content
stringlengths
1
15.9M
\section{Introduction}\label{intro} The inflationary scenario according to which an early exponential expansion of the Universe takes place, offers a compelling explanation for the initial conditions of a hot Big Bang (for reviews see \cite{Olive:1989nu, Lyth:1998xn,Martin:2013tda}). This inflationary description of the early phases of the Universe can be viewed as the effect of the dynamics of a scalar field called inflaton. At the same time, observations based on the Cosmic Microwave Background Radiation (CMBR) offer increasingly precise constraints to test the inflationary paradigm, as well as the theory of gravity that operates at very high densities. Moreover, there has been a significant effort regarding the formation of primordial black holes, during a super slow-roll phase during the inflationary period, which could in fact be a viable Dark Matter candidate (see \cite{Khlopov:2008myu,Chongchitnan:2006wx,Chen:2019zza, Garcia-Bellido:2017mdw,Cai:2018tuh,Ballesteros:2018wlw,Germani:2018jgr, Fu:2019ttf,Lu:2019sti,Dalianis:2018ymb,Yi:2020cut,Yi:2020kmq,Pi:2017}). Hence, the physics surrounding inflation is of particular significance to various aspects of our understanding of the Universe, and as such early universe cosmology provides the grounds to test and choose between a significant number of inflationary models. To identify a viable one, one should study the dynamics of the full system of the inflaton field and gravity. In an attempt to describe the early cosmological evolution according to recent observational results, gravity theories that are based on modifications of Einstein Gravity were proposed. Two of the most common ways to modify the standard Theory of Relativity, are introducing higher order curvature terms, and/or including scalar fields that are nonminimally coupled to gravity. Higher-order corrections to the Einstein-Hilbert action arise naturally in the gravitational effective action of String Theory \cite{Gross:1986mw}. On the other hand, introducing extra scalar fields, which are non-minimally coupled to gravity, is a thoroughly studied way to modify the standard theory of General Relativity (GR) and results to what is known as scalar-tensor theory \cite{Fujii:2003pa}. A particularly well-studied scalar-tensor theory is the one obtained through the Horndeski Lagrangian \cite{Horndeski:1974wa}. These theories yield field equations of second order and hence they do not produce ghost instabilities \cite{Ostrogradsky:1850fid}. Moreover, many scalar-tensor theories share a classical Galilean symmetry \cite{Nicolis:2008in,Deffayet:2009wt,Deffayet:2009mn,Deffayet:2011gsz, Kobayashi:2011nu,Harko:2016xip,Kamada:2010qe,Saridakis:2021lqd}. One simple subclass of Horndeski theories is obtained with the use of a scalar field coupled to the Ricci scalar, which is known as Non-Minimal Coupling (NMC). Such a construction goes beyond the simple case of GR plus a scalar field and thus it can improve the inflationary behavior. In particular, by taking a NMC of the form $\xi \phi^2$, if the scale $\xi$ is large enough the resulting inflationary phase is long enough \cite{Salopek:1989,Fakir:1990,Kaiser:1994,Komatsu:1999,Nozari:2008,Ren:2014}. In fact, it was shown that a rather well-behaved phenomenology is obtained, since the tensor to scalar ratio is particularly low, and easily inside the Planck 2018 observational limits. Additionally, there have also been other works that have utilized a different NMC \cite{Park:2008} or a matrix configuration for the inflaton field \cite{Ashoorioon:2019}. However, although NMC models with large coupling values are very efficient in producing improved inflationary phenomenology, large coupling constants lead to problems related to the unitarity of this theory, and thus are not desirable from a quantum mechanical perspective \cite{Bezrukov:2007,Barvinsky:2008,Bezrukov:2008,Bellido:2008,Simone:2008, Bezrukov:2008b,Burgess:2009,Barbon:2009, Bezrukov:2009,Barvinsky:2009,Clark:2009, Barvinsky:2009b, Einhorn:2009,Lerner:2009b,Burgess:2010,Mazumdar:2010, Geng:2017mic,Fumagalli:2016}, if one is to have a single field model. A different picture is obtained when multi field theories are studied, and it has been argued \cite{Hertzberg:2010, Giudice:2010} that in such theories these problems do not exist. Moreover, other attempts without unitarity issues have been made in a similar context, utilizing a Palatini formulation of gravity \cite{Tenkanen:2017,McDonald:2020,Tenkanen:2020}, or by taking into account additional interactions \cite{Lerner:2010b,Lola:2020lvk}. On the other hand, in Horndeski theory one of the most well-studied terms is the one corresponding to the non-minimal derivative coupling (NMDC) of the scalar field to the Einstein tensor. This term has interesting implications both on small and large scales for black hole physics \cite{Kolyvaris:2011fk, Rinaldi:2012vy, Kolyvaris:2013zfa, Babichev:2013cya, Cisterna:2014nua, Charmousis:2014zaa, Koutsoumbas:2015ekk, Anabalon:2013, Cisterna:2015, Cisterna:2016}, for dark energy \cite{Saridakis:2010mf, Dent:2013awa} and for inflation \cite{Amendola:1993uh,Sheikhahmadi:2016wyz} respectively. For a recent review, see \cite{Papantonopoulos:2019eff}. Concerning inflation, the main advantage of NMDC is that it is free from unitarity problems, and this led to the established model of new Higgs inflation \cite{Germani:2015plv}. As it has been shown, the non-minimal derivative coupling acts as a friction mechanism, and therefore from an inflationary model-building point of view it allows for the implementation of a slow-roll phase \cite{Amendola:1993uh,Sushkov:2009hk}, as well as for inflation with potentials such as the Standard-Model Higgs to be realized \cite{Germani:2010gm}. In light of the above, it becomes a very attractive term within the framework of Horndeski theory. Moreover, such models are consistently described within supergravity \cite{Farakos:2012je, Farakos:2013zya} via the gauge kinematic function \cite{Dalianis:2014sqa}. An extensive study of the NMDC predictions is performed in \cite{Dalianis:2016wpu}, where the dynamics of both the inflationary slow-roll phase and the reheating phase were considered. In particular, the NMDC oscillations of the inflaton are very rapid and remain undamped for a very lengthy period \cite{Sadjadi:2012zp, Ghalee:2013ada, Yang:2015pga, Gumjudpai:2015vio, Yi:2016jqr, Gialamas:2020vto, Myung:2016twf, Ema:2015oaa, Ema:2016hlw}, affecting heavy particle production \cite{Koutsoumbas:2013boa}. However, such oscillations, where the NMDC remains dominant over the standard GR term, are problematic in terms of stability of the post-inflationary system. This is due to the oscillations of the sound-speed squared between positive and negative values \cite{Ema:2015oaa}, implying that scalar fluctuations are exponentially enhanced. To avoid this instability, the non-minimal kinetic term must cease to be the dominant (or even co-leading) term, when compared to the canonical kinetic term. However, if this condition is to be met, the model effectively reduces to that of a canonical scalar field in GR even during the slow-roll period, and the advantages of the NMDC are lost. Nevertheless, one can generalize the NMDC term, since it is a special case of the Horndeski Lagrangian density, and consider Lagrangians of the form \cite{Deffayet:2011gsz,Kobayashi:2011nu,Harko:2016xip} \begin{align} \label{lagran} {\cal L}_5=G_5(\phi, X) G^{\mu\nu}\partial_\mu \partial_\nu \phi \,~, \end{align} where $X=-\partial_\mu \phi \partial^\mu \phi /2$. If the function $G_5(\phi, X)$ is chosen to be, $G_5(\phi, X)=-\phi/(2M^2)$, one gets the simplest NMDC possible, since after integration by parts the derivative coupling becomes constant. This however leads to the problematic post-inflationary evolution. Instead, in \cite{Dalianis:2019vit} it was shown that if one chooses a more general function $G_5(\phi, X)=G(\phi)\, \xi(X)$, the phenomenology of the Horndeski terms becomes richer, both during inflation and reheating stages. In the case where $G(\phi)\propto \phi$ this Generalized NMDC term (GNMDC) essentially vanishes when the inflaton field approaches the minimum of the potential. Thus, the system, after a few oscillations, transits to the dynamics of a canonical kinetic term in GR, leading to a more manageable and reliable behavior, dominated by GR dynamics during the reheating stage. In fact it was shown that with this kind of term the inflationary phenomenology generated in a Higgs potential was in very good agreement with observations. Furthermore, the tight bounds on the speed of Gravitational Waves (GWs) extracted by recent observations \cite{Abbott:2016blz,Abbott:2016nmj,Baker:2017hug} and from the solar system constraints \cite{Gonzalez:2020vzl}, were dismissive of the NMDC \cite{Ezquiaga:2017ekz,Gong:2017kim}, since an NMDC term playing the role of dark energy can produce superluminal tensor perturbations \cite{Germani:2010gm,Germani:2011ua} in Friedmann-Lemaitre-Robertson-Walker cosmological backgrounds and also. A GNMDC of the form $G(\phi)\propto \phi$ however can heal this problem, since after the end of slow roll inflation it has essentially decoupled from the dynamics of the system since it becomes negligible. However, it was also shown that the sound speed square was not completely healed of the oscillations between positive and negative values, albeit this problem was significantly ameliorated. One then, would have to seek for further modifications that could entirely heal the theories that are modified with non-canonical kinetic terms of this form, from the sound-speed related instabilities, and possibly even further improve the observables of inflation. The motivation of this work is based on the above discussion, according to which neither the NMC nor NMDC scenarios are completely free of disadvantages and problems when a desirable phenomenology is achieved. Hence, we are interested in investigating a simple combination of the NMC and GNMDC terms, that can alleviate the problems of both of these standardized modifications. In particular, the GNMDC's gravitational friction effect allows for the $\xi$ and $\phi_*$ to be lowered enough to not violate unitarity, while the late time domination of the NMC term ensures that no sound-speed related instabilities occur. Moreover, a lowering of the tensor-to-scalar ratio of this combined theory is obtained as compared to the GNMDC case and a desirable theory is achieved. This manuscript is organized as follows. In Section \ref{standalones} we briefly analyze some basic results of each of the NMC and GNMDC terms as standalone modifications of GR. In Section \ref{combined}, we present the combined scenario of inflation in the presence of the NMC and GNMDC terms. Then in Section \ref{specificstandalones} we proceed to a detailed numerical investigation in a Higgs potential for a variety of interesting cases, with the purpose of demonstrating the general results obtained in Section \ref{combined}, thus clearly showing the advantages of this scenario. Finally, in Section \ref{conclusions} we summarize our results. \section{Nonminimal coupling and generalized nonminimal derivative coupling as standalone modifications }\label{standalones} In this Section we present a short synopsis of inflationary models resulting from general relativity plus nonminimal coupling (GR+NMC) and from general relativity plus generalized nonminimal derivative coupling (GR+GNMDC), which have been studied extensively in the literature. In studying inflationary models it is of great importance to perturbatively study the effects of inflation, since every inflationary model provides a rich phenomenology related to scalar and tensorial perturbations. This phenomenology sets the observational testing grounds for all inflationary models. Specifically, in order to test their viability, one needs to compare the predictions of a variety of quantities with their corresponding observed values, mainly obtained through CMBR. These observable quantities, include the power spectrum of the scalar perturbations, $\mathcal{P_R}$, the scalar spectral index (tilt) $n_s$, and the tensor-to-scalar ratio $r$, while a specific amount of e-folds is also required in order for the horizon and flatness problems to be efficiently solved. In Appendix \ref{perturbations} we include a short review of the usual steps taken in this direction. A full analysis of single-field perturbations (without soft-properties considerations \cite{Saridakis:2021qxb}) has been performed in a number of works, e.g. in \cite{Ema:2015oaa,Tsujikawa:2012mk,Kobayashi:2019} . \subsection{Inflation with nonminimal coupling} The action of this modification to GR is written in the form \begin{align}\label{NMCaction} S=\int d^4x \sqrt{-g} \left[ f(\phi) R-\frac{\partial_\mu \phi \partial^\mu \phi}{2}-V(\phi)\right], \end{align} and the most studied coupling of this form in the literature is $f(\phi)=\xi \phi^2$. Nonminimal coupling (NMC) as a standalone modification to GR, when taking the form $f(\phi)=\xi \phi^2$ in a Higgs potential, has been shown to produce remarkably low tensor-to-scalar ratio values. Additionally, it has no post-inflationary instability issues, since $c_s^2$ can be shown to be identically equal to 1, regardless of the form of the NMC. Nevertheless, it was shown that it does not preserve unitarity and thus it is problematic from a quantum-mechanical point of view, since the combination $\xi \phi^2$ takes values larger than $M_{Pl}$ in order to yield a long enough inflation \cite{Bezrukov:2007,Barvinsky:2008,Bezrukov:2008,Bellido:2008,Simone:2008, Bezrukov:2008b,Burgess:2009,Barbon:2009, Bezrukov:2009,Barvinsky:2009,Clark:2009, Barvinsky:2009b, Einhorn:2009,Lerner:2009b,Burgess:2010,Mazumdar:2010, Geng:2017mic}. We consider a homogeneous and isotropic flat Friedmann-Robertson-Walker (FRW) geometry with metric \begin{equation} \label{FRWmetric} ds^{2}=-dt^{2}+a^{2}(t)\delta_{ij}dx^{i}dx^{j}\,, \end{equation} where $a(t)$ is the scale factor. The Friedmann equations of this scenario are \begin{align}\label{Fried00NMC} 3M_{Pl}^2 H^2=V(\phi)+\frac{\dot{\phi}^2}{2}-6\xi \left[f(\phi) H^2+f'(\phi) \dot{\phi} H\right], \end{align} \begin{align} \label{Fried11NMC} M_{Pl}^2 ( 2 \dot{H}+3 H^2)= -\xi \left[2 \dot{\phi}^2 f''(\phi)+4 H \dot{\phi} f'(\phi)+2 \ddot{\phi} f'(\phi) \right. \nonumber \\ +4 \left.f(\phi) \dot{H}+6 H^2 f(\phi)\right]-\frac{\dot{\phi}^2}{2}+V(\phi), \end{align} and the scalar-field equation of motion reads as: \begin{align}\label{KGinNMC} \ddot{\phi}+3 H \dot{\phi}- 6 \xi f'(\phi) \left(\dot{H}+2 H^2\right)+V'(\phi)=0~. \end{align} However, in order to calculate the inflationary observables, the convenient approach is to perform a conformal transformation, thus passing to the Einstein frame. By choosing $ \hat{g}_{\mu\nu}=\Omega^2(x) g_{\mu\nu}$, with \[ \Omega^2(x)=\frac{16\pi}{M_{Pl}^2} f(\phi)~, \] and defining a new scalar field $\varphi$ and potential $U$ such that \[ \frac{d\varphi}{d\phi}\equiv \sqrt{\frac{M_{Pl}^2}{8\pi}\frac{f(\phi)+3f'^2(\phi)}{2f^2(\phi)}}~, \] \[ U(\varphi)\equiv \Omega^{-4} V(\phi)~, \] then the action is brought to the Einstein-frame equivalent form \begin{align} S=\int d^4x\sqrt{-\hat{g}}\left[\frac{M_{Pl}^2}{2}\hat{R}-\frac{\partial_\mu \varphi \partial^\mu \varphi}{2}-U(\varphi) \right]~, \end{align} where the quantities in the Einstein frame are denoted with a hat. It has been shown that to first order one can write the spectral index and tensor-to-scalar ratio as \cite{Martin:2013tda} \begin{align} 1-n_s=6 \epsilon_U-2\delta_U~, \end{align} \begin{align} r=16\epsilon_U~, \end{align} where we have defined the slow-roll parameters \begin{eqnarray} &&\epsilon_U =\frac{M_{Pl}^2}{2}\left(\frac{U'}{U}\right)~,\\ && \delta_U=M_{Pl}^2\frac{U''}{U}~. \end{eqnarray} Moreover, it can be easily shown that for an arbitrary coupling $f(\phi)$ the $c_s^2$ of the GR+NMC scenario is identically equal to 1, by simple replacement of the above equations into equation \eqref{sspddef}. We mention here that in the Einstein frame the potential $U$ is essentially flat for large values of the NMC term ($\xi \phi^2 \gg M_{Pl}$), hence the field rolls very slowly and the slow-roll parameters $\epsilon_U$ and $\delta_U$ are very small, yielding a correspondingly small $r$. This last conclusion is what entails one of the basic results of single field, NMC, Higgs inflation with the coupling form $f(\phi)=\phi^2$. Nevertheless, as we mentioned above, these particularly attractive features of a very low $r$ and a long inflation, come at the cost of $\xi \phi^2 > M_{Pl}$, leading to non-unitarity. In order to solve this problem one should consider other couplings of the scalar field to gravity, as the one described in the next subsection. \subsection{Inflation with nonminimal derivative coupling} We now turn to the scenario according to which the generalized nonminimal derivative coupling is a stand-alone modification to GR. As we discussed in the Introduction in the general framework of Horndeski theories nonminimal derivative coupling (NMDC) holds a particular position, due to its attractive feature of ``gravitational friction'', i.e. the phenomenon according to which a single inflaton field, when rolling down a potential, stays in ``slow roll'' for a significantly lengthier period compared to GR. This results to an easier realization of inflation and a richer phenomenology, studied extensively in the literature \cite{Germani:2010gm,Sadjadi:2012zp, Ghalee:2013ada, Gumjudpai:2015vio,Gialamas:2020vto, Myung:2016twf, Ema:2015oaa, Ema:2016hlw, Fumagalli:2017}. However, among other effects it has been argued that a standalone NMDC modification to GR creates post-inflationary instabilities, due to the fact that the NMDC term remains dominant after the slow-roll period and this may lead to $c_s^2<0$. As a result, a further intuitive modification, dubbed generalized nonminimal derivative coupling (GNMDC) was proposed in \cite{Harko:2016xip,Dalianis:2019vit}, where it was shown that when the derivative coupling with the Einstein tensor is of the form $G(\phi)\partial_\mu\phi \partial_\nu\phi G^{\mu\nu}$, then this problem is significantly ameliorated. In particular, the action of this modification to GR can be written in the form \begin{align}\label{GNMDCaction} S=\int d^4x \sqrt{-g} \left[\frac{M_{Pl}^2}{2} R+G_5(\phi, X) G^{\mu\nu}\partial_\mu \partial_\nu \phi -V(\phi)\right]~, \end{align} where $G^{\mu\nu}$ is the Einstein tensor. Hence, by considering only a $\phi$-dependence of the $G_5$ function, the Friedmann equations of this scenario are \cite{Harko:2016xip,Dalianis:2019vit} \begin{align}\label{Fried00GNMDC} && 3 M_{Pl}^2 H^2=9 H^2 G(\phi) \dot{\phi}^2+\frac{1}{2} \dot{\phi}^2+V(\phi)~, \end{align} \begin{align} \label{Fried11GNMDC} M_{Pl}^2 ( 2 \dot{H}+3 H^2)&=V(\phi)-\frac{\dot{\phi}^2}{2} +2 H \dot{\phi}^3 G'(\phi)\nonumber \\ &+G(\phi) \left(2 \dot{H} \dot{\phi}^2+3 H^2 \dot{\phi}^2+4 H \dot{\phi} \ddot{\phi}\right)~, \end{align} while the scalar-field equation of motion reads as \begin{align}\label{KGinGNMDC} \ddot{\phi}&+V'(\phi)+3 H \dot{\phi}+3 H^2 \dot{\phi}^2 G'(\phi)\nonumber \\ &+G(\phi) \left(12 H H' \dot{\phi}+6 H^2 \ddot{\phi}+18 H^3 \dot{\phi}\right)=0~. \end{align} Note that the function $G(\phi)$ results from $G_5$, after integrating by parts, namely $G(\phi)=-G'_5(\phi)$. In the class of models that include a non-canonical kinetic term, the gravitational friction effect offers the ground for very efficient inflationary predictions, since the slow-roll conditions can be easily satisfied. In particular, in order to investigate inflation in the slow-roll approximation we define the slow-roll parameters \begin{equation} \begin{aligned}[t] \epsilon =-\frac{\dot{H}}{H^2}~, \end{aligned} \qquad \begin{aligned}[t] \delta = \frac{\ddot{\phi}}{H\dot{\phi}}~, \end{aligned} \end{equation} \begin{equation} \begin{aligned}[t] \epsilon_V =\frac{M_{Pl}^2}{2}\left(\frac{V'}{V}\right)^2~, \end{aligned} \qquad \begin{aligned}[t] \eta_V \equiv \frac{M_{Pl}^2}{2}\frac{V''}{V}~. \end{aligned} \end{equation} The slow-roll approximation holds when $\epsilon \ll 1$ and $\delta \ll 1$, and thus $\dot{H} \ll H^2$ and $\ddot{\phi}\ll 3H\dot{\phi}$, and in this case the Friedmann equations \eqref{Fried00GNMDC}, \eqref{KGinGNMDC} are simplified to \begin{align} \label{fried00inGRNMDCSRA} 3 M_{Pl}^2 H^2\approx V(\phi)~, \end{align} \begin{align} \label{KGinGRNMDCSRA} 3H\dot{\phi} \left[1 +6G(\phi)H^2+G'(\phi) H \dot{\phi} \right] +V'(\phi) \approx 0~. \end{align} Hence, under the slow-roll approximations, the first slow-roll parameter, $\epsilon$, can then be written in the form \begin{align} \label{epsilonbroken} \epsilon \approx \epsilon_\text{GR}+\epsilon_D+\epsilon_{\cal{B}}~, \end{align} where \begin{equation} \begin{aligned}[t] \epsilon_D\equiv \frac{3G(\phi) \dot{\phi}^2}{M_{Pl}^2}~, \end{aligned} \qquad \begin{aligned}[t] \epsilon_{\cal B}\equiv \frac{\dot{\phi}^2}{ M_{Pl}^2 H^2} G'(\phi) H \dot{\phi}~, \end{aligned} \end{equation} These two functions correspond to $\epsilon_{G1}$ and $\epsilon_{G4}$ of equation \eqref{auxilepsilons} that we will later use. Moreover, \begin{align} \epsilon_\text{GR}\equiv \frac{ \dot{\phi}^2}{2 M_{Pl}^2 H^2}~, \end{align} where the quantity $\epsilon_\text{GR}$ corresponds to the result of the GR case, while $\epsilon_D$ is the leading term during slow-roll. The GNMDC term has the effect of decreasing the $\epsilon$ parameter and hence increases the slow-roll period. In fact, in the slow-roll approximation, equation \eqref{epsilonbroken} can be brought to the form \begin{align} \label{epsilonwithcal} \epsilon=\epsilon_V \frac{\mathcal{A}- 2\mathcal{B}}{\left(\mathcal{A}+\mathcal{B}\right)^2}~, \end{align} with ${\cal A } \equiv1+6H^2 G(\phi)$ and $ {\cal B} \equiv G'(\phi)H\dot{\phi}$. Additionally, the squared sound speed of the scalar perturbations is found to be \cite{Dalianis:2019vit} \begin{align}\label{cssqGRNMDC} c_s^2= &\left[1-\frac{\epsilon_D}{3} +6H^2 G(\phi) (1+\epsilon_D) \right]^{-1}\cdot \nonumber \\ \cdot&\Bigl\{1+\epsilon_D +6H^2 G(\phi)\left[ 1+ \epsilon_D+\frac{4 \epsilon_D(1-\epsilon_D)}{3(3-\epsilon_D)} \right] \Bigr.\nonumber \\ &\Bigl.\text{ } +12{\dot{H}} G(\phi) \left({1-\frac{\epsilon_D}{3}}\right) \Bigr\}~. \end{align} Furthermore, we can approximate the number of e-folds as \cite{Dalianis:2019vit} \begin{align} N \approx \frac{1}{M_{Pl}} \int_{\phi_{end}}^{\phi} \frac{\mathcal{A}+\mathcal{B}}{\sqrt{2\epsilon_V}} d\phi~. \end{align} As one can see, for $G(\phi)\rightarrow 0$ all the above expressions restore the canonical case. Finally, concerning the inflationary observables, the scalar power spectrum can be brought to the form \cite{Dalianis:2019vit} \begin{align} \label{PsinGRNMDC} \mathcal{P}_\mathcal{R}=\frac{H^2}{8 \pi^2 M_{Pl}^2 \epsilon_V} \left[\mathcal{A} + \mathcal{B} +\mathcal{O}\left(\frac{\mathcal{B}^2}{\mathcal{A}}\right) \right]~, \end{align} the scalar spectral index becomes \begin{align}\label{nsinGRNMDC} 1-n_s\approx 8\epsilon-2\eta+\epsilon M_{Pl} \frac{G'(\phi)}{G(\phi)}\sqrt{\frac{2}{\epsilon_V}}~, \end{align} with $\eta\equiv \frac{\eta_V}{\mathcal{A}}$, whilst the tensor-to-scalar ratio is written as \begin{align}\label{rinGRNMDC} r=16\frac{\epsilon_V}{\mathcal{A}+\mathcal{B}}~. \end{align} Let us now consider a specific model of GNMDC. In particular, we will focus on the case \begin{align}\label{Fphiform} G(\phi)=\frac{\alpha \phi^{\alpha-1}}{2M^{\alpha+1}}, \end{align} which recovers the simple NMDC for $\alpha=1$ (see \cite{Dalianis:2019vit} for the different case of $G(\phi)=\frac{e^{\tau\phi/M_{Pl}}}{M^2}$). Within the framework of this particular modification, it can be shown that as $\alpha$ becomes larger then the post-inflationary instabilities related to $c_s^2<0$ become significantly shorter as compared to the simple NMDC $(\alpha=1)$. This effect results from the fact that near the bottom of the potential the GNMDC term is not dominant and GR takes over, which in turn results from the fact that the more the $\alpha$ parameter grows the more dominant becomes the gravitational friction effect and this allows the scale of the theory $\frac{1}{M^{\alpha+1}}$ (needed to produce a long enough inflation) to decrease significantly. Concerning the observables, it can be shown that, for a given value of the scalar power spectrum $\mathcal{P}_{\mathcal{R}}$, while a growing $\alpha$ parameter ameliorates the instability problem, it additionally affects the values of the spectral index $n_s$ and the tensor-to-scalar ratio. In particular, while $r$ becomes smaller, $n_s$ increases and tends to the outside of the observationally determined Planck likelihood contours, if one seeks to build a 60 e-fold model \cite{Dalianis:2019vit}. Similar results can be obtained if one uses as $G(\phi)$ a polynomial instead of a monomial form, namely $G(\phi)=\sum_{i}\frac{\alpha_i \phi^{\alpha_i-1}}{2M_i^{\alpha_i+1}}$. In order for a coupling of such a form to produce a different phenomenology than the one studied in the monomial case, its various terms must be of comparable magnitude. If this is not the case, then the leading monomial term determines the phenomenology. Finding the scales, $M_i$, so that different terms are comparable is a non-trivial task. In \cite{Dalianis:2019vit}, a constraint between the scale $M$, the parameter $\alpha$ and the initial values $\phi_*,\dot{\phi}_*$ was found (similar to Eq. \eqref{Consinfull} below). This constraint creates a part of the phase space that is forbidden, which proves problematic when one seeks to build a model with an even value of $\alpha$. This issue is carried over in the polynomial GNMDC case, if a term that corresponds to an even value of $\alpha$ becomes important, posing yet another problem for the polynomial case. However, this is significantly ameliorated in the combined theory proposed in this paper (when the NMC term is turned on in Eq. \eqref{Consinfull}), as we discuss later. In summary, if one has a polynomial form of $G(\phi)$ or obtains such a polynomial form through quantum corrections \cite{Fumagalli:2020}, the non-leading terms will either make an insignificant contribution in phenomenology, or in order to affect it they have to be fine tuned in terms of $\alpha$ and $M_i$. \section{Nonminimal coupling and generalized nonminimal derivative coupling combined} \label{combined} In the previous Section we presented the inflationary realization of each of the standalone modifications to GR, namely of the nonminimal coupling (NMC) and of the generalized nonminimal derivative coupling (GNMDC). As we mentioned, the NMC can lead to observables in very good agreement with observations, however it possesses the known unitarity problem, while the $\alpha=1$ GNMDC solves the unitarity violation but it leads to $c_s^2$-instabilities, while the $\alpha>1$ GNMDC solves the unitarity, but only ameliorates the $c_s^2$ issues while making the observable predictions less attractive, in terms of the spectral index. Keeping the above behaviors in mind, in this section we construct the combination of the scenarios of NMC and GNMDC, intending to maintain their separate advantages while removing their separate disadvantages. \subsection{The model} We considered the combined action of the form \begin{align}\label{NMCGNMDCaction} S=\int d^4x \sqrt{-g} \left[\mathcal{L}_{GR}+\mathcal{L}_{\phi}+\mathcal{L}_{NMC} +\mathcal{L}_{GNMDC}\right], \end{align} with \begin{eqnarray}\label{lagrangianparts} &&\mathcal{L}_{GR}=\frac{M_{Pl}^2}{2} R~, \nonumber\\ && \mathcal{L}_{\phi}=-\frac{1}{2} g^{\mu\nu}\partial_\mu \phi \partial_\nu \phi -V(\phi)~, \nonumber\\ && \mathcal{L}_{NMC}=\xi f(\phi) R~, \nonumber\\ && \mathcal{L}_{GNMDC}=G(\phi) G^{\mu\nu}\partial_\mu \phi \partial_\nu \phi~. \end{eqnarray} Variation in terms of the metric gives rise to the field equations as \begin{align}\label{fullfeq} G_{\mu\nu}&=\frac{1}{M_{Pl}^2}\left[T_{\mu\nu}^{(\phi)}+\xi T_{\mu\nu}^{(NMC)}-2 G(\phi) T_{\mu\nu}^{(NMDC 1)}\right.\nonumber \\ &\left.\ \ \ \ \ \ \ \ \ \ \ \ -G'(\phi) T_{\mu\nu}^{(NMDC 2)}\right]~, \end{align} while variation in terms of the scalar field leads to the Klein-Gordon equation \begin{align}\label{fullKG} \Box\phi&-G_{\mu\nu}\left[ 2 G(\phi) \nabla^\mu \nabla^\nu \phi+G'(\phi) \nabla^\mu \phi \nabla^\nu \phi \right]\nonumber \\ & +\xi f'(\phi) R-V'(\phi)=0~, \end{align} where \begin{align}\label{fullfeqparts} T_{\mu\nu}^{(\phi)}= \nabla_\mu \phi\nabla_\nu \phi-\frac{1}{2}g_{\mu\nu}\nabla_\lambda \phi \nabla^\lambda \phi-g_{\mu\nu} V(\phi)~, \end{align} \begin{align} T_{\mu\nu}^{(NMC)} &=-2 f(\phi) \left[R_{\mu\nu}-\frac{1}{2}g_{\mu\nu}R\right]\nonumber\\ &-2 f'(\phi)\left[g_{\mu\nu}\Box\phi-\nabla_\mu \nabla_\nu \phi\right]\nonumber\\ & -2 f''(\phi)\left[g_{\mu\nu}\nabla_\lambda \phi \nabla^\lambda \phi-\nabla_\mu\phi \nabla_\nu \phi\right]~, \end{align} \begin{align} &T_{\mu\nu}^{(NMDC 1)} = -G_{\mu\nu}\nabla_\lambda\phi \nabla^\lambda\phi+4 R^{\lambda}_{\text{ }\text{ }(\mu}\nabla_{\nu)}\phi\nabla_\lambda\phi \nonumber\\ & +2 [\nabla^\kappa\phi \nabla^\lambda\phi R_{\mu\kappa\nu\lambda} +\nabla_\mu\nabla^\lambda\phi\nabla_\nu\nabla_\lambda\phi-\nabla_\nu\nabla_\mu \phi\nabla^2\phi]\nonumber \\ &+g_{\mu\nu}[ \nabla^2\phi\nabla^2\phi-\nabla_\kappa\nabla_\lambda\phi\nabla^\kappa \nabla^\lambda\phi-2 R_{\kappa\lambda}\nabla^\kappa\phi\nabla^\lambda\phi]\nonumber \\ &-\nabla_\mu\phi\nabla_\nu\phi R~, \end{align} \begin{align} T_{\mu\nu}^{(NMDC 2)} &= g_{\mu\nu}(\nabla_\lambda\phi\nabla^\lambda\phi \nabla^2\phi-\nabla^\kappa\phi\nabla^\lambda\phi\nabla_\kappa\nabla_\lambda\phi) \nonumber\\ & +2\nabla^\lambda\phi\nabla_{(\mu}\phi\nabla_{\nu)}\nabla_\lambda\phi -\nabla_\lambda\phi\nabla^\lambda\phi\nabla_\nu\nabla_\mu\phi\nonumber\\ & -\nabla_\mu\phi \nabla_\nu\phi\nabla^2\phi~, \end{align} with the indices in parentheses denoting symmetrization. As expected, for $G(\phi)\rightarrow 0$ we recover the GR+NMC case, while for $f(\phi)\rightarrow 0$ we re-obtain the GR+GNMDC case. Applying the above general field equations in the FRW metric (\ref{FRWmetric}) we extract the two Friedmann equations as \begin{align}\label{fried00full} \rho_\phi\equiv 3 M_{Pl}^2 H^2&=\frac{\dot{\phi}^2}{2}+V(\phi)+9 G(\phi) H^2 \dot{\phi}^2\nonumber \\ &-6 \xi \left[f(\phi) H^2+f'(\phi) \dot{\phi} H\right], \end{align} \begin{align}\label{fried11full} -p_\phi &\equiv M_{Pl}^2 \left(3 H^2+2 \dot{H}\right)=V(\phi)-\frac{\dot{\phi}^2}{2}+\nonumber \\ &+G(\phi)\left(3H^2 \dot{\phi}^2+2\dot{H}\dot{\phi}^2+4 H \dot{\phi}\ddot{\phi}\right)+2G'(\phi) H \dot{\phi}^3\nonumber \\ &-2 \xi \left[ 3 f(\phi) H^2+2 f(\phi)\dot{H}+2 H f'(\phi)\dot{\phi}+\dot{\phi}^2f''(\phi) \right.\nonumber \\ &\left.+f'(\phi)\ddot{\phi}\right], \end{align} where for convenience we have introduced the effective energy density $\rho_\phi$ and pressure $p_\phi$ for the scalar field. Additionally, the Klein-Gordon equation (\ref{fullKG}) becomes \begin{align}\label{KGfull} \ddot{\phi} &\left(1+6 G(\phi) H^2 \right)+3 H \dot{\phi} (1+6 G(\phi) H^2+4 G(\phi)\dot{H})\nonumber \\ &+3 H^2 G'(\phi)\dot{\phi}^2-6 \xi f'(\phi) (\dot{H}+2H^2)+V'(\phi)=0~. \end{align} We mention that combining the above equations, one deduces that in order for the scalar field to obtain real values then the quantity \begin{align}\label{Consinfull} {\cal{Q}}&\equiv 6 \xi ^2 \dot{\phi}^2 f'(\phi)^2+\xi \left(2 f(\phi) \dot{\phi}^2+4 f(\phi) V(\phi)\right)\nonumber \\ &+G(\phi) \left(-3 \dot{\phi}^4-6 \dot{\phi}^2 V(\phi)\right)+M_{Pl}^2 \dot{\phi}^2+2 M_{Pl}^2 V(\phi)~, \end{align} must be positive. \subsection{Slow Roll Inflation and the three regimes} From a theoretical perspective, if one investigates a theory that combines two different terms, it is expected that there will be three different regimes, that one would need to study, depending on their relative magnitude: one where the GNMDC is dominating and NMC is a small correction, one that NMC dominates and GNMDC acts as a small correction, and finally a regime where the two terms are roughly of the same order. Before discussing each one individually, and in order to facilitate the following discussion, we first provide the general slow-roll framework of this theory. In the slow-roll approximation, namely when $\dot{H} \ll H^2$, $\dot{\phi} \ll H$, and $\ddot{\phi}\ll 3H\dot{\phi}$, and keeping the leading terms of GNMDC and NMC, the first Friedmann equation (\ref{fried00full}) becomes \begin{align} \label{F00fullSRA} 3 M_{Pl}^2 H^2=9 G(\phi) H^2 \dot{\phi}^2-6 \xi f(\phi) H^2+V(\phi)~, \end{align} while the Klein-Gordon equation (\ref{KGfull}) is simplified as \begin{align} \label{KGfullSRA} 3H\dot{\phi} \left( 1+6G(\phi) H^2\right)-12H^2 \xi f'(\phi)+V'(\phi)=0~. \end{align} Note that regarding $f'(\phi)$ and $f(\phi)$, since we focus in monomial $f(\phi)$ forms which give $f'(\phi)>f(\phi)$ in the small field scenarios ($\phi<M_{Pl}$), we deduce that the difference is less important than that between $\dot{\phi}$ and $H$ due to the slow-roll, and hence we keep only the $f(\phi)H^2$ term. This approximation will be a posteriori shown to hold in the numerical analysis of the next section, see Fig. \ref{fig:fulltheorycompare4}. Using equations \eqref{fried00full} and \eqref{fried11full} we can obtain the exact form of the slow-roll parameter $\epsilon=-\frac{\dot{H}}{H^2}$ as \begin{align}\label{epsilonanalytic} \epsilon=\epsilon_{GR}&+\epsilon_{G1}+\epsilon_{G2}+\epsilon_{G3}+\epsilon_{G4}\nonumber \\ &+\epsilon_{N1}+\epsilon_{N2}+\epsilon_{N3}+\epsilon_{N4}~, \end{align} where we have introduced the following auxiliary parameters \begin{align*} \epsilon_{GR} = \frac{\dot{\phi}^2}{2 M_{Pl}^2 H^2}~, \end{align*} \begin{eqnarray} && \epsilon_{G1} = \frac{3 \dot{\phi}^2 G(\phi)}{M_{Pl}^2}~, \quad \epsilon_{G2} = -\frac{\dot{\phi}^2 \dot{H} G(\phi)}{M_{Pl}^2 H^2}~, \nonumber \\ && \epsilon_{G3} = -\frac{2\dot{\phi} \ddot{\phi} G(\phi)}{M_{Pl}^2 H}~, \quad \epsilon_{G4} = -\frac{G'(\phi)\dot{\phi}^3}{M_{Pl}^2 H}~, \nonumber \\ && \epsilon_{N1} = \frac{2\xi f(\phi) \dot{H}}{M_{Pl}^2 H^2}~, \quad \epsilon_{N2} = -\frac{\xi f'(\phi) \dot{\phi}}{M_{Pl}^2 H}~, \nonumber\\ && \epsilon_{N3} = \frac{\dot{\phi}^2 \xi f''(\phi)}{M_{Pl}^2 H^2}~, \quad \epsilon_{N4} = \frac{\xi f'(\phi) \ddot{\phi}}{M_{Pl}^2 H^2}~. \label{auxilepsilons} \end{eqnarray} These separate parameters will be useful in order to quantify which specific term of the theory dominates the inflationary realization, and in particular the $\epsilon_{Gi}$ are related to the GNMDC while the $\epsilon_{Ni}$ are related to the NMC ($i$ runs from 1 to 4), while $\epsilon_{GR} $ is the usual slow-roll parameter of minimally coupled, single-field inflation. From our previous discussion it becomes clear that in the slow-roll era the only important terms should be $\epsilon_{G1}$, $\epsilon_{N1}$ and $\epsilon_{N2}$. We can now move on to calculate the various perturbative functions, as functions of the auxiliary parameters defined above. Using the definitions in Appendix \ref{perturbations} we find \begin{align} &\mathcal{G}_T=M_{Pl}^2\left(1-\frac{\epsilon_{G1}}{3}-\frac{\epsilon_{N1}}{\epsilon} \right)~. \\ &\mathcal{F}_T=M_{Pl}^2\left(1+\frac{\epsilon_{G1}}{3}-\frac{\epsilon_{N1}}{\epsilon} \right)~, \\ & \Sigma=M_{Pl}^2 H^2\left(\epsilon_{GR}+6\epsilon_{G1}+6\epsilon_{N2}+3\frac{\epsilon_{N1}}{ \epsilon } -3\right)~, \\ & \Theta=M_{Pl}^2 H (1-\epsilon_{G1}-\epsilon_{N2}-\frac{\epsilon_{N1}}{\epsilon})~, \end{align} \begin{eqnarray} && \!\!\!\!\!\!\!\!\!\!\!\!\! \mathcal{G}_s=-\frac{M_{Pl}^2}{9} \left[\epsilon_{N1}+\epsilon(\epsilon_{G1}+\epsilon_{N2}-1)\right]^{-2} \nonumber \\ &&\!\!\!\!\cdot \left[ \epsilon (\epsilon_{G1}-3)+3\epsilon_{N1}\right]\left\{-3\epsilon_{N1} (\epsilon_{G1}+\epsilon_{GR}) \right. \nonumber \\ && \! \!\!\!\left. \! + \epsilon\! \left[ 3\epsilon_{G1}^2\!+\!3\epsilon_{GR}\!+\!9\epsilon_{N2}^2 +\epsilon_{G1} (3\!-\!\epsilon_{GR}\!+\!12 \epsilon_{N2})\right]\!\right\}\! , \end{eqnarray} \begin{eqnarray} && \!\!\! \mathcal{F}_s = -\frac{M_{Pl}^2}{9 [\epsilon(\epsilon_{G1}+\epsilon_{N2}-1)+\epsilon_{N1}]^2} \notag \\ && \ \ \ \cdot \Big\{ \epsilon^2 \left\{\epsilon_{G1}^2 \left[7 \epsilon_{N1}+17 \epsilon_{N2}+\epsilon_{N3}-4\right.\right. \notag \\ &&\left. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ -3\left(\epsilon_{G3}+\epsilon_{G4}+\epsilon_{N4}\right)-4\right] \nonumber \\ && \ \ \ \ \ +4 \epsilon_{G1}^3+3 \epsilon_{G1} \left[2 \epsilon_{G3}-2 \epsilon_{G4} (\epsilon_{N2}-1)-10 \epsilon_{N1}\right. \notag \\ && \left. \ \ \ \,\ -2 \epsilon_{N3} +5 \epsilon_{N2} (\epsilon_{N2}-2) +2 \epsilon_{N4}\right]+9 \left(2 \epsilon_{G4} \epsilon_{N2} \right.\nonumber \\ && \ \ \ \ \left. \left.+\epsilon_{G3}+\epsilon_{G4}+3 \epsilon_{N1}-3 \epsilon_{N2}^2+\epsilon_{N2}+\epsilon_{N3}+\epsilon_{N4}\right)\right\} \notag \\ && \ \ \ \ \left.+\epsilon \epsilon_{N1} \left[\epsilon_{G1} (-6 \epsilon_{G3}-6 \epsilon_{G4}+15 \epsilon_{N1}+30 \epsilon_{N2}+6 \epsilon_{N3} \right.\right.\nonumber \\ &&\left.\left. \ \ \ \ \ \ \ \ \,\ \ \ \ -6 \epsilon_{N4})-9 \left(2 \epsilon_{G3}+2 \epsilon_{G4} (\epsilon_{N2}+1)+3 \epsilon_{N1} \notag \right.\right.\right.\\ && \ \ \ \ \ \ \ \ \,\ \ \ \ \left.\left.+2 (\epsilon_{N2}+\epsilon_{N3}+\epsilon_{N4})-3 \epsilon_{N2}^2\right)+4 \epsilon_{G1}^2\right] \nonumber \\ & & \ \ \ \ +\epsilon^3 (\epsilon_{G1}-3)^2 (\epsilon_{G1}-1) \nonumber \\ & & \ \ \ \ +9 \epsilon_{N1}^2 (\epsilon-\epsilon_{GR}-\epsilon_{G1}-\epsilon_{G2})\Big\}. \end{eqnarray} We can now proceed to calculate the soundspeed of the theory. If we insert these equations into the definition of the sounspeed \eqref{sspddef} we obtain \begin{eqnarray} && \!\!\!\!\!\! c_s^2 = \left\{\epsilon \left[\epsilon_{G1} (12 \epsilon_{N2}-\epsilon_{GR}+3)+3 \left(\epsilon_{G1}^2+\epsilon_{GR}+3 \epsilon_{N2}^2\right)\right]\right. \notag \\ && \ \ \ \ \, \left.-3 \epsilon_{N1} (\epsilon_{G1}+\epsilon_{GR})\right\}^{-1} \left[\epsilon (\epsilon_{G1}-3)+3 \epsilon_{N1}\right]^{-1} \notag \\ && \ \ \ \, \cdot \Big\{\epsilon^2 \left\{\epsilon_{G1}^2 \left[7 \epsilon_{N1}+17 \epsilon_{N2}+\epsilon_{N3}\right.\right. \notag \\ && \ \ \ \ \ \, \ \ \ \ \ \ \left. -3 \left(\epsilon_{G3}-\epsilon_{G4}-\epsilon_{N4}\right)-4\right] \notag \\ && \ \ \ \ \ \ +3 \epsilon_{G1} \left[5 (\epsilon_{N2}-2)\epsilon_{N2} -2 \epsilon_{G4} (\epsilon_{N2}-1) -10 \epsilon_{N1}\right. \notag \\ && \ \ \ \ \, \ \ \ \ \ \ \ \ \ \ \, \left. +2 \left(\epsilon_{G3}-\epsilon_{N3}+\epsilon_{N4}\right)\right] \notag \\ && \ \ \ \ \ \ +4 \epsilon_{G1}^3+9 \left(\epsilon_{G3}+2 \epsilon_{G4} \epsilon_{N2}+\epsilon_{G4}+3 \epsilon_{N1}\right. \notag \\ && \left.\left.\ \ \ \ \ -3 \epsilon_{N2}^2+\epsilon_{N2}+\epsilon_{N3}+\epsilon_{N4}\right)\right\} \notag \\ && \ \ \ \ \ \, +\epsilon \epsilon_{N1} \left\{\epsilon_{G1} \left[6\left( \epsilon_{N3}- \epsilon_{G3}- \epsilon_{G4}- \epsilon_{N4}\right)\right.\right. \notag \\ && \left.\ \ \ \ \ \ \ \ \, \ \ \ \ \ \, +15 \epsilon_{N1}+30 \epsilon_{N2}\right] \notag \\ && \ \ \ \ \ \, +4 \epsilon_{G1}^2-9 \left[2 \epsilon_{G3}+2 \epsilon_{G4} (\epsilon_{N2}+1)+3 \epsilon_{N1} \right. \notag \\ &&\left.\left. \ \ \ \ \ \ \ \ \, \ \ \ \ \ +2 (\epsilon_{N2}+\epsilon_{N3}+\epsilon_{N4})-3 \epsilon_{N2}^2\right]\right\} \notag \\ && \ \ \ \ \ \, +\epsilon^3 (\epsilon_{G1}-3)^2 (\epsilon_{G1}-1) \notag \\ && \ \ \ \, +9 \epsilon_{N1}^2 (\epsilon_{G3}+\epsilon_{G4}+\epsilon_{N1}+\epsilon_{N2}+\epsilon_{N3}+\epsilon_{N4})\Big\}, \label{soundspeedgene} \end{eqnarray} which is an exact expression. Let us consider its various limits. First, in the GR limit, where $\epsilon_{Gi}$, $\epsilon_{Ni} \rightarrow 0$, we can see that $c_s^2 $ becomes identically equal to 1 as expected. The same holds in the NMC limit, where $\epsilon_{Gi} \rightarrow 0$, again as expected. Moreover, in the GNMDC limit, where $\epsilon_{Ni}\rightarrow 0$, we acquire \begin{align}\label{csgnmdclimit} {c_s^2}&=\frac{1}{(\epsilon_{G1}-3) (3 \epsilon_{G1} (\epsilon_{G1}+1)-(\epsilon_{G1}-3) \epsilon_{GR})}\cdot \nonumber \\ &\cdot \left\{ \epsilon (\epsilon_{G1}-1) (\epsilon_{G1}-3)^2+9 (\epsilon_{G3}+\epsilon_{G4})+\right.\nonumber \\ &\left.\epsilon_{G1} \left[\epsilon_{G1} (4 \epsilon_{G1}-3 \epsilon_{G3}-3 \epsilon_{G4}-4)+6 (\epsilon_{G3}+\epsilon_{G4})\right]\right\}, \end{align} which using the definitions (\ref{auxilepsilons}) gives expression \eqref{cssqGRNMDC}. However, in general we would like to extract more information about the behavior of the full equation \eqref{soundspeedgene}. A detailed manipulation of this equation is quite tedious and is not included here, however there is a clear note to be made based on it. If we use equation \eqref{epsilonanalytic}, to substitute $\epsilon$ with the auxiliary $\epsilon$ functions, we end up with an expression of the form \begin{align}\label{csorder} c_s^2-1\approx\frac{\mathcal{O}(\epsilon_{Gi})}{f_{\epsilon}(\epsilon_{Ni}, \epsilon_{GR})+\mathcal{O}(\epsilon_{Gi})}, \end{align} where $f_{\epsilon}$ is a function that does not depend on the $\epsilon_{Gi}$ while $\mathcal{O}(\epsilon_{Gi})$ is a function at least linear in $\epsilon_{Gi}$. Hence, the denominator is of greater order of magnitude as compared to the nominator of this fraction, when Slow Roll has ended and the NMC terms completely take over, if one chooses a derivative coupling that vanishes towards the bottom of the potential. This implies that $c_s^2 \equiv 1$, which is, in fact, one of the main results of this work: the inclusion of NMC and a vanishing $\phi$-dependent GNMDC, regardless its exact form, can completely heal the $c_s^2$ instabilities of derivative coupling (see also Fig. \ref{fig:fulltheorycompare3} for corresponding numerical results). This was expected because the NMC term has a sound speed identically equal to 1 and its terms remain dominant after the end of the slow roll. On the other hand, using the same rationale with equation \eqref{csgnmdclimit}, we can show that in the GNMDC limit we acquire \begin{align} c_s^2-1\approx\frac{\mathcal{O}(\epsilon_{Gi})}{\mathcal{O}(\epsilon_{Gi})}. \end{align} This fraction, is obviously non-zero in general, and in particular it can be larger or smaller than 1. This reconfirms the results of \cite{Dalianis:2019vit}, regarding the squared sound-speed oscillations between negative and superluminal values. \subsubsection*{Regime 1: \textbf{NMC $\gg$ GNMDC}} If one would like to study the case where the GNMDC term is negligible compared to the NMC term during the slow-roll era, then observing equations \eqref{F00fullSRA}, \eqref{KGfullSRA}, there are two requirements that should be satisfied, namely \begin{align} \xi \gg \frac{G(\phi)}{f'(\phi)}H\dot{\phi}~, \end{align} and \begin{align} \xi \gg \frac{G(\phi)}{f(\phi)}\dot{\phi}^2~, \end{align} where, based on our previous discussion, we deduce that the former is actually stronger than the latter. Nevertheless, we should mention here that the GNMDC form (\ref{Fphiform}) on which we will focus on in this work, turns off at the end of inflation, hence, if we enforce the above constraints then the GNMDC will be unimportant throughout the field's evolution. Thus, this case would bear practically no effect in both the early and late stages phenomenology, and therefore we will not investigate it further. \subsubsection*{Regime 2: \textbf{GNMDC $\gg$ NMC}} In order to realize this regime of GNMDC domination, using equations \eqref{F00fullSRA} and \eqref{KGfullSRA} we extract the requirements \begin{align} \xi \ll \frac{G(\phi)}{f'(\phi)}H\dot{\phi}~, \end{align} and \begin{align} \xi \ll \frac{G(\phi)}{f(\phi)}\dot{\phi}^2~, \end{align} where the latter is stronger than the former if the dynamics of the NMC are to be negligible in the slow-roll era. However, unlike the previous case where GNMDC $\ll$ NMC, the post-slow-roll dynamics cannot be studied without the NMC terms. This is due to the fact that a $\phi$-dependent GNMDC quickly becomes subdominant near the bottom of the potential, in the post-slow-roll regime. Hence, this case should be studied in more detail, and in particular to examine the sound speed squared, since in the sole GNMDC model the derivative coupling has been shown to create instabilities due to $c_s^2<0$. Specifically, as discussed and shown with eq. \eqref{csorder}, we are interested in investigating whether the inclusion of the NMC term corrects the $c_s^2$ values towards 1, compared to the standalone GNMDC case. A theoretical indication towards this direction is that the NMC sound speed is identically equal to 1, and since the NMC should take over (or at least be comparable) with GNMDC in the post-slow-roll period it is expected that the sound speed will be corrected, albeit the magnitude of this correction remains to be found, since eq. \eqref{csorder} is only qualitative. Instead, of providing explicit results here, we will do it in the analysis of the next regime, namely where NMC $\approx$ GNMDC. \subsubsection*{Regime 3: \textbf{NMC $\approx$ GNMDC}} We can now proceed to the investigation of the case where NMC and GNMDC terms are of the same order. We start with the slow-roll dynamical equations presented above. To enforce NMC $\approx$ GNMDC we can choose between the two requirements presented earlier, one of which is stronger. For simplicity we will choose the weaker constraint which nevertheless is adequate for the results of our model. In particular, we enforce \begin{align} \xi f'(\phi)\approx G(\phi) H \dot{\phi}~, \end{align} while still \begin{align} \xi f(\phi) \gg G(\phi) \dot{\phi}^2~, \end{align} and we additionally require that the GR terms are negligible compared to the GNMDC and NMC ones during the slow-roll era. Then, the scalar-field equation \eqref{KGfullSRA} becomes \begin{align} \label{KGfullSRAnext} 18 G(\phi) H^3 \dot{\phi}+V'(\phi)=12 H^2 \xi f'(\phi)~, \end{align} while the Friedmann equation \eqref{F00fullSRA} is significantly simplified and becomes \begin{align} \label{F00fullSRAnext} 3 M_{Pl}^2 H^2+6 \xi f(\phi) H^2=V(\phi)~. \end{align} Based on the discussion following equations \eqref{F00fullSRA} and \eqref{KGfullSRA}, regarding the slow-roll approximations, the dominant parameters during the slow-roll period are $\epsilon_{G1}$, $\epsilon_{N1}$ and $\epsilon_{N2}$. Hence, if we are interested in the early phase's predictions we can, as a first approximation, keep only the first-order contributions with regards to these parameters. We thus acquire \begin{align} \mathcal{F}_s=\mathcal{G}_s \approx M_{Pl}^2 \epsilon_{G1}~. \end{align} Inserting this into the squared sound-speed relation (\ref{sspddef}) we obtain $c_s^2=1$ during the slow-roll period (equivalently maintaing only $\epsilon_{G1}$, $\epsilon_{N1}$ and $\epsilon_{N2}$ in the general expression (\ref{soundspeedgene}) gives $c_s^2=1$). We proceed by calculating the inflationary observables. Using expression (\ref{PsandPtdef}), for the power spectrum at first order we obtain \begin{align} \mathcal{P}_\mathcal{R} \approx \frac{H^2}{8M_{Pl}^2\pi^2 \epsilon_{G1}}~, \end{align} which coincides with \eqref{PsinGRNMDC} if one keeps only the first order contribution. Interestingly enough, at first order the NMC term does not have an effect on the scalar power spectrum value, since the only $\epsilon$ parameter appearing is $\epsilon_{G1}$. Concerning the tensor-to-scalar ratio $r$, using (\ref{PsandPtdef}), (\ref{rdef}) we find \begin{align} \label{rprediction} r &\approx 16 \epsilon_{G1}+\frac{16\epsilon_{G1}}{\epsilon_{G1}+\epsilon_{N2}}\epsilon_{N1}~. \end{align} Unlike the scalar power spectrum, this result clearly shows the effect of the combined theory. In particular, during slow-roll we have $\epsilon_{N1}<0$, which implies that the NMC term lowers the standard result, which is $r=16 \epsilon_{G1}$, namely improving the tensor-to-scalar ratio to values that are in better agreement with the observations. Hence, the very low tensor-to-scalar ratio, which is a characteristic result of the NMC term, is maintained in the combined theory. Concerning the scalar spectral index, $n_s$, using (\ref{PsandPtdef}), (\ref{nsdefgene}) in the case of the present combined scenario we obtain: \begin{align} n_s \approx 1+\frac{-3 (\epsilon_{G3}+\epsilon_{G4})+2\epsilon_{G1}(\epsilon_{G1}+\epsilon_{N1}+\epsilon_{N2})}{ \epsilon_{G1}(\epsilon_{G1}+\epsilon_{N1}+\epsilon_{N2}-1)}~. \end{align} Note that here we cannot ignore the terms $\epsilon_{G3}$, $\epsilon_{G4}$ as we have done until now, since the rest of the terms are of second order in the $\epsilon$ parameters. As expected, when the NMC-related parameters go to zero we can recover the result (\ref{nsinGRNMDC}) of the standalone GNMDC model. In summary, when a $\phi$-dependent GNMDC and the NMC terms are comparable, the scenario can be completely healed from the $c_s^2<0$ unstable region. Additionally, the value of the tensor-to-scalar ratio not only remains inside the Planck 2018's contour plots, but it is increasingly improving as the NMC contribution becomes more significant. Finally, the scenario can, in principle, be healed from the unitarity problem, because as the GNMDC term becomes more significant in the slow-roll period, the magnitude of $\xi \phi_*^2$ decreases significantly. These features make the combined scenario at hand better than its individual counterparts. We emphasize that all the above results hold as long as $G(\phi)$ is $\phi$-dependent, and thus at the bottom of the potential it becomes negligible. \section{Numerical investigation} \label{specificstandalones} In this Section we perform a full numerical study, in order to demonstrate, by use of specific examples, the general results of our theory obtained in the previous Section, most importantly equations \eqref{csorder} and \eqref{rprediction}. To satisfy the ansatz that GNMDC becomes negligible at the end of inflation we choose a monomial or polynomial form for $G(\phi)$, however other similar forms still produce viable results. To numerically elaborate, we consider, then, specific NMC and GNMDC functions. For the former, i.e for the coupling function $f(\phi)$ we choose the most well-studied case of the standalone NMC scenario, namely $f(\phi)=\xi \phi^2$, while for the latter we consider the well-studied monomial form (\ref{Fphiform}), namely $ G(\phi)=\frac{\alpha \phi^{\alpha-1}}{2M^{\alpha+1}}$~. We then provide and discuss an example with a polynomial form $ G(\phi)=\sum_{i}\frac{\alpha_i \phi^{\alpha_i-1}}{2M_i^{\alpha_i+1}}$. Additionally, in order to have increased theoretical justification, and to compare with the literature, we consider the scalar field to be the Higgs boson and thus its potential to be the known quartic Higgs one \cite{Germani:2010gm,Atkins:2010yg}, namely \begin{align} V(\phi)= \frac{\lambda \phi^4}{4}. \end{align} Finally, in what follows, we have imposed the normalization that the scalar power spectrum value at $k=0.05 Mpc^{-1}$ is $\mathcal{P}_\mathcal{R}=2.2\cdot10^{-9}$ \cite{Akrami:2018odb}. Additionally, the initial conditions are selected in order for the produced models to yield 40, 50 and 60 e-folds. Starting with the monomial GNMDC scenario, in Fig. \ref{fig:fulltheorycompare1} we depict the evolution of the scalar field for the various cases. The main observation from this graph is the fact that although in the standalone GNMDC scenario the oscillations of $\phi$ (and consequently of $\dot{\phi}$) are quite wild, in the combined scenario the period of the field oscillations increases. This will play a crucial role in the following analysis since it is the cause of the $c_s^2$-instabilities healing in the combined scenario. \begin{figure}[ht] \center \includegraphics[width=\linewidth]{phiFTcompare.pdf}% \\[0.4cm] \caption{{\it{The evolution of the scalar field in three different cases: For GNMDC with $\alpha=5$, for NMC with $\xi\approx 8000$ and for the combination of NMC+GNMDC with $\alpha=5$ and $\xi=2000$, respectively. All three models yield 60 e-folds and $\mathcal{P}_\mathcal{R}=2.2\cdot10^{-9}$. One can observe the lengthening of the period of oscillations, as well as the larger initial value of the field, in the case where NMC becomes more important ($\xi$ grows). Finally, note that when the two theories are combined, $\xi \phi_*^2$ remains less than $M_{Pl}$.}}} \label{fig:fulltheorycompare1} \end{figure} \begin{figure}[!] \center \includegraphics[width=\linewidth]{rofnsFTcompare.pdf} \\[0.4cm] \caption{{\it{ 1$\sigma$ (purple) and 2$\sigma$ (light purple) contours for Planck 2018 results (Planck $+TT+lowP$) \cite{Akrami:2018odb}, on the $r-n_s$ plane, alongside the predictions of the scenarios at hand. The NMC scenario corresponds to the dot-dashed line. For the GNMDC (purple lines) we have chosen to show two cases, one with $\alpha=3$ (dashed line) and one with $\alpha=5$ (dotted line). The same convention is used for the combined NMC+GNMDC scenario in terms of $\alpha$, where we also have the colour code of blue lines for $\xi=1500$ and red lines for $\xi=2000$. It is evident that the NMC term lowers the $r$ value as it becomes more significant, as compared to the GNMDC alone. Very low $r$-values are a main feature of NMC of the form $\phi^2$. Moreover, one observes that for the same value of $\xi$, as $\alpha$ grows $r$ is also lowered, as reported in \cite{Dalianis:2019vit} too. Finally, the growing dots represent 40, 50 and 60 e-folds respectively.}}} \label{fig:fulltheorycompare2} \end{figure} As a next step we calculate the inflationary observables, and in particular the scalar spectral index and the tensor to scalar ratio, using the exact expressions of Appendix \ref{perturbations}. In Fig. \ref{fig:fulltheorycompare2}, we present the obtained results for the standalone cases of NMC and of GNMDC, as well as for the combined scenario. Additionally, for transparency, in the same figure we provide the 1$\sigma$ and 2$\sigma$ contours of the Planck 2018 data \cite{Akrami:2018odb}. As we observe, the simple NMC gives very satisfactory predictions however due to the unitarity violation this model has to be abandoned. The simple GNMDC scenario solves the unitarity issue however it leads to quite large $r$ values and moreover it leads to instabilities related to $c_s^2$. We observe that, in the combined NMC+GNMDC scenario which alleviates the unitarity issue, one can improve the obtained $r$ values, bringing them back inside the Planck 2018 contours, and moreover the larger the $\alpha$ value is the larger is the improvement. Specifically, one observes that for the same value of $\alpha$ (dashed lines for $\alpha=3$, dotted lines for $\alpha=5$), as $\xi$ grows the tensor-to-scalar ratio lowers. Moreover, for the same value of $\xi$ (blue lines for $\xi=1500$, red lines for $\xi=2000$), as $\alpha$ grows, $r$ also lowers. This result is also expected since this is one of the effects of the sole GNMDC term \cite{Dalianis:2019vit}. In conclusion, monomial GNMDC models with larger $\alpha$ would in fact be more desirable in the context of the combined theory proposed in this work, due to the enhancement of the gravitational friction effect that the $\alpha$ parameter essentially quantifies. However, if one considers a polynomial GNMDC the same effect can actually be obtained, since inflation can be carried by two or more ``frictious'' terms present in a polynomial GNMDC. We demonstrate such a scenario later. \begin{figure}[ht] \includegraphics[width=\linewidth]{sspdFTcompa5.pdf}% \\[0.4cm] \caption{{\it{The squared sound speed evolution for the scenario at hand, for $\alpha=5$, with $\xi=0, 1500$ and $2000$ respectively. It is clear that as the NMC contribution becomes more significant ($\xi$ increases), the oscillations in its value are damped and $c_s^2$ is corrected towards 1.}}} \label{fig:fulltheorycompare3} \end{figure} \begin{figure}[!] \includegraphics[width=\linewidth]{KGtermsFTcompa5.pdf}% \\[0.4cm] \caption{{\it{ The contribution of the terms related to the GNMDC (continuous lines) and to the NMC (dashed lines) in the Klein-Gordon equation (\ref{KGfull}), for $\alpha=5$ and $\xi=2000$. It is clear than when the oscillations start, the NMC terms dominate over the GNMDC terms and hence the GNMDC effects are negligible, even though during the slow-roll era they are comparable. The standard GR terms are intentionally omitted in order to make the graph simpler.}}} \label{fig:fulltheorycompare4} \end{figure} Let us now examine the evolution of $c_s^2$ in order to verify that the combined scenario can indeed heal the $c_s^2$-instabilities of the standalone GNMDC. In Fig. \ref{fig:fulltheorycompare3} we depict the evolution of $c_s^2$ for various cases. As one can clearly see, while in the standalone GNMDC (i.e. for $\xi=0$) the $c_s^2$ wildly oscillates between positive and negative values, when we switch on the NMC contribution we obtain a significant decrease of the oscillatory behavior and a stabilization to positive values. In particular, in the combined scenario we observe that near the end of inflation the GNMDC contribution smooths out, while the NMC term remains co-leading alongside the standard GR (i.e. of the minimally coupled scalar field) terms. However, it is known that the standalone NMC as well as the GR terms have no instability issues. Hence, the $c_s^2<0$ problem is healed. In order to provide a more transparent picture of the above relative effect of the GNMDC and the NMC contributions, in Fig. \ref{fig:fulltheorycompare4} we present the contribution of the terms related to the GNMDC and the NMC in the Klein-Gordon equation (\ref{KGfull}). From this graph it becomes clear that although during the slow-roll era the contributions from NMC and GNMDC are comparable, when the oscillations start the NMC terms dominate completely over the GNMDC terms and since NMC alone leads to $c_s^2=1$ its complete dominance in the combined model is adequate to bring $c_s^2$ away from the unstable region (caused by standalone GNMDC). Hence, the GNMDC contribution to the $c_s^2$ at the end of inflation is overpowered by the NMC contribution and the wild oscillations of the sound speed are damped much earlier in this scenario. Note that this damping of oscillations is more efficient for larger $\alpha$ values, which as we mentioned above lead also to better $r$ values. Hence, overall, larger $\alpha$ values would be more desirable. This brings up the question of whether this is a realistic scenario. Quantum corrections should, in fact, bring about terms that might be of lower order, so one should check the resulting phenomenology. However, if one chooses a polynomial form for $G(\phi)$, a very similar phenomenology occurs, since, unless the various terms of the polynomial are finely tuned, there will still be only one monomial term that drives the slow roll and hence it will produce very similar results. Moreover, even in the case that two, or more, terms are actually of the same order of magnitude, the phenomenology is still, qualitatively, the same, since the results of Section \ref{combined} are independent of the exact form of the GNMDC. They are only based on the fact that the GNMDC should become negligible at the end of inflation. Nevertheless, we later provide a numerical example of such a scenario for demonstrative purposes. In conclusion, in the combined scenario, when inflation starts, the gravitational friction effect due to the GNMDC term is what causes the model to produce a significant amount of e-folds without having to resort to $\xi \phi_*^2>M_{Pl}$ values as in the standalone NMC case, and this is what alleviates the unitarity issue. At the same time, the NMC term causes the $r$ of the model to be significantly lowered, and thus be in better agreement with observations, as compared to the standalone GNMDC case. Finally, when inflation ends and the oscillations start, the NMC terms remain more significant than that of the GNMDC, which leads to the fast eradication of the oscillations in the $c_s^2$ value, healing the theory of instabilities. These features and advantages of the combined scenario are amongst the main results of the present work. Before closing this section, we note another role of the GNMDC parameter $\alpha$ on the results. In the combined scenario even $\alpha$ values can still lead to viable inflation. This is not the case when GNMDC is considered alone \cite{Dalianis:2019vit} due to its inability to satisfy the corresponding requirement (\ref{Consinfull}), which essentially disqualifies the area of the phase space corresponding to desirable observables. The fact that in the combined scenario all $\alpha$ values can be used, is a significant advance in the richness of the resulting phenomenology. This also holds for a polynomial GNMDC form: when an even-valued $\alpha$ term becomes important the polynomial GNMDC numerics become unstable due to the above constraint. This can be ameliorated or even healed, when it is combined with NMC. As a further numerical demonstration of the effects of the NMC+GNMDC scenario we include a model resulting from a polynomial GNMDC form, namely \[ G(\phi)=\sum_{i}\frac{\alpha_i \phi^{\alpha_i-1}}{2M_i^{\alpha_i+1}}, \] where $i$ is a subscript that defines which and how many corresponding terms are taken into account. As a demonstration we pick \begin{align} \label{polynomialGNMDC} \frac{\alpha \phi ^{\alpha -1}}{2 M_1^{\alpha +1}}+\frac{(\alpha -1) \phi ^{\alpha -2}}{2 M_2^{\alpha }}, \end{align} with $\alpha=4$, while the NMC coupling is $\kappa \approx 2000$. The coupling coefficients should be such that these two terms as a whole are of comparable magnitude. If not, then one of the terms would dominate during slow roll, essentially reducing the model to the monomial form presented earlier. We reiterate, that such a scenario is not viable in the sole GNMDC case, since even values of $\alpha$ are problematic. A polynomial form still falls within the ansatz needed for the results of Section \ref{combined} to hold, namely that the GNMDC becomes negligible near the end of inflation. The results shown therein, then, still hold, since this modification affects only the exact form of the $\epsilon_{G_i}$ parameters, and not their overall behavior. Definitely, picking initial conditions and scales for the combined theory, with a polynomial GNMDC, is a tedious task as compared to the monomial case. Nevertheless, by imposing the ansatz discussed earlier, regarding the magnitude of the various terms of the GNMDC, one can obtain results that are well within observational bounds. The overall picture is very similar to the monomial case, as one can see in Fig. \ref{fig:polynomialrns}, which was expected since the $\epsilon_{G_i}$ show a similar behavior. \begin{figure}[!] \center \includegraphics[width=\linewidth]{rofnspolynom.pdf} \\[0.4cm] \caption{{\it{ 1$\sigma$ (purple) and 2$\sigma$ (light purple) contours for Planck 2018 results (Planck $+TT+lowP$) \cite{Akrami:2018odb}, on the $r-n_s$ plane, alongside the predictions of the polynomial GNMDC+NMC scenario. To demonstrate that the resulting phenomenology is very similar to the monomial case of Fig. \ref{fig:fulltheorycompare2}, we present two cases, one with $M_1=M_2$ and one with $M_1=10M_2$. The growing dots represent 40, 50 and 60 e-folds respectively. The corresponding models when NMC is not included are not stable due to the constraint \eqref{Consinfull}.}}} \label{fig:polynomialrns} \end{figure} \section{Conclusions}\label{conclusions} It is widely accepted that for modern Cosmology to explain the hot big bang and the primordial perturbations observed through the CMBR it has to be complemented by an initial inflationary period. There is a variety of ways to achieve inflation, the most well-studied of which is the inclusion of a scalar field, that through its dynamics affects the evolution of the infant Universe. Given that the only scalar field actually observed in nature up to now is the Higgs field, it would be the prime candidate for such a scenario. The basic scenarios in which the Higgs field is minimally coupled to gravity have been excluded from Planck observations \cite{Akrami:2018odb}. The next candidate is to allow the Higgs field to couple nonminimally (NMC) with gravity. NMC Higgs inflation, with a quadratic coupling of the form $f(\phi)=\phi^2$, has been shown to yield results in very good agreement with the observations, and particularly low tensor-to-scalar ratio, while the squared sound speed of the scalar perturbations is identically equal to 1 and thus the scenario is free from instabilities. However, this model leads to unitarity violation which in turn is undesirable if one wished to quantize the theory. The consideration of nonminimal derivative couplings of the scalar field to gravity is shown to solve the unitarity issue, while still leading to satisfactory inflationary observables, due to the presence of a ``gravitational friction'' that lowers the initial values needed to produce a long slow-roll period and thus a significant amount of e-folds. Nevertheless, these models lead to perturbative instabilities and in particular to $c_s^2<0$. Although one could construct generalized versions of nonminimal derivative couplings (GNMDC) that could improve the instability issue, considering for instance a coupling function of the form $\frac{\alpha \phi^{\alpha-1}}{M^{\alpha+1}}$, potential problematic behavior still remains. In this work we constructed the combined scenario of NMC and of GNMDC, which maintain the advantages of the individual models, but remove their individual disadvantages. In the combined scenario, a long enough inflationary phase can be easily achieved, while the initial value of the scalar field and the scale of the NMC term are such that it remains sub-Planckian, a feature not possible in the single field NMC scenario. These attractive features are achieved due to the GNMDC term, that brings about the gravitational friction effect that extends the slow-roll phase, allowing for lower initial values of $\phi_*$. Additionally, near the end of inflation, at the bottom of the potential, when a suitable GNMDC term is chosen, it becomes negligible, while the NMC term dominates completely. To demonstrate this, we have chosen to include two examples, one with a GNMDC of monomial form and one of polynomial form that satisfy the above ansatz (however, other GNMDC forms should also be viable, as long as they become negligible at the end of inflation). In both cases we show that a desirable phenomenology is achieved. At the same time, at the end of inflation canonical gravity is restored, and the scenario is healed from $c_s^2$-instabilities due to wild oscillations, and with no superluminal scalar perturbations that are related to the simple NMDC case. Finally, another advantage of the present construction is that since the GNMDC contribution becomes negligible after inflation ends, the theory can easily pass the recent LIGO-VIRGO contstraints on the gravitational wave speed \cite{TheLIGOScientific:2017qsa,Goldstein:2017mmi} (since it is known that the nonminimal derivative coupling terms are amongst the ones that lead to a gravitational wave speed different than one). In summary, the combined scenario leads to inflationary observables in agreement with observations, it is free from $c_s^2$-instabilities, and it alleviates the unitarity issue. Hence, it does maintain the advantages of the individual scenarios without sharing their disadvantages. Thus, inflationary scenarios with nonminimal and derivative couplings to gravity combined, may serve as successful candidates for the description of inflationary dynamics, and other mechanisms related to inflation, like Primordial Black Hole formation, and deserve further investigation. \section*{Acknowledgements} ENS would like to acknowledge the contribution of the COST Action CA18108 ``Quantum Gravity Phenomenology in the multi-messenger approach''. \section{Introduction}\label{intro} The inflationary scenario according to which an early exponential expansion of the Universe takes place, offers a compelling explanation for the initial conditions of a hot Big Bang (for reviews see \cite{Olive:1989nu, Lyth:1998xn,Martin:2013tda}). This inflationary description of the early phases of the Universe can be viewed as the effect of the dynamics of a scalar field called inflaton. At the same time, observations based on the Cosmic Microwave Background Radiation (CMBR) offer increasingly precise constraints to test the inflationary paradigm, as well as the theory of gravity that operates at very high densities. Moreover, there has been a significant effort regarding the formation of primordial black holes, during a super slow-roll phase during the inflationary period, which could in fact be a viable Dark Matter candidate (see \cite{Khlopov:2008myu,Chongchitnan:2006wx,Chen:2019zza, Garcia-Bellido:2017mdw,Cai:2018tuh,Ballesteros:2018wlw,Germani:2018jgr, Fu:2019ttf,Lu:2019sti,Dalianis:2018ymb,Yi:2020cut,Yi:2020kmq,Pi:2017}). Hence, the physics surrounding inflation is of particular significance to various aspects of our understanding of the Universe, and as such early universe cosmology provides the grounds to test and choose between a significant number of inflationary models. To identify a viable one, one should study the dynamics of the full system of the inflaton field and gravity. In an attempt to describe the early cosmological evolution according to recent observational results, gravity theories that are based on modifications of Einstein Gravity were proposed. Two of the most common ways to modify the standard Theory of Relativity, are introducing higher order curvature terms, and/or including scalar fields that are nonminimally coupled to gravity. Higher-order corrections to the Einstein-Hilbert action arise naturally in the gravitational effective action of String Theory \cite{Gross:1986mw}. On the other hand, introducing extra scalar fields, which are non-minimally coupled to gravity, is a thoroughly studied way to modify the standard theory of General Relativity (GR) and results to what is known as scalar-tensor theory \cite{Fujii:2003pa}. A particularly well-studied scalar-tensor theory is the one obtained through the Horndeski Lagrangian \cite{Horndeski:1974wa}. These theories yield field equations of second order and hence they do not produce ghost instabilities \cite{Ostrogradsky:1850fid}. Moreover, many scalar-tensor theories share a classical Galilean symmetry \cite{Nicolis:2008in,Deffayet:2009wt,Deffayet:2009mn,Deffayet:2011gsz, Kobayashi:2011nu,Harko:2016xip,Kamada:2010qe,Saridakis:2021lqd}. One simple subclass of Horndeski theories is obtained with the use of a scalar field coupled to the Ricci scalar, which is known as Non-Minimal Coupling (NMC). Such a construction goes beyond the simple case of GR plus a scalar field and thus it can improve the inflationary behavior. In particular, by taking a NMC of the form $\xi \phi^2$, if the scale $\xi$ is large enough the resulting inflationary phase is long enough \cite{Salopek:1989,Fakir:1990,Kaiser:1994,Komatsu:1999,Nozari:2008,Ren:2014}. In fact, it was shown that a rather well-behaved phenomenology is obtained, since the tensor to scalar ratio is particularly low, and easily inside the Planck 2018 observational limits. Additionally, there have also been other works that have utilized a different NMC \cite{Park:2008} or a matrix configuration for the inflaton field \cite{Ashoorioon:2019}. However, although NMC models with large coupling values are very efficient in producing improved inflationary phenomenology, large coupling constants lead to problems related to the unitarity of this theory, and thus are not desirable from a quantum mechanical perspective \cite{Bezrukov:2007,Barvinsky:2008,Bezrukov:2008,Bellido:2008,Simone:2008, Bezrukov:2008b,Burgess:2009,Barbon:2009, Bezrukov:2009,Barvinsky:2009,Clark:2009, Barvinsky:2009b, Einhorn:2009,Lerner:2009b,Burgess:2010,Mazumdar:2010, Geng:2017mic,Fumagalli:2016}, if one is to have a single field model. A different picture is obtained when multi field theories are studied, and it has been argued \cite{Hertzberg:2010, Giudice:2010} that in such theories these problems do not exist. Moreover, other attempts without unitarity issues have been made in a similar context, utilizing a Palatini formulation of gravity \cite{Tenkanen:2017,McDonald:2020,Tenkanen:2020}, or by taking into account additional interactions \cite{Lerner:2010b,Lola:2020lvk}. On the other hand, in Horndeski theory one of the most well-studied terms is the one corresponding to the non-minimal derivative coupling (NMDC) of the scalar field to the Einstein tensor. This term has interesting implications both on small and large scales for black hole physics \cite{Kolyvaris:2011fk, Rinaldi:2012vy, Kolyvaris:2013zfa, Babichev:2013cya, Cisterna:2014nua, Charmousis:2014zaa, Koutsoumbas:2015ekk, Anabalon:2013, Cisterna:2015, Cisterna:2016}, for dark energy \cite{Saridakis:2010mf, Dent:2013awa} and for inflation \cite{Amendola:1993uh,Sheikhahmadi:2016wyz} respectively. For a recent review, see \cite{Papantonopoulos:2019eff}. Concerning inflation, the main advantage of NMDC is that it is free from unitarity problems, and this led to the established model of new Higgs inflation \cite{Germani:2015plv}. As it has been shown, the non-minimal derivative coupling acts as a friction mechanism, and therefore from an inflationary model-building point of view it allows for the implementation of a slow-roll phase \cite{Amendola:1993uh,Sushkov:2009hk}, as well as for inflation with potentials such as the Standard-Model Higgs to be realized \cite{Germani:2010gm}. In light of the above, it becomes a very attractive term within the framework of Horndeski theory. Moreover, such models are consistently described within supergravity \cite{Farakos:2012je, Farakos:2013zya} via the gauge kinematic function \cite{Dalianis:2014sqa}. An extensive study of the NMDC predictions is performed in \cite{Dalianis:2016wpu}, where the dynamics of both the inflationary slow-roll phase and the reheating phase were considered. In particular, the NMDC oscillations of the inflaton are very rapid and remain undamped for a very lengthy period \cite{Sadjadi:2012zp, Ghalee:2013ada, Yang:2015pga, Gumjudpai:2015vio, Yi:2016jqr, Gialamas:2020vto, Myung:2016twf, Ema:2015oaa, Ema:2016hlw}, affecting heavy particle production \cite{Koutsoumbas:2013boa}. However, such oscillations, where the NMDC remains dominant over the standard GR term, are problematic in terms of stability of the post-inflationary system. This is due to the oscillations of the sound-speed squared between positive and negative values \cite{Ema:2015oaa}, implying that scalar fluctuations are exponentially enhanced. To avoid this instability, the non-minimal kinetic term must cease to be the dominant (or even co-leading) term, when compared to the canonical kinetic term. However, if this condition is to be met, the model effectively reduces to that of a canonical scalar field in GR even during the slow-roll period, and the advantages of the NMDC are lost. Nevertheless, one can generalize the NMDC term, since it is a special case of the Horndeski Lagrangian density, and consider Lagrangians of the form \cite{Deffayet:2011gsz,Kobayashi:2011nu,Harko:2016xip} \begin{align} \label{lagran} {\cal L}_5=G_5(\phi, X) G^{\mu\nu}\partial_\mu \partial_\nu \phi \,~, \end{align} where $X=-\partial_\mu \phi \partial^\mu \phi /2$. If the function $G_5(\phi, X)$ is chosen to be, $G_5(\phi, X)=-\phi/(2M^2)$, one gets the simplest NMDC possible, since after integration by parts the derivative coupling becomes constant. This however leads to the problematic post-inflationary evolution. Instead, in \cite{Dalianis:2019vit} it was shown that if one chooses a more general function $G_5(\phi, X)=G(\phi)\, \xi(X)$, the phenomenology of the Horndeski terms becomes richer, both during inflation and reheating stages. In the case where $G(\phi)\propto \phi$ this Generalized NMDC term (GNMDC) essentially vanishes when the inflaton field approaches the minimum of the potential. Thus, the system, after a few oscillations, transits to the dynamics of a canonical kinetic term in GR, leading to a more manageable and reliable behavior, dominated by GR dynamics during the reheating stage. In fact it was shown that with this kind of term the inflationary phenomenology generated in a Higgs potential was in very good agreement with observations. Furthermore, the tight bounds on the speed of Gravitational Waves (GWs) extracted by recent observations \cite{Abbott:2016blz,Abbott:2016nmj,Baker:2017hug} and from the solar system constraints \cite{Gonzalez:2020vzl}, were dismissive of the NMDC \cite{Ezquiaga:2017ekz,Gong:2017kim}, since an NMDC term playing the role of dark energy can produce superluminal tensor perturbations \cite{Germani:2010gm,Germani:2011ua} in Friedmann-Lemaitre-Robertson-Walker cosmological backgrounds and also. A GNMDC of the form $G(\phi)\propto \phi$ however can heal this problem, since after the end of slow roll inflation it has essentially decoupled from the dynamics of the system since it becomes negligible. However, it was also shown that the sound speed square was not completely healed of the oscillations between positive and negative values, albeit this problem was significantly ameliorated. One then, would have to seek for further modifications that could entirely heal the theories that are modified with non-canonical kinetic terms of this form, from the sound-speed related instabilities, and possibly even further improve the observables of inflation. The motivation of this work is based on the above discussion, according to which neither the NMC nor NMDC scenarios are completely free of disadvantages and problems when a desirable phenomenology is achieved. Hence, we are interested in investigating a simple combination of the NMC and GNMDC terms, that can alleviate the problems of both of these standardized modifications. In particular, the GNMDC's gravitational friction effect allows for the $\xi$ and $\phi_*$ to be lowered enough to not violate unitarity, while the late time domination of the NMC term ensures that no sound-speed related instabilities occur. Moreover, a lowering of the tensor-to-scalar ratio of this combined theory is obtained as compared to the GNMDC case and a desirable theory is achieved. This manuscript is organized as follows. In Section \ref{standalones} we briefly analyze some basic results of each of the NMC and GNMDC terms as standalone modifications of GR. In Section \ref{combined}, we present the combined scenario of inflation in the presence of the NMC and GNMDC terms. Then in Section \ref{specificstandalones} we proceed to a detailed numerical investigation in a Higgs potential for a variety of interesting cases, with the purpose of demonstrating the general results obtained in Section \ref{combined}, thus clearly showing the advantages of this scenario. Finally, in Section \ref{conclusions} we summarize our results. \section{Nonminimal coupling and generalized nonminimal derivative coupling as standalone modifications }\label{standalones} In this Section we present a short synopsis of inflationary models resulting from general relativity plus nonminimal coupling (GR+NMC) and from general relativity plus generalized nonminimal derivative coupling (GR+GNMDC), which have been studied extensively in the literature. In studying inflationary models it is of great importance to perturbatively study the effects of inflation, since every inflationary model provides a rich phenomenology related to scalar and tensorial perturbations. This phenomenology sets the observational testing grounds for all inflationary models. Specifically, in order to test their viability, one needs to compare the predictions of a variety of quantities with their corresponding observed values, mainly obtained through CMBR. These observable quantities, include the power spectrum of the scalar perturbations, $\mathcal{P_R}$, the scalar spectral index (tilt) $n_s$, and the tensor-to-scalar ratio $r$, while a specific amount of e-folds is also required in order for the horizon and flatness problems to be efficiently solved. In Appendix \ref{perturbations} we include a short review of the usual steps taken in this direction. A full analysis of single-field perturbations (without soft-properties considerations \cite{Saridakis:2021qxb}) has been performed in a number of works, e.g. in \cite{Ema:2015oaa,Tsujikawa:2012mk,Kobayashi:2019} . \subsection{Inflation with nonminimal coupling} The action of this modification to GR is written in the form \begin{align}\label{NMCaction} S=\int d^4x \sqrt{-g} \left[ f(\phi) R-\frac{\partial_\mu \phi \partial^\mu \phi}{2}-V(\phi)\right], \end{align} and the most studied coupling of this form in the literature is $f(\phi)=\xi \phi^2$. Nonminimal coupling (NMC) as a standalone modification to GR, when taking the form $f(\phi)=\xi \phi^2$ in a Higgs potential, has been shown to produce remarkably low tensor-to-scalar ratio values. Additionally, it has no post-inflationary instability issues, since $c_s^2$ can be shown to be identically equal to 1, regardless of the form of the NMC. Nevertheless, it was shown that it does not preserve unitarity and thus it is problematic from a quantum-mechanical point of view, since the combination $\xi \phi^2$ takes values larger than $M_{Pl}$ in order to yield a long enough inflation \cite{Bezrukov:2007,Barvinsky:2008,Bezrukov:2008,Bellido:2008,Simone:2008, Bezrukov:2008b,Burgess:2009,Barbon:2009, Bezrukov:2009,Barvinsky:2009,Clark:2009, Barvinsky:2009b, Einhorn:2009,Lerner:2009b,Burgess:2010,Mazumdar:2010, Geng:2017mic}. We consider a homogeneous and isotropic flat Friedmann-Robertson-Walker (FRW) geometry with metric \begin{equation} \label{FRWmetric} ds^{2}=-dt^{2}+a^{2}(t)\delta_{ij}dx^{i}dx^{j}\,, \end{equation} where $a(t)$ is the scale factor. The Friedmann equations of this scenario are \begin{align}\label{Fried00NMC} 3M_{Pl}^2 H^2=V(\phi)+\frac{\dot{\phi}^2}{2}-6\xi \left[f(\phi) H^2+f'(\phi) \dot{\phi} H\right], \end{align} \begin{align} \label{Fried11NMC} M_{Pl}^2 ( 2 \dot{H}+3 H^2)= -\xi \left[2 \dot{\phi}^2 f''(\phi)+4 H \dot{\phi} f'(\phi)+2 \ddot{\phi} f'(\phi) \right. \nonumber \\ +4 \left.f(\phi) \dot{H}+6 H^2 f(\phi)\right]-\frac{\dot{\phi}^2}{2}+V(\phi), \end{align} and the scalar-field equation of motion reads as: \begin{align}\label{KGinNMC} \ddot{\phi}+3 H \dot{\phi}- 6 \xi f'(\phi) \left(\dot{H}+2 H^2\right)+V'(\phi)=0~. \end{align} However, in order to calculate the inflationary observables, the convenient approach is to perform a conformal transformation, thus passing to the Einstein frame. By choosing $ \hat{g}_{\mu\nu}=\Omega^2(x) g_{\mu\nu}$, with \[ \Omega^2(x)=\frac{16\pi}{M_{Pl}^2} f(\phi)~, \] and defining a new scalar field $\varphi$ and potential $U$ such that \[ \frac{d\varphi}{d\phi}\equiv \sqrt{\frac{M_{Pl}^2}{8\pi}\frac{f(\phi)+3f'^2(\phi)}{2f^2(\phi)}}~, \] \[ U(\varphi)\equiv \Omega^{-4} V(\phi)~, \] then the action is brought to the Einstein-frame equivalent form \begin{align} S=\int d^4x\sqrt{-\hat{g}}\left[\frac{M_{Pl}^2}{2}\hat{R}-\frac{\partial_\mu \varphi \partial^\mu \varphi}{2}-U(\varphi) \right]~, \end{align} where the quantities in the Einstein frame are denoted with a hat. It has been shown that to first order one can write the spectral index and tensor-to-scalar ratio as \cite{Martin:2013tda} \begin{align} 1-n_s=6 \epsilon_U-2\delta_U~, \end{align} \begin{align} r=16\epsilon_U~, \end{align} where we have defined the slow-roll parameters \begin{eqnarray} &&\epsilon_U =\frac{M_{Pl}^2}{2}\left(\frac{U'}{U}\right)~,\\ && \delta_U=M_{Pl}^2\frac{U''}{U}~. \end{eqnarray} Moreover, it can be easily shown that for an arbitrary coupling $f(\phi)$ the $c_s^2$ of the GR+NMC scenario is identically equal to 1, by simple replacement of the above equations into equation \eqref{sspddef}. We mention here that in the Einstein frame the potential $U$ is essentially flat for large values of the NMC term ($\xi \phi^2 \gg M_{Pl}$), hence the field rolls very slowly and the slow-roll parameters $\epsilon_U$ and $\delta_U$ are very small, yielding a correspondingly small $r$. This last conclusion is what entails one of the basic results of single field, NMC, Higgs inflation with the coupling form $f(\phi)=\phi^2$. Nevertheless, as we mentioned above, these particularly attractive features of a very low $r$ and a long inflation, come at the cost of $\xi \phi^2 > M_{Pl}$, leading to non-unitarity. In order to solve this problem one should consider other couplings of the scalar field to gravity, as the one described in the next subsection. \subsection{Inflation with nonminimal derivative coupling} We now turn to the scenario according to which the generalized nonminimal derivative coupling is a stand-alone modification to GR. As we discussed in the Introduction in the general framework of Horndeski theories nonminimal derivative coupling (NMDC) holds a particular position, due to its attractive feature of ``gravitational friction'', i.e. the phenomenon according to which a single inflaton field, when rolling down a potential, stays in ``slow roll'' for a significantly lengthier period compared to GR. This results to an easier realization of inflation and a richer phenomenology, studied extensively in the literature \cite{Germani:2010gm,Sadjadi:2012zp, Ghalee:2013ada, Gumjudpai:2015vio,Gialamas:2020vto, Myung:2016twf, Ema:2015oaa, Ema:2016hlw, Fumagalli:2017}. However, among other effects it has been argued that a standalone NMDC modification to GR creates post-inflationary instabilities, due to the fact that the NMDC term remains dominant after the slow-roll period and this may lead to $c_s^2<0$. As a result, a further intuitive modification, dubbed generalized nonminimal derivative coupling (GNMDC) was proposed in \cite{Harko:2016xip,Dalianis:2019vit}, where it was shown that when the derivative coupling with the Einstein tensor is of the form $G(\phi)\partial_\mu\phi \partial_\nu\phi G^{\mu\nu}$, then this problem is significantly ameliorated. In particular, the action of this modification to GR can be written in the form \begin{align}\label{GNMDCaction} S=\int d^4x \sqrt{-g} \left[\frac{M_{Pl}^2}{2} R+G_5(\phi, X) G^{\mu\nu}\partial_\mu \partial_\nu \phi -V(\phi)\right]~, \end{align} where $G^{\mu\nu}$ is the Einstein tensor. Hence, by considering only a $\phi$-dependence of the $G_5$ function, the Friedmann equations of this scenario are \cite{Harko:2016xip,Dalianis:2019vit} \begin{align}\label{Fried00GNMDC} && 3 M_{Pl}^2 H^2=9 H^2 G(\phi) \dot{\phi}^2+\frac{1}{2} \dot{\phi}^2+V(\phi)~, \end{align} \begin{align} \label{Fried11GNMDC} M_{Pl}^2 ( 2 \dot{H}+3 H^2)&=V(\phi)-\frac{\dot{\phi}^2}{2} +2 H \dot{\phi}^3 G'(\phi)\nonumber \\ &+G(\phi) \left(2 \dot{H} \dot{\phi}^2+3 H^2 \dot{\phi}^2+4 H \dot{\phi} \ddot{\phi}\right)~, \end{align} while the scalar-field equation of motion reads as \begin{align}\label{KGinGNMDC} \ddot{\phi}&+V'(\phi)+3 H \dot{\phi}+3 H^2 \dot{\phi}^2 G'(\phi)\nonumber \\ &+G(\phi) \left(12 H H' \dot{\phi}+6 H^2 \ddot{\phi}+18 H^3 \dot{\phi}\right)=0~. \end{align} Note that the function $G(\phi)$ results from $G_5$, after integrating by parts, namely $G(\phi)=-G'_5(\phi)$. In the class of models that include a non-canonical kinetic term, the gravitational friction effect offers the ground for very efficient inflationary predictions, since the slow-roll conditions can be easily satisfied. In particular, in order to investigate inflation in the slow-roll approximation we define the slow-roll parameters \begin{equation} \begin{aligned}[t] \epsilon =-\frac{\dot{H}}{H^2}~, \end{aligned} \qquad \begin{aligned}[t] \delta = \frac{\ddot{\phi}}{H\dot{\phi}}~, \end{aligned} \end{equation} \begin{equation} \begin{aligned}[t] \epsilon_V =\frac{M_{Pl}^2}{2}\left(\frac{V'}{V}\right)^2~, \end{aligned} \qquad \begin{aligned}[t] \eta_V \equiv \frac{M_{Pl}^2}{2}\frac{V''}{V}~. \end{aligned} \end{equation} The slow-roll approximation holds when $\epsilon \ll 1$ and $\delta \ll 1$, and thus $\dot{H} \ll H^2$ and $\ddot{\phi}\ll 3H\dot{\phi}$, and in this case the Friedmann equations \eqref{Fried00GNMDC}, \eqref{KGinGNMDC} are simplified to \begin{align} \label{fried00inGRNMDCSRA} 3 M_{Pl}^2 H^2\approx V(\phi)~, \end{align} \begin{align} \label{KGinGRNMDCSRA} 3H\dot{\phi} \left[1 +6G(\phi)H^2+G'(\phi) H \dot{\phi} \right] +V'(\phi) \approx 0~. \end{align} Hence, under the slow-roll approximations, the first slow-roll parameter, $\epsilon$, can then be written in the form \begin{align} \label{epsilonbroken} \epsilon \approx \epsilon_\text{GR}+\epsilon_D+\epsilon_{\cal{B}}~, \end{align} where \begin{equation} \begin{aligned}[t] \epsilon_D\equiv \frac{3G(\phi) \dot{\phi}^2}{M_{Pl}^2}~, \end{aligned} \qquad \begin{aligned}[t] \epsilon_{\cal B}\equiv \frac{\dot{\phi}^2}{ M_{Pl}^2 H^2} G'(\phi) H \dot{\phi}~, \end{aligned} \end{equation} These two functions correspond to $\epsilon_{G1}$ and $\epsilon_{G4}$ of equation \eqref{auxilepsilons} that we will later use. Moreover, \begin{align} \epsilon_\text{GR}\equiv \frac{ \dot{\phi}^2}{2 M_{Pl}^2 H^2}~, \end{align} where the quantity $\epsilon_\text{GR}$ corresponds to the result of the GR case, while $\epsilon_D$ is the leading term during slow-roll. The GNMDC term has the effect of decreasing the $\epsilon$ parameter and hence increases the slow-roll period. In fact, in the slow-roll approximation, equation \eqref{epsilonbroken} can be brought to the form \begin{align} \label{epsilonwithcal} \epsilon=\epsilon_V \frac{\mathcal{A}- 2\mathcal{B}}{\left(\mathcal{A}+\mathcal{B}\right)^2}~, \end{align} with ${\cal A } \equiv1+6H^2 G(\phi)$ and $ {\cal B} \equiv G'(\phi)H\dot{\phi}$. Additionally, the squared sound speed of the scalar perturbations is found to be \cite{Dalianis:2019vit} \begin{align}\label{cssqGRNMDC} c_s^2= &\left[1-\frac{\epsilon_D}{3} +6H^2 G(\phi) (1+\epsilon_D) \right]^{-1}\cdot \nonumber \\ \cdot&\Bigl\{1+\epsilon_D +6H^2 G(\phi)\left[ 1+ \epsilon_D+\frac{4 \epsilon_D(1-\epsilon_D)}{3(3-\epsilon_D)} \right] \Bigr.\nonumber \\ &\Bigl.\text{ } +12{\dot{H}} G(\phi) \left({1-\frac{\epsilon_D}{3}}\right) \Bigr\}~. \end{align} Furthermore, we can approximate the number of e-folds as \cite{Dalianis:2019vit} \begin{align} N \approx \frac{1}{M_{Pl}} \int_{\phi_{end}}^{\phi} \frac{\mathcal{A}+\mathcal{B}}{\sqrt{2\epsilon_V}} d\phi~. \end{align} As one can see, for $G(\phi)\rightarrow 0$ all the above expressions restore the canonical case. Finally, concerning the inflationary observables, the scalar power spectrum can be brought to the form \cite{Dalianis:2019vit} \begin{align} \label{PsinGRNMDC} \mathcal{P}_\mathcal{R}=\frac{H^2}{8 \pi^2 M_{Pl}^2 \epsilon_V} \left[\mathcal{A} + \mathcal{B} +\mathcal{O}\left(\frac{\mathcal{B}^2}{\mathcal{A}}\right) \right]~, \end{align} the scalar spectral index becomes \begin{align}\label{nsinGRNMDC} 1-n_s\approx 8\epsilon-2\eta+\epsilon M_{Pl} \frac{G'(\phi)}{G(\phi)}\sqrt{\frac{2}{\epsilon_V}}~, \end{align} with $\eta\equiv \frac{\eta_V}{\mathcal{A}}$, whilst the tensor-to-scalar ratio is written as \begin{align}\label{rinGRNMDC} r=16\frac{\epsilon_V}{\mathcal{A}+\mathcal{B}}~. \end{align} Let us now consider a specific model of GNMDC. In particular, we will focus on the case \begin{align}\label{Fphiform} G(\phi)=\frac{\alpha \phi^{\alpha-1}}{2M^{\alpha+1}}, \end{align} which recovers the simple NMDC for $\alpha=1$ (see \cite{Dalianis:2019vit} for the different case of $G(\phi)=\frac{e^{\tau\phi/M_{Pl}}}{M^2}$). Within the framework of this particular modification, it can be shown that as $\alpha$ becomes larger then the post-inflationary instabilities related to $c_s^2<0$ become significantly shorter as compared to the simple NMDC $(\alpha=1)$. This effect results from the fact that near the bottom of the potential the GNMDC term is not dominant and GR takes over, which in turn results from the fact that the more the $\alpha$ parameter grows the more dominant becomes the gravitational friction effect and this allows the scale of the theory $\frac{1}{M^{\alpha+1}}$ (needed to produce a long enough inflation) to decrease significantly. Concerning the observables, it can be shown that, for a given value of the scalar power spectrum $\mathcal{P}_{\mathcal{R}}$, while a growing $\alpha$ parameter ameliorates the instability problem, it additionally affects the values of the spectral index $n_s$ and the tensor-to-scalar ratio. In particular, while $r$ becomes smaller, $n_s$ increases and tends to the outside of the observationally determined Planck likelihood contours, if one seeks to build a 60 e-fold model \cite{Dalianis:2019vit}. Similar results can be obtained if one uses as $G(\phi)$ a polynomial instead of a monomial form, namely $G(\phi)=\sum_{i}\frac{\alpha_i \phi^{\alpha_i-1}}{2M_i^{\alpha_i+1}}$. In order for a coupling of such a form to produce a different phenomenology than the one studied in the monomial case, its various terms must be of comparable magnitude. If this is not the case, then the leading monomial term determines the phenomenology. Finding the scales, $M_i$, so that different terms are comparable is a non-trivial task. In \cite{Dalianis:2019vit}, a constraint between the scale $M$, the parameter $\alpha$ and the initial values $\phi_*,\dot{\phi}_*$ was found (similar to Eq. \eqref{Consinfull} below). This constraint creates a part of the phase space that is forbidden, which proves problematic when one seeks to build a model with an even value of $\alpha$. This issue is carried over in the polynomial GNMDC case, if a term that corresponds to an even value of $\alpha$ becomes important, posing yet another problem for the polynomial case. However, this is significantly ameliorated in the combined theory proposed in this paper (when the NMC term is turned on in Eq. \eqref{Consinfull}), as we discuss later. In summary, if one has a polynomial form of $G(\phi)$ or obtains such a polynomial form through quantum corrections \cite{Fumagalli:2020}, the non-leading terms will either make an insignificant contribution in phenomenology, or in order to affect it they have to be fine tuned in terms of $\alpha$ and $M_i$. \section{Nonminimal coupling and generalized nonminimal derivative coupling combined} \label{combined} In the previous Section we presented the inflationary realization of each of the standalone modifications to GR, namely of the nonminimal coupling (NMC) and of the generalized nonminimal derivative coupling (GNMDC). As we mentioned, the NMC can lead to observables in very good agreement with observations, however it possesses the known unitarity problem, while the $\alpha=1$ GNMDC solves the unitarity violation but it leads to $c_s^2$-instabilities, while the $\alpha>1$ GNMDC solves the unitarity, but only ameliorates the $c_s^2$ issues while making the observable predictions less attractive, in terms of the spectral index. Keeping the above behaviors in mind, in this section we construct the combination of the scenarios of NMC and GNMDC, intending to maintain their separate advantages while removing their separate disadvantages. \subsection{The model} We considered the combined action of the form \begin{align}\label{NMCGNMDCaction} S=\int d^4x \sqrt{-g} \left[\mathcal{L}_{GR}+\mathcal{L}_{\phi}+\mathcal{L}_{NMC} +\mathcal{L}_{GNMDC}\right], \end{align} with \begin{eqnarray}\label{lagrangianparts} &&\mathcal{L}_{GR}=\frac{M_{Pl}^2}{2} R~, \nonumber\\ && \mathcal{L}_{\phi}=-\frac{1}{2} g^{\mu\nu}\partial_\mu \phi \partial_\nu \phi -V(\phi)~, \nonumber\\ && \mathcal{L}_{NMC}=\xi f(\phi) R~, \nonumber\\ && \mathcal{L}_{GNMDC}=G(\phi) G^{\mu\nu}\partial_\mu \phi \partial_\nu \phi~. \end{eqnarray} Variation in terms of the metric gives rise to the field equations as \begin{align}\label{fullfeq} G_{\mu\nu}&=\frac{1}{M_{Pl}^2}\left[T_{\mu\nu}^{(\phi)}+\xi T_{\mu\nu}^{(NMC)}-2 G(\phi) T_{\mu\nu}^{(NMDC 1)}\right.\nonumber \\ &\left.\ \ \ \ \ \ \ \ \ \ \ \ -G'(\phi) T_{\mu\nu}^{(NMDC 2)}\right]~, \end{align} while variation in terms of the scalar field leads to the Klein-Gordon equation \begin{align}\label{fullKG} \Box\phi&-G_{\mu\nu}\left[ 2 G(\phi) \nabla^\mu \nabla^\nu \phi+G'(\phi) \nabla^\mu \phi \nabla^\nu \phi \right]\nonumber \\ & +\xi f'(\phi) R-V'(\phi)=0~, \end{align} where \begin{align}\label{fullfeqparts} T_{\mu\nu}^{(\phi)}= \nabla_\mu \phi\nabla_\nu \phi-\frac{1}{2}g_{\mu\nu}\nabla_\lambda \phi \nabla^\lambda \phi-g_{\mu\nu} V(\phi)~, \end{align} \begin{align} T_{\mu\nu}^{(NMC)} &=-2 f(\phi) \left[R_{\mu\nu}-\frac{1}{2}g_{\mu\nu}R\right]\nonumber\\ &-2 f'(\phi)\left[g_{\mu\nu}\Box\phi-\nabla_\mu \nabla_\nu \phi\right]\nonumber\\ & -2 f''(\phi)\left[g_{\mu\nu}\nabla_\lambda \phi \nabla^\lambda \phi-\nabla_\mu\phi \nabla_\nu \phi\right]~, \end{align} \begin{align} &T_{\mu\nu}^{(NMDC 1)} = -G_{\mu\nu}\nabla_\lambda\phi \nabla^\lambda\phi+4 R^{\lambda}_{\text{ }\text{ }(\mu}\nabla_{\nu)}\phi\nabla_\lambda\phi \nonumber\\ & +2 [\nabla^\kappa\phi \nabla^\lambda\phi R_{\mu\kappa\nu\lambda} +\nabla_\mu\nabla^\lambda\phi\nabla_\nu\nabla_\lambda\phi-\nabla_\nu\nabla_\mu \phi\nabla^2\phi]\nonumber \\ &+g_{\mu\nu}[ \nabla^2\phi\nabla^2\phi-\nabla_\kappa\nabla_\lambda\phi\nabla^\kappa \nabla^\lambda\phi-2 R_{\kappa\lambda}\nabla^\kappa\phi\nabla^\lambda\phi]\nonumber \\ &-\nabla_\mu\phi\nabla_\nu\phi R~, \end{align} \begin{align} T_{\mu\nu}^{(NMDC 2)} &= g_{\mu\nu}(\nabla_\lambda\phi\nabla^\lambda\phi \nabla^2\phi-\nabla^\kappa\phi\nabla^\lambda\phi\nabla_\kappa\nabla_\lambda\phi) \nonumber\\ & +2\nabla^\lambda\phi\nabla_{(\mu}\phi\nabla_{\nu)}\nabla_\lambda\phi -\nabla_\lambda\phi\nabla^\lambda\phi\nabla_\nu\nabla_\mu\phi\nonumber\\ & -\nabla_\mu\phi \nabla_\nu\phi\nabla^2\phi~, \end{align} with the indices in parentheses denoting symmetrization. As expected, for $G(\phi)\rightarrow 0$ we recover the GR+NMC case, while for $f(\phi)\rightarrow 0$ we re-obtain the GR+GNMDC case. Applying the above general field equations in the FRW metric (\ref{FRWmetric}) we extract the two Friedmann equations as \begin{align}\label{fried00full} \rho_\phi\equiv 3 M_{Pl}^2 H^2&=\frac{\dot{\phi}^2}{2}+V(\phi)+9 G(\phi) H^2 \dot{\phi}^2\nonumber \\ &-6 \xi \left[f(\phi) H^2+f'(\phi) \dot{\phi} H\right], \end{align} \begin{align}\label{fried11full} -p_\phi &\equiv M_{Pl}^2 \left(3 H^2+2 \dot{H}\right)=V(\phi)-\frac{\dot{\phi}^2}{2}+\nonumber \\ &+G(\phi)\left(3H^2 \dot{\phi}^2+2\dot{H}\dot{\phi}^2+4 H \dot{\phi}\ddot{\phi}\right)+2G'(\phi) H \dot{\phi}^3\nonumber \\ &-2 \xi \left[ 3 f(\phi) H^2+2 f(\phi)\dot{H}+2 H f'(\phi)\dot{\phi}+\dot{\phi}^2f''(\phi) \right.\nonumber \\ &\left.+f'(\phi)\ddot{\phi}\right], \end{align} where for convenience we have introduced the effective energy density $\rho_\phi$ and pressure $p_\phi$ for the scalar field. Additionally, the Klein-Gordon equation (\ref{fullKG}) becomes \begin{align}\label{KGfull} \ddot{\phi} &\left(1+6 G(\phi) H^2 \right)+3 H \dot{\phi} (1+6 G(\phi) H^2+4 G(\phi)\dot{H})\nonumber \\ &+3 H^2 G'(\phi)\dot{\phi}^2-6 \xi f'(\phi) (\dot{H}+2H^2)+V'(\phi)=0~. \end{align} We mention that combining the above equations, one deduces that in order for the scalar field to obtain real values then the quantity \begin{align}\label{Consinfull} {\cal{Q}}&\equiv 6 \xi ^2 \dot{\phi}^2 f'(\phi)^2+\xi \left(2 f(\phi) \dot{\phi}^2+4 f(\phi) V(\phi)\right)\nonumber \\ &+G(\phi) \left(-3 \dot{\phi}^4-6 \dot{\phi}^2 V(\phi)\right)+M_{Pl}^2 \dot{\phi}^2+2 M_{Pl}^2 V(\phi)~, \end{align} must be positive. \subsection{Slow Roll Inflation and the three regimes} From a theoretical perspective, if one investigates a theory that combines two different terms, it is expected that there will be three different regimes, that one would need to study, depending on their relative magnitude: one where the GNMDC is dominating and NMC is a small correction, one that NMC dominates and GNMDC acts as a small correction, and finally a regime where the two terms are roughly of the same order. Before discussing each one individually, and in order to facilitate the following discussion, we first provide the general slow-roll framework of this theory. In the slow-roll approximation, namely when $\dot{H} \ll H^2$, $\dot{\phi} \ll H$, and $\ddot{\phi}\ll 3H\dot{\phi}$, and keeping the leading terms of GNMDC and NMC, the first Friedmann equation (\ref{fried00full}) becomes \begin{align} \label{F00fullSRA} 3 M_{Pl}^2 H^2=9 G(\phi) H^2 \dot{\phi}^2-6 \xi f(\phi) H^2+V(\phi)~, \end{align} while the Klein-Gordon equation (\ref{KGfull}) is simplified as \begin{align} \label{KGfullSRA} 3H\dot{\phi} \left( 1+6G(\phi) H^2\right)-12H^2 \xi f'(\phi)+V'(\phi)=0~. \end{align} Note that regarding $f'(\phi)$ and $f(\phi)$, since we focus in monomial $f(\phi)$ forms which give $f'(\phi)>f(\phi)$ in the small field scenarios ($\phi<M_{Pl}$), we deduce that the difference is less important than that between $\dot{\phi}$ and $H$ due to the slow-roll, and hence we keep only the $f(\phi)H^2$ term. This approximation will be a posteriori shown to hold in the numerical analysis of the next section, see Fig. \ref{fig:fulltheorycompare4}. Using equations \eqref{fried00full} and \eqref{fried11full} we can obtain the exact form of the slow-roll parameter $\epsilon=-\frac{\dot{H}}{H^2}$ as \begin{align}\label{epsilonanalytic} \epsilon=\epsilon_{GR}&+\epsilon_{G1}+\epsilon_{G2}+\epsilon_{G3}+\epsilon_{G4}\nonumber \\ &+\epsilon_{N1}+\epsilon_{N2}+\epsilon_{N3}+\epsilon_{N4}~, \end{align} where we have introduced the following auxiliary parameters \begin{align*} \epsilon_{GR} = \frac{\dot{\phi}^2}{2 M_{Pl}^2 H^2}~, \end{align*} \begin{eqnarray} && \epsilon_{G1} = \frac{3 \dot{\phi}^2 G(\phi)}{M_{Pl}^2}~, \quad \epsilon_{G2} = -\frac{\dot{\phi}^2 \dot{H} G(\phi)}{M_{Pl}^2 H^2}~, \nonumber \\ && \epsilon_{G3} = -\frac{2\dot{\phi} \ddot{\phi} G(\phi)}{M_{Pl}^2 H}~, \quad \epsilon_{G4} = -\frac{G'(\phi)\dot{\phi}^3}{M_{Pl}^2 H}~, \nonumber \\ && \epsilon_{N1} = \frac{2\xi f(\phi) \dot{H}}{M_{Pl}^2 H^2}~, \quad \epsilon_{N2} = -\frac{\xi f'(\phi) \dot{\phi}}{M_{Pl}^2 H}~, \nonumber\\ && \epsilon_{N3} = \frac{\dot{\phi}^2 \xi f''(\phi)}{M_{Pl}^2 H^2}~, \quad \epsilon_{N4} = \frac{\xi f'(\phi) \ddot{\phi}}{M_{Pl}^2 H^2}~. \label{auxilepsilons} \end{eqnarray} These separate parameters will be useful in order to quantify which specific term of the theory dominates the inflationary realization, and in particular the $\epsilon_{Gi}$ are related to the GNMDC while the $\epsilon_{Ni}$ are related to the NMC ($i$ runs from 1 to 4), while $\epsilon_{GR} $ is the usual slow-roll parameter of minimally coupled, single-field inflation. From our previous discussion it becomes clear that in the slow-roll era the only important terms should be $\epsilon_{G1}$, $\epsilon_{N1}$ and $\epsilon_{N2}$. We can now move on to calculate the various perturbative functions, as functions of the auxiliary parameters defined above. Using the definitions in Appendix \ref{perturbations} we find \begin{align} &\mathcal{G}_T=M_{Pl}^2\left(1-\frac{\epsilon_{G1}}{3}-\frac{\epsilon_{N1}}{\epsilon} \right)~. \\ &\mathcal{F}_T=M_{Pl}^2\left(1+\frac{\epsilon_{G1}}{3}-\frac{\epsilon_{N1}}{\epsilon} \right)~, \\ & \Sigma=M_{Pl}^2 H^2\left(\epsilon_{GR}+6\epsilon_{G1}+6\epsilon_{N2}+3\frac{\epsilon_{N1}}{ \epsilon } -3\right)~, \\ & \Theta=M_{Pl}^2 H (1-\epsilon_{G1}-\epsilon_{N2}-\frac{\epsilon_{N1}}{\epsilon})~, \end{align} \begin{eqnarray} && \!\!\!\!\!\!\!\!\!\!\!\!\! \mathcal{G}_s=-\frac{M_{Pl}^2}{9} \left[\epsilon_{N1}+\epsilon(\epsilon_{G1}+\epsilon_{N2}-1)\right]^{-2} \nonumber \\ &&\!\!\!\!\cdot \left[ \epsilon (\epsilon_{G1}-3)+3\epsilon_{N1}\right]\left\{-3\epsilon_{N1} (\epsilon_{G1}+\epsilon_{GR}) \right. \nonumber \\ && \! \!\!\!\left. \! + \epsilon\! \left[ 3\epsilon_{G1}^2\!+\!3\epsilon_{GR}\!+\!9\epsilon_{N2}^2 +\epsilon_{G1} (3\!-\!\epsilon_{GR}\!+\!12 \epsilon_{N2})\right]\!\right\}\! , \end{eqnarray} \begin{eqnarray} && \!\!\! \mathcal{F}_s = -\frac{M_{Pl}^2}{9 [\epsilon(\epsilon_{G1}+\epsilon_{N2}-1)+\epsilon_{N1}]^2} \notag \\ && \ \ \ \cdot \Big\{ \epsilon^2 \left\{\epsilon_{G1}^2 \left[7 \epsilon_{N1}+17 \epsilon_{N2}+\epsilon_{N3}-4\right.\right. \notag \\ &&\left. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ -3\left(\epsilon_{G3}+\epsilon_{G4}+\epsilon_{N4}\right)-4\right] \nonumber \\ && \ \ \ \ \ +4 \epsilon_{G1}^3+3 \epsilon_{G1} \left[2 \epsilon_{G3}-2 \epsilon_{G4} (\epsilon_{N2}-1)-10 \epsilon_{N1}\right. \notag \\ && \left. \ \ \ \,\ -2 \epsilon_{N3} +5 \epsilon_{N2} (\epsilon_{N2}-2) +2 \epsilon_{N4}\right]+9 \left(2 \epsilon_{G4} \epsilon_{N2} \right.\nonumber \\ && \ \ \ \ \left. \left.+\epsilon_{G3}+\epsilon_{G4}+3 \epsilon_{N1}-3 \epsilon_{N2}^2+\epsilon_{N2}+\epsilon_{N3}+\epsilon_{N4}\right)\right\} \notag \\ && \ \ \ \ \left.+\epsilon \epsilon_{N1} \left[\epsilon_{G1} (-6 \epsilon_{G3}-6 \epsilon_{G4}+15 \epsilon_{N1}+30 \epsilon_{N2}+6 \epsilon_{N3} \right.\right.\nonumber \\ &&\left.\left. \ \ \ \ \ \ \ \ \,\ \ \ \ -6 \epsilon_{N4})-9 \left(2 \epsilon_{G3}+2 \epsilon_{G4} (\epsilon_{N2}+1)+3 \epsilon_{N1} \notag \right.\right.\right.\\ && \ \ \ \ \ \ \ \ \,\ \ \ \ \left.\left.+2 (\epsilon_{N2}+\epsilon_{N3}+\epsilon_{N4})-3 \epsilon_{N2}^2\right)+4 \epsilon_{G1}^2\right] \nonumber \\ & & \ \ \ \ +\epsilon^3 (\epsilon_{G1}-3)^2 (\epsilon_{G1}-1) \nonumber \\ & & \ \ \ \ +9 \epsilon_{N1}^2 (\epsilon-\epsilon_{GR}-\epsilon_{G1}-\epsilon_{G2})\Big\}. \end{eqnarray} We can now proceed to calculate the soundspeed of the theory. If we insert these equations into the definition of the sounspeed \eqref{sspddef} we obtain \begin{eqnarray} && \!\!\!\!\!\! c_s^2 = \left\{\epsilon \left[\epsilon_{G1} (12 \epsilon_{N2}-\epsilon_{GR}+3)+3 \left(\epsilon_{G1}^2+\epsilon_{GR}+3 \epsilon_{N2}^2\right)\right]\right. \notag \\ && \ \ \ \ \, \left.-3 \epsilon_{N1} (\epsilon_{G1}+\epsilon_{GR})\right\}^{-1} \left[\epsilon (\epsilon_{G1}-3)+3 \epsilon_{N1}\right]^{-1} \notag \\ && \ \ \ \, \cdot \Big\{\epsilon^2 \left\{\epsilon_{G1}^2 \left[7 \epsilon_{N1}+17 \epsilon_{N2}+\epsilon_{N3}\right.\right. \notag \\ && \ \ \ \ \ \, \ \ \ \ \ \ \left. -3 \left(\epsilon_{G3}-\epsilon_{G4}-\epsilon_{N4}\right)-4\right] \notag \\ && \ \ \ \ \ \ +3 \epsilon_{G1} \left[5 (\epsilon_{N2}-2)\epsilon_{N2} -2 \epsilon_{G4} (\epsilon_{N2}-1) -10 \epsilon_{N1}\right. \notag \\ && \ \ \ \ \, \ \ \ \ \ \ \ \ \ \ \, \left. +2 \left(\epsilon_{G3}-\epsilon_{N3}+\epsilon_{N4}\right)\right] \notag \\ && \ \ \ \ \ \ +4 \epsilon_{G1}^3+9 \left(\epsilon_{G3}+2 \epsilon_{G4} \epsilon_{N2}+\epsilon_{G4}+3 \epsilon_{N1}\right. \notag \\ && \left.\left.\ \ \ \ \ -3 \epsilon_{N2}^2+\epsilon_{N2}+\epsilon_{N3}+\epsilon_{N4}\right)\right\} \notag \\ && \ \ \ \ \ \, +\epsilon \epsilon_{N1} \left\{\epsilon_{G1} \left[6\left( \epsilon_{N3}- \epsilon_{G3}- \epsilon_{G4}- \epsilon_{N4}\right)\right.\right. \notag \\ && \left.\ \ \ \ \ \ \ \ \, \ \ \ \ \ \, +15 \epsilon_{N1}+30 \epsilon_{N2}\right] \notag \\ && \ \ \ \ \ \, +4 \epsilon_{G1}^2-9 \left[2 \epsilon_{G3}+2 \epsilon_{G4} (\epsilon_{N2}+1)+3 \epsilon_{N1} \right. \notag \\ &&\left.\left. \ \ \ \ \ \ \ \ \, \ \ \ \ \ +2 (\epsilon_{N2}+\epsilon_{N3}+\epsilon_{N4})-3 \epsilon_{N2}^2\right]\right\} \notag \\ && \ \ \ \ \ \, +\epsilon^3 (\epsilon_{G1}-3)^2 (\epsilon_{G1}-1) \notag \\ && \ \ \ \, +9 \epsilon_{N1}^2 (\epsilon_{G3}+\epsilon_{G4}+\epsilon_{N1}+\epsilon_{N2}+\epsilon_{N3}+\epsilon_{N4})\Big\}, \label{soundspeedgene} \end{eqnarray} which is an exact expression. Let us consider its various limits. First, in the GR limit, where $\epsilon_{Gi}$, $\epsilon_{Ni} \rightarrow 0$, we can see that $c_s^2 $ becomes identically equal to 1 as expected. The same holds in the NMC limit, where $\epsilon_{Gi} \rightarrow 0$, again as expected. Moreover, in the GNMDC limit, where $\epsilon_{Ni}\rightarrow 0$, we acquire \begin{align}\label{csgnmdclimit} {c_s^2}&=\frac{1}{(\epsilon_{G1}-3) (3 \epsilon_{G1} (\epsilon_{G1}+1)-(\epsilon_{G1}-3) \epsilon_{GR})}\cdot \nonumber \\ &\cdot \left\{ \epsilon (\epsilon_{G1}-1) (\epsilon_{G1}-3)^2+9 (\epsilon_{G3}+\epsilon_{G4})+\right.\nonumber \\ &\left.\epsilon_{G1} \left[\epsilon_{G1} (4 \epsilon_{G1}-3 \epsilon_{G3}-3 \epsilon_{G4}-4)+6 (\epsilon_{G3}+\epsilon_{G4})\right]\right\}, \end{align} which using the definitions (\ref{auxilepsilons}) gives expression \eqref{cssqGRNMDC}. However, in general we would like to extract more information about the behavior of the full equation \eqref{soundspeedgene}. A detailed manipulation of this equation is quite tedious and is not included here, however there is a clear note to be made based on it. If we use equation \eqref{epsilonanalytic}, to substitute $\epsilon$ with the auxiliary $\epsilon$ functions, we end up with an expression of the form \begin{align}\label{csorder} c_s^2-1\approx\frac{\mathcal{O}(\epsilon_{Gi})}{f_{\epsilon}(\epsilon_{Ni}, \epsilon_{GR})+\mathcal{O}(\epsilon_{Gi})}, \end{align} where $f_{\epsilon}$ is a function that does not depend on the $\epsilon_{Gi}$ while $\mathcal{O}(\epsilon_{Gi})$ is a function at least linear in $\epsilon_{Gi}$. Hence, the denominator is of greater order of magnitude as compared to the nominator of this fraction, when Slow Roll has ended and the NMC terms completely take over, if one chooses a derivative coupling that vanishes towards the bottom of the potential. This implies that $c_s^2 \equiv 1$, which is, in fact, one of the main results of this work: the inclusion of NMC and a vanishing $\phi$-dependent GNMDC, regardless its exact form, can completely heal the $c_s^2$ instabilities of derivative coupling (see also Fig. \ref{fig:fulltheorycompare3} for corresponding numerical results). This was expected because the NMC term has a sound speed identically equal to 1 and its terms remain dominant after the end of the slow roll. On the other hand, using the same rationale with equation \eqref{csgnmdclimit}, we can show that in the GNMDC limit we acquire \begin{align} c_s^2-1\approx\frac{\mathcal{O}(\epsilon_{Gi})}{\mathcal{O}(\epsilon_{Gi})}. \end{align} This fraction, is obviously non-zero in general, and in particular it can be larger or smaller than 1. This reconfirms the results of \cite{Dalianis:2019vit}, regarding the squared sound-speed oscillations between negative and superluminal values. \subsubsection*{Regime 1: \textbf{NMC $\gg$ GNMDC}} If one would like to study the case where the GNMDC term is negligible compared to the NMC term during the slow-roll era, then observing equations \eqref{F00fullSRA}, \eqref{KGfullSRA}, there are two requirements that should be satisfied, namely \begin{align} \xi \gg \frac{G(\phi)}{f'(\phi)}H\dot{\phi}~, \end{align} and \begin{align} \xi \gg \frac{G(\phi)}{f(\phi)}\dot{\phi}^2~, \end{align} where, based on our previous discussion, we deduce that the former is actually stronger than the latter. Nevertheless, we should mention here that the GNMDC form (\ref{Fphiform}) on which we will focus on in this work, turns off at the end of inflation, hence, if we enforce the above constraints then the GNMDC will be unimportant throughout the field's evolution. Thus, this case would bear practically no effect in both the early and late stages phenomenology, and therefore we will not investigate it further. \subsubsection*{Regime 2: \textbf{GNMDC $\gg$ NMC}} In order to realize this regime of GNMDC domination, using equations \eqref{F00fullSRA} and \eqref{KGfullSRA} we extract the requirements \begin{align} \xi \ll \frac{G(\phi)}{f'(\phi)}H\dot{\phi}~, \end{align} and \begin{align} \xi \ll \frac{G(\phi)}{f(\phi)}\dot{\phi}^2~, \end{align} where the latter is stronger than the former if the dynamics of the NMC are to be negligible in the slow-roll era. However, unlike the previous case where GNMDC $\ll$ NMC, the post-slow-roll dynamics cannot be studied without the NMC terms. This is due to the fact that a $\phi$-dependent GNMDC quickly becomes subdominant near the bottom of the potential, in the post-slow-roll regime. Hence, this case should be studied in more detail, and in particular to examine the sound speed squared, since in the sole GNMDC model the derivative coupling has been shown to create instabilities due to $c_s^2<0$. Specifically, as discussed and shown with eq. \eqref{csorder}, we are interested in investigating whether the inclusion of the NMC term corrects the $c_s^2$ values towards 1, compared to the standalone GNMDC case. A theoretical indication towards this direction is that the NMC sound speed is identically equal to 1, and since the NMC should take over (or at least be comparable) with GNMDC in the post-slow-roll period it is expected that the sound speed will be corrected, albeit the magnitude of this correction remains to be found, since eq. \eqref{csorder} is only qualitative. Instead, of providing explicit results here, we will do it in the analysis of the next regime, namely where NMC $\approx$ GNMDC. \subsubsection*{Regime 3: \textbf{NMC $\approx$ GNMDC}} We can now proceed to the investigation of the case where NMC and GNMDC terms are of the same order. We start with the slow-roll dynamical equations presented above. To enforce NMC $\approx$ GNMDC we can choose between the two requirements presented earlier, one of which is stronger. For simplicity we will choose the weaker constraint which nevertheless is adequate for the results of our model. In particular, we enforce \begin{align} \xi f'(\phi)\approx G(\phi) H \dot{\phi}~, \end{align} while still \begin{align} \xi f(\phi) \gg G(\phi) \dot{\phi}^2~, \end{align} and we additionally require that the GR terms are negligible compared to the GNMDC and NMC ones during the slow-roll era. Then, the scalar-field equation \eqref{KGfullSRA} becomes \begin{align} \label{KGfullSRAnext} 18 G(\phi) H^3 \dot{\phi}+V'(\phi)=12 H^2 \xi f'(\phi)~, \end{align} while the Friedmann equation \eqref{F00fullSRA} is significantly simplified and becomes \begin{align} \label{F00fullSRAnext} 3 M_{Pl}^2 H^2+6 \xi f(\phi) H^2=V(\phi)~. \end{align} Based on the discussion following equations \eqref{F00fullSRA} and \eqref{KGfullSRA}, regarding the slow-roll approximations, the dominant parameters during the slow-roll period are $\epsilon_{G1}$, $\epsilon_{N1}$ and $\epsilon_{N2}$. Hence, if we are interested in the early phase's predictions we can, as a first approximation, keep only the first-order contributions with regards to these parameters. We thus acquire \begin{align} \mathcal{F}_s=\mathcal{G}_s \approx M_{Pl}^2 \epsilon_{G1}~. \end{align} Inserting this into the squared sound-speed relation (\ref{sspddef}) we obtain $c_s^2=1$ during the slow-roll period (equivalently maintaing only $\epsilon_{G1}$, $\epsilon_{N1}$ and $\epsilon_{N2}$ in the general expression (\ref{soundspeedgene}) gives $c_s^2=1$). We proceed by calculating the inflationary observables. Using expression (\ref{PsandPtdef}), for the power spectrum at first order we obtain \begin{align} \mathcal{P}_\mathcal{R} \approx \frac{H^2}{8M_{Pl}^2\pi^2 \epsilon_{G1}}~, \end{align} which coincides with \eqref{PsinGRNMDC} if one keeps only the first order contribution. Interestingly enough, at first order the NMC term does not have an effect on the scalar power spectrum value, since the only $\epsilon$ parameter appearing is $\epsilon_{G1}$. Concerning the tensor-to-scalar ratio $r$, using (\ref{PsandPtdef}), (\ref{rdef}) we find \begin{align} \label{rprediction} r &\approx 16 \epsilon_{G1}+\frac{16\epsilon_{G1}}{\epsilon_{G1}+\epsilon_{N2}}\epsilon_{N1}~. \end{align} Unlike the scalar power spectrum, this result clearly shows the effect of the combined theory. In particular, during slow-roll we have $\epsilon_{N1}<0$, which implies that the NMC term lowers the standard result, which is $r=16 \epsilon_{G1}$, namely improving the tensor-to-scalar ratio to values that are in better agreement with the observations. Hence, the very low tensor-to-scalar ratio, which is a characteristic result of the NMC term, is maintained in the combined theory. Concerning the scalar spectral index, $n_s$, using (\ref{PsandPtdef}), (\ref{nsdefgene}) in the case of the present combined scenario we obtain: \begin{align} n_s \approx 1+\frac{-3 (\epsilon_{G3}+\epsilon_{G4})+2\epsilon_{G1}(\epsilon_{G1}+\epsilon_{N1}+\epsilon_{N2})}{ \epsilon_{G1}(\epsilon_{G1}+\epsilon_{N1}+\epsilon_{N2}-1)}~. \end{align} Note that here we cannot ignore the terms $\epsilon_{G3}$, $\epsilon_{G4}$ as we have done until now, since the rest of the terms are of second order in the $\epsilon$ parameters. As expected, when the NMC-related parameters go to zero we can recover the result (\ref{nsinGRNMDC}) of the standalone GNMDC model. In summary, when a $\phi$-dependent GNMDC and the NMC terms are comparable, the scenario can be completely healed from the $c_s^2<0$ unstable region. Additionally, the value of the tensor-to-scalar ratio not only remains inside the Planck 2018's contour plots, but it is increasingly improving as the NMC contribution becomes more significant. Finally, the scenario can, in principle, be healed from the unitarity problem, because as the GNMDC term becomes more significant in the slow-roll period, the magnitude of $\xi \phi_*^2$ decreases significantly. These features make the combined scenario at hand better than its individual counterparts. We emphasize that all the above results hold as long as $G(\phi)$ is $\phi$-dependent, and thus at the bottom of the potential it becomes negligible. \section{Numerical investigation} \label{specificstandalones} In this Section we perform a full numerical study, in order to demonstrate, by use of specific examples, the general results of our theory obtained in the previous Section, most importantly equations \eqref{csorder} and \eqref{rprediction}. To satisfy the ansatz that GNMDC becomes negligible at the end of inflation we choose a monomial or polynomial form for $G(\phi)$, however other similar forms still produce viable results. To numerically elaborate, we consider, then, specific NMC and GNMDC functions. For the former, i.e for the coupling function $f(\phi)$ we choose the most well-studied case of the standalone NMC scenario, namely $f(\phi)=\xi \phi^2$, while for the latter we consider the well-studied monomial form (\ref{Fphiform}), namely $ G(\phi)=\frac{\alpha \phi^{\alpha-1}}{2M^{\alpha+1}}$~. We then provide and discuss an example with a polynomial form $ G(\phi)=\sum_{i}\frac{\alpha_i \phi^{\alpha_i-1}}{2M_i^{\alpha_i+1}}$. Additionally, in order to have increased theoretical justification, and to compare with the literature, we consider the scalar field to be the Higgs boson and thus its potential to be the known quartic Higgs one \cite{Germani:2010gm,Atkins:2010yg}, namely \begin{align} V(\phi)= \frac{\lambda \phi^4}{4}. \end{align} Finally, in what follows, we have imposed the normalization that the scalar power spectrum value at $k=0.05 Mpc^{-1}$ is $\mathcal{P}_\mathcal{R}=2.2\cdot10^{-9}$ \cite{Akrami:2018odb}. Additionally, the initial conditions are selected in order for the produced models to yield 40, 50 and 60 e-folds. Starting with the monomial GNMDC scenario, in Fig. \ref{fig:fulltheorycompare1} we depict the evolution of the scalar field for the various cases. The main observation from this graph is the fact that although in the standalone GNMDC scenario the oscillations of $\phi$ (and consequently of $\dot{\phi}$) are quite wild, in the combined scenario the period of the field oscillations increases. This will play a crucial role in the following analysis since it is the cause of the $c_s^2$-instabilities healing in the combined scenario. \begin{figure}[ht] \center \includegraphics[width=\linewidth]{phiFTcompare.pdf}% \\[0.4cm] \caption{{\it{The evolution of the scalar field in three different cases: For GNMDC with $\alpha=5$, for NMC with $\xi\approx 8000$ and for the combination of NMC+GNMDC with $\alpha=5$ and $\xi=2000$, respectively. All three models yield 60 e-folds and $\mathcal{P}_\mathcal{R}=2.2\cdot10^{-9}$. One can observe the lengthening of the period of oscillations, as well as the larger initial value of the field, in the case where NMC becomes more important ($\xi$ grows). Finally, note that when the two theories are combined, $\xi \phi_*^2$ remains less than $M_{Pl}$.}}} \label{fig:fulltheorycompare1} \end{figure} \begin{figure}[!] \center \includegraphics[width=\linewidth]{rofnsFTcompare.pdf} \\[0.4cm] \caption{{\it{ 1$\sigma$ (purple) and 2$\sigma$ (light purple) contours for Planck 2018 results (Planck $+TT+lowP$) \cite{Akrami:2018odb}, on the $r-n_s$ plane, alongside the predictions of the scenarios at hand. The NMC scenario corresponds to the dot-dashed line. For the GNMDC (purple lines) we have chosen to show two cases, one with $\alpha=3$ (dashed line) and one with $\alpha=5$ (dotted line). The same convention is used for the combined NMC+GNMDC scenario in terms of $\alpha$, where we also have the colour code of blue lines for $\xi=1500$ and red lines for $\xi=2000$. It is evident that the NMC term lowers the $r$ value as it becomes more significant, as compared to the GNMDC alone. Very low $r$-values are a main feature of NMC of the form $\phi^2$. Moreover, one observes that for the same value of $\xi$, as $\alpha$ grows $r$ is also lowered, as reported in \cite{Dalianis:2019vit} too. Finally, the growing dots represent 40, 50 and 60 e-folds respectively.}}} \label{fig:fulltheorycompare2} \end{figure} As a next step we calculate the inflationary observables, and in particular the scalar spectral index and the tensor to scalar ratio, using the exact expressions of Appendix \ref{perturbations}. In Fig. \ref{fig:fulltheorycompare2}, we present the obtained results for the standalone cases of NMC and of GNMDC, as well as for the combined scenario. Additionally, for transparency, in the same figure we provide the 1$\sigma$ and 2$\sigma$ contours of the Planck 2018 data \cite{Akrami:2018odb}. As we observe, the simple NMC gives very satisfactory predictions however due to the unitarity violation this model has to be abandoned. The simple GNMDC scenario solves the unitarity issue however it leads to quite large $r$ values and moreover it leads to instabilities related to $c_s^2$. We observe that, in the combined NMC+GNMDC scenario which alleviates the unitarity issue, one can improve the obtained $r$ values, bringing them back inside the Planck 2018 contours, and moreover the larger the $\alpha$ value is the larger is the improvement. Specifically, one observes that for the same value of $\alpha$ (dashed lines for $\alpha=3$, dotted lines for $\alpha=5$), as $\xi$ grows the tensor-to-scalar ratio lowers. Moreover, for the same value of $\xi$ (blue lines for $\xi=1500$, red lines for $\xi=2000$), as $\alpha$ grows, $r$ also lowers. This result is also expected since this is one of the effects of the sole GNMDC term \cite{Dalianis:2019vit}. In conclusion, monomial GNMDC models with larger $\alpha$ would in fact be more desirable in the context of the combined theory proposed in this work, due to the enhancement of the gravitational friction effect that the $\alpha$ parameter essentially quantifies. However, if one considers a polynomial GNMDC the same effect can actually be obtained, since inflation can be carried by two or more ``frictious'' terms present in a polynomial GNMDC. We demonstrate such a scenario later. \begin{figure}[ht] \includegraphics[width=\linewidth]{sspdFTcompa5.pdf}% \\[0.4cm] \caption{{\it{The squared sound speed evolution for the scenario at hand, for $\alpha=5$, with $\xi=0, 1500$ and $2000$ respectively. It is clear that as the NMC contribution becomes more significant ($\xi$ increases), the oscillations in its value are damped and $c_s^2$ is corrected towards 1.}}} \label{fig:fulltheorycompare3} \end{figure} \begin{figure}[!] \includegraphics[width=\linewidth]{KGtermsFTcompa5.pdf}% \\[0.4cm] \caption{{\it{ The contribution of the terms related to the GNMDC (continuous lines) and to the NMC (dashed lines) in the Klein-Gordon equation (\ref{KGfull}), for $\alpha=5$ and $\xi=2000$. It is clear than when the oscillations start, the NMC terms dominate over the GNMDC terms and hence the GNMDC effects are negligible, even though during the slow-roll era they are comparable. The standard GR terms are intentionally omitted in order to make the graph simpler.}}} \label{fig:fulltheorycompare4} \end{figure} Let us now examine the evolution of $c_s^2$ in order to verify that the combined scenario can indeed heal the $c_s^2$-instabilities of the standalone GNMDC. In Fig. \ref{fig:fulltheorycompare3} we depict the evolution of $c_s^2$ for various cases. As one can clearly see, while in the standalone GNMDC (i.e. for $\xi=0$) the $c_s^2$ wildly oscillates between positive and negative values, when we switch on the NMC contribution we obtain a significant decrease of the oscillatory behavior and a stabilization to positive values. In particular, in the combined scenario we observe that near the end of inflation the GNMDC contribution smooths out, while the NMC term remains co-leading alongside the standard GR (i.e. of the minimally coupled scalar field) terms. However, it is known that the standalone NMC as well as the GR terms have no instability issues. Hence, the $c_s^2<0$ problem is healed. In order to provide a more transparent picture of the above relative effect of the GNMDC and the NMC contributions, in Fig. \ref{fig:fulltheorycompare4} we present the contribution of the terms related to the GNMDC and the NMC in the Klein-Gordon equation (\ref{KGfull}). From this graph it becomes clear that although during the slow-roll era the contributions from NMC and GNMDC are comparable, when the oscillations start the NMC terms dominate completely over the GNMDC terms and since NMC alone leads to $c_s^2=1$ its complete dominance in the combined model is adequate to bring $c_s^2$ away from the unstable region (caused by standalone GNMDC). Hence, the GNMDC contribution to the $c_s^2$ at the end of inflation is overpowered by the NMC contribution and the wild oscillations of the sound speed are damped much earlier in this scenario. Note that this damping of oscillations is more efficient for larger $\alpha$ values, which as we mentioned above lead also to better $r$ values. Hence, overall, larger $\alpha$ values would be more desirable. This brings up the question of whether this is a realistic scenario. Quantum corrections should, in fact, bring about terms that might be of lower order, so one should check the resulting phenomenology. However, if one chooses a polynomial form for $G(\phi)$, a very similar phenomenology occurs, since, unless the various terms of the polynomial are finely tuned, there will still be only one monomial term that drives the slow roll and hence it will produce very similar results. Moreover, even in the case that two, or more, terms are actually of the same order of magnitude, the phenomenology is still, qualitatively, the same, since the results of Section \ref{combined} are independent of the exact form of the GNMDC. They are only based on the fact that the GNMDC should become negligible at the end of inflation. Nevertheless, we later provide a numerical example of such a scenario for demonstrative purposes. In conclusion, in the combined scenario, when inflation starts, the gravitational friction effect due to the GNMDC term is what causes the model to produce a significant amount of e-folds without having to resort to $\xi \phi_*^2>M_{Pl}$ values as in the standalone NMC case, and this is what alleviates the unitarity issue. At the same time, the NMC term causes the $r$ of the model to be significantly lowered, and thus be in better agreement with observations, as compared to the standalone GNMDC case. Finally, when inflation ends and the oscillations start, the NMC terms remain more significant than that of the GNMDC, which leads to the fast eradication of the oscillations in the $c_s^2$ value, healing the theory of instabilities. These features and advantages of the combined scenario are amongst the main results of the present work. Before closing this section, we note another role of the GNMDC parameter $\alpha$ on the results. In the combined scenario even $\alpha$ values can still lead to viable inflation. This is not the case when GNMDC is considered alone \cite{Dalianis:2019vit} due to its inability to satisfy the corresponding requirement (\ref{Consinfull}), which essentially disqualifies the area of the phase space corresponding to desirable observables. The fact that in the combined scenario all $\alpha$ values can be used, is a significant advance in the richness of the resulting phenomenology. This also holds for a polynomial GNMDC form: when an even-valued $\alpha$ term becomes important the polynomial GNMDC numerics become unstable due to the above constraint. This can be ameliorated or even healed, when it is combined with NMC. As a further numerical demonstration of the effects of the NMC+GNMDC scenario we include a model resulting from a polynomial GNMDC form, namely \[ G(\phi)=\sum_{i}\frac{\alpha_i \phi^{\alpha_i-1}}{2M_i^{\alpha_i+1}}, \] where $i$ is a subscript that defines which and how many corresponding terms are taken into account. As a demonstration we pick \begin{align} \label{polynomialGNMDC} \frac{\alpha \phi ^{\alpha -1}}{2 M_1^{\alpha +1}}+\frac{(\alpha -1) \phi ^{\alpha -2}}{2 M_2^{\alpha }}, \end{align} with $\alpha=4$, while the NMC coupling is $\kappa \approx 2000$. The coupling coefficients should be such that these two terms as a whole are of comparable magnitude. If not, then one of the terms would dominate during slow roll, essentially reducing the model to the monomial form presented earlier. We reiterate, that such a scenario is not viable in the sole GNMDC case, since even values of $\alpha$ are problematic. A polynomial form still falls within the ansatz needed for the results of Section \ref{combined} to hold, namely that the GNMDC becomes negligible near the end of inflation. The results shown therein, then, still hold, since this modification affects only the exact form of the $\epsilon_{G_i}$ parameters, and not their overall behavior. Definitely, picking initial conditions and scales for the combined theory, with a polynomial GNMDC, is a tedious task as compared to the monomial case. Nevertheless, by imposing the ansatz discussed earlier, regarding the magnitude of the various terms of the GNMDC, one can obtain results that are well within observational bounds. The overall picture is very similar to the monomial case, as one can see in Fig. \ref{fig:polynomialrns}, which was expected since the $\epsilon_{G_i}$ show a similar behavior. \begin{figure}[!] \center \includegraphics[width=\linewidth]{rofnspolynom.pdf} \\[0.4cm] \caption{{\it{ 1$\sigma$ (purple) and 2$\sigma$ (light purple) contours for Planck 2018 results (Planck $+TT+lowP$) \cite{Akrami:2018odb}, on the $r-n_s$ plane, alongside the predictions of the polynomial GNMDC+NMC scenario. To demonstrate that the resulting phenomenology is very similar to the monomial case of Fig. \ref{fig:fulltheorycompare2}, we present two cases, one with $M_1=M_2$ and one with $M_1=10M_2$. The growing dots represent 40, 50 and 60 e-folds respectively. The corresponding models when NMC is not included are not stable due to the constraint \eqref{Consinfull}.}}} \label{fig:polynomialrns} \end{figure} \section{Conclusions}\label{conclusions} It is widely accepted that for modern Cosmology to explain the hot big bang and the primordial perturbations observed through the CMBR it has to be complemented by an initial inflationary period. There is a variety of ways to achieve inflation, the most well-studied of which is the inclusion of a scalar field, that through its dynamics affects the evolution of the infant Universe. Given that the only scalar field actually observed in nature up to now is the Higgs field, it would be the prime candidate for such a scenario. The basic scenarios in which the Higgs field is minimally coupled to gravity have been excluded from Planck observations \cite{Akrami:2018odb}. The next candidate is to allow the Higgs field to couple nonminimally (NMC) with gravity. NMC Higgs inflation, with a quadratic coupling of the form $f(\phi)=\phi^2$, has been shown to yield results in very good agreement with the observations, and particularly low tensor-to-scalar ratio, while the squared sound speed of the scalar perturbations is identically equal to 1 and thus the scenario is free from instabilities. However, this model leads to unitarity violation which in turn is undesirable if one wished to quantize the theory. The consideration of nonminimal derivative couplings of the scalar field to gravity is shown to solve the unitarity issue, while still leading to satisfactory inflationary observables, due to the presence of a ``gravitational friction'' that lowers the initial values needed to produce a long slow-roll period and thus a significant amount of e-folds. Nevertheless, these models lead to perturbative instabilities and in particular to $c_s^2<0$. Although one could construct generalized versions of nonminimal derivative couplings (GNMDC) that could improve the instability issue, considering for instance a coupling function of the form $\frac{\alpha \phi^{\alpha-1}}{M^{\alpha+1}}$, potential problematic behavior still remains. In this work we constructed the combined scenario of NMC and of GNMDC, which maintain the advantages of the individual models, but remove their individual disadvantages. In the combined scenario, a long enough inflationary phase can be easily achieved, while the initial value of the scalar field and the scale of the NMC term are such that it remains sub-Planckian, a feature not possible in the single field NMC scenario. These attractive features are achieved due to the GNMDC term, that brings about the gravitational friction effect that extends the slow-roll phase, allowing for lower initial values of $\phi_*$. Additionally, near the end of inflation, at the bottom of the potential, when a suitable GNMDC term is chosen, it becomes negligible, while the NMC term dominates completely. To demonstrate this, we have chosen to include two examples, one with a GNMDC of monomial form and one of polynomial form that satisfy the above ansatz (however, other GNMDC forms should also be viable, as long as they become negligible at the end of inflation). In both cases we show that a desirable phenomenology is achieved. At the same time, at the end of inflation canonical gravity is restored, and the scenario is healed from $c_s^2$-instabilities due to wild oscillations, and with no superluminal scalar perturbations that are related to the simple NMDC case. Finally, another advantage of the present construction is that since the GNMDC contribution becomes negligible after inflation ends, the theory can easily pass the recent LIGO-VIRGO contstraints on the gravitational wave speed \cite{TheLIGOScientific:2017qsa,Goldstein:2017mmi} (since it is known that the nonminimal derivative coupling terms are amongst the ones that lead to a gravitational wave speed different than one). In summary, the combined scenario leads to inflationary observables in agreement with observations, it is free from $c_s^2$-instabilities, and it alleviates the unitarity issue. Hence, it does maintain the advantages of the individual scenarios without sharing their disadvantages. Thus, inflationary scenarios with nonminimal and derivative couplings to gravity combined, may serve as successful candidates for the description of inflationary dynamics, and other mechanisms related to inflation, like Primordial Black Hole formation, and deserve further investigation. \section*{Acknowledgements} ENS would like to acknowledge the contribution of the COST Action CA18108 ``Quantum Gravity Phenomenology in the multi-messenger approach''.
\section{Introduction} As a geometrical evolution equation, the Ricci flow \cite{Hamilton} has attracted the attention of the physical community since it behaves as a heat equation for the metric, homogenizing the metric on a given manifold. The most obvious applications of the Ricci flow in physics can be realized within general relativity, since it is a theory about the geometry of space and time. Nowadays, the Ricci flow has been applied to study several problems within the framework of physics: A possible relation between Perelman's entropy and the geometric Bekenstein-Hawking entropy from black hole thermodynamics was considered at \cite{GFBHE} based on a study of the fixed points of the flow. It appeared that Perelman's entropy has no connection to the geometric entropy, however, a modified flow does appear to relate both entropies. Further, a remarkable relation between the evolution of the area of a closed surface and the corresponding Hawking mass under the Ricci flow was obtained in \cite{EnergyERF}, revealing that the rate of change of the area is bounded by its Hawking mass. The behavior of the ADM mass of an asymptotic locally Euclidean (ALE) space along the Ricci flow was investigated in \cite{Dai}, revealing that the mass is invariant under the flow in three dimensions and that the ALE property is conserved under the Ricci flow. The Ricci flow was also applied to $4d$ Euclidean gravity with a $S^1\times S^2$ boundary, realizing the canonical ensemble for gravity in a box \cite{wiseman}; it turned out that at high temperature the action possesses three saddle points, one unstable under the Ricci flow, and other two that respectively lead to a large black hole and to a hot flat space (via a topology-changing singularity in this case). The Ricci flow has been implemented as well to deform wormhole geometries, yielding three scenarios for the evolution of the wormhole throat (shrinking, expanding or steady) determined by a critical parameter that also reveals topological changes on a manifold \cite{Viqar}. A review on how the Ricci flow arises in the renormalization group (RG) of non-linear sigma models was presented in \cite{woolgar}, along with a relation between the Ricci flow and Ricci solitons on the basis of the behavior of the mass under the flow; moreover, a discussion about the construction of $4d$ Lorentzian and Euclidean analytic Ricci solitons from a $3d$ seed solution (with the aid of a scalar field) was given. Subsequently, the analysis of the asymptotically hyperbolic mass under the curvature-normalized Ricci flow of conformally compactifiable and asymptotically hyperbolic manifolds was performed in \cite{BahelowskyWoolgar}, showing that the mass exponentially vanishes along the flow for $d\geq 3$ manifolds. By using a maximum principle, it was proved that Ricci solitons do not exist within static Lorentzian spacetimes which are asymptotically flat, Kaluza-Klein, locally AdS or have extremal horizons \cite{figueras}. Additionally, the connection between the holographic RG flow and the Ricci flow was revealed in \cite{kiritsis,jackson}. In particular, the Hamilton-Jacobi formalism was introduced in \cite{jackson} in order to derive the RG flow equations and to show that for dual AdS/QFT theories, the RG flow is described by the Ricci flow. Besides, a proof of the irreversibility of a wide class of world-sheet RG flows to first order in $\alpha'$ in string theory for asymptotically flat target manifolds was reported in \cite{OSW1}-\cite{OSW2}. One more physical theory in which the Ricci flow emerges in a natural way is the Ho\v{r}ava-Lifshitz gravity \cite{horava,nishioka}, where the Hamilton Ricci flow arises as a limit of a generalized RG flow under the application of the Hamilton-Jacobi equation to the Ho\v{r}ava-Lifshitz theory of gravity. One more appearance of the Ricci flow as a RG flow within the field theory realm takes place when the flow parameter encodes the observation scale of the theory under consideration \cite{Chowdhury}. Thus, a change in scale corresponds to a shift in the magnification of a microscope used to study a given physical system: The bigger the magnification, the more detailed the obtained image is and the more information we get. One can physically interpret the decrease of information as an increase of entropy, in this sense the Ricci flow diminishes the information of a given manifold and leaves just the topological information needed to identify the manifold \cite{Chowdhury,perelman}. It is well-known that flat spaces are fixed points of the Ricci flow for some geometries \cite{Oliynyk}, for instance, the evolution of the Ricci flow under specific initial conditions (e. g. rotationally symmetric and asymptotically flat initial data) is immortal in the sense that the solution exists for the whole interval $(\lambda_0,\infty)$, remains asymptotically flat, and asymptotically converges to flat Euclidean space as the flow parameter goes to infinity. There are more complicated geometries, such as the direct-product metrics $(\mathcal{T}^2, \mu) \times (S^1, dx^2)$ where $\mu$ is an arbitrary Riemannian metric on $\mathcal{T}^2$, that also converge to flat metrics \cite{RStability}. More recently, a study of the behavior of maximally symmetric manifolds with constant curvature, de Sitter (dS) and Anti de Sitter (AdS) spaces, under the so-called Hamilton-DeTurck Ricci flow\footnote{ An equivalent formulation of the Ricci flow was introduced by D. DeTurck \cite{Turck} through a family of diffeomorphisms along the flow, giving rise to the Hamilton-DeTurck Ricci flow.} was reported in \cite{CFHAOS} by analytically solving the modified Ricci flow equations with a simple ansatz for the DeTurck vector field and revealing a change in the signature of the metric at a singular point in the curvature, a transition from positive to negative curvature throughout this singularity, and a further evolution towards Minkowski spacetime. One more family of exact solutions to the Hamilton-DeTurck Ricci flow was obtained for Lifshitz spacetimes represented by metrics that are invariant under anisotropic scalings of space and time \cite{CHAHM}; these spaces play a very important role in the description of holographic quantum systems within the framework of the Gravity (Lifshitz)/Condensed Matter Theory correspondence \cite{Taylor,HLS}. These exact solutions to the Ricci flow equations show as well that Lifshitz spaces with discrete and continuous critical exponents tend to a fixed point that corresponds to Minkowski spacetime as the flow parameter evolves towards infinity. Thus, the Ricci flow generally homogenizes the metric in such a way that it reaches the equilibrium state represented by flat spacetime. \section{Motivation} Here we would like to motivate our work from the connection of two intrinsically different perspectives on the Ricci flow: physics and mathematics. On the one hand, the recent discovery of the Standard Model Higgs boson reported by both the ATLAS and the CMS collaborations \cite{cms-atlas}, and on the other, the final proof of the Poincar\'e conjecture given by G. Perelman \cite{perelman}, milestones that represent a breakthrough in these research areas. The first confirms the existence of the only elementary particle in the Standard Model that has not yet been observed, the second unravels one of the most fundamental unsolved problems in mathematics for close to a century. The relevance of the first is clear, the Standard Model describes successfully high energy particle interactions, and the detection of the Higgs boson represented also a scientific goal of the Large Hadron Collider. On the other hand, the longstanding Poincar\'e conjecture is only a consequence of a more general result proved by Perelman on geometrization theorems, overcoming the difficulties in the programme of R. S. Hamilton, which uses the Ricci flows as the fundamental tool \cite{Hamilton}. Such theorems have a potential importance in physics, beyond the obvious impact in mathematics; for example, in the path-integral quantization for geometrical theories, one must sum over topologies and geometries, and a criterion for discerning over inequivalent histories is mandatory. The geometrical flows appear also in field theory by describing the RG equations, providing an approach to the problem of tachyon condensation and vacuum selection in string theory, where it has been shown that there exists an action functional whose gradient (with respect to a metric on the space of coupling constants) produces the RG flow of the target space metric in the worldsheet sigma model to all orders in perturbation theory \cite{Tseytlin}. This fact yields a monotonicity formula for the flow which fails only when the perturbation series of the beta function does not converge, a situation that arises when the curvatures or their derivatives grow large at next-to-leading order in perturbation theory \cite{OSW3}. It is not evident that there exists a direct relationship between both scenarios, and the purpose of the present paper is to show that the fundamental role played by the Higgs mechanism in the Standard Model can be extended to the context of the geometrical flows and, conversely, to show the behavior of that mechanism of symmetry breaking under flows defined in the field space; the results will reveal qualitatively new aspects in both senses. In order to simplify the discussion and ideas, we focus on two-dimensional manifolds describing gravity; the dynamical variables are the metric and the torsion, which is identified with the gradient of a scalar Higgs field $\phi$. The respective action, identified as an entropy functional in field space within the context of the geometrical flows, corresponds to the scalar curvature of the manifold, which mimics the kinetic term for the Higgs field; such Lagrangian term will be supplemented with a Higgs potential; the full action has the discrete symmetry $\phi \rightarrow -\phi$, which will be spontaneously broken. The paper is further organized as follows: In Section 3 the action, conventions, and the basic formalism, are briefly exposed. In Section 4, the metric, Higgs, and mass flows are constructed by the requirement of a non-decreasing entropy functional along the flows. The mass flow is solved explicitly, and we show in details the qualitative behavior. Section 5 is devoted to the description of vacuum in both the Unbroken Exact symmetry (UES) case, and most importantly, in the Spontaneous Symmetry Breaking (SSB) scenario, for which the evolution of the Higgs potential and the tunneling probability between vacua are studied. \section{Preliminaries and entropy functional} In this part, as a first step we shall consider that the geometry of a manifold is encoded in the metric compatible only with the symmetric part of the connection as regarded in \cite{cartas}, this approach allows us to introduce torsion and to retain some properties of the usual Riemannian manifolds with a Levi-Civita connection. If the full covariant derivative ($\nabla$) of the metric is decomposed according to the decomposition of the full connection in terms of symmetric and anti-symmetric parts in the lower indices $\Gamma^{i}_{jk} = \widehat{\Gamma}^{i}_{(jk)} + \frac{1}{2}T^{i}_{jk}$, as $\nabla_{i} g_{jk}=\widehat{\nabla}_{i} g_{jk}-\frac{1}{2}T^{l}_{ji}g_{lk}-\frac{1}{2}T^{l}_{ki}g_{jl}$, then the compatibility condition of the metric with respect to $\widehat{\Gamma}$ alone is achieved if the tensorial constraint $\widehat{\nabla}_{i} g_{jk}=0$ is satisfied, which leads to $\widehat{\Gamma}^{k}_{(ij)}=\frac{1}{2}g^{kl}[\partial_{i} g_{jl}+\partial_{j} g_{il}-\partial_{l} g_{ij}]$. Note that this approach can be interpreted as a variant of the Ricci theorem, and does not involve the {\it contorsion} (for more details see \cite{cartas}); moreover, within the present framework, the torsion will be determined dynamically though an identification with the Higgs field. The full curvature of the two-manifold can be displayed as \begin{equation} R^{i}{_{jkl}}(\Gamma =\widehat{\Gamma}+\frac{1}{2}T) =\widehat{R}^{i}{_{jkl}}(\widehat{\Gamma}) + S^{i}{_{jkl}}(\widehat{\Gamma},T), \label{cur-total} \end{equation} where $\widehat{R}^{i}{_{jkl}}(\widehat{\Gamma}(g))= \delta^{i}{_{[k}}g_{l]j}\widehat{R}$, for the particular case of two dimensions, and \begin{equation} S^{i}{_{jkl}} = \delta^{i}_{j}F_{kl} + \delta^{i}_{[k}F_{l]j} + 2\delta^{i}_{[k}S^{+}_{l]j} - 2\delta^{i}_{[k}g_{l]j}S, \label{S-curvature} \end{equation} with \begin{eqnarray} S^{+}_{ij} \!\! & \equiv & \!\! g^{kl}S_{iklj} = -\frac{1}{2} (\widehat{\nabla}_{(i}T_{j)} - \frac{1}{2}T_{i}T_{j}) + \frac{1}{2} g_{ij} (\widehat{\nabla}_{k} - \frac{1}{2}T_{k}) T^{k}, \nonumber \\ S \!\! & = & \!\! g^{ij}S^{+}_{ij} = \frac{1}{2} (\widehat{\nabla}_{k} - \frac{1}{2}T_{k}) T^{k}; \qquad F_{ij} = \partial_{[j} T_{i]}, \label{traces} \end{eqnarray} where we have considered that in two-dimensions the torsion is fully described by its trace $T_{i}\equiv \delta^{k}_{j} T_{i}{^{j}}{_{k}}$. Besides the compatibility of the metric with $\widehat{\Gamma}$, now we make the second assumption within our approach; in what follows we identify the torsion vector field with the gradient of a neutral scalar field such as $T_{i}=\partial_{i}\phi$, leading trivially to $F_{ij} = 0$, and to the following relations \begin{eqnarray} S^{i}{_{jkl}} \!\! & = & \!\! 2 \delta^{i}{_{[k}} R^{+}_{l]j}, \quad S^{+}_{ij} = \frac{1}{2} g_{ij} (\widehat{\nabla}_{k} - \frac{1}{2}\partial_{k}\phi ) \partial^{k}\phi + R^{+}_{ij}, \nonumber \\ R^{+}_{ij} \!\! & = & \!\! -\frac{1}{2} \widehat{\nabla}_{(i} \widehat{\nabla}_{j)}\phi + \frac{1}{4} \partial_{i}\phi\cdot\partial_{j}\phi, \quad S = - \frac{1}{4} \partial_{i}\phi\cdot\partial^{i}\phi + \frac{1}{2} \widehat{\nabla}_{i}\partial^{i}\phi. \label{Higgs-S} \end{eqnarray} The full scalar curvature of the two-manifold $\widehat{R}-S$, proves to be a geometrical invariant from which we shall construct an entropy functional; once we have identified the torsion with the gradient of a Higgs field, we can add a Higgs potential with a $``\lambda \phi^{4}"$ interaction, leading to the functional \begin{equation} {\cal E} (g,T) \equiv \int_{M} \sqrt{g} (S-\widehat{R}) d^{2}x-\int_{M} \sqrt{g} V d^{2}x, \label{full-action} \end{equation} where $V=-\frac{1}{2} m^{2}\phi^{2} - \frac{1}{16}\lambda\phi^{4}$, with $\lambda> 0$; and in general, the expressions associated to $m$ and $\lambda$ depend on the parameter $t$, as $m=m(t)$, and $\lambda = \lambda (t)$. Note that with the identification $T=\nabla\phi$, the $S$-curvature corresponding of the manifold $M$ reduces, modulo a total derivative, to the {\it kinetic} term of the Higgs-like field; thus, for two-manifolds without boundaries, we can observe that the entropy functional $\cal E$ has the reflection symmetry $\phi\rightarrow -\phi$. In appearance, this action looks like pure gravity ($\hat{R}$) coupled to a scalar field ($S$); however the geometrical content is different, since the complete scalar curvature $\hat{R}-S$ is ``pure gravity", {\it i.e.} vacuum two-dimensional gravity, and in this sense the geometry of the two-manifold is exotic. Additionally the term $\hat{R}$ is topological in two -dimensions, which means that the dynamics will be generated only by the term $S$ through the field $\phi$; variationally the term $S$ leads to the usual wave equations of motion for the scalar field $\phi$, but in this context they correspond geometrically to the Einstein (vacuum) equations of motion. Therefore, $S$ corresponds to a {\it massless} Lagrangian term, and the inclusion of the potential can be considered as mass corrections. \section{Metric, Higgs, and mass flows} Perelman flows are strictly defined only in the Euclidean framework; thus in the following we work on a two-dimensional manifold $M$ with a positive definite metric; the ``time" parameter along the flow is denoted by $t$. The variation of the entropy functional is given by \begin{eqnarray} \partial_{t}{\cal E}\!\! & = & \!\! \frac{1}{4}\int_{M}\sqrt{g}\{ [\partial^{i}\phi\cdot\partial^{j}\phi+4\widehat{R}^{ij}- \frac{1}{2} g^{ij}((\partial\phi)^{2}+4\widehat{R})]-2Vg^{ij}\}\partial_{t}g_{ij}\nonumber \\ \!\! & + & \!\!\int_{M}\sqrt{g} [(\frac{1}{2} \widehat{\Box}\phi - \frac{\partial V}{\partial\phi}) \partial_{t}\phi + \frac{1}{2}\phi^{2} \partial_{t}m^{2} + \frac{1}{16}\phi^{4} \partial_{t}\lambda], \label{var-2} \end{eqnarray} where $\widehat{\Box}\equiv\widehat{\nabla}_{i}\partial^{i}$ is the two-dimensional Laplace-Beltrami operator; and also the metric variations have been separated in a traceless part and the trace depending on the Higgs potential. Now, we assume that the metric of the two-manifold (with torsion) is conformally flat, that is $g_{ij}\equiv\delta_{ij}\Omega^{2}(x,t)$; thus, the traceless part vanishes trivially, reducing the flow for the conformal factor to \begin{equation} \partial_{t} \Omega^{2} = -\omega V \Omega^{2l}, \quad l = 0,\pm 1,\pm 3 ,\pm 5,...\label{metric-flow} \end{equation} with the constant $\omega\geq0$; under this flow the metric variations of the entropy reduce to $\omega V^2 \Omega^{2(l-1)}$, which results to be strictly positive. Note that the inclusion of the Higgs potential makes dynamical the conformal factor along geometrical flows; thus, the stationary points are characterized by $V=0$ ({\it i.e.}, $\phi=0$), or by the condition $\omega=0$, which corresponds to the trivial case. The change of the area $\cal A$ associated to the manifold $M$ is controlled by, \begin{equation} \partial_{t} {\cal A} = \frac{1}{2} \int_{M} d^{2}x \sqrt{g} g^{ij} \partial_{t} g_{ij} = -\omega\int_{M}\sqrt{g}V\Omega^{2(l-1)} d^{2}x = -\omega\int_{M}V\Omega^{2l} d^{2}x ; \label{area} \end{equation} since $\omega\Omega^{2l}$ is strictly positive, we observe that the Higgs potential will determine a qualitatively different behavior of the area in the UES and SSB scenarios; in particular for $l=0$, the gradient of ${\cal A}$ is governed by the average of the Higgs potential over $M$. Similarly the Higgs flow must be \begin{equation} \partial_{t}\phi = \frac{1}{2} \widehat{\Box}\phi - \frac{\partial V}{\partial\phi}; \label{Higgs-flow} \end{equation} which corresponds to a diffusion-like equation for the Higgs field; note that both fields $\phi$, and $\Omega$ appear coupled in the evolution Eqs. (\ref{metric-flow}), and (\ref{Higgs-flow}); in general the stationary points for the Higgs flow satisfy $\frac{1}{2} \widehat{\Box}\phi - \frac{\partial V}{\partial\phi}=0$, and define also the space of solutions of the equations of motion. Additionally, the monotonicity of ${\cal E}$ requires that $\partial_{t}m^{2}\geq 0$, and $\partial_{t}\lambda\geq 0$; the cases corresponding with strict equalities prove to be trivial, since they imply that $m^{2}$ and $\lambda$ are stationary along the flows. The UES and SSB scenarios require that $\lambda >0$; hence, if this restriction is imposed at $t=0$, then the condition $\partial_{t}\lambda \geq 0$ required by the monotonicity of ${\cal E}$ will maintain the positivity of $\lambda$ for all $t$, and the scenario for the Higgs symmetry-breaking is possible along the flows. As one may expect, the more delicate aspect is the behavior of the mass along the flows; the UES scenario requires $m^{2}>0$, and SSB requires $m^{2}<0$; however, the monotonicity will be consistent with both, since the restriction $\partial_{t}m^{2}\geq0$ can be realized through the mass flow \begin{equation} \partial_{t}m^{2} = \mu (m^{2})^{n}, \qquad m^{2}(t) = [(n-1) (-\mu t+ \mu_{0})]^{\frac{1}{1-n}},\quad n=0, \pm 2, \pm 4, \ldots \label{mass-flow} \end{equation} where $\mu$ is a constant such that $\mu \geq 0$; the solution of this flow is displayed explicitly in Figure 1, where $\mu_{0}$, corresponds to an arbitrary constant but without positivity restrictions. We can choose $t=0$ as the moment at which the usual SSB occurs; eventually the system is left to evolve along the flow. There exist two scenarios for the mass spectrum at $t=0$, depending on the sign of $\mu_{0}$. In the case $\mu_{0}<0$, we have that $m^{2}(0)> 0$ for $n \leq 0$, and $m^{2}(0)< 0$ for $n \geq 2$; similarly for $\mu_{0}>0$, we have that $m^{2}(0)>$ for $n \geq 2$, and $m^{2}(0)<0$ for $n \leq 0$. However, the two scenarios are qualitatively equivalent, and for the sake of convenience we choose the first one for discussion; in the following Figure we show the profile of $m^{2}(0)$ against $n$, according to the Eq. (\ref{mass-flow}). \begin{figure}[H] \begin{center} \includegraphics[width=.5\textwidth]{mass-gap.eps} \caption{Each blue point represents the (real) value of $m^{2}(0)$ for $n$ in Eq. (\ref{mass-flow}); for $n \leq 0$ the mass spectrum is continuous, since all values of $m^{2}(0)$ are real, this fact is shown by a continuous curve connecting all these points; this region in the second quadrant correspond to UES. For $n \geq 2$ in the fourth quadrant, between two blue points corresponding to real values, there exist in general complex values for $m^{2}(0)$; thus, there is not a continuous curve connecting these points, then, it corresponds to the SSB with a strict discrete mass spectrum. In appropriate units, we can fix $m^{2}(t=0, n=0)=1$, and $m^{2}(t=0, n=2)=-1$; additionally we can see that $lim_{n\rightarrow \pm \infty} m^{2}(t=0,n)=\mp 1$, which is indicated by blue horizontal dashed lines.} \label{fig:ejemplo} \end{center} \end{figure} Once we have described the profile of mass at $t=0$, we left it to evolve according to the Eq. (\ref{mass-flow}), where in the figure we can understand the "x-axis" as the $t$-axis; then $m^{2}(t)$ evolves for each value of $n$, as indicated by the red (meshed) lines, in appropriate units of $\mu$. These red lines go always to the right, while the mass is increasing, showing the restriction $\partial_{t}m^{2}>0$; thus the scenario of UES seems to be stable along the flow, with $lim_{t\rightarrow +\infty} m^{2}(t,n)=+\infty$. Similarly in the fourth quadrant we have that $lim_{t\rightarrow +\infty} m^{2}(t,n)=0$, and the red lines never touch the "x-axis" at finite time; thus, the SSB scenario seems also to be stable along the mass flow. Note that in fact there exists a Mass Gap region between the two scenarios, which is inaccessible for the mass flow; the gap is increasing along the mass flow. Therefore the UES and SSB scenarios seem to be disconnected in the parameters space. The case with $\mu_{0}>0$ can be obtained from the Figure 1 by reflecting the blue points though the "x-axis"; the effect is that the UES and SSB are interchanged; in the first quadrant we shall have the UES scenario, and then the blue points will be connected by a continuous curve; on the other hand, in the third quadrant we shall obtain the SSB scenario with disconnected points. For this instance, the qualitative behavior of the red lines, and the presence of a Mass Gap region will be maintained. This implies that the SSB-scenarios in the third quadrant are not stable, since all red lines will reach continuously the first quadrant (where $m^{2}>0$) at finite time, and thus the SSB-scenarios become UES-scenarios; in these cases we have that $lim_{t\rightarrow +\infty} m^{2}(t,n)=+\infty$. The case of UES-scenarios in the first quadrant is more involved; consider by simplicity the case $n=2$, which is representative of all cases with $n\geq 2$ with $\mu_{0}>0$. The mass reads $m^2(n=2,t)=\frac{1}{-\mu t+\mu_{0}}$; thus, in the interval $[0,\frac{\mu_{0}}{\mu})$ the mass is increasing from a positive value at $t=0$; at $t=\frac{\mu_{0}}{\mu}$ a singularity appears, and in the interval $(\frac{\mu_{0}}{\mu},+\infty)$, the mass is increasing from negative values, localized at the fourth quadrant. This abrupt change is not physical, since it can be eliminated by a reparametrization of $t$; under such a convenient reparametrization the original UES-scenarios are maintained stable. The case with $\mu_{0}=0$ implies that the mass vanishes at $t=0$, and is well-defined only in the cases $n=0,-2,-4,...$; this case only presents the UES scenario, due to $m^{2}(t,n)\geq 0$. This case can be obtained from the Figure 1 by moving down the mass spectrum in the second quadrant in such a way the horizontal asymptote will be now the ``x-axis"; the red lines will be essentially the same. The change of the area corresponding to the manifold $M$ is given explicitly by $\partial_{t}{\cal A}=\omega\int_{M}(\frac{1}{2} m^{2}\phi^{2} + \frac{1}{16}\lambda\phi^{4})\Omega^{2l} d^{2}x$, according to Eq. (\ref{area}); thus in the UES scenario the area is increasing from certain initial value ${\cal A}_{0}$. Since in the case of SSB we have that $m^{2}<0$, the change in the area has no definite sign, and in general the area will have contractions and expansions, this could imply that $M$ may collapse to a point; explicit solutions for the Higgs and metric flows are required for determining the precise behavior of the area; this will be possible at vacuum, treated in the next section. The evolution of the $\widehat{R}$-curvature and its traces is determined fully by the metric evolution (\ref{metric-flow}), \begin{eqnarray} \partial_{t} \widehat{\Gamma}^{k}_{ij} \!\! & = & \!\! - \omega [\delta^{k}_{(i} \partial_{j)} - \frac{1}{2} \delta_{ij} \partial^{k}]V_{\Omega}, \quad g^{ij} \partial_{t} \widehat{\Gamma}^{k}_{ij} = 0, \qquad \partial_{t} (\delta^{j}_{k} \widehat{\Gamma}^{k}_{ij})=-\omega\partial_{i}V_{\Omega}, \nonumber \\ \partial_{t} \widehat{R} \!\! & = & \!\! \omega (\widehat{R} + \Omega^{-2}{\Box})V_{\Omega},\quad \partial_{t}\widehat{R}_{ij} = \frac{\omega}{2} \delta_{ij}{\Box}V_{\Omega}, \quad \partial_{t} \widehat{R}^{i}{_{jkl}} = \omega \delta^{i}_{[k} \delta_{l]j}{\Box}V_{\Omega}, \label{evolution-6} \end{eqnarray} where $V_{\Omega}\equiv V\Omega^{2(l-1)}$, and $\Box\equiv\delta^{ij}\partial_{i}\partial_{j}$. Similarly, the evolution of the $S$-curvature is given by both the metric (\ref{metric-flow}) and the Higgs flows (\ref{Higgs-flow}), \begin{eqnarray} \partial_{t} F_{ij} \!\! & = & \!\! 0, \quad \partial_{t} S = \omega V_{\Omega}S + \frac{\Omega^{-2}}{2} ({\Box} - \partial^{i}\phi\cdot\partial_{i}) (\frac{1}{2} \widehat{\Box}\phi - \partial_{\phi}V); \nonumber \\ \partial_{t} R^{+}_{ij} \!\! & = & \!\! - \frac{1}{2} [\widehat{\nabla}_{(i} - \partial_{(i}\phi] \partial_{j)} (\frac{1}{2} \widehat{\Box}\phi - \partial_{\phi}V) +\frac{1}{2}\partial_{t} \Gamma^{k}_{ij}\cdot\partial_{k}\phi ; \label{evolution-7} \end{eqnarray} in this manner, the evolution of the $S$-curvature is determined by $\partial_{t}S^{i}{_{jkl}} = 2\delta^{i}_{[k}\partial_{t} R^{+}_{l]j}$. The stationary metric points in the case $\omega = 0$, induce stationary points for the $\widehat{R}$-curvature; however the geometry evolves according to (\ref{evolution-7}), along the unrestricted Higgs flow. \section{Vacuum under evolution} The evolution of the mass spectrum shown in the Figure 1, together with the diffusion-like equation (\ref{Higgs-flow}), and Eq. (\ref{metric-flow}) will determine the evolution of the configurations of the Higgs field and of the metric at vacuum; this means that the geometries associated with vacuum will evolve in a nontrivial way. The vacua are defined by the vanishing of the derivative $\frac{\partial V(t)}{\partial \phi}=-\phi(t)[m^{2}(t)+\frac{\lambda}{4}\phi^2(t)]$, which depends on $t$. In the case of UES the profile of a symmetric potential with a unique vacuum localized at $t_{0}$, $\phi_{vac}(t_{0},n)=0$, with $V_{vac}(t_{0},n)=0$, is not preserved along the flows for all $t$; Furthermore, the vanishing of the torsion $T_{vac}(t_{0})=\nabla\phi_{vac}(t_{0})=0$, implies that the $S$-curvature vanishes, and consequently the unique vacuum corresponds to conformally flat manifolds with (usual) Riemannian geometry; such a vacuum is not stable under the Higgs-metric flows. Then, one requires of explicit solutions of the coupled system for metric and Higgs flows Eq. (\ref{metric-flow}), and Eq. (\ref{Higgs-flow}), in order to determine the evolution of such vacuum geometries, in particular if they will evolve to geometries with torsion; we will address this problem elsewhere. In the case with SSB we have the profile of the potential with degenerated vacuum localized at $\phi_{vac}(t)=\pm2\sqrt{-\frac{m^{2}}{\lambda}}$ (Width) with $V_{vac}(t)=-\frac{m^{4}}{\lambda}$ (Height), it will have a nontrivial evolution determined by the evolution of the mass spectrum and of the parameter $\lambda$ described above. The metric flow (\ref{metric-flow}) reduces to $\partial_{t}\Omega^{2}_{vac}= \omega\frac{m^{4}}{\lambda}(\Omega^{2}_{vac})^{l}$, which is strictly positive; implying that the metric is expanding at vacuum for all $l$ . The proportionality factor in this equation can be rewritten as $\omega\frac{m^{4}}{\lambda}= \omega\frac{\lambda}{16}\phi_{vac}^{4}$, thus the solutions will respect the reflection symmetry. This equation for the conformal factor can be solved easily under the assumption of a stationary parameter $\lambda$; however, positivity of a (real) conformal factor permits only the values $l\geq 0$, with restrictions on the mass spectrum; solutions for $l<0$ lead to complex expressions, and although the analytic extensions are of interest, we focus here only on real solutions. Therefore, the solutions are \begin{eqnarray} \Omega^{2}_{vac}(x,t)\!\! & = & \!\! \left\{ \begin{array}{lll}\frac{\omega}{(n-3)\lambda \mu}(-m^{2})^{3-n}+\Theta, \qquad l=0, \quad n=4,6,8...,\\ \Theta\exp\{\frac{\omega}{(n-3)\lambda \mu}(-m^{2})^{3-n} \}, \quad l=1, \quad n=2,4,6,..,\\ (l-1)^{\frac{1}{1-l}}[\frac{\omega}{\lambda \mu}(-m^{2})+\Theta]^{\frac{1}{1-l}} , \qquad l=3,5,7,..\quad n=2; \end{array} \right. \label{conformal-vacuum} \end{eqnarray} where $\Theta=\Theta(x)$, is a strict positive arbitrary function, and $\lambda$ is a (positive) constant. The asymptotic limit for $\omega>0$ of the conformal factor is given by \begin{eqnarray} lim_{_{t\rightarrow +\infty}} \Omega^{2}_{vac}(x,t)\!\! & = & \!\! \left\{ \begin{array}{lllll} +\infty , \qquad l=0, \quad n=4,6,8..,\\ +\infty, \qquad l=1, \quad n=4,6,8..,\\ \Theta, \qquad l=1, \qquad n=2,\\ ((l-1) \Theta)^{\frac{1}{1-l}}, \qquad l=3,5,7,.., \quad n=2; \\ \end{array} \right. \label{conformal-vacuum-asymp} \end{eqnarray} observe that the case $l=1$ has a splitting depending on the $n$-values; note also that the case $n=2$ of the mass spectrum is special, since if $\Theta$ is bounded, then is the only case with asymptotically bounded metric. Moreover, the area of the manifolds at vacuum is given directly by the expression ${\cal A}_{vac}(t)= \int_{M}\Omega^{2}_{vac}(x,t) d^{2}x$, and will inherit the asymptotic behavior from the conformal factor. The case $\omega=0$, will correspond to a scenario with conformal factor and area preserved along the flows, determined essentially by the function $\Theta$. Furthermore, in the Figure 2 we describe the evolution of the Higgs potential according to the evolution of its Width and Height; for simplicity we take $\lambda$ only as a stationary parameter. Under evolution, the potential becomes smoother, tending to eliminate the degeneration; however, this will take an infinite time. \begin{figure}[H] \begin{center} \includegraphics[width=.4\textwidth]{vacumm5.png} \caption{The Higgs potential under evolution: In the forefront we have the potential at $t=0$ with certain sharpness; this is soften under evolution, since both the Width and the Height of the barrier decrease according to the behavior of the mass spectrum; this fact seems to favor the tunneling between the two minima. Since $lim_{t\rightarrow +\infty}[m(t,n)]=0$, then $lim_{t\rightarrow +\infty}[Width, Height]=0$, and the degeneration of vacuum is preserved at finite time; once the SSB has occurred, so is maintained along the flows.} \label{fig:ejemplo} \end{center} \end{figure} \newpage As a result of the previous analysis, we can obtain that the quantum probability (per unit area) of tunneling between vacua is proportional to $$\Psi(t)\equiv\exp{[\int_{M} V_{vac}]}/{\cal A}_{vac}=\exp{[- \int_{M}\Omega^{2}_{vac}(\frac{m^{4}}{\lambda} )d^{2}x ]}/\int_{M}\Omega^{2}d^{2}x, $$ which is even under reflection. From this expression we shall determine the qualitative aspects for possible transitions of manifolds, depending essentially on their boundedness. We consider first the case with $\omega = 0$, which corresponds to manifolds of area determined by the integration over $M$ of the function $\Theta(x)$, preserved along the flows, and independent on the mass $m(t)$. At the beginning, $\Psi(t=0)$ is determined by the configuration of $m(t=0)$ (the blue points in the Figure 1), for each value admitted of $n$, which proves to be finite for manifolds with ${\cal A}$ bounded; thus, such a probability increases along the flow, and reaches an asymptotic maximum as $lim_{t\rightarrow +\infty}\Psi(t,n,l)\sim \frac{1}{{\cal A}_{vac}}$. Therefore, in the case of two-manifolds at vacua with unbounded area, the probability of transition goes to zero for all $t$; in other words, the manifolds with infinite area do not "climb the wall", and are concentrated around the minima, a result certainly expected. Note that this conclusion is valid in spite of the behavior of the Higgs potential in the Figure 2. In the cases with $\omega>0$, the tunneling probability will be dominated by an increasing area along the flows; the probability at $t=0$ will be given by the configuration of $m$ and ${\cal A}$ at $t=0$, and we assume that is finite for ${\cal A}$ finite. Now, in the first scenario with $l=0$, and $n=4,6,8,...,$ described in (\ref{conformal-vacuum-asymp}), the exponential is increasing for $n=4$, but bounded from above; thus $lim_{t\rightarrow +\infty}\Psi(t,l=0, n=4)=0$, since the area is unbounded. In the same scenario, the cases with $n=6,8,...,$, involve a decaying exponential, and the decay rate of $\Psi$ as $t\rightarrow +\infty$ is greater than the case $n=4$. The second scenario in (\ref{conformal-vacuum-asymp}) with $l=1$, and $n=4,6,8,...,$ is qualitatively similar. Qualitative differences of quantum tunneling emerge in the cases when the area is bounded along the flows and for $t\rightarrow +\infty$, which correspond to the last two cases in (\ref{conformal-vacuum-asymp}) described by the function $\Theta$. Along the lines discussed above, we start with certain probability at $t=0$, it goes decreasing but with lower limits given by $lim_{t\rightarrow +\infty}\Psi(t,l=1, n=2)\sim\frac{1}{\int_{M}\Theta}$, and $lim_{t\rightarrow +\infty}\Psi(t,l=3,5,7,..., n=2) \sim \frac{1}{\int_{M}((l-1) \Theta)^{\frac{1}{1-l}}}$, respectively. The last case deserves more discussion, since the probability has a maximum for certain combination of $l$ and the function $\Theta$. Consider first that $\Theta$ is a constant (positive); thus, the values of the probability against $l$ lie on the following curve (Figure 3), drawn for continuous values of $l$; this curve shows a maximum, although it is not localized precisely in an admissible value of $l$, since it depends also on $\Theta$; the corresponding value of $l$ is the closest to that calculated as a continuous variable, which maximizes the tunneling probability. \begin{figure}[H] \begin{center} \includegraphics[width=.5\textwidth]{prob.png} \caption{For $\Theta$ a positive constant, the maximum for the tunneling probability is localized at the blue point in $\frac{e^{(l-1)^{2}}}{l-1}=\Theta e^{-1/\Theta}$, considering $l$ as a continuous variable. The admissible values $l=3,5,7,...,$ correspond to the red points; the red point closest to the blue point gives the wished pair $(l,\Psi)$. With the dashed line we show an additional limiting scenario with $lim_{l\rightarrow +\infty}[\frac{1}{((l-1) \Theta)^{\frac{1}{1-l}}}]=\frac{1}{\Theta}$, which coincides with the limit for the case $(l=1, n=2)$ as ${t\rightarrow +\infty}$.} \label{fig:ejemplo} \end{center} \end{figure} If the function $\Theta$ depends on $x$, the condition for the maximum of the probability is given by the following integral constraint, \begin{equation} \int_{M} \Theta^{\frac{1}{1-l}}[(l-1)^{2}+\frac{1}{\Theta}-\ln[(l-1)\Theta]] =0; \label{prob-max} \end{equation} once the integration is made, the constraint is reduced to an algebraic equation for $l$ as a continuous variable; the value calculated allows to choice the closest $l$ among the admissible values. In terms of the conformal factor the only component of the $\widehat{R}$-curvature is expressed as $\widehat{R}^{2}{_{112}} = -\frac{1}{2} \Box \ln \Omega^{2}$; at vacua it has the form \begin{eqnarray} [\widehat{R}^{2}{_{112}}]_{vac} = - \frac{1}{2} \Box \left\{ \begin{array}{ll} \ln [\frac{\omega}{(n-3)\lambda\mu}(-m^{2})^{3-n} + \Theta], & l=0, \quad n=4,6,8,\ldots ,\\ \ln \Theta + \frac{\omega}{(n-3)\lambda\mu}(-m^{2})^{3-n}, & l=1, \quad n=2,4,6,\ldots, \\ \frac{1}{1-l} \ln [\frac{\omega}{\lambda\mu} (-m^{2}) + \Theta], & l=3,5,7,\ldots \quad n=2; \end{array} \right. \label{R-vacuum} \end{eqnarray} which respects the reflection symmetry; this symmetry is maintained under evolution according to the Eq. (\ref{evolution-6}), since $( V_{\Omega})_{vac}$ is even under reflection. The asymptotic limit is given by \begin{eqnarray} \lim_{t\rightarrow +\infty} [\widehat{R}^{2}{_{112}}] _{vac}= \left\{ \begin{array}{lll} \frac{1}{2} \Box \ln (\lambda \mu^{\frac{2}{n-1}}), & l=0, \quad n=4,6,8,\ldots \\ \infty, & l=1, \quad n=4,6,8,\ldots \\ -\frac{1}{2} \Box \ln \Theta , & l=1, \quad n=2, \\ \frac{1}{2(l-1)} \Box \ln\Theta , & l=3,5,7,\ldots, \quad n=2, \end{array} \right. \label{R-asymp} \end{eqnarray} note that the first case of a divergent metric as $t\rightarrow +\infty$ in Eq. (\ref{conformal-vacuum-asymp}), is cured at the level of the $\widehat{R}$-curvature, due to the presence of the logarithmic function; in the second case the divergent behavior persists. Similarly to the UES case, the manifolds at the degenerate vacua have no torsion, $T_{vac}(t)=\nabla\phi_{vac}(t)=0$, thus, with a vanishing $S$-curvature along the flow, since \begin{equation} \partial_{t} (R^{+}_{ij})_{vac} = \mp \frac{1}{4} (\widehat{\nabla}_{(i} \mp \partial_{(i} \phi_{vac}) \partial_{j)} \widehat{\Box} \phi_{vac} \pm \frac{1}{2} \partial_{t}( \widehat{\Gamma}^{k}_{ij})_{ vac} \cdot \partial_{k} \phi_{vac}=0. \label{S-vac-ev} \end{equation} Furthermore, considering that $\partial_{t}(\widehat{R}^{1}{_{112}})_{vac} = -\frac{\omega}{2} \Box (\frac{m^{4}}{\lambda} \Omega^{2l-2}_{vac})$, a negative gradient along the flows, then the geometries at vacua with positive curvature at $t=0$ tend to be flat, but bounded below according to Eq. (\ref{R-asymp}); by choosing appropriately the functions $\lambda$, $\mu$, and $\Theta$, such bound limits can be fixed to flat two-dimensional geometries. In the case of geometries with initial negative curvature, the flow tends to evolve to make it more negative, but bounded from below. Thus, in general the flow tends to favor negative curvatures for vacua. \section{Concluding remarks} The present scheme allows to distinguish dynamically between geometries with and without torsion; in the case with a SSB scenario, the building of the perturbation theory around a ground state, corresponds to expand around conformally flat two-dimensional geometries without torsion (the usual ones), generating hence twisted geometries once the reflexion symmetry is broken spontaneously. These results have been obtained by using basically the parameters flows, ignoring explicit solutions for the diffusion-like equation for the Higgs field; explicit solutions are available in the literature, and we shall extend the results in future communications. As commented previously, the explicit solutions for the coupled system of metric and Higgs flows will allow to determine the evolution of the potential in an UES scenario as initial condition; it is possible that there exist transitions between different scenarios, which will connect different phases of the theory by trajectories in the parameters space. String theory is formulated basically on the geometries associated to the vacua in the SSB scenario; it will be interesting to re-formulate the theory using the twisted geometries that emerge by SSB. \begin{center} {\uno ACKNOWLEDGMENTS} \end{center} This work was supported by the Sistema Nacional de Investigadores (M\'{e}xico); the analysis of the differential equations and figures were made using Mathematica. RCF and AHA acknowledge support by a CONACYT Grant No. A1-S-38041, and JBM for financial support from CONACYT-Mexico under the project No. CB-2017-283838.
\section{Introduction} \label{sec:intro} Low-dimensional node embeddings are a primary tool in graph mining and machine learning. They are used for node classification, community detection, link prediction, and graph generative models. Classic approaches like spectral clustering \citep{shi2000normalized,ng2002spectral}, Laplacian eigenmaps \citep{belkin2003laplacian}, IsoMap \citep{tenenbaum2000global}, and locally linear embeddings \citep{roweis2000nonlinear} use spectral embeddings derived for the graph Laplacian, adjacency matrix, or their variants. Recently, neural-network and random-walk-based embeddings have become popular due to their superior performance in many settings. Examples include DeepWalk \citep{PerozziAl-RfouSkiena:2014}, node2vec \citep{grover2016node2vec}, LINE \citep{tang2015line}, NetMF \citep{QiuDongMa:2018}, and many others \citep{cao2016deep,kipf2016semi,wang2016structural}. In many cases, these methods can be viewed as variants on classic spectral methods, producing an approximate low-dimensional factorization of an implicit matrix representing graph structure \citep{QiuDongMa:2018}. \spara{Problem definition.} We focus on the following high-level question: \begin{quotation} \noindent What graph properties are encoded in and can be recovered from node embeddings? How do these properties correlate with learning tasks? \end{quotation} \noindent We study the above question on undirected graphs with non-negative edge weights. Let $\mathcal{G}$ denote the set of all such graphs with $n$ nodes. We formalize the question via Problems~\ref{prob:inversion} and \ref{prob:stab} below. \begin{problem}[Embedding Inversion]\label{prob:inversion} Given an embedding algorithm $\mathcal{E}: \mathcal{G} \rightarrow \mathbb{R}^{n \times k}$ and the embedding $\mathcal{E}(G)$ for some $G \in \mathcal{G}$, produce $\tilde G \in \mathcal{G}$ with $\mathcal{E}(\tilde G) = \mathcal{E}(G)$ or such that $\norm{\mathcal{E}(\tilde G) - \mathcal{E}(G)}$ is small for some norm $\norm{\cdot}$ \end{problem} \noindent We refer to $k$ as the {\em embedding dimension}. A solution to Problem \ref{prob:inversion} lets us approximately invert the embedding $\mathcal{E}(G)$ to obtain a graph. It is natural to ask what structure is common between $G, \tilde G$. Using the same notation as Problem~\ref{prob:inversion}, our second problem is as follows. \begin{problem}[Graph Recovery]\label{prob:stab} Given $G, \tilde G$ such that $\norm{\mathcal{E}(\tilde G) - \mathcal{E}(G)}$ is small for some matrix norm $\norm{\cdot}$, how close are $G,\tilde G$ in terms of common edges, degree sequence, triangle counts, and community structure? \end{problem} Answering Problems~\ref{prob:inversion} and ~\ref{prob:stab} is an important step towards a better understanding of a node embedding method $\mathcal{E}$. We focus on the popular DeepWalk method of \citet{PerozziAl-RfouSkiena:2014}. DeepWalk embedding can be interpreted as low-rank approximation of a pointwise mutual information (PMI) matrix based on node co-occurrences in random walks \citep{GoldbergLevy:2014}. The NetMF method of \citet{QiuDongMa:2018} directly implements this low-rank approximation using SVD, giving a variant with improved performance in many tasks. Due to its mathematically clean definition, we use this variant. Many embedding methods can be viewed similarly -- as producing a low-rank approximation of some graph-based similarity matrix. We expect our methods to extend to such embeddings. \begin{figure*} \centering \begin{tabular}{cc} \includegraphics[width=0.40\linewidth]{figures/intro_adjacency_frobeniuscoin_toss} & \includegraphics[width=0.40\linewidth]{figures/intro_conductance_Homo_sapiens} \\ (a) & (b) \end{tabular} \caption{\label{fig:intro_fig} (a) Relative Frobenius error $\norm{A-\tilde A}_F/\norm{A}_F$ between the adjacency matrices of $G$ and $\tilde G$. (b) Relative error between $G$ and $\tilde{G}$ for the conductances of the five largest communities (corresponding to biological states) in a human protein-protein interaction network.} \end{figure*} \spara{Our contributions.} We make the following findings: \begin{itemize} \item We prove that when the embedding dimension $k$ is equal to $n$ and the node embedding method is NetMF in the limit as the co-occurrence window size parameter goes to infinity, then solving a linear system can provably recover $G$ from $\mathcal{E}(G)$, i.e., find $\tilde G = G$. \item We present two algorithms for solving Problem~\ref{prob:inversion} on NetMF embeddings in typical parameter regimes. The first is inspired by the above result, and relies on solving a linear system. The second is based on minimizing $\norm{\mathcal{E}(G) - \mathcal{E}(\tilde G)}_F$, where $\norm{\cdot}_F$ is the matrix Frobenius norm, using gradient based optimization. \item Despite the non-convex nature of the above optimization problem, we show empirically that our approach successfully solves Problem \ref{prob:inversion} on a variety of real word graphs, for a range of embedding dimensions used frequently in practice. We show that, typically our optimization based algorithm outperforms the linear system approach with respect to producing a graph $\tilde G$ with embeddings closer to those of the input graph $G$. \item We study Problem~\ref{prob:stab} by applying our optimization algorithm to NetMF embeddings for a variety of real world graphs. We compare the input graph $G$ and the output of our inversion algorithm $\tilde G$ across different criteria. Our key findings include the following: \begin{enumerate} \item \spara{Fine-Grained Edge Information.} As the embedding dimension $k$ increases {\em up to a certain point} $\tilde G$ tends closer to $G$, i.e., the Frobenius norm of the difference of the adjacency matrices gets smaller. After a certain point, the recovery algorithm is trying unsuccessfully to reconstruct fine grained edge information that is ``washed-out'' by NetMF. Figure~\ref{fig:intro_fig}(a) illustrates this finding for a popular benchmark of datasets (see Section~\ref{sec:exp} for more details). \item \spara{Graph properties.} We focus on two fundamental graph properties, counts of triangles and community structure. Surprisingly, while the number of triangles in $G$ and $\tilde G$ can differ significantly, community structure is well-preserved. In some cases this structure is actually enhanced/emphasized by the embedding method. I.e., the conductance of the same community in $\tilde G$ is even lower than in $G$. Figure~\ref{fig:intro_fig}(b) shows the relative error between the conductance of a ground-truth community in $G$ and the conductance of the same community in $\tilde G$ vs. $k$ for the five largest communities in a human protein-protein interaction network. \end{enumerate} Figure~\ref{fig:intro_matshow} provides another visual summary of the above findings. Specifically, it shows on the left the spy plot of a stochastic block model graph with 1\,000 nodes and four clusters, and on the right the spy plot of the output of our reconstruction algorithm from a $32$-dimensional NetMF embedding of the former graph. The two graphs differ on exact edges, but the community structure is preserved. \end{itemize} \begin{figure} \centering \includegraphics[width=0.33\linewidth]{sbm1_true} \quad \includegraphics[width=0.33\linewidth]{sbm1_recon_32} \caption{$G$ (left), a stochastic block model graph with 1000 nodes and 4 clusters, and $\tilde G$ (right), a reconstruction of $G$ from a $32$-dimensional NetMF embedding. While $G$ and $\tilde G$ differ in the exact edges they contain, we can see that the community structure is preserved.} \label{fig:intro_matshow} \end{figure} \section{Related work} \label{sec:rel} \spara{Graph recovery from embeddings.} To the best of our knowledge, Problem~\ref{prob:inversion} has not been studied explicitly in prior work. \citet{hoskins2018learning} study graph recovery using a partial set of effective resistance measurements between nodes -- equivalent to Euclidean distances for a certain embedding, see Section 4 of \citep{spielman2011graph}. Close to our work lies recent work on node embedding privacy, and in particular graph reconstruction attacks on these embeddings. \citet{EllersCochezSchumacher:2019} identify neighbors of a given node $v$ with good accuracy by considering the change in embeddings of the other nodes in $G$ and $G \setminus v$. \citet{DudduBoutetShejwalkar:2020} study a graph reconstruction attack that inverts a simple spectral embedding using a neural network. Training this network requires knowledge of a random subgraph of $G$, used as training data, and can be viewed as solving Problem \ref{prob:inversion}, but with some auxiliary information provided on top of $\mathcal{E}(G)$. Graph sketching algorithms study the recovery of information about $G$ (e.g., approximations to all its cuts or shortest path distances) from linear measurements of its edge-vertex incidence matrix \citep{McGregor:2014}. These linear measurements can be thought of as low-dimensional node embeddings. However, generally they are designed specifically to encode certain information about $G$, and they differ greatly from the type of embeddings used in graph learning applications. Recently, \citet{chanpuriya2020node} showed that any graph with degree bounded by $\Delta$ admits an embedding into $2\Delta+1$ dimensions that can be \emph{exactly inverted}. These exact embeddings allow for a perfect encoding of the full graph structure in low-dimensions, and circumvent limitations of a large family of embeddings that cannot capture triangle richness and edge sparsity {\em provably} in low dimensions \citep{seshadhri2020impossibility}. \spara{DeepWalk and NetMF.} We focus on inverting embeddings produced by the \citet{QiuDongMa:2018} NetMF variant of the popular DeepWalk method of \citet{PerozziAl-RfouSkiena:2014}. Consider an undirected, connected, non-bipartite graph $G$, with adjacency matrix $A \in \{0,1\}^{n \times n}$, diagonal degree matrix $D \in \mathbb{R}^{n \times n}$ and volume $v_G = \mathrm{tr}(D) = \sum_{i, j} A_{i,j}$. Qui et al. show that, for window size hyperparameter $T$ (typical settings are $T = 10$ or $T = 1$), DeepWalk stochastically factorizes the \emph{pointwise mutual information (PMI) matrix}: \begin{align*} \hat{M}_T = \log \left( \frac{v_G}{T}\sum_{r=1}^{T}(D^{-1}A)^r D^{-1} \right), \end{align*} \noindent where the logarithm is applied entrywise to its $n \times n$ argument. Note that if the diameter of $G$ exceeds $T$, then at least one entry of $\sum_{r=1}^{T}(D^{-1}A)^r D^{-1}$ will be $0$. To avoid taking the logarithm of $0$, NetMF instead employs the \emph{positive pointwise mutual information (PPMI)} matrix: \begin{align} \label{eq:netmf} M_T = \log \left( \max\left(1, \frac{v_G}{T}\sum_{r=1}^{T}(D^{-1}A)^r D^{-1} \right) \right) . \end{align} Via truncated eigendecomposition of $M_T$, one can find an eigenvector matrix $V \in \mathbb{R}^{n \times k}$ and a diagonal eigenvalue matrix $W \in \mathbb{R}^{k \times k}$ such that ${M}_{T,k} = V W V^\top$ is the best possible $k$-rank approximation of $M_T$ in the Frobenius norm. The NetMF embedding is set to the eigenvectors scaled by the square roots of the eigenvalue magnitudes. I.e., $\mathcal{E}(G) = V \sqrt{|W|}$, where the absolute value and the square root are applied entrywise. In practice, these node embeddings perform at least as well as DeepWalk in downstream tasks. Further, their deterministic nature lets us to define a straightforward optimization model to invert them. \section{Proposed methods} \label{sec:proposed} In Sections~\ref{subsec:linear_system} and \ref{subsec:gradalg} we present our two proposed NetMF embedding inversion methods. The first is inspired by our constructive proof of Theorem~\ref{thm:invert} and relies on solving an appropriately defined linear system. The second is based on optimizing a natural objective using a gradient descent algorithm. Since the NetMF embedding $\mathcal{E}(G)$ encodes the best $k$-rank approximation $M_{T,k} = VWV^T$ to the positive pointwise mutual information (PPMI) matrix $M_T$, we will assume throughout that we are given $M_{T,k}$ directly and seek to recover $\tilde G$ from this matrix. We also assume knowledge of the number of edges in $G$ in terms of the volume $v_G$. While all networks used in our experiments are unweighted, simple, undirected graphs, i.e., their adjacency matrices are binary ($A \in \{0,1\}^{n \times n}$), our inversion algorithms produce $\tilde G$ with $\tilde{A}\in [0,1]^{n \times n}$. The real valued edge weights in $\tilde G$ can be thought of as representing edge probabilities. We will also convert $\tilde G$ to an unweighted graph with binary adjacency matrix $\tilde{A}_b\in \{0,1\}^{n \times n}$. We describe the binarization process in detail in the following sections. \subsection{Analytical Approach} \label{subsec:linear_system} We leverage a recent asymptotic result of \citet{infiniteWalk}, which shows that as the number of samples and the window size $T$ for DeepWalk/NetMF tend to infinity, the PMI matrix tends to the limit: \begin{equation} \label{eq:infwalk} \begin{aligned} \lim_{T\to \infty} T \cdot \hat{M}_T &= \hat{M}_\infty = v_G \cdot D^{-1/2} (\bar L^+ - I) D^{-1/2} + J , \end{aligned} \end{equation} where $\bar L = I - D^{-1/2} A D^{-1/2}$ is the normalized Laplacian, $\bar{L}^+$ is the Moore-Penrose pseudoinverse of this matrix, and $J$ is the all-ones matrix. Our first observation is that if, in addition to $\hat{M}_\infty$, we are given the degrees of the vertices in $G$, then we know both $D$ and $v_G$, and we can simply invert equation \eqref{eq:infwalk} as follows: \begin{equation} \label{eq:infwalkbackideal} \begin{aligned} \bar{L} &= \left( D^{1/2} \left(\frac{ \hat{M}_\infty - J}{v_G}\right) D^{1/2} + I \right)^+ \\ A &= D^{1/2} \left( I - \bar{L} \right) D^{1/2} . \end{aligned} \end{equation} In Appendix~\ref{app:degrees}, we show using just the graph volume $v_G$, that one can perfectly recover the degree matrix ${D}$ from $\hat{M}_\infty$ via a linear system, provided the adjacency matrix of $G$ is full-rank. Combining this fact with Equations~\eqref{eq:infwalk} and~\eqref{eq:infwalkbackideal} we obtain the following: \begin{theorem}[Limiting Invertibility of Full-Rank PMI Embeddings] \label{thm:invert} Let $G$ be an undirected, connected, non-bipartite graph with full-rank adjacency matrix $A \in \{0,1\}^{n \times n}$ and volume $v_G$. Let $\hat{M}_T$ be the PMI matrix of $G$ which is produced with window size $T$. There exists an algorithm that takes only $\hat{M}_T$ and $v_G$ as input and recovers $A$ exactly in the limit as $T \to \infty$. \end{theorem} In our embedding inversion task, rather than the exact limiting PMI matrix $\hat{M}_\infty$, we are given the low-rank approximation $M_{T,k}$ of the finite-$T$ PPMI matrix, through the NetMF embeddings. Our first algorithm is based on essentially ignoring this difference. We use $M_{T,k}$ to obtain an approximation to $\hat{M}_\infty$, which we then plug into \eqref{eq:infwalkbackideal}. This approximation is based on inverting the following limit, shown by~\citet{infiniteWalk}: % \begin{align}\label{eq:pminonlinearapprox} \lim_{T\to \infty} \hat{M}_T = \log\left( \tfrac{1}{T} \hat{M}_\infty + J \right), \end{align} where the logarithm is applied entrywise. Due to the various approximations used, the elements of the reconstructed adjacency matrix $\tilde A$ may not be in $\{0,1\}$, and may not even be in $[0,1]$; for this reason, as in \citet{seshadhri2020impossibility}, we apply an entrywise clipping function, $\text{clip}(x) = \min(\max(0,x),1)$, after the inversion steps from Equations~\eqref{eq:infwalkbackideal} and \eqref{eq:pminonlinearapprox}. The overall procedure is given in Algorithm~\ref{alg:dwbackanl}. \begin{algorithm} \caption{DeepWalking Backwards (Analytical)} \label{alg:dwbackanl} \textbf{input} approximation $M_{T,k}$ of true $T$-step PPMI, window-size $T$, degree matrix $D$, graph volume $v_G$ \\ \textbf{output} reconstructed adjacency matrix $\tilde{A} \in [0,1]^{n \times n}$ \begin{algorithmic}[1] \State $\tilde{M}_\infty \gets T \cdot \left( \exp \left({M_{T,k}} \right) - J \right)$ \Comment{\textcolor{gray}{$\exp$ is applied entrywise, $J$ is the all-ones matrix}} \State $\tilde{\bar{L}} \gets \left( D^{1/2} \left(\frac{ \tilde{M}_\infty - J}{v_G}\right) D^{1/2} + I \right)^+$ \State $\tilde{A} \gets \text{clip}\left( D^{1/2} \left( I - \tilde{\bar{L}} \right) D^{1/2} \right)$ \State \textbf{return} $\tilde{A}$ \end{algorithmic} \end{algorithm} \spara{Binarization.} To produce a binary adjacency matrix $\tilde{A}_b\in \{0,1\}^{n \times n}$ from $\tilde{A}$, we use a slight modification of Algorithm~\ref{alg:dwbackanl}: rather than clipping, we set the highest $v_G$ off-diagonal entries above the diagonal to 1, and their symmetric counterparts below the diagonal to 1. This ensures that the matrix represents an undirected graph $\tilde G$ with the same number of edges as $G$. \subsection{Optimization Approach} \label{subsec:gradalg} Our gradient based approach parameterizes the entries of a real valued adjacency matrix $\tilde{A} \in (0,1)^{n \times n}$ with independent logits for each potential edge, and leverages the differentiability of Equation~\eqref{eq:netmf}. Based on $\tilde{A}$, we compute the PPMI matrix $\tilde{M}_T$, and then the squared PPMI error loss, i.e., the squared Frobenius error between $\tilde{M}_T$ and the low-rank approximation $M_{T,k}$ of the true PPMI, given by the NetMF embeddings. We differentiate through these steps, update the logits, and repeat. Pseudocode is given in Algorithm~\ref{alg:dwbackgrad}. Since the input to the algorithm is a low-rank approximation of the true PPMI, and since this approximation is used for the computation of error, it may seem more appropriate to also compute a low-rank approximation of the reconstructed PPMI matrix $\tilde M_T$ prior to computing the error; we skip this step since eigendecomposition within the optimization loop is both computationally costly and unstable to differentiate through. Note that we invoke a ``shifted logistic'' function $\sigma_v$ which constructs an adjacency matrix with a given target volume. The pseudocode for this function is given in Algorithm~\ref{alg:slogistic}. This algorithm is an application of Newton's method. We find that 10 iterations are sufficient for convergence in our experiments. Our implementation uses PyTorch~\citep{NEURIPS2019_9015} for automatic differentiation and minimizes the loss using the SciPy \citep{scipy} implementation of L-BFGS \citep{liu1989limited,zhu1997algorithm} with default hyperparameters and a maximum of 500 iterations. \begin{algorithm} \caption{DeepWalking Backwards (Optimization)} \label{alg:dwbackgrad} \textbf{input} approximation $M_{T,k}$ of true $T$-step PPMI, window-size $T$, graph volume $v_G$, number of iters. $N$ \\ \textbf{output} reconstructed adjacency matrix $\tilde{A} \in (0,1)^{n \times n}$ \begin{algorithmic}[1] \State Initialize elements of $X \in \mathbb{R}^{(n \times n)}$ to $0$ \Comment{\textcolor{gray}{logits of the reconstructed adjacency matrix}} \For{$i \gets 1$ to $N$} \State $\tilde{A} \gets \sigma_{v_G}(X)$ \Comment{\textcolor{gray}{construct adjacency matrix with target volume, see Algorithm~\ref{alg:slogistic}}} \State $\tilde{M}_T \gets \text{PPMI}\left( \tilde{A} \right)$ via Eq.~\eqref{eq:netmf} \State $L \gets \Vert \tilde{M}_T - M_{T,k} \Vert_F^2 $ \Comment{\textcolor{gray}{squared error of PPMI}} \State Calculate $\partial_{X} L$ via automatic differentiation through Steps 3 to 5 \State Update $X$ to minimize $L$ using $\partial_{X} L$ \EndFor \State \textbf{return} $\sigma_v(X)$ \end{algorithmic} \end{algorithm} \begin{algorithm} \caption{Shifted Logistic Function $\sigma_v$} \label{alg:slogistic} \textbf{input} logit matrix $X \in \mathbb{R}^{(n\times n)}$, target sum $v \in (0,n^2)$, number of iterations $I$ \\ \textbf{output} matrix $A \in (0,1)^{n \times n}$ which sums approximately to $v$ \begin{algorithmic}[1] \State $s \gets 0$ \For{$i \gets 1$ to $I$} \State $A \gets \sigma(X+s)$ \Comment{\textcolor{gray}{ $\sigma$ is the logistic function applied entrywise }} \State $s \gets s + \frac{ v - \Sigma(A) }{\Sigma\left( A \circ (1 - A) \right)}$ \Comment{\textcolor{gray}{ $\Sigma$ sums over all elements, and $\circ$ is an entrywise product }} \EndFor \State \textbf{return} $\sigma(X+s)$ \end{algorithmic} \end{algorithm} \spara{Binarization.} We binarize the reconstructed $\tilde{A} \in (0,1)^{n \times n}$ differently from the prior approach. We treat each element of $\tilde{A}$ as the parameter of a Bernoulli distribution and sample independently to produce $\tilde{A}_b \in \{0,1\}^{n \times n}$. Since we set $\tilde{A}$'s volume to be approximately $v_G$ using the $\sigma_v$ function, the number of edges in the binarized network after sampling is also $\approx v_G$. \section{Experimental results} \label{sec:exp} \subsection{Experimental setup} \spara{Datasets.} We apply the NetMF inversion algorithms described in Section~\ref{sec:proposed} to a benchmark of networks, summarized in Table~\ref{tab:datasets}. As part of our investigation of how well the output $\tilde{G}$ of our methods matches the underlying graph $G$, we examine how community structure is preserved. For this reason, we choose only test graphs with labeled ground-truth communities. All datasets we use are publicly available: see \citet{QiuDongMa:2018} for \textsc{BlogCatalog} and \textsc{PPI}, \citet{sen2008collective} for \textsc{Citeseer} and \textsc{Cora}, and SNAP~\citep{snapnets} for \textsc{Email} and \textsc{Youtube}. The \textsc{YouTube} graph we use is a sample of 20 communities from the raw network of \cite{snapnets}. For all networks, we consider only the largest connected component. The community labels that we report for various datasets, such as those reported in the legends of Figure~\ref{fig:conductancesmall}, refer to the labels as given in the input datasets. \begin{table}[h] \small \centering \begin{tabular}{llll} \toprule \textbf{Name} & \textbf{Nodes} & \textbf{Edges} & \textbf{\# Labels} \\ \midrule {\sc BlogCatalog} & 10,312 & 333,983 & 39 \\ {\sc E-mail} & 986 & 16,064 & 42 \\ {\sc PPI} & 3,852 & 76,546 & 50 \\ {\sc Cora} & 2,485 & 10,138 & 7 \\ {\sc Citeseer} & 2,110 & 7,388 & 6 \\ {\sc YouTube} & 10,617 & 55,864 & 20 \\ \bottomrule \end{tabular} \caption{\label{tab:datasets} Datasets used in our experiments.} \end{table} \spara{Hyperparameter settings.} We experiment with a set of different values for the embedding dimension $k$, starting from $2^4$ and incrementing in powers of $2$, up to $2^{11}=2048$, except for the {\sc Email} dataset, which has fewer than $2^{10}$ nodes. For this dataset we only test for $k$ up to $2^9$. Throughout the experiments, we set the window-size $T$ to 10, as this is the most commonly used value in downstream machine learning tasks. \spara{Evaluation.} Our first step is to evaluate how well the two algorithms proposed in Section \ref{sec:proposed} solve embedding inversion (Problem \ref{prob:inversion}). To do this, we measure the error in terms of the relative Frobenius error between the rank-$k$ approximations of the true and reconstructed PPMI matrices, $M_{T,k}$ and $\tilde M_{T,k}$ respectively. These matrices represent the NetMF embeddings of $G$ and $\tilde G$. The relative Frobenius error for two matrices $X$ and $\tilde{X}$ is simply $\norm{X-\tilde X}_F/\norm{X}_F$. We next study how the reconstructed graph $\tilde G$ obtained via embedding inversion compares with the true $G$ (Problem \ref{prob:stab}). Here, we binarize the reconstructed adjacency matrix to produce $\tilde A_b$. See Sections \ref{subsec:linear_system} and \ref{subsec:gradalg} for details. Thus, like $G$, $\tilde G$ is an undirected, unweighted graph. Most directly, we measure the relative Frobenius error between $G$'s adjacency matrix $A$ and $\tilde G$'s adjacency matrix $\tilde A_b$. We also measure the reconstruction error for three other key measures: \begin{itemize} \item \textbf{Number of triangles ($\tau$)}. The total number of 3-cliques, i.e., triangles, in the graph. \item \textbf{Average path length ($\ell$)}. The average path length between any two nodes in the graph. \item \textbf{Conductance ($\phi$) of ground-truth communities}. For a community $S$, the conductance is defined as: $\phi(S) = \frac{e(S:\bar{S})}{\min(\text{vol}(S),\text{vol}(\bar{S}))}$ where $e(S:\bar{S})$ is the number of edges leaving community $S$ and $\text{vol}(S)$ is number of edges induced by $S$. $\bar S$ is the complement $V \setminus S$. \end{itemize} For the above measures we report the {relative error} between the measure $x$ for the true network and the one of the recovered network $\tilde x$, defined as $(\tilde x-x)/x$. Finally, we evaluate how well $\tilde G$'s low-dimensional embeddings perform in classification, where the goal is to infer the labels of the nodes of $G$. We train a linear model using a fraction of the labeled nodes of $G$ and the low-dimensional embedding of $\tilde G$, and try to infer the labels of the remaining nodes. We report accuracy in terms of micro F1 score and compare it with the accuracy when using the low-dimensional embedding of $G$ itself. For this task, we use both the recovered real-valued adjacency matrix of $\tilde G$ and its binarized version. We observe that, contrary to the previous measures, performance is sensitive to binarization. \spara{Code.} All code is written in Python and is available at \url{https://github.com/konsotirop/Invert_Embeddings}. \begin{figure} \centering \includegraphics[width=0.40\linewidth]{linearVSoptLRvsLR} \quad \includegraphics[width=0.40\linewidth]{LRvsLR1} \caption{ \label{fig:frobenius_embedding} Relative Frobenius error vs. embedding rank $k$ for the low-rank PPMI matrices of the graphs reconstructed using the inversion algorithms: the analytical approach, Alg.~\ref{alg:dwbackanl} (left), and the optimization approach, Alg.~\ref{alg:dwbackgrad} (right). For details, see Section~\ref{subsec:alg1alg2}. } \vspace{-1.5em} \end{figure} \spara{Summary of findings.} Before we delve into details, we summarize our key findings. \begin{itemize} \item The optimization approach (Alg.~\ref{alg:dwbackgrad}), significantly outperforms the analytical approach (Alg.~\ref{alg:dwbackanl}), in terms of how closely the NetMF embeddings of the reconstructed graph $\tilde G$ match those of the true graph $G$ (i.e., in solving Problem \ref{prob:inversion}). See Figure~\ref{fig:frobenius_embedding}. \item Focusing on $\tilde G$ produced by Algorithm~\ref{alg:dwbackgrad}, the NetMF embedding is close to the input at all ranks. The adjacency matrix error of $\tilde G$ trends downwards as the embedding rank $k$ increases. However, for small $k$, the two graph topologies can be very different in terms of edges and non-edges. See Figure~\ref{fig:alg2_evaluation}. \item $\tilde G$ preserves and or even enhances the community structure present in $G$, and tends to preserve the average path length. However, the number of triangles in $\tilde G$ greatly differs from that in $G$ when the embedding rank $k$ is low. See Figure \ref{fig:alg2_evaluation}. \item $\tilde G$'s NetMF embeddings perform essentially identically to $G$'s in downstream classification on $G$. However, binarization has a significant effect: if we first binarize $\tilde G$'s edge weights, and then produce embeddings, there is a drop in classification performance. \item Overall, we are able to invert NetMF embeddings as laid out in Problem~\ref{prob:inversion} and, in the process, recover $\tilde G$ with similar community structure to the true graph $G$. Surprisingly, however, $\tilde G$ and $G$ can be very different graphs in terms of both specific edges and broader network properties, despite their similar embeddings. \end{itemize} \subsection{Analytical vs. Optimization Based Inversion} \label{subsec:alg1alg2} Figure~\ref{fig:frobenius_embedding} reports the relative Frobenius error of the analytical method (Alg.~\ref{alg:dwbackanl}) and the optimization approach (Alg.~\ref{alg:dwbackgrad}) in embedding inversion as we range $k$. We can see that Alg.~\ref{alg:dwbackgrad} {\em significantly} outperforms Alg.~\ref{alg:dwbackanl}. While Alg.~\ref{alg:dwbackanl} comes with strong theoretical guarantees (Theorem~\ref{thm:invert}) in asymptotic settings (i.e., $T \rightarrow \infty$, $k=n$), it performs poorly when these conditions are violated. In practice, the embedding dimension $k$ is always set to be less than $n$ (typical values are $128$ or $256$), and $T$ is finite ($T$ is often set to $10$). At these settings, the approximations used in Alg.~\ref{alg:dwbackanl} seem to severely limit its performance. Given the above, in the following sections we focus our attention on the optimization approach. This approach makes no assumption on the rank $k$, or the window-size $T$. We can see in Figure \ref{fig:frobenius_embedding} that the embedding error stays low across different values of $k$ when using Alg.~\ref{alg:dwbackgrad}, indicating that performance is insensitive to the dimension parameter. \begin{figure*} \centering \includegraphics[width=0.32\linewidth]{adjacency_frobeniuscoin_toss} \hfill \includegraphics[width=0.32\linewidth]{triangles_coin_toss}\hfill \includegraphics[width=0.32\linewidth]{apl} \caption{\label{fig:alg2_evaluation} From left to right: Relative Frobenius error for the binarized adjacency matrix; relative error for the number of triangles; and relative error for the average path length. All plots are versus the embedding rank. } \end{figure*} \subsection{Evaluating Graph Recovery} \label{subsec:evaluatealg2} \spara{Adjacency matrix reconstuction.} We next examine how closely the output of Alg.~\ref{alg:dwbackgrad}, the binarized adjacency matrix $\tilde A_{b}$, matches the original adjacency matrix $A$, especially as we vary the embedding dimensionality $k$. As can be seen in Figure~\ref{fig:alg2_evaluation}, at low ranks, the relative Frobenius error is often quite high -- near $1$. In combination with Figure~\ref{fig:frobenius_embedding} (left), this shows an interesting finding: two graphs may be very different topologically, but still have very similar low-dimensional node embeddings (i.e., low-rank PPMI matrices). We do observe that as the embedding dimension grows, the adjacency matrix error decreases. This aligns with the message of Theorem~\ref{thm:invert} that, in theory, high dimensional node embeddings yield enough information to facilitate full recovery of the underlying graph $G$. We remark that, by construction, $G$ and $\tilde G$ have approximately the same number of edges. Thus, the incurred Frobenius error is purely due to a reorientation of the specific edges between the true and the reconstructed networks. \spara{Recovery of graph properties.} Bearing in mind that the recovered $\tilde G$ differs substantially from the input graph $G$ in the specific edges it contains, we next investigate whether the embedding inversion process at least recovers bulk graph properties. Figure~\ref{fig:alg2_evaluation} shows the relative error of the triangle count versus embedding dimensionality $k$. We observe that the number of triangles can be hugely different among the true and the reconstructed networks when $k$ is small. In other words, there exist networks with similar low-dimensional NetMF embeddings that differ significantly in their total number of triangles. This is surprising: since the number of triangles is an important measure of local connectivity, one might expect it to be preserved by the node embeddings. In constrast, for another important global property, the average path length, the reconstruction error is always relatively low (also shown in Figure~\ref{fig:alg2_evaluation}). \begin{figure} \centering \includegraphics[width=0.32\linewidth]{conductance_blogcatalog} \hfill \includegraphics[width=0.32\linewidth]{conductance_cora} \hfill \includegraphics[width=0.32\linewidth]{conductance_citeseer}\\ \includegraphics[width=0.32\linewidth]{conductance_email} \hfill \includegraphics[width=0.32\linewidth]{conductance_Homo_sapiens}\hfill \includegraphics[width=0.32\linewidth]{conductance_youtube} \caption{Relative error for the conductances of the five largest communities for each of the selected networks.} \label{fig:conductancesmall} \end{figure} \begin{figure} \centering \includegraphics[width=0.32\linewidth]{blog_class_10_extra.png} \hfill \includegraphics[width=0.32\linewidth]{cora_class_10_extra.png}\hfill \includegraphics[width=0.32\linewidth]{citeseer_class_10_extra.png} \\ \includegraphics[width=0.32\linewidth]{email_class_10_extra.png}\hfill \includegraphics[width=0.32\linewidth]{ppi_class_10_extra.png}\hfill \includegraphics[width=0.32\linewidth]{youtube_class_10_extra.png} \caption{Multi-label classification using embeddings from reconstructed networks. Performance when using embeddings from a random graph is included as a baseline.} \label{fig:real_class} \end{figure} In Figure~\ref{fig:conductancesmall}, we plot the relative errors for the conductances of the five most populous communities of the networks under consideration. We see that the conductance of ground-truth communities is generally preserved in the reconstructed networks, with the error becoming negligible after rank $2^7=128$, an embedding rank which is often used in practice. This finding is intuitive -- since NetMF embeddings are used for node classification and community detection, it is to be expected that they preserve community structure. \spara{Node classification.} In a typical classification setting for a graph $G$, when we know only a fraction of the labels of its nodes and want to infer the rest, we can use a low-dimensional embedding of its nodes as our feature matrix and employ a linear classifier to infer the labels for the remaining nodes. While our reconstructed networks $\tilde G$ differ from $G$ edge-wise, they have similar low-dimensional NetMF embeddings. As another indicator of the preservation of community structure, we measure the performance in this node classification task when using the embeddings $\mathcal{E}(\tilde G)$ as our feature matrix in place of $\mathcal{E}(G)$. We report the performance of two embeddings made from reconstructed networks: by applying NetMF to $\tilde G$ before and after binarizing its edges as described in Section \ref{subsec:gradalg}. Our classification setting is the same as that of \cite{QiuDongMa:2018}: we use a one-vs-rest logistic regression classifier, sampling a certain portion of the nodes as the training set. We repeat this sampling procedure $10$ times and report the mean micro F1 scores. We also repeat the experiments as we vary the embedding dimensionality $k$ and as we change the ratio of labeled examples from 10\% to 90\%. As shown in Figure~\ref{fig:real_class}, when we use $\mathcal{E}(\tilde G)$ generated from the non-binarized (i.e., expected) $\tilde G$ as the input to our logistic regression classifier, we achieve almost equal performance to when we use the true embedding $\mathcal{E}(G)$. This finding can be interpreted in two ways. First, it shows that the low error observed in Figure~\ref{fig:frobenius_embedding} (left) extends beyond the Frobenius norm metric, to the perhaps more directly meaningful metric of comparable performance in classification. Second, it makes clear that losing local connectivity properties in the inversion process (like total triangle count and the existence of specific edges) does not significantly effect classification performance. The reconstructed networks seem to preserve more global properties that are important for node classification, like community structure. While binarization does not significantly affect other metrics used to compare $\tilde G$ to $G$ (e.g., adjacency error, triangles), the classification task seems to be more sensitive, as performance falls when we use the embedding for the binarized $\tilde G$. It is an interesting open direction to investigate this phenomenon, and generally how the low-dimensional embeddings of a probabilistic adjacency matrix change when that matrix is sampled to produce an unweighted graph. \spara{Synthetic graphs.} We repeat the above experiments using several synthetic networks produced by the stochastic block model (SBM)~\citep{abbe2015exact}. This random graph model assigns each node to a single cluster, and an edge between two nodes appears with probability $p_{in}$ if the nodes belong to the same cluster and $p_{out}$ otherwise, where generally it sets $p_{out} < p_{in}$. The configurations are summarized in Table~\ref{tab:sbm_config}. All networks have 1000 nodes, and, within each network, each cluster has the same size. \begin{table}[h] \centering \begin{tabular}{llll} \toprule \textbf{Name} & \textbf{\# of Clusters} & \textbf{$p_{in}$} & \textbf{$p_{out}$} \\ \midrule SBM 1 & 4 & 0.1 & 0.02 \\ SBM 2 & 2 & 0.06 & 0.015 \\ SBM 3 & 2 & 0.1 & 0.055 \\ SBM 4 & 2 & 0.1 & 0.01 \\ SBM 5 & 2 & 0.07 & 0.04 \\ \bottomrule \end{tabular} \caption{\label{tab:sbm_config} Configuration of SBM networks; all networks have 1000 nodes.} \end{table} As with the real-world networks, we include plots for the error of the NetMF embedding matrix and the binarized adjacency matrix; (Figure~\ref{fig:frobenius_embedding_sbm}; the error of triangles count, and average path length (Figure~\ref{fig:apl_triangles_sbm}); the error of the conductances of the top communities (Figure~\ref{fig:conductance_sbm}); and the node classification performance using embeddings made from the reconstructed networks (Figure~\ref{fig:sbm_class}). For the node classification task, each node is a member of a single ground-truth community which corresponds to its cluster in the SBM. The results here largely match those of the real-world networks: the networks recovered by applying NetMF embedding inversion differ substantially from the true networks in terms of adjacency matrix and triangle count. However, we observe that community structure is well preserved -- see Figure~\ref{fig:intro_matshow} for a visual depiction. Finally, we note that when our input is the full rank PPMI matrix (i.e., $k = n$), we succeed in reconstructing $G$ exactly (i.e., $\tilde G = G$) for the SBM networks. This further supports the message of Theorem~\ref{thm:invert} that, when embedding dimensionality is sufficiently high, node embeddings can be exactly inverted. However, at low dimensions, the embeddings seem to capture some important global properties, including community structure, while washing out more local structure. \begin{figure} \centering \includegraphics[width=0.40\linewidth]{LRvsLR1_SBM} \quad \includegraphics[width=0.40\linewidth]{sbm_adjacency_frobeniuscoin_toss} \caption{Relative Frobenius error for the low-rank PPMI matrices of reconstructions of the synthetic SBM networks (left) and the binarized adjacency matrix (right).} \label{fig:frobenius_embedding_sbm} \end{figure} \begin{figure} \centering \includegraphics[width=0.40\linewidth]{sbm_triangles_coin_toss} \quad \includegraphics[width=0.40\linewidth]{sbm_apl} \caption{Graph reconstruction errors for synthetic SBM networks. Relative error for the number of triangles (left) and for the average path length (right).} \label{fig:apl_triangles_sbm} \end{figure} \begin{figure}[h] \centering \includegraphics[width=0.32\linewidth]{conductance_sbm1} \hfill \includegraphics[width=0.32\linewidth]{conductance_sbm2} \hfill \includegraphics[width=0.32\linewidth]{conductance_sbm3}\\ \includegraphics[width=0.32\linewidth]{conductance_sbm4} \quad \includegraphics[width=0.32\linewidth]{conductance_sbm5} \caption{Relative error for the conductances of the five most populous communities for each synthetic SBM network.} \label{fig:conductance_sbm} \end{figure} \begin{figure}[h] \centering \includegraphics[width=0.32\linewidth]{sbm1_class_10} \quad \includegraphics[width=0.32\linewidth]{sbm2_class_10} \caption{Multi-label classification using embeddings from reconstructions of two of the synthetic SBM networks.} \label{fig:sbm_class} \end{figure} \section{Conclusion} \label{sec:concl} Node embeddings have been instrumental in achieving state-of-the-art results for graph-based machine learning tasks. Our work is a step towards a deeper understanding of why this is the case. We initiate the study of node embedding inversion as a tool to probe the information encoded in these embeddings. For the NetMF embedding method, we propose two approaches based on different techniques, and we show that the inversion problem can be effectively solved. Building on this, we show that while these embeddings seem to wash out local information in the underlying graph, they can be inverted to recover a graph with similar community structure to the original. Two interesting questions are whether our framework can be extended beyond the NetMF method, and whether we can formalize our empirical findings mathematically. We believe that our framework can be extended to the broader family of node embeddings that are based on low-rank factorization of graph similarity matrices. We hope that comparing the invertibility of such embeddings can shed light on the differences and similarities between them. \bibliographystyle{plainnat}
\section{Error indicator for the adaptive collision operator} \label{sec:indicator} According to the discussion in the previous section, given $\mathbf{f}$ defined on any spatial grid cell, our purpose is to choose appropriate $M_0$ such that the right-hand side of \eqref{eq:semi_discrete_SSP} is a good approximation of the collision term. Since the collision operator is defined locally in both time and space, we expect that the choice $M_0$ on any cell depends only on the distribution function defined thereon. Hence, we will omit the arguments $\bx$ and $t$ in the following discussion. Also, we assume that the distribution function $f$ has been normalized such that its integral equals $1$. The purpose of this normalization is to provide the bounds for the relative error. To begin with, we will introduce some notations and assumptions for the sake of convenience. \subsection{Notations and hypotheses} Let $\mathcal{T}_M$ be truncation operator that cut off the series defined in \eqref{eq:inf_series} by discarding all the terms with polynomials of degree greater than $M$. Therefore \begin{displaymath} \mathcal{T}_M f = f_M \end{displaymath} with $f_M$ given in \eqref{eq:truncated_series}. Then in the original spectral method \eqref{eq:PG}, the right-hand side represents the coefficients in the expansion of $\mathcal{T}_M Q[f_M, f_M]$. In other words, we have \begin{equation} \label{eq:original_rhs} [\mathbf{Q} : (\mathbf{f} \otimes \mathbf{f})]^T \bvphi = \mathcal{T}_M Q[f_M, f_M]. \end{equation} Similarly, for the right-hand side of \eqref{eq:semi_discrete_SSP}, we have \begin{equation} \label{eq:new_rhs} \begin{pmatrix} \mathbf{Q}_{M_0} : (\mathbf{f}^{(1)} \otimes \mathbf{f}^{(1)} - \mathbf{M}^{(1)} \otimes \mathbf{M}^{(1)}) \\ \nu_{M_0} (\mathbf{M}^{(2)} - \mathbf{f}^{(2)}) \end{pmatrix}^T \bvphi = \mathcal{T}_{M_0} \left( Q[f^{(1)}, f^{(1)}] - Q[\mathcal{M}^{(1)}, \mathcal{M}^{(1)}] \right) + \nu_{M_0}(\mathcal{M}^{(2)} - f^{(2)}), \end{equation} where we have used $\mathcal{M}$ to denote the local Maxwellian associated with the distribution function $f$, and we will use the notations $\mathcal{M}_M$, $\mathcal{M}^{(1)}$ and $\mathcal{M}^{(2)}$ defined similarly to \eqref{eq:truncated_series} and \eqref{eq:f1_f2}. Likewise, we define the operator \begin{displaymath} Q_M = \mathcal{T}_M Q, \end{displaymath} so that the right-hand side of \eqref{eq:original_rhs} can be written as $Q_M[f_M, f_M]$. To choose $M_0$, we are interested in the estimation of the difference between the two right-hand sides in \eqref{eq:original_rhs} and \eqref{eq:new_rhs}. For this aim, we make the following assumptions: \begin{itemize} \item The truncated series $f_M$ provides a sufficiently good approximation of the distribution function $f$, so that we can assume \begin{displaymath} f_M(\bv) \gtrapprox 0, \qquad \forall \bv \in \mathbb{R}^3, \end{displaymath} where ``$\gtrapprox$'' means the inequality holds approximately. \item The truncated series $\mathcal{M}_M$ provides a sufficiently good approximation of the local Maxwellian $\mathcal{M}$, so that we can assume $Q[\mathcal{M}_M, \mathcal{M}_M] \approx 0$. \item The operator $Q_M$ provides a sufficiently good approximation of the collision operator $Q$, so that $Q_M$ and $Q$ are interchangeable in the derivation below. \end{itemize} In general, these assumptions mean that $M$ is sufficiently large so that truncated functions and operators can almost preserve the properties of the original functions and operators. The purpose of these conditions is to focus mainly on the modeling error to be described below, and temporarily ignore the error introduced by the spectral method itself. Alternatively, one can regard $M$ as infinity in our following derivations so that the conditions above hold naturally. After the error indicator is derived, to make the computation feasible, the infinities that appear in its expression are replaced by a finite $M$ to approximate our error indicator. Now we use $\Delta Q$ to denote the modeling error, i.e. the difference between the right-hand sides of \eqref{eq:original_rhs} and \eqref{eq:new_rhs}: \begin{displaymath} \Delta Q := Q_M[f_M, f_M] - \Big( Q_{M_0}[f^{(1)}, f^{(1)}] - Q_{M_0}[\mathcal{M}^{(1)}, \mathcal{M}^{(1)}] + \nu_{M_0}(\mathcal{M}^{(2)} - f^{(2)}) \Big). \end{displaymath} Our aim is to find a heuristic error indicator characterizing the size of the quantity above. This error indicator must be relatively cheap to compute given the expansion of $f_M$. To this end, we split $\Delta Q$ into three terms, written in the three lines below: \begin{equation} \label{eq:Delta_Q} \begin{split} \Delta Q & = \big( Q_M[f^{(1)}, f^{(1)}] - Q_M[\mathcal{M}^{(1)}, \mathcal{M}^{(1)}] \big) - \big( Q_{M_0}[f^{(1)}, f^{(1)}] - Q_{M_0}[\mathcal{M}^{(1)}, \mathcal{M}^{(1)}] \big) \\ & + Q_M[f_M, f_M] - \big( Q_M[f^{(1)}, f^{(1)}] - Q_M[\mathcal{M}^{(1)}, \mathcal{M}^{(1)}] \big) \\ & - \nu_{M_0} (\mathcal{M}^{(2)} - f^{(2)}). \end{split} \end{equation} The first line in this equation is the truncation error of the function $Q_M[f^{(1)}, f^{(1)}] - Q_M[\mathcal{M}^{(1)}, \mathcal{M}^{(1)}]$. The estimation of the truncation error usually requires the information of the function, which is expensive to retrieve. As a workaround, we choose to ignore this term in our error indicator. In fact, this term may be relatively small due to the following two reasons: \begin{enumerate} \item Both $f^{(1)}$ and $\mathcal{M}^{(1)}$ are early truncations of the series (only include polynomials of degree up to $M_0$), which usually appear to be very smooth. Therefore both $Q_M[f^{(1)}, f^{(1)}]$ and $Q_M[\mathcal{M}^{(1)}, \mathcal{M}^{(1)}]$ are sufficiently smooth functions which can be well approximated by an early truncation of their expansions. \item According to the observations in \cite{Cai2015}, the dependence of higher moments on the lower moments is relatively weak, meaning that $f^{(1)}$ does not produce large numbers in the higher coefficients in the expansion of $Q_M[f^{(1)}, f^{(1)}]$, which is similar for $\mathcal{M}^{(1)}$. \end{enumerate} These statements are yet to be verified rigorously. We would like to leave it to future work. Below we will mainly focus on the quantification of the second line in \eqref{eq:Delta_Q}. \subsection{Building indicator} According to our working hypotheses, we rewrite the second line of \eqref{eq:Delta_Q} by replacing $Q_M$ with $Q$ and subtracting an approximately zero term $Q[\mathcal{M}_M, \mathcal{M}_M]$. Thereby we can rewrite this term as \begin{equation} \label{eq:DQ} \delta Q := \big(Q[f_M, f_M] - Q[\mathcal{M}_M, \mathcal{M}_M]\big) - \big(Q [f^{(1)}, f^{(1)}] - Q[\mathcal{M}^{(1)}, \mathcal{M}^{(1)}]\big). \end{equation} Using $f_M = f^{(1)} + f^{(2)}$ and the fact that $Q[\cdot,\cdot]$ is quadratic and symmetric, we have \begin{equation} \label{eq:sim_DQ1} \begin{aligned} \delta Q & =\big(Q[\mathcal{M}_M +( f_M - \mathcal{M}_M),\mathcal{M}_M +( f_M - \mathcal{M}_M) ] - Q[\mathcal{M}_M, \mathcal{M}_M]\big) \\ & \qquad - \big(Q[\mathcal{M}^{(1)} +(f^{(1)} - \mathcal{M}^{(1)}),\mathcal{M}^{(1)} +(f^{(1)} - \mathcal{M}^{(1)}) ] - Q[\mathcal{M}^{(1)}, \mathcal{M}^{(1)}] \big)\\ & = \underbrace{2\big(Q[f_M - \mathcal{M}_M, \mathcal{M}_M] - Q[f^{(1)} - \mathcal{M}^{(1)}, \mathcal{M}^{(1)}] \big)}_{\delta Q_a} + \underbrace{\big( Q[f_M - \mathcal{M}_M, f_M - \mathcal{M}_M] - Q[f^{(1)} - \mathcal{M}^{(1)}, f^{(1)} - \mathcal{M}^{(1)}]\big)}_{\delta Q_b}, \end{aligned} \end{equation} where $\delta Q_a$ and $\delta Q_b$ can be further simplified as \begin{equation} \label{eq:Q_ab} \begin{aligned} \delta Q_a & =2 Q[(f^{(1)} - \mathcal{M}^{(1)} )+ (f^{(2)} - \mathcal{M}^{(2)}), \mathcal{M}^{(1)} + \mathcal{M}^{(2)}] - 2Q[f^{(1)} - \mathcal{M}^{(1)}, \mathcal{M}^{(1)}] \\ & = 2 Q[f^{(2)} - \mathcal{M}^{(2)}, \mathcal{M}_M] + 2 Q[f^{(1)} - \mathcal{M}^{(1)}, \mathcal{M}^{(2)}], \\ \delta Q_b & =Q[f_M - \mathcal{M}_M, f_M - \mathcal{M}_M] - Q[(f_M - \mathcal{M}_M) - (f^{(2)} - \mathcal{M}^{(2)}), (f_M - \mathcal{M}_M) - ( f^{(2)} - \mathcal{M}^{(2)})] \\ & = Q[f^{(2)} - \mathcal{M}^{(2)}, f^{(2)}- \mathcal{M}^{(2)}] + 2 Q[f_M - \mathcal{M}_M , f^{(2)}- \mathcal{M}^{(2)}]. \end{aligned} \end{equation} Inserting \eqref{eq:Q_ab} into \eqref{eq:sim_DQ1} yields \begin{equation} \label{eq:sim_DQ} \begin{aligned} \delta Q & = 2\underbrace{Q[ f_M, f^{(2)} - \mathcal{M}^{(2)}]}_{\delta Q_1} + 2\underbrace{Q[f^{(1)} - \mathcal{M}^{(1)}, \mathcal{M}^{(2)} ]}_{\delta Q_2} +\underbrace{Q[f^{(2)} - \mathcal{M}^{(2)}, f^{(2)} - \mathcal{M}^{(2)} ]}_{\delta Q_3}. \end{aligned} \end{equation} This expression implies that $\delta Q$ is small in either of the following two scenarios: \begin{enumerate} \item The functions $f^{(1)}$ and $\mathcal{M}^{(1)}$ can accurately describe $f_M$ and $\mathcal{M}_M$, respectively, which means $f^{(2)}$ and $\mathcal{M}^{(2)}$ are small. \item The function $f_M$ is close to the equilibrium $\mathcal{M}_M$, which means $f^{(1)} - \mathcal{M}^{(1)}$ and $f^{(2)} - \mathcal{M}^{(2)}$ are both small. \end{enumerate} In either case, the term $\delta Q_3$ appears to be a quadratic term, and is expected to be smaller than the previous two terms. Hence, we ignore this term in our error indicator and mainly discuss the estimation of $\delta Q_1$ and $\delta Q_2$. The analysis above indicates that $\delta Q_1$ and $\delta Q_2$ present two different sources of the error: $\delta Q_1$ mainly captures the error due to the BGK approximation of the high-frequency part, and $\delta Q_2$ mainly captures the error due to the missing interaction between the low-frequency part and the high-frequency part. Before proceeding, we would like to first discuss how much computational cost we can afford to estimate \eqref{eq:sim_DQ}. Recall that the time complexity for evaluating all the coefficients in the expansion of $Q_M[f_M, f_M]$ is $O(M^8)$. Therefore, the computational cost of the indicator should be essentially smaller than $O(M^8)$ to achieve savings. Besides, the computational cost for the right-hand side of \eqref{eq:semi_discrete_SSP} is $O(M_0^8 + M^3)$ according to \cite{Hu2020b}, and our computational cost for the indicators should not be significantly larger than this. Thus, it is unrealistic to compute $\delta Q_1$ directly since its computation requires already $O(M^8)$ operations. Meanwhile, we would also like to avoid direct computation of $\delta Q_2$ since it requires $O(M^6 M_0^2)$ operations, which would take the most time of the simulation if computed. As a result, we need to estimate these terms using a computationally cheaper expression. The most naive approach is to consider the following type of estimation: \begin{displaymath} \|Q[f,g]\| \leqslant C \|f\| \cdot \|g\|. \end{displaymath} Unfortunately, the collision operator $Q$ is unbounded for most collision kernels. Note that the gain term may be bounded when the assumption of Grad's angular cut-off holds (see e.g. \cite{Mouhot2004}), while our approach to be proposed in the rest part of this section does not rely on this assumption. The basic idea is to bound $Q[f,g]$ by splitting it into the gain and loss operators: \begin{align*} Q^+[f,g] &= \frac{1}{2} \int_{\mathbb{R}^3} \int_{\bn \perp \bg} \int_0^{\pi} B(|\bg|, \chi) [f(\bv') g(\bv_*') + f(\bv_*') g(\bv')] \,\mathrm{d}\chi \,\mathrm{d}\bn \,\mathrm{d}\bv_*, \\ Q^-[f,g] &= \frac{1}{2} \int_{\mathbb{R}^3} \int_{\bn \perp \bg} \int_0^{\pi} B(|\bg|, \chi) [f(\bv) g(\bv_*) + f(\bv_*) g(\bv)] \,\mathrm{d}\chi \,\mathrm{d}\bn \,\mathrm{d}\bv_*. \end{align*} Then for any functions $f$ and $g$ satisfying $f \geqslant 0$, if we can find another distribution function $h$ satisfying $|g(\bv)| \leqslant h(\bv)$ for every $\bv \in \mathbb{R}^3$, then it holds that \begin{equation} \label{eq:est} |Q[f,g]| = |Q^+[f,g] - Q^-[f,g]| \leqslant Q^+[f,|g|] + Q^-[f,|g|] \leqslant Q^+[f,h] + Q^-[f,h], \end{equation} where we have used the positivity of the collision kernel $B(|\bg|,\chi)$ to get the last inequality. Thus, the right-hand side of \eqref{eq:est} can be used as an upper bound of $|Q[f,g]|$. In general, the computational cost of this upper bound is as high as a full collision operator. Therefore, the function $h$ must be chosen carefully so that $Q^+[f,h] + Q^-[f,h]$ can be efficiently computed. For simplicity, we define \begin{displaymath} Q^{\mathrm{abs}}[f,h] = Q^+[f,h] + Q^-[f,h], \end{displaymath} which is different from $Q[f,h]$ since $Q[f,h]$ is the difference of these two terms. Based on this idea, we need to answer the following two questions: \begin{enumerate} \item What should the general form of $h$ be such that the computation of $Q^{\mathrm{abs}}[f,h]$ is efficient? \item Given $f_M$, how to find the function $h$ as the bound of $f_M$? \end{enumerate} These two questions will be addressed in the following two subsections. \subsubsection{Space of the bounding function} Our choice of $h$ is established on the rotational invariance of the collision operator: \begin{lemma} For any orthogonal matrix $\boldsymbol{R}$, let \begin{displaymath} f^R(\bv) = f(\boldsymbol{R} \bv), \quad g^R(\bv) = g(\boldsymbol{R} \bv). \end{displaymath} Then \begin{displaymath} Q[f,g](\boldsymbol{R}\bv) = Q[f^R, g^R](\bv), \qquad Q^{\mathrm{abs}}[f,g](\boldsymbol{R}\bv) = Q^{\mathrm{abs}}[f^R, g^R](\bv). \end{displaymath} \end{lemma} Here the rotational invariance of the collision operator is a classical result and can be found in \cite[p. 45]{Degond2004}. The rotational invariance of $Q^{\mathrm{abs}}$ can be derived from the rotational invariance of both $Q^+$ and $Q^-$. A natural consequence of this result is \begin{corollary} Let $h(\bv)$ be a function depending only on $|\bv|$. Then the linear operator $\mathcal{L}_h[\cdot] := Q^{\mathrm{abs}}[\cdot,h]$ is a rotational invariant operator, \textit{i.e.}, for any orthogonal matrix $\boldsymbol{R}$, we have \begin{displaymath} \mathcal{L}_h[f](\boldsymbol{R}\bv) = \mathcal{L}_h[f^R](\bv), \end{displaymath} for $f^R(\bv) = f(\boldsymbol{R}\bv)$. \end{corollary} For linear rotationally invariant operators, we have the following result: \begin{theorem} Suppose $\mathcal{L}[\cdot]$ is a linear rationally invariant operator. For any non-negative integers $l$ and $n$, there exists an isotropic function $c_{ln}(|\bv|)$ such that \begin{displaymath} \mathcal{L}[\varphi_{lmn}](\bv) = c_{ln}(|\bv|) \varphi_{lmn}(\bv), \qquad \forall m = -l, \cdots, l. \end{displaymath} \end{theorem} This result is already given in \cite[Theorem 1]{Cai2015}, where the statement is written for the linearized collision operator but the proof only requires the rotational invariance of $\mathcal{L}$. This theorem indicates that the series form of $\mathcal{L}_h[\varphi_{lmn}]$ should be \begin{equation} \label{eq:L_h} \mathcal{L}_h[\varphi_{lmn}] = \sum_{n_1=0}^{+\infty} a_{lnn_1}^{(h)} \varphi_{lmn_1}. \end{equation} Consequently, if we choose $h(\bv)$ to be an isotropic function that depends only on $|\bv|$, we have \begin{displaymath} Q^{\mathrm{abs}}[f_M,h] = \mathcal{L}_h[f_M] = \sum_{l=0}^M \sum_{m=-l}^l \sum_{n=0}^{\lfloor (M-l)/2 \rfloor} f_{lmn} \mathcal{L}_h[\varphi_{lmn}] = \sum_{l=0}^M \sum_{m=-l}^l \sum_{n=0}^{\lfloor (M-l)/2 \rfloor} \sum_{n_1=0}^{+\infty} f_{lmn} a_{lnn_1}^{(h)} \varphi_{lmn_1}. \end{displaymath} Numerically, we truncate the series above by replacing $+\infty$ with $\lfloor (M-l)/2 \rfloor$. Thus, when all the coefficients $a_{lnn'}^{(h)}$ are given, the computational cost for the expansion of $Q^{\mathrm{abs}}[f_M,h]$ is $O(M^4)$. Technically, this can be done by carrying out the matrix-vector multiplication \begin{equation} \label{eq:Qabs_coef} Q^{\mathrm{abs}}_{lmn_1} = \sum_{n=0}^{\lfloor (M-l)/2 \rfloor} a_{lnn_1}^{(h)} f_{lmn}, \qquad l = 0,1\cdots,M, \quad m = -l, \cdots, l, \quad n_1 = 0,1,\cdots,\lfloor (M-l)/2 \rfloor, \end{equation} as allows efficient libraries of linear algebra to be used. To find the coefficients $a_{lnn_1}^{(h)}$, we need the expansion of $h$ in terms of the basis functions $\varphi_{lmn}$. Since we choose $h$ to be isotropic, the expansion holds the form \begin{displaymath} h(\bv) = \sum_{n'=0}^{+\infty} h_{n'} \varphi_{00n'}(\bv). \end{displaymath} For each $n'$, the function $\varphi_{00n'}$ is also isotropic, implying that $\mathcal{L}_{\varphi_{00n'}}[\cdot] = Q^{\mathrm{abs}}[\varphi_{00n'}, \cdot]$ is rotationally invariant. Thus we can assume \begin{displaymath} \mathcal{L}_{\varphi_{00n'}}[\varphi_{lmn}] = \sum_{n_1 = 0}^{+\infty} a_{lnn_1}^{n'} \varphi_{lmn_1}, \end{displaymath} so that \begin{displaymath} \mathcal{L}_{h}[\varphi_{lmn}] = \sum_{n'=0}^{+\infty} h_{n'} \mathcal{L}_{\varphi_{00n'}}[\varphi_{lmn}] = \sum_{n_1=0}^{+\infty} \sum_{n'=0}^{+\infty} a_{lnn_1}^{n'} h_{n'} \varphi_{lmn_1}. \end{displaymath} By comparing this equation with \eqref{eq:L_h}, one can find that \begin{equation} \label{eq:a_lnn1} a_{lnn_1}^{(h)} = \sum_{n' = 0}^{+\infty} a_{lnn_1}^{n'} h_{n'}, \qquad l = 0,1,\cdots,M, \quad n, n_1 = 0,1,\cdots, \lfloor (M-l)/2 \rfloor. \end{equation} In practice, we again truncate the above series by replacing $+\infty$ with some $N_0 = O(M)$. Then the equation \eqref{eq:a_lnn1} shows that the computation of all required coefficients again needs $O(M^4)$ operations. By now, we have concluded that choosing $h(\bv)$ to be an isotropic function can reduce the computational cost of $Q^{\mathrm{abs}}[f,h]$ to $O(M^4)$ (including \eqref{eq:a_lnn1} and \eqref{eq:Qabs_coef}). To complete the computation, we still need to obtain $a_{lnn_1}^{n'}$ for a given collision operator. These coefficients can be precomputed before the simulation, which will be discussed in detail in Section \ref{sec:a_lnn1}. Now we will first discuss the construction of $h$ such that $|g| \leqslant h$ for some given function $g$ in order that the estimation \eqref{eq:est} holds. \subsubsection{The approximation of the bounding function and the error indicator} In our implementation, instead of looking for $h$ that bounds $|g|$ pointwisely, we choose to find an approximate upper bound with the form \begin{equation} \label{eq:hv} h(\bv) = \sum_{n'=0}^{N_0} h_{n'} \varphi_{00n'}(\bv), \qquad N_0 = \left\lceil \frac{M}{2} \right\rceil. \end{equation} The general idea to find $h$ is to bound the radial part and the angular part separately. To this end, we write the basis functions as \begin{equation} \varphi_{lmn}(\bv) = \varphi^{1}_{ln}(\bv-\overline{\bu}) Y_l^m \left( \frac{\bv-\overline{\bu}}{|\bv-\overline{\bu}|} \right), \end{equation} where \begin{equation} \label{eq:split_bas_psh} \varphi^{1}_{ln}(\bv) = \sqrt{\frac{2^{1-l}\pi^{3/2}n!}{\Gamma(n+l+3/2)}} L^{(l+1/2)}_n \left( \frac{|\bv|^2}{2\overline{\theta}} \right) \left( \frac{|\bv|}{\sqrt{\overline{\theta}}}\right)^l\cdot \frac{1}{(2\pi \overline{\theta})^{3/2}} \exp \left(-\frac{|\bv|^2}{2\overline{\theta}} \right) \end{equation} represents the radial part of the basis function. Without loss of generality, we set $\bar{\bu} = 0$ and $\bar{\theta} = 1$ in the analysis below. Since $\varphi_{ln}^1(\bv)$ depends only on $|\bv|$, here we approximate its absolute value by a linear combination of $\varphi_{00n}$: \begin{equation} \label{eq:appro_phi1} |\varphi^{1}_{ln}(\bv)| \approx \sum_{n' = 0}^{N_0 } s_{ln}^{n'} \varphi_{00n'}(\bv), \end{equation} and we choose to find the approximation by orthogonal projection: \begin{equation} \label{eq:sn} s_{ln}^{n'} = \int_{\mathbb{R}^3}|\varphi^1_{ln}(\bv)| \varphi_{00n'}(\bv) \omega(\bv) \,\mathrm{d}\bv. \end{equation} Since $\varphi_{00n}$ contains a polynomial with even order $2n$, by choosing $N_0 = \lceil{\frac{M}{2}}\rceil$, we can guarantee that the degree of the polynomial in the right-hand side of \eqref{eq:appro_phi1} is no less than that in the radial function $\varphi^1_{ln}$. Thus, it holds for any distribution function $g$ that \begin{equation} \label{eq:bound_f} \begin{aligned} |g(\bv)| & = \left| \sum_{l=0}^M \sum_{n=0}^{\lfloor (M-l)/2 \rfloor} \sum_{m=-l}^l g_{lmn} Y_l^m\left(\frac{\bv}{|\bv|}\right) \varphi^1_{ln}(\bv)\right|\leqslant \sum_{l=0}^M \sum_{n=0}^{\lfloor (M-l)/2 \rfloor} \left|\sum_{m=-l}^l g_{lmn}Y_{l}^m\left(\frac{\bv}{|\bv|}\right)\right| |\varphi^1_{ln}(\bv)| \\ & \leqslant \sum_{l=0}^M \sum_{n=0}^{\lfloor (M-l)/2 \rfloor} g_{ln} |\varphi^1_{ln}(\bv)| \approx \sum_{l=0}^M \sum_{n=0}^{\lfloor (M-l)/2 \rfloor} g_{ln} \sum_{n' = 0}^{N_0} s_{ln}^{n'}\varphi_{00n'}(\bv), \end{aligned} \end{equation} where \begin{equation} \label{eq:coeG} g_{ln} = \max_{|\bn| = 1}\left| \sum_{m=-l}^l g_{lmn}Y^m_{l}(\bn)\right|. \end{equation} Equation \eqref{eq:bound_f} shows that we can choose \begin{equation} \label{eq:h} h_{n'} = \sum_{l=0}^M \sum_{n=0}^{\lfloor (M-l)/2 \rfloor} g_{ln} s_{ln}^{n'}, \qquad n' = 0,1,\cdots,N_0 \end{equation} such that $h(\bv)$ is an approximate upper bound of $g(\bv)$. In the calculation of $h_{n'}$, the coefficients $s_{ln}^{n'}$ can be precomputed by numerical integration before the simulation. Thus once $g_{ln}$ are obtained, the computational cost is $O(M^3)$. As for $g_{ln}$, we again choose to approximate them instead of computing them exactly. We pick a finite set of points $\Omega \in \mathbb{S}^2$ and approximate $g_{ln}$ by \begin{equation} \label{eq:coeG1} g_{ln} \approx \max_{\bn \in \Omega}\left| \sum_{m=-l}^l g_{lmn}Y^m_{l}(\bn)\right|. \end{equation} In our implementation, the fifty-point Lebedev-Gauss integral points \cite{Lebedev1975} are chosen to form the set $\Omega$. Thus the computational cost to find all $g_{ln}$ is also $O(M^3)$. By such means, we can find $h(\bv)$ with the form \eqref{eq:hv} such that $|f^{(2)}(\bv) - \mathcal{M}^{(2)}(\bv)| \lessapprox h(\bv)$, meaning that $h(\bv)$ is an approximate bound of $f^{(2)} - \mathcal{M}^{(2)}$. Thus $\delta Q_1$ defined in \eqref{eq:sim_DQ} can be bounded by \begin{equation} \label{eq:est_Q1} \begin{aligned} |\delta Q_1| &\leqslant Q^{\rm abs}[f_M, |f^{(2)} - \mathcal{M}^{(2)}|] \lessapprox Q^{\mathrm{abs}}[f_M, h], \end{aligned} \end{equation} which can be computed via \eqref{eq:Qabs_coef} and \eqref{eq:a_lnn1} with computational cost $O(M^4)$. To bound $\delta Q_2$, we adopt the similar approach: by constructing $h^{(1)}(\bv)$ and $h^{(2)}(\bv)$ such that $|f^{(1)} - \mathcal{M}^{(1)}| \lessapprox h^{(1)}(\bv)$, $|\mathcal{M}^{(2)}| \lessapprox h^{(2)}(\bv)$ and \begin{equation} h^{(1)}(\bv) = \sum_{n' = 0}^{N_0} h^{(1)}_{n'} \varphi_{00n'}(\bv), \qquad h^{(2)}(\bv) = \sum_{n' = 0}^{N_0} h^{(2)}_{n'} \varphi_{00n'}(\bv), \end{equation} we have \begin{equation} \label{eq:eta_Q2} \begin{aligned} |\delta Q_2| &\leqslant Q^{\mathrm{abs}}[|f^{(1)} - \mathcal{M}^{(1)}|, |\mathcal{M}^{(2)}|] \lessapprox Q^{\mathrm{abs}}[h^{(1)}, h^{(2)}] \\ & = \sum_{n' = 0}^{N_0} \sum_{n=0}^{N_0} h^{(1)}_{n} h^{(2)}_{n'} \mathcal{L}_{\varphi_{00n'}} [\varphi_{00n}] = \sum_{n' = 0}^{N_0} \sum_{n=0}^{N_0} h_n^{(1)}h^{(2)}_{n'} \sum_{n_1 = 0}^{N_0} a_{0n n_1}^{n'}\varphi_{00n_1} \\ & = \sum_{n_1 = 0}^{N_0} \left( \sum_{n'=0}^{N_0} \sum_{n=0}^{N_0} h_n^{(1)} h_{n'}^{(2)} a_{0nn_1}^{n'} \right) \varphi_{00n_1}, \end{aligned} \end{equation} where the coefficients \begin{equation} \label{eq:tQ} \widetilde{Q}^{\mathrm{abs}}_{n_1} = \sum_{n'=0}^{N_0} \sum_{n=0}^{N_0} h_n^{(1)} h_{n'}^{(2)} a_{0nn_1}^{n'}, \qquad n = 0,1,\cdots,N_0 \end{equation} can be computed with time complexity $O(M^3)$. Finally, we choose our error indicator to be the sum of the bounds of both $\delta Q_1$ and $\delta Q_2$: \begin{equation} \label{eq:indicator} \mathrm{Indicator} = \sqrt{\sum_{l=0}^M \sum_{m=-l}^l \sum_{n_1=0}^{N_0} \left|Q^{\mathrm{abs}}_{lmn_1}\right|^2} +\sqrt{ \sum_{n_1=0}^{N_0} \left|\widetilde{Q}^{\mathrm{abs}}_{n_1}\right|^2}. \end{equation} Here we have used the weighted $L^2$-norm with weight function $\omega(\bv)$ so that the norm is simply the sum of squares of the coefficients. This error indicator can be considered as an \textit{a posteriori} estimation of the truncation error, since it depends on the numerical solution but only estimates the error of the collision term instead of the solution itself. In the indicator above, we did not consider the third line of \eqref{eq:Delta_Q} since the contribution of this term is similar to $h$ times a constant (since $h(\bv)$ is the approximate bound of $|f^{(2)}(\bv) - \mathcal{M}^{(2)}(\bv)|$). Such contribution has been covered by the term $Q^{\mathrm{abs}}[f_M,h]$ and it is less meaningful to duplicate it in the error indicator. \subsubsection{Computation of the coefficients $a_{lnn_1}^{n'}$} \label{sec:a_lnn1} By the orthogonality of the basis functions \eqref{eq:orth}, we have \begin{equation} \label{eq:a_lnn1^n'} a_{lnn_1}^{n'} = \int_{\mathbb{R}^3} p_{lmn}^{\dagger}(\bv) Q^{\mathrm{abs}}[\varphi_{lmn_1},\varphi_{00n'}](\bv) \,\mathrm{d}\bv \end{equation} for any $m = -l,\cdots,l$. For simplicity, here we have used \begin{displaymath} p_{lmn}(\bv) = \varphi_{lmn}(\bv) \omega(\bv), \end{displaymath} and $p_{lmn}$ is a polynomial of degree $l+2n$. Below we will also use $p_{lmn}^0$ to denote the polynomial $p_{lmn}$ with $\overline{\bu}$ set to be zero. In our calculation, we choose $m = 0$ so that all the functions are real and we can remove ``$\dagger$'' in \eqref{eq:a_lnn1^n'}. A well-known property of the collision integral is \begin{equation} \label{eq:pq_int} \begin{split} & \int_{\mathbb{R}^3} p_{l0n}(\bv) Q^{\mathrm{abs}}[\varphi_{l0n_1},\varphi_{00n'}](\bv) \,\mathrm{d}\bv \\ ={} & \frac{1}{2} \int_{\mathbb{R}^3} \int_{\mathbb{R}^3} \int_{\bn \perp \bg} \int_0^{\pi} [p_{l0n}(\bv') + p_{l0n}(\bv_*') + p_{l0n}(\bv) + p_{l0n}(\bv_*)] B(|\bg|, \chi) \varphi_{l0n_1} (\bv) \varphi_{00n'}(\bv_*) \,\mathrm{d}\chi \,\mathrm{d}\bn \,\mathrm{d}\bv_* \,\mathrm{d}\bv. \end{split} \end{equation} A classical approach \cite{Grad1949, kumar1966} to computing this integral is to define \begin{displaymath} \bg' = \bv' - \bv_*', \qquad \bh = \frac{\bv + \bv_*}{2}, \end{displaymath} which yields \begin{displaymath} |\bg| = |\bg'|, \quad \bv = \bh + \frac{1}{2} \bg, \quad \bv_* = \bh - \frac{1}{2} \bg, \quad \bv' = \bh + \frac{1}{2} \bg', \quad \bv'_* = \bh - \frac{1}{2} \bg', \quad \mathrm{d}\bv \,\mathrm{d}\bv_* = \mathrm{d}\bg \,\mathrm{d}\bh. \end{displaymath} The purpose of these changes of variables is to convert the integral with respect to $\bv_*$ and $\bv$ to the integral with respect to $\bg$ and $\bh$. This requires us to express the polynomials in \eqref{eq:pq_int} by linear combinations of the basis polynomials of $\bg$ and $\bh$. This requires the following result: \begin{theorem} \label{thm:pp} For any non-negative integers $l$, $n$ and $n'$, it holds that \begin{equation} \label{eq:vv_to_gh} \begin{split} & p_{l0n}\left( \bh + \frac{1}{2} \bg \right) p_{00n'} \left(\bh - \frac{1}{2} \bg\right) \\ ={} & \sum_{\substack{l_1, l_2, n_1, n_2 \geqslant 0\\ l_1 + l_2 + 2(n_1 + n_2) = l + 2(n+n')}} \sum_{\substack{m_1 = -l_1, \cdots, l_1 \\ m_2 = -l_2, \cdots, l_2 \\ m_1 + m_2 = 0}} A_{lnn'}^{l_1 l_2 m_2 n_2} p_{l_1 m_1 n_1}(\sqrt{2}\bh) p_{l_2 m_2 n_2}^0\left( \frac{\bg}{\sqrt{2}} \right). \end{split} \end{equation} The coefficients $A_{lnn'}^{l_1 l_2 m_2 n_2}$ are constants satisfying the recurrence relation: \begin{equation} \label{eq:A_recur} \begin{split} & A_{ln,n'+1}^{l_1 l_2 m_2 n_2} = \frac{1}{\sqrt{(n'+1)(n'+3/2)}} \Bigg[ \sum_{k=1}^2 \frac{\sqrt{n_k(n_k+l_k+1/2)}}{2} A_{lnn'}^{l_1l_2m_2,n_2-\delta_{2k}} \\ & \qquad +\sum_{\mu = -1}^1 (-1)^{\mu} \bigg( \sqrt{(l_1 + n_1 + 1/2)(l_2 + n_2 + 1/2)} \gamma_{l_1,m_2+\mu}^{-\mu} \gamma_{l_2,m_2+\mu}^{-\mu} A_{lnn'}^{l_1-1,l_2-1,m_2+\mu,n_2} \\ & \hspace{90pt} -(-1)^{\mu} \sqrt{n_1(l_2 + n_2 + 1/2)} \gamma_{-l_1-1,m_2+\mu}^{-\mu} \gamma_{l_2,m_2+\mu}^{-\mu} A_{lnn'}^{l_1+1,l_2-1,m_2+\mu,n_2} \\ & \hspace{90pt} -(-1)^{\mu} \sqrt{n_2(l_1 + n_1 + 1/2)} \gamma_{l_1,m_2+\mu}^{-\mu} \gamma_{-l_2-1,m_2+\mu}^{-\mu} A_{lnn'}^{l_1-1,l_2+1,m_2+\mu,n_2-1} \\ & \hspace{90pt} +\sqrt{n_1 n_2} \gamma_{-l_1-1,m_2+\mu}^{-\mu} \gamma_{-l_2-1,m_2+\mu}^{-\mu} A_{lnn'}^{l_1+1,l_2+1,m_2+\mu,n_2-1} \bigg) \Bigg], \end{split} \end{equation} where $n_1 = (l - l_1 - l_2) / 2 + (n + n' - n_2)$, and $\gamma_{lm}^{\mu}$ is defined by \begin{equation} \label{eq:gamma_lm} \gamma_{lm}^{\mu} = \sqrt{\frac{[l + (2\delta_{1,\mu} - 1) m + \delta_{1,\mu}] [l - (2\delta_{-1,\mu} - 1) m + \delta_{-1,\mu}]} {2^{|\mu|} (2l-1)(2l+1)}}, \end{equation} and $A_{lnn'}^{l_1 m_1 n_1, l_2 m_2 n_2}$ is regarded as zero if any of the following conditions are violated: \begin{displaymath} \text{(1) } l_1, l_2, n_2 \text{ are positive integers;} \qquad \text{(2) } l - l_1 - l_2 + 2(n + n' - n_2) \geqslant 0; \qquad \text{(3) } |m_2| \leqslant \min(l_1, l_2). \end{displaymath} \end{theorem} The proof of this theorem is similar to the proof of \cite[Proposition 3]{Cai2015}, and the details can be found in Appendix \ref{sec:proof}. The recurrence relation \eqref{eq:A_recur} helps compute the coefficients in the expansion \eqref{eq:vv_to_gh}. The initial condition corresponds to the case $n' = 0$, for which $p_{00n'}(\cdot) \equiv 1$ and the corresponding coefficients $A_{lnn'}^{l_1 l_2 m_2 n_2}$ have been derived in \cite[Proposition 3]{Cai2015}. By \eqref{eq:vv_to_gh}, we have \begin{displaymath} \begin{split} & p_{l0n}(\bv') + p_{l0n}(\bv_*') + p_{l0n}(\bv) + p_{l0n}(\bv_*) \\ ={} & \sum_{\substack{l_1, l_2, n_1, n_2 \geqslant 0\\ l_1 + l_2 + 2(n_1 + n_2) = l + 2n}} \sum_{\substack{m_1 = -l_1, \cdots, l_1 \\ m_2 = -l_2, \cdots, l_2 \\ m_1 + m_2 = 0}} A_{ln0}^{l_1 l_2 m_2 n_2} p_{l_1 m_1 n_1}(\sqrt{2}\bh) \times {} \\ & \hspace{120pt} \left[ p_{l_2 m_2 n_2}^0\left( \frac{\bg'}{\sqrt{2}} \right) + p_{l_2 m_2 n_2}^0\left( -\frac{\bg'}{\sqrt{2}} \right) + p_{l_2 m_2 n_2}^0\left( \frac{\bg}{\sqrt{2}} \right) + p_{l_2 m_2 n_2}^0\left( -\frac{\bg}{\sqrt{2}} \right)\right] \\ ={} & \sum_{\substack{l_1, l_2, n_1, n_2 \geqslant 0\\ l_1 + l_2 + 2(n_1 + n_2) = l + 2n}} \sum_{\substack{m_1 = -l_1, \cdots, l_1 \\ m_2 = -l_2, \cdots, l_2 \\ m_1 + m_2 = 0}} [1 + (-1)^{l_2}] A_{ln0}^{l_1 l_2 m_2 n_2} p_{l_1 m_1 n_1}(\sqrt{2}\bh) \left[ p_{l_2 m_2 n_2}^0 \left( \frac{\bg'}{\sqrt{2}} \right) + p_{l_2 m_2 n_2}^0\left( \frac{\bg}{\sqrt{2}} \right)\right], \end{split} \end{displaymath} where we have used the property that $p_{lmn}^0$ is odd/even if $l$ is odd/even. By the equality \cite[Eq. (7.1)]{Ikenberry1956} \begin{displaymath} \int_{\bn \perp \bg} p_{lmn}^0\left( \frac{\bg'}{\sqrt{2}} \right) \,\mathrm{d}\bn = 2\pi p_{lmn}^0\left(\frac{\bg}{\sqrt{2}} \right) P_l(\cos \chi), \end{displaymath} we conclude that \begin{equation} \label{eq:n_int} \begin{split} & \int_{\bn \perp \bg} [p_{l0n}(\bv') + p_{l0n}(\bv_*') + p_{l0n}(\bv) + p_{l0n}(\bv_*)] \,\mathrm{d}\bn \\ ={} & \sum_{\substack{l_1, l_2, n_1, n_2 \geqslant 0\\ l_1 + l_2 + 2(n_1 + n_2) = l + 2n}} \sum_{\substack{m_1 = -l_1, \cdots, l_1 \\ m_2 = -l_2, \cdots, l_2 \\ m_1 + m_2 = 0}} 2\pi [1 + (-1)^{l_2}][P_{l_2}(\cos \chi) + 1] A_{ln0}^{l_1 l_2 m_2 n_2} p_{l_1 m_1 n_1}(\sqrt{2}\bh) p_{l_2 m_2 n_2}^0\left( \frac{\bg}{\sqrt{2}} \right). \end{split} \end{equation} Next, we perform the following operations: \begin{enumerate} \item Insert \eqref{eq:n_int} into \eqref{eq:pq_int}; \item Use \eqref{eq:vv_to_gh} to expand $\varphi_{l0n_1}(\bv) \varphi_{00n'}(\bv_*)$ in \eqref{eq:pq_int}; \item Use the orthogonality \eqref{eq:orth} to integrate with respect to $\bh$. \item Represent $\bg$ using spherical coordinates as $g \boldsymbol{\omega}$ and use the orthogonality of spherical harmonics to integrate with respect to $\boldsymbol{\omega}$. \end{enumerate} We omit the details of these steps since they are standard procedures to compute the moments of the collision operators. Afterward, we obtain \begin{equation} \label{eq:a} \begin{split} a_{lnn_1}^{n'} = & \hspace{-8pt} \sum_{\substack{l_1, l_2 \geqslant 0 \\ l - (l_1 + l_2) \text{ is even} \\ l_1 + l_2 \leqslant l + 2 \min(n,n_1 + n')}} \sum_{m_2 = -\min(l_1,l_2)}^{\min(l_1,l_2)}\sum_{\substack{n_2, n_2' \geqslant 0 \\ n - n_2 = n_1 + n' - n_2'\\n_2 \leqslant (l-l_1-l_2)/2+n}} \sqrt{\frac{n_2! n_2'!}{\Gamma(l_2 + n_2 + 3/2) \Gamma(l_2 + n_2' + 3/2)}} A_{ln0}^{l_1 l_2 m_2 n_2} A_{ln_1 n'}^{l_1 l_2 m_2 n_2'} \\ & \times \pi [1 + (-1)^{l_2}] \underline{\int_0^{+\infty} \int_0^{\pi} B(\sqrt{4\bar{\theta} r},\chi) [P_{l_2}(\cos\chi) + 1] L_{n_2}^{(l_2 + 1/2)}(r) L_{n_2'}^{(l_2 + 1/2)}(r) r^{l_2 + 1/2} \exp(-r) \,\mathrm{d}\chi \,\mathrm{d}r}, \end{split} \end{equation} where $r$ comes from the change of variables $r = g^2/(4\bar{\theta})$. The integrals with respect to $\chi$ and $r$ depend on the collision kernel. For the variable-hard-sphere (VHS) model, the collision kernel is \begin{equation}\label{eq:vhs} B(g,\chi) = g^{\nu} \sin \chi \quad \text{for } \nu \in [0,1]. \end{equation} In this case, the underlined integral in the equation above can be computed explicitly as \begin{equation} \label{eq:underlined} \begin{split} & 2^{\nu+1} (\delta_{0,l_2} + 1) \bar{\theta}^{\nu/2} \int_0^{+\infty} L_{n_2}^{(l_2 + 1/2)}(r) L_{n_2'}^{(l_2 + 1/2)}(r) r^{l_2 + (\nu+1)/2} \exp(-r) \,\mathrm{d}r \\ ={} & (-1)^{n_2 + n_2'} 2^{\nu+1} (\delta_{0l_2} + 1) \bar{\theta}^{\nu/2} \Gamma\left(l_2 + 1 + \frac{\nu+1}{2} \right) \sum_{k=0}^{\min(n_2,n_2')} \begin{pmatrix} \nu/2 \\ n_2 - k \end{pmatrix} \begin{pmatrix} \nu/2 \\ n_2' - k \end{pmatrix} \begin{pmatrix} k + l_2 + (\nu+1)/2 \\ k \end{pmatrix}. \end{split} \end{equation} Note that the coefficients $a_{lnn_1}^{n'}$ can all be precomputed before the simulation. In our implementation, we ignore the coefficient $\bar{\theta}^{\nu/2}$ since it only introduces a universal constant to the indicator. \subsection{Adaptive strategy} \label{sec:adaptive} With the error indicator defined by \eqref{eq:indicator}, we compute this quantity for the distribution function on each spatial grid cell after every time step. For distribution functions with a large indicator, we increase the value of $M_0$ at the next time step, and vice versa. In our implementation, in order that the numerical solution does not oscillate due to the self-adaptation, we would like to maintain the stability of the collision model by avoiding the drastic change of the value of $M_0$. To this end, we adopt the following two strategies: \begin{itemize} \item Instead of a single threshold for the indicator like in most adaptive methods, we introduce two thresholds $\epsilon_1$ and $\epsilon_2$. If the error indicator of a certain distribution function lies between $(\epsilon_1, \epsilon_2)$, we keep the value of $M_0$ unchanged. \item The value of $M_0$ changes only by $1$ at each time step. More precisely, if the error indicator exceeds $\epsilon_2$, we increase $M_0$ by $1$; if the error indicator falls below $\epsilon_1$, we reduce $M_0$ by $1$. \end{itemize} In general, if the range of the interval $(\epsilon_1, \epsilon_2)$ is wider, $M_0$ is more stable and the algorithm is less adaptive. A larger lower bound $\epsilon_1$ makes it easier for $M_0$ to drop; a larger upper bound $\epsilon_2$ makes it harder for $M_0$ to increase. In many applications, the bounds do not need to be too tight since the first few moments (e.g., density, velocity, and temperature) are usually not very sensitive about small changes of the collision models. This is why some simpler collision models such as the ES-BGK and the Shakhov models can still provide decent numerical results for these macroscopic variables. To select the proper values of $\epsilon_1$ and $\epsilon_2$, we adopt the following strategy: \begin{enumerate} \item Do a test run with a small $M_0$ (e.g. $M_0 = 3$) being fixed without self-adaptation. Calculate the indicators for all time steps on all grid cells, and find its maximum value $\epsilon_{\max}$. \item Use $\epsilon_{\max}$ as a reference value and choose the initial guesses of $\epsilon_1$ and $\epsilon_2$. They should be less than but not too far away from $\epsilon_{\max}$, e.g. $\epsilon_1 = \epsilon_{\max}/4$ and $\epsilon_2 = \epsilon_{\max}/2$. \item Do a test run for the self-adaptive algorithm with the chosen $\epsilon_1$ and $\epsilon_2$, and then reduce $\epsilon_1$ (e.g. set $\epsilon_1$ to be $\epsilon_1 / 2$). \item Do another test run for the current $\epsilon_1$ and $\epsilon_2$. \item Compare the results of the two most recent runs. Go to the next step if the two results are sufficiently close to each other; otherwise, reduce $\epsilon_1$ again and return to the previous step. \item Keep $\epsilon_1$ fixed and reduce the value of $\epsilon_2$ (e.g. set $\epsilon_2$ to be $\epsilon_2 / 2$). \item Compare the results of the two most recent runs. Stop if the two results are sufficiently close to each other; otherwise, reduce the value of $\epsilon_2$ and check if $\epsilon_1 < \epsilon_2$. If so, return to Step 6; otherwise, reduce $\epsilon_1$ and return to Step 3. \end{enumerate} Here, the purpose of the first step is to provide a general range of the acceptable error indicator. Then, based on the initial guess of $\epsilon_1$ and $\epsilon_2$ in the second step, we first determine the lower bound by reducing $\epsilon_1$ until the solution looks stable, and then apply the same approach to $\epsilon_2$ to find a suitable upper bound. All test runs can be carried out on a coarse grid to save computational time. An example will be given in Section \ref{sec:colliding_flow}. \subsection{Outline of the algorithm} As a summary, below we list out the general steps of our algorithm: \begin{enumerate} \item Precompute the coefficients $s_{ln}^{n'}$ according to \eqref{eq:sn}. \item Precompute the coefficients $A_{lnn'}^{l_1 l_2 m_2 n_2}$ according to \eqref{eq:A_recur}. \item Precompute the coefficients $a_{lnn_1}^{n'}$ according to \eqref{eq:a} with the underlined term replaced by \eqref{eq:underlined}. \item \label{itm:solve} Solve the Boltzmann equation by one time step. Terminate if the final time is reached. \item \label{itm:bounds} For each distribution function, use \eqref{eq:h} and \eqref{eq:coeG1} to find the bounding functions $h$, $h^{(1)}$ and $h^{(2)}$, which bound $f^{(2)} - \mathcal{M}^{(2)}$, $f^{(1)} - \mathcal{M}^{(1)}$ and $\mathcal{M}^{(2)}$, respectively. \item \label{itm:indicator} Use \eqref{eq:Qabs_coef}\eqref{eq:a_lnn1}\eqref{eq:tQ}\eqref{eq:indicator} to compute the error indicator for each collision term. \item Perform self-adaptation on each grid cell: if the error indicator is greater than the threshold $\epsilon_1$, we increase $M_0$ by $1$; if the error indicator is less than the threshold $\epsilon_2$, we decrease $M_0$ by $1$ if $M_0 > 3$. \item Return to Step \ref{itm:solve}. \end{enumerate} In the algorithm, we have required that $M_0$ is no less than $3$, which is the smallest $M_0$ that includes the heat flux in the quadratic part of the collision operator. This ensures that the Navier-Stokes limit can always be correctly captured. The computation of the indicator lies in Steps \ref{itm:bounds} and \ref{itm:indicator}. In these two steps, the computation of \eqref{eq:Qabs_coef} and \eqref{eq:a_lnn1} has complexity $O(M^4)$, and the computation \eqref{eq:coeG1} requires $O(|\Omega|M^3)$ operations, where $|\Omega|$ denotes the number of quadrature points on the sphere. These parts take up most of the computational time in Steps \ref{itm:bounds} and \ref{itm:indicator}. Note that the computational cost of the indicator depends on $M$ instead of $M_0$, since the computation of $Q^{\mathrm{abs}}(\cdot, \cdot)$ involves the complete distribution function instead of only the low-frequency part, so that the error due to the inaccuracy of the high-frequency part can be captured. Nevertheless, as we will see in the next section, such a cost is quite small compared to the evaluation of the collision operator for a large $M_0$. \section{Introduction} \label{sec:intro} Due to the extensive applications of rarefied gas dynamics in a number of engineering fields, including the manufacturing of spacecrafts and micro-electro-mechanical systems, the numerical simulation of gas kinetic theory is under active research in recent years. In the kinetic theory, the fluid state is described using the distribution function $f(\bx,\bv,t)$, where $t$ is the time, and $\bx$ and $\bv$ represent the spatial coordinates and the velocity of gas molecules, respectively. The distribution function represents the number density of gas molecules in the joint position-velocity space. In this paper, we consider the Boltzmann equation: \begin{displaymath} \frac{\partial f}{\partial t} + \bv \cdot \nabla_{\bx} f = Q[f,f], \end{displaymath} where $Q[f,f]$ is the binary collision term defined by: \begin{displaymath} Q[f,g](\bv) = \frac{1}{2} \int_{\mathbb{R}^3} \int_{\bn \perp \bg} \int_0^{\pi} B(|\bg|, \chi) [f(\bv') g(\bv_*') + f(\bv_*') g(\bv') - f(\bv) g(\bv_*) - f(\bv_*) g(\bv)] \,\mathrm{d}\chi \,\mathrm{d}\bn \,\mathrm{d}\bv_*. \end{displaymath} In the equation above, the relative velocity $\bg$ is defined by $\bg = \bv - \bv_*$, and the post-collisional velocities $\bv'$ and $\bv_*'$ are given by \begin{align*} \bv' &= \cos^2(\chi/2) \bv + \sin^2(\chi/2) \bv_* - |\bg| \sin(\chi/2) \cos(\chi/2) \bn, \\ \bv_*' &= \cos^2(\chi/2) \bv_* + \sin^2(\chi/2) \bv + |\bg| \sin(\chi/2) \cos(\chi/2) \bn. \end{align*} Note that here $\bn$ is a unit vector in $\mathbb{S}^2$, which implies that the integral with respect to $\bn$ is a one-dimensional integral over a circle perpendicular to $\bg$. The non-negative function $B(\cdot,\cdot)$ is the collision kernel determined by the mutual force between gas molecules. One of the numerical difficulties in the discretization of the Boltzmann equation lies in the high-dimensional integral form of $Q[f,f]$. To compute the collision term efficiently, the velocity variable in the distribution function is usually discretized by high-order schemes such as the spectral methods \cite{Pareschi1996,Bobylev1997} and discontinuous Galerkin methods \cite{Alekseenko2014}, so that the number of degrees of freedom can be reduced. In the literature, the spectral methods mainly include the Fourier spectral method \cite{Bobylev1997,Filbet2006,Gamba2017} based on the periodization of the velocity variable and the Hermite/Burnett spectral method based on the unbounded velocity domain \cite{Gamba2018, Kitzler2019}. The Fourier spectral method provides a significant improvement in computational efficiency \cite{Dimarco2018,Jaiswal2019}, and the recent development of the Hermite/Burnett spectral method shows its advantage due to its connection with modelling in the gas kinetic theory. Specifically, the Hermite/Burnett spectral method can be linked to the moment method since the coefficients in the spectral expansion are actually the moments of the distribution functions. Such a property has been applied to derive the regularized 13-moment equations in \cite{Cai2020r}, and inversely, some modelling techniques can therefore also be applied to the spectral methods. In \cite{Cai2015}, by taking the idea of the Shakhov operator \cite{Shakhov1968}, the authors divided all moments of the distribution function into two sets, with one set including low-order moments describing the sketch of the distribution function, and the other including high-order moments providing the details. For the set with low-order moments, the linearized collision operator is applied, while for the set with high-order moments, a simple decay towards the equilibrium is used as an approximation. This hybrid approach is later extended to quadratic collision operators in \cite{Wang2019, Cai2020}. One parameter in this hybrid approach is the critical order $M_0$ that defines the ``low-order'' and ``high-order'' moments. In this paper, we will focus on the selection of this parameter in the spatially inhomogeneous Boltzmann equation. Since the parameter $M_0$ defines the modeling accuracy, it is expected that the choice of $M_0$ should depend on the ``modeling error'' given by some differences between the current collision model and the exact binary collision model when applied to the current distribution function. Once such an error indicator is obtained, we can change the value of $M_0$ dynamically during our simulation. However, the construction of such an error indicator is far from trivial due to the following reasons: \begin{enumerate} \item Unlike the {\it a posteriori} error estimation in the finite element methods, we do not have an equation to define the ``residual'' as an error indicator. \item The collision operator is generally unbounded, so that even an {\it a priori} error estimation is non-trivial. \item Another common technique by comparing the current model and a more accurate model with larger $M_0$ is not applicable here due to the rapid growth of the computational cost with respect to $M_0$ (usually $M_0^8$). \end{enumerate} Because of these difficulties, we have to look for non-standard techniques to quantify the error. Since a rigorous and numerically affordable error bound is difficult to find, as an initial study, the goal of this paper is to establish an error indicator with low computational cost compared to the collision term. With this error indicator, we are able to choose this modeling parameter $M_0$ adaptively on each spatial grid cell at each time step with the purpose to reduce the computational time on the collision terms. Due to the high computational complexity with respect to $M_0$, reducing $M_0$ can effectively save the computational cost. This work contributes to the adaptive methods for the Boltzmann equation. In the literature, the self-adaptive methods have been applied to both spatial discretization and velocity discretization \cite{Kolobov2007,Chen2012,Baranger2014,Abdelmalik2017}, which can effectively reduce the degrees of freedom in the simulation. There have been also many works coupling the kinetic equations and fluid equations, so that the cheaper Navier-Stokes equations or Euler equations can be solved where the fluid is close to its local equilibrium \cite{Degond2005, Degond2012, Rey2015}, and many criteria have been proposed to predict the breakdown of fluid equations \cite{Levermore1998,Wang2003,Filbet2018}. While the method in this work does not change the number of variables, we consider the modeling adaptivity, which changes the complexity of the collision model. We hope that this work can provide a new perspective for the simulation of Boltzmann equations, which might also be applicable in other related areas. In the rest of this paper, we will first review the Burnett spectral method introduced in \cite{Hu2020b} (Section \ref{sec:Burnett}), and then in Section \ref{sec:indicator}, we will detail the derivation of the error indicator, and the general structure of our numerical algorithm will also be presented. One- and two-dimensional numerical experiments showing the efficiency of the self-adaptive method will be given in Section \ref{sec:num}, and the paper is concluded by a brief summary in Section \ref{sec:conclusion}. \section{Burnett spectral method for the Boltzmann equation} \label{sec:Burnett} The Burnett spectral method is based on the following expansion of the distribution function: \begin{equation} \label{eq:inf_series} f(\bx,\bv,t) = \sum_{l=0}^{+\infty} \sum_{m=-l}^l \sum_{n=0}^{+\infty} f_{lmn}(\bx,t) \varphi_{lmn}(\bv), \end{equation} where $\varphi_{lmn}(\bv) = \varphi_{lmn}^0(\bv - \overline{\bu})$, and \begin{multline*} \varphi_{lmn}^0(\bv) = \sqrt{\frac{2^{1-l}\pi^{3/2}n!}{\Gamma(n+l+3/2)}} L^{(l+1/2)}_n \left( \frac{|\bv|^2}{2\bar{\theta}} \right) \left( \frac{|\bv|}{\sqrt{\bar{\theta}}} \right)^l Y_l^m \left( \frac{\bv}{|\bv|} \right) \cdot \frac{1}{(2\pi \overline{\theta})^{3/2}} \exp \left(-\frac{|\bv|^2}{2\overline{\theta}} \right), \\ l,n = 0,1,\cdots, \qquad m = -l,\cdots,l, \end{multline*} with $L_n^{(\alpha)}(\cdot)$ being the Laguerre polynomials and $Y_l^m(\cdot)$ being the spherical harmonics. The parameters $\overline{\bu}$ and $\overline{\theta}$ are chosen to specify the center and the scaling of the basis functions. Note that $\varphi_{lmn}$ is the product of a Gaussian and a polynomial of degree $l+2n$. When we truncate the series \eqref{eq:inf_series} in our numerical method, we select a positive integer $M$ as the upper bound of the polynomial, and preserve only the terms with $l+2n \leqslant M$. Thus, the truncated series reads \begin{equation} \label{eq:truncated_series} f_M(\bx,\bv,t) = \sum_{l=0}^M \sum_{m=-l}^l \sum_{n=0}^{\lfloor (M-l)/2 \rfloor} f_{lmn}(\bx,t) \varphi_{lmn}(\bv). \end{equation} In this expansion, the basis functions $\varphi_{lmn}$ satisfy the orthogonality \begin{equation} \label{eq:orth} \langle \varphi_{lmn}(\bv), \varphi_{l'm'n'}(\bv) \rangle_{\omega} := \int_{\mathbb{R}^3} \varphi_{lmn}^{\dagger}(\bv) \varphi_{l'm'n'}(\bv) \omega(\bv) \,\mathrm{d}\bv = \delta_{ll'} \delta_{mm'} \delta_{nn'}, \end{equation} where $\dagger$ refers to the complex conjugate, and the weight function is \begin{displaymath} \omega(\bv) = \left[ \frac{1}{(2\pi \overline{\theta})^{3/2}} \exp \left(-\frac{|\bv - \overline{\bu}|^2}{2\overline{\theta}} \right) \right]^{-1}. \end{displaymath} Note that here $\omega(\bv)$ is the reciprocal of a global Maxwellian, while in what follows, we use the term ``local Maxwellian'' to refer to the Maxwellian $\mathcal{M}(\bv) = \exp(\alpha + \boldsymbol{\beta} \cdot \bv + \gamma |\bv|^2)$ associated with a distribution function $f(\bv)$ by \begin{equation} \label{eq:local_Maxwellian} \int_{\mathbb{R}^3} \begin{pmatrix} 1 \\ \bv \\ |\bv|^2 \end{pmatrix} \mathcal{M}(\bv) \,\mathrm{d}\bv = \int_{\mathbb{R}^3} \begin{pmatrix} 1 \\ \bv \\ |\bv|^2 \end{pmatrix} f(\bv) \,\mathrm{d}\bv. \end{equation} Let $\mathbf{f}(\bx,t)$ be the vector including all the coefficients $f_{lmn}(\bx,t)$ with $l + 2n \leqslant M$, and define $\bvphi$ as the vector including all the basis function $\varphi_{lmn}(\bv)$ also with $l + 2n \leqslant M$ arranged in the same order as $\mathbf{f}$. Then \begin{displaymath} f_M(\bx,\bv,t) = [\mathbf{f}(\bx,t)]^T \bvphi(\bv). \end{displaymath} With the Petrov-Galerkin method \cite{Gamba2018, Hu2020b} based on the orthogonality \eqref{eq:orth}, the semi-discrete Boltzmann equation has the form \begin{equation} \label{eq:PG} \frac{\partial \mathbf{f}}{\partial t} + \sum_{k=1}^3 \mathbf{A}_k \frac{\partial \mathbf{f}}{\partial x_k} = \mathbf{Q} : (\mathbf{f} \otimes \mathbf{f}). \end{equation} Here $\mathbf{A}_k$, $k=1,2,3$ are sparse matrices coming from the discretization of the advection term, and $\mathbf{Q}$ is a 3-tensor representing the discrete collision kernel. Since $\mathbf{f}$ has $O(M^3)$ components, the tensor $\mathbf{Q}$ has $O(M^9)$ elements, where only $O(M^8)$ elements are nonzero due to the rotational invariance of the collision operator \cite{Cai2020}. Despite this sparsity of $\mathbf{Q}$, the computational cost grows quickly as $M$ increases. To reduce the computational cost, in \cite{Cai2020, Hu2020b}, the authors chose $M_0 < M$ and split the discrete distribution function into two parts $f_M = f^{(1)} + f^{(2)}$, where \begin{equation} \label{eq:f1_f2} \begin{aligned} f^{(1)}(\bx,\bv,t) &= \sum_{l=0}^{M_0} \sum_{m=-l}^l \sum_{n=0}^{\lfloor (M_0 - l) / 2 \rfloor} f_{lmn}(\bx,t) \varphi_{lmn}(\bv), \\ f^{(2)}(\bx,\bv,t) &= \sum_{l=0}^M \sum_{m=-l}^l \sum_{n=\max(0, \lfloor (M_0 - l) / 2 \rfloor + 1)}^{\lfloor (M - l) / 2 \rfloor} f_{lmn}(\bx,t) \varphi_{lmn}(\bv). \end{aligned} \end{equation} Due to the high efficiency of the spectral approximation, we expect that by choosing $M_0 < M$, the first part $f^{(1)}$ can capture the sketch of distribution function $f$, while $f^{(2)}$ provides more details of its profile. For simplicity, we write $\mathbf{f}$ as \begin{displaymath} \mathbf{f} = \begin{pmatrix} \mathbf{f}^{(1)} \\ \mathbf{f}^{(2)} \end{pmatrix}, \end{displaymath} where $\mathbf{f}^{(1)}$ includes all the coefficients in the expansion of $f^{(1)}$ and $\mathbf{f}^{(2)}$ includes all the coefficients in the expansion of $f^{(2)}$. Similarly, we let $\mathbf{M}$ denote the coefficients in the truncated expansion of the local Maxwellian defined by \eqref{eq:local_Maxwellian},and use $\mathbf{M}^{(1)}$ and $\mathbf{M}^{(2)}$ to denote its subvectors. Then using the idea of the BGK and Shakhov collision operators, the original collision term $\mathbf{Q} : (\mathbf{f} \otimes \mathbf{f})$ can be approximated by \begin{equation} \label{eq:approx_coll} \begin{pmatrix} \mathbf{Q}_{M_0} : (\mathbf{f}^{(1)} \otimes \mathbf{f}^{(1)}) \\ \nu_{M_0} (\mathbf{M}^{(2)} - \mathbf{f}^{(2)}) \end{pmatrix}. \end{equation} Here $\mathbf{Q}_{M_0}$ is the discrete collision kernel for $M = M_0$. The approximation \eqref{eq:approx_coll} applies the accurate binary collision operator to the sketch of the distribution function, while for the part representing the finer details, a simpler BGK-like expression is used instead. Such an idea can be found in \cite{Cercignani2006} as a generalization of the classical BGK model. It was later realized for the linearized Boltzmann collision operator in \cite{Cai2015}, where the authors proved that for the linearized collision term, our BGK-like operator converges to the original operator in the resolvent sense as $M_0 \rightarrow +\infty$. The generalization to quadratic collision operators was first introduced in \cite{Wang2019}, where the choice of the parameter $\nu_{M_0}$ was chosen to be the spectral radius of the truncated linearized collision operator following the approach in \cite{Cai2015}. Here we adopt the same choice of $\nu_{M_0}$, and the details are given in the Appendix \ref{sec:nu}. To preserve Maxwellian in the homogeneous Boltzmann equation, in \cite{Hu2020b}, the approximate collision term \eqref{eq:approx_coll} is supplemented by adding a close-to-zero term so that the semi-discrete equation reads \begin{equation} \label{eq:semi_discrete_SSP} \frac{\partial \mathbf{f}}{\partial t} + \sum_{k=1}^3 \mathbf{A}_k \frac{\partial \mathbf{f}}{\partial x_k} = \widetilde{\mathbf{Q}}(M_0; \mathbf{f}) := \begin{pmatrix} \mathbf{Q}_{M_0} : (\mathbf{f}^{(1)} \otimes \mathbf{f}^{(1)} - \mathbf{M}^{(1)} \otimes \mathbf{M}^{(1)}) \\ \nu_{M_0} (\mathbf{M}^{(2)} - \mathbf{f}^{(2)}) \end{pmatrix}. \end{equation} Here $\mathbf{M}^{(1)}$ plays the same role as $\mathbf{f}^{(1)}$ and provides the sketch of the local Maxwellian. Since any Maxwellian is a smooth function, we again expect that $\mathbf{M}^{(1)}$ can well capture the general structure of the Maxwellian with a moderate value of $M_0$. Thus the corresponding collision term $\mathbf{Q}_{M_0} : (\mathbf{M}^{(1)} \otimes \mathbf{M}^{(1)})$ is likely to be close to zero. Such a discrete collision term ensures that it vanishes if $\mathbf{f}^{(1)} = \mathbf{M}^{(1)}$ and $\mathbf{f}^{(2)} = \mathbf{M}^{(2)}$. The idea of this approach comes from the steady-state preserving method introduced in \cite{Filbet2015}, which uses an equivalent form \begin{displaymath} \mathbf{Q}_{M_0} : (\mathbf{f}^{(1)} \otimes \mathbf{f}^{(1)} - \mathbf{M}^{(1)} \otimes \mathbf{M}^{(1)}) = \mathbf{Q}_{M_0} : (\mathbf{g}^{(1)} \otimes \mathbf{g}^{(1)} + \mathbf{g}^{(1)} \otimes \mathbf{M}^{(1)} + \mathbf{M}^{(1)} \otimes \mathbf{g}^{(1)}), \end{displaymath} where $\mathbf{g}^{(1)} = \mathbf{f}^{(1)} - \mathbf{M}^{(1)}$ denotes the non-equilibrium part of the distribution function. Such splitting also borrows ideas from the method of micro-macro decomposition to develop asymptotic preserving schemes \cite{Bennoune2008}. The idea of hybridizing expensive and cheap models has been tested in a number of previous works \cite{Cai2015, Cai2018, Wang2019, Hu2020, Cai2020, Hu2020b}. However, the choice of $M_0$ remains to be problem-dependent, and currently its determination can only be based on trial-and-error approaches. In this work, we would like to determine $M_0$ based on an error estimate, and different $M_0$ will be used on different spatial grids. \section{Choice of the parameter $\nu_{M_0}$} \label{sec:nu} The parameter $\nu_{M_0}$ in the approximate collision term \eqref{eq:approx_coll} is chosen following \cite{Cai2015,Wang2019,Cai2020}. It can be obtained by the following steps: \begin{itemize} \item Set $\overline{\bu}$ and $\overline{\theta}$ to be the velocity $\bu$ and temperature $\theta$, respectively, so that \begin{displaymath} \mathbf{M} = \begin{pmatrix} \mathbf{M}^{(1)} \\ \mathbf{M}^{(2)} \end{pmatrix} = (\rho, 0, \cdots, 0)^T. \end{displaymath} \item Define the linearized collision operator \begin{displaymath} \mathbf{L}(\mathbf{f}^{(1)}) = \mathbf{Q}_{M_0} : (\mathbf{f}^{(1)} \otimes \mathbf{M}^{(1)}). \end{displaymath} Since $\mathbf{M}^{(1)}$ denotes an isotropic distribution function, the operator can be expressed by \begin{displaymath} g_{lmn} = \sum_{n'=0}^{\lfloor (M_0-l)/2 \rfloor} a_{lnn'}^0 f_{lmn'}, \quad l = 0,1,\cdots,M_0, \quad m = -l,\cdots,l, \quad n = 0,\cdots,\lfloor (M_0-l)/2 \rfloor \end{displaymath} where $f_{lmn'}$ are the components of $\mathbf{f}^{(1)}$ and $g_{lmn}$ are the components of $\mathbf{L}(\mathbf{f}^{(1)})$. \item Set $\nu_{M_0}$ to be the spectral radius of $\mathbf{L}$, which can be computed via \begin{displaymath} \nu_{M_0} = \max_{l=0,1,\cdots,M_0} \max \{|\lambda|: \lambda \text{ is the eigenvalue of the matrix $\mathbf{A}_l = (a_{lnn'}^0)$}\}. \end{displaymath} The coefficients $a_{lnn'}^0$ are given in \eqref{eq:a_lnn1^n'}, and the matrix eigenvalues are numerically computed. \end{itemize} When $M_0 = 2$, the matrix $\mathbf{A}_0$ is a $2\times 2$ matrix, and $\mathbf{A}_1$ and $\mathbf{A}_2$ are scalars. Due to the conservation of mass, momentum and energy, we have $\mathbf{A}_0 = 0$, $\mathbf{A}_1 = 0$. Thus, the absolute value of the only coefficient $a_{200}^0$ in $\mathbf{A}_2$ provides the value of $\nu_{M_0}$. This coefficient indicates the decay rate of the stress tensor, which is often used as the collision frequency in the BGK model. \section{Proof of Theorem \ref{thm:pp}} \label{sec:proof} \begin{lemma} Given non-negative indices $l,n,n',l_1,n_1,l_2,n_2$ and integer indices $m_1 \in [-l_1, l_1]$ and $m_2 \in [-l_2, l_2]$, the integral \begin{displaymath} \int_{\mathbb{R}^3} \int_{\mathbb{R}^3} p_{l_1 m_1 n_1}^{\dagger}(\sqrt{2}\bh) p_{l_2 m_2 n_2}^{0\dagger} \left( \frac{\bg}{\sqrt{2}} \right) p_{l0n} \left( \bh + \frac{1}{2} \bg \right) p_{00n'} \left( \bh - \frac{1}{2} \bg \right) \omega\left(\bh + \frac{1}{2} \bg\right) \omega \left( \bh - \frac{1}{2} \bg \right) \,\mathrm{d}\bg \,\mathrm{d}\bh \end{displaymath} is nonzero only if $l_1 + l_2 + 2(n_1 + n_2) = l + 2(n+n')$ and $m_1 + m_2 = 0$. \end{lemma} This conclusion can be found in \cite[eqs. (112)(114)]{kumar1966}. \begin{proof}[Proof of Theorem \ref{thm:pp}] Due to the orthogonality of the polynomials $p_{lmn}$, we know that \begin{equation} \label{eq:A_integral} \begin{split} A_{lnn'}^{l_1 l_2 m_2 n_2} = \int_{\mathbb{R}^3} \int_{\mathbb{R}^3} p_{l_1 m_1 n_1}^{\dagger}(\sqrt{2}\bh) p_{l_2 m_2 n_2}^{0\dagger} \left( \frac{\bg}{\sqrt{2}} \right) p_{l0n} \left( \bh + \frac{1}{2} \bg \right) p_{00n'} \left( \bh - \frac{1}{2} \bg \right) \\ \times \omega\left(\bh + \frac{1}{2} \bg\right) \omega \left( \bh - \frac{1}{2} \bg \right) \,\mathrm{d}\bg \,\mathrm{d}\bh, \end{split} \end{equation} where $m_1 = -m_2$ and $n_1 = l-l_1-l_2+2(n+n'-n_2)$. For simplicity, we assume that $\overline{\bu} = 0$, and in the case of nonzero $\overline{\bu}$, the result can be obtained by translation. To derive the recurrence relation of $A_{lnn'}^{l_1l_2 m_2 n_2}$, we use the recurrence relation of Laguerre polynomials to get \begin{displaymath} p_{00,n'+1}\left(\bh - \frac{1}{2}\bg \right) = -\frac{1}{2\sqrt{(n+1)(n+3/2)}} \overline{\theta}^{-1} \left\| \bh - \frac{1}{2} \bg \right\|^2 p_{00n'} \left( \bh - \frac{1}{2} \bg \right) + (\text{Lower degree polynomials}), \end{displaymath} where ``lower degree polynomials'' refers to the polynomials of $\bg$ and $\bh$ of degree less than $2(n'+1)$. Due to the orthogonality of $p_{lmn}$, these terms will vanish when calculating the integral \eqref{eq:A_integral} with $n'$ replaced by $n'+1$: \begin{equation} \label{eq:Alnnp1} \begin{split} A_{ln,n'+1}^{l_1 l_2 m_2 n_2} &= -\frac{1}{2\sqrt{(n+1)(n+3/2)}} \overline{\theta}^{-1} \int_{\mathbb{R}^3} \int_{\mathbb{R}^3} \left( h^2 + \frac{1}{4} g^2 - \bh \cdot \bg \right) p_{l_1 m_1 n_1}^{\dagger}(\sqrt{2}\bh) p_{l_2 m_2 n_2}^{0\dagger} \left( \frac{\bg}{\sqrt{2}} \right) \\ & \qquad \times p_{l0n} \left( \bh + \frac{1}{2} \bg \right) p_{00n'} \left( \bh - \frac{1}{2} \bg \right) \omega\left(\bh + \frac{1}{2} \bg\right) \omega \left( \bh - \frac{1}{2} \bg \right) \,\mathrm{d}\bg \,\mathrm{d}\bh. \end{split} \end{equation} Using \begin{equation} \label{eq:h2_g2} \begin{split} & \overline{\theta}^{-1} \left( h^2 + \frac{1}{4} g^2 \right) p_{l_1 m_1 n_1}(\sqrt{2} \bh) p_{l_2 m_2 n_2}^0 \left( \frac{\bg}{\sqrt{2}} \right) \\ ={} & -\sum_{k=1}^2 \sqrt{n_k(n_k+l_k+1/2)} p_{l_1,m_1,n_1-\delta_{1k}} (\sqrt{2}\bh) p_{l_2,m_2,n_2-\delta_{2k}}^0 \left( \frac{\bg}{\sqrt{2}} \right) + (\text{Higher degree polynomials}) \end{split} \end{equation} and \begin{equation} \label{eq:hg} \begin{split} & \frac{1}{2} \overline{\theta}^{-1} (\bh \cdot \bg) p_{l_1 m_1 n_1}(\sqrt{2} \bh) p_{l_2 m_2 n_2}^0 \left( \frac{\bg}{\sqrt{2}} \right) \\ ={} & \sum_{\mu=-1}^1 (-1)^{\mu} \left[ \sqrt{l_1 + n_1 + 1/2} \gamma_{l_1,m_1-\mu}^{\mu} p_{l_1-1,m_1-\mu,n_1}(\sqrt{2}\bh) - (-1)^{\mu} \sqrt{n_1} \gamma_{-l_1-1,m_1-\mu}^{\mu} p_{l_1+1,m_1-\mu,n_1-1}(\sqrt{2}\bh) \right] \\ & \qquad \times \left[ \sqrt{l_2 + n_2 + 1/2} \gamma_{l_2,m_2+\mu}^{-\mu} p_{l_2-1,m_2+\mu,n_2}(\sqrt{2}\bh) - (-1)^{\mu} \sqrt{n_2} \gamma_{-l_2-1,m_2+\mu}^{-\mu} p_{l_2+1,m_2+\mu,n_2-1}(\sqrt{2}\bh) \right] \\ & + (\text{Higher degree polynomials}). \end{split} \end{equation} We refer the readers to \cite[Appendix B]{Cai2015} for the derivation of these equations. In the above two equations, ``higher degree polynomials'' refer to the orthogonal polynomials of $\bg$ and $\bh$ whose degrees are higher than $l+2(n+n')-1$, and such terms will vanish after substituting \eqref{eq:h2_g2} and \eqref{eq:hg} into \eqref{eq:Alnnp1}. The recurrence relation \eqref{eq:A_recur} can be obtained by such substitution and using the properties \begin{displaymath} m_1 + m_2 = 0, \qquad \gamma_{l,m}^{\mu} = \gamma_{l,-m}^{-\mu}. \qedhere \end{displaymath} \end{proof} \section{Summary and outlook} \label{sec:conclusion} This paper contributes to the efficient simulation of the Boltzmann equation with the quadratic collision operator. Instead of a full discretization of the binary collision term, we choose to replace part of it with the BGK simulation, and the choice of ``BGK part'' changes with the distribution function. To make proper choices adaptively, we construct our error indicator based on a novel idea that uses a cheaper linear operator to control some quadratic parts of the error term, so that even in the case where the full binary collision operator has to be used widely, our adaptive method does not slow down the computation. Our numerical simulation shows the affordability and reliability of our indicators. The error indicator introduced in this paper is specially designed for the Burnett spectral method, while we expect that the same idea can be applied to other approaches such as the Fourier spectral method, which has lower time complexity. As the Fourier spectral method is also much cheaper for certain particular models \cite{Filbet2006}, we are exploring the possibilities of such extensions. \section{Numerical scheme and experiments} \label{sec:num} We are now ready to integrate the adaptation technique into the Boltzmann solver and carry out numerical experiments. In what follows, we will first brief our numerical algorithm to solve the system \eqref{eq:semi_discrete_SSP}, and then present several numerical experiments to demonstrate the effectiveness of the proposed indicator. \subsection{Numerical scheme} For convenience, we will only provide the numerical algorithm for the spatially one-dimensional case (the velocity space is still three-dimensional), where we assume that \begin{equation} \label{eq:1D} \frac{\partial \mathbf{f}}{\partial x_2} = \frac{\partial \mathbf{f}}{\partial x_3} = 0. \end{equation} The algorithm can be naturally generalized to the multi-dimensional case with uniform grids. Suppose the spatial domain $\Omega \subset \mathbb{R}$ is discretized by a uniform grid with cell size $\Delta x$. Using $\mathbf{f}_j^n$ to approximate the average of $\mathbf{f}$ over the $j$th grid cell $[x_{j-1/2}, x_{j+1/2}]$ at time $t^n$, we can solve the system \eqref{eq:semi_discrete_SSP} by the following finite volume method with time step size $\Delta t$: \begin{equation} \label{eq:numerical_sch} \mathbf{f}_j^* = \mathbf{f}_j^n - \frac{\Delta t}{\Delta x} [\mathbf{F}_{j+1/2}^n -\mathbf{F}_{j-1/2}^n], \qquad \mathbf{f}_j^{n+1} = \mathbf{f}_j^* + \Delta t \widetilde{\mathbf{Q}}(M_0; \mathbf{f}_j^n), \end{equation} where $\widetilde{\mathbf{Q}}(M_0; \mathbf{f}_j^n)$ is the modified collision operator defined in \eqref{eq:semi_discrete_SSP}. The numerical fluxes $\mathbf{F}_{j\pm 1/2}^n$ are chosen according to the HLL scheme \cite{HLL}: \begin{equation} \label{eq:HLL} \mathbf{F}_{j+1/2}^n = \frac{\lambda^R\mathbf{A}_1 \mathbf{f}_j^n - \lambda^L\mathbf{A}_1 \mathbf{f}_{j+1}^n + \lambda^R \lambda^L \Big(\mathbf{f}_{j+1}^n - \mathbf{f}_j^n\Big)}{\lambda^R - \lambda^L}, \end{equation} where $\lambda^R$ and $\lambda^L$ are the minimum and maximum eigenvalues of $\mathbf{A}_1$, respectively. Precisely, we have \begin{equation} \lambda^L = \bar{u}_1 - C_{M+1} \sqrt{\bar{\theta}} , \qquad \lambda^R = \bar{u}_1 + C_{M+1} \sqrt{\bar{\theta}}, \end{equation} and $C_{M+1}$ is the largest zero of the Hermite polynomial of degree $M+1$. Here the parameters are always chosen such that $\lambda^L < 0$ and $\lambda^R > 0$ to avoid advection only in one direction. Besides, the time step size is determined by the CFL condition \begin{equation} \label{eq:CFL} \Delta t \frac{|\bar{u}_1| + C_{M+1} \sqrt{\bar{\theta}}}{\Delta x} = {\rm CFL} < 1. \end{equation} In our actual implementation, we have upgraded this scheme to the second order by linear reconstruction with minmod limiter, Heun's time integrator, and the Strang splitting. Such strategies are standard techniques and can be found in many textbooks (e.g. \cite{Leveque2002}). \subsection{One-dimensional numerical examples} In this section, we present two numerical examples, both of which use the variable hard sphere model with $\nu = 5/9$ (see \eqref{eq:vhs}). In our simulation, in order to prevent the computational cost from getting out of control, we set a cap for the value of $M_0$ to be $15$, and we use the non-adaptive results with $M_0 = 15$ being fixed as our reference solution. All the numerical tests in this section are carried out on a desktop with CPU model Intel\textsuperscript{\textregistered} Core\texttrademark{} i7-7600U. \subsubsection{Colliding flow} \label{sec:colliding_flow} We consider the colliding flow with the initial condition \begin{equation} \label{eq:ini_ex1_1} f(x, \boldsymbol{v}, 0) = \frac{\rho(x)}{(2 \pi \theta(x))^{3/2}} \exp\left(-\frac{|\bv - \boldsymbol{u}(x)|^2}{2 \theta(x)}\right) \end{equation} with \begin{equation} \label{eq:ini_ex1_2} \rho(x) = 1, \qquad \bu(x) = \left\{\begin{array}{cc} (1, 0, 0)^T, & {\rm if}~ x < 0, \\ (-1, 0, 0)^T, & {\rm if}~ x > 0, \end{array} \right. \qquad \theta(x) = 1/3. \end{equation} We scale the collision term such that the Knudsen number equals $0.5$. The initial condition consists of two equilibrium flows with the same temperature moving in opposite directions, and it is expected that the collision of the two Maxwellians will create some non-equilibrium effects, which require a relatively large $M_0$ to accurately capture the flow states. The computational domain is set as $[-20, 20]$. In \eqref{eq:truncated_series}, we choose $M$ to be $30$, and $\bar{\bu}$ and $\bar{\theta}$ are set to be $\mathbf{0}$ and $1$, respectively. To determine the values of the thresholds $\epsilon_1$ and $\epsilon_2$, we follow the strategy in Section \ref{sec:adaptive} and carry out a test run for $M_0$ fixed to be $3$ up to $t = 15$. The cell size is chosen to be $\Delta x = 0.4$ in all the test runs below. The numerical solutions of this test run at different times are given in Figure \ref{fig:ex1_M03}, which plots the density $\rho$ and heat flux $\boldsymbol{q}$ of the gas, which are defined by \begin{equation} \label{eq:moments1} \rho = \int_{\mathbb{R}^3} f(\bv) \,\mathrm{d}\bv, \qquad \boldsymbol{q} = \frac{1}{2} \int_{\mathbb{R}^3} |\bv-\bu|^2 (\bv - \bu) f(\bv) \,\mathrm{d}\bv, \end{equation} where $\bu$ is the average velocity of gas molecules: \begin{equation} \label{eq:moments_u} \bu = \frac{1}{\rho} \int_{\mathbb{R}^3} \bv f(\bv) \,\mathrm{d}\bv. \end{equation} For this one-dimensional flow, only the first component of $\boldsymbol{q}$ is plotted. Due to the insufficient resolution of the solution and the small value of $M_0$, the peak values of both density and heat flux are not well captured, but the general behavior of the flow is still qualitatively correct: the collision of the flow generates two shock waves moving in opposite directions, and the heat flux is nonzero inside these shock waves. During the test run, we record the maximum value of the indicator, which turns out to be \begin{displaymath} \epsilon_{\max} = 15.6. \end{displaymath} This leads us to the following initial guess of $\epsilon_1$ and $\epsilon_2$: \begin{displaymath} (\epsilon_1, \epsilon_2) = (4,8) \approx (\epsilon_{\max}/4, \epsilon_{\max}/2). \end{displaymath} \begin{figure}[!htb] \centering \subfloat[$\rho$ ]{\includegraphics[width=0.49\textwidth,clip]{images/ex1_M03_rho.pdf}}\hfill \subfloat[$q_1$]{\includegraphics[width=0.49\textwidth,clip]{images/ex1_M03_q.pdf}} \caption{Plots of density and heat flux for the colliding flow with $M_0 = 3$ (fixed) at different times.} \label{fig:ex1_M03} \end{figure} We now carry out a test with adaptive collision operators using this pair of parameters, and then reduce the value of $\epsilon_1$ to $2$ and run another test. The comparison of these two tests is given in Figure \ref{fig:ex1_ep_1}, where we only present the non-equilibrium variable $q_1$ that shows a more significant difference than the equilibrium variables. It can be seen from Figure \ref{fig:ex1_ep_1_M0} that the smaller value of $\epsilon_1$ leads to slightly greater $M_0$ inside the shock wave. Since the graph of $q_1$ in Figure \ref{fig:ex1_ep_1_q1} still shows quite some difference between the two solutions, we further reduce $\epsilon_1$ by a half and carry out another test run. The comparison of the solutions is given in Figure \ref{fig:ex1_ep_2}. We are now satisfied with the small difference and will fix the value of $\epsilon_1$ to be $1$. \begin{figure}[!htb] \centering \subfloat[$q_1$. Solid lines: $(\epsilon_1,\epsilon_2) = (4, 8)$. Dashed lines: $(\epsilon_1,\epsilon_2) = (2,8)$.\label{fig:ex1_ep_1_q1}]{\includegraphics[width=0.49\textwidth,height=0.35\textwidth, clip]{images/ex1_q_4_8.pdf}}\hfill \subfloat[$M_0$. Solid lines: $(\epsilon_1,\epsilon_2) = (4, 8)$. Dashed lines: $(\epsilon_1,\epsilon_2) = (2,8)$.\label{fig:ex1_ep_1_M0}]{\includegraphics[width=0.49\textwidth,height=0.35\textwidth, clip]{images/ex1_M0_4_8.pdf}} \caption{Profiles of heat flux and distributions of $M_0$ for the colliding flow with two different pairs of indicator thresholds $(\epsilon_1,\epsilon_2) = (4, 8)$ and $(\epsilon_1,\epsilon_2) = (2,8)$.} \label{fig:ex1_ep_1} \end{figure} \begin{figure}[!htb] \centering \subfloat[$q_1$. Solid lines: $(\epsilon_1,\epsilon_2) = (2, 8)$. Dashed lines: $(\epsilon_1,\epsilon_2) = (1,8)$.]{\includegraphics[width=0.49\textwidth,height=0.35\textwidth, clip]{images/ex1_q_2_8.pdf}}\hfill \subfloat[$M_0$. Solid lines: $(\epsilon_1,\epsilon_2) = (2, 8)$. Dashed lines: $(\epsilon_1,\epsilon_2) = (1,8)$.]{\includegraphics[width=0.49\textwidth,height=0.35\textwidth, clip]{images/ex1_M0_2_8.pdf}} \caption{Profiles of heat flux and distributions of $M_0$ for the colliding flow with two different pairs of indicator thresholds $(\epsilon_1,\epsilon_2) = (2, 8)$ and $(\epsilon_1,\epsilon_2) = (1,8)$.} \label{fig:ex1_ep_2} \end{figure} The selection of $\epsilon_2$ is done in a similar way. We reduce $\epsilon_2$ from $8$ to $4$ and compare the results with the parameters $(\epsilon_1, \epsilon_2) = (1,8)$ and $(\epsilon_1, \epsilon_2) = (1,4)$. As shown in Figure \ref{fig:ex1_ep_3}, in a few grid cells inside the shock wave, the values of $M_0$ have been significantly increased, while the solution of the heat flux does not change too much. We therefore fix the value of $\epsilon_2$ to be $4$. The computational times for these test runs are given in Table \ref{tab:ex1_ep}, which look affordable due to the coarse grid size. \begin{figure}[!htb] \centering \subfloat[$q_1$. Solid lines: $(\epsilon_1,\epsilon_2) = (1, 8)$. Dashed lines: $(\epsilon_1,\epsilon_2) = (1,4)$.]{\includegraphics[width=0.49\textwidth,height=0.35\textwidth, clip]{images/ex1_q_1_4.pdf}}\hfill \subfloat[$M_0$. Solid lines: $(\epsilon_1,\epsilon_2) = (1, 8)$. Dashed lines: $(\epsilon_1,\epsilon_2) = (1,4)$.]{\includegraphics[width=0.49\textwidth,height=0.35\textwidth, clip]{images/ex1_M0_1_4.pdf}} \caption{Profiles of heat flux and distributions of $M_0$ for the colliding flow with two different pairs of indicator thresholds $(\epsilon_1,\epsilon_2) = (1,8)$ and $(\epsilon_1,\epsilon_2) = (1,4)$.} \label{fig:ex1_ep_3} \end{figure} \begin{table}[!ht] \centering \def1.3{1.5} \caption{CPU times of the test run for the collision flow. The parameters $(0,+\infty)$ refers to the non-adaptive run with $M_0$ fixed to be $3$.} \label{tab:ex1_ep} \begin{tabular}{c|c@{\qquad}c@{\qquad}c@{\qquad}c@{\qquad}c@{\qquad}} $(\epsilon_1, \epsilon_2)$ & $(0,+\infty)$ & $(4, 8)$ & $(2, 8)$ & $(1, 8)$ &$(1, 4)$\\ \hline Total CPU time (s) & $240.62$ & $479.27$ & $510.55$ & $525.35$ & $724.82$ \end{tabular} \end{table} Next, we refine the grid and set the cell size to be $\Delta x = 0.1$. With $(\epsilon_1, \epsilon_2)$ chosen to be $(1,4)$, we rerun the simulation up to $t = 15$. The numerical solutions at different times are given in Figure \ref{fig:ex1_sol}, including three equilibrium quantities (density $\rho$, velocity $\bu$ and temperature $\theta$) and one non-equilibrium moment (heat flux $\boldsymbol{q}$). The temperature $\theta$ is related to the distribution function by \begin{equation} \label{eq:moments} \theta = \frac{1}{3\rho} \int_{\mathbb{R}^3} |\bv-\bu|^2 f(\bv) \,\mathrm{d}\bv. \end{equation} For the velocity and heat flux, only their first components are plotted due to the one-dimensional nature of the flow. Similar to our test runs, the flow structure emerges from the middle of the domain due to the interaction of the two Maxwellians, producing higher density and temperature. Then two shock waves are formed and move in opposite directions. After the two shock waves are separated, the center of the domain returns to local equilibrium state. We would like to emphasize that Figure \ref{fig:ex1_sol} includes two sets of solutions (the reference solution and the self-adaptive solution) which almost coincide. \begin{figure}[!htb] \centering \subfloat[$\rho$ ]{\includegraphics[width=0.49\textwidth,clip]{images/ex1_rho.pdf}}\hfill \subfloat[$u_1$]{\includegraphics[width=0.49\textwidth,clip]{images/ex1_vel.pdf}} \\ \subfloat[$\theta$]{\includegraphics[width=0.49\textwidth,clip]{images/ex1_T.pdf}}\hfill \subfloat[$q_1$]{\includegraphics[width=0.49\textwidth,clip]{images/ex1_q.pdf}} \caption{Solution of the colliding flow at different times. The solid lines are the numerical solution of the adaptive algorithm and the dashed lines are the reference solution.} \label{fig:ex1_sol} \end{figure} The evolution of the distribution of $M_0$ is provided in Figure \ref{fig:ex1_M0}. Initially, we set $M_0 = 15$ on all grid cells. In a few time steps, this drops to $3$ almost everywhere except the center of the domain. Afterward, the evolution of $M_0$ well agrees with the evolution of the non-equilibrium. During the simulation, most part of the domain is in the local equilibrium state, where $M_0$ stays at its lowest value $3$, requiring much less computational cost. Consequently, as shown in Table \ref{tab:ex1}, the total CPU time is significantly reduced compared with the simulation using a uniform $M_0$. Moreover, the evaluation of the error indicator only takes a relatively small portion of the total computational time, which agrees with the goal we set in Section \ref{sec:intro}. It is also worth mentioning that the total computational time is 3993.29s, which is even longer than the sum of all our test runs. \begin{figure}[!htb] \centering \subfloat[$M_0, t = 1$]{\includegraphics[width=0.49\textwidth,clip]{images/ex1_M01.pdf}}\hfill \subfloat[$M_0, t = 2$]{\includegraphics[width=0.49\textwidth,clip]{images/ex1_M02.pdf}} \\ \subfloat[$M_0, t = 3$]{\includegraphics[width=0.49\textwidth,clip]{images/ex1_M03.pdf}}\hfill \subfloat[$M_0, t = 5, 10, 15$]{\includegraphics[width=0.49\textwidth,clip]{images/ex1_M0.pdf}} \caption{Distribution of $M_0$ for the colliding flow at different times.} \label{fig:ex1_M0} \end{figure} \begin{table}[!ht] \centering \caption{Statistical data for the colliding flow. $T_{\mathrm{ref}}$ and $T_{\mathrm{adp}}$ refer to the average CPU time per time step for the reference solution and the self-adaptive solution, respectively, and $T_{\mathrm{ind}}$ refers to the average CPU time per time step for the computation of the error indicator.} \label{tab:ex1} \begin{tabular}{c@{\qquad}c@{\qquad}c@{\qquad}c@{\qquad}c} \hline $T_{\mathrm{ref}}$ & $T_{\mathrm{adp}}$ & $T_{\mathrm{ind}}$ & $1 - T_{\mathrm{adp}} / T_{\mathrm{ref}}$ & $T_{\mathrm{ind}} / T_{\mathrm{adp}}$ \\ \hline $16.96$s & $1.06$s & $0.108$s & $93.7$\% & $10.1$\% \\ \hline \end{tabular} \end{table} \subsubsection{Planar Couette flow} The planar Couette flow is a commonly used benchmark problem for the one-dimensional Boltzmann equation. We assume that the gas between two infinite parallel plates has an initial temperature $\theta = 1$, and the two plates move in the opposite directions with velocities parallel to the plates. The speeds of both plates are $0.5$, and the distance between the two plates is $L = 1$. Both plates are assumed to be completely diffusive, meaning that for any particle hitting the wall, the reflected velocity is completely independent of the incident velocity. Instead, the distribution of the reflected velocity follows the Maxwellian with the wall velocity being the center and wall temperature being the variance. The implementation of the boundary condition in the Burnett spectral method has been detailed in \cite[Section 3.4]{Hu2020b}. The initial state of the fluid is set to be a uniform Maxwellian with density $\rho=1$, velocity $\bu = 0$ and temperature $\theta = 1$. Driven by the motion of the plates, the flow will reach a steady state as time approaches infinity. Here we choose the Knudsen number to be $0.5$, for which a strong non-equilibrium can be expected, especially on the boundary of the domain where the distribution function is discontinuous. Numerically, we set $\bar{\bu} = \boldsymbol{0}$, $\bar{\theta} = 1$ and $M=30$ in \eqref{eq:truncated_series}. A uniform grid with $200$ cells is used for spatial discretization, and the thresholds of the error indicator are set to be $\epsilon_1 = 1$ and $\epsilon_2 = 8$. Figure \ref{fig:ex2_sol} shows the numerical solution of the four moments defined in \eqref{eq:moments1}\eqref{eq:moments_u} and \eqref{eq:moments}, and Figure \ref{fig:ex2_M0} shows the evolution of the parameter $M_0$. During the evolution to the steady state, some small differences between the self-adaptive solution and the reference solution can be observed. The discrepancy of the velocity profiles appears to be the most significant due to its small magnitude. In this example, large $M_0$ only appears near the boundary of the domain for small $t$, since the central part of the domain is still mostly in the initial equilibrium state. As the boundary effect propagates inward, the value of $M_0$ gradually increases. Interestingly, the distribution of $M_0$ reaches the ``steady state'' earlier than the fluid does. As shown in Figures \ref{fig:ex2_t1} and \ref{fig:ex2_steady}, at $t = 1.0$, while the fluid structure is still evolving, $M_0$ does not change with time any more. Compared to the example in Section \ref{sec:colliding_flow}, the non-equilibrium spreads more widely in this case, resulting in less reduction of the computational cost (see Table \ref{tab:ex2}). Nevertheless, the CPU time per time step is still reduced to nearly one-sixth. Here, the computation of the indicator takes a smaller portion since longer time is spent on the evaluation of the collision term. \begin{figure}[!htb] \centering \subfloat[$\rho$ ]{\includegraphics[width=0.49\textwidth,clip]{images/ex2_rho.pdf}}\hfill \subfloat[$u_1$]{\includegraphics[width=0.49\textwidth,clip]{images/ex2_vel.pdf}} \\ \subfloat[$\theta$]{\includegraphics[width=0.49\textwidth,clip]{images/ex2_T.pdf}}\hfill \subfloat[$q_1$]{\includegraphics[width=0.49\textwidth,clip]{images/ex2_q.pdf}} \caption{Solution of the Couette flow at different times. The solid lines are the numerical solution of the adaptive algorithm and the dashed lines are the reference solution. } \label{fig:ex2_sol} \end{figure} \begin{figure}[!htb] \centering \subfloat[$t = 0.1$ ]{\includegraphics[width=0.49\textwidth]{images/ex2_M001.pdf}}\hfill \subfloat[$t = 0.5$]{\includegraphics[width=0.49\textwidth]{images/ex2_M005.pdf}} \\ \subfloat[$t = 1.0$]{\label{fig:ex2_t1}\includegraphics[width=0.49\textwidth]{images/ex2_M01.pdf}}\hfill \subfloat[steady state]{\label{fig:ex2_steady}\includegraphics[width=0.49\textwidth]{images/ex2_M0.pdf}} \caption{Distribution of $M_0$ for the Couette flow at different times.} \label{fig:ex2_M0} \end{figure} \begin{table}[!ht] \centering \caption{Statistical data for the planar Couette flow. $T_{\mathrm{ref}}$ and $T_{\mathrm{adp}}$ refer to the CPU time per time step for the reference solution and the self-adaptive solution, respectively, and $T_{\mathrm{ind}}$ refers to the CPU time per time step for the computation of the error indicator.} \label{tab:ex2} \begin{tabular}{c@{\qquad}c@{\qquad}c@{\qquad}c@{\qquad}c} \hline $T_{\mathrm{ref}}$ & $T_{\mathrm{adp}}$ & $T_{\mathrm{ind}}$ & $1 - T_{\mathrm{adp}} / T_{\mathrm{ref}}$ & $T_{\mathrm{ind}} / T_{\mathrm{adp}}$ \\ \hline $8.54$s & $1.51$s & $0.057$s & $82.3$\% & $3.78$\% \\ \hline \end{tabular} \end{table} \subsection{Two-dimensional examples} In our two-dimensional examples, we also consider the variable hard sphere model with $\nu = 5/9$, and $M_0$ is still capped at $15$. Two examples with and without boundary conditions will be considered in the following two subsections. \subsubsection{Fluid diffusion} \label{sec:diffusion} Our first two-dimensional example considers the initial data \begin{displaymath} f(x_1, x_2, \bv, 0) = \frac{\rho(x_1, x_2)}{(2\pi \theta(x_1, x_2))^{3/2}} \exp \left( -\frac{|\bv - \bu(x_1, x_2)|^2}{2\theta(x_1, x_2)} \right), \end{displaymath} where $\bu(x_1, x_2) = \boldsymbol{0}$ and $\theta(x_1, x_2) = 1$ for all $x_1$ and $x_2$, while $\rho(x)$ is set to be \begin{displaymath} \rho(x_1, x_2) = \left\{\begin{array}{@{}ll} 10, & \text{if } |x_1| \leqslant 0.05 \text{ and } |x_2| \leqslant 0.05, \\ 1, & \text{otherwise.} \end{array} \right. \end{displaymath} We set the computational domain to be $\Omega = [-0.5, 0.5] \times [-0.5, 0.5]$ and apply the Neumann boundary condition to simulate the flow in the unbounded domain. In this example, there is a high density region in the center of the domain, and we are interested in the dynamics of its diffusion into the background fluid. Here we choose the Knudsen number to be $\Kn = 0.05$. The parameters in \eqref{eq:truncated_series} are set to be $M = 30$, $\bar{\bu} = \boldsymbol{0}$ and $\bar{\theta} = 1$. A uniform grid of size $200 \times 200$ is utilized here to discretize the physical space. The thresholds of the error indicator are chosen as $(\epsilon_1, \epsilon_2) = (2.5, 8.5)$. We plot the evolution of the fluid states in Figure \ref{fig:ex4_sol}, with reference solutions computed by using $M_0 = 15$ everywhere. Besides the equilibrium variables density $\rho$ and temperature $\theta$, we have also plotted the shear stress $\sigma_{12}$, which is related to the distribution function by \begin{equation} \sigma_{12} = \int_{\mathbb{R}^3} (v_1 - u_1)(v_2 - u_2) f(\bv) \,\mathrm{d}\bv. \end{equation} It can be seen that the density in the center of the domain gradually decreases, and as the mass flows out, the temperature also starts to decrease so that the total energy can be conserved. Due to the symmetry of the initial data, the value of the non-equilibrium variable $\sigma_{12}$ equals zero on both $x$- and $y$-axes. As the fluid evolves with time, the non-equilibrium effect spreads out, while the peak values of $\sigma_{12}$ start to decrease. With our adaptive method, these phenomena can be accurately captured. To get a clearer view of the difference between the adaptive solutions and the reference solutions, we define \begin{equation} \label{eq:ex3_error} \mathcal{E}_{\rho} = \rho^{\rm adp} - \rho^{\rm ref}, \qquad \mathcal{E}_{\theta} = \theta^{\rm adp} - \theta^{\rm ref}, \qquad \mathcal{E}_{\sigma_{12}} = \sigma_{12}^{\rm adp} - \sigma_{12}^{\rm ref}, \end{equation} where the superscripts ``adp'' and ``ref'' denote the adaptive solution and the reference solution, respectively. These quantities are plotted in Figure \ref{fig:ex4_l2_error}, and the corresponding relative $L^2$ differences are given in Table \ref{tab:ex4_l2_error}. One can observe that the difference between the two solutions increases with time due to the accumulation of the error. This also implies that the thresholds $\epsilon_1$ and $\epsilon_2$, whose values stay the same throughout the simulation, do not directly correspond to the error of the solution. Our error indicator only estimates the local truncation error, which may accumulate in time-dependent problems. In such circumstances, to ensure the numerical accuracy for longer simulations, one may need to choose smaller values of $\epsilon_1$ and $\epsilon_2$. Such an effect is automatically incorporated into the procedure of parameter selection introduced in Section \ref{sec:adaptive} if the test runs are also preformed until the desired final time. \begin{table}[!ht] \centering \def1.3{1.3} \caption{Relative $L_2$ difference between the self-adaptive solution and the reference solution.} \label{tab:ex4_l2_error} \footnotesize \begin{tabular}{c|@{\qquad}c@{\qquad}c@{\qquad}c@{\qquad}c} & $t = 0.04$ & $t = 0.08$ & $t = 0.12$ & $t = 0.15$ \\ \hline $\|\mathcal{E}_{\rho}\|_{L^2} / \|\rho^{\mathrm{ref}}\|_{L^2}$ & $0.01$\% & $0.03$\% & $0.11$\% & $0.24$\% \\ $\|\mathcal{E}_{\theta}\|_{L^2} / \|\theta^{\mathrm{ref}}\|_{L^2}$ & $0.01$\% & $0.04$\% & $0.12$\% & $0.20$\% \\ $\|\mathcal{E}_{\sigma_{12}}\|_{L^2} / \|\sigma_{12}^{\mathrm{ref}}\|_{L^2}$ & $0.30$\% & $0.84$\% & $1.29$\% & $2.01$\% \end{tabular} \end{table} \begin{figure}[!htb] \centering \subfloat[$\rho, t = 0.04$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/ex4_rho_t04.pdf}}\hfill \subfloat[$\theta, t = 0.04$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/ex4_T_t04.pdf}}\hfill \subfloat[$\sigma_{12}, t = 0.04$ ]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/ex4_sigma_t04.pdf}}\hfill \\ \subfloat[$\rho, t = 0.08$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/ex4_rho_t08.pdf}} \hfill \subfloat[$\theta, t = 0.08$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/ex4_T_t08.pdf}} \hfill \subfloat[$\sigma_{12}, t = 0.08$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/ex4_sigma_t08.pdf}} \hfill \\ \subfloat[$\rho, t = 0.12$]{\includegraphics[bb=18 21 584 500,width=0.33\textwidth,clip]{images/ex4_rho_t12.pdf}} \hfill \subfloat[$\theta, t = 0.12$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/ex4_T_t12.pdf}} \hfill \subfloat[$\sigma_{12}, t = 0.12$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/ex4_sigma_t12.pdf}} \\ \subfloat[$\rho, t = 0.15$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/ex4_rho_t15.pdf}}\hfill \subfloat[$\theta, t = 0.15$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/ex4_T_t15.pdf}} \hfill \subfloat[$\sigma_{12}, t=0.15$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/ex4_sigma_t15.pdf}} \caption{Solution of the fluid diffusion problem at different times. The red contours are the numerical solutions of the adaptive method and the black contours are the reference solutions.} \label{fig:ex4_sol} \end{figure} \begin{figure}[!htb] \centering \subfloat[$\mathcal{E}_{\rho}, t = 0.04$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/drho_004.pdf}}\hfill \subfloat[$\mathcal{E}_{\theta}, t = 0.04$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/dT_004.pdf}}\hfill \subfloat[$\mathcal{E}_{\sigma_{12}}, t = 0.04$ ]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/dsigma_004.pdf}}\hfill \\ \subfloat[$\mathcal{E}_{\rho}, t = 0.08$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/drho_008.pdf}} \hfill \subfloat[$\mathcal{E}_{\theta}, t = 0.08$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/dT_008.pdf}} \hfill \subfloat[$\mathcal{E}_{\sigma_{12}}, t = 0.08$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/dsigma_008.pdf}} \hfill \\ \subfloat[$\mathcal{E}_{\rho}, t = 0.12$]{\includegraphics[bb=18 21 584 500,width=0.33\textwidth,clip]{images/drho_012.pdf}} \hfill \subfloat[$\mathcal{E}_{\theta}, t = 0.12$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/dT_012.pdf}} \hfill \subfloat[$\mathcal{E}_{\sigma_{12}}, t = 0.12$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/dsigma_012.pdf}} \\ \subfloat[$\mathcal{E}_{\rho}, t = 0.15$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/drho_015.pdf}}\hfill \subfloat[$\mathcal{E}_{\theta}, t = 0.15$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/dT_015.pdf}} \hfill \subfloat[$\mathcal{E}_{\sigma_{12}}, t=0.15$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/dsigma_015.pdf}} \caption{Error \eqref{eq:ex3_error} of the fluid diffusion problem at different times.} \label{fig:ex4_l2_error} \end{figure} \clearpage The evolution of the distribution of $M_0$ is given in Figure \ref{fig:ex4_M0}. Initially, the mixing of two fluid regions creates some non-equilibrium. However, due to the high density in the central part of the domain, fast collisions of particles keep the fluid near its local equilibrium, so that $M_0$ is generally not too large at $t = 0.04$. As $t$ increases, both the density and the temperature in the central area decrease, and correspondingly, $M_0$ needs to be increased to capture the non-equilibrium effects. From $t = 0.12$ to $t = 0.15$, although the fluid has spread more widely, the outside layers are almost in the equilibrium states, and therefore the distribution of $M_0$ does not change significantly. Compared with the reference solution, the average CPU time per time step is reduced from $1473$ seconds to $123.7$ seconds using our method. \begin{figure}[!htb] \centering \hfill \subfloat[$t = 0. 04$]{\includegraphics[bb=18 21 584 500,width=0.33\textwidth,clip]{images/ex4_M0_t04.pdf}}\hfill \subfloat[$t = 0.08$]{\includegraphics[bb=18 21 584 500,width=0.33\textwidth,clip]{images/ex4_M0_t08.pdf}} \hfill \mbox{}\\ \hfill \subfloat[$t = 0.12$]{\includegraphics[bb=18 21 584 500,width=0.33\textwidth,clip]{images/ex4_M0_t12.pdf}}\hfill \subfloat[$t = 0.15$]{\includegraphics[bb=18 21 584 500,width=0.33\textwidth,clip]{images/ex4_M0_t15.pdf}} \hfill \mbox{} \caption{Distribution of $M_0$ for fluid diffusion at different times. } \label{fig:ex4_M0} \end{figure} \subsubsection{Lid-driven cavity flow} \label{sec:cavity_flow} Our second example assumes that the gas is in a square cavity $\Omega = [0,1] \times [0,1]$, and we scale the collision term such that the Knudsen number is $0.1$. The top lid of the cavity moves horizontally at a constant speed $v = 0.0208$, and all the four sides of $\Omega$ are assumed to be fully diffusive. Initially, the fluid is in the equilibrium state with density $\rho = 1$, velocity $\bu = \boldsymbol{0}$ and temperature $\theta = 1$. The friction between the lid and the gas causes the rotation of the fluid, and a steady state will be developed after a sufficiently long time. Such an example has been widely studied in the literature \cite{John2010, Liu2016}. Here we discretize the domain $\Omega$ with a uniform grid of size $100\times 100$. The parameters in \eqref{eq:truncated_series} are set to be $M = 40$, $\bar{\bu} = \boldsymbol{0}$ and $\bar{\theta} = 1$. The reference solution will again be provided by the uniform $M_0$ equal to $15$. To study the effect of adaptive parameters, we consider two groups of thresholds: $(\epsilon_1^1, \epsilon_2^1) = (0.05, 0.20)$ and $(\epsilon_1^2, \epsilon_2^2) = (0.025, 0.08)$. Clearly, the second set of parameters is tighter and will lead to larger $M_0$ in the simulations. The evolution of the fluid states is plotted in Figure \ref{fig:ex3_sol}, which includes the density $\rho$, the temperature $\theta$, and shear stress $\sigma_{12}$ at time $t =0.5, 1, 5$ and the steady state. One can observe the singular flow structure in the top two corners of the cavity, where the distributions are distorted due to the inconsistent boundary velocities. In Figure \ref{fig:ex3_sol}, three sets of solutions generally agree with each other. Some differences can be observed in the second column representing the temperature contours. Despite this, the relative difference in temperature between our results and the reference solution is well below $0.05\%$. In the first and third columns, all the three sets of contour lines almost coincide with each other, indicating the effectiveness of our error indicator. The distribution of $M_0$ is given in Figure \ref{fig:ex3_M0}. Since the flow is driven by the movement of the top lid, non-equilibrium emerges from the upper part of the domain, and then expands downward as $t$ increases. For the first set of parameters (left column), the value of $M_0$ reaches the cap $15$ only near the boundary of the domain, where the distribution function is discontinuous, while in the right column, more than a half of the grid cells are covered by the collision term with $M_0 = 15$, which is consistent with our prediction. \begin{figure}[!htb] \centering \subfloat[$\rho, t = 0.5$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/rho_t05.pdf}}\hfill \subfloat[$\theta, t = 0.5$ ]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/T_t05.pdf}}\hfill \subfloat[$\sigma_{12}, t = 0.5$ ]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/sigmaxy_t05.pdf}}\hfill \\ \subfloat[$\rho, t = 1$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/rho_t1.pdf}} \hfill \subfloat[$\theta, t = 1$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/T_t1.pdf}} \hfill \subfloat[$\sigma_{12}, t = 1$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/sigmaxy_t1.pdf}} \hfill \\ \subfloat[$\rho, t = 5$]{\includegraphics[bb=18 21 584 500,width=0.33\textwidth,clip]{images/rho_t5.pdf}} \hfill \subfloat[$\theta, t = 5$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/T_t5.pdf}} \hfill \subfloat[$\sigma_{12}, t = 5$]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/sigmaxy_t5.pdf}} \\ \subfloat[$\rho$, steady state]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/rho_t95.pdf}}\hfill \subfloat[$\theta$, steady state]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/T_t95.pdf}} \hfill \subfloat[$\sigma_{12}$, steady state]{\includegraphics[bb=18 21 584 500, width=0.33\textwidth,clip]{images/sigmaxy_t95.pdf}} \caption{Solution of the lid-driven cavity flow at different times. The white contours and the red contours are the numerical solutions with threshold parameters $(\epsilon_1^1, \epsilon_2^1)$ and $(\epsilon_1^2, \epsilon_2^2)$, respectively. The black contours are the reference solution.} \label{fig:ex3_sol} \end{figure} \begin{figure}[!htb] \centering \hfill \subfloat[$(\epsilon_1^1, \epsilon_2^1), t = 0.5$]{\includegraphics[bb=18 21 584 500,width=0.33\textwidth,clip]{images/M0_t05_1.pdf}}\hfill \subfloat[$(\epsilon_1^2, \epsilon_2^2), t = 0.5$]{\includegraphics[bb=18 21 584 500,width=0.33\textwidth,clip]{images/M0_t05_2.pdf}} \hfill \mbox{}\\ \hfill \subfloat[$(\epsilon_1^1, \epsilon_2^1), t = 1$]{\includegraphics[bb=18 21 584 500,width=0.33\textwidth,clip]{images/M0_t1_1.pdf}}\hfill \subfloat[$(\epsilon_1^2,\epsilon_2^2), t = 1$]{\includegraphics[bb=18 21 584 500,width=0.33\textwidth,clip]{images/M0_t1_2.pdf}} \hfill \mbox{} \\ \hfill \subfloat[$(\epsilon_1^1, \epsilon_2^1), t = 5$]{\includegraphics[bb=18 21 584 500,width=0.33\textwidth,clip]{images/M0_t5_1.pdf}}\hfill \subfloat[$(\epsilon_1^2,\epsilon_2^2), t = 5$]{\includegraphics[bb=18 21 584 500,width=0.33\textwidth,clip]{images/M0_t5_2.pdf}} \hfill \mbox{}\\ \hfill \subfloat[$(\epsilon_1^1, \epsilon_2^1)$, steady state]{\includegraphics[bb=18 21 584 500,width=0.33\textwidth,clip]{images/M0_t95_1.pdf}}\hfill \subfloat[$(\epsilon_1^2,\epsilon_2^2)$, steady state]{\includegraphics[bb=18 21 584 500,width=0.33\textwidth,clip]{images/M0_t95_2.pdf}} \hfill \mbox{} \caption{The distribution of $M_0$ for the lid-driven cavity flow at different times. } \label{fig:ex3_M0} \end{figure} \subsection{Discussion on the choice of parameters} In the previous numerical examples, one can observe that the choice of the thresholds $\epsilon_1$ and $\epsilon_2$ appears to be quite problem-dependent. This is mainly due to the different requirements of the numerical accuracy in different problems. Generally speaking, for flows with larger fluctuations such as Section \ref{sec:diffusion}, we tend to choose a larger pair of parameters since the small error is less noticeable, while for the lid-driven cavity flow in Section \ref{sec:cavity_flow}, the parameters are chosen smaller since the contour lines are more sensitive to the numerical error. In practice, when the flow structure is complicated, the flows in different areas may have different features, which may require different thresholds to obtain proper relative errors. To achieve this, a straightforward method is to add the spatial variable $x$ to both thresholds. Then the method in Section \ref{sec:adaptive} can still be applied to determine $\epsilon_1(x)$ and $\epsilon_2(x)$. Further study of this approach will be considered in our future work.
\section{Introduction} 1D aperiodic crystals are similar to ordinary crystals by virtue of being translationally symmetric in two independent directions yet differ by being aperiodic in the third. Consequently, they cannot be described by just an underlying unit cell and lattice, suggesting the need to go beyond the usual language and formalism of crystallography to describe them. The contemporary description of these crystals begins with a paper by \citeasnoun{hendricks1942x}, proposing that the aperiodic direction is composed of a sequence of layers where the probability of a layer being a certain type depends on some finite number of near neighbour layers. \citeasnoun{jagodzinski} later assumed this dependence was caused by an interatomic interaction with constant range he called \emph{reichweite}, which he denoted with the integer $s$ if and only if a layer's type depends on $s$ preceding layers. This sequence of layers was described by \citeasnoun{MarkovCrystal} as a sequence of random variables where a given variable depends on only finitely many preceding variables; which the authors recognised as a Markov chain of order $s$. They successfully analysed this description of aperiodic crystals by partitioning the layer chain into blocks comprising $s$ adjacent layers and noting each block depends only on the immediately preceding block, hence reducing the chain to first order. The approach taken by \citeasnoun{MarkovCrystal} has been used practically by \citeasnoun{cherepanova2004simulation} to model graphite like materials as Markov chains, allowing them to study their X-Ray diffraction pattern. \citeasnoun{hostettler2002structure} expressed the average structure factor of the aperiodic \emph{orange crystal} HgI$_{2}$ using the same principle, hence could study the crystal's diffraction pattern. The probability of a particular layer being a certain type depending on some nearest neighbour interaction is strongly analogous to the axial next nearest neighbour Ising (ANNNI) model, as noticed by \citeasnoun{christy1989short} and \citeasnoun{shaw1990nature}. \citeasnoun{christy1989short} went further and used the ANNNI model to compare the suite of polytypes generated for sapphirine and wollastonite each with \emph{reichweite} equal to 4. An overview of aperiodic crystal theory is provided by \citeasnoun{estevez2007powder} and the elementary treatment of Markov theory to describe 1D aperiodicity is presented by \citeasnoun{welberry2004diffuse}. In addition to simple crystal structures, aperiodic polytypes have been studied by \citeasnoun{varn2004finite} who simulated transforms between ordered and disordered polytypes, specifically the solid state transformation of annealed ZnS crystals from a 2H to a 3C. Furthermore, \citeasnoun{varn2013machine} and \citeasnoun{varn2004finite} have made significant progress relating the statistics of stacking faults distributed throughout a general aperiodic crystal to the crystal's scattering pattern using the tools of information theory. The authors cast the problem of finding the simplest possible process that could give rise to an aperiodic crystal exhibiting the observed scattering pattern as defining the crystal's $\varepsilon$-machine, which may be represented as a directed graph or a hidden Markov model (HMM). The HMM describes a Markov process with states hidden from the observer, but each emitting an observable (in this context a layer type) following some probability distribution depending on the state. The resultant sequence of observables (layer types) may not be a Markov chain of any order, and in this case would describe an aperiodic crystal with infinite $reichweite$. However, all Markov chains of finite order can be described by some HMM, so the formulation of an aperiodic crystal as a HMM generalises the Markov theoretic description of aperiodic crystals. This work on creating an information theoretic description of aperiodic crystals has culminated in the new field of \emph{chaotic crystallography} summarised elegantly by \citeasnoun{Varn201547}, who invite the reader to view the work on aperiodic crystals as the foundations of a new generalised crystallography, encompassing the study of disordered materials as well the as translationally symmetric and ordered structures studied by so-called \emph{classical crystallography}. Our present paper builds upon chaotic crystallography by first reviewing the description of 1D aperiodic crystals that encompasses both periodic and aperiodic polytypes. Under this description we generalise the notion of a topologically centrosymmetric crystal having an underlying centrosymmetric unit cell to a reversible aperiodic crystal having an underlying reversible Markov chain. By extending the notion of acentricity to aperiodic crystals, it may be possible to explain the physical properties of aperiodic crystals in formal analogy to the properties of acentric periodic crystals. Examples include the piezoelectric effect exhibited by acentric crystals which may have an analogous effect exhibited by aperiodic crystals with an underlying irreversible Markov chain. This paper also adds to the chaotic crystallographer's mathematical toolbox. We use the matrix formulation of Markov theory to build on the work of \citeasnoun{jagodzinski1954symmetrieeinfluss} to construct new analytic expressions for the differential scattering cross section of 1D aperiodic crystals with finite \emph{reichweite} $s$. Several similar derivations do of course exist, including that of \citeasnoun{kakinoki1954intensity} who reached a different expression, that is mathematically interesting but more cumbersome than ours. There is also the expression for the average structure factor product of a single layer derived by \citeasnoun{Allegra}, which is superseded by our expression for the entire scattering cross section. More recently \citeasnoun{riechers2015pairwise} produced a deep theoretical paper relating the scattering pattern of a close-packed structure to its underlying $\varepsilon$-machine, in doing so, produced the most general possible expression for the scattering cross section of a close-packed structure. However, their expression was derived by exploiting a feature of the close-packed structure that does not apply to all aperiodic crystals, namely that the layer types are translations of one another in real space. This assumption is very powerful, as the authors demonstrate by deriving closed form expressions for the diffraction pattern of crystals with independent and identically distributed layers, crystals exhibiting random growth and stacking faults, and crystals exhibiting Shockley-Frank stacking faults. However, the assumption that a crystal's constituent layers differ only by a translation in real space does not hold for the aperiodic ice described by \citeasnoun{Hansen2008}, nor does it hold for aperiodic opal, composed of a disordered sequence of cristobalite and tridymite layers. Motivated by aperiodic ice and opal, we have derived a general expression for the cross section for an aperiodic crystal with finite $s$ that does not assume different layer types have translational symmetry. Since we are interested in finite $s$, we need only consider Markov theory without worrying about the theory of HMMs. However, for completeness, we do include a derivation in Appendix \ref{HMM_CS} of the cross section of the general aperiodic crystal described by a HMM without the assumption of translationally symmetric layer types. The computational cost of evaluating our cross section is compared to the cross section developed by \citeasnoun{hendricks1942x} and \citeasnoun{warren1959x} then implemented by \citeasnoun{treacy1991general} in the software package DIFFaX. We argue that our expression is computationally efficient, and could be used to significantly improve several modern uses of \citeasnoun{Rietveld}'s scheme to refine theoretical cross sections of real aperiodic crystals like ice or opal. Examples include \citeasnoun{kuhs2012extent}, \citeasnoun{PhysRevB.34.3586} and \citeasnoun{Hansen2008} who needlessly employed a Monte Carlo simulation to estimate the scattering cross section of ice which could have been estimated more accurately at a much greater speed using our expression for the cross section. \section{Forging the Markov chain} \label{Forge} We begin by representing a 1D aperiodic crystal as a sequence of layers, each of a finite set of distinct layer types. The probability that a layer is a particular type is assumed to depend on the type of each of finitely many consecutive preceding layers. The number of interacting preceding layers is denoted $s$ and called \emph{reichweite} as coined by \citeasnoun{jagodzinski}. Following the method employed by \citeasnoun{MarkovCrystal}, the crystal is partitioned into blocks each comprising $s$ consecutive layers - then the set of distinct blocks is indexed with the set $B$. Blocks go by different names in different papers, including \emph{structural motifs} in the work of \citeasnoun{michels2013analyzing}, but we will continue to refer to them as \emph{blocks}. We notice that a block's type depends only on the block immediately preceding it, revealing that a complete sequence of blocks is generated by a first order Markov process. For those interested in forming an analogy with the ANNNI model, consider a nearest neighbour Ising chain with $m$ discrete spin states, rather than just 2 states; up and down. The spin state at each site is analogous to the block type of a particular set of $s$ consecutive layers, hence $m$ is equal to the number of distinct block types $|B|$. The $m$ state ANNNI model is usually analysed using the \emph{transfer matrix} method \cite{baxter2007exactly}, which is essentially what we proceed with here. Making use of the probabilist's lexicon, we define the \emph{transition matrix} (another name for the transfer matrix) $\boldsymbol{\Xi}$ with elements $\xi_{ij}$ representing the probability that a block is type $j \in B$ given its predecessor is type $i \in B$. Next, elementary results of Markov theory reveal that the probability of a block being type $j$ given that the $\nu$th preceding block is type $i$ is the $ij$th element of the matrix $\boldsymbol{\Xi}^{\nu}$; the transition matrix raised to the power $\nu$. We now seek to compute the probability $\pi_{i}$ that a block sampled from an aperiodic crystal is type $i$. Here, to \emph{sample a crystal} is to randomly, and with equi-probability, select a position from an infinite crystal and observe which type of block is at that position. By assumption, the probability of sampling a $j$ block is related to the probability of the previous block being type $i$, which gives rise to the self-consistency condition \begin{equation} \pi_{j} = \sum_{i \in B} \pi_{i}\xi_{ij} \end{equation} which may be expressed in matrix notation \begin{equation} \boldsymbol{\pi} \boldsymbol{\Xi}= \boldsymbol{\pi} \end{equation} where $\pi_{i}$ are elements of the so-called stationary distribution vector $\boldsymbol{\pi}$, a left eigenvector of the transition matrix $\boldsymbol{\Xi}$ with corresponding eigenvalue $1$. The row vector $\boldsymbol{\pi}$ contains the elements of a probability distribution, so satisfies the normalisation condition \begin{equation} \sum_{i \in B}\pi_{i} = 1. \end{equation} \subsection{Analysis of the block chain} \subsection{Block pair-correlation function} \label{MatrixVectMult} The pair-correlation function $G_{ij}(\nu)$ with $ij \in B$ is defined as the probability that a layer block sampled from a crystal is type $i$ and the block $\nu$ blocks ahead is type $j$. We observe that $G_{ij}(\nu)$ are the components of the matrix \begin{equation} \boldsymbol{G}(\nu) = \Diag(\boldsymbol{\pi})\boldsymbol{\Xi}^{\nu} \label{pipixi} \end{equation} where $\Diag(\boldsymbol{\pi})$ is the diagonal matrix with diagonal entries the components of the vector $\boldsymbol{\pi}$. \subsubsection{Convergence to a stationary distribution} \label{Convergence} We shall analyse $\boldsymbol{G}(\nu)$ as a sequence in $\nu$ under the technical conditions that the transition matrix $\boldsymbol{\Xi}$ generates a chain that is \emph{positive recurrent}, \emph{irreducible} and \emph{aperiodic}; this allows us to build a description of aperiodic crystals which can be later extended to polytypes. We justify these three conditions by assuming an aperiodic crystal has three respective physical properties. The first, is that after observing that a block is type $i$, the mean number of blocks after which another is type $i$ is finite. The second, is that after observing that a block is type $i$ there will certainly be a block of type $j$ somewhere ahead of the block $i$. Thirdly, all block types have \emph{period} $k = 1$, where the period $k$ is defined \begin{equation} k = \gcd\{ \nu > 0 : (\boldsymbol{\Xi}^{\nu})_{ii} > 0 \} \end{equation} where $\gcd$ stands for greatest common divisor. It suffices to assume any block type has non-zero probability of following any other to satisfy all three condition. For a chain that is positive recurrent, irreducible and aperiodic, each row of the matrix $\boldsymbol{G}(\nu)$ converges as $\nu \to \infty$ with exponential order to the same unique steady state row vector $\boldsymbol{\pi}$; specifically the convergence is $\mathcal{O}(\abs{\lambda_{2}}^{\nu})$ where $\lambda_{2}$ is the second largest eigenvalue of the transition matrix $\boldsymbol{\Xi}$. Proof is included in many books on Markov theory like \citeasnoun{MarkovChains}. This result is useful because it allows a crystallographer to estimate how distant a pair of blocks must be before it becomes reasonable to approximate their separation as infinite, and therefore assume their types are uncorrelated. There is however some subtlety to this, which is covered in more detail by \citeasnoun{riechers2015pairwise}. \subsubsection{Entropic density of aperiodic crystals} \citeasnoun{MarkovCrystal} observed that 1D aperiodic crystals can be represented by a finite order Markov chain, a special type of an $\varepsilon$-machine considered by \citeasnoun{Varn201547} in their discussion of chaotic crystallography. The entropic density $h$ discussed by Varn \& Crutchfield can be expressed in terms of the matrix formalism so far developed \begin{equation} h = -\sum_{ij} \pi_{i}\xi_{ij}\log(\xi_{ij}) \end{equation} for ease of computation in practical scenarios. The entropy rate can be informally thought of as measuring an aperiodic crystal's \emph{disorder per unit length} in the aperiodic direction, maximising at $h = \log(|B|)$ when any block could follow its predecessor with equi-probability, and minimising at $h = 0$ in the limit as the crystal becomes perfectly periodic. $h$ can be computed in the same way for ensembles that are usually thought of as periodic crystals with stack defects, and provides a measure of how much order there is to the distribution of stack defects. For example, a crystal comprising stack defects that tend to be nearly equally spaced will have a lower entropy rate than one with the same frequency of stack defects distributed with equi-probability throughout the crystal. One might expect from thermodynamic considerations that the entropic density will increase with increasing temperature. \subsubsection{Aperiodic crystals generalise polytypes} \citeasnoun{varn2013machine} and \citeasnoun{riechers2015pairwise} have remarked that a polytype comprising a periodic array of unit cells is in fact a special case of an aperiodic crystal. In the formalism used here, a Markov chain with transition matrix $\boldsymbol{\Xi}$ underlies a polytype if and only if its state space can be reduced to a closed communicating class $\mathcal{C}$ with the additional property that $\xi_{ij} \in \{0, 1\} \ \forall ij \in \mathcal{C}$. Less formally, any Markov chain that eventually underlies a sequence of blocks, where the probability of some block following the next is either unity or zero is a polytype. Now, recall that 1D aperiodic crystals are described by \emph{positive recurrent}, \emph{irreducible} and \emph{aperiodic} chains and note that this cannot be said of the chains that underlie polytypes. However, we can reduce a polytype's underlying chain to the closed communicating class $\mathcal{C}$ which is both \emph{positive recurrent} and \emph{irreducible} forming sufficient conditions for the stationary state vector $\boldsymbol{\pi}$ to exist \cite{MarkovChains}. Conveniently, a Markov chain underlying a polytype differs from that underlying an aperiodic crystal by reducing to a chain that is \emph{periodic}. \subsection{An Analytic expression for differential scattering cross section of 1D aperiodic crystals} Neutron and X-ray diffraction experiments can measure a 1D aperiodic crystal's differential scattering cross section, which we seek to express as concisely as possible. We begin by noting that a 1D aperiodic crystal possesses long range order across the basel plane spanned by two primitive lattice vectors $\vec{a}$ and $\vec{b}$ and is aperiodic along the direction plane's normal $\vec{c}$. We let $N_{a}$ and $N_{b}$ denote the number of unit cells across the respective lattice vectors spanning the basal plane, and note that the crystal's cross sectional area is therefore $N_{a} \times N_{b}$. Our notation has been standard so far - but we now break convention and let $N_{c}$ denote the number of blocks (rather than unit cells) stacked in the $\vec{c}$ direction, which together comprise the entire crystal (We should note here that our crystals are now cuboids). Returning to convention, we denote positions in reciprocal space by \begin{equation} \vec{Q} = 2\pi(h\vec{a}^* + k\vec{b}^* + l\vec{c}^*) \end{equation} where $\vec{a}^*$, $\vec{b}^*$ and $\vec{c}^*$ are primitive lattice vectors and $h,k,l$ are real numbers. For a macroscopic crystal where $N_{a}$ and $N_{b}$ are large we have an expression for the differential cross section developed by \citeasnoun{PhysRevB.34.3586} \begin{align} &\frac{d\sigma(\vec{Q})}{d\Omega} = \frac{\sin^2(N_a\pi h)}{\sin^2(\pi h)}\frac{\sin^2(N_b\pi k)}{\sin^2(\pi k)} \times \label{BerlinerExpression} \\ &\sum^{N_{c}}_{m_{3} = -N_{c}}(N_{c} - \abs{m_{3}})Y_{m_3}(\vec{Q})e^{2 \pi i m_{3} l}. \nonumber \end{align} Here, $Y_{m_{3}}(\vec{Q})$ is the average structure factor product which has expression \begin{align} Y_{m_{3}}(\vec{Q}) = \sum_{i \in B }\sum_{j \in B}G_{ij}(m_{3})F_{i}(\vec{Q})F^{*}_{j}(\vec{Q}) \label{SFExpression} \end{align} where $G_{ij}(m_{3})$ is exactly the pair-correlation discussed in section \ref{MatrixVectMult}; the probability of finding a layer block of type $j$ separated by a distance $m_{3}c$ from a block of type $i$. Finally, $F_{i}$ is the structure factor of a type $i$ block, $F_{i}^{*}$ is its complex conjugate, and $h_{0}$, $k_{0}$ are nodal lines. Berliner and Werner's expression \eqref{BerlinerExpression} was derived using the works of \citeasnoun{wilson1942imperfections}, \citeasnoun{hendricks1942x} and \citeasnoun{jagodzinski}. Further, \eqref{BerlinerExpression} has been used practically to study the cross section of computer generated statistically faulted crystals by \citeasnoun{PhysRevB.34.3586} themselves in an effort to analyse stacking-faults in the 9R lattice and compare the results of simulation to those measured for Li at 20K. More recently, in a pair of papers by \citeasnoun{Hansen2008} \& (2008$b$), equation \eqref{BerlinerExpression} was used to compute the differential scattering cross section of stack-faulted cubic ice. Since \eqref{BerlinerExpression} is widely used in simulations, it would be useful to use the matrix formalism of Markov theory to derive an equivalent analytic expression that can be efficiently evaluated by a computer. Starting from equations \eqref{BerlinerExpression} and \eqref{SFExpression} then building on work by \citeasnoun{jagodzinski1954symmetrieeinfluss} it can be shown \begin{align} \frac{d\sigma}{d\Omega} =&\frac{\sin^2(N_a\pi h)}{\sin^2(\pi h)}\frac{\sin^2(N_b\pi k)}{\sin^2(\pi k)} Re\bigg\{ \Tr\big( \boldsymbol{\hat{P}}(2\boldsymbol{\hat{S}} + N_c\boldsymbol{I})\boldsymbol{\hat{F}} \big)\bigg\} \label{MNDSCS} \end{align} where the terms are defined as follows. First, let $\boldsymbol{Q}$ be the invertible square matrix transforming $\boldsymbol{\Xi}$ into its Jordan Normal form $\boldsymbol{\hat{\Xi}}$ like so \begin{equation} \boldsymbol{\Xi} = \boldsymbol{Q}^{-1}\boldsymbol{\hat{\Xi}}\boldsymbol{Q} \end{equation} allowing us to define \begin{equation} \boldsymbol{\hat{P}} = \boldsymbol{Q}^{-1}\Diag(\boldsymbol{\pi})\boldsymbol{Q} \end{equation} for $\Diag(\boldsymbol{\pi})$ the diagonal matrix with entries the components of the stationary distribution vector $\boldsymbol{\pi}$. Next, we call $\boldsymbol{F}$ the structure matrix with elements $F_{ij} = F_{i}F^{*}_{j}$ where $F_{i}$ and $F_{i}^{*}$ are the structure factor and conjugate structure factor of an $i$ block respectively. We then let \begin{equation} \boldsymbol{\hat{F}} = \boldsymbol{Q}^{-1}\boldsymbol{F}\boldsymbol{Q} \end{equation} and note that $\Tr$ denotes the trace. Finally, if $\boldsymbol{\Xi}$ is diagonalisable then $\boldsymbol{\hat{S}}$ is a diagonal matrix with entries \begin{align} s_{n} = \begin{cases} \frac{N_c}{2}(N_c - 1) \text{ if $\lambda_n e^{2 \pi i l} = 1$ } \\ \frac{\lambda_n e^{2 \pi i l} ( \lambda_n^{N_c} e^{2 \pi i l N_c} + N_c(1 - \lambda_n e^{2 \pi i l} ) - 1)}{(1 - \lambda_n e^{2 \pi i l})^2} \text{ otherwise,} \end{cases} \label{Sn} \end{align} where $\lambda_{n}$ are the eigenvalues shared by the transition matrix $\boldsymbol{\Xi}$ and its diagonal representation $\boldsymbol{\hat{\Xi}}$. On the other hand, if $\boldsymbol{\Xi}$ is not diagonalisable (defective), then $\boldsymbol{\hat{S}}$ is an upper triangular matrix with a more complicated expression. See Appendix \ref{CrossSectionDerivation} for a derivation of equation \eqref{MNDSCS}, where the unlikely and somewhat pathological case of a defective transition matrix $\boldsymbol{\Xi}$ is also covered. By \emph{unlikely}, we mean that almost all transition matrices are diagonalisable, in the measure theoretic sense that almost all real numbers between $0$ and $1$ are not equal to $\frac{1}{2}$. The reason we bother with the defective case at all is to ensure that an optimisation algorithm seeking to find the set of transition probabilites that best fits experimental data would not `break' if the algorithm were to try to evaluate the cross section using a near defective transition matrix; where we informally define a near defective matrix as one for which the process of diagonalisation is numerically unstable. With equation \eqref{MNDSCS} now defined, we use \citeasnoun{PhysRevB.34.3586}'s observation that the cross section of a macroscopic crystal can be well approximated by taking the limit as $N_a$ and $N_b$ tend to infinity, revealing \begin{align} \frac{d\sigma}{d\Omega} = &N_{a}N_{b} \delta(h - h_{0})\delta(k - k_{0})Re\bigg\{ \Tr\big( \boldsymbol{\hat{P}}(2\boldsymbol{\hat{S}} + N_c\boldsymbol{I})\boldsymbol{\hat{F}} \big)\bigg\} \end{align} We note for experimentalists here that taking a powder average of equation \eqref{MNDSCS} can be problematic near $2\theta = 0$ or $2\theta = \pi$ (measured during backscattering experiments) where broadened Bragg spots cut the \emph{Ewald shell} almost tangentially and are therefore in significant need of a Lorentz correction. On the other hand, the Lorentz correction hardly varies at angles well away form $2\theta = 0$ or $2\theta = \pi$ allowing one to easily bring expression \eqref{MNDSCS} to bear on powder averaged samples for many values of $\theta$. This expression allows the differential scattering cross section to be computed much more efficiently than a popular method employed by \citeasnoun{PhysRevB.34.3586} to investigate Lithium at 20K, as well as by \citeasnoun{Hansen2008} and by \citeasnoun{kuhs2012extent} to study so-called cubic ice. The popular method estimates the pair-correlation functions $G_{ij}(m_{3})$, which form part of the Berliner and Werner's expression for the average structure factor product \eqref{SFExpression} and scattering cross section \eqref{BerlinerExpression}. This section compares this method's performance to evaluating expression \eqref{MNDSCS} directly. The popular method begins by sampling block of layers from the crystal. Then a randomly selected layer is fixed atop the seed with probability dependant on preceding $s$ layers, which are initially the set of layers composing the seed. The algorithm continues to grow the crystal by iteratively affixing a new layer atop the last with layer determined by the previous $s$ layers; this process continues until the crystallite size is of the order of the coherently scattering domain. The estimate for the pair-correlation $G_{ij}(m_{3})$ is taken by simply counting up the number of times a layer of of type $j$ is found $m_{3}$ layers ahead of one of type $i$, then dividing by the total number of trials. Since the estimate is reached by sampling a phase space (the set of possible layer sequences) then taking an average to estimate a thermodynamic variable (probability of pair occurrence), this method is a Monte Carlo (MC) simulation. \subsection{Monte Carlo vs Markov chain} The traditional MC algorithm estimates the pair-correlation functions with an uncertainty converging toward $0$ as the number of crystals grown, hence samples taken, tends to infinity. The convergence is asymptotically proportional to the reciprocal square root of the number of samples taken. In big $\mathcal{O}$ notation, the convergence is $\mathcal{O}(N^{-1/2})$ where $N$ is the number of samples \cite{SimTech}. Consequently high accuracy comes at a heavy computational cost, specifically every additional correct decimal point appended to the estimate for the pair-correlation function requires that $100$ times more samples be taken, requiring that the simulation be run for $100$ times longer. Having obtained an estimate for the pair-correlation function, the MC algorithm can compute the scattering cross section at each value of $l$ in $\mathcal{O}(|B|)$ time, where $|B|$ is the number of distinct layer blocks. On the other hand, the time taken to evaluate equation \eqref{MNDSCS} for many values of $l$ does not depend on the size of the crystal $N$, instead we compute \eqref{MNDSCS} in $\mathcal{O}(|B|^3)$ for each value of $l$. Further, since we express \eqref{MNDSCS} exactly, it can be evaluated by a computer as precisely as compounded rounding errors on floating point arithmetic allow. This is deceptively useful because the Levenberg-\citeasnoun{LM}, or similar, algorithm employed by Rietveld's refinement scheme \cite{Rietveld} requires that the sum of square residuals be differentiated with respect to each free parameter and evaluated at every data point for each iteration. The square residual sum is expressed in terms of the cross section, hence Rietveld's method demands that the cross section be differentiated with respect each free parameter including the transition probabilities. Now, it is shown in Appendix \ref{dixB} that analytic derivatives with respect to parameters of the structure factor do exist for \eqref{MNDSCS}, but neither the Monte Carlo algorithm nor \eqref{MNDSCS} easily yield analytic derivatives with respect to the transition probabilities. Consequently, these derivatives must be evaluated numerically using a finite difference. The finite difference approximation evaluates a function at two (or more) points, separated by a small, but finite, length then uses the values to estimate the derivative at a nearby point. Crucially, the approximation is better as the separation between points gets smaller, tending to the exact derivative as the separation tends to $0$. Consequently, computing the cross section to a high precision permits a smaller finite difference, producing a better approximated matrix of derivatives, resulting in a much better behaved descent algorithm. \subsection{Comparison to the recursion method used by DIFFaX} \citeasnoun{treacy1991general} have written a user friendly and flexible program in FORTRAN computing the X-ray/neutron scattering pattern of stack faulted crystal structures. The program: Diffracted intensities from faulted Xtals (DIFFaX), computes a crystal's differential scattering cross section using an equation that is fundamentally the same as that developed by \citeasnoun{hendricks1942x}, \citeasnoun{warren1959x}, and us in this paper. However, their derivation and heuristic is somewhat different. Roughly speaking, \citeasnoun{treacy1991general} consider that the scattering pattern for a crystal is equal to the pattern of the same crystal shifted upward by one layer superposed with the pattern produced by a single layer placed under the shifted crystal. By relating the scattering pattern to itself recursively, a set of simultaneous equations can set up and solved to yield the scattering pattern of a stack faulted or aperiodic crystal. Solving this set of simultaneous equations has computational complexity $|B|^3$, as does evaluating \eqref{MNDSCS}. However, the time taken to evaluate the exponential function is the most time intensive process if the number of block types $|B|$ is small, which is true for low interaction range and low number of layer types. Though the original DIFFaX does not support a least squares refinement of free parameters, the work in progress DIFFaX+ being developed by \citeasnoun{DIFFaXplus} does support Rietveld refinement. \section{Close-packed structures} \subsection{Topology of the close-packed structure} \label{Topology} The topologically close-packed aperiodic crystal is ubiquitous in nature and has some interesting mathematical features. First of all, the atomic coordination of a close-packed structure is determined by assuming a crystal layers' constituent atoms are equally sized hard spheres that are physically stacked between other layers. The layers (so-called \emph{modular layers}) are constrained by the structure's geometry to 1 of 3 distinct equilibrium positions labelled $A$, $B$ and $C$ such that adjacent layers cannot have the same relative position. $A$ cannot follow $A$, $B$ cannot follow $B$, nor can $C$ follow $C$. We denote a sequence of layers by printing the positions $A$, $B$ and $C$ and the order these appear in the crystal, exemplified in figure \ref{layerSeq}. \begin{figure} \begin{align} ...ABCABCBACBA... \nonumber \end{align} \caption{A subset of a layer sequence.} \label{layerSeq} \end{figure} It can be seen from figure \ref{diagramOfSpheres} that if a layer is flanked by layers of the same type, the resultant lattice is hexagonal. If it is flanked by layers of different types, the resultant lattice is cubic. We label hexagonally stacked layers $H$ and cubic ones $K$ in accordance with Wyckoff-Jagodzinski notation, then notice all layer sequences have unique representation as a stack sequence. Under this representation, the layer sequence in figure \ref{layerSeq} has a unique stack sequence illustrated and explained in figure \ref{stackSeq}. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{Close_pack_spheres.PNG} \caption{Stacking sequences of close-packed layers of atoms. A-first layer (with outlines of atoms shown); B-second layer; C-third layer. Reproduced from \citeasnoun {FundOfCryst} with permission of the International Union of Crystallography. More images and a short overview of the close-packed structure is provided by \citeasnoun{Closepackedshazzam}.} \label{diagramOfSpheres} \end{figure} We recall that for a 1D aperiodic crystal, a given layers' type depends on finitely many consecutive preceding layers $s$. For a close-packed 1D aperiodic crystal, we observe that the stack type of a layer depends on the stack type of $s-2$ consecutive preceding stacks. For example a stack sequence with \emph{reichweite} $s$ equal to 4 can be characterised by the transition probabilities $\alpha$, $\beta$, $\gamma$ and $\delta$ that a $K$ stack follows an $HH$, $HK$, $KH$ and $KK$ pair of stacks respectively. \begin{figure} \begin{align} ...KKKKHKKKK... \nonumber \end{align} \caption{All layers are flanked by layers of different type, hence they are cubic, except for the layer $C$ at the centre of the subsequence $...BCB...$ which is hexagonal.} \label{stackSeq} \end{figure} The Markov process generating the stack sequence is intimately related to that producing the layer sequence. After all, the labels $A$, $B$ and $C$ are deployed arbitrarily to represent a sequence that can be equally well represented in Wyckoff-Jagodzinski $HK$ notation. In order to formally relate these equivalent representations, we first declare that two layer sequences $l_{1}$ and $l_{2}$ belong to the same equivalence class $l_{1} \sim l_{2}$ if and only if there exists a permutation on the set of layer types $\phi$ such that $l_{1} = \phi \circ l_{2}$. We note that all layer sequences belonging to the same class have the same stack sequence representation, consequently, the sequences belonging to the same equivalence class are described by the same set of transition probabilities; hence they are represented by the same Markov chain. Figure \ref{membersOfClass} displays a stack sequence on its right hand side with members of the corresponding layer sequence equivalence class on its left. We let the crystal's stack block Markov chain have transition matrix $\boldsymbol{X}$ and stationary state vector $\boldsymbol{p}$. \begin{figure} \begin{align} &...ABCABCABCABC... \nonumber \\ &...ACBACBACBACB... \nonumber \\ &...BACBACBACBAC... \nonumber \\ &...BCABCABCABCA... \nonumber \\ &...CABCABCABCAB... \nonumber \\ &...CBACBACBACBA... \nonumber \end{align} \caption{These six layer sequences belong to the same equivalence class because there is a permutation on the set of layer types that will map any one of the sequences to any other. For example, the permutation $\phi_{1} \colon \{A,B,C\} \to \{A,B,C\}$ defined $\phi_{1}(A) = A, \phi_{1}(B) = C, \phi_{1}(C) = B$ is employed to map the first sequence in the list to the second. This equivalence class comprises all layer sequences with perfectly cubic stack sequence $KKKKKKKKKK$.} \label{membersOfClass} \end{figure} Spherically close-packed structures are not the only structures that can be described in $ABC$ or $HK$ notation. For example, 1D aperiodic ice crystals are open-packed, but placing hypothetical spheres with appropriate radii at the midpoint of each of an ice crystal's hydrogen bonds results in an ensemble of spheres that is close-packed. Hence, we say that cubic ice is topologically close-packed and describe it using the same $ABC$ or $HK$ notation as real close-packed structures. Similarly, silicon carbide layers are composed of tetrahedra arranged with spherical close-pack topology, as can be seen in figure \ref{tets}. Informally, any aperiodic 1D crystal that can be described in $ABC$ or $HK$ notation has the same spherical close-pack topology. \begin{figure} \includegraphics[width=0.5\textwidth]{Tets.png} \caption{Here the labels $1,2,3$ replace $A,B,C$. Notice the arrangement of tetrahedra is the same as the arrangement of spheres dipslayed in figure \ref{diagramOfSpheres}. Reproduced from an educational paper by \citeasnoun{ortiz2013prolific} on the prolific polytypism of silicon carbide, with permission of the International Union of Crystallography.} \label{tets} \end{figure} \subsection{The cross section of aperiodic ice} The simplest close-packed structure is a crystal composed of three layer types $A$, $B$, an $C$ that are identical up to some translation in real space, so their structure factors are equal up to some rotation in reciprocal space, as observed by \citeasnoun{PhysRevB.53.5198}. This structure has been studied extensively by many authors including \citeasnoun{PhysRevB.34.3586}, \citeasnoun{PhysRevB.53.5198}, and \citeasnoun{riechers2014diffraction}, but is insufficient to describe the aperiodic ice studied by \citeasnoun{Hansen2008} and \citeasnoun{hansen2015approximations}. In fact, Hansen \emph{et al.} explain that the content of an ice layer depends on that of its neighbours; so are forced to consider the existence of $6$ distinct layers $AB$, $AC$, $BA$, $BC$, $CA$, and $CB$ each with their own structure factor. These layers are obtained by considering a pair of layers $A$ and $B$ for example, then shifting the borders of the layer $A$ in the aperiodic direction by half a unit cell, obtaining a layer containing half the $A$ layer and half the $B$ layer; then labelling this layer $AB$. This is illustrated in figure \ref{ice_layers_fig}. \begin{figure} \begin{align} ... \overunderbraces{&\br{2}{AB} { \ B \ \ C \ \ & A \ & \ B \ & \ C \ & \ A \ \ B \ {&&\br{2}{BC}} \nonumber ... \caption{New layer types from old} \end{align} \label{ice_layers_fig} \end{figure} \citeasnoun{Hansen2008} provide complete molecular details including the structure factor of each of the 6 layer types, including the important observation that the layers are not simply identical up to translation. The authors further assume that a layer depends on some finite number $s$ of previous layers, allowing ice to be described as an aperiodic crystal built from a sequence of layer blocks each with length $s$. Under the conditions that $A$ cannot follow $A$, $B$ cannot follow $B$ nor can $C$ follow $C$, ice comprises $|B| = 3 \times 2^s$ distinct block types. The cross section of ice is therefore given by equation \eqref{MNDSCS}, which is in terms of an appropriate transition matrix $\boldsymbol{\Xi}$ and structure matrix $\boldsymbol{F}$. The remainder of this section describes how one might construct these matrices, though before we begin, we note that for low $s$ the resulting matrices are small, and it may be possible to cleverly construct the transition matrix using methods similar to those deployed by \citeasnoun{riechers2015pairwise} to produce analytic expressions for the eigenvalues and cross section. First of all, we need to define what is meant by \emph{a block of type $i$} when discussing ice. To do this, we index the set of block types with a subset of the integers $\{ 1, \ 2, \ ... \ , 3 \times 2^s \} \ni i$ using the following scheme. First, find the quotient $q$ and remainder $r$ upon dividing $i-1$ by $6$. i.e write $i-1 = 6q + r$. The remainder is either $0, 1, 2, 3, 4,$ or $5$; so for each of these numbers respectively, set the first layer in the block as $AB, AC, BA, BC, CA,$ or $CB$. Now express the quotient in binary, producing a sequence of $s-1$ digits that are either $1$ or $0$. Let $X,Y,Z \in \{ A , B , C \}$ and observe that if the $n$th layer of the block is the layer $XY$, then either it is the last layer of the block, or the next layer is $YZ$ for $Z$ taking one of $2$ values (since $Z \neq Y$). If the $n$th digit of the binary representation of $q$ is $0$ then choose $Z$ depending on $Y$ as follows. If $Y = A$, set $Z = B$, if $Y = B$, set $Z = C$, and if $Y = C$, set $Z = A$. On the other hand if the $n$th digit of the binary representation of $q$ is $1$, then if $Y = A$, set $Z = C$, if $Y = B$, set $Z = A$, and if $Y = C$, set $Z = B$. This procedure determines the first of a block's layers, then constructs the $n$th layer from the $n-1$th layer, hence recursively constructs the entire block. This scheme is of course reversible. Indeed the first layer in the block is either $AB, AC, BA, BC, CA,$ or $CB$ so set the remainder $r$ to the respective index $0, 1, 2, 3, 4,$ or $5$ depending on the first layer. Next, define a sequence of $s-1$ binary digits as follows. If the $n+1$th layer in the block is $AB$, $BC$, or $CA$ set the $n$th binary digit to $0$, otherwise, set the digit to $1$. The sequence of digits is a binary representation of a number $q$. With $q$ and $r$ determined, set the index $i = 6q + r + 1$. So in the context of ice at a given \emph{reichweite}, it is now clear what we mean when referring to a block of type $i$. For example, if $s=4$ then the block of type $21$ is $BA \ AB \ BA \ AC$, which can be seen by noting $21 - 1 = 6 \times 3 + 2 $, so $r = 2$, hence the first of the block's layers is $BA$, and the quotient $3$ has binary representation $011$, fixing the next three layers as $AB$, $BA$, and $AC$. Next, we need the structure factor of the $i$th block $F_i$ which we can find as follows. Let $f_{n}^{i}$ be the structure factor of the $n$th layer in the block of type $i$; which has expression found in the work of \citeasnoun{Hansen2008}. Now a block's structure factor is just a superposition of the structure factor of each layer shifted to the right position, so \begin{align} F_i = \sum_{n = 0}^{s-1} f_{n}^{i} \exp\bigg(\frac{2 \pi i m_3 l n}{s}\bigg). \end{align} Now we can fully define the structure matrix $\boldsymbol{F}$ by recalling its $ij$th elements are just $F_i F_j^*$. Next on the agenda is to obtain the $ij$th element of the transition matrix. These elements can be discovered by noting that a block $i$ defines a stack sequence $(1)$ in $HK$ notation with length $s-1$. The concatenation of blocks $i$ and $j$ defines a second stack sequence $(2)$ with length $2s - 1$ where the first $s-1$ stacks are those belonging to block $i$. Suppose an arbitrary stack sequence of length $2s - 1$ has its first $s-1$ stacks fixed to those comprising sequence $(1)$, then the probability that the remaining stacks form sequence $(2)$ is the probability that block $i$ is followed by block $j$; which specifies the $ij$th element of the transition matrix. For example, when $s = 4$ the transition matrix $\boldsymbol{\Xi}$ has element $\xi_{21 \ 35}$ representing the probability that a block of type 35 will follow one of type 21. Using the index scheme, notice this is the probability that the block $CA \ AC \ CA \ AC$ will follow the block $BA \ AB \ BA \ AC$. This is exactly the probability of $ACAC$ following $BABAC$ which equals the probability of $HHHH$ following $HHK$. Recalling that the probability of $K$ following $HH$, $HK$, $KH$, and $KK$ is given by $\alpha$, $\beta$, $\gamma$, and $\delta$ respectively, we have that $\xi_{21 \ 35} = (1-\beta)(1-\gamma)(1-\alpha)^2$. With the structure matrix $\boldsymbol{F}$ and transition matrix $\boldsymbol{\Xi}$ now defined, computing the cross section of aperiodic ice is just a matter of evaluating equation \eqref{MNDSCS}. It is also possible to compute the entropic density $h$ with only the transition matrix. \subsection{Aperiodic opal} There is ample X-ray diffraction data \cite{Graetsch1994},\cite{GDGuthrie} to suggest that the opal CT form of silica is composed of disordered (cubic) cristobalite and (hexagonal) tridymite layers, in topological identity to disordered ice. Like ice, these opaline forms of silica are topologically close-packed stackings of $ABC$ (cristobalite) and $AB$ layers (tridymite), in which the packing centers are located at the linear midpoint of the Si-O-Si covalent bond chains, i.e. close to the (likely disordered) oxygen position. This view is supported by HRTEM studies in which the stacking disorder could be directly visualised \cite{JMElzea}. It was also recognised that the crystallite sizes of the stacking disordered opals is nanoscopic \cite{GDGuthrie} leading to diffraction broadening. It was further suggested that additionally disordered, more amorphous regions could be an intrinsic part of opal CT. The various micro-structural aspects of opal CT were recently discussed by \citeasnoun{WILSON201468}, who highlighted some discrepancies between diffraction and spectroscopic findings. As suspected by \citeasnoun{GDGuthrie}, a straightforward assignment of cubic and hexagonal peak intensities in the complex first diffraction (triplet) peak to the relative proportions of tridymite and cristobalite layers seems unjustified; a statement supported by the work of \citeasnoun{JMElzea}. \citeasnoun{Arasuna2013} have suggested that a largely amorphous water-containing opal (so-called opal A) that undergoes heating and annealing will transform (under loss of water) continuously into a progressively more crystalline opal CT form, finally becoming a material dominated by cristobalite stackings; though the authors adopt a simplified view of stacking disorder which is unlikely to be quantitatively correct. A more involved treatment of stacking disorder and micro-crystallinity as presented here and in the past for ice \cite{Hansen2008} \cite{kuhs2012extent} has not yet been applied to opal but appears highly desirable as it may well resolve some of the open issues on the nature of disorder in opal CT as discussed by \citeasnoun{WILSON201468}. In any case, the annealing of amorphous silica via stacking disordered opal CT into a largely crystalline form close to the melting point of silica shows a close resemblance to the annealing of amorphous ice with the main difference that opals drive towards a cubic form close to melting while ice prefers a hexagonal arrangement. It is also noteworthy that \citeasnoun{GDGuthrie} were interested in the X-ray diffraction pattern of opal containing water molecules. Our formalism could capture this by letting an opal unit cell containing an H$_2$O molecule at a particular position and orientation within the cell be a new layer type with appropriate structure factor. \subsection{Reversible crystals} \label{ReversibleCrystals} We are interested in whether a 1D aperiodic crystal is reversible, which we define informally as whether it looks the same (in some statistical sense) upside down. Before proceeding, we should declare that we have appropriated the word \emph{reversible} from Markov theory and do not mean it in the thermodynamic sense of a process maintaining a constant entropy. We also restrict ourselves to the special case of a topologically close-packed 1D aperiodic crystal in order to conveniently relate this theory to the experimental findings of \citeasnoun{Hansen2008} \& (2008$b$); but note that the idea of a reversible crystal is quite general. Further, we restrict ourselves to crystals with layer types that are individually inversion symmetric. Next, we observe that since a set of layer chain equivalence classes is related to a unique stack chain, we say that a layer chain equivalence class contains reversible layer chains if and only if its related stack chain is reversible. With the preamble out of the way, we define a reversible crystal as one for which the probability of sampling a type $i$ block of stacks and discovering the next block is type $j$ matches the odds of sampling from the crystal a block with stack sequence the reverse of $j$, and noting its successor is the block type with stack sequence reversing that of block type $i$. In other words, sampling a two block long sequence of stacks running from the beginning of an $i$ block's sequence to the end of a $j$ block's is as likely as the sequence running from the end of the $j$ block's to the beginning to the $i$ block's. Formally, an aperiodic crystal is reversible if and only if its underlying Markov process satisfies the reversibility condition \begin{equation} p_{i}X_{ij} = p_{\sigma(j)}X_{\sigma(j)\sigma(i)} \ \forall \ ij \label{ReversibilityCondition} \end{equation} where $\sigma \colon B \to B$ is the involution mapping a block type index to the index of the block type with the reverse stack sequence. Note that we are not using Einstein's sum notation; reversibility entails that equation \eqref{ReversibilityCondition} holds pointwise over all $i$ and $j$. We are interested in whether the $s = 4$ close-packed 1D aperiodic crystal in particular is reversible, so we note first of all that the reversibility condition holds trivially for $ij$ satisfying $\sigma(i) = j$. Next, using that this crystal's involution map is defined $\sigma(1) = 1, \sigma(2) = 3, \sigma(3) = 2, \sigma(4) = 4$ we see that \begin{align} p_{1}X_{12} &= (1 - \gamma)(1 - \alpha)p_{2} &= p_{3}X_{31} = p_{\sigma(2)}X_{\sigma(2)\sigma(1)} \\ p_{1}X_{13} &= (1 - \gamma)(1 - \beta)p_{2} &= p_{2}X_{21} = p_{\sigma(3)}X_{\sigma(3)\sigma(1)}\nonumber \\ p_{1}X_{14} &= (1 - \gamma)\beta p_{2} &= p_{4}X_{41} = p_{\sigma(4)}X_{\sigma(4)\sigma(1)}\nonumber \\ p_{2}X_{22} &= (1-\beta)\gamma p_{2} &= p_{3}X_{33} = p_{\sigma(2)}X_{\sigma(2)\sigma(2)}\nonumber \\ p_{2}X_{24} &= \beta\delta p_{2} &= p_{4}X_{43} = p_{\sigma(4)}X_{\sigma(4)\sigma(2)}\nonumber \\ p_{3}X_{34} &= \gamma\beta p_{2} &= p_{4}X_{42} = p_{\sigma(4)}X_{\sigma(4)\sigma(3)}\nonumber \end{align} revealing the remarkable fact that all $s = 4$ close-packed 1D aperiodic crystals are reversible. Notice that if we let $\alpha = \gamma$ and $\beta = \delta$ the probability that a stack is type $K$ depends only on a single preceding stack, which is to say $s = 3$, and the crystal is still reversible. Now if we let $\alpha = \beta = \gamma = \delta$ we are left with a sequence of independent and identically distributed random variables where $s = 2$ and that the crystal is of course still reversible. Thus we conclude that the crystal is reversible for all $1 < s \leq 4$. This result does not hold for crystals where $s > 4$. Specifically, for crystals with \emph{reichweite} greater than 4 some sets of transition probabilities ($\alpha, \beta, \gamma$ etc) satisfy condition \eqref{ReversibilityCondition} while others do not. We can see that there exist reversible crystals with $s>4$ by considering a chain of blocks where a block composed entirely of cubic stacks will certainly follow one composed entirely of hexagonal stacks, and vice versa. This reversible crystal happens to possess the property of being a polytype, and can be shown to satisfy the reversibility condition. Next, we claim that when $s > 4$ some chains are irreversible, which we prove with the following example. Let $s = 5$ and the probability of $K$ following $HHH \text{ be } 1, \ $ $HHK \text{ be } 1, \ $ $HKK \text{ be } 0, \ $ $KKH \text{ be } 1, \ $ $KHK \text{ be } 0 $ and the probability be $\frac{1}{2}$ for all other blocks. Note that the blocks $HHH, \ KKH, \ KHH, \ HKK, \ HKH, \ HHK, \ KHK $ form a closed communicating class where the probability of one following the other is either $0$ or $1$, so represents a polytype with stack sequence representation shown in figure \ref{Irreversible}. The polytype does not satisfy the reversibility condition and is therefore irreversible. \begin{figure} \begin{align} ...\underbrace{HHHKKHK}_{\text{polytypic lattice}}\underbrace{HHHKKHK}_{\text{polytypic lattice}}... \nonumber \end{align} \caption{This crystal is irreversible because the block $HHH$ is certainly followed the block $KKH$, but in reverse $HHH$ is certainly followed by $KHK$.} \label{Irreversible} \end{figure} This result can be extended to any $s > 4$ by simply considering a crystal composed of lattices like those in figure \ref{Irreversible} but with more than $3H$ stacks in a row before being followed by the sequence $KKHK$. In summary, we have established that for a the topologically close-packed crystal with symmetric layer types, if $s \leq 4$ the crystal is certainly reversible. If $s > 4$ the transition probabilities may or may not satisfy the reversibility condition, hence the crystal may or may not be reversible. Having established that existence of irreversible close-packed crystals with $s > 4$ we are interested in how many reversible crystals can possibly exist in comparison to irreversible crystals. For $s \leq 4$ we have established the number of irreversible crystals is zero, so we direct our attention to the case where $s > 4$. A reversible $s > 4$ aperiodic crystal has transition probabilities constrained by the reversibility condition. This constraint is holonomic, so by the implicit function theorem, the space of transition probabilities for which a crystal is reversible has lower dimension than the space of all transition probabilities, so has $0$-measure. Therefore, reversible crystals with $s > 4$ almost surely do not occur at random, so any that appear in nature almost surely owe their reversibility to some long range interaction somehow forcing them to be symmetric, as it has been observed for polytypic stacking disorder in SiC \cite{varn2001crystal}. Finally, we note that the implications of whether a Markov model underlying a dynamical system is reversible has many more subtle and interesting points elaborated at length by \citeasnoun{Ellison2009}. \subsection{Markov processes in relation to growth physics of stacking disordered ice} The Markov theoretic considerations in the previous chapter may shed some light on the process by which some class of crystals form. In particular, if an aperiodic crystal is irreversible, then its formation process must have an intrinsic directionality. Contrapositively, any formation process that does not have any particular or special directionality should produce a reversible aperiodic crystal. This observation can be applied to ice, sometimes called I$_{\text{ch}}$ \cite{hansen2015approximations} or ice I$_{\text{sd}}$ \cite{Malkin1041}, a material which can be well described without requiring a \emph{reichweite} $s > 4$ \cite{Hansen2008}, for which there is no recent evidence for the existence of polytypes \cite{Hansen2008}; an earlier specific search for polytypes was similarly fruitless \cite{Kuhs1987}. Having no experimental evidence for growth processes with $s > 4$ likely means that the growth of ice stacks is an intrinsically symmetric process; this is in contrast to other materials with longer-ranged or even infinite \emph{reichweite} discussed by \citeasnoun{varn2016did}. Can we learn something else for the growth physics from a Markov theoretic description of 1D periodic crystals? First of all, the stacking disorder in ice I$_{\text{ch}}$ is very strongly influenced by the parent phase, both in its \emph{reichweite} and in the frequency of the distinguishable stackings observed; indeed, the stacking disorder provides very clear and reproducible fingerprints to trace back the parent phase after its transformation into ice I$_{\text{ch}}$ \cite{kuhs2012extent}. This information is wiped out only upon prolonged annealing \cite{0953-8984-20-28-285105}, \cite{kuhs2012extent}; this is understood to be a consequence of annihilation of various partial dislocations \cite{doi:10.1080/14786435.2015.1091109}, a process which also depends on the lateral extent of the stacks. This process proceeds in a discontinuous manner and eventually yields good hexagonal ice on approaching 240K within a laboratory timescales of seconds to minutes \cite{B412866D} in full agreement with \citeasnoun{doi:10.1080/14786435.2015.1091109}. Interestingly, a satisfactory description of ice I$_{\text{ch}}$ obtained from high pressure ices (recovered to ambient pressure at low temperature) or obtained from water vapour requires $s=4$, making use of 4 parameters $\alpha, \beta, \gamma$ and $\delta$ \cite{kuhs2012extent}, but the formation from super-cooled water is adequately described by $s=2$, making use of single stacking fault parameter \cite{Malkin1041} \cite{doi:10.1021/acs.jpclett.7b01142}. An explanation for this difference is certainly worth pursuing. \citeasnoun{kuhs2012extent} introduced the term \emph{cubicity} to describe the proportion of cubic sequences in a crystal, which has been found to be almost 80\% when freezing very small (15 nm) droplets at 225K \cite{doi:10.1021/acs.jpclett.7b01142}, while larger (900 nm) drops freeze to a 50\%:50\% mixture of cubic and hexagonal sequences at 232K \cite{Malkin1041}. It turns out that highest cubicities are obtained when no time is allowed for any annealing of stacking faults, like in the very fast (timescale of $\mu$s) freezing achieved by \citeasnoun{doi:10.1021/acs.jpclett.7b01142}. This poses a question on the nature of the initially formed nucleus: is it cubic, hexagonal or stacking-disordered? While the bulk crystal in its stable form is certainly hexagonal, the reasons for this preference are somewhat less clear: On the basis of quantum mechanical calculations \citeasnoun{PhysRevX.5.021033} have suggested that the anharmonic vibrational energies favour the hexagonal form as a consequence of differences in the fourth nearest-neighbour protons, related to the occurrence of the topologically different boat and chair-forms of the 6-membered water rings in cubic and hexagonal ice. Still, as nucleation (and growth) for super-cooled water is kinetically controlled, freezing may well start also with a cubic or a stacking disordered nucleus \cite{Lupi2017}. The subsequent growth appears experimentally to follow a fast $s=2$ Markov chain prescription, before any annealing has time to set in for temperatures below approximately $240$K. It is noteworthy that branching (twinning) has been observed for a significant percentage of snow crystals formed at temperatures higher than about 238K \cite{1980416}, which likely have formed from a cubic (or stacking-faulty) nucleus growing along directions separated by the octahedral angle of $70.53^{\circ}$ (i.e. the angle between two or more cubic [111] directions). Maintaining a larger macroscopic snow-crystal in a stacking disordered state is energetically expensive due to the development of large-angle grain boundaries between several stacking directions \cite{Kobayashi1987}; so individual branches develop by further growth from the gas phase after the initial freezing. Moreover, at high enough temperatures the stacking disorder will quickly anneal as discussed above. Thus, the only traces left of the earlier stacking disorder are these multiply twinned, branched hexagonal crystals. But why is vapour-grown ice I$_\text{ch}$ so complex that a satisfactory description demands that $s=4$? The observed preferential stacking sequences \cite{kuhs2012extent} indicate a persistence of hexagonal or cubic consecutive stackings rather than a frequent switching between them and an overall preponderance of hexagonal stackings. Such a persistence can easily be explained by the growth of stackings around screw dislocations \cite{Thrmer11757}, a growth mechanism which avoids a costly layer-by-layer nucleation along the stack. Recovered high-pressure phases of ice (like ice IX or ice V) when transformed into ice I$_{\text{ch}}$ do not show strong indications for persistence nor for alternating stackings. Rather, the stackings developed could well reflect orientational relationships with their parent phase. Such a topological inheritance has been demonstrated in the ice I${_\text{h}}$ $\to$ ice II transition \cite{doi:10.1080/01418619708209983} and is manifest in the observed textural relationships. It is well conceivable that structural inheritance could also express itself in certain stacking topologies to minimize the bond-breaking as well as striving for the shortest pathways for (multistage) diffusionless reconstructive phase transitions \cite{Christy:al0563}. It is also worth mentioning that the topology of the ice IX phase is acentric, with water molecules arranged along a 4-fold screw-axis. In particular, there are two enantiomorphic forms of ice IX (and the same is true for ice III) with left and right handed forms occurring in nature with equal probability. Consequently, a naturally occurring sample of ice IX is expected have equal proportions of right and left handed crystallites. Now, we expect a sequence of right handed layers to be the reverse of a sequence of left handed layers, and since we expect a sample to contain both forms in equal proportions, an irreversible ice IX crystal would not be simply distinguished from a reversible counterpart by examining their X-ray or neutron powder diffraction patterns. Further work is undoubtedly needed to elucidate the myriad of transitions between the many forms of ice in search for an explanation for the observed stacking probabilities. \section{The pair distribution function of a 1D aperiodic crystal} The scattering-length density function $\beta(\vec{r})$ describes the distribution of scatterers of the ensemble when centred at the origin \cite{sivia2011elementary}. The autocorrelation function of $\beta(\vec{r})$, which is given by its convolution with its complex conjugate, produces a pair-correlation function that we will denote $g(\vec{r})$. There are several expressions for pair-correlation functions that differ in their normalisations, and they can be written either in vectorial or in orientationally-averaged form. See \citeasnoun{fischer2005neutron} and \citeasnoun{keen2001comparison}. The pair-correlation function $g(\vec{r})$ of an aperiodic ensemble of scatterers (atoms) gives the probability density of finding an atom a vector distance $\vec{r}$ from an ensemble-averaged atom at the origin. It can be obtained by Fourier transforming the total scattered intensity $I(\vec{Q})$ and is usually separated into a (trivial) self-correlation part and a structure-dependent so-called distinct part \begin{equation} g(\vec{r})_{self} + g(\vec{r})_{distinct} \propto \int_{Q-\text{space}} I(\vec{Q}) e^{-2\pi i \vec{Q}\cdot\vec{r}} d\vec{Q}. \end{equation} $I(\vec{Q})$ is obtained experimentally as the total differential scattering cross section into solid angle $d\Omega$ as e.g. measured in a diffraction experiment; this measured total intensity is composed of the trivial self-scattering part and the structurally more interesting distinct part: \begin{equation} I(\vec{Q}) = \frac{d\sigma(\vec{Q})}{d \Omega} = I(\vec{Q})_{self} + I(\vec{Q })_{distinct}. \end{equation} For powders with a random orientation of particles, the diffraction data obtained are usually 1D averages of $I(\vec{Q})$ like those obtained for amorphous materials or liquids; consequently only the isotropic function $g(r)$ can be accessed experimentally. Yet, for known atomic arrangements of the powder crystallites the isotropic average of their 3D pair-correlation functions can be obtained by integration over the 3D shell at constant $r$. The isotropic $g(r)$, which by choice contains only the distinct part, can then be renormalised into a Radial Distribution Function or RDF$(r)$ from which coordination numbers can be obtained by integration. It is also possible to normalise $g(r)$ into the density function $D(r)$ whose slope at small $r$ is proportional to the sample's atomic number density. It is this function $D(r)$, when generalised to polyatomic systems, that is frequently called the Pair Distribution Function, or PDF$(r)$. Note that the PDF$(r)$ converges to zero at large $r$, since it represents fluctuations around the average atomic density. PDF-analysis has developed into an important tool for analysing the often defective atomic arrangements of nanomaterials \cite{neder2014pdf}, \cite{egami2012underneath}. Nanocrystalline materials often exhibit stacking-faults as a consequence of their manufacturing procedures (ball milling, mechanical alloying) or crystal growth \cite{zehetbauer2009bulk}. Such materials show very broad reflections as a consequence of crystal size broadening and stacking-faults as well as microstrains, and thus are not routinely accessible by Rietveld analyses if these contributions are not disentangled \cite{gayle1995stacking}. A PDF-analysis of stacking-faults in nanomaterials seems a viable alternative and was performed e.g. for CdSe by \citeasnoun{yang2013confirmation} as well as by \citeasnoun{masadeh2007quantitative} and \citeasnoun{gawai2016study} for ZnS nanocubes and nanowires. The stacking-fault model used in these works is rather simple and limited to mixture models of the pure cubic and hexagonal constituents via a single stacking-fault probability parameter. That said, a more sophisticated treatment of disordered ZnS was presented by \citeasnoun{PhysRevB.66.174110} who offer a broad statistical description of the close-packed topology, which includes ZnS. The authors find the minimum effective memory length for stacking sequences in close-packed structures and discuss how to infer the $\varepsilon$-machine from scattering data. The pair distribution function $g(r)$ is sensitive to the next-nearest neighbour arrangements, consequently also to the \emph{reichweite} of the layer interactions, it is in principle possible to extract detailed information on the nature of stacking faults from an experimental $g(r)$ using a Markov chain approach. Obtaining $g(r)$ via a Fourier transformation of the (incompletely and imperfectly) measured $I_{meas}(Q)$ results in noise and artefacts, so it might well be worth calculating $g(r)$ from the direct-space structure model scattered intensity $I_{model}(Q)$, accounting for instrument resolution etc, then comparing with $I_{meas}(Q)$, as has been done for nanocrystalline, stacking-faulty ice by \citeasnoun{Hansen2008}, (2008$b$), and \citeasnoun{kuhs2012extent}. Indeed, a $Q$-space based approach like Rietveld refinement is the only way to proceed in cases where high $Q$ data are not available for making a meaningful Fourier transformation to obtain $g(r)$ from $I(Q)$. We should stress that neither $Q$-space nor PDF-analysis is generally better than the other, but that they are chosen carefully depending on different experimental situations: For example, a low density of defects in an otherwise crystalline system is better analysed using $Q$-space refinement since $S(Q)$ displays long-range correlations of defects as diffuse scattering near the base of Bragg peaks. On the other hand, for a high density of defects, especially when one begins to see broad and/or asymmetric intrinsic profiles of Bragg peaks, which can also happen for quasi-2D or quasi-1D systems, then PDF-analysis is in principle better than Rietveld refinement. In these cases, the methods of efficiently calculating PDFs of aperiodic crystals developed by \citeasnoun{varn2013machine} and \citeasnoun{riechers2015pairwise} may come in handy. Moreover, the resolution of the neutron diffractometer plays a big role in deciding between PDF and $Q$-space analysis, at least for reactor-based diffractometers where there is a tradeoff between high $Q$ (needed for good PDF-analysis and resolution in R-space), and good $Q$-space resolution (needed for seeing diffuse scattering at the base of Bragg peaks). It is only with some spallation-source diffractometers that one can achieve very good $Q$-space resolution in addition to a high $Q_{\text{max}}$ (at the expense of counting rate at high $Q$), and in that case one could conceivably attempt both PDF and $Q$-space analysis. \section{Conclusion and outlook} We have mildly generalised the cross section derived by \citeasnoun{riechers2015pairwise} to reach an expression for the scattering cross section of crystals including ice and opal. These crystals have close-packed topology, so we studied the close-packed topology in more detail, finding that those topologically close-packed crystals with \emph{reichweite} 4 or less are necessarily reversible and those with \emph{reichweite} greater than 4 are almost surely irreversible. Our expression for the cross section provides the experimental crystallographer with a description that fully accounts for the stacking disorder of ice and opal (and possibly more) when applying a Rietveld-like analysis. This could be used to estimate transition probabilities, and understand the distribution of stacking faults much more accurately than trying to estimate them via MC simulation. Moreover, one could seek to determine the \emph{reichweite} of opal in the same way that \citeasnoun{Hansen2008} and \citeasnoun{kuhs2012extent} measured the \emph{reichweite} of ice, which was fundamentally similar to the method outlined by \citeasnoun{PhysRevB.66.174110} to determine the $\varepsilon$-machine of a close-packed crystal. Roughly speaking both approaches involve attempting to fit a model with $s = 1$ to scattering data, and if the model fit is not \emph{good enough} by some metric, the methods increment $s$ until the fit becomes good enough; though the $\varepsilon$-machine reconstruction of \citeasnoun{PhysRevB.66.174110} is somewhat more sophisticated. Further to this, one could examine how the transition probabilities and entropic density of opal evolve under change in temperature, or any other variable. Obtaining the \emph{reichweite} of opal could provide information about its reversibility, providing clues about its formation process. A fruitful direction of future theoretical work may be to extend the theory so far explored to crystals composed of infinitely many kinds of layer, which could be applied to a crystal composed of layers that are identical to their immediate predecessor up to some rotation, translation, change in curvature, or shift orthogonal to the basel plane, which takes one of infinitely many values. Such crystals possess so-called turbostratic disorder, and include a range of materials including smectites \cite{Ufer:2008:0009-8604:272}, \cite{Turbostratic2009}, carbon blacks \cite{ShiThesis} \cite{ZHOU201417} and possibly $n$-layer graphene; a novel material that has captured the attention of the nanoscience community \cite{Razado-Colambo2016} \cite{Huang2017}. Such an extension of existing theory may be achievable by replacing the transition matrix (an operator on a finite dimensional vector space) with a transition operator on an infinite dimensional Banach space. This functional analytic treatment could be extended to hidden Markov models with infinitely many alphabetical symbols as well as an infinite state space. \\ \ack{We thank the Institut Laue Langevin for funding A. G. Hart's internship. Further, we thank Joellen Preece for advice on Markov theory and probability, as well as Henry Fischer for guidance on PDF analysis. Further thanks are owed to the anonymous reviewers for their knowledgeable and detailed suggestions which helped to considerably improve the manuscript. We extend our gratitude to Chris Cook, Michael Green, Matthew Hill, Daniel Hoare, and Lucy Roche for offering corrections and criticism.} \begin{appendix} \section{Cross section of a 1D aperiodic crystal described by a HMM} \label{HMM_CS} HMMs are an ordered quintuple $\Gamma = (A,\mathbb{S},\mu_0,\mathcal{T},V)$ where $\mathbb{S}$ is the state space of some hidden Markov process giving rise to a sequence of states $\mathcal{S}_n$ satisfying the Markov property. $\mathcal{T}$ is the transition matrix between states of the hidden Markov process, with elements $\mathcal{T}_{rs}$ representing the probability that a hidden state $r \in \mathbb{S}$ will transition to another hidden state $s \in \mathbb{S}$. $\mu_0$ is some initial probability distribution over the state space $\mathbb{S}$. $\mathcal{A}$ is the alphabet of symbols, which are not hidden, and represent the set of distinct layer types. At every state $s \in \mathbb{S}$ some symbol from the alphabet $\mathcal{A}$ will be emitted with probability following a distribution dependant only on $s$. Specifically, the probability that the state $s \in \mathbb{S}$ will emit a symbol $x \in \mathcal{A}$ is the element $V_{sx}$ of the matrix $V$. The sequence of hidden states $\mathcal{S}_n$ gives rise to a sequence of symbols $X_n$; which is of course the sequence of layer types that compose a crystal. Our definition of a HMM is presented differently to that of \citeasnoun{riechers2015pairwise}, but is equivalent. In fact, we can define a set of matrices $\boldsymbol{T}$ with elements $\mathcal{T}^{[x]}$ for each $x \in \mathcal{A}$ with components $\mathcal{T}^{[x]}_{rs} = \mathcal{T}_{rs}V_{sx}$ representing the probability of both a transition to state $s \in \mathbb{S}$ from state $r \in \mathbb{S}$ and an emission of symbol $x \in \mathcal{A}$ from state $s$. Then we recover the quadruple $(A,\mathbb{S},\mu_0,\boldsymbol{T})$ used by \citeasnoun{riechers2015pairwise} to define the HMM. Now, to derive the cross section we first consider the average structure factor product $Y_m$ expressed by \citeasnoun{PhysRevB.34.3586} in terms of structure factors and pair correlation functions of the layer types comprising a crystal. To this end we let $F_{x}$ represent the structure factor of the layer type $x \in \mathcal{A}$, and $F$ be a matrix with entries $F_{xy} = F_{x}F^*_{y}$. Further we let $\pi$ represent the stationary distribution of the hidden Markov process, which exists if the hidden Markov process is positive recurrent and irreducible. Starting from the average structure factor product $Y_m$ provided by \citeasnoun{PhysRevB.34.3586}, making use of Bayes' theorem and the Markov property of the sequence $\mathcal{S}_m$, we have for $m > 0$ \begin{align} Y_{m} = \sum_{x \in \mathcal{A}} \sum_{y \in \mathcal{A}}P(X_0 = x , X_{m} = y) F_{xy} \\ = \sum_{x \in \mathcal{A}} \sum_{y \in \mathcal{A}}P(X_0 = x)P(X_m = y \mid X_0 = x) F_{xy} \\ = \sum_{x \in \mathcal{A}} \sum_{y \in \mathcal{A}}\sum_{r \in \mathbb{S}} \sum_{s \in \mathbb{S}} P(\mathcal{S}_0 = r)P(X_0 = x \mid \mathcal{S}_0 = r) \\ \times P(\mathcal{S}_m = s \mid \mathcal{S}_0 = r)P(X_m = y \mid \mathcal{S}_m = s)F_{xy} \nonumber \\ = \sum_{x \in \mathcal{A}} \sum_{y \in \mathcal{A}}\sum_{r \in \mathbb{S}} \sum_{s \in \mathbb{S}} \pi_s v_{rx} \mathcal{T}_{sr}^m v_{sy} F_{xy} \\ = \sum_{x \in \mathcal{A}} \sum_{y \in \mathcal{A}}\sum_{r \in \mathbb{S}} \sum_{s \in \mathbb{S}} \pi_s \mathcal{T}_{sr}^m v_{rx} F_{xy} v_{sy} \\ = \Tr\big( \Diag(\pi) \mathcal{T}^m V F V^{T} \big). \end{align} Now, \begin{align} Y_{-m} = \sum_{x \in \mathcal{A}} \sum_{y \in \mathcal{A}}P(X_0 = x , X_{m} = y) F_{yx} \\ = \sum_{x \in \mathcal{A}} \sum_{y \in \mathcal{A}}P(X_0 = x , X_{m} = y) F_{xy}^* \end{align} because $F$ is Hermitian, so \begin{align} Y_{-m} = \Tr\big( \Diag(\pi) \mathcal{T}^m V F^* V^{T} \big), \end{align} and last of all \begin{align} Y_0 = \sum_{x \in \mathcal{A}} \sum_{y \in \mathcal{A}}P(X_0 = x , X_0 = y) F_{xy} \\ = \sum_{x \in \mathcal{A}} \sum_{y \in \mathcal{A}}\pi_s \delta_{sr} v_{rx} F_{xy} v_{sy} \\ = \Tr\big( \Diag(\pi) V F V^T \big). \end{align} Next, \begin{align} \sum_{m = 1}^{N} (N - |m|) Y_m e^{2 \pi i m l} \\ = \Tr\bigg( \Diag(\pi) \sum_{m = 1}^{N} (N-m) \big(\mathcal{T} e^{2 \pi i l}\big)^m V F V^{T} \bigg) \nonumber \\ = \Tr\bigg( \Diag(\pi) S V F V^{T} \bigg) \end{align} where \begin{align} S = \sum_{m = 1}^{N} (N-m) \big(\mathcal{T} e^{2 \pi i l}\big)^m \\ = \mathcal{T} e^{2 \pi i l} ( \mathcal{T}^{N} e^{2 \pi i l N} + N(I - \mathcal{T} e^{2 \pi i l} ) - I) (I - \mathcal{T} e^{2 \pi i l})^{-2} \nonumber \end{align} if $(I - \mathcal{T} e^{2 \pi i l})^{-1}$ exists. Similarly \begin{align} \sum_{m = -N}^{-1} (N - |m|) Y_m e^{2 \pi i m l} \\ = \sum_{m = 1}^{N} (N - m) Y_{-m} e^{- 2 \pi i m l} \nonumber \\ = \Tr\bigg( \Diag(\pi) S^* V F^* V^{T} \bigg) \end{align} so \begin{align} \sum_{m = -N}^{N} (N - |m|) Y_m e^{2 \pi i m l} \\ = \Tr\bigg( \Diag(\pi) S V F V^{T} \bigg) + \Tr\bigg( \Diag(\pi) S^* V F^* V^{T} \bigg) \\ + \Tr\bigg( \Diag(\pi) V F V^T \bigg) \nonumber \\ = 2 Re \bigg\{ \Tr\big( \Diag(\pi) S V F V^{T} \big) \bigg\} + \Tr\big( \Diag(\pi) V F V^T \big). \end{align} The general expression for the cross section given by \citeasnoun{PhysRevB.34.3586} \begin{align} \frac{d\sigma}{d\Omega} =\frac{\sin^2(N_a\pi h)}{\sin^2(\pi h)}\frac{\sin^2(N_b\pi k)}{\sin^2(\pi k)} \sum_{m_3 = -N_c}^{N_c} (N_c - |m_3|) Y_{m_3} e^{2 \pi i m_3 l} \end{align} completes the derivation \begin{align} \frac{d\sigma}{d\Omega} =\frac{\sin^2(N_a\pi h)}{\sin^2(\pi h)}\frac{\sin^2(N_b\pi k)}{\sin^2(\pi k)} \\ \times \bigg( 2 Re \bigg\{ \Tr\big( \Diag(\pi) S V F V^{T} \big) \bigg\} + N_c\Tr\big( \Diag(\pi) V F V^T \big) \bigg) \nonumber \\ =\frac{\sin^2(N_a\pi h)}{\sin^2(\pi h)}\frac{\sin^2(N_b\pi k)}{\sin^2(\pi k)} Re \bigg\{ \Tr\big( \Diag(\pi) (2S+N_cI) V F V^{T} \big) \bigg\}. \end{align} \section{Expressing the differential scattering cross section of 1D aperiodic crystals} \label{CrossSectionDerivation} We begin with the expression for the differential scattering cross developed by \citeasnoun{PhysRevB.34.3586} \begin{align} &\frac{d\sigma}{d\Omega} = \frac{\sin^2(N_a\pi h)}{\sin^2(\pi h)}\frac{\sin^2(N_b\pi k)}{\sin^2(\pi k)} \times \label{BerlinerExpressionAppendix} \\ &\sum^{N_{c}}_{m_{3} = -N_{c}}(N_{c} - \abs{m_{3}})Y_{m_3}e^{2 \pi i m_{3} l} \nonumber \end{align} and proceed by splitting the sum \begin{align} &\sum^{N_{c}}_{m_{3} = -N_{c}}(N_{c} - \abs{m_{3}})Y_{m_3}e^{2 \pi i m_{3} l} \label{blehh} \\ =Y_{0}N_{c} + &\sum^{N_{c}}_{m_{3} = 1} (N_{c} - m_{3})Y_{m_3}e^{2 \pi i m_{3} l} \nonumber \\ + &\sum^{N_{c}}_{m_{3} = 1} (N_{c} - m_{3})Y_{-m_3}e^{-2 \pi i m_{3} l}. \nonumber \end{align} Now, according to \citeasnoun{PhysRevB.34.3586}, the average structure factor product has expression \begin{equation} Y_{m_{3}}(\vec{Q}) = \sum_{i \in B}\sum_{j \in B} F_{i}(\vec{Q})F_{j}^{*}(\vec{Q })G_{ij}(m_{3}) \end{equation} where $F_{i}(\vec{Q})$ and $F_{i}^{*}(\vec{Q})$ are the structure factor and conjugate structure factor of an $i$ block respectively. For brevity, let $F_{ij} = F_{i}(\vec{Q})F_{j}^{*}(\vec{Q})$ be the $ij$th components of what we will call the \emph{structure matrix} $\boldsymbol{F}$. Next, $G_{ij}(m_{3})$ denotes the probability that a $j$ block is $m_{3}$ blocks ahead of an $i$ block so we have that $G_{ij}(m_{3}) = \pi_{i}{\xi}^{m_{3}}_{ij}$ for positive $m_{3}$. Postponing the case where $m_{3}$ is negative, we proceed by noting \begin{align} Y_{m_{3}}(\vec{Q}) &= \sum_{i \in B} \sum_{j \in B} F_{ij}\pi_{i}\xi_{ij}^{m_{3}} \ , \ m_{3} > 0 \\ &= \sum_{i \in B} \sum_{j \in B} F_{ji}^{T}\pi_{i}\xi_{ij}^{m_{3}} \end{align} and use that $\boldsymbol{F}$ is Hermitian, which is to say $\boldsymbol{F}^{T} = \boldsymbol{F}^{*}$, to deduce \begin{align} Y_{m_{3}}(\vec{Q}) &= \sum_{i \in B} \sum_{j \in B} F_{ji}^{*}\pi_{i}\xi_{ij}^{m_{3}} \end{align} which we identify as \begin{equation} Y_{m_{3}}(\vec{Q}) = \Tr\bigg(\boldsymbol{F}^{*}\Diag(\pi)\boldsymbol{\Xi}^{m_{3}}\bigg) \end{equation} where $\Tr$ is the trace. Now, the probability of sampling an $i$ block from a crystal then finding a $j$ block $m_{3}$ blocks behind the first block, is equal to the probability of sampling a $j$ block from the crystal then finding a type $i$ block $m_{3}$ blocks ahead of the former block, consequently \begin{equation} Y_{-m_{3}}(\vec{Q}) = \Tr \bigg( \boldsymbol{F}\Diag(\pi)\boldsymbol{\Xi}^{m_{3}}\bigg)\ , \ m_{3} > 0. \end{equation} Now, continuing from equation \eqref{blehh} \begin{align} &\sum^{N_{c}}_{m_{3} = -N_{c}}(N_{c} - \abs{m_{3}})Y_{m_3}e^{2 \pi i m_{3} l} \label{SplitSum} \\ =&N_{c}\Tr\bigg(\boldsymbol{F}\Diag(\boldsymbol{\pi})\bigg) \nonumber \\ + &\sum^{N_{c}}_{m_{3} = 1} (N_{c} - m_{3})\Tr\bigg( \boldsymbol{F}^{*}\Diag(\boldsymbol{\pi})\boldsymbol{\Xi}^{m_{3}} \bigg)e^{2 \pi i m_{3} l} \nonumber \\ + &\sum^{N_{c}}_{m_{3} = 1} (N_{c} - m_{3})\Tr\bigg( \boldsymbol{F}\Diag(\boldsymbol{\pi})\boldsymbol{\Xi}^{m_{3}} \bigg)e^{-2 \pi i m_{3} l}. \nonumber \end{align} Since the two summands on the RHS of the previous equation are complex conjugate, we seek an expression for only one of them, from which we can deduce the other easily. We do this by invoking the linearity of the trace to deduce \begin{align} &\sum^{N_{c}}_{m_{3} = 1} (N_{c} - m_{3})\Tr\bigg( \boldsymbol{F}^{*}\Diag(\boldsymbol{\pi})\boldsymbol{\Xi}^{m_{3}} \bigg)e^{2 \pi i m_{3} l} \label{Trace} \\ = &\Tr\bigg( \boldsymbol{F}^{*}\Diag(\boldsymbol{\pi})\sum^{N_{c}}_{m_{3} = 1}(N_{c} - m_{3})\boldsymbol{\Xi}^{m_{3}}e^{2 \pi i m_{3} l} \bigg) \nonumber \end{align} then we consider 2 cases, the first is for $\boldsymbol{\Xi}$ a diagonalisable matrix, where \begin{align} &\sum^{N_{c}}_{m_{3} = 1}(N_{c} - m_{3}) \boldsymbol{\Xi}^{m_{3}}e^{2 \pi i m_{3} l} \nonumber \\ =& \sum^{N_{c}}_{m_{3} = 1}(N_{c} - m_{3}) \boldsymbol{Q} \left( \begin{array}{ccc} \lambda_{1}^{m_{3}} & & 0 \\ & \ddots & \\ 0 & & \lambda_{n}^{m_{3}} \end{array} \right) \boldsymbol{Q}^{-1}e^{2 \pi i m_{3} l} \\ =& \boldsymbol{Q} \\ &\sum^{N_{c}}_{m_{3} = 1} \left( \begin{array}{ccc} (N_{c} - m_{3})\lambda_{1}^{m_{3}}e^{2 \pi i m_{3} l} & & 0 \\ & \ddots & \\ 0 & & (N_{c} - m_{3})\lambda_{n}^{m_{3}}e^{2 \pi i m_{3} l} \end{array} \right) \nonumber \\ &\boldsymbol{Q}^{-1} \nonumber \end{align} for some invertible matrix $\boldsymbol{Q}$. Now the sum \begin{align} s_{n} = \sum^{N_{c}}_{m_{3} = 1}(N_{c} - m_{3})\lambda_{n}^{m_{3}}e^{2 \pi i m_{3} l} \end{align} has analytic expression \begin{align} s_{n} = \begin{cases} \frac{N_c}{2}(N_c - 1) \text{ if $\lambda_n e^{2 \pi i l} = 1$ } \\ \frac{\lambda_n e^{2 \pi i l} ( \lambda_n^{N_c} e^{2 \pi i l N_c} + N_c(1 - \lambda_n e^{2 \pi i l} ) - 1)}{(1 - \lambda_n e^{2 \pi i l})^2} \text{ otherwise,} \end{cases} \end{align} so we can let $\boldsymbol{\hat{S}}$ be the diagonal matrix with components $s_n$. Next, we consider the case of a defective $\boldsymbol{\Xi}$. Though we cannot diagonalise $\boldsymbol{\Xi}$, we can express it terms of its Jordan Canonical form \begin{align} \boldsymbol{J} = \boldsymbol{Q}^{-1} \boldsymbol{\Xi} \boldsymbol{Q} \end{align} where $\boldsymbol{J}$ is a block diagonal matrix comprised of Jordan blocks $\boldsymbol{J}_p$; which are themselves upper triangular matrices each associated with an eigenvalue $\lambda_p$ of $\boldsymbol{\Xi}$. The columns of the matrix $\boldsymbol{Q}$ are the eigenvectors and generalised eigenvectors of $\boldsymbol{\Xi}$, so $\boldsymbol{Q}$ is necessarily invertible. We proceed by first noting \begin{align} &\sum^{N_{c}}_{m_{3} = 1}(N_{c} - m_{3}) \boldsymbol{\Xi}^{m_{3}}e^{2 \pi i m_{3} l} \nonumber \\ =& \sum^{N_{c}}_{m_{3} = 1}(N_{c} - m_{3}) \boldsymbol{Q} \left( \begin{array}{ccc} J_{1}^{m_{3}} & & 0 \\ & \ddots & \\ 0 & & J_{p}^{m_{3}} \end{array} \right) \boldsymbol{Q}^{-1}e^{2 \pi i m_{3} l} \\ =& \boldsymbol{Q} \\ &\sum^{N_{c}}_{m_{3} = 1} \left( \begin{array}{ccc} (N_{c} - m_{3})J_{1}^{m_{3}}e^{2 \pi i m_{3} l} & & 0 \\ & \ddots & \\ 0 & & (N_{c} - m_{3})J_{p}^{m_{3}}e^{2 \pi i m_{3} l} \end{array} \right) \nonumber \\ &\boldsymbol{Q}^{-1}. \nonumber \end{align} Now the weighted sum of Jordan blocks \begin{align} \mathcal{S}_{p} = \sum^{N_{c}}_{m_{3} = 1}(N_{c} - m_{3})J_{p}^{m_{3}}e^{2 \pi i m_{3} l} \end{align} has expression \begin{align} \mathcal{S}_{p} &= \boldsymbol{J}_p e^{2 \pi i l} ( \boldsymbol{J}_p^{N_c} e^{2 \pi i l N_c} + N_c(\boldsymbol{I} - \boldsymbol{J}_p e^{2 \pi i l} ) - \boldsymbol{I}) \\ &\times (\boldsymbol{I} - \boldsymbol{J}_p e^{2 \pi i l})^{-2} \end{align} under the condition that the resolvent $\big( \boldsymbol{I} - \boldsymbol{J}_{p}e^{2\pi i l} \big)$ is invertible, which is true unless $\lambda_p e^{2 \pi i l} = 1$. In the case of an invertible resolvent, it is noteworthy for ease of computation that \begin{align} \bigg( \boldsymbol{I} - \boldsymbol{J}_p e^{2 \pi i l} \bigg)^{-1}_{ij} = \begin{cases} (1 - \lambda_{p} e^{2 \pi i l })^{-1 + i - j} &\text{ if $i \leq j$} \\ 0 &\text{ otherwise } \end{cases} \end{align} and that \begin{align} \bigg(\boldsymbol{J}_p e^{2 \pi i l}\bigg)^{N_c}_{ij} = \begin{cases} (\lambda_p e^{2 \pi i l})^{N_c} \lambda^{i - j} \binom{N_c}{j - i} &\text{ if $i \leq j$} \\ 0 &\text{ otherwise } \end{cases} \end{align} where $\binom{a}{b}$ are binomial coefficients. On the other hand, if $\lambda_p e^{2 \pi i l} = 1$ then the resolvent $\big( \boldsymbol{I} - \boldsymbol{J}_{p}e^{2\pi i l} \big)$ is singular and we note \begin{align} \bigg( \sum_{m_3 = 1}^{N_c}(N_c - m_3)J^{m_3}_p \bigg)_{ij} = \sum_{m_3 = 1}^{N_c}(N_c-m_3) \binom{m_3}{j-i}. \end{align} We can now define the matrix $\boldsymbol{\hat{S}}$ as the block diagonal matrix composed of the blocks $\mathcal{S}_p$ Having considered both cases of $\boldsymbol{\Xi}$ diagonalisable and not, we proceed by recalling equation \eqref{Trace} and note \begin{align} &\sum^{N_{c}}_{m_{3} = 1} (N_{c} - m_{3})\Tr\bigg( \boldsymbol{F}^{*}\Diag(\boldsymbol{\pi})\boldsymbol{\Xi}^{m_{3}} \bigg)e^{2 \pi i m_{3} l} \\ =& \Tr\bigg(\boldsymbol{F}^{*}\Diag(\boldsymbol{\pi})\boldsymbol{Q}^{-1}\boldsymbol{\hat{S}}\boldsymbol{Q}\bigg) \nonumber \end{align} hence we can express equation \eqref{SplitSum} \begin{align} &\sum_{m_{3} = -N_{c}}^{N_{c}}(N_{c} - \abs{m_{c}})Y_{m_{3}}e^{2 \pi i m_{3} l} \\ =&\Tr\bigg(\boldsymbol{F}\Diag(\boldsymbol{\pi}) \bigg) \nonumber \\ +&\Tr\bigg(\boldsymbol{F}^{*}\Diag(\boldsymbol{\pi})\boldsymbol{Q}^{-1}\boldsymbol{\hat{S}}\boldsymbol{Q}\bigg) \nonumber \\ +&\Tr\bigg(\boldsymbol{F}\Diag(\boldsymbol{\pi})\boldsymbol{Q}^{-1}\boldsymbol{\hat{S}}^{*}\boldsymbol{Q}\bigg) \nonumber \end{align} then using equation \eqref{BerlinerExpressionAppendix}, linearity of the trace, and the trace operator's cyclic permutation property \begin{equation} \Tr(\boldsymbol{ABC}) = \Tr(\boldsymbol{CBA}), \end{equation} we deduce \begin{align} \frac{d\sigma}{d\Omega} =&\frac{\sin^2(N_a\pi h)}{\sin^2(\pi h)}\frac{\sin^2(N_b\pi k)}{\sin^2(\pi k)} \times \\ &\Tr\bigg(\Diag(\boldsymbol{\pi})(N_c\boldsymbol{F} + \boldsymbol{Q}^{-1}\boldsymbol{\hat{S}}\boldsymbol{Q}\boldsymbol{F}^{*} + \boldsymbol{Q}^{-1}\boldsymbol{\hat{S}}^{*}\boldsymbol{Q}\boldsymbol{F})\bigg). \nonumber \end{align} Finally we deploy the change of basis \begin{align} \Diag(\boldsymbol{\pi}) &= \boldsymbol{Q}^{-1}\boldsymbol{\hat{P}}\boldsymbol{Q} \\ \boldsymbol{F} &= \boldsymbol{Q}^{-1}\boldsymbol{\hat{F}}\boldsymbol{Q} \end{align} and once again use the linearity and cyclic permutation property of the trace to deduce \begin{align} \frac{d\sigma}{d\Omega} =\frac{\sin^2(N_a\pi h)}{\sin^2(\pi h)}\frac{\sin^2(N_b\pi k)}{\sin^2(\pi k)} \times \\ \Tr\bigg(\boldsymbol{\hat{P}}(N_c\boldsymbol{\hat{F}} + \boldsymbol{\hat{S}}\boldsymbol{\hat{F}}^{*} + \boldsymbol{\hat{S}}^{*}\boldsymbol{\hat{F}})\bigg) \nonumber \\ = \frac{\sin^2(N_a\pi h)}{\sin^2(\pi h)}\frac{\sin^2(N_b\pi k)}{\sin^2(\pi k)} Re \bigg\{ \Tr \big(\boldsymbol{\hat{P}}(2\boldsymbol{\hat{S}}+N_c\boldsymbol{I})\boldsymbol{\hat{F}})\big) \bigg\}. \end{align} \section{Analytic derivatives of the scattering cross section} \label{dixB} We may be interested in using scattering data to measure certain molecular quantities encoded in the structure factor. For example, the separation between a particular pair of atoms in a block of type $i$. We can represent these unknown molecular quantities as free parameters that we attempt to estimate by finding values for them that best fit experimental scattering data. This sort of refinement often requires the evaluation of a Jacobi matrix of derivatives. Consequently, it may be useful to have an expression for the analytic derivatives of the scattering cross section with respect to the structure factor's free parameters. Letting $\tau$ be such a free parameter, we have that \begin{align} \frac{\partial}{\partial \tau}\bigg(\frac{d\sigma}{d\Omega}\bigg) = &N_{a}N_{b} \delta(h - h_{0})\delta(k - k_{0}) \times \\ &\Tr\bigg(\Diag(\boldsymbol{\pi})(\partial \boldsymbol{F} + \boldsymbol{Q}^{-1}\boldsymbol{S}\boldsymbol{Q}\partial\boldsymbol{F}^{*} + \boldsymbol{Q}^{-1}\boldsymbol{S}^{*}\boldsymbol{Q}\partial \boldsymbol{F})\bigg) \nonumber \end{align} where $\partial\boldsymbol{F}$ is a matrix with elements \begin{equation} \partial F_{ij} = \frac{\partial F_{i}}{\partial \tau} F^{*}_{j} + F_{i}\frac{\partial F^{*}_{j}}{\partial \tau}. \end{equation} Here, the derivative $\frac{\partial F_{i}}{\partial \tau}$ may be expressed analytically if possible or approximated using a finite difference if necessary. \end{appendix} \bibliographystyle{iucr}
\section{Introduction} \vspace{-1mm} \emph{Reward poisoning} refers to an adversarial attack against reinforcement learning (RL) where the adversary manipulates the rewards in order to mislead the RL agent's learning process. It has been considered by many as a realistic threat against modern RL applications. Many real-world applications---such as recommendation systems \cite{zhao2018deep, chen2019top}, virtual/conversational assistants \cite{dhingra2016towards,li2016deep}---extract reward signals directly from user feedback and are thus prone to adversarial corruption. Reward poisoning has recently been study in various settings~\cite{zhang2008value,zhang2009policy,ma2018data,jun2018adversarial, peltola2019machine, altschuler2019best, liu2019data,ma2019policy, huang2019deceptive, rakhsha2020policy,rakhsha2020policy-jmlr,zhang2020adaptive}, but most of the prior work makes strong assumptions on the knowledge of the adversary. It is often assumed that the adversary has full knowledge of the environment (i.e., true rewards/transitions) or the agent's learning algorithm or both. Under such assumptions, attack strategies have been proposed that can mislead the agent to learn a nefarious policy with minimal perturbations to the rewards. However, in many applications, the adversary has limited knowledge about the environment or the agent's learning algorithm. For example, on e-commerce platforms, the adversary may take the form of a malicious seller who wants to mislead the platform's ranking system to promote their product by posting fake purchases, reviews, or comments. In such scenarios, the malicious sellers often have very limited knowledge about the dynamics of the market or the particular ranking algorithm currently used by the platform. In this setting, the attack strategies developed by prior works cannot be applied, and therefore one can argue that the security threats anticipated in these works might be pessimistic. To evaluate the security threat against RL agents in more realistic scenarios, in this work, we investigate the \emph{unknown-unknown} attack setting, where we assume that the adversary has \emph{no knowledge} about the environment or the agents' learning algorithm. To the best of our knowledge, we are the first to study reward-poisoning attacks against RL in this setting. Our contributions are three folds. \begin{enumerate} \item We develop a black-box attack strategy, \textsc{U2}{}, that can attack unknown RL agents (learners) in an unknown environment. \textsc{U2}{} operates without any prior knowledge of the environment or the learners and only requires that learners follow a no-regret RL algorithm. \vspace{1mm} \item We show that surprisingly, with appropriate choice of hyperparameters, \textsc{U2}{} can achieve an attack cost not much worse than the optimal white-box attack \cite{rakhsha2020policy,rakhsha2020policy-jmlr}. \vspace{1mm} \item As part of the \textsc{U2}{} attack, we develop an exploration subroutine that is of independent interest. This subroutine can turn any no-regret RL algorithm to apply to the reward-free/task-agnostic \cite{jin2020reward,zhang2020task} RL settings, where the learner is manipulated to explore the whole state-action space and allow data to be efficiently collected for arbitrary down-stream tasks (in our case the poisoning attack task). \end{enumerate} \section{Related Work} \paragraph{No-regret RL algorithms.} There is a long history of research on no-regret RL algorithms, and in the tabular MDP case, this problem is now considered well-understood. For example, in the episodic setting, the UCRL2 algorithm~\cite{auer2009near} achieves $O(\sqrt{H^4S^2AT})$ regret, where $H$ is the episode length, $S$ is the state space size, $A$ is the action space size, and $T$ is the total number of steps. The UCBVI algorithm \cite{azar2017minimax, dann2017unifying} achieves the optimal $O(\sqrt{H^2SAT})$ regret matching the lower bound \cite{osband2016lower, dann2015sample}. More recently, model-free methods \cite{jin2018q} and policy-based methods \cite{cai2020provably} have all been shown to be able to achieve the same optimal regret bound. In our work, we assume that the learner is implementing a no-regret algorithm, i.e. the regret scales sublinearly with $T$. We will show that the learning efficiency of the learner will ``backfire'' on itself in presence of an attack. \paragraph{Test-time attacks against RL.} Earlier work on adversarial attacks against RL studied \textit{test-time} attacks, where an adversary aims to manipulate the perceived state of the environment to mislead a fixed and deployed RL policy to perform an incorrect action~\cite{huang2017adversarial,lin2017tactics,kos2017delving, behzadan2017vulnerability}. For example, in Atari games, the attacker can make small pixel perturbation to a frame, similar to adversarial attacks on image classification ~\cite{goodfellow2014explaining}), to induce an action $\pi(s^\dagger_t) \neq \pi(s_t)$. Although test-time attacks can severely impact the performance of a deployed and fixed policy $\pi$, they do not modify $\pi$ itself, and thus the adversarial impact will disappear as soon as the attack terminates. On the other hand, poisoning attacks are \textit{training-time} attacks that aim at changing the learned policy and thus have a long-term effect. \paragraph{Reward poisoning.} Reward poisoning against RL has been first studied in \emph{batch RL}~\cite{zhang2008value,zhang2009policy,ma2019policy} where rewards are stored in a pre-collected data set by some behavior policy, and the attacker comes in to modify the batch data. Because all data are available to the attacker at once, the batch attack problem is somewhat easier. Our paper instead focuses on the \textit{online} RL attack setting where reward poisoning must be done on the fly. In online settings, reward poisoning is first introduced and studied in multi-armed bandits~\cite{ma2018data,jun2018adversarial,peltola2019machine,altschuler2019best,liu2019data}, where the authors show that adversarially perturbed reward can mislead standard bandit algorithms to pull a suboptimal arm or suffer large regret. \cite{huang2019deceptive, rakhsha2020policy,rakhsha2020policy-jmlr,zhang2020adaptive} studied online reward poisoning attacks in the white-box setting, where the adversary is assumed to have full knowledge of the MDP or the learning algorithm. Among them, \cite{huang2019deceptive,rakhsha2020policy,rakhsha2020policy-jmlr} focus on attacking the reward function itself, in which case the adversarial rewards are also functions of state and action, but independent of the learning process. \cite{zhang2020adaptive} focuses on attacking a Q-learning agent, and presents a more powerful attack that can depend on the RL victim's Q-table $Q_t$. Their analysis shows that such adaptive attacks can be exponentially faster in enforcing the target policy than non-adaptive attacks studied in prior works. In comparison, our work focus on the more challenging black-box setting, and our attack can be applied to any no-regret RL algorithms. Recently, \cite{sun2020vulnerability} empirically studied the problem of black-box poisoning attack against policy-based deep RL algorithms. Their algorithm \textsc{VA2C-P} takes an actor-critic structure and shows strong attack performance against state-of-the-art policy gradient algorithms, such as \textsc{REINFORCE}, A2C, PPO, etc. In comparison, our work provide a more general and theoretically sound black-box attack strategy against any efficient RL algorithms, not just policy gradient algorithms. \paragraph{Poisoning attacks and teaching.} Poisoning attacks is mathematically equivalent to the formulation of machine teaching with the teacher being the adversary~\cite{goldman1995complexity,zhu2015machine,singla2014near,DBLP:journals/corr/ZhuSingla18,DBLP:conf/nips/ChenSAPY18,mansouri2019preference,peltola2019machine}. A recent line of research has studied robust notions of teaching in settings where the teacher has limited information about the learner's dynamics~\cite{dasgupta2019teaching,DBLP:conf/ijcai/DevidzeMH0S20,cicalese-icml20-teaching-with-limited}, however, these works only consider supervised learning settings. \looseness-1There have been a number of recent works on teaching an RL agent via providing an optimized curriculum of demonstrations \cite{cakmak2012algorithmic,DBLP:conf/uai/WalshG12,hadfield2016cooperative,DBLP:conf/nips/HaugTS18,DBLP:conf/ijcai/KamalarubanDCS19,DBLP:conf/nips/TschiatschekGHD19,brown2019machine}. However, most of these works have focused on imitation-learning based RL agents who learn from provided demonstrations without any reward feedback \cite{osa2018algorithmic}. Given that we consider RL agents who find policies based on rewards, our work is technically very different from theirs. A recent work of \cite{DBLP:journals/corr/abs-2006-09324} studies the problem of teaching Q-learning algorithm, however, considers the white-box setting. There is also related literature on changing the behavior of an RL agent via \emph{reward shaping} \cite{ng1999policy,asmuth2008potential}; here the reward function is changed to only speed up the convergence of the learning algorithm while ensuring that the optimal policy in the modified environment is unchanged. \section{Problem Setup} We now formalize the problem addressed in this paper. \subsection{Preliminaries and Definitions} In this work, we assume that the environment is modeled as an episodic Markov Decision Process (MDP), defined by a tuple $M = (S, A, R, P, d_0, \gamma, H)$, where $S$ is a finite state space, $A$ is a finite action space, $R\colon S\times A \to \mathbb{R}$ is a reward function, $P\colon S \times A \times S \to [0, 1]$ is the transition probability function, $d_0$ is the initial state distribution, and $\gamma \in (0,1)$ is the discounting factor. We further assume that each episode terminates in at most $H$ steps almost surely. To simplify the notation, from here on, we will omit $d_0,\gamma,H$ and denote $M = (S,A,R,P)$; when clear from context, we will abuse the notation and also use $S,A$ to denote the size of the state space and action space respectively. At the beginning of each episode, the agent starts from a state sampled from the initial state distribution $d_0$. By taking action $a$ at state $s$, the agent receives a reward with expectation $R(s, a)$ and $\sigma^2$-sub-Gaussian noise for some $\sigma > 1$, and transits to state $s'$ with probability $P(s, a, s')$. A (deterministic) \textit{policy} is a mapping from states to actions, i.e., $\pi\colon S \to A$. We will use the standard state value function $V^\pi_M(s) = \expct{\sum_{\tau=0}^{\infty} \gamma^\tau r_\tau|s_0 = s, \pi}$ and the state-action value function $Q^\pi_M(s, a)= \expct{\sum_{\tau=0}^{\infty} \gamma^\tau r_\tau|s_0 = s, a_0 = a, \pi}$ where the expectations are over the stochasticity in both transition and reward functions. The optimal value functions are also defined as $Q^*_M(s, a) = \max_\pi Q^\pi_M(s, a)$ and $V^*_M(s) = \max_\pi V^\pi_M(s)$. Given initial state distribution $d_0$, the expected discounted reward $\rho^\pi_M$ of policy $\pi$ is defined as $ \expct{\sum_{\tau=0}^{\infty} \gamma^\tau r_\tau|s_0 \sim d_0, \pi}$ which gives $\rho^\pi_M = \expct{V^\pi_M(s) | s \sim d_0}$. Policy $\pi^*$ is said to be optimal if $\rho_M^{\pi^*} \ge \rho_M^\pi$ for every $\pi \ne \pi^*$ and $\epsilon$-robust optimal if $\rho_M^{\pi^*} \ge \rho_M^\pi + \epsilon$ also holds. We denote the expected discounted reward of the optimal policy by $\rho^*_M$. A policy $\pi$ is called $\epsilon$-optimal if it is at most $\epsilon$ worse than the optimal policy, i.e. $\rho_M^{\pi} \ge \rho_M^* - \epsilon$, and $\epsilon$-suboptimal otherwise. A step is called $\epsilon$-suboptimal if the action performed is $\epsilon$-suboptimal, i.e., $a_\tau \notin \{\pi(s_\tau) : \rho^\pi_M \ge \rho^*_M - \epsilon\}$ (action is not chosen by any $\epsilon$-optimal policy). Let $\mu^\pi$ be the state distribution of policy $\pi$ defined as $\mu^\pi_M(s) = (1 - \gamma) \sum_{\tau = 0}^{\infty} \gamma^\tau\Pr[s_\tau = s | \pi, d_0]$. Let $\ensuremath{\mu_\text{min}} = \min_{s, \pi} \mu^\pi_M(s)$. We assume under any policy $\pi$, all states are visited with a positive probability, i.e. $\ensuremath{\mu_\text{min}} > 0$. For policy $\pi$ and a state-action pair $(s,a)$ we define the neighboring policies of $\pi$ at $(s,a)$ as \begin{equation} \neighbor{\pi}{s}{a}(x) = \left\{\begin{array}{lc} \pi(x) & x \ne s \\ a & x = s \end{array}\right. \end{equation} \subsection{Attack Problem} \paragraph{Learners.} In this work, we focus on a \textit{population learning} scenario, in which a sequence of $L$ online RL agents take turns to interact with the environment. Such scenarios are relevant when many learners aim to learn the same (or similar) task, for example, RL agents as auto-pilots for autonomous transportation systems or RL agents as virtual personal assistants that learn independently to adapt to the preferences of their users. We will consider a setting where each learner interacts with the environment for a total of $T$ steps spread over several episodes, i.e., we index all the time steps over different episodes with $t = 1$ to $T$. At step $t$ of learner $l$'s interaction, the learner chooses action $a_t^{(l)}$ from state $s_t^{(l)}$, and the environment produces reward $r_t^{(l)}$ and next state $s_{t+1}^{(l)}$. The learner is moved to $s_{t+1}^{(l)}$, but the attacker changes the observed reward from $r_t^{(l)}$ to $r'^{(l)}_t$. The learners' goal is to maximize their discounted return. In this paper, we make the following assumption on the learners' performance: \begin{assumption}\label{ass:subopt} With probability of at least $1-\delta$, the learner performs $\epsilon$-suboptimal actions at most $\textsc{SubOpt}(T, \epsilon, \delta)$ times where $\textsc{SubOpt}$ is sublinear in $T$. Moreover, for some $\alpha, \beta > 0$, the learner is able to find an $\alpha$-optimal policy in $T$ steps with probability of at least $1 - \beta$. \end{assumption} \begin{remark} Assumption \ref{ass:subopt} is satisfied by most sample-efficient RL algorithms in the literature, such as UCRL2 \cite{auer2009near}, UCBVI \cite{azar2017minimax, dann2017unifying}, UCB-H \cite{jin2018q}, etc. In particular, one can show that a sub-linear regret is sufficient for the algorithm to satisfy both properties in Assumption \ref{ass:subopt}. \end{remark} \paragraph{Attacker.} In this paper, we study the \emph{black-box reward poisoning attack} problem. In this setting, the attacker has no prior knowledge about the rewards, the transitions, or the learners, except that the learners satisfy the $(\alpha,\beta)$ and $\textsc{SubOpt}(T, \epsilon, \delta)$ guarantees, but without knowing the actual parameters $\alpha,\beta$ and the $\textsc{SubOpt}$ function. The attacker has a \textit{target policy} $\ensuremath{\pi_{\dagger}}$ and wants to force the learners to follow this policy by making small changes in the observed rewards. This objective is formulated by an \textit{attack cost} function $\textsc{Cost}(T, L)$ defined as \begin{align}\label{eq:attack_cost} \frac{1}{L\cdot T} \sum_{l = 1}^{L}\sum_{t = 1}^{T} \left( |r^{(l)}_t - r'^{(l)}_t| + \lambda \ind{a^{(l)}_t \ne \ensuremath{\pi_{\dagger}}(s^{(l)}_t)} \right) \end{align} where $\ind{.}$ denotes the indicator function. In other words, the attacker needs to pay the cost $|r^{(l)}_t - r'^{(l)}_t|$ to change the reward from $r^{(l)}_t$ to $r'^{(l)}_t$ and will be penalised with an additional cost of $\lambda$ for each step the learner does not follow the target policy. The final objective is defined as the average cost over all $L \cdot T$ steps. Here, $\lambda > 0$ is a parameter balancing the trade-off between the cost incurred when learners do not follow the target policy and the cost incurred when changing the rewards. Throughout the attack process, the attacker only observes the interaction between the learners and the environment, i.e. $s_t^{(l)}, a_t^{(l)}, r_t^{(l)}$ and does not observe the internal process of learners' algorithms or the environment. \section{Overview of \textsc{U2}{} and Main Results} In this paper, we show a way that the attacker can enforce the target policy without any knowledge about either the environment or the learners. We present an \emph{explore-and-exploit} attack strategy, \textsc{U2}{}, and demonstrate its optimality by comparing its attack cost with the optimal white-box attack in the literature. In what follows, we first introduce a state-of-the-art white-box attack. Our black-box attack \textsc{U2}{} builds upon this white-box attack and is introduced in the second half of the section. \subsection{White-box Attack} To begin with, consider the white-box attack problem, in which the attacker has full knowledge of the MDP and the learner. White-box attacks have been studied extensively in the literature \cite{huang2019deceptive, rakhsha2020policy, zhang2020adaptive}. Here, we will utilize a state-of-the-art attack method that is agnostic to the learning algorithm and hence is suitable for designing \textsc{U2}{}. Below, we briefly summarize the intuition behind this method. The key idea behind the attack is to design the poisoned rewards $r'^{(l)}_t$ to come from a reward function $R'$ such that $\ensuremath{\pi_{\dagger}}$ is $\epsilon$-robust optimal in $M' = (S, A, R', P)$. This way, the only $\epsilon$-optimal policy will be the target policy, and all the steps in which $\ensuremath{\pi_{\dagger}}$ is not followed will be $\epsilon$-suboptimal. Thus, the learner does not follow the target policy in only sublinear number of steps in $T$. While such a reward function can successfully force the target policy, it may incur a large attack cost because $R'$ may be different from $R$ on the target actions (actions used in the target policy). One way to avoid this is to add another constraint when designing the adversary reward $R'$ such that the rewards on the target actions remain unchanged. Consequently, the attacker will only pay the cost $\lambda + |r^{(l)}_t - r'^{(l)}_t|$ on the steps the target policy is not followed, which will only happen a number of times sublinear in $T$ if the agent is a no-regret RL learner. Specifically, this adds a constraint $R'(s, \ensuremath{\pi_{\dagger}}(s)) = R(s, \ensuremath{\pi_{\dagger}}(s))$ for every state $s$. Letting $R' = R - \Delta$ for some $\Delta\colon S \times A \to \mathbb{R}$, this attack can be performed by setting \begin{align} \label{eq.attack} r'^{(l)}_t = r^{(l)}_t - \Delta(s^{(l)}_t, a^{(l)}_t) \quad \forall l, t. \end{align} One can bound the cost of this attack using the $\textsc{SubOpt}(T, \epsilon, \delta)$ guarantee, obtaining the following result: \begin{lemma} \label{prop.fix.attack} Assume the attacker performs the attack described in \eqref{eq.attack} for some $\Delta\colon S \times A \to \mathbb{R}$ on all the learners. Then, with probability of at least $1 - \delta$, \begin{align} \textsc{Cost}(T, L) \le \left(\norm{\Delta}_\infty + \lambda \right) \cdot \frac{\textsc{SubOpt}(T, \epsilon, \frac{\delta}{L})}{T} \end{align} \end{lemma} The bound follows directly from the fact that the attacker incurs no cost on steps when $a^{(l)}_t = \ensuremath{\pi_{\dagger}}(s^{(l)}_t)$ and the cost on other steps which are at most $L \cdot \textsc{SubOpt}(T, \epsilon, \frac{\delta}{L})$ steps, is at most $\norm{\Delta}_\infty + \lambda $. The problem of finding the $\Delta$ that minimizes the upper bound in Lemma \ref{prop.fix.attack} can be formulated as the following program: \begin{align} \label{prob.full.knowledge} \tag{P1} &\quad \min_{\Delta} \quad \norm{\Delta}_{\infty} \\ \notag &\quad \mbox{ s.t. } \quad \text{$\ensuremath{\pi_{\dagger}}$ is $\epsilon$-robust opimal in $(S, A, R - \Delta, P)$}\\ &\qquad \quad \quad \forall s: \quad \Delta(s, \ensuremath{\pi_{\dagger}}(s)) = 0 \notag. \end{align} If the attacker has full knowledge of the MDP, it can directly solve for \eqref{prob.full.knowledge}, which has been shown to have a closed-form solution \cite{rakhsha2020policy}: \begin{align} \Delta^*_M(s, a) = \pos{ Q^{\ensuremath{\pi_{\dagger}}}_M(s, a) - V^{\ensuremath{\pi_{\dagger}}}_M(s) + \frac{\epsilon}{\mu_M^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}(s)}} \end{align} for $a \ne \ensuremath{\pi_{\dagger}}(s)$, and $ \Delta^*_M(s, \ensuremath{\pi_{\dagger}}(s)) = 0$ for every $s$. Here, $\pos{x} = \max(0, x)$. For completeness, we state the above result in the following lemma: \begin{lemma}\cite{rakhsha2020policy}. \label{lemma.full.knowledge} The optimal solution for \eqref{prob.full.knowledge} is $\Delta^*_M$. Moreover, $\Delta\colon S \times A \to \mathbb{R}$ is a feasible solution of \eqref{prob.full.knowledge} if and only if for every state $s$ and action $a$, $\Delta(s, a) \ge \Delta^*_M(s, a)$ and $\Delta(s, \ensuremath{\pi_{\dagger}}(s)) = 0$. \end{lemma} Note that Lemma \ref{lemma.full.knowledge} implies that the choice of norm in the objective of \eqref{prob.full.knowledge} can be arbitrary, while the optimal solution $\Delta^*_M(s, a)$ remains unchanged, showing the robustness of this solution. This optimal white-box attack serves as a baseline for our black-box attack strategy. \subsection{Black-box Attack} In this work, however, we study the problem in which the attacker has no knowledge of the MDP's rewards/transitions, and thus can no longer directly solve \eqref{prob.full.knowledge} to perform the attack. In this setting, we propose an attack strategy that consists of two separate phases. \textbf{Exploration phase.} To begin with, the attacker aims to collect data on the environment by providing rewards that encourage the learners to explore the whole MDP. This goal is achieved by providing the following simple yet effective rewards: \begin{align} \label{eq.explore} r'_t \sim \text{Bernoulli}(\frac{1}{2}), \quad \forall t. \end{align} \looseness-1We will show that this simple reward function enforces the learner to provably visit all $(s,a)$ pairs sufficiently often and allows the attacker to learn about the MDP rewards and transitions to perform the attack. We discuss the guarantee and the intuition of this simple reward function in Section \ref{sec:explore.phase}. \textbf{Attack phase.} Once the attacker has gathered enough observations, it can start to attack the rest of the learners by estimating a set of plausible MDPs ${\mathcal{M}}$. It then solves for a robust perturbation $\Delta$ that is guaranteed to enforce the target policy $\ensuremath{\pi_{\dagger}}$ on all $M\in{\mathcal{M}}$. This robust attack problem can be formulated as a robust version of problem \eqref{prob.full.knowledge}: \begin{align} \label{prob.partial.knowledge} \tag{P2} &\quad \min_{\Delta} \quad \norm{\Delta}_{\infty} \\ \notag &\quad \mbox{ s.t. } \quad \forall (S, A, \widetilde R, \widetilde P) \in {\mathcal{M}}:\\ \notag &\qquad \quad \qquad \text{$\ensuremath{\pi_{\dagger}}$ is $\epsilon$-robust optimal in $(S, A, \widetilde R - \Delta, \widetilde P)$} \\ \notag &\qquad \quad \quad \forall s: \quad \Delta(s, \ensuremath{\pi_{\dagger}}(s)) = 0. \end{align} In Section~\ref{sec.attack.phase}, we describe the process of solving \eqref{prob.partial.knowledge} in detail. Following the two-phase procedure, the attack cost of \textsc{U2}{} can be upper bounded by the following theorem: \begin{theorem} \label{theorem.final} For any $m > 0$ and $p \in (0, 1)$, assume that $\alpha < \frac{\ensuremath{\mu_\text{min}} }{2\sqrt{2}}$ and $\beta < \frac{1}{8SA}$, then, with probability of at least $1 - 4p$, the cost of \textsc{U2}{} is bounded by \begin{align*} \textsc{Cost}(T, L) \le\; \frac{k_0}{L}\cdot \left(\norm{R}_\infty + \sigma \sqrt{2\log \frac{2k_0T}{p}}+ 1+ \lambda\right)\\ \quad + \ (\norm{\Delta^*_M}_\infty + \lambda + m)\cdot \frac{\textsc{SubOpt}(T, \epsilon, \frac{p}{L})}{T} \end{align*} where $k_0$ is a function of MDP $M$, $p$, $\alpha$, $\beta$, $\lambda$, $m$, $\epsilon$, and $L$ as defined in \eqref{eq.def.k0}. \end{theorem} The given bound on $\textsc{Cost}(T, L)$ consists of two terms: The first term is the cost of the exploration phase and is of the order $O(k_0/L)$, where $k_0 = O(\log L)$. Therefore, the first term is diminishing in $L$ and $k_0 \ll L$ for large enough $L$. The second term is $m \cdot \textsc{SubOpt}(T, \epsilon, \frac{p}{L}) / T$ worse than the attack cost achievable by the optimal white-box attack as in Lemma \ref{lemma.full.knowledge}. $m$ is a hyperparameter of \textsc{U2}{} that dictates how closely the attack cost should match with the optimal white-box attack. The second term is diminishing in $T$ due to the assumption that $\textsc{SubOpt}(T, \epsilon, \frac{p}{L})$ is sublinear in $T$. Therefore, \textsc{U2}{} can be viewed as a \emph{no-regret} attack strategy, whose averaged attack cost diminishes to zero as $T$ and $L$ go to infinity, as is achieved by the attack of \cite{rakhsha2020policy} in the white-box setting. \begin{algorithm}[tb] \caption{\textsc{U2}} \label{alg:example} \textbf{Input:} $S, A, \gamma, d_0, \sigma, p, \epsilon, m$\\ \textbf{Initialize:} $l \leftarrow 1$\\ \textbf{Exploration Phase:} \begin{algorithmic} \REPEAT \FOR{$t=1$ {\bfseries to} $T$} \STATE {Set $r'^{(l)}_t \sim\text{Bernoulli}(\frac{1}{2})$.} \ENDFOR \STATE Calculate confidence set $\mathcal{M}$ of possible MDPs. \STATE {$l \leftarrow l+1$} \UNTIL{${\mathcal{M}}$ satisfies condition \eqref{eq.stop.condition}.} \end{algorithmic} \textbf{ Attack Phase:} \begin{algorithmic} \STATE Solve \eqref{prob.partial.knowledge} to get $\widehat{\Delta}\colon S\times A \to \mathbb{R}$ \WHILE{$l \le L$} \FOR{$t=1$ {\bfseries to} $T$} \STATE {Set $r'^{(l)}_t = r^{(l)}_t - \widehat{\Delta}(s^{(l)}_t, a^{(l)}_t)$.} \ENDFOR \STATE {$l \leftarrow l+1$} \ENDWHILE \end{algorithmic} \end{algorithm} \section{Technical Details of \textsc{U2}} In what follows, we present the details of the \textsc{U2}{} strategy in both the exploration phase and the attack phase. We will describe both the algorithmic intuitions behind the procedure and sketch high-level building blocks of the theoretical analysis for Theorem \ref{theorem.final}. The detailed proofs are deferred to the Appendix. \subsection{Exploration Phase}\label{sec:explore.phase} In this phase, the goal is to collect observations on the MDP to estimate its parameters, which will be used in the attack phase to find an effective reward perturbation. With more observations, the attacker will be able to build smaller confidence set ${\mathcal{M}}$ on the environment MDP and find a $\widehat{\Delta}$ of smaller norm. In the extreme case where the attacker gathers an infinite number of observations on all $(s,a)$ pairs, it can find the optimal $\Delta^*_M$ and match the optimal white-box attack. In order to gather observations on all $(s,a)$ pairs, the attacker needs to design adversarial rewards that encourage the learners to explore the environment. Our key observation is that, despite not knowing anything about the MDP or the learner, the attacker can still utilize the learners' learning guarantee to provably collect observations. The idea is to draw $r'_t$ from a reward function $R_E$, such that finding a nearly optimal policy in $M_E = (S, A, R_E, P)$ requires properly exploring all states and actions. This condition can be met by choosing $R_E$ in a way that the gap of the optimal Q function is small, i.e. the $Q^*_{M_E}(s, a)$ values are similar for different actions $a$. Specifically, we show that the uniform Bernoulli reward function in \eqref{eq.explore} effectively enforces the learner to explore, as detailed in the following lemma. \begin{lemma} \label{lemma.exploration.basic} Let $s, a$ be an arbitrary state and action pair, and $g(s, a) = \min_{\pi: \pi(s) = a} \mu_M^\pi(s)$. Assume $4 \beta \le \delta$ and $ \frac{\alpha}{g(s, a)} < \frac{1}{2\sqrt{2}}$. If the feedback as in \eqref{eq.explore} is given to a learner, then at the end of $T$ steps, with probability of at least $1 - \delta$, the action $a$ is chosen from state $s$ for at least \begin{equation} \frac{g(s, a)^2}{\alpha^2} \cdot \frac{ c_1 \cdot (\log\; \frac{\delta}{4\beta})^2}{\log \frac{8}{\delta}+ c_2 \cdot (\log\; \frac{\delta}{4 \beta})} \end{equation} number of times, where $c_1 = 0.02$ and $c_2 = 1.34$. \end{lemma} Lemma \ref{lemma.exploration.basic} provides a lower bound on the number of data points that will be collected by each learner under our exploratory reward function. The proof is based on the following intuition: if the learner visits some $(s, a)$ insufficiently with high probability, then it will make a similar decision about the optimal policy on MDPs that differ from $M_E$ only in $(s, a)$. In particular, we consider two alternative MDPs, $M^+_E$ in which $(s, a)$ has a higher reward and is used in all $\alpha$-optimal policies, and $M^-_E$ in which $(s, a)$ has a smaller reward and is not used in any of the $\alpha$-optimal policies. The likelihood of a sequence of observations with few visits to $(s, a)$ is similar under all three MDPs $M^+_E$, $M^-_E$, and $M_E$. If the learner's actions in $M_E$ lead to a high probability for these sequences, then these sequences will have a high likelihood under both $M^+_E$ and $M^-_E$ too. Then, no matter which policy the learner chooses given these sequences of observations, the learner will make a mistake with high probability in one of $M^+_E$ and $M^-_E$. This high-level idea of the construction is similar to the classic lower bound construction in stochastic bandits \cite{mannor2004sample}. The detailed proof of this lemma is deferred to the Appendix. After each learner's interaction in the exploration phase, the attacker builds a confidence set ${\mathcal{M}}$ for plausible environment MDPs for two main purposes. First, these sets are used in the exploration phase to check whether the gathered data is enough for the attack phase and the attacker can stop the exploration. Second, the last set is used in the attack phase to find an effective attack in the environment. After each learner, let $N(s, a)$ be the number of times state-action pair $(s, a)$ is observed, and let $\ensuremath{N_{\textnormal{min}} } = \min_{s, a} N(s, a)$. If $\ensuremath{N_{\textnormal{min}} }>0$, we define the following empirical estimates of $R(s, a)$ and $P(s, a, s')$: \begin{align} \widehat{R}(s, a) &= \frac{ \sum_{t, l}\ind{s^{(l)}_t = s, a^{(l)}_t = a} \cdot r^{(l)}_t }{ N(s, a) }\\ \widehat{P}(s, a, s') &= \frac{ \sum_{t, l}\ind{s^{(l)}_t = s, a^{(l)}_t = a, s^{(l)}_{t+1} = s'} }{ N(s, a) }\nonumber \end{align} We will also define the following confidence sets of reward ${\mathcal{R}}(s, a)$ and transition ${\mathcal{P}}(s, a)$ as \begin{align} {\mathcal{R}}(s, a) =& \left\{ r\in \mathbb{R}: |r - \widehat{R}(s,a)| \le \frac{u}{\sqrt{N(s, a)}}) \right\} \\ {\mathcal{P}}(s, a) =& \left\{ d\in \Lambda(S): \norm{d - \widehat{P}(s,a, \cdot)}_1 \le \frac{w}{\sqrt{N(s, a)}} \right\}\nonumber \end{align} where $\Lambda(S)$ is the probability simplex over $S$ and \begin{gather} u = \sqrt{2\sigma^2\log(2SAL/p)},\\ w = \sqrt{2\log(2SAL/p) + 2S\log 2}.\nonumber \end{gather} These two confidence intervals $u,w$ are direct consequences of Hoeffding's Inequality and \cite{weissman2003inequalities}. Now let the confidence set ${\mathcal{M}}$ be the set of all MDPs $(S, A, \widetilde{R}, \widetilde{P})$ such that for every $s, a$, $\widetilde{R}(s, a) \in {\mathcal{R}}(s, a)$ and $\widetilde{P}(s, a, .) \in {\mathcal{P}}(s, a)$. This gives us the following lemma. \begin{lemma} \label{lemma.confidence} With probability of at least $1-p/L$, $M \in {\mathcal{M}}$. \end{lemma} The failure probability of $p/L$ ensures that following this scheme to build ${\mathcal{M}}$ after each learner, with a probability of at least $1 - p$, $M$ will always be in ${\mathcal{M}}$. The attacker continues the exploration until ${\mathcal{M}}$ is small enough to perform a near-optimal attack. Since this decision involves technical details of the attack phase, we turn back to it in Section \ref{sec.stopping.conditions}. \begin{remark} It's worth mentioning that the exploration subroutine and the guarantee in Lemma \ref{lemma.exploration.basic} are of independent interests to pure exploration problems in reinforcement learning. A number of recent works study the problem of task-agnostic exploration \cite{jin2020reward, zhang2020task}, where the goal is to design a learner that can explore the MDP and collect data efficiently to prepare for any downstream task. In \cite{zhang2020task}, their algorithm \textsc{UCBZero} can be viewed as a \textsc{UCB-H} \cite{jin2018q} algorithm under uniform reward, and they left as an open problem whether other no-regret algorithms can be transformed into a task-agnostic exploration algorithm. Our analysis in this section provides a positive answer. We show that any no-regret RL algorithm can provably explore all (s,a) pairs in the MDP given a simple uniform reward function. \end{remark} \subsection{Attack Phase}\label{sec.attack.phase} After collecting enough data on the environment's dynamics, the attacker moves on to the attack phase in which the target policy is enforced to the remaining learners. In the beginning of the attack phase, the attacker uses the last ${\mathcal{M}}$ built in the exploration phase to find an appropriate $\widehat \Delta$ by solving problem \eqref{prob.partial.knowledge}. It then provides rewards as in \eqref{eq.attack} with $\Delta = \widehat{\Delta}$ to all the remaining learners. To solve \eqref{prob.partial.knowledge}, note that one can utilize Lemma \ref{lemma.full.knowledge} to rewrite the first constraint of \eqref{prob.partial.knowledge} as \begin{align} \label{eq.delta.condition} \forall s, a: \quad \Delta(s, a) \ge \max_{\widetilde{M} \in {\mathcal{M}}} \Delta^*_{\widetilde{M}} (s, a). \end{align} Thus, the attacker needs to upper bound $\Delta^*_{\widetilde{M}} (s, a)$ for $\widetilde{M} \in {\mathcal{M}}$ to find a feasible solution for \eqref{prob.partial.knowledge}. For policy $\pi$, define $V^\pi_\text{low}(s) = \min_{\widetilde{M} \in {\mathcal{M}}} V^\pi_{\widetilde{M}}(s)$ and $Q^\pi_\text{high}(s, a) = \max_{\widetilde{M} \in {\mathcal{M}}} Q^\pi_{\widetilde{M}}(s, a)$. Also let $\mu^\pi_\text{low}(s) = \min_{\widetilde{M} \in {\mathcal{M}}} \mu^\pi_{\widetilde{M}}(s)$. The attacker sets \begin{align} \widehat{\Delta}(s, a) = \pos{ Q^{\ensuremath{\pi_{\dagger}}}_\text{high}(s, a) - V^{\ensuremath{\pi_{\dagger}}}_\text{low}(s) + \frac{\epsilon}{\mu_\text{low}^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}(s)} } \end{align} for $a \ne \ensuremath{\pi_{\dagger}}(s)$, and $\widehat{\Delta}(s, \ensuremath{\pi_{\dagger}}(s)) = 0$. By the definitions, it is clear that $\widehat{\Delta}$ satisfies condition \eqref{eq.delta.condition}, and therefore, is a feasible solution for \eqref{prob.partial.knowledge}. Computationally, the attacker can calculate quantities $V^\pi_\text{low}$, $Q^\pi_\text{high}$, and $\mu^\pi_\text{low}$ using \emph{robust policy evaluation} \cite{iyengar2005robust,nilim2004robust}, a standard robust control procedure that is also used in no-regret model-based RL algorithms such as UCRL2 \cite{auer2009near}. Robust policy evaluation calculates the worst-case value function of a policy $\pi$, i.e. $V^\pi_\text{low}(s)$, when the exact model of environment is not available, and the transition distributions and rewards are just known to be in certain sets of possible values (usually confidence intervals obtained from observations). Specifically, if $R(s, a) \in {\mathcal{R}}(s, a)$ and $P(s, a, .) \in {\mathcal{P}}(s, a)$ for every $s, a$, the procedure sets $v^{\pi}_0(s) = 0$ for every state $s$, and applies the following iterative updates: \begin{equation} v^{\pi}_{i+1}(s) = \min_{r \in {\mathcal{R}}(s, \pi(s))} r + \gamma \min_{p \in \mathcal{P}(s, \pi(s))} \mathbb{E}_{s'\sim p}v^{\pi}_{i}(s') \end{equation} Then, it is shown that $V^\pi_\text{low}(s) = \lim_{i \rightarrow \infty} v^{\pi}_{i}(s)$. Note that with our choices of ${\mathcal{R}}$ and ${\mathcal{P}}$, each iteration of robust policy evaluation involves $S$ special linear programming problems that can be solved in total time of $\mathcal{O}(S^2)$ \cite{strehl2008analysis}. Consequently, one execution of the robust policy evaluation algorithm gives all the $V^\pi_\text{low}(s)$ values for $s\in S$. The same algorithm can be used to obtain values $V^\pi_\text{high}(s) = \max_{\widetilde{M} \in {\mathcal{M}}} V^\pi_{\widetilde{M}}(s)$ by substituting $\min$ with $\max$. Then, one can set \begin{equation} Q^\pi_\text{high}(s, a) = \max_{r \in {\mathcal{R}}(s, a)} r + \gamma \max_{p \in \mathcal{P}(s, a)} \mathbb{E}_{s'\sim p} V^\pi_\text{high}(s') \end{equation} Note that this is again a linear programming problem and can be solved in the same manner as each iteration of the robust policy evaluation. Next, we show how to compute $\mu^\pi_\text{low}(s)$. For state $s$, define the reward function $R_s(x, a) = \ind{x = s}$, and for $\widetilde{M} = (S, A, \widetilde{R}, \widetilde{P}, \gamma, d_0)$ let $\widetilde{M}_s = (S, A, R_s, \widetilde{P}, \gamma, d_0)$. We have $\mu^\pi_{\widetilde{M}}(s) = (1 - \gamma) \cdot \rho^\pi_{\widetilde{M}_s}$. Thus, we can write \begin{equation} \mu^\pi_\text{low}(s) = (1 - \gamma) \cdot \sum_{x} d_0(x)\cdot \left( \min_{\widetilde{M} \in {\mathcal{M}}} V^\pi_{\widetilde{M}_s}(x) \right) \end{equation} Values of $\min_{\widetilde{M} \in {\mathcal{M}}} V^\pi_{\widetilde{M}_s}(x)$ for $x \in S$ can again be calculated using the robust policy evaluation used for $V^\pi_\text{low}$, with only difference that now the reward function is known to be in the singleton set $\{R_s\}$. As one execution of the robust policy evaluation is needed for each $\mu_\text{low}^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}(s)$ in $\widehat \Delta(s, a)$, the whole attack phase has time complexity of $\mathcal{O}(SA)$ runs of robust policy evaluation. \begin{remark} \label{remark:attack_phase} The robust attack procedure can also be used in the case where the attacker has a set of prior observations of the environment, and wishes to enforce the target policy to all the learners and not use any of the learners to collect more data. Such scenarios are applicable, for example, when the attacker is able to observe the natural behavior of many other learners before starting the attack. Again, let $N(s, a)$ be the number of times $(s, a)$ is observed in the data and let $\ensuremath{N_{\textnormal{min}} } = \min_{s, a} N(s, a)$. Define \begin{align*} e(s, a) = 2\ensuremath{e_Q } + \frac{\epsilon}{ \pos{ \mu_M^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}(s) - \ensuremath{e_\mu }} } - \frac{\epsilon}{\mu_M^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}(s)} \end{align*} where \begin{align*} \ensuremath{e_Q } = \frac{2u + 2\gamma \cdot \ensuremath{R_\text{range}} \cdot w}{(1 - \gamma)^2\cdot \sqrt{\ensuremath{N_{\textnormal{min}} }}}\;,\; \ensuremath{e_\mu } = \frac{2\gamma \cdot w}{(1 - \gamma)\cdot \sqrt{\ensuremath{N_{\textnormal{min}} }}}. \end{align*} Here, $\ensuremath{R_\text{range}} = \max_{s, a} R(s, a) - \min_{s, a}R(s, a)$. As we show in the Appendix, this attack with probability of at least $1 - 2p$ achieves an attack cost of at most \begin{align}\label{eq:prior_obs} \frac{1}{T}\cdot \left(\norm{\Delta^*_M + e}_\infty + \lambda \right) \cdot \textsc{SubOpt}(T, \epsilon, \frac{p}{L}) \end{align} This bound is achieved by bounding the difference of values $V^\pi_\text{low}(s)$, $Q^\pi_\text{high}(s, a)$, and $\mu^\pi_\text{low}(s)$ from their true values, i.e. the error of estimates, based on the size of confidence intervals on rewards and transitions. The error for $V^\pi_\text{low}(s)$ and $Q^\pi_\text{high}(s, a)$ is shown to be at most $\ensuremath{e_Q }$, and for $\mu^\pi_\text{low}(s)$ it is at most $\ensuremath{e_\mu }$. Note that with infinite number of observations on all $(s, a)$ pairs, $\ensuremath{e_Q }$, $\ensuremath{e_\mu }$ will be zero and this attack matches the guarantee for the optimal white-box attack. \end{remark} \subsection{Conditions for Stopping Exploration}\label{sec.stopping.conditions} A key part of the \textsc{U2}{} attack strategy is to decide when to end the exploration phase and start the attack phase. If the exploration is stopped earlier, the attacker is forced to make a large perturbation to the reward to compensate for the uncertainty, and thus incur a larger attack cost in the attack phase. On the other hand, a longer exploration phase allows the attacker to estimate $\Delta^*_M$ more accurately, but incurs a larger attack cost in the exploration phase. In \textsc{U2}{}, the attacker explores the MDP until it is guaranteed that the per step cost of attack phase is at most $m$-larger then the per step cost of the optimal white-box attack, i.e. for every $s, a$ \begin{align} \label{eq.stop.goal} \widehat \Delta (s, a) + \lambda \le \Delta^*_M(s, a) + \lambda + m \end{align} where $m > 0$ is a hyperparameter to adjust the amount of the exploration. After each learner in the exploration phase, the attacker calculates the confidence intervals ${\mathcal{R}}$, ${\mathcal{P}}$ and then the $\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s)$ values for every $s, a$. Let $R_\text{high}(s, a) = \max {\mathcal{R}}(s, a)$ and $R_\text{low}(s, a) = \min {\mathcal{R}}(s, a)$. Define \begin{align} \ensuremath{\widehat{R}_\text{range}} &\triangleq \max_{s, a} R_\text{high}(s, a) - \min_{s,a} R_\text{low}(s, a)\\ \ensuremath{\widehat{e}_Q } &\triangleq \frac{2u + 2\gamma \cdot \ensuremath{\widehat{R}_\text{range}} \cdot w}{(1 - \gamma)^2\cdot \sqrt{\ensuremath{N_{\textnormal{min}} }}} \end{align} The exploration phase ends if for every state and action pair $s, a$ we have \begin{align} \label{eq.stop.condition} 2\ensuremath{\widehat{e}_Q } + \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s)} - \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s) + \ensuremath{e_\mu }} \le m \end{align} We show that given the event $M \in {\mathcal{M}}$, we have $V^{\ensuremath{\pi_{\dagger}}}_M(s) \le V^{\ensuremath{\pi_{\dagger}}}_\text{low}(s) + \ensuremath{\widehat{e}_Q }$, $Q^{\ensuremath{\pi_{\dagger}}}_M(s, a) \ge Q^{\ensuremath{\pi_{\dagger}}}_\text{high}(s, a) - \ensuremath{\widehat{e}_Q }$, and $\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) \le \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s) + \ensuremath{e_\mu }$. Consequently, it is shown that the goal \eqref{eq.stop.goal} is satisfied once \eqref{eq.stop.condition} is satisfied for every $s, a$. This stopping condition gives a simple bound on the cost of the attack phase. However, the number of learners that will be used for exploration, is also important as it decides the cost of the exploration phase, and should be bounded. Let \begin{align} \notag N_0 = \max\bigg[& \left(\frac{2u}{\ensuremath{R_\text{range}} }\right)^2, \left(\frac{8u + 16 \gamma \cdot \ensuremath{R_\text{range}} \cdot w}{(1 - \gamma)^2 \cdot m} \right)^2 \\ & \left( \frac{2\gamma \cdot w}{1 - \gamma }\cdot \frac{6\epsilon + m\cdot \ensuremath{\mu_\text{min}} }{m\cdot\ensuremath{\mu_\text{min}} ^2} \right) ^2 \bigg] \end{align} Then define $k_0$ as \begin{align} \label{eq.def.k0} 8\log (\frac{1}{p}) + \frac{4\alpha^2N_0}{\ensuremath{\mu_\text{min}} ^2} \cdot \frac{\log 16SA+ c_2 \cdot (\log\; \frac{1}{8SA\cdot \beta})}{ c_1 \cdot (\log\; \frac{1}{8SA\cdot \beta})^2} \end{align} where $c_1 = 0.02$ and $c_2 = 1.34$. We then have the following lemma: \begin{lemma}\label{lemma:k0} With probability of at least $1 - 2p$, \textsc{U2}{} uses at most $k_0$ learners as per \eqref{eq.def.k0} in the exploration phase. \end{lemma} This bound is based on the guarantee from Lemma \ref{lemma.exploration.basic} on the effectiveness of the exploration phase in collecting observations and analysis of how more observations shrink the confidence intervals and reduce the suboptimality of the attack phase. Together with the guarantee of Eq. \eqref{eq.stop.goal}, Lemma \ref{lemma:k0} gives us the upper bound on the total attack cost in Theorem \ref{theorem.final}. \section{Conclusions and Discussion} In this work, we studied the challenging problem of black-box reward poisoning attacks against reinforcement learning, where the adversary starts off having no information on either the environment or the agents' learning algorithm. We proposed an explore-and-exploit style attack \textsc{U2}, that can ``hijack'' the RL agents to efficiently collect data about the environment, and then carry out a near-optimal attack. We showed that surprisingly, with appropriate choice of hyperparameters, \textsc{U2}{} can achieve an attack cost not much worse than the optimal white-box attack. Despite the effectiveness of our attack, there is still scope for improvement. In particular, it might be possible to design attack strategies that balance and transit between exploration and exploitation more adaptively. A different perspective is to view the black-box attack problem as a \emph{structured bandit problem} \cite{mersereau2009structured}, where each time step consists of the interaction with one learner, and each reward function $r\in \R^{S\times A}$ is an arm. The structure among the arms is captured by the underlying MDP and agents' learning algorithm. Then, minimizing the total attack cost corresponds exactly to a regret minimization problem in this structured bandit, where the attacker gradually uncovers the structure from the observations in each iteration. Progress along this direction will give us a more precise characterization of black-box attacks against reinforcement learning and will allow us to design defense countermeasures more effectively. \section{Proofs for the exploration phase}\label{sec:proof_exp} In this section, we first prove Lemma \ref{lemma.exploration.basic} which lower-bounds the number of visits to each $(s,a)$ pair by each learner in the exploration phase. Then we give the details of Lemma~\ref{lemma.confidence}. \begin{lemma}[Lemma \ref{lemma.exploration.basic}] \label{lemma.exploration.basic1} Let $s, a$ be an arbitrary state and action pair, and $g(s, a) = \min_{\pi: \pi(s) = a} \mu_M^\pi(s)$. Assume $4 \beta \le \delta$ and $ \frac{\alpha}{g(s, a)} < \frac{1}{2\sqrt{2}}$. If the feedback as in \eqref{eq.explore} is given to a learner, then at the end of $T$ steps, with probability of at least $1 - \delta$, the action $a$ is chosen from state $s$ for at least \begin{equation} \frac{g(s, a)^2}{\alpha^2} \cdot \frac{ c_1 \cdot (\log\; \frac{\delta}{4\beta})^2}{\log \frac{8}{\delta}+ c_2 \cdot (\log\; \frac{\delta}{4 \beta})} \end{equation} number of times, where $c_1 = 0.02$ and $c_2 = 1.34$. \end{lemma} \begin{proof}[\bf Proof of Lemma \ref{lemma.exploration.basic1}] We will show that with probability of at least $1 - \delta$, we have \begin{align} N(s, a) \ge t^* \triangleq \frac{g(s, a)^2}{\alpha^2} \cdot \frac{ c_1 \cdot (\log\; \delta/4\beta)^2}{\log \frac{8}{\delta}+ c_2 \cdot (\log \;\delta/4\beta)}. \end{align}. We consider three possible reward distributions during the exploration phase. We call these possibilities "\textit{hypotheses}" $H_0, H_1$ and $H_2$. $H_0$ is the actual reward distribution simulated for the learner: \begin{align} H_0:& \quad r'_t \sim \text{Bernoulli}(\frac{1}{2}) \end{align} $H_1$ is an alternative reward distributions in which $s, a$ is taken in all $\alpha$-optimal policies, and $H_2$, in contrary, is a reward distributions in which $s, a$ is not taken in any $\alpha$-optimal policies: \begin{align} H_1:& \quad r'_t \sim \begin{cases} \text{Bernoulli}(\frac{1}{2} + \frac{\alpha}{g(s, a)}) & \mbox{if} \; s_t = s, a_t = a\\ \text{Bernoulli}(\frac{1}{2}) & \mbox{otherwise} \end{cases}\\ H_2:& \quad r'_t \sim \begin{cases} \text{Bernoulli}(\frac{1}{2} - \frac{\alpha}{g(s, a)}) & \mbox{if} \; s_t = s, a_t = a\\ \text{Bernoulli}(\frac{1}{2}) & \mbox{otherwise}\\ \end{cases} \end{align} Let $M_E^+ = (S, A, R_E^+, P)$ be the MDP with rewards described in $H_1$ and Let $M_E^- = (S, A, R_E^-, P)$ be the MDP with rewards described in $H_2$. The following lemma formalizes this construction. \begin{lemma} \label{lemma.hypothesis.optimality} For every $\alpha$-optimal policy $\pi$ in $M_E^+$, we have $\pi(s) = a$. In contrast, for every $\alpha$-optimal policy $\pi$ in $M_E^-$, we have $\pi(s) \ne a$. \end{lemma} \begin{proof} Let $\pi$ and $\pi'$ be arbitrary policies such that $\pi(s) \ne a$ and $\pi'(s) = a$. We have $\rho^{\pi}_{M_E^+} = \rho^{\pi}_{M_E^-} = \frac{1}{2}$. We can also write \begin{align} \rho^{\pi'}_{M_E^+} = \sum_{s'\in S} \mu^{\pi'}_{M_E^+}(s')R_E^+(s', \pi'(s')) = \frac{1}{2} + \frac{\alpha}{g(s, a)} \mu^{\pi'}_{M}(s) \ge \frac{1}{2} + \alpha \end{align} Thus, $\rho^{\pi}_{M_E^+} \le \rho^{\pi'}_{M_E^+} - \epsilon$, which shows $\pi$ is not $\alpha$-optimal and proves the first part. For the second part, we write \begin{align} \rho^{\pi'}_{M_E^-} = \sum_{s'\in S} \mu^{\pi'}_{M_E^-}(s')R_E^-(s', \pi'(s')) = \frac{1}{2} - \frac{\alpha}{g(s, a)} \mu^{\pi'}_{M}(s) \le \frac{1}{2} - \alpha \end{align} Consequently, $\rho^{\pi'}_{M_E^+} \le \rho^{\pi}_{M_E^+} - \epsilon$, and therefore $\pi'$ is not $\alpha$-optimal. \end{proof} Next, we use the same argument as in the classic lower bound construction in stochastic bandits \cite{mannor2004sample}. The proof is based on the following idea: a sequence of observations in which $(s, a)$ is rarely visited has similar likelihood under all $H_0$, $H_1$, and $H_2$. Thus, if these sequences appear with high probability under $H_0$, they also will happen with high probability under both $H_1$, and $H_2$ too. If in the majority of these sequences, the learner decides to pick $a$ in $s$, it will with a large probability of incur large optimality gap in $H_2$. On the other hand, if the learner decides not to pick $a$ in $s$, will with a large probability of incur large optimality gap in $H_2$. First, we define some events that are used in our analysis. Let $A$ be the event that the bound is not true, i.e. \begin{equation} A = \{ N(s, a) < t^* \}. \end{equation} Next, let $\pi^*$ be the final chosen policy by the learner and $B$ denote the event in which $(s, a)$ is chosen by $\pi^*$. More specifically, \begin{equation} B = \{\pi^*(s) = a\}. \end{equation} Finally let $K_n = \sum_{i = 1}^n r'_{t_i(s, a)}$ where $t_i(s, a)$ is the $i$-th time step when $s, a$ is chosen and define event $C$ as the following: \begin{align} C = \left\{ \max_{1 \le n \le t^*} |2K_n - n| \le \sqrt{\frac{8t^*}{3} \log \frac{8}{\delta}} \right\} \end{align} Let $P_0, P_1$ and $P_2$ denote the probability functions under $H_0$, $H_1$, and $H_2$, respectively. We will show that if $P_0(A) \ge \delta$, either $P_1(B^c) \ge \beta$ or $P_2(B) \ge \beta$ where $B^c$ is the complement of $B$. Based on Lemma \ref{lemma.hypothesis.optimality}, this contradicts the learner's guarantee and will prove the lemma. Now, assume that $P_0(A) \ge \delta$. Then, either $P_0(A \cap B) \ge \frac{\delta}{2}$ or $P_0(A \cap B^c) \ge \frac{\delta}{2}$. We consider each of these cases separately. Before that, we need to show some intermediate lemmas. \begin{lemma} We have $P_0(C) \ge 1 - \frac{\delta}{4}$. \end{lemma} \begin{proof} Let $p = \sqrt{\frac{8t^*}{3} \log \frac{8}{\delta}} $. The result is trivial if $p \ge t^*$. For $p \le t^*$, from the maximal Bernstein inequality (Theorem B.2 in \cite{rio2017asymptotic}) \begin{align} P_0\left(\max_{1 \le n \le t^*} (2K_n - n) > p\right) & \le \exp\left(-\frac{p^2}{2t^*+2p/3}\right) \\ &\le \exp\left(-\frac{p^2}{2t^*+2t^*/3}\right) \\ &= \delta/8 \end{align} Similarly, we have \begin{equation} P_0\left(\max_{1 \le n \le t^*} (n - 2K_n) > p\right) \le \delta/8 \end{equation} From the union bound, we get \begin{equation} P_0\left(\max_{1 \le n \le t^*} |2K_n - n| > p\right) \le \delta/4 \end{equation} It means that $P_0(C) > 1 - \delta/4$. \end{proof} \begin{lemma} \label{lemma.log_to_dx} \cite{mannor2004sample} If $0 \le x \le 1/\sqrt{2}$, then $\log (1 - x) \ge -dx$ where $d = 1.78$. \end{lemma} Let $Y$ be the sequence of all the chosen actions, received rewards, states visited during the whole interaction with the learner, and the final chosen policy by the learner. We define the likelihood functions $L_0, L_1$ and $L_2$ for each of the hypotheses: \begin{align} L_i(y) = P_i(Y = y) \end{align} The following lemmas show a lower bound on likelihood of observed history if $A$ happens. \begin{lemma} \label{lemma.likelihood.bound1} If $y \in A \cap C$, then $\frac{L_1(y)}{L_0(y)} \ge \frac{4\beta}{\delta}$. \end{lemma} \begin{proof} Note that the transition probabilities are the same under $H_0$ and $H_1$. Also, conditioned on the history up to time $t$, the choice of action $a_t$ has the same likelihood under $H_0$ and $H_1$ as it only depends on the learner's internal stochasticity. Finally, the received reward has the same distribution unless $s_t = s, a_t = a$. For brevity, let $N = N(s, a), K = K_{N}, \varepsilon = \frac{\alpha}{g(s, a)}$. We can write \begin{align} \frac{L_1(y)}{L_0(y)} &= \frac{(\frac{1}{2} + \varepsilon)^{K}\cdot (\frac{1}{2} - \varepsilon)^{N - K} }{ (\frac{1}{2})^{N} }\\ &=(1 + 2\varepsilon)^{K}\cdot (1 - 2\varepsilon)^{N - K}\\ &=(1 - 4\varepsilon^2)^{K}\cdot (1 - 2\varepsilon)^{N - 2K} \end{align} Since $A \cap C$ has happened, we have \begin{align} K &\le N < t^*\\ N - 2K &\le \sqrt{\frac{8t^*}{3} \log \frac{8}{\delta}} \end{align} Thus using Lemma \ref{lemma.log_to_dx}, we can write: \begin{align} \log \frac{L_1(y)}{L_0(y)} &= K\cdot \log(1 - 4\varepsilon^2) + (N - 2K)\cdot \log(1 - 2\varepsilon)\\ &\ge -t^* \cdot 4d\varepsilon^2 - \sqrt{\frac{8t^*}{3} \log \frac{8}{\delta}} \cdot 2d\varepsilon \end{align} Thus, we need to show \begin{align} \label{eq.show2} t^* \cdot 4d\varepsilon^2 + \sqrt{\frac{8t^*}{3} \log \frac{8}{\delta}} \cdot 2d\varepsilon \le \log \frac{\delta}{4\beta} \end{align} Now let $t^* = \frac{1}{\varepsilon^2} \cdot z^2$, $b = \sqrt{\frac{2}{3} \log \frac{8}{\delta}} $, and $c =\frac{1}{4d} \log \frac{\delta}{4\beta}$. Then, \eqref{eq.show2} can be rewritten as \begin{align} z^2 + bz - c \le 0 \end{align} Since $\delta \ge 4\beta$, we have $c> 0$, and therefore, this is true if $z \ge 0$ and \begin{align} z \le \frac{-b + \sqrt{b^2 + 4c}}{2} = \frac{2c}{\sqrt{b^2 + 4c} + b} \end{align} Thus, by Jensen's inequality, it satisfies to have $z \le \frac{c}{\sqrt{b^2 + 2c}}$ which means we need to have: \begin{align} t^* = \frac{1}{\varepsilon^2} \cdot z^2 &\le \frac{1}{\varepsilon^2} \frac{\frac{1}{16d^2} (\log \frac{\delta}{4\beta})^2} {\frac{2}{3} \log \frac{8}{\delta} + \frac{1}{2d} \log \frac{\delta}{4\beta}}\\ &=\frac{g(s, a)^2}{\alpha^2} \frac{ \frac{3}{32d^2} \cdot(\log \frac{\delta}{4\beta})^2} {\log \frac{8}{\delta} + \frac{3}{4d} \log \frac{\delta}{4\beta}} \end{align} which is true when $c_1 \le \frac{3}{2d^2}$ and $c_2 \ge \frac{3}{4d}$. \end{proof} \begin{lemma} If $y \in A \cap C$, then $\frac{L_2(y)}{L_0(y)} \ge \frac{4\beta}{\delta}$. \end{lemma} \begin{proof} Following the same argument in proof of Lemma.\ref{lemma.likelihood.bound1}, we can write \begin{align} \frac{L_2(y)}{L_0(y)} &= \frac{(\frac{1}{2} - \varepsilon)^{K}\cdot (\frac{1}{2} + \varepsilon)^{N - K} }{ (\frac{1}{2})^{N} }\\ &=(1 - 2\varepsilon)^{K}\cdot (1 + 2\varepsilon)^{N - K}\\ &=(1 - 4\varepsilon^2)^{K}\cdot (1 + 2\varepsilon)^{N - 2K} \end{align} where $N = N(s, a), K = K_{N}, \varepsilon = \frac{\alpha}{g(s, a)}$. Since $A \cap C$ has happened, we have \begin{align} K \le N < t^*\\ N - 2K \ge - \sqrt{\frac{8t^*}{3} \log \frac{8}{\delta}} \end{align} Thus using Lemma \ref{lemma.log_to_dx}, we can write: \begin{align} \log \frac{L_1(y)}{L_0(y)} &= K\cdot \log(1 - 4\varepsilon^2) + (N - 2K)\cdot \log(1 + 2\varepsilon)\\ &\ge t^*\cdot \log(1 - 4\varepsilon^2) - \sqrt{\frac{8t^*}{3} \log \frac{8}{\delta}} \cdot \log(1 + 2\varepsilon)\\ &\ge -t^* \cdot 4d\varepsilon^2 - \sqrt{\frac{8t^*}{3} \log \frac{8}{\delta}} \cdot 2\varepsilon\\ \end{align} where we used $\log(1 + x) \le x$ for $x \ge 0$. Thus, we need to show \begin{align} \label{eq.show1} t^* \cdot 4d\varepsilon^2 + \sqrt{\frac{8t^*}{3} \log \frac{8}{\delta}} \cdot 2\varepsilon \le \log \frac{\delta}{4\beta} \end{align} Now let $t^* = \frac{1}{\varepsilon^2} \cdot z^2$, $b = \sqrt{\frac{2}{3} \log \frac{8}{\delta}}$, and $c =\frac{1}{4} \log \frac{\delta}{4\beta}$. Then \eqref{eq.show1} can be rewritten as \begin{align} dz^2 + bz - c \ge 0 \end{align} Since $\delta \ge 4\beta$, we have $c> 0$, and therefore, this is true if $z \ge 0$ and \begin{align} z \le \frac{-b + \sqrt{b^2 + 4cd}}{2d} = \frac{2c}{\sqrt{b^2 + 4cd} + b} \end{align} Thus, by Jensen's inequality, it satisfies to have $z \le \frac{c}{\sqrt{b^2 + 2cd}}$ which means we need to have: \begin{align} t^* = \frac{1}{\varepsilon^2} \cdot z^2 &\le \frac{1}{\varepsilon^2} \frac{\frac{1}{16} (\log \frac{\delta}{4\beta})^2} {\frac{2}{3} \log \frac{8}{\delta} + \frac{d}{2} \log \frac{\delta}{4\beta}}\\ &= \frac{g(s, a)^2}{\alpha^2} \frac{ \frac{3}{32} \cdot (\log \frac{\delta}{4\beta})^2} {\log \frac{8}{\delta} + \frac{3d}{4}\cdot \log \frac{\delta}{4\beta}} \end{align} which is true when $c_1 \le \frac{3}{32}$ and $c_2 \ge 3d/4$. \end{proof} Finally, to prove the proposition, assume $P_0(A) \ge \delta$ and consider two cases: $P_0(A \cap B^c) \ge \frac{\delta}{2}$ and $P_0(A \cap B) \ge \frac{\delta}{2}$. If $P_0(A \cap B^c) \ge \frac{\delta}{2}$, first note that $ P_0(A \cap B^c \cap C) \ge \delta/4 $. Now we write \begin{align} P_1(B^c) &\ge P_1(A \cap B^c \cap C) \\ &= E_1[\mathbf{1}_{A \cap B^c \cap C}]\\ &= E_0[\mathbf{1}_{A \cap B^c \cap C} \frac{L_1(Y)}{L_0(Y)}]\\ &\ge E_0[\mathbf{1}_{A \cap B^c \cap C} \frac{4\beta}{\delta}]\\ &=\frac{4\beta}{\delta}\cdot P_0(A \cap B^c \cap C)\\ &\ge \beta \end{align} where $\mathbf{1}_X$ denotes the indicator function of event $X$ and we used Lemma~\ref{lemma.likelihood.bound1}. Similarly, when $P_0(A \cap B) \ge \frac{\delta}{2}$, we have $ P_0(A \cap B \cap C) \ge \delta/4 $, and we write \begin{align} P_2(B) &\ge P_2(A \cap B \cap C) \\ &= E_2[\mathbf{1}_{A \cap B\cap C}]\\ &= E_0[\mathbf{1}_{A \cap B \cap C} \frac{L_2(Y)}{L_0(Y)}]\\ &\ge E_0[\mathbf{1}_{A \cap B \cap C} \frac{4\beta}{\delta}]\\ &= \frac{4\beta}{\delta}\cdot P_0(A \cap B \cap C)\\ &\ge \beta \end{align} In both cases, the assumption on learner's performance in wrong. This shows that $P_0(A) < \delta$. \end{proof} \begin{lemma}[Lemma \ref{lemma.confidence}] \label{lem:confidence1} With probability of at least $1-p/L$, $M \in {\mathcal{M}}$. \end{lemma} \begin{proof}[\bf Proof of Lemma \ref{lem:confidence1}] From Hoeffding's inequality, for every $s, a$ we have \begin{align} \Pr\left( |R(s, a) - \widehat{R}(s, a)| > z \right) \le 2\exp\left( \frac{-N(s, a)z^2}{2\sigma^2} \right) \end{align} Letting $z = \frac{u}{\sqrt{\ensuremath{N_{\textnormal{min}} }}}$, we get \begin{align} \Pr\left( |R(s, a) - \widehat{R}(s, a)| > \frac{u}{\sqrt{\ensuremath{N_{\textnormal{min}} }}} \right) &\le 2\exp\left( \frac{-N(s, a)u^2}{2\sigma^2 \cdot \ensuremath{N_{\textnormal{min}} }} \right)\\ &\le \frac{p}{2SAL} \end{align} Also, \cite{weissman2003inequalities} bounds the $\ell_1$ distance between empirical distribution $\widehat{d}$ with $N$ samples and true distribution $d$ over $n$ outcomes as \begin{align} \Pr\left( \norm{d - \widehat{d}}_1 \ge z \right) \le (2^n - 2)\exp \left( -\frac{Nz^2}{2}\right) \end{align} Thus, for every $s, a$ we have \begin{align} \Pr\left( \norm{P(s, a, .) - \widehat{P}(s, a, .)}_1 \ge \frac{w}{\sqrt{\ensuremath{N_{\textnormal{min}} }}} \right) &\le (2^S - 2)\exp \left( -\frac{N(s, a)w^2}{2\ensuremath{N_{\textnormal{min}} }}\right)\\ &\le 2^S \exp \left( -\frac{w^2}{2}\right)\\ &= \frac{p}{2SAL} \end{align} The lemma immediately follows from the union bound and above bounds. \end{proof} The following result is an immediate consequence of Lemma~\ref{lem:confidence1}. \begin{corollary} \label{cor:confidence} With probability of at least $1 - p$, we have $M \in {\mathcal{M}}$ for all ${\mathcal{M}}$s built after each of the learners in the exploration phase. \end{corollary} \section{Agnostic Attack} \section*{Table of Contents} In this section we provide a brief description of the content provided in the appendices of the paper. \begin{itemize} \item Appendix~\ref{sec:proof_wb} provides the proofs for the white-box attack. \item Appendix~\ref{sec:proof_exp} provides the proofs for the exploration phase of \textsc{U2}{}. \item Appendix~\ref{appendix.stopping} provides the proofs for the stopping condition of \textsc{U2}{}. \item Appendix~\ref{appendix.theorem} provides the proofs for Theorem \ref{theorem.final}. \item Appendix~\ref{sec:standalone_attack_phase} provides the analysis of Remark~\ref{remark:attack_phase}. \end{itemize} \section{Proof for the white-box attack}\label{sec:proof_wb} \begin{lemma}[Lemma \ref{lemma.full.knowledge}] \label{lemma.full.knowledge1} The optimal solution for \eqref{prob.full.knowledge} is $\Delta^*_M$. Moreover, $\Delta\colon S \times A \to \mathbb{R}$ is a feasible solution of \eqref{prob.full.knowledge} if and only if for every state $s$ and action $a$, $\Delta(s, a) \ge \Delta^*_M(s, a)$ and $\Delta(s, \ensuremath{\pi_{\dagger}}(s)) = 0$. \end{lemma} For completeness, we include the proof of Lemma~\ref{lemma.full.knowledge} for the white-box attack that immediately follows from the following two lemmas in \cite{rakhsha2020policy-jmlr}. \begin{lemma} \label{lemma.using_neighbors} \textbf{\cite{rakhsha2020policy-jmlr}} Policy $\pi$ is $\epsilon$-robust optimal \emph{iff} we have $\rho^{\pi} \ge \rho^{\neighbor{\pi}{s}{a}} + \epsilon$ for every state $s$ and action $a \ne \pi(s)$. \end{lemma} \begin{lemma}\label{lemma_qrho_relate} \textbf{ \cite{schulman2015trust}} For two policies $\pi$ and $\pi'$ we have: \begin{equation} \rho^\pi_M - \rho^{\pi'}_M = \sum_{s\in\mathcal{S}}\mu^{\pi'}_M(s)\big(Q^\pi_M(s, \pi(s)) - Q^\pi_M(s, \pi'(s))\big). \end{equation} \end{lemma} \begin{proof}[\bf Proof of Lemma \ref{lemma.full.knowledge1}] Based on these two lemmas, we note that $\Delta$ is a feasible solution for \eqref{prob.full.knowledge} if and only if for every $s, a$ \begin{align} \epsilon \le \rho^{\ensuremath{\pi_{\dagger}}}_{M'} - \rho^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_{M'} = \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_{M'}(s)\big(V^{\ensuremath{\pi_{\dagger}}}_{M'}(s) - Q^{\ensuremath{\pi_{\dagger}}}_{M'} (s, a)\big) = \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_{M}(s)\big(V^\pi_{M}(s) - Q^{\ensuremath{\pi_{\dagger}}}_{M} (s, a) + \Delta(s, a)\big) \end{align} where $M' = (S, A, R - \Delta, P)$. Rearranging this inequality gives us the condition in the lemma: \begin{align} \Delta(s, a) \ge Q^{\ensuremath{\pi_{\dagger}}}_{M} (s, a) - V^\pi_{M}(s) \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_{M}(s)} = \Delta^*_M(s, a) \end{align} \end{proof} \input{9.2_appendix_exploration} \section{Proof of Stopping Condition}\label{appendix.stopping} In this section, we provide rigorous proofs on various consequences induced by the stopping condition \eqref{eq.stop.condition}: \begin{align} \label{eq.stop.condition1} 2\ensuremath{\widehat{e}_Q } + \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s)} - \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s) + \ensuremath{e_\mu }} \le m \end{align} In what follows, define event $B$ as \begin{align} B \triangleq \{ M \in {\mathcal{M}} \; \text{for all ${\mathcal{M}}$s built after each of the learners in the exploration phase} \} \end{align} From Corollary~\ref{cor:confidence} we have $\Pr(B) \ge 1 - p$. We make use of the \emph{simulation lemma}: \begin{lemma}(Simulation Lemma \cite{strehl2008analysis}) \label{simulation3} Let $M_1 =(S, A, R_1, P_1, \gamma)$ and $M_2 =(S, A, R_2, P_2, \gamma)$ be two MDPs with reward range $\ensuremath{R_\text{range}} $. The following condition holds for all states $s$, actions $a$, and stationary, deterministic policies $\pi$: \begin{equation} |Q_1^{\pi}(s, a) - Q_2^{\pi}(s, a)| \le \frac{1}{(1 - \gamma)^2}(\norm{R_1 - R_2}_\infty + \gamma (\ensuremath{R_\text{range}} ) \norm{P_1 - P_2}_\infty) \end{equation} \end{lemma} Our first result says that the stopping condition guarantees that the attack cost is at most $m$ worse than the white-box attack: \begin{lemma}\label{lem:stop1} Under event $B$, the stopping condition \eqref{eq.stop.condition1} guarantees that $\widehat\Delta(s, a) \leq\Delta^*_M(s, a) +m$ for every $s, a$. \end{lemma} \begin{proof}[\bf Proof of Lemma \ref{lem:stop1}] Lemma \ref{simulation3} and event $B$ imply \begin{gather} Q^{\ensuremath{\pi_{\dagger}}}_M(s, a) \ge Q_\text{high}^{\ensuremath{\pi_{\dagger}}}(s, a) - \ensuremath{e_Q }\\ V^{\ensuremath{\pi_{\dagger}}}_M(s) \le V_\text{low}^{\ensuremath{\pi_{\dagger}}}(s) + \ensuremath{e_Q } \end{gather} where again \begin{align} \ensuremath{e_Q } = \frac{2u + 2\gamma \cdot \ensuremath{R_\text{range}} \cdot w}{(1 - \gamma)^2\cdot \sqrt{\ensuremath{N_{\textnormal{min}} }}}\;,\; \ensuremath{e_\mu } = \frac{2\gamma \cdot w}{(1 - \gamma)\cdot \sqrt{\ensuremath{N_{\textnormal{min}} }}}. \end{align} Let $\overline M = \argmin_{\widetilde{M}\in {\mathcal{M}}} \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_{\widetilde M}(s)$, which means $\mu^{{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}}_\text{low} = \mu^{{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}}_{\overline M}$. In $M_s$ and $\overline{M}_s$, all the rewards are the same and either $0$ or $1$. Thus, utilizing the simulation lemma, \begin{align} \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) &= (1 - \gamma) \sum_x d_0(x) V^\pi_{{M}_s}(x)\\ &\le (1 - \gamma) \sum_x d_0(x) (V^\pi_{\overline M}(x) + \frac{2\gamma w}{(1 - \gamma)^2 \cdot \sqrt{\ensuremath{N_{\textnormal{min}} }}})\\ \label{eq:mu.confidence} &= \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s) +\ensuremath{e_\mu } \end{align} Under event $B$, all the confidence intervals hold and therefore $\ensuremath{\widehat{R}_\text{range}} \ge \ensuremath{R_\text{range}} $. In that case, from Lemma \ref{simulation3}, we have: \begin{gather} V^{\ensuremath{\pi_{\dagger}}}_M(s) \le V_\text{low}^{\ensuremath{\pi_{\dagger}}}(s) + \ensuremath{\widehat{e}_Q }\\ Q^{\ensuremath{\pi_{\dagger}}}_M(s, a) \ge Q_\text{high}^{\ensuremath{\pi_{\dagger}}}(s, a) - \ensuremath{\widehat{e}_Q } \end{gather} Thus, once \eqref{eq.stop.condition} is satisfied, we have \begin{align} & m + Q^{\ensuremath{\pi_{\dagger}}}_M(s, a) - V^{\ensuremath{\pi_{\dagger}}}_M(s) + \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s)}\\ &\ge m + Q_\text{high}^{\ensuremath{\pi_{\dagger}}}(s, a) - V_\text{low}^{\ensuremath{\pi_{\dagger}}}(s) - 2\ensuremath{\widehat{e}_Q } + \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s) + \ensuremath{e_\mu }} \\ & \ge 2\ensuremath{\widehat{e}_Q } + \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s)} - \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s) + \ensuremath{e_\mu }} + Q_\text{high}^{\ensuremath{\pi_{\dagger}}}(s, a) - V_\text{low}^{\ensuremath{\pi_{\dagger}}}(s) - 2\ensuremath{\widehat{e}_Q } + \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s) + \ensuremath{e_\mu }} \\ & = Q_\text{high}^{\ensuremath{\pi_{\dagger}}}(s, a) - V_\text{low}^{\ensuremath{\pi_{\dagger}}}(s) + \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s) } \end{align} Consequently, \begin{align} m \ge& \left(Q_\text{high}^{\ensuremath{\pi_{\dagger}}}(s, a) - V_\text{low}^{\ensuremath{\pi_{\dagger}}}(s) + \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s) }\right) - \left( Q^{\ensuremath{\pi_{\dagger}}}_M(s, a) - V^{\ensuremath{\pi_{\dagger}}}_M(s) + \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s)} \right)\\ \ge& \pos{Q_\text{high}^{\ensuremath{\pi_{\dagger}}}(s, a) - V_\text{low}^{\ensuremath{\pi_{\dagger}}}(s) + \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s) }} - \pos{ Q^{\ensuremath{\pi_{\dagger}}}_M(s, a) - V^{\ensuremath{\pi_{\dagger}}}_M(s) + \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s)} }\\ =& \widehat\Delta(s,a)-\Delta^*_M(s,a) \end{align} \end{proof} \begin{lemma}\label{lem:stop2} Under event $B$, the stopping condition is satisfied after at most $N_0$ observations of each $(s,a)$ pair. \end{lemma} \begin{proof}[\bf Proof of Lemma \ref{lem:stop2}] We show that after $N_0$ observations \begin{gather} 2\ensuremath{\widehat{e}_Q } \le \frac{m}{2}\\ \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s)} - \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s) + \ensuremath{e_\mu }} \le \frac{m}{2} \end{gather} For the first part, note that $N_0 \ge \left(\frac{2u}{\ensuremath{R_\text{range}} }\right)^2$. Thus, under event $B$, we have \begin{align} \ensuremath{\widehat{R}_\text{range}} \le \ensuremath{R_\text{range}} + \frac{2u}{\sqrt{\ensuremath{N_{\textnormal{min}} }}} \le 2\ensuremath{R_\text{range}} \end{align} Thus, \begin{align} \ensuremath{\widehat{e}_Q } = \frac{2u + 2\gamma \cdot \ensuremath{\widehat{R}_\text{range}} \cdot w}{(1 - \gamma)^2\cdot \sqrt{\ensuremath{N_{\textnormal{min}} }}} \le \frac{2u + 4\gamma \cdot \ensuremath{R_\text{range}} \cdot w}{(1 - \gamma)^2\cdot \sqrt{\ensuremath{N_{\textnormal{min}} }}} \end{align} From $\ensuremath{N_{\textnormal{min}} } \ge \left(\frac{8u + 16\gamma \cdot \ensuremath{R_\text{range}} \cdot w}{(1 - \gamma)^2 \cdot m}\right)^2$ we get $\ensuremath{\widehat{e}_Q } \le \frac{m}{4}$. From \begin{equation} \ensuremath{N_{\textnormal{min}} } \ge \left( \frac{2\gamma \cdot w}{1 - \gamma }\cdot \frac{6\epsilon + m\cdot \ensuremath{\mu_\text{min}} }{m\cdot\ensuremath{\mu_\text{min}} ^2} \right)^2, \end{equation} we get \begin{align} \label{eq.ermu.bound} \ensuremath{e_\mu } = \frac{2\gamma \cdot w}{(1 - \gamma)\cdot \sqrt{\ensuremath{N_{\textnormal{min}} }}} \le \frac{m \cdot \ensuremath{\mu_\text{min}} ^2}{6\epsilon + m \cdot \ensuremath{\mu_\text{min}} } \end{align} With the same argument as in \eqref{eq:mu.confidence}, we have \begin{align} \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) - \ensuremath{e_\mu } \le \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s) \le \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) + \ensuremath{e_\mu } \end{align} note that \eqref{eq.ermu.bound} shows that $\ensuremath{e_\mu } < \ensuremath{\mu_\text{min}} \le \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s)$ so we can write \begin{align} \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s)} - \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s) + \ensuremath{e_\mu }} &\le \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) - \ensuremath{e_\mu }} - \frac{\epsilon}{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) + 2\ensuremath{e_\mu }} \\ &= \frac{3\epsilon \ensuremath{e_\mu }}{ (\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) - \ensuremath{e_\mu }) (\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) + 2\ensuremath{e_\mu }) }\\ &\le \frac{3\epsilon \ensuremath{e_\mu }}{ (\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) - \ensuremath{e_\mu }) \cdot \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) } \end{align} Thus, it suffices to show \begin{align} &\frac{3\epsilon \ensuremath{e_\mu }}{ (\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) - \ensuremath{e_\mu }) \cdot \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) } \le \frac{m}{2} \\ \Leftrightarrow &6\epsilon\ensuremath{e_\mu } \le m \cdot \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) \cdot (\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) - \ensuremath{e_\mu })\\ \Leftrightarrow &(6\epsilon + m \cdot \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) )\ensuremath{e_\mu } \le m \cdot \left(\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s)\right)^2\\ \Leftrightarrow &\ensuremath{e_\mu } \le \frac{ m \cdot \left(\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s)\right)^2 } { 6\epsilon + m \cdot \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) } \end{align} which follows from \eqref{eq.ermu.bound} noting that $\ensuremath{\mu_\text{min}} \le \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s)$ and $f(x) = \frac{x}{a + x}$ is increasing for $a, x > 0$. \end{proof} \begin{lemma}\label{lem:stop3} With probability $1-p$, $N_0$ observations on each $(s,a)$ pair can be made after at most $k_0$ learners. \end{lemma} \begin{proof}[\bf Proof of Lemma \ref{lem:stop3}] Setting $\delta = \frac{1}{2SA}$, Lemma~\ref{lemma.exploration.basic} and union bound imply that with probability of at least $1/2$, each learner give the following number of observations for each $s, a$ \begin{equation} \frac{\ensuremath{\mu_\text{min}} ^2}{\alpha^2} \cdot \frac{ c_1 \cdot (\log\; \frac{1}{8SA \cdot \beta})^2}{\log 16SA + c_2 \cdot (\log\; \frac{1}{8SA \cdot \beta})} \end{equation} Let $k_1$ be the number of learners among the $k_0$ learners for which the above bound holds. Then after $k_0$ learners, we have at least \begin{equation} k_1 \cdot \frac{\ensuremath{\mu_\text{min}} ^2}{\alpha^2} \cdot \frac{ c_1 \cdot (\log\; \frac{1}{8SA \cdot \beta})^2}{\log 16SA + c_2 \cdot (\log\; \frac{1}{8SA \cdot \beta})} \end{equation} observations. From Hoeffding's inequality we have \begin{align} \Pr \left[k_1 \le \left(\frac{1}{2} - \sqrt{\frac{\log 1/p}{2k_0}}\right) \cdot k_0 \right] \le p \end{align} Thus, with probability of at least $1- p$, \begin{align} k_1 \ge \left(\frac{1}{2} - \sqrt{\frac{\log 1/p}{2k_0}}\right) \cdot k_0 \end{align} and consequently \begin{equation} \ensuremath{N_{\textnormal{min}} } \ge \left(\frac{1}{2} - \sqrt{\frac{\log 1/p}{2k_0}}\right) \cdot k_0 \cdot \frac{\ensuremath{\mu_\text{min}} ^2}{\alpha^2} \cdot \frac{ c_1 \cdot (\log\; \frac{1}{8SA \cdot \beta})^2}{\log 16SA + c_2 \cdot (\log\; \frac{1}{8SA \cdot \beta})} \end{equation} Now we have $k_0 \ge 8\log 1/p$ which gives \begin{align} \frac{1}{2} - \sqrt{\frac{\log 1/p}{2k_0}} \ge 1/4 \end{align} thus \begin{equation} \ensuremath{N_{\textnormal{min}} } \ge \frac{1}{4} \cdot k_0 \cdot \frac{\ensuremath{\mu_\text{min}} ^2}{\alpha^2} \cdot \frac{ c_1 \cdot (\log\; \frac{1}{8SA \cdot \beta})^2}{\log 16SA + c_2 \cdot (\log\; \frac{1}{8SA \cdot \beta})} \ge N_0 \end{equation} \end{proof} \section{Proof of the main theorem}\label{appendix.theorem} Finally, we prove our main theorem by combining all the building blocks above. \begin{theorem}[Theorem \ref{theorem.final}] \label{theorem.final1} For any $m > 0$ and $p \in (0, 1)$, assume that $\alpha < \frac{\ensuremath{\mu_\text{min}} }{2\sqrt{2}}$ and $\beta < \frac{1}{8SA}$, then, with probability of at least $1 - 4p$, the cost of \textsc{U2}{} is bounded by \begin{align} \textsc{Cost}(T, L) \le\; \frac{k_0}{L}\cdot \left(\norm{R}_\infty + \sigma \sqrt{2\log \frac{2k_0T}{p}}+ 1+ \lambda\right)\\ \quad + \ (\norm{\Delta^*_M}_\infty + \lambda + m)\cdot \frac{\textsc{SubOpt}(T, \epsilon, \frac{p}{L})}{T}\nonumber \end{align} where $k_0$ is a function of MDP $M$, $p$, $\alpha$, $\beta$, $\lambda$, $m$, $\epsilon$, and $L$ as defined in \eqref{eq.def.k0}. \end{theorem} \begin{proof}[\bf Proof of Theorem \ref{theorem.final1}] Let $k_1$ denote the number of learners in the exploration phase, and $\xi_t^{(l)}$ be the noise in reward of step $t$ of learner $l$, i.e. $r_t^{(l)} = R(s_t^{(l)}, a_t^{(l)}) + \xi_t^{(l)}$. For the total cost we have \begin{align} \textsc{Cost}(T, L) = &\frac{1}{L\cdot T} \sum_{l = 1}^{L}\sum_{t = 1}^{T} \left( |r^{(l)}_t - r'^{(l)}_t| + \lambda \ind{a^{(l)}_t \ne \ensuremath{\pi_{\dagger}}(s^{(l)}_t)} \right)\\ = & \frac{1}{L\cdot T} \sum_{l = 1}^{k_1}\sum_{t = 1}^{T} \left( |R(s_t^{(l)}, a_t^{(l)}) + \xi_t^{(l)} - r'^{(l)}_t| + \lambda \ind{a^{(l)}_t \ne \ensuremath{\pi_{\dagger}}(s^{(l)}_t)} \right) +\\ &\frac{1}{L\cdot T} \sum_{l = k_1 + 1}^{L}\sum_{t = 1}^{T} \left( \widehat \Delta(s_t^{(l)}, a_t^{(l)}) + \lambda \ind{a^{(l)}_t \ne \ensuremath{\pi_{\dagger}}(s^{(l)}_t)} \right)\nonumber\\ \le & \frac{1}{L\cdot T} \sum_{l = 1}^{k_1} \sum_{t = 1}^{T} \left( |R(s_t^{(l)}, a_t^{(l)})| + |\xi_t^{(l)}| + 1 + \lambda \right) +\\ &\frac{1}{L\cdot T} \sum_{l = k_1 + 1}^{L}\sum_{t = 1}^{T} \left( (\widehat \Delta(s_t^{(l)}, a_t^{(l)}) + \lambda) \cdot \ind{a^{(l)}_t \ne \ensuremath{\pi_{\dagger}}(s^{(l)}_t)} \right)\nonumber\\ \le & \frac{k_1 \cdot (\norm{R}_\infty + 1 + \lambda)}{L} + \frac{\sum_{l = 1}^{k_1}\sum_{t = 1}^{T} |\xi_t^{(l)}|}{L\cdot T} +\frac{\norm{\widehat \Delta}_\infty + \lambda}{L\cdot T} \sum_{l = k_1 + 1}^{L}\sum_{t = 1}^{T} \ind{a^{(l)}_t \ne \ensuremath{\pi_{\dagger}}(s^{(l)}_t)} \end{align} Define events $C$ and $D$ as the following \begin{gather} C \triangleq \{k_1 \le k_0\}\\ \label{eq:def.d} D \triangleq \left\{ \sum_{l = 1}^{k_0}\sum_{t = 1}^{T} |\xi_t^{(l)}| \le \sigma \cdot k_0T \cdot \sqrt{2\log \frac{2k_0T}{p}} \right\} \end{gather} That is, $C$ is the event that the attacker uses at most $k_0$ learners in the exploration phase, and $D$ is the event that sum of absolute value of noises in first $k_0$ learners is bounded as in \eqref{eq:def.d}. Also let $E$ be the event that for all of $L$ learners, the number of $\epsilon$-suboptimal steps taken is at most $\textsc{SubOpt}(T, \epsilon, \frac{p}{L})$. We show that under event $F = B \cap C \cap D \cap E$ the bound on the cost holds, and then show that $\Pr(F) \ge 1 - 4p$. From event $C$ we get \begin{align} \label{eq:final.bound1} \frac{k_1 \cdot (\norm{R}_\infty + 1 + \lambda)}{L} \le \frac{k_0 \cdot (\norm{R}_\infty + 1 + \lambda)}{L} \end{align} Also $C \cap D$ implies \begin{align} \label{eq:final.bound2} \frac{\sum_{l = 1}^{k_1}\sum_{t = 1}^{T} |\xi_t^{(l)}|}{L\cdot T} \le \frac{\sum_{l = 1}^{k_0}\sum_{t = 1}^{T} |\xi_t^{(l)}|}{L\cdot T} \le \frac{\sigma \cdot k_0 \cdot \sqrt{2\log \frac{2k_0T}{p}}}{L} \end{align} Finally note that under $B$, since $\widehat \Delta$ is a solution of \eqref{prob.partial.knowledge}, the target policy is an $\epsilon$-robust optimal for learners in the attack phase. Thus, all the steps that learners in the attack phase do not follow the target policy are $\epsilon$-suboptimal. From event $E$ and Lemma~\ref{lem:stop1} we get \begin{align} \frac{\norm{\widehat \Delta}_\infty + \lambda}{L\cdot T} \sum_{l = k_1 + 1}^{L}\sum_{t = 1}^{T} \ind{a^{(l)}_t \ne \ensuremath{\pi_{\dagger}}(s^{(l)}_t)} &\le (\norm{\widehat \Delta}_\infty + \lambda)\cdot \frac{\textsc{SubOpt}(T, \epsilon, \frac{p}{L})}{T}\\ \label{eq:final.bound3} &\le (\norm{\Delta^*_M}_\infty + \lambda + m)\cdot \frac{\textsc{SubOpt}(T, \epsilon, \frac{p}{L})}{T} \end{align} Putting all the bounds together, we get that under event $F$ we have \begin{align} \textsc{Cost}(T, L) \le \frac{k_0 \cdot (\norm{R}_\infty + 1 + \lambda)}{L} + \frac{\sigma \cdot k_0 \cdot \sqrt{2\log \frac{2k_0T}{p}}}{L} + (\norm{\Delta^*_M}_\infty + \lambda + m)\cdot \frac{\textsc{SubOpt}(T, \epsilon, \frac{p}{L})}{T} \end{align} which is the bound in the theorem. Now note that from Corollary~\ref{cor:confidence} we have $\Pr(B) \ge 1 - p$. Lemma~\ref{lem:stop2} and Lemma~\ref{lem:stop3} show that $\Pr(C | B) \ge 1 - p$. Thus, we have $\Pr(B \cap C) = \Pr(C | B)\cdot \Pr(B) = (1-p)^2 \ge 1 - 2p$. Note that from Hoeffding's inequality we have \begin{align} \Pr\left(|\xi_t^{(l)}| > \sqrt{2\sigma^2\log \frac{2k_0T}{p}}\right) \le \frac{p}{k_0T} \end{align} Applying this lemma to all $k_0T$ steps of first $k_0$ learners, from union bound we get $\Pr(D) \ge 1 - p$. Finally, from the definition of $\textsc{SubOpt}$ and union bound, we have $\Pr(E) \ge 1 - p$. Thus, we have \begin{align} \Pr(F) = \Pr(B \cap C \cap D \cap E) \ge 1 - (1 - \Pr(B \cap C)) - (1 - \Pr(D)) - (1 - \Pr(E)) \ge 1 - 4p \end{align} which concludes the proof. \end{proof} \section{Technical Details of Attack with Prior Data} \label{sec:standalone_attack_phase} In the remark in Section~\ref{sec.attack.phase}, we highlighted a stand-alone application of the attack phase procedure, in which the attacker uses some prior set of observations to do the attack without an exploration phase. Here, we prove the claimed guarantee (Eq. \ref{eq:prior_obs}) of this attack. We show that with probability of at least $1 - 2p$ the cost of this attack is at most \begin{align} \frac{1}{T}\cdot \left(\norm{\Delta^*_M + e}_\infty + \lambda \right) \cdot \textsc{SubOpt}(T, \epsilon, \frac{p}{L}) \end{align} \begin{proof} If $M \in {\mathcal{M}}$, which happens with probability at least $1-p$, from Lemma~\ref{lem:stop1} we have \begin{gather} Q_\text{high}^{\ensuremath{\pi_{\dagger}}}(s, a)\le Q^{\ensuremath{\pi_{\dagger}}}_M(s, a) + \ensuremath{e_Q }\\ V_\text{low}^{\ensuremath{\pi_{\dagger}}}(s) \ge V^{\ensuremath{\pi_{\dagger}}}_M(s) - \ensuremath{e_Q } \end{gather} Also with similar argument as in \eqref{eq:mu.confidence}, we have \begin{align} \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s) \ge \pos{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) -\ensuremath{e_\mu }} \end{align} Thus, we have \begin{align} Q_\text{high}^{\ensuremath{\pi_{\dagger}}}(s, a) - V_\text{low}^{\ensuremath{\pi_{\dagger}}}(s) + \frac{\epsilon}{ \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s) } &\le Q_M^{\ensuremath{\pi_{\dagger}}}(s, a) - V_M^{\ensuremath{\pi_{\dagger}}}(s) + \frac{\epsilon}{ \pos{\mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) -\ensuremath{e_\mu }} } + 2\ensuremath{e_Q }\\ &= Q_M^{\ensuremath{\pi_{\dagger}}}(s, a) - V_M^{\ensuremath{\pi_{\dagger}}}(s) + \frac{\epsilon}{ \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) } + e(s, a)\ \end{align} which gives \begin{align} e(s, a) &\ge \left( Q_\text{high}^{\ensuremath{\pi_{\dagger}}}(s, a) - V_\text{low}^{\ensuremath{\pi_{\dagger}}}(s) + \frac{\epsilon}{ \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s) } \right) - \left( Q_M^{\ensuremath{\pi_{\dagger}}}(s, a) - V_M^{\ensuremath{\pi_{\dagger}}}(s) + \frac{\epsilon}{ \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) } \right)\\ &\ge \pos{ Q_\text{high}^{\ensuremath{\pi_{\dagger}}}(s, a) - V_\text{low}^{\ensuremath{\pi_{\dagger}}}(s) + \frac{\epsilon}{ \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_\text{low}(s) } } - \pos{ Q_M^{\ensuremath{\pi_{\dagger}}}(s, a) - V_M^{\ensuremath{\pi_{\dagger}}}(s) + \frac{\epsilon}{ \mu^{\neighbor{\ensuremath{\pi_{\dagger}}}{s}{a}}_M(s) } }\\ &= \widehat \Delta(s, a) - \Delta^*_M(s, a) \end{align} As $\widehat \Delta$ is a solution of \eqref{prob.partial.knowledge}, the target policy is $\epsilon$-robust optimal for the learner. Consequently, the steps in which the target policy is not followed are $\epsilon$-suboptimal and with probability of at least $1 - p$ at most $\textsc{SubOpt}(T, \epsilon, \frac{p}{L})$ for all the learners. Thus, by a union bound, with probability of at least $1-2p$ we have \begin{align} \textsc{Cost}(T, L) &= \frac{1}{L\cdot T} \sum_{l = 1}^{L}\sum_{t = 1}^{T} \left( |r^{(l)}_t - r'^{(l)}_t| + \lambda \ind{a^{(l)}_t \ne \ensuremath{\pi_{\dagger}}(s^{(l)}_t)} \right)\\ &\le \frac{1}{L \cdot T} \cdot (\norm{\widehat \Delta}_\infty + \lambda) \cdot L\cdot \textsc{SubOpt}(T, \epsilon, \frac{p}{L})\\ &\le \frac{1}{T} \cdot (\norm{ \Delta^*_M + e}_\infty + \lambda) \cdot \textsc{SubOpt}(T, \epsilon, \frac{p}{L}) \end{align} which proves the claim. \end{proof}
\section{Introduction} \label{sec:intro} The James Webb Space Telescope (JWST) is expected to transform our understanding of high-redshift galaxies, and test our predictions for the epoch of reionization. Recently, galaxy simulations aimed at improving our understanding of the epoch of reionization have included stars that interact in binaries \citep{Ma_2016, Rosdahl_2018, Secunda2020}. Although binary fractions in low-metallicity environments like those of the early universe have yet to be measured directly, observations of massive stars in the Milky Way and Large Magellanic Cloud suggest binary interactions occur for approximately 70\% of young, massive stars in local environments \citep{Kobulnicky2007, Mason_2009, Sana2012, Almeida2017}. Through mass-transfer and coalescence, binary interactions can produce ionizing sources, such as high-mass stars or envelope-stripped helium stars, that emit ionizing photons tens to hundreds of Myr after starburst \citep{VanBever1999, 2016MNRAS.456..485S, Gotberg2019}. Because Lyman Continuum (LyC) photons from these products of binary interactions are ``delayed,'' the presence of binaries increases the total LyC emission in older stellar populations where there are no remaining O/B stars \citep{Eldridge2017, Secunda2020}. In addition, simulations that include ionizing photons from binary products show these photons are more likely to escape their host galaxy, as the delay provides more time for feedback from massive stars to remove the surrounding gas from the birth cloud, which normally traps LyC radiation \citep{KimmCen_2014, 2009Wise, Secunda2020, Ma_2016, Rosdahl_2018}. This increase in escaping LyC radiation that results from the presence of binary products suggests that the observed spectral energy distributions (SEDs) of galaxies that are 10-100 Myr post-starburst may look significantly different, primarily at ionizing wavelengths, than one would expect if no binary evolution occurred. Stripped stars are one such product of binary evolution, and are particularly interesting because they have very high effective surface temperature and are copious LyC emitters \citep[see e.g.,][]{Gotberg2017}. Stripped stars are formed when their envelopes are stripped from interaction with binary companions \citep{Kippenhahn67, Pols1994}, and emit significant ionizing radiation in stellar populations older than 10~Myr \citep{Gotberg2019}. \cite{Secunda2020} simulated high-redshift, dwarf galaxies with virial masses ($M_{vir}$) ranging from $10^8 - 10^{10.5}~M_{\odot}$, and found that the median rate of escaping photons of lower mass halos ($M_{vir} < 10^9\ M_{\odot}$) increases by a factor of as much as 200 when stripped stars are included. This result suggests that LyC emission from these low-mass halos is almost exclusively dominated by binary products. Despite the fact that a significant portion of massive stars undergo binary interactions to produce stripped stars, and the importance of stripped stars in the process of reionization \citep{Ma_2016, Rosdahl_2018, Secunda2020}, only a handful of stripped stars with main sequence companions have been observationally confirmed \citep[e.g.,][]{Groh2008, Wang2018}. If detected by JWST, low-mass galaxies dominated by stripped-star ionizing emission may provide an ideal laboratory for studying binary-interactions as a function of redshift. Other potential sources of ionizing radiation during the epoch of reionization are Population III (Pop III) stars. Pop III stars are first generation, zero-metallicity stars that were proposed early on by \cite{1978Natur.275...35R} in the context of the cosmic microwave background, and by \cite{1978MNRAS.183..341W} and \cite{1984ApJ...277..445C} to explain missing mass in galaxy clusters. Pop III stars are thought to have smaller radii, higher masses (up to several hundred solar masses), higher temperatures $(\sim 10^5\ \text{K})$, and a characteristically hard ionizing spectrum compared to typical massive stars \citep{Tumlinson_2000,Schaerer2002}. While it is unlikely that JWST will be able to probe isolated Pop III stars \citep{Rydberg_2013}, Pop III galaxies with stellar masses as low as $10^5\ M_\odot$ may be detectable \citep{Zackrisson_2011}. Because both stripped stars and Pop III stars are characterized by significant ionizing emission, high-redshift galaxies with stripped stars may masquerade as Pop III stars or vice versa. While galaxies containing Pop III stars may lack dust and have different gas-richness relative to galaxies with stripped stars, much is still unknown about the nature of Pop III galaxies. Thus, understanding the characteristics of SEDs of galaxies dominated by stripped stars is crucial to how we can distinguish between these two stellar populations. Spectral shape in the ionizing regime is a sensitive probe for revealing what source is responsible for emission of ionizing photons \citep[see e.g.,][]{Gotberg2019}. Because the astrophysical objects mentioned here produce ionizing photons under different physical conditions, each of them are predicted to have a characteristic spectral hardness in the ionizing regime. Apart from the most massive stars \citep{2002MNRAS.337.1309S, 2016MNRAS.458..624C} stripped stars, and Pop III stars, other sources of ionizing emission include accreting white dwarfs \citep{2015MNRAS.453.3024C}, X-ray binaries \citep{2019A&A...622L..10S, 2020MNRAS.494..941S}, and post-AGB stars \citep{2019AJ....158....2B}. Among these, stripped stars emit hydrogen-ionizing photons at the highest rates in stellar populations older than $\sim 10$ Myr. However, the accreting compact objects are predicted to have harder ionizing radiation and have therefore been considered to contribute substantially to the emission rate of He$^+$ ionizing photons \citep{2013MNRAS.432.1640W, 2020MNRAS.494..941S}. Chemical mixing and mass loss induced by moderate to extreme stellar rotation \citep{1987A&A...178..159M, 2005A&A...443..643Y} could also increase the emission rate of ionizing photons from a stellar population substantially \citep{2009A&A...497..243D, 2012ApJ...751...67L, 2015A&A...581A..15S, 2019A&A...623A...8K}. However, although circumstantial evidence have been claimed, direct proof that rotational mixing is efficient is still missing (see e.g., \citealt{2009A&A...495..257M, 2015A&A...581A..21H, 2018A&A...611A..75S, 2019A&A...627A.151S,2019ApJ...880..115A}). In this paper we choose to focus on and compare ionizing emission from massive stars, stripped stars and Pop III stars, only. Recent observations have revealed remarkably hard ionizing spectra of stellar populations both in the local \citep{2019ApJ...878L...3B} and distant Universe \citep{2019A&A...624A..89N, 2020A&A...636A..47S}. No current spectral synthesis model produces a significant amount of sufficiently hard ionizing photons to explain the observed spectra, which highlights the urgency of better understanding sources of ionizing emission. Carefully characterizing the individual effects various ionizing sources have on the SEDs of galaxies is a necessary first step. These can then be used to produce observable predictions such as nebular line strengths of ionized elements \citep[cf.][]{2014MNRAS.444.3466S, 2018MNRAS.477..904X}. In this paper, we seek to characterize the effects of stripped stars on the SEDs of galaxies at the epoch of reionization, and compare these results to predictions for Pop III stars. In \S \ref{sec:Method} we briefly describe the cosmological simulations used and the method for constructing the SEDs of galaxies. In \S \ref{sec:res} we discuss the SEDs of galaxies without accounting for absorption and in \S \ref{sec:abs} we discuss the SEDs of galaxies accounting for absorption by intervening gas and dust along randomly chosen sightlines. We summarize our results and conclude in \S \ref{sec:conclusion}. \section{Methods} \label{sec:Method} \subsection{Cosmological Simulations} We use output from the cosmological hydrodynamical simulations of \cite{KimmCen_2014}, performed using the \verb"RAMSES" Eulerian adaptive mesh refinement (AMR) code \citep{Teyssier2002}. \cite{KimmCen_2014} use the \verb"MUSIC" software \citep{Hahn_Abel_2011} to generate initial conditions with the following cosmological parameters from WMAP7 \citep{Komatsu_2011}: ($\Omega_m$, $\Omega_\lambda$, $\Omega_b$, h, $\sigma_8$, $n_s$ = 0.272, 0.728, 0.045, 0.702, 0.82, 0.96). We expect that our results are only weakly dependent on these assumed cosmological parameters. \cite{KimmCen_2014} begin with dark matter-only simulations of $256^3$ particles using a large volume of $(25\ \text{Mpc} h^{-1})^3$, in order to include the effects of the large-scale tidal field. They then zoom in on a $3.8 \times 4.8 \times 9.6$ Mpc box (comoving) and employ a series of refinements to achieve a dark matter mass resolution of $1.6 \times 10^5 M_\odot$. Further refinement, optimized to resolve the structure of the ISM, results in a minimum physical cell size of 4.2 pc, and a stellar mass resolution of approximately 49 $M_\odot$. Radiation from each star particle represents a full stellar population, rescaled for mass. These simulations include star formation, radiative cooling \citep{Sutherland1993, Rosen1995}, thermal stellar winds, feedback from supernova explosions, and photoionization by stellar radiation. For more details, see \cite{KimmCen_2014}. \subsection{Stellar Populations} In this section we describe the three stellar populations models used in this paper: a population accounting for only single stars, a population accounting for single stars and the creation of stripped stars, and a population consisting of only zero-metallicity Pop III stars. We also describe two versions of modelling for each population: one accounting for the presence of gas and dust and one not accounting for the presence of gas and dust. \subsubsection{Single Stars and Stripped Stars} \label{sec:single_stripped_stars} To model ionizing emission from single-stellar populations, we use Starburst99 \citep{Starburst99}, with stellar evolution models from Padova \citep{Bertelli_1993, Bertelli_1994, Marigo_2008}, atmospheric models from CMFGEN \citep{Hellier_1998} and WM-Basic \citep{Pauldrach_2001}, and a Kroupa initial mass function \citep{Kroupa2001} from 0.1 $M_\odot$ to 100 $M_\odot$. The metallicities available in Starburst99 are 0.0004, 0.004, 0.008, 0.02, and 0.05. We use the models of \cite{Gotberg2019} to simulate the emission of stripped stars. These are based on binary stellar evolution models created with MESA \citep{Paxton2011,Paxton2013,Paxton2015} and spectral models made with CMFGEN \citep{Hellier_1998}. For the predictions of a population, \cite{Gotberg2019} assume the same \cite{Kroupa2001} IMF as in the Starburst99 model and the mass dependent initial binary fraction synthesized by \cite{Moe_2017}. They assume the mass ratios, $q \equiv M_{2,init}/M_{1,init}$, where $M_{1,init}$ is the initial mass of the donor star and $M_{2,init}$ is the initial mass of the accretor star, are uniformly distributed between 0.1 and 1. They also assume the orbital periods are uniformly distributed in log-space following \cite{Opik1924} for $M_{1,init} < 15\ M_\odot$ and \cite{Sana2012} for $M_{1,init} > 15\ M_\odot$. The metallicities used are 0.0002, 0.002, 0.006, and 0.014. The ionizing emission from a stellar population containing stars stripped of their hydrogen-rich envelopes via binary interaction is modeled by combining the Starburst99 models with those of \cite{Gotberg2019}. Although Starburst99 is made for single stars, it can be used to represent radiation from binaries prior to interaction when their evolution is effectively single. For more details, see \cite{Gotberg2019}. We interpolate between the different ages and metallicities of these stellar population models to generate SEDs for 586 galaxies from a snapshot of the \cite{KimmCen_2014} simulation at $z=7$ based on the ages, masses, and metallicities of each galaxy's star particles as output from the simulation. When calculating intrinsic SEDs (not accounting for absorption by intervening gas and dust), we recreate the star-formation history of each galaxy in order to construct multiple SEDs for the galaxy at various time points. To identify peaks of star-formation, we smooth the star-formation history of each galaxy, using a Gaussian kernel with a standard deviation of 5 Myr. An example of original and smoothed star formation histories for one of these galaxies is shown in the bottom panel of Figure \ref{fig:sf_history}, with the maxima of star-formation peaks identified by red points, start-times of star formation peaks identified by vertical dashed black lines, and end-times identified by vertical solid black lines. The start and end time of a star formation peak is defined as the time at which star-formation is 10\% of its maximum height. This smoothing is used only for the identification of start and end times of star formation peaks. To construct SEDs for simulated galaxies, we use the original, unsmoothed star-formation histories, as plotted in the top panel of Figure \ref{fig:sf_history}. SEDs are constructed for every Myr following each star formation peak, up to either 100~Myr or the beginning of the next star-formation peak. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{SF_History_ex.jpg} \cprotect\caption{\textbf{Top:} Star formation history for a single galaxy (with stellar mass $4.27 \times 10^5\ M_\odot$ at $z = 7$) from the simulations of \cite{KimmCen_2014}. \textbf{Bottom:} Smoothed star formation history for a single galaxy from the simulations of \cite{KimmCen_2014}, corresponding to the original star formation history in the top panel. Maxima of relevant star-formation peaks are identified by red points, start-times of star formation peaks are identified by vertical dashed black lines, and end-times are identified by vertical solid black lines. The start and end time of a star formation peak is defined as the time at which star formation is a tenth of its maximum.} \label{fig:sf_history} \end{figure} When accounting for absorption by hydrogen, helium, and dust, the resulting luminosity at a particular frequency, $\nu$, and line of sight, $\Omega$, is given by: \begin{equation} \begin{split} L_{esc}(\nu, \Omega) &= L(\nu) \exp\biggl[ -\sigma_{\text{HI}}(\nu)N_{\text{HI}}(\Omega) \\ & - \sigma_{\text{HeI}}(\nu)N_{\text{HeI}}(\Omega) -\sigma_{\text{HeII}}(\nu)N_{\text{HeII}}(\Omega) \\ & - k_{ext}\Sigma(\Omega) \biggr] \end{split} \end{equation} where $ L(\nu)$ is the luminosity before absorption; $N_{\text{HI}}(\Omega)$, $N_{\text{HeI}}(\Omega)$, and $N_{\text{HeII}}(\Omega)$ are the neutral hydrogen, neutral helium, and singly-ionized helium column densities along the line of sight (until the edge of the simulation box), computed based on the gas distribution output from the \verb"RAMSES" simulation; $\sigma_{\text{HI}}(\nu)$, $\sigma_{\text{HeI}}(\nu)$, and $\sigma_{\text{HeII}}(\nu)$ are neutral hydrogen, neutral helium, and singly-ionized helium cross-sections calculated according to \cite{Osterbrock}; $\Sigma(\Omega)$ is the surface density of dust along the line of sight, also output from the \verb"RAMSES" simulations; and $k_{ext}$ is the dust extinction opacity as modelled for the Small Magellanic Cloud (SMC) from \cite{Li_2001} and \cite{Weingartner_2001}. We use these dust extinction opacities because high redshift galaxies, like the SMC, are expected to have low metallicity. SEDs accounting for absorption are calculated for 100 randomly chosen sightlines to each galaxy at $z=7$ for an observer positioned at infinity, meaning that rays to each star particle for a particular sightline are assumed to be parallel. Note that while galaxies for which SEDs are calculated without absorption are sampled at multiple time points, specifically up to 100 times following the end of every starburst, galaxies for which SEDs are calculated with absorption are sampled at a single time point ($z=7$). Further, for SEDs with absorption, galaxies are only sampled if they are up to 100 Myr after a star formation peak. Each of these galaxies is sampled 100 times, for 100 randomly chosen lines of sight. Galaxies are only sampled at one time when absorption is included, because while we can reconstruct the star formation histories of these galaxies, we cannot reconstruct their past evolution of the gas. \subsubsection{Pop III Stars} \label{sec:popiii} To model SEDs of Pop III stars, we use the results of \cite{Schaerer2002} and \cite{Zackrisson_2011}. Current predictions for the initial mass functions (IMFs) of Pop III stars are uncertain. While some estimates suggest that Pop III stars are very massive (several hundred $M_\odot$, as in \cite{Bromm2001,2002Abel}), other estimates suggest that certain Pop III stars are much less massive \citep{Tan2004, Stacy2016}. Thus, we employ four different IMFs: three Salpeter IMFs with different upper and lower mass limits ($1<M/M_\odot<100$, $1<M/M_\odot<500$, $50<M/M_\odot<500$), and one log-normal IMF with mass limits $1<M/M_\odot<500$, a characteristic mass $M_c = 10\ M_\odot$, and a dispersion $\sigma = 1\ M_\odot$. We denote these models as IMF A, IMF B, IMF C, and IMF D, respectively. IMFs A and B correspond to Models A and B in \cite{Schaerer2002}, while IMFs C and D correspond to the PopIII.1 and PopIII.2 populations in the Yggdrasil models of \cite{Zackrisson_2011}. For results without absorption, we use intrinsic, zero-age SEDs for IMFs A and B, and intrinsic SEDs aged 0.01 Myr for IMFs C and D. For results with absorption, we calculate SEDs by replacing the stellar particles in the simulations with zero-age Pop III populations for IMFs A and B, and 0.01 Myr age Pop III populations for IMFs C and D. We then account for absorption as described in \S \ref{sec:single_stripped_stars}. As a result, for SEDs without absorption, we provide a single value for each SED measure for each Pop III IMF, while for SEDs with absorption, we provide a distribution of values (corresponding to the effects of absorption) for each SED measure for each Pop III IMF. We use only zero-age Pop III stars because most ionizing emission is emitted by the most massive stars, which have very short lifetimes ($\sim 3$ Myr), and the SED characteristics discussed in \S \ref{sec:full_res} do not change significantly for a population of Pop III stars while the most massive stars are still alive. We stress that, since we use cosmological simulations not aimed at simulating Pop III galaxies nor Pop III star formation specifically, the results for Pop III stars with absorption are rather approximate. \bigskip \section{Results} \label{sec:full_res} \subsection{Without Absorption} \label{sec:res} In this section we examine and compare the intrinsic SEDs of galaxies that do and do not include stripped stars, without any absorption. We also compare these results to intrinsic SEDs for Pop III stellar populations with three different Salpeter IMFs: $1<M/M_\odot<100$ (IMF A), $1<M/M_\odot<500$ (IMF B), $50<M/M_\odot<500$ (IMF C), and one log-normal IMF ($1<M/M_\odot<500$, IMF D). For our comparison we use four metrics. First, we define a broken power-law, $L_{\lambda} \propto \lambda^{\alpha_i}$, for three wavelength intervals: 240-500 $\text{\AA}$ ($\alpha_1$, hydrogen and neutral helium ionizing), 600-900 $\text{\AA}$ ($\alpha_2$, hydrogen ionizing), and 1200-2000~$\text{\AA}$ ($\alpha_3$). Our $\alpha_3$ is similar to the commonly used UV continuum slope $\beta$ \citep[see e.g.,][]{Shivaei2018, 2016ApJ...833..254S}. We do not analyze the hard HeII-ionizing regime of the SEDs because the ionizing emission rate of HeII-ionizing photons is very sensitive to the treatment of stellar winds, which is uncertain for hot stars (see \citealt{2014ARA&A..52..487S}, \citealt{2020MNRAS.491.4406S}, and in particular \citealt{Gotberg2017} for the effect for stripped stars). Second, we define the luminosity ratio, $L_{FUV}/L_{LyC}$, as the ratio of total luminosity in the 1200-2000 $\text{\AA}$ wavelength interval ($L_{FUV}$) to total luminosity in the 240-900 $\text{\AA}$ wavelength interval ($L_{LyC}$). This ratio is similar to the $f_{1500}/f_{900}$ ratio, commonly applied to characterize observed ionizing radiation from LyC-leaking galaxies by comparing observed fluxes at 1500 $\text{\AA}$ and 900 $\text{\AA}$ \citep[see e.g.,][]{2018MNRAS.476L..15V, 2015ApJ...810..107M}. Figure \ref{fig:spectra} shows an example SED for a galaxy (stellar mass $4.2 \times 10^5 M_{\odot}$, modeled $\sim$ 50 Myr after the most recent starburst) with stripped stars (black), without stripped stars (red), and a Pop III galaxy (IMF C, blue) before (solid) and after (dashed) absorption by intervening gas and dust. We see that stripped stars significantly change spectral shape at ionizing wavelengths, by flattening the spectral slope, but do not affect spectral shape in the FUV regime. We also see that the spectral shape of Pop III galaxies, while bearing more similarity to the spectral shape of galaxies with stripped stars than galaxies without stripped stars, is distinct from both stellar populations. In the sections that follow, we examine this effect in all sampled galaxies. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{Spectra_ex.jpg} \cprotect\caption{An example intrinsic SED and SED after absorption (in solid and dashed lines, respectively) for a galaxy with stripped stars (black), a galaxy without stripped stars (red), and a Pop III galaxy with a Salpeter IMF from 50 $M_\odot$ to 500 $M_\odot$ (IMF C, blue). The galaxy has a stellar mass of $4.2 \times 10^5 M_{\odot}$, and is modeled $\sim$ 50 Myr after the most recent starburst. Shaded grey regions show wavelength intervals used to calculate power-law indices: 240-500 $\text{\AA}$ ($\alpha_1$), 600-900 $\text{\AA}$ ($\alpha_2$), and 1200-2000~$\text{\AA}$ ($\alpha_3$). Pop III SEDs are re-scaled to the same flux level at 1500 $\text{\AA}$ as the SEDs for galaxies without stripped stars, for ease of comparison.} \label{fig:spectra} \end{figure} \subsubsection{Time Evolution of $\alpha_i$} Figure \ref{fig:slopes_ex} shows a typical example of the evolution of the power-law index for each wavelength range for a single galaxy as a function of time since the previous starburst. The blue line shows $\alpha_i$ for galaxy SEDs without stripped stars, while the orange line shows $\alpha_i$ for galaxy SEDs with stripped stars. Each panel shows $\alpha_i$ for a different wavelength interval. In the 240-500 $\text{\AA}$ and 600-900 $\text{\AA}$ intervals, there is a clear difference in the evolution of power-law index over time when stripped stars are included. For neutral helium-ionizing wavelengths (240-500 $\text{\AA}$), the power-law exponent for the SED that does not include stripped stars rises quickly for approximately the first 10~Myr following the end of a star formation peak, then continues to increase at a slower rate. The initially low values of $\alpha_1$ for these SEDs can be attributed to hard radiation from newly-formed O/B stars, as modelled by \cite{2010ApJS..189..309L}. As these O/B stars reach the end of their lifetime, there is a significant decrease in this hard radiation; $\alpha_1$ increases above 5 after 4 Myr, reaches 20 after 10 Myr and eventually 35 after 100 Myr. While we also see a slight increase in $\alpha_1$ for the SED that does include stripped stars, this rise is constant over time, and the power-law index remains below 5 over 100~Myr. The behavior of $\alpha_2$ is similar to that of $\alpha_1$ described above. For the galaxy without stripped stars, we again see a sharp increase soon after star formation followed by a less severe ($\alpha_2$ only reaches $\sim 11$), but consistent increase over 100~Myr. In contrast, the power-law for the SED including stripped stars settles at a constant value of $\alpha_2 \approx -0.7$ approximately 20 Myr after the end of star formation. This slight negative value indicates a preference for the lowest wavelength radiation in this interval, which originates from the high temperature of the stripped stars. Overall, Figure \ref{fig:slopes_ex} shows that the harder ionizing emission of stripped stars has a large impact on the SED in the LyC wavelength range, leading to lower values of $\alpha_{1,2}$, especially at later times. In the 1200-2000 $\text{\AA}$ interval, in line with the similar studies presented in \S6.2 of \cite{Gotberg2019}, we find that stripped stars do not significantly affect the power-law index of this galaxy's SED. We see a slight difference at later times, where the exponent for the SED with stripped stars is slightly more negative. This difference is small compared to the more prominent difference when stripped stars are included at LyC wavelengths. We expect stripped stars not to have as strong an effect at longer wavelengths, because even though stripped stars have a harder UV slope than the other stars in the stellar population, they are orders of magnitudes fainter in the UV and optical wavelengths. As a result, they are outshone at longer wavelengths, meaning that we do not see their footprint at these wavelengths in full galaxy SEDs \citep{Gotberg2019}. While above we have calculated power-law indices from luminosity as a function of wavelength, another commonly used definition of the spectral index measures luminosity as a function of frequency. Here, for ease of comparison, we briefly mention corresponding values of $\alpha_i$ over time following a star formation peak, when the power-law is defined as $L_{\nu} \propto \nu^{\alpha_{i,\nu}}$. In the 240-500 $\text{\AA}$ wavelength interval, when stripped stars are not included, we find that the spectral index $\alpha_{1,\nu}$ reaches $\sim -37$ after 100 Myr, while steadily decreasing from $-3.5$ to $-5.5$ when stripped stars are included. In the 600-900 $\text{\AA}$ interval, we find that when stripped stars are included, the power-law settles at a constant value of $\alpha_{2,\nu} \approx -1.3$. These values can be compared to values of $\alpha_{\nu}$ for other ionizing sources, such as AGN, which are expected to be within the range $-2.0 \leq \alpha_{\nu} \leq -1.2$, with some observations indicating slopes of $\alpha_{\nu} \approx -1.7$ \citep[see references in][]{2016MNRAS.456.3354F}. In the 1200-2000 $\text{\AA}$ interval, the power-law evolves from $\sim 0.5$ immediately after the end of star formation to $\sim -1$ after 100 Myr for both stellar populations. \begin{figure*} \centering \includegraphics[width=\textwidth]{Slope_Example.jpg} \caption{An example of the power-law index $\alpha_i$ (defined as the exponent in the power-law: $L_{\lambda} \propto \lambda^{\alpha_i}$) for a single galaxy (stellar mass $8.68 \times 10^4\ M_\odot$) over time, following a recent starburst. The power-law is calculated over three wavelength intervals: 240-500 $\text{\AA}$ ($\alpha_1$), 600-900 $\text{\AA}$ ($\alpha_2$), and 1200-2000~$\text{\AA}$ ($\alpha_3$). Indices for galaxy SEDs that do not include stripped stars are shown in blue while indices for galaxy SEDs that do include stripped stars are shown in orange.} \label{fig:slopes_ex} \end{figure*} \subsubsection{Metric Distributions by Luminosity} We now turn to the distributions of the four metrics described at the beginning of this section for simulated galaxies with absolute UV magnitude between $-15$ and $-11$. The absolute UV magnitude (calculated in the AB magnitude system) was averaged between 1485 and 1515 $\text{\AA}$ to avoid potential fluctuations from spectral features. The complete distribution of UV magnitudes when accounting for gas and dust absorption for 100 randomly chosen sightlines per galaxy at $z = 7$ is shown in Figure \ref{fig:mag_hist}. The dashed vertical line indicates which galaxies we might expect to be observable by JWST, according to \cite{Behroozi_2020}. \begin{figure} \centering \includegraphics[width=0.4\textwidth]{Mag_hist.jpg} \caption{Distribution of UV magnitudes for 100 randomly chosen sightlines per galaxy (accounting for absorption by gas and dust) at a redshift $z = 7.$ The vertical line shows UV magnitudes below which galaxies may be detectable by JWST, according to \cite{Behroozi_2020}.} \label{fig:mag_hist} \end{figure} Figure \ref{fig:slopes_fuv} presents a histogram of power-law indices in the 1200-2000 $\text{\AA}$ wavelength interval for galaxies in the UV magnitude interval mentioned above with (in orange) and without (in blue) stripped stars. These power-law indices (largely concentrated between $-2.5$ and $0.5$) are similar to those cited in studies that measure UV continuum slopes from observations, such as \cite{Shivaei2018}, which give power-law indices clustered between $-2.5$ and $-0.6$ (calculated from 1268-2580 $\text{\AA}$) at $z=2$ (see also \citealt{2016ApJ...831..176B} and \citealt{2019ApJ...881..124M} for measurements of UV continuum slopes at higher redshifts). We find that the distributions of power-law indices of the SEDs for galaxies with and without stripped stars overlap almost completely, suggesting again that stripped stars have little effect on SEDs in these wavelengths. \begin{figure} \centering \includegraphics[width=0.45\textwidth]{Slope_fuv_all.jpg} \caption{Histogram of the power-law index over the 1200-2000 $\text{\AA}$ wavelength interval ($\alpha_3$) for galaxies with UV magnitude between $-15$ and $-11$. Magnitudes were calculated as absolute magnitudes at 1500 $\text{\AA}$. The distributions for galaxy SEDs that include stripped stars are plotted in orange while the distributions for galaxy SEDs that do not include stripped stars are plotted in blue. } \label{fig:slopes_fuv} \end{figure} Figure \ref{fig:no_abs} presents results for $\alpha_1$, $\alpha_2$, and $L_{FUV}/L_{LyC}$ for $M_{UV} = [-15,-11]$ in the top, middle, and bottom panels respectively. The left panels are formatted in the same way as Figure \ref{fig:slopes_fuv}. The middle panels of Figure \ref{fig:no_abs} show the distributions of times after starburst for galaxies with SED metrics corresponding to signature peaks from stripped stars in the left panels: $0<\alpha_1<4,-1<\alpha_2<0.5$, and $10 < L_{FUV}/L_{LyC} < 70.$ The right panels present a comparison to Pop III stars for each metric. We find that $\alpha_1$ and $\alpha_2$ peak far more prominently near zero when stripped stars are included. When stripped stars are not present, we see that more galaxies tend to have larger power-law indices. In the top left panel the distribution of galaxies with stripped stars has a signature peak when $0<\alpha_1<4$. Within this range, galaxies with stripped stars outnumber galaxies without by a factor of $\sim 4.4$. Similarly, we see a signature peak in $\alpha_2$ between $-1$ and $0.5$, where galaxies with stripped star outnumber galaxies without stripped stars by a factor of $8.9$. The middle panels of the top two rows in Figure \ref{fig:no_abs} show that the most recent starburst for over 60\% of galaxies with stripped stars that contribute to the peaks in $\alpha_1$ and $\alpha_2$ was more than 10~Myr ago. Galaxies that include stripped stars and are more than 10 Myr past their most recent starburst likely fall within these low $\alpha_1$ and $\alpha_2$ peaks due to the ``delayed'' LyC radiation from stripped stars. For this reason, there is a larger fraction of galaxies older than 10 Myr when stripped stars are included. It is somewhat unexpected that a significant proportion of galaxies that do not include stripped stars continue to have low values of $\alpha_1$ and $\alpha_2$ 10 Myr after the most recent starburst, as the lifetime of the O/B stars that produce hard radiation is typically under 10 Myr. This result suggests there may be some ongoing star formation after the main peak has ended. In the top and center right panels of Figure \ref{fig:no_abs}, we see no overlap in the distribution of $\alpha_1$ and $\alpha_2$ for galaxies with stripped stars and the Pop III models. Interestingly, while all Pop III IMFs produce SEDs with negative values of $\alpha_1$, $\alpha_1$ is positive for all galaxies with stripped stars. As expected, IMF A, with the lowest upper mass limit, has the softest SED, while IMF C, with the highest lower mass limit, has the most negative values for $\alpha_1$ and $\alpha_2$. This trend indicates that we may expect more similarity in the SEDs of galaxies with stripped stars and galaxies with certain low-mass Pop III stars, but that galaxies composed of Pop III stars with masses greater than $100 M_\odot$ have different spectral shapes. \begin{figure*} \centering \includegraphics[width=\textwidth]{all_combined.jpg} \caption{Distributions of $\alpha_1$ (top), $\alpha_2$ (middle), and $L_{FUV}/L_{LyC}$ (bottom) for all sampled galaxies with $M_{UV} = [-15,-11]$. \textbf{Left Panel:} Histograms of each metric with galaxies with stripped stars in orange and galaxies without stripped stars in blue. \textbf{Middle Panel:} Distributions of times after starburst for galaxy SEDs with $\alpha_1$ between 0 and 4 (top), $\alpha_2$ between $-1$ and $0.5$ (middle), and $L_{FUV}/L_{LyC}$ between 10 and 70 (bottom), corresponding to the prominent peaks plotted in the left panel. \textbf{Right Panel:} Histograms of each metric for galaxy SEDs that include stripped stars (orange). Vertical lines show values for Pop III populations with IMFs A (solid black line), B (dashed black line), C (dotted black line), and D (dash-dotted black line). \label{fig:no_abs}} \end{figure*} The bottom panels of Figure \ref{fig:no_abs} show results for the ratio of total luminosity between 1200 and 2000 $\text{\AA}$ to total luminosity between 240 and 900 $\text{\AA}$. These results are similar to measurements of $f_{1500}/f_{900}$ flux density ratios from LyC-leaking galaxies. \cite{2018MNRAS.476L..15V}, for example, find a ratio of $\sim 19$ for a star-forming galaxy with stellar mass $1.5 \times 10^9\ M_{\odot}$, while \cite{2015ApJ...810..107M} find a ratio of $\sim 4.0$ for a galaxy with stellar mass $4.8 \times 10^8\ M_{\odot}$. The distributions of FUV to LyC luminosity ratios for galaxies with and without stripped stars overlap very closely when $L_{FUV}/L_{LyC} < 3$. These SEDs can be attributed primarily to galaxies less than 10 Myr after star formation peaks, indicating that galaxies with the largest proportion of ionizing radiation relative to FUV radiation are dominated by recent starbursts. The largest peak in the distribution of SEDs including stripped stars occurs for ratios roughly between 10 and 70, and mostly can be attributed to times 10-30 Myr after the most recent peak. Specifically, we find that $\sim 80\%$ of galaxies that include stripped stars and contribute to ratios between 10 and 70 are more than 10 Myr past the most recent starburst, meaning that we expect these galaxies to be dominated by radiation from stripped stars. The difference between the fraction of galaxies with and without stripped stars that fall within the selected range and are over 10~Myr since the last starburst is most dramatic for this metric; $84\%$ of galaxies without stripped stars are less than 10~Myr past their most recent star formation peak. This result suggests even ongoing star formation post-starburst cannot lead to values of $L_{FUV}/L_{LyC}<70$. As a result, SEDs falling within this peak are almost exclusively from galaxies undergoing rapid star formation or containing stripped stars. In the bottom right panel of Figure \ref{fig:no_abs}, we see that Pop III galaxies, for all four IMFs, have smaller luminosity ratios than what we predict in galaxies with stripped stars. In fact, these ratios are always less than one, suggesting that galaxies dominated by LyC radiation are either starburst galaxies or made up of Pop III stars, rather than dominated by emission from stripped stars, which instead will lead to ratios between 10 and 70. \begin{figure*} \centering \includegraphics[width=\textwidth]{Slope_600-900_v.jpg} \caption{\textbf{Left Panel:} Histograms of the power-law index over the 600-900 $\text{\AA}$ wavelength interval ($\alpha_2$) for galaxy SEDs in four magnitude intervals, with the same notation as in the left panels of Figure \ref{fig:slopes_fuv}. \textbf{Middle Panel:} Distributions of times after starburst for galaxy SEDs with power-law index $\alpha_2$ between $-1$ and 0.5, corresponding to the prominent peaks and four magnitude intervals plotted in the left panel. \textbf{Right Panel:} Histograms of power-law index $\alpha_2$ over the 600-900 $\text{\AA}$ wavelength interval in four different magnitude intervals for galaxy SEDs that include stripped stars (orange). Vertical lines show values of $\alpha_2$ for Pop III populations with IMFs A (solid black line), B (dashed black line), C (dotted black line), and D (dash-dotted black line). \label{fig:slopes_lyc}} \end{figure*} We now discuss the dependence of these metrics on UV magnitude, using $\alpha_2$ as a typical example. Figure \ref{fig:slopes_lyc} presents results for power-law indices for the 600-900 $\text{\AA}$ wavelength interval, divided into four magnitude bins: $M_{UV}=[-15,-14], [-14,-13]$, $[-13,-12], [-12,-11]$ mag. Figure \ref{fig:slopes_lyc} is formatted from left to right in the same way as Figure \ref{fig:no_abs}. For galaxies that do not include stripped stars, we see that the power-law index tends to increase with decreasing luminosity. Higher luminosity galaxies tend to have more recent star formation and therefore have harder ionizing radiation emitted by newly formed O/B stars. The presence of O/B stars leads to a slight peak in galaxy SEDs without stripped stars at smaller values of $\alpha_2$. This peak shifts to the right as luminosity decreases and fewer galaxies have recent star formation. In contrast, we see a prominent peak in the power-laws of galaxies with SEDs that include stripped stars at $\alpha_2$ between $-1$ and 0.5, which remains largely unchanged at all luminosities. Interestingly, when stripped stars are included, we find no galaxies with $\alpha_2 > 1$. For the most luminous magnitude bin, we find that galaxies with stripped stars outnumber galaxies without stripped stars by roughly a factor of 3.5 at these lower values of $\alpha_2$. However, the difference between galaxy SEDs with and without stripped stars is clearest in lower luminosity galaxies, where there are almost two orders of magnitude more galaxies with negative power-law indices when stripped stars are included. In summary, we find that stripped stars strongly effect the distribution of $\alpha_2$ in all considered magnitude bins, and that the effect becomes even more prominent for fainter galaxies. The same effect was observed for distributions of $\alpha_1$ and $L_{FUV}/L_{LyC}$, with both trending towards higher values for lower luminosity galaxies. The middle panels of Figure \ref{fig:slopes_lyc} show the fraction of galaxies within the peak in $\alpha_2$ described above ($-1<\alpha_2<0.5$) that are anywhere from 0 to 100~Myr after their last starburst. For the highest luminosity galaxies ($M_{UV} < -14$), where recent star formation is significant, we find that the peaks at smaller $\alpha_2$ are mainly made up of galaxies less than 10 Myr after starburst ($\sim 75 \%$ for SEDs without stripped stars, and $\sim 55 \%$ for SEDs with stripped stars). At lower luminosities, a majority of galaxies that include stripped stars and are within the selected range in $\alpha_2$ are older than 10 Myr. For the least luminous galaxies, for example, 80\% of galaxies with stripped stars that contribute to the shallower $\alpha_2$ are over 10 Myr past their most recent starburst. These results again indicate that we are most likely to see the effects of stripped stars in the lowest luminosity galaxies. However, even for galaxies in the brightest magnitude bin, we are likely to see the effects of stripped stars, as $\sim 45 \%$ of these galaxies are more than 10 Myr after recent star formation. The right panels of Figure \ref{fig:slopes_lyc} present a comparison between the distribution of $\alpha_2$ for the SEDs of galaxies with stripped stars to $\alpha_2$ for the SEDs of a population of Pop III stars with IMFs A, B, C, and D, plotted as solid, dashed, dotted, and dash-dotted vertical black lines, respectively. We see that all Pop III IMFs have harder SEDs than those of galaxies with stripped stars, at all luminosities. \subsection{Accounting for Absorption} \label{sec:abs} To more accurately determine $\alpha_i$ and $L_{FUV}/L_{LyC}$ as would be viewed by an observer, we account for absorption by hydrogen, helium, and dust, as a function of frequency. For each galaxy, we choose 100 random lines of sight and position an observer at infinity. Values are calculated only at $z = 7$. Thus, we note that our histograms with absorption present fewer galaxies, particularly at higher luminosities (see Figure \ref{fig:mag_hist}). Specifically, the following results consist of 200 sightlines for $M_{UV} = [-15, - 14]$, 1400 sightlines for $M_{UV} = [-14, - 13]$, 2300 sightlines for $M_{UV} = [-13, - 12]$, and 3200 sightlines for $M_{UV} = [-12, - 11]$. Below we compare our results for galaxies that include emission from only single stellar populations, galaxies that also include emission from stripped stars, and galaxies that include emissions from only zero-age Pop III stars. \begin{figure*} \centering \includegraphics[width=\textwidth]{all_combined_abs.jpg} \caption{Distributions of $\alpha_1$ (top), $\alpha_2$ (middle), and $L_{FUV}/L_{LyC}$ (bottom) for all sampled galaxies with $M_{UV} = [-15,-11]$, calculated for 100 randomly chosen lines of sight per galaxy. \textbf{Left Panel:} Histograms of each metric with galaxies with stripped stars in orange and galaxies without stripped stars in blue. \textbf{Middle Panel:} Distributions of times after starburst for galaxy SEDs with $\alpha_1$ between $-2$ and 4 (top), $\alpha_2$ between $-2$ and $0.5$ (middle) , and $L_{FUV}/L_{LyC}$ between 10 and 500 (bottom), corresponding to the prominent peaks plotted in the left panel. \textbf{Right Panel:} Histograms of each metric for galaxy SEDs that include stripped stars (orange) and Pop III populations with IMFs A (solid black line), B (dashed black line), C (dotted black line), and D (dash-dotted black line)}. \label{fig:abs} \end{figure*} Figure \ref{fig:abs} is the same as Figure \ref{fig:no_abs}, except it presents results accounting for absorption by intervening gas and dust (see \S \ref{sec:single_stripped_stars}, \S \ref{sec:popiii}). For all metrics, we again see a consistent peak at shallower power-law indices for galaxy SEDs that do include stripped stars. We see a signature peak in galaxies with stripped stars for $-2 < \alpha_1 < 4$, $-2 < \alpha_2 < 0.5$, and $10 < L_{FUV}/L_{LyC} < 500$. Compared to results that did not account for absorption, we also find that absorption tends to cause a slight trend towards negative values of $\alpha_1$ and $\alpha_2$, due to the tendency of H and He to absorb more at lower wavelengths over these intervals. For $L_{FUV}/L_{LyC}$, we see a shift towards larger ratios when we account for absorption. This shift is a result of H and He absorption at ionizing wavelengths. With absorption we find that $\sim80\%$ of galaxies that include stripped stars and make up the prominent peaks for each of the metrics are over 10 Myr after starburst. This proportion is larger than without absorption, because within the first 10~Myr after a starburst, before feedback has time to remove gas from the birth cloud, most LyC radiation will be absorbed. On the other hand, ionizing photons from stripped stars, which begin to form at an approximately 10 Myr delay following the end of star formation, will be able to escape and produce the hard SEDs that make up the peaks in the distributions in the left panels of Figure \ref{fig:abs}. In contrast, the same ranges of power-law indices for SEDs without stripped stars are composed almost exclusively of galaxies experiencing recent star formation peaks. This result suggests that absorption of LyC photons in the still gas-rich regions undergoing star formation after a galaxy's star formation peak prevents these regions from significantly hardening their galaxy's SED as they did in \S \ref{sec:res}. The right panels of Figure \ref{fig:abs} show a comparison between SEDs from galaxies with stripped stars and galaxies composed of Pop III populations of various IMFs, where we have accounted for absorption. Similar to results from galaxies without absorption, we find that Pop III stars produce the hardest ionizing spectra. For Pop III populations with an IMF from 1-100 $M_\odot$ (IMF A), we see a very slight overlap with the stripped-star distribution of $\alpha_1$ and $\alpha_2$. The luminosity ratio distributions show the most overlap between Pop III galaxies and stripped-star galaxies. Still, the Pop III and stripped-star populations are clearly distinct. Figure \ref{fig:alpha_density} presents contour plots for each set of stellar populations for results with absorption in the $\alpha_1 - \alpha_2$ plane, with contour lines containing 5\%, 50\%, 75\%, and 95\% of galaxies from inside out. The left panel displays galaxies with stripped stars, galaxies without stripped stars, and Pop III galaxies with IMFs A, B, C, and D, colored black, blue, green, purple, red, and orange, respectively. The right panel is zoomed in on galaxies composed of Pop III stars and galaxies with stripped stars. We see a clear separation between the high-density regions of galaxies with and without stripped stars. Specifically, we see no overlap between 95\% of galaxies with stripped stars and 75\% of galaxies without stripped stars. We also find that Pop III galaxies are distinct from galaxies with stripped stars. For all four IMFs, we find that Pop III galaxies have more negative values of $\alpha_1$ and $\alpha_2$ than galaxies with stripped stars. Contour lines for IMFs B and D, which have the same upper and lower mass limits ($1<M/M_\odot<500$), but different mass distributions (IMF B uses a Salpeter slope while IMF D is log-normal with $M_c = 10\ M_\odot$ and $\sigma = 1\ M_\odot$), overlap almost completely. This overlap suggests that the maximum mass plays the most significant role in determining the power-law indices for Pop III stellar populations. We also note that a small fraction of Pop III galaxies ($0.2\%$), galaxies with stripped stars ($0.1\%$), and galaxies without stripped stars ($0.02\%$) have $\alpha_2 > \alpha_1$. This effect is caused by strong absorption of radiation in the $\alpha_1$ interval over particular lines of sight, resulting in power-law indices that appear to characterize particularly hard spectra. \begin{figure*} \centering \includegraphics[width=0.7\textwidth]{alpha_density_all.jpg} \caption{\textbf{Left Panel:} Contour plot of the number of galaxies in the $\alpha_1 - \alpha_2$ plane for galaxies with stripped stars (black), galaxies without stripped stars (blue), Pop III galaxies with IMF A (green), IMF B (purple), IMF C (red), and IMF D (orange). Contour lines contain 5\%, 50\%, 75\%, and 95\% of cases from inside out. \textbf{Right Panel:} Same as the left panel but zoomed in on galaxies with stripped stars and galaxies composed of Pop III stars. \label{fig:alpha_density}} \end{figure*} \section{Summary and Conclusions} \label{sec:conclusion} Our findings can be summarized as follows: \begin{enumerate} \item Stripped stars have little effect on SEDs in the 1200-2000 $\text{\AA}$ interval (Figure \ref{fig:slopes_fuv}). This result is expected, given that stripped stars emit most at ionizing wavelengths. \item In the 600-900 $\text{\AA}$ interval, galaxy SEDs with stripped stars have signature power-law indices concentrated between $-2$ and 0.5, with no galaxies exhibiting values of $\alpha_2 > 1$ (Figures \ref{fig:no_abs}, \ref{fig:abs}). We see a clear difference between SEDs with and without stripped stars. When we account for absorption we find that $\sim 80\% $ of galaxies contributing to power-law indices between $-2$ and 0.5 are more than 10 Myr from the end of their most recent starburst. The length of time since the last starburst for these galaxies suggests that their SEDs are dominated by ionizing emission from stripped stars rather than O/B stars formed in recent starburts. Our results suggest that if the SED of a galaxy has a power-law index between 600 and 900 $\text{\AA}$ greater than one, that galaxy would not contain any stripped stars. \item In the 240-500 $\text{\AA}$ interval, galaxy SEDs with stripped stars have signature power-law indices concentrated between $-2$ and 4 (Figures \ref{fig:no_abs}, \ref{fig:abs}), with no galaxies exhibiting values of $\alpha_1 > 5$. As in the previous point, when we account for absorption a majority of galaxies with power-law indices between $-2$ and 4 are more than 10 Myr after the most recent starburst. This result again indicates that ionizing radiation from these galaxies is likely to be dominated by stripped stars. \item In the $\alpha_1 - \alpha_2$ plane, as in Figure \ref{fig:alpha_density}, we find a clear distinction between galaxies with and without stripped stars. Specifically, we find that there is no overlap between 95\% of galaxies with stripped stars and 75\% of galaxies without stripped stars. \item $L_{FUV}/L_{LyC}$ peaks between 10 and 500 for galaxy SEDs that include stripped stars, while the distribution of values for galaxy SEDs without stripped stars sits somewhat higher. Approximately 80\% of galaxies that contain stripped stars and contribute to luminosity ratios between 10 and 500 are over 10 Myr past their most recent starburst (Figures \ref{fig:no_abs}, \ref{fig:abs}). As above, this result suggests that the SEDs of these galaxies will be dominated by stripped stars. \item There is little similarity in SEDs between galaxies with stripped stars and Pop III populations with IMFs A, B, C, or D. This is clearest when $\alpha_1$ and $\alpha_2$ are taken together, as in Figure \ref{fig:alpha_density}. These results indicate that it is likely possible to distinguish between galaxies containing stripped stars and Pop III stars in most cases. More robust comparisons between Pop III stars and stripped stars will require a better understanding of the Pop III IMF and more detailed models of early galaxies containing Pop III stars. \item While differences between each stellar population are clear at all luminosities, we see the greatest differences between galaxies with and without stripped stars at lower luminosities (Figure \ref{fig:slopes_lyc}). Specifically, we see a trend towards higher values of $\alpha_1$, $\alpha_2$, and $L_{FUV}/L_{LyC}$ for galaxies without stripped stars as luminosity decreases, while metric distributions remain largely unchanged as a function of luminosity when stripped stars are present. We also find that an increasing fraction of galaxies corresponding to signature peaks from stripped stars in each metric are more than 10 Myrs after starburst as luminosity decreases, reaching $\sim 90\%$ for the lowest luminosity galaxies. \end{enumerate} \cite{Behroozi_2020} found that galaxies at a UV magnitude less than $-17$ (in the AB system) were likely to be detected by JWST with high confidence ($> 85\%$) at redshifts up to 13.5, and indicated that galaxies at a UV magnitude less than $-14$ may be detectable at lower confidence. Figure \ref{fig:slopes_lyc} suggests that galaxies one to two magnitudes dimmer would have the most distinctive signatures of stripped stars being present. However, Figure \ref{fig:slopes_lyc} still suggests that smaller power-law indices and smaller luminosity ratios are likely to indicate that stripped stars are present even for $M_{UV}$ between $-15$ and $-14$. From $z = 7$ to $z = 6$, we expect little change in the galaxy luminosity function, particularly at low luminosities \citep{Trac_2015}. At $z = 6$ galaxies with $M_{UV}$ between $-15$ and $-14$ may be detectable by certain JWST ultra-deep surveys or if gravitationally lensed \citep{2013JCAP...12..017M}. We also expect the ionizing spectrum to leave imprints on the emission line properties of galaxies. For example, binary populations present a possible explanation for observed high emission line ratios [O III]/H$\beta$ in distant, low-mass, star-forming galaxies \citep{2014MNRAS.444.3466S}, as products of binary evolution tend increase emission line strengths for older stellar populations, relative to those predicted from single-stars. \cite{2018MNRAS.477..904X} modeled and characterized nebular line ratios between single stellar populations and binary populations, and found that binary populations enhance emission line strength, particularly on the metal lines [N II], [S II], [O III] and [O I], for stellar populations older than 10 Myrs. Future work can use our comparison of the differences in the SEDs of galaxies made up of different stellar populations to predict the impact of these differences on emission line properties and other observational signatures. With the launch of JWST, we will be able to observe faint, low-mass galaxies during cosmic reionization. We predict that stripped stars dramatically increase the ionizing emission from the bulk of these galaxies, which, for example, could significantly affect the morphology of the nebular spectrum. We have also shown that stripped stars and Pop III stars appear to have completely different spectral hardness in the ionizing regime. Therefore, it may be possible to use the hardness of ionizing radiation as a key for revealing what sources in a stellar population are responsible for the emitted ionizing radiation. Our results highlight the importance of better understanding the spectral hardness of various different ionizing sources and their effect on observable quantities. \acknowledgments We thank Taysun Kimm for kindly sharing the simulation data. Computing resources were in part provided by the NASA High- End Computing (HEC) Program through the NASA Advanced Supercomputing (NAS) Division at Ames Research Center. A.S. is supported by the NSF Graduate Research Fellowship Program under Grant No. DGE-1656466. The research is supported in part by NASA grant 80NSSC18K1101. Y.G. acknowledges support from NASA through the NASA Hubble Fellowship Program grant \#HST-HF2-51457.001-A awarded by the Space Telescope Science Institute, which is operated by the Association of Universities for Research in Astronomy, Inc., for NASA, under contract NAS5-26555. \vspace{5mm} \clearpage
\section*{Introduction} Quantum chaos is a certain type of complex quantum behavior that results in the exponential decay of out-of-time-order correlation functions (OTOC)\cite{kitaev2014hidden,roberts2017chaos,harrow2020separation} efficient operator spreading\cite{nahum2018operator,khemani2018spreading}, small fluctuations of the purity\cite{Oliviero2020random} and information scrambling\cite{ding2016conditional,hosur2016chaos}. All these quantities can be unified in a single framework\cite{leone2020isospectral} which shows that, in order to simulate quantum chaos, one needs at least a unitary $4$-design, that is, a set of unitary operators that reproduces up to the four moments of the Haar distribution over the unitary group $\mathcal U(d)$ in an $d$-dimensional Hilbert space. {Here, we define quantum chaos for a quantum evolution in terms of attaining the Haar value for general multi-point OTOC, that is, the value that would be reached by a random unitary operator in $\mathcal U (d)$. We consider a subgroup of the unitary group - the Clifford group - which only reproduces up to the four-point OTOC\cite{roberts2017chaos} and thus it is not sufficient to simulate quantum chaotic evolutions.} In \cite{zhou2020single}, it was shown numerically that a Clifford circuit on a $d=2^N$-dimensional system of $N$ qubits doped by a single $T$ gate can bring a typical product state in an entangled state with the same entanglement spectrum statistics resulting from the random matrix theory for $\mathcal U(d)$. This result opens the question of whether it would be possible to simulate quantum chaos with classical resources. In a seminal paper\cite{gross2020quantum}, the authors show that an $\epsilon$-approximate $t$-design can be obtained by doping a Clifford circuit with $k=O(t^4\log^2t\log\epsilon^{-1})$ non Clifford gates. In particular, one can $\epsilon$-simulate the quantum channel that realizes a $4$-design by classical resources. This result is striking: by injecting a vanishing density $\sigma=k/N$ of non Clifford gates in a Clifford quantum circuit - as the authors say, {\em homeopathically} - one can obtain any $\epsilon$-approximate $t$-design. Does this mean that one can simulate quantum chaos classically? The answer is no, because - as we will show - to simulate quantum chaos, the error $\epsilon$ must be exponentially small in $N$, $\epsilon =O(d^{-\alpha})$, where $\alpha$ only depends on the Haar average over the full unitary group. A corollary of the result in\cite{gross2020quantum} is that a {\em sufficient} condition to simulate quantum chaos requires $O(N)$ non Clifford resources. In this paper, we show that $\Theta(N)$ non Clifford resources are {\em both necessary and sufficient} to simulate quantum chaos. To this end, we explicitly compute the $8$-point OTOC and the fluctuations of the purity in a subsystem and show that a doped Clifford circuit will attain the Haar values for these quantities if and only if $\Theta(N)$ non Clifford resources are used. In other words, one needs more than a homeopathic dose of non Clifford gates to simulate quantum chaos. Can a classical computer simulate quantum chaos? In order to simulate a Clifford circuit with a $\Theta(N)$ non-Clifford resources, an exponential number of classical resources are needed \cite{bravyi2016improved}. Complexity-theoretic arguments \cite{bremner2011classical, Harrow2017supremacy} imply that one cannot simulate efficiently on a classical computer a quantum Clifford circuit doped with $\Theta(N)$ non-Clifford gates, and therefore, since this is necessary to simulate quantum chaos, the latter cannot be efficiently simulated on a classical computer: quantum chaos is quantum. \section{Doped Random Quantum Clifford Circuits}\label{sec:schemdop} Consider doped random quantum Clifford circuits $U^{(k)}$ on a system $\mathcal{H}=\mathbb{C}^{2\otimes N}$ of $N$ qubits of dimension $d=2^N$. The architecture of the circuit is the following: we have layers of random Clifford unitary operators on the full $\mathcal{H}$ interspersed by a single qubit gate $K_i$ applied randomly on any qubit $i$, see Fig.\ref{fig1}. As we shall see in Sec. \ref{lemma}, the positioning $i$ of the gates $K$ does not play any role. We denote by $k$ the number of gates $K$ in the circuit, also called the number of {\em layers} of the circuit, $\psi$ a pure input state for the circuit, and $\psi_U = U\psi U^\dagger$ its output. We call the quantity $\sigma=k/N$ the {\em doping} of the circuit $U^{(k)}$. \begin{figure}[h!] \centering \includegraphics[scale=0.1]{DiagramT.png} \caption{{\em Left}: Scheme of the $4$-Doped Clifford circuit. {\em Right}: Detail of $K_{C_{4}}$, a unitary single-qubit non Clifford gate $K$ evolved adjointly by a Clifford circuit $C_{4}$. Note that the set formed by these circuits is equivalent to the set of doped Clifford circuits, i.e circuits composed by Clifford unitaries $C_{i}$ interspersed with single-qubit non Clifford gates $K_{i}$.} \label{fig1} \end{figure} We denote by $x$ a set of unitary operators, e.g. $x= \mathcal U(d), \mathcal C(d)$ the unitary and Clifford group, respectively, on $\mathcal{H}$. For $k=0$, the circuit is just a Clifford circuit, $U^{(0)}\in\mathcal C(d)$. The Haar average on these sets will be denoted by $\langle\cdot\rangle_{U\in x}$. We define the $(x,t)$-fold channel as \begin{eqnarray} \Phi_{x}^{(t)}(\mathcal{O}):=\aver{\mathcal{O}_{U}}_{U\in x} \end{eqnarray} where $\mathcal{O}\in\mathcal{B}(\mathcal{H}^{\otimes t})$ and $\mathcal{O}_{U}\equiv U^{\otimes t}\mathcal{O}U^{\dag\otimes t}$. Averaging over $\mathcal C(d)$ for a circuit $U^{(k)}$ with $k$ layers involves averaging over $k$ independent Clifford groups; in the following we define this set of circuits as $\mathcal{C}_k$. The $(\mathcal{C}_k,4)$-fold channel is \begin{equation}\label{groupav} \Phi^{(4)}_{\mathcal C_k} (\mathcal O)= \left\langle \mathcal{O}_{U}\right\rangle_{U\in\mathcal{C}_k} \equiv \left\langle C_{k}^{\otimes 4}K_{i_k}^{\otimes 4}\dots C_{1}^{\otimes 4}K_{i_{1}}^{\otimes 4}C_{0}^{\otimes 4}\mathcal{O}C_{0}^{\dag\otimes 4}K_{i_1}^{\dag\otimes 4}C_{1}^{\otimes 4}\dots K_{i_{k}}^{\dag\otimes 4}C_{k}^{\dag\otimes 4}\right\rangle_{C_1\ldots C_k\in\mathcal{C}(d)} \end{equation} Notice that the above average over $\mathcal C(d)$ is the same thing - because of the left/right invariance of group averages - than the average over circuits of the type sketched in Fig.\ref{fig1}. Quantum chaos can be defined as an appropriate form of the butterfly effect\cite{roberts2016bound}: an exponential (in $N$) decay of the OTOCs defined as \begin{equation} \otoc_{8}(U):=d^{-1}\tr\left(AB_{U}CD_{U}A^\dag D^\dag_{U}C^\dag B^\dag_{U}\right) \label{8otocdef} \end{equation} so that the OTOCs adhere to the value of the OTOCs obtained by Haar-random $U$ on the unitary group scaling with $d^{-4}$, while other ensembles, like the Clifford group, feature a scaling of $d^{-2}$\cite{roberts2017chaos}. It is immediate to see that, in order to distinguish the two types of scaling, one needs an $\epsilon =O(d^{-4})$. As $2t$-OTOCs are probes of $t$-designs, an $8$-point OTOC is a probe of a $4$-design, and therefore a quantum chaotic channel needs to have a frame potential exponentially close to that of the Haar measure on $\mathcal U(d)$. A related measure of chaos\cite{leone2020isospectral} is given by the fluctuations of the purity of the reduced density matrix to a subsystem \begin{eqnarray}\label{flucpurdef1} \Delta_{x}\operatorname{Pur}(\psi_U)_A:= \left\langle (\operatorname{Pur}(\psi_U)_A-\langle \operatorname{Pur}(\psi_U)_A\rangle_{U\in x})^2\right\rangle_{U\in x} \end{eqnarray} This quantity is related to the emergent irreversibility in closed quantum systems\cite{chamon2014emergent} and to both $4$-designs and OTOCs. In Sec. \ref{flucpurity}, we show that the purity fluctuations are exponentially small for every doping (including no doping, $k=0$) of the random Clifford circuits and thus also to distinguish the fluctuations of the purity one needs an exponentially small error $\epsilon$. We ask the question: what is the necessary and sufficient number $k$ of non Clifford gates $K$ for $U\in\mathcal{C}_{k}$ to simulate quantum chaos? The main goal of this paper is to show that, for $\mathcal{C}_{k}$ to reproduce the Haar-unitary values of the probes Eqs. \eqref{8otocdef} and \eqref{flucpurdef1}, $\Theta(N)$ non Clifford resources are both necessary and sufficient. We will prove it in the next sections by explicitly computing these two quantities. Here, we want to make some more general considerations. Given a probe to quantum chaos defined as $\mathcal{P}_t(U):=\tr(T^{(t)}\mathcal{O}_1 U^{\otimes t}\mathcal{O}_{2}U^{\dag\otimes t})$, see\cite{leone2020isospectral,Oliviero2020random}, we can establish the following \begin{prop} Let $\mathcal{P}_{t}(U)$ a probe of quantum chaos of order $t$. If the number $k$ of non Clifford gates in the doped Clifford circuit $U\in \mathcal{C}_k$ is $k=O((\alpha+t) Nt^{4}\log^2(t))$, then: \begin{equation} \delta_{\mathcal{P}}^{(k)}\equiv\left|\aver{\mathcal{P}(U)}_{U\in\mathcal{C}_k}-\aver{\mathcal{P}(U)}_{U\in\mathcal{U}(d)}\right|\le O(d^{-\alpha}) \end{equation} where $\alpha$ is given by the following relation $\aver{\mathcal{P}(U)}_{U\in\mathcal{U}(d)}=O(d^{-\alpha})$. \end{prop} \begin{proof} The proof is straightforward from the result in \cite{gross2020quantum}. In \cite{leone2020isospectral}, we proved that the generic probe $\mathcal{P}_t(U)$ to quantum chaos can be written as $\mathcal{P}_t(U)=\tr(T^{(t)}\mathcal{O}_1 U^{\otimes t}\mathcal{O}_{2}U^{\dag\otimes t})$ where $\mathcal{O}_1,\mathcal{O}_2, T^{(t)}\in\mathcal{B}(\mathcal{H}^{\otimes t})$, including the $2t$-point OTOC which characterize $t$-designs\cite{roberts2017chaos}. Then, the following inequality holds: \begin{equation} \delta_{\mathcal{P}}^{(k)}\le \norm{T^{(t)}\mathcal{O}_1}_{\infty}\norm{\mathcal{O}_2}_{1}\norm{\Phi^{(t)}_{\mathcal{C},k}(\cdot)-\Phi^{(t)}_{\mathcal{U}(d)}(\cdot)}_{\diamond}\le d^t \norm{T^{(t)}\mathcal{O}_1}_{\infty}\norm{\mathcal{O}_2}_{\infty}\norm{\Phi^{(t)}_{\mathcal{C},k}(\cdot)-\Phi^{(t)}_{\mathcal{U}(d)}(\cdot)}_{\diamond} \end{equation} where we bounded $\norm{\mathcal{O}_2}_{1}\le \norm{\mathcal{O}_2}_{\infty}\norm{{\mathchoice {\rm 1\mskip-4mu l} {\rm 1\mskip-4mu l^{\otimes t}}_{1}=d^t\norm{\mathcal{O}_2}_{\infty}$. Thus if $k=O((\alpha+t) Nt^{4}\log^2(t))$ then $\delta^{(k)}_{\mathcal{P}}=O(d^{-\alpha})$.\end{proof} As we will show in the following sections, the error $O(d^{-\alpha})$ is required to have OTOCs and fluctuations of the purity attain the unitary-Haar values. It follows that injecting $O(N)$ non Clifford resources into a Clifford circuit is sufficient to obtain quantum chaos. As we stated above, the necessary (together with the sufficient) condition will follow from direct calculations. It is important at this point to make some remarks about the value of $t$. One wonders if it is enough to consider $8$-OTOCs to reveal quantum chaos, or if sometimes it should be necessary to use higher order OTOCs. From the point of view of the above proposition, it is clear that $O(N)$ non Clifford resources are sufficient to obtain any OTOC with an exponentially good $O(d^{-\alpha})$ approximation. Once one has proved the necessary condition for $t=4$, it will also hold for any $t>4$ design, as an approximate $t$-design is necessarily a $t^{\prime}$ approximate design, for all $t^{\prime}<t$. In other words, polynomials of degree four are all that takes to reveal quantum chaos. {To see this, notice that the $4m-$OTOCs defined as \begin{equation} \otoc_{4m}(U):=d^{-1}\tr[(A_{1}B_{1}^{U}A_{2}B_{2}^{U}\cdots A_{m}B_{m}^{U})A_{1}^{\dag}(A_{1}B_{1}^{U}A_{2}B_{2}^{U}\cdots A_{m}B_{m}^{U})] \label{4motocdef} \end{equation} reduces, for $A_{3},\dots, A_m,B_{3},\dots B_{m}={\mathchoice {\rm 1\mskip-4mu l} {\rm 1\mskip-4mu l$, to the $8-$OTOC in Eq. \eqref{8otocdef}; therefore $k=\Omega(N)$ are necessary to obtain any $4m-$OTOC with an exponentially good approximation.} \section{Main Theorem}\label{sec:main} From the technical point of view, the main result of this paper is the exact calculation of the fourth moment of the output of a $k$-doped random Clifford circuit for a generic operator $\mathcal{O}\in\mathcal{B}(\mathcal{H}^{\otimes 4})$: \begin{theorem}\label{th1} Let $\mathcal{O}\in\mathcal{B}(\mathcal{H}^{\otimes 4})$ be a bounded operator, $U\in \mathcal{C}_k$ a $k$-doped Clifford circuit; then the $(\mathcal{C}_k,4)$-fold channel for the $k$-doped Clifford circuit reads \begin{equation} \Phi^{(4)}_{\mathcal{C}_k} (\mathcal O)=\sum_{\pi,\sigma\in\mathcal{S}_4}\left[\parent{(\Xi^{k})_{\pi\sigma}Q+\Gamma_{\pi\sigma}^{(k)}}c_{\pi}(\mathcal{O})+\delta_{\pi\sigma}b_{\pi}(\mathcal{O})\right]T_{\sigma} \label{t1} \end{equation} where \begin{equation} Q=\frac{1}{d^2}\sum_{P\in\mathcal{P}(2^N)}P^{\otimes 4};\qquad\; Q^{\perp}={\mathchoice {\rm 1\mskip-4mu l} {\rm 1\mskip-4mu l^{\otimes 4}-Q \end{equation} and $\mathcal{P}(2^N)$ is the Pauli group on $N$ qubits; $T_{\pi}$ are permutation operators corresponding to $\pi\in\mathcal{S}_{4}$, then $\Xi^{k}$ is the $k$-matrix power of the matrix $\Xi$, whose components read \begin{equation} \Xi_{\sigma\pi}\equiv\sum_{\tau\in\mathcal{S}_4}\left[W^{+}_{\pi\tau}\tr\left(T_{\sigma}K^{\otimes 4}QK^{\dag\otimes 4}QT_{\tau})-W^{-}_{\pi\tau}\tr(T_{\sigma}K^{\otimes 4}QK^{\dag\otimes 4}Q^{\perp}T_{\tau}\right)\right]\label{xi} \end{equation} with \begin{eqnarray} \Gamma^{(k)}_{\pi\sigma}&\equiv&\sum_{\tau\in\mathcal{S}_4}\Lambda_{\pi\tau}\sum_{i=0}^{k-1}(\Xi^i)_{\tau\sigma}\\ \Lambda_{\pi\tau}&\equiv&\sum_{\sigma\in\mathcal{S}_4}W^{-}_{\pi\sigma}\tr(T_{\tau}K^{\otimes 4}QK^{\dag\otimes 4}Q^{\perp}T_{\sigma}) \end{eqnarray} and the information about the operator $\mathcal O$ is all contained in the coefficients \begin{eqnarray}\label{bc_coeff} c_{\pi}(\mathcal{O})&\equiv&\sum_{\sigma\in\mathcal{S}_4}[W^{+}_{\pi\sigma}\tr(\mathcal{O}QT_{\sigma})-W^{-}_{\pi\sigma}\tr(\mathcal{O}Q^{\perp}T_{\sigma})]\label{ccoeff}\\ b_{\pi}(\mathcal{O})&\equiv&\sum_{\sigma\in\mathcal{S}_4}W^{-}_{\pi\sigma}\tr(\mathcal{O}Q^{\perp}T_{\sigma})\label{bcoeff} \end{eqnarray} where $W^{\pm}_{\pi\sigma}$ are the generalized Weingarten functions for the Clifford group, introduced and discussed in App. \ref{Cliffhaar}. \end{theorem} The proof of the theorem can be found in App. \ref{proofmaintheorem}. For many purposes, it is important to know to what $\Phi^{(4)}_{\mathcal{C}_k}(\cdot)$ converges in the limit of infinite layers. Without substantial loss of generality, we consider the case of the non Clifford resources given by phase gates $P_\theta$ with $\theta\ne\pi/2$. We can thus establish the application: \begin{application}\label{thconvergence} For $K=P_{\theta}\equiv\ket{0}\bra{0}+e^{i\theta}\ket{1}\bra{1}$, where $\{\ket{0},\ket{1}\}$ is the single qubit computational basis, and for any $\theta\neq\pm \pi/2$ the $(\mathcal{C}_k,4)$-fold channel equals the $(\mathcal{U}(d),4)$-fold channel in the limit $k\rightarrow\infty$ is \begin{equation} \lim_{k\rightarrow\infty}\Phi^{(4)}_{\mathcal{C}_k} (\mathcal O)=\Phi^{(4)}_{\mathcal U(d)} (\mathcal O) \end{equation} \end{application} The proof can be found in App. \ref{proofthconvergence}. Note that the above result can be also seen as a consequence of the results in \cite{harrow2009random}. In the next sections, we apply these theorems to calculating the $8$-point OTOCs and fluctuations of subsystem purity to find how these quantities approach the Haar-average on $\mathcal U (d)$ with $k$. \section{The $8$-point OTOC}\label{sec:8otoc} Consider four non-identity and non-overlapping Pauli operators $A,B,C,D\in\mathcal{P}(d)$. Then consider the unitary evolution of $A_{U}=UAU^{\dag}$ in the Heisenberg picture and define an $8$-point Out of Time Order Correlator (OTOC) as\cite{roberts2017chaos}, defined in Eq.\eqref{8otocdef} \begin{equation} \otoc_{8}(U):=d^{-1}\tr(AB_UCD_UAD_UCB_U) \label{8otocdef2} \end{equation} We are interested in taking the twirling of the $8$-point OTOC for a $k$-doped Clifford circuit, in order to find a necessary and sufficient condition for the exponential decay of the OTOC. Thanks to Theorem \ref{th1} we obtain \begin{application}\label{c3} Let $K\equiv T$ the single qubit $T$-gate, then the average of the $8$-point OTOC over the $k$-doped Clifford circuit reads \begin{eqnarray} \aver{\otoc_{8}(U)}_{U\in\mathcal{C}_k}&=&\frac{5d^2}{(d^2-1)(d^2-4)(d^2-9)}-(f^{-})^{k}\frac{d(d^2+4d+6)}{6(d^2-1)(d+2)(d+3)}\nonumber\\&+&(f^{+})^{k}\frac{d(d^2-4d+6)}{6(d^2-1)(d-2)(d-3)}+ \parent{\frac{f^{+}+f^{-}}{2}}^{k}\frac{4d^2}{3(d^2-1)(d^2-4)} \label{otocfinalresult} \end{eqnarray} where $f^{\pm}\equiv f^{\pm}_{\pi/4}=\frac{3d^2\pm3d-4}{4(d^2-1)}=\frac{3}{4}+\Theta(d^{-1})$, where $f^{\pm}_{\theta}$ are defined in Eq.\eqref{fpmtheta}. \end{application} \begin{proof Starting from Eq.\eqref{8otocdef2} we can write the $8$-point OTOC for $U$ as \begin{equation} \otoc_{8}(U)=d^{-1}\tr(T_{(1432)}(A\otimes C\otimes A\otimes C)U^{\otimes 4}(B\otimes D\otimes D\otimes B)U^{\dag\otimes 4}) \label{otocpermutation} \end{equation} Taking the average over the $k$-doped Clifford $U\in \mathcal{C}_{k}$ we have \begin{equation} \aver{\otoc_8(U)}_{U\in\mathcal{C}_k}=d^{-1}\tr\left(T_{(1432)}\left(A\otimes C\otimes A\otimes C\right)\aver{\left(B\otimes D\otimes D\otimes B\right)_{U}}_{U\in\mathcal{C}_k}\right) \end{equation} from the latter equation, the calculation is a straightforward, but tedious application of Theorem \ref{th1}. \end{proof} The following corollary explicitly shows the difference in the scaling of the $8$-point OTOC for a pure Clifford circuit and a universal circuit. As we shall see there is a marked difference in these scalings. As a direct consequence of Theorem \ref{th1} and Application \ref{thconvergence}, we obtain the following \begin{corollary} Taking the average for $U\in\mathcal{U}(d)$ and $C\in\mathcal{C}(d)$ of the $8$-point OTOC, one gets \begin{eqnarray} \aver{\otoc_8(U)}_{U\in\mathcal{U}(d)}&=&\frac{5d^2}{(d^2-1)(d^2-4)(d^2-9)}=\frac{5}{d^4}+\Theta(d^{-6})\label{otochaarexp}\\ \aver{\otoc_8(C)}_{C\in\mathcal{C}(d)}&=&\frac{d^2}{d^4-5d^2+4}=\frac{1}{d^2}+\Theta(d^4)\label{otocclifford1} \end{eqnarray} \end{corollary} \begin{proof} The proof of Eq.\eqref{otochaarexp} can be obtained from Eq.\eqref{otocfinalresult} in the limit $k\rightarrow\infty$, in virtue of Theorem \ref{thconvergence}, while Eq.\eqref{otocclifford1} can be obtained from Eq.\eqref{otocfinalresult} setting $k=0$.\end{proof} With the following statement, we give the necessary and sufficient condition for the number of non Clifford gates needed to precisely simulate the behavior of the $8$-point OTOC, and thus to simulate quantum chaos. \begin{corollary}\label{c5} Iff $k=\Theta(\log d)$, then \begin{equation} \delta_{\otoc}^{(k)}\equiv\left|\aver{\otoc_{8}(U)}_{U\in\mathcal{C}_k}-\aver{\otoc_{8}({U})}_{U\in\mathcal{U}(d)}\right|=\Theta(d^{-4}) \end{equation} \end{corollary} \begin{proof} Taking the difference in absolute value between Eq.\eqref{otocfinalresult} and \eqref{otochaarexp} we get \begin{eqnarray} \delta_{\otoc}^{(k)}&=&-(f^{-})^{k}\frac{d(d^2+4d+6)}{6(d^2-1)(d+2)(d+3)}+(f^{+})^{k}\frac{d(d^2-4d+6)}{6(d^2-1)(d-2)(d-3)}\nonumber\\&+& \parent{\frac{f^{+}+f^{-}}{2}}^{k}\frac{4d^2}{3(d^2-1)(d^2-4)} \end{eqnarray} Taking the asymptotic limit for $d\rightarrow\infty$ up to $\Theta(d^{-4})$ \begin{equation} \delta_{\otoc}^{(k)}=\frac{1}{d^2}\left|\frac{k-3}{3}\right|\parent{\frac{3}{4}}^{k}+\Theta(d^{-4}) \end{equation} from here it's easy to see that one has the following condition \begin{equation} \left(\frac{3}{4}\right)^{k}k=\Theta(d^{-2})\iff k=\Theta(\log d) \end{equation} which leads to the desired result. \end{proof} \section{Purity and its Fluctuations} \label{flucpurity} In this section, we compute the fluctuations of a subsystem purity Eq.\eqref{flucpurdef1} for the output of the $k$-doped Clifford circuit $U\in\mathcal{C}_k$. To this end, we first apply Theorem \ref{th1} to calculate the average of the fourth tensor power of a pure state $\psi$, namely $\Phi^{(4)}_{\mathcal{C}_k}(\psi^{\otimes 4}) $. \begin{application}\label{application1} The $(\mathcal{C}_k,4)$-fold channel of a pure state $\psi^{\otimes 4}\in\mathcal{B}(\mathcal{H}^{\otimes 4})$ reads \begin{eqnarray}\label{maintheorem} \Phi^{(4)}_{\mathcal{C}_k}(\psi^{\otimes 4}) =a_{k}Q\Pi_{\text{sym}}^{(4)}+b_{k}\Pi_{\text{sym}}^{(4)} \end{eqnarray} where $\Pi_{\text{sym}}^{(4)}$ is the projector onto the completely symmetric subspace of the permutation group $\mathcal S_4$ and $D_{\text{sym}}=\tr(\Pi_\text{sym}^{(4)})$. The coefficients $a_k,b_k$ are given by \begin{eqnarray} a_{k}&\equiv&\left(\frac{\tr(\psi^{\otimes 4}Q)}{D^+}-\frac{\tr(\psi^{\otimes 4}Q^{\perp})}{D^{-}}\right)\left(\frac{c_Q}{D^+}-\frac{c_{QQ^\perp}}{D^-}\right)^{k}\nonumber\\ b_{k}&\equiv&\frac{\tr(\psi^{\otimes 4}Q^{\perp})}{D^{-}}+\frac{c_{QQ^\perp}}{D^-}\sum_{i=0}^{k-1}a_i \label{coefficientmaintheorem} \end{eqnarray} with \begin{equation} c_{Q}\equiv\tr(K^{\otimes 4}QK^{\dag\otimes 4}Q\Pi_{\text{sym}}^{(4)}), \quad c_{QQ^\perp}\equiv\tr(K^{\otimes 4}QK^{\dag\otimes 4}Q^{\perp}\Pi_{\text{sym}}^{(4)}) \end{equation} \end{application} The proof can be found in App. \ref{proofcorollary1}. The evaluation of Eq.\eqref{maintheorem} becomes particularly simple if the gate $K$ is a $P_\theta$-gate: \begin{application}\label{app4} If the single qubit gate $K$ is the $P_\theta$-gate, the coefficients $c_{Q}, c_{QQ^\perp}$ read: \begin{eqnarray} c_{Q}&=&\frac{(d+2)(4+7d+(4+d)\cos(4\theta))}{48}\\ c_{QQ^\perp}&=&\frac{(d+2)(d+4)}{24}\sin^{2}(2\theta) \end{eqnarray} Then for any $k$ we can write the coefficients $a_k,b_k$ as \begin{eqnarray} a_{k}&=&\frac{24 }{(d^2-1)(d+2)(d+4)}\left(\frac{d(d+3)}{4}\tr(\psi^{\otimes 4} Q)-1\right)(f_{\theta}^{-})^{k}\nonumber\\ b_{k}&=&\frac{1}{D_{\text{sym}}}+\frac{24}{(d^2-1)(d+2)(d+4)}\left(\frac{4}{d(d+3)}-\tr(\psi^{\otimes 4}Q)\right)(f_{\theta}^{-})^{k}\label{kcoefficienttheta} \end{eqnarray} where $(f_{\theta}^{-})$ is defined in Eq.\eqref{fpmtheta}; note that $(f_{\theta}^{-})<1$ unless $\theta=\pm \pi/2$, i.e unless $P_\theta=S$ the $S$-gate $\in \mathcal{C}(d)$. \end{application} See App. \ref{calculationcqcqqp} for the proof. \begin{corollary}\label{corollaryptheta} For any $\theta\neq \pm \pi/2$ \begin{equation}\label{Tgatetheorem} \lim_{k\rightarrow\infty}\Phi^{(4)}_{\mathcal{C},k}(\psi^{\otimes 4})=\Phi^{(4)}_{\mathcal{U}(d)}(\psi^{\otimes 4}) \end{equation} \end{corollary} \begin{proof} The proof follows directly from Application \ref{thconvergence}; here we give an alternative version: setting $f_{\theta}<1$ in Eq.\eqref{kcoefficienttheta} and taking the limit $k\rightarrow\infty$ one gets \begin{eqnarray} \lim_{k\rightarrow\infty}a_{k}&=&0\\ \lim_{k\rightarrow\infty}b_{k}&=&D_{\text{sym}}^{-1} \end{eqnarray} Now, since the fourth tensor power of $\psi_U$ averages to - see Eq.\eqref{haaraverageofstate} in App. \ref{puraveragesec} for a proof - \begin{equation} \Phi^{(4)}_{\mathcal{U}(d)}(\psi^{\otimes 4})=\frac{\Pi_{\text{sym}}^{(4)}}{D_{\text{sym}}} \end{equation} then by Application \ref{application1} the proof is complete. \end{proof} In what follows, we calculate the purity and its fluctuations in a bipartite Hilbert space for the output state of a $k$-doped Clifford circuit, calculated above in Eq.\eqref{maintheorem}. Consider then a bipartition of the $N$-qubit system $\mathcal{H}= \mathcal{H}_A\otimes \mathcal{H}_B$ with $\mathcal H_{A(B)}= \mathbb{C}^{2\otimes N_{A(B)}}$, $N_{A}+N_{B}=N$ and $d_{A(B)}=2^{N_{A(B)}}$. The purity of a marginal state $\psi_A =\tr_B\psi \in \mathcal B(\mathcal H_A)$ is given by \begin{equation} \operatorname{Pur}(\psi_A):=\tr(\psi_{A}^2) \end{equation} The averages over Unitary and Clifford group for the purity of the output $\psi$ of a random quantum circuits are the same, namely \begin{equation} \aver{\operatorname{Pur}(\psi_U)_A}_{U\in\haar}=\aver{\operatorname{Pur}(\psi_C)_A}_{C\in \mathcal C(d)}=\frac{d_A+d_B}{d_Ad_B+1} \label{purityaverage} \end{equation} This is a consequence of $\mathcal C(d)$ being a $3$-design\cite{webb2016clifford,Zhu2017multiqubit} (in fact, being a $2$-design is sufficient), see App. \ref{puraveragesec} for a proof. Notice that the average purity does not depend on the input state. The fluctuations of the purity for the set $x$ are defined as \begin{eqnarray}\label{flucpurdef2} \Delta_{x}\operatorname{Pur}(\psi_U)_{A}:= \langle (\operatorname{Pur}(\psi_U)_A-\langle \operatorname{Pur}(\psi_U)_A\rangle_{U\in x})^2\rangle_{U\in x} \end{eqnarray} Since the fluctuations involve the fourth moment of the Haar measure, the fluctuations for $\mathcal U(d), \mathcal C(d)$ are expected to be different. We have indeed, for $d_A=d_B=\sqrt{d}$ \begin{eqnarray} \Delta_{\haar}\operatorname{Pur}(\psi_U)_{A}&=& \frac{2(d-1)^2}{(d+1)^2(d+2)(d+3)}=\Theta(d^{-2})\\ \Delta_{\mathcal{C}(d)}\operatorname{Pur}(\psi_C)_{A}&=&\frac{(d-1)[d(d+1)\tr(Q\psi^{\otimes 4})-2]}{(d+1)^2(d+2)}=\begin{cases}\Theta(d^{-1}), \quad \psi=\ket{0}\bra{0}^{\otimes N}\\ \Theta(d^{1-\log_2 5}), \quad \psi=\otimes_i\psi_i, \; \psi_i \; \text{random} \end{cases} \label{cliffordfluct} \end{eqnarray} This result is a consequence of Application \ref{application1} and Corollary \ref{corollaryptheta}. Notice that while the fluctuations of the purity for the unitary group again do not depend on the initial state, those for the Clifford group do. For $\psi $ being any other stabilizer state different from $\ket{0}\bra{0}^{\otimes N}$, the formula would not change thanks to the left/right invariance of the Haar measure over groups. Notably, starting from completely factorized states, there is a marked difference whether the initial state $\psi$ is a stabilizer state or a random product state. \begin{lemma}\label{lemmafluc} The fluctuations of the purity in the $k$-doped Clifford circuit, for $d_A=d_B=\sqrt{d}$ and $\psi=\ket{0}\bra{0}^{\otimes N}$, are \begin{equation} \Delta_{\mathcal{C}_k}\operatorname{Pur}(\psi_U)_{A}=\frac{(d-1)^2}{(d+1)^2(d+2)(d+3)}(2+(d+1)(f_{\theta}^{-})^{k}) \label{fluctclifforddoped} \end{equation} where $f_\theta^{-}$ is defined in Eq.\eqref{fpmtheta}. \end{lemma} The proof can be found in App. \ref{prooflemmafluc}. \begin{remark} For the undoped, $k=0$, pure Clifford circuit, one finds \begin{equation} \aver{\operatorname{Pur}^2(\psi_{C})_A}_{C\in\mathcal{C}(d)}=\frac{5d+1}{(d+1)(d+2)} \end{equation} Notice that, in the large $d$ limit, \begin{eqnarray} \aver{\operatorname{Pur}^2(\psi_{C})_A}_{C\in\mathcal{C}(d)}&=& \frac{5}{d}+\Theta(d^{-2})\\ \aver{\operatorname{Pur}^2(\psi_{U})_A}_{U\in\mathcal{U}(d)}&=&\frac{4}{d}+\Theta(d^{-2}) \end{eqnarray} and thus have the same order. However, the next corollary shows that - because of an exact cancellation - the fluctuations are very different in scaling with $d$. \end{remark} \begin{corollary} The fluctuations of the purity, for $d_A=d_B=\sqrt{d}$ and $\psi=\ket{0}\bra{0}^{\otimes N}$ for the Clifford circuit are \begin{eqnarray} \Delta_{\mathcal{C}(d)}\operatorname{Pur}(\psi_C)_{A}&=&\frac{(d-1)^2}{(d+1)^2(d+2)}=\Theta(d^{-1})\label{eq41}\\ \Delta_{\mathcal{U}(d)}\operatorname{Pur}(\psi_U)_{A}&=& \frac{2(d-1)^2}{(d+1)^2(d+2)(d+3)}=\Theta(d^{-2})\label{eq42} \end{eqnarray} \end{corollary} \begin{proof} Eq.\eqref{eq41} follows immediately from Lemma \ref{lemmafluc} by setting $k=0$, while Eq.\eqref{eq42} can be found in \cite{Hammalungo_2012}. \end{proof} \begin{corollary}\label{iffpurity} For any $\theta\neq \pm \pi/2$, for $d_{A}=d_{B}=\sqrt{d}$ and $\psi=\ket{0}\bra{0}^{\otimes N}$, iff $k=\Theta(\log d)$ \begin{equation} \delta_{\operatorname{Pur}}^{(k)}\equiv |\Delta_{\mathcal{C}_k}\operatorname{Pur}(\psi_U)_{A}-\Delta_{\mathcal{U}(d)}\operatorname{Pur}(\psi_U)_{A}|=\Theta(d^{-2}) \end{equation} \end{corollary} \begin{proof} From Eq.\eqref{fluctclifforddoped} one has \begin{equation} \delta_{\operatorname{Pur}}^{(k)}=\frac{(d-1)^2}{(d+1)(d+2)(d+3)}(f_{\theta}^{-})^{k} \end{equation} for $k=0$ this difference is $\Theta(d^{-1})$, then in order to get $O(d^{-2})$ one needs to have \begin{equation} f_{\theta}^{k}=\Theta(d^{-1})\iff k=\Theta(\log d) \end{equation} moreover, note that the rate of convergence is dictated by $f_{\theta}$, which reaches its minimum value for $\theta=\pi/4$, that is the $T$-gate, cfr. Eq.\eqref{fpmtheta}.\end{proof} \begin{lemma}\label{lemma2} The fluctuations of the purity for a $k$-doped Clifford circuit, for $d_A=d_B=\sqrt{d}$ and $\psi$ be a random product state read \begin{equation} \Delta_{\mathcal{C}_k}\operatorname{Pur}(\psi_U)_{A}=\frac{2(d-1)^2}{(d+1)^2(d+2)(d+3)}+\frac{(d-1)(d^{(2-\log_2 5)}(d-3)-4)(f^{-}_{\theta})^{k}}{(d+1)(d+2)(d+3)} \end{equation} \end{lemma} \begin{proof} The proof is straightforward and is left to the interested reader: by plugging \eqref{randomproductstate} into Eqs. \eqref{coefficientmaintheorem} and \eqref{maintheorem} and using Eq.\eqref{purfluctdoped} the calculation follows easily.\end{proof} \begin{corollary} The fluctuations of the purity for a non-doped Clifford circuit, for $d_A=d_B=\sqrt{d}$ and $\psi$ a random product state, are \begin{equation} \Delta_{\mathcal{C}(d)}\operatorname{Pur}(\psi_U)_{A}=\frac{(d-1)[d(d+1)d^{1-\log_{2}5}-2]}{(d+1)^2(d+2)} \end{equation} \end{corollary} \begin{proof} This result is obtained from Lemma \ref{lemma2} setting $k=0$.\end{proof} \begin{remark} The hypothesis $d_A=d_B=\sqrt{d}$ only simplifies the displayed formulas and the related considerations but does not change the general behavior. For instance, in the case $d_B \gg d_A \gg 1$ one has - after a lengthy calculation, \begin{equation} \Delta_{\mathcal{C}_k}\operatorname{Pur}(\psi_U)_{A}=\frac{2(d^2-d_{A}^2)(d^2_{A}-1)}{(d+1)^2(d+2)(d+3)d^2_{A}}+\frac{(d^2-d_{A}^2)(d_{A}^2-1)f^{k}_{\theta}(d(d+3)\tr\parent{Q\psi^{\otimes 4}}-4)}{(d-1)(d+1)(d+2)(d+3)d^2_{A}} \end{equation} \end{remark} \section*{Conclusions and Outlook} In this paper, we showed that in a random Clifford circuit with $N$ qubits, $\Theta(N)$ non Clifford gates are both necessary and sufficient to simulate quantum chaos. As a consequence, quantum chaos cannot be efficiently simulated on a classical computer, as the cost for simulating such circuits is exponential in the non Clifford resources. In perspective, there are several open questions. One could generalize many of these results by proving that an $\epsilon$-approximate $2t$-OTOC characterizes an $\epsilon$-approximate $t$-design. Although the scaling is fixed to be $\Theta(N)$, the actual number of non Clifford resources is undetermined and it would be of practical importance in obtaining approximate $t$-designs with a noisy, intermediate-scale quantum computer. One could thus study the optimal arrangement of non Clifford resources. A related question is the onset of irreversibility in a closed quantum system in the sense of entanglement complexity\cite{chamon2014emergent} is driven by the doping of a Clifford circuit. Similarly, it would be interesting to show how the entanglement spectrum statistics converges with the doping\cite{zhou2020single}. \section*{Acknowledgments} We acknowledge support from NSF award number 2014000. The authors thank Claudio Chamon for important and enlightening discussions and comments.
\section{Survey Questions}\label{app:SurveyQuestions} \section{Open Coding of Final Survey Responses}\label{sec:app-open-coding-results} Table~\ref{tab:s2Categories} shows the distribution of the categories by the questions. \begin{table*}[htbp] \centering \caption{The codes emerged during the open-coding of the responses (\#TC = Total codes).} \begin{tabular}{l|rr|rr|rr|rr|rr|rr|rr|rr|rr|r}\toprule & \multicolumn{2}{c}{\textbf{Q4}} & \multicolumn{2}{c}{\textbf{Q5}} & \multicolumn{2}{c}{\textbf{Q6}} & \multicolumn{2}{c}{\textbf{Q7}} & \multicolumn{2}{c}{\textbf{Q11}} & \multicolumn{2}{c}{\textbf{Q12}} & \multicolumn{2}{c}{\textbf{Q13}} & \multicolumn{2}{c}{\textbf{Q14}} & \multicolumn{2}{c}{\textbf{Q24}} & \\ \cmidrule{2-20} & \textbf{\#C} & \textbf{\#R} & \textbf{\#C} & \textbf{\#R} & \textbf{\#C} & \textbf{\#R} & \textbf{\#C} & \textbf{\#R} & \textbf{\#C} & \textbf{\#R} & \textbf{\#C} & \textbf{\#R} & \textbf{\#C} & \textbf{\#R} & \textbf{\#C} & \textbf{\#R} & \textbf{\#C} & \textbf{\#R} & \multicolumn{1}{l}{\textbf{\#TC}} \\ \midrule \textbf{Documentation} & {11} & {11} & {1} & {1} & {4} & {4} & {54} & {49} & {47} & {43} & {11} & {9} & {6} & {5} & {1} & {1} & & & 135 \\ \cmidrule{2-20} \textbf{Search} & & & {94} & {79} & {15} & {11} & & & & & {12} & {12} & {1} & {1} & & & & & 122 \\ \cmidrule{2-20} \textbf{Usability} & {1} & {1} & & & {2} & {2} & & & {87} & {56} & {2} & {2} & {2} & {2} & & & & & 94 \\ \cmidrule{2-20} \textbf{Community} & {11} & {9} & & & {9} & {7} & {12} & {10} & {31} & {22} & {6} & {3} & {2} & {2} & & & {2} & {1} & 71 \\ \cmidrule{2-20} \textbf{Trustworthiness} & {13} & {11} & {1} & & {21} & {20} & {8} & {5} & {2} & {1} & {2} & {2} & & & {21} & {17} & {4} & {3} & 68 \\ \cmidrule{2-20} \textbf{Expertise} & {31} & {31} & {2} & {2} & {3} & {3} & {13} & {12} & {3} & {3} & {3} & {3} & {4} & {4} & & & {2} & {2} & 59 \\ \cmidrule{2-20} \textbf{API Selection} & {13} & {12} & & & {6} & {6} & {1} & {1} & & & & & {30} & {25} & {6} & {6} & & & 56 \\ \cmidrule{2-20} \textbf{API Usage} & {17} & {16} & & & {8} & {8} & {2} & {2} & {10} & {9} & {7} & {6} & {7} & {7} & {2} & {2} & & & 53 \\ \cmidrule{2-20} \textbf{Situational Relevance} & & & & & {26} & {22} & {12} & {9} & {8} & {7} & {3} & {3} & {3} & {3} & & & {2} & {2} & 52 \\ \cmidrule{2-20} \textbf{Reputation} & & & {1} & {1} & {1} & {1} & {35} & {33} & {5} & {4} & & & & & & & & & 42 \\ \cmidrule{2-20} \textbf{Performance} & {8} & {8} & & & & & & & {30} & {23} & & & {3} & {3} & & & & & 41 \\ \cmidrule{2-20} \textbf{Recency} & & & {1} & {1} & {13} & {13} & {6} & {6} & & & {1} & {1} & {3} & {3} & {3} & {3} & & & 27 \\ \cmidrule{2-20} \textbf{Productivity} & {9} & {8} & & & {1} & {1} & & & & & & & {12} & {11} & & & & & 22 \\ \cmidrule{2-20} \textbf{Compatibility} & & & & & {4} & {4} & & & {18} & {14} & & & & & & & & & 22 \\ \cmidrule{2-20} \textbf{Aggregation Portal} & & & & & & & & & & & {18} & {15} & {1} & {1} & & & & & 19 \\ \cmidrule{2-20} \textbf{Missing Nuances} & & & & & & & & & & & & & & & {18} & {12} & & & 18 \\ \cmidrule{2-20} \textbf{Legal} & & & & & & & & & {15} & {14} & & & & & & & & & 15 \\ \cmidrule{2-20} \textbf{Sentiment Statistics} & & & {4} & {4} & & & & & & & {8} & {5} & & & & & & & 12 \\ \cmidrule{2-20} \textbf{General Insight} & & & & & {1} & {1} & & & {4} & {4} & {1} & {1} & {2} & {2} & {4} & {4} & & & 12 \\ \cmidrule{2-20} \textbf{API Maturity} & & & & & & & & & {6} & {5} & {3} & {2} & & & & & & & 9 \\ \cmidrule{2-20} \textbf{API Adoption} & & & & & & & {2} & {1} & {4} & {4} & {3} & {3} & & & & & & & 9 \\ \cmidrule{2-20} \textbf{Portability} & & & & & & & & & {5} & {5} & & & {4} & {4} & & & & & 9 \\ \cmidrule{2-20} \textbf{Opinion Categorization} & & & & & & & & & & & {8} & {8} & {1} & {1} & & & & & 9 \\ \cmidrule{2-20} \textbf{Opinion Reasoning} & & & & & & & & & & & & & {1} & {1} & {7} & {6} & & & 8 \\ \cmidrule{2-20} \textbf{Contrastive Summary} & & & & & & & & & & & {7} & {7} & & & & & & & 7 \\ \cmidrule{2-20} \textbf{Info Overload} & & & & & {3} & {3} & & & & & {1} & {1} & & & {2} & {2} & & & 6 \\ \cmidrule{2-20} \textbf{Similarity} & & & {3} & {3} & & & & & & & {2} & {2} & & & & & & & 5 \\ \cmidrule{2-20} \textbf{Security} & & & & & & & & & {2} & {2} & {1} & {1} & & & & & & & 3 \\ \cmidrule{2-20} \textbf{Learning Barrier} & & & & & & & & & & & & & & & {3} & {3} & & & 3 \\ \cmidrule{2-20} \textbf{Bug} & & & & & & & & & {1} & {1} & & & {1} & {1} & & & & & 2 \\ \cmidrule{2-20} \textbf{Extractive Summary} & & & & & & & & & & & {2} & {2} & & & & & & & 2 \\ \cmidrule{2-20} \textbf{API Improvement} & & & & & & & & & & & & & {1} & {1} & {1} & {1} & & & 2 \\ \cmidrule{2-20} \textbf{FAQ} & & & & & & & & & & & {1} & {1} & & & & & & & 1 \\ \cmidrule{2-20} \textbf{Problem Summaries} & & & & & & & & & & & {1} & {1} & & & & & & & 1 \\ \cmidrule{2-20} \textbf{Machine Learning} & & & & & & & & & & & {1} & {1} & & & & & & & 1 \\ \cmidrule{2-20} \textbf{Wrong Info} & & & & & & & & & & & & & & & {1} & {1} & & & 1 \\ \cmidrule{2-20} \textbf{Lack of Info} & & & & & {1} & {1} & & & & & & & & & & & & & 1 \\ \midrule Not Sure & & & & & & & & & & & {10} & {9} & {23} & {22} & {26} & {25} & {1} & {1} & 59 \\ \cmidrule{2-20} Irrelevant & {7} & {4} & {5} & {5} & {10} & {8} & {7} & {4} & {11} & {7} & {25} & {18} & {8} & {7} & {14} & {13} & {6} & {3} & 87 \\ \midrule \textbf{Total} & {121} & {83} & {112} & {83} & {128} & {83} & {152} & {83} & {289} & {83} & {139} & {83} & {115} & {83} & {109} & {83} & {17} & {10} & 1019 \\ \midrule \textbf{\# Categories} & \multicolumn{2}{c|}{9} & \multicolumn{2}{c|}{8} & \multicolumn{2}{c|}{17} & \multicolumn{2}{c|}{10} & \multicolumn{2}{c|}{17} & \multicolumn{2}{c|}{21} & \multicolumn{2}{c|}{19} & \multicolumn{2}{c|}{14} & \multicolumn{2}{c|}{5} & {37} \\ \midrule \multicolumn{20}{l}{Notes: \#C = the number of code, \#R = the number of respondents, Q4 = Reasons for referring to opinions of other developers about APIs? Q5 = How do you} \\ \multicolumn{20}{l}{seek information about APIs in a developer forum?, Q6 = Challenges when seeking for opinions about an API? Q7 = Factors in a forum post to determine the} \\ \multicolumn{20}{l}{the quality of a provided opinion about an API?, Q11 = Factors of an API that play a role in your decision to choose an API? Q12 = Different ways opinions} \\ \multicolumn{20}{l}{about APIs can be summarized from developer forums? Q13=Areas positively affected by the summarization of reviews about APIs from developer forums?} \\ \multicolumn{20}{l}{Q14=Areas negatively affected by the summarization of reviews about APIs from developer forums? Q24= Reasons to not value the opinion of other devs.} \\ \bottomrule \end{tabular}% \label{tab:s2Categories}% \end{table*}% \end{appendices} \section{Discussions} \label{sec:discussion} In this section, we summarize the key points from our primary survey with regards to the two research questions that we set forth to address (Section~\ref{sec:summary}). We then analyze the findings from the two surveys along three demographics by: \begin{inparaenum} \item profession in Section~\ref{sec:demographic-profession}, \item experience of the survey participants in Section~\ref{sec:demographic-experience}, and \item the nine programming languages used to sample the primary survey participants in Section~\ref{sec:demographic-programming-langs}. \end{inparaenum} \begin{table*}[t] \centering \caption{Highlights of findings from Primary survey about developers' needs for tool support to analyze opinions about APIs (RQ2). Subscript with a question number shows number of responses.} \begin{tabular}{r|p{16cm}}\toprule \multicolumn{1}{l}{\textbf{RQ2.1}} & \multicolumn{1}{l}{\textbf{Tool support}} \\ \midrule 8$_{83}$ & \multicolumn{1}{l}{Do you rely on tools to help you understand opinions about APIs in online forum discussions?} \\ & \ib{ \begin{inparaenum} \item Yes 13.3\%, \item No 86.7\% \end{inparaenum} } \\ \midrule 9$_{72}$ & \multicolumn{1}{p{49.95em}}{If you don't use a tool currently to explore the diverse opinions about APIs in developer forums, do you believe there is a need of such a tool to help you find the right viewpoints about an API quickly?} \\ & \ib{ \begin{inparaenum} \item Yes 9.7\%, \item No 27.8\%, \item I don't know 62.5\% \end{inparaenum} } \\ \midrule 10$_{11}$ & \multicolumn{1}{l}{You said yes to the previous question on using a tool to navigate forum posts. Please provide the name of the tool} \\ & \ib{ \begin{inparaenum} \item Google/Search 4, \item Stack Overflow votes/app/related post 3, \item GitHub issue/pulse 1, \item Safari 1, \item Reference documentation 1 \end{inparaenum} } \\ \midrule 19$_{83}$ & \multicolumn{1}{l}{What tools can better support your understanding of API reviews in developer forums? } \\ & \ib{ \begin{inparaenum} \item Opinion mining 56.6\%, \item Sentiment analysis 41\%, \item Opinion summarization 45.8\%, \item API comparator 68.7\%, \item Trend analyzer 67.5\%, \item Co-mentioned competing APIs 73.5\%, \item Other Tools 8.4\% \end{inparaenum} } \\ \midrule \multicolumn{1}{l}{\textbf{RQ2.2}} & \multicolumn{1}{l}{\textbf{Needs for Opinion Summarization}} \\ \midrule 11$_{83}$ & \multicolumn{1}{l}{What are the important factors of an API that play a role in your decision to choose an API?} \\ & \ib{ \begin{inparaenum} \item Usability 30.1\%, \item Documentation 16.3\%, \item Community 10.7\%, \item Performance 10.4\%, \item Compatibility 6.2\%, \item Legal 5.2\%, \end{inparaenum} } \\ \midrule 12$_{83}$ & \multicolumn{1}{p{49.95em}}{Considering that opinions and diverse viewpoints about an API can be scattered in different posts and threads of a developer\newline{}forum, what are the different ways opinions about APIs can be summarized from developer forums?} \\ & \ib{ \begin{inparaenum} \item Portal for opinion aggregation 12.7\%, \item Search 8.5\% \item Documentation 7.7\%, \item Sentiment statistics/Opinion categorization 5.6\%, \item Contrastive summaries/Usage scenario summaries 4.9\% \end{inparaenum} } \\ \midrule 13$_{83}$ & \multicolumn{1}{l}{What areas can be positively affected by the summarization of reviews about APIs from developer forums?} \\ & \ib{ \begin{inparaenum} \item API selection 26.1\%, \item Productivity 10.4\% \item API usage 6.1\% \item Documentation 5.2\% \item API popularity analysis 3.5\% \end{inparaenum} } \\ \midrule 14$_{83}$ & \multicolumn{1}{l}{What areas can be negatively affected by the summarization of reviews about APIs from developer forums?} \\ & \ib{ \begin{inparaenum} \item Opinion trustworthiness 19.3\% \item Missing nuances 16.5\% \item Opinion reasoning 6.4\% \item API selection 5.5\% \item New API Entry 2.8\% \end{inparaenum} } \\ \midrule 15$_{83}$ & \multicolumn{1}{l}{An opinion is important if it contains discussion about the following API aspects?} \\ & \ib{ \begin{inparaenum} \item Usability 88\% \item Documentation 85.3\% \item Security 83.1\% \item Performance 81.9\% \item Bug 81.9\% \item Compatibility 66.3\%, \item Community 63.9\%, \item Legal 47\%, \item Portability 44.6\%, \item General API Features 45.8\%, \item Only Sentiment 18.1\% \end{inparaenum} } \\ \midrule 20$_{83}$ & \multicolumn{1}{l}{How often do you feel overwhelmed due to the abundance of opinions about an API?} \\ & \ib{ \begin{inparaenum} \item Sometimes 48.2\% \item Rarely 37.3\% \item Never 10.8\% \item Always 3.6\% \end{inparaenum} } \\ \midrule 21$_{83}$ & \multicolumn{1}{l}{Would a summarization of opinions about APIs help you to make a better decision on which one to use? } \\ & \ib{ \begin{inparaenum} \item I don't know 48.2\% \item Yes 38.6\% \item No 13.3\% \end{inparaenum} } \\ \midrule 22$_{83}$ & \multicolumn{1}{l}{Opinions about an API need to be summarized because} \\ & \ib{ \begin{inparaenum} \item The interesting opinion may not be in the posts that you have looked in 71.1\% \item Not enough time to look at all opinions 68.7\% \item Contradictory opinions about an API may be missed 61.4\% \item Too many forum posts with opinions 50.6\% \item Other reason 12\% \end{inparaenum} } \\ \midrule 23$_{83}$ & \multicolumn{1}{l}{Opinion summarization can improve the following decision making processes} \\ & \ib{ \begin{inparaenum} \item Selection among choices 73.5\%, \item Determining replacement of an API 71.1\%, \item Validating an API selection 48.2\%, \item Feature enhancement 45.8\% , \item Replacing an API feature 42.2\%, \item Fixing a bug 38.6\%, \item Selecting API version 28.9\%, \item Other 9.6\% \end{inparaenum} } \\ \bottomrule \end{tabular}% \label{tab:s2rq2highlights}% \end{table*}% \subsection{Summary}\label{sec:summary} In Table~\ref{tab:s2rq1highlights} and Table~\ref{tab:s2rq2highlights}, we summarize the responses from our primary survey for RQ1 and RQ2, respectively. The insights are calculated using the same rules that we used in Section~\ref{sec:pilot-survey}. \rev{\addtocounter{o}{1} \vspace{1mm}\noindent\textit{\textbf{Observation \arabic{o}.}} \textbf{Developers leverage opinions about APIs to support development needs, such as API selection, usage, learning about edge cases, etc (Table~\ref{tab:s2rq1highlights}.) Developers expect opinion summaries can facilitate those needs by offering an increase in productivity, e.g., save time by offering quick but synthesized insights (Table~\ref{tab:s2rq2highlights})} In the absence of a specific opinion summarization portal available for APIs, though, we find that developers were unsure whether such summaries can be feasible. However, they recommend to leverage machine learning techniques to facilitate an opinion portal for APIs.} \rev{\addtocounter{o}{1} \vspace{1mm}\noindent\textit{\textbf{Observation \arabic{o}.}} A number of questions were paired as open-ended and closed questions, with the open-ended questions being asked before the corresponding closed-end question. For example, we asked developers about the reasons behind why they seek opinions about APIs using two questions (Q4 and Q18). Another pair was Q11 and Q15, which we used to ask developers about their preference of specific API aspects/factors that they expect to see in the opinions about APIs.} \rev{In the first pair (i.e., Q4 and Q18) the responses to the open-ended question (Q4) show a slight variation from the response to the closed question (Q18). In Q4, the main reason mentioned was to build and look for expertise about APIs while seeking for opinions. Q18 does not have that option. Nevertheless, the majority of agreement for the options in Q18 show that those needs are also prevalent. In the second pair (i.e., Q11 and Q15), the responses to both questions produced an almost similar set of API aspects, such as, performance, usability, documentation, etc.} \rev{\addtocounter{o}{1} \vspace{1mm}\noindent\textit{\textbf{Observation \arabic{o}.}} In both surveys, two closed questions were paired together (Q18 and Q23 in the primary survey and Q4 and Q12 in the pilot survey). The first question in each pair (i.e., Q18 in primary and Q4 in pilot surveys) aims at understanding the needs of developers for seeking opinions about APIs. The second question in each pair (i.e., Q23 in primary survey and Q12 in pilot one) aims to understand the needs for summarizing such opinions. The options for each of the four questions remained the same (see Table~\ref{tab:s2rq1highlights}). In both surveys, the highest ranked option was ``selection among choices''. Therefore, developers seek opinions to decide on an API among choices and they believe that the summarization of opinions can assist them in their selection process. The three selection-related options (i.e., selection among choices, determining a replacement, and validating an API selection) are ranked as the top three in the pair of questions from the primary survey. \textbf{Therefore, the primary focus to aggregate and summarize opinions about APIs would be to assist developers in their selection of APIs and any other tasks relevant to it.}} \begin{table*}[t] \centering \caption{Highlights of Findings from Primary Survey RQ1 Closed Questions by Profession} \begin{tabular}{r|p{16cm}} \toprule \textbf{No} & \textbf{Question} \\ \midrule 1 & Do you visit developer forums to seek info about APIs? Research Engineer\\ &\textit{\begin{inparaenum} \item Research Engineer: \ib{Yes 100\%*}, \item Student: \ib{Yes 66.7\%}, \item Software Developer: \ib{Yes 78.7\%*}, \item Lead: \ib{Yes 100\%*} \end{inparaenum}}\\ \midrule 3 & Do you value the opinion of other developers in the developer forums when deciding on what API to use? \\ & \textit{\begin{inparaenum} \item Research Engineer: \ib{Yes 100\%*}, \item Student: \ib{Yes 100\%}, \item Software Developer: \ib{Yes 89.2\%*}, \item Lead: \ib{Yes 100\%*} \end{inparaenum} } \\ \midrule 16 & Where do you seek help/opinions about APIs? \\ & \begin{tabular}{lrrrrr} & \multicolumn{1}{l}{\textbf{Internal Mailing list}} & \multicolumn{1}{l}{\textbf{IRC chats}} & \multicolumn{1}{l}{\textbf{Co-workers}} & \multicolumn{1}{l}{\textbf{Stack Overflow}} & \multicolumn{1}{l}{\textbf{Search/Diverse Sources}} \\ \textbf{Software Developer} & 24.3\% & 24.3\% & 71.6\% & \ib{89.2\%*} & 39.2\% \\ \textbf{Other} & - & - & - & \ib{33.3\%} & \ib{33.3\%} \\ \textbf{Student} & 50.0\% & 50.0\% & 33.3\% & \ib{100.0\%} & 50.0\% \\ \textbf{Research Engineer} & 33.3\% & 33.3\% & 33.3\% & \ib{100\%*} & 66.7\% \\ \textbf{Lead} & 36.4\% & 18.2\% & 63.6\% & \ib{100\%*} & 63.6\% \\ \end{tabular}% \\ \midrule 17 & How often do you refer to online forums (e.g., Stack Overflow) to get information about APIs? \\ & \begin{tabular}{lrrrrr} & \textbf{Every day} & \textbf{Two or three times a week} & \textbf{Once a week} & \textbf{One a month} & \textbf{Never} \\ \textbf{Software Developer} & \ib{33.3\%*} & 12.2\% & 28.4\% & 14.9\% & 11.2\% \\ \textbf{Other} & 33.3\% & 0.0\% & 0.0\% & 0.0\% & \ib{66.7\%} \\ \textbf{Student} & \ib{50.0\%} & 0.0\% & 0.0\% & \ib{50.0\%} & 0.0\% \\ \textbf{Research Engineer} & \ib{33.3\%} & \ib{33.3\%} & \ib{33.3\%} & 0.0\% & 0.0\% \\ \textbf{Lead} & 27.3\% & \ib{36.4\%*} & 18.2\% & 18.2\% & 0.0\% \\ \end{tabular}% \\ \midrule 18 & When do you seek opinions about APIs? \\ & SAC = Selecting amidst choices, DAR = Determining a replacement, ISF = Improving software feature, RAF = Replacing software feature, DAN = Developing a new API, FAB = Fixing a bug, SAV = Selecting API version, VAS = Validating a selection \begin{tabular}{lrrrrrrrrr}\ & {\textbf{SAC}} & {\textbf{DAR}} & {\textbf{ISF}} & {\textbf{RAF}} & {\textbf{DAN}} & {\textbf{VAS}} & {\textbf{FAB}} & {\textbf{SAV}} & {\textbf{Other}} \\ \textbf{Software Developer} & \ib{81.1\%*} & 74.3\% & 60.8\% & 45.9\% & 51.4\% & 39.2\% & 59.5\% & 25.7\% & 17.6\% \\ \textbf{Other} & 0.0\% & 33.3\% & \ib{33.3\%} & \ib{33.3\%} & \ib{33.3\%} & 0.0\% & \ib{33.3\%} & 0.0\% & 0.0\% \\ \textbf{Student} & \ib{100.0\%} & \ib{100.0\%} & 50.0\% & 100.0\% & 100.0\% & 0.0\% & 50.0\% & 0.0\% & 0.0\% \\ \textbf{Research Engineer} & 66.7\% & 33.3\% & 66.7\% & 0.0\% & 66.7\% & 0.0\% & \ib{100.0\%} & 0.0\% & 0.0\% \\ \textbf{Lead} & \ib{81.8\%*} & 72.7\% & \ib{81.8\%*} & 36.4\% & 36.4\% & 27.3\% & 72.7\% & 36.4\% & 0.0\% \\ \end{tabular}% \\ \bottomrule \end{tabular}% \label{tab:rq1-sum-by-profession}% \end{table*}% \begin{table*}[t] \centering \caption{Highlights of Findings from Primary Survey RQ2 Closed Questions by Profession} \begin{tabular}{r|p{16cm}} \toprule \textbf{No} & \textbf{Question} \\ \midrule 8 & Do you rely on tools to help you understand opinions about APIs in online forum discussions? \\ & \textit{ \begin{inparaenum} \item Research Engineer: \ib{No 66.7\%}, \item Student: \ib{No 100\%}, \item Software Developer: \ib{No 79.7\%*}, \item Lead: \ib{No 72.7\%*} \end{inparaenum} } \\ \midrule 9 & If you don't use a tool currently to explore the diverse opinions about APIs in developer forums, do you believe there is a need of such a tool to help you find the right viewpoints about an API quickly? \\ & \textit{ \begin{inparaenum} \item Research Engineer: \ib{No 33.3\%, I don't know 33.3\%} \item Student: \ib{Yes 50\%, I don't know 50\%} \item Software Developer: \ib{I don't know 48.6\%*}, \item Lead: \ib{I don't know 54.5\%*} \end{inparaenum} } \\ \midrule 15 & An opinion is important if it contains discussion about the following API aspects? \\ & Per = Performance, Sec = Security, Use = Usability, Doc = Documentation, Comp = Compatibility, Comm = Community, Leg = Legal, Port = Portability, Sen = Only Sentiment, Feat = General Features \begin{tabular}{lrrrrrrrrrrr & {\textbf{Per}} & {\textbf{Sec}} & {\textbf{Use}} & {\textbf{Doc}} & {\textbf{Comp}} & {\textbf{Comm}} & {\textbf{Bug}} & {\textbf{Leg}} & {\textbf{Por}} & {\textbf{Sen}} & {\textbf{Feat}} \\ \textbf{Software Developer} & 75.7\% & 74.3\% & \ib{82.4\%*} & 75.7\% & 60.8\% & 56.8\% & 74.3\% & 41.9\% & 40.5\% & 13.5\% & 43.2\% \\ \textbf{Other} & \ib{33.3\%} & \ib{33.3\%} & \ib{33.3\%} & 0.0\% & \ib{33.3\%} & 0.0\% & 0.0\% & 0.0\% & \ib{33.3\%} & 0.0\% & \ib{33.3\%} \\ \textbf{Student} & 50.0\% & \ib{100.0\%} & \ib{100.0\%} & \ib{100.0\%} & 50.0\% & 50.0\% & 100.0\% & 0.0\% & 50.0\% & 50.0\% & 0.0\% \\ \textbf{Research Engineer} & \ib{66.7\%} & \ib{66.7\%} & \ib{66.7\%} & \ib{66.7\%} & 33.3\% & \ib{66.7\%} & \ib{66.7\%} & \ib{66.7\%} & 0.0\% & 33.3\% & 33.3\% \\ \textbf{Lead} & 72.7\% & 81.8\% & 63.6\% & \ib{100\%*} & 63.6\% & 72.7\% & 81.8\% & 54.5\% & 45.5\% & 27.3\% & 36.4\% \\ \end{tabular}% \\ \midrule 19 & What tools can better support your understanding of API reviews in developer forums? \\ & OM = Opinion Miner, SA = Sentiment Analyzer, OS = Opinion Summarizer, AC = API Comparator, TA = Trend Analyzer, CA = Competing APIs, OT = Other Tools \begin{tabular}{lrrrrrrr} & \textbf{OM} & \textbf{SA} & \textbf{OS} & \textbf{AC} & \textbf{TA} & \textbf{CA} & \textbf{OT} \\ \textbf{Software Developer} & 54.1\% & 39.2\% & 43.2\% & 62.2\% & 59.5\% & \ib{64.9\%*} & 6.8\% \\ \textbf{Other} & 0.0\% & 0.0\% & 0.0\% & \ib{33.3\%} & \ib{33.3\%} & \ib{33.3\%} & 0.0\% \\ \textbf{Student} & \ib{100.0\%} & 0.0\% & 50.0\% & 50.0\% & \ib{100.0\%} & \ib{100.0\%} & 0.0\% \\ \textbf{Research Engineer} & 0.0\% & 33.3\% & 33.3\% & \ib{100.0\%} & 66.7\% & 66.7\% & 33.3\% \\ \textbf{Lead} & 45.5\% & 36.4\% & 36.4\% & 54.5\% & 63.6\% & \ib{72.7\%*} & 9.1\% \\ \end{tabular}% \\ \midrule 20 & How often do you feel overwhelmed due to the abundance of opinions about an API? \\ & \begin{tabular}{lrrrr} & \multicolumn{1}{l}{\textbf{Always}} & \multicolumn{1}{l}{\textbf{Sometimes}} & \multicolumn{1}{l}{\textbf{Rarely}} & \multicolumn{1}{l}{\textbf{Never}} \\ \textbf{Software Developer} & 4.1\% & \ib{45.9\%*} & 31.1\% & 8.1\% \\ \textbf{Other} & \ib{33.3\%} & 0.0\% & 0.0\% & 0.0\% \\ \textbf{Student} & 0.0\% & \ib{100.0\%} & 0.0\% & 0.0\% \\ \textbf{Research Engineer} & 0.0\% & \ib{33.3\%} & \ib{33.3\%} & \ib{33.3\%} \\ \textbf{Lead} & 0.0\% & 27.3\% & \ib{63.6\%*} & 9.1\% \\ \end{tabular}% \\ \midrule 21 & Would a summarization of opinions about APIs help you to make a better decision on which one to use? \\ & \textit{ \begin{inparaenum} \item Research Eng: No 66.7\%, \item Student: Yes 50\%, don't know 50\%, \item Software Dev: \ib{don't know 40.5\%*}, \item Lead: \ib{don't know 63.6\%*} \end{inparaenum} } \\ \midrule 22 & Opinions about an API need to be summarized because \\ & \begin{tabular}{lrrrrr} & {\textbf{Too many posts}} & {\textbf{Opinion in missed posts}} & {\textbf{Missed contradictory}} & {\textbf{Not enough time}} & {\textbf{Other reason}} \\ \textbf{Software Developer} & 50.0\% & \ib{63.5\%*} & 54.1\% & 59.5\% & 12.2\% \\ \textbf{Other} & \ib{33.3\%} & \ib{33.3\%} & \ib{33.3\%} & \ib{33.3\%} & 0.0\% \\ \textbf{Student} & 50.0\% & \ib{100.0\%} & \ib{100.0\%} & \ib{100.0\%} & 0.0\% \\ \textbf{Research Engineer} & 0.0\% & \ib{66.7\%} & \ib{66.7\%} & \ib{66.7\%} & 33.3\% \\ \textbf{Lead} & 27.3\% & 63.6\% & 54.5\% & \ib{72.7\%*} & 0.0\% \\ \end{tabular}% \\ \midrule 23 & Opinion summarization can improve the following decision making processes \\ & SAC = Selecting amidst choices, DAR = Determining a replacement, ISF = Improving software feature, RAF = Replacing software feature, DAN = Developing a new API, FAB = Fixing a bug, SAV = Selecting API version, VAS = Validating a selection \begin{tabular}{lrrrrrrrrr} & {\textbf{SAC}} & {\textbf{DAR}} & {\textbf{ISF}} & {\textbf{RAF}} & {\textbf{DAN}} & {\textbf{VAS}} & {\textbf{FAB}} & {\textbf{SAV}} & {\textbf{Other}} \\ \textbf{Software Developer} & \ib{63.5\%*} & 60.8\% & 41.9\% & 36.5\% & 37.8\% & 45.9\% & 33.8\% & 24.3\% & 10.8\% \\ \textbf{Other} & \ib{33.3\%} & \ib{33.3\%} & 0.0\% & \ib{33.3\%} & 0.0\% & 0.0\% & 0.0\% & \ib{33.3\%} & 0.0\% \\ \textbf{Student} & \ib{100.0\%} & \ib{100.0\%} & 0.0\% & 50.0\% & 0.0\% & 50.0\% & 50.0\% & 0.0\% & 0.0\% \\ \textbf{Research Engineer} & \ib{66.7\%} & \ib{66.7\%} & \ib{66.7\%} & 33.3\% & \ib{66.7\%} & 33.3\% & 33.3\% & 0.0\% & 0.0\% \\ \textbf{Lead} & \ib{81.8\%*} & \ib{81.8\%*} & 45.5\% & 45.5\% & 36.4\% & 36.4\% & 45.5\% & 45.5\% & 0.0\% \\ \end{tabular}% \\ \bottomrule \end{tabular}% \label{tab:rq2-sum-by-profession}% \end{table*}% \subsection{Analysis by Professions}\label{sec:demographic-profession} \rev{In Tables~\ref{tab:rq1-sum-by-profession} and \ref{tab:rq2-sum-by-profession}, we summarize the results of closed questions from our final survey by the reported professions of survey participants. We report each question as follows: \begin{enumerate} \item Multiple Choice Questions. If the question has three options (Yes, No, I don't know), we only show the result of the option(s) with the majority agreement. \item Likert-scale Questions. We show all the options, by calculating agreements using the formula we introduce in Section~\ref{sec:pilot-survey} (we used in Tables~\ref{tbl:s1questions},\ref{tab:s2rq1highlights}, and \ref{tab:s2rq2highlights}). \item We highlight the value of an option for each profession as \textit{bold italic}, if the option has the maximum value out of all options for the profession. For example, for Q16 (where do you seek opinions about APIs?) in Table~\ref{tab:rq1-sum-by-profession}, there are five options: \begin{inparaenum} \item Internal mailing lists, \item IRC chats, \item Co-workers, \item Stack Overflow, \item Search/Diverse sources \end{inparaenum} The software developers in our survey show the most agreement (89.2\%) towards Stack Overflow. We thus make the value bold-italic among the five option for software developers. \item We place a star symbol beside a highlighted value of an option, if the value is statistically significant\footnote{We use Mann Whitney U test and a 95\% confidence level (i.e., $p$ = 0.05).} \end{enumerate}} \rev{\addtocounter{o}{1} \vspace{1mm}\noindent\textit{\textbf{Observation \arabic{o}.}} \textbf{The necessity of seeking opinions about APIs is mostly prevalent and consistent across the different reported professions in our surveys.} All the research engineers, students, and team leads, and 89.2\% of software developers who visit developer forums in our survey, also value the opinions about APIs in the forums. Unlike managers, technical leads are expected to work closely with the codebase and overall system architecture design. The decision on an API during the design of a system can be beneficial for such team leads. According to one team lead: \emt{The quality of APIs can vary considerably. Getting experience of others can save a lot of time if you end up using a better API or end up skipping a bad one.} For the researchers, the motivation was to learn from the experts: \emt{ they have used the API, probably more extensively then I have, and may be experts in their subfield}.} \rev{\addtocounter{o}{1} \vspace{1mm}\noindent\textit{\textbf{Observation \arabic{o}.}} While all the team leads consult API information in the developer forums, most of them visit the forum two or three times a week. In contrast, most of the developers who consult developer forums for API information, do so more every day.} \rev{\addtocounter{o}{1} \vspace{1mm}\noindent\textit{\textbf{Observation \arabic{o}.}} In both pilot and primary surveys, we asked developers about their preference for tools to better support their understanding of opinions about APIs in the developer forums (Q19 in primary survey, Q7 in pilot survey). A summarization engine to compare APIs based on different features is considered as the most useful among the software developers, team leads and research engineers. In our pilot survey, the leads also preferred the same tool the most among all tools. In our pilot survey, we got responses from three managers, who showed equal preference (33.3\%) to all the tools except an opinion miner (66.7\%).} \rev{\addtocounter{o}{1} \vspace{1mm}\noindent\textit{\textbf{Observation \arabic{o}.}} There is a more clear distinction among the professions in their preference of API aspects that they prefer to explore in the opinions about APIs (Q15 in primary survey). The team leads are most interested to find opinions about API documentation, while the other professions including software engineers are most interested to learn about the usability of the API. All the professions agreed the most that the summarizing of opinions can help in the selection of APIs.} \begin{table*}[t] \centering \caption{Highlights of Findings from Primary Survey RQ1 Closed Questions by Experience} \begin{tabular}{r|p{16cm}} \toprule \textbf{No} & \textbf{Question} \\ \midrule 1 & Do you visit developer forums to seek info about APIs? Research Engineer\\ & \textit{ \begin{inparaenum} \item 10+: \ib{Yes 76.8\%*}, \item 7-10: \ib{Yes 83.9\%*}, \item 3-6: \ib{Yes 85.7\%*} \end{inparaenum} } \\ \midrule 3 & Do you value the opinion of other developers in the developer forums when deciding on what API to use? \\ & \textit{ \begin{inparaenum} \item 10+: \ib{Yes 85.5\%*}, \item 7-10: \ib{Yes 92.3\%*}, \item 3-6: \ib{Yes 100\%*} \end{inparaenum} } \\ \midrule 16 & Where do you seek help/opinions about APIs? \\ & \begin{tabular}{lrrrrr} & {\textbf{Internal Mailing list}} & {\textbf{IRC chats}} & {\textbf{Co-workers}} & {\textbf{Stack Overflow}} & {\textbf{Search/Diverse Sources}} \\ \textbf{10+} & 21.8\% & 10.9\% & 67.3\% & \ib{85.5\%*} & 41.8\% \\ \textbf{7--10} & 30.8\% & 34.6\% & 69.2\% & \ib{92.3\%*} & 46.2\% \\ \textbf{3--6} & 33.3\% & 58.3\% & 66.7\% & \ib{100.0\%*} & 41.7\% \\ \end{tabular}% \\ \midrule 17 & How often do you refer to online forums (e.g., Stack Overflow) to get information about APIs? \\ & \begin{tabular}{lrrrrr} & {\textbf{Every day}} & {\textbf{Two or three times a week}} & {\textbf{Once a week}} & {\textbf{One a month}} & {\textbf{Never}} \\ \textbf{10+} & \ib{32.7\%*} & 25.5\% & 12.7\% & 14.5\% & 0.0\% \\ \textbf{7--10} & \ib{30.8\%*} & 30.8\% & 11.5\% & 19.2\% & 7.7\% \\ \textbf{3--6} & 33.3\% & \ib{41.7\%*} & 16.7\% & 8.3\% & 0.0\% \\ \end{tabular}% \\ \midrule 18 & When do you seek opinions about APIs? \\ & SAC = Selecting amidst choices, DAR = Determining a replacement, ISF = Improving software feature, RAF = Replacing software feature, DAN = Developing a new API, FAB = Fixing a bug, SAV = Selecting API version, VAS = Validating a selection \begin{tabular}{lrrrrrrrrr} & {\textbf{SAC}} & {\textbf{DAR}} & {\textbf{ISF}} & {\textbf{RAF}} & {\textbf{DAN}} & {\textbf{VAS}} & {\textbf{FAB}} & {\textbf{SAV}} & {\textbf{Other}} \\ \textbf{10+} & \ib{74.5\%*} & 65.5\% & 60.0\% & 38.2\% & 45.5\% & 34.5\% & 47.3\% & 25.5\% & 10.9\% \\ \textbf{7--10} & \ib{80.8\%*} & 84.6\% & 61.5\% & 53.8\% & 57.7\% & 38.5\% & \ib{80.8\%*} & 26.9\% & 19.2\% \\ \textbf{3--6} & \ib{91.7\%*} & 75.0\% & 75.0\% & 50.0\% & 58.3\% & 25.0\% & 83.3\% & 16.7\% & 16.7\% \\ \end{tabular}% \\ \bottomrule \end{tabular}% \label{tab:rq1-sum-by-exp}% \end{table*}% \begin{table*}[t] \centering \caption{Highlights of Findings from Primary Survey RQ2 Closed Questions by Experience} \begin{tabular}{r|p{16cm}} \toprule \textbf{No} & \textbf{Question} \\ \midrule 8 & Do you rely on tools to help you understand opinions about APIs in online forum discussions? \\ & \textit{ \begin{inparaenum} \item 10+: \ib{No 70.9\%*}, \item 7-10: \ib{No 84.6\%*}, \item 3-6: \ib{No 91.7\%*} \end{inparaenum} } \\ \midrule 9 & If you don't use a tool currently to explore the diverse opinions about APIs in developer forums, do you believe there is a need of such a tool to help you find the right viewpoints about an API quickly? \\ & \textit{ \begin{inparaenum} \item 10+: \ib{I don't know 45.5\%*}, \item 7-10: \ib{I don't know 53.8\%*}, \item 3-6: \ib{I don't know 50\%*} \end{inparaenum} } \\ \midrule 15 & An opinion is important if it contains discussion about the following API aspects? \\ & Per = Performance, Sec = Security, Use = Usability, Doc = Documentation, Comp = Compatibility, Comm = Community, Leg = Legal, Port = Portability, Sen = Only Sentiment, Feat = General Features \begin{tabular}{lrrrrrrrrrrr} & {\textbf{Per}} & {\textbf{Sec}} & {\textbf{Use}} & {\textbf{Doc}} & {\textbf{Comp}} & {\textbf{Comm}} & {\textbf{Bug}} & {\textbf{Leg}} & {\textbf{Por}} & {\textbf{Sen}} & {\textbf{Feat}} \\ \textbf{10+} & 69.1\% & 70.9\% & 70.9\% & \ib{72.7\%*} & 52.7\% & 58.2\% & \ib{72.7\%*} & 43.6\% & 41.8\% & 18.2\% & 38.2\% \\ \textbf{7--10} & 69.2\% & 76.9\% & \ib{84.6\%*} & \ib{84.6\%*} & 61.5\% & 50.0\% & 65.4\% & 42.3\% & 38.5\% & 19.2\% & 13.3\% \\ \textbf{3--6} & 100.0\% & 83.3\% & \ib{100.0\%*} & 75.0\% & 83.3\% & 66.7\% & 91.7\% & 33.3\% & 33.3\% & 0.0\% & 50.0\% \\ \end{tabular}% \\ \midrule 19 & What tools can better support your understanding of API reviews in developer forums? \\ & OM = Opinion Miner, SA = Sentiment Analyzer, OS = Opinion Summarizer, AC = API Comparator, TA = Trend Analyzer, CA = Competing APIs, OT = Other Tools \begin{tabular}{lrrrrrrr} & \textbf{OM} & \textbf{SA} & \textbf{OS} & \textbf{AC} & \textbf{TA} & \textbf{CA} & \textbf{OT} \\ \textbf{10+} & 49.1\% & 40.0\% & 38.3\% & 54.5\% & 50.9\% & \ib{63.6\%*} & 9.1\% \\ \textbf{7--10} & 50.0\% & 30.8\% & 42.3\% & 65.4\% & \ib{69.2\%*} & \ib{69.2\%*} & 7.7\% \\ \textbf{3--6} & 58.3\% & 33.3\% & 50.0\% & \ib{83.3\%*} & \ib{83.3\%*} & 66.7\% & 0.0\% \\ \end{tabular}% \\ \midrule 20 & How often do you feel overwhelmed due to the abundance of opinions about an API? \\ & \begin{tabular}{lrrrr} & \textbf{Always} & \textbf{Sometimes} & \textbf{Rarely} & \textbf{Never} \\ \textbf{10+} & 1.8\% & 34.5\% & \ib{40.0\%*} & 9.1\% \\ \textbf{7--10} & 3.8\% & \ib{50.0\%*} & 26.9\% & 11.5\% \\ \textbf{3--6} & 8.3\% & \ib{66.7\%*} & 16.7\% & 8.3\% \\ \end{tabular}% \\ \midrule 21 & Would a summarization of opinions about APIs help you to make a better decision on which one to use? \\ & \textit{ \begin{inparaenum} \item 10+: \ib{I don't know 43.6\%*}, \item 7-10: \ib{I don't know 46.2\%*}, \item 3-6: \ib{Yes 58.3\%*} \end{inparaenum} } \\ \midrule 22 & Opinions about an API need to be summarized because \\ & \begin{tabular}{lrrrrr} & \textbf{Too many posts} & \textbf{Opinion in missed posts} & \textbf{Missed contradictory opinion} & \textbf{Not enough time} & \textbf{Other reason} \\ \textbf{10+} & 36.4\% & \ib{60.0\%*} & 54.5\% & 58.2\% & 10.9\% \\ \textbf{7--10} & 50.0\% & \ib{65.4\%*} & 53.8\% & 61.5\% & 11.5\% \\ \textbf{3--6} & \ib{75.0\%*} & \ib{75.0\%*} & 58.3\% & \ib{75.0\%*} & 8.3\% \\ \end{tabular}% \\ \midrule 23 & Opinion summarization can improve the following decision making processes \\ & SAC = Selecting amidst choices, DAR = Determining a replacement, ISF = Improving software feature, RAF = Replacing software feature, DAN = Developing a new API, FAB = Fixing a bug, SAV = Selecting API version, VAS = Validating a selection \begin{tabular}{lrrrrrrrrr} & \textbf{SAC} & \textbf{DAR} & \textbf{ISF} & \textbf{RAF} & \textbf{DAN} & \textbf{VAS} & \textbf{FAB} & \textbf{SAV} & \textbf{Other} \\ \textbf{10+} & 61.8\% & \ib{63.6\%*} & 41.8\% & 34.5\% & 40.0\% & 45.5\% & 30.9\% & 45.5\% & 5.5\% \\ \textbf{7--10} & \ib{65.4\%*} & 61.5\% & 46.2\% & 38.5\% & 34.6\% & 46.2\% & 42.3\% & 30.8\% & 11.5\% \\ \textbf{3--6} & \ib{83.3\%*} & 66.7\% & 25.0\% & 50.0\% & 25.0\% & 25.0\% & 33.3\% & 16.7\% & 16.7\% \\ \end{tabular}% \\ \bottomrule \end{tabular}% \label{tab:rq2-sum-by-exp}% \end{table*}% \subsection{Analysis by Experiences}\label{sec:demographic-experience} \rev{In Tables~\ref{tab:rq1-sum-by-exp} and \ref{tab:rq2-sum-by-exp}, we summarize the results of closed questions from our final survey by the reported experiences of survey participants following the same reporting principles we discussed in Section~\ref{sec:demographic-profession}.} \rev{\addtocounter{o}{1} \vspace{1mm}\noindent\textit{\textbf{Observation \arabic{o}.}} In both pilot and primary surveys, the developers with less experience show more interest to value the opinion of other developers (Q2 in Table~\ref{tab:rq1-sum-by-exp}). In both the surveys, the more experienced developers offer more uniform preferences towards the different tools that could be developed to facilitate opinion analysis from developer forums (Q19 in Table~\ref{tab:rq2-sum-by-exp}).} \rev{\addtocounter{o}{1} \vspace{1mm}\noindent\textit{\textbf{Observation \arabic{o}.}} The less experienced developers visit forums more frequently (Q17 in primary survey): 75\%, 61.2\%, and 58.2\% developers with 3-6, 7-10, and 10+ years of experience, respectively visit developer forums at least two or three times a week.} \rev{\addtocounter{o}{1} \vspace{1mm}\noindent\textit{\textbf{Observation \arabic{o}.}} Among the less experienced developers (3-6 years of experience), both Trend Analyzer and API Comparator were ranked over other tools when asked about their preference of tools to better support their understanding of opinions about APIs (Q19 in primary survey). The developers with 10+ years of experience were most interested to explore the Competing APIs tool. The preference towards a specific tool decreases as developers become more experienced. For example, the developers with 10+ years of experience prefer the different tools with almost similar preference. The two tools (API Comparator and Competing APIs) are also ranked the highest (70.7\%) by developers with 10+ years of experience in the pilot survey (Q7).} \rev{\addtocounter{o}{1} \vspace{1mm}\noindent\textit{\textbf{Observation \arabic{o}.}} The developers with 10+ years of experience show almost equal preference to the different implicit API aspects about which they prefer to see or seek opinions. The less experienced developers also have more specific preference of API aspects about which they like to explore the opinions of other developers (Q15 in primary survey): \begin{inparaenum} \item More than 75\% agreement for the six API aspects by developers with 3-6 years of experience (maximum 100\% for Usability) \item More than 75\% agreement for three API aspects by developers with 7-10 years of experience (maximum 84.6\% for both usability and documentation) \item Maximum 72.7\% agreement for two API aspects by developers with 10+ years of experience (Documentation and Bug). \end{inparaenum}} \begin{table*}[t] \centering \caption{Highlights of Findings from Primary Survey RQ1 Closed Questions by Programming Languages} \begin{tabular}{r|p{16cm}} \toprule \textbf{No} & \textbf{Question} \\ \midrule 1 & Do you visit developer forums to seek info about APIs? Research Engineer\\ & \textit{ \begin{inparaenum} \item R: \ib{Yes 86.4\%*}, \item Java: No 71.4\%, \item Python: \ib{Yes 83.3\%*} \item Javascript: \ib{Yes 81.2\%*} \item C: \ib{Yes 75\%*} \item C++: \ib{Yes 83.3\%*} \item C\#: \ib{Yes 76.5\%*} \item Objective-C: \ib{Yes 70.0\%*} \item Ruby: \ib{Yes 100\%*} \end{inparaenum} } \\ \midrule 3 & Do you value the opinion of other developers in the developer forums when deciding on what API to use? \\ & \textit{ \begin{inparaenum} \item R: \ib{Yes 78.9\%*} \item Java: \ib{Yes 100\%*} \item Python: \ib{Yes 83.3\%*} \item Javascript: \ib{Yes 84.6\%*} \item C: \ib{Yes 87.5\%*} \item C++: \ib{Yes 100.0\%*} \item C\#: \ib{Yes 92.3\%*} \item Objective-C: \ib{Yes 100\%*} \item Ruby: \ib{Yes 100\%*} \end{inparaenum} } \\ \midrule 16 & Where do you seek help/opinions about APIs? \\ & \begin{tabular}{lrrrrr} & \textbf{Internal Mailing list} & \textbf{IRC chats} & \textbf{Co-workers} & \textbf{Stack Overflow} & \textbf{Search/Diverse Sources} \\ \textbf{R} & 26.3\% & 31.6\% & 63.2\% & \ib{78.9\%*} & 36.8\% \\ \textbf{Java} & 40.0\% & 20.0\% & 80.0\% & \ib{100.0\%*} & 60.0\% \\ \textbf{Python} & 16.7\% & 16.7\% & 66.7\% & \ib{83.3\%*} & 50.0\% \\ \textbf{Javascript} & 30.8\% & 30.8\% & 53.8\% & \ib{84.6\%*} & 30.8\% \\ \textbf{C} & 25.0\% & 18.8\% & 56.2\% & \ib{87.5\%*} & 43.8\% \\ \textbf{C++} & 20.0\% & 20.0\% & 60.0\% & \ib{100.0\%*} & 50.0\% \\ \textbf{C\#} & 30.8\% & 7.7\% & \ib{92.3\%*} & \ib{92.3\%*} & 30.8\% \\ \textbf{Objective-C} & 71.4\% & 14.3\% & 42.9\% & \ib{100.0\%*} & 57.1\% \\ \textbf{Ruby} & 25.0\% & 25.0\% & \ib{100.0\%*} & \ib{100.0\%*} & 25.0\% \\ \end{tabular}% \\ \midrule 17 & How often do you refer to online forums (e.g., Stack Overflow) to get information about APIs? \\ & \begin{tabular}{lrrrrr} & \textbf{Every day} & \textbf{Two or three times a week} & \textbf{Once a week} & \textbf{One a month} & \textbf{Never} \\ \textbf{R} & \ib{31.6\%*} & 15.8\% & 21.1\% & 10.5\% & 21.0\% \\ \textbf{Java} & 40.0\% & 20.0\% & 0.0\% & 40.0\% & 0.0\% \\ \textbf{Python} & 16.7\% & \ib{66.7\%*} & 0.0\% & 0.0\% & 16.6\% \\ \textbf{Javascript} & \ib{30.8\%*} & \ib{30.8\%*} & 7.7\% & 15.4\% & 15.3\% \\ \textbf{C} & 25.0\% & \ib{31.2\%*} & 18.8\% & 12.5\% & 12.5\% \\ \textbf{C++} & 30.0\% & \ib{40.0\%*} & 10.0\% & 20.0\% & 0.0\% \\ \textbf{C\#} & 38.5\% & 30.8\% & 15.4\% & 7.7\% & 7.6\% \\ \textbf{Objective-C} & \ib{71.4\%*} & 0.0\% & 14.3\% & 14.3\% & 0.0\% \\ \textbf{Ruby} & 0.0\% & 50.0\% & 0.0\% & 50.0\% & 0.0\% \\ \end{tabular}% \\ \midrule 18 & When do you seek opinions about APIs? \\ & SAC = Selecting amidst choices, DAR = Determining a replacement, ISF = Improving software feature, RAF = Replacing software feature, DAN = Developing a new API, FAB = Fixing a bug, SAV = Selecting API version, VAS = Validating a selection \begin{tabular}{lrrrrrrrrr} & \textbf{SAC} & \textbf{DAR} & \textbf{ISF} & \textbf{RAF} & \textbf{DAN} & \textbf{VAS} & \textbf{FAB} & \textbf{SAV} & \textbf{Other} \\ \textbf{R} & 68.4\% & \ib{73.7\%*} & 47.4\% & 31.6\% & 47.4\% & 42.1\% & 52.6\% & 31.6\% & 15.8\% \\ \textbf{Java} & \ib{100.0\%*} & 80.0\% & 60.0\% & 20.0\% & 60.0\% & 60.0\% & 100.0\% & 20.0\% & 0.0\% \\ \textbf{Python} & \ib{66.7\%*} & 66.7\% & \ib{66.7\%*} & 33.3\% & 50.0\% & 16.7\% & \ib{66.7\%*} & 33.3\% & 16.7\% \\ \textbf{Javascript} & 61.5\% & \ib{76.9\%*} & \ib{76.9\%*} & 38.5\% & 30.8\% & 15.4\% & \ib{76.9\%*} & 15.4\% & 15.4\% \\ \textbf{C} & \ib{75.0\%*} & 56.2\% & 56.2\% & 56.2\% & 56.2\% & 18.8\% & 50.0\% & 25.0\% & 12.5\% \\ \textbf{C++} & \ib{100.0\%*} & \ib{100.0\%*} & 70.0\% & 70.0\% & 80.0\% & 60.0\% & 40.0\% & 20.0\% & 20.0\% \\ \textbf{C\#} & \ib{92.3\%*} & 61.5\% & 69.2\% & 46.2\% & 53.8\% & 53.8\% & 69.2\% & 23.1\% & 7.7\% \\ \textbf{Objective-C} & \ib{85.7\%*} & 71.4\% & 71.4\% & 42.9\% & 28.6\% & 28.6\% & 71.4\% & 42.9\% & 14.3\% \\ \textbf{Ruby} & \ib{75.0\%*} & 75.0\% & 50.0\% & 50.0\% & 50.0\% & 0.0\% & 50.0\% & 0.0\% & 25.0\% \\ \end{tabular}% \\ \bottomrule \end{tabular}% \label{tab:rq1-sum-by-lang}% \end{table*}% \begin{table*}[tbp] \vspace{-5mm} \centering \caption{Highlights of Findings from Primary Survey RQ2 Closed Questions by Programming Languages} \vspace{-2mm} \begin{tabular}{r|p{16cm}} \toprule \textbf{No} & \textbf{Question} \\ \midrule 8 & Do you rely on tools to help you understand opinions about APIs in online forum discussions? \\ & \textit{ \begin{inparaenum} \item R: \ib{No 57.9\%*} \item Java: \ib{No 100\%*} \item Python: \ib{No 100\%*} \item Javascript: \ib{No 76.9\%*} \item C: \ib{No 75\%*} \item C++: \ib{No 90.0\%*} \item C\#: \ib{No 84.6\%*} \item Objective-C: \ib{No 71.4\%*} \item Ruby: \ib{No 100\%*} \end{inparaenum} } \\ \midrule 9 & If you don't use a tool currently to explore the diverse opinions about APIs in developer forums, do you believe there is a need of such a tool to help you find the right viewpoints about an API quickly? \\ & \textit{ \begin{inparaenum} \item R: No 26.3\%, \item Java: don't know 60.0\%, \item Python: \ib{don't know 83.3\%*} \item Javascript: \ib{don't know 69.2\%*} \item C: \ib{No 50\%, don't know 50\%} \item C++: \ib{don't know 80.0\%*} \item C\#: don't know 53.8\%* \item Objective-C: \ib{don't know 57.1\%*} \item Ruby: don't know 50\%, No 50\% \end{inparaenum} } \\ \midrule 15 & An opinion is important if it contains discussion about the following API aspects? \\ & Per = Performance, Sec = Security, Use = Usability, Doc = Documentation, Comp = Compatibility, Comm = Community, Leg = Legal, Port = Portability, Sen = Only Sentiment, Feat = General Features \begin{tabular}{lrrrrrrrrrrr} & \textbf{Per} & \textbf{Sec} & \textbf{Use} & \textbf{Doc} & \textbf{Comp} & \textbf{Comm} & \textbf{Bug} & \textbf{Leg} & \textbf{Por} & \textbf{Sen} & \textbf{Feat} \\ \textbf{R} & 68.4\% & 68.4\% & \ib{78.9\%*} & 73.7\% & 42.1\% & 52.6\% & 78.9\% & 42.1\% & 36.8\% & 21.1\% & 4.8\% \\ \textbf{Java} & \ib{100.0\%*} & \ib{100.0\%*} & \ib{100.0\%*} & 80.0\% & \ib{100.0\%*} & 60.0\% & 80.0\% & 60.0\% & 60.0\% & 0.0\% & 60.0\% \\ \textbf{Python} & 66.7\% & \ib{83.3\%*} & \ib{83.3\%*} & 66.7\% & 66.7\% & 50.0\% & 66.7\% & 50.0\% & 33.3\% & 16.7\% & 16.7\% \\ \textbf{Javascript} & \ib{76.9\%*} & 69.2\% & 69.2\% & 69.2\% & 61.5\% & 46.2\% & 53.8\% & 30.8\% & 23.1\% & 7.7\% & 46.2\% \\ \textbf{C} & 56.2\% & 62.5\% & 56.2\% & \ib{68.8\%*} & 62.5\% & 56.2\% & 68.8\% & 43.8\% & 50.0\% & 0.0\% & 37.5\% \\ \textbf{C++} & 80.0\% & 70.0\% & 90.0\% & \ib{100.0\%*} & 70.0\% & 60.0\% & 80.0\% & 50.0\% & 70.0\% & 40.0\% & 50.0\% \\ \textbf{C\#} & 84.6\% & \ib{92.3\%*} & \ib{92.3\%*} & 84.6\% & 61.5\% & 61.5\% & 84.6\% & 38.5\% & 30.8\% & 30.8\% & 76.9\% \\ \textbf{Objective-C} & 71.4\% & 71.4\% & \ib{85.7\%*} & \ib{85.7\%*} & 71.4\% & 71.4\% & 85.7\% & 57.1\% & 42.9\% & 14.3\% & 28.6\% \\ \textbf{Ruby} & \ib{75.0\%*} & \ib{75.0\%*} & \ib{75.0\%*} & 50.0\% & 0.0\% & \ib{75.0\%*} & 50.0\% & 0.0\% & 0.0\% & 0.0\% & 25.0\% \\ \end{tabular}% \\ \midrule 19 & What tools can better support your understanding of API reviews in developer forums? \\ & OM = Opinion Miner, SA = Sentiment Analyzer, OS = Opinion Summarizer, AC = API Comparator, TA = Trend Analyzer, CA = Competing APIs, OT = Other Tools \begin{tabular}{lrrrrrrr} & \textbf{OM} & \textbf{SA} & \textbf{OS} & \textbf{AC} & \textbf{TA} & \textbf{CA} & \textbf{OT} \\ \textbf{R} & 31.6\% & 10.5\% & 31.6\% & 36.8\% & 47.4\% & \ib{52.6\%*} & 0.0\% \\ \textbf{Java} & 60.0\% & 40.0\% & 60.0\% & \ib{80.0\%*} & \ib{80.0\%*} & \ib{80.0\%*} & 20.0\% \\ \textbf{Python} & \ib{66.7\%*} & 16.7\% & 16.7\% & 50.0\% & 33.3\% & 50.0\% & 0.0\% \\ \textbf{Javascript} & 61.5\% & 38.5\% & 46.2\% & 53.8\% & \ib{69.2\%*} & \ib{69.2\%*} & 7.7\% \\ \textbf{C} & 37.5\% & 37.7\% & 18.8\% & 56.2\% & 43.8\% & \ib{62.5\%*} & 12.5\% \\ \textbf{C++} & 70.0\% & 50.0\% & 60.0\% & \ib{80.0\%*} & 70.0\% & \ib{80.0\%*} & 0.0\% \\ \textbf{C\#} & 61.5\% & 69.2\% & 61.5\% & 69.2\% & \ib{76.9\%*} & 61.5\% & 15.4\% \\ \textbf{Objective-C} & 42.9\% & 57.1\% & 57.1\% & \ib{100.0\%*} & 85.7\% & 85.7\% & 14.3\% \\ \textbf{Ruby} & 50.0\% & 0.0\% & 25.0\% & \ib{75.0\%} & 50.0\% & \ib{75.0\%} & 0.0\% \\ \end{tabular}% \\ \midrule 20 & How often do you feel overwhelmed due to the abundance of opinions about an API? \\ & \begin{tabular}{lrrrr} & \textbf{Always} & \textbf{Sometimes} & \textbf{Rarely} & \textbf{Never} \\ \textbf{R} & 5.3\% & \ib{31.6\%} & 31.6\% & 10.5\% \\ \textbf{Java} & 20.0\% & \ib{60.0\%} & 20.0\% & 0.0\% \\ \textbf{Python} & 0.0\% & \ib{50.0\%} & 33.3\% & 16.7\% \\ \textbf{Javascript} & 15.3\% & \ib{46.2\%} & 30.8\% & 7.7\% \\ \textbf{C} & 12.5\% & 12.5\% & \ib{56.2\%} & 18.8\% \\ \textbf{C++} & 0.0\% & \ib{70.0\%*} & 30.0\% & 0.0\% \\ \textbf{C\#} & 7.7\% & \ib{53.8\%} & 30.8\% & 7.7\% \\ \textbf{Objective-C} & 0.0\% & \ib{57.1\%} & 14.3\% & 28.6\% \\ \textbf{Ruby} & 0.0\% & \ib{50.0\%} & 25.0\% & 25.0\% \\ \end{tabular}% \\ \midrule 21 & Would a summarization of opinions about APIs help you to make a better decision on which one to use? \\ & \textit{ \begin{inparaenum} \item R: \ib{I don't know 36.8\%} \item Java: \ib{I don't know 40.0\%, Yes 40.0\%} \item Python: \ib{I don't know 50.0\%} \item Javascript: \ib{I don't know 46.2\%} \item C: \ib{No 50.0\%*} \item C++: \ib{Yes 70.0\%*} \item C\#: \ib{I don't know 46.2\%*, Yes 46.2\%} \item Objective-C: \ib{Yes 57.1\%} \item Ruby: \ib{I don't know 75\%} \end{inparaenum} } \\ \midrule 22 & Opinions about an API need to be summarized because \\ & \begin{tabular}{lrrrrr} & \textbf{Too many posts} & \textbf{Opinion in missed posts} & \textbf{Missed contradictory opinion} & \textbf{Not enough time} & \textbf{Other reason} \\ \textbf{R} & 36.8\% & 57.9\% & 42.1\% & \ib{63.2\%*} & 5.3\% \\ \textbf{Java} & 80.0\% & \ib{100.0\%*} & \ib{100.0\%*} & 60.0\% & 20.0\% \\ \textbf{Python} & 50.0\% & \ib{66.7\%*} & 50.0\% & 50.0\% & 0.0\% \\ \textbf{Javascript} & 46.2\% & \ib{61.5\%*} & 46.2\% & \ib{61.5\%*} & 15.4\% \\ \textbf{C} & 25.0\% & 56.2\% & 50.0\% & 56.2\% & 6.2\% \\ \textbf{C++} & 50.0\% & 60.0\% & \ib{70.0\%*} & \ib{70.0\%*} & 20.0\% \\ \textbf{C\#} & 53.8\% & \ib{61.5\%*} & \ib{61.5\%*} & 61.5\% & 15.4\% \\ \textbf{Objective-C} & 71.4\% & \ib{85.7\%*} & 57.1\% & \ib{85.7\%*}& 14.3\% \\ \textbf{Ruby} & 25.0\% & \ib{50.0\%} & \ib{50.0\%} & 25.0\% & 0.0\% \\ \end{tabular}% \\ \midrule 23 & Opinion summarization can improve the following decision making processes \\ & SAC = Selecting amidst choices, DAR = Determining a replacement, ISF = Improving software feature, RAF = Replacing software feature, DAN = Developing a new API, FAB = Fixing a bug, SAV = Selecting API version, VAS = Validating a selection \begin{tabular}{lrrrrrrrrr} & \textbf{SAC} & \textbf{DAR} & \textbf{ISF} & \textbf{RAF} & \textbf{DAN} & \textbf{VAS} & \textbf{FAB} & \textbf{SAV} & \textbf{Other} \\ \textbf{R} & 36.8\% &\ib{42.1\%*} & 15.8\% & 26.3\% & 21.1\% & 21.1\% & 21.1\% & 26.3\% & 0.0\% \\ \textbf{Java} & \ib{80.0\%*} & 60.0\% & 0.0\% & 20.0\% & 40.0\% & 60.0\% & 80.0\% & 20.0\% & 20.0\% \\ \textbf{Python} & \ib{66.7\%*} & \ib{66.7\%*} & 50.0\% & 50.0\% & \ib{66.7\%*} & 50.0\% & 50.0\% & 33.3\% & 0.0\% \\ \textbf{Javascript} & \ib{69.2\%*} & 84.6\% & \ib{69.2\%*} & 46.2\% & 23.1\% & 46.2\% & 38.5\% & 30.8\% & 7.7\% \\ \textbf{C} & 50.0\% & \ib{56.2\%*} & 50.0\% & 31.2\% & 25.0\% & 25.0\% & 31.2\% & 25.0\% & 0.0\% \\ \textbf{C++} & \ib{90.0\%*} & 80.0\% & 40.0\% & 50.0\% & 50.0\% & 80.0\% & 20.0\% & 10.0\% & 20.0\% \\ \textbf{C\#} & \ib{84.6\%*} & 61.5\% & 53.8\% & 46.2\% & 53.8\% & 61.5\% & 46.2\% & 30.8\% & 23.1\% \\ \textbf{Objective-C} & \ib{85.7\%*} & \ib{85.7\%*} & 42.9\% & 42.9\% & 57.1\% & 57.1\% & 28.6\% & 28.6\% & 14.3\% \\ \textbf{Ruby} & \ib{75.0\%} & 50.0\% & 25.0\% & 25.0\% & 25.0\% & 0.0\% & 25.0\% & 25.0\% & 0.0\% \\ \end{tabular}% \\ \bottomrule \end{tabular}% \label{tab:rq2-sum-by-lang}% \end{table*}% \subsection{Analysis by Programming Languages}\label{sec:demographic-programming-langs} \rev{In Tables~\ref{tab:rq1-sum-by-lang} and \ref{tab:rq2-sum-by-lang}, we summarize the results of closed questions from our final survey by the nine targeted programming languages from where our survey sample was collected. We follow the same reporting principles that we discussed in Section~\ref{sec:demographic-profession}.} \rev{\addtocounter{o}{1} \vspace{1mm}\noindent\textit{\textbf{Observation \arabic{o}.}} Among the nine programming languages that we targeted in our primary survey to sample the participants of our primary survey, at least 70\% respondents from each language reported that they visit developer forums to seek information about APIs. The opinions posted about APIs in the forums are valued by those developers (100\% of all Java developers, followed by at least 78\% of the respondents from other languages).} \rev{\addtocounter{o}{1} \vspace{1mm}\noindent\textit{\textbf{Observation \arabic{o}.}} All the Java developers also report that they do not have any tools that they can currently use to analyze those opinions. The lack of such tool support is also prevalent among developers across other languages.} \rev{\addtocounter{o}{1} \vspace{1mm}\noindent\textit{\textbf{Observation \arabic{o}.}} The developers across all the programming languages (except Python and C\#) preferred most the tools that can offer summarized comparisons between APIs or show list of competing APIs. For python, the most preferred tool was an opinion miner and for C\# it was a trend analyzer.} \rev{\addtocounter{o}{1} \vspace{1mm}\noindent\textit{\textbf{Observation \arabic{o}.}} While developers prefer to explore opinions about diverse API aspects, the usability aspect was ranked the highest among the list of API aspects across all the languages except C, C++ and Javascript. For C and C++, the most pressing aspects are documentation and for Javascript it was performance.} \section{Introduction}\label{sec:introduction}} APIs (Application Programming Interfaces) offer interfaces to reusable software components. Modern-day rapid software development is often facilitated by the plethora of open-source APIs available for any given development task. The online development portal GitHub~\cite{website:github} now hosts more than 67 million public repositories. We can observe a radical increase from the 2.2 million active repositories hosted in GitHub in 2014. While many of the public repositories in GitHub may not be code-based or are personal projects, we observed similar growth in many other online API package managers. For example, we observed an increase in the number of open-source APIs shared in all the following package managers (as of July 2018) : \begin{inparaenum} \item 11,782\% for Javascript APIs in {\em npm} package manager (from 5,646 in December 2011), \item 334\% for Java APIs in online {\em maven} central (from 55,785 in March 2013), \item 2,447\% for C\# APIs in online {\em nuget} repository (from 4,799 in February 2012), \item 1,477\% for Python APIs in {\em PyPI} (from 9,362 in March 2010). \end{inparaenum} Javascript, Java, C\# and Python are among the top five most popular programming languages in Stack Overflow\footnote{We used the GitHub API and modulecounts.com to collect the statistics}. Developers can share their APIs in other package managers as well, such as {\em Bower} for Javascript, {\em Rubygems.org} for Ruby, etc. \begin{figure*} \centering \includegraphics[scale=.55]{images_new/intro-motivation.png} \caption{Example of a Stack Overflow discussion about two APIs. Green-coloured circles are comments, and red-coloured ones are answers.} \label{fig:soSentimentPosts} \end{figure*} With a myriad of APIs being available, developers now face a new challenge --- how to choose the right API. For any given task, we now expect to see multiple competing APIs. For example, in the mapping community, developers can choose from multiple web APIs, such as Google Maps APIs, Bing Maps APIs, Apple Maps APIs, MapBox, OpenLayer, etc. The selection and adoption of an API depends on a number of factors~\cite{Robillard-APIsHardtoLearn-IEEESoftware2009a}, such as the availability of learning resources, the design and usability of the API~\cite{Myers-ImprovingAPIUsability-CACM2016,Stylos-UsabilityObjectConstructor-ICSE2007a,Stylos-MakingAPIsmoreUsable-PhDThesis2009}. Developers can learn APIs by using the API official documentation. However, the official documentation can be often incomplete, obsolete, and/or incorrect~\cite{Uddin-HowAPIDocumentationFails-IEEESW2015,Robillard-FieldStudyAPILearningObstacles-SpringerEmpirical2011a}. In our previous study of more than 300 developers at IBM, we found that such problems in an API official documentation can motivate a developer to select other competing APIs. To overcome the challenge of selecting an API among available choices and properly learning it, many developers seek help and insights from other developers in online developer forums. Figure~\ref{fig:soSentimentPosts} presents the screenshot of seven Stack Overflow posts. In Figure~\ref{fig:soSentimentPosts}, the four red-coloured circles are answers \circled{1}, \circled{3}-\circled{5} and three green-coloured circles are comments \circled{2}, \circled{6}, \circled{7}. The oldest post (at the top) is dated from November 06, 2009, while the most recent one (at the bottom) is from February 10, 2016. These posts express developers' opinions about two Java APIs (Jackson~\cite{website:jackson} and Gson~\cite{website:gson}) offering JSON parsing features for Java. None of the posts contain any code snippets. The first answer \circled{1} representing a positive opinion about the Gson API motivates the developer `binaryrespawn' to use it \circled{2}. In the next answer \circled{3}, the user `StaxMan' compares Gson with Jackson, favoring Jackson for offering better support, and based on this feedback, `mickthomson' \circled{4} decides to use Jackson instead of Gson. Three out of the four answers \circled{3}--\circled{5} imply a positive sentiment towards Jackson but a negative one about Gson. Later, the developer `Daniel Winterstein' develops a new version of Gson fixing existing issues, and shares his API \circled{7}. This example illustrates how developers share their experiences and insights, as well as how they influence and are influenced by other developers' opinions. A developer looking for only code examples for Gson would have missed the important insights about the API's limitations, which may have affected his development activities. Thus, opinions extracted from the informal discussions can drive developers' decision making. \begin{figure*} \centering \hspace*{-.5cm}% \includegraphics[scale=.70]{images_new/ResearchJourneyStepsWithPhases} \caption{The major research steps undertaken during and after the two surveys reported in this paper} \label{fig:researchJourneySteps} \end{figure*} Indeed, opinions are key determinants to many of the activities related to software development, such as developers' productivity analysis~\cite{Ortu-AreBulliesMoreProductive-MSR205}, determining developers burnout~\cite{Mika-MiningValenceBurnout-MSR2016}, improving software applications~\cite{Guzman-SentimentAnalysisAppReviews-RE2014}, and developing awareness tools for software development teams~\cite{Guzman-EmotionalAwareness-FSE2013,Murgia-DoDevelopersFeelEmotion-MSR2014, Novielli-ChallengesSentimentDetectionProgrammerEcosystem-SSE2015}. Research on APIs has produced important contributions, such as automatic usage inference mining~\cite{ZimmermannZeller-eRose-TSE2006a,Michail-DataMiningLibraryReusePatternsAssociation-ICSE2000a}, automatic traceability recovery between API elements and learning resources~\cite{Dagenais-RecoDocPaper-ICSE2012a,Rigby-CodeElementInformalDocument-ICSE2013,Bacchelli-LinkEmailSourceCode-ICSE2010a}, as well as recommendation systems to facilitate code reuse~\cite{Holmes-Strathcona-TSE2006a,Ekwa-APIExplorer-ECOOP2011a} (see Section~\ref{sec:background}). However, to the best of our knowledge, there is no research that focuses on the analysis of developers' perception about API reviews and how such opinions affect their API-related decisions. As illustrated in Figure~\ref{fig:soSentimentPosts}, while developer forums serve as communication channels for discussing the implementation of the API features, they also enable the exchange of opinions or sentiments expressed on numerous APIs, their features and aspects. Given the presence of sentiments in the forum posts and opinions about APIs, such insights can be leveraged to develop techniques to automatically analyze API reviews in forum posts. Such insights can also contribute not only to the development of an empirical body of knowledge on the topic, but also to the design of tools that analyze opinion-rich information. To fill this gap in the literature, we conducted two surveys involving a total of 178 software developers. The \textit{goals} of our study are to \textit{understand} \begin{inparaenum}[(1)] \item how software developers seek and value opinions about APIs, and \item what tools can better support their analysis and evaluation of the API reviews. \end{inparaenum} The \textit{subjects} are the surveys' participants and the \textit{objects} are the API reviews that the developers encounter in their daily development activities from diverse resources. The \textit{context} consists of the various development activities that can be influenced by the API reviews. Through an exploratory analysis of the surveys' responses, we answer the following research questions: \vspace{1mm}\noindent\textbf{RQ1: How do developers seek and value opinions about APIs in developer forums?} The developers reported that they seek opinions about APIs in forum posts to support diverse development needs, such as API selection, documentation, learning how to use an API, etc. The developers valued the API reviews. However, they were also cautious while making informed decisions based on those reviews due to a number of factors related to the quality of the provided opinions, such as, the lack of insights into the prevalence of the issue reported in the opinion, the trustworthiness of the provided opinion (e.g., marketing initiatives vs subjective opinion), etc. The developers wished for the support of different mechanisms to aggregate opinions about APIs and to assess the quality of the provided opinions about APIs in the developer forums. \vspace{1mm}\noindent\textbf{RQ2: What tool support is needed to help developers with analyzing and assessing API reviews in developer forums?} The developers consider that automated tools of diverse nature can be developed and consulted to properly analyze API reviews in forum posts, e.g., visualizations of the aggregated sentiment about APIs to determine their popularity, understanding the various aspects (e.g., performance) about APIs and how other developers rate those aspects about APIs based on their usage of the APIs, etc. The developers mentioned that the huge volume of available information and opinions about APIs in the forum posts can hinder their desire to get quick, digestible, and actionable insights about APIs. The developers also mentioned that in the absence of any automated summarization technique to help them, they leverage different features in forum posts to get summarized viewpoints of the APIs, e.g., skimming through highly-ranked posts, using tags to find similar APIs, etc. Developers also envision diverse potential summarization approaches to help them address such needs, e.g., a dedicated portal to show aggregated opinions about APIs. In Figure~\ref{fig:researchJourneySteps}, we show the three major research phases we undertook during and after conducting the two surveys. \begin{description}[style=nextline] \item[Phase 1. Design, Conduct, and Report Surveys] We conducted two surveys. We analyze the survey responses using both statistical and qualitative analyses. This paper primarily focuses on the design, analysis, and reporting of the two surveys (see Sections~\ref{sec:motivation} - \ref{sec:discussion}). \item[Phase 2. Identify Actionable Insights for Tool Design] We identify requirements from the survey results to develop techniques and tools to assist developers in their exploration of opinions about APIs from developer forums. In Section~\ref{sec:research-journey}, we discuss the actionable findings from the survey results that could be used for future tool designs. \item[Phase 3. Develop and Evaluate Techniques and Tools] We develop techniques based on the findings from Phase 2. We incorporate the techniques in our prototype tool, called Opiner. Opiner is a search engine~\cite{Uddin-OpinerReviewToolDemo-ASE2017,Uddin-OpinerReviewToolDemo-ASE2017}. Using Opiner, developers can search for an API by name and explore the opinions and usage scenarios related to APIs. The opinions and usage scenarios are automatically mined from Stack Overflow. In Section~\ref{sec:research-journey}, we briefly describe Opiner. \end{description} \vspace{1mm}\noindent In this paper, we make the following main contributions: \begin{enumerate \item \textbf{Surveys.} The design of two surveys and the collected data involving the responses of 178 software engineers. \item \textbf{Analysis.} A detailed analysis of the survey responses that provides insights into: \begin{inparaenum}[(1)] \item How developers seek and analyze opinion-rich API information. \item Needs for automated tool supports to make informed, proactive, and efficient decisions based on analysis of API reviews. \end{inparaenum} \rev{In Table~\ref{tab:comparison-related-work}, we compare the major findings of this paper against the state of the art research on APIs. In Section~\ref{sec:background}, we discuss the related work in details.} \end{enumerate} \begin{table*}[t] \centering \caption{Comparison between our findings and prior findings} \begin{tabular}{p{1.8cm}p{4cm}|p{5cm}|p{6.3cm}}\toprule \textbf{Theme} & \multicolumn{1}{l}{\textbf{Our Study}} & \multicolumn{1}{l}{\textbf{Prior Study}} & \textbf{Comparison} \\ \midrule \multirow{2}{*}{\parbox{1.8cm}{\textbf{How developers learn to select and use APIs}}} & \multirow{2}{*}{\parbox{4cm}{ \begin{inparaenum}[(1)] \item Developers seek opinions to support diverse development needs, e.g., API selection, feature improvement, etc. \item Developers seek opinions to compensate for the shortcomings in API official documentation (e.g., incorrectness, etc.). \item Developers consider the combination of code examples and opinions about an API as a form of API documentation. \end{inparaenum} }} & Robillard and DeLine~\cite{Robillard-FieldStudyAPILearningObstacles-SpringerEmpirical2011a} identified in a series of survey and interviews that the most severe obstacles developers faced while learning new APIs were related to the official documentation of the APIs. & Our study confirms the findings of~\cite{Robillard-FieldStudyAPILearningObstacles-SpringerEmpirical2011a} that developers find API official documentation can be incomplete. In addition, we find that developers leverage API reviews in forums to compensate for those shortcomings. \\ \cmidrule{3-4} & & Carroll et al.~\cite{Carroll-MinimalManual-JournalHCI1987a} designed ``minimal manual'' to support task-based documentation after observing that the learning of the developers was often interrupted by their self-initiated problem-solving tasks while using API official documentation. & While Carroll et al.~\cite{Carroll-MinimalManual-JournalHCI1987a} created ``minimal manual'' manually, our results show that we can leverage developer forums to develop ``minimal manual'' by combining code examples and API reviews, because developers consider both as a form of documentation. \\ \midrule {\textbf{Sentiment analysis of software artifacts}} & (1) Developers use positive and negative opinions of other developers as an indicator of quality of the discussed API and code examples. (2) Developers face challenges to determine the quality of provided opinions (e.g., trustworthiness, recency, real-world facts, etc.). & The attributes in developer forums (e.g., upvotes, downvotes, etc.) are used to analyze the quality of posts and their roles in the Q\&A process~\cite{Calefato-SOSuccessfulAnswers-MSR2014,Bajaj-MiningQuestionsSO-MSR2014, Lal-MigratedQuestionsSO-APSEC2014,Correa-DeletedQuestionSO-WWW2014,Vasilescu-SocialQAKnowledgeSharing-CSCW2014,Kavaler-APIsUsedinAndroidMarket-SOCINFO2013}, to analyze developer profiles (e.g., personality traits of the most and low reputed users)~\cite{Bazelli-SOPersonalityTraits-ICSM2013, Ginsca-UserProfiling-DUBMOD2013}, or to determine the influence of badges in Stack Overflow~\cite{Anderson-SOBadge-WWW2013}. & Our findings show that more insights can be derived by analyzing the opinions of developers towards APIs, in addition to~\cite{Calefato-SOSuccessfulAnswers-MSR2014,Bajaj-MiningQuestionsSO-MSR2014, Lal-MigratedQuestionsSO-APSEC2014,Correa-DeletedQuestionSO-WWW2014,Vasilescu-SocialQAKnowledgeSharing-CSCW2014,Kavaler-APIsUsedinAndroidMarket-SOCINFO2013}. Our findings highlight the needs for research into the analysis of opinion quality, e.g., by gaining deeper insights into developer reputations and badges following~\cite{Bazelli-SOPersonalityTraits-ICSM2013, Ginsca-UserProfiling-DUBMOD2013,Anderson-SOBadge-WWW2013}. \\ \midrule \textbf{Analysis of APIs in developer forums} & Developers prefer to learn about different API aspects from the opinions of other developers in forum posts using automated analysis (e.g., find all opinions discussing about the performance of an API). & Zhang and Hou~\cite{Zhang-ProblematicAPIFeatures-ICPC2013} identified problematic API features in the discussion Stack Overflow posts, by detecting sentences with negative sentiments. Treude and Robillard~\cite{Treude-APIInsight-ICSE2016} mined important insights about an API type from the textual contents of Stack Overflow. & Unlike Zhang and Hou~\cite{Zhang-ProblematicAPIFeatures-ICPC2013}, our study shows that both positive and negative opinions about API features need to be identified. The insights gained for each API type by~\cite{Treude-APIInsight-ICSE2016} can be enhanced by also including the diverse opinions about API aspects. \\ \midrule \multirow{2}{*}{\parbox{1.8cm}{\textbf{Summarization of software artifacts}}} & Developers mostly rely on search engines to explore opinions about APIs. They are frequently overwhelmed with the huge volume of opinions about APIs in forums. They wished for an automatic summarizer by mining those opinions. & Topic modeling has been used to find dominant discussion topics in Stack Overflow~\cite{Barua-StackoverflowTopics-ESE2012,Rosen-MobileDeveloperSO-ESE2015}, and to find recurrent themes in API learning obstacles~\cite{Wang-DetectingAPIUsageObstacles-MSR2013}. Both natural language and structural summaries of source code have been studied extensively~\cite{Rastkar:2014,murphy:context,Holmes-Strathcona-TSE2006a, anvik:context,Sridhara-MethodSummary-ASE2010,Moreno13,McBurney14,Guerrouj15-nier,Murphy:summarization}. & Unlike~\cite{Barua-StackoverflowTopics-ESE2012,Rosen-MobileDeveloperSO-ESE2015}, our study shows that a finer grained topic-based summarization is required (e.g., using only opinions). Given the needs to analyze opinions by diverse API aspects (e.g., performance, usability), an aspect-based~\cite{Kim-OpinionSummarizerSurvey-UIUC2011} opinion summarization for APIs can be useful, which is different from source code summarization~\cite{Rastkar:2014,murphy:context,Holmes-Strathcona-TSE2006a, anvik:context,Sridhara-MethodSummary-ASE2010,Moreno13,McBurney14,Guerrouj15-nier,Murphy:summarization}.\\ \cmidrule{2-4} & Besides an opinion summarizer, developers also asked for tool support to assist in their development tasks by leveraging opinions about APIs, such as, API comparator, trend analyzer, API opinion miner, etc. & Several tools have been developed to harness knowledge about APIs from developer forums, such as automatically generating comments to explain a code example~\cite{Wong-AutoCommentSO-ASE2013}, recommending experts to answer a question in Stack Overflow~\cite{Chang-RoutingQuestionsSO-SNAM2013}, etc. & Unlike~\cite{Wong-AutoCommentSO-ASE2013,Chang-RoutingQuestionsSO-SNAM2013}, we offer insights on the usage of opinions in tool development to support development tasks. Our findings offer possible extensions to existing research, e.g., include reactions towards a code example of~\cite{Wong-AutoCommentSO-ASE2013} to show its quality. \\ \bottomrule \end{tabular}% \label{tab:comparison-related-work}% \end{table*}% \section{Primary Survey Design} \label{sec:methodology} We conducted the primary survey with a different group of software developers. Besides the three demographic questions, the primary survey contained 24 questions. In Table~\ref{tab:s2questions}, we show the questions in the order they were asked. We show how the questions from the pilot survey were asked in the primary survey in the last column of Table~\ref{tab:s2questions}. The survey was conducted using Google forms and is available for view at: \url{https://goo.gl/forms/2nPVUgBoqCcAabwj1}. {As we noted in Section~\ref{subsec:motivation-surveys}, in our primary survey, we focused on understanding how and whether developers seek and analyze API reviews in developer forums. This decision was based on the observations from our pilot survey. The participants in our pilot survey reported the developer forums as their primary sources for seeking opinions about APIs (along with co-workers). One of our major goals from the surveys is to elicit requirements for tool designs to facilitate API analysis using API reviews. Developer forums, such as Stack Overflow, can be a sharing place for co-workers as well. Moreover, the design and deployment of such tools can be better facilitated if the data is already available and shared in the forum posts.} In Table~\ref{tab:s2questions}, the horizontal lines between questions denote sections. For example, there is only one question in the first section (Q1). Once a developers responds to all the questions in a section, he is navigated to the next section. Depending on the type of the question, the next section is determined. For example, if the answer to first question (``Do you visit developer forums to seek info about APIs?'') is a `No', we did not ask him any further questions. If the answer is a `Yes', the respondent is navigated to the second question. The navigation between the sections was designed to ensure two things: \begin{inparaenum} \item that we do not ask a respondent irrelevant questions. For example, if a developer does not value the opinions of other developers, it is probably of no use asking him about his motivation for seeking opinions about APIs anyway, and \item that the response to a question is not biased by another relevant question. For example, the first question in the third section of Table~\ref{tab:s2questions} is Q4 (``What are your reasons for referring to opinions of other developers about APIs in online developer forums?''). This was an open-ended question, where the developers were asked to write their responses in a text box. A relevant question was Q18 in the sixth section (``When do you seek opinions about APIs?''). The developers were given eight options in a Likert scale (e.g., selection of an API among choices). The developers were able to answer Q18 only after they answered Q4. The developers were not allowed to return to Q4 from Q18. We adopted similar strategy for all such question pairs in the primary survey. In this way, we avoided the problem of potential bias in the developers' responses in our primary survey. \end{inparaenum} The second last column in Table~\ref{tab:s2questions} shows how the questions are mapped to the two research questions (and the sub-questions) that we intend to answer. The pilot and the primary surveys contained similar questions. The last column of Table~\ref{tab:s2questions} shows how 18 of the 24 questions in the primary survey were similar to 18 questions in the Pilot survey. While the two sets of questions are similar, in the primary survey the questions focused specifically on developer forums. For example, Q4 in the primary survey (Table~\ref{tab:s2questions}) was ``What are your reasons for referring to opinions of other developers about APIs in online developer forums?'' The similar question in the pilot survey was Q5 (Table~\ref{tbl:s1questions}): ``What are other reasons for you to refer to the opinions about APIs from other developers?'' To ensure that we capture developers' experience about API reviews properly in the primary survey, we also asked six questions that were not part of the pilot survey. The first two questions (discussed below) in the primary survey were asked to ensure that we get responses from developers who indeed seek and value opinions about APIs. The first question was ``Do you visit developer forums to seek info about APIs?''. If a developer responded with a `No' to this question, we did not ask him any further questions. We did this because \begin{inparaenum} \item developer forums are considered as the primary resource in our pilot survey and \item automated review analysis techniques can be developed to leverage the developer forums. \end{inparaenum} The second new question was about asking the participants about the top developer forums they recently visited. Such information can be useful to know which developer forums can be leveraged for such analysis. The third new question was ``Do you value the opinion of other developers in the forum posts while deciding on what API to use?''. If the response was a `no', we asked the participant only one question (24): ``Please explain why you don't value the opinion of developers in the forum posts''. We asked this question to understand the potential problems in the opinions that may be preventing them from leveraging those opinions. In Figure~\ref{fig:survey2navigation}, we show how the above two questions are used to either navigate into the rest of the survey questions or to complete the survey without asking the respondents further questions. \begin{figure} \centering \includegraphics[scale=0.90]{images_new/Survey2Navigatation.png} \caption{Navigation between sections in the primary survey.} \label{fig:survey2navigation} \end{figure} \begin{figure} \centering \includegraphics[scale=0.65]{images_new/SamplingSurvey2} \caption{Sampling of participants for the primary survey.} \label{fig:sampling-survey2} \end{figure} \begin{table*}[t] \centering \caption{Summary statistics of the primary survey population and sampled users from the population.} \resizebox{\textwidth}{!}{% \begin{tabular}{lr|r|rrr|rrr|rrrrr}\toprule & {\textbf{Total}} & {\textbf{Threads}} & \multicolumn{3}{c}{\textbf{Created}} & \multicolumn{3}{c}{\textbf{Last Active}} & \multicolumn{5}{c}{\textbf{Reputation}} \\ \cmidrule{4-14} & {\textbf{Users}} & {\textbf{Contributed}} & \textbf{2012} & \textbf{2011} & \textbf{$<=$ 2010} & \textbf{2017} & \textbf{2016} & \textbf{$<=$ 2015} & \textbf{Min} & \multicolumn{1}{r}{\textbf{Max}} & \multicolumn{1}{r}{\textbf{Median}} & \multicolumn{1}{r}{\textbf{Avg}} & \multicolumn{1}{r}{\textbf{Std}} \\ \midrule \textbf{Population} & 88,021 & 3,233,131 & 16,080 & 26,257 & 45,684 & 40,780 & 10,409 & 36,832 & 1 & 627,850 & 159 & 1,866.5 & 10,169.1 \\ \textbf{Sample} & 900 & 772,760 & 47 & 151 & 702 & 900 & 0 & 0 & 5,471 & 627,850 & 18,433.5 & 43,311.22 & 66,738 \\ \bottomrule \end{tabular}% } \label{tbl:s2summarystats}% \end{table*}% \subsection{Participants} We targeted developers that participated in the Stack Overflow forum posts (e.g., asked a question or provided an answer to a question in Stack Overflow). Out of a total of 720 invitations sent, we received 114 responses (response rate 15.8\%). Among those, 72.8\% responded that they visit developers forums and they value the opinion of other developers in the forums. The distribution of the profession of those participants is: \begin{inparaenum} \item Software developers 79.5\%, \item Tech/Team Lead 13.3\%, \item Research Engineer 3.6\%, \item Student 3.6\%, and \item Other 1.2\% \end{inparaenum}. The distribution of experience of the participants is: \begin{inparaenum} \item 10+ years 56.6\%, \item Seven to 10 years 28.9\%, and \item Three to six years 14.5\%. \end{inparaenum} To report the experience, the developers were given five options to choose from (following Treude et al.~\cite{Treude-SummarizingDevelopmentActivity-FSE2015}): \begin{inparaenum} \item less than 1 year, \item 1 to 2 years, \item 3 to 6 years, \item 7 to 10 years, and \item 10+ years. \end{inparaenum} None of the respondents reported to have software development experience of less than three years. Therefore, we received responses from experienced developers in our primary survey. 97.6\% of them were actively involved in software development. \subsubsection{Sampling Strategy} To recruit the participants for an empirical study in software engineering, Kitchenham et al.~\cite{Kitchenham-GuidelinesEmpiricalResearchSE-TSE2002} offered two recommendations: \begin{description} \item[Population] \emt{Identify the population from which the subjects and objects are drawn}, and \item[Process]\emt{Define the process by which the subjects and objects were selected}. \end{description} We followed both of the two suggestions to recruit the participants for our primary survey (discussed below). The contact information of users in Stack Overflow is kept hidden from the public to ensure that the users are not spammed. Vasilescu et al.~\cite{Vasilescu-AssociationSOGithub-SocialCom2013} correlated the user email hash from Stack Overflow to those in GitHub. To ensure that the mining of such personal information is not criticized by the Stack Overflow community in general, Bogdan Vasilescu started a question in Stack Overflow with the theme, which attracted a considerable number of developers from the Stack Overflow community in 2012~\cite{website:stackoverflow-q135104}. The purpose of Vasilescu et al.~\cite{Vasilescu-AssociationSOGithub-SocialCom2013} was to see how many of the Stack Overflow users are also active in GitHub. In August of 2012, they found 1,295,623 Stack Overflow users. They cross-matched 93,772 of those users in GitHub. For each of those matched users in GitHub, they confirmed their email addresses by mapping their email hash in Stack Overflow to their email addresses as they shared in GitHub. Each user record in their dataset contains three fields: \begin{inparaenum}[(1)] \item UnifiedId: a unique identifier for each record (an auto-incremental integer), \item GitHubEmail: the email address of the user as posted in GitHub, \item SOUserId: the ID of the user in Stack Overflow. \end{inparaenum} We used this list of 93,772 users as the \textit{potential population source} of the primary survey. In our survey invitation, we were careful not to spam the developers. For example, we only sent emails to them twice (the second time as a reminder). In addition, we followed the Canadian Anti-Spam rules~\cite{website:canad-antispam} while sending the emails, by offering each email recipient the option to `opt-out' from our invitation. We did not send the second, i.e., reminder email to the users who decided to opt-out. \vspace{1mm}\noindent We sampled 900 users from the 93,772 users as follows (Figure~\ref{fig:sampling-survey2}): \begin{enumerate}[leftmargin=10pt \item \textbf{Match:} Out of the 93,772 users in the list of Vasilescu et al.~\cite{Vasilescu-AssociationSOGithub-SocialCom2013}, we found 92,276 of them in the Stack Overflow dataset of March 2017. We cross-linked the user `ID' in the Stack Overflow dataset to the `SOUserId' field in the dataset of Vasilescu et al.~\cite{Vasilescu-AssociationSOGithub-SocialCom2013} to find the users. For each user, we collected the following information: \begin{inparaenum}[(1)] \item Name, \item Reputation\footnote{The reputation of a user in Stack Overflow is based on the votes from other developers}, \item User creation date, and \item Last accessed date in Stack Overflow. \end{inparaenum} \item \textbf{Discard:} Out of the 92,276 users, we discarded 4,255 users whose email addresses were also found in the list of 4,500 GitHub users that we used to sample the 2,500 GitHub users for the pilot survey. Thus, the size of the target population in our primary survey was 88,021. \item \textbf{Tag:} For each user out of the population (88,021), we then searched for the posts in the Stack Overflow data dump of 2017 where he has contributed by either asking the question or answering the question. For each user, we created a user tag frequency table as follows: \begin{inparaenum} \item For each post contributed by the user, we collected the id of the thread of the post. \item For each thread, we collected the list of tags assigned to it. We put all those tags in the tag frequency table of the user. \item We computed the occurrence of each tag in the tag frequency table of the user \item We ranked the tags based on frequency, i.e., the tag with the highest occurrence in the table was put at the top. \end{inparaenum} \item \textbf{Programming Languages:} We assigned each user to one of the following nine programming languages:\begin{inparaenum}[(1)] \item Javascript, \item Java, \item C\#, \item Python, \item C++, \item Ruby, \item Objective-C, \item C, and \item R. \end{inparaenum} {The nine programming languages are among the top 10 programming languages in Stack Overflow, based on the number of questions tagged as languages. In our survey population, we observed that more than 95\% of the users tagged at least one of the languages in the Stack Overflow posts.} We assigned a user to a language, if the language had the highest occurrence among the nine languages in the user frequency table of the user. If a user did not have any tag resembling any of the nine languages, we did not include him/her in the sample. \item \textbf{Ranking of Users.} For each language, we ranked the users by reputation and activity date, i.e., first by reputation and then if two users had the same reputation, we put the one at the top between the two, who was active more recently. \item \textbf{Create sample} For each language, we picked the top 100 users. For each user, we created a personalized email and sent him/her the survey invite. \end{enumerate} In Table~\ref{tbl:s2summarystats}, we show the summary statistics of the primary survey population and the sampled users. The 88,021 users contributed to more than 3.2M threads. As of September 2017, Stack Overflow hosts 14.6M threads and 7.8M users. Thus, the users in the population corresponds to 0.012\% of all the users in Stack Overflow, but they contributed to 22.1\% of all threads in Stack Overflow. \rev{All of the 900 users were active in Stack Overflow as early as 2017, even though most of them first created their account in Stack Overflow on or before 2010. Moreover, each of the sampled users was highly regarded in the Stack Overflow community, if we take their reputation in the forum as a metric for that -- the minimum reputation was 5,471 and the maximum reputation was 627,850, with a median of 18,434. Therefore, we could expect that the answers from these users would ensure informed insights about the needs for opinions in reviews about APIs posted in Stack Overflow.} \begin{figure*}[t] \centering \includegraphics[scale=0.50]{images_new/s2Snapshot2.png} \caption{Snapshots of the primary survey email and responses} \label{fig:response-snapshot-survey2} \end{figure*} \subsubsection{Participation Engagement} While targeting the right population is paramount for a survey, convincing the population to respond to the survey is a non-trivial task. As Kitchenham et al.~\cite{Kitchenham-GuidelinesEmpiricalResearchSE-TSE2002} and Smith et al.~\cite{Smith-DeveloperParticipationSurvey-Chase2013} noted, it is necessary to consider the contextual nature of the daily activities of software developers while inviting them to the survey. While sending the survey invitations, we followed the suggestions of Smith et al.~\cite{Smith-DeveloperParticipationSurvey-Chase2013} who reported their experience on three surveys conducted at Microsoft. Specifically, we followed five suggestions, two related to \textit{persuasion} (Liking, Authority and credibility) and three related to \textit{social factors} (Social benefit, compensation value, and timing). \begin{description} \item[Liking.] Nisbett and Wilson~\cite{Nisbett-HaloEffect-PSP1977} explained the cognitive bias \textit{halo effect} that people are \textit{more likely to comply with a request from a person they have positive affect afterwards}~\cite{Smith-DeveloperParticipationSurvey-Chase2013}. Their advice to leverage the positive affection is to communicate with the people in the study by their name. For our survey, we created a personalized email for each user by \begin{inparaenum}[(i)] \item addressing the developer by his name in the email, and \item including the reputation of the developer in the email. \end{inparaenum} In Figure~\ref{fig:response-snapshot-survey2}, we show a screenshot of an email sent to one of the users \circled{1}. \item[Authority and credibility.] Smith et al.~\cite{Smith-DeveloperParticipationSurvey-Chase2013} pointed out that the \emph{``compliance rates rise with the authority and credibility of the persuader''}. To ensure that the developers considered our survey as authentic and credible, we highlighted the nature of the research in both the email and the survey front page. We also cited that the survey was governed by the formal Ethics Approval from McGill University and that the reporting to the survey would be anonymized. \item [Social Benefit.] Edwards found that participants are more likely to respond to survey requests from universities~\cite{Edwards-IncreasingResponseRatesPostal-BMJ2002}. The reason is that, participants may be more likely to respond to a survey if they know that their response would not be used for commercial benefits, rather it will be used to benefit the society (e.g., through research). We contacted the survey participants using the academic emails of all the authors of the paper. We also mentioned in the email that the survey is conducted as a PhD research of the first author, and stressed on the fact that the survey was not used for any commercial purpose. \item [Compensation value.] Smith et al.~\cite{Smith-DeveloperParticipationSurvey-Chase2013} observed in the surveys conducted at Microsoft that people will likely comply with a survey request if they owe the requester a favor. Such reciprocity can be induced by providing an incentive, such as a gift card. Previous research showed that this technique alone can double the participation rate~\cite{James-SurveyMonetaryIncentives-PublicOpinion1992}. In our primary survey, we offered a 50 USD Amazon Gift card to one of the randomly selected participants. \item [Timing.] As Smith et al.~\cite{Smith-DeveloperParticipationSurvey-Chase2013} experienced, the time when a survey invitation is sent to the developers, can directly impact their likelihood of responding to the email. They advise to avoid sending the survey invitation emails during the following times: \begin{inparaenum} \item Monday mornings (when developers just quickly want to skim through their emails) \item Most likely out of office days (Mondays, Fridays, December month). \end{inparaenum} We sent the survey invitations only on the three other weekdays (Tuesday-Thursday). We conducted the survey in August 2017. \end{description} Out of the 900 emails we sent to the sampled users, around 150 bounced back for various reasons (e.g., old or unreachable email). Around 30 users requested by email that they would not want to participate in the survey. Therefore, the final number of emails sent \textit{successfully} was 720. We note that the email list compiled by Vasilescu et al.~\cite{Vasilescu-AssociationSOGithub-SocialCom2013} is from 2013. Therefore, it may happen that not all of the 720 email recipients may have been using those email addresses any more. Previously, Treude et al.~\cite{Treude-SummarizingDevelopmentActivity-FSE2015} reported a response rate of 7.8\% for a survey conducted with the Github developers. Our response rate (15.8\%) is more than the response rate of Treude et al.~\cite{Treude-SummarizingDevelopmentActivity-FSE2015}. \subsection{Survey Data Analysis} We analyzed the primary survey data using the same statistical and qualitative approaches we applied in the pilot survey. We created a total of 947 quotes from the responses to the open-ended questions. We created quotes from each response as follows: \begin{inparaenum} \item We divided it into sentences. \item We further divided each sentence into individual clauses. We used semi-colon as a separator between two clauses. Each clause was considered a quote. \end{inparaenum} Two coders analyzed the quotes. The first author was the first coder. The second coder was selected as a senior software engineer working in the Industry in Ottawa, Canada. The second coder is not an author of this manuscript. The two coders together coded eight of the nine open-ended questions (Q4-Q7, Q11-Q14 in Table~\ref{tab:s2questions}). The other open-ended question was Q24 (``explain why you don't value the opinion of other developers \ldots''). Only 10 participants responded to that question, resulting in 17 quotes. The first coder labelled all of those. In Table~\ref{tab:agreementc1c2Fors2}, we show the agreement level between the two coders for the eight open-ended questions. The last row in Table~\ref{tab:agreementc1c2Fors2} shows the number of quotes for each of the questions. To compute the agreement between the coders, we used the online recal2 calculator~\cite{recal}. The calculator reports the agreement using four measures: \begin{inparaenum} \item Percent agreement, \item Cohen $\kappa$~\cite{Cohen-Kappa-EducationalPsy1960}, \item Scott's Pi~\cite{Scott-Pi-PublicOpinion1955}, and \item Krippendorff's $\alpha$~\cite{Krippendorff-Alpha-HumanCommunications2004} \end{inparaenum} The Scott's pi is extended to more than two coders in Fleiss' $\kappa$. Unlike Cohen $\kappa$, in Scott's Pi the coders have the same distribution of responses. The Krippendorff's $\alpha$ is more sensitive to bias introduced by a coder, and is recommended over Cohen $\kappa$~\cite{website:joyce-pickingbeststats-2013}. The agreement (Cohen $\kappa$) between the coders is above 0.75 for all questions except Q7. For Q7, the agreement is above the substantial level~\cite{Viera-KappaInterpretation-FamilyMed2005}. \begin{table}[t] \centering \caption{The agreement level between the coders in the open coding.} \begin{tabular}{lrrrrrrrr}\toprule & \multicolumn{1}{l}{\textbf{Q4}} & \multicolumn{1}{l}{\textbf{Q5}} & \multicolumn{1}{l}{\textbf{Q6}} & \multicolumn{1}{l}{\textbf{Q7}} & \multicolumn{1}{l}{\textbf{Q11}} & \multicolumn{1}{l}{\textbf{Q12}} & \multicolumn{1}{l}{\textbf{Q13}} & \multicolumn{1}{l}{\textbf{Q14}} \\ \midrule Percent & 98.9 & 98.6 & 99.0 & 96.4 & 98.9 & 98.4 & 100 & 100 \\ Cohen $\kappa$ & 0.90 & 0.76 & 0.80 & 0.66 & 0.80 & 0.75 & 1 & 1 \\ Scott $\pi$ & 0.90 & 0.77 & 0.80 & 0.67 & 0.81 & 0.76 & 1 & 1 \\ Krippen $\alpha$ & 0.90 & 0.77 & 0.80 & 0.67 & 0.81 & 0.76 & 1 & 1 \\ \midrule \textbf{Quotes} & 112 & 104 & 112 & 121 & 150 & 122 & 101 & 108 \\ \bottomrule \end{tabular}% \label{tab:agreementc1c2Fors2}% \end{table}% \section{Research Context} \label{sec:motivation} We further motivate the needs for better understanding of the impact of opinions about APIs on the developers first by taking cues from other domains (Section~\ref{subsec:motivation-other-domains}) and then by demonstrating the prevalence of opinions about APIs in Stack Overflow based on small study in Section~\ref{subsec:study-prevalence-opinions}. We discuss the rationale behind each research question, along with its sub-questions in Sections~\ref{subsec:rq1} and \ref{subsec:rq2}. We then discuss the motivation behind the two surveys we conducted to answer the research questions (Section~\ref{subsec:motivation-surveys}). \subsection{Opinion Analysis in Other Domains}\label{subsec:motivation-other-domains} Our research on API reviews was motivated by similar research in the other domains. Automated sentiment analysis and opinion mining about entities (e.g., cars, camera products, hotels, restaurants) have been challenging but a practical research area due to their benefits for consumers (e.g., guiding them in choosing a hotel or selecting a camera product). In Figure~\ref{fig:opiniontools-camera}, we show the screenshot of three separate initiatives on the automatic collection and aggregation of reviews about camera products. The first two tools are developed in the academia and the third tool was developed as part of Microsoft's Bing Product Search. The first two circles \circled{1} and \circled{2}, show two preliminary outlines of such a tool presented by Liu et al.~\cite{liu-sentimentanalysis-handbookchapter-2010}. The third circle \circled{3} shows a similar tool in the Microsoft Bing Product Search. In all of the three tools, positive and negative opinions about a camera product are collected and aggregated under a number of aspects (e.g., picture quality, battery life, etc.). When no predefined aspect is found, the opinions are categorized under a generic aspect ``GENERAL'' (aspect is named as ``feature'' in \circled{2}). The opinions about the camera can be collected from diverse sources, e.g., online product reviews, sites selling the product, etc. For example, Google collects reviews about hotels and restaurants through a separate gadget in its online search engine. \subsection{API Reviews in Developer Forums}\label{subsec:study-prevalence-opinions} \rev{Similar to the camera reviews in Figure~\ref{fig:opiniontools-camera}, API reviews can be found in forum posts. As we demonstrated in Figure~\ref{fig:soSentimentPosts}, opinions about APIs can be prevalent in developer forums. In fact, we observed that more than 66\% of posts that are tagged ``Java'' and ``JSON'' in the Stack Overflow data contain at least one positive or negative sentiment\footnote{We used sentiment detection algorithm we developed in~\cite{Uddin-OpinionValue-TSE2018} on the Stack Overflow 2014 data dump}. In Table~\ref{tbl:datasets-overview} we show descriptive statistics of the dataset. There were 22,733 posts from 3,048 threads with scores greater than zero. We did not consider any post with a negative score because such posts are considered as not helpful by the developers in Stack Overflow. The last column ``Users'' show the total number of distinct users that posted at least one answer/comment/question in those threads. To identify uniqueness of a user, we used the user\_id as found in the Stack Overflow database. On average, around four users participated in one thread, and more than one user participated in 2,940 threads (96.4\%), and a maximum of 56 distinct users participated in one thread~\cite{website:stackoverflow-338586}. From this corpus, we identified the Java APIs that were mentioned in the posts. To identify the Java APIs, we used our API database.} \rev{Our API database consists of the Java official APIs and the Java APIs listed in the two software portals Ohloh~\cite{website:ohloh} and Maven central.~\cite{website:maven-central}\footnote{\scriptsize We crawled Maven in March 2014 and Ohloh in December 2013.} We crawled the Javadocs of five official Java APIs (SE 6-8, and EE 6,7) and collected information about 875 packages and 15,663 types. We consider an official Java package as an API in the absence of any guidelines available to consider otherwise. In total, our API database contains 62,444 distinct Java APIs. All of the APIs (11,576) hosted in Maven central are for Java. From Ohloh, we only included the Java APIs (50,863) out of the total crawled (712,663). We considered a project in Ohloh as a Java API if its main programming language was Java.} \rev{We collected the opinionated sentences about APIs using a technique we developed in~\cite{Uddin-OpinionMining-TSE2018}. The technique works as follows: \begin{enumerate}[leftmargin=10pt] \item \textbf{Load and preprocess} Stack Overflow posts. \item \textbf{Detect opinionated sentences} using a rule-based algorithm. The algorithm is an adaptation of the Domain Sentiment Orientation (DSO)~\cite{Hu-MiningSummarizingCustomerReviews-KDD2004} algorithm for software engineering. Similar adaptation of the algorithm was previously reported by Blair-Goldensohn et al.~\cite{BlairGoldensohn-SentimentSummarizerLocalReviews-NLPIX2008} for Google local product reviews. The algorithm computes sentiment score of each sentence by detecting positive and negative sentiment words in the sentence. \item \textbf{Detection of API names} in the forum texts and hyperlinks based a set of heuristics (e.g., exact and fuzzy matching) and \item \textbf{Association of APIs to opinionated sentences} using heuristics, e.g., proximity between API names and opinionated sentences. \end{enumerate}} \begin{table}[tbp] \centering \scriptsize \caption{Statistics of the dataset (A = Answers, C = Comments).} \centering \begin{tabular}{rrrr|rr|r}\toprule \textbf{Threads} & \textbf{Posts} & \textbf{A} & \textbf{C} & \textbf{Sentences} & \textbf{Words} & \textbf{Users} \\ \midrule 3048 & 22.7K & 5.9K & 13.8K & 87K & 1.08M & 7.5K \\ \midrule \textbf{Average} & 7.46 & 1.93 & 4.53 & 28.55 & 353.36 & 3.92 \\ \bottomrule \end{tabular} \label{tbl:datasets-overview} \end{table} \rev{In Table~\ref{tbl:opinionated-sentence-dataset}, we present summary statistics of the opinionated sentences detected in the dataset. Overall 415 distinct APIs were found. While the average number of opinionated sentences per API was 37.66, it was 2,066 for the top five most reviewed APIs. In fact, the top five APIs contained 66.1\% of all the opinionated sentences in the posts. These APIs are \api{jackson}, \api{Google Gson}, \api{spring framework}, \api{jersey}, and \api{org.json}.} \begin{table}[tbp] \centering \scriptsize \caption{Distribution of opinionated sentences across APIs.} \begin{tabular}{rrrr|rrr}\toprule \multicolumn{ 4}{c}{\textbf{Overall}} & \multicolumn{ 3}{c}{\textbf{Top Five}} \\ \midrule \textbf{API} & \textbf{Total} & \textbf{+Pos} & \textbf{--Neg} & \textbf{Total} & \textbf{+Pos} & \textbf{--Neg} \\ \midrule 415 & 15,627 & 10,055 & 5,572 & 10,330 & 6,687 & 3,643 \\ \midrule \multicolumn{1}{l}{\textbf{Average}} & 37.66 & 24.23 & 13.43 & 2,066 & 1,337.40 & 728.60 \\ \bottomrule \end{tabular} \label{tbl:opinionated-sentence-dataset} \end{table} \begin{table*}[t] \centering \caption{The formulation of the research questions in the study.} \begin{tabular}{r|r|l}\toprule \multicolumn{1}{l}{\textbf{RQ1}} & \multicolumn{2}{l}{\textbf{How do developers seek and value opinions about APIs?}} \\ \midrule \textbf{1.1} & \multicolumn{2}{l}{\textit{\textbf{ Theme - Opinion Needs: How do developers seek opinions about APIs?}}} \\ \cmidrule{2-3} & \textbf{1.1.a} & \textit{Where do developers seek opinions?} \\ & \textbf{1.1.b} & \textit{What motivates developers to seek opinions about APIs?} \\ & \textbf{1.1.c} & \textit{What challenges do developers face while seeking API reviews?} \\ \cmidrule{2-3} \textbf{1.2} & \multicolumn{2}{l}{\textit{\textbf{Theme - Opinion Quality: How do developers assess the quality of the provided opinions about APIs?}}} \\ \midrule \multicolumn{1}{l}{\textbf{RQ2}} & \multicolumn{2}{l}{\textbf{How can the support for automated processing of opinions assist developers to analyze API reviews?}} \\ \midrule \textbf{2.1} & \multicolumn{2}{p{44.55em}}{\textit{\textbf{Theme - Tool Support: What tool support is needed to help developers to assess API reviews?}}} \\ \cmidrule{2-3} \textbf{2.2} & \multicolumn{2}{p{44.55em}}{\textit{\textbf{Theme - Summarization Needs: What are the developers' needs for summarization of API reviews?}}} \\ \cmidrule{2-3} & \textbf{2.2.a} & \textit{What problems in API reviews motivate the need for summarization?} \\ & \textbf{2.2.b} & \textit{How summarization of API reviews can support developer decision making?} \\ & \textbf{2.2.c} & \textit{How do developers expect API reviews to be summarized?} \\ \bottomrule \end{tabular}% \label{tab:rqs}% \end{table*}% \subsection{Reasons for Seeking Opinions About APIs (RQ1)}\label{subsec:rq1} We aim to understand how and why developers seek and analyze such opinions about APIs and how such information can shape their perception and usage of APIs. The first goal of our study is to learn how developers seek and value the opinions of other developers. \subsubsection{Motivation} By analyzing how and why developers seek opinions about APIs, we can gain insights into the role of API reviews in the daily development activities of software developers. The first step towards understanding the developers needs, is to learn about the resources they currently leverage to seek information and opinions about APIs. The developers may use diverse resources to seek opinions about APIs. If a certain resource is used more than other resources, the analysis of the resource can be given more priority over others. \rev{As we noted in Section~\ref{subsec:study-prevalence-opinions}, our observation of the API reviews shows that opinions about APIs are shared in the developer forums.} Therefore, an understanding of how the different development activities can be influenced and supported through the API reviews can provide us with insights about the factors that motivate developers to seek opinions as well as the challenges that they may face during this process. By learning about these challenges while seeking reviews about APIs, we can gain insights into the complexity of the problem that needs to be addressed to assist developers in their exploration of API reviews. Finally, opinions are by themselves \textit{subjective}, i.e., opinions about APIs stem from the personal belief or experience of the developers who use the APIs. Therefore, developers may face challenges while assessing the validity of claims by other developers. By analyzing what factors can hinder and support the developers' assessment of the quality of the provided API reviews, we can gain insights into the challenges developers face while leveraging the API reviews. \subsubsection{Approach} We examine developer needs for API reviews via the following questions: \begin{itemize} \item RQ1.1: How do developers seek opinions about APIs? \item RQ1.2: How do developers assess the quality of the provided opinion? \end{itemize} To exhaustively answer these questions, we further divide RQ1.1 into three sub-questions: \begin{itemize} \item {\textit{RQ1.1.a: Where do developers seek opinions about APIs?}} \item {\textit{RQ1.1.b: What motivates developers to seek opinions?}} \item {\textit{RQ1.1.c: What challenges do developers face while seeking for opinions?}} \end{itemize} \subsection{Tool Support to Analyze API Reviews (RQ2)} \label{subsec:rq2} The second goal of our study is to understand the needs for tool support to facilitate automated analysis of API reviews. \subsubsection{Motivation} To understand whether developer needs any tools to analyze API reviews, we first need to understand what tools developers may be using currently to analyze the reviews and what problems they may be facing. Such analysis can offer insights into how research in this direction can offer benefits to the developers through future prototypes and tool supports. A predominant direction in the automated processing of reviews in other domains (e.g., cars, cameras, products) is to summarize the reviews. For the domain of API reviews, it can also help to know how developers determine the needs for opinion summarization about APIs. The first step is to determine the feasibility of the existing cross-domain opinion summarization techniques to the domain of API reviews. Such analysis can provide insights into how the summarization approaches adopted in other domains can be applicable to the domain of API reviews. By learning about the specific development needs that can be better supported though the summarization of API reviews, we can gain insights into the potential use cases API review summaries can support. By understanding how developers expect to see summaries of API reviews, we can gain insights into whether and how different summarization techniques can be designed and developed for the domain of API reviews. It is, thus, necessary to know what specific problems in the API reviews should be summarized and whether priority should be given to one API aspect over another. \subsubsection{Approach} We pose two research questions to understand the needs for tool support to analyze API reviews: \begin{itemize} \item RQ2.1: What tool support is needed to help developers with analyzing and assessing API-related opinions? \item RQ2.2: What are the developers' needs for summarization of opinion-rich information? \end{itemize} To answer these two questions exhaustively, we further divide RQ2.2 into three sub-questions: \begin{itemize} \item {\textit{RQ2.2.a: What problems in API reviews motivate the needs for summarization? }} \item {\textit{RQ2.2.b: How can summarization of API reviews support the developer's decision making processes? }} \item {\textit{RQ2.2.c: How do developers expect API reviews to be summarized? }} \end{itemize} \subsection{The Surveys}\label{subsec:motivation-surveys} We learn about the developer needs for API reviews and tool support for analyzing the reviews through two surveys. We conducted the first survey as a pilot survey and the second as the primary one. The purpose of the pilot survey is to identify and correct potential ambiguities in the design of the primary survey. Both the pilot and the primary surveys share the same goals. However, the questions of the primary survey are refined and made more focused based on the findings of the pilot survey. For example, in the pilot survey, we mainly focused on the GitHub developers. \rev{We picked GitHub for our pilot survey, because previous research shows that GitHub developers use third-party APIs (e.g., open source APIs) and would like to stay aware of changes in APIs in their development tasks to become remain productive~\cite{Treude-SummarizingDevelopmentActivity-FSE2015}. We focused on open source community because open source development is embraced by both individual developers as well as big and small companies (both as contributors to API development as well API usage). In addition, due to the openness, the community may also be more reliant on developer forums to inform choices. Such interactions can be visible to any other developers for further analysis (e.g., during their decision making about an API). This offers us access to diverse viewpoints (i.e., opinions) of developers on APIs that may be used in diverse development needs and contexts.} We found that most of the respondents in our pilot survey considered the developer forums (e.g., Stack Overflow) as the primary source of opinions about APIs. Therefore, in the primary survey, our focus was to understand how developers seek and analyze opinions in developer forums. Stack Overflow is arguably the most popular online forums to share and discuss code and opinions about open-source APIs. Therefore, in our primary survey, we picked developers who are actively involved in the discussions of Stack Overflow posts. In Section~\ref{sec:pilot-survey}, we discuss the design and the summary of results of the pilot survey. In Sections~\ref{sec:methodology} and \ref{sec:results}, we discuss the design and detailed results of the primary survey. \section*{Acknowledgements} We thank all developers who took part in our survey for their time, participation, and feedback, and Lalit Azad who participated in the open-coding of the primary survey. \bibliographystyle{IEEEtran} \section{The Pilot Survey}\label{sec:pilot-survey} The pilot survey consisted of 24 questions: three demographic questions, eight multiple-choice, five Likert-scale questions, and eight open-ended questions. In Table~\ref{tbl:s1questions}, we show all the questions of the pilot survey (except the demographic questions) in the order they appeared in the survey questionnaires. The demographic questions concern the participants role (e.g., software developer or engineer, project manager or lead, QA or testing engineer, other), whether they are actively involved in software development or not, and their experience in software development (e.g., less than 1 year, more than 10 years, etc.). The survey was hosted in Google forms and can be viewed at \url{https://goo.gl/forms/8X5jKDKilkfWZT372}. \subsection{Pilot Survey Participants} We sent the pilot survey invitations to 2,500 GitHub users. The 2,500 users were randomly sampled from 4,500 users from GitHub. {The 4,500 users were collected using the GitHub API. The GitHub API returns GitHub users starting with an ID of 1. We stopped calling the API after it returned the first 4,500 users.} From the number of emails sent to GitHub users, 70 emails were bounced back for various reasons, e.g., invalid (domain expired) or non-existent email addresses, making it 2,430 emails being actually delivered. A few users emailed us saying that they were not interested in participating due to the lack of any incentives. Finally, a total of 55 developers responded. In addition, we sent the invitation to 11 developers in a software development company in Ottawa, Canada. The company was selected based on a personal contact we had within the company. The company was involved in multiple different software projects involving open-source APIs. Out of the 11, nine responded. Among the GitHub participants: \begin{enumerate} \item 78\% of respondents said that they are software developers (11\% are project managers and 11\% belong to ``other'' category), \item 92\% are actively involved in software development, and \item 64\% have more than 10 years of software development experience, 13\% of them have between 7 and 10 years of experience, 9\% between 3 to 6 years, 8\% between 1 to 2 years and around 6\% less than 1 year of experience. \end{enumerate} Among the nine Industrial participants, three were team leads and six were professional developers. All nine participants were actively involved in software development. The nine participants had professional development experience between five to more than 10 years. \begin{table*}[h] \vspace{-3mm} \centering \caption{Pilot survey questions with key highlights from responses. Subscript with a question number shows number of responses.} \vspace{-2mm} \resizebox{\textwidth}{!}{% \begin{tabular}{r|p{17cm}}\toprule \textbf{RQ1.1} & \textbf{Opinion Needs} \\ \midrule 1$_{60}$ & Do you value opinion of other developer when deciding on what API to use? \textit{(yes / no)} \\ & \ib{\begin{inparaenum} \item Yes 95\%, \item No 5\% \end{inparaenum} } \\ \cmidrule{2-2} 2$_{60}$ & Where do you seek help/opinions about APIs? \textit{(five sources and others)} \\ & \ib{\begin{inparaenum} \item Developer Forums 83.3\%, \item Co-worker 83.3\%, \item Mailing List 33.3\%, \item IRC 26.7\%, \item Others 35\% \end{inparaenum}} \\ \cmidrule{2-2} 3$_{60}$ & How often do you refer to online forums (e.g, Stack Overflow) to get information about APIs? \textit{(five options)} \\ & \ib{\begin{inparaenum} \item Every day 23.3\%, \item Two/three times a week 36.7\%, \item Once a month 25\%, \item Once a week 10\%, \item Never 5\% \end{inparaenum}} \\ \cmidrule{2-2} 4$_{60}$ & When do you seek opinions about APIs? \textit{(5-point Likert scale for each option)} \\ & \ib{ \begin{inparaenum} \item Select among choices 83.3\%, \item Select API version 18.3\%, \item Improve a feature 61.7\%, \item Fix bug 63.3\%, \item Determine a replacement 73.3\%, \item Validate a selection 45\%, \item Develop a competing API 58.3\%, \item Replace an API feature 51.7\% \end{inparaenum} } \\ \cmidrule{2-2} 5$_{21}$ & What are other reasons of you referring to the opinions about APIs from other developers? \textit{(text box)} \\ & \ib{ \begin{inparaenum} \item Opinion trustworthiness analysis 18.8\% \item API usage 15.6\%, \item API suitability 15.6\%, \item API maturity 6.3\%, \item Usability analysis 6.3\% \end{inparaenum} } \\ \cmidrule{2-2} 6$_{28}$ & What is your biggest challenge while seeking opinions about an API? \textit{(text box)} \\ & \ib{ \begin{inparaenum} \item Trustworthiness analysis 19.4\% \item Too much info 16.1\%, \item Biased opinion 12.9\%, \item Documentation 9.7\%, \item Staying aware 6.5\% \end{inparaenum} } \\ \cmidrule{2-2} \textbf{RQ1.2} & \textbf{Opinion Quality} \\ \midrule 20$_{60}$ & How do you determine the quality of a provided opinion in a forum post? (e.g., Stack Overflow) \textit{(seven options)} \\ & \ib{\begin{inparaenum} \item Date 55\%, \item Votes 66.7\%, \item Supporting links 70\%, \item User profile 45\%, \item Code presence 73.3\%, \item Post length 16.7\%, \item Others 1.7\% \end{inparaenum}} \\ \cmidrule{2-2} 21$_{15}$ & What other factors in a forum post can help you determine the quality of a provided opinion? \textit{(text box)} \\ & \ib{ \begin{inparaenum} \item Documentation 63.3\%, \item Expertise 10.5\%, \item Trustworthiness 10.5\%, \item Situational relevance 10.5\%, \item Biased opinion 5.3\% \end{inparaenum} } \\ \cmidrule{2-2} \textbf{RQ2.1} & \textbf{Tool Support} \\ \midrule 7$_{60}$ & What tools can better support your understanding of opinions about APIs in online forum discussions? \textit{(5-point Likert scale for each option)} \\ & \ib{ \begin{inparaenum} \item Opinion mine \& summarize 68.3\%, \item Sentiment mine 45\%, \item Comparator analyze 73.3\%, \item Trends 56.7\%, \item Co-mentioned APIs 76.7\% \end{inparaenum} } \\ \cmidrule{2-2} 8$_{17}$ & What other tools can help your understanding of opinions about APIs in online forum discussions? \textit{(text box)}\\ & \ib{ \begin{inparaenum} \item Reasoning 18.2\%, \item Extractive summaries 18.2\%, \item Dependency info 12.1\%, \item Documentation 9.1\%, \item Expertise find 9.1\% \end{inparaenum} } \\ \cmidrule{2-2} \textbf{RQ2.2} & \textbf{Summarization Needs} \\ \midrule 9$_{60}$ & How often do you feel overwhelmed due to the abundance of opinions about an API? \textit{(four options)} \\ & \ib{\begin{inparaenum} \item Every time 5\%, \item Some time 48.3\%, \item Rarely 33.3\%, \item Never 13.3\% \end{inparaenum}} \\ \cmidrule{2-2} 10$_{60}$ & Would summarization of opinions about APIs help you to make a better decision on which one to use? \textit{(yes/no)} \\ & \ib{ \begin{inparaenum} \item Yes 83.3\%, \item No 16.7\% \end{inparaenum} } \\ \cmidrule{2-2} 11$_{59}$ & Opinions about APIs need to be summarized because? \textit{(5-point Likert scale for each option)} \\ & \ib{ \begin{inparaenum} \item Too many posts with opinions 60\%, \item Interesting opinion in another post 66.7\%, \item Contrastive viewpoints missed 55\%, \item Not enough time to look for all opinions 56.7\% \end{inparaenum} } \\ \cmidrule{2-2} 12$_{60}$ & Opinion summarization can improve the following decision making processes. \textit{(5-point Likert scale for each option)} \\ & \ib{ \begin{inparaenum} \item Select among choices 85\%, \item Select API version 45\%, \item Improve a feature 48.3\%, \item Fix bug 40\%, \item Determine a replacement 78.3\%, \item Validate a selection 53.3\%, \item Develop a competing API 48.3\%, \item Replace an API feature 46.7\% \end{inparaenum} } \\ \cmidrule{2-2} 13$_{9}$ & What other areas can be positively affected having support for opinion summarization? \textit{(text box)} \\ & \ib{\begin{inparaenum} \item API usage 21.4\%, \item Trustworthiness analysis 21.4\%, \item Documentation 9.5\%, \item Maturity analysis 14.3\%, \item Expertise 7.1\% \end{inparaenum}} \\ \cmidrule{2-2} 14$_{9}$ & What other areas can be negatively affected having support for opinion summarization? \textit{(text box)} \\ & \ib{\begin{inparaenum} \item Trustworthiness analysis 33.3\%, \item Info overload 33.3\%, \item API usage 8.3\%, \item Reasoning 8.3\% \end{inparaenum}} \\ \cmidrule{2-2} 15$_{60}$ & An opinion is important if it contains discussion about one or more of the following API aspects? \textit{(5-point Likert scale for each option)} \\ &\ib{\begin{inparaenum} \item Performance 86.7\%, \item Security 85\%, \item Usability 85\%, \item Documentation 88.3\%, \item Compatibility 75\%, \item Community 73.3\%, \item Bug 86.7\%, \item Legal 43.3\%, \item Portability 50\%, \item General Features 48.3\%, \item Only sentiment 15\% \end{inparaenum}} \\ \cmidrule{2-2} 16$_{16}$ & What are the other factors you look for in API opinions? \textit{(text box)} \\ & \ib{\begin{inparaenum} \item API usage 28.6\%, \item Usability 19\%, \item Expertise 14.3\%, \item Standards 9.5\%, \item Reasoning 9.5\% \end{inparaenum}} \\ \cmidrule{2-2} 17$_{60}$ & What type of opinion summarization would you find most useful? \textit{(five types)} \\ & \ib{ \begin{inparaenum} \item In a paragraph 83.3\%, \item Divided into aspects 78.3\%, \item Top N by most recent 36.7\%, \item Divided into topics 35\%, \item Others 1.7\% \end{inparaenum} } \\ \cmidrule{2-2} 18$_{60}$ & How many keywords do you find to be sufficient for topic description? \textit{(five options)} \\ & \ib{\begin{inparaenum} \item Five words 61.7\%, \item 5-10 words 28.3\%, \item 10-15 words 5\%, \item 15-20 words 3.3\%, \item Not helpful at all 1.7\% \end{inparaenum}} \\ \cmidrule{2-2} 19$_{7}$ & What are the other ways opinions about APIs should be summarized? \textit{(text box)} \\ & \ib{ \begin{inparaenum} \item API Usage 25\%, \item Expertise 8.3\%, \item Documentation 8.3\%, \item Popularity 8.3\%, \item Testing 8.3\% \end{inparaenum} } \\ \bottomrule \end{tabular}% } \label{tbl:s1questions} \vspace{-2mm} \end{table*}% \subsection{Pilot Survey Data Analysis} We analyzed the survey data using statistical and qualitative approaches. For the open-ended questions, we applied an open coding approach~\cite{miles_1994}. {Open coding includes labelling of concepts/categories in textual contents based on the properties and dimensions of the entities (e.g., an API) about which the contents are provided. In our open coding, we followed the card sorting approach~\cite{Fincher-MakingSenseofSurveyData-JES2005}. In card sorting, the textual contents are divided into \textit{cards}, where each card denotes a \textit{conceptually coherent quote}. For example, consider the following sentence in Figure~\ref{fig:soSentimentPosts} (from answer circled as \circled{5}): \emt{Note that Jackson fixes these issues, and is faster than GSON.} The sentence has two different conceptual coherent quotes, ``Note that Jackson fixes these issues'', and ``and is faster than GSON''. The first quote refers to fixes to issues (i.e., bugs) by the API. The second quote refers to the ``performance'' aspect of the API. In our analysis, as we analyzed the quotes, themes and categories emerged and evolved during the open coding process.} We created all of the ``cards'', splitting the responses for eight open-ended questions. This resulted into 173 individual quotes; each generally corresponded to individual cohesive statements. In further analysis, the first two authors acted as coders to group cards into themes, merging those into categories. We analyzed the responses to each open-ended question in three steps: \begin{enumerate \item The two coders independently performed card sorts on the 20\% of the cards extracted from the survey responses to identify initial card groups. The coders then met to compare and discuss their identified groups. \item The two coders performed another independent round, sorting another 20\% of the quotes into the groups that were agreed-upon in the previous step. We then calculated and report the coder reliability to ensure the integrity of the card sort. We selected two popular reliability coefficients for nominal data: percent agreement and Cohen's Kappa~\cite{Cohen-Kappa-EducationalPsy1960}. Coder reliability is a measure of agreement among multiple coders for how they apply codes to text data. To calculate agreement, we counted the number of cards for each emerged group for both coders and used ReCal2~\cite{recal} for calculations. The coders achieved the \textit{almost perfect} degree of agreement; on average two coders agreed on the coding of the content in 96\% of the time (the average percent agreement varies across the questions and is within the range of 92--100\%; while the average Cohen's Kappa score is 0.84 ranging between 0.63--1 across the questions). \item The rest of the card sort (for each open-ended question), i.e., 60\% of the quotes, was performed by both coders together. \end{enumerate} \subsection{Summary of Results from the Pilot Survey} In this section, we briefly discuss the major findings from the pilot survey, that influenced the design of the primary survey. A detail report of the findings is in our online appendix~\cite{website:opinionsurvey-online-appendix}. Out of the 64 respondents who completed the demographic questions, maximum 60 respondents answered the other questions. In Table~\ref{tbl:s1questions}, the type of each question (e.g., open or closed-ended) is indicated beside the question (in \textit{italic} format). The \textit{key findings} for each question are provided under the question in Table~\ref{tbl:s1questions} (in \ib{bold italic} format). The key findings are determined as follows: \begin{description} \item[Responses to open-ended questions.] The response to an open-ended question is provided in a text box (e.g., Q5). For each such question, we show the top five categories (i.e., themes) that emerged from the responses of the question. The frequency of categories under a question is used to find the top five categories for the question. \item[Likert-scale questions] Each such question can have multiple options for a user to choose from (e.g., Q7). Each option can be rated across five scales: Strongly Agree, Agree, Neutral, Disagree, and Strongly Disagree. For each question, we calculate the percentage of respondents that agreed (= Total Agreed + Total Strongly Agreed) with the provided option. \item[Multiple choice questions.] There were two types of multiple choice questions. \begin{inparaenum} \item Only Select One: Each such question can have more than one choice and a participant can pick one of the the options (e.g., Q1). \item Can Select Multiple. The participant can pick one, more than one, or all the choices, when the options are of type multiple select (e.g., Q17). \end{inparaenum} For each option, we calculate the percentage of respondents that picked the option. \end{description} \vspace{1mm}\noindent\textbf{Needs for API Reviews (RQ1.1).} 95\% of the participants reported that they consider opinions of other developers while making a selection of an API. The primary sources of such opinions for them are both developer forums and co-workers (83.3\%). 69.3\% of the participants reported to have consulted developers forums to gain information about APIs. Most of the participants (83.3\%) reported that they consider opinions about APIs while making a selection of an API among multiple choices. They also seek opinions to determine a replacement of an API (73.3\%), as well as fixing a bug (63.3\%), etc. Among the other reasons for the participants to seek opinion were the learning of API usage and the analysis of validity of a provided API usage (e.g, if it actually works). The participants reported that making an informed decision among too much opinion, and judging the trustworthiness of the provided opinions are the major challenges they face while seeking and analyzing opinions. \vspace{1mm}\noindent\textbf{Needs for API Review Quality Analysis (RQ1.2).} Most of the participants (73.3\%) considered an opinion, accompanied by a code example, to be of high quality (Q20). 70\% of the participants considered the presence of links to supporting documents as a good indicator of the quality of the provided opinion, while 55\% believed that the posting date is an important factor. Stack Overflow uses upvotes and downvotes of a post as a gauge of the public opinion on the content. 66.7\% of developers attributed a higher count of votes on the post to their assumption of the higher quality of the corresponding opinion in the post. The user profile, another Stack Overflow feature, was found as useful by 45\% of participants to evaluate the quality of the provided opinion. The length of the post where the opinion is provided was not considered as a contributing factor during the assessment of the opinion quality (agreed by only 16.7\% of the responders). One participant did not agree with any of the choices, while two participants mentioned two additional factors: \begin{inparaenum}[\textbf(1)] \item real example, i.e., the provided code example should correspond to a real world scenario; and \item reasoning of the provided opinion. \end{inparaenum} \vspace{1mm}\noindent\textbf{Tools for API Review Analysis (RQ2.1).} More than 83\% of the respondents agreed that opinion summarization is much needed for several reasons. Since opinions change over time or across different posts, developers wanted to be able to track changes in API opinions and to follow how APIs evolve. {In our surveys, we sought to explain each option in the closed questions with a short description or examples. The description for each question can be found in the links to the surveys (see \url{https://goo.gl/forms/8X5jKDKilkfWZT372} for the pilot survey). For example, in Q11 of the pilot survey (Table~\ref{tbl:s1questions}), the two options ``Opinions can change over time'' and ``Opinions can evolve over time'' are differentiated as follows: Opinions about an API about a feature can change from bad to good, e.g., developers did not like it before, but like it now (i.e., we need a contrastive viewpoint). In contrast, \textit{overall} opinions about an API can evolve, e.g., it is more positive now due to the increase in adoption by users (e.g., by becoming more usable), etc.} \vspace{1mm}\noindent\textbf{Tools for API Review Summarization (RQ2.2).} The vast majority of responders also thought that an interesting opinion about an API might be expressed in a post that they have missed or have not looked at. The need for opinion summarization was also motivated by the myriad of opinions expressed via various developer forums. Developers believe that the lack of time to search for all possible opinions and the possibility of missing an important opinion are strong incentives for having opinions organized in a better way. While developers were interested in tool support for mining and summarizing opinions about APIs, they also wanted to link such opinions to other related dimensions, such as, usage, maturity, documentation, and user expertise. 85\% of the respondents believed that opinion summarization could help them select an API among multiple choices. More than 78\% believed that opinion summaries can also help them find a replacement to an API. Developers agreed that summaries can also help them develop a new API to address the needs that are currently not supported, improve a software feature, replace an API feature, validate the choice of an API, select the right version of an API, and fix a bug (48.3\%, 48.3\%, 46.7\%, 53.3\%, 45\%, and 40\%, respectively). \subsection{Needs for the Primary Survey}\label{sec:needs-for-primary-survey} The responses in our pilot survey showed that opinions about APIs are important in diverse development needs. However, the survey had the following limitations: \begin{description}[style=nextline] \item[Design.] A number of similar questions were asked in pairs. For example, in Q4, we asked the developers about the reasons to seek opinions. The developers were provided eight options to choose from. In Q5, we asked the developers to write about the other reasons that could also motivate them to seek opinions. Q5 is an open-ended question. Both Q4 and Q5 explore similar themes (i.e., needs for opinion seeking). Therefore, the responses in Q5 could potentially be biased due to the respondents already being presented the eight possible options in Q4. A review of the manuscript based on the pilot survey (available in our online appendix~\cite{website:opinionsurvey-online-appendix}) both by the colleagues and the reviewers in Transaction of Software Engineering pointed out that a better approach would have been to ask Q5 before Q4, or only ask Q5. Moreover, the respondent should not be given an option to modify his response to an open-ended question, if a similar themed closed-ended question is asked afterwards. \item[Sampling.] We sampled 2,500 GitHub developers out of the first 4,500 GitHub IDs as returned by the GitHub API. We did not investigate the relevant information of the developers, e.g., are they still active in software development? Do they show expertise in a particular programming languages?, and so on. This lack of background information on the survey population can also prevent us from making a formal conclusion out of the responses of the survey. \item[Response Rate.] While previous studies involving GitHub developers also reported low response rate (e.g., 7.8\% by Treude et al.~\cite{Treude-SummarizingDevelopmentActivity-FSE2015}), the response rate in our pilot survey was still considerably lower (only 2.62\%). There can be many reasons for such low response rate. For example, unlike Treude et al.~\cite{Treude-SummarizingDevelopmentActivity-FSE2015}, we did not offer any award/incentives to participate in the survey. However, our lack of enough knowledge of the GitHub survey population prevents us from making a definitive connection between the low response rate and the lack of incentives. \end{description} We designed the primary survey to address the above limitations. Specifically, we took the following steps to avoid the above problems in our primary survey: \begin{enumerate} \item We asked all the open-ended questions before the corresponding closed-ended questions. The respondents only saw the closed-ended questions after they completed their responses to all the open-ended questions. The respondents were not allowed to change their response to any open-ended question, once they were asked the closed-ended questions. \item We conducted the primary survey with a different group of software developers, all collected from Stack Overflow. To pick the survey participants, we applied a systematic and exhaustive sampling process (discussed in the next section). \item We achieved a much higher response rate (15.8\%) in our primary survey. \end{enumerate} In the next section, we discuss in details about the design of the primary survey. In Section~\ref{sec:discussion}, we briefly compare the results of the pilot and primary survey on the similar-themed question pairs. \section{Related Work} \label{sec:background} As noted in Section~\ref{sec:introduction}, the findings of this paper motivated us to pursue a research journey that contributed to the development of our proof-of-concept tool, Opiner (see Section~\ref{sec:research-journey}). Specifically, our subsequent research projects focused on the design, development, and evaluation of techniques and tools to mine and summarize opinions and usage scenarios about APIs from developer forums. The research journey is captured in the following manuscripts: \begin{enumerate} \item In \cite{Uddin-OpinionMining-TSE2018}, we present a benchmark dataset of 4,522 sentences from Stack Overflow, each labelled as API aspects, such as performance, usability, etc. The catalog of API aspects is derived from the two surveys of this paper (Q11 and Q15 in Final Survey and Q15 from pilot survey). We leverage the benchmark dataset to develop machine learning supervised classifiers to automatically detect API aspects discussed in opinionated sentences. We then present a suite of algorithms to automatically mine opinions about APIs from Stack Overflow. We report the evaluation of each technique. \item In \cite{Uddin-OpinerReviewAlgo-ASE2017}, we present two algorithms to summarize opinions about APIs from Stack Overflow. The design and development of the algorithms were motivated by the findings from this paper, e.g., developers prefer to seek opinions about API aspects, such as performance, etc. We compare the algorithms against six off-the-shelf summarization algorithms. \item In \cite{Uddin-OpinerReviewToolDemo-ASE2017}, we present the Opiner architecture that supports the mining and summarization of opinions from Stack Overflow. \item In \cite{Uddin-MiningUsageScenarios-TechReport2018}, we present a framework to automatically mine usage scenarios about APIs from Stack Overflow. We present an empirical study to investigate the value of the framework. \item In \cite{Uddin-UsageSummarization-TSE2018}, we present four algorithms to automatically summarize usage scenarios about APIs and their evaluation using four user studies. \end{enumerate} As noted above, the findings from this paper have formed the cornerstone towards the development and evaluation of the techniques and tools presented in the above papers. Other related work can be categorized into four areas. \begin{inparaenum}[(1)] \item Studies conducted to understand how developers learn to select and use APIs, \item Analysis of APIs in developer forums, \item Sentiment analysis in software engineering, and \item Summarization of software artifacts. \end{inparaenum} We discuss the related work below. \subsection{How developers learn to select and use APIs}\label{sec:related-work-howDevLearnSelectApis} While our surveys focused on the role of opinions to support development tasks, previous studies mainly focused on interviews or empirical studies to understand the role of API official documentation to support the development tasks~\cite{Sohan-UsabilityRESTAPI-VLHCC2017,Uddin-HowAPIDocumentationFails-IEEESW2015,Wang-DetectingAPIUsageObstacles-MSR2013,Barzillay-StackOverflow-Springer2013,Ekwa-StudyUnfamiliarAPIs-ICSE2012,Robillard-FieldStudyAPILearningObstacles-SpringerEmpirical2011a,Treude-HowProgrammersAskQuestionsInWeb-ICSE2011}. Developers in our survey seek opinions about APIs to support diverse development needs (e.g., API selection) as well as to compensate for shortcomings in API documentation, e.g., when the documentation is incomplete or ambiguous. The problems in API official documentation are previously reported in multiple studies, such as~\cite{Robillard-FieldStudyAPILearningObstacles-SpringerEmpirical2011a,Carroll-MinimalManual-JournalHCI1987a,Uddin-HowAPIDocumentationFails-IEEESW2015,Shull-InvestigatingReadingTechniquesForOOFramework-TSE2000}, etc. Robillard and DeLine~\cite{Robillard-FieldStudyAPILearningObstacles-SpringerEmpirical2011a} conducted a survey and a series of qualitative interviews of software developers at Microsoft to understand how developers learn APIs. The study identified that the most severe obstacles developers faced while learning new APIs were related to the official documentation of the APIs. With API documentation, the developers cited the lack of code examples and the absence of task-oriented description of the API usage as some major blockers to use APIs. The benefit of task-based documentation over traditional hierarchy-based documentation (e.g., Javadoc) was previously also reported by Carroll et al.~\cite{Carroll-MinimalManual-JournalHCI1987a} who observed developers while using traditional documentation to learn an API (e.g., Javadoc, manual). They found that the learning of the developers was often interrupted by their self-initiated problem-solving tasks that they undertook during their navigation of the documentation. During such unsupervised exploration, they observed that developers ignored groups and entire sections of a documentation that they deemed not necessary for their development task at hand. Unsurprisingly, such unsupervised exploration often led to mistakes. They conjectured that traditional API documentation is not designed to support such active way of developers' learning. To support developers' learning of APIs from documentation, they designed a new type of API documentation, called as the \textit{minimal manual}, that is task-oriented and that helps the users resolve errors~\cite{Cai-FrameworkDocumentation-PhDThesis2000,Carroll-MinimalManual-JournalHCI1987a, Rossen-SmallTalkMinimalistInstruction-CHI1990a,Meij-AssessmentMinimalistApproachDocumentation-SIGDOC1992}. In a subsequent study of 43 participants, Shull et al.~\cite{Shull-InvestigatingReadingTechniquesForOOFramework-TSE2000} also confirmed the effectiveness of example-based documentation over hierarchy-based documentation. The advent of cloud-based software development has popularized the adoption of Web APIs, such as, the Google Map APIs, API mashups in the ProgrammableWeb, and so on. Tian et al.~\cite{Tian-ExploratoryStudyWebApi-EASE2017} conducted an exploratory study to learn about the features offered by the Web APIs via the ProgrammableWeb portal and the type of contents supported in the documentation of those APIs. They observed that such Web APIs offer diverse development scenarios, e.g., text mining, business analysis, etc. They found that the documentation of the APIs offer insights into different knowledge types, e.g., the underlying intent of the API features, the step-by-step guides, etc. Sohan et al.~\cite{Sohan-UsabilityRESTAPI-VLHCC2017} observed that REST API client developers face problems while using an API without usage examples, such as correct data types, formats, required HTTP headers, etc. Intuitively, the developer forums can be used for missing code examples for an API, because developers in our surveys mentioned that they rely on the API usage discussions in developer forums when the API official documentation can be missing. The generation of such task-based documentation can be challenging. However, the developers in our survey reported that they consider the combinations of code examples and reactions towards the examples about an API in the forum as a form of API documentation. Intuitively, the Q\&A format of online developer forums (e.g., Stack Overflow) follow task-based documentation format, e.g., the task is described in the question and the solution with code examples and opinions in the answer posts. Leveraging usage scenarios about APIs posted in the developer forums can be necessary, when API official documentation does not include those scenarios and can often be outdated~\cite{ Dagenais-DeveloperDocumentation-FSE2010a}. Indeed, documentation that does not meet the expectations of its readers can lead to frustration and a major loss of time, or even in an API being abandoned~\cite{Robillard-FieldStudyAPILearningObstacles-SpringerEmpirical2011a}. To address the shortcomings in API official documentation, research efforts focused on the linking of API types in a formal documentation (e.g., Javadoc) to code examples in forum posts where the types are discussed~\cite{Subramanian-LiveAPIDocumentation-ICSE2014}, presenting interesting textual contents from Stack Overflow about an API type in the formal documentation~\cite{Treude-DocumentationInsightsSO-ICSE2016}, etc. However, our study in this paper shows that the plethora of usage discussions available for an API in the forum posts can pose challenges to the developers to get quick and actionable insights into how an API can be used for a given development task. One possible way to assist developers is to generate on-demand developer documentation from forum posts~\cite{Robillard-OndemandDeveloperDoc-ICSME2017}. However, to be able to do that, we first need to understand what specific problems persist in the API official documentation, that should be addressed through such documentation efforts. If we know of the common documentation problems, we can then prioritize those problems and investigate techniques to leverage API usage scenarios posted in the developer documents to address those problems. In a recent study~\cite{Uddin-HowAPIDocumentationFails-IEEESW2015}, we conducted surveys of more than 300 developers at IBM to understand the problems developers faced while using API official documentation. We observed 10 common documentation problems, such as documentation incompleteness, incorrectness, ambiguities, etc. Therefore, we can leverage the findings from our study to design API documentation resources that can address the problems developers that are commonly observed in API documentation. \subsection{Sentiment Analysis of Software Artifacts}\label{sec:related-work-sentiment} Developers in our surveys reported that they use the positive and negative opinions towards an API as an indicator of quality of the features offered by the API. While our findings shed light on developers' perceptions of API quality by leveraging opinions, recent research of sentiment analysis of software artifacts focused on the mining of sentiments and emotions from software repositories. Ortu et al.~\cite{Ortu-AreBulliesMoreProductive-MSR205} observed weak correlation between the politeness of the developers in the comments and the time to fix the issue in Jira, i.e., bullies are not more productive than others in a software development team. M\"{a}ntyl\"{a} et al.~\cite{Mika-MiningValenceBurnout-MSR2016} correlated VAD (Valence, Arousal, Dominance) scores~\cite{Warriner-VadLexicons-BRM2013} in Jira issues with the loss of productivity and burn-out in software engineering teams. They found that the increases in issue's priority correlate with increases in Arousal. Pletea et al.~\cite{Pletea-SecurityEmotionSE-MSR2014} found that security-related discussions in GitHub contained more negative comments. Guzman et al.~\cite{Guzman-SentimentAnalysisGithub-MSR2014} found that GitHub projects written in Java have more negative comments as well as the comments posted on Monday, while the developers in a distributed team are more positive. Guzman and Bruegge~\cite{Guzman-EmotionalAwareness-FSE2013} summarized emotions expressed across collaboration artifacts in a software team (bug reports, etc.) using LDA~\cite{Blei-LDA-JournalMachineLearning2003} and sentiment analysis. The team leads found the summaries to be useful, but less informative. We observed in our surveys that while developers analyze opinions to learn about APIs, they also find it challenging to assess the quality (e.g., trustworthiness) of the provided opinions due to the presence of such opinions scattered across multiple unrelated forum posts. Related research has focused on the assessment of post quality using post attributes (e.g., post score) and their roles in the Q\&A process~\cite{Calefato-SOSuccessfulAnswers-MSR2014,Bajaj-MiningQuestionsSO-MSR2014, Lal-MigratedQuestionsSO-APSEC2014,Correa-DeletedQuestionSO-WWW2014,Vasilescu-SocialQAKnowledgeSharing-CSCW2014,Kavaler-APIsUsedinAndroidMarket-SOCINFO2013}, to analyze developer profiles (e.g., personality traits of the most and low reputed users)~\cite{Bazelli-SOPersonalityTraits-ICSM2013, Ginsca-UserProfiling-DUBMOD2013}, or to determine the influence of badges in Stack Overflow~\cite{Anderson-SOBadge-WWW2013}. In contrast to the above work, our findings motivate the needs to develop opinion quality assessment models, tools and techniques for forum posts. \subsection{Analysis of APIs in Developer Forums}\label{sec:related-work-analysisOfApiDeveloperForums} Developers in our surveys prefer to seek opinions about different API aspects and wish to leverage automated tools to support such analysis (e.g., get all the opinions discussing about the performance of an API, etc.). A closely related work is the identification of problematic API features in Stack Overflow by Zhang and Hou~\cite{Zhang-ProblematicAPIFeatures-ICPC2013}, who considered sentences with negative sentences as indicators of problematic API features. In a parallel study, Wang and Godfrey~\cite{Wang-DetectingAPIUsageObstacles-MSR2013} hypothesize that the more discussions an API class generate in the forum posts, the more likely that it is problematic to use. By applying topic modeling on the posts, they observed several recurrent themes of API usage obstacles, such as learning the interactions among components. Unlike both \cite{Zhang-ProblematicAPIFeatures-ICPC2013} and \cite{Wang-DetectingAPIUsageObstacles-MSR2013} our findings motivate the needs to study both positive and negative opinions about APIs to obtain finer-grained insights about API aspects. Intuitively, such fine-grained insights can also be useful to compare competing APIs for a given task. A large volume of API research has devoted into the automatic mining of insights about APIs from Stack Overflow. In contrast to our study, they the studies are mainly empirical (i.e., automatic mining techniques) and they do not consider opinions about APIs. For example, Treude and Robillard~\cite{Treude-APIInsight-ICSE2016} developed machine learning tools to detect insightful sentences about API types from Stack Overflow. Parnin et al.~\cite{Parnin2012} have investigated API classes discussed in Stack Overflow using heuristics based on exact matching of classes names with words in posts (title, body, snippets, etc.). Using a similar approach, Kavaler et al.~\cite{Kavaler-APIsUsedinAndroidMarket-SOCINFO2013} analyzed the relationship between API usage and their related Stack Overflow discussions. Both studies found a positive relationship between API class usage and the volume of Stack Overflow discussions. More recent research \cite{Linares-Vasquez-2014,Guerrouj15-saner} investigated the relationship between API changes and developer discussions. Treude et al.~\cite{Treude-HowProgrammersAskQuestionsInWeb-ICSE2011} categorized questions and posts from Stack Overflow to understand the types of questions asked in Stack Overflow. They observed that developer forums are the most effective for code reviews and conceptual questions. The findings corroborate to our study participants who mentioned that they seek expertise in API usage in forum posts. \subsection{Summarization of Software Artifacts}\label{sec:related-work-summarization} Developers in our surveys wish for tools to automatically summarize the huge volume of opinions posted about APIs from developer forums. Such summaries can be different from the research conducted to produce Natural language and structural summaries of source code~\cite{Rastkar:2014, murphy:context, Holmes-Strathcona-TSE2006a, anvik:context, Sridhara-MethodSummary-ASE2010, Moreno13, McBurney14, Guerrouj15-nier, Haiduc:Summarization, Murphy:summarization, Ying-SelectionPresentationCodeExample-FSE2014,Rodeghero-CodeSummarizationEyeTracking-ICSE2014}. One potential technique in text-based summarization is topic modeling, which can be applicable to summarize opinions (e.g., in other domains~\cite{Kim-OpinionSummarizerSurvey-UIUC2011}). Previously, topic modeling has been used to study dominant discussion topics in developer forums~\cite{Barua-StackoverflowTopics-ESE2012,Rosen-MobileDeveloperSO-ESE2015}. Our survey findings motivate for a finer grained analysis using topic modeling, such as analysis of only opinions instead of all textual contents. Given that developers in our survey prefer to analyze opinions by API aspects (e.g., performance, usability), another potential summarization approach could be aspect-based summarization~\cite{Kim-OpinionSummarizerSurvey-UIUC2011} of API opinions, as we developed in Opiner~\cite{Uddin-OpinerReviewAlgo-ASE2017} based on the findings from this study. \section{Research Journey}\label{sec:research-journey} We noted in Section~\ref{sec:introduction} (Figure~\ref{fig:researchJourneySteps}) that the findings from the surveys led us to develop techniques and tools to assist developers in their analysis of opinions and usage about APIs from Stack Overflow. In this section, we break down the journey into two major phases that we undertook after the surveys: \begin{enumerate} \item Identification of core and actionable insights from the survey results that can be used to guide the design of tools to assist developers in their analysis of opinions and usage of APIs from developer forums (see Section~\ref{sec:core-findings}). \item Development and evaluation of techniques and our tool (Opiner) based on the insights (see Section~\ref{sec:implications}). \end{enumerate} \subsection{Core and Actionable Findings}\label{sec:core-findings} In Table~\ref{tbl:core-findings}, we summarize the core findings obtained from the surveys. Each finding is provided a unique ID (denoted by CID). The first two columns show the research questions, the third column presents the core findings. In Table~\ref{tbl:actionable-findings}, we identify requirements for future tool designs to support each core finding. Each requirement is mapped to the CIDs from Table~\ref{tbl:core-findings} (first column). The second column shows the requirements, i.e., actionable findings. We cluster the requirements into five categories (R1-R5). The third column lists the questions from the primary survey that we used to identify those requirements. The last column presents the features implemented in our tool Opiner to address those requirements. In Figure~\ref{fig:researchJourneyToolDevelopment}, we show how requirements are implemented into our tool. We now discuss the findings below along with the elicited requirements. \subsubsection{Needs for Mining API Opinions \& Usage (R1)} The developers in our surveys seek and analyze opinions about APIs to support diverse development needs and they consider the combination of opinions and code examples in the forum posts as a form of API documentation (CID 1, 2 in Table~\ref{tbl:core-findings}). To search for opinions and usage discussions about APIs, developers use search engines or the tags in Stack Overflow. They raise the concern that this approach of using search engines (e.g., find sentiments about an API) can be sub-optimal when they only explore the top results (CID 3 in Table~\ref{tbl:core-findings}). The developers reported to look for sentiments and situational relevance in the search results (Q5). This exploration can be challenging, because the results may not be \begin{inparaenum}[(1)] \item \textit{situationally relevant}, such as the API about which they would like to see opinions about may not be present in the search result. It could also be that their development task is not properly supported by the code example found in the search result. \item \textit{trustworthy}, such as, sentiment towards an API found in the search result may not represent the overall sentiments expressed towards it (e.g., the opinion in the search results may be biased). \item \textit{recent}, such as the opinion and code example may not be the most recent and thus the solution may not be applicable to the most recent version of the API. \end{inparaenum} In the absence of a dedicated engine for APIs, developers opt for the reformulation of their search query by modifying search keywords. This approach is considered as challenging and time consuming. The developers wished for better search support to address their needs. Intuitively, it is easier to find opinions/solutions for an API with regards to specific task (or situation), if they are not \textit{scattered} in millions of posts in the forums. As a first step towards facilitating such search, it is thus necessary to collect opinions and code examples about APIs from the millions of posts, where their usage is discussed. During our tool design to assist developers in their exploration of opinions and usage about APIs from developer forums, we formulate the following two requirements: \begin{enumerate} \item \textbf{Opinions about an API need to be collected}. \rev{Sentiment and emotion mining in software engineering has so far focused on the usefulness of cross-domain sentiment detection tools for software engineering, the development of sentiment detection tools for the domain of software engineering, and the relationship between team productivity with the sentiments expressed (see Section~\ref{sec:related-work-sentiment}). We are aware of no technique that can mine opinions associated to an API from developer forums.} We developed a framework to automatically mine opinions about APIs from developer forums. The framework currently supports the following major features: \begin{inparaenum} \item Detection of API names in the forum texts \item Detection of opinionated sentences in the forum texts, and \item Association of opinionated sentences to APIs. \end{inparaenum} A detailed description and evaluation of the framework is the subject of our paper~\cite{Uddin-OpinionValue-TSE2018}. \item \textbf{Code examples with reactions need to be collected together}. \rev{A number of recent research efforts have been devoted to mine code examples about APIs from forums, such as detecting all the APIs used in a code example in a forum post~\cite{Subramanian-LiveAPIDocumentation-ICSE2014,Dagenais-RecoDocPaper-ICSE2012a}, etc. We are aware of no technique that mines both a code example and the reactions towards the code example for an API from forum post.} We developed another framework to automatically mine usage scenarios about APIs from developer forums. Each usage scenario about an API consists of three major components: \begin{inparaenum} \item The code example \item A short description in natural language about the code example, and \item The reactions of developers towards the forum post from where the code example is found. \end{inparaenum} A detailed description and evaluation of the framework is the subject of our technical report~\cite{Uddin-MiningUsageScenarios-ASE2018}. \end{enumerate} \subsubsection{Needs for Summarization of API Opinions (R2)} In our primary survey, 89.2\% of the developers mentioned that they are overwhelmed by the huge volume of opinions posted about APIs in forums (CID 7). While the majority of the developers agreed that opinion summaries can help them evaluating APIs, the following summarization types were rated as (could be) useful (CID 8): \begin{inparaenum} \item categorization of opinions by API aspects, \item show trends of API popularity, \item show contrastive viewpoints, \item show dashboards to compare APIs, \item opinions summarized as topics; and \item most importantly opinions summarized into a paragraph. \end{inparaenum} It would be interesting to further investigate the relative benefit of each summarization type and compare such findings with other domains. For example, Lerman et al.~\cite{Lerman-SentimentSummarizerEvaluation-EACL2009} found no clear winner for consumer product summarization, while aspect-based summarization is predominantly present in camera and phone reviews~\cite{liu-sentimentanalysis-handbookchapter-2010}, and topic-based summarization has been studied in many domains (e.g., identification of popular topics in bug report detection~\cite{Nguyen-DuplicateBugReport-ASE2012}, software traceability~\cite{AsuncionTylor-TopicModelingTraceabilityWithLDA-ICSE2010a}, etc.). As a first step towards facilitating the summarization of opinions about APIs, we formulate the following design requirements: \begin{enumerate} \item \textbf{Categorize opinions by aspect.} The developers indicated that they would like to seek opinions about diverse API aspects, such as performance, usability, security, etc. We develop machine learning techniques to automatically categorize each opinionated sentences associated to an API into 11 different categories: \begin{inparaenum}[(i)] \item Performance \item Usability \item Security \item Compatibility \item Portability \item Legal \item Bug \item Community \item Documentation \item Other general features \item Only sentiment \end{inparaenum}. The first nine categories are frequently asked for in the responses of our surveys (e.g., Q11, Q15 in our primary survey). \item \textbf{Statistical summarization.} Developers asked for automated analysis to see trends of usage of an API based on sentiment analysis. We have developed techniques to create time series of positivity and negativity towards an API by analyzing the sentiments expressed about the API in the different forum posts. \item \textbf{API Comparator.} The most-asked tool was a dashboard to compare APIs and to see competing APIs given an API. We developed two techniques to facilitate comparison between APIs. \begin{inparaenum} \item We rank APIs by aspect to offer recommendation, such as based on the aspect performance the API Jackson is the most popular for JSON-based tasks in Java, but for usability aspect it is the Google GSON API. \item We further apply collocation algorithm on the forum posts for each API mention and show which other APIs were positively or negative reviewed in the same forum post. This analysis can reveal other similar APIs to developers if they are not satisfied with their initially selected API. \end{inparaenum} \item \textbf{Summarize opinions by topics and paragraphs.} In our pilot survey, we asked developers of their preference to summarize opinions by topics and in short paragraphs. The two options were ranked lower than the aspect-based categorization, but were still considered as useful. We investigated the following existing algorithms to summarize opinions along the two options. Each algorithm takes as input all the opinionated sentences (one bucket for positive and another for negative sentences). \begin{inparaenum} \item We applied the widely used topic modeling algorithm, LDA (Latent Dirichlet Allocation)~\cite{Blei-LDA-JournalMachineLearning2003} to find topics in the input and to cluster the opinionated sentences by topics. \item We applied four algorithms based on Extractive and Abstractive summarization of natural language texts to produce a summary of the input as a paragraph. \end{inparaenum} \end{enumerate} The detail of the summarization algorithms and their evaluation was the subject of our recently published paper~\cite{Uddin-OpinerReviewAlgo-ASE2017}. \subsubsection{Needs for API Usage Summarization (R3)} Developers mentioned that opinions about different API elements can help them better understand the benefits and shortcomings of the API. In our primary survey, developers mentioned that they consider the combination of opinions and code examples posted in Stack Overflow as a form a API documentation. Motivated by this finding, we developed a framework to mine usage scenarios about APIs (R1), where each usage scenario of an API consists of a code example and the reactions (i.e., positive and negative opinions) towards the code example. In our survey, developers mentioned several quality criteria for such usage scenarios while developing an API documentation based on the scenarios, such as offering clues to determine situational relevance of the usage, clarity and correctness of the usage, etc. Indeed, summaries extracted from Stack Overflow can be effective about the purpose and use of API elements (classes, methods, etc.) by building opinion summarizer tools that leverage informal documentation. This motivates future extension of the recent research on augmenting insights about APIs from the forums to the formal API documentation~\cite{Treude-APIInsight-ICSE2016}. Such tools can be integrated within IDEs to assist developers during their APIs-based tasks. As a first step towards producing summaries of usage scenarios of an API as a form of API documentation, we formulated the following tool design requirements: \begin{enumerate} \item \textbf{Show situationally relevant usage scenarios together.} We developed an algorithm to find code examples of an API that are \textit{conceptually similar}, i.e., the tasks supported by the code examples may be closely related to each other. One such example would be, while using the Apache HttpClient API, developers first establish a connection to an HTTP server and then they send or receive messages using the connection~\cite{Uddin-TemporalApiUsage-ICSE2012}. \item \textbf{Integrate usage scenarios into API documentation.} In our previous study, we found that the official API documentation can be often obsolete, incomplete, or outdated~\cite{Uddin-HowAPIDocumentationFails-IEEESW2015}. In our primary survey, developers asked for a unified documentation by combining API usage scenarios from developer forums with the official API documentation. One such integration would be the Live API documentation, as proposed by Subramanian et al.~\cite{Subramanian-LiveAPIDocumentation-ICSE2014}, i.e., link code examples from Stack Overflow into the Javadoc of each API class. We developed algorithms to produce type-based usage summaries of an API. In a type-based summary of an API, the usage scenarios of each type (e.g., a class) of the API is grouped and further summarized into situationally relevant clusters. \item \textbf{Provide situationally relevant information to an API usage.} A development task often requires the usage of more than one API. While the above two summaries are focused on producing summaries for an API, we still need information on whether and how other APIs are co-used with our API of interest in the usage scenarios. We used collocation algorithms to find APIs that are co-used together, and other API types that are co-used together with an API type of our interest. \end{enumerate} The development and evaluation of the usage summarization algorithm is the subject of our recent publication~\cite{Uddin-UsageSummarization-TSE2018}. \subsubsection{Needs for Opinion Quality Analysis (R4)} In our surveys, the developers expressed their concerns about the trustworthiness of the provided opinions, in particular those that contain strong bias. Since by definition an ``opinion'' is a ``personal view, belief, judgment, attitude''~\cite{opinion}, all opinions are biased. However, developers associate \textit{biased} opinions with noise defining them as the ones not being supported by facts (e.g., links to the documentation, code snippets, appropriate rationale). While the detection of spam (e.g., intentionally biased opinion) is an active research area~\cite{liu-sentimentanalysis-handbookchapter-2010}, it was notable that developers are mainly concerned about the \textit{unintentional} bias that they associate with the user experience. Developers are also concerned about the overall writing quality. As a first step towards assisting developers to analyze the quality of the provided opinions, we formulated the following design requirements: \begin{enumerate} \item \textbf{Contrastive viewpoint summarization.} We implement the contrastive opinion clustering algorithm proposed by Kim and Zhai~\cite{KimZhai-ContrastiveOpinionSummary-CIKM2009} to find pairs of opinions that offer opposing views about an API feature. \item \textbf{Ranking by Recency.} Developers in our surveys were explicitly asked about the necessity for finding more recent opinions about APIs. The reason is that API versions evolve quickly and some old features can become obsolete or changed. We rank the opinionated sentences of an API by recency, i.e., the most recent opinion is placed at the top. \item \textbf{Tracing Opinions to Posts.} Developers in our surveys highlight the necessity of investigating the context of a provided opinion, such as the features about which the opinion is provided, the particular configuration parameters used in the usage example, etc. To enable such exploration, we link each mined opinionated sentence about an API to the specific forum post from where the opinion was mined. \end{enumerate} A number of additional research avenues can be explored in this direction, such as, the design of a theoretical framework to define the quality of the opinions about APIs, the development of a new breed of recommender systems that can potentially warn users of any potential bias in an opinion in the forums, etc. \subsubsection{Needs for an API Portal (R5)} In our primary survey, developers explicitly asked for a dedicated portal for APIs where they can search and analyze opinions and usage about APIs that are posted in developer forums, such as Stack Overflow (Q12 in primary survey). Based on the themes and developer needs that emerged from the study, we developed a prototype tool, named Opiner. The tool is developed as an opinion search engine where developers can search for an API by its name to explore the positive and negative opinions provided for the API by the developers in the forum posts. \begin{figure*}[t] \centering \hspace*{-1.cm}% \includegraphics[scale=.9]{images_new/opiner-sc-mod} \caption{Screenshots of Opiner opinion search engine for API reviews.} \label{fig:opinerSC} \end{figure*} \begin{figure}[t \centering \hspace*{-.8cm}% \includegraphics[scale=.72]{images_new/intro-opiner-long} \hspace*{-.8cm}% \vspace{-4mm} \caption{Screenshots of the Opiner API usage summarizer} \label{fig:opiner-intro} \vspace{-4mm} \end{figure} \begin{figure}[t] \centering \vspace{-6mm} \hspace*{-.8cm}% \includegraphics[scale=1.2]{images_new/concept-summary} \hspace*{-.8cm}% \vspace{-4mm} \caption{Concept based summary for API Jackson} \label{fig:concept-summary} \vspace{-4mm} \end{figure} The Opiner's infrastructure supports the implementation and deployment for all the above requirements (R1-R4). Since the online deployment on October 30, 2017, Opiner has been accessed and used by developers from 57 countries from all the continents except Antarctica (as of July 29, 2018 by Google Analytics). \vspace{1mm}\noindent\textbf{$\bullet$ Opiner API Review Summarizer.} In Figure~\ref{fig:opinerSC}, we show screenshots of the user interface of Opiner API review summarizer. The UI of Opiner is a search engine, where users can search for APIs by their names to look for the mined and categorized opinions about the API. There are two search options in the front page of Opiner. A user can search for an API by its name using \circled{1}. A user can also investigate the APIs by their aspects using \circled{2}. Both of the search options provide auto-completion and provide live recommendation while doing the search. When a user searches for an API by name, such as, `jackson' in \circled{1}, the resulting query produces a link to all the mined opinions of the API. When the user clicks the links (i.e., the link with the same name of the API as `com.fasterxml.jackson'), all of the opinions about the API are shown. The opinions are grouped as positive and negative (see \circled{7}). The opinions are further categorized into the API aspects by applying the aspect detectors on the detected opinions \circled{8}. By clicking on each aspect, a user can see the opinions about the API (see \circled{9}). Each opinion is linked to the corresponding post from where the opinion was mined (using `details' link in \circled{9}). When a user searches by an API aspect (e.g., performance as in \circled{2}), the user is shown the top ranked APIs for the aspect (e.g., most reviewed, most negatively reviewed in \circled{4}). For each API in the Opiner page where the top ranked APIs are shown, we show the most recent three positive and negative opinions about the API \circled{5}. If the user is interested to further explore the reviews of an API from \circled{5}, he can click the `Explore All reviews' which will take him to the page in \circled{7}. The system architecture of Opiner API review summarizer is the subject of our tool demo paper~\cite{Uddin-OpinerReviewToolDemo-ASE2017}. \vspace{1mm}\noindent\textbf{$\bullet$ Opiner API Usage Scenario Summarizer.} In Figure~\ref{fig:opiner-intro}, we show screenshots of Opiner usage scenario summarizer. The user can search an API by name to see the different usage summaries of the API \circled{1}. The front page also shows the top 10 APIs for which the most number of code examples were found \circled{2}. Upon clicking on the search result, the user is navigated to the usage summary page of the API \circled{3}, where the summaries are automatically mined and summarized from Stack Overflow. A user can also click on each of the top 10 APIs listed in the front page. An example usage scenario in Opiner is shown in \circled{4}. The reactions included in a usage scenario can be simply a ``thank you'' note (when the code example serves the purpose) or more elaborated (when the code example has certain limitations or specific usage requirements). In Figure~\ref{fig:concept-summary}, we show an overview of the concept-based API usage summary for the API Jackson in Opiner. In Opiner, each concept consists of one or more similar API usage scenarios. Each concept is titled as the title of the most representative usage scenario (discussed below). In \circled{1} of Figure~\ref{fig:concept-summary}, we show the most recent three concepts for API Jackson. The concepts are sorted by time of their most representative usage scenario. The most recent concept is placed at the top of all concepts. Upon clicking on a each concept title, the most representative scenario for the concept is shown in \circled{2}. Each concept is provided a star rating as the overall sentiments towards all the usage scenarios under the concept (see \circled{2}). Other relevant usage scenarios of the concept are grouped under a `See Also' (see \circled{3}). Each usage scenario under the `See Also' can be further explored (see \circled{4}). Each usage scenario is linked to the corresponding post in Stack Overflow where the code example was found (by clicking on the \textit{details} word after the description text of a scenario). The summaries page of an API in Opiner also contains a `Search' box, which developers can use to search for review and usage summaries of another API (e.g., a competing API). \subsection{Effectiveness of Opiner}\label{sec:implications}\label{sec:implications} We investigated the effectiveness of Opiner using both empirical evaluation and user studies. We conducted the empirical evaluation to compute the performance of the mining techniques in Opiner (e.g., the precision of the sentiment detection and opinion association algorithms). We observed a reasonable degree of precision in our mining techniques, such as more than 0.73 in our sentiment detection and .90 in our opinionated sentences to API association algorithm. We conducted a total of six user studies to assess the usefulness of the opinion and usage summaries in Opiner. We found that developers were able to select the right API with more accuracy while using Opiner and leveraging opinion summaries in Opiner. Additionally, we found that developers were able to complete their coding tasks with more accuracy, in less time and using less effort while using the usage summaries in Opiner. The details of the user studies and empirical evaluation are subject to our recent papers and journals~\cite{Uddin-OpinerReviewAlgo-ASE2017,Uddin-OpinerReviewToolDemo-ASE2017,Uddin-MiningUsageScenarios-ASE2018, Uddin-SummarizationUsageScenariosOpiner-TSE2018,Uddin-OpinionValue-TSE2018}. We summarize the user studies below. \vspace{1mm}\noindent\textbf{Effectiveness of Opiner Review Summaries.} We conducted two user studies to assess the usefulness of the opinion summaries in Opiner and four studies were used to assess the usefulness of the usage scenario summaries in Opiner. In the first study, we compared our proposed summaries (aspect-based and statistical) against the cross-domain review summarization techniques (summaries in paragraphs, topic-based). We compared the summaries using five development scenarios: \begin{inparaenum} \item Selection of APIs among choices, \item Documentation of an API, \item Presentation of an API to others to justify its selection to team members, \item Staying aware of an API over time, and \item Authoring a competing API to address the problems of an existing API. \end{inparaenum} A total of 10 professional software developers were asked to rate the usefulness of the summaries for the five tasks. A number of criteria were used to rate, such as usability of the API over other APIs, completeness of the summaries to produce a documentation, etc. The aspect-based summaries were rated as the most useful (more than 85\% rating), followed by the statistical summaries (more than 70\%). The paragraph-based summaries were considered as the least useful (less than 40\% rating). We conducted the study on-site of a software company. A total of nine software developers from the company participated in the study. The developers were given access to Opiner online tool. The developers were asked to complete the tasks using Opiner and Stack Overflow. Both tasks involved the selection of an API among two competing APIs. For example, the first task asked the developers to pick one of the two APIs (GSON and org.json). The criteria used to select were the usability and licensing restrictions of the two APIs. The developers were asked to consult Stack Overflow and the review summaries in Opiner. The developers made the best decision while using Stack Overflow with Opiner, instead of while using Stack Overflow only. All the developers considered Opiner to be usable and wished to use it in their daily development tasks. \vspace{1mm}\noindent\textbf{Effectiveness of Opiner Usage Summaries.} We conducted four user studies to assess the usefulness of the usage scenario summaries in Opiner. The first study involved the coding of four development tasks and the other involved surveys. A total of 33 professional software developers and students participated in the four user studies (33 in the coding tasks, and 31 of the 34 in each of the surveys). In the coding study, each participant was given four tasks, for which they wrote code. They used four different development resources (one each for the four tasks): Stack Overflow, API official documentation, Opiner usage summaries, and everything including search engines. We observed an average accuracy of 0.62 in the provided solutions while the participants used the Opiner usage summaries. The second best was the everything setting with an accuracy of 0.55, followed by an accuracy of 0.5 when the participants used only Stack Overflow. The participants showed the least accuracy (0.46) while using the API official documentation. In subsequent surveys, more than 80\% of the participants agreed that the usage summaries in Opiner can offer improvements over API official documentation and the developer forums. For example, the developers recommended that the usage summaries should be integrated with the API official documentation. \section{Primary Survey Results} \label{sec:results} During the open-coding process of the nine open-ended questions, 37 categories emerged (excluding `irrelevant' and responses such as `Not sure'). We labelled a quote as `Not Sure' when the respondent in the quote mentioned that he was not sure of the specific answer or did not understand the question. For example, the following quotes were all labelled as `Not sure': \begin{inparaenum} \item \emt{Don't know} \item \emt{I am not sure} \item \emt{This is a hard problem.} \item \emt{I'm not sure what this question is asking.} \end{inparaenum} The 37 categories were observed a total of 1,019 times in the quotes. 46 quotes have more than one category. For example, the following quote has three categories (Documentation, API usage, and Trustworthiness): \emt{Many responses are only minimally informed, have made errors in their code samples, or directly contradict first-party documentation.} In Table~\ref{tab:s2Categories} (Appendix~\ref{sec:app-open-coding-results}), we show the distribution of the categories by the questions. In Figure~\ref{fig:ResponseNumsS2}, we show the number of participants that answered the different questions in the primary survey. We discuss the results below. \begin{figure}[t] \centering \hspace*{-.5cm}% \includegraphics[scale=0.78]{images_new/ResponseNumsS2} \caption{The number of responses to the questions in the primary survey} \label{fig:ResponseNumsS2} \end{figure} \subsection{Reasons for Seeking Opinions about APIs (RQ1.1)} We report the responses of the developers along the three sub-questions: \begin{inparaenum \item Sources for development and opinion needs, \item Factors motivating developers to seek opinion about APIs from developer forums, and \item Challenges developers face while seeking for opinions about APIs from developer forums. \end{inparaenum} \subsubsection{Sources for Opinions about APIs (RQ1.1.a)} We asked the developers three questions (Q2, 16, 17 in Table~\ref{tab:s2questions}). \bnd{Q2} \textit{We asked them to give a list of the top developer forums they visited in the last two years}. The respondents reported 40 different developer forums. Stack Overflow and its companion sites in Stack Exchange were reported the most (94 times), at least once by each respondent. The other major forums listed were (in order of frequency): \begin{inparaenum} \item GitHub issue tracker (9), \item Google developer forum (8), \item Apple developer forum (6), \item Twitter/Quora/Reddit/Slack (3) \end{inparaenum} The other mentions were blog lists, internal mailing lists, XDA, Android forums, etc. \bnd{Q16} \textit{We further asked them which sources they use to seek opinions about APIs}. We gave them six options to choose from: \begin{inparaenum} \item Developer forums, e.g., Stack Overflow (Picked by all 83 developers who mentioned that they valued the opinions of other developers and that they visit developer forums). \item Co-workers (63 developers), \item IRC chats (22 developers), \item Internal mailing lists (24 developers), \item None (0 developers), \item Others. For `Others', we gave them a text box to write the name of the forums. Among the other sources, developers picked a variety of online resources, such as, Google search engine, Hacker news, blogs, Slack (for meetups), GitHub, Twitter, etc. \end{inparaenum} The Google and Apple developer forums were present in the list of forums that the developers visited in the last two years, but they were absent in the list of forums where developers visit to seek opinions. Stack Overflow was picked in both questions as the most visited site by the developers both as a general purpose forum to find information about APIs and as a forum to seek opinions about APIs. {We observed the presence of Twitter in both lists (Q2 and Q16). Therefore, besides Stack Overflow, Twitter can be another resource to support developer's learning needs, as was previously observed by Sharma et al.~\cite{Sharma-TwitterSerendipitous-SANER2017}.} \bnd{Q17} \textit{We asked the developers about their frequency of visiting the online developer forums (e.g., Stack Overflow) to get information about APIs (Q17)}. There were six options to choose from: \begin{inparaenum} \item Every day (picked by 36.1\% of the developers), \item Two/three times a week (32.5\%), \item Once a week (14.5\%), \item Once a month (16.9\%), \item Once a year (0\%), \item Never (0\%). \end{inparaenum} Therefore, most of the developers (83.1\%) reported that they visit developer forums at least once a week, with the majority (36.1\%) visiting the forums every day. Each developer reported to visit the developer forums to seek opinions about APIs at least once a month. \begin{tcolorbox}[title=Reasons for Seeking Opinions about APIs (RQ1.1) \hrule \textit{Sources for Opinions about APIs (RQ1.1.a)}, opacityback=0, standard jigsaw,] Stack Overflow was considered as the major source to seek information and opinions about APIs. Developers also use diverse informal documentation resources, e.g., blogs, Twitter, GitHub issue tracking system, etc. \end{tcolorbox} \subsubsection{Factors Motivating Opinion Seeking (RQ1.1.b)} We asked the developers two questions (Q4,18 in Table~\ref{tab:s2questions}). For each category as we report below (e.g., \co{Expertise}\info{31,31} below), the superscript $(n,m)$ is interpreted as follows: $n$ for the number of quotes found in the responses of the questions, and $m$ is the number of total distinct participants provided those responses. A similar format was previously used by Treude et al.~\cite{Treude-SummarizingDevelopmentActivity-FSE2015} (except $m$, i.e., number of respondents). \bnd{Q4} \textit{We asked the developers to write about the reasons for them to refer to opinions about APIs from other developers}. The developers seek opinions for a variety of reasons: \begin{enumerate}[leftmargin=10pt] \item To gain overall \co{Expertise}\info{31,31} about an API by learning from experience of others. Developers consider the opinions from other expert developers as indications of real-word experience and hope that such experience can lead them to the right direction, \emt{Getting experience of others can save a lot of time if you end up using a better API or end up skipping a bad one.}. \item To learn about the \co{Usage}\info{17,16} of an API by analyzing the opinion of other developers posted in response to the API usage scenarios in the posts. Developers consider that certain edge cases of an API usage can only be learned by looking at the opinions of other developers, \emt{It's especially helpful to learn about problems others' faced that might only be evident after consider time is spent experimenting with or using the API in production.} They expect to learn about the potential issues about an API feature from the opinions, before they start using an API, \emt{Because there is always a trick and even best practice which can only be provided by other developers.} \item To be able to \co{Select}\info{13,12} an API among multiple choices for a given development. The developers think that the quality of APIs can vary \textit{considerably}. Moreover, not all APIs may suit the needs at hand. Therefore, they expect to see the pros and cons of the APIs before making a selection. \emt{If I don't know an API and I need to pick one, getting the opinion of a few others helps make the decision.} To make a selection or to meet the specific development needs at hand, the developers leverage the knowledge about the API aspects expressed in the opinions about the competing APIs. \begin{enumerate}[leftmargin=10pt] \item the \co{Documentation}\info{11,11} support, e.g., when the official documentation is not sufficient enough, \emt{possibility to get an answer to a specific question (which may not be explained in other sources like the API's documentation)}. \item the \co{Community}\info{11,9} engagement in the forum posts and mailing lists, \emt{for instance, Firebase team members are active on Stack Overflow.} \item the \co{Usability}\info{1,1} and design principles of the API and the \co{Performance}\info{8,8} of the API to assess API quality, \emt{It allows me to see common gotchas, so I can estimate the quality of the API based on those opinions, not just my own.} \end{enumerate} \item To improve \co{productivity}\info{9,8} by saving time in the decision making process, \emt{Getting experience of others can save a lot of time if you end up using a better API or skipping a bad one.} \item To \co{trust}\info{13,11} and to \textit{validate} the claims about a specific API usage or feature (e.g., if a posted code example is good/safe to use), because \emt{They represent hands-on information from fellow devs, free of marketing and business.} \end{enumerate} \begin{figure*} \centering \includegraphics[scale=.86]{images_new/WhenDoYouSeekOpinionsAboutAPIs} \caption{Developer motivation for seeking opinions about APIs.} \label{fig:WhenDoYouSeekOpinionsAboutAPIs} \end{figure*} \bnd{Q18}\textit{We asked the developers about the specific development needs that may motivate them to seek opinions about APIs.} We solicited opinions using a five-point Likert-scale question. The analysis of the responses (Figure~\ref{fig:WhenDoYouSeekOpinionsAboutAPIs}) shows that developers find selection-related factors (i.e., determining replacement of an API and selection of an API among choices) to be the most influential for seeking for opinions (88\% and 80.7\% of all respondents agreed/strongly agreed, respectively). Developers also seek opinions when they need to improve a software feature or to fix a bug (69.9\% and 68.7\% agreement, respectively). 56.6\% of the respondents seek help during the development of a new API, such as, addressing the shortcomings of the existing API. Developers are less enthusiastic to rely on opinions for validating their choice of an API to others (38.6\%), or replacing one version of an API with another version (27.7\%). Only 15.7\% of the respondents mentioned that they seek opinions for reasons not covered by the above options. Note that while the `Neutral' responses are not shown in Figure~\ref{fig:WhenDoYouSeekOpinionsAboutAPIs}, we include the neutral counts in our calculation of percent agreements above. Our charts to show the results of Likert-scale questions (e.g., Figure~\ref{fig:WhenDoYouSeekOpinionsAboutAPIs}) follow similar formats as adopted in previous research~\cite{Kononenko-CodeReviewQuality-ICSE2016,Bird-BranchWhatIf-FSE2012}. \begin{tcolorbox}[title=Reasons for Seeking Opinions about APIs (RQ1.1) \hrule \textit{Factors Motivating Opinion Seeking (RQ1.1.b)}, opacityback=0, standard jigsaw,] Developers seek opinions about APIs in developer forums to support diverse development needs, such as building \textit{expertise} about API aspects, learning nuances about specific API usage, making a selection of an API among choices, etc. \end{tcolorbox} \subsubsection{Challenges in Opinion Seeking (RQ1.1.c)} We asked developers two questions (Q5, 6 in Table~\ref{tab:s2questions}) to determine the way developers seek information and opinions about APIs and the challenges they face while seeking and analyzing the opinions. \bnd{Q5}\textit{We asked the developers to write about how they seek information about APIs in a developer forums and how they navigate through multiple forums posts to form an informed insight about an API.} More than 83\% of the respondents include some form of \co{searching}\info{94,79} using a general purpose search engine (e.g., Google) or using the provided search capabilities in the forums. In the absence of a suitable alternative, the developers learn to trust such resources, \emt{I use Google and trust Stack Overflow's mechanisms for getting the best posts into the top search results} However, they also cite that they learn to be patient to get the \textit{right} results from the search engines, \emt{Google and patience}. Because such search can still return many results, developers employ different mechanisms to navigate through the results and to find the information that they can consider as the \textit{right} result. Such mechanisms include, the ranking (e.g., top hits) of the results, the manual \co{Similarity}\info{3,3} assessment of the search results by focusing on the \textit{recency} of the opinion, the analysis of the presence of \co{Sentiments}\info{4,4} in the post about the API, \emt{I usually google keyword and then look for the positive and negative response}. \bnd{Q6} \textit{We asked developers to write about the challenges they face, while seeking for opinions about APIs from developer forums.} The major challenge developers reported was to get the \co{situational relevancy}\info{26,22} of the opinions within their usage needs. Such difficulties can stem from diverse sources, such as, finding the right question for their problem, or realizing that the post may have only the fraction of the answers that the developer was looking for, \emt{It's hard to know what issues people have with APIs so it's difficult to come up with something to search for.} Another relevant category was \co{Recency}\info{13,13} of the provided opinion, as developers tend to struggle whether the provided opinion is still valid within the features offered by an API, \emt{Information may be outdated, applying to years-old API versions}. The assessment of the \co{Trustworthiness}\info{21,20} of the provided opinion as well as the opinion provider were considered as challenging due to various reasons, such as, lack of insight into the expertise level of the opinion provider, bias of opinion provider, etc. According to one developer, \emt{Sometimes it's hard to determine a developer's experience with certain technologies, and thus, it may be hard to judge the API based on that dev's opinion alone}. The \q{information overload}{3,3} in the forum posts while navigating through the forum posts was mentioned as a challenge, \emt{They provide many different opinions, and I have to aggregate all information and make my own decision}. The absence of answers to questions, as well as the presence of low quality questions and answers, and the \q{Lack of Information}{1,1} in the answers were frustrating to the developers during the analysis of the opinions. The developers mention about their extensive reliance on the \q{Search}{15,11} features offered by both Stack Overflow and general purpose search engines to find the right information. Finding the right keywords was a challenge during the searching. Developers wished for better search support to easily find duplicate and unanswered questions. Lack of knowledge on how to search can prove a blocker in such situations, \emt{If I'm inexperienced or lacking information in a particular area, I may not be using the right terminology to hit the answers I'm looking for.} Developers expressed their difficulties during their \q{selection}{6,6} of an API by leveraging the opinions. The lack of opinions and information for newer APIs is a challenge during the selection of an API, \emt{With newer APIs, there's often very little information.}. Developers can have specific requirements (e.g., performance) for their \q{Usage}{8,8} of an API, and finding the opinion corresponding to the requirement can be non-trivial (e.g., is the feature offered by this API scalable?). The necessity to analyze opinions based on specific API aspects was highlighted by the developers, such as, \begin{enumerate}[leftmargin=10pt] \item link to the \q{Documentation}{4,4} support in the opinions,\emt{Ensuring that the information is up-to-date and accurate requires going back-and-forth between forums and software project's official docs to ensure accuracy (in this case official docs would be lacking, hence using forums is the first place)} \item \q{compatibility}{4,4} of an API feature in different versions, \emt{filtering for a particular (current) API version is difficult.} \item \q{Usability}{2,2} of the API, and the activity, and engagement of the supporting \q{community}{9,7}, \emt{But looking at several questions in a particular tag will help give a feeling for the library and sometimes its community too.} \end{enumerate} The lack of a proper mechanism to support such analysis within the current search engine or developer forums make such analysis difficult for the developers. Finally, getting an instant insight into the \q{expertise}{3,3} of the opinion provider is considered as important by the developers during their analysis of the opinions. The developers consider that getting such insight can be challenging, \emt{Need to figure out if the person knows what they are talking about and is in a situation comparable to ours.} \begin{tcolorbox}[title=Reasons for Seeking Opinions about APIs (RQ1.1) \hrule \textit{Challenges in Opinion Seeking (RQ1.1.c)}, opacityback=0, standard jigsaw,] Majority of the developers leverage search engines to look for opinions. They manually analyze the presence of sentiments in the posts to pick the important information. The developers face challenges in such exploration for a variety of reasons, such as the difficulty in associating such opinions within the contexts of their development needs, the lack of enough evidence to validate the trustworthiness of a given claim in an opinion, etc. \end{tcolorbox} \subsection{Needs for API Review Quality Assessment (RQ1.2)} We asked three questions (Q3,7,24 in Table~\ref{tab:s2questions}, two open-ended). \bnd{Q3} \textit{We asked the developers whether they value the opinion about APIs of the other developers in the developer forums.} 89.2\% of the respondents mentioned that they value the opinion of other developers in the online developer forums, such as, Stack Overflow. 10.8\% reported that they do not value such opinions. \bnd{Q24} \textit{We asked the 10.8\% participants who do not value the opinion of other developers to provide us the reasons why they do not value such opinions.} The developers cited their concern about \co{trustworthiness}\info{4,3} as the main reason, followed by the lack of \co{Situational relevancy}\info{2,2} of the opinion to suit specific development needs. The concerns related to the trustworthiness of the opinion can stem from diverse factors, such as, the \textit{credibility} and the \textit{experience} of the poster, \emt{They are usually biased and sometimes blatant advertisements.}. Lack of trust can also stem from the inherent bias someone may possess towards a specific computing platform (e.g., Windows vs Linux developers). We note that both of these two categories were mentioned also by the developers who value opinions of other developers. However, they mentioned that by looking for diverse opinions about an entity, they can form a better insight into the trustworthiness of the provided claim and code example. We now report the results from responses of the 89.2\% developers who reported that they value the opinion of other developers. \bnd{Q7}\textit{The open-ended question asked developers to write about the factors that determine the quality of the provided opinion.} The following factors are used to assess the quality of the opinions: \begin{enumerate}[leftmargin=10pt,topsep=0pt] \item The quality of the provided opinions as comparable to API official \q{documentation}{54,49}. Forum posts are considered as informal documentation. The developers expected the provided opinions to be considered as an alternative source of API documentation. Clarity of the provided opinion with proper writing style and enough details with links to support each claim are considered as important when opinions can be considered as of good quality. In particular, the following metrics are cited to assess opinions as a form of API documentation. \begin{enumerate}[leftmargin=10pt,topsep=0pt \item \textbf{Completeness} of the provided opinion based on the \emt{Exhaustiveness of the answer and comparison to others} \item \textbf{Acceptable writing quality} by using \emt{proper language} and \emt{Spelling, punctuation and grammar.} \item \textbf{Accompanying with facts}, such as using \textit{screenshots or similar suggestions}, \textit{examples from real world applications}, or \emt{Cross-referencing other answers, comments on the post, alternate answers to the same question.} \item \textbf{Brevity of the opinion} by being \emt{brief and to the point} \item \textbf{Providing context} by discussing \emt{identified usage patterns and recognized API intent} \item \textbf{Accompanying code examples with reaction}, \emt{Code samples, references to ISOs and other standards, clear writing that demonstrates a grasp of the subjects at hand} \end{enumerate} \item The \q{Reputation}{35,33} of the opinion provider and upvote to the forum post where the opinion is found, \emt{If the poster has a high Stack Overflow score and a couple of users comment positively about it, that weighs pretty heavily on my decision.} \item The perceived \q{Expertise}{13,12} of the opinion provider within the context of the provided opinion, \emt{It's easy to read a few lines of technical commentary and identify immediately whether the writer is a precise thinker who has an opinion worth reading.} \item The \q{Trustworthiness}{8,5} of the opinion provider who demonstrates \textit{apparent fairness and weighing pros/cons}. \item The \q{situational relevance}{12,9} of the provided opinion within a given development needs, and \item The \q{recency}{6,6} of the opinion, \emt{posts more than a few years old are likely to be out of date and counterproductive.} \end{enumerate} \begin{tcolorbox}[title=Needs for API Review Quality Assessment (RQ1.2), opacityback=0, standard jigsaw,] Developer analyze the quality of the opinions about APIs in the forum posts by considering the opinions as a source of \textit{API documentation}. They employ a number of \textit{metrics} to judge the quality of the provided opinions, e.g., the clarity and completeness of the provided opinion, the presence of code examples, the presence of detailed links supporting the claims, etc. \end{tcolorbox} \subsection{Tool Support for API Review Analysis (RQ2.1)} We asked four questions (Q8-10, 19 in Table~\ref{tab:s2questions}, one open-ended) . \bnd{Q8}\textit{We asked developers whether they currently rely on tools to analyze opinions about APIs from developer forums.} 13.3\% responded with a `Yes' and the rest (86.7\%) with a `No'. \bnd{Q9}\textit{We further probed the developers who responded with a `No'. We asked them whether they feel the necessity of a tool to help them to analyze those opinions.} The majority (62.5\%) of the developers were unsure (`I don't know'). 9.7\% responded with a `Yes' and 27.8\% with a `No'. \bnd{Q10}\textit{We further probed the developers who responded with a `Yes'. We asked them to write the name of the tool they currently use.} The developers cited the following tools: \begin{inparaenum} \item Google search, \item Stack Overflow votes, \item Stack Overflow mobile app, and \item GitHub pulse. \end{inparaenum} \begin{figure*} \centering \includegraphics[scale=.86]{images_new/WhatToolsBetterSupportOpinionUnderstanding} \caption{ Tool support for analyzing API opinions.} \label{fig:WhatToolsBetterSupportOpinionUnderstanding} \end{figure*} \bnd{Q19} was a multiple choice question, with each choice referring to one specific tool. The choice of the tools was inspired by research on sentiment analysis in other domains~\cite{liu-sentimentanalysis-handbookchapter-2010}. To ensure that the participants understood what we meant by each tool, we provided a one-line description to each choice. The choices were as follows (in the order we placed those in the survey): \begin{enumerate}[leftmargin=10pt,topsep=0pt \item \textbf{Opinion miner}: for an API name, it provides only the positive and negative opinions collected from the forums. \item \textbf{Sentiment analyzer}: it automatically highlights the positive and negative opinions about an API in the forum posts. \item \textbf{Opinion summarizer}: for an API name, it provides only a summarized version of the opinions from the forums. \item \textbf{API comparator}: it compares two APIs based on opinions. \item \textbf{Trend analyzer}: it shows sentiment trends towards an API. \item \textbf{Competing APIs}: it finds APIs co-mentioned positively or negatively along an API of interest and compares those. \end{enumerate} The respondents' first choice was the `Competing APIs' tool (6), followed by a `Trend Analyzer' to visualize trends of opinions about an API (5), an `Opinion Miner' (1) and a `Summarizer' (3) (see Figure~\ref{fig:WhatToolsBetterSupportOpinionUnderstanding}). The sentiment analyzer (2) is the least desired tool, i.e., developers wanted tools that do not simply show sentiments, but also show the context of the provided opinions. Note that an opinion search and summarization engine in other domain (e.g, camera reviews) not only show the mined opinions, but also offer insights by summarizing and revealing trends. The engines facilitate the comparison among the competing entities through different aspects of the entities. Such aspects are also used to show the summarized viewpoints about the entities (ref Figure~\ref{fig:opiniontools-camera}). Therefore, it was encouraging to see that developers largely agreed with the diverse summarization needs of API reviews and usage information, which corroborate with the similar summarization needs in other domains. \begin{tcolorbox}[title=Tool Support for API Review Analysis (RQ2.1), opacityback=0, standard jigsaw,] To analyze opinions about APIs in the forums, developers leverage traditional search features in the absence of a specialized tool. The developers agree that a variety of opinion analysis tools can be useful in their exploration of opinions about APIs, such as, opinion miner and summarizer, a trend analyzer, and an API comparator engine that can leverage those opinions to facilitate the comparison between APIs. \end{tcolorbox} \subsection{Needs for API Review Summarization (RQ2.2)} As we observed in the previous section, a potential opinion summarization engine about APIs need to show both summarized viewpoints about an API and support the comparison of APIs based on those viewpoints. To properly understand how and whether such summarization can indeed help developers, we probed the participants with a number of question. Specifically, we present the analysis of their responses along three themes (RQs 2.2a, b, and c in Sections~\ref{sec:factors-summarization}-\ref{sec:summarization-types}. \subsubsection{Factors Motivating Summarization Needs (RQ2.2.a)}\label{sec:factors-summarization} We asked the developers three questions (Q20-22 in Table~\ref{tab:s2questions}). \bnd{Q20}\textit{We asked developers how often they feel overwhelmed due to the abundance of opinions about APIs in the developer forums.} 3.6\% of the developers mentioned that they are `Always' overwhelmed, 48.2\% are `Sometimes' overwhelmed and 37.3\% are `Rarely' overwhelmed. Only 10.8\% developers mentioned that they are `Never' overwhelmed by the abundance of opinions about APIs in the developer forums. \bnd{Q21}\textit{We then asked them whether a summarization of those opinions would help them make better decisions about APIs?} 38.6\% responded with a `Yes' and 13.3\% responded with a `No'. 48.2\% were unsure (`I don't know'). \bnd{Q22}\textit{We examined the needs to opinion summarization using a five-point Likert-scale with seven options}\footnote{Before conducting the two surveys, the first author manually analyzed around 1,000 posts from Stack Overflow. The goal was to understand the type of opinions developers share about APIs in the forum posts. The options were selected based on our observation of API reviews in forum posts.}: \begin{inparaenum} \item Too many forum posts with opinions, \item Opinions can evolve over time in different posts, \item Opinions can change over time, \item The interesting opinion may not be in the posts that you have looked in, \item Contradictory opinions about an API may be missed, \item Not enough time to look at all opinions, and \item Other reason. \end{inparaenum} The same options were also used in the pilot survey and we observed agreement from the developers across the options. \rev{We remove the analysis of two options (``Opinions can evolve over time in different posts'' and ``Opinions can change over time''), because both may be perceived as similar by the participants without a clarification.} The analysis of the rest of the options (Figure~\ref{fig:OpinionsNeedTobeSummarizedBecause}) shows that nearly all developers agree that opinion summarization is much needed for several reasons. The vast majority of the respondents think that an interesting opinion about an API might be expressed in a post that they have missed or have not looked at. The need for opinion summarization is also motivated by the presence of too many posts to explore. Developers also believed that the lack of time to search for all possible opinions and the possibility of missing an important opinion are strong incentives for having opinions organized in a better way. \begin{tcolorbox}[title=Needs for API Review Summarization (RQ2.2) \hrule \textit{Factors Motivating Summarization Needs (RQ2.2.a)}, opacityback=0, standard jigsaw,] The developers reported that they feel overwhelmed due to the abundance of opinions about APIs in the developer forums. The developers were in agreement that such difficulty arises due to a variety of reasons, such as, relevant opinions about an API may be missed because those opinions were in posts not checked by the developer, the lack of enough time to find all such opinions, etc. \end{tcolorbox} \begin{figure*} \centering \includegraphics[scale=.82]{images_new/OpinionsNeedTobeSummarizedBecauseShort} \caption{Developer needs for opinion summarization about APIs.} \label{fig:OpinionsNeedTobeSummarizedBecause} \end{figure*} \subsubsection{Summarization Preferences (RQ2.2.b)}\label{sec:summarization-preferences} We asked three questions (two open-ended) to understand the relative benefits and problems developers may encounter during their usage of API review summaries from developer forums (Q13,14, and 23 in Table~\ref{tab:s2questions}). \bnd{Q13}\textit{We asked developers to write about the areas that can be positively impacted by the summarization of opinions about APIs from developer forums.} The following areas were considered to be benefited from the summaries: \begin{enumerate}[leftmargin=10pt] \item The majority of the developers considered that \q{API selection}{30,25} is an area that can reap the benefits from the summaries, \emt{It would make the initial review and whittling down of candidates quicker and easier.}. They also considered that API review summarization can improve the \q{Productivity}{12,11} of the developers by offering quick but informed insights about APIs, \emt{It would make the initial review and whittling down of candidates quicker and easier.} \item The developers expected the summaries to assist in their \q{API usage}{7,7}, such as, by showing reactions from other developers for a given code example that can offer \q{situationally relevant}{3,3} insights about the code example (e.g., if the code example does indeed work and solve the need as claimed). The developers consider that they can use a summary as a form of documentation to explore the relative strengths and weaknesses of an API for a given development need. The developers do not expect the official documentation of an API to have such insights, because \emt{You can see how the code really works, as opposed to how the documentation thinks it works}. Indeed, official documentation can be often incomplete~\cite{Robillard-FieldStudyAPILearningObstacles-SpringerEmpirical2011a}. Carroll et al.~\cite{Carroll-MinimalManual-JournalHCI1987a} advocated the needs for \textit{minimal API documentation}, where API usage scenarios should be shown in a task-based view. In a way, our developers in the survey expect the API usage scenarios combined with the opinions posted in the forum posts as effective ingredients to their completion of the task at hand. Hence, they expect that the summaries of opinions about API can help them with the efficient usage of an API during their development tasks, \emt{If summarization is beneficial to understanding API, then any problem even remotely related to that use stands to achieve a network benefit.} \begin{figure*} \centering \includegraphics[scale=.82]{images_new/OpinionSummarizationCanImproveDecisionMakingProcess} \caption{ Impact of opinion summaries on decision making about APIs.} \label{fig:OpinionSummarizationCanImproveDecisionMakingProcess} \end{figure*} \item As we noted earlier in this section, developers leverage the opinions about diverse API aspects to compare APIs during their selection of an API among choices. In the absence of any such automatic categorization available to automatically show how an API operates based on a given aspect (e.g., performance), the developers had expectations that an opinion summarizer would help them with such information. For example, the developers considered that opinion summaries can also improve the analysis about different API aspects, such as, \q{Usability}{2,2}, \q{Community}{2,2}, \q{Performance}{3,3}, \q{Documentation}{6,5}, etc. \item Finally, developers envisioned that opinion summaries can improve the \q{Search}{6,6} for APIs and help them find better \q{Expertise}{4,4} to learn and use APIs. \end{enumerate} \bnd{Q14}\textit{We next asked developers to write about the areas that can be negatively impacted by the summarization of opinions about APIs from developer forums.} The purpose was to be aware of any drawback that can arise due to the use of API opinion summaries. \begin{enumerate}[leftmargin=10pt] \item Developers considered that opinion summaries may \q{Miss Nuances}{18,12} in the API behavior that are subtle, may not be as frequent, but that could be \emt{key design choices or the meta-information \ldots}. The \q{reasoning}{7,6} about opinions can also suffer because of that. \item While developers considered the selection of an API as an area that can be positively affected by opinion summaries in general, they also raised the concern that summaries may negatively impact \q{API selection}{6,6} when more subtle API aspects are not as widely discussed as other aspects, because \emt{Popularity and fashion trends may mask more objective quality criteria }. Summaries may become \q{API Barrier}{3,3} when new APIs with less number of opinions are not ranked higher in the summaries, \emt{Just relying on the summarization for deciding for or against an API will probably not be enough and may lead to decisions that are less than optimal.} \end{enumerate} \bnd{Q23}\textit{We asked developers about how opinion summaries can support their tasks and decision making process.} There were nine options. We used the same options we used to solicit the needs for opinions about APIs in Figure~\ref{fig:WhenDoYouSeekOpinionsAboutAPIs}. This was due to the fact that the purpose of an opinion summarizer should be to facilitate the easier and efficient consumption of opinions. In Figure~\ref{fig:OpinionSummarizationCanImproveDecisionMakingProcess}, we present the responses of the developers. More than 70\% of the developers believe that opinion summarization can help them with two decisions: 1) determining a replacement of an API and 2) selecting the right API among choices. Developers agree that summaries can also help them improve a software feature, replace an API feature, and validate the choice of API. Fixing a bug, while receiving 38.6\% of the agreement, might not be well supported by summaries since this task requires certain detailed information about an API that may not be present in the opinions (e.g., its version, the code itself, the feature). The developers mostly disagreed with the use of opinions to select an API version (28.9\% agreement only). \begin{tcolorbox}[title=Needs for API Review Summarization (RQ2.2) \hrule \textit{Summarization Preferences (RQ2.2.b)}, opacityback=0, standard jigsaw,] The summarization of opinions about APIs can be effective to support the selection of an API among choices, the learning of API usage cases, etc. Developers expect a gain in productivity in supporting such needs by the opinion summarizer. However, developers expressed their cautions with a potential opinion summarizer for APIs, when for example, subtle nuances of an API can be missed in the summary. Another concern is that summaries can make it difficult for a new API to be adopted. For example, developers may keep using the existing APIs, because they are possibly reviewed more than the new APIs. \end{tcolorbox} \subsubsection{Summarization Types (RQ2.2.c)}\label{sec:summarization-types} We asked developers three questions (Q11,12,15 in Table~\ref{tab:s2questions}) to learn about their preferences on how they would like to have opinion summaries about APIs to be produced. \bnd{Q11}\textit{We asked developers to write about the different factors in an API that play a role during their decision to choose the API.} The purpose was to learn what specific API aspects developers consider as important. Intuitively, developers would like to see opinions about those aspects in the forum posts to make a decision on the API. The developers mentioned about the following API aspects as factors contributing to their decisions to choose an API: \begin{enumerate}[leftmargin=10pt] \item\textbf{\q{Usability}{87,56}} \begin{enumerate} \item Simple. \emt{Simplicity, compliance with standards} \item Ease of use. \emt{\ldots easy to replace, simple to use} \item Design. \emt{clearly designed \& documented usage protocol} \item Stable. \emt{\ldots, so it doesn't change every 10 days?} \end{enumerate} \item\textbf{\q{Documentation}{47,43}} \begin{enumerate} \item Clear. \emt{Clear documentation \ldots}, \item Consistent. \emt{\ldots, has to be intuitive (consistent naming)} \item Complete and correct with examples. \emt{Correctness, completeness, documentation \& examples} \item Availability. \emt{clear and complete description, and a good blogging is a big bonus} \end{enumerate} \item\textbf{\q{Community}{31,22}} \begin{enumerate} \item Active Community. \emt{Code quality, maintainer activity, ratio of answered/unanswered questions about the API.} \item Mature. \emt{Strong Stack Overflow community (to show that the API is relatively mature).} \item Reputation. \emt{Reputation of the organization.}, \emt{Other works of its creators.} \end{enumerate} \item\textbf{\q{Performance}{30,23}} \emt{Has it been used in production grade software before?} \item\textbf{\q{Compatibility}{18,14}} \begin{enumerate} \item Language. \emt{Implemented in the language I need it.} \item Other API. \emt{Uniformity with other API \ldots} \item Framework/Project. \emt{compatibility (will it work for project I'm working on)} \end{enumerate} \item\textbf{\q{Legal}{15,14}}\emt{\ldots the API is open source and maintained.} \item\textbf{\q{Portability}{5,5}} \emt{Thread safety, sync/async, cross-language and cross-OS support, etc. } \item\textbf{\q{Security}{2,2}} \emt{Are security issues addressed quickly?} \item\textbf{\q{Bug}{1,1}} \emt{Features, ease of use, documentation, size and culture of community, bugs, quality of implementation, performance, how well I understand its purpose, whether it's a do-all framework or a targeted library, \ldots } \end{enumerate} The \q{Usage scenarios}{10,9} of an API, and the \q{Features}{4,4} it supports are also considered to be important factors to be part of the opinion summaries. \bnd{Q12}\textit{We asked developers to provide their analysis on how opinions about APIs can be summarized when such opinions are scattered across multiple forum posts.} The purpose was to know what techniques developers consider as valuable to aggregate such opinions from diverse posts. While developers mention about using the \q{search}{12,12} features in Stack overflow, they acknowledged that they never thought of this problem deeply. They acknowledge that search engines or Stack Overflow features are really not the summarizer they may need, \emt{Often there is a sidebar with similar questions/discussions, but no easy way to "summarize".} To address their needs for such a summarizer, the idea of a dedicated API \q{Opinion Portal}{18,15} was discussed. In such a portal all opinions about an API can be aggregated and presented in one place, \emt{aggregate similar information, collect `A vs B' discussions } \ldots \emt{like an aggregated portal about an API with all organized or non-organized pages}. Having a centralized portal for such information can be useful, because \emt{Then I can read through them all and synthesize a solution.}. Developers advocated for machine learning approaches to develop such a portal \emt{It would be very interesting for this to be automated via machine learning.} \begin{figure*} \centering \includegraphics[scale=.8]{images_new/APIAspectImportantInOpinion} \caption{Developers' preference to see opinions about API aspects.} \label{fig:APIAspectImportantInOpinion} \end{figure*} Developers wished diverse presentation of opinions in the portal: \begin{enumerate}[leftmargin=10pt] \item \q{Categorized}{8,8} into different API aspects, such as \emt{Summarization by different criteria, categorization}, \item Distributed by \q{Sentiments}{8,5}, such as, star rating (similar to other domains), \emt{do an x-out-of-5 rating for portability, stability, versatility and other attributes}. \item Grouped by \q{Contrastive}{7,7} viewpoints to learn the strengths and weaknesses of an API feature from multiple forum posts, \emt{I make a research if the there are contradicting opinions on stack overflow / etc.} \item Combined with code examples as a form of \q{API usage scenarios}{7,6}, as well as integrated with the \q{API Formal Documentation}{11,9}. \end{enumerate} According to one developer \emt{Unified documentation on Stack Overflow (beta) looks like a positive step in the right direction.} Unfortunately, the Stack Overflow documentation site was shut down on August 8, 2017~\cite{website:sodoc-sunset-2017}, mainly due to a lower than the expected number of visits to the documentation site. Therefore, we can draw insights both from the problems faced by the Stack Overflow documentation site and from the responses of the developers in our survey to develop an API portal that can offer better user experiences to the developers. \bnd{Q15}\textit{We asked developers about 11 API aspects, whether they would like to explore opinions about APIs around those aspects.} The 11 aspects are: \begin{inparaenum} \item Performance, \item Usability, \item Portability, \item Compatibility, \item Security, \item Bug, \item Community, \item Documentation, \item Legal, \item General Features, \item Only sentiment. \end{inparaenum} We note that each of these options are found in the open-ended questions already. Thus, the response to this question can be used to further ensure that we understood the responses of the developers. The results of the relevant Likert-scale survey question are summarized in Figure~\ref{fig:APIAspectImportantInOpinion}. The vast majority of the developers agrees that the presence of documentation, discussion of API's security features, mention of any known bugs in an API, its compatibility, performance, usability, and the supporting user community are the main attributes that contribute to the opinion quality. Developers could not agree whether a useful opinion should include a mention of any legal terms; while they agree that posts containing only one's sentiment (e.g., ``I love API X'' or ``API Y sucks'') without any rationale are not very useful. We note that there was a similar themed open-ended question in Q11. However, the developers were not shown Q15 before their response of Q11. Moreover, the two questions were placed in two separate sections, Q11 in section 4 and Q15 in section 6. There was only one question (i.e., Q11) in section 4. Therefore, the participants did not see Q15 or the options in Q15 during their response of Q11. \begin{tcolorbox}[title=Needs for API Review Summarization (RQ2.2) \hrule \textit{Summarization Types (RQ2.2.c)}, opacityback=0, standard jigsaw,] Developers expect to see opinions about diverse API aspects, such as, usability, performance, security, compatibility, portability, etc. Developers wished for a dedicated opinion portal engine for APIs where they can search for an API and see all the opinions collected about the APIs from the developer forums. \end{tcolorbox} \section{Conclusions and Future Work} \label{sec:conclusion} Opinions can shape the perception and decisions of developers related to the selection and usage of APIs. The plethora of open-source APIs and the advent of developer forums have influenced developers to publicly discuss their experiences and share opinions about APIs. To better understand the role of opinions and how developers use them, we conducted a study based on two surveys of a total of 178 software developers. We are aware of no such previous surveys in the field of software engineering. The design of the two surveys and the survey responses form the first major contribution of this paper. The survey responses offer insights into how and why developers seek opinions, the challenges they face, their assessment of the quality of the available opinions, their needs for opinion summaries, and the desired tool support to navigate through opinion-rich information. We observed the following major findings in our analysis: \begin{enumerate} \item Developers seek opinions about APIs to support diverse development needs, such as selection of an API among available choices. A primary source of such opinions is the online developer forums, such as Stack Overflow. \item Developers face several challenges associated with noise, trust, bias, and API complexity when seeking opinions. High-quality opinions are typically viewed as clear, short and to the point, bias free, and supported by facts. \item Developers feel frustrated with the amount of available API opinions and desire a tool support to efficiently analyze the opinions, such as API comparator, opinion summarizer, API sentiment trend analyzer, etc. \end{enumerate} The findings and insights gained from this study helped us to build a prototype tool, named Opiner. The Opiner framework can be used to mine and summarize opinions about APIs in a fully automatic way. We observed promising results of leveraging the Opiner API review summaries to support diverse development needs. The detailed analysis of the survey responses and the findings form the second major contribution of this paper. Our future work is broadly divided into two directions: \begin{inparaenum} \vspace{1mm}\noindent\item \rev{\textbf{Tool Support by Developer Experience.} As we noted in Section~\ref{sec:demographic-experience}, less experienced developers show more interest to value the opinions and were also more distinct in their preference of tools to support such analysis (API comparator and Trend Analyzer). We plan to investigate the particular characteristics of the less experienced developers which could motivate them more to value opinions of others and to use the tools. Such insights then can be used to motivate the design of tools and APIs by focusing on the demographic needs. It is thus desirable to replicate our study on a randomized sample of Stack Overflow users, because it may give us higher concentration of less experienced developers than the sample we have used (i.e., based on users with high reputation in Stack Overflow).} \vspace{1mm}\noindent\item \textbf{Sentiments vs Emotions.} We plan to investigate the role of finer grained emotions (e.g., anger, fear, etc.) in the daily development activities involving APIs. In particular, we are interested in conducting more surveys and developing tools to advance the knowledge on the impact of emotions in API usage analysis. \end{inparaenum} \section{Threats to Validity} \label{sec:threats} {We now discuss the threats to validity of our study by following the guidelines for empirical studies~\cite{Woh00}.} \subsection{Construct Validity} {\textit{Construct validity threats} concern the relation between theory and observations. In our study, they could be due to the measurement of errors. The accuracy of the open coding of the survey responses is subject to our ability to correctly detect and label the categories. The exploratory nature of such coding may have introduced the \textit{researcher bias}. To mitigate this, we coded 20\% of the cards for four questions independently and measured the coder reliability on the next 20\% of the cards. We report the measures of agreement in Table~\ref{tab:agreementc1c2Fors2}. While we achieved a high level of agreement, we, nevertheless, share the complete survey responses in an online appendix~\cite{website:opinionsurvey-online-appendix}.} {\textit{Maturation threats} concerns the changes in a participant during the study due to the \textit{passage of time}, such as change in development priorities or environments (e.g., moving from open source-based APIs to proprietary APIs). Intuitively, we expect to see greater concentration of opinions about open-source APIs in the forums. None of these concerns are applicable to our surveys, because each survey was supposed to take not more than 30 minutes by each participant.} \subsection{Internal Validity} {Threats to internal validity refer to how well the research is conducted. In our case, it is about how well the design of the surveys allow us to choose among alternative explanations of the phenomenon. A high internal validity in the design can let us choose one explanation (e.g., tool support to assist in opinion analysis) over another (e.g., no need for a tool) with a high degree of confidence, because it avoids (potential) confounds.} {In our primary survey, we sought to avoid confounding factors by asking the participants open-ended questions. The questions with options (i.e., closed questions) were presented to the participants only after they have responded to the open-ended questions. The two types of questions were divided into separate sections, i.e., the participants could not see the closed-ended questions when they answered the open-ended questions. Despite this, we observed similar findings in the responses of the questions. For example, one open-ended question was about the different factors in an API that can play a role in their decisions to choose the API (Q11). The paired closed-ended question was Q15. In both the responses, we found that developers asked for similar API aspects about which they prefer to seek opinions, such as performance, usability, etc.} {Another threat could arise from the placement of the options in a multiple choice question. The threat may influence the participants to agree/disagree with an option more than the other options, such as the option that is placed at the top (i.e., rated first). We did not observe any such pattern in the responses. For example, the first option in our question about tool support in opinion analysis (Q19 in primary survey and Q7 in pilot survey). Both surveys followed the same ordering of the options for the question. Despite this, we observed the lowest rank for the option ``sentiment miner'' in both surveys (second option) and highest rank for the option ``API comparator'' (fourth option). In addition, there was no significant difference in the preference of the participants towards a specific tool over another (see Figure~\ref{fig:WhatToolsBetterSupportOpinionUnderstanding}). Therefore, all such tools were found as favorable by the participants, despite their placements.} \subsection{External Validity} {Threats to external validity compromise the confidence in stating whether the study results are applicable to other groups.} \rev{While our sample size of 900 developers out of a population of 88K developers is small, we received 15.8\% response rate in our primary survey. Moreover, the qualitative assessment of the responses offered us interesting insights about the needs and challenges to seek and analyze opinions about APIs. However, it is desirable that future researches replicate our study on a larger and--or different population of developers to make our findings more generic/robust.} {Due to the diversity of the domains where APIs can be used and developed, the provided opinions can be contextual. Thus, the generalizability of the findings requires careful assessment. Such diversity may introduce \textit{sampling bias} if developers from a given domain are under- or over-represented.} {One related threat could arise due to our sampling of developers from GitHub (for pilot survey) and Stack Overflow (for primary survey). The sampling might have missed developers who do not use GitHub or Stack Overflow. As we noted in Section~\ref{subsec:motivation-surveys}, we picked developers from GitHub and Stack Overflow because of their popularity among the open-source developers. We observed similar findings between our pilot and primary surveys. Nevertheless, a replication of our study involving developers from other online forums could offer further validation towards the generalization of our findings across the larger domains of software engineering.} {Another potential threat of over-representation would be related to all the developers being proficient in only one programming language (e.g., Javascript). This can happen because Javascript has been the most popular language in Stack Overflow over the last six years (according to Stack Overflow survey of 2018~\cite{website:stackoverflow-survey}). In our primary survey population of 88,021 Stack Overflow users, we observed that the Stack Overflow posts where the users participated in 2017, corresponded to all the popular languages found in the Stack Overflow surveys. Moreover, while our sample attempted to assign each user to one of the top nine programming languages, those users also participated in the discussions of APIs involving other programming languages. Therefore, their opinions in the primary survey may be representative of the overall Stack Overflow population.} {In our primary survey, we only collected responses from developers who visit developer forums to seek information about APIs. As we noted in Section~\ref{sec:methodology}, this decision was based on our observation from the pilot survey that developer forums are the primary resource for developers to see such information. In the primary survey, we did not collect additional information from the participants who do not visit developer forums. Further probing of such participants to understand why they do not use developer forums, could have offered us insights into the shortcomings of developer forums to provide such needs. Intuitively, such insights about problems in developer forums can be more concrete from a participant who actually uses developer forums. Therefore, to understand the shortcomings in developer forums, we probed the participants with a number of questions, such as ``What are your biggest challenges while seeking opinions about APIs from developer forums?'' (Q6), ``What areas can be positively/negatively affected by summarization of reviews from developer forums?'' (Q13, 14), and ``What factors in a forum post can help you determine the quality of the provided opinions?'' (Q7). The responses to those questions showed us that developers face numerous challenges while seeking opinions about APIs from forum posts (such as information overload, trustworthiness, etc.). We observed similar findings in our pilot survey. However, we could still have missed important insights from the participants who do not visit developer forums. We leave the analysis of such participants for our future work.} {Our survey samples are derived from GitHub and Stack Overflow developers. We picked the pilot survey participants from a list of 4,500 GitHub users. We randomly selected the primary survey participants from a list of more than 88K Stack Overflow users, each of which also had an account in GitHub. We designed the primary survey by leveraging lessons learned from our pilot survey (see Section~\ref{sec:needs-for-primary-survey}). In our primary survey, we attempted to fix each of the problems. For example, we applied \textit{stratification} in our sampling to ensure that we involve developers from Stack Overflow that are \textit{proficient} in different programming languages. The stratification is necessary, because otherwise a random sample from the 88K Stack Overflow users would have picked more developers from a language that is more popular (e.g., Javascript, Java, and Python) among the developers (in terms of the number of users participating in the discussion of the posts related to the language). In addition, we attempted to include the developers who can be considered as \textit{experts} in those programming languages. Intuitively, expertise of a developer for a programming language can be correlated to his reputation in Stack Overflow posts that are related to the language. The higher reputation score a user has, the more likely those reputation scores are provided by many different users in Stack Overflow, and hence the higher likelihood that the user is considered as an expert within the community. An expert user is thus more likely to offer more concrete information about the APIs used in the language, based on real-world experience.} \subsection{Reliability Validity} {Reliability threats concern the possibility of replicating this study. We attempted to provide all the necessary details to replicate the study. The anonymized survey responses are provided in our online appendix~\cite{website:opinionsurvey-online-appendix}. The complete labels and list of quotes used in the primary survey are also provided in the online appendix.}
\section{Introduction} \par For supervised learning, the gathering of precisely labelled data is crucial to the success of any model, although it is often the most labour-intensive part of any project that requires external resources\cite{Roh2018ASO}. For highly specialised tasks, Subject Matter Experts (SME) are often employed to provide labels, while crowd-sourcing platforms such as Mechanical Turk (MTurk) have also become popular for gathering high volumes of data quickly, when the task can be completed by a layman, as can be seen in the growth of models like ImageNet\cite{Russakovsky2015ImageNetLS} and their ability to sometimes provide labels similar to that of a “gold standard”\cite{snow-etal-2008-cheap}. Obtaining this “gold standard” is crucial to the production of a high-performance model. \par As well as increasing the speed at which data is gathered, having multiple workers label the same data can remove the problem of a single worker being considered infallible, thus reducing the risk of incorrect labels due to human error, whether it be due to lack of expertise in labelling a particular data point, misinterpreting a task\cite{Le10ensuringquality} or applying the incorrect label accidentally. There also remains the possibility that workers simply have different interpretations of the labels they apply\cite{Giancola2018PermutationInvariantCO}. Whether it is crowd-sourced workers or experts, we still run into an issue of which workers we should trust in what instances, and inferring which label can be considered the "ground-truth" for each datum in sample becomes a problem when workers give different labels to a particular data point. While there are methodologies to resolve these problems, little is known about the circumstances under which these methods provide the most benefit and whether some methods are better than others under certain task conditions.\par Crowd-sourcing platforms have grown in popularity due to the ease of gathering data for a relatively low cost. However, accuracy from each worker is not assured and the anonymity of the workers means that the person who wants the data must put blind faith into others who may provide poor quality labels. Halpin \& Blanco\cite{Halpin2012MachineLearningFS} considered two different types of poor quality workers: those who deliberately select answers as quickly as possible in order to get paid - referred to as "bad faith" workers - and those who are "unsuitable" workers, due to their lack of understanding or poor ability. The "bad faith" workers may also be known as "spammers"\cite{Raykar2012EliminatingSA} or “adversarial” workers\cite{Jagabathula2017IdentifyingUA}. The growth of crowd-sourcing platforms has come at the cost of more malicious workers sabotaging machine learning projects for financial gain\cite{Wang2014ManVM}. Detecting these “bad faith” workers is of critical concern for the users of crowd-sourcing platforms, as they waste time and money while also negatively impacting the final decision. On the other hand, some workers may have misunderstood the task or have limited experience of labelling the given data, which can be provided with stronger guidance or training. However, when working with a high number of anonymous workers, it is difficult to disseminate between the two. Detecting poor workers early in a data gathering exercise is of the utmost importance when considering efficiency and cost effectiveness\cite{Lee2018EffectiveQA}. \par Crowd-sourcing platforms, where a high number of workers can be employed, are most suitable for tasks that can be completed by a layman, but tasks requiring a high level of expertise often need SMEs. Owing to a smaller pool of highly skilled expertise, recruiting SMEs is more challenging and costly\cite{Aroyo2013CrowdTH} and crowd-sourcing platforms may not be able to provide access. When a task is of a certain degree of difficulty or complexity, experts can often disagree among themselves - something that is often seen in the diagnosis of medical conditions\cite{Benbadis2010TheTO,Graber2013TheIO,Ehrich2018TheIO} due to the highly specialised nature of the task, and reliance on individual professional experience, adding more difficulty to the data gathering process. As an example, compare a task where a worker must label whether an image is a cat or a dog with a task where a worker must label whether a cancer diagnosis is benign or malignant. The former task has more people who will likely be able to contribute knowledgeably, while the latter necessitates specialised training and expertise. Even in these tasks where we consider people as “experts”, seeing noise in label sets is inevitable and this can have a severe impact on any model if not controlled correctly\cite{Karimi2020DeepLW}. One possible control is employing a single expert, or an “oracle”, to make final decisions on data entries where there is disagreement amongst non-experts\cite{Dolatshah2018CleaningCL}. This, however, creates an extra overhead and also relies upon the knowledge of the “oracle” to be entirely accurate, which is a flawed concept and does not entirely rule out errors in the final label set. \par One of the reasons for disagreements in expert labelling is that even within different fields of expertise, some are better at identifying certain things than others. Additionally, inherent subjectivity ensures there will always be some variation in answers\cite{Raykar2010LearningFC}, as well as bias within each worker\cite{Hube2018LimitBiasMW}. Valizadegan, Nguyen \& Hauskrecht\cite{Valizadegan2013LearningCM}, who attempted to adapt popular consensus methods based on large crowds to work with smaller sets of experts, discussed the impact on expertise labelling as a result of SMEs having different levels of expertise, utilities, knowledge and subjective preference. These various aspects can prove troublesome for those administering the task, as it is often unknown who is right when there are disagreements. Those with specialist knowledge also often use every piece of information available to them, and this cannot always be accounted for within a machine learning labelling task, which is often a replication of a real-world setting. Lacking this information, experts may then have to pivot making probable guesses, which results in more noise in the data set\cite{Brodley1999IdentifyingMT}. \par Whereas some of the previous work has focused on independent aspects of the labelling task like: the number of workers, the number of labels, sample size and the expertise levels of the workers, the differing permutations of each of these parameters has not been fully considered before. More importantly, whether certain ground-truth inference methods are better with certain parameters of a labelling task is not well understood. Previous work has suggested that while there are a number of different options for practitioners to choose from in terms of methods and algorithms, they can largely vary in their performance depending on the data set they are attempting to infer ground-truth from\cite{Zheng2017TruthII}. For the number of workers, previous studies have attempted to offer optimisation for recruitment\cite{Carvalho2015HowMC}, but these have not controlled for the other parameters of the labelling task and have not considered if some methods could provide an opportunity to make the crowd-sourcing recruitment even more efficient. In terms of number of labels, binary label tasks have often been a popular choice in research\cite{Valizadegan2013LearningCM,Zhang2011LearningFI,Welinder2010TheMW}, and while on rare occasions there are tasks with more labels\cite{Yan2010ModelingAE}, these often do not look at data sets where there is a double-digit label taxonomy. \par It is also important to understand the scaling of ground-truth inference depending on the number of labels in a taxonomy, as tasks theoretically become more inherently difficult when more label choices are added. Sample size is something that is often overlooked in machine learning research\cite{Balki2019SampleSizeDM}, and time limitations and cost can often prevent large amounts of data being gathered, meaning there is no guidance for practitioners to maximise their chances of getting the most accurate label set with respect to these restrictions. Expertise can be difficult to ascertain, but is valuable knowledge for any practitioner, as the ideal situation is to get the best possible workers to give more confidence in their answers. However, when this is not an option, as can be seen in crowd-sourcing tasks, it can be of benefit to know how many workers should be employed in order to mitigate against this risk. Alternatively, it is also beneficial to know if there are any advantages to ensuring expertise of workers is high before administering a task. \par The above summarises some of the important considerations regarding interactions between the parameters in labelling tasks. This paper investigates popular methods for inferring ground-truth from multiple workers and aims to explore how they are impacted by the various parameters of a labelling task, drawing conclusions about which methods are suited to which parameters and providing guidance for when they can be proven to be advantageous when label consensus is sought. Although previous research has looked at comparison of some popular methods, there are no studies, to our knowledge, that consider the impact of all the parameters discussed above or the relationship of ground-truth inference methods with all these parameters. Thus, this paper will attempt to determine the parameters that popular methods for ground-truth inference work best under and will help provide future researchers with guidance as to when the chosen popular methods are appropriate and when they are not. As well as this, while previous studies have focused on the number of workers crowd-sourcing works best at\cite{Carvalho2015HowMC}, we hope to provide more depth to optimal crowd-sourcing choices by studying the relationships between all the parameters with respect to the methods, as opposed to the impact of a single parameter. \par \section{Establishing Ground Truth} \label{sec:headings} \subsection{Majority Vote} The easiest and most common way to get the ground-truth label when multiple workers have provided an answer is to use Majority Vote (MV). In its briefest definition, the answers of workers for each input item are treated as votes, with the popular vote being considered the ground-truth. \par Take an example where three workers have labelled a single data item, where the label can be either "red" or "blue". The first two workers choose "red", while the final worker chooses "blue". When a practitioner comes to assigning a label to this data item for training a model, the label "red" would be chosen, since more workers have chosen this than “blue”. This means that any mistakes made by a single worker are mitigated. With a binary label choice and an odd number of workers, there is always a guarantee of a consensus label, but outside of these resources and task choices things can become more difficult. Take the previous example and add a third label - "yellow”. Presume each of the three workers has picked a different label; there is now no majority to pick from for this data item. Alternatively, having an even number of workers for the task with a binary option means that there is a possibility of an even 50/50 split in answers. Let us consider a situation where we have four workers as well as the three labels previously mentioned: two of our workers select "red", one worker selects "blue" and the final worker selects "yellow". This leaves the practitioner in a dilemma; the label "red" now has some agreement among the workers, but it is not a majority exceeding 50\%. When no majority is found, the practitioner is left with three potential options: \begin{enumerate} \item Return to the workers to ask if any are willing to reconsider their answers in the hope a majority can be found. The practitioner must be careful to remain objective in this instance so as not to lead the worker into forcefully changing their label, and there is no guarantee that a majority will be reached for all conflicts. \item Drop the data point so it is not removed from the final data set. In contrast to point one, this means that no time is wasted in trying to "fix" labels where no majority can be reached, and instead this time can be dedicated to getting more labels. The obvious downside of this approach is that data loss is inevitable, and tasks of higher difficulty- which are more likely to see disagreement - may not be understood by the model. \item From one of the selected answers, pick one at random to use as ground-truth. Answer choice can also be weighted depending on how many workers selected it. This means no data is lost, although there is now the potential of added noise in the labels due to the random selection. \end{enumerate} \par One of MV’s key weaknesses is that the expertise of all workers is considered equal across the board, which is a flawed assumption for most real-world tasks. If you consider a situation where you have one highly accurate worker and two highly inaccurate workers who are consistent with each other (with this information not apparent to the practitioner), we would accept the answers of the two inaccurate workers more often than not, compromising our data set. Even in the case of SMEs, expertise levels can vary, and the decisions made by workers can differ when a task has some level of subjectivity. Despite the issues with MV, it is a quick method and does have theoretical grounding in "wisdom of the crowd\cite{10.5555/1095645}. This suggests that, when putting a question to a crowd, the answer will average out to an approximate of the ground-truth. When employing a high number of crowd-sourcing workers, the hope is that enough of them will give the correct answer so that the risk of those who do make an error is reduced. However, the number of people in the crowd has no rule of thumb and having a high number of workers is often not always possible due to expertise requirements or costs.\par \subsection{CrowdTruth} CrowdTruth (CT) 2.0\cite{Dumitrache2018CrowdTruth2Q} is an open-source framework designed to sit on top of crowd-sourcing platforms such as MTurk and CrowdFlower, offering an automated solution to inferring ground-truth data\footnote{ https://github.com/CrowdTruth/CrowdTruth-core}. In contrast to MV that enforces agreement between workers, the framework captures inter-annotator disagreement to help resolve ambiguity in the data when disagreements occur among workers. CT considers that there are three main aspects that should be considered when inferring ground-truth the workers, input data (media units) and annotations\cite{Inel2014CrowdTruthMC}. Upon collection of the crowd-sourced labels, metrics are calculated for each of the three components, which in turn have an impact on each other. For example, if there are 20 workers for a single input data unit and 19 of the workers choose label A, while 1 worker selects label B, the worker who chose label B would be penalised heavily for this in their worker quality score, as the high level of agreement for this input data would assign a high quality metric score. Alternatively, if there are ten labels and worker annotation is evenly split among the workers for an input unit, the worker quality penalty would be lower, while the input data quality score for that item would be low. CT is currently in its 2nd iteration, with the improvements over the first version\cite{Aroyo2015TruthIA} centred around the metrics so that low quality workers disagreeing does not indicate the input data is ambiguous, and vice-versa where a low quality input does not indicate a poor worker. A naive example of this could be in a task where dog breeds are labelled and all the input data is blurred, making it difficult for the workers to select a correct annotation. If workers give different annotations, it is an indicator that the input data itself is the issue and the annotations are not a reflection of the worker quality, thus offering a statistic that allows the task administrator to remove problematic input units.\par Whereas CT provides a number of useful statistics that help give a good overview of various aspects of a task, we are mostly interested in the “Media Unit - Annotation Score” as shown in equation \ref{eq:eq1}, which gives a score for each input sample to determine the confidence that the annotation (label) is associated with that item. It is weighted by a worker quality score algorithm, thus boosting the answers of better workers while penalising the score of those who are considered to have a lower quality, with quality determined from worker agreement across all annotated units by said worker. Previous experiments investigated thresholds of the \(U\) score, which allows the user to make a judgement about which units they want to use for training\cite{Dumitrache2018EmpiricalMF}. However, there is no rule of thumb to choosing a “best” annotation threshold score, and it seems to depend on the data set - with recommendations to experiment with thresholds.\par \begin{equation} U\left(s,g\right)=\frac{\sum_{w\in W}{n_{sg}^{\left(w\right)}Q\left(w\right)}}{\sum_{w\in W} Q\left(w\right)} \label{eq:eq1} \end{equation} \(n_{sg}^{\left(w\right)}\) refers to worker \(w\)’s labelling for input unit \(s\), with each input unit having a choice of \(G\) label. This is weighted by the “worker quality score” (\(Q\)) for each worker \(w\) that has supplied an answer for that input unit \(s\). The outcome of this is a ratio of how many workers picked each annotation weighted by their perceived ability - effectively acting like a weighted MV. \(Q\) is the product of two other equations: the worker-media unit agreement - which is the average cosine distance between a single worker’s annotations and the annotations of the input units they have completed - and the worker-worker agreement, which indicates how similar a worker is to all others by calculating pairwise agreement. Both algorithms are weighted by the unit quality score algorithm, which means workers are not penalised heavily if the input item itself seems ambiguous. Full explanations of all the metrics can be found in the work by Dumitrache et al.\cite{Dumitrache2018CrowdTruth2Q}. \subsection{Expectation Maximisation} A popular alternative method for inferring ground-truth is Expectation Maximisation (EM), as demonstrated by Dawid \& Skene\cite{Dawid1979MaximumLE}. The method takes initial guesses of the ground-truth labels, usually done with MV, from the answers of each worker \(w\) and then infers the error rate of each worker by determining how many times a worker w selected label \(g\) when \(j\) is the correct one, with \(\ g,\ j\in G\ \) labels within the taxonomy of label choices \(G\). Doing this produces a square matrix for each worker, \(w\), with each row summing to 1. Therefore, the diagonal of each matrix is the rate at how accurate a worker is for each label and forms the basis of EM, in that it determines how consistent a worker is in applying labels. This error rate, along with the marginal probabilities of all labels \(G\), are used to recalculate the ground-truth. It continually loops between two stages - an expectation step (E-step) and a maximisation step (M-step) - until it converges to produce ground-truth results for all labels. In general, the E-step relies upon the equations of the M-step, thus the M-step is often computed first with an initialised guess for parameters. The following discusses the algorithms in regard to this analysis. \par \subsubsection{M-step} Assuming the ground-truth is unknown for the labels, the error rate, seen in equation \ref{eq:eq2}, for each worker and the marginal probabilities, seen in equation \ref{eq:eq3}, for each label \(j\) are computed in the M-step. Within these equations, \(n_{sg}^{\left(w\right)}\) refers to the counts of given answers for each item in the sample from a worker, similar to that used in equation \ref{eq:eq1}. Equation. \ref{eq:eq2} takes the inferred ground-truth labels, \(T\), and the counts of each answer given, \(n\). For the first instance, \(T\) is randomly initialised if not known, usually with a majority vote. Equation \ref{eq:eq3} takes the inferred ground-truth labels \(T\) and divides it by each item in the sample, \(S\). \par EM is capable of handling a worker answering the same sample more than once, but if based on an assumption of each worker only answering each item in the sample once, each vector for a worker’s answer to a sample can be considered as one-hot encoded vector of length \(G\). For example, if worker 1 has three label options and chooses the second label, the worker answer vector for that sample is \([0,1,0]\). For error rate estimation, the estimated ground-truth labels are multiplied by the worker answers for each item in the sample, and these are then normalised to produce a square matrix for each worker \(w\), which gives the error rate of each label. \par \begin{equation} {\hat{\pi}}_{jg}^{\left(w\right)}=\frac{\sum_{s}{T_{sj}n_{sg}^{\left(w\right)}}}{\sum_{g}\sum_{s}{T_{sj}n_{sg}^{\left(w\right)}}} \label{eq:eq2} \end{equation} \begin{equation} \widehat{P_j}=\frac{\sum_{s} T_{sj}}{S} \label{eq:eq3} \end{equation} \subsubsection{E-step} Finally, the equations in the M-step are used for the E-step, where new probabilistic estimates of the ground-truth labels \(T\) are made, as can be seen in equation \ref{eq:eq4}. This gives a probability of a label being the inferred ground-truth for each item in the sample. EM then loops between these two steps until it converges. Here, \(q\) is introduced to denote the presumed true label in the set for a sample item, while \(D\) refers to the input data of worker answers. \par \begin{equation} p\left(T_{sj}=1\middle|\ D\right)=\frac{\prod_{w=1}^{W}\prod_{g=1}^{G}\left(\pi_{jg}^{\left(w\right)}\right)^{n_{sg}^{\left(w\right)}}P_j}{\sum_{q=1}^{G}\prod_{w=1}^{W}\prod_{g=1}^{G}\left(\pi_{qg}^{\left(w\right)}\right)^{n_{sg}^{\left(w\right)}}P_q} \label{eq:eq4} \end{equation} The original Dawid \& Skene\cite{Dawid1979MaximumLE} method simply infers the ground-truth of the given data. Many modern methods are based upon this method - including most notably Raykar et al.\cite{Raykar2010LearningFC} - which extends the method to produce a classifier. The previously mentioned work of Valizadegan, Nguyen \& Hauskrecht\cite{Valizadegan2013LearningCM} is also noteworthy, as it adapted the work performed by Raykar et al.\cite{Raykar2010LearningFC} to situations where there are fewer experts, focused solely on high expertise tasks where worker resources may be scarce. The work performed by Raykar et al.\cite{Raykar2010LearningFC} is better geared towards a much higher number of workers, as outlined by the authors. Even the resulting error rate for each worker calculated by EM is useful in itself and can be used to determine the cost of each worker, something particularly valuable in crowd-sourcing\cite{Ipeirotis2010QualityMO}. \par \section{Methods} \subsection{Data sets} For the data, two different sets were chosen, with the distributions of labels used to create data sets for the various tests. With the based data set being \(D\), they are used to create samples sizes for experiments, denoted as \(S=\{50,125,250,500, 1000,2000\}\). Each item in \(S\) can be thought of as the target sample size that needs to be generated for experiments in order to test the impact of \(S\) on the varying consensus methods. Depending on the label distributions, sample sizes can sometimes be slightly higher or lower than the target \(S\) to help fit to the respective distribution. \par \subsubsection{Wisconsin Breast Cancer} The first data set is the Wisconsin Breast Cancer data set\footnote{\protect\url{ https://scikit-learn.org/stable/modules/generated/sklearn.datasets.load_breast_cancer.html}}, which includes 569 samples where the label is either malignant or benign. The data set was selected due to it being readily available and something that is common for binary classification in research. In this instance, we treat malignant as false and benign as true. The data associated with each label contains 39 different features, all of which are continuous, although it should be noted that the input data to each of the algorithms is the label choices of the workers, not these features. \par \subsubsection{20 Newsgroups} The second data set is the 20 Newsgroups data set\footnote{\protect\url{https://scikit-learn.org/stable/modules/generated/sklearn.datasets.fetch_20newsgroups.html}}, which includes 18846 samples in total and 20 different labels. This data set is used here to generate the different label sets by taking subsets of the data based on the number of labels that are required for the experiment. The data set is one of few to be readily available containing so many label choices, while the distribution of labels is fairly balanced for each subset of selected labels and is popular in natural language processing applications of machine learning. The data associated with each label is in text format and this is again not used as part of any of the ground-truth methods. \par \subsection{High and low expertise workers} Each experiment takes a number from set \(W=\ \{3,5,8,10,13,15,18,20,30,40\}\), with each \(w\ \in\ W\) denoting the number of workers that are generated in a particular experiment. All generated workers are assigned an expertise score \(\lambda\) between two boundaries, \(lb<\lambda\ <ub\), where lb \& ub are the lower and upper bounds of the expertise, respectively. The final expertise score set for all desired \(w\) workers is denoted as \(\mathrm{\Lambda}\ =\ \{\lambda^1,\ \lambda^2,\ldots,\lambda^w\}\). For all higher expertise experiments, \(ub\ =\ 0.99\), while \(lb\ =\ 0.51\). These values are set to ensure that every generated worker is getting at least half of the answers correct, regardless of the number of labels in the set to provide a measure of what we consider a high expertise set, with a limit that suggests they will at least have some minor error. For lower expertise experiments, the \(ub\ =\ 0.8\), while the lower bound is found through a lower-bound model finder, which is discussed in-depth below. 0.8 was chosen due to a similar expert generation upper-boundary selected in Ipeirotis et al.\cite{Ipeirotis2010QualityMO}. This is done to produce more noise in the experiment and represent a lower expertise set. Each worker is assigned a randomly selected expertise \(\lambda\) that is between the two boundaries. \(\lambda\) signifies how many answers we want to keep as correct for an individual worker. As an example, if \(\lambda = 0.6\) - and our ground-truth labels are \(T\) - we want 60\% of a worker’s answers to equal their equivalent value in \(T\), while changing 40\% of the answers to not equal their equivalent in \(T\). \subsection{Lower-bound model finder} For the lower-bound model finder, 100 different random forest models are trained with the entire base data set \(D^g\subseteq D\) for all label sets, denoted as \(G=\{2,\ 3,\ 5,\ 7,\ 10,\ 13,\ 15,\ 20\}\), which are associated with L random labels all chosen with equal probability of being selected from the set \(g\ =\ \{1,\ldots,G\}\). While a random forest model has been chosen here, any classification model will suffice, and its selection is simply due to it being a popular method that is widely used. The main goal is to produce lb for expertise that can simulate a worker who is, at worst, performing slightly better than random in their label selection. The experiments presume that workers have good intentions to perform well and are not maliciously selecting the incorrect answer, which is why setting lb to 0 does not make sense. Please note, \(G=2\) is the Wisconsin Breast Cancer data set, while \(G\neq2\) are all subsets of the 20 Newsgroups data set. \par Based on the selection of \(G\), \(T\) denotes the ground-truth of \(D^g\). For the Wisconsin Breast Cancer data set, no pre-processing was applied to the data, while for the 20 Newsgroups data, a TF-IDF vector representation for each record was used. As an example, for the experiment with the first 4 labels from 20 Newsgroups, all the data labelled \(g\in{1,2,3,4}\) was gathered (therefore all items not labelled \(\{1,2,3,4\}\) are not used) and vectorised. \(L\) random labels are created which match the size of \(T\) with each item being selected from the selection of \(G\). Data is split - 70\% for training and 30\% for testing. Training uses the 70\% split of \(D\) and its associated \(L\), while the remaining 30\% of \(D\) is used to predict new answers \(L\prime\), with \(L\prime\) then compared against the corresponding 30\% of \(T\) to calculate the weighted f1-score. The mean of all weighted f1-scores for all 100 repetitions is then computed and used as the lb expertise for the experiment. For each \(G\) label set experiment, this lower-bound model is computed once and then used across all permutations where there is the selection of \(G\) labels. The parameters of the random forest models are the defaults in scikit-learn package (version 0.21.3) on Python\footnote{\protect\url{https://scikit-learn.org/stable/index.html}}.The lb expertise scores for each label set in \(G\) are displayed in the Table \ref{tab:table1}. \par \begin{table} \caption{Lower-bound expertise \(lb\) for each label set, determined by the average f1-score of 100 repetitions of Random Forest Models on the base data.} \centering \begin{tabular}{ll} \toprule \cmidrule(r){1-2} G (labels in set) & Lower-bound expertise – lb \\ \midrule 2 & 0.483 \\ 3 & 0.327 \\ 5 & 0.189 \\ 7 & 0.139 \\ 10 & 0.094 \\ 15 & 0.063 \\ 20 & 0.049 \\ \bottomrule \end{tabular} \label{tab:table1} \end{table} \subsection{Label distributions} Each generated sample size \(S\) is built from the distributions of labels from \(D^g\). For the 20 Newsgroups data, each \(D\) only includes the labels up to the point of \(G\) and chooses them sequentially. So, for example, when \(G\ =\ 3\), \(D\) is reduced to include only the data that is labelled from the set where each individual label \(g\in\ \{1,\ 2,\ 3\}\), and the distributions of this set are used to generate \(S\) and \(L\). The distributions can be seen in Table \ref{tab:table2}. Please note that, due to the samples and rounding, the result of \(S\) is not always exact. For example, in some instances it may include 251 labels instead of 250 so the distribution of the original \(D\) can be best matched. \par \begin{table} \caption{The distribution of label choices for each \(D^g\), which are used with \(S\) to generate the \(T\) ground-truth labels.} \centering \begin{tabular}{l|llllllll} \toprule & \multicolumn{7}{c}{G (labels in set)}\\ Label & 2 & 3 & 5 & 7 & 10 & 15 & 20 \\ \midrule 0 & 0.373 & 0.289 & 0.17 & 0.12 & 0.083 & 0.055 & 0.042 \\ 1 & 0.627 & 0.353 & 0.207 & 0.146 & 0.101 & 0.067 & 0.052 \\ 2 & & 0.358 & 0.21 & 0.148 & 0.102 & 0.068 & 0.052 \\ 3 & & & 0.209 & 0.147 & 0.102 & 0.067 & 0.052 \\ 4 & & & 0.204 & 0.145 & 0.1 & 0.066 & 0.051 \\ 5 & & & & 0.148 & 0.102 & 0.068 & 0.052 \\ 6 & & & & 0.146 & 0.101 & 0.067 & 0.051 \\ 7 & & & & & 0.103 & 0.068 & 0.053 \\ 8 & & & & & 0.103 & 0.068 & 0.053 \\ 9 & & & & & 0.103 & 0.068 & 0.053 \\ 10 & & & & & & 0.068 & 0.053 \\ 11 & & & & & & 0.068 & 0.053 \\ 12 & & & & & & 0.067 & 0.052 \\ 13 & & & & & & 0.068 & 0.053 \\ 14 & & & & & & 0.067 & 0.052 \\ 15 & & & & & & & 0.053 \\ 16 & & & & & & & 0.048 \\ 17 & & & & & & & 0.05 \\ 18 & & & & & & & 0.041 \\ 19 & & & & & & & 0.033 \\ \bottomrule \end{tabular} \label{tab:table2} \end{table} \subsection{Majority Vote vs. CrowdTruth vs. Expectation Maximisation experiments} For each experiment a label set \(G\) and a sample \(S\) is chosen, with lb and ub to determine \(\mathrm{\Lambda}\) based on the criteria of whether it is a lower or higher expertise experiment. \(S\) determines the number of \(T\) labels we want to produce based on distributions of \(D\). \(W\) worker sets are tested on each of these experiments, with ten repetitions for each \(W\). Each item \(W\) signifies the number of workers we want to generate answers for. For example, \(W\ =\ 10\) means we generate ten workers with different answers governed by their expertise score \(\lambda^w\), chosen between the boundaries of the experiment. Ten repetitions were chosen to provide a balance between obtaining a good range of scores while not being computationally expensive. Initial experiments were run at higher worker sets, but these did not add any value considering their added computational cost. \par For each of the ten repetitions, a different accuracy score and worker generated answers were created, producing a unique noisy version of \(T\) for each worker, denoted by \(A_{sw}\). The noise in the labels is determined by the previously mentioned \(\lambda\) parameter, selected at random for each worker between the two expertise boundaries, with items selected to be changed to incorrect also picked at random. For which label to assign to an item selected to be incorrect, each item in \(G\) is assigned an equal probability of 1/\(G\), and a label is picked at random until \(A_{sw}\neq T_s\). With \(A_{sw}\) computed in an iteration, the matrix is used to infer ground-truth \({T\prime}_m\), via each of the algorithms \(M\): MV, CT and EM\footnote{EM implementation taken from: \protect\url{ https://github.com/dallascard/dawid_skene}} . All algorithms are therefore presented with the same generated worker answers in each repetition. The weighted f1-score comparing \({T\prime}_m\) to \(T\) is then computed for each \(M\). An ANOVA test compared each of the f1-score distribution, created by the ten repetitions, with p values recorded and tested for significance of \(p<0.05\) and \(p<0.005\). \par As an example of a single experiment, we consider the lower expertise boundaries for workers, set \(S=500\) and \(G=5\), generating a set of \(T_s\) labels based on the distribution of labels from \(D_g\). Each \(w \in W\) is then looped through for ten repetitions, which can be thought of as creating 3 workers with a different expertise 10 times, then creating 5 workers with a different expertise 10 times, and so on. In a single repetition, the workers are created by assigning them an expertise score \(lb\ >\lambda>0.8\). From the ground truth labels \(T\), a noisy version for each worker is created based on a worker’s assigned \(\lambda\). The concatenated version of all worker’s answers, \(A_{sw}\), is then put through each of the three methods, taking the label with the highest value for each item in \(S\) to produce an inferred ground-truth of \({T\prime}_m\). The results for each method, \({T\prime}_m\), are then compared to T and a weighted f1-score is calculated and recorded. This process is completed nine more times with all f1-scores recorded for each iteration, followed by moving onto the next worker set item in \(W\). \par \section{Results} \subsection{Higher expertise} For higher expertise experiments, only\ S\ =\ 500\ experiments. As previously mentioned, all experiments set expertise for each worker \(0.51<\lambda<0.99\). For all experiments, when \(W=3\), all methods had a larger range of f1-scores, with the smallest weighted f1-scores being when \(G=\ 3\ \land W=3\), with these being MV=0.72, CT=0.72 and EM=0.74, although these were all considered outliers, as the mean f1-scores in this experiment instance were MV=0.91, CT=0.95 and EM=0.92. For all experiments using the 20 Newsgroups data, at \(W\geq13\) there is no f1-score <\ 0.99 for all methods, apart from one instance for MV when \(W=13\land G=3\). For experiments where \(\{2,\ 5,\ 7,\ 10\}\subset G\), all results where \(W\geq18\) produced a perfect f1-score of 1.0 for each iteration, while \(\{13,\ 15,\ 20\}\subset G\) also produced perfect f1-scores where \(W\geq13\). Figure \ref{fig:fig1} shows the results of selected experiments, displaying how more label choices resulted in quicker convergence to a perfect f1-score with fewer workers. There were no instances where CT outperformed EM to a significant degree and vice-versa. \par \begin{figure}[ht] \begin{subfigure}{0.45\textwidth} \includegraphics[width=1\linewidth, height=6cm]{images/figure1/wbc_2_569_he_boxplot.png} \caption{Higher expertise experiment with two label choices and 569 sample size from the Wisconsin Breast Cancer data set. Note that CT has the same performance as MV when there are three workers.} \label{fig:fib1a} \end{subfigure}\hspace{0.1\textwidth} \begin{subfigure}{0.45\textwidth} \includegraphics[width=1\linewidth, height=6cm]{images/figure1/ng_7_500_he_boxplot.png} \caption{Higher expertise experiment with seven label choices and 500 sample size from the 20 Newsgroups data set. Compared to Fig 1(a), the results converge faster to a near-perfect f1-score with fewer workers.} \label{fig:fig1b} \end{subfigure} \begin{center} \begin{subfigure}{0.5\textwidth} \includegraphics[width=1\linewidth, height=6cm]{images/figure1/ng_15_500_he_boxplot.png} \caption{Higher expertise experiment with fifteen label choices and 500 sample size from the 20 Newsgroups data set. While this also converges to a near-perfect f1-score with fewer workers than Fig 1a, it should be noted that no matter how many labels there are to choose from, having three workers will always produce a large variance.} \label{fig:fig1c} \end{subfigure} \end{center} \caption{Selected results for higher expertise, displaying the quick convergence to near-perfect f1-score for all methods when more labels are included.} \label{fig:fig1} \end{figure} \subsubsection{Expectation Maximisation vs. Majority Vote} Selected results where \(S=500\) are displayed in Fig 2. Green cells below indicate a significant difference of \(p<0.05\) in favour of EM, while red cells indicate instances where there was no significant difference \((p>0.05)\). Of the 70 permutations for the high expertise experiment, EM produced a more favourable result in five instances, with four of them being for \(G=2\), and the remaining being when \(G=3\). Experiment \(G=2\ \land W=10\) produced a significant result where \(p<0.005\). \par \begin{figure}[h] \centering \includegraphics[scale=0.3]{images/figure2/em_v_mv_heatmap.png} \caption{Displaying \(p<0.05\) results where EM outperformed MV for high expertise experiment in green cells. Results where \(p>0.05\) have been omitted in the red cells.} \label{fig:fig2} \end{figure} \subsubsection{CrowdTruth vs. Majority Vote} Selected results where \(S=500\) are displayed in Fig 3. Green cells below indicate a significant difference of \(p<0.05\) in favour of CT while red cells indicate instances where there was no significant difference \((p>0.05)\). Of the 70 permutations for the high experiment, CT produced a more favourable result in three instances. For experiments where \(G=2\), experiments where worker sets \(W=10\) and \(W=18\) produced significant results where \(p<0.05\), while \(G=7\land W=3\) produced a single result where \(p<0.05\). \par \begin{figure}[h] \centering \includegraphics[scale=0.3]{images/figure3/ct_v_mv_heatmap.png} \caption{Displaying results where CT outperformed MV with \(p<0.05\) in green cells. Results where \(p>0.05\) have been omitted in the red cells.} \label{fig:fig3} \end{figure} \subsection{Lower expertise} For the lower expertise boundaries, where each worker is assigned an expertise of \(lb<\lambda<0.8\), the full set of \(S\) sample size is used, resulting in 420 permutations. Unlike higher expertise, no method converged to perfect f1-scores, although there continued to be a pattern in all experiments where the greater value for W, the higher the average f1-score, while the range of scores for each method tended to get smaller. In all experiments where \(W=3\), CT produced identical results to MV, with every f1-score in the ten repetitions the same. \par \subsubsection{Expectation Maximisation vs. Majority Vote} Among all 420 permutations, EM was more favourable with \(p<0.05\) in 59 (14.0\%) instances. A large proportion (80\%) of these significant results occurred when \(G\le3\), as the likelihood of EM giving a significant advantage over MV falls dramatically as G increases. EM also benefited from a worker set of \(W\geq10\), as only four (6.78\%) of the significant results occurred at the smaller worker sets \((W\le\ 8)\), with the most occurring when \(W=20\), with ten significant improvements (seven of these ten were also when \(G\le3\)). In addition, at \(W=40\), when MV tends to get close to f1-score of 1.0, EM was still able to provide an advantage, although it should be noted again that six of the seven results occurred when \(G\le3\), with the remaining result when \(G=5\). A similar pattern can be seen for S=250, where all seven of the significant results had \(G\le3\). This was 17.5\% of the 40 permutations where \(S=250\). Advantageous performance tended to be more common as \(S\) grew, with both \(S=1000\) and \(S=2000\) sample sizes producing 19 significant results; 47.5\% of all permutations for their respective experiments. Where \(G\geq7\), all three of the significant results were seen when \(S=2000\), with one of these when \(W=18\) and the other two when \(W=20\).\par Two of the experiments where EM outperformed MV are displayed in Fig 4a and Fig 4b, while one experiment where EM never outperformed MV is displayed in Fig 4c. In Fig 4a, all \(W\geq10\) have a significant improvement of \(p<0.05\) for EM when compared to MV, with \(W\geq20\) also being significant to \(p<0.005\). In Fig 4b, for all \(8\le W\le30\), EM is a significant improvement to a degree of \(p<0.05\) compared to MV. Finally, Fig 4c shows \(G=10\land S=2000\) experiments where EM never outperformed MV, which can be seen by boxplots being a similar size or bigger to their MV counterparts. Overall, there were 17 experiments where \(p<0.005\), with 12 of these occurring when \(W\geq15\land G=2\). Experiments where \(W=40\land G=2\land S\geq250\) produced four significant improvements where \(p<0.005\).\par \begin{figure}[h] \begin{subfigure}{0.45\textwidth} \includegraphics[width=1\linewidth, height=6cm]{images/Figure4/wbc_2_2000_le_boxplot.png} \caption{Lower expertise experiment with two label choices and 2000 sample size from the Wisconsin Breast Cancer data set. The f1-score for EM when there are ten or more workers in a binary data set always outperforms MV.} \label{fig:fib4a} \end{subfigure}\hspace{0.1\textwidth} \begin{subfigure}{0.45\textwidth} \includegraphics[width=1\linewidth, height=6cm]{images/Figure4/ng_3_1000_le_boxplot.png} \caption{Lower expertise experiment with three label choices and 1000 sample size from the Newsgroups data set. With between 8 and 3 and 30 workers, EM outperforms MV.} \label{fig:fig4b} \end{subfigure} \begin{center} \begin{subfigure}{0.5\textwidth} \includegraphics[width=1\linewidth, height=6cm]{images/Figure4/ng_10_1998_le_boxplot.png} \caption{Lower expertise experiment with ten label choices and 1998 sample size (S=2000) from the 20 Newsgroups data set. Here, EM did not manage to outperform MV, which was common for many of the lower expertise experiments that had a large label choice size.} \label{fig:fig4c} \end{subfigure} \end{center} \caption{Charts displaying 2 instances where EM performed well, and one where it did not offer any real improvement over MV.} \label{fig:fig4} \end{figure} \subsubsection{CrowdTruth vs. Majority Vote} For 55 (13.1\%) of the 420 permutations CT had a significant advantage over MV, a similar number to EM, although the instances where \(p<0.05\) against MV tended to differ. Of the experiments that returned a significant result all occurred between \(2\le G\geq10\) apart from one which appeared when \(G=20\). The incidence of \(p<0.05\) experiments for \(G\) grows as there are more labels added, before peaking at \(G=5\) when the number of significant results is 14, and this is then followed by a drop until \(G=15\) where there are no results where \(p<0.05\). 58.9\% of all significant results occurred when \(G=5\vee G=7\). Occurrences of \(p<0.05\) experiments tended to rise steadily as S grew where \(50\le S\le500\), until \(S=1000\) and \(S=2000\) indicates a similar number of significant occurrences compared to \(S=500\). Overall, there were six results where \(p<0.005\).\par The pattern in \(G\) differs from EM which observed a much steeper drop in significant results as \(G\) grew, as can be seen below in Fig 5a. The pattern for significant occurrences in \(S\) and \(W\) is somewhat similar between the two methods when comparing f1-score distributions to that of MV - although for \(S\), EM appears to benefit more from a larger sample size, as can be seen in Fig 5b.\par \begin{figure}[h] \begin{subfigure}{0.45\textwidth} \includegraphics[width=0.9\linewidth, height=5cm]{images/Figure5/g_pocc.PNG} \caption{Showing instances where EM and CT f1-scores outperformed MV with respect to the number of label choices. EM is much better suited to fewer label choices, while CT peaks when there are five label choices. Neither perform that much better with a large label set choice.} \label{fig:fib5a} \end{subfigure}\hspace{0.1\textwidth} \begin{subfigure}{0.45\textwidth} \includegraphics[width=0.9\linewidth, height=5cm]{images/Figure5/s_pocc.PNG} \caption{Showing instances where EM and CT f1-scores outperformed MV with respect to the sample size. CT and EM are more likely to produce an advantage over MV as the sample size grows.} \label{fig:fig5b} \end{subfigure} \begin{center} \begin{subfigure}{0.5\textwidth} \includegraphics[width=0.9\linewidth, height=5cm]{images/Figure5/w_pocc.PNG} \caption{Showing instances where EM and CT f1-scores outperformed MV with respect to the number of workers in the set. CT and EM have a similar pattern. Neither are strong in performance compared to MV when there are few workers.} \label{fig:fig5c} \end{subfigure} \end{center} \caption{Charts displaying counts of significant experiments for labels in set, sample size and workers in set when comparing results of EM and CT against MV.} \label{fig:fig5} \end{figure} \subsubsection{CrowdTruth vs. Expectation Maximisation} Overall, 27 (6.4\%) of the 420 experiments produced a result where using CT or EM was more favourable than the other, with 14 of these for CT and 13 for EM. However, of the 14 for CT, only 6 of these were results where CT was also more advantageous than using MV. All 13 of the EM results where \(p<0.05\) against CT were also results where \(p<0.05\) against MV, which also all occurred when \(G=2\ \land W\geq13\). Five of the 14 results where CT was better than EM occurred when \(S=50\). Overall, there were 1.4\% of instances where CT was the standout method to use and 3.1\% of instances where EM was the standout method. In no experiments did MV come out as the clear winning method.\par \section{Discussion} Whereas CT and EM do offer advantages over a simple MV, this depends on the parameters of the labelling task. EM is more likely to produce better results if the label set is binary, whereas for CT it is harder to determine a general rule of thumb for when it is the outright best method to use, although it does seem effective with moderately sized label sets. Neither seems to give an advantage for large label sets, while the same is true for small worker sets, where a large variance in f1-score is seen for all methods. The experimental results show the relationship between the various parameters and these particular methods, and give a new understanding as to when they actually provide an advantage.\par Overall, the results presented here should offer practitioners a general guidance of when to utilise one of these methods rather than MV depending on their choices of workers, expertise, labels and sample. Caution is, however, advised in that this is not a recommendation to base a label task around using a particular method, or just choose one without consideration, but rather seeing where there is an opportunity to use one once a label task has been completed. While previous research has looked at the optimal number of workers for ground-truth inference with multiple workers\cite{Carvalho2015HowMC}, the results suggest that the other task parameters can be just as important when attempting to maximise accuracy through methodology choice. Since label gathering can often be considered the most crucial aspect of any supervised machine learning project, the insight offered here provides practitioners with a huge benefit when attempting to get the best possible data in an efficient manner.\par If worker ability can be assured to be of high quality, then fewer workers will be required to gain a near perfect ground-truth consensus, while the method choice is not as crucial when compared to lower expertise workers. Considering only three workers, somewhat favourable labels are gained when all can be assured to get at least 51\% of answers correct when compared to the ground-truth. Although results get slightly better the more labels that are added, we often observe convergence to a perfect score with eight to ten workers, with anything beyond this not adding any real value. In the situation that worker cost is high, our analysis indicates there is an advantage in pre-screening workers and gauging their ability, as a small quality check can remove noisy workers and focus on a team with more confidence in their ability. However, the cost of this screening and the hit rate of getting good workers needs to be taken into consideration, while any task to perform this needs to be balanced enough that the expertise scored garnered for workers has a high degree of confidence. One interesting approach from any screening experiment would be to group workers based on the screen into two separate groups: “strong” and “weak”, to see performance on a full task and record the impact on the full task results.\par With regards to lower expertise workers, we see that smaller numbers result in more variance for the final f1-score for all methods, as less than eight workers often means that the final results can become quite unstable. In addition, a high number of workers often results in convergence to a near-perfect f1-score for all methods, although even in these instances there are occasions with lower expertise workers where CT and EM can still provide an advantage over MV. Variance in the result does tend to reduce as the number of workers grow, although this is not as sudden for the lower expertise worker sets as can be seen when compared to the higher expertise experiments.\par Both methods tended to produce their best results when there were ten or more workers, although incidents of better performance did not tend to grow in parallel with the number of workers, which could be attributed to other parameters having a bigger impact, or the fact that more workers, on average, tended to produce more accurate results due to the nature of crowd averages phenomenon. Whereas previous research has suggested that ten or eleven workers is the optimal number regardless of other factors\cite{Carvalho2015HowMC}, the results here demonstrate that employing slightly more workers than this can still offer some gains when the expertise of workers can drop below 50\%. For smaller worker sets, often seen in specialist knowledge settings where there are fewer available resources\cite{Valizadegan2013LearningCM}, the results indicate the challenges that they face, in that the final consensus results can vary to a large degree, and none of the methods used in these experiments offer a robust solution to inferring ground-truth.\par For binary tasks, or even some tasks with three labels in the taxonomy, the choice of EM is clear, as it can often be seen to provide an advantage when this label parameter is met. If the label count is low, there can be reasonable assurance that EM will offer an advantage in inferring ground-truth, so it is recommended to consider it. The method does not appear to scale as well to the number of labels in a set; this causes an issue for real world applications, where large label taxonomies are common due to the complex problems practitioners attempt to solve, as the potential advantages are sparse outside of tasks with fewer than seven labels.\par On the other hand, CT is a method that generally offers advantages over MV across a broader range of task parameters - although it can be hard to provide a general rule of thumb of when it is best used, unlike EM. Whereas it does offer some advantages at smaller label taxonomy sizes, most of its performance enhancements over MV are seen with slightly larger taxonomies where there are five to seven labels to choose from. One of the curious aspects of CT is seen in the lower expertise experiments for binary label tasks and three workers, as it produced exactly the same results as MV every time, suggesting that it mimics MV with the minimum number of workers (three) and labels (two) for a task, rendering it redundant. Recommending it as a way of improving results over both methods is also tricky, as there were very few occasions when it was the standout method. When it was, these tended to be sparsely populated across the parameter experiments. It is clear that CT is a useful tool and can offer advantages in inferring ground-truth, but giving a definitive idea of when to use it to benefit from above advantages is not entirely obvious.\par Overall, we discovered that large label taxonomies tend to mean that the choice of method for ground-truth inference is redundant. This may be due to some relation to the class subset sample size, as it can be seen from the overall sample sizes that CT and EM both have some sensitivity to this. Keeping in mind that it is usually the goal to accrue as much data as possible, EM seems to be even more sensitive to the overall sample size, concluding that 500-1000 as a minimum sample size can increase the possibility that a particular method will help boost ground-truth inference. This is particularly curious as the example in Dawid \& Skene\cite{Dawid1979MaximumLE} base their work on a, albeit contrived, sample size of 45.\par Considerations over sample size are particularly true for CT where it is recommended to use thresholds on their media unit annotation score to remove noisy examples, which can help aid training data for a model\cite{Dumitrache2018EmpiricalMF}. Thresholds that remove too many labels could, in theory, be costly to CT, meaning the method is unlikely to offer substantial benefit over a standard MV when compared to the results of experiments conducted here. Further experimentation with even larger sample sizes could prove beneficial in understanding whether the occurrences of significant improvements increases in likelihood with respect to the other parameters, or if it tails off to a similar number for each sample set, as can be seen in sample sets 1000 and 2000 for both CT and EM.\par This also raises questions about label distributions and minority classes, in particular how both of these methods handle it and if some instances of beneficial performance could actually be explained by sub-samples of each label. As we see in much research, the two data sets used here tended to have much more desirable distributions than many real-life equivalents, and analysis into the impact of label imbalance could add to the knowledge acquired here in informing others on how to infer consensus in this particular scenario. Indeed, it could be theorised that, since both EM and CT produce statistics related to each label, the same statistic between a minority class and a majority class is not entirely fair. Whereas these experiments have focused on overall performance, examining the performance of each method on each class with controls on class distributions where minority classes are introduced is a possible avenue for future research to assess how robust each method is when it is presented with these issues. Taking EM as an example, the error rate square matrix produced for each worker will likely be impacted by imbalanced label distributions, and any gains gathered in the overall picture may be massively skewed by the dominant classes, whereas minority classes are often included due to their high importance.\par \section{Conclusions} Here, we have concluded that each method has its advantages and draw backs. However, as a first choice we recommend:\par \begin{enumerate} \item EM is a better choice for smaller label sets, while CT is more favourable in medium-sized label sets. Neither method offers much advantage when the label set size is large. \item Employing 10-20 workers will not only result in a good balance between overall accuracy and efficiency, but also increases the likelihood that CT or EM can produce more accurate ground-truth inference than MV. \item None of the methods can provide much advantage when there are fewer than ten workers, while accuracy also tends to be less stable, so alternative methods should be sought to mitigate any potential errors in the label sets. \item High average worker expertise can result in needing fewer workers to gain a better consensus score, although this means methodology for inferring ground-truth is not as important. \item Practitioners should aim to get each of their workers to provide an answer to as much sample as possible if they want to reap the potential advantages of CT or EM, as both benefit from a larger sample. \end{enumerate} \hspace{\parindent}From the experiments, a loose rubric on these popular methods is now available to help not only guide data-gathering exercises, but also inform others of opportunities to enhance ground-truth inference when the parameters of their exercise align with those in the experiments of this paper. In this paper we have seen that CT and EM are only likely to be advantageous with certain parameter conditions, which was not previously understood. The results provide researchers with new insight into the parameter relationships and how they might impact accuracy on a task. This is particularly important for any supervised learning task, as accuracy of the labels associated with the data is crucial to the success of any model, and every opportunity to increase this accuracy should always be taken.\par The experimental set up in this paper can help guide future research in testing other methods to see the parameter conditions they work best under, as well as providing researchers with a framework to establish new methods that can attempt to resolve some of the shortcomings of the methods used in these experiments.\par \bibliographystyle{unsrt}
\section{Introduction} Markov Random Fields (MRFs) provide a useful framework to model high dimensional probability distributions via an associated dependency graph $\mathbf{G}$, which captures the conditional independence relationships between random variables. Here, the nodes correspond to the random variables; edges represent the conditional independence relationships between these nodes. Any random variable conditioned on the random variables with which it shares an edge is independent of all the remaining random variables. This `Markov' property has encouraged the adoption of MRFs in a wide variety of fields such as computer vision, finance, biology, and social networks. Here, MRFs model various inference tasks via popular algorithms such as loopy belief propagation, message passing, etc. For a deeper understanding of these underlying ideas and applications, we refer the reader to \cite{lauritzen1996graphical, koller2009probabilistic, wainwright2008graphical, pearl2014probabilistic}. A special class of graphical model where the underlying graph is tree-structured is suited for applications where sample efficient learning, and time-efficient inference are required with strong theoretical guarantees. As a result, the problem of learning tree-structured graphical models from data has been well-studied since the 1960s. In the seminal work \cite{chow1968approximating}, the authors propose the Chow-Liu algorithm, which shows that the maximum weight spanning tree of the empirical mutual information between all the pairs of random variables corresponds to the maximum-likelihood tree estimate. In practice, it is rare to observe the random variables without noise, as sources of noise are ubiquitous, e.g. errors in sensors, incorrect human labeling. In \cite{nikolakakis2019learning}, the authors present numerous motivating examples from social science, epidemiology, biology, differential privacy, and finance, where noise is present in the observations. Unfortunately, in the face of corruption by unequal noise in the nodes, the Chow-Liu algorithm breaks down. This occurs as the noise in the random variables alters the order of the pairwise mutual information. The noise also destroys the tree structure by adding fictitious edges. Moreover, as noise is unknown, the structure of a noisy graphical model could possibly originate from different tree structures. This brings the recoverability of the original tree structure into question. In this paper, we focus on learning the underlying tree-structured graphical model on non-noisy discrete random variables using samples that are corrupted by a $k$-ary symmetric noise channel (where $k$ is the size of the common support of all the random variables). Our work reveals a rich recoverability landscape for MRFs under symmetric noise. We discover that when $k\geq 3$, for a fixed underlying tree structure, the recoverability is determined by the pairwise PMF of the non-noisy random variables. This is in contrast to the Gaussian graphical model and Ising model results (\cite{katiyar2019robust}, \cite{katiyar2020robust}, \cite{tandon2021sga}) where, for a fixed tree structure, edges within a \textit{leaf cluster} (a leaf node, its parent, and its siblings) are never recoverable irrespective of the probability distribution of the non-noisy random variables. We completely characterize the recoverability for $k\geq 2$ by providing the necessary and sufficient conditions for the identifiability of the edges within a \textit{leaf cluster}. Our contributions can be summarized as follows: \begin{itemize} [leftmargin=*,noitemsep]\vspace{-5pt} \item[1.] \textbf{Identifiability Characterization}: In \textit{Theorem \ref{th:k_ary_iden}}, we completely characterize the recoverability of tree-structured MRF on support size $k$ when the observations come from unknown $k$-ary symmetric channel noise where each node has a different error probability. We show the identifiability depends on the PMF of the non-noisy random variables, which is unobserved. This dependence can then be translated to the PMF of the noisy random variables, which is observed, that provides the characterization. We show that for the special class of {\em Symmetric Graphical Models} (as defined in \textit{Section \ref{sec:symmetric}}), for any $k$, the nodes within a \textit{leaf cluster} are unidentifiable. On the other direction, we show for the class of Perturbed Symmetric Graphical Models (details in \textit{Section \ref{sec:pertured_symmetric}}) for $k\geq 4$, the exact tree is identifiable. \item[2.] \textbf{Algorithm}: We develop an algorithm that recovers the class of candidate trees that can explain the noisy observations. In the identifiable setting, this corresponds to recovering the exact tree. The algorithm is iterative where we recover one edge from the candidate tree per iteration. \textit{(Section \ref{sec:algo})}. \item[3.] \textbf{Sample Complexity Analysis:} We provide novel sample complexity lower bounds and upper bounds (\textit{Section \ref{sec:sample_complexity}}). Our upper bounds are shown to have orderwise tight dependence on underlying graph parameters, size of the graph, edge parameters (related to underlying conditional MF), and noise parameters. The lower bound proof relies on a novel construction of a class of graphical models including perturbed symmetric graphical models where part of the \textit{leaf clusters} are identifiable. \item[4.] \textbf{Experiments:}\footnote{The code containing the implementation of the algorithm is available at \url{https://github.com/ashishkatiyar13/NoisyTreeMRF}} We demonstrate the efficacy of our algorithm via extensive numerical experiments for a variety of trees with different structures, edge parameters, corruption, and support sizes. \end{itemize} \section{Related Work} We divide the related work into three main categories:\\ \textbf{Learning Generic Graphical Models from Non-Noisy Samples:} There exists a rich literature on the problem of learning graphical models on discrete random variables which assume access to non-noisy samples \cite{bresler2014structure, bresler2008reconstruction, bresler2015efficiently, bresler2014hardness, lee2007efficient, klivans2017learning, wu2019sparse, ravikumar2010high}. However, these models do not provide guarantees in the face of noise in the samples.\\ \textbf{Learning Tree-Structured Graphical Models:} The special class of tree-structured graphical models has also been extensively studied beginning with the classical Chow-Liu algorithm was proposed in \cite{chow1968approximating}. Chow-Liu algorithm's error exponents for Gaussian graphical models and graphical models on discrete random variables were analyzed in \cite{tan2010learning} and \cite{tan2011large} respectively. Results in \cite{tan2011large} were further refined in \cite{tandon2020exact} under additional assumptions of homogeneity and zero external field in tree-structured Ising models. In \cite{bresler2016learning} the authors approximate the distribution of generic Ising models using tree-structured Ising models. More recently, in \cite{daskalakis2020tree}, the authors provide an algorithm to learn tree-structured Ising models providing total variation distance guarantees. In \cite{bhattacharyya2020near}, the authors provide finite sample guarantees for the Chow-Liu algorithm. As these algorithms assume access to non-noisy samples, no performance guarantees can be established when the samples have noise.\\ \textbf{Robust Estimation of Graphical Models:} Robust estimation of graphical models has been studied in multiple prior works but they are unable to resolve our setting. The algorithms in \cite{goel2019learning, lindgren2019robust, hamilton2017information} learn graphical models on discrete random variables without the tree structure assumption but assume access to error probabilities. This is complementary to our setting as we have the tree structure constraint but do not require the knowledge of the error probabilities. In \cite{tandon2020exact,nikolakakis2019learning,nikolakakis2020information}, the authors study the recovery of trees using noisy samples. Critically, they operate in the restricted regime where the Chow-Liu algorithm converges to the correct tree. While these results are insightful in their own right, their assumptions are generally violated in our setting making their results inapplicable. For Gaussian graphical models and Ising models, the unidentifiability properties are established in \cite{katiyar2019robust} and \cite{katiyar2020robust}, respectively. In \cite{tandon2021sga} the authors extend the results in \cite{katiyar2019robust, katiyar2020robust}, providing better sample complexity results and a more efficient algorithm. The critical limitation of these results is that they do not extend to discrete random variables with support sizes larger than 2 and therefore fail to capture the nuanced identifiability properties demonstrated in our setting. Finally, our problem can be posed as the latent tree graphical model estimation problem, where the noisy nodes are observed and non-noisy nodes are latent. Results for learning latent tree graphical models in \cite{pearl1986structuring, chang1996full, choi2011learning}, and {\em independently and concurrently} in \cite{ casanellas2021robust}, can be used to recover the underlying tree barring the nodes within leaf clusters. Importantly, these models do not assume any structure on the noise, and thereby, contrived noise models make it impossible to recover nodes within a leaf cluster. As a result they fail to uncover the possibility of identifiability within a leaf cluster when we consider the natural $k$-ary symmetric channel noise model. \section{Problem Setup} Let $\mathbf{X} = [X_1, X_2\dots X_n]$ be the vector of random variables with a common support set, $\mathcal{S} = \{s_1, s_2, \dots s_k\}$ such that their graphical model structure is a tree $T^*$. The vanilla learning problem is to recover the tree $T^*$ from i.i.d samples of $X_i$. In this paper, we consider the problem of recovering $T^*$ but we do not get to observe samples of $X_i$. Instead, the samples of $X_i$ pass through a $k$-ary symmetric noise channel and we observe the output denoted by $X_i'$, that is, \begin{equation} \label{eq:noise} X_i' = \begin{cases}X_i & \text{ w.p. }1 - q_i,\\ U_i & \text{ w.p. } q_i, \end{cases} \end{equation} where $q_i$ is the probability of error for $X_i$ and $U_i$ is a discrete random variable independent of $\mathbf{X}$ and $U_j$ $\forall j\neq i$, distributed uniformly on $\mathcal{S}$. Note that $q_i$ can be unequal for all $X_i$. The vector of the noisy random variables is denoted by $\mathbf{X'} = [X_1', X_2'\dots X_n']$. Due to the noise in $X_i$, the graphical model of the nodes in $\mathbf{X'}$ is no longer given by $T^*$. In general, \textit{the graphical model on the noisy random variables can be a complete graph}. \paragraph{Matrix PMF and Distance Notation:} We denote the joint PMF matrix for random variables ($X_a$, $X_b$), and ($X_a'$, $X_b'$) by the matrix $P_{a,b}$ and $P_{a',b'}$ respectively, such that: \begin{equation*} (P_{a,b})_{i,j} = P(X_a = s_i, X_b = s_j), (P_{a',b'})_{i,j} = P(X_a' = s_i, X_b' = s_j). \end{equation*} The conditional PMF of $X_a$ conditioned on $X_b$ is denoted by the matrix $P_{a|b}$ while the marginal distribution of random variables $X_a$ and $X_a'$ are denoted using diagonal matrices $P_a$ and $P_{a'}$ respectively such that: \begin{equation*} (P_{a|b})_{i,j} = P(X_a = s_i|X_b = s_j), (P_a)_{i,i} = P(X_a = s_i), (P_{a'})_{i,i} = P(X_a' = s_i). \end{equation*} The information distance metric between proposed in \cite{lake1994reconstructing}, is defined as follows: \begin{equation}\label{eq:dist} d_{i,j} =-\log\tfrac{|det(P_{i,j})|}{\sqrt{det(P_i)det(P_j)}}, d_{i',j'} =-\log\tfrac{|det(P_{i',j'})|}{\sqrt{det(P_{i'})det(P_{j'})}}. \end{equation} We require the following assumptions that are natural and standard in this line of literature (c.f. \cite{chang1996full,choi2011learning}). \begin{assumption}\label{ass:pmf} The probability mass at every support for each non-noisy random variable is bounded away from $0$ : $(P_a)_{i,i}\geq p_{min}>0$. \end{assumption} \begin{assumption}\label{ass:distance} The distance $d_{i,j}$ between adjacent non-noisy random variables is bounded: $0<d_{min}<d_{i,j}<d_{max}$. \end{assumption} \begin{assumption}\label{ass:max_error} The probability of error is upper bounded away from 1: $q_i \leq q_{max} < 1$. \end{assumption} Assumption \ref{ass:pmf} ensures that the probability mass at any support is not arbitrarily small for any random variable. The bounds on the distance in Assumption \ref{ass:distance} ensure that no adjacent random variables are duplicates or independent. Assumption \ref{ass:max_error} ensures that the noisy observations are not independent of the underlying random variables. Our sample complexity lower bounds in Section \ref{sec:sample_complexity} show that the problem becomes infeasible if these assumptions are not satisfied. Lastly, we also formally define a \textit{leaf cluster} as follows: \begin{definition} \label{def:leafcluster} The \textbf{leaf cluster} of any leaf node is the set containing that leaf node, its parent node and all its sibling leaf nodes. \end{definition} \section{Identifiability Results} \label{sec:identifiability} In this section, we prove that the identifiability of the underlying tree is determined by the joint PMF of leaf parent pairs. The proof is divided in 3 parts - (i) prove that the only potential unidentifiability is within the leaf clusters of the tree, (ii) analyze the existence of valid probability of error for a tree on three nodes, (iii) extend the analysis to a generic tree and arrive at the necessary and sufficient condition for identifiability. \subsection{Potential unidentifiability is limited to leaf clusters} For any tree $T^*$, \cite{katiyar2019robust} defined the equivalence class $\mathcal{T}_{T^*}$ to be the set of all the trees obtained by different permutations of nodes within a leaf cluster, and showed that in the Gaussian graphical model setting, $\mathcal{T}_{T^*}$ can be recovered. We show here that with a few new proof ideas, essentially the same is true for graphical models on discrete random variables with general support size $k$: \begin{lemma}\label{le:lim_unid_gen} Suppose the random variables in $\mathbf{X}$ form a tree graphical model $T^*$. Given samples from noisy random variables $X_i'$, it is possible to recover the equivalence class $\mathcal{T}_{T^*}$. \end{lemma} \textit{Proof Idea.} The proof of this lemma is similar in spirit to \cite{katiyar2019robust} and so we defer the details to Appendix \ref{ap:lemma1}. The proof depends on categorizing groups of 4 nodes as a {\em non-star} when 2 of the nodes lie in one subtree and the remaining 2 nodes lie in a disjoint subtree. The key new element we need for this categorization in the discrete setting for general $k$, is the information distance metric $d_{i,j}$ as defined in \eqref{eq:dist}.\\ \textbf{Remarks:} (i) Lemma \ref{le:lim_unid_gen} is not limited to the $k$-ary symmetric noise channel and holds for any noise channel such that when conditioned on $X_i$, $X_i'$ is independent of $X_j$ $\forall j \in [n] \neq i$ and $X_i$ and $X_i'$ are not independent. This result was independently and concurrently derived in \cite{casanellas2021robust}. (ii) If there are no restrictions on the noise channel, recovering $\mathcal{T}_{T^*}$ is the best we can do. That is, for every tree in $\mathcal{T}_{T^*}$, it is possible to construct a noise model that can produces the noisy observation. This analysis along with the proof of Lemma \ref{le:lim_unid_gen} is included in Appendix \ref{ap:lemma1}. \subsection{Error Estimation for a Tree on 3 Nodes} \paragraph{Additional Notation for $k$-ary Symmetric Channel:} For each random variable $X_a$, we define a $k\times k$ error matrix $E_a$ as follows: \begin{equation*} E_a = (1-q_a)I + \tfrac{q_a}{k}O, \end{equation*} where $O$ is a matrix of all ones. Recall that $k$ is the common support size for all the random variables and $q_a$ is the probability of error of $X_a$.\\ We denote the error estimated for node $X_a$ which enforces $X_b\perp X_c|X_a$ by $\Tilde{q}_{a}^{b,c}$ and we also define the matrix $\ind{\Tilde{E}}{a}{b}{c}$ as: \begin{equation*} \ind{\Tilde{E}}{a}{b}{c} = (1-\ind{\Tilde{q}}{a}{b}{c})I + \tfrac{\ind{\Tilde{q}}{a}{b}{c}}{k}O. \end{equation*} Note that $P_{a',b'}$ and $P_{a,b}$ are related as follows: \begin{equation}\label{eq:noisy_joint_pmf} P_{a',b'} = E_aP_{a,b}E_b. \end{equation} It is also easy to see that: \begin{equation}\label{eq:noisy_pmf} P_{a'} = (1-q_a)P_a + \tfrac{q_a}{k} I. \end{equation} \paragraph{Error Estimation:} Suppose there exist 3 nodes such that $X_1\perp X_3|X_2$ and we observe $X_1'$, $X_2'$ and $X_3'$ through a $k$-ary symmetric channel as defined in Equation \eqref{eq:noise}. The conditional independence relationship gives us: \begin{equation}\label{eq:cond_ind} P_{1, 3} = P_{1,2}P_2^{-1}P_{2,3}. \end{equation} From Equation \eqref{eq:noisy_joint_pmf}, we have $P_{1',3'} = E_1P_{1,3}E_3$, $P_{1',2'} = E_1P_{1,2}E_2$, $P_{2',3'} = E_2P_{2,3}E_3$. From Equation \eqref{eq:noisy_pmf}, we have $P_{2'} = (1-q_2)P_2 + \frac{q_2}{k}I$. By substituting these in Equation \eqref{eq:cond_ind} we get the following quadratic equation with matrix coefficients in noise parameter $q_2$ (details in Appendix \ref{ap:quadratic}): \begin{equation}\label{eq:err_est_quad} \begin{aligned} &\frac{q_2^2}{k^2}(O - kI) - \frac{q_2}{k}(OP_{2'} + P_{2'}O - kP_{2'} - I) + P_{2',3'} P_{1,' 3'}^{-1}P_{1',2'}-P_{2'} = 0, \end{aligned} \end{equation} where the $0$ on the RHS is a $k\times k$ matrix of all $0$s. The key insight here is that, Equation \eqref{eq:err_est_quad} depends only on the noisy observations. Therefore, in the absence of the knowledge of conditional independence relation, it can be used as a test to check if the noisy observations can potentially be explained by $X_1\perp X_3|X_2$. Precisely, for a graph on 3 nodes $(X_1, X_2, X_3)$, $X_2$ is a potential middle node if the we can satisfy Equation~\eqref{eq:err_est_quad} for some noise parameter $q_2 \in [0,q_{max}]$. In other words, $X_2$ is a potential middle node if the following holds, with $\|\cdot\|_F$ as the Forbenius norm of a matrix: \begin{equation}\label{eq:err_est_x} \begin{aligned} &\min_{0\leq x\leq q_{max}} \|\frac{x^2}{k^2}(O - kI) - \frac{x}{k}(OP_{2'} + P_{2'}O - kP_{2'} - I) + P_{2',3'} P_{1,' 3'}^{-1}P_{1',2'}-P_{2'}\|_F = 0. \end{aligned} \end{equation} This is equivalent to $k^2$ quadratic equations corresponding to each element of the matrix having a common root which lies between $0$ and $q_{max}$. These equations need not be unique. \subsection{Extension to a generic tree} Before presenting the identifiability result, we first establish some notation. Let $\mathcal{L}$ be the set containing all the leaf nodes of the tree-structured graphical model $T^*$. Now, consider the subset of leaf nodes with the following property: the leaf node $X_2$, its parent node $X_1$, and any arbitrary node $X_3$ from the graph have a solution to Equation \eqref{eq:err_est_x}. We label this subset $\mathcal{L}^{sub} \subseteq \mathcal{L}$. $\mathcal{T}_{T^*}^{sub}\subseteq \mathcal{T}_{T^*}$ represents the equivalence class where only leaves in $\mathcal{L}^{sub}$ can exchange positions with their parents.\\ The next theorem completely characterizes the identifiability of the underlying tree for a $k$-ary symmetric noise channel. \begin{theorem}\label{th:k_ary_iden} Suppose the random variables in $\mathbf{X}$ form a tree-structured graphical model $T^*$. Let $\mathbf{X}'$ be the observed noisy output after passing $\mathbf{X}$ through a $k$-ary symmetric channel. Then, we show that for any leaf node $X_2 \in \mathcal{L}^{sub}$ and its parent node $X_1$, equation \eqref{eq:err_est_x} remains unchanged for any arbitrary third node $X_3$ from the graph. Using $\mathbf{X}'$, we can recover $\mathcal{T}_{T^*}^{sub}$. Moreover, for every tree $\Tilde{T}\in\mathcal{T}_{T^*}^{sub}$, there exist random variables $\Tilde{\mathbf{X}}$ and a $k$-ary symmetric channels such that the graphical model of $\Tilde{\mathbf{X}}$ is $\Tilde{T}$ and the $k$-ary channel output is $\mathbf{X}'$. \end{theorem} \textit{Proof Idea:} As the unidentifiability is only between the nodes within a \textit{leaf cluster}, the key idea is to study a subset of 3 nodes comprising of a leaf parent pair and an arbitrary third node. It is clear that, Equation \eqref{eq:err_est_x} has a solution when the parent node is the middle node. Whenever Equation \eqref{eq:err_est_x} does not have a solution for a given node being a candidate center node, we can rule out the possibility of that node being a parent node. We further show that when the solution exists for a leaf node as a candidate center node, we can construct a tree where the parent node exchanges position with the leaf node. The details are presented in Appendix \ref{ap:k_ary_iden_proof}. \subsection{Examples} \label{sec:examples} In this section, we do not assume access to $q_{max}$ and analyse the solution to Equation \eqref{eq:err_est_x} with the constraint $0<x<1$. Extension to the setting of $0<x<q_{max}$ is straightforward where we reject any solution $x>q_{max}$. We first prove that symmetric graphical models are unidentifiable. Next, we present perturbed symmetric graphical models that are unidentifiable for $k=3$ but are identifiable for $k\geq4$. Finally, we show that our analysis recovers the existing results for $k=2$. \paragraph{Symmetric graphical models:}\label{sec:symmetric} Symmetric graphical models are a class of graphical models where the marginals of all the random variables are uniform on the support and the conditional PMF matrix $P_{a|b}$ for random variables $X_a$, $X_b$ that have an edge between them, takes the following form: $$ P_{a|b} = P_{b|a} = \alpha_{a,b}I+(1-\alpha_{a,b})\tfrac{O}{k}. $$ Recall that $O$ is the matrix of all ones. The bounds on the distance in Assumption \ref{ass:distance} enforces $\exp{(-d_{max}/(k-1))}<\alpha_{a,b}<\exp{(-d_{min}/(k-1))}$. \begin{theorem}\label{th:symmetric} Suppose the random variables in $\mathbf{X}$ form a tree graphical model $T^*$. Let $X_2$ be any leaf node and $X_1$ be its parent node. If $P_1 = P_2 = \frac{I}{k}$ and $P_{2|1} = \alpha_{2,1}I+(1-\alpha_{2,1})\frac{O}{k}$ such that $\exp{(-d_{max}/(k-1))}<\alpha_{2,1}<\exp{(-d_{min}/(k-1))}$, then Equation \eqref{eq:err_est_x} has a solution. \end{theorem} The proof is included in Appendix \ref{ap:symmetric}. Since, Equation \eqref{eq:err_est_x} has a solution for every leaf node $X_2$ as the candidate center node, using Theorem \ref{th:k_ary_iden}, we conclude that symmetric graphical models are unidentifiable. \paragraph{Perturbed symmetric graphical models:}\label{sec:pertured_symmetric} We first define a $k\times k$ perturbation matrix $\Delta_{a,b}$. For a given offset $0<c_{a,b}<k$, the term in the $(i,j)$ position of $\Delta_{a,b}$ is: $$ \Delta_{a,b}(i,j) = \left\{\begin{array}{rl} \delta_{a,b}, & \text{for } j = ((i-1+c_{a,b})\mod k) + 1\\ 0, & \text{o/w}. \end{array}\right. $$ In the perturbed symmetric model, the marginals continue to be uniform on the support but the conditional PMF matrix $P_{a|b}$ for adjacent $X_a$ and $X_b$ is modified to: $$ P_{a|b} = (\alpha_{a,b}-\delta_{a,b})I+(1-\alpha_{a,b})\tfrac{O}{k}+\Delta_{a,b}. $$ Here $\alpha_{a,b}$ and $\delta_{a,b}$ are chosen such that Assumption \ref{ass:distance} is satisfied. We find that perturbed symmetric graphical models are unidentifiable for $k = 3$ but become identifiable for $k\geq 4$. \begin{theorem}\label{th:perturbed_symmetric} Suppose the random variables in $\mathbf{X}$ form a tree graphical model $T^*$. Let $X_2$ be any leaf node and $X_1$ be its parent node. Suppose $P_1 = P_2 = \frac{I}{k}$ and $P_{2|1} = (\alpha_{a,b}-\delta_{a,b})I+(1-\alpha_{a,b})\frac{O}{k}+\Delta_{a,b}$ such that $|\delta_{a,b}|>0, \alpha_{a,b}\neq\delta_{a,b}$, and $\alpha_{a,b}$, $\delta_{a,b}$ are such that the distance assumptions in \ref{ass:distance} are satisfied. Then, equation \eqref{eq:err_est_x} has a solution for $k=3$, but does not have a solution for $k\geq 4$. \end{theorem} \textit{Proof Idea.} The proof for $k\geq 4$ relies on lower bounding the Frobenius norm of the quadratic away from 0. In conjunction with Theorem \ref{th:k_ary_iden}, this implies that the exact tree is identifiable when $k\geq4$. For $k=3$, we explicitly calculate the solution to Equation \eqref{eq:err_est_x}. Note that, for $k=3$ the class of symmetric and perturbed symmetric graphical models together comprise all the joint PMF matrices that are circulant. In fact, for $k=3$, when the marginals are uniformly distributed, the joint PMF matrix being circulant is a necessary and sufficient condition for unidentifiability. These details are presented in Appendix \ref{ap:perturbed_symmetric}. \paragraph{Unidentifiability when $k = 2$:} We now discuss the unidentifiability for $k=2$. \begin{lemma}\label{le:bin_sol} Suppose the random variables in $\mathbf{X}$ have support size $k=2$ and they form a tree graphical model $T^*$. The random variables in $\mathbf{X}$ pass through a binary symmetric channel with positive probability of error and we observe $\mathbf{X}'$. For any 3 nodes $(X_1, X_2, X_3)$, Equation \eqref{eq:err_est_x} always has a valid solution. \end{lemma} The proof of Lemma \ref{le:bin_sol} is in Appendix \ref{ap:bin_sol}. Corollary \ref{cor:ising} recovers the unidentifiability results of \cite{katiyar2020robust}. \begin{corollary}\label{cor:ising} When the random variables in $\mathbf{X}$ have a support size of 2 and all the parents of leaf nodes have non-zero noise, we have $\mathcal{T}_{T^*}^{sub} = \mathcal{T}_{T^*}$. \end{corollary} \section{Algorithm}\label{sec:algo} In this section, we present the algorithm to recover a tree from $\mathcal{T}_{T^*}^{sub}$ given samples corrupted by a $k$-ary symmetric noise channel as inputs. \\ \textbf{Key Idea:} The algorithm to recover the tree is an iterative one. During an iteration, we have an active set of nodes which are guaranteed to form a subtree. At each iteration, we find a leaf parent pair in the subtree, record that edge, and remove the leaf node from the active set of nodes. The algorithm to recover the tree structure is presented in Algorithm \ref{alg:find_tree}. \begin{figure} \centering \begin{minipage}{0.65\textwidth} \begin{algorithm}[H] \caption{Recover Tree Structure}\label{alg:find_tree} \textit{Input}: Pairwise noisy distributions, $P'_{i,j}$ $\forall{i,j} \in [n]$\\ \textit{Output}: List of edges, $Edges$ \begin{small} \begin{algorithmic}[1] \Procedure{FindTree}{$P'_{i,j}$ $\forall{i,j} \in [n]$} \State $ActiveSet \gets \{1, 2, \dots n\}$, $Edges \gets \{\}$, $Parents\gets \{\}$ \While{$|ActiveSet| > 2$} \State $leaf,parent \gets $ \textsc{GetLeafParent}($P'_{i,j}$, $ActiveSet$, $\dots$\\ \hspace{18em} $Edges$, $Parents$) \State{$ActiveSet \gets ActiveSet\setminus leaf$} \State{$Edges\gets Edges\cup (leaf,parent)$} \State{$Parents\gets Parents\cup parent$} \EndWhile \State $Edges\gets Edges\cup(ActiveSet[0],ActiveSet[1])$\\ \Return $Edges$ \EndProcedure \end{algorithmic} \end{small} \end{algorithm} \end{minipage}~\hfill \begin{minipage}{0.33\textwidth} \centering \includegraphics[width=0.9\textwidth]{algo_step.jpg} \caption{(a) If the node $z$ lies between $l$ and $r$, $l$ becomes $z$, hence getting closer to $r$. (b) If the node $r$ lies between $l$ and $z$, both $l$ and $r$ shift towards the right with $l$ becoming $r$ and $r$ becoming $z$.} \label{fig:alg_step} \end{minipage} \vspace{-2pt} \end{figure} \\ \textbf{Finding a leaf parent pair:} We next describe the algorithm to find a leaf parent pair. We maintain two nodes - a left node $l$, and a right node $r$. The idea is to move both the nodes towards the right side till $r$ is a leaf node and $l$ is its parent node. In order to do this we consider a third node $z$ and perform the following operations: \vspace{-0.7pc} \begin{enumerate}[leftmargin = *] \item If the center node in $(l,r,z)$ is $z$, we shift node $l$ to node $z$, \item If the center node in $(l,r,z)$ is $r$, we shift node $l$ to node $r$ and node $r$ to node $z$. \end{enumerate} \vspace{-0.7pc} This is illustrated in Figure (\ref{fig:alg_step}). Finding the center node can be done by checking the feasibility of Equation \eqref{eq:err_est_x} for different candidate center nodes. If Equation \eqref{eq:err_est_x} has a solution for more than one nodes, we use an alternative method which uses the 3 nodes in conjunction with different $4^{th}$ nodes. These 4 nodes are categorized as star/non-star to arrive at the center node. While doing the test for the center node, we only consider the nodes with pairwise distances smaller than $4d_{max} + 3\eta_{max}$. Here $\eta_{max}$ is an upper bound on the distance between a clean and noisy node. For a given $p_{min}$ and $q_{max}$ from Assumption \ref{ass:pmf} and \ref{ass:max_error} respectively, $\eta_{max} = (1-k)\log (1-q_{max}) - 0.5k \log (kp_{min})$ (details in Appendix \ref{ap:algo}). This makes it easy to adapt the algorithm for the finite sample setting. \paragraph{Finite sample algorithm:} The finite sample version of the algorithm uses the empirical estimate of the joint PMF of random variables to test for the center node given a set of three nodes. We only perform the test for nodes that whose empirical distance is small to avoid a sample complexity exponential in the diameter of the graph. For the test of center node by checking for existence of a solution to Equation \eqref{eq:err_est_x} using empirical PMF estimates, we need the following additional assumption: \begin{assumption}\label{ass:fin_sample_err_est} When Equation \eqref{eq:err_est_x} does not have a solution, we have the following inequality: \begin{align*} \min_{0\leq x<q_{max}}& \|\frac{x^2}{k^2}(O - kI) - \frac{x}{k}(OP_{2'} + P_{2'}O - kP_{2'} - I) + P_{2',3'} P_{1,' 3'}^{-1}P_{1',2'}-P_{2'}\|_F > t_0 \end{align*} \end{assumption} This assumption ensures that when Equation \eqref{eq:err_est_x} does not have a solution for a leaf node $X_2$ as a center node, it can be detected in the presence of perturbations due to finite samples. In Appendix \ref{ap:algo}, we provide the details of the algorithm including finding the center node, and necessary modifications for executing the algorithm using finite samples. In addition, we also include the pseudocode and the proof of correctness of the algorithm. \vspace{-5pt} \paragraph{Insights into the input parameters of the algorithm:} The algorithm in its vanilla form requires $d_{min},~d_{max},~ q_{max}, p_{min}$ and $t_0$ in addition to the noisy samples as inputs. While the dependence on the knowledge of $q_{max}$ is necessary, it is possible to obtain estimates of bounds of $d_{min}$ and $d_{max}$ using the noisy samples. This comes at the cost of higher sample complexity. Dependence on $t_0$ can also be avoided at the cost of higher time complexity. This is detailed as follows: \vspace{-5pt} \begin{itemize}[leftmargin = *, noitemsep] \item The upper bound on $d_{max}$ is denoted by $\Tilde{d}_{max}$. It is defined as $\Tilde{d}_{max} = \max_i\min_{j\neq i}d_{i'j'}$. This bound can potentially be lose by $2\eta_{max}$. \item If the ground truth is such that $d_{min} - 2\eta_{max} > 0$ then a lower bound on $d_{min}$, denoted by $\Tilde{d}_{min}$, can be defined as $\Tilde{d}_{min} = \min_i\min_{j\neq i}d_{i'j'} - 2\eta_{max}$. This bound can also be loose by $2\eta_{max}$. \item If $p_{min}$ and $q_{max}$ are such that $p_{min}>q_{max}$ then a valid lower bound on $p_{min}$ is $\min_i(P_{a'})_{i,i} - q_{max}$ which can potentially be lose by $q_{max}$. \item In the absence of the knowledge of $t_0$, we can use the star/non-star test for finding the center node among 3 nodes as long as no 2 nodes belong to the same \textit{leaf cluster}. This increases the time complexity of finding the center node from $\mathcal{O}(1)$ to $\mathcal{O}(n)$. Once we get nodes within the same \textit{leaf cluster}, the potential center node with the minimum objective function in Equation \eqref{eq:err_est_x} is chosen as the center node. \end{itemize} \vspace{-10pt} \section{Sample Complexity Results}\label{sec:sample_complexity}\vspace{-5pt} In this section, we provide both the sample complexity upper bounds and sample complexity lower bounds for recovering the tree using our algorithm in presence of corrupted samples. \begin{theorem}[\textbf{Sample Complexity Upper Bound}]\label{th:ub} Suppose the random variables in $\mathbf{X}$ form a tree graphical model $T^*$ and we observe $\mathbf{X}'$ such that Assumptions \ref{ass:pmf}, \ref{ass:distance}, \ref{ass:max_error} and \ref{ass:fin_sample_err_est} are satisfied. Then, the finite sample Algorithm \ref{alg:find_tree} correctly recovers $\mathcal{T}_{T^*}^{sub}$ with probability at least $1-\delta$ if the number of samples $N$ satisfies \begin{small} \begin{align*} N = \mathcal{O}\Bigg(\max\Bigg\{&\tfrac{k^2\exp(8d_{\max})}{(1-q_{max})^{6(k-1)}(0.9p_{min}^{2.5})^{2k}(1-\exp{(-2d_{min})})^2(k-1)^{2(k-1)}}\Bigg. \Bigg.,\\ &\Bigg.\Bigg.\tfrac{k \exp(16d_{\max})}{t_0^2 (1-q_{max})^{12(k-1)}(0.9p_{min}^{2.5})^{4k}(k-1)^{4(k-1)}}\Bigg\}\log\left(\tfrac{2nk(n-1)}{\delta}\right)\Bigg) \end{align*} \end{small} \end{theorem} In the unidentifiable setting, since Equation \eqref{eq:err_est_x} always has a solution, our algorithm finds more than one candidate center nodes and therefore resorts to the star/non-star test for finding the center node. In the sample complexity, the second term in the $\max$ comes from the quadratic test and therefore it can be dropped. As a result, since we have an easier learning problem of learning only $\mathcal{T}_{T^*}$, the sample complexity has better dependence on $d_{max}, q_{max}$ and $p_{min}$. \begin{theorem}[\textbf{Sample Complexity Lower Bound}]\label{th:lb} Suppose the random variables in $\mathbf{X}$ form a tree graphical model $T^*$ and we observe $\mathbf{X}'$ such that Assumptions \ref{ass:pmf}, \ref{ass:distance}, \ref{ass:max_error} and \ref{ass:fin_sample_err_est} are satisfied. Then any algorithm that correctly recovers $\mathcal{T}_{T^*}^{sub}$ with probability at least $1-\delta$ requires $N$ samples where $$ N = \Omega\left(\tfrac{\exp\left(\tfrac{2d_{\max}}{k-1}\right)}{(k-1)(1-q_{\max})^2\left(1-\exp\left(-\tfrac{d_{\min}}{k-1}\right)\right)} (1- \delta) \log(n)\right) $$ Furthermore, for $k \geq 4$, $0< t_0 \leq \tfrac{k}{10}\exp(-2\tfrac{d_{\max}}{k-1})$, we additionally have $$ N = \Omega\left(\max_{d\in \{d_{\max}, d_{\min}\}}\exp\left(-\tfrac{2d}{k-1}\right)\left(1-\exp\left(-\tfrac{d}{k-1}\right)\right) \tfrac{k(1- \delta) \log(n)}{ t_0^2}\right) $$ \end{theorem} \vspace{-5pt} We note that our lower bounds on sample complexity shows our certain dependence on the problem parameters cannot be improved orderwise. Firstly, we see the dependence on the graph size scales as $\Theta(\log(n))$ which is standard in graphical model learning. We observe that the sample complexity scales as ${\exp(\Theta(d_{\max}))}$ as a function of the $d_{max}$. Furthermore, for small enough $t_0$ and support size $4$ or more, the dependence on the lower bound for the quadratic term $Q(x)$, $t_0$, scales as $\Theta(\frac{1}{t_0^2})$ highlighting the significance of the term $Q(x)$ in the recovery of MRFs under unknown symmetric noise model. Our lower bound proof for $t_0$ dependence in the (partially) identifiable case uses a family of $(n+1)$ star graphs with $n$ edges each, where one graph is a perturbed symmetric graphical model (Section \ref{sec:pertured_symmetric}), and for the other graphs we select one edge each and replace the conditional PMF with the one from a symmetric model. Thus, the equivalence class $\mathcal{T}_{T^*}^{sub}$ for each graph in the family is unique. For the lower bounds in the unidentifiable scenario, we generalize the construction in \cite{tandon2021sga} to $k>2$ support size using symmetric graphical models. Our derivation for KL divergence for symmetric graphical model, and perturbed symmetric graphical models used in the lower bound proofs can be of independent interest.\vspace{-10pt} \section{Experiments}\label{sec:exp} In this section, we present the experiments demonstrating the efficacy of our algorithm (The code can be found at \url{https://github.com/ashishkatiyar13/NoisyTreeMRF}.). We first demonstrate the performance of our algorithm for the $k = 2$ setting and demonstrate that our algorithm considerably outperforms the algorithm in \cite{tandon2021sga}. Next, we showcase the performance of our algorithm for the $k = 4$ setting with the perturbed symmetric model. As discussed in Section \ref{sec:examples}, the exact tree is identifiable in this scenario. \vspace{-8pt} \begin{figure} \begin{subfigure}{\textwidth} \centering \includegraphics[scale = 0.27]{our_vs_sga_chain.pdf} \caption{Chain Graph} \label{fig:our_vs_sga_chain} \end{subfigure} \newline \begin{subfigure}{\textwidth} \centering \includegraphics[scale = 0.27]{our_vs_sga_star.pdf} \caption{Star Graph} \label{fig:our_vs_sga_star} \end{subfigure} \caption{For both chain and star graphs, our algorithm outperforms SGA for 4 different settings - (i) $\rho_{max} = 0.6, q_{max} = 0.4$, (ii) $\rho_{max} = 0.6, q_{max} = 0.0$, (iii) $\rho_{max} = 0.8, q_{max} = 0.4$, (iv) $\rho_{max} = 0.8, q_{max} = 0.0$} \label{fig:our_vs_sga} \end{figure} \subsection{Support size, $k = 2$ (Unidentifiable setting):}\vspace{-5pt} In this part, we compare the performance of our algorithm for chain and star graphs to that of SGA proposed in \cite{tandon2021sga}. We use the exact same settings as in \cite{tandon2021sga} and demonstrate that we outperform SGA. \\ For chain graphs, the nodes are labeled $X_1$ to $X_{12}$ from left to right. The star graphs have $X_1$ as the center node and $X_2,\dots X_{12}$ are leaf nodes connected to $X_1$\vspace{-3pt} \paragraph{Setting:} (i) Number of nodes = 12. (ii) Correlation of all the adjacent nodes = $\rho$. (iii) Alternate nodes have maximum noise ($q_i$ = 0 if $i~\%~2 = 0$, $q_i$ = $q_{max}$ if $i~\%2~ = 1$). (iv) Assume access to $\rho$. (v) Number of iterations = 1000 \\ For both, chain graphs and star graphs, we vary $\rho$ in $\{0.6, 0.8\}$ and $q_{max}$ in $\{0, 0.4\}$. We would like to point out that $q_{max}$ is defined differently in our setting and in SGA; $q_{max}$ in our setting is twice the SGA's $q_{max}$. The final results are presented in Figures \ref{fig:our_vs_sga_chain} and \ref{fig:our_vs_sga_star} respectively. \vspace{-10pt} \begin{figure} \centering \includegraphics[scale = 0.4]{random_graph.jpg} \caption{Randomly generated graph used for algorithm evaluation.} \label{fig:random_graph} \end{figure} \subsection{Support size, $k = 4$ (Identifiable Setting):} \vspace{-5pt} In this part we see the impact of $\delta$ on the performance of the algorithm for different graphs. We execute the algorithm for a lot of randomly generated graphs and the algorithm converges to the correct output. We report the results for 3 different graph structures - star, chain and one of the many randomly generated graphs (Figure \ref{fig:random_graph}). \paragraph{Setting}: (i) Number of nodes = 7.\\ (ii) Graph Shape = \{Chain, Star, Random\}\\ (iii) Distance of all the adjacent nodes = $\exp(-0.7)$. \\ (iv) Error probability is uniformly sampled from $[0,0.2]$.\\ (v) $\delta\in \{0.00, 0.02, 0.04\}$\\ (vi) Assume access to $q_{max}$, $d_{min}$ but not to $d_{max}$, $t_0$.\\ (vii) Number of iterations = 100 \begin{figure} \centering \includegraphics[scale = 0.2]{app_k_4_delta.pdf} \caption{Comparing the performance of our algorithm and Chow-Liu over different values of $\delta_{i,j}\in \{0.00, 0.02, 0.04\}$ and different graph shapes - chain, star, random. Setting: $d_{min} = d_{max} = \exp(-0.7)$, $q_{max} = 0.2$, $\#$ of nodes$=7$. For both algorithms, we provide results for two cases: i) when the exact underlying tree is recovered, ii) when a tree from the equivalence class is recovered.} \label{fig:app_k_4_delta} \end{figure} \paragraph{Takeaways:} \begin{enumerate}[leftmargin=*,noitemsep]\vspace{-5pt} \item We witness the transition from unidentifiability to identifiability. When $\delta = 0$, the exact graph cannot be recovered and hence the exact recovery fraction remains low consistently regardless of the number of samples. Higher $\delta$ has faster convergence to the correct graph. \item Learning a tree from the equivalence class requires much fewer samples. \item For the given noise model when the probability of error is randomly selected, for a significant number of realizations in the star shape, the Chow-Liu remains in the equivalence class. However, it lags behind considerably compared to our algorithm. \item Chow-Liu has high error for complete recovery. \end{enumerate} We also perform extensive experiments where we evaluate the impact of the probability of error and the distance between adjacent nodes and present the results in Appendix \ref{ap:exps}. \vfill \pagebreak
\section{Introduction} The non-linear sigma model (NLSM) \cite{GellMann:1960np,Coleman:1969sm,Callan:1969sn}, originally designed to describe light mesons in the chiral perturbation theory \cite{Weinberg:1978kz,Gasser:1983yg,Gasser:1984gg}, serves as an effective field theory (EFT) for Nambu-Goldstone bosons (NGB's), which are consequences of spontaneous symmetry breaking. It was gradually realized \cite{Susskind:1970gf,Ellis:1970nn} and made concrete in the recent years \cite{Low:2014nga,Low:2014oga} that a universal Lagrangian can be constructed for NLSM using entirely infrared (IR) information, without input from the symmetry breaking pattern in the ultraviolet (UV). The IR universality has already been shown to have profound phenomenological implications \cite{Liu:2018vel,Liu:2018qtb,Liu:2019rce} for composite Higgs models \cite{Kaplan:1983fs,Agashe:2004rs,Panico:2015jxa}. On the other hand, the past decade has seen much activity in studying on-shell properties of the NLSM \cite{ArkaniHamed:2008gz,Kampf:2012fn,Kampf:2013vha,Chen:2013fya,Chen:2014dfa,He:2016vfi,Du:2016tbc,Chen:2016zwe,Cheung:2017ems,Cheung:2017yef,Mizera:2018jbh,Carrillo-Gonzalez:2018pjk,Bjerrum-Bohr:2018jqe,Gomez:2019cik,Carrasco:2019qwr}. The bulk of these endeavors focus on the NLSM amplitudes at the leading $\mathcal{O} (p^2)$ in the derivative expansion of the EFT, as well as of the coset ${\text{SU}} (N) \times {\text{SU}} (N)/{\text{SU}} (N)$ seen in the chiral perturbation theory. This appears as a disconnection to the IR universality of the EFT Lagrangian. There are notable exceptions \cite{Carrillo-Gonzalez:2019aao,Bijnens:2019eze}, such as interesting higher derivative terms connected to the Z-theory \cite{Carrasco:2016ldy,Carrasco:2016ygv}, which involves a very specific set of operators starting at $\mathcal{O} (p^6)$. However, the general amplitudes at the subleading $\mathcal{O}(p^4)$, as well as other kinds of flavor symmetries, are less understood. A particularly important aspect of the NLSM amplitudes is the soft theorems, which dictate the on-shell behaviors when there exists a hierarchy among the energy of the external states. Interesting soft theorems are seen in a variety of quantum field theories, and have received much attention in the recent years for their connections to other subjects such as asymptotic symmetries and memory effects \cite{Strominger:2017zoo}. For NLSM, in the single soft limit, i.e. when one of the external momenta is taken to zero, the amplitudes vanish\footnote{This applies to the common case when the NGB's transform under a group representation that can be embedded into a symmetric coset, which will be the focus of this work. For a recent discussion on the soft theorems when this is not the case, see Ref. \cite{Kampf:2019mcd}.}, a behavior known as the Adler zero \cite{Adler:1964um}. Acting as a defining property of the EFT by enforcing a nonlinear shift symmetry, the Adler zero is a key ingredient in the IR construction of the universal Lagrangian. An on-shell equivalent of such a construction is the soft bootstrap \cite{Cheung:2014dqa,Cheung:2015ota,Cheung:2016drk,Elvang:2018dco,Low:2019ynd}, which utilizes recursion relations that are only valid because of the Adler zero, and has been used to explore higher derivative corrections \cite{Dai:2020cpk}. Other constructions in similar spirit have been realized as well \cite{Kampf:2013vha,Arkani-Hamed:2016rak,Rodina:2016jyz,Rodina:2018pcb}. The leading non-vanishing term in the single soft theorem of the tree level $\mathcal{O} (p^2)$ NLSM amplitudes involves an extended theory with additional field content of bi-adjoint scalars, which was first discovered \cite{Cachazo:2016njl} using the Cachazo-He-Yuan (CHY) formalism \cite{Cachazo:2013gna,Cachazo:2013hca,Cachazo:2013iea,Cachazo:2014xea}. The appearance of the extended theory was later understood as a consequence of the Ward identity corresponding to the shift symmetry, which enables a direct calculation of the relevant Feynman rules \cite{Low:2017mlh,Low:2018acv,Yin:2018hht}. These previous results have all been presented in the context of a symmetry breaking pattern of ${\text{SU}} (N) \times {\text{SU}} (N)/{\text{SU}} (N)$. We argue here that such a restriction is unnecessary, because the flavor ordering at this derivative order is universal. The extended theory emerging from the soft theorem thus also can be interpreted in more general group representations. A specific application of such a generalization is for NGB's in the fundamental representation $\mathbf{N}$ of ${\text{SO}} (N)$, as seen in composite Higgs models, where the Higgs doublet is treated as pseudo NGB's furnishing $\mathbf{4}$ of the custodial ${\text{SO}} (4)$. Apart from the single trace ordering for a general group representation, a special ``pair basis'' is available in this case. An extended theory amplitude in such a basis has been shown to exist in the corresponding single soft theorem \cite{Low:2019wuv}, for which we provide detailed derivations, uncovering interesting properties of the pair basis amplitudes along the way. By using the Ward identity, there is no obstruction to calculate the leading non-vanishing piece in the single soft theorem to higher derivative orders. What is less clear is whether there still exist the interpretations of extended theories. Recent work by the authors \cite{Low:2020ubn} asked a similar question in the context of the double copy \cite{Bern:2019prr}. It was demonstrated that at least one $\mathcal{O} (p^4)$ operator, which results in a theory dubbed $\text{NLSM}^{d_2}$, admits a double copy construction, through novel color-kinematic numerators \cite{Carrasco:2019yyn,Low:2019wuv} which do not necessarily imply Bern-Carrasco-Johansson (BCJ) relations \cite{Bern:2008qj}. Naturally, one would expect an extended theory emerging from the single soft theorem of $\text{NLSM}^{d_2}$, as previously its appearance has been known to be intricately related to the existence of double copy structures and CHY representations of the amplitudes. We find that this is indeed the case. However, we are also able to discover that at least another $\mathcal{O} (p^4)$ operator gives rise to an extended theory as well. This is surprising, as the corresponding amplitudes have no known double copy structures or CHY representations, marking the first instance when an extended theory emerging in the single soft theorem is uncovered using the Ward identity alone. The double soft theorem for the NLSM has also been well established, when two of the external states take much less energy than the rest. Unlike the single soft case, the double soft limits of NLSM do not generate extended theory amplitudes with new field content, but just the usual lower point amplitudes as in the well-known single and double soft limits of gauge theory and gravity \cite{Strominger:2017zoo}. The double soft theorem has been known to the leading and subleading orders in the soft expansion \cite{Cachazo:2015ksa,Du:2015esa}, and has been studied in a completely general group representation as well \cite{Low:2015ogb}, but still only for $\mathcal{O} (p^2)$ in the EFT expansion. It is natural then to extend it to higher derivative orders. We find that at tree level, the double soft theorems can actually be computed to all orders in the derivative expansion, by judiciously applying various single soft limits in the spirit of Ref. \cite{Low:2015ogb}. Interestingly, they are fully determined by the $\mathcal{O}(p^2)$ and $\mathcal{O}(p^4)$ order Lagrangians, implying that higher derivative corrections to NLSM all satisfy the same soft theorems. The paper is organized as follows. In Section \ref{sec2} we review the usual trace decomposition of the NLSM amplitudes governed by the linear flavor symmetry, as well as the single soft theorem as a consequence of the nonlinear shift symmetry and the corresponding Ward identity. The universality of the flavor ordering for a general symmetry group representation enables us to reinterpret the known extended theory in the single soft limit. In Section \ref{sec:son} we inspect the specific case of NGB's furnishing $\mathbf{N}$ of ${\text{SO}} (N)$, where we study the alternative flavor decomposition in the pair basis. We present new amplitude relations and a CHY formula for the amplitudes in such a basis, then derive the corresponding single soft theorem at $\mathcal{O} (p^2)$ and the associated extended theory amplitudes. In Section \ref{sec4} we compute the single soft theorems for $\mathcal{O}(p^4)$ amplitudes, and study the possible existence of the extended theories, first for the $\text{NLSM}^{d_2}$ and then for the general case. In Section \ref{sec5} we compute the double-soft theorems valid to arbitrary derivative order. We conclude in Section \ref{sec6}. We also provide supporting materials in the appendices: useful derivations in Appendix \ref{app:der}, as well as examples related to the single soft theorems in Appendix \ref{app:lpv}. \section{Symmetries and the amplitudes of the NLSM}\label{sec2} As an EFT, the NLSM is valid below a high energy scale $\Lambda$, and its Lagrangian admits a derivative expansion of $\partial/\Lambda$. Up to the 4-derivative level, we can write \begin{eqnarray} {\mathcal{L}}^\text{NLSM} = {\mathcal{L}}^{(2)} + {\mathcal{L}}^{(4)} +\mathcal{O} \left( \frac{1}{\Lambda^4} \right), \end{eqnarray} with ${\mathcal{L}}^{(2)} = \mathcal{O} (1/\Lambda^0)$ and ${\mathcal{L}}^{(4)} = \mathcal{O} (1/ \Lambda^2)$. Let us consider a general NLSM of NGB's furnishing the representation $R$ of a linearly realized flavor group $H$, with associated generators $(T^i)_{ab}$\footnote{We choose a totally imaginary and anti-symmetric basis for any group generators throughout this work, and the normalization is given by $\mathrm{tr} (T^i T^j) = \delta^{ij}$, $\mathrm{tr} (\textsf{X}^a \textsf{X}^b) = \delta^{ab}$, etc.}, and the NGB $\pi^a$ carries the flavor index $a$. The basic building blocks for the Lagrangian are \begin{eqnarray} d_\mu \equiv d_\mu^a \textsf{X}^a,\qquad E_\mu \equiv E_\mu^i \textsf{T}^i, \end{eqnarray} where $\textsf{X}^a$ and $\textsf{T}^i$ are generators of some group $G$ containing the subgroup $H$. In the traditional coset construction of Callan, Coleman, Wess and Zumino \cite{Coleman:1969sm,Callan:1969sn}, the NGB's are known to be coming from the spontaneous symmetry breaking of group $G$ to the unbroken group $H$, $\textsf{T}^i$ are the ``unbroken generators'' of the subgroup $H$, while $\textsf{X}^a$ are the ``broken generators'' associated with the coset $G/H$. On the other hand, the same Lagrangian can also be constructed using entirely IR information of the linearly realized group $H$ and its representation $R$ \cite{Low:2014nga,Low:2014oga}, where $\textsf{T}^i$ and $\textsf{X}^a$ are constructed using the generators $(T^i)_{ab}$ of $R$ and the structure constants $f^{ijk}$ of $H$ \cite{Low:2019ynd}. We are also assuming that the generators $T^i$ satisfy the ``closure condition'': \begin{eqnarray} T^i_{ab} T^i_{cd} + T^i_{ac} T^i_{db}+T^i_{ad} T^i_{bc} = 0,\label{eq:clocon} \end{eqnarray} which guarantees that $R$ of $H$ can be embedded into a symmetric coset $G/H$, so that one can identify $T^i_{ab} = -if^{iab}$ as the structure constants for $G$, whose Lie algebra is given by \begin{eqnarray} [\textsf{X}^a, \textsf{X}^b] = if^{iab} \textsf{T}^i,\qquad [\textsf{T}^i, \textsf{X}^a] = if^{iab} \textsf{X}^{b},\qquad [\textsf{T}^i, \textsf{T}^j] = if^{ijk} \textsf{T}^k.\label{eq:crg} \end{eqnarray} In general, $d_\mu^a$ and $E_\mu^i$ can be expressed as \begin{eqnarray} d_\mu^a = \frac{1}{f} [ F_1 ({\mathcal{T}}) ]_{ab} \partial_\mu \pi^b, \qquad E_\mu^i = \frac{1}{f^2} \partial_\mu \pi^{a} [ F_2({\mathcal{T}}) ]_{a b} T^i_{b c} \pi^c , \label{eq:dexpo} \end{eqnarray} where \begin{eqnarray} F_1 ({\mathcal{T}}) &=& \frac{\sin \sqrt{{\mathcal{T}}}}{\sqrt{ {\mathcal{T}}} } = \sum_{n=0}^\infty \frac{(-1)^n}{(2n+1)! } {\mathcal{T}}^n,\label{eq:ccf1}\\ F_2 ({\mathcal{T}} ) &=& -\frac{2i}{{\mathcal{T}}} \sin^2 \frac{\sqrt{{\mathcal{T}}}}{2} =-i \sum_{n=0}^\infty \frac{(-1)^n}{(2n+2)! } {\mathcal{T}}^n, \label{eq:ccf2}\\ ({\mathcal{T}})_{a b} &=& \frac{1}{f^2} T^i_{ac} T^i_{db} \pi^c \pi^{d} . \end{eqnarray} Notice that both $d_\mu$ and $E_\mu$ are linear in $\partial$, while being a series expansion of $\pi/f$, where $f$ is the coupling constant with the same mass dimension as $\pi$. One can construct a ``covariant derivative'' $\nabla_\mu$ so that \begin{eqnarray} \nabla_\mu d_\nu \equiv \partial_\mu d_\nu + i[E_\mu, d_\nu]. \end{eqnarray} Then the Lagrangian can be expressed as: \begin{eqnarray} {\mathcal{L}}^\text{NLSM} = f^2 \Lambda^2 \tilde{{\mathcal{L}}} \left(\frac{d}{\Lambda},\frac{\nabla}{\Lambda} \right),\label{eq:nlsmp} \end{eqnarray} where $\tilde{{\mathcal{L}}}$ is a dimensionless function. Up to $\mathcal{O} (p^4)$, the Lagrangian is given by \begin{eqnarray} {\mathcal{L}}^{(2)}= \frac{f^2}{2} \mathrm{tr} \left( d_\mu d^\mu \right),\qquad {\mathcal{L}}^{(4)}= \frac{f^2}{\Lambda^2} \left( \sum_{i=1}^4 C_i O_i + C_- O_{\text{wzw}} \right) ,\label{eq:nlsml4} \end{eqnarray} where $C_i$ and $C_-$ are dimensionless Wilson coefficients, \begin{eqnarray} O_1 = [ \mathrm{tr} ( d_\mu d^\mu ) ]^2, \quad O_2 = [\mathrm{tr} ( d_\mu d_\nu ) ]^2, \quad O_3 = \mathrm{tr} ( [ d_\mu, d_\nu]^2 ) ,\quad O_4 = \mathrm{tr} ( \{ d_\mu, d_\nu \}^2 ) \label{eq:o14} \end{eqnarray} are the parity (P) even generators at $\mathcal{O} (p^4)$, and \begin{eqnarray} O_{\text{wzw}} = \varepsilon^{\mu\nu\rho\sigma}\ \mathrm{tr} \left( \Pi \partial_\mu\Pi \partial_\nu\Pi \partial_\rho\Pi \partial_\sigma\Pi \right)+ \mathcal{O} (\Pi^7), \qquad \Pi \equiv \frac{\pi^a \textsf{X}^a}{f} \end{eqnarray} is the P-odd Wess-Zumino-Witten (WZW) term \cite{Wess:1971yu,Witten:1983tw} that can exist when the spacetime dimension $d=4$, and can be expressed using $d_\mu$ by compactifying a 5-dimensional spacetime: \begin{eqnarray} S_{{\text{wzw}}} \propto \int d^5y \ \varepsilon^{\alpha \beta \gamma \delta \epsilon} \mathrm{tr} ( d_\alpha d_\beta d_\gamma d_\delta d_\epsilon ) = \int d^4 x\ O_{\text{wzw}} .\label{eq:lagwzwdef} \end{eqnarray} The form of ${\mathcal{L}}^\text{NLSM}$ is dictated by the linearly realized symmetry of $H$, as well as a nonlinearly realized shift symmetry, which we will discuss in detail in Section \ref{sec:st}. Notice that up to $\mathcal{O} (p^4)$, the Lagrangian can be expressed entirely using $d_\mu$ without involving $\nabla_\mu$. One may write down other operators for the Lagrangian, e.g. $\mathrm{tr} ( d_\mu d^\nu \nabla^\mu d^\nu)$, but they will not be independent of the operators in Eq. (\ref{eq:nlsml4}): they are related by total derivatives, symmetry transformations or the equation of motion (EoM) \cite{Low:2019ynd}. If we specify the $R$ of $H$, the basis of independent operators may further be reduced. For example, in the chiral perturbation theory, the coset is $G/H = {\text{SU}} (N_\text{f}) \times {\text{SU}} (N_\text{f})/ {\text{SU}} (N_\text{f})$, so that $R$ is the adjoint representation of ${\text{SU}} (N_\text{f})$, where $N_\text{f} = 2$ or $3$ is the number of the flavors for the light quarks. For $N_\text{f} = 2$, $O_{\text{wzw}}$ vanishes while $O_3 $ and $O_4$ can be expressed in terms of linear combinations of $O_1$ and $O_2$, so that there are only 2 independent $\mathcal{O} (p^4)$ operators. For $N_\text{f} = 3$, $O_{\text{wzw}}$ is non-vanishing, though $O_4$ can be expressed as a linear combination of $O_1$, $O_2$ and $O_3$, thus there are 3 independent P-even operators at $\mathcal{O} (p^4)$. The amplitudes for the NLSM also exhibit a derivative expansion, and at tree level one can write \begin{eqnarray} {\cal M}_n^\text{NLSM} &=& {\cal M}_n^{(2)} + {\cal M}_n^{(4)} + \mathcal{O} \left( \frac{1}{\Lambda^4} \right),\label{eq:dena} \end{eqnarray} where $n$ is the multiplicity, with \begin{eqnarray} {\cal M}_{n}^{(m)} = \mathcal{O} (f^{2-n} \Lambda^{2-m} ), \end{eqnarray} which is controlled by the Lagrangian up to $\mathcal{O} (p^m)$. Below we discuss the consequences of the symmetries in NLSM at the amplitude level. In Section \ref{sec:fo} we review the flavor decomposition of the amplitudes, while in Section \ref{sec:st} we review the single soft theorem resulting from the nonlinearly realized shift symmetry. \subsection{Flavor symmetry and flavor ordering} \label{sec:fo} The existence of the linearly realized flavor symmetry of $H$ leads to a convenient separation of flavor and kinematics for the tree level amplitudes. We will see that up to $\mathcal{O} (p^4)$, the general NLSM can be expressed in a single or double trace basis. An additional ``pair basis'' is available when we specify $R$ of $H$ to be $\mathbf{N}$ of ${\text{SO}} (N)$, which will be discussed later in Section \ref{sec:son}. \label{sec:rb} Let us consider the leading order Lagrangian \begin{eqnarray} {\mathcal{L}}^{(2)}= \frac{f^2}{2} \mathrm{tr} \left( d_\mu d^\mu \right) = \frac{f^2}{2} d_\mu^a d^{a\mu} ,\label{eq:lolg} \end{eqnarray} and denote the corresponding theory $\text{NLSM}^{(2)}$. Using the relations in Eq. (\ref{eq:crg}) we can rewrite ${\mathcal{L}}^{(2)}$ as \cite{Kampf:2013vha} \begin{eqnarray} {\mathcal{L}}^{(2)} &=& \frac{f^2}{8} \mathrm{tr} \left( \partial_\mu U^\dagger \partial^\mu U \right),\label{eq:lagst} \end{eqnarray} where \begin{eqnarray} U = \exp \left(2i \Pi \right) = \exp \left(2i \pi^a \textsf{X}^a /f \right). \end{eqnarray} The interactions given by Eq. (\ref{eq:lagst}) are even powers of $\pi^a$ contracted with a single trace of generators $\textsf{X}^a$. Therefore, it is convenient to consider flavor-ordered partial amplitudes, as used in the soft bootstrap as the on-shell construction of the NLSM \cite{Cheung:2015ota,Cheung:2016drk,Elvang:2018dco,Low:2019ynd}. These partial amplitudes are similar to the color-ordered amplitudes of the Yang-Mills (YM) theory \cite{Dixon:1996wi}, where the interactions involve the structure constant $f^{ijk}$, which corresponds to $T^i_{ab} $ in Eq. (\ref{eq:lolg}). From the perspective of just the group $H$, $T^i_{ab}$ is a group generator in some general representation; however, from the perspective of the broken group $G$ and coset $G/H$, $T^i_{ab} = -if^{iab}$ is the structure constant of $G$, i.e. the generator of $G$ in the adjoint representation. Similarly, the gauge bosons in YM theories furnish the adjoint representation as well. The color-decomposition of the YM theory can thus be directly applied to general $\text{NLSM}^{(2)}$. The flavor structure of the full amplitude can be expanded in the trace basis as \begin{eqnarray} {\cal M}_n^{(2),a_1 \cdots a_n} (p_1, \cdots, p_n) = \sum_{\alpha \in S_{n-1}} \mathrm{tr} \left( \textsf{X}^{a_1} \textsf{X}^{a_{\alpha (1)}} \cdots \textsf{X}^{a_{\alpha (n-1)}} \right) M_n^{(2)} (1,\alpha),\label{eq:fdtb} \end{eqnarray} where $\alpha$ is a permutation of $\{2, 3, \cdots, n\}$ and $M_n^{(2)} (1,\alpha)$ is the single-trace flavor-ordered partial amplitude. The right-hand side (RHS) of Eq. (\ref{eq:fdtb}) is a sum of $(n-1)!$ terms. The lesson we learn from YM theories is that the flavor expansion in Eq. (\ref{eq:fdtb}) is over-complete, and can be further reduced to the Del Duca-Dixon-Maltoni (DDM) basis \cite{DelDuca:1999rs} as a sum of $(n-2)!$ terms: \begin{eqnarray} &&{\cal M}_n^{(2),a_1 \cdots a_n} (p_1, \cdots, p_n)\nonumber\\ &=& \sum_{\alpha \in S_{n-2}} (-1)^{n/2-1} f^{a_1 a_{\alpha (1)} i_1 }\left( \prod_{j=1}^{n/2-2} f^{i_{j} a_{ \alpha (2j)} b_j} f^{b_j a_{\alpha (2j+1)} i_{j+1}} \right) f^{i_{n/2-1} a_{\alpha (n-2)} a_n} M_n^{(2)} (1,\alpha, n)\nonumber\\ &=& \sum_{\alpha \in S_{n-2}} T^{i_1}_{a_1 a_{\alpha (1)} }\left( \prod_{j=1}^{n/2-2} T^{i_{j}}_{ a_{ \alpha (2j)} b_j} T^{i_{j+1}}_{b_j a_{\alpha (2j+1)} } \right) T^{i_{n/2-1}}_{ a_{\alpha (n-2)} a_n} M_n^{(2)} (1,\alpha, n),\label{eq:ddm} \end{eqnarray} where $\alpha $ is a permutation of $\{2,3,\cdots, n-1\}$. The ordered amplitudes thus need to satisfy the Kleiss-Kuijf (KK) relations \cite{Kleiss:1988ne}. If we further take flavor-kinematics duality into account, using the BCJ relations \cite{Bern:2008qj} we can reduce the number of independent ordered amplitudes to $(n-3)!$. It is helpful to express the flavor factors diagrammatically, where solid lines represent the broken indices $a$ in the representation $R$, and dashed lines denote the unbroken indices $i$ in the adjoint of $H$. The generator $T^i_{ab}$ and the structure constant $f^{ijk}$ are then vertices given by Fig. (\ref{fig:tf}). Under this notation, the flavor factor of each term in Eq. (\ref{eq:ddm}) is given by a half-ladder graph shown in Fig. \ref{fig:ddm}. \begin{figure}[t] \centering \includegraphics[width=0.5\textwidth]{tf} \caption{\label{fig:tf} The graphic presentation of $T^i_{ab}$ and $f^{ijk}$ as vertices.} \end{figure} \begin{figure}[t] \centering \includegraphics[width=0.7\textwidth]{ddm} \caption{\label{fig:ddm} The flavor factors in the DDM basis. The internal lines represent the indices that are contracted and summed over.} \end{figure} A common practice of calculating the ordered amplitude is working out the ordered Feynman vertices, and then summing up all distinct planar Feynman diagrams \cite{Dixon:1996wi}. It is important to note that in principle, such operation does not work for a general group representation of the NLSM, as it relies on the correct factorization of traces, which is only valid in some cases such as the adjoint of ${\text{SU}} (N)$ \cite{Kampf:2013vha}. This applies to recursion relations as in the soft bootstrap as well \cite{Low:2019ynd}. However, in practice, we can still always calculate the on-shell amplitudes correctly using these methods, as the flavor ordering is universal, thus the partial amplitudes for the adjoint of ${\text{SU}} (N)$ are not different from the partial amplitudes of any other group representations\footnote{Again, with the assumption that the closure condition Eq. (\ref{eq:clocon}) is satisfied.}. This is similar to the case of gauge theory: the ordered amplitudes are universal whatever the gauge group is. The general trace ordering can be extended to $\mathcal{O} (p^4)$. At tree level, when we consider the Feynman diagrams, the $\mathcal{O} (p^4)$ vertices generated by ${\mathcal{L}}^{(4)}$ enter once and only once in each diagram for ${\cal M}_{n}^{(4)}$. Consequently, from Eqs. (\ref{eq:nlsml4}), (\ref{eq:o14}) and (\ref{eq:lagwzwdef}) we see that the contributions of $O_1$ and $O_2$ admit a double-trace ordering, while $O_3$, $O_4$ and $O_{\text{wzw}}$ still have the same single-trace structure as the $\mathcal{O} (p^2)$ piece. In general, one can define the multi-trace flavor decomposition as \begin{eqnarray} &&{\cal M}^{a_1 \cdots a_{n} }_n (p_1, \cdots, p_{n})\nonumber\\ & \equiv& \sum_{t=1}^{\lfloor n/2 \rfloor } \sum_{ l} \sum_{\sigma \in S_{n} / S_{n;l} } \left[ \prod_{i=1}^{t} \mathrm{tr} \left( \textsf{X}^{a_{\sigma (l_{i-1} +1)}} \cdots \textsf{X}^{a_{\sigma (l_i)}} \right) \right] \nonumber\\ &&\times M_n ( \alpha (1), \cdots, \alpha (l_1) | \alpha(l_1 + 1), \cdots , \alpha (l_2 ) | \cdots | \alpha (l_{t-1} + 1), \cdots \alpha (n) ),\label{eq:mttfo} \end{eqnarray} where $l = \{ l_0, \cdots ,l_t \}$ labels partitions of ordered indices $\{1, 2, \cdots , n\}$ into $t$ subsets, so that $l_0 = 0$, $l_t = n$ and $l_{i+1} - l_i \le l_{i+2} - l_{i+1}$, $i=0,1, \cdots, t-2$; $S_{n;l}$ are the permutations of $\{1, 2, \cdots , n\}$ that leave the flavor factor invariant. The partial amplitude \begin{eqnarray} M_n (1,2, \cdots l_1|l_1 + 1, \cdots , l_2 | \cdots | l_{t-1} + 1, \cdots, n) \end{eqnarray} is invariant not only under the cyclic permutations separately for the sets of indices $\{1,2, \cdots, l_1\}$, $\{ l_1+1, \cdots, l_2 \}$ and so on, but also when we exchange the sets $\{ l_i+1, \cdots ,l_{i+1} \}$ and $\{ l_{i+1} + 1, \cdots , l_{i+2} \}$ if they are of the same size, i.e. $l_{i+1} - l_i = l_{i+2} - l_{i+1}$. \subsection{Shift symmetry and the single soft theorem} \label{sec:st} The NLSM effective Lagrangian is determined by a non-linear shift symmetry. From the UV perspective of spontaneous symmetry breaking, this shift symmetry is the non-linear realization of the broken symmetry associated with the coset $G/H$. However, the shift symmetry can also be fixed without knowing the UV information of the broken group $G$. This is directly related to the fact that the amplitudes of NLSM satisfy the Adler zero condition: for an on-shell amplitude ${\cal M}_{n}^{a_1\cdots a_{n-1} a} (p_1, \cdots, p_{n-1}, q)$\footnote{In this work we assume all momenta are ingoing, so that the momentum conservation here is given by $\sum_{i=1}^{n-1} p_i = -q$.}, if we take the soft limit of $q$, i.e. replace $q$ with $\tau q$ and take the limit of $\tau \to 0$, the amplitude vanishes linearly in $\tau$: \begin{eqnarray} {\cal M}_{n}^{a_1\cdots a_{n-1} a} (p_1, \cdots, p_{n-1}, \tau q) = \mathcal{O} (\tau).\label{eq:azc} \end{eqnarray} Such a condition can be treated as the defining property of the NLSM, and is the most basic of the soft theorems of NLSM amplitudes. Upon recognizing the Adler zero condition, the non-linear shift symmetry can be derived without the UV information of the broken group $G$. The associated transformation of the shift symmetry for the NGB's is \cite{Low:2014nga,Low:2014oga,Low:2017mlh,Low:2018acv} \begin{eqnarray} \pi^a \to \pi^a + \left[ F_3 ({\mathcal{T}}) \right]^{ab} \varepsilon^b, \end{eqnarray} where \begin{eqnarray} F_3 ({\mathcal{T}}) &=& \sqrt{{\mathcal{T}}} \cot \sqrt{{\mathcal{T}}}, \end{eqnarray} and $\varepsilon^a$ are constants that parameterize the shift. Starting at $\mathcal{O} (p^4)$, there are both P-even and P-odd parts in the Lagrangian, the latter of which are the WZW terms that capture the effects of the anomalies. Under the shift transformation, the P-even parts of the Lagrangian are invariant, while the WZW terms change by a total derivative. We can then calculate the current associated with the shift symmetry: we promote the shift parameter to a local one: $\varepsilon^a \to \varepsilon^a (x)$, and find out that up to total derivatives, the variation of the Lagrangian is given by \begin{eqnarray} \delta {\mathcal{L}} =\varepsilon^a (x) \partial^\mu \mathcal{J}_\mu^a, \end{eqnarray} where \begin{eqnarray} \mathcal{J}_\mu^a = \partial_\mu \pi^a + \mathcal{O} \left (\frac{1}{f^2} \right). \end{eqnarray} Classically, the current is conserved because the action should not change: \begin{eqnarray} \partial^\mu \mathcal{J}_\mu^a = 0. \end{eqnarray} As we have taken care of the quantum anomalies with the WZW term in the Lagrangian, the current remains conserved at the quantum level, leading to the Ward identity for the correlation functions: \begin{eqnarray} &&i \partial^\mu \< \Omega| \mathcal{J}^a_\mu (x) \prod_{i=1}^n \pi^{a_i} (x_i) |\Omega \>\nonumber \\ &=& \sum_{r=1}^n \<\Omega| \pi^{a_1} (x_1) \cdots \left[F_3 ({\mathcal{T}})\right]_{a_r a}(x_r) \delta^{(4)}(x-x_r) \cdots \pi^{a_n} (x_n) |\Omega \> . \end{eqnarray} Performing the LSZ reduction and taking the on-shell limit, the RHS of the above vanishes, and we arrive at a single soft theorem of the on-shell amplitude: \begin{eqnarray} {\cal M}_n^{a_1\cdots a_{n} a} (p_1, \cdots, p_n, q) = q \cdot {\cal R}^{a_1 \cdots a_{n} a} (p_1, \cdots, p_n; q),\label{eq:wia} \end{eqnarray} where the momentum $q$ is carried by the current. As shown in Fig. \ref{fig:cur}, the left-hand side (LHS) of the above comes from the one particle pole in $\mathcal{J}$, while the rest of the current enter the remainder function ${\cal R}^{a_1 \cdots a_{n} a}_\mu$: \begin{eqnarray} {\cal R}_\mu^{a_1 \cdots a_{n} a} (p_1, \cdots, p_n; q) = \frac{i}{\sqrt{Z}} \<0| \int d^4x\, e^{-i q \cdot x} \tilde{\mathcal{J}}_\mu^a | \pi^{a_1} \cdots \pi^{a_n}\>,\label{eq:genrf} \end{eqnarray} where $Z$ is the field strength renormalization factor, with $Z=1$ at tree level, which is what we will assume in the rest of the work, and \begin{eqnarray} \tilde{\mathcal{J}}_\mu^a = - (\mathcal{J}_\mu^a - \partial_\mu \pi^a) . \end{eqnarray} As there are no cubic interactions in the Lagrangian, which is the case when the closure condition of Eq. (\ref{eq:clocon}) is satisfied, we have $\tilde{\mathcal{J}} = \mathcal{O} (\pi^3)$. Therefore, the only divergence possible when we take $q \to 0$, given by the ``pole diagrams'' shown in Fig. (\ref{fig:sinp}), cannot exist, so that the remainder function ${\cal R}$ is finite. This leads to the Adler zero condition given by Eq. (\ref{eq:azc}). \begin{figure}[t] \centering \includegraphics[width=0.4\textwidth]{currentins} \caption{A graphic representation of Eq. (\ref{eq:wia}), where the grey blobs denote collections of NLSM Feynman diagrams, while the black dot indicates the insertion of the current $\mathcal{J}$ carrying the momentum $q$, with the LHS given by the one-particle pole in $\mathcal{J}$, and the RHS given by $\tilde{\mathcal{J}}$. \label{fig:cur}} \end{figure} \begin{figure}[t] \centering \includegraphics[width=0.16\textwidth]{remainderpole} \caption{The only possible kind of diagrams that develops a pole for soft $q$ in ${\cal R}$. As $p_i$ is on-shell, this kind of diagrams gives the propagator $i/(2 p_i \cdot q)$. This apparently requires terms in $\tilde{\mathcal{J}}$ that are quadratic in $\pi$. \label{fig:sinp}} \end{figure} Notice that in the flavor decomposition, the flavor factors are linearly independent, thus each of the ordered amplitudes also need to satisfy the Adler zero condition, similar to the YM theory where the ordered amplitudes are also gauge invariant. Now we can go beyond the Adler zero and compute the $\mathcal{O} (\tau)$ piece in the soft limit, which gives us the subleading single soft theorem. This amounts to calculating the vertices in ${\cal R}$ given by the current $\mathcal{J}$. At $\mathcal{O} (p^2)$, this leads to the single-trace version of the subleading single soft theorem, which is already known. The current from ${\mathcal{L}}^{(2)}$ is: \begin{eqnarray} \mathcal{J}_\mu^{(2),a} = \left[ \frac{\sin \left(2 \sqrt{{\mathcal{T}}} \right) }{2 \sqrt{{\mathcal{T}}}} \right]_{ab} \partial_\mu \pi^b = \partial_\mu \pi^a - \tilde{\mathcal{J}}_\mu^{(2),a},\label{eq:cp2} \end{eqnarray} with \begin{eqnarray} \tilde{\mathcal{J}}_\mu^{(2),a} = \sum_{k=1}^{\infty} \frac{(-4)^k}{(2k+1)!} \left( {\mathcal{T}}^k \right)_{ab} \partial_\mu \pi^b. \end{eqnarray} As we see from Eq. (\ref{eq:genrf}), each term in $\tilde{\mathcal{J}}_\mu^{(2),a}$ inserts the following single-trace vertex into ${\cal R}_\mu$, after we strip the flavor factors: \begin{eqnarray} {\cal V}^{(2)}_{2k+1} (\mathbb{I}_{2k+1}) = \frac{-(-4)^k}{(2k+1)!f^{2k}}\sum_{j=0}^{2k} \left(\begin{array}{c} 2k\\ j \end{array} \right) (-1)^{j} q \cdot p_{j+1},\label{eq:op2vi} \end{eqnarray} where $\mathbb{I}_{n} \equiv \{1,2, \cdots, n\}$ is the identity permutation for $n$ labels. As shown in Fig. \ref{fig:curt}, the legs of the above vertex are connected to semi-on-shell amplitudes, i.e. the Berends-Giele currents \cite{Berends:1987me} \begin{eqnarray} J^{a_1 \cdots a_n, a} (p_1, \cdots ,p_n) \equiv \langle 0| \pi^a (0) | \pi^{a_1}(p_1) \cdots \pi^{a_n}(p_n)\rangle.\label{eq:bgcd} \end{eqnarray} These objects have one uncut off-shell leg of momentum $-\sum_i p_i$, which is connected to ${\cal V}$ in the single soft theorem, while all the other legs are on-shell. Just like the on-shell amplitudes, at $\mathcal{O} (p^2)$ the off-shell amplitudes can be ordered in a single trace basis, so that the subleading single soft theorem for $\text{NLSM}^{(2)}$ is \begin{eqnarray} M_{n+1}^{(2)} (\mathbb{I}_{n+1}) &=& \tau \sum_{k=1}^{\lfloor n/2 \rfloor} \frac{-(-4)^k}{(2k+1)!f^{2k}} \sum_{l}\sum_{j=1}^{2k-1} \left[ \left(\begin{array}{c} 2k\\ j \end{array} \right) (-1)^{j} -1 \right] p_{n+1} \cdot q_{l_{j+1}}\nonumber\\ &&\times \prod_{m=1}^{2k+1} J^{(2)} (l_{m-1}+1, \cdots , l_m) ,\label{eqnlsmosex} \end{eqnarray} where we have taken $p_{n+1}$ to be soft. In the above $l$ is a way to split $\{1, 2, \cdots,n\}$ into $2k+1$ disjoint, ordered subsets $\{l_{m-1}+1, \cdots , l_m \}$, with $l_0=0$, $l_{2k+1} = n$ and $q_{l_{j+1}} = \sum_{i=l_j+1}^{l_{j+1}} p_i$. \begin{figure}[t] \centering \includegraphics[width=0.5\textwidth]{curtree} \caption{The remainder function at tree level. The black dot now labels the vertex ${\cal V}$ created by the current $\mathcal{J}$, while the grey blobs are now semi-on-shell amplitudes $J$ where the only off-shell external leg is connected to ${\cal V}$. \label{fig:curt}} \end{figure} It was first discovered in Ref. \cite{Cachazo:2016njl} using the CHY formalism that an extended theory with the NGB's interacting with the bi-adjoint scalars emerges in the soft theorem. Originally, NGB's generated by the coset of ${\text{SU}} (N) \times {\text{SU}} (N)/ {\text{SU}} (N)$ were considered, so that $R$ is the adjoint representation of the unbroken ${\text{SU}} (N)$ group, and the coset space is isomorphic to the unbroken ${\text{SU}} (N)$. Then the generator $T^i_{ab}$ in the Lagrangian can be exchanged with the structure constant $-if^{iab}$ of ${\text{SU}}(N)$: the difference between the broken and unbroken indices becomes non-existent. The bi-adjoint scalars $\phi^{a {\tilde{a}}}$, as the additional field content in the extended theory, transform under both the original flavor group ${\text{SU}} (N)$ and another flavor group ${\text{SU}} (\tilde{N})$, and has the following cubic self-interaction: \begin{eqnarray} -\frac{\lambda}{6} \phi^{a {\tilde{a}}} \phi^{b {\tilde{b}}} \phi^{c {\tilde{c}}} f^{abc} f^{{\tilde{a}} {\tilde{b}} {\tilde{c}}},\label{eq:phi3v} \end{eqnarray} characterized by the coupling constant $\lambda$. For the $(n+1)$-point (pt) amplitude, taking $p_{n+1}$ to be soft, we have \begin{eqnarray} M_{n+1}^{(2)} (\mathbb{I}_{n+1}) = \frac{\tau}{\lambda f^2} \sum_{i=2}^{n-1} s_{n+1,i} \ M_n^{\text{NLSM} + \phi^3}(\mathbb{I}_{n}||1,n,i) + \mathcal{O} (\tau^2),\label{eq:sssstr} \end{eqnarray} where $s_{i,j} \equiv (p_i + p_j)^2$, and $\text{NLSM} + \phi^3$ denotes the extended theory\footnote{It should be understood that whenever it appears in the name of an mixed theory like $\text{NLSM} + \phi^3$, ``NLSM'' means $\text{NLSM}^{(2)}$.}. In the RHS of the above, ``$||$'' separates flavor structures of different flavor groups, which should not be confused with ``$|$'' in the multi-trace amplitudes in Eq. (\ref{eq:mttfo}) which separates traces of the generators of the same group. In $M_n^{\text{NLSM} + \phi^3}(\mathbb{I}_{n}||1,n,i)$, the external states $1$, $n$ and $i$ are apparently bi-adjoint as they have two separate orderings, the left for ${\text{SU}}(N)$ and the right for ${\text{SU}} (\tilde{N})$; other external legs, which only have left orderings, then belong to the NGB's. In the DDM basis, the flavor factor for $M_n^{\text{NLSM} + \phi^3}(\mathbb{I}_{n}||1,n,i)$ in Eq. (\ref{eq:sssstr}) is \begin{eqnarray} (-1)^{(n-1)/2} f^{a_1 a_2 b_1} \left( \prod_{j=1}^{n-4} f^{b_j a_{j+2} b_{j+1}} \right) f^{b_{n-3} a_{n-1} a_n } \tilde{f}^{{\tilde{a}}_1 {\tilde{a}}_n {\tilde{a}}_i}, \end{eqnarray} where $f^{abc}$ and $\tilde{f}^{{\tilde{a}} {\tilde{b}} {\tilde{c}}}$ are structure constants of ${\text{SU}} (N)$ and ${\text{SU}} (\tilde{N})$, respectively. Comparing with Eq. (\ref{eqnlsmosex}), one can identify all the new Feynman vertices in the extended theory that are relevant in Eq. (\ref{eq:sssstr}), in addition to ones already in $\text{NLSM}^{(2)}$ \cite{Low:2017mlh,Low:2018acv,Yin:2018hht}: \begin{itemize} \item \textbf{Type I} vertices with two $\phi$ and an even number of $\pi$, which has to take exactly the same value as the vertices in $\text{NLSM}^{(2)}$ with the same left ordering, i.e. \begin{eqnarray} V_{2k}^{\text{NLSM} + \phi^3} (\mathbb{I}_{2k} || i,j) = V_{2k}^{(2)} (\mathbb{I}_{2k} ). \end{eqnarray} \item \textbf{Type II} vertices with three $\phi$, two of whose left orderings are adjacent, and an even number of $\pi$. These vertices are generated by the current $\mathcal{J}$, and to match Eq. (\ref{eq:sssstr}) we need \begin{eqnarray} {\cal V}^{(2)}_{2k+1} (\mathbb{I}_{2k+1}) =\frac{1}{\lambda f^2} \sum_{i=2}^{2k} 2 q \cdot p_i \ V_{2k+1}^{\text{NLSM} + \phi^3} (\mathbb{I}_{2k+1} || 1,2k+1,j).\label{eq:type2r} \end{eqnarray} We know that ${\cal V}^{(2)} $ is linear in $q$, but for the above to hold the coefficients of $q \cdot p_1$ and $q\cdot p_{2k+1}$ need to vanish at the same time. Applying total momentum conservation to Eq. (\ref{eq:op2vi}), as well as the fact that whenever we use ${\cal V}^{(2)} $ we have the on-shell condition of $q^2 = 0$, we see that \begin{eqnarray} V_{2k+1}^{\text{NLSM} + \phi^3} (\mathbb{I}_{2k+1} || 1,2k+1,j) =\frac{\lambda}{2} \frac{(-4)^k }{(2k+1)!f^{2k-2}} \left[ 1- \left(\begin{array}{c} 2k\\ j-1 \end{array} \right) (-1)^{j} \right]\ .\label{eq:ev} \end{eqnarray} A special case is the 3-pt vertex \begin{eqnarray} V_{2k+1}^{\text{NLSM} + \phi^3} (1,2,3 || 1,3,2) = -\lambda,\label{eq:etp3} \end{eqnarray} which matches the $\phi^3$ interaction given by Eq. (\ref{eq:phi3v}). \end{itemize} As discussed in Section \ref{sec:rb}, the flavor ordering works equally well for $\text{NLSM}^{(2)}$ of a general coset $G/H$, implying that instead of restricting ourselves to ${\text{SU}} (N) \times {\text{SU}} (N)/ {\text{SU}} (N)$, we can have a more general interpretation of the extended theory. Meanwhile, the isomorphism between the coset ${\text{SU}} (N) \times {\text{SU}} (N)/ {\text{SU}} (N)$ and the group ${\text{SU}} (N)$ is lost in a general coset, thus we need to discern the broken and unbroken indices. The flavor factor for $M_n (\mathbb{I}_{n}||1,n,i)$ will need to be \begin{eqnarray} T_{a_1 a_2}^{j_1} \left( \prod_{k=1}^{(n-5)/2} T^{j_k}_{a_{2k+1 } b_k } T^{j_{k+1}}_{b_k a_{2k+2}} \right) T^{j_{(n-3)/2}}_{a_{n-2} b_{(n-3)/2}} T^{j_n}_{b_{(n-3)/2} a_{n-1}} {\tilde{T}}^{{\tilde{j}}_n}_{{\tilde{a}}_i {\tilde{a}}_1},\label{eq:gf} \end{eqnarray} where $T^{i}_{ab}$ and ${\tilde{T}}^{{\tilde{i}}}_{{\tilde{a}} {\tilde{b}}}$ are generators of $H$ and $\tilde{H}$ in some representation $R$ and $\tilde{R}$, respectively. The flavor factor in Eq. (\ref{eq:gf}) can be presented graphically as in Fig. \ref{fig:etgd}. Notice that external states $1,2, \cdots n-1$ carry indices $a_k$ that furnish some representation $R$, while particle $n$ has indices in the adjoint. In other words, we have two different kinds of bi-index scalars: $\psi^{a {\tilde{a}}}$ in $R$ and $\tilde{R}$, and the bi-adjoint scalars $\phi^{j {\tilde{j}}}$. We will denote such an extended theory as $\text{NLSM} + \phi + \psi$. An example useful in the following will be $H = {\text{SO}} (N)$ and $R$ is the fundamental representation, so that the amplitudes can also be expressed in the pair basis. \begin{figure}[t] \centering \includegraphics[width=0.8\textwidth]{etgd} \caption{The general flavor factor for $M_n^{\text{NLSM} + \phi + \psi}(\mathbb{I}_{n}||1,n,i)$ in the DDM basis. Notice that these are not Feynman diagrams, but only represent the flavor structures of the associated ordered amplitudes. The thin lines are for the group $H$ of the left ordering, while the thick lines are for the group $\tilde{H}$ of the right ordering.\label{fig:etgd}} \end{figure} \section{The single soft theorem for $\mathbf{N}$ of ${\text{SO}}(N)$} \label{sec:son} In this section we consider NGB's furnishing $\mathbf{N}$ of ${\text{SO}} (N)$, focusing on the leading $\mathcal{O} (p^2)$ in the EFT expansion. There are $N$ flavors in such a theory, and the minimal coset that realizes this is ${\text{SO}} (N+1)/ {\text{SO}} (N)$. The generators $T^i_{ab}$ satisfy the following completeness relation: \begin{eqnarray} (T^i)_{ab } (T^i)_{cd} = \frac{1}{2} (\delta^{ad} \delta^{bc} - \delta^{ac} \delta^{bd})\ ,\label{eq:comrel} \end{eqnarray} using which we can reduce the Lagrangian in Eq. (\ref{eq:lolg}) to \cite{Low:2019ynd} \begin{eqnarray} {\mathcal{L}}^{(2)} &=& \frac{1}{2} F_1^2 (r^2) \<\partial_\mu \pi| \partial^\mu \pi \> - \frac{1}{4f^2 r^2} \left[ F_1^2 (r^2) - 1 \right] \< \pi | \partial_\mu \pi \>^2,\label{eq:nlagso} \end{eqnarray} where we have adopted the bra-ket notation $(| \pi \>)_a \equiv \pi_a$, and $r \equiv \sqrt{ \< \pi | \pi \>/(2 f^2)}$. We see that in the vertices given by the above, $\pi^a$ are pair-wise contracted, which implies that the flavor factor for the amplitudes are products of Kronecker deltas: we have \begin{eqnarray} {\cal M}_n^{(2),a_1 \cdots a_n} &=& \sum_{\dot{\alpha} \in P_n} \left( \prod_{j=1}^{n/2} \delta^{a_{\dot{\alpha} (2j-1)} a_{\dot{\alpha} (2j)}} \right) \nonumber\\ &&\times M_n^{(2)} (\dot{\alpha} (1),\dot{\alpha} (2)|\dot{\alpha} (3), \dot{\alpha}(4)| \cdots | \dot{\alpha} (2n-1), \dot{\alpha} (2n)),\label{eq:fdpair} \end{eqnarray} where $P_n$ is all the distinct partitions of non-ordered set $\{1, 2, \cdots , n\}$ into $n/2$ subsets of two elements: $\{\dot{\alpha} (1),\dot{\alpha} (2)\}, \{\dot{\alpha} (3), \dot{\alpha}(4)\}, \cdots \{ \dot{\alpha} (2n-1), \dot{\alpha} (2n)\}$. The partial amplitude $M (\dot{\alpha}) $ in Eq. (\ref{eq:fdpair}) contains $n/2$ non-ordered pairs of external particle indices. The RHS of Eq. (\ref{eq:fdpair}) is a sum of $(n-1)!!$ terms, and as the flavor factors in front of each term are completely independent of each other, they form a basis which we call the pair basis. As $\delta^{ab} = \mathrm{tr} \left( \textsf{X}^a \textsf{X}^b \right)$, the pair basis can also be understood as a multi-trace basis. The amplitude in the basis is invariant under exchanging the positions of different traces, as well as exchanging two labels in each trace. When the multiplicity $n$ is large, we have $(n-1)!! \ll (n-3)!$, thus the pair basis is much smaller than the minimal BCJ basis of a general NLSM. A comparison of the size of the different bases is given in Table \ref{tab:compb}. Our ability to reduce to the $(n-1)!!$ basis depends on the special properties of the ${\text{SO}} (N)$ fundamental representation, i.e. the completeness relation in Eq. (\ref{eq:comrel}). \begin{table}[t] \begin{center} \begin{tabular}{c |c|c|c|c} \hline Multiplicity & Single trace & DDM & BCJ & Pair\\ \hline $n$ & $(n-1)!$ & $(n-2)!$ & $(n-3)!$ & $(n-1)!!$\\ \hline $4$ & $6$ & $2$ & $1$ & $3$\\ \hline $6$ & $120$ & $24$ & $6$ & $15$\\ \hline $8$ & $5040$ & $720$ & $120$ & $105$\\ \hline $10$ & $362880$ & $40320$ & $5040$ & $945$\\ \hline \end{tabular} \end{center} \caption{\label{tab:compb} The size of different amplitude bases for NLSM.} \end{table} In the following, we explore the amplitude relations for the pair basis in Section \ref{sec:pbddmr}, which will be useful when we derive the subleading single soft theorem for the pair basis in Section \ref{sec:ssp}. \subsection{Amplitude relations for the pair basis} \label{sec:pbddmr} It turns out that the relation between partial amplitudes in the pair basis and the single-trace amplitudes is quite straightforward. Let us first look at the DDM basis given by Eq. (\ref{eq:ddm}), the flavor factors of which are given by Fig. \ref{fig:ddm}. We would like to convert it to the pair basis, using the completeness relation given by Eq. (\ref{eq:comrel}), which can be represented graphically as in Fig. \ref{fig:comrel}. Applying the relation to Fig. \ref{fig:ddm}, we arrive at flavor factors as in Fig. \ref{fig:pairld}. \begin{figure}[t] \begin{eqnarray} \begin{minipage}[c]{0.25\textwidth} \begin{center} \includegraphics[width=\textwidth]{comrel} \end{center} \end{minipage} = \frac{1}{2} \left( \qquad \begin{minipage}[c]{0.25\textwidth} \begin{center} \includegraphics[width=\textwidth]{comrel11} \end{center} \end{minipage} - \qquad \begin{minipage}[c]{0.25\textwidth} \begin{center} \includegraphics[width=\textwidth]{comrel12} \end{center} \end{minipage} \right) \nonumber \end{eqnarray} \caption{\label{fig:comrel} The graphic representation of the completeness relation in Eq. (\ref{eq:comrel}). On the RHS, the solid lines do not intersect with each other, and each of them connects two fundamental indices of ${\text{SO}} (N)$ and represents a Kronecker delta for the two indices. For a contraction of adjoint index $i$ on the LHS, there are two ways to contract the fundamental indices on the RHS, represented by a ``$\times$'' or an ``$=$'' in the dotted circle. The two choices have a sign difference.} \end{figure} \begin{figure}[t] \centering \includegraphics[width=0.7\textwidth]{pairld} \caption{\label{fig:pairld} The half-ladder after applying the completeness relation. Each dotted circle contains either a ``$\times$'' or an ``$=$''.} \end{figure} Now let us consider the multi-trace partial amplitudes where indices $1$ and $n$ form a pair, e.g. $M_n^{(2)} (1,n|2,3|4,5| \cdots | n-2,n-1)$. By definition, it is the coefficient of the flavor factor \begin{eqnarray} \delta^{a_1 a_n} \prod_{j=1}^{n/2-1} \delta^{a_{2j} a_{2j+1}}\label{eq:phlc} \end{eqnarray} in the full amplitude. As shown in Fig. \ref{fig:pairld}, the indices $a_1$ and $a_n$ are always on the two ends of the half-ladder. As explained in Figs. \ref{fig:comrel} and \ref{fig:pairld}, each dotted circle can be either a ``$\times $'' or an ``$=$'', but for $a_1$ and $a_n$ to be contracted to get $\delta^{a_1 a_n}$, all of the dotted circles must contain an ``$=$''. Therefore, the upper two indices in each of the dotted circles must be contracted as well. Then the coefficient of the flavor factor in Eq. (\ref{eq:phlc}) is \begin{eqnarray} M_n^{(2)} (1,n|2,3|4,5| \cdots | n-2,n-1)=\frac{1}{2^{n/2-1}} \sum_{\alpha \in {\text{Ar}}_{n}} M_n^{(2)} (1, \alpha, n),\label{eq:pstr} \end{eqnarray} where ${\text{Ar}}_{n}$ are permutations of $\{2, 3, \cdots, n-1\}$ so that for all pairs $\{2, 3\}$, $\{4,5\}$, $\cdots$, $\{n-2, n-1\}$, the two indices in the pair are adjacent to each other. The RHS of the above is a sum of $(n-2)!!$ terms. Other partial amplitudes containing the pair $\{1,n\}$ can be generated in exactly the same way, while partial amplitudes containing the pair $\{1, j\}$ where $j \ne n$ can be generated by starting with a DDM basis where $a_1$ and $a_j$ are at the two ends of the half-ladder. Apparently the formula in Eq. (\ref{eq:pstr}) has the correct relabeling symmetry. From the cyclic and reflection symmetries of $M_n (1, \alpha, n)$, we see that the RHS of Eq. (\ref{eq:pstr}) also has the correct permutation symmetry. The same relation can be derived for ordered vertices in exactly the same way\footnote{The practice of summing over all distinct planar Feynman diagrams still works in the pair basis, as the Kronecker deltas certainly satisfy the correct factorization property \cite{Low:2019ynd}.}. An example of Eq. (\ref{eq:pstr}) at 6-pt is \begin{eqnarray} M_n^{(2)} (16|23|45) &=& \frac{1}{4} \left[ M_n^{(2)} (123456) + M_n^{(2)} (123546) +M_n^{(2)} (132456) + M_n^{(2)} (132546) \right. \nonumber\\ &&\left.+ M_n^{(2)} (145236) + M_n^{(2)} (145326) + M_n^{(2)} (154236) + M_n^{(2)} (154326) \right]. \end{eqnarray} In hindsight, the form of the RHS of Eq. (\ref{eq:pstr}) is very natural: it has the correct pole structure, it satisfies the Adler zero condition, and it also has the correct mass dimension and permutation symmetry. The only thing non-trivial is that the RHS of Eq. (\ref{eq:pstr}) must also factorize correctly. One should also recognize that Eq. (\ref{eq:pstr}) is not the unique way to write the multi-trace partial amplitudes in terms of single-trace ones: other representations can be easily generated by using the KK relations among the single-trace amplitudes. An immediate consequence of Eq. (\ref{eq:pstr}) is that we can easily write down the CHY formula for the partial amplitudes in the pair basis. In the CHY representation, the tree-level amplitude for a scalar theory is in general written in the following form: \begin{eqnarray} {\cal M}_n = \oint d\mu_n \; \mathcal{I}_L (\{p, \sigma \}) \; \mathcal{I}_R (\{p, \sigma\}),\label{eq:chyg} \end{eqnarray} where $\{p \}$ are the on-shell external momenta, while $\{ \sigma \}$ are dimensionless variables satisfying the scattering equation \begin{eqnarray} E_j \equiv \sum_{i \ne j} \frac{p_i \cdot p_j}{ \sigma_{ij} }=0,\label{eq:sceq} \end{eqnarray} with $\sigma_{ij} \equiv \sigma_i - \sigma_j$. This is enforced by the measure $d \mu_n$ of the integral: \begin{eqnarray} d \mu_n &\equiv& ( \sigma_{ij}\sigma_{jk}\sigma_{ki}) (\sigma_{pq}\sigma_{qr}\sigma_{rp}) \prod_{a \neq i,j,k} E_a^{-1} \prod_{b \neq p,q,r} d\sigma_b. \end{eqnarray} Choosing $\{ i ,j ,k\}$ and $\{ p, q, r\}$ is called ``fixing the gauge'', and the measure $d \mu_n$ is actually gauge invariant, i.e. independent of the choice of $\{ i ,j ,k\}$ and $\{ p, q, r\}$. The integrands $\mathcal{I}_L$ and $\mathcal{I}_R$ are different among different theories. For the general $\text{NLSM}^{(2)}$, the single-trace partial amplitudes are given by, up to coupling constants, \cite{Cachazo:2014xea} \begin{eqnarray} M_n^{(2)} (\alpha) = \oint d\mu_n ~(\mathrm{Pf}' \textsf{A}_n)^2 ~\mathcal{C}_n (\alpha), \end{eqnarray} where $\mathcal{C}_n (\alpha)$ is the Parke-Taylor factor given by \begin{eqnarray} \mathcal{C}_n (\alpha) = \frac{1}{\sigma_{\alpha (1) \alpha (2)} \cdots \sigma_{\alpha (n-1) \alpha (n)} \sigma_{\alpha (n) \alpha (1)}},\label{eq:chynst} \end{eqnarray} and the anti-symmetric matrix $\textsf{A}_n$ is given by \begin{eqnarray} [\textsf{A}_n]_{ab} =\left\{\begin{array}{ll} \dfrac{2 p_a \cdot p_b}{\sigma_{ab}}, & a \neq b, \\ 0, & a = b.\end{array} \right. \end{eqnarray} The reduced Pfaffian $\mathrm{Pf}'$ is defined as $\mathrm{Pf}' \textsf{A}_n = \frac{(-)^{a+b}}{\sigma_{ab}} \mathrm{Pf} \textsf{A}_n^{[a,b]}$, where $\textsf{A}_n^{[a,b]}$ is the matrix $\textsf{A}_n$ with rows and columns of labels $a$ and $b$ removed. It turns out such a definition does not depend on the choices of $\{a , b\}$. An important observation is that in Eq. (\ref{eq:chynst}), both the measure $d\mu_n$ and the reduced Pfaffian $\mathrm{Pf}' \textsf{A}_n$ are independent of the ordering $\alpha$: the ordering information is only contained in the Parke-Taylor factor $\mathcal{C}_n (\alpha)$. Then using Eq. (\ref{eq:pstr}) we can easily arrive at the CHY formula for the partial amplitude in the pair basis: \begin{eqnarray} M_n^{(2)} (1,n|2,3|4,5| \cdots | n-2,n-1) &=& \frac{1}{2^{n/2-1}} \sum_{\alpha \in {\text{Ar}}_{n}} \oint d\mu_n ~(\mathrm{Pf}' \textsf{A}_n)^2 ~\mathcal{C}_n (1, \alpha, n)\nonumber\\ &=& \oint d\mu_n ~(\mathrm{Pf}' \textsf{A}_n)^2 ~\frac{1}{2^{n/2-1}} \sum_{\alpha \in {\text{Ar}}_{n}}\mathcal{C}_n (1, \alpha, n).\label{eq:chypb} \end{eqnarray} In other words, we have \begin{eqnarray} \mathcal{I}_L = (\mathrm{Pf}' \textsf{A}_n)^2, \end{eqnarray} which remains the same as the single-trace amplitudes, while \begin{eqnarray} \mathcal{I}_R = \frac{1}{2^{n/2-1}} \sum_{\alpha \in {\text{Ar}}_{n}}\mathcal{C}_n (1, \alpha, n).\label{eq:pbir} \end{eqnarray} Another relation between the partial amplitudes in the pair basis can be easily proved using Eq. (\ref{eq:pstr}). Firstly, we know the ${\text{U}} (1)$-decoupling relation between the single-trace partial amplitudes, which is the simplest kind of the KK relations: \begin{eqnarray} M_n^{(2)} (1,2,3,\cdots,n-1, n) + M_n^{(2)} (1,3,4,\cdots, n,2) + \cdots + M_n^{(2)} (1,n,2,\cdots,n-2,n-1) \nonumber\\ = 0. \qquad \label{eq:u1dc} \end{eqnarray} Then \begin{eqnarray} \sum_{\dot{\alpha} \in P_n} M_n^{(2)} (\dot{\alpha} (1),\dot{\alpha} (2)|\dot{\alpha} (3), \dot{\alpha}(4)| \cdots | \dot{\alpha} (2n-1), \dot{\alpha} (2n)) = 0,\label{eq:pasf} \end{eqnarray} as the LHS of the above can be expressed as $(n-2)!$ sums like the LHS of Eq. (\ref{eq:u1dc}). The relation given by Eq. (\ref{eq:pasf}) can also be easily understood from a physical perspective: we see from the definition of the pair basis in Eq. (\ref{eq:fdpair}), that \begin{eqnarray} {\cal M}_n^{ (2),a a \cdots a} &=& \sum_{\dot{\alpha} \in P_n} M_n^{ (2)} (\dot{\alpha} (1),\dot{\alpha} (2)|\dot{\alpha} (3), \dot{\alpha}(4)| \cdots | \dot{\alpha} (2n-1), \dot{\alpha} (2n)). \end{eqnarray} Namely, the LHS of Eq. (\ref{eq:pasf}) is actually the two-derivative full amplitude when all external particles are of a single flavor. The shift symmetry in NLSM forbids any 2-derivative interactions for a single kind of scalar, and the corresponding leading order amplitude must vanish \cite{Low:2014nga}. Therefore, Eq. (\ref{eq:pasf}) just states the fact that at the two-derivative level, the NLSM amplitude between scalars of a single flavor vanishes. \subsection{The single soft theorem in the pair basis} \label{sec:ssp} Now we are ready to discuss the subleading single soft theorem for the pair-basis amplitudes. In Section \ref{sec:st}, the subleading single soft theorem at $\mathcal{O} (p^2)$ for a general symmetric coset is presented in the single-trace basis. Then we can calculate the subleading single soft theorem in the pair basis, by using the relation between the pair basis and single-trace basis amplitudes. Applying Eq. (\ref{eq:pstr}) to Eq. (\ref{eq:sssstr}), we have \begin{eqnarray} &&M_{n+1}^{(2)} (n+1,1|2,3|4,5|\cdots | n-1,n)\nonumber\\ &=& \frac{\tau}{\lambda f^2} \frac{1}{2^{(n-1)/2 }} \sum_{k=2}^{n} s_{n+1,k} \ \sum_{\substack{j=2\\ j\ne k}}^n \sum_{\alpha \in {\text{Ar}}_{n-3} } M_n^{\text{NLSM} + \phi + \psi}(1,\alpha, j_p, j||1,j,k) + \mathcal{O} (\tau^2),\label{eq:pbsti} \end{eqnarray} where $j_p \equiv j+ (-1)^j$, ${\text{Ar}}_{n-3}$ are permutations of $\{2,3, \cdots, n\} \setminus \{ j, j_p \}$ so that for all the pairs $\{ m, m_p \}$ in the set, the two indices in the pair are adjacent to each other. Note that although $j \ne k$, the situation when $j_p = k$, i.e. $j$ and $k$ form a pair in the symmetrization of the LHS in the above, can still happen. Next, we need to express the amplitudes of the extended theory in the pair basis as well. Using the procedure similar to Section \ref{sec:pbddmr}, we can derive a relation between the single-trace and the pair basis in the extended theory, the details and examples of which are shown in Appendix \ref{app:rpse}. We have \begin{eqnarray} &&M_{n}^{\text{NLSM} + \phi + \psi} (1,2,3|4,5| \cdots|n-1,n || 1^\psi, 2^\phi, i^\psi) \nonumber\\ &=& -\frac{1}{2^{(n-3)/2}} \sum_{\alpha \in {\text{Ar}}_{n-3} } M_n^{\text{NLSM} + \phi + \psi}(1,\alpha,3, 2 ||1^\psi, 2^\phi, i^\psi),\label{eq:ptret} \end{eqnarray} where we have identified the different bi-index scalars $\phi$ and $\psi$ in the right ordering. Plugging the above into Eq. (\ref{eq:pbsti}), we arrive at \cite{Low:2019wuv} \begin{eqnarray} &&M_{n+1}^{(2)} (n+1,1|2,3|4,5|\cdots | n-1,n)\nonumber\\ &=& -\frac{\tau}{2\lambda f^2} \sum_{k=2}^n s_{k,n+1} \sum_{\substack{j=2\\j \ne k}}^{n} M_n^{\text{NLSM} + \phi + \psi} (1,j,j_p|\dot{\alpha}/j|| 1^\psi,j^\phi, k^\psi) + \mathcal{O} (\tau^2),\label{eq:slsspb} \end{eqnarray} where $\dot{\alpha} /j$ is the partition $\{2,3 |4,5| \cdots | n-1,n\}$ with the pair $\{j, j_p\}$ removed. Examples of Eq. (\ref{eq:slsspb}) are given in Appendix \ref{app:nlv}. Similarly, we can also work out the vertices in the pair basis of $\text{NLSM} + \phi + \psi$: the Type I vertices are given by \begin{eqnarray} &&V_n^{\text{NLSM} + \phi + \psi} (1,n|2,3|4,5| \cdots | n-2,n-1||i, j)\nonumber\\ &=&\frac{1}{2^{n/2-1}} \sum_{\alpha \in {\text{Ar}}_{n}} V_n^{\text{NLSM} + \phi + \psi} (1, \alpha, n||i,j) = V_n^{(2)} (1,n|2,3|4,5| \cdots | n-2,n-1),\label{eq:soeept} \end{eqnarray} while the Type II vertices are \begin{eqnarray} &&V_{n}^{\text{NLSM} + \phi + \psi} (1,2,3|4,5| \cdots|n-1,n || 1^\psi, 2^\phi, j^\psi) \nonumber\\ &=& -\frac{1}{2^{(n-3)/2}} \sum_{\alpha \in {\text{Ar}}_{n-3} } V_n^{\text{NLSM} + \phi + \psi}(1,\alpha,3, 2||1, 2, j). \end{eqnarray} Plugging in the vertices in the single-trace basis given by Eq. (\ref{eq:ev}), we arrive at \begin{eqnarray} V_{n}^{\text{NLSM} + \phi + \psi} (1,2,3|4,5| \cdots|n-1,n || 1^\psi, 2^\phi, 4^\psi) = 0,\label{eq:vv} \end{eqnarray} while \begin{eqnarray} V_{2n+1}^{\text{NLSM} + \phi + \psi} (1,2,3|4,5| \cdots|2n,2n+1 || 1^\psi, 2^\phi, 3^\psi) = \frac{\lambda}{2} \frac{-(-4)^{n} (n-1)! }{ (2n)! f^{2n-2} },\label{eq:soevop} \end{eqnarray} with the 3-pt vertex given by \begin{eqnarray} V_{2n+1}^{\text{NLSM} + \phi + \psi} (1,2,3||1^\psi, 2^\phi, 3^\psi) = \lambda. \end{eqnarray} Note that although $V_{n}^{\text{NLSM} + \phi + \psi} (1,2,3|4,5| \cdots || 1^\psi, 2^\phi, 4^\psi) = 0$, the amplitude with the same ordering does not vanish: $M_{n}^{\text{NLSM} + \phi + \psi} (1,2,3|4,5| \cdots || 1^\psi, 2^\phi, 4^\psi) \ne 0$. This can be easily checked for the 5-pt amplitude $M_{5}^{\text{NLSM} + \phi + \psi} (1,2,3|4,5|| 1^\psi, 2^\phi, 4^\psi)$, and it receives non-vanishing contributions from non-contact diagrams, as shown in Fig. (\ref{fig:soe5pt}). We give examples of $M_{n}^{\text{NLSM} + \phi + \psi}$ in the pair basis in Appendix \ref{app:eet}. \begin{figure}[t] \centering \includegraphics[width=0.8\textwidth]{soe5pt} \caption{\label{fig:soe5pt} Two types of Feynman diagrams that can contribute to $M_{5}^{\text{NLSM} + \phi + \psi} (1,2,3|4,5|| 1^\psi, 2^\phi, 4^\psi)$. The solid lines represent fundamental indices, while the dashed lines represent adjoint indices. The thin lines are for the ${\text{SO}} (N)$ flavor group of the NGB's, while the thick lines are for the other flavor group $\tilde{H}$ carried by $\phi$ and $\psi$. Although the contact term on the left vanishes, the diagram on the right still contribute, so that the amplitude is non-zero. The 4-pt vertex in the diagram on the right is given by Eq. (\ref{eq:soeept}).} \end{figure} We can work out the operators in the Lagrangian that give the vertices in Eq. (\ref{eq:soevop}): \begin{eqnarray} \lambda T^i_{ab} T^{{\tilde{i}}}_{{\tilde{a}} {\tilde{b}}} \phi^{i {\tilde{i}}} \psi^{a {\tilde{a}}} \psi^{b {\tilde{b}}} \sum_{n=1}^\infty \frac{(-4)^{n-1} }{(2n)! } r^{2(n-1)} = \frac{ \lambda}{2} T^i_{ab} T^{{\tilde{i}}}_{{\tilde{a}} {\tilde{b}}} \phi^{i {\tilde{i}}} \psi^{a {\tilde{a}}} \psi^{b {\tilde{b}}} F_1^2 (r^2) , \end{eqnarray} where the cubic operator in the above is $(\lambda/2) T^i_{ab} T^{{\tilde{i}}}_{{\tilde{a}} {\tilde{b}}} \phi^{i {\tilde{i}}} \psi^{a {\tilde{a}}} \psi^{b {\tilde{b}}}$. The results of Eqs. (\ref{eq:slsspb}) and (\ref{eq:soevop}) can also be confirmed by a direct calculation from the Ward identity. As we are still at $\mathcal{O} (p^2)$, the current is still given by Eq. (\ref{eq:cp2}), though it can be simplified using the completeness relations of the ${\text{SO}} (N)$ fundamental generators given by Eq. (\ref{eq:comrel}): \begin{eqnarray} \mathcal{J}^a_\mu &=&\partial_\mu \pi^a + \sum_{k=1}^\infty \frac{(-4)^k}{(2k+1)! } \left( r^{2k} \partial_\mu \pi^a - r^{2k-2} \frac{\<\pi | \partial_\mu \pi \>}{2f^2} \pi^a \right). \end{eqnarray} Such a current inserts the following flavor-ordered vertices to the soft theorem, i.e. the RHS of Eq. (\ref{eq:wia}): \begin{eqnarray} &&{\cal V}_{2n+1} (1|2,3|4,5| \cdots | 2n, 2n+1) = - \left(\frac{-4}{f^2}\right)^n\frac{ (n-1)!}{2 (2n)!} q\cdot p_{1}\nonumber\\ &=& -\frac{1}{2\lambda f^2} \sum_{k=2}^{2n+1} (2q \cdot p_k) V_{2n+1}^{\text{NLSM} + \phi + \psi} (1,k,k_p|4,5| \cdots|2n,2n+1 || 1^\psi, k^\phi, k_p^\psi)\nonumber\\ &=& -\frac{1}{2\lambda f^2} \sum_{k=2}^{2n+1} (2q \cdot p_k) \sum_{\substack{j=2\\j \ne k}}^{2n + 1} V_{2n+1}^{\text{NLSM} + \phi + \psi} (1,j,j_p|\dot{\alpha}/j|| 1^\psi,j^\phi, k^\psi) . \end{eqnarray} The second equality in the above utilizes total momentum conservation as well as the on-shell condition of $q$, while the last equality is a consequence of the vanishing contributions of vertices given by Eq. (\ref{eq:vv}). This directly leads to the soft theorem given by Eq. (\ref{eq:slsspb}). \section{The single soft theorem at $\mathcal{O} (p^4)$}\label{sec4} Now let us work out the subleading single soft theorem of NLSM at $\mathcal{O} (p^4)$ for a general group representation. We will use the universal trace basis and focus on the 4 P-even operators given by Eq. (\ref{eq:o14}), which will always exist for a general spacetime dimension $d$. Unlike the case for the $\mathcal{O} (p^2)$ amplitudes as in Eq. (\ref{eqnlsmosex}), the single soft limit of $M^{(4)}$ receives two contributions: terms with the $\mathcal{O} (p^4)$ corrections to the current $\mathcal{J}$ of the shift symmetry, as well as terms with the $\mathcal{O} (p^4)$ corrections to one of the semi-on-shell amplitudes $J$. Taking the momentum $p_{n+1}$ to be soft, for the single trace amplitude we should have \begin{eqnarray} M_{n+1}^{(4)} (\mathbb{I}_{n+1}) &=& \tau \sum_{k=1}^{\lfloor n/2 \rfloor} \sum_l {\cal V}^{(4)} (q_{l_{1}}, \cdots, q_{l_{2k+1}}) \prod_{m=1}^{2k+1} J^{(2)} (l_{m-1}+1, \cdots , l_m)\nonumber\\ &&+\tau \sum_{k=1}^{\lfloor n/2 \rfloor} \sum_l {\cal V}^{(2)} (q_{l_{1}}, \cdots, q_{l_{2k+1}}) \sum_{i=1}^{2k+1} J^{(4)} (l_{i-1}+1, \cdots , l_i) \nonumber\\ &&\times\prod_{\substack{m=1\\ m\ne i}}^{2k+1} J^{(2)} (l_{m-1}+1, \cdots , l_m) + \mathcal{O} (\tau^2)\ ,\label{eq:ssp4st} \end{eqnarray} where ${\cal V}^{(2)}$ is given by Eq. (\ref{eq:op2vi}), the choice of partitions $l$ is the same as in the single soft theorem for $\text{NLSM}^{(2)}$ given by Eq. (\ref{eqnlsmosex}), and ${\cal V}^{(4)} (\cdots)$ comes from the single trace part in $\mathcal{J}^{(4)}$. Similarly, for the double trace amplitude we should have \begin{eqnarray} &&M_{n+1}^{(4)} ( \mathbb{I}_{m}| m+1, m+2, \cdots, n+1) \nonumber\\ &=& \tau \sum_{k,\gamma} \sum_{j'=1}^k {\cal V}^{(2)} (q_{\gamma_{1}},q_{\gamma_{2}},\cdots, q_{\gamma_{j'}} + q_{\mathbb{I}_{m}}, \cdots, q_{\gamma_{k}}) J^{(4)} ( \gamma_{j'} | \mathbb{I}_{m} ) \prod_{\substack{j=1\\ j\ne j'}}^{k} J^{(2)} ( \gamma_j )\nonumber\\ && + \tau \sum_{k,i,\gamma,\gamma'} {\cal V}^{(4)} (q_{\gamma_1}, \cdots,q_{\gamma_{k}} |q_{\gamma'_{1}}, \cdots, q_{\gamma'_{i}}) \left[\prod_{j=1}^{k} J^{(2)} ( \gamma_j ) \right] \left[ \prod_{j'=1}^{i} J^{(2)} ( \gamma'_{j' }) \right] + \mathcal{O} (\tau^2)\ ,\label{eq:ssp4dt} \end{eqnarray} where $\{ \gamma_{1}, \cdots, \gamma_k \}$ are partitions of $\{ m+1, m+2, \cdots, n\}$, $\{ \gamma'_1, \gamma'_2, \cdots , \gamma'_i \}$ are partitions of any of the cyclic permutations of $\mathbb{I}_{m}$, and $q_{\alpha} \equiv \sum_{r \in \alpha} p_r$ for any sequence $\alpha$ . It should be understood in Eq. (\ref{eq:ssp4dt}) that $n$ is odd, $m$ is even, ${\cal V}^{(2)}$ is non-vanishing only if $k$ is even (so that it has an odd number of arguments), ${\cal V}^{(4)}$ is non-vanishing only if $i$ is even and $k$ is odd, $J^{(2)}$ is non-vanishing only if it has an odd number of arguments, and $J^{(4)} (\alpha | \beta)$ is non-vanishing only if one of the sets in $\{ \alpha, \beta \}$ has an even number of elements while the other has an odd number, with the off-shell leg in $J^{(4)} (\alpha | \beta)$ being in the same trace as the odd set. Our goal then is to work out ${\cal V}^{(4)}$. For the single trace operators $O_3$ and $O_4$, it will be convenient to rewrite them as \begin{eqnarray} C_3 O_3 + C_4 O_4 &=&2(C_3 + C_4) \mathrm{tr} ( d_\mu d_\nu d^\mu d^\nu ) - 2(C_3 - C_4) \mathrm{tr} ( d_\mu d^\mu d_\nu d^\nu )\nonumber\\ &\equiv & C_{3'} O_{3'} + C_{4'} O_{4'}, \end{eqnarray} with \begin{eqnarray} O_{3'} = \mathrm{tr} ( d_\mu d_\nu d^\mu d^\nu ),\ O_{4'} = \mathrm{tr} ( d_\mu d^\mu d_\nu d^\nu ),\ C_{3'} = 2(C_3 + C_4),\ C_{4'} = - 2(C_3 - C_4). \end{eqnarray} The contribution of $O_{3'}$ to the current is \begin{eqnarray} \left(\mathcal{J}^{(4),3'}\right)_\mu^a &=&\frac{4f}{\Lambda^2} \left[\cos \sqrt{{\mathcal{T}}} \right]_{ab} \mathrm{tr} \left( \textsf{X}^b d_\nu d_\mu d^\nu \right),\label{eq:o3po} \end{eqnarray} with \begin{eqnarray} \cos \sqrt{{\mathcal{T}}} = \sum_{n=0}^\infty \frac{(-1)^n}{(2n)! } {\mathcal{T}}^n. \end{eqnarray} Using the Lie algebra in Eq. (\ref{eq:crg}), one can show that \begin{eqnarray} d_\mu = - \frac{i}{2} \xi^\dagger \partial_\mu U \xi^\dagger = \frac{i}{2} \xi \partial_\mu U^\dagger \xi,\qquad \xi \left( \left[\cos \sqrt{{\mathcal{T}}} \right]_{ab} \textsf{X}^b \right) \xi = \frac{1}{2} \left\{ \textsf{X}^a, U \right\}, \end{eqnarray} where \begin{eqnarray} \xi = e^{i \Pi}, \qquad \Pi = \frac{\pi^a \textsf{X}^a}{f}, \qquad U = \xi^2. \end{eqnarray} Then \begin{eqnarray} \left(\mathcal{J}^{(4),3'}\right)_\mu^a &=& \frac{if}{4\Lambda^2} \mathrm{tr} \left( \left\{ \textsf{X}^a, U \right\} \partial_\nu U^\dagger \partial_\mu U \partial^\nu U^\dagger \right) \nonumber\\ &=& \sum_{n=1}^\infty \sum_{l_1 = 0}^{2n +1} \sum_{l_2 = 0}^{2n +1 -l_1} \sum_{l_3 =0 }^{2n +1 -l_1- l_2} \frac{f}{\Lambda^2} \frac{(-4)^{n } (-1)^{l_1 + l_3}}{l_1! l_2! l_3!(2n+1-l_1 - l_2 - l_3)!}\nonumber\\ &&\times \mathrm{tr} \left( \textsf{X}^a \Pi^{l_1} \partial_\nu \Pi^{l_2} \partial_\mu \Pi^{l_3} \partial^\nu \Pi^{2n+1-l_1 - l_2 -l_3} \right)\nonumber\\ &=& \frac{4 f}{ \Lambda^2} \mathrm{tr} \left( \textsf{X}^a \partial_\nu \Pi \partial_\mu \Pi \partial^\nu \Pi \right) + \frac{4f}{3 \Lambda^2} \mathrm{tr} \left[ \textsf{X}^a \left( -6 \Pi^2 \partial_\nu \Pi \partial_\mu \Pi \partial^\nu \Pi\right. \right.\nonumber\\ && + 6\Pi \partial_\nu \Pi^2 \partial_\mu \Pi \partial^\nu \Pi -6 \Pi \partial_\nu \Pi \partial_\mu \Pi^2 \partial^\nu \Pi +6 \Pi \partial_\nu \Pi \partial_\mu \Pi \partial^\nu \Pi^2 \nonumber\\ && - 2\partial_\nu \Pi^3 \partial_\mu \Pi \partial^\nu \Pi - 2\partial_\nu \Pi \partial_\mu \Pi^3 \partial^\nu \Pi -2\partial_\nu \Pi \partial_\mu \Pi \partial^\nu \Pi^3 \nonumber\\ &&\left. \left. +3\partial_\nu \Pi^2 \partial_\mu \Pi^2 \partial^\nu \Pi + 3\partial_\nu \Pi \partial_\mu \Pi^2 \partial^\nu \Pi^2 -3\partial_\nu \Pi^2 \partial_\mu \Pi \partial^\nu \Pi^2 \right) \right]\nonumber\\ && + \cdots.\label{eq:c3pc} \end{eqnarray} Similarly, the contribution of $O_{4'}$ to the current is \begin{eqnarray} \left( \mathcal{J}^{(4),4'} \right)_\mu^a &=& \sum_{n=1}^\infty \sum_{l_1 = 0}^{2n +1} \sum_{l_2 = 0}^{2n +1 -l_1} \sum_{l_3 =0 }^{2n +1 -l_1- l_2} \frac{f }{2 \Lambda^2} \frac{(-4)^{n } (-1)^{l_1 + l_3}}{l_1! l_2! l_3!(2n+1-l_1 - l_2 - l_3)!}\nonumber\\ &&\times \mathrm{tr} \left[ \textsf{X}^a \Pi^{l_1} \left(\partial_\mu \Pi^{l_2} \partial_\nu \Pi^{l_3} \partial^\nu \Pi^{2n+1-l_1 - l_2 -l_3} +\partial_\nu \Pi^{l_2} \partial^\nu \Pi^{l_3} \partial_\mu \Pi^{2n+1-l_1 - l_2 -l_3} \right) \right].\ \ \end{eqnarray} The corresponding vertices inserted into ${\cal R}_\mu$, after stripping the single-trace flavor factors, are \begin{eqnarray} {\cal V}^{(4),3'}_{2n+1} (\mathbb{I}_{2n+1}) &=& \sum_{l_1 = 0}^{2n -2} \sum_{l_2 = 1}^{2n -1 -l_1} \sum_{l_3 =1 }^{2n -l_1- l_2} \frac{1}{f^{2n} \Lambda^2} \frac{(-4)^{n } (-1)^{l_1 + l_3}}{l_1! l_2! l_3!(2n+1-l_1 - l_2 - l_3)!}\nonumber\\ &&\times q\cdot p_{l_1+ l_2 +1;l_1 + l_2 + l_3} \ p_{l_1+1;l_1+l_2} \cdot p_{l_1 + l_2 +l_3 + 1; 2n+1},\label{eq:c3pjv}\\ {\cal V}^{(4),4'}_{2n+1} (\mathbb{I}_{2n+1}) &=& \sum_{l_1 = 0}^{2n -2} \sum_{l_2 = 1}^{2n -1 -l_1} \sum_{l_3 =1 }^{2n -l_1- l_2} \frac{1}{2 f^{2n} \Lambda^2} \frac{(-4)^{n } (-1)^{l_1 + l_3}}{l_1! l_2! l_3!(2n+1-l_1 - l_2 - l_3)!}\nonumber\\ &&\times \left( q\cdot p_{l_1+1;l_1+l_2} \ p_{l_1+ l_2 +1;l_1 + l_2 + l_3} \cdot p_{l_1 + l_2 +l_3 + 1; 2n+1} \right.\nonumber\\ &&+ \left. q\cdot p_{l_1 + l_2 +l_3 + 1; 2n+1} \ p_{l_1+1;l_1+l_2} \cdot p_{l_1+ l_2 +1;l_1 + l_2 + l_3} \right), \end{eqnarray} where \begin{eqnarray} p_{i;j} \equiv \sum_{k=i}^{j} p_k \end{eqnarray} and $q = - \sum_{i=1}^{2n+1} p_i$. On the other hand, the contributions of $O_1$ and $O_2$ to the current are \begin{eqnarray} \left(\mathcal{J}^{(4),1} \right)^a_\mu &=& \sum_{n=0}^{\infty} \sum_{m=1}^\infty \sum_{l_1 = 0}^{2n+1} \sum_{l_2 = 0}^{2m} \frac{1}{f^{2(m+n)} \Lambda^2} \frac{(-4)^{(m+n)} (-1)^{l_1 + l_2}}{l_1! l_2! (2n+1-l_1)!(2m-l_2)!}\nonumber\\ &&\times \mathrm{tr} \left( X^a \Pi^{l_1} \partial_\mu \Pi^{2n+1-l_1}\right) \mathrm{tr} \left( \partial_\nu \Pi^{l_2} \partial^\nu \Pi^{2m- l_2} \right),\\ \left(\mathcal{J}^{(4),2} \right)^a_\mu &=& \sum_{n=0}^{\infty} \sum_{m=1}^\infty \sum_{l_1 = 0}^{2n+1} \sum_{l_2 = 0}^{2m} \frac{1}{f^{2(m+n)} \Lambda^2} \frac{(-4)^{(m+n)} (-1)^{l_1 + l_2}}{l_1! l_2! (2n+1-l_1)!(2m-l_2)!}\nonumber\\ &&\times \mathrm{tr} \left( X^a \Pi^{l_1} \partial_\nu \Pi^{2n+1-l_1}\right) \mathrm{tr} \left( \partial_\mu \Pi^{l_2} \partial^\nu \Pi^{2m- l_2} \right), \end{eqnarray} and the corresponding double-trace vertices are \begin{eqnarray} &&{\cal V}^{(4),1}_{2m+2n+1} (1, \cdots, 2m|2m+1, \cdots, 2m+2n+1 ) \nonumber\\ &=& \sum_{l_1 = 0}^{2n} \sum_{l_2 = 1}^{2m-1} \sum_{i=1}^{2m} \frac{1}{f^{2(m+n)} \Lambda^2} \frac{(-4)^{(m+n)} (-1)^{l_1 + l_2}}{l_1! l_2! (2n+1-l_1)!(2m-l_2)!}\nonumber\\ &&\times q\cdot p_{2m+l_1+1;2m+ 2n+1}\ p_{m|1;l_2|i} \cdot p_{m|l_2+1;2m|i},\\ &&{\cal V}^{(4),2}_{2m+2n+1} (1, \cdots, 2m|2m+1, \cdots, 2m+2n+1 ) \nonumber\\ &=& \sum_{l_1 = 0}^{2n} \sum_{l_2 = 1}^{2m-1} \sum_{i=1}^{2m} \frac{1}{f^{2(m+n)} \Lambda^2} \frac{(-4)^{(m+n)} (-1)^{l_1 + l_2}}{l_1! l_2! (2n+1-l_1)!(2m-l_2)!}\nonumber\\ &&\times q\cdot p_{m|1;l_2|i} \ p_{m|l_2+1;2m|i} \cdot p_{2m+l_1+1;2m+ 2n+1}, \end{eqnarray} where \begin{eqnarray} p_{m|i;j|k} = \sum_{l = \mod (i+k,2m)+1}^{\mod (j+k,2m)+1} p_l. \end{eqnarray} Then we have \begin{eqnarray} {\cal V}^{(4)} (\alpha) =C_{3'} {\cal V}^{(4),3'} (\alpha) +C_{4'} {\cal V}^{(4),4'} (\alpha) ,\quad {\cal V}^{(4)} (\alpha | \beta) = C_1 {\cal V}^{(4),1} (\alpha | \beta)+ C_2 {\cal V}^{(4),2} (\alpha | \beta). \end{eqnarray} We give low-pt examples of these vertices in Appendix \ref{app:p4cv}. The next question to ask is: can we interpret the RHS of Eqs. (\ref{eq:ssp4st}) and (\ref{eq:ssp4dt}) as given by the amplitudes of some extended theory? We will first focus on a special case where we have a definite answer, and then proceed to the more general case. To avoid complicated flavor labels, we will assume that the NGB's furnish the adjoint representation, so that the extended theory of $\text{NLSM}^{(2)}$ is just $\text{NLSM} + \phi^3$, though the results can be straightforwardly reinterpreted for a general group representation. \subsection{The $d_2$ case} As demonstrated in Ref. \cite{Cachazo:2016njl}, the extended theory can be identified in a concrete manner when the amplitudes of the original theory have a CHY representation and admit a double copy structure. In Ref. \cite{Low:2020ubn} a special case of the NLSM up to $\mathcal{O} (p^4)$, dubbed $\text{NLSM}^{d_2}$, was observed to demonstrate these properties. In such a theory the Wilson coefficients are fixed to be \begin{eqnarray} C_1 = \frac{1}4, \qquad C_2 =- \frac{1}2,\qquad C_3 = C_4 = 0.\label{eq:defd2} \end{eqnarray} The corresponding $\mathcal{O} (p^4)$ amplitude $M^{(4),d_2}$ always has a double trace ordering, and is a component of an EFT named the extended Dirac-Born-Infeld (DBI) theory \cite{Cachazo:2014xea}, also called $\text{DBI} + \text{NLSM}$ \cite{Chiodaroli:2017ngp}, which is a double copy of $\text{NLSM}^{(2)}$ and a gauged version of the bi-adjoint scalar theory called $\text{YM} + \phi^3$ \cite{Chiodaroli:2014xia}, or generalized YM scalar \cite{Cachazo:2014xea}. We can write \begin{eqnarray} \text{NLSM}^{d_2} \subset \text{DBI} + \text{NLSM} = \text{NLSM}^{(2)} \stackrel{\rm KLT}{\otimes} \left({\textrm{YM}+\phi^3}\right), \end{eqnarray} where $\stackrel{\rm KLT}{\otimes}$ indicates a Kawai-Lewellen-Tye (KLT) relation \cite{Kawai:1985xq} between the ordered amplitudes of two theories, which we will use extensively below to show that in the single soft limit of $\text{NLSM}^{d_2}$ there is indeed an extended theory. \subsubsection{From the double copy} The amplitudes for $\text{NLSM}^{d_2}$ can be expressed using the KLT formula as \begin{eqnarray} &&M^{(4),d_2}_n (n,\mathbb{I}_{l}|\alpha) \nonumber\\ &=& \sum_{a,b=2}^{n-2} \sum_{\beta_L, \beta_R \in S_{n-4}} M^{(2)}_n (1,\beta_L,n-1,a,n) K_n(1,\beta_L,n-1,a,n || 1,\beta_R,n-1,n,b)\nonumber\\ && \times M^{ \text{YM} + \phi^3}_n (n,\mathbb{I}_l|\alpha ||1,\beta_R,n-1,n,b),\label{eq:kltd2} \end{eqnarray} where $l$ is odd and $1\le l \le n-3$, $M^{ \text{YM} + \phi^3}$ is the amplitude for $\text{YM} + \phi^3$ where all external states are scalars, and $K_n$ is the KLT kernel for the $n$-pt amplitude satisfying \cite{Cachazo:2013iea} \begin{eqnarray} K_n = \left[M_n^{\phi^3} \right]^{-1},\label{eq:kltp3} \end{eqnarray} with $M_n^{\phi^3}$ being the doubly ordered amplitudes for the bi-adjoint scalar theory. In Eq. (\ref{eq:kltp3}) $K_n$ and $M_n^{\phi^3}$ are understood as $(n-3)! \times (n-3)!$ square matrices, whose rows and columns correspond to $(n-3)!$ ways of the left and right ordering, respectively. For example, in Eq. (\ref{eq:kltd2}) the positions of $1$, $n-1$ and $n$ are fixed in both the left and the right orderings of $K_n$, so that the remaining $(n-3)!$ left and right orderings define the square KLT matrix. Now let us take the single soft limit of state $n$ in Eq. (\ref{eq:kltd2}). The $\text{NLSM}^{(2)}$ amplitude $M^{(2)}$ on the RHS of Eq. (\ref{eq:kltd2}) is expanded using Eq. (\ref{eq:sssstr}). The $\phi^3$ amplitudes start at $\mathcal{O} (\tau^{-1})$, and similar to what we have seen in Section \ref{sec:st}, the leading contributions in the soft limit have to be given by ``pole diagrams'' shown in Fig. \ref{fig:p3p}. Then a simple calculation yields \begin{eqnarray} &&M_n^{\phi^3} (1,\beta_L,n-1,a,n || 1,\beta_R,n-1,n,b) \nonumber\\ & =& \frac{ \lambda}{\tau } \frac{\delta_{ab}}{s_{an}} M_{n-1}^{\phi^3} (1,\beta_L,n-1,a || 1,\beta_R,n-1,b) + \mathcal{O} (\tau^0), \end{eqnarray} so that the KLT kernel in Eq. (\ref{eq:kltd2}) is given by \begin{eqnarray} \left[M_n^{\phi^3} \right]^{-1} = \frac{\tau}\lambda \delta_{ab} s_{an} \left[M_{n-1}^{\phi^3} \right]^{-1}+\mathcal{O} (\tau^2).\label{eq:d2kl} \end{eqnarray} \begin{figure}[t] \centering \includegraphics[width=0.18\textwidth]{phi3pole} \caption{\label{fig:p3p} The ``pole diagrams'' giving $\mathcal{O} (\tau^{-1})$ contributions in the $\phi^3$ theory, where the soft leg and another external leg are attached to the same 3-pt vertex, leading to a pole in $\tau$ given by the propagator $i/(2\tau p_{i} \cdot p_n )$.} \end{figure} Similar to the $\phi^3$ amplitudes, we have $M_n^{\text{YM} + \phi^3} = \mathcal{O} (\tau^{-1})$, but the pole diagrams here not only contain ones shared with the $\phi^3$ theory as shown in Fig. \ref{fig:p3p}, but more diagrams where the internal leg giving the $1/\tau$ pole belongs to a gauge boson, as shown in Fig. \ref{fig:ymp3p}. However, these additional diagrams are proportional to \begin{eqnarray} \frac{1}{\tau s_{in}} p_i^\mu M^{\text{YM} + \phi^3}_{\mu, n-1} (i^g) + \mathcal{O} (\tau^0), \end{eqnarray} where $\epsilon_i^\mu M^{\text{YM} + \phi^3}_{\mu, n-1} (i^g)$ is the on-shell amplitude of $\text{YM} + \phi^3$ with all external states being scalar except for the state $i$, which is a gauge boson with polarization vector $\epsilon_i$. Then \begin{eqnarray} p_i^\mu M^{\text{YM} + \phi^3}_{\mu, n-1} (i^g) = 0 \end{eqnarray} because of gauge invariance, so that Fig. \ref{fig:ymp3p} starts at $\mathcal{O} (\tau^0)$ after all. Therefore, the only $\mathcal{O} (\tau^{-1})$ contributions are still given by Fig. \ref{fig:p3p} as in the $\phi^3$ theory, and \begin{eqnarray} M_n^{\text{YM} + \phi^3} (n,\mathbb{I}_l|\alpha||1,\beta_R,n-1,n,b) = \frac{\lambda}{\tau} \frac{\delta_{bl}}{ s_{bn}} M^{\text{YM} + \phi^3}_{n-1} (\mathbb{I}_l |\alpha||1,\beta_R,n-1,b) + \mathcal{O} (\tau^0).\label{eq:d2yp} \end{eqnarray} Notice that in the above, the $\mathcal{O} (\tau^{-1})$ term vanishes when $l=1$. \begin{figure}[t] \centering \includegraphics[width=0.18\textwidth]{ymphi3pole} \caption{\label{fig:ymp3p} The additional pole diagram in $\text{YM} + \phi^3$, where the internal line that gives the $1/\tau $ pole is a gauge boson.} \end{figure} Combining Eq. (\ref{eq:kltd2}) with Eqs. (\ref{eq:sssstr}), (\ref{eq:d2kl}) and (\ref{eq:d2yp}), we arrive at the single soft theorem of $\text{NLSM}^{d_2}$: \begin{eqnarray} M^{(4),d_2}_n (n,\mathbb{I}_{l}|\alpha) =\frac{\tau}{\lambda f^2} \sum_{\substack{i=2 \\ i \ne l}}^{n-1} s_{n,i} M_{n-1}^{d_2 + \phi^3 } (\mathbb{I}_{l}|\alpha||1,l,i) + \mathcal{O} (\tau^2).\label{eq:sttd2} \end{eqnarray} In the above, the amplitudes of the extended theory $d_2 + \phi^3$ are given by the following double copy formula: \begin{align} M_{n}^{d_2 + \phi^3 } (\mathbb{I}_{l}|\alpha||1,l,i) &\equiv& \sum_{\beta_L, \beta_R\in S_{n-3}} M^{\text{NLSM}+\phi^3}_n (\beta_L||1,l,i) K_n(\beta_L || \beta_R) M^{ \text{YM} + \phi^3}_n (\mathbb{I}_l|\alpha||\beta_R),\ \ \end{align} where $\beta_L$ and $\beta_R$ are permutations of $\{ 1,2, \cdots, n\}$ with the positions of three arbitrary elements fixed. Again, the above does not exist when $l = 1$, thus \begin{eqnarray} M^{(4),d_2}_n (n,1|\alpha) = \mathcal{O} (\tau^2).\label{eq:ssd2t2} \end{eqnarray} This can be easily checked for the 6-pt amplitude $M^{(4),d_2}_6 (6,1|2,3,4,5)$, which we show in Appendix \ref{app:nlv}. The soft theorem given by Eq. (\ref{eq:sttd2}) is very similar to the single soft theorem of $\text{NLSM}^{(2)}$ as in Eq. (\ref{eq:sssstr}): 3 legs are given additional ordering in the extended theory, where two of them, i.e. $1$ and $l$ in Eq. (\ref{eq:sttd2}), are adjacent to the soft leg $n$ in the original amplitude, while the third leg $i$ ranges over all the hard legs non-adjacent to $n$ and enters the simple the soft factor $s_{n,i}$. Just like the theory $\text{NLSM}^{d_2}$ is part of $\text{DBI} + \text{NLSM}$, the extended theory $d_2 + \phi^3$ in Eq. (\ref{eq:sttd2}) can be identified as part of a theory called $\text{DBI} +\text{YM}+ \text{NLSM} + \phi^3$ \cite{Chiodaroli:2017ngp}, which is the double copy of $\text{NLSM} + \phi^3$ and $\text{YM} + \phi^3$: \begin{eqnarray} d_2 + \phi^3 \subset \text{DBI} +\text{YM}+ \text{NLSM} + \phi^3 = \left(\text{NLSM} + \phi^3 \right) \stackrel{\rm KLT}{\otimes} \left( \text{YM} + \phi^3 \right) \end{eqnarray} Actually, by the same argument as above one can easily calculate the single soft theorem for a general $n$-pt amplitude of $\text{DBI} + \text{NLSM}$, taking $p_n$ to be soft: \begin{eqnarray} &&M^{\text{DBI} + \text{NLSM}}_n (\alpha_1 | \alpha_2 |\cdots|\alpha_m, n) \nonumber\\ &=& \frac{\tau}{\lambda f^2} \sum_{\substack{i=1\\i\ne j_L, j_R}}^{n-1} s_{n,i} M^{\text{DBI} +\text{YM}+ \text{NLSM} + \phi^3}_{n-1} (\alpha_1 | \alpha_2 |\cdots|\alpha_m ||j_R,j_L,i) + \mathcal{O} (\tau^2),\label{eq:stdn} \end{eqnarray} where $j_L$ and $j_R$ are the legs left/right adjacent to the leg $n$ in the ordering of the original amplitude, i.e. the last and first element in the sequence $\alpha_m$. \subsubsection{Matching to the Ward identity} \label{sec:d2ev} Now let us compare Eq. (\ref{eq:sttd2}) with what we know from the Ward identity, i.e. Eq. (\ref{eq:ssp4dt}), and work out the vertices in $d_2 + \phi^3$. As Eq. (\ref{eq:sttd2}) has essentially the same form as the $\mathcal{O} (p^2)$ soft theorem of Eq. (\ref{eq:sssstr}), we again have the Type I and Type II vertices: Type I are vertices with two $\phi$ that equals the $\text{NLSM}^{d_2}$ ones with the same left ordering, while Type II comes from vertices ${\cal V}$ generated by the current. We then need to compute the Type II vertices in the following. In $\text{NLSM}^{d_2}$ the Wilson coefficients of the $\mathcal{O} (p^4)$ operators take the fixed values of Eq. (\ref{eq:defd2}), so that the relevant vertex ${\cal V}^{(4)}$ is \begin{eqnarray} {\cal V}^{(4),d_2} (\alpha|\beta) = \frac{1}{4} {\cal V}^{(4),1} (\alpha|\beta) - \frac{1}{2}{\cal V}^{(4),2} (\alpha|\beta) . \end{eqnarray} The first thing one may want to check is the special case of Eq. (\ref{eq:ssd2t2}), where the $\mathcal{O} (\tau)$ term vanishes. In such a case, Eq. (\ref{eq:ssp4dt}) is reduced to \begin{eqnarray} M_{n+1}^{(4)} ( n,1| \alpha) = \tau \sum_{i,\gamma'} {\cal V}^{(4),d_2} (1|q_{\gamma'_{1}}, \cdots,q_{\gamma'_{i}} ) \prod_{j=1}^{i} J^{(2)} ( \gamma_j ) + \mathcal{O} (\tau^2)\ \end{eqnarray} with $p_n$ being soft, where $\{ \gamma'_1, \cdots, \gamma'_i \}$ are partitions of any of the cyclic permutations of $\alpha$. It is clear that vertices ${\cal V}^{(4),d_2} (j|\alpha) $ with only one leg $j$ in one of their traces appear in all the $\mathcal{O} (\tau)$ terms in the above. Therefore, to satisfy Eq. (\ref{eq:ssd2t2}) we need total cancellations of all terms involving ${\cal V}^{(4),d_2} (j|\alpha) $. This, however, does not necessarily imply that ${\cal V}^{(4),d_2} (j|\alpha) = 0$. It is easy to show that \begin{eqnarray} {\cal V}^{(4),d_2} (1,2|3) = \frac{2}{f^2 \Lambda^2} \left( q\cdot p_1\ p_2^2 + q \cdot p_2\ p_1^2 \right),\label{eq:3pd2o} \end{eqnarray} which does not vanish, but its effect can be moved to higher-pt vertices. For example, if $p_{1}$ in ${\cal V}^{(4),d_2} (1,2|3)$ is an internal momentum in a Feynman diagram, the term with $p_{1}^2$ will cancel the propagator and effectively resulting in a higher-pt vertex. This suggests that the EoM may be needed here. Indeed, let us directly look at the current: the vertices ${\cal V}^{(4),d_2} (j|\alpha) $ come from \begin{eqnarray} \left( \mathcal{J}^{(4),d_2} \right)^a_\mu &=& \frac{f}{\Lambda^2} \left[\cos \sqrt{{\mathcal{T}}} \right]_{ab} \left[ \mathrm{tr} \left( X^b d_\mu \right) \mathrm{tr} \left( d_\nu d^\nu \right) - 2 \mathrm{tr} \left( X^b d_\nu \right) \mathrm{tr} \left(d_\mu d^\nu \right) \right]\nonumber\\ &\supset & \frac{1}{\Lambda^2} \left[ \mathrm{tr} \left( X^a \partial_\mu \Pi \right) \mathrm{tr} \left( d_\nu d^\nu \right) - 2 \mathrm{tr} \left( X^a \partial_\nu \Pi \right) \mathrm{tr} \left(d_\mu d^\nu \right) \right]\nonumber\\ &\simeq & -\frac{2}{\Lambda^2} \mathrm{tr} \left( X^a \Pi \right) \left[ 2 \mathrm{tr} \left( d^\nu \nabla_{[\mu} d_{\nu]} \right) - \mathrm{tr} \left( d_\mu \nabla_\nu d^\nu \right) \right]\nonumber\\ &\simeq &0. \end{eqnarray} In the second line of the above we select all terms that generate ${\cal V}^{(4),d_2} (j|\alpha) $, in the third line we drop total derivatives, which give a contribution of $\mathcal{O} (\tau^2)$ in the soft theorem, while in the last line we apply an identity: $\nabla_{[\mu} d_{\nu]} \equiv (\nabla_{\mu} d_{\nu} -\nabla_{\nu} d_{\mu} )/2= 0$, as well as the EoM $\nabla_\mu d^\mu = \mathcal{O} (\partial^4)$, and dropped terms beyond $\mathcal{O} (\partial^3)$. We provide a proof of these relations in Appendix \ref{app:eom}. This indicates that all contributions from the vertices like ${\cal V}^{(4),d_2} (j|\alpha)$ will be cancelled out in the final amplitude. The vertex that we need to consider is then \begin{eqnarray} &&{\cal V}^{(4),d_2}_{2m+2n+1} (\mathbb{I}_{2m}|2m+1, \cdots, 2m+2n+1 )\nonumber\\ &=& \frac{1}{\Lambda^2} \left(-\frac{4}{f^2}\right)^{m+n} \sum_{l_1 = 0}^{2n} \sum_{l_2 = 1}^{2m-1} \sum_{i=1}^{2m} \frac{ (-1)^{l_1 + l_2}}{l_1! l_2! (2n+1-l_1)!(2m-l_2)!}\nonumber\\ &&\times \left( \frac{1}4 q\cdot p_{2m+l_1+1;2m+ 2n+1}\ p_{m|1;l_2|i} \cdot p_{m|l_2+1;2m|i} \right. \nonumber\\ &&\left.- \frac{1}2 q\cdot p_{m|1;l_2|i} \ p_{m|l_2+1;2m|i} \cdot p_{2m+l_1+1;2m+ 2n+1} \right)\nonumber\\ &=& \frac{1}{\lambda f^2} \sum_{\substack{i=1 \\ i \ne 2m+1}}^{2m+2n} 2 q \cdot p_i \ V_{2k+1}^{d_2 + \phi^3} (\mathbb{I}_{2k+1} || 2m,2m+2n+1,j). \end{eqnarray} Similar to what we see in Eq. (\ref{eq:type2r}), the above dictates that terms involving $q \cdot p_{2m+1}$ and $q \cdot p_{2m+2n+1}$ in ${\cal V}^{(4),d_2}$ need to be eliminated at the same time. The final form of the vertices for the extended theory would be \begin{eqnarray} &&V^{d_2 + \phi^3}_{2m+2n+1} (\mathbb{I}_{2m}|2m+1,\cdots,2m+2n+1||2m+1,2m+2n+1,j)\nonumber\\ &=& \frac{\lambda }{2\Lambda^2} \left(-\frac{4}{f^2}\right)^{m+n-1} \frac{ 1 }{ (2m)!(2n+1) !} \sum_{i=1}^{2m} \left[ \sum_{l_2 = 1}^{2m-1} (-1)^{ l_2} \left(\begin{array}{c} 2m\\ l_2 \end{array}\right)p_{m|1;l_2|i} \cdot p_{m|l_2+1;2m|i} \right. \nonumber\\ && \left. + 2 \mathsf{F} (m, |i-j|) \sum_{l_1 = 0}^{2n} (-1)^{l_1} \left(\begin{array}{c} 2n+1\\ l_1 \end{array}\right) p_i \cdot p_{2m+l_1+1;2m+ 2n+1} \right] \end{eqnarray} for $1 \le j \le 2m$, and \begin{eqnarray} &&V^{d_2 + \phi^3}_{2m+2n+1}(\mathbb{I}_{2m}|2m+1,\cdots,2m+2n+1||2m+1,2m+2n+1,j)\nonumber\\ &=& \frac{\lambda }{2\Lambda^2} \left(-\frac{4}{f^2}\right)^{m+n-1} \sum_{l_2 = 1}^{2m-1} \sum_{i=1}^{2m} \frac{ (-1)^{ l_2}}{ (2m)!(2n+1) !} \left(\begin{array}{c} 2m\\ l_2 \end{array}\right) \nonumber\\ &&\times\left[ 1 + (-1)^{j} \left(\begin{array}{c} 2n\\ j-2m-1 \end{array}\right) \right] p_{m|1;l_2|i} \cdot p_{m|l_2+1;2m|i} \end{eqnarray} for $ 2m+2 \le j \le 2m+2n$, with \begin{eqnarray} \mathsf{F} (m , k ) &\equiv& -2m \min ( k, 2m-k) \nonumber\\ &&+ \frac{\left(1- \delta_{1,m}\right) (-1)^k k (2m-k) \left[ \min (k, 2m-k) - 1 \right]}{2(m-1 + \delta_{1,m})(2m-1)} \left(\begin{array}{c} 2m\\ k \end{array}\right) . \end{eqnarray} Examples of the vertices and amplitudes for $d_2 + \phi^3$ are presented in Appendix \ref{app:eet}. \subsection{The general case} It is still unknown whether the most general $\mathcal{O} (p^4)$ amplitudes of NLSM, with arbitrary Wilson coefficients $C_i$, have a double copy structure or a CHY representation. Without such input it is hard to answer definitely whether the soft theorems of Eqs. (\ref{eq:ssp4st}) and (\ref{eq:ssp4dt}) have an interpretation of extended theories. If they do, as they are for amplitudes of the higher derivative corrections to $\text{NLSM}^{(2)}$, it is natural to assume that they are higher derivative corrections to the $\text{NLSM}^{(2)}$ soft theorem, given by Eq. (\ref{eq:sssstr}). However, the correction can either enter the extended theory or the soft factor. Schematically, we can have \begin{eqnarray} M^{(4)}_{n+1} = \tau {\cal S}^{(2)} M^{(4)+ }_n + \tau {\cal S}^{(4)} M^{\text{NLSM} +\phi^3 }_n + \mathcal{O} (\tau^2),\label{eq:gsssch} \end{eqnarray} where ${\cal S}^{(2)}$ is the known soft factor in the soft theorem of $\text{NLSM}^{(2)}$, $(4)+$ is some higher derivative corrections to the extended theory $\text{NLSM} +\phi^3$, and ${\cal S}^{(4)}$ a new soft factor at $\mathcal{O} (p^4)$. One needs to determine which part of the RHS of Eqs. (\ref{eq:ssp4st}) and (\ref{eq:ssp4dt}) enters the first/second term on the RHS of Eq. (\ref{eq:gsssch}). Here we make the first steps to answer these questions. We observe that in the special case of $\text{NLSM}^{d_2}$, the form of the soft theorem is very similar to that of $\text{NLSM}^{(2)}$: the soft factor is not modified at all, while all the higher derivative corrections go into the extended theory. One can then ask: is it possible to do this for the general amplitudes of NLSM at $\mathcal{O} (p^4)$? To be more concrete, we would like to ask whether the single trace $\mathcal{O} (p^4)$ soft theorem given by Eq. (\ref{eq:ssp4st}) can be interpreted as \begin{eqnarray} M_{n+1}^{(4)} (\mathbb{I}_{n+1}) = \frac{\tau}{\lambda f^2} \sum_{i=2}^{n-1} s_{n+1,i} \ M_n^{(4) + \phi^3}(\mathbb{I}_{n}||1,n,i) + \mathcal{O} (\tau^2),\label{eq:sstast} \end{eqnarray} and similarly in the double trace case, whether Eq. (\ref{eq:ssp4dt}) can be interpreted as \begin{eqnarray} M_{n+1}^{(4) } (n+1,\mathbb{I}_{l}|\sigma ) = \frac{\tau}{\lambda f^2} \sum_{\substack{i=2 \\ i \ne l}}^{n} s_{n+1,i} M_{n}^{(4) + \phi^3 } (\mathbb{I}_{l}|\sigma||1,l,i) + \mathcal{O} (\tau^2).\label{eq:sstadt} \end{eqnarray} Notice that Eqs. (\ref{eq:sstast}) and (\ref{eq:sstadt}) are much more stringent constraints than Eq. (\ref{eq:gsssch}): we require that at $\mathcal{O} (\tau)$, the coefficient of $s_{n+1,i}$, with $n+1$ labeling the soft leg, vanishes if $i$ is adjacent to $n+1$ in the ordering of the original amplitude. Furthermore, $(4) + \phi^3$ is understood as a higher derivative correction to $\text{NLSM} + \phi^3$, and the coefficient of $s_{n+1,i}$ is an amplitude where only three of the $n$ external legs are bi-adjoint scalars, while all the other external states are still NGB's. Then the extended theory amplitudes should satisfy the Adler zero condition for all the external legs, except for $\{1,n,i\}$ in Eq. (\ref{eq:sstast}) and $\{1,l,i \}$ in Eq. (\ref{eq:sstadt}). One can then use low-pt amplitudes of $\text{NLSM}$ to test whether such interpretations are possible. For the double trace amplitudes, satisfying Eq. (\ref{eq:sstadt}) leads to a constraint of the Wilson coefficients: $C_2 = -2 C_1$. This effectively selects the amplitudes of $\text{NLSM}^{d_2}$. On the other hand, we have tested up to 8-pt that the interpretation of Eq. (\ref{eq:sstast}) is possible for the single trace amplitudes if $C_{4'} = 0$. In the $\text{NLSM}^{d_2}$ case the result is somewhat expected, given that these amplitudes can be built by a double copy with $\text{NLSM}^{(2)}$ amplitudes, which themselves satisfy this type of single soft theorem. The single trace case on the other hand is surprising, as these $\mathcal{O}(p^4)$ amplitudes are not known to have any direct connection to the $\mathcal{O}(p^2)$ amplitudes. We will call the NLSM with $\mathcal{O} (p^4)$ Wilson coefficients $C_{3'} = 1$, $C_{4'} = C_1 = C_2 = 0$ as $\text{NLSM}^{C_{3'}}$, and the corresponding extended theory $C_{3'} + \phi^3$. The soft theorem for the $\mathcal{O} (p^4)$ amplitudes of $\text{NLSM}^{C_{3'}}$ is then \begin{eqnarray} M_{n+1}^{(4),3'} (\mathbb{I}_{n+1}) = \frac{\tau}{\lambda f^2} \sum_{i=2}^{n-1} s_{n+1,i} \ M_n^{C_{3'} + \phi^3}(\mathbb{I}_{n}||1,n,i) + \mathcal{O} (\tau^2).\label{eq:sstc3p} \end{eqnarray} Again, as in the case of $d_2 + \phi^3$, there should be Type I and Type II vertices in $C_{3'} + \phi^3$, Type I taking the same value the $\text{NLSM}^{C_{3'}}$ vertices with identical left orderings, while Type II vertices should be given by \begin{eqnarray} {\cal V}^{(4),3'}_{2k+1} (\mathbb{I}_{2k+1}) =\frac{1}{\lambda f^2} \sum_{i=2}^{2k} 2 q \cdot p_i \ V_{2k+1}^{C_{3'} + \phi^3} (\mathbb{I}_{2k+1} || 1,2k+1,j). \end{eqnarray} We see from Eq. (\ref{eq:c3pjv}) that ${\cal V}^{(4),3'}_{2k+1} (\mathbb{I}_{2k+1})$ can indeed be put in a form without $2 q \cdot p_1$ and $2q \cdot p_{2k+1}$. However, when $k=1$, $j$ has to be $2$, and the coefficient of $q \cdot p_2$ is proportional to \begin{eqnarray} p_1 \cdot p_3,\label{eq:v3po} \end{eqnarray} which cannot work as $V^{C_{3'}+\phi^3}_3 ( 1,2,3|| 1,3,2)$, because the 3-pt $\phi^3$ vertex need to be invariant under cyclic permutations. This problem persists in higher-pt vertices as well: we need \begin{eqnarray} V^{C_{3'}+\phi^3}_{2k+1} ( \mathbb{I}_{2k+1}|| 1,2k+1,2) = V^{C_{3'}+\phi^3}_{2k+1} ( 1,2k+1,2k,2k-1,\cdots, 2|| 1,2,2k+1),\label{eq:c3pcst} \end{eqnarray} the two sides of which are related by a reversion of both the left and the right orderings. For example, the coefficient of $2q \cdot p_2$ for ${\cal V}^{(4),3'}_{5} (\mathbb{I}_{5})$ in Eq. (\ref{eq:c3pjv}) is \begin{eqnarray} \frac{2}{3 f^4 \Lambda^2 } p_1 \cdot (-2 p_3 + p_4 - p_5), \end{eqnarray} which is not invariant under $2 \leftrightarrow 5$, $3 \leftrightarrow 4$. At 3-pt, we see that \begin{eqnarray} p_1 \cdot p_3 = - \left( p_1 \cdot p_3 + p_1 \cdot p_2 + p_2 \cdot p_3 + p_1^2 + p_3^2 \right).\label{eq:c3p3om} \end{eqnarray} In other words, the difference between Eq. (\ref{eq:v3po}) and a cyclic form is associated with $p_i^2$. Similar to what we have seen in ${\cal V}^{(4),d_2}(1,2|3)$ as in Eq. (\ref{eq:3pd2o}), this amounts to corrections to higher-pt vertices. Similar to Section \ref{sec:d2ev}, it would be easier to fix the problem at the level of the current using the EoM. The suitably modified vertices given by the current is \begin{eqnarray} \hat{{\cal V}}^{(4),3'}_{2k+1} (1,2,\cdots, 2k+1) &=& -\frac{1}{\Lambda^2 f^{2k} } \sum_{l_1 = 0}^{2k-2} \sum_{l_2=1}^{2k-1-l_1} \sum_{l_3=1}^{2k-l_1 - l_2} \frac{(-4)^k (-1)^{l_1 + l_3}}{l_1! l_2 ! l_3 ! (2k+1 - l_1 - l_2 - l_3)! }\nonumber\\ && \left( q \cdot p_{l_3 + 1;l_3 + l_2} \ p_{l_3 + 1;l_3 + l_2} \cdot p_{l_1 + l_2 + l_3 + 1; 2k+1}\right.\nonumber\\ &&\left. + q \cdot p_{l_1+l_2 + 1;l_1 + l_2 + l_3} \ p_{l_1 + 1;l_1 + l_2} \cdot p_{l_1 + l_2 + 1; 2k+1} \right)\nonumber\\ &=&\frac{1}{\lambda f^2} \sum_{i=2}^{2k} 2 q \cdot p_i \ V_{2k+1}^{C_{3'} + \phi^3} (\mathbb{I}_{2k+1} || 1,2k+1,j),\label{eq:v3pm} \end{eqnarray} and the details of the derivation of the above are presented in Appendix \ref{app:c3pfc}. Then the Type II vertices are given by \begin{eqnarray} &&V^{C_{3'} + \phi^3}_{2k+1} (1,2,\cdots, 2k+1||1,2k+1,j) \nonumber\\ &=& -\frac{\lambda (-4)^k}{2\Lambda^2 f^{2k-2} } \sum_{l_1 = 1}^{j-1} \left\{ \sum_{l_2=j-l_1}^{2k-l_1} \sum_{l_3=0}^{2k-l_1 - l_2} \frac{ (-1)^{l_1 + l_3}}{l_1! l_2 ! l_3 ! (2k+1 - l_1 - l_2 - l_3)! } \right.\nonumber\\ &&\times p_{l_1 + 1;l_1 + l_2} \cdot p_{l_1 + l_2 + l_3 + 1; 2k+1} \nonumber\\ &&+ \sum_{l_2=1}^{j-l_1} \left[ 1 + (-1)^j \left( \begin{array}{c} 2k+1-l_1 - l_2 \\ 2k+1 - j \end{array} \right) \right] \nonumber\\ && \left. \phantom{\sum_j^{l_2}} \times \frac{ (-1)^{l_2 }}{(l_1-1)! l_2 ! (2k+2-l_1 - l_2)! } p_{l_1 ;l_1 + l_2 -1} \cdot p_{l_1 + l_2 ; 2k+1} \right\}, \end{eqnarray} which satisfy Eq. (\ref{eq:c3pcst}). We provide examples in Appendix \ref{app:eet}. \section{The double soft theorem at $\mathcal{O} (p^\infty)$}\label{sec5} It was shown in Ref. \cite{Low:2015ogb} that the first two non-vanishing orders of the double-soft theorem for NLSM can be straightforwardly derived for the $\mathcal{O} (p^2)$, flavor-dressed full amplitudes ${\cal M}^{(2)}$. Using the same method, we can generalize such results to all orders in the derivative expansion for the tree amplitude ${\cal M}^\text{NLSM}$. Let us consider the $(n+2)$-pt tree amplitude ${\cal M}_{n+2}$, and take $p_{n+1}$ and $p_{n+2}$ to be soft. The leading non-vanishing term in the double soft limit is $\mathcal{O} (\tau^0)$, instead of $\mathcal{O} (\tau)$ which the Adler zero in the single soft limit may suggest. This is because when two of the external legs are soft, there are Feynman diagrams where a pole in the soft parameter $\tau $ develops: this happens when both of the soft legs are attached to a single 4-pt vertex, and a third external leg with momentum $p_i$ is attached to the vertex as well, as shown in Fig. (\ref{fig:dousopol}). The pole in $\tau$ then appears in the propagator attached to the vertex: \begin{eqnarray} \frac{i}{\tau (s_{i,n+1} + s_{i,n+2} + \tau s_{n+1,n+2})}. \end{eqnarray} \begin{figure}[t] \centering \includegraphics[width=0.18\textwidth]{dousopol} \caption{\label{fig:dousopol} The pole diagram in the double soft limit.} \end{figure} Therefore, we are able to classify all Feynman diagrams into two groups: the pole diagrams with such a pole in $\tau$, summed to ${\cal M}_{ {\mathrm{pole}}}$; all the other diagrams, which are called ``gut diagrams'' and sum to ${\cal M}_ {\mathrm{gut}}$. It is straightforward to calculate ${\cal M}_{ {\mathrm{pole}}}$ in the double soft limit, while the contributions of the gut diagrams are then fixed by applying symmetry constraints on the full amplitude ${\cal M} = {\cal M}_{ {\mathrm{pole}}} + {\cal M}_ {\mathrm{gut}}$, including flavor symmetry as well as the shift symmetry, which manifests as the Adler zero condition in the single soft limit. We will be able to calculate the double soft limit up to $\mathcal{O} (\tau)$ in this manner. The pole diagrams for ${\cal M}_{n+2}$ are given by \begin{eqnarray} &&{\cal M}_{n+2,\ {\mathrm{pole}}}^{a_1 \cdots a_{n+2}} (p_1, \cdots, p_n, \tau p_{n+1}, \tau p_{n+2}) \nonumber\\ &=& \sum_{i=1}^n \frac{- V^{a_i a_{n+1} a_{n+2} b}_4 (p_i, \tau p_{n+1}, \tau p_{n+2}, -\tilde{p_i})}{\tau (s_{i,n+1} + s_{i,n+2} + \tau s_{n+1,n+2})} \tilde{{\cal M}}_n^{a_1 \cdots a_{i-1} b a_{i+1} \cdots n} (p_1, \cdots, p_{i-1},\tilde{p_i}, p_{i+1},\cdots , p_n) \nonumber\\ && + \mathcal{O} (\tau^2),\label{eq:dspei} \end{eqnarray} where $V_4$ is the 4-pt vertex attached by the two soft legs as shown in Fig. (\ref{fig:dousopol}), while \begin{eqnarray} \tilde{{\cal M}}_n^{a_1 \cdots a_{i-1} b a_{i+1} \cdots a_n} (p_1, \cdots, p_{i-1},\tilde{p_i}, p_{i+1},\cdots , p_n) \end{eqnarray} is the $n$-pt amplitude with leg $i$ off-shell, with momentum $\tilde{p_i} = p_i + \tau (p_{n+1} + p_{n+2})$. Here $\tilde{{\cal M}}$ is clearly equivalent to the Berends-Giele current given by Eq. (\ref{eq:bgcd}), except that the off-shell leg is also cut in $\tilde{{\cal M}}$ but not in $J$. Of course, in the fully on-shell limit we have $\tilde{{\cal M}}_n (p_i) = {\cal M}_n ( p_i)$. However, for a general off-shell momentum $\tilde{p_i}$, $\tilde{{\cal M}}_n (\tilde{p_i}) = {\cal M}_n (\tilde{p_i})$ is not guaranteed. Therefore, to relate $\tilde{{\cal M}}$ and ${\cal M}$ in a concrete manner, it is necessary to express $\tilde{{\cal M}}_n (\tilde{p_i})$ as \begin{eqnarray} &&\tilde{{\cal M}}_n^{a_1 \cdots b \cdots a_n} ( \cdots,\tilde{p_i},\cdots)\nonumber\\ & =& {\cal M}_n^{a_1 \cdots b \cdots a_n} (\cdots,\tilde{p_i},\cdots ) + \tilde{p_i}^2 X^{a_1 \cdots b \cdots a_n} (p_1, \cdots,\tilde{p_i},\cdots , p_n), \end{eqnarray} where $X(\tilde{p_i})$ is some unknown function of the momenta and must be non-singular in the limit of $\tilde{p_i} \to p_i$. The $X$ piece is usually neglected in the literature, but should be included in a rigorous derivation. As it clearly contains off-shell data, it should vary under local redefinitions of the field variables, but its contributions need to vanish in any on-shell results. Then $\tilde{{\cal M}}_n (\tilde{p_i})$ in Eq. (\ref{eq:dspei}) can be expanded in $\tau$ as \begin{eqnarray} &&\tilde{{\cal M}}_n^{a_1 \cdots b \cdots a_n} ( \cdots,\tilde{p_i},\cdots)\nonumber\\ &=&\tilde{{\cal M}}_n^{a_1 \cdots b \cdots a_n} ( \cdots,p_i,\cdots) \nonumber\\ &&+ \tau (p_{n+1} + p_{n+2}) \cdot \left.\left[\frac{\partial}{\partial \tilde{p_i} }\tilde{M}_n^{a_1 \cdots b \cdots a_n} ( \cdots,\tilde{p_i},\cdots) \right]\right|_{\tilde{p_i} = p_i} + \mathcal{O} (\tau^2)\nonumber\\ &=& {\cal M}_n^{a_1 \cdots b \cdots a_n} ( \cdots,p_i,\cdots) + \tau (p_{n+1} + p_{n+2}) \cdot \frac{\partial}{\partial p_i }{\cal M}_n^{a_1 \cdots b \cdots a_n} ( \cdots,p_i,\cdots) \nonumber\\ &&+ 2\tau p_i \cdot (p_{n+1} + p_{n+2}) X^{a_1 \cdots b \cdots a_n} ( \cdots,p_i,\cdots) + \mathcal{O} (\tau^2).\label{eq:dstme} \end{eqnarray} As we would like to calculate the double soft limit up to $\mathcal{O} (\tau)$, from Eq. (\ref{eq:dspei}) we know that we need $V_4$ up to $\mathcal{O} (\tau^2)$, which turns out to be completely fixed by the Lagrangian up to $\mathcal{O} (p^4)$. This is because for a general, off-shell 4-pt scalar vertex $V_4$ with momenta $p_1 ,\cdots, p_4$ satisfying total momentum conservation, it can only be a polynomial of 6 independent momentum invariants, for example \begin{eqnarray} s_{12},\ s_{13}, \ s_{23}, \ p_1^2, \ p_2^2, \ p_3^2. \end{eqnarray} However, in $V^{a_i a_{n+1} a_{n+2} b}_4 (p_i, \tau p_{n+1}, \tau p_{n+2}, -\tilde{p_i})$ three of the momenta are on-shell, reducing the number of independent momentum invariants to 3, e.g. \begin{eqnarray} \tau s_{i, n+1}, \ \tau s_{i,n+2},\ \tau^2 s_{n+1,n+2}, \end{eqnarray} which are at least at $\mathcal{O} (\tau)$. The contribution of the $\mathcal{O} (p^{2n})$ Lagrangian then consists of $n$ powers of these invariants, which are at least $\mathcal{O} (\tau^n)$. Therefore, to calculate $V_4$ in Eq. (\ref{eq:dspei}) up to $\mathcal{O} (\tau^2)$, we only need the Lagrangian up to $\mathcal{O} (p^4)$; moreover, as the Lagrangian starts at $\mathcal{O} (p^2)$, $V_4$ in Eq. (\ref{eq:dspei}) starts at $\mathcal{O} (\tau)$, thus we only need to calculate $\tilde{{\cal M}}_n (\tilde{p_i})$ up to $\mathcal{O} (\tau)$. From the Lagrangian given by Eq. (\ref{eq:nlsml4}) we can then expand $V_4$ as \begin{eqnarray} &&V^{a_i a_{n+1} a_{n+2} b}_4 (p_i, \tau p_{n+1}, \tau p_{n+2}, p_I)\nonumber\\ &=&-\tau \frac{1}{3f^2} \left[ T^j_{a_i a_{n+1}} T^j_{a_{n+2} b} (2s_{i,n+2} - s_{i,n+1}) - T^j_{a_i a_{n+2}} T^j_{ a_{n+1} b} (2s_{i,n+1} - s_{i,{n+2}}) \right] \nonumber\\ &&-\tau^2\left[ \frac{1}{3f^2} \left( T^j_{a_i a_{n+1}} T^j_{a_{n+2} b} + T^j_{a_i a_{n+2}} T^j_{ a_{n+1} b} \right) s_{n+1,n+2}\right.\nonumber\\ &&\left. + \frac{1}{f^2 \Lambda^2} \mathcal{F}^{(4),a_i a_{n+1} a_{n+2} b} s_{i,n+1} s_{i,n+2} \right] + \mathcal{O} (\tau^3),\label{eq:dsv4e} \end{eqnarray} where \begin{eqnarray} \quad \mathcal{F}^{(4),abcd} & =&(2C_1 + C_2) \left(\delta^{ac } \delta^{bd} + \delta^{ab} \delta^{cd} \right) +2 C_2\ \delta^{ad} \delta^{bc} \nonumber\\ &&+ \left( C_3 + \frac{2}{3} C_4 \right) \left( T^j_{ab } T^j_{ cd} + T^j_{ac } T^j_{bd} \right) + 16 C_4 \mathsf{d}^{abcd} \end{eqnarray} is the flavor factor associated with the $\mathcal{O} (p^4)$ contribution in the Lagrangian, and the totally symmetric flavor tensor $\mathsf{d}^{abcd}$ is defined as \begin{eqnarray} \mathsf{d}^{a_1 a_2 a_3 a_4} = \frac{1}{3!} \sum_{\alpha \in S_3} \mathrm{tr} \left( \textsf{X}^{a_{\alpha (1)}} \textsf{X}^{a_{\alpha (2)}} \textsf{X}^{a_{\alpha (3)}} \textsf{X}^{a_{4}} \right). \end{eqnarray} Notice that in Eq. (\ref{eq:dsv4e}) we have used the closure condition Eq. (\ref{eq:clocon}) for the generators $T^i_{ab}$ of the flavor group. Now that we have expanded ${\cal M}_{ {\mathrm{pole}}}$ to $\mathcal{O} (\tau)$, it is time to do the same for ${\cal M}_ {\mathrm{gut}}$: \begin{eqnarray} &&{\cal M}_{n+2,\ {\mathrm{gut}}}^{a_1 \cdots a_{n+2}} (p_1, \cdots , p_n, \tau p_{n+1}, \tau p_{n+2})\nonumber\\ & = & {\cal M}_{n+2,\ {\mathrm{gut}}}^{a_1 \cdots a_{n+2}} (p_1, \cdots , p_n, 0, 0) \nonumber\\ &&+\tau p_{n+1} \cdot \left. \left[ \frac{\partial}{\partial p_{n+1}} {\cal M}_{n+2,\ {\mathrm{gut}}}^{a_1 \cdots a_{n+2}} (p_1, \cdots , p_n, p_{n+1}, 0) \right] \right|_{p_{n+1} = 0}\nonumber\\ &&+\tau p_{n+2} \cdot \left. \left[ \frac{\partial}{\partial p_{n+2}} {\cal M}_{n+2,\ {\mathrm{gut}}}^{a_1 \cdots a_{n+2}} (p_1, \cdots , p_n, 0, p_{n+2}) \right] \right|_{p_{n+2} = 0}+ \mathcal{O} (\tau^2).\ \label{eq:gutoe} \end{eqnarray} Apparently, we need to calculate the leading contributions of ${\cal M}_ {\mathrm{gut}}$ in both the single and the double soft limits. Let us first consider the single soft limit with $p_{n+1} = 0$: \begin{eqnarray} &&{\cal M}_{n+2,\ {\mathrm{gut}}}^{a_1 \cdots a_{n+2}}(p_1, \cdots, p_n , 0, p_{n+2})\nonumber\\ & =&M_{n+2}^{a_1 \cdots a_{n+2}} (p_1, \cdots, p_n , 0, p_{n+2}) - {\cal M}_{n+2, \ {\mathrm{pole}}}^{a_1 \cdots a_{n+2}}(p_1, \cdots, p_n , 0, p_{n+2})\nonumber\\ &=&- {\cal M}_{n+2, \ {\mathrm{pole}}}^{a_1 \cdots a_{n+2}}(p_1, \cdots, p_n , 0, p_{n+2}),\label{eq:gutsmpole} \end{eqnarray} where the last equality is dictated by the Adler zero condition. Eq. (\ref{eq:gutoe}) requires expanding the above to the linear order in soft $p_{n+2}$. Therefore, let us make the usual replacement of $p_{n+2} \to \tau p_{n+2}$, and expand $\tau $ around $0$; we have \begin{eqnarray} &&{\cal M}_{n+2,\ {\mathrm{pole}}}^{a_1 \cdots a_{n+2}} (p_1, \cdots, p_n, 0, \tau p_{n+2}) \nonumber\\ &=& \sum_{i=1}^n \frac{- V^{a_i a_{n+1} a_{n+2} b}_4 (p_i, 0, \tau p_{n+2}, -p_i - \tau p_{n+2})}{ \tau s_{i,n+2} } \nonumber\\ &&\times \tilde{{\cal M}}^{a_1 \cdots a_{i-1} b a_{i+1} \cdots n} (p_1, \cdots, p_{i-1}, p_i + \tau p_{n+2}, p_{i+1},\cdots , p_n) . \end{eqnarray} Notice that in the above, $V_4 $ must be a polynomial of $\tau s_{i,n+2}$, which is the only non-vanishing momentum invariant left. Therefore, the contribution of $\mathcal{O} (p^{2n})$ terms in the Lagrangian must be proportional to $\tau^n s^{n}_{i, n+2}$. From the Lagrangian in Eq. (\ref{eq:nlsml4}) we see that the $\mathcal{O} (p^4)$ contribution actually vanishes, thus \begin{eqnarray} &&V^{a_i a_{n+1} a_{n+2} b}_4 (p_i, 0, \tau p_{n+2}, -p_i - \tau p_{n+2})\label{eq:v4at3pt}\nonumber \\ &=&- \frac{\tau}{3f^2} \left( T^j_{a_i b} T^j_{a_{n+1} a_{n+2}} - T^j_{a_i a_{n+1}} T^j_{a_{n+2} b} \right) s_{i, n+2} + \mathcal{O} (\tau^3), \end{eqnarray} and Eq. (\ref{eq:gutsmpole}) becomes \begin{eqnarray} &&{\cal M}_{n+2,\ {\mathrm{gut}}}^{a_1 \cdots a_{n+2}}(p_1, \cdots, p_n , 0, \tau p_{n+2}) \label{eq:gutsins1} \nonumber\\ &=& \frac{1}{3f^2} \sum_{i=1}^n \left( T^j_{a_i b} T^j_{a_{n+1} a_{n+2}} - T^j_{a_i a_{n+1}} T^j_{a_{n+2} b} \right) \tilde{{\cal M}}_n^{a_1 \cdots b \cdots a_n} ( \cdots, p_i + \tau p_{n+2},\cdots) + \mathcal{O} (\tau^2) ,\nonumber\\ \end{eqnarray} where the expansion of $\tilde{{\cal M}}$ in terms of $\tau p_{n+2}$ in the above is given by Eq. (\ref{eq:dstme}). Specifically, if we then set $\tau = 0$ in the above, we get \begin{eqnarray} {\cal M}_{n+2,\ {\mathrm{gut}}}^{a_1 \cdots a_{n+2}} (p_1, \cdots, p_n , 0, 0)= -\frac{1}{3f^2} \sum_{i=1}^n T^j_{a_i a_{n+2}} T^j_{a_{n+1} b} {\cal M}_n^{a_1 \cdots b \cdots a_n} (p_1, \cdots, p_n),\label{eq:gut00} \end{eqnarray} where again we have used the closure condition in Eq. (\ref{eq:clocon}), as well as the flavor symmetry of the full on-shell amplitude: \begin{eqnarray} \sum_{i=1}^n T^j_{a_i b} {\cal M}_n^{a_1 \cdots b \cdots a_n} ( \cdots, p_i ,\cdots) = 0.\label{eq:onslw} \end{eqnarray} Similarly, we have \begin{eqnarray} &&{\cal M}_{n+2,\ {\mathrm{gut}}}^{a_1 \cdots a_{n+2}}(p_1, \cdots, p_n , \tau p_{n+1}, 0)= - {\cal M}_{n+2,\ {\mathrm{pole}}}^{a_1 \cdots a_{n+2}}(p_1, \cdots, p_n , \tau p_{n+1}, 0)\nonumber\\ &=& \frac{1}{3f^2} \sum_{i=1}^n \left( T^j_{a_i b} T^j_{a_{n+2} a_{n+1}} - T^j_{a_i a_{n+2}} T^j_{a_{n+1} b} \right) \tilde{{\cal M}}_n^{a_1 \cdots b \cdots a_n} ( \cdots, p_i + \tau p_{n+1},\cdots) + \mathcal{O}(\tau^2),\nonumber\\ \label{eq:gutsins2} \end{eqnarray} and if we set $\tau = 0$ in the above, we get back to Eq. (\ref{eq:gut00}). Then putting everything together into Eq. (\ref{eq:gutoe}) we have \begin{eqnarray} &&{\cal M}_{n+2,\ {\mathrm{gut}}}^{a_1 \cdots a_{n+2}} (p_1, \cdots , p_n, \tau p_{n+1}, \tau p_{n+2})\nonumber\\ & = & -\frac{1}{3f^2} \sum_{i=1}^n \left\{ T^j_{a_i a_{n+2}} T^j_{a_{n+1} b} {\cal M}_n^{a_1 \cdots b \cdots a_n} (p_1, \cdots, p_n) \right.\nonumber\\ &&-\tau\left[ \left( T^j_{a_i b} T^j_{a_{n+2} a_{n+1}} - T^j_{a_i a_{n+2}} T^j_{a_{n+1} b} \right) \right. p_{n+1} \cdot \frac{\partial}{\partial p_{i}} {\cal M}_n^{a_1 \cdots b \cdots a_n} ( p_1, \cdots, p_n) \nonumber\\ &&+ \left( T^j_{a_i b} T^j_{a_{n+1} a_{n+2}} - T^j_{a_i a_{n+1}} T^j_{a_{n+2} b} \right) p_{n+2} \cdot \frac{\partial}{\partial p_{i}} {\cal M}_n^{a_1 \cdots b \cdots a_n} (p_1, \cdots, p_n)\nonumber\\ && + \left( T^j_{a_i b} T^j_{a_{n+2} a_{n+1}} - T^j_{a_i a_{n+2}} T^j_{a_{n+1} b} \right) s_{i, n+1} X^{a_1 \cdots b \cdots a_n} (p_1, \cdots, p_n)\nonumber\\ && \left. \left.+ \left( T^j_{a_i b} T^j_{a_{n+1} a_{n+2}} - T^j_{a_i a_{n+1}} T^j_{a_{n+2} b} \right) s_{i, n+2} X^{a_1 \cdots b \cdots a_n} (p_1, \cdots, p_n) \right]\right\}\nonumber\\ &&+ \mathcal{O} (\tau^2).\label{eq:finalgut} \end{eqnarray} Notice that the result of ${\cal M}_ {\mathrm{gut}}$ in Eq. (\ref{eq:finalgut}) is exactly the same as in Ref. \cite{Low:2015ogb}, apart from pieces containing the unknown function $X$, although Ref. \cite{Low:2015ogb} only considered the $\mathcal{O} (p^2)$ Lagrangian while the result here is valid in all orders of the derivative expansion. This is because the only direct input from the Lagrangian needed in the above calculations is for the 4-pt vertices like in Eq. (\ref{eq:v4at3pt}), where the $\mathcal{O} (p^4)$ contributions vanishes, while terms beyond $\mathcal{O} (p^4)$ are included in the $\mathcal{O} (\tau^2)$ terms in Eqs. (\ref{eq:gutsins1}) and (\ref{eq:gutsins2}), which are eliminated when being plugged into Eq. (\ref{eq:gutoe}). Now we are ready to calculate the full amplitude up to $\mathcal{O} (\tau)$: \begin{eqnarray} &&{\cal M}^{a_1 \cdots a_{n+2}}_{n+2} (p_1, \cdots , p_n, \tau p_{n+1}, \tau p_{n+2}) \nonumber \\ &=& {\cal M}_{n+2, \ {\mathrm{pole}}}^{a_1 \cdots a_{n+2}} (p_1, \cdots, p_n, \tau p_{n+1}, \tau p_{n+2}) + {\cal M}_{n+2,\ {\mathrm{gut}}}^{a_1 \cdots a_{n+2}} (p_1, \cdots, p_n, \tau p_{n+1}, \tau p_{n+2}), \end{eqnarray} thus the double soft theorem is \begin{eqnarray} &&{\cal M}^{a_1 \cdots a_{n+2}}_{n+2} (p_1, \cdots , p_n, \tau p_{n+1}, \tau p_{n+2}) \\ &=& - \frac{1}{2f^2} \sum_{i=1}^n \frac{1}{s_{i,n+1} + s_{i,n+2} + \tau s_{n+1,n+2}} \left\{ T^j_{a_i b } T^j_{a_{n+1} a_{n+2} } (s_{i,n+2} - s_{i,n+1}) \phantom{\frac{2}{ \Lambda^2}}\right. \nonumber\\ && + \tau\left[ \left( T^j_{a_i a_{n+1}} T^j_{a_{n+2} b} + T^j_{a_i a_{n+2}} T^j_{ a_{n+1} b} \right) s_{n+1,n+2} - \frac{2}{ \Lambda^2} \mathcal{F}^{(4),a_i a_{n+1} a_{n+2} b} s_{i,n+1} s_{i,n+2} \right. \nonumber\\ && \left.\left. \phantom{\frac{2}{ \Lambda^2}}+4 T^j_{a_i b} T^j_{a_{n+1} a_{n+2}} p_{n+1}^\nu p_{n+2}^\mu J_{i,\mu \nu} \right] \right\} {\cal M}_n^{a_1 \cdots b \cdots a_n} (p_1, \cdots, p_n)+ \mathcal{O} (\tau^2),\label{eq:ds} \end{eqnarray} where \begin{eqnarray} J_{i, \mu \nu} = p_{i,\mu} \frac{\partial}{ \partial p_i^\nu} - p_{i,\nu} \frac{\partial}{ \partial p_i^\mu} \end{eqnarray} is the angular momentum operator for external state $i$. Notice that the off-shell $X$ terms are cancelled nicely. The only difference between the $\mathcal{O} (p^2)$ result in Ref. \cite{Low:2015ogb} and our all-order result is the $\mathcal{O} (\tau)$ contribution associated with $\mathcal{F}^{(4)}$. In other words, the $\mathcal{O} (p^2)$ Lagrangian completely fixes the $\mathcal{O} (\tau^0)$ double soft theorem, while the $\mathcal{O} (\tau)$ soft factor is fixed by the Lagrangian up to $\mathcal{O} (p^4)$. The soft theorem is unaffected by the possible WZW term in $4$ spacetime dimensions, as its interaction starts at $5$-pt while the only input we need here are $4$-pt vertices. \section{Conclusion}\label{sec6} In this work we have explored NLSM amplitudes beyond leading order in the derivative expansion, as well as the usual flavor structure of ${\text{SU}} (N) \times {\text{SU}} (N) / {\text{SU}} (N)$. We have demonstrated the universality of the trace ordering for a general group representation up to $\mathcal{O} (p^4)$. This enables us to reinterpret the extended theory $\text{NLSM} + \phi^3$, in the previously known $\mathcal{O} (p^2)$ single soft theorem of Eq. (\ref{eq:sssstr}), as a more general theory $\text{NLSM} + \phi + \psi$. In particular, for NGB's furnishing $\mathbf{N}$ of ${\text{SO}} (N)$, the alternative flavor decomposition of the pair basis is convenient, and we derive the corresponding single soft theorem of $\text{NLSM}^{(2)}$ in Eq. (\ref{eq:slsspb}) where the extended theory is presented in this basis as well. To achieve this, we have studied the pair basis in detail, uncovering novel amplitude relations given in Eqs. (\ref{eq:pstr}), (\ref{eq:pasf}) and (\ref{eq:ptret}), as well as the CHY formula Eq. (\ref{eq:chypb}) for the pair basis $\text{NLSM}^{(2)}$ amplitudes. As the pair basis can be regarded as a multi-trace basis where each trace only contains two external states, it appears in amplitudes of other theories as well, such as the multi-flavor DBI scalars as well as the YM scalar theory of a single flavor but multiple colors. There may be connections between these theories and the $\text{NLSM}^{(2)}$ for $\mathbf{N}$ of ${\text{SO}} (N)$, such as in the web of theories of Ref. \cite{Cheung:2017ems}. Amplitude relations for these theories are also worth exploring. Moreover, the DBI scalar amplitudes start at $\mathcal{O} (\tau^2)$ in the single soft limit, which can be seen as a special case of the $\text{DBI} + \text{NLSM}$ soft theorem given by Eq. (\ref{eq:stdn}). The leading non-vanishing terms at $\mathcal{O} (\tau^2)$ have been calculated using the Ward identity \cite{Yin:2018hht}, and it remains to be seen whether the double copy structure of the DBI amplitudes leads to extended theories in this context. Using the Ward identity corresponding to the shift symmetry, we have also extended the subleading single soft theorem to $\mathcal{O} (p^4)$, given by Eqs. (\ref{eq:ssp4st}) and (\ref{eq:ssp4dt}). We found that for at least two specific choices of the Wilson coefficients for the $\mathcal{O} (p^4)$ operators, which result in $\text{NLSM}^{d_2}$ and $\text{NLSM}^{C_{3'}}$, the single soft theorems can be interpreted as generating extended theory amplitudes, similar to the $\text{NLSM}^{(2)}$. For the $\text{NLSM}^{d_2}$ case, as seen in Eq. (\ref{eq:sttd2}), this fact is expected as the theory is known to have a double copy construction in terms of $\text{NLSM}^{(2)}$, but the emergence of $C_{3'} + \phi^3$ in Eq. (\ref{eq:sstc3p}) can only be understood from the perspective of the Ward identity. This may give us a handle to explore the possible double copy structure or CHY representation of $\text{NLSM}^{C_{3'}}$. Finally, we computed the general double soft theorem to the subleading order of the soft expansion, which is valid to all orders in the EFT expansion. As shown in Eq. (\ref{eq:ds}), the only higher order corrections compared to the known $\text{NLSM}^{(2)}$ results enter in the subleading soft order, and only $\mathcal{O} (p^4)$ operators give non-vanishing contributions. Similar situations, where only a limited number of EFT operators modify soft theorems, are known in gauge theory and gravity \cite{Elvang:2016qvq}. It would be interesting to see how these patterns extend to higher orders in the soft expansion, as well as the multi-soft limits studied in Refs. \cite{Du:2016njc,Low:2018acv}. The investigation of the multi-soft limits has previously relied heavily on manipulating Feynman diagrams in the Cayley parameterization, which is only available for the adjoint ${\text{U}} (N)$ $\text{NLSM}$ \cite{Kampf:2013vha}. Although the resulting amplitudes in the trace basis are universal, it would still be beneficial to develop other techniques that are more physically intuitive. We have seen clearly that the higher derivative operators at $\mathcal{O} (p^4)$ generate amplitudes with properties similar to what we have seen in $\text{NLSM}^{(2)}$, but only for different specific choices of the Wilson coefficients. These include: \begin{itemize} \item A double copy construction and a CHY formula for $\text{NLSM}^{d_2}$. \item The same subleading single soft theorem in $\text{NLSM}^{C_{3'}}$ and $\text{NLSM}^{d_2}$ as in $\text{NLSM}^{(2)}$, with emergent extended theories. \item The double soft theorem of $\text{NLSM}^{(2)}$ does not change when we only add the WZW term. \item The double soft theorem, after flavor ordering and with two adjacent legs taken to be soft, is not modified by higher derivative operators if $C_3 = -3C_4$, $C_1 = C_2 = 0$. \item The KK relation is satisfied when $C_1 = C_2 = C_4 = C_- = 0$. \end{itemize} On the other hand, no combination of the Wilson coefficients generates amplitudes that satisfy BCJ relations or appear in the Z-theory. It is evident that the higher derivative amplitudes in NLSM exhibit a wide variety of behaviors, and is an ideal testing ground to study the origin of the numerous properties known in $\text{NLSM}^{(2)}$ as well as in gauge theory and gravity. It is also well-known that causality enforces positivity constraints on the Wilson coefficients of the chiral Lagrangian \cite{Pham:1985cr,Adams:2006sv}. This suggests a potential positive geometry which exists in the EFT expansion of NLSM that may be worth investigating as well, using the approach recently developed in \cite{Arkani-Hamed:2020blm}, including for the closely related Z-theory \cite{Huang:2020nqy}. As for the WZW term, which is not featured prominently in this work, although it does not modify the double soft theorem of $\text{NLSM}^{(2)}$ at all, it definitely will contribute to the subleading single soft theorem. Calculating its contribution using the Ward identity would be straightforward, but the result is more useful if we have a closed-form expression of the WZW operator at the beginning. For applications to phenomenological models such as the chiral perturbation theory or the composite Higgs models, more features need to be added to the idealized NLSM, including explicit symmetry breaking which gives the pseudo NGB's masses, as well as interactions with fermions and vector bosons. As long as the explicit symmetry breaking is soft, the Ward identity, which is our main tool for deriving the soft theorems, will still hold at the leading order. It is certainly desirable to have purely on-shell techniques such as the CHY formalism generalized to these realistic cases as well. Further investigations in this direction are left for future work. Lastly, there is the question of loop corrections. Generically, these can modify the soft theorems, whether at integrand or integrated level \cite{Bern:2014oka,He:2014bga,Bianchi:2014gla}, and it would be interesting to also explore these issues in the context of the NLSM. \begin{acknowledgments} The authors would like to thank Ian Low for collaborations at the early stage of this project, as well as on other closely related projects. The authors also thank Mattias Sj\"{o} for providing expressions for high-point NLSM amplitudes, and John Joseph M. Carrasco for enlightening discussions. ZY would like to thank Henrik Johansson and Jaroslav Trnka for useful discussions. ZY is supported in part by the Knut and Alice Wallenberg Foundation under grants KAW 2018.0116 and KAW 2018.0162. LR is supported by Taiwan Ministry of Science and Technology Grant No. 109-2811-M-002-523. \end{acknowledgments} \begin{appendix} \section{Derivation details} \label{app:der} \subsection{Pair basis of the extended theory $\text{NLSM} + \phi + \psi$} \label{app:rpse} In this section all the amplitudes discussed are for the theory of $\text{NLSM} + \phi + \psi$, so that the superscript for $M^{\text{NLSM} + \phi + \psi}$ is omitted. Consider the amplitude $M_{n} (1,2,3|4,5| \cdots |n-1,n || 1^\psi, 2^\phi, 4^\psi)$, which has the following coefficient in the flavor decomposition of the pair basis: \begin{eqnarray} T^{j_2}_{a_1 a_{3}} \left[ \prod_{l=2}^{(n-1)/2} \delta^{a_{2l} a_{2l+1}} \right]T^{{\tilde{j}}_2}_{{\tilde{a}}_1 {\tilde{a}}_{4}}.\label{eq:etff1} \end{eqnarray} Note that for the left ordering of such an amplitude, shuffling the positions of the traces still leaves the amplitude invariant--this include the three component trace $\{1, 2,3 \}$. The left and the right three component traces are separately invariant under cyclic permutations, but generate a minus sign when two indices are exchanged in one of the two traces. To express $M_{n} (1,2,3|4,5| \cdots |n-1,n || 1^\psi, 2^\phi, 4^\psi)$ as a sum of single-trace amplitudes, we decompose the full amplitude in the DDM basis, setting $4$ and $5$ as the two ends of the half-ladders: \begin{eqnarray} &&{\cal M}_n^{a_1 j_2 a_3 \cdots a_{n} ; {\tilde{a}}_1 {\tilde{a}}_{4} {\tilde{j}}_2 } (p_1, \cdots, p_n)\nonumber\\ &=& \sum_{\alpha \in S_{n-3}} T^{i_1}_{a_4 a_{\alpha (1)} } \left( \prod_{m=1}^{(n-5)/2} T^{i_{2m}}_{ a_{ \alpha (2m)} b_{2m-1}} T^{i_{2m+1}}_{b_{2m} a_{\alpha (2m+1)} } \right) T^{i_{n-3}}_{ a_{\alpha (n-3)} a_{5}}\nonumber\\ &&\times \left[ \left( \prod_{ m=1 }^{(n-3)/2} \delta^{i_{2m-1} i_{2m}} \right) \sum_{l=1}^{(n-5)/2} \left( \prod_{\substack{m=1 \\ m \ne l}}^{(n-5)/2} \delta^{b_{2m-1} b_{2m}} \right) T^{j_2}_{b_{2l-1} b_{2l}} \right. \nonumber\\ &&\left. + \left( \prod_{ m=1 }^{(n-5)/2} \delta^{b_{2m-1} b_{2m}} \right) \sum_{l=1}^{(n-3)/2} \left( \prod_{\substack{m=1 \\ m \ne l}}^{(n-3)/2} \delta^{i_{2m-1} i_{2m}} \right) i f^{i_{2l-1} j_2 i_{2l}} \right]\nonumber\\ &&\times T^{{\tilde{j}}_2}_{{\tilde{a}}_1 {\tilde{a}}_{4}} M_n (4,\alpha, 5 ||1^\psi,2^\phi,4^\psi),\label{eq:etddm} \end{eqnarray} where $\alpha$ is a permutation of $\{1,2, \cdots, n\} \setminus \{4,5 \}$. As demonstrated in above equation, there are two kinds of flavor factors for the left group ${\text{SO}} (N)$, corresponding to the graphs in Figs. \ref{fig:etf1} and \ref{fig:etf2}, respectively. It turns out that the first kind cannot contribute to Eq. (\ref{eq:etff1}), because it cannot generate $\delta^{a_4 a_{5}}$. For the second kind, we need to work out what happens in the dotted box in Fig. \ref{fig:etf2}: we have \begin{eqnarray} T^j_{ab} \ if^{jik} T^k_{cd} = T^j_{ab} [T^j, T^i]_{cd} = \frac{1}{2} \left( \delta^{ad} T^i_{bc} + \delta^{bc} T^i_{ad} - \delta^{bd} T^i_{ac} - \delta^{ac} T^i_{bd} \right),\label{eq:comr2} \end{eqnarray} which is demonstrated in Fig. \ref{fig:comr2}. \begin{figure}[t] \centering \includegraphics[width=\textwidth]{etf1} \caption{\label{fig:etf1} The first kind of flavor factor in Eq. (\ref{eq:etddm}), which does not generate $\delta^{a_4 a_{5}}$. As explained in Fig. (\ref{fig:comrel}), each of the dotted circles can contain either an ``$=$'' or a ``$\times$''.} \end{figure} \begin{figure}[t] \centering \includegraphics[width=0.9\textwidth]{etf2} \caption{\label{fig:etf2} The second kind of flavor factor in Eq. (\ref{eq:etddm}), where the structure inside the dotted box is given by Fig. \ref{fig:comr2}.} \end{figure} \begin{figure}[t] \centering \begin{eqnarray} &&\begin{minipage}[c]{0.33\textwidth} \begin{center} \includegraphics[height=2.7cm]{comrel2} \end{center} \end{minipage} \nonumber\\ &=& \frac{1}{2} \left( \quad \begin{minipage}[c]{0.33\textwidth} \begin{center} \includegraphics[height=3cm]{comrel21} \end{center} \end{minipage} \quad+ \qquad \begin{minipage}[c]{0.33\textwidth} \begin{center} \includegraphics[height=3cm]{comrel22} \end{center} \end{minipage}\right.\nonumber\\ &&\left. - \begin{minipage}[c]{0.33\textwidth} \begin{center} \includegraphics[height=3cm]{comrel24} \end{center} \end{minipage}\qquad - \begin{minipage}[c]{0.33\textwidth} \begin{center} \includegraphics[height=3cm]{comrel23} \end{center} \end{minipage}\qquad \right) \nonumber \end{eqnarray} \caption{\label{fig:comr2} Graphical representation of Eq. (\ref{eq:comr2}). Only the first term on the RHS generates $\delta^{ad}$.} \end{figure} Therefore, the contribution to Eq. (\ref{eq:etff1}) is a sum of all single-trace amplitudes where in the left ordering, $4$ and $5$ are fixed at two ends, all other pairs $\ \{6,7\}, \ \cdots , \ \{n-1, n\}$ are adjacent, while $1$ and $3$ sandwich $2$. The only complication is that there is an extra minus sign for terms with $\{3, 2, 1\}$ instead of $\{1, 2, 3\}$. We have \begin{eqnarray} M_{n} (1,2,3|4,5| \cdots|n-1,n || 1^\psi, 2^\phi, 4^\psi) = \frac{1}{2^{(n-3)/2}} \sum_{\alpha \in {\text{Ar}}'_{n-2}} {\text{sgn}} (\alpha) M_n (4, \alpha, 5||1, 2, 4),\label{eq:cr1} \end{eqnarray} where ${\text{Ar}}'_{n-2}$ is for any permutation of $\{ 1, 2, \cdots, n\} \setminus \{4, 5 \}$ where all pairs $\{6,7\}, \ \cdots , \ \{n-1, n\}$ are adjacent and also contains the sequence $\{1,2,3\}$ or $\{3,2,1\}$. The signature of $\alpha$ is defined as \begin{eqnarray} {\text{sgn}} (\cdots, 1,2,3, \cdots ) =1,\qquad {\text{sgn}} (\cdots, 3,2,1, \cdots )= -1. \end{eqnarray} Now, as the left ordering in the RHS of Eq. (\ref{eq:cr1}) is a single trace with $n$ labels, a reversal of the left ordering will give a factor $(-1)^n = -1$. Then it is very easy to see that Eq. (\ref{eq:cr1}) is equivalent to \begin{eqnarray} M_{n} (1,2,3|4,5| \cdots|n-1,n || 1^\psi, 2^\phi, 4^\psi) = -\frac{1}{2^{(n-3)/2}} \sum_{\alpha \in {\text{Ar}}_{n-3} } M_n (1,\alpha,3, 2 ||1^\psi, 2^\phi, 4^\psi). \end{eqnarray} Similarly, we have \begin{eqnarray} M_{n} (1,2,3|4,5| \cdots|n-1,n || 1^\psi, 2^\phi,3^\psi) = -\frac{1}{2^{(n-3)/2}} \sum_{\alpha \in {\text{Ar}}_{n-3} } M_n (1,\alpha,3, 2 ||1^\psi,2^\phi, 3^\psi). \end{eqnarray} For example, \begin{eqnarray} M_{5} (123|45|67 || 1^\psi 2^\phi i^\psi) &=& -\frac{1}{4} \left[ M_5 (1456732 ||12i) + M_5 (1546732 ||12i) \right.\nonumber\\ &&+M_5 (1457632 ||12i) + M_5 (1547632 ||12i)\nonumber\\ &&+M_5 (1674532 ||12i) + M_5 (1764532 ||12i)\nonumber\\ &&\left.+M_5 (1675432 ||12i) + M_5 (1765432 ||12i)\right], \end{eqnarray} where we have omitted the labels $\phi$ and $\psi$ on the RHS, and $i \ne 1 $ or $2$. \subsection{Useful relations involving the NGB field operators} \label{app:eom} Here we briefly prove relations used in this work that involve the NGB field operator $\pi$. The building blocks of the NLSM Lagrangian, $d_\mu$ and $E_\mu$, come from the Maurer-Cartan 1-form \begin{eqnarray} -i \xi^\dagger \partial_\mu \xi = d_\mu^a \textsf{X}^a + E_\mu^i \textsf{T}^i = d_\mu + E_\mu, \end{eqnarray} where \begin{eqnarray} \xi (\pi) = e^{i \Pi},\qquad \Pi \equiv \frac{\pi^a \textsf{X}^a}{f}. \end{eqnarray} The Lie algebra of a symmetric coset, given by Eq. (\ref{eq:crg}), leads to an automorphism $\text{Aut}$ under which the broken generators change sign, namely \begin{eqnarray} \text{Aut} (\textsf{X}^a) = -\textsf{X}^a.\label{eq:aut} \end{eqnarray} As $\text{Aut} (\xi) = \xi^\dagger$, we have \begin{eqnarray} d_\mu &=& \frac{1}{2}[-i \xi^\dagger \partial_\mu \xi + i \text{Aut}(\xi^\dagger \partial_\mu \xi)] =-\frac{i}{2} [\xi^\dagger \partial_\mu \xi -\xi \partial_\mu \xi^\dagger ],\label{eq:gdefd}\\ E_\mu &=&-\frac{i}{2} [\xi^\dagger \partial_\mu \xi + \xi \partial_\mu \xi^\dagger ],\label{eq:gdefe} \end{eqnarray} while the covariant derivative is given by $\nabla_{\mu} d_{\nu} = \partial_\mu d_\nu + i[E_\mu, d_\nu]$, thus \begin{eqnarray} \nabla_{[\mu} d_{\nu] } &=& 0 \label{eq:covd0} \end{eqnarray} and \begin{eqnarray} \nabla_\mu d^\mu = -\frac{i}{2} \left[ \partial_\mu \left( \xi^\dagger \partial^\mu U \xi^\dagger \right) + \partial_\mu \xi^\dagger U \partial^\mu \xi^\dagger - \partial_\mu \xi U^\dagger \partial^\mu \xi \right]. \end{eqnarray} Now let us work out the EoM of the NLSM \cite{Panico:2015jxa}. From the completely fixed form of ${\mathcal{L}}^{(2)}$ given in Eq. (\ref{eq:nlsml4}), we calculate the EoM as \begin{eqnarray} D_\text{EoM}^{a,(2)} = \frac{\delta {\mathcal{L}}^{(2)}}{\delta \pi^a} - \partial_\nu \frac{\delta {\mathcal{L}}^{(2)}}{\delta \partial_\nu \pi^a} = \mathcal{O} (\partial^4).\label{eq:l2eom} \end{eqnarray} An important observation is \begin{eqnarray} \partial_\mu F(\Pi) = \frac{\delta F(\Pi) }{\delta \pi^a} \partial_\mu \pi^a,\label{eq:varf1} \end{eqnarray} where $F(\Pi)$ can be any function of $\Pi$. The above implies \begin{eqnarray} \frac{\delta \partial_\mu F(\Pi)}{\delta \partial_\nu \pi^a} = \delta^\nu_{\mu} \frac{\delta F(\Pi) }{\delta \pi^a}.\label{eq:varf2} \end{eqnarray} Combining Eqs. (\ref{eq:l2eom}), (\ref{eq:varf1}) and (\ref{eq:varf2}), one can show that \begin{eqnarray} \mathrm{tr} \left( \frac{ \delta d_\nu}{ \delta \partial_\nu \pi^a} \nabla_\mu d^\mu \right) = \frac{1}{f^2} D_\text{EoM}^{a,(2)} = \mathcal{O} (\partial^4). \end{eqnarray} The explicit form of $d_\mu$, given by Eq. (\ref{eq:dexpo}), tells us that \begin{eqnarray} \mathrm{tr} \left( \frac{ \delta d_\nu}{ \delta \partial_\nu \pi^a} \nabla_\mu d^\mu \right) = \frac{1}{f} [ F_1 ({\mathcal{T}}) ]_{ a b} (\nabla_\mu d^\mu)^b. \end{eqnarray} We know that $F_1({\mathcal{T}})$ is invertible, thus \begin{eqnarray} (\nabla_\mu d^\mu)^a = f \left\{ [ F_1({\mathcal{T}}) ]^{-1} \right\}_{ab} \mathrm{tr} \left\{ \frac{ \delta d_\nu}{ \delta \partial_\nu \pi^b} \nabla_\mu d^\mu \right\} = \mathcal{O} (\partial^4).\label{eq:eom} \end{eqnarray} \subsection{Preparing the current for the theory $C_{3'}+\phi^3$} \label{app:c3pfc} The current associated with the coefficient $C_{3'}$, as we originally derive it in Eq. (\ref{eq:c3pc}), is \begin{eqnarray} \left(\mathcal{J}^{(4),3'}\right)_\mu^a = \frac{if}{4\Lambda^2} \mathrm{tr} \left( \left\{ \textsf{X}^a, U \right\} \partial_\nu U^\dagger \partial_\mu U \partial^\nu U^\dagger \right) = \frac{4f}{\Lambda^2 } \mathrm{tr} \left( \textsf{X}^a \partial_\nu \Pi \partial_\mu \Pi \partial^\nu \Pi \right) + \cdots. \end{eqnarray} We need to rewrite the above so that the resulting vertices of the extended theory $C_{3'}+\phi^3$ satisfy the correct symmetry condition of Eq. (\ref{eq:c3pcst}). As we see from the above, the current is neatly written in terms of $U$. We will need to use the EoM given in Eq. (\ref{eq:eom}), so it would be convenient to rewrite it using $U$ as well: one can show that \begin{eqnarray} \frac{i}{2} \partial_\mu \left(\partial^\mu U^\dagger U \right) = -\frac{i}{2} \partial_\mu \left( U^\dagger \partial^\mu U \right) = \xi^\dagger \nabla_\mu d^\mu \xi = \mathcal{O} (\partial^4).\label{eq:eomu1} \end{eqnarray} The existence of the automorphism given by Eq. (\ref{eq:aut}) implies that \begin{eqnarray} \frac{i}{2} \partial_\mu \left(\partial^\mu U U^\dagger \right) = -\frac{i}{2} \partial_\mu \left( U \partial^\mu U^\dagger \right) = \mathcal{O} (\partial^4)\label{eq:eomu2} \end{eqnarray} as well. For the rest of this section, whenever we rewrite the current, we freely drop any terms involving the form of the EoM as in Eqs. (\ref{eq:eomu1}) and (\ref{eq:eomu2}), as well as any terms that are total derivatives, because the former lead to terms of higher orders in the derivative expansion, while the latter only contribute $\mathcal{O} (\tau^2)$ effects in the soft expansion. Let us take the inspiration from the 3-pt vertex. The manipulation on the current corresponding to Eq. (\ref{eq:c3p3om}) is \begin{eqnarray} \mathrm{tr} \left( \textsf{X}^a \partial_\nu \Pi \partial_\mu \Pi \partial^\nu \Pi \right) &=&- \mathrm{tr} \left( \textsf{X}^a \partial_\nu \Pi \partial_\mu \Pi \partial^\nu \Pi + \textsf{X}^a \Pi \partial_\mu \partial_\nu \Pi \partial^\nu \Pi \right.\nonumber\\ && \left. +\textsf{X}^a \partial_\nu \Pi \partial_\mu \partial^\nu \Pi \Pi + \textsf{X}^a \Pi \partial_\mu \Pi \DAl \Pi + \textsf{X}^a \DAl \Pi \partial_\mu \Pi \Pi \right), \ \ \end{eqnarray} where the terms with $\DAl \Pi$ can be converted to higher-pt vertices using the EoM. Similarly, we can use the following relations: \begin{eqnarray} U \partial_\nu U^\dagger \partial_\mu U \partial^\nu U^\dagger = \partial_\nu U \partial_\mu U^\dagger U \partial^\nu U^\dagger &=& - U \partial_\mu \partial_\nu U^\dagger U \partial^\nu U^\dagger,\\ \partial_\mu \partial_\nu U^\dagger U \partial^\nu U^\dagger &=& 0,\\ U\partial_\nu U^\dagger \partial_\mu U \partial^\nu U^\dagger + U\partial_\nu U^\dagger \partial_\mu \partial^\nu U U^\dagger &=& 0, \end{eqnarray} to rewrite the current as \begin{eqnarray} \left(\mathcal{J}^{(4),3'}\right)_\mu^a &=& -\frac{if}{4\Lambda^2} \mathrm{tr} \left\{ \textsf{X}^a \left[ (U-1) \partial_\mu \partial_\nu U^\dagger U \partial^\nu U^\dagger +U\partial_\nu U^\dagger \partial_\mu U \partial^\nu U^\dagger \right.\right.\nonumber\\ &&\left.\left.+ U\partial_\nu U^\dagger \partial_\mu \partial^\nu U (U^\dagger -1) \right] - U \leftrightarrow U^\dagger \right\}\nonumber\\ &=& -\frac{f}{\Lambda^2} \sum_{l_1 = 0}^{2n-2} \sum_{l_2=1}^{2n-1-l_1} \sum_{l_3=1}^{2n-l_1 - l_2} \frac{(-4)^n (-1)^{l_1 + l_3}}{l_1! l_2 ! l_3 ! (2n+1 - l_1 - l_2 - l_3)! }\nonumber\\ &&\times \mathrm{tr} \left[ \Pi^{l_3} \partial_\mu \partial_\nu \Pi^{l_2} \Pi^{l_1} \partial^\nu \Pi^{2n+1 - l_1 - l_2 - l_3} \right.\nonumber\\ && \left.+ \Pi^{l_1} \partial_\nu \Pi^{l_2} \partial^\nu \left( \partial_\mu \Pi^{l_3} \Pi^{2n+1 - l_1 - l_2 - l_3} \right) \right],\label{eq:c3pcr} \end{eqnarray} which generates the vertices given by Eq. (\ref{eq:v3pm}). \section{Examples in the single soft theorems} \label{app:lpv} Here we give low-pt examples of various quantities appearing in the single soft theorems. \subsection{The NLSM} \label{app:nlv} The flavor-ordered 4-pt vertices of NLSM in the general trace basis, up to $\mathcal{O} (p^4)$: \begin{eqnarray} V (1,2,3,4) &=& V^{(2)} (1,2,3,4) +\frac{2}{f^2 \Lambda^2} \left[ 2 C_{3' } p_1 \cdot p_3\ p_2 \cdot p_4 \right.\nonumber\\ &&\left. + C_{4'} \left(p_1 \cdot p_2\ p_3 \cdot p_4 + p_1 \cdot p_4 \ p_2 \cdot p_3 \right) \right] + \mathcal{O} \left(\frac{1}{\Lambda^4} \right),\\ V (1,2|3,4) &=& \frac{4}{f^2 \Lambda^2} \left[ 2C_1 p_1 \cdot p_2 \ p_3 \cdot p_4 \right.\nonumber\\ &&\left.+ C_2 ( p_1 \cdot p_3 \ p_2 \cdot p_4+ p_1 \cdot p_4 \ p_2 \cdot p_3 ) \right] + \mathcal{O} \left(\frac{1}{\Lambda^4} \right), \end{eqnarray} with the $\mathcal{O} (p^2)$ vertex given by \begin{eqnarray} V^{(2)} (1,2,3,4) = \frac{1}{f^2} \left[ s_{12} + s_{23} - \frac{2}{3} \left(p_1^2 + p_2^2 + p_3^2 + p_4^2\right) \right]. \end{eqnarray} The 4-pt vertex in the pair basis for $\text{NLSM}^{(2)}$: \begin{eqnarray} V^{(2)} (1,2|3,4) = \frac{1}{6f^2} \left[2 p_1 \cdot p_2 + 2 p_3 \cdot p_4 + (p_1 + p_2)^2\right]. \end{eqnarray} The 4-pt amplitudes in the trace basis up to $\mathcal{O} (p^4)$, with $p_4$ as the soft momentum, are \begin{eqnarray} M_4(1,2,3,4) &=& -\frac{\tau}{f^2} s_{24} + \mathcal{O} (\tau^2) = \frac{\tau}{\lambda f^2} s_{24} M^{\text{NLSM} + \phi^3}_3 (1,2,3||1,3,2) + \mathcal{O} (\tau^2),\label{eq:nlsmst4}\\ M_4(1,2|3,4) &=& \mathcal{O} (\tau^2), \end{eqnarray} with \begin{eqnarray} M^{\text{NLSM} + \phi^3}_3 (1,2,3||1,3,2) = -\lambda, \end{eqnarray} given by the cubic vertex in Eq. (\ref{eq:etp3}). The 4-pt amplitude in the pair basis for $\text{NLSM}^{(2)}$, with $p_4$ as the soft momentum: \begin{eqnarray} &&M_4^{(2)} (1,2|3,4) = \frac{\tau}{2f^2} s_{34} + \mathcal{O} (\tau^2) \nonumber\\ &=& -\frac{\tau}{2\lambda f^2} \left[ s_{14} M^{\text{NLSM} + \phi^3}_3 (3,2,1||3^\psi,2^\phi,1^\psi) + s_{24} M^{\text{NLSM} + \phi^3}_3 (3,1,2||3^\psi,1^\phi,2^\psi) \right] + \mathcal{O} (\tau^2).\nonumber\\ \end{eqnarray} The 6-pt amplitude in the pair basis for $\text{NLSM}^{(2)}$, with $p_6$ as the soft momentum: \begin{eqnarray} M_6^{(2)} (61|23|45) &=&- \frac{1}{4} \left[s_{23} s_{16} \left( \frac{1}{P^2_{235}} + \frac{1}{P^2_{234}}\right) + s_{23} s_{45} \left( \frac{1}{P^2_{236}} + \frac{1}{P^2_{123}}\right)\right.\nonumber\\ &&\left. + s_{45} s_{16} \left( \frac{1}{P^2_{245}} + \frac{1}{P^2_{345}}\right) -s_{23} - s_{45} - s_{16} \right]\nonumber\\ &=&-\frac{\tau}{2\lambda f^2 } \left\{ s_{26} \left[ M_5 (132|45||1 3 2) +M_5 (145|23||1 4 2) + M_5 (154|23||1 5 2) \right]\right.\nonumber\\ &&+ s_{36} \left[ M_5 (123|45||1 2 3) +M_5 (145|23||1 4 3) + M_5 (154|23||1 5 3) \right]\nonumber\\ &&+s_{46} \left[ M_5 (123|45||1 2 4) +M_5 (132|45||1 3 4) + M_5 (154|23||1 5 4) \right]\nonumber\\ &&\left.+ s_{56} \left[ M_5 (123|45||1 2 5) +M_5 (132|45||1 3 5) + M_5 (145|23||1 4 5) \right] \right\}\nonumber\\ &&+ \mathcal{O} (\tau^2),\label{eq:6ptst} \end{eqnarray} where $P_{ijk} \equiv p_i +p_j + p_k$, and we have omitted the superscript $\text{NLSM} + \phi + \psi$ as well as particle labels for the bi-index scalars in the 5-pt amplitudes, whose second state in the right ordering should be understood as $\phi$, while the other two are $\psi$. The 6-pt amplitude of $\text{NLSM}^{d_2}$: \begin{eqnarray} M^{(4),d_2}_6 (6,1|2,3,4,5) &=& \frac{1}{\Lambda^2f^4} \left[ s_{35} \left(\frac{s_{26} s_{12}}{P^2_{126}} + \frac{s_{46} s_{14}}{P^2_{146}} \right) + s_{24} \left(\frac{s_{36} s_{13}}{P^2_{136}} + \frac{s_{56} s_{15}}{P^2_{156}} \right) \right.\nonumber\\ &&\left.\phantom{\frac{ s_{12}}{P^2_{126}}}- \left(s_{46} + s_{26}) (s_{14} + s_{12}\right) + s_{16} s_{24} \right] , \end{eqnarray} which is clearly $\mathcal{O} (\tau^2)$ when state $1$ or $6$ is taken to be soft. On the other hand, taking $p_5$ to be soft, \begin{eqnarray} &&M^{(4),d_2}_6 (6,1|2,3,4,5) \nonumber\\ &=& \frac{\tau}{\Lambda^2f^4} \left[s_{35} \left(\frac{ s_{12} s_{26}}{s_{34}} +\frac{ s_{13} s_{36}}{s_{24}}+ \frac{ s_{14} s_{46}}{ s_{23}} + s_{16} \right) + s_{15} \left( \frac{ s_{13} s_{36}}{ s_{24}} - s_{36}\right) \right.\nonumber\\ &&\left.+ s_{56} \left( \frac{ s_{13} s_{36}}{ s_{24}} - s_{13}\right) \right] + \mathcal{O} (\tau^2)\nonumber\\ &=& \frac{\tau}{\lambda f^2} \left[ s_{56}M^{d_2 + \phi^3}_5 (6,1|2,3,4||2,4,6) + s_{15}M^{d_2 + \phi^3}_5 (6,1|2,3,4||2,4,1) \right.\nonumber\\ &&\left. + s_{35}M^{d_2 + \phi^3}_5 (6,1|2,3,4||2,4,3) \right] + \mathcal{O} (\tau^2).\label{eq:ed46ps} \end{eqnarray} The 6-pt amplitude of $\text{NLSM}^{C_3'}$: \begin{eqnarray} M_6^{(4),3'} (1,2,3,4,5,6) &=& \frac{1}{\Lambda^2f^4} \left[\frac{s_{13} s_{46}(s_{13} + s_{46})}{P^2_{123}} + \frac{s_{24} s_{15}(s_{24} + s_{15}) }{P^2_{234}}+ \frac{s_{35} s_{26} ( s_{35} + s_{26} ) }{P^2_{345}} \right. \nonumber\\ &&\left.\phantom{\frac{(s_{13} )}{P^2_{123}}}- \left( P^2_{135} \right)^2 - s_{13} s_{46} - s_{24} s_{15} - s_{35} s_{26} \right], \end{eqnarray} so that when we take the soft limit of external state $6$, \begin{eqnarray} &&M_6^{(4),3'} (1,2,3,4,5,6)\nonumber\\ &=& \frac{\tau}{\Lambda^2f^4}\left[ s_{26} \left( \frac{s_{35}^2}{s_{12}} + \frac{s_{24}^2}{s_{15}} - s_{24} - s_{35} \right) + s_{36} \left( \frac{s_{24}^2}{s_{15}} + s_{24} \right)\right.\nonumber\\ &&\left. +s_{46} \left( \frac{s_{13}^2}{s_{45}} + \frac{s_{24}^2}{s_{15}} - s_{24} - s_{13} \right)\right] + \mathcal{O} (\tau^2)\nonumber\\ &=& \frac{\tau}{\lambda f^2}\left[ s_{26} M^{C_{3'} + \phi^3}_5 (1,2,3,4,5||1,5,2) + s_{36} M^{C_{3'} + \phi^3}_5 (1,2,3,4,5||1,5,3) \right.\nonumber\\ &&\left. +s_{46} M^{C_{3'} + \phi^3}_5 (1,2,3,4,5||1,5,4) \right] + \mathcal{O} (\tau^2).\label{eq:c3pst6p} \end{eqnarray} \subsection{The current} \label{app:p4cv} Below we present the vertices ${\cal V}$ generated by the current. 3-pt vertices: \begin{eqnarray} {\cal V}^{(4),1}_3 (1,2|3) &=& \frac{8}{f^2 \Lambda^2} q\cdot p_3 \ p_1 \cdot p_2, \label{eq:tso1}\\ {\cal V}^{(4),2}_3 (1,2|3) &= & \frac{4}{f^2 \Lambda^2} \left( q\cdot p_2 \ p_1 \cdot p_3+ q \cdot p_1 \ p_2 \cdot p_3 \right),\\ {\cal V}^{(4),3'}_3 (1,2,3) &=& \frac{4}{f^2 \Lambda^2} q \cdot p_2 \ p_1 \cdot p_3,\\ {\cal V}^{(4),4'}_3 (1,2,3) &=& \frac{2}{f^2 \Lambda^2} (q \cdot p_1 \ p_2 \cdot p_3 + q \cdot p_3 \ p_1 \cdot p_2). \end{eqnarray} 5-pt vertices: \begin{eqnarray} {\cal V}^{(4),1}_5 (1,2,3,4|5) &=& \frac{8}{3f^4 \Lambda^2}q \cdot p_5 \left[ p_1\cdot (p_2 - p_3) + p_2\cdot (p_3 - p_4) \right.\nonumber\\ &&\left.+ p_3\cdot (p_4 - p_1) + p_4\cdot (p_1 - p_2) \right],\\ {\cal V}^{(4),2}_5 (1,2,3,4|5) &=& \frac{4}{3f^4 \Lambda^2} \left[q \cdot p_1 \ p_5 \cdot (p_2 -2 p_3 + p_4) + q \cdot p_2 \ p_5 \cdot (p_3 -2 p_4 + p_1)\right.\nonumber\\ && \left.+q \cdot p_3 \ p_5 \cdot (p_4 -2 p_1 + p_2) + q \cdot p_4 \ p_5 \cdot (p_1 -2 p_2 + p_3)\right],\\ {\cal V}^{(4),1}_5 (1,2|3,4,5) &=& -\frac{16}{3f^4 \Lambda^2} q \cdot (p_3 -2 p_4 + p_5) \ p_1 \cdot p_2,\\ {\cal V}^{(4),2}_5 (1,2|3,4,5) &=& -\frac{8}{3f^4 \Lambda^2} \left[q \cdot p_1 \ p_2 \cdot (p_3 -2 p_4 + p_5) + q \cdot p_2 \ p_1 \cdot (p_3 -2 p_4 + p_5)\right],\\ {\cal V}^{(4),3'}_5 (1,2,3,4,5) &=& \frac{4 }{3 f^4 \Lambda^2 } \left[ q\cdot p_2 \ p_1 \cdot (-2 p_3 + p_4 - p_5) + q\cdot p_4 \ p_5 \cdot (-p_1 + p_2 - 2 p_3 ) \right.\nonumber\\ &&\left. +q\cdot p_3 \ (p_1 \cdot p_5 + 3 p_2 \cdot p_4) \right],\\ {\cal V}^{(4),4'}_5 (1,2,3,4,5) &=&\frac{2 }{3 f^4 \Lambda^2 } \left\{ q\cdot p_1 \left[ p_2 \cdot (p_4 - 2p_3 ) + p_5 \cdot (p_1+ 2 p_3 ) \right]\ +q \cdot p_2 \ p_4 \cdot (3p_3 + p_5) \right.\nonumber\\ &&-2 q\cdot p_3 \ (p_1 \cdot p_2 + p_4 \cdot p_5) + q\cdot p_4 \ p_2 \cdot (p_1 + 3 p_3) \nonumber\\ &&\left. + q\cdot p_5 \left[p_1 \cdot (2p_3 + p_5 ) +p_4 \cdot (p_2 - 2 p_3) \right] \right\}. \end{eqnarray} \subsection{The extended theories} \label{app:eet} The 5-pt amplitudes of $\text{NLSM} + \phi + \pi$ in the pair basis: \begin{eqnarray} M_5(1,2,3|4,5||1^\psi ,2^\phi ,3^\psi) &=& -\frac{\lambda}{2 f^2} s_{45} \left( \frac{1}{s_{12}} + \frac{1}{s_{23}} \right),\\ M_5(1,2,3|4,5||1^\psi ,2^\phi ,4^\psi) &=& -\frac{\lambda}{2 f^2} \left( \frac{s_{45}}{s_{12}} - \frac{s_{25}}{s_{14}} \right), \end{eqnarray} which match Eq. (\ref{eq:6ptst}). For the extended theory $d_2 + \phi^3$, as ${\cal V}^{(4),d_2} (j | \alpha)$ does not contribute $\mathcal{O} (\tau)$ terms in the soft theorem, there are no 3-pt vertices at $\mathcal{O} (1/\Lambda^2)$, though there is of course the $\mathcal{O} (1/\Lambda^0)$ vertex of the $\phi^3$ theory given by Eq. (\ref{eq:etp3}). Similarly, all the higher-pt vertices at $\mathcal{O} (1/\Lambda^0) $ are the same as in $\text{NLSM} + \phi^3$. The 5-pt vertices at $\mathcal{O} (1/\Lambda^2)$ are given by \begin{eqnarray} V^{d_2 + \phi^3}_{5} (1,2 | 3,4,5 ||3,5,1) &=& -\frac{2\lambda }{3\Lambda^2 f^2} p_2 \cdot \left( p_2 + 3 p_4 \right) ,\\ V^{d_2 + \phi^3}_{5} (1,2 | 3,4,5 ||3,5,4) &=& \frac{2\lambda }{\Lambda^2 f^2} p_1 \cdot p_2. \end{eqnarray} One can then calculate the amplitudes of the extended theory to be \begin{eqnarray} M^{d_2 + \phi^3}_{5} (1,2 | 3,4,5 ||3,5,1) &=& \frac{\lambda }{\Lambda^2 f^2} \left[\frac{s_{14} s_{24}}{s_{35}} - s_{24} \right],\\ M^{d_2 + \phi^3}_{5} (1,2 | 3,4,5 ||3,5,4) &=& \frac{\lambda }{\Lambda^2 f^2} \left[\frac{s_{13} s_{23}}{s_{45}} + \frac{s_{14} s_{24}}{s_{35}} + \frac{s_{15} s_{25}}{s_{34}} + s_{12} \right], \end{eqnarray} which matches Eq. (\ref{eq:ed46ps}). For $C_{3'} + \phi^3$, first we present the 3-pt and 5-pt vertices ${\cal V}^{(4),3'}$ after we rewrite the current $\mathcal{J}^{(4),3'}$ as in Eq. (\ref{eq:c3pcr}): \begin{eqnarray} \hat{{\cal V}}^{C_{3'} + \phi^3}_3 (1,2,3) &=& -\frac{4}{\Lambda^2 f^2} q \cdot p_2 \left( p_1 \cdot p_2 + p_1 \cdot p_3 + p_2 \cdot p_3 \right),\\ \hat{{\cal V}}^{C_{5'} + \phi^3}_5 (1,2,3,4,5) &=& \frac{4}{3\Lambda^2 f^4} \left\{ q \cdot p_2 \left[ -p_1^2 + p_2 \cdot \left(2 p_3 - p_4 + p_5 \right) + p_3 \cdot \left(3p_4 - p_5 \right) + 2p_4 \cdot p_5 \right]\ \right.\nonumber\\ &&+q\cdot p_3 \left( p_1^2 + p_1 \cdot p_5 + 3 p_2 \cdot p_4 + p_5^2 \right) \nonumber\\ &&\left.+ q\cdot p_4 \left[ 2 p_1 \cdot p_2 + p_3 \cdot \left( - p_1 +3 p_2 \right) + p_4 \cdot \left( p_1 - p_2 + 2 p_3 \right) - p_5^2 \right]\right\}. \end{eqnarray} The 5-pt vertices of $C_{3'} + \phi^3$ at $\mathcal{O} (1/\Lambda^2)$ are given by \begin{eqnarray} V^{C_{3'} + \phi^3}_{3} (1,2 , 3 ||1,3,2) &=& - \frac{2\lambda }{\Lambda^2 } \left( p_1 \cdot p_2 + p_1 \cdot p_3 + p_2 \cdot p_3 \right),\\ V^{C_{3'} + \phi^3}_{5} (1,2 , 3,4,5 ||1,5,2) &=& -\frac{2\lambda }{3\Lambda^2 f^2} \left[ p_2^2 + p_3^2 + p_4^2 + p_5^2 + 3\left( p_2 \cdot p_4 + p_3 \cdot p_5 \right) \right.\nonumber\\ &&\left. \phantom{p_2^2}+ p_2 \cdot p_5 - p_3 \cdot p_4 \right] ,\\ V^{C_{3'} + \phi^3}_{5} (1,2 , 3,4,5 ||1,5,3) &=& \frac{2\lambda }{3\Lambda^2 f^2} \left( p_1^2 + p_1 \cdot p_5 + 3 p_2 \cdot p_4 + p_5^2 \right) . \end{eqnarray} We see explicitly that $V^{C_{3'} + \phi^3}_{3} (1,2 , 3 ||1,3,2)$ and $V^{C_{3'} + \phi^3}_{5} (1,2 , 3,4,5 ||1,5,2)$ has the correct relabeling property of Eq. (\ref{eq:c3pcst}). Although we have a 3-pt vertex at $\mathcal{O} (1/\Lambda^2)$, the corresponding 3-pt amplitude still vanishes, so that it contributes nothing to the soft theorem in Eq. (\ref{eq:nlsmst4}). On the other hand, we can calculate the 5-pt amplitudes to be \begin{eqnarray} M^{C_{3'} + \phi^3}_{5} (1,2 , 3,4,5 ||1,5,2) &=& \frac{\lambda }{\Lambda^2 f^2} \left( \frac{s_{35}^2}{s_{12}} + \frac{s_{24}^2}{s_{15}} - s_{24} - s_{35} \right) ,\\ M^{C_{3'} + \phi^3}_{5} (1,2 , 3,4,5 ||1,5,3) &=& \frac{\lambda }{\Lambda^2 f^2} \left( \frac{s_{24}^2}{s_{15}} + s_{24} \right) , \end{eqnarray} which agrees with Eq. (\ref{eq:c3pst6p}). \end{appendix}
\section{Introduction} \label{sec:intro} The current paradigm of hierarchical structure formation has been in place for decades \citep{Rees1977,Silk1977,White1978,White1991}. The general mechanism by which galaxies form starts with random density fluctuations in dark matter that collapse over cosmic time into massive dark matter halos. Baryonic matter is similarly gravitationally attracted to dark matter halos, where it collects and eventually forms galaxies \citep[for a review, see][]{Benson2010}. The standard paradigm of galaxy formation supposes that gas falling onto a massive halo, $M_{\rm halo} \gtrsim {\rm few}\times10^{11} M_{\odot}$ \citep{Birnboim2003}, shock-heats to the virial temperature before later cooling at the halo center to form stars. More recent models \citep{Keres2005,Dekel2006,Dekel2009,Nelson2013} show that infalling gas need not shock-heat to high temperatures, but may instead be accreted to the central galaxy along filaments while remaining cold ($T \lesssim 10^{4-5}$ K). Modern simulations show that both hot halos and cold filaments can exist surrounding a galaxy simultaneously, but the presence of a hot, shock-heated gaseous halo is still expected surrounding massive galaxies, even if it is not the primary mode of gas accretion \citep{Bennett2020,Fielding2017,Stern2020a}. In order for gas to form stars at the center of halos, it must be cold (with $T \ll 10^4$ K). The standard paradigm assumes gas either cools radiatively before accreting onto the galaxy or flows onto the galaxy from the intergalactic medium (IGM) without being heated. However, the exact processes by which cold gas forms from, or interacts with, the expected hot halo are not fully understood. The conditions for the formation and survival of the cold gas are strongly dependent on the properties of the hot, diffuse, volume-filling phase of the circumgalactic medium (CGM). In models that attempt to describe hot gas observations or cool gas formation and survival within the hot halo, the hot gas is usually assumed to be static, in hydrostatic equilibrium near the virial temperature, $T_\mathrm{vir}$, of the halo \citep{Maller2004,Anderson2010,Miller2013,Faerman2017,Mathews2017,McQuinn2018,Qu2018,Stern2019,Voit2019a,Faerman2020}. `Idealized' simulations commonly adopt a hydrostatic hot halo at $T_\mathrm{vir}$ as part of their initial conditions \citep{Armillotta2017,Fielding2017,Li2020a}. Small, cold gas clouds may then condense from the hot medium, seeded by thermal instabilities \citep{McCourt2012,Voit2015}. Cold gas may also be seeded by galactic winds, where the hot flow can entrain, precipitate, or carry cold clumps into the CGM \citep{Thompson2016,Schneider2018,Lochhaas2018} to re-accrete later. If cold CGM gas is instead in the form of extended filamentary structures, these structures may pierce through the expected virial shock and hot halo \citep{Keres2005,Dekel2006,Keres2009,Dekel2009,Bennett2020}, interacting with the hot diffuse gas and creating hydrodynamical instabilities at the hot-cold interface \citep{Mandelker2016,Mandelker2020}. Alternatively, cold accreting gas may take the form of a cooling flow, where the hot halo undergoes bulk cooling as it is compressed on its journey to the central galaxy \citep{Mathews1978,Fabian1984,Malagoli1987,Li2012,Stern2019,Stern2020a}. Observations of the CGM typically find both hot and cold gas traced by high- and low-ionization state absorption observed in the UV and optical \citep{Wakker2009,Rudie2012,Werk2013,Stocke2013,Bordoloi2014,Lehner2015,Borthakur2016,Heckman2017,Keeney2017,Chen2018,Berg2018,Berg2019,Rudie2019,Chen2020,Lehner2020} or emission in the X-ray \citep{Anderson2010}. The densities and temperatures are derived from ionization modeling, where generally it is assumed that high-ion absorbers (\ion{O}{6} or \ion{O}{7}) trace a warmer, collisionally-ionized gas phase than low-ionization state absorbers (e.g., \ion{Mg}{2}, \ion{Si}{3}), which trace a cooler, photoionized gas phase \citep[e.g.,][]{Tumlinson2017}. Studies that find a significant mass of cold gas in the CGM of $L^*$ galaxies, $\sim10^{10}M_\odot$, have raised questions about how so much cold gas could be supported in the CGM \citep[e.g.,][]{Werk2014,Keeney2017}. Fitting small, thermal-pressure-supported cold clouds into the standard paradigm of a hydrostatic hot halo is difficult while also matching the cold and hot gas densities inferred from photoionized modeling \citep[but see \citeauthor{Haislmaier2021} \citeyear{Haislmaier2021}]{Werk2014,McQuinn2018}. All such modeling is laden with assumptions about the thermal balance of the CGM that could prove to be mistaken. At larger scales, galaxy cluster and intra-cluster medium (ICM) analytic, simulation, and observational studies have shown that the ICM is not in perfect hydrostatic equilibrium because non-thermal kinetic gas motions are crucial to the overall energy balance of the halo. Bulk non-thermal gas motions, such as turbulence, contribute a significant fraction of pressure support to the cluster gas \citep{Shi2015,Shi2018,Simionescu2019}. This fraction is significant enough to produce a ``hydrostatic mass bias", i.e. the cluster mass derived without including non-thermal pressure support differs from the ``true" cluster mass by $\sim15\%$ on average \citep{Lau2013,Shi2016}. At $\sim L^*$ galaxy halo scales, only recently have simulations begun to show that the standard picture of a hot gaseous halo in hydrostatic equilibrium may not be accurate. \citet{Lochhaas2020} showed that even in idealized $L^*$ CGM simulations initiated with hydrostatic hot halos, galactic feedback creates bulk flows that induce significant turbulence and rapidly drive the halo out of hydrostatic equilibrium. Instead, the halo evolves toward a dynamical equilibrium in which non-thermal turbulent and ram pressure combine with the usual thermal pressure to hold the CGM up against gravity. The simulations of \citet{Oppenheimer2018} also showed the importance non-thermal pressure support of the CGM. \citet{Salem2016}, \citet{Ji2020} and \citet{Butsky2020} found that cosmic rays are also an important non-thermal supporting pressure in the CGM of simulated galaxies. Clearly, the structure of the hot phase, which is so important to models of observed and simulated cold CGM gas at the galaxy halo scale, warrants further investigation beyond a simple assumption of hydrostatic equilibrium at $T_\mathrm{vir}$. In this paper, we apply a virial analysis to simulated galaxy halos from the Figuring Out Gas \& Galaxies In Enzo (FOGGIE) cosmological zoom-in simulations to quantify when and where $\sim L^*$ galaxy halos are in virial equilibrium. We find that dynamic gas motions drive the temperature of the diffuse hot halo below the classical $T_\mathrm{vir}$ by a factor of $\sim2$, even when the halo is in or close to virial equilibrium. We derive a ``modified" virial temperature, which adds explicit treatment of bulk gas motions to the classical definition of $T_\mathrm{vir}$. This modified virial temperature more accurately describes the temperature of gas in the outskirts of the $\sim L^\star$ FOGGIE galaxy halos. A cooler than expected ``hot" halo has significant implications on the thermal pressure and cooling rates of the gas as well as on inferences made from UV absorption line and X-ray emission CGM observations. Section~\ref{sec:derivation} provides the derivation of the modified virial temperature and explains how it differs from the standard virial temperature. Section~\ref{sec:FOGGIE} describes the FOGGIE simulations and the basic analysis we use throughout the paper. Section~\ref{sec:virial} presents how we assess the virial equilibrium of the FOGGIE halos (\S\ref{subsec:assessing}) and the results of this assessment (\S\ref{subsec:virial_results}). Section~\ref{sec:Tmod} describes how we calculate the modified virial temperature in the FOGGIE simulations (\S\ref{subsec:calc_Tmod}) and shows that the modified virial temperature accurately describes the simulated halo gas when the halo is in virial equilibrium (\S\ref{subsec:T_results}). Section~\ref{sec:xcorr} explores the impact of strong bursts of star formation feedback on the energy and temperature of the CGM. In Section~\ref{sec:implications}, we describe the implications of a lower temperature for the thermal pressure of the CGM (\S\ref{subsec:th_pres}), the CGM cooling time (\S\ref{subsec:tcool}), CGM mass estimates from X-ray observations (\S\ref{subsec:xray}), the origin of the \ion{O}{6} ion (\S\ref{subsec:OVI}), and the importance of turbulence to the CGM (\S\ref{subsec:turb}). We conclude in Section~\ref{sec:summary}. Appendix~\ref{sec:Rvir_def} shows our results do not depend on the precise definition of the virial radius or the virial theorem. \section{Deriving Virial Temperature} \label{sec:derivation} In the standard paradigm of galaxy formation, the gaseous halo bound to a galaxy is virialized within the potential well of the dark matter halo such that \begin{equation} \mathrm{PE} - \Sigma = -2\mathrm{KE}, \label{eq:virial} \end{equation} where PE is the potential energy of the galaxy and its dark matter halo, KE is the kinetic energy of the halo gas, and $\Sigma$ is a boundary pressure working with gravity to confine the halo gas from the outside. Gas falling into the halo is heated by passing through a virial shock at roughly the virial radius, so it is assumed that the kinetic energy of gas infall is completely thermalized into a thermal energy, $\mathrm{KE}_\mathrm{th}$, which is given by \begin{equation} \mathrm{KE}_\mathrm{th} = \frac{3}{2}\frac{k_B T}{\mu m_p}, \label{eq:TE} \end{equation} where $T$ is the temperature, $\mu=0.6$ is the molecular weight per particle for fully ionized gas of primarily primordial composition, $k_B$ is the Boltzmann constant and $m_p$ is the mass of the proton. Note that Equation~\ref{eq:TE} gives the specific thermal energy of the gas, which is the energy per unit gas mass. Through the virial equation (Eq.~\ref{eq:virial}), the (specific) potential energy of the gas is thus directly related to the temperature of the gas, and this temperature is defined as virial temperature $T_\mathrm{vir}$ \citep[e.g.,][]{Mo2010}: \begin{equation} T_\mathrm{vir}=\frac{1}{2}\frac{\mu m_p}{k_B}\frac{GM_{200}}{R_{200}}, \label{eq:Tvir} \end{equation} where $M_{200}$ and $R_{200}$ are the halo virial mass and radius, respectively, and $G$ is the gravitational constant. This definition of the virial temperature assumes the halo gas can be adequately described by a singular isothermal sphere density profile. In general, this may not be applicable for real galactic halos, but we show in Appendix~\ref{sec:SIS} that this approximation holds reasonably well in the outskirts of our simulated halos, near $R_{200}$. Throughout this paper, we define $R_{200}$ as the radius enclosing an overdensity 200 times the critical density of the universe, which evolves with redshift (although we always use an overdensity factor of 200, regardless of redshift). We show in Appendix~\ref{sec:Rvir_def} that our results are insensitive to the exact choice of overdensity in the definition of virial radius, and so robust against inconsistent practice for this quantity in the existing literature. Equation~(\ref{eq:Tvir}) assumes the specific potential energy of gas in a dark matter halo at the virial radius is described by \begin{equation} \mathrm{PE} = -\frac{GM_{200}}{R_{200}} \label{eq:PE} \end{equation} and the boundary pressure term is described by \begin{equation} \Sigma=\frac{1}{2}\frac{GM_{200}}{R_{200}}. \label{eq:Sigma} \end{equation} Again, both equations~\ref{eq:PE} and~\ref{eq:Sigma} assume a singular isothermal sphere halo gas density profile. See Appendix~\ref{sec:SIS} for explicit calculation of these terms without assuming a particular gas density profile. The definition of virial temperature (\ref{eq:Tvir}) makes a strong, deeply embedded assumption about the energy partition in gas-filled dark-matter halos: that all the potential energy of gas flowing into the halo is fully thermalized into internal thermal energy and that gas turbulence and bulk flows contribute nothing, by definition, to the overall energy of the halo gas when the system is in virial equilibrium. To explore the consequences of explicitly including non-thermal motions (such as turbulence and bulk flows) in the energy partition of the halo, we rewrite the virial equation (Eq.~\ref{eq:virial}) to explicitly include kinetic energy from both thermal and non-thermal motions: \begin{equation} \mathrm{PE}-\Sigma=-2(\mathrm{KE}_\mathrm{th}+\mathrm{KE}_\mathrm{nt}) \end{equation} where PE is still given by Equation~\ref{eq:PE}, the thermal kinetic energy $\mathrm{KE}_\mathrm{th}$ is given by Equation~\ref{eq:TE}, and the kinetic energy due to non-thermal gas motions is $\mathrm{KE}_\mathrm{nt}$. Plugging these in and rewriting, we find a modification to the virial temperature, $T_\mathrm{mod}$, that explicitly includes non-thermal gas motions, given by: \begin{equation} T_\mathrm{mod}=\frac{1}{2}\frac{\mu m_p}{k_B}\frac{GM_{200}}{R_{200}} - \frac{2}{3}\frac{\mu m_p}{k_B}\mathrm{KE}_\mathrm{nt} \label{eq:Tmod} \end{equation} or \begin{equation} T_\mathrm{mod}=T_\mathrm{vir} - \frac{2}{3}\frac{\mu m_p}{k_B}\mathrm{KE}_\mathrm{nt}. \label{eq:Tvirmod} \end{equation} Both $T_\mathrm{vir}$ and $T_\mathrm{mod}$ assume the virial equation (Eq.~\ref{eq:virial}) holds. A halo in perfect virial equilibrium does not contain any sources or sinks of energy --- the gas can only transfer energy between its potential and kinetic energies. Star formation, feedback, and radiative cooling provide sources and sinks of energy in the halo that can drive a departure from virial equilibrium. Therefore, we expect the virial temperature (either the standard $T_\mathrm{vir}$ or the modified $T_\mathrm{mod}$) to be a good descriptor of halo gas only far from the galaxy where these sources and sinks operate, at galactocentric radii $\gtrsim0.5R_{200}$. By comparing the thermal energy of the gas in the FOGGIE halos (see \S\ref{sec:FOGGIE} below) to its radiative cooling rate, we confirm that the cooling time in the outskirts of the halos we study here is longer than the Hubble time and radiative energy losses are small compared to thermal and kinetic energy of the gas, and thus we neglect energy sinks in the outskirts of the halos. However, we note that the radiative cooling is not entirely negligible, and neglecting it is a caveat to the virial equilibrium argument at a $\sim10\%$ level (see Appendix~\ref{sec:cooling}). In detail, there may be events in a galaxy's history that lead to temporary departures from virial equilibrium even near the virial radius: mergers may lead to especially strong bursts of star formation feedback that may unbind a portion of the halo's gas. Likewise, there may be spatially distinct parts of the halo that do not participate in the overall balance of virial equilibrium, such as cosmological filaments that can pierce inward through the virial shock without being heated \citep[e.g.][]{Bennett2020} or strong outflows faster than the escape velocity of the halo (see \S\ref{subsec:calc_Tmod}). \citet{Fielding2020b} analyzed the properties of the CGM across many idealized and cosmological simulations, finding that the properties of the outer CGM ($r\gtrsim0.5R_{200}$) tend to be set by cosmological structure formation whereas the properties of the inner CGM ($r\lesssim0.5R_{200}$) tend to be set by feedback processes in the central galaxy \citep[a result also corroborated by][]{Stern2020b}, validating our choice to focus on the outer CGM. We note that neither $T_\mathrm{vir}$ nor $T_\mathrm{mod}$ will capture all relevant physics that sets the temperature of the warm gas in a galaxy halo. Both are built on the assumption of a singular isothermal sphere profile, an assumption which only holds in the outskirts of the halo (see Appendix~\ref{sec:SIS}). If the warm gas is in hydrostatic equilibrium, its temperature must increase toward the center of the gravitational potential well (see Figure~\ref{fig:temp_radius} and \S\ref{subsec:T_results}), a property that is not captured by converting the potential energy near $R_{200}$ into a single temperature through the virial theorem. In this paper, we work within the limitations of the concept of virial temperature to describe the warm halo gas temperature in the outskirts of simulated galaxy halos. Our goal is to formulate a more accurate estimate of the widely-used virial temperature through the concept of energy budget accounting within the halo gas, and ensure our findings are still as intuitive as the concept behind the standard $T_\mathrm{vir}$. \begin{figure} \centering \includegraphics[width=\linewidth]{mass_vs_t_Tempest.pdf} \includegraphics[width=\linewidth]{mass_vs_t_Squall.pdf} \includegraphics[width=\linewidth]{mass_vs_t_Maelstrom.pdf} \caption{The total (black solid), dark matter (red dashed), stellar (blue dotted) and gaseous (green dash-dotted) masses within $R_{200}$ for the three galaxies from the FOGGIE suite considered in this work, arranged from least massive to most massive at $z=0$ top to bottom.} \label{fig:masses} \end{figure} \section{The Simulations: Figuring Out Gas \& Galaxies In Enzo} \label{sec:FOGGIE} To explore energy partition in realistic halo simulations and assess the viabilty of the modified virial temperature for characterizing the bulk properties of the CGM, we use simulations from the Figuring Out Gas \& Galaxies In Enzo (FOGGIE) project. These simulations are described fully in the previous papers FOGGIE I -- IV \citep{Peeples2019,Corlies2020,Zheng2020,Simons2020}, but we briefly describe the relevant parts here for convenience. \begin{table} \centering \begin{tabular}{l r r r} Property & Tempest & Squall & Maelstrom \\ \hline $^\mathrm{a}R_{200}$ [kpc] & 168.3\phantom{0} & 195.93 & 211.87 \\ $^\mathrm{b}M_{200}$ [$10^{11}M_\odot$] & 5.04 & 8.02 & 10.12 \\ $^\mathrm{c}M_\mathrm{DM,200}$ [$10^{11}M_\odot$] & 4.26 & 6.56 & 8.45 \\ $^\mathrm{d}M_{\star,200}$ [$10^{10}M_\odot$] & 5.44 & 12.34 & 11.55 \\ $^\mathrm{e}M_\mathrm{gas,200}$ [$10^{10}M_\odot$] & 2.33 & 2.28 & 5.15 \\ \end{tabular} \caption{Properties of the three FOGGIE halos studied in this paper at $z=0$.\\$^\mathrm{a}$ Radius enclosing an average density of $200\times$ the critical density of the universe at $z=0$.\\$^\mathrm{b}$ Total mass enclosed within $R_{200}$.\\$^\mathrm{c}$ Dark matter mass enclosed within $R_{200}$.\\$^\mathrm{d}$ Stellar mass enclosed within $R_{200}$. Includes satellites.\\$^\mathrm{e}$ Gas mass enclosed within $R_{200}$. Includes ISM of central and satellites.} \label{tab:halo_props} \end{table} FOGGIE is run using the adaptive mesh refinement (AMR) code Enzo \citep{Bryan2014,BrummelSmith2019}\footnote{https://enzo-project.org}. As introduced in \citet{Simons2020}, six halos with roughly the Milky Way's present day total mass were selected from a cosmological volume 143.88 comoving Mpc on a side to be re-simulated in ``zoom-in" regions, where additional spatial refinement of at least 1.10 comoving kpc is forced in a box 287.77 comoving kpc on a side centered on the galaxy as it moves through the cosmological domain. Within this ``forced-refinement'' box, the resolution is refined further up to 274.44 comoving pc using an adaptive ``cooling refinement'' criterion in which one cell is replaced with 8 cells when the product of gas cooling time and sound speed is smaller the original cell size. The cooling refinement scheme places high resolution elements where they are needed most, in the high density and/or rapidly cooling cells, saving computational resources with less refinement in the hot and/or lowest density phases. However, the forced refinement region keeps the warm, diffuse gas resolved to a high level even in the absence of short cooling times, allowing detailed kinematics to be resolved and reducing the degree of artificial mixing frequently present in simulations with standard refinement schemes. In the outskirts of the halo that we focus on in this paper, the typical spatial resolution is set at the fixed, minimum refinement of the forced-refinement tracking box, where cells are 1.10 comoving kpc on a side, because there is not much gas there with very short cooling times. The galaxies chosen to be simulated at high resolution have their last significant merger ($<$ 10:1 mass ratio) prior to $z = 2$, to be similar to the Milky Way merger history. This generally means they do not have strong bursts of star formation or feedback driving their halo gas significantly away from equilibrium at low redshifts (see \S\ref{subsec:virial_results}), making them an excellent choice for this study that depends on the halo gas being in or near virial equilibrium. At the time of this writing, three of the six FOGGIE galaxies have been run to $z = 0$, Tempest, Squall, and Maelstrom, so we focus on just these three in this paper (see \citeauthor{Simons2020} \citeyear{Simons2020} for more information on these halos). However, we expect our results to be generally applicable and not specific to the properties of these galaxies and their halos. Figure~\ref{fig:masses} shows the build-up of gaseous, stellar, dark matter, and total masses within $R_{200}$ in these three halos over the redshift range considered here, $z\sim2$ to $z=0$. Table~\ref{tab:halo_props} shows the final properties of each halo at $z=0$. By $z\sim 1$, each galaxy's total mass is above the threshold where a virial shock is expected to form and remain stable, $M_h\sim {\rm few} \times 10^{11}M_\odot$ \citep{Birnboim2003}. Maelstrom, being the most massive of the three galaxies, surpasses this threshold by $z\sim1.5$. In general, the build-up of all types of mass within $R_{200}$ becomes smooth and slowly increasing at late times. Squall is an exception because it continues to undergo gas-rich minor mergers at late times that drive the star formation rate up and lead to bursty changes in the stellar or gas masses within $R_{200}$. We select $\sim190$ snapshots in time between $z=2$ and $z=0$, separated by $\sim50$ Myr, for each of the halos. The FOGGIE runs are set up to output a snapshot every $\sim5$ Myr but for the bulk of our analysis (Sections~\ref{sec:virial} and~\ref{sec:Tmod}), we use only every tenth snapshot in time and perform all analysis on each of these snapshots. We divide up the outer CGM between $0.3R_{200}$ and $1.3R_{200}$ into 100 radial bins (of width $0.01R_{200}$) to compute the properties of the CGM gas as functions of radius. In what follows, we take the radial bin $0.99R_{200} < r <R_{200}$ as the bin representing the gas near $R_{200}$.\footnote{This shell of width $0.01R_{200}$ contains $\sim200,000-300,000$ cells. We recalculated all results with a shell of width $0.1R_{200}$ and found no qualitative difference in using shells of different widths except for smoother radial profiles, so we continue with the thinner shell.} At low redshift, $R_{200}$ for the FOGGIE halos examined here falls partially inside and partially outside of the forced refinement region. We test the impact of combining high and low resolution cells within a single spherical shell by re-calculating all results using only the high-resolution cells in the shell near $R_{200}$ and find it has a minor quantitative and no qualitative effect on our results. The higher-resolution cells can better resolve the gas kinematics and thus contain somewhat more non-thermal kinetic energy overall than the low-resolution cells, which serves to somewhat \emph{strengthen} the difference between $T_\mathrm{vir}$ and $T_\mathrm{mod}$ and strengthen our qualitative conclusions. We proceed with using all cells within the shell at $R_{200}$ rather than only the high-resolution cells, but note that perhaps a cosmological simulation with higher forced resolution than FOGGIE would find an even stronger difference between $T_\mathrm{vir}$ and $T_\mathrm{mod}$ than we report here. This result shows the importance of high resolution within the diffuse CGM gas. \begin{figure*} \centering \includegraphics[width=0.49\linewidth]{DD2427_temperature_x_slice_Tempest_z0.pdf} \includegraphics[width=0.49\linewidth]{DD2427_radial_velocity_x_slice_Tempest_z0.pdf} \includegraphics[width=0.49\linewidth]{DD2427_temperature_x_slice_filaments-removed_Tempest_z0.pdf} \includegraphics[width=0.49\linewidth]{DD2427_radial_velocity_x_slice_filaments-removed_Tempest_z0.pdf} \caption{Slices of gas temperature (left) and radial velocity (right) in the Tempest halo at $z=0$ before and after cutting satellite ISM and filament gas (top and bottom panels, respectively). The black circle shows the location of $R_{200}$. The satellite cut removes a negligible amount of mass and volume from the domain for this halo at this redshift, but the filament cut removes $\sim37\%$ of the gas mass and $\sim22\%$ of the volume between $0.3R_{200}$ and $R_{200}$.} \label{fig:slices} \end{figure*} \section{Virial Energy of the FOGGIE Halos} \label{sec:virial} Because both the standard virial temperature and the modified virial temperature are built on the assumption of virial equilibrium, we start by assessing when and where the FOGGIE halos are in virial equilibrium. Throughout the paper, when we say a halo is ``virialized", what we mean is that {\it the warm halo gas} has kinetic and potential energies that nearly or exactly satisfy Equation~\ref{eq:virial}. We focus exclusively on the warm halo gas because it is this component of the CGM for which we are interested in deriving a temperature. In principle, all components of the galaxy system --- including the dark matter, the stars in the disk, and the interstellar medium gas --- contribute their energies to the overall energy balance and virialization of the system. The standard definition of virial temperature (Equation~\ref{eq:Tvir}) assumes the warm halo gas is {\it virialized into} the gravitational potential well set by the dark matter halo, and thus separates out just this part of the system. We note that an energy budget accounting of the entire galactic halo system would nearly always produce a virialized system, even if the energy accounting of the warm halo gas alone does not strictly satisfy equation~\ref{eq:virial}. In this way, we use the term ``virialized" to refer to an energy budget accounting for the warm halo gas alone, rather than as a statement about the equilibrium for the entire system. Note, as well, the difference between ``virialized" and ``thermalized." If the warm halo gas satisfies Equation~\ref{eq:virial}, it is {\it virialized}. However, that does not imply that all kinetic energy of the gas is in the form of thermal kinetic energy, that is, it does not imply the gas is fully {\it thermalized}. Indeed, we will show below that, in our simulations, only half of the halo gas's kinetic energy is thermal. \subsection{Assessing Virial Equilibrium} \label{subsec:assessing} First, we remove the parts of the CGM that do not contribute to the warm halo gas that we focus on here: satellites and filaments. Satellites are excised from the domain by removing all gas cells with a density $>2\times10^{-26}$ g cm$^{-3}$ and temperature $<1.5\times10^4$ K. In some cases, this method does not perfectly remove all gas associated with a satellite, but it does eliminate confusion of satellite ISM gas with host halo CGM gas. To remove filaments, we excise all gas with an inward radial velocity faster than half of the local free-fall velocity, $v_\mathrm{ff}=r/\sqrt{3\pi/(32G\rho)}$, where $r$ is the galactocentric radius of the gas parcel, $G$ is the gravitational constant, $\rho=\frac{3}{4\pi}\frac{M_\mathrm{enc}(<r)}{r^3}$ is the average mass density within $r$, and $M_\mathrm{enc}(<r)$ is the total mass (dark matter, gas, and stars) contained within radius $r$. We chose to remove gas with inward radial velocities greater than $\frac{1}{2}v_\mathrm{ff}$ because some inflow filaments have enough tangential motion that their radial velocities are not exactly $v_\mathrm{ff}$, and we found that a fraction of $\frac{1}{2}$ removes most filament contamination. Again, this cut does not perfectly remove all filament gas, but it removes enough that the filament contamination to virialized CGM gas is small in most cases. Outflows, in the form of galactic winds launched from the central galaxy and any of its satellites, have a different source than the warm, volume-filling halo gas and are unlikely to have an energy budget that follows the virial theorem. However, outflows have a range of velocities, making them difficult to select and remove cleanly, and they may also mix into the ambient CGM to become part of the virialized halo gas. Rather than attempt to remove coherent structures of outflows like we do with satellites and filaments, we do not consider any gas with an outward radial velocity greater than the escape velocity at its location in the dark matter halo to be contributing to the virial balance of the halo gas. Near the virial radius, very little gas is moving fast enough to escape the halo at times when the halo gas is in virial equilibrium (see Figure~\ref{fig:vel_dist} and discussion in \S\ref{subsec:calc_Tmod}). Figure~\ref{fig:slices} shows temperature and radial velocity slices through the center of the Tempest halo at $z=0$, before and after the cuts to remove satellite ISM and filaments. In both cases, we remove the central $0.3R_{200}$ to eliminate the galaxy and extended disk. This particular snapshot of this halo does not have any satellites in the plane of this slice, but the filament cut removes an extended wedge-shaped filament in the bottom right of the panel, primarily gas with $T\lesssim10^5$ K and $v_r<-100$ km s$^{-1}$. For Tempest at $z=0$, the satellite cut removes $0.4\%$ of all gas mass between $0.3R_{200}$ and $R_{200}$ while the filament cut removes $37.4\%$ of all gas mass in the same region. The total gas mass between $0.3R_{200}$ and $R_{200}$ is $5.5\times10^9M_\odot$ before any cuts and is $3.45\times10^9M_\odot$ after removing satellites and filaments. By volume, the satellite cut removes $0.01\%$ of the volume between $0.3R_{200}$ and $R_{200}$ and the filament cut removes $21.6\%$ of the volume. Both the standard and the modified virial temperatures assume the halo gas near $R_{200}$ is in virial equilibrium, i.e. that Equation~(\ref{eq:virial}) is satisfied. We generally expect this to be true unless the halo is experiencing galaxy mergers or a strong burst of energy input in the form of feedback \citep{Fielding2020b,Stern2020b}. Rather than assuming the virial equation holds, we explicitly measure it within the FOGGIE halos. We measure directly whether the gas at $R_{200}$ is in virial equilibrium by summing the potential, kinetic, and thermal energies of the gas in a thin spherical shell\footnote{Formally, the virial theorem applies to all gas in the system, not just within a thin shell. However, the assumption of a singular isothermal sphere as the density profile implies that the energy of gas located within a shell will be in equilibrium if the entire system is in equilibrium. We use the shell definition of the virial energy throughout the paper as it allows us to focus on just the outskirts of the halo, but see Appendix~\ref{sec:SIS} for a comparison of shell virial energies to whole-system virial energies.}. We focus on the outer CGM, where we expect virial equilibrium to hold. We define the ``virial energy", VE, to be this sum: \begin{equation} \mathrm{VE} = \mathrm{PE} - \Sigma + \sum2\left(\mathrm{KE}_\mathrm{nt} + \mathrm{KE}_\mathrm{th}\right) \label{eq:VE} \end{equation} where PE is given by Equation~(\ref{eq:PE}) multiplied by the gas mass in the shell, the boundary pressure term $\Sigma$ is given by Equation~(\ref{eq:Sigma}), and the thermal and non-thermal kinetic energies are obtained by direct sum over all cells in the spherical shell. We use the total energies, not the specific energies as we did in Eqs.~(\ref{eq:virial}) through Eq.~(\ref{eq:Tvirmod}), making Equation~(\ref{eq:VE}) a true measurement of the total energies of the gas contained within the shell. If the gas satisfies virial equilibrium, then VE $=0$. \subsection{Halos are in Virial Equilibrium Only When Non-Thermal Kinetic Energy is Included} \label{subsec:virial_results} \begin{figure} \centering \includegraphics[width=\linewidth]{all_energies_vs_t_Tempest.pdf} \includegraphics[width=\linewidth]{all_energies_vs_t_Squall.pdf} \includegraphics[width=\linewidth]{all_energies_vs_t_Maelstrom.pdf} \caption{Energies of the gas within $0.99R_{200}<r<R_{200}$ as a function of cosmic time (bottom axis) and redshift (top axis). All energies are normalized by $\frac{GM_{200}}{R_{200}}$. The virial energy (Eq.~\ref{eq:VE}) is plotted as the thick, red line. The thermal kinetic energy of the gas is plotted as the green dashed line and the non-thermal kinetic energy is plotted as the blue dotted line. A thin solid red line indicates the virial energy of the gas near $R_{200}$ if $\mathrm{KE}_\mathrm{nt}$ is neglected in the virial equation. The SFR of the central 20 kpc of the halo is shown as the thin black line, with values indicated on the right axis.} \label{fig:virial_time} \end{figure} Figure~\ref{fig:virial_time} shows the virial energy VE (thick red line) given by Equation~(\ref{eq:VE}) in a radial shell $0.99R_{200}<r<1.0R_{200}$ over cosmic time as the halos evolve from $z=2$ to $z=0$. None of the halos have gas near $R_{200}$ in perfect virial equilibrium for extended periods of time; instead their VE oscillates as the halos evolve, approaching values near zero only at low redshift or during periods of low star formation rate (SFR). The SFR is plotted as the thin black line, with values marked on the right axis, and is calculated as all new stars formed since the previous time step within 20 kpc of the center of the halo. It is clear that there is a correlation between star formation bursts and when the gas near $R_{200}$ is out of virial equilibrium, for example at $z\sim0.3$ or $z\sim1.5$ in Tempest (top panel). At lower redshift, the gas near $R_{200}$ stabilizes and approaches virial equilibrium, but bursts of stellar feedback still drive the gas near $R_{200}$ away from equilibrium temporarily (this direct cause-and-effect relationship will be discussed further below, see \S\ref{sec:xcorr}). Tempest, being the lowest-mass halo, has its gas near $R_{200}$ significantly perturbed away from equilibrium by relatively small bursts of star formation and does not approach steady virial equilibrium until rather late in its evolution, $z\lesssim0.2$. Squall is more massive (see Figure~\ref{fig:masses}), but has very strong bursts of star formation that drive its gas significantly out of equilibrium. Nonetheless, its gas approaches virial equilibrium somewhat earlier than Tempest, $z\lesssim0.4$. Maelstrom, the most massive halo of the three, has gas roughly in virial equilibrium (thick red line close to zero) throughout much of its evolution $z\lesssim0.75$, despite a significant number of star formation bursts. Maelstrom's SFR peaks to higher values, and more frequently, than Tempest's (at $z\lesssim1$), and yet the bursts do not drive its gas as far out of virial equilibrium as Tempest's bursts do. It seems the ability of strong feedback events to perturb gas near $R_{200}$ is dependent on the mass of the halo. \begin{figure} \centering \includegraphics[width=\linewidth]{DD2427_all_energies_vs_r_Tempest.pdf} \includegraphics[width=\linewidth]{DD2360_all_energies_vs_r_Squall.pdf} \includegraphics[width=\linewidth]{DD2510_all_energies_vs_r_Maelstrom.pdf} \caption{Energies of the gas within the halos, as in Figure~\ref{fig:virial_time}, as a function of distance from the center of the halo and normalized by $\frac{GM_\mathrm{enc}(r)}{r}$. The snapshots shown here are chosen as the latest times when the gas near $R_{200}$ is close to virial equilibrium (VE $\approx0$), marked in the panels for each halo. Squall is far from equilibrium at $z=0$ so we show the next closest time it is roughly in equilibrium, $z=0.06$. The other halos are roughly in equilibrium at $z=0$.} \label{fig:virial_radius} \end{figure} We expect the gas near $R_{200}$ to be at the virial temperature (either $T_\mathrm{vir}$ or $T_\mathrm{mod}$) only when the gas near $R_{200}$ satisfies VE $\sim0$. However, the gas near $R_{200}$ is \emph{not} in perfect virial equilibrium throughout much of the halos' evolution --- instead, the gas's virial energy oscillates near zero and is perturbed by feedback events, especially at higher redshift. The thin red line in Figure~\ref{fig:virial_time} shows the virial energy of the gas near $R_{200}$ if the non-thermal kinetic energy of bulk flows is neglected, like in the standard definition of virial temperature. This curve falls below the VE $=0$ at all times other than following strong bursts of star formation for all halos. At late times, when the halos are massive enough to maintain virialized halos, neglecting the non-thermal kinetic energy in the energy balance of the halo would lead to the conclusion that the halo gas is under-virialized and under-supported and should be collapsing. It is only when the non-thermal kinetic energy is included that the halo gas can be said to be close to virialized (even if perfect virial equilibrium is not achieved long-term). Figure~\ref{fig:virial_time} also shows the thermal and non-thermal kinetic energies of the gas near $R_{200}$ as the green dashed and blue dotted curves, respectively. This figure illustrates our basic finding that the gas near $R_{200}$ has roughly equal amounts of thermal and non-thermal kinetic energy at nearly all times. Shortly after strong bursts of feedback, both the thermal energy and the non-thermal kinetic energy increase, as feedback both heats and accelerates gas. Figure~\ref{fig:virial_radius} shows the same energy components as in Figure~\ref{fig:virial_time}, but as a function of radius at a given snapshot in time, over the radius range $0.3R_{200}$ to $1.3R_{200}$ (note that the vertical scale differs from Figure~\ref{fig:virial_time}). Each halo's snapshot was chosen to reflect a time when the gas near $R_{200}$ in each halo is roughly in virial equilibrium, which is $z=0$ for Tempest, $z=0.06$ for Squall, and $z=0$ for Maelstrom. The halo gas is closest to virial equilibrium for $r\gtrsim0.5R_{200}$, and again we see that neglecting the non-thermal kinetic energy in the virial equation leads to a configuration that is far out of equilibrium. Feedback drives the gas away from equilibrium in the inner regions of each halo, and some residual feedback-driven outflows that traveled to the outer halo can push it out of virial equilibrium near $R_{200}$ as well, as in the case of Squall (middle panel). Figure~\ref{fig:virial_radius} shows that at $z=0$ we expect any temperature derived from the virial equation to be a poor description of the gas within $r\lesssim0.5R_{200}$, where the virial energy deviates strongly from zero. However, the virial energy is not exactly zero for most of the volume and time so we do not expect either $T_\mathrm{vir}$ or $T_\mathrm{mod}$ to be a perfect descriptor of the gas temperature. In summary, we find that while the gas in the outskirts of the FOGGIE halos are rarely in perfect virial equilibrium (VE $=0$), their virial energies (Equation~\ref{eq:VE}) are close to zero for much of the later stages of their evolution, when they are massive enough to be expected to host a hot halo \citep[see discussion surrounding Figure~\ref{fig:masses} in \S\ref{sec:derivation} and][]{Birnboim2003}. Their normal state is to be close to VE near $R_{200}$, except when strong bursts of star formation feedback temporarily drive the halo out of equilibrium, after which it settles back into an equilibrium state. Neglecting the non-thermal kinetic energy contribution to the overall energy balance of the halo would suggest the gas in these halos are further out of virial equilibrium than they really are, suggesting that the halo gas is in fact \emph{virialized} without being fully \emph{thermalized}. We have shown that the non-thermal kinetic energy is an important component of energy partition in halos and should not be neglected in analyses that rely on accurate characterization of their main properties. \section{Modified Virial Temperature in FOGGIE Halos} \label{sec:Tmod} With an understanding of when (periods of low SFR) and where ($r\gtrsim0.5R_{200}$) the CGM gas is in virial equilibrium and thus when and where we expect $T_\mathrm{mod}$ to be a good descriptor of the gas temperature, we move on to calculating the modified virial temperature for the FOGGIE halos. We measure the distribution of gas temperatures at each radius in the simulations and compare to both $T_\mathrm{mod}$ and $T_\mathrm{vir}$ to determine if the modified virial temperature is a better descriptor of the mass-weighted peak gas temperature in the CGM than the standard virial temperature. \subsection{Calculating Modified Virial Temperature} \label{subsec:calc_Tmod} \begin{figure*} \centering \includegraphics[width=\linewidth]{DD1477_velocity_PDFs_Tempest_z0p5.pdf} \includegraphics[width=\linewidth]{DD2427_velocity_PDFs_Tempest_z0.pdf} \caption{Mass-weighted distributions of velocities of gas within $0.99R_{200}<r<R_{200}$ are shown as the black solid lines, split into the three spherical directions: $\theta$ (left), $\phi$ (middle), and radial (right). The top row shows gas near $R_{200}$ at $z=0.5$ and the bottom row shows gas near $R_{200}$ at $z=0$, both in the Tempest halo. The best-fit Gaussian model (to the two tangential velocity directions) and the best-fit double-Gaussian model (to the radial velocity direction) are shown as the blue dashed lines. For the double-Gaussian model, the two Gaussians that make it up are shown with thin blue dashed lines. Dotted vertical lines show the location of the best-fit mean of the Gaussian and dotted horizontal lines show $\pm1$ best-fit standard deviation. The best-fit values are printed in each panel.} \label{fig:vel_dist} \end{figure*} To compute $T_\mathrm{mod}$ we need a measurement of the non-thermal kinetic energy $\mathrm{KE}_\mathrm{nt}$, and thus both the turbulent velocity and the bulk flow velocity of the gas. As gas velocities are tracked explicitly, cell-by-cell, at runtime, we could use the simulated velocity fields to obtain a measure of the non-thermal kinetic energy as in \S\ref{sec:virial}. However, rather than integrate all the cell-level data directly, we will use statistical descriptions of their distributions in velocity space within radial shells, as gas velocities are typically more accessible in CGM observations than the unknown sum of all kinetic energies. In doing so, we must be careful to consider coherent bulk flows, such as filaments and fast outflows, apart from localized turbulence or convective motions. First, we decompose the CGM velocity into spherical components: radial velocity $v_r$ and velocities $v_\theta$ and $v_\phi$ tangential to the radial direction (Figure~\ref{fig:vel_dist}). The tangential velocities are defined arbitrarily, \emph{not} relative to the disk of the galaxy. Near the virial radius, we find that any rotation in the filament-removed CGM gas is negligible at times when the halo is near virial equilibrium (i.e. at $z=0$ in the Tempest halo, Figure~\ref{fig:vel_dist}), so we do not include bulk CGM rotation in our accounting of the halo's non-thermal gas motions.\footnote{Observations and simulations alike have found the CGM to be rotating within $\sim0.5R_{200}$ \citep{HodgesKluck2016,Ho2019,Martin2019,Ho2020}, although \citet{Oppenheimer2018} shows rotation is sub-dominant to other forms of non-thermal gas motions at the virial radius.} The spread of the tangential velocity distributions will thus be a good tracer for turbulent or convective non-thermal motions. We perform a least-squares fit of Gaussian distributions of the form \begin{equation} f_\mathrm{tan}(v)=A\exp{\frac{-(v-\mu)^2}{2\sigma^2}} \end{equation} to the two tangential velocity distributions to obtain the peak velocity, $\mu$, and velocity dispersion, $\sigma$, of the two tangential velocity distributions (the amplitude $A$ is a free parameter that has no physical meaning in this case, as all of the velocity distributions being fit are normalized). This also allows us to confirm that the peak of these distributions are close to zero, indicating a small net rotation. The left and center panels of Figure~\ref{fig:vel_dist} show the two tangential velocity distributions with their best-fit Gaussian distributions for the gas near $R_{200}$ in the Tempest halo at $z=0.5$ and $z=0$, as an example. At $z=0.5$, the gas does show some bulk rotation in the $\theta$ direction as indicated by a non-zero $\mu=-27$ km s$^{-1}$, but the rotation is not long-lived or coherent, generally appearing and disappearing from snapshot to snapshot as the halo evolves. By $z=0$, there is no significant rotation of the Tempest halo's gas near $R_{200}$ in either the $\theta$ or $\phi$ directions, as indicated by $\mu\approx0$ for both tangential velocity directions. The radial velocity distribution will have a contribution from turbulent motions, assuming turbulence in the CGM is isotropic, but it will also have contributions from galactic outflows that reach large distances. Thus, we do not expect the radial velocity distribution to be symmetric, nor necessarily peaked close to zero. To fit the radial velocity distribution, we perform a least-squares fit to the sum of two Gaussian distributions of the form \begin{equation} f_r(v)=A_1\exp{\frac{-v^2}{2\sigma_\mathrm{tan}^2}} + A_2\exp{\frac{-(v-\mu_r)^2}{2\sigma_r^2}} \end{equation} where the first term in the sum represents the contribution due to turbulence and the second term represents the contribution due to bulk outflows. The turbulence Gaussian has its mean fixed to 0 km s$^{-1}$ and its standard deviation fixed to $\sigma_\mathrm{tan}$, where $\sigma_\mathrm{tan}$ is the best-fit standard deviation of a Gaussian fit to the tangential velocity distribution (not shown), given by $v_\mathrm{tan}=\sqrt{v_\theta^2+v_\phi^2}$. The outflow Gaussian's mean and standard deviation are unconstrained, but it is defined to be zero for $v<0$ km s$^{-1}$ so that it measures strictly the bulk outflow component of the radial velocity. Both Gaussians' amplitudes are unconstrained. The right panels in Figure~\ref{fig:vel_dist} show the radial velocity distribution along with the best-fit sum of Gaussians to the distribution. The cut to remove filaments removes all gas with $v_r\lesssim50$ km s$^{-1}$ (this value changes slightly with redshift), and galactic outflows can be seen as the Gaussian component shifted toward large positive velocities. With the velocity distributions characterized, we can compute the non-thermal kinetic energy from either turbulence only or turbulence and bulk flows. Because we do not expect significant rotation of the CGM near the virial radius and the means of the best-fit Gaussians to the tangential velocity distributions are close to zero, we use only the standard deviation of the best-fit Gaussians to the tangential velocity distributions as a measure of turbulent velocity. Turbulence will always contribute to the virialization and non-thermal kinetic energy of the gas, but it is unclear how much, if at all, bulk outflows with velocities $<v_\mathrm{esc}$ in the radial velocity distribution contribute to the virialization of the halo. It could be that outflows produce a perturbation from virial equilibrium for the halo (like filaments and satellite galaxies) and thus should not be included in the derivation of the modified virial temperature, or it could be that outflows provide a necessary supporting force for the halo and thus should be included. Instead of attempting to characterize how much outflows contribute to the virialized, non-thermal kinetic energy, we define two ways of calculating the modified virial temperature: one with only turbulence, and one with both turbulence and bulk outflows. The total kinetic energy per mass (specific kinetic energy) of a velocity distribution is $\int \frac{1}{2}v^2f(v)\ \mathrm{d}v$ where $f(v)$ is the probability of a parcel of gas having a velocity between $v$ and $v+\mathrm{d}v$, normalized such that $\int f(v)\ \mathrm{d}v = 1$. For a Gaussian velocity distribution, like we find for the tangential velocity distributions, the specific kinetic energy is simply $\frac{1}{2}\sigma^2$ where $\sigma$ is the standard deviation of the Gaussian, the velocity dispersion. For the radial velocity distribution, we model $f(v)$ as the sum of two Gaussians, one of which cuts off for $v_r<0$ km s$^{-1}$, so we compute $\int \frac{1}{2}v_r^2f(v_r)\ \mathrm{d}v_r$ directly from the best-fit function, which includes both the radial-direction turbulent velocity distribution and the outflow velocity distribution. The specific kinetic energy of a velocity distribution that can be described as a three-dimensional Gaussian is given by $\mathrm{KE}=\frac{1}{2}(\sigma_\theta^2+\sigma_\phi^2+\sigma_r^2)$, where each $\sigma$ is the velocity dispersion in one of the three directions. In our case, we have measured velocity dispersions for the two tangential dimensions and assume that the velocity dispersion in the third, radial dimension can be described as the average of the tangential dispersions, $\sigma_r^2=\frac{1}{2}(\sigma_\theta^2+\sigma_\phi^2)$. The non-thermal kinetic energy due to turbulence alone is then \begin{equation} \mathrm{KE}_\mathrm{nt}^{\mathrm{turb}}=\frac{1}{2}\left(\frac{3}{2}\sigma_\theta^2+\frac{3}{2}\sigma_\phi^2\right) \label{eq:KEnt_turb} \end{equation} where $\sigma_\theta$ and $\sigma_\phi$ are the standard deviations of the best-fit Gaussians to the $\theta$ and $\phi$ velocity distributions, respectively. The non-thermal specific kinetic energy of both turbulence and bulk outflows is given by \begin{equation} \mathrm{KE}_\mathrm{nt}^{\mathrm{turb+out}}=\frac{1}{2}\left(\sigma_\theta^2+\sigma_\phi^2\right) + \frac{1}{2}\int_{-0.5v_{\rm ff}}^{v_\mathrm{esc}} v_r^2 f(v_r)\ \mathrm{d}v_r \label{eq:KEnt_turb_out} \end{equation} where the lower bound of the integral reflects the cut made to remove the inflow filaments (see \S\ref{subsec:assessing}), and the upper bound at the escape velocity $v_\mathrm{esc}$ assumes that outflows that are fast enough to escape the halo do not contribute to the virialization of the halo. Note that the contribution of turbulence in the radial direction is included in $f(v_r)$ within the integral, so the factor of $3/2$ has been dropped from the first term in the sum. The standard virial temperature $T_\mathrm{vir}$ is a single temperature for all locations in the halo, by the singular isothermal sphere definition. However, for $T_\mathrm{mod}$ we can derive a radius-dependent form by making some simple substitutions. In Equation~(\ref{eq:Tmod}), we replace $M_{200}$ with $M_\mathrm{enc}(<r)$, the enclosed mass within a radius $r$, and replace $R_{200}$ with $r$ (this is equivalent to replacing $M_{200}$ and $R_{200}$ in the potential energy term given by equation~\ref{eq:PE} with $M_\mathrm{enc}(<r)$ and $r$, respectively)\footnote{We allow the temperature $T_\mathrm{mod}$ to vary although we still use the singular isothermal sphere assumption for the form of PE (equation~\ref{eq:PE}). In this case, the singular isothermal sphere assumption governs the gas density and halo gravitational potential profiles, rather than the temperature.}. We also measure $\sigma_\mathrm{\theta}$, $\sigma_\mathrm{\phi}$, and $\int \frac{1}{2}v_r^2f(v_r)\ \mathrm{d}v_r$ within radial bins. This gives \begin{equation} T_\mathrm{mod}^{\mathrm{turb}}=\frac{1}{2}\frac{\mu m_p}{k_B}\left[\frac{GM_\mathrm{enc}(<r)}{r} - \left(\sigma_\theta(r)^2+\sigma_\phi(r)^2\right)\right]. \label{eq:Tvirmod_r_turb} \end{equation} and \begin{align} &T_\mathrm{mod}^{\mathrm{turb+out}}=\frac{1}{2}\frac{\mu m_p}{k_B}\left[\frac{GM_\mathrm{enc}(<r)}{r} - \right. \nonumber \\ &\left.\frac{2}{3}\left(\sigma_\theta(r)^2+\sigma_\phi(r)^2 + \int_{-0.5v_{\rm ff}(r)}^{v_\mathrm{esc}} v_r^2 f(v_r,r)\ \mathrm{d}v_r \right)\right]. \label{eq:Tvirmod_r_turb_out} \end{align} In equations~(\ref{eq:Tvirmod_r_turb}) and~(\ref{eq:Tvirmod_r_turb_out}), we find $\sigma_{\theta}(r)$, $\sigma_{\phi}(r)$, and $f(v_r,r)$ by fitting these functional forms to the velocity distributions in bins of radius, from $0.3R_{200}$ to $1.3R_{200}$, of radial width $0.01R_{200}$. We now have all the analytic tools we need to compare $T_\mathrm{vir}$ and $T_\mathrm{mod}$ as descriptions of simulated halo gas. \subsection{$T_\mathrm{mod}$ Better Describes the CGM Temperature than $T_\mathrm{vir}$} \label{subsec:T_results} Figure~\ref{fig:temp_time} shows two-dimensional mass-weighted histograms of the gas within $0.99R_{200}<r<R_{200}$ in temperature-time space. Darker shading indicates the temperature of a larger fraction of the gas mass at $R_{200}$. The standard virial temperature (Equation~\ref{eq:Tvir}) is shown as the dashed orange line and the modified virial temperature, calculated either with turbulence alone or with turbulence and bulk outflows (equations~\ref{eq:Tvirmod_r_turb} or~\ref{eq:Tvirmod_r_turb_out}, respectively) is shown as the dotted red and solid red lines, respectively. When there is a strong burst of star formation, the temperature histogram of gas near $R_{200}$ shifts upward to higher temperatures as feedback heats the CGM. At low redshift and during quiescent periods, when the gas near $R_{200}$ is closest to virial equilibrium (see Figure~\ref{fig:virial_time}), The darkest parts of the histograms indicate the temperature range of the majority of the gas mass, and $T_\mathrm{mod}$ passes closer to this temperature range than the standard $T_\mathrm{vir}$, which over-estimates the temperature of the gas near $R_{200}$ by roughly a factor of two at nearly all times unless feedback is coincidentally heating the CGM gas. \begin{figure} \centering \includegraphics[width=\linewidth]{temperature_vs_t_mass-colored_Tempest.pdf} \includegraphics[width=\linewidth]{temperature_vs_t_mass-colored_Squall.pdf} \includegraphics[width=\linewidth]{temperature_vs_t_mass-colored_Maelstrom.pdf} \caption{The temperature of gas with $0.99R_{200}<r<R_{200}$ is shown as a mass-weighted distribution as a function of cosmic time (bottom axis) and redshift (top axis), with dark colors indicating the peak of the mass-weighted temperature distribution. The orange dashed line shows the standard virial temperature (Equation~\ref{eq:Tvir}) and red solid and red dashed lines show the modified virial temperature, calculated using the kinetic energy due to turbulence only (Equation~\ref{eq:Tvirmod_r_turb}) or both turbulence and outflows (Equation~\ref{eq:Tvirmod_r_turb_out}), respectively. The thin black line shows the star formation rate, with values on the right axis.} \label{fig:temp_time} \end{figure} Figure~\ref{fig:temp_radius} shows a mass-weighted two-dimensional histogram of temperature of CGM gas as a function of distance from the halo center compared to the standard virial temperature (orange dashed line) and the two calculations for the modified virial temperature (solid red for turbulence-only, Equation~\ref{eq:Tvirmod_r_turb}, dotted red for turbulence and outflows, Equation~\ref{eq:Tvirmod_r_turb_out}), at the same time snapshots as in Figure~\ref{fig:virial_radius} for each halo. The distribution is smoother at smaller radii where more of the cells in a given radial bin are refined to a higher resolution (see \S\ref{sec:FOGGIE}). In the outskirts of the halos, where the gas is closest to virial equilibrium (see Figure~\ref{fig:virial_radius}), $T_\mathrm{mod}$ passes closer to the darkest regions of the mass-weighted temperature distribution than the standard $T_\mathrm{vir}$ does. Both $T_\mathrm{vir}$ and $T_\mathrm{mod}$ fail to describe the temperature of the gas in the inner regions of the halo, where the gas temperature rises. In these inner regions, the halo gas is not in virial equilibrium (see Figure~\ref{fig:virial_radius}), so it is not expected that any temperature derived from the virial theorem will accurate describe this gas. In the inner regions of halos, there are several physical processes occurring that are not captured by an energy budget accounting through the lens of the virial theorem: there are sources (feedback) and sinks (radiative cooling) of energy, the singular isothermal sphere assumption used in both $T_\mathrm{vir}$ and $T_\mathrm{mod}$ does not describe the gravitational potential as well as it does in the outskirts of the halo (Appendix~\ref{sec:SIS}), and an increased gas temperature where the gravitational potential is stronger is expected from hydrostatic equilibrium but not captured by virial equilibrium arguments. For these reasons, we focus on the outskirts of the halo when using the virial theorem to estimate the halo gas temperature (although note that even at large radii, radiative cooling plays a minor role in the gas energy balance; see Appendix~\ref{sec:cooling}). The standard $T_\mathrm{vir}$ overestimates the temperature of the majority of the gas (by mass) by a factor of $\sim2$ at the virial radius, where we would expect the $T_\mathrm{vir}$ to describe the gas temperature best. The modified virial temperature calculated including both turbulence and bulk outflows, $T_\mathrm{mod}^\mathrm{turb+out}$, performs somewhat better in describing the peak of the temperature distribution (darkest shading) near $R_{200}$ than $T_\mathrm{mod}^\mathrm{turb}$ calculated from turbulence alone, without bulk outflows, in Tempest and Squall, whereas it makes no difference in Maelstrom, perhaps indicating that the kinetic energy due to outflows is more important to include in the overall energy balance of lower-mass halos. \begin{figure} \centering \includegraphics[width=\linewidth]{DD2427_temperature_vs_radius_mass-colored_Tempest.pdf} \includegraphics[width=\linewidth]{DD2360_temperature_vs_radius_mass-colored_Squall.pdf} \includegraphics[width=\linewidth]{DD2510_temperature_vs_radius_mass-colored_Maelstrom.pdf} \caption{The mass-weighted temperature of the filament- and satellite-removed CGM gas at times when the region near $R_{200}$ is in virial equilibrium (as indicated in each panel) is shown as a two-dimensional histogram in temperature-radius space, with dark colors indicating the peak of the mass-weighted temperature distribution at a given radius. The standard virial temperature (Equation~\ref{eq:Tvir}) is radius-independent and shown as the orange dashed line. The two ways of calculating the modified virial temperature, with and without bulk outflows (Equations~\ref{eq:Tvirmod_r_turb_out} and~\ref{eq:Tvirmod_r_turb}) are shown as the dotted and solid red lines, respectively.} \label{fig:temp_radius} \end{figure} When the kinetic energy due to bulk outflows is included in the energy balance of gas near $R_{200}$, the corresponding $T_\mathrm{mod}$ is smaller because the $\mathrm{KE}_\mathrm{nt}$ term in Equation~(\ref{eq:Tvirmod}) is larger, driving a larger deviation below the standard $T_\mathrm{vir}$. Because it is unclear how much, if at all, outflows with $v<v_\mathrm{esc}$ contribute to the energy budget of the CGM gas, we report both $T_\mathrm{mod}^\mathrm{turb}$ and $T_\mathrm{mod}^\mathrm{turb+out}$ and do not pick one or the other as a better description of the temperature of the majority by mass of the CGM gas. However, Figure~\ref{fig:temp_time} indicates there are some times when it appears $T_\mathrm{mod}^\mathrm{turb+out}$ passes closer to the peak of the temperature distribution near $R_{200}$ than $T_\mathrm{mod}^\mathrm{turb}$, which indicates there are some times in the halo's history when outflows are an important contributor to the energy budget of the halo gas, and some times when they are not (although note that outflows faster than the escape velocity are never included in $T_\mathrm{mod}^\mathrm{turb+out}$). In addition, at different radii within the halo one or the other form of $T_\mathrm{mod}$ may be a closer description of the peak of the gas temperature distribution, indicating that outflows may only be important to the energy budget at certain radii. We also see from Figure~\ref{fig:temp_radius} that neither form of $T_\mathrm{mod}$ is an appropriate descriptor of the gas temperature at small radii where the assumption of virial equilibrium breaks down, as expected (see \S\ref{subsec:virial_results}). \section{Feedback Drives Deviations from Equilibrium} \label{sec:xcorr} While $T_\mathrm{mod}$ is clearly a better descriptor of the gas temperature in the outskirts of the FOGGIE halos than $T_\mathrm{vir}$ for most each halos' evolution, there are times following strong bursts of star formation when outflows push the halo gas out of virial equilibrium and away from $T_\mathrm{mod}$ or $T_\mathrm{vir}$ (Figure~\ref{fig:temp_time}). Here, we quantify this cross-correlation between the SFR and energy or temperature of the gas near $R_{200}$ explicitly. \begin{figure} \centering \includegraphics[width=\linewidth]{xcorr_energy-SFR_vs_delay-t_Tempest.pdf} \includegraphics[width=\linewidth]{xcorr_energy-SFR_vs_delay-t_Squall.pdf} \includegraphics[width=\linewidth]{xcorr_energy-SFR_vs_delay-t_Maelstrom.pdf} \caption{The cross-correlation between SFR and various energies of the gas near $R_{200}$ as a function of time delay (Equation~\ref{eq:xcorr}). The correlation is positive for $\tau\lesssim1-1.5$ Gyr and peaks at $\tau\sim25-75$ Myr, quantifying what is easy to see by eye in Figure~\ref{fig:virial_time}, that the halo is driven out of virial equilibrium by strong bursts of feedback.} \label{fig:energy_xcorr} \end{figure} Figure~\ref{fig:energy_xcorr} shows a time-delay cross-correlation between the central galaxy's SFR and the energy of the gas at $R_{200}$. The cross-correlation is computed as \begin{equation} \xi(\tau)=\frac{1}{N}\sum_{i}^{N} \frac{[\mathrm{SFR}(t_i) - \overline{\mathrm{SFR}}][\mathrm{E}(t_i-\tau) - \overline{\mathrm{E}}]}{\sigma_\mathrm{SFR}\sigma_\mathrm{E}} \label{eq:xcorr} \end{equation} where SFR$(t_i)$ is the star formation rate and E$(t_i)$ is the energy, which can be VE (Equation~\ref{eq:VE}), $\mathrm{KE}_\mathrm{th}$, or $\mathrm{KE}_\mathrm{nt}$, at time snapshot $t_i$. $\overline{\mathrm{SFR}}$ and $\overline{\mathrm{E}}$ are the averages of SFR and energy over the time from $z=2$ to $z=0$, $\sigma_\mathrm{SFR}$ and $\sigma_\mathrm{E}$ are the standard deviations of SFR and energy over time, $\tau$ is a time-delay shift of one function relative to the other, and the sum is taken over all $N$ time snapshots. This function is normalized such that $\xi(\tau)=1$ would indicate a perfect correlation between SFR and energy at a time delay of $\tau$, $\xi(\tau)=-1$ would indicate a perfect anti-correlation at $\tau$, and $\xi(\tau)=0$ indicates no correlation at $\tau$. We perform this calculation over every snapshot output by the FOGGIE runs, separated by $\sim5$ Myr, in order to capture short-time variations in the energy and temperature of the halo. This is a factor of ten increase in time resolution over the analysis in Sections~\ref{sec:virial} and~\ref{sec:Tmod}. Figure~\ref{fig:energy_xcorr} shows that at time delays $\tau\lesssim1-1.5$ Gyr, SFR and VE, $\mathrm{KE}_\mathrm{nt}$, and $\mathrm{KE}_\mathrm{th}$ (except for Maelstrom, see below) are all positively correlated, peaking at $\tau\sim25$ Myr for Tempest and $\tau\sim75$ Myr for Squall and Maelstrom. This means that stronger star formation is correlated with a higher energy of gas near $R_{200}$ $\sim25-75$ Myr later\footnote{Note that the value of $\tau$ where the cross-correlation peaks is not strictly a travel time of outflows from the galaxy to $R_{200}$ because the duration of the star formation burst also helps set $\tau$.}, and it takes $\sim1-1.5$ Gyr for the energy of the gas near $R_{200}$ to fully ``relax" to what it was before the period of higher star formation, as can also be seen in Figure~\ref{fig:virial_time}. The strong correlation between SFR and gas energy at $R_{200}$ confirms what was suspected from Figure~\ref{fig:virial_time}: strong bursts of feedback, driven by large SFRs, is what drives the gas near $R_{200}$ away from the halo's ``natural state" of virial equilibrium. This further emphasizes why both $T_\mathrm{vir}$ and $T_\mathrm{mod}$ fail at describing the halo gas following a burst of star formation or in the inner regions of the halo most strongly affected by feedback: the virial theorem provides a tool for accounting for different forms of energies in the halo gas, and when the virial energy of the gas defined by equation~(\ref{eq:VE}) is not close to zero, the prerequisite for $T_\mathrm{vir}$ or $T_\mathrm{mod}$ to be descriptive is not met. Interestingly, Squall shows two prominent peaks in the cross-correlation, but the second peak at $\sim800$ Myr is likely driven by the two extremely strong bursts of star formation at $\sim7.5$ Gyr and $\sim8.2$ Gyr (see middle panel of Fig.~\ref{fig:virial_time}) rather than predicting a cause-and-effect behavior. We verify this is the case by capping the SFR at $20 M_\odot$ yr$^{-1}$ and re-calculating the cross-correlation, which greatly diminishes the strength of the second peak without affecting the primary peak at 75 Myr (not shown). For large $\tau$, the cross-correlation samples fewer points and so it can be disproportionately driven by a handful of extreme events. Maelstrom shows the weakest correlation strength between SFR and energy of the gas near $R_{200}$ out of the three halos examined here. It is also the most quiescent of the three halos, with few very strong bursts of SFR that would be expected to drive the halo away from virial equilibrium, and this lack of strong peaks in both the SFR and the energy (see bottom panel of Fig.~\ref{fig:virial_time}) is likely what produces the weakest correlation in Figure~\ref{fig:energy_xcorr}. However, there is still a general trend of positive correlation between VE and $\mathrm{KE}_\mathrm{nt}$ and SFR, with a weak peak at $\sim100$ Myr, that declines over 1 Gyr. Interestingly, there is an anti-correlation between SFR and $\mathrm{KE}_\mathrm{th}$ in Maelstrom roughly constant with time-delay, which is not seen in either Squall or Tempest, but a strong positive correlation with $\mathrm{KE}_\mathrm{nt}$. This indicates that despite Maelstrom's general quiescence compared to the other two halos where it appears bursts of star formation do not heat the gas much, the non-thermal kinetic motions triggered by star formation feedback are still important to the overall energy balance (or lack thereof) of the gas at $R_{200}$. Figure~\ref{fig:temp_xcorr} shows a similar time-delay cross-correlation, this time correlating the SFR with the mass of gas at $R_{200}$ within different temperature bins relative to the standard $T_\mathrm{vir}$ as marked on the figure (calculated with Equation~\ref{eq:xcorr}, but replacing E$(t_i)$ and $\overline{\mathrm{E}}$ with the mass in a temperature bin at $t_i$ and averaged over time, respectively). The two hottest temperature bins ($\gtrsimT_\mathrm{vir}$) in Tempest and Squall are positively correlated with bursts of SFR, indicating that the presence of $\simT_\mathrm{vir}$ gas at $R_{200}$ is due to star formation feedback, \emph{not} that the gas at $R_{200}$ is naturally at $T_\mathrm{vir}$ when the halo is fully relaxed. The two coolest temperature bins ($\lesssimT_\mathrm{vir}$) are anticorrelated with the SFR in Tempest and Maelstrom, indicating that bursts of star formation remove cool gas mass from $R_{200}$. This trend can be seen by eye in Figure~\ref{fig:temp_time}, where the only time the gas at $R_{200}$ is close to or greater than the standard $T_\mathrm{vir}$ (orange dashed line in that figure) is shortly following a burst of feedback, after which the temperature drops again as the halo relaxes. Like the energy cross-correlation, the temperature cross-correlation takes $\sim1-1.5$ Gyr to relax to the state it was prior to the burst of SFR. The highest temperature bin (solid orange) peaks sooner than the next-highest (dashed pink) temperature bin, a signature of the general declining temperature trend after a strong burst of star formation seen in Figure~\ref{fig:temp_time}. In Squall, while the two highest temperature bins are positively correlated with SFR, the two lowest temperature bins are not particularly correlated with SFR in either a positive or a negative direction. This may indicate that Squall has significant cool gas mass in the halo regardless of feedback, and that bursts of feedback simply add more hot gas without removing cool gas near $R_{200}$. Just like above with the energy-SFR cross-correlation, the secondary peak in the hot gas mass in Squall is driven by just two of the strongest starburst events and is greatly reduced if we cap the SFR at $20 M_\odot$ yr$^{-1}$ (not shown). Maelstrom shows the opposite trend, where the two hottest temperature bins are not particularly correlated with SFR while the two coolest temperature bins are strongly anti-correlated with SFR. The anti-correlation of cool gas mass with SFR is expected if feedback heats the gas near $R_{200}$, but lack of correlation with hot gas is unexpected and may just suggest that there are not enough significant peaks in the SFR to drive the gas temperature near $R_{200}$ significantly away from its equilibrium value. This seems to be corroborated by Figure~\ref{fig:temp_time} (bottom panel), where the temperature of the gas near $R_{200}$ does not exhibit as many short deviations to high temperatures as in the other halos. \begin{figure} \centering \includegraphics[width=\linewidth]{xcorr_temp-SFR_vs_delay-t_Tempest.pdf} \includegraphics[width=\linewidth]{xcorr_temp-SFR_vs_delay-t_Squall.pdf} \includegraphics[width=\linewidth]{xcorr_temp-SFR_vs_delay-t_Maelstrom.pdf} \caption{The cross-correlation between SFR and mass in different temperature bins relative to the standard $T_\mathrm{vir}$ as indicated in the figure, as a function of time delay $\tau$ (Equation~\ref{eq:xcorr}). The mass in the warmer temperature bins is positively correlated with SFR while the mass in the cooler bins is anticorrelated, quantifying what is easy to see by eye in Figure~\ref{fig:temp_time}, that temperatures $\gtrsimT_\mathrm{vir}$ are only achievable following a burst of SFR and \emph{not} when the halo is in relaxed virial equilibrium.} \label{fig:temp_xcorr} \end{figure} \section{Implications of a Cooler CGM} \label{sec:implications} In Sections~\ref{sec:virial} through~\ref{sec:xcorr}, we found that across cosmic time and throughout the outskirts of a galactic halo, non-thermal gas motions are critical to understanding the energy partition and the temperature of the halo gas. For the simulated halos studied here, virial equilibrium holds near $R_{200}$ only if non-thermal kinetic energies are included in the energy balance and only when the halo is not being perturbed by strong feedback, proving that the halo gas can be virialized without being fully thermalized. The consequence of this finding is that the standard virial temperature $T_\mathrm{vir}$ overestimates the peak of the gas temperature distribution by a factor of $\sim2$ when the halo is relaxed. Instead, the modified virial temperature, which is calculated taking these non-thermal gas motions into account, is a better descriptor of the halo gas near $R_{200}$. The end result is a somewhat cooler galactic halo than expected from standard virial arguments. While we carefully calculate the contribution to the energy budget of bulk flows here, this may not be possible in many cases, such as in interpreting observations or in analytic models or idealized simulations of $L^*$ galaxy halos. In these cases, we suggest using a halo temperature roughly a factor of 2 lower than the standard virial temperature. The factor of two arises due to the roughly equal contributions of thermal and non-thermal energies to the halo's energy budget throughout most of its evolution (see Figure~\ref{fig:virial_time}), which we suggest as a general rule of thumb in cases where emergent non-thermal kinetic energies cannot be explicitly calculated. Observations of the diffuse gas making up the CGM, especially in the outskirts of galaxy halos, are typically done in absorption line studies against the light from a bright background source. This generally restricts the derived information to at most a handful of lines of sight through any given galaxy's halo \citep[an important exception is M31, for which multiple sightlines through the same galaxy's CGM can be obtained,][]{Lehner2015,Lehner2020}, and restricts the dimensionality of that information to only line-of-sight velocities. Galaxy formation simulations or cosmological simulations can provide more information than these pencil-beam observations, but they may be under-resolving the small-scale structure of the CGM, especially on scales far from the galaxy. In addition, the implementation of star formation and feedback in the central galaxy varies across different simulations and with resolution. It is necessary to develop and analyze analytic models for the CGM to tie the differing information from observations and simulations back to the gas physics that govern the CGM, and it is in the context of these analytic models where a cooler-than-expected CGM has significant implications that we outline below. \subsection{Thermal Pressure of the CGM} \label{subsec:th_pres} Absorption-line surveys of the CGM routinely discover both hot ($T\sim10^6$ K) and cool ($T\sim10^4$ K) gas, frequently in the same line of sight and at the same line-of-sight velocity \citep{Tumlinson2013,Bordoloi2014,Borthakur2015,Werk16, Keeney2017,Berg2018,Chen2018,Muzahid2018}. Ionization modeling of low-ionization state absorption lines produces estimates of the gas density that tend to show that the cool gas density is similar to the hot gas density \citep{Werk2014,Stern2016} despite large temperature differences, and thus the two gas phases are out of pressure equilibrium. However, multiphase CGM models that pose the cold phase is found in small clouds embedded within the volume-filling hot phase generally expect that the cool and hot gas are in pressure equilibrium at the pressure of the hot phase \citep{Mo1996,Maller2004}. An overall cooler CGM can help alleviate this discrepancy somewhat, as a lower temperature for the hot phase reduces its thermal pressure and thus reduces the thermal pressure needed in the cold phase to match it, allowing the cold phase to be more diffuse. A factor of two decrease in hot-phase temperature leads to a factor of two decrease in the expected cold-phase density if the phases are in pressure equilibrium. The detailed multiphase ionization modeling of \citet{Haislmaier2021} finds the warm and cool gas phases may actually be in pressure equilibrium in some cases, but out-of-equilibrium solutions are not entirely ruled out, and those authors also find that the thermal gas pressure of all phases (regardless of whether they are in pressure equilibrium with each other) is lower than typically expected for $\sim L^\star$ halos. A lower thermal pressure may be explained by the cooler-than-expected volume-filling phase of the halo we present in this paper, although it may not be enough to fully rectify thermal pressure differences between phases and a shallower pressure gradient \citep{Voit2019a,Voit2019b} or non-thermal pressure from turbulence or cosmic rays is likely needed \citep{Salem2016,Oppenheimer2018,Butsky2020,Ji2020,Lochhaas2020}. \subsection{Cooling Time of CGM Gas} \label{subsec:tcool} The efficiency of radiative cooling is strongly dependent on temperature and peaks around $T\sim10^5$ K for metal-enriched gas. At these \ temperatures, CGM gas produces many intermediate ions such as \ion{C}{4}, \ion{Si}{4}, and potentially \ion{O}{6}, all species that are frequently found in absorption in the CGM surrounding Milky Way-like galaxies. This intermediate-temperature gas may live in radiatively-cooling interface regions between hot and cold phases, which grow as hot and cold gas turbulently mix together \citep[e.g.,][]{Begelman1990,Slavin1993,Wakker2012,Kwak2015,Ji2019,Fielding2020a,Tan2020}. A cooler hot phase means less mixing is required for gas to reach intermediate temperatures and cool efficiently, perhaps allowing cooling to proceed more quickly than would be expected in a hotter medium. This could lead to more cool gas forming by entraining mass from the hot phase, explaining observations of the cool and intermediate phases. While we find that cooling does not dominate the overall energy balance of the halo at more than a $\sim10\%$ level (see Appendix~\ref{sec:cooling}), the lower gas temperature may seed cooling on small scales that can explain observations without upsetting the global balance. \subsection{CGM Mass Estimates from X-Ray Observations} \label{subsec:xray} X-ray studies observe the hot component of the CGM of both the Milky Way and external galaxies. X-ray emission is strongly dependent on the gas density, so typically the CGM is only observed in X-ray emission in the densest regions closest to massive galaxies. A popular strategy for characterizing the hot CGM gas that emits in X-ray is to fit its density profile with a $\beta$ model, which is a power-law profile where the parameter $\beta$ describes the power. To estimate the total mass of hot gas in a galaxy's CGM, the $\beta$ model is extrapolated out to the virial radius and integrated \citep{Anderson2010,Gupta2012,Das2019}, finding $\sim10^{9-10} M_\odot$ of hot gas within the halo \citep{Anderson2010}. This method assumes that the gas maintains its hot temperature out to the virial radius and that it is only the decline in density that leads to the decrease in X-ray surface brightness below detection limits in the outskirts of galaxy halos. In addition, fits to X-ray spectra may infer gas temperatures higher than the peak of the temperature distribution \citep{Vijayan2021}. Figure~\ref{fig:temp_radius} shows that the gas temperature decreases with increasing radius approaching the virial radius, and is a factor of $\sim2$ lower than the commonly-assumed virial temperature, so that mass estimates of the hot gas from $\beta$ models may not be accurate. If the decrease of gas temperature with increasing radius is what drives the low X-ray surface brightness in the outskirts of galactic halos, rather than lack of gas mass, the gas mass in the halo's volume-filling phase may be higher than estimated. However, the volume-filling gas is not ``hot" ($T > 10^6$ K) but ``warm" ($T = 10^5 - 10^6 K$, see Figure~\ref{fig:temp_radius}), so the \emph{hot gas} contribution to the mass of the halo may be lower than estimated even if the \emph{volume-filling} gas phase contribution to the halo mass is higher than estimated. A detailed analysis of the relative contribution of each gas phase to the mass budget of the CGM is beyond the scope of this paper. \subsection{The Origin of \ion{O}{6}} \label{subsec:OVI} The UV doublet of \ion{O}{6} is the highest-ionization tracer of warm gas that is readily accessible outside the X-ray. \citet{Tumlinson2011} presented correlations of CGM \ion{O}{6} abundance with galaxy properties, finding a bimodality in presence of \ion{O}{6} that depends on SFR of the central galaxy: star-forming galaxies have more \ion{O}{6} in their halos than quiescent galaxies. \citet{Oppenheimer2016} proposed a different source for gas traced by \ion{O}{6}: the ionization fraction of \ion{O}{6} peaks near the virial temperature of roughly Milky Way-mass galaxies such that the \ion{O}{6} bimodality is actually a bimodality in halo mass (and thus virial temperature), rather than relating primarily to SFR. Galaxies living in massive halos have virial temperatures too high for \ion{O}{6} to be prevalent (oxygen ions are instead ionized further to \ion{O}{7} or \ion{O}{8}), and these galaxies are also typically quenched, thus explaining the \ion{O}{6} bimodality with SFR as well. However, \citet{McQuinn2018} showed that there is a slight offset between the halo mass where virial-temperature-tracing \ion{O}{6} is expected to be prevalent and the halo mass where \ion{O}{6} is most frequently observed, such that \ion{O}{6} is detected surrounding more massive halos whose virial temperatures are too large, seemingly, for \ion{O}{6} to survive (see their Figure 3). \citet{McQuinn2018} proposed a spread in gas temperature around the virial temperature as one possible solution to this dilemma, such that some of the gas exists at lower temperatures where \ion{O}{6} can be found. In this paper, we showed the temperature of CGM gas is lower than expected from the classical virial analysis. While we do not yet have enough halos simulated at high resolution to examine this trend with halo mass, the prevalence of the hydrostatic mass bias in galaxy clusters (see \S\ref{subsec:turb}) shows that even very high-mass halos have significant non-thermal gas motions, which should also affect the virial balance and reduce the virial temperature. If the actual temperature of halo gas is lower than expected for halos of all masses, then the halo mass at which the \ion{O}{6} ionization fraction peaks at the virial temperature is larger than expected, potentially explaining why \ion{O}{6} is seen with such abundance surrounding more massive galaxies than expected. The highest-mass halo explored in this paper, Maelstrom, does still show a temperature lower than the standard virial temperature, so it seems likely that halos of all masses will have lower temperatures than expected. We note, however, that without a more rigorous study of what drives the turbulence and other non-thermal gas motions and how those processes may change with halo mass, we cannot derive a halo mass scaling for the modified virial temperature to confirm this scenario. A substantial amount of the \ion{O}{6} in a galaxy halo may arise from a cooler, photoionized phase rather than the warm, volume-filling virialized phase \citep{Stern2018,Strawn2020}. The scenario outlined in this subsection assumes most of the observed \ion{O}{6} arises from the warm phase in collisional ionization equilibrium, rather than from a cool phase in photoionization equilibrium. If \ion{O}{6}-hosting gas is primarily cool, then a trend of \ion{O}{6} column density with halo mass would not be tracing the virial temperature of the halo but rather the amount of cool gas in a halo as a function of halo mass. Reality is likely to be a mixture of both scenarios, and distinguishing between them is beyond the scope of this paper. \subsection{The Importance of Turbulence} \label{subsec:turb} The main result of this study is that non-thermal gas motions, such as turbulence, are important to the energy partition of a virialized halo, and this has important consequences for the temperature of the CGM. Significant turbulent motions also have effects that go beyond just modifying the virial temperature: turbulence can provide pressure support to the CGM \citep{Oppenheimer2018,Lochhaas2020} and it can affect how cool gas condenses out of the hot medium \citep{Voit2018} or mixes with the hot medium to efficiently create more cool gas \citep[e.g.,][]{Fielding2020a}. In particular, turbulent pressure drives halo gas away from purely hydrostatic solutions where it is assumed that thermal pressure exactly balances the gravitational potential. The importance of non-thermal pressure support has been known for some time in galaxy clusters, where the idea of a ``hydrostatic mass bias" is well known \citep{Nagai2007,Piffaretti2008,Lau2009,Lau2013,Shi2015,Shi2016,Biffi2016,Shi2018,Simionescu2019,Gianfagna2020}. The hydrostatic mass bias is the difference between inferred cluster mass from a hydrostatic assumption for cluster gas and the true cluster mass, and most studies find differences on the order of $\sim10-20\%$, driven by a non-thermal pressure contribution on the order of $\sim20-30\%$ of the total pressure \citep{Vazza2011,Nelson2014,He2020}. Clearly, non-thermal gas motions are important in galaxy clusters, and there is no reason to suspect that galaxy-scale halos lack significant non-thermal pressure or energy. Indeed, we have shown in this paper that non-thermal kinetic energy is a significant contribution to the energy balance of galaxy-scale halos, and that this has consequences for the temperature of the halo gas. The consequences of significant non-thermal energy on the pressure of the halo gas will be explored in a forthcoming paper. \citet{Rudie2019} observed the CGM of star-forming galaxies at $z\sim2$ and found that the non-thermal broadening of most ions' absorption lines was small, indicating that thermal motions dominate over turbulence. However, the broadening of \ion{O}{6}, the highest ionization state ion probed in that study, was larger, roughly a few tens of km s$^{-1}$. If \ion{O}{6} traces the warmest phase of gas, this would indicate turbulence roughly on the scale of the simulated turbulence in the warmest gas phases in the FOGGIE halos. \citet{Lehner2014} found a similar result for \ion{O}{6}, but also found roughly half of \ion{C}{4} and \ion{Si}{4} absorption lines at high redshift were broader than would be expected from pure thermal broadening, indicating that there may be turbulence in the warm gas phase probed by these mid-ions as well. \citet{Rudie2019} found lower ionization state ions had narrower absorption lines, indicating less turbulent broadening. If lower ions are found in cool clouds embedded within a warmer halo, each individual cloud may not have significant internal turbulence, leading to narrow individual absorption components, but the collection of cool clouds may trace the turbulence of the hot phase in which they are embedded. If that is the case, it is the velocity dispersion between individual cool-phase components that traces the hot-phase turbulence, which \citet{Rudie2019} find to be $\sim100-200$ km s$^{-1}$. Some of these components may be tracing fast-moving coherent structures like outflows or accretion filaments (and indeed they find a subset of absorbers with velocities above the escape velocity of their host halo). \citet{Zahedy2019} carried out a similar analysis at lower redshift ($z\sim0.4$), and found the low-ion absorption lines had a modest amount of non-thermal broadening. Turbulence clearly plays some role in the CGM, but it is unclear as yet how much, and in what gas phases. Turbulence drives motions that cascade down to smaller scales, all the way to the single-cell resolution scale in simulations. If the resolution in a simulation is poor, meaning that the turbulent cascade is cut off, then the turbulent energy in the smaller scales will not be captured. If the small-scale energy in turbulence is significant, a simulation with poor spatial resolution will underestimate the amount of energy in non-thermal, turbulent motions. A deeper analysis of the driving and structure of turbulence in the FOGGIE simulations is beyond the scope of this paper, but we note that FOGGIE's high spatial resolution in the CGM may be required to capture the consequences of substantial non-thermal motions. For example, \citet{Bennett2020} showed an increase of $\sim80\%$ in turbulent energy near the virial radius with increasing resolution (see their Figure 13), which was balanced by a decrease in thermal energy and thus likely temperature, although they do not discuss temperature explicitly. Assuming a turbulent cascade from large to small scales, the majority of the turbulent energy is located in the large scales on which turbulence is first driven, so it may be that this driving scale is all that needs to be resolved in order to capture the majority of the turbulent energy. \citet{Li2020b} found the driving scale for turbulence in galaxy clusters to be on the order of the scale of feedback, so an analysis of the impact of feedback at different scales in CGM simulations may specify the driving scale and thus enlighten the resolution needed to resolve the bulk of the turbulent energy in the CGM. \section{Summary and Conclusions} \label{sec:summary} In this paper, we derived a modified virial temperature by explicitly including the kinetic energy of non-thermal gas motions in the virial equation for a galaxy halo (Equation~\ref{eq:Tvirmod}). We made two estimates for the non-thermal kinetic energy: one that includes only turbulence (Equation~\ref{eq:KEnt_turb}) and one that includes both turbulence and bulk outflows (Equation~\ref{eq:KEnt_turb_out}). We used the Figuring Out Gas \& Galaxies In Enzo simulations to show how non-thermal kinetic energy contributes to $\sim L^*$ galaxy halos roughly equally to thermal kinetic energy, motivating the need for non-thermal kinetic energy in considerations of virial equilibrium. Even when all forms of energy are accounted for, the gas in galaxy halos is generally not in virial equilibrium throughout much of the halos' evolution (Figure~\ref{fig:virial_time}) and only approaches equilibrium at low redshifts when the halo mass surpasses $\mathrm{few}\times10^{11}M_\odot$ and only when strong bursts of stellar feedback are not perturbing the halo gas (Figure~\ref{fig:energy_xcorr}). Finally, we showed that the modified virial temperature is a closer description of the gas temperature for most of the gas mass in the outskirts of a galaxy halo than the standard virial temperature, which is $\sim2\times$ too large, \emph{even when the halo gas is virialized} (Figures~\ref{fig:temp_time} and~\ref{fig:temp_radius}), suggesting that even the gas in \emph{virialized} halos is not fully \emph{thermalized}. The only times when the standard $T_\mathrm{vir}$ is a good descriptor of the gas near $R_{200}$ is for a short time following a strong burst of feedback (Figure~\ref{fig:temp_xcorr}), which may be difficult to ``catch" in observations and only occurs when the halo gas is not in virial equilibrium --- giving the expected temperature for the wrong reason. A lower-than-expected gas temperature in galaxy halos has important implications for analytic CGM models and the initial conditions of idealized CGM simulations. If gas is cooler, thermal pressures are lower, radiative cooling is more efficient, expected X-ray surface brightnesses are lower, and galaxy halos may be able to maintain higher \ion{O}{6} column densities at larger halo masses than expected (\S\ref{sec:implications}). These consequences of lower temperatures may affect analytic models that derive gas physics processes starting from initial assumptions of virial temperature. They also affect idealized simulations of isolated galaxies, where the initial hot halo is frequently put in by hand at the standard virial temperature at the start of the simulation. \textbf{We suggest that analytic models and idealized simulations adopt the modified virial temperature at a factor of $\sim2$ lower than the standard virial temperature for the initial conditions of any model or simulation.} A lower-than-expected halo temperature due to energy contributions from non-thermal motions is not a unique feature in FOGGIE. This phenomenon should be measurable in any self-consistent cosmological simulation where gaseous halos are built up along with galaxies. However, other cosmological simulations with lower spatial resolution than FOGGIE may not be capturing enough of the energy contained in the small scales of the turbulent cascade in order to make a considerable difference to the overall energy of the halo gas. Indeed, it is possible that at the resolution of FOGGIE, there is still some turbulent energy below the resolution scale that we do not capture, so the magnitude of the difference between standard and modified virial temperatures may be even larger than what we find here. A full analysis of the structure of turbulence in the CGM in FOGGIE is forthcoming. \acknowledgments{ This study was primarily funded by NASA via an Astrophysics Theory Program grant 80NSSC18K1105. We are especially grateful to Mark Voit for comments that helped clarify the key concepts of the paper. We also thank Nicolas Lehner, John O'Meara, Philipp Grete, David H.\ Weinberg, and Claire Kopenhafer for useful discussion. We thank the referee for suggestions that ultimately improved the clarity of the paper. CL and RA were additionally supported by HST GO \#15075. BWO acknowledges support from NSF grants no. AST-1517908, OAC-1835213, and AST-1908109, by NASA ATP grants NNX15AP39G and 80NSSC18K1105, and by HST AR \#14315. RCS appreciates support from a Giacconi Fellowship 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. This research was supported in part by the National Science Foundation under Grant No. NSF PHY-1748958. Resources supporting this work were provided by the NASA High-End Computing (HEC) Program through the NASA Advanced Supercomputing (NAS) Division at Ames Research Center and were sponsored by NASA's Science Mission Directorate; we are grateful for the superb user-support provided by NAS. Resources were also provided by the Blue Waters sustained-petascale computing project, which is supported by the NSF (award number ACI-1238993 and ACI-1514580) and the state of Illinois. Blue Waters is a joint effort of the University of Illinois at Urbana-Champaign and its NCSA. \texttt{Enzo} \citep{Bryan2014,BrummelSmith2019} and \texttt{yt} \citep{Turk2011} are developed by a large number of independent researchers from numerous institutions around the world. This research made use of Astropy (http://www.astropy.org), a community-developed core Python package for Astronomy \citep{Astropy1, Astropy2}. Their commitment to open science has helped make this work possible. This work benefited greatly from copious pictures of the FOGGIE team's cats and dog posted to our Slack channel. \facilities{NASA Pleiades} \software{astropy \citep{Astropy1,Astropy2}, Cloudy \citep{Ferland2017}, Enzo \citep{Bryan2014,BrummelSmith2019}, grackle \citep{Smith2017}, yt \citep{Turk2011} } } \section{Introduction} \label{sec:intro} The current paradigm of hierarchical structure formation has been in place for decades \citep{Rees1977,Silk1977,White1978,White1991}. The general mechanism by which galaxies form starts with random density fluctuations in dark matter that collapse over cosmic time into massive dark matter halos. Baryonic matter is similarly gravitationally attracted to dark matter halos, where it collects and eventually forms galaxies \citep[for a review, see][]{Benson2010}. The standard paradigm of galaxy formation supposes that gas falling onto a massive halo, $M_{\rm halo} \gtrsim {\rm few}\times10^{11} M_{\odot}$ \citep{Birnboim2003}, shock-heats to the virial temperature before later cooling at the halo center to form stars. More recent models \citep{Keres2005,Dekel2006,Dekel2009,Nelson2013} show that infalling gas need not shock-heat to high temperatures, but may instead be accreted to the central galaxy along filaments while remaining cold ($T \lesssim 10^{4-5}$ K). Modern simulations show that both hot halos and cold filaments can exist surrounding a galaxy simultaneously, but the presence of a hot, shock-heated gaseous halo is still expected surrounding massive galaxies, even if it is not the primary mode of gas accretion \citep{Bennett2020,Fielding2017,Stern2020a}. In order for gas to form stars at the center of halos, it must be cold (with $T \ll 10^4$ K). The standard paradigm assumes gas either cools radiatively before accreting onto the galaxy or flows onto the galaxy from the intergalactic medium (IGM) without being heated. However, the exact processes by which cold gas forms from, or interacts with, the expected hot halo are not fully understood. The conditions for the formation and survival of the cold gas are strongly dependent on the properties of the hot, diffuse, volume-filling phase of the circumgalactic medium (CGM). In models that attempt to describe hot gas observations or cool gas formation and survival within the hot halo, the hot gas is usually assumed to be static, in hydrostatic equilibrium near the virial temperature, $T_\mathrm{vir}$, of the halo \citep{Maller2004,Anderson2010,Miller2013,Faerman2017,Mathews2017,McQuinn2018,Qu2018,Stern2019,Voit2019a,Faerman2020}. `Idealized' simulations commonly adopt a hydrostatic hot halo at $T_\mathrm{vir}$ as part of their initial conditions \citep{Armillotta2017,Fielding2017,Li2020a}. Small, cold gas clouds may then condense from the hot medium, seeded by thermal instabilities \citep{McCourt2012,Voit2015}. Cold gas may also be seeded by galactic winds, where the hot flow can entrain, precipitate, or carry cold clumps into the CGM \citep{Thompson2016,Schneider2018,Lochhaas2018} to re-accrete later. If cold CGM gas is instead in the form of extended filamentary structures, these structures may pierce through the expected virial shock and hot halo \citep{Keres2005,Dekel2006,Keres2009,Dekel2009,Bennett2020}, interacting with the hot diffuse gas and creating hydrodynamical instabilities at the hot-cold interface \citep{Mandelker2016,Mandelker2020}. Alternatively, cold accreting gas may take the form of a cooling flow, where the hot halo undergoes bulk cooling as it is compressed on its journey to the central galaxy \citep{Mathews1978,Fabian1984,Malagoli1987,Li2012,Stern2019,Stern2020a}. Observations of the CGM typically find both hot and cold gas traced by high- and low-ionization state absorption observed in the UV and optical \citep{Wakker2009,Rudie2012,Werk2013,Stocke2013,Bordoloi2014,Lehner2015,Borthakur2016,Heckman2017,Keeney2017,Chen2018,Berg2018,Berg2019,Rudie2019,Chen2020,Lehner2020} or emission in the X-ray \citep{Anderson2010}. The densities and temperatures are derived from ionization modeling, where generally it is assumed that high-ion absorbers (\ion{O}{6} or \ion{O}{7}) trace a warmer, collisionally-ionized gas phase than low-ionization state absorbers (e.g., \ion{Mg}{2}, \ion{Si}{3}), which trace a cooler, photoionized gas phase \citep[e.g.,][]{Tumlinson2017}. Studies that find a significant mass of cold gas in the CGM of $L^*$ galaxies, $\sim10^{10}M_\odot$, have raised questions about how so much cold gas could be supported in the CGM \citep[e.g.,][]{Werk2014,Keeney2017}. Fitting small, thermal-pressure-supported cold clouds into the standard paradigm of a hydrostatic hot halo is difficult while also matching the cold and hot gas densities inferred from photoionized modeling \citep[but see \citeauthor{Haislmaier2021} \citeyear{Haislmaier2021}]{Werk2014,McQuinn2018}. All such modeling is laden with assumptions about the thermal balance of the CGM that could prove to be mistaken. At larger scales, galaxy cluster and intra-cluster medium (ICM) analytic, simulation, and observational studies have shown that the ICM is not in perfect hydrostatic equilibrium because non-thermal kinetic gas motions are crucial to the overall energy balance of the halo. Bulk non-thermal gas motions, such as turbulence, contribute a significant fraction of pressure support to the cluster gas \citep{Shi2015,Shi2018,Simionescu2019}. This fraction is significant enough to produce a ``hydrostatic mass bias", i.e. the cluster mass derived without including non-thermal pressure support differs from the ``true" cluster mass by $\sim15\%$ on average \citep{Lau2013,Shi2016}. At $\sim L^*$ galaxy halo scales, only recently have simulations begun to show that the standard picture of a hot gaseous halo in hydrostatic equilibrium may not be accurate. \citet{Lochhaas2020} showed that even in idealized $L^*$ CGM simulations initiated with hydrostatic hot halos, galactic feedback creates bulk flows that induce significant turbulence and rapidly drive the halo out of hydrostatic equilibrium. Instead, the halo evolves toward a dynamical equilibrium in which non-thermal turbulent and ram pressure combine with the usual thermal pressure to hold the CGM up against gravity. The simulations of \citet{Oppenheimer2018} also showed the importance non-thermal pressure support of the CGM. \citet{Salem2016}, \citet{Ji2020} and \citet{Butsky2020} found that cosmic rays are also an important non-thermal supporting pressure in the CGM of simulated galaxies. Clearly, the structure of the hot phase, which is so important to models of observed and simulated cold CGM gas at the galaxy halo scale, warrants further investigation beyond a simple assumption of hydrostatic equilibrium at $T_\mathrm{vir}$. In this paper, we apply a virial analysis to simulated galaxy halos from the Figuring Out Gas \& Galaxies In Enzo (FOGGIE) cosmological zoom-in simulations to quantify when and where $\sim L^*$ galaxy halos are in virial equilibrium. We find that dynamic gas motions drive the temperature of the diffuse hot halo below the classical $T_\mathrm{vir}$ by a factor of $\sim2$, even when the halo is in or close to virial equilibrium. We derive a ``modified" virial temperature, which adds explicit treatment of bulk gas motions to the classical definition of $T_\mathrm{vir}$. This modified virial temperature more accurately describes the temperature of gas in the outskirts of the $\sim L^\star$ FOGGIE galaxy halos. A cooler than expected ``hot" halo has significant implications on the thermal pressure and cooling rates of the gas as well as on inferences made from UV absorption line and X-ray emission CGM observations. Section~\ref{sec:derivation} provides the derivation of the modified virial temperature and explains how it differs from the standard virial temperature. Section~\ref{sec:FOGGIE} describes the FOGGIE simulations and the basic analysis we use throughout the paper. Section~\ref{sec:virial} presents how we assess the virial equilibrium of the FOGGIE halos (\S\ref{subsec:assessing}) and the results of this assessment (\S\ref{subsec:virial_results}). Section~\ref{sec:Tmod} describes how we calculate the modified virial temperature in the FOGGIE simulations (\S\ref{subsec:calc_Tmod}) and shows that the modified virial temperature accurately describes the simulated halo gas when the halo is in virial equilibrium (\S\ref{subsec:T_results}). Section~\ref{sec:xcorr} explores the impact of strong bursts of star formation feedback on the energy and temperature of the CGM. In Section~\ref{sec:implications}, we describe the implications of a lower temperature for the thermal pressure of the CGM (\S\ref{subsec:th_pres}), the CGM cooling time (\S\ref{subsec:tcool}), CGM mass estimates from X-ray observations (\S\ref{subsec:xray}), the origin of the \ion{O}{6} ion (\S\ref{subsec:OVI}), and the importance of turbulence to the CGM (\S\ref{subsec:turb}). We conclude in Section~\ref{sec:summary}. Appendix~\ref{sec:Rvir_def} shows our results do not depend on the precise definition of the virial radius or the virial theorem. \section{Deriving Virial Temperature} \label{sec:derivation} In the standard paradigm of galaxy formation, the gaseous halo bound to a galaxy is virialized within the potential well of the dark matter halo such that \begin{equation} \mathrm{PE} - \Sigma = -2\mathrm{KE}, \label{eq:virial} \end{equation} where PE is the potential energy of the galaxy and its dark matter halo, KE is the kinetic energy of the halo gas, and $\Sigma$ is a boundary pressure working with gravity to confine the halo gas from the outside. Gas falling into the halo is heated by passing through a virial shock at roughly the virial radius, so it is assumed that the kinetic energy of gas infall is completely thermalized into a thermal energy, $\mathrm{KE}_\mathrm{th}$, which is given by \begin{equation} \mathrm{KE}_\mathrm{th} = \frac{3}{2}\frac{k_B T}{\mu m_p}, \label{eq:TE} \end{equation} where $T$ is the temperature, $\mu=0.6$ is the molecular weight per particle for fully ionized gas of primarily primordial composition, $k_B$ is the Boltzmann constant and $m_p$ is the mass of the proton. Note that Equation~\ref{eq:TE} gives the specific thermal energy of the gas, which is the energy per unit gas mass. Through the virial equation (Eq.~\ref{eq:virial}), the (specific) potential energy of the gas is thus directly related to the temperature of the gas, and this temperature is defined as virial temperature $T_\mathrm{vir}$ \citep[e.g.,][]{Mo2010}: \begin{equation} T_\mathrm{vir}=\frac{1}{2}\frac{\mu m_p}{k_B}\frac{GM_{200}}{R_{200}}, \label{eq:Tvir} \end{equation} where $M_{200}$ and $R_{200}$ are the halo virial mass and radius, respectively, and $G$ is the gravitational constant. This definition of the virial temperature assumes the halo gas can be adequately described by a singular isothermal sphere density profile. In general, this may not be applicable for real galactic halos, but we show in Appendix~\ref{sec:SIS} that this approximation holds reasonably well in the outskirts of our simulated halos, near $R_{200}$. Throughout this paper, we define $R_{200}$ as the radius enclosing an overdensity 200 times the critical density of the universe, which evolves with redshift (although we always use an overdensity factor of 200, regardless of redshift). We show in Appendix~\ref{sec:Rvir_def} that our results are insensitive to the exact choice of overdensity in the definition of virial radius, and so robust against inconsistent practice for this quantity in the existing literature. Equation~(\ref{eq:Tvir}) assumes the specific potential energy of gas in a dark matter halo at the virial radius is described by \begin{equation} \mathrm{PE} = -\frac{GM_{200}}{R_{200}} \label{eq:PE} \end{equation} and the boundary pressure term is described by \begin{equation} \Sigma=\frac{1}{2}\frac{GM_{200}}{R_{200}}. \label{eq:Sigma} \end{equation} Again, both equations~\ref{eq:PE} and~\ref{eq:Sigma} assume a singular isothermal sphere halo gas density profile. See Appendix~\ref{sec:SIS} for explicit calculation of these terms without assuming a particular gas density profile. The definition of virial temperature (\ref{eq:Tvir}) makes a strong, deeply embedded assumption about the energy partition in gas-filled dark-matter halos: that all the potential energy of gas flowing into the halo is fully thermalized into internal thermal energy and that gas turbulence and bulk flows contribute nothing, by definition, to the overall energy of the halo gas when the system is in virial equilibrium. To explore the consequences of explicitly including non-thermal motions (such as turbulence and bulk flows) in the energy partition of the halo, we rewrite the virial equation (Eq.~\ref{eq:virial}) to explicitly include kinetic energy from both thermal and non-thermal motions: \begin{equation} \mathrm{PE}-\Sigma=-2(\mathrm{KE}_\mathrm{th}+\mathrm{KE}_\mathrm{nt}) \end{equation} where PE is still given by Equation~\ref{eq:PE}, the thermal kinetic energy $\mathrm{KE}_\mathrm{th}$ is given by Equation~\ref{eq:TE}, and the kinetic energy due to non-thermal gas motions is $\mathrm{KE}_\mathrm{nt}$. Plugging these in and rewriting, we find a modification to the virial temperature, $T_\mathrm{mod}$, that explicitly includes non-thermal gas motions, given by: \begin{equation} T_\mathrm{mod}=\frac{1}{2}\frac{\mu m_p}{k_B}\frac{GM_{200}}{R_{200}} - \frac{2}{3}\frac{\mu m_p}{k_B}\mathrm{KE}_\mathrm{nt} \label{eq:Tmod} \end{equation} or \begin{equation} T_\mathrm{mod}=T_\mathrm{vir} - \frac{2}{3}\frac{\mu m_p}{k_B}\mathrm{KE}_\mathrm{nt}. \label{eq:Tvirmod} \end{equation} Both $T_\mathrm{vir}$ and $T_\mathrm{mod}$ assume the virial equation (Eq.~\ref{eq:virial}) holds. A halo in perfect virial equilibrium does not contain any sources or sinks of energy --- the gas can only transfer energy between its potential and kinetic energies. Star formation, feedback, and radiative cooling provide sources and sinks of energy in the halo that can drive a departure from virial equilibrium. Therefore, we expect the virial temperature (either the standard $T_\mathrm{vir}$ or the modified $T_\mathrm{mod}$) to be a good descriptor of halo gas only far from the galaxy where these sources and sinks operate, at galactocentric radii $\gtrsim0.5R_{200}$. By comparing the thermal energy of the gas in the FOGGIE halos (see \S\ref{sec:FOGGIE} below) to its radiative cooling rate, we confirm that the cooling time in the outskirts of the halos we study here is longer than the Hubble time and radiative energy losses are small compared to thermal and kinetic energy of the gas, and thus we neglect energy sinks in the outskirts of the halos. However, we note that the radiative cooling is not entirely negligible, and neglecting it is a caveat to the virial equilibrium argument at a $\sim10\%$ level (see Appendix~\ref{sec:cooling}). In detail, there may be events in a galaxy's history that lead to temporary departures from virial equilibrium even near the virial radius: mergers may lead to especially strong bursts of star formation feedback that may unbind a portion of the halo's gas. Likewise, there may be spatially distinct parts of the halo that do not participate in the overall balance of virial equilibrium, such as cosmological filaments that can pierce inward through the virial shock without being heated \citep[e.g.][]{Bennett2020} or strong outflows faster than the escape velocity of the halo (see \S\ref{subsec:calc_Tmod}). \citet{Fielding2020b} analyzed the properties of the CGM across many idealized and cosmological simulations, finding that the properties of the outer CGM ($r\gtrsim0.5R_{200}$) tend to be set by cosmological structure formation whereas the properties of the inner CGM ($r\lesssim0.5R_{200}$) tend to be set by feedback processes in the central galaxy \citep[a result also corroborated by][]{Stern2020b}, validating our choice to focus on the outer CGM. We note that neither $T_\mathrm{vir}$ nor $T_\mathrm{mod}$ will capture all relevant physics that sets the temperature of the warm gas in a galaxy halo. Both are built on the assumption of a singular isothermal sphere profile, an assumption which only holds in the outskirts of the halo (see Appendix~\ref{sec:SIS}). If the warm gas is in hydrostatic equilibrium, its temperature must increase toward the center of the gravitational potential well (see Figure~\ref{fig:temp_radius} and \S\ref{subsec:T_results}), a property that is not captured by converting the potential energy near $R_{200}$ into a single temperature through the virial theorem. In this paper, we work within the limitations of the concept of virial temperature to describe the warm halo gas temperature in the outskirts of simulated galaxy halos. Our goal is to formulate a more accurate estimate of the widely-used virial temperature through the concept of energy budget accounting within the halo gas, and ensure our findings are still as intuitive as the concept behind the standard $T_\mathrm{vir}$. \begin{figure} \centering \includegraphics[width=\linewidth]{mass_vs_t_Tempest.pdf} \includegraphics[width=\linewidth]{mass_vs_t_Squall.pdf} \includegraphics[width=\linewidth]{mass_vs_t_Maelstrom.pdf} \caption{The total (black solid), dark matter (red dashed), stellar (blue dotted) and gaseous (green dash-dotted) masses within $R_{200}$ for the three galaxies from the FOGGIE suite considered in this work, arranged from least massive to most massive at $z=0$ top to bottom.} \label{fig:masses} \end{figure} \section{The Simulations: Figuring Out Gas \& Galaxies In Enzo} \label{sec:FOGGIE} To explore energy partition in realistic halo simulations and assess the viabilty of the modified virial temperature for characterizing the bulk properties of the CGM, we use simulations from the Figuring Out Gas \& Galaxies In Enzo (FOGGIE) project. These simulations are described fully in the previous papers FOGGIE I -- IV \citep{Peeples2019,Corlies2020,Zheng2020,Simons2020}, but we briefly describe the relevant parts here for convenience. \begin{table} \centering \begin{tabular}{l r r r} Property & Tempest & Squall & Maelstrom \\ \hline $^\mathrm{a}R_{200}$ [kpc] & 168.3\phantom{0} & 195.93 & 211.87 \\ $^\mathrm{b}M_{200}$ [$10^{11}M_\odot$] & 5.04 & 8.02 & 10.12 \\ $^\mathrm{c}M_\mathrm{DM,200}$ [$10^{11}M_\odot$] & 4.26 & 6.56 & 8.45 \\ $^\mathrm{d}M_{\star,200}$ [$10^{10}M_\odot$] & 5.44 & 12.34 & 11.55 \\ $^\mathrm{e}M_\mathrm{gas,200}$ [$10^{10}M_\odot$] & 2.33 & 2.28 & 5.15 \\ \end{tabular} \caption{Properties of the three FOGGIE halos studied in this paper at $z=0$.\\$^\mathrm{a}$ Radius enclosing an average density of $200\times$ the critical density of the universe at $z=0$.\\$^\mathrm{b}$ Total mass enclosed within $R_{200}$.\\$^\mathrm{c}$ Dark matter mass enclosed within $R_{200}$.\\$^\mathrm{d}$ Stellar mass enclosed within $R_{200}$. Includes satellites.\\$^\mathrm{e}$ Gas mass enclosed within $R_{200}$. Includes ISM of central and satellites.} \label{tab:halo_props} \end{table} FOGGIE is run using the adaptive mesh refinement (AMR) code Enzo \citep{Bryan2014,BrummelSmith2019}\footnote{https://enzo-project.org}. As introduced in \citet{Simons2020}, six halos with roughly the Milky Way's present day total mass were selected from a cosmological volume 143.88 comoving Mpc on a side to be re-simulated in ``zoom-in" regions, where additional spatial refinement of at least 1.10 comoving kpc is forced in a box 287.77 comoving kpc on a side centered on the galaxy as it moves through the cosmological domain. Within this ``forced-refinement'' box, the resolution is refined further up to 274.44 comoving pc using an adaptive ``cooling refinement'' criterion in which one cell is replaced with 8 cells when the product of gas cooling time and sound speed is smaller the original cell size. The cooling refinement scheme places high resolution elements where they are needed most, in the high density and/or rapidly cooling cells, saving computational resources with less refinement in the hot and/or lowest density phases. However, the forced refinement region keeps the warm, diffuse gas resolved to a high level even in the absence of short cooling times, allowing detailed kinematics to be resolved and reducing the degree of artificial mixing frequently present in simulations with standard refinement schemes. In the outskirts of the halo that we focus on in this paper, the typical spatial resolution is set at the fixed, minimum refinement of the forced-refinement tracking box, where cells are 1.10 comoving kpc on a side, because there is not much gas there with very short cooling times. The galaxies chosen to be simulated at high resolution have their last significant merger ($<$ 10:1 mass ratio) prior to $z = 2$, to be similar to the Milky Way merger history. This generally means they do not have strong bursts of star formation or feedback driving their halo gas significantly away from equilibrium at low redshifts (see \S\ref{subsec:virial_results}), making them an excellent choice for this study that depends on the halo gas being in or near virial equilibrium. At the time of this writing, three of the six FOGGIE galaxies have been run to $z = 0$, Tempest, Squall, and Maelstrom, so we focus on just these three in this paper (see \citeauthor{Simons2020} \citeyear{Simons2020} for more information on these halos). However, we expect our results to be generally applicable and not specific to the properties of these galaxies and their halos. Figure~\ref{fig:masses} shows the build-up of gaseous, stellar, dark matter, and total masses within $R_{200}$ in these three halos over the redshift range considered here, $z\sim2$ to $z=0$. Table~\ref{tab:halo_props} shows the final properties of each halo at $z=0$. By $z\sim 1$, each galaxy's total mass is above the threshold where a virial shock is expected to form and remain stable, $M_h\sim {\rm few} \times 10^{11}M_\odot$ \citep{Birnboim2003}. Maelstrom, being the most massive of the three galaxies, surpasses this threshold by $z\sim1.5$. In general, the build-up of all types of mass within $R_{200}$ becomes smooth and slowly increasing at late times. Squall is an exception because it continues to undergo gas-rich minor mergers at late times that drive the star formation rate up and lead to bursty changes in the stellar or gas masses within $R_{200}$. We select $\sim190$ snapshots in time between $z=2$ and $z=0$, separated by $\sim50$ Myr, for each of the halos. The FOGGIE runs are set up to output a snapshot every $\sim5$ Myr but for the bulk of our analysis (Sections~\ref{sec:virial} and~\ref{sec:Tmod}), we use only every tenth snapshot in time and perform all analysis on each of these snapshots. We divide up the outer CGM between $0.3R_{200}$ and $1.3R_{200}$ into 100 radial bins (of width $0.01R_{200}$) to compute the properties of the CGM gas as functions of radius. In what follows, we take the radial bin $0.99R_{200} < r <R_{200}$ as the bin representing the gas near $R_{200}$.\footnote{This shell of width $0.01R_{200}$ contains $\sim200,000-300,000$ cells. We recalculated all results with a shell of width $0.1R_{200}$ and found no qualitative difference in using shells of different widths except for smoother radial profiles, so we continue with the thinner shell.} At low redshift, $R_{200}$ for the FOGGIE halos examined here falls partially inside and partially outside of the forced refinement region. We test the impact of combining high and low resolution cells within a single spherical shell by re-calculating all results using only the high-resolution cells in the shell near $R_{200}$ and find it has a minor quantitative and no qualitative effect on our results. The higher-resolution cells can better resolve the gas kinematics and thus contain somewhat more non-thermal kinetic energy overall than the low-resolution cells, which serves to somewhat \emph{strengthen} the difference between $T_\mathrm{vir}$ and $T_\mathrm{mod}$ and strengthen our qualitative conclusions. We proceed with using all cells within the shell at $R_{200}$ rather than only the high-resolution cells, but note that perhaps a cosmological simulation with higher forced resolution than FOGGIE would find an even stronger difference between $T_\mathrm{vir}$ and $T_\mathrm{mod}$ than we report here. This result shows the importance of high resolution within the diffuse CGM gas. \begin{figure*} \centering \includegraphics[width=0.49\linewidth]{DD2427_temperature_x_slice_Tempest_z0.pdf} \includegraphics[width=0.49\linewidth]{DD2427_radial_velocity_x_slice_Tempest_z0.pdf} \includegraphics[width=0.49\linewidth]{DD2427_temperature_x_slice_filaments-removed_Tempest_z0.pdf} \includegraphics[width=0.49\linewidth]{DD2427_radial_velocity_x_slice_filaments-removed_Tempest_z0.pdf} \caption{Slices of gas temperature (left) and radial velocity (right) in the Tempest halo at $z=0$ before and after cutting satellite ISM and filament gas (top and bottom panels, respectively). The black circle shows the location of $R_{200}$. The satellite cut removes a negligible amount of mass and volume from the domain for this halo at this redshift, but the filament cut removes $\sim37\%$ of the gas mass and $\sim22\%$ of the volume between $0.3R_{200}$ and $R_{200}$.} \label{fig:slices} \end{figure*} \section{Virial Energy of the FOGGIE Halos} \label{sec:virial} Because both the standard virial temperature and the modified virial temperature are built on the assumption of virial equilibrium, we start by assessing when and where the FOGGIE halos are in virial equilibrium. Throughout the paper, when we say a halo is ``virialized", what we mean is that {\it the warm halo gas} has kinetic and potential energies that nearly or exactly satisfy Equation~\ref{eq:virial}. We focus exclusively on the warm halo gas because it is this component of the CGM for which we are interested in deriving a temperature. In principle, all components of the galaxy system --- including the dark matter, the stars in the disk, and the interstellar medium gas --- contribute their energies to the overall energy balance and virialization of the system. The standard definition of virial temperature (Equation~\ref{eq:Tvir}) assumes the warm halo gas is {\it virialized into} the gravitational potential well set by the dark matter halo, and thus separates out just this part of the system. We note that an energy budget accounting of the entire galactic halo system would nearly always produce a virialized system, even if the energy accounting of the warm halo gas alone does not strictly satisfy equation~\ref{eq:virial}. In this way, we use the term ``virialized" to refer to an energy budget accounting for the warm halo gas alone, rather than as a statement about the equilibrium for the entire system. Note, as well, the difference between ``virialized" and ``thermalized." If the warm halo gas satisfies Equation~\ref{eq:virial}, it is {\it virialized}. However, that does not imply that all kinetic energy of the gas is in the form of thermal kinetic energy, that is, it does not imply the gas is fully {\it thermalized}. Indeed, we will show below that, in our simulations, only half of the halo gas's kinetic energy is thermal. \subsection{Assessing Virial Equilibrium} \label{subsec:assessing} First, we remove the parts of the CGM that do not contribute to the warm halo gas that we focus on here: satellites and filaments. Satellites are excised from the domain by removing all gas cells with a density $>2\times10^{-26}$ g cm$^{-3}$ and temperature $<1.5\times10^4$ K. In some cases, this method does not perfectly remove all gas associated with a satellite, but it does eliminate confusion of satellite ISM gas with host halo CGM gas. To remove filaments, we excise all gas with an inward radial velocity faster than half of the local free-fall velocity, $v_\mathrm{ff}=r/\sqrt{3\pi/(32G\rho)}$, where $r$ is the galactocentric radius of the gas parcel, $G$ is the gravitational constant, $\rho=\frac{3}{4\pi}\frac{M_\mathrm{enc}(<r)}{r^3}$ is the average mass density within $r$, and $M_\mathrm{enc}(<r)$ is the total mass (dark matter, gas, and stars) contained within radius $r$. We chose to remove gas with inward radial velocities greater than $\frac{1}{2}v_\mathrm{ff}$ because some inflow filaments have enough tangential motion that their radial velocities are not exactly $v_\mathrm{ff}$, and we found that a fraction of $\frac{1}{2}$ removes most filament contamination. Again, this cut does not perfectly remove all filament gas, but it removes enough that the filament contamination to virialized CGM gas is small in most cases. Outflows, in the form of galactic winds launched from the central galaxy and any of its satellites, have a different source than the warm, volume-filling halo gas and are unlikely to have an energy budget that follows the virial theorem. However, outflows have a range of velocities, making them difficult to select and remove cleanly, and they may also mix into the ambient CGM to become part of the virialized halo gas. Rather than attempt to remove coherent structures of outflows like we do with satellites and filaments, we do not consider any gas with an outward radial velocity greater than the escape velocity at its location in the dark matter halo to be contributing to the virial balance of the halo gas. Near the virial radius, very little gas is moving fast enough to escape the halo at times when the halo gas is in virial equilibrium (see Figure~\ref{fig:vel_dist} and discussion in \S\ref{subsec:calc_Tmod}). Figure~\ref{fig:slices} shows temperature and radial velocity slices through the center of the Tempest halo at $z=0$, before and after the cuts to remove satellite ISM and filaments. In both cases, we remove the central $0.3R_{200}$ to eliminate the galaxy and extended disk. This particular snapshot of this halo does not have any satellites in the plane of this slice, but the filament cut removes an extended wedge-shaped filament in the bottom right of the panel, primarily gas with $T\lesssim10^5$ K and $v_r<-100$ km s$^{-1}$. For Tempest at $z=0$, the satellite cut removes $0.4\%$ of all gas mass between $0.3R_{200}$ and $R_{200}$ while the filament cut removes $37.4\%$ of all gas mass in the same region. The total gas mass between $0.3R_{200}$ and $R_{200}$ is $5.5\times10^9M_\odot$ before any cuts and is $3.45\times10^9M_\odot$ after removing satellites and filaments. By volume, the satellite cut removes $0.01\%$ of the volume between $0.3R_{200}$ and $R_{200}$ and the filament cut removes $21.6\%$ of the volume. Both the standard and the modified virial temperatures assume the halo gas near $R_{200}$ is in virial equilibrium, i.e. that Equation~(\ref{eq:virial}) is satisfied. We generally expect this to be true unless the halo is experiencing galaxy mergers or a strong burst of energy input in the form of feedback \citep{Fielding2020b,Stern2020b}. Rather than assuming the virial equation holds, we explicitly measure it within the FOGGIE halos. We measure directly whether the gas at $R_{200}$ is in virial equilibrium by summing the potential, kinetic, and thermal energies of the gas in a thin spherical shell\footnote{Formally, the virial theorem applies to all gas in the system, not just within a thin shell. However, the assumption of a singular isothermal sphere as the density profile implies that the energy of gas located within a shell will be in equilibrium if the entire system is in equilibrium. We use the shell definition of the virial energy throughout the paper as it allows us to focus on just the outskirts of the halo, but see Appendix~\ref{sec:SIS} for a comparison of shell virial energies to whole-system virial energies.}. We focus on the outer CGM, where we expect virial equilibrium to hold. We define the ``virial energy", VE, to be this sum: \begin{equation} \mathrm{VE} = \mathrm{PE} - \Sigma + \sum2\left(\mathrm{KE}_\mathrm{nt} + \mathrm{KE}_\mathrm{th}\right) \label{eq:VE} \end{equation} where PE is given by Equation~(\ref{eq:PE}) multiplied by the gas mass in the shell, the boundary pressure term $\Sigma$ is given by Equation~(\ref{eq:Sigma}), and the thermal and non-thermal kinetic energies are obtained by direct sum over all cells in the spherical shell. We use the total energies, not the specific energies as we did in Eqs.~(\ref{eq:virial}) through Eq.~(\ref{eq:Tvirmod}), making Equation~(\ref{eq:VE}) a true measurement of the total energies of the gas contained within the shell. If the gas satisfies virial equilibrium, then VE $=0$. \subsection{Halos are in Virial Equilibrium Only When Non-Thermal Kinetic Energy is Included} \label{subsec:virial_results} \begin{figure} \centering \includegraphics[width=\linewidth]{all_energies_vs_t_Tempest.pdf} \includegraphics[width=\linewidth]{all_energies_vs_t_Squall.pdf} \includegraphics[width=\linewidth]{all_energies_vs_t_Maelstrom.pdf} \caption{Energies of the gas within $0.99R_{200}<r<R_{200}$ as a function of cosmic time (bottom axis) and redshift (top axis). All energies are normalized by $\frac{GM_{200}}{R_{200}}$. The virial energy (Eq.~\ref{eq:VE}) is plotted as the thick, red line. The thermal kinetic energy of the gas is plotted as the green dashed line and the non-thermal kinetic energy is plotted as the blue dotted line. A thin solid red line indicates the virial energy of the gas near $R_{200}$ if $\mathrm{KE}_\mathrm{nt}$ is neglected in the virial equation. The SFR of the central 20 kpc of the halo is shown as the thin black line, with values indicated on the right axis.} \label{fig:virial_time} \end{figure} Figure~\ref{fig:virial_time} shows the virial energy VE (thick red line) given by Equation~(\ref{eq:VE}) in a radial shell $0.99R_{200}<r<1.0R_{200}$ over cosmic time as the halos evolve from $z=2$ to $z=0$. None of the halos have gas near $R_{200}$ in perfect virial equilibrium for extended periods of time; instead their VE oscillates as the halos evolve, approaching values near zero only at low redshift or during periods of low star formation rate (SFR). The SFR is plotted as the thin black line, with values marked on the right axis, and is calculated as all new stars formed since the previous time step within 20 kpc of the center of the halo. It is clear that there is a correlation between star formation bursts and when the gas near $R_{200}$ is out of virial equilibrium, for example at $z\sim0.3$ or $z\sim1.5$ in Tempest (top panel). At lower redshift, the gas near $R_{200}$ stabilizes and approaches virial equilibrium, but bursts of stellar feedback still drive the gas near $R_{200}$ away from equilibrium temporarily (this direct cause-and-effect relationship will be discussed further below, see \S\ref{sec:xcorr}). Tempest, being the lowest-mass halo, has its gas near $R_{200}$ significantly perturbed away from equilibrium by relatively small bursts of star formation and does not approach steady virial equilibrium until rather late in its evolution, $z\lesssim0.2$. Squall is more massive (see Figure~\ref{fig:masses}), but has very strong bursts of star formation that drive its gas significantly out of equilibrium. Nonetheless, its gas approaches virial equilibrium somewhat earlier than Tempest, $z\lesssim0.4$. Maelstrom, the most massive halo of the three, has gas roughly in virial equilibrium (thick red line close to zero) throughout much of its evolution $z\lesssim0.75$, despite a significant number of star formation bursts. Maelstrom's SFR peaks to higher values, and more frequently, than Tempest's (at $z\lesssim1$), and yet the bursts do not drive its gas as far out of virial equilibrium as Tempest's bursts do. It seems the ability of strong feedback events to perturb gas near $R_{200}$ is dependent on the mass of the halo. \begin{figure} \centering \includegraphics[width=\linewidth]{DD2427_all_energies_vs_r_Tempest.pdf} \includegraphics[width=\linewidth]{DD2360_all_energies_vs_r_Squall.pdf} \includegraphics[width=\linewidth]{DD2510_all_energies_vs_r_Maelstrom.pdf} \caption{Energies of the gas within the halos, as in Figure~\ref{fig:virial_time}, as a function of distance from the center of the halo and normalized by $\frac{GM_\mathrm{enc}(r)}{r}$. The snapshots shown here are chosen as the latest times when the gas near $R_{200}$ is close to virial equilibrium (VE $\approx0$), marked in the panels for each halo. Squall is far from equilibrium at $z=0$ so we show the next closest time it is roughly in equilibrium, $z=0.06$. The other halos are roughly in equilibrium at $z=0$.} \label{fig:virial_radius} \end{figure} We expect the gas near $R_{200}$ to be at the virial temperature (either $T_\mathrm{vir}$ or $T_\mathrm{mod}$) only when the gas near $R_{200}$ satisfies VE $\sim0$. However, the gas near $R_{200}$ is \emph{not} in perfect virial equilibrium throughout much of the halos' evolution --- instead, the gas's virial energy oscillates near zero and is perturbed by feedback events, especially at higher redshift. The thin red line in Figure~\ref{fig:virial_time} shows the virial energy of the gas near $R_{200}$ if the non-thermal kinetic energy of bulk flows is neglected, like in the standard definition of virial temperature. This curve falls below the VE $=0$ at all times other than following strong bursts of star formation for all halos. At late times, when the halos are massive enough to maintain virialized halos, neglecting the non-thermal kinetic energy in the energy balance of the halo would lead to the conclusion that the halo gas is under-virialized and under-supported and should be collapsing. It is only when the non-thermal kinetic energy is included that the halo gas can be said to be close to virialized (even if perfect virial equilibrium is not achieved long-term). Figure~\ref{fig:virial_time} also shows the thermal and non-thermal kinetic energies of the gas near $R_{200}$ as the green dashed and blue dotted curves, respectively. This figure illustrates our basic finding that the gas near $R_{200}$ has roughly equal amounts of thermal and non-thermal kinetic energy at nearly all times. Shortly after strong bursts of feedback, both the thermal energy and the non-thermal kinetic energy increase, as feedback both heats and accelerates gas. Figure~\ref{fig:virial_radius} shows the same energy components as in Figure~\ref{fig:virial_time}, but as a function of radius at a given snapshot in time, over the radius range $0.3R_{200}$ to $1.3R_{200}$ (note that the vertical scale differs from Figure~\ref{fig:virial_time}). Each halo's snapshot was chosen to reflect a time when the gas near $R_{200}$ in each halo is roughly in virial equilibrium, which is $z=0$ for Tempest, $z=0.06$ for Squall, and $z=0$ for Maelstrom. The halo gas is closest to virial equilibrium for $r\gtrsim0.5R_{200}$, and again we see that neglecting the non-thermal kinetic energy in the virial equation leads to a configuration that is far out of equilibrium. Feedback drives the gas away from equilibrium in the inner regions of each halo, and some residual feedback-driven outflows that traveled to the outer halo can push it out of virial equilibrium near $R_{200}$ as well, as in the case of Squall (middle panel). Figure~\ref{fig:virial_radius} shows that at $z=0$ we expect any temperature derived from the virial equation to be a poor description of the gas within $r\lesssim0.5R_{200}$, where the virial energy deviates strongly from zero. However, the virial energy is not exactly zero for most of the volume and time so we do not expect either $T_\mathrm{vir}$ or $T_\mathrm{mod}$ to be a perfect descriptor of the gas temperature. In summary, we find that while the gas in the outskirts of the FOGGIE halos are rarely in perfect virial equilibrium (VE $=0$), their virial energies (Equation~\ref{eq:VE}) are close to zero for much of the later stages of their evolution, when they are massive enough to be expected to host a hot halo \citep[see discussion surrounding Figure~\ref{fig:masses} in \S\ref{sec:derivation} and][]{Birnboim2003}. Their normal state is to be close to VE near $R_{200}$, except when strong bursts of star formation feedback temporarily drive the halo out of equilibrium, after which it settles back into an equilibrium state. Neglecting the non-thermal kinetic energy contribution to the overall energy balance of the halo would suggest the gas in these halos are further out of virial equilibrium than they really are, suggesting that the halo gas is in fact \emph{virialized} without being fully \emph{thermalized}. We have shown that the non-thermal kinetic energy is an important component of energy partition in halos and should not be neglected in analyses that rely on accurate characterization of their main properties. \section{Modified Virial Temperature in FOGGIE Halos} \label{sec:Tmod} With an understanding of when (periods of low SFR) and where ($r\gtrsim0.5R_{200}$) the CGM gas is in virial equilibrium and thus when and where we expect $T_\mathrm{mod}$ to be a good descriptor of the gas temperature, we move on to calculating the modified virial temperature for the FOGGIE halos. We measure the distribution of gas temperatures at each radius in the simulations and compare to both $T_\mathrm{mod}$ and $T_\mathrm{vir}$ to determine if the modified virial temperature is a better descriptor of the mass-weighted peak gas temperature in the CGM than the standard virial temperature. \subsection{Calculating Modified Virial Temperature} \label{subsec:calc_Tmod} \begin{figure*} \centering \includegraphics[width=\linewidth]{DD1477_velocity_PDFs_Tempest_z0p5.pdf} \includegraphics[width=\linewidth]{DD2427_velocity_PDFs_Tempest_z0.pdf} \caption{Mass-weighted distributions of velocities of gas within $0.99R_{200}<r<R_{200}$ are shown as the black solid lines, split into the three spherical directions: $\theta$ (left), $\phi$ (middle), and radial (right). The top row shows gas near $R_{200}$ at $z=0.5$ and the bottom row shows gas near $R_{200}$ at $z=0$, both in the Tempest halo. The best-fit Gaussian model (to the two tangential velocity directions) and the best-fit double-Gaussian model (to the radial velocity direction) are shown as the blue dashed lines. For the double-Gaussian model, the two Gaussians that make it up are shown with thin blue dashed lines. Dotted vertical lines show the location of the best-fit mean of the Gaussian and dotted horizontal lines show $\pm1$ best-fit standard deviation. The best-fit values are printed in each panel.} \label{fig:vel_dist} \end{figure*} To compute $T_\mathrm{mod}$ we need a measurement of the non-thermal kinetic energy $\mathrm{KE}_\mathrm{nt}$, and thus both the turbulent velocity and the bulk flow velocity of the gas. As gas velocities are tracked explicitly, cell-by-cell, at runtime, we could use the simulated velocity fields to obtain a measure of the non-thermal kinetic energy as in \S\ref{sec:virial}. However, rather than integrate all the cell-level data directly, we will use statistical descriptions of their distributions in velocity space within radial shells, as gas velocities are typically more accessible in CGM observations than the unknown sum of all kinetic energies. In doing so, we must be careful to consider coherent bulk flows, such as filaments and fast outflows, apart from localized turbulence or convective motions. First, we decompose the CGM velocity into spherical components: radial velocity $v_r$ and velocities $v_\theta$ and $v_\phi$ tangential to the radial direction (Figure~\ref{fig:vel_dist}). The tangential velocities are defined arbitrarily, \emph{not} relative to the disk of the galaxy. Near the virial radius, we find that any rotation in the filament-removed CGM gas is negligible at times when the halo is near virial equilibrium (i.e. at $z=0$ in the Tempest halo, Figure~\ref{fig:vel_dist}), so we do not include bulk CGM rotation in our accounting of the halo's non-thermal gas motions.\footnote{Observations and simulations alike have found the CGM to be rotating within $\sim0.5R_{200}$ \citep{HodgesKluck2016,Ho2019,Martin2019,Ho2020}, although \citet{Oppenheimer2018} shows rotation is sub-dominant to other forms of non-thermal gas motions at the virial radius.} The spread of the tangential velocity distributions will thus be a good tracer for turbulent or convective non-thermal motions. We perform a least-squares fit of Gaussian distributions of the form \begin{equation} f_\mathrm{tan}(v)=A\exp{\frac{-(v-\mu)^2}{2\sigma^2}} \end{equation} to the two tangential velocity distributions to obtain the peak velocity, $\mu$, and velocity dispersion, $\sigma$, of the two tangential velocity distributions (the amplitude $A$ is a free parameter that has no physical meaning in this case, as all of the velocity distributions being fit are normalized). This also allows us to confirm that the peak of these distributions are close to zero, indicating a small net rotation. The left and center panels of Figure~\ref{fig:vel_dist} show the two tangential velocity distributions with their best-fit Gaussian distributions for the gas near $R_{200}$ in the Tempest halo at $z=0.5$ and $z=0$, as an example. At $z=0.5$, the gas does show some bulk rotation in the $\theta$ direction as indicated by a non-zero $\mu=-27$ km s$^{-1}$, but the rotation is not long-lived or coherent, generally appearing and disappearing from snapshot to snapshot as the halo evolves. By $z=0$, there is no significant rotation of the Tempest halo's gas near $R_{200}$ in either the $\theta$ or $\phi$ directions, as indicated by $\mu\approx0$ for both tangential velocity directions. The radial velocity distribution will have a contribution from turbulent motions, assuming turbulence in the CGM is isotropic, but it will also have contributions from galactic outflows that reach large distances. Thus, we do not expect the radial velocity distribution to be symmetric, nor necessarily peaked close to zero. To fit the radial velocity distribution, we perform a least-squares fit to the sum of two Gaussian distributions of the form \begin{equation} f_r(v)=A_1\exp{\frac{-v^2}{2\sigma_\mathrm{tan}^2}} + A_2\exp{\frac{-(v-\mu_r)^2}{2\sigma_r^2}} \end{equation} where the first term in the sum represents the contribution due to turbulence and the second term represents the contribution due to bulk outflows. The turbulence Gaussian has its mean fixed to 0 km s$^{-1}$ and its standard deviation fixed to $\sigma_\mathrm{tan}$, where $\sigma_\mathrm{tan}$ is the best-fit standard deviation of a Gaussian fit to the tangential velocity distribution (not shown), given by $v_\mathrm{tan}=\sqrt{v_\theta^2+v_\phi^2}$. The outflow Gaussian's mean and standard deviation are unconstrained, but it is defined to be zero for $v<0$ km s$^{-1}$ so that it measures strictly the bulk outflow component of the radial velocity. Both Gaussians' amplitudes are unconstrained. The right panels in Figure~\ref{fig:vel_dist} show the radial velocity distribution along with the best-fit sum of Gaussians to the distribution. The cut to remove filaments removes all gas with $v_r\lesssim50$ km s$^{-1}$ (this value changes slightly with redshift), and galactic outflows can be seen as the Gaussian component shifted toward large positive velocities. With the velocity distributions characterized, we can compute the non-thermal kinetic energy from either turbulence only or turbulence and bulk flows. Because we do not expect significant rotation of the CGM near the virial radius and the means of the best-fit Gaussians to the tangential velocity distributions are close to zero, we use only the standard deviation of the best-fit Gaussians to the tangential velocity distributions as a measure of turbulent velocity. Turbulence will always contribute to the virialization and non-thermal kinetic energy of the gas, but it is unclear how much, if at all, bulk outflows with velocities $<v_\mathrm{esc}$ in the radial velocity distribution contribute to the virialization of the halo. It could be that outflows produce a perturbation from virial equilibrium for the halo (like filaments and satellite galaxies) and thus should not be included in the derivation of the modified virial temperature, or it could be that outflows provide a necessary supporting force for the halo and thus should be included. Instead of attempting to characterize how much outflows contribute to the virialized, non-thermal kinetic energy, we define two ways of calculating the modified virial temperature: one with only turbulence, and one with both turbulence and bulk outflows. The total kinetic energy per mass (specific kinetic energy) of a velocity distribution is $\int \frac{1}{2}v^2f(v)\ \mathrm{d}v$ where $f(v)$ is the probability of a parcel of gas having a velocity between $v$ and $v+\mathrm{d}v$, normalized such that $\int f(v)\ \mathrm{d}v = 1$. For a Gaussian velocity distribution, like we find for the tangential velocity distributions, the specific kinetic energy is simply $\frac{1}{2}\sigma^2$ where $\sigma$ is the standard deviation of the Gaussian, the velocity dispersion. For the radial velocity distribution, we model $f(v)$ as the sum of two Gaussians, one of which cuts off for $v_r<0$ km s$^{-1}$, so we compute $\int \frac{1}{2}v_r^2f(v_r)\ \mathrm{d}v_r$ directly from the best-fit function, which includes both the radial-direction turbulent velocity distribution and the outflow velocity distribution. The specific kinetic energy of a velocity distribution that can be described as a three-dimensional Gaussian is given by $\mathrm{KE}=\frac{1}{2}(\sigma_\theta^2+\sigma_\phi^2+\sigma_r^2)$, where each $\sigma$ is the velocity dispersion in one of the three directions. In our case, we have measured velocity dispersions for the two tangential dimensions and assume that the velocity dispersion in the third, radial dimension can be described as the average of the tangential dispersions, $\sigma_r^2=\frac{1}{2}(\sigma_\theta^2+\sigma_\phi^2)$. The non-thermal kinetic energy due to turbulence alone is then \begin{equation} \mathrm{KE}_\mathrm{nt}^{\mathrm{turb}}=\frac{1}{2}\left(\frac{3}{2}\sigma_\theta^2+\frac{3}{2}\sigma_\phi^2\right) \label{eq:KEnt_turb} \end{equation} where $\sigma_\theta$ and $\sigma_\phi$ are the standard deviations of the best-fit Gaussians to the $\theta$ and $\phi$ velocity distributions, respectively. The non-thermal specific kinetic energy of both turbulence and bulk outflows is given by \begin{equation} \mathrm{KE}_\mathrm{nt}^{\mathrm{turb+out}}=\frac{1}{2}\left(\sigma_\theta^2+\sigma_\phi^2\right) + \frac{1}{2}\int_{-0.5v_{\rm ff}}^{v_\mathrm{esc}} v_r^2 f(v_r)\ \mathrm{d}v_r \label{eq:KEnt_turb_out} \end{equation} where the lower bound of the integral reflects the cut made to remove the inflow filaments (see \S\ref{subsec:assessing}), and the upper bound at the escape velocity $v_\mathrm{esc}$ assumes that outflows that are fast enough to escape the halo do not contribute to the virialization of the halo. Note that the contribution of turbulence in the radial direction is included in $f(v_r)$ within the integral, so the factor of $3/2$ has been dropped from the first term in the sum. The standard virial temperature $T_\mathrm{vir}$ is a single temperature for all locations in the halo, by the singular isothermal sphere definition. However, for $T_\mathrm{mod}$ we can derive a radius-dependent form by making some simple substitutions. In Equation~(\ref{eq:Tmod}), we replace $M_{200}$ with $M_\mathrm{enc}(<r)$, the enclosed mass within a radius $r$, and replace $R_{200}$ with $r$ (this is equivalent to replacing $M_{200}$ and $R_{200}$ in the potential energy term given by equation~\ref{eq:PE} with $M_\mathrm{enc}(<r)$ and $r$, respectively)\footnote{We allow the temperature $T_\mathrm{mod}$ to vary although we still use the singular isothermal sphere assumption for the form of PE (equation~\ref{eq:PE}). In this case, the singular isothermal sphere assumption governs the gas density and halo gravitational potential profiles, rather than the temperature.}. We also measure $\sigma_\mathrm{\theta}$, $\sigma_\mathrm{\phi}$, and $\int \frac{1}{2}v_r^2f(v_r)\ \mathrm{d}v_r$ within radial bins. This gives \begin{equation} T_\mathrm{mod}^{\mathrm{turb}}=\frac{1}{2}\frac{\mu m_p}{k_B}\left[\frac{GM_\mathrm{enc}(<r)}{r} - \left(\sigma_\theta(r)^2+\sigma_\phi(r)^2\right)\right]. \label{eq:Tvirmod_r_turb} \end{equation} and \begin{align} &T_\mathrm{mod}^{\mathrm{turb+out}}=\frac{1}{2}\frac{\mu m_p}{k_B}\left[\frac{GM_\mathrm{enc}(<r)}{r} - \right. \nonumber \\ &\left.\frac{2}{3}\left(\sigma_\theta(r)^2+\sigma_\phi(r)^2 + \int_{-0.5v_{\rm ff}(r)}^{v_\mathrm{esc}} v_r^2 f(v_r,r)\ \mathrm{d}v_r \right)\right]. \label{eq:Tvirmod_r_turb_out} \end{align} In equations~(\ref{eq:Tvirmod_r_turb}) and~(\ref{eq:Tvirmod_r_turb_out}), we find $\sigma_{\theta}(r)$, $\sigma_{\phi}(r)$, and $f(v_r,r)$ by fitting these functional forms to the velocity distributions in bins of radius, from $0.3R_{200}$ to $1.3R_{200}$, of radial width $0.01R_{200}$. We now have all the analytic tools we need to compare $T_\mathrm{vir}$ and $T_\mathrm{mod}$ as descriptions of simulated halo gas. \subsection{$T_\mathrm{mod}$ Better Describes the CGM Temperature than $T_\mathrm{vir}$} \label{subsec:T_results} Figure~\ref{fig:temp_time} shows two-dimensional mass-weighted histograms of the gas within $0.99R_{200}<r<R_{200}$ in temperature-time space. Darker shading indicates the temperature of a larger fraction of the gas mass at $R_{200}$. The standard virial temperature (Equation~\ref{eq:Tvir}) is shown as the dashed orange line and the modified virial temperature, calculated either with turbulence alone or with turbulence and bulk outflows (equations~\ref{eq:Tvirmod_r_turb} or~\ref{eq:Tvirmod_r_turb_out}, respectively) is shown as the dotted red and solid red lines, respectively. When there is a strong burst of star formation, the temperature histogram of gas near $R_{200}$ shifts upward to higher temperatures as feedback heats the CGM. At low redshift and during quiescent periods, when the gas near $R_{200}$ is closest to virial equilibrium (see Figure~\ref{fig:virial_time}), The darkest parts of the histograms indicate the temperature range of the majority of the gas mass, and $T_\mathrm{mod}$ passes closer to this temperature range than the standard $T_\mathrm{vir}$, which over-estimates the temperature of the gas near $R_{200}$ by roughly a factor of two at nearly all times unless feedback is coincidentally heating the CGM gas. \begin{figure} \centering \includegraphics[width=\linewidth]{temperature_vs_t_mass-colored_Tempest.pdf} \includegraphics[width=\linewidth]{temperature_vs_t_mass-colored_Squall.pdf} \includegraphics[width=\linewidth]{temperature_vs_t_mass-colored_Maelstrom.pdf} \caption{The temperature of gas with $0.99R_{200}<r<R_{200}$ is shown as a mass-weighted distribution as a function of cosmic time (bottom axis) and redshift (top axis), with dark colors indicating the peak of the mass-weighted temperature distribution. The orange dashed line shows the standard virial temperature (Equation~\ref{eq:Tvir}) and red solid and red dashed lines show the modified virial temperature, calculated using the kinetic energy due to turbulence only (Equation~\ref{eq:Tvirmod_r_turb}) or both turbulence and outflows (Equation~\ref{eq:Tvirmod_r_turb_out}), respectively. The thin black line shows the star formation rate, with values on the right axis.} \label{fig:temp_time} \end{figure} Figure~\ref{fig:temp_radius} shows a mass-weighted two-dimensional histogram of temperature of CGM gas as a function of distance from the halo center compared to the standard virial temperature (orange dashed line) and the two calculations for the modified virial temperature (solid red for turbulence-only, Equation~\ref{eq:Tvirmod_r_turb}, dotted red for turbulence and outflows, Equation~\ref{eq:Tvirmod_r_turb_out}), at the same time snapshots as in Figure~\ref{fig:virial_radius} for each halo. The distribution is smoother at smaller radii where more of the cells in a given radial bin are refined to a higher resolution (see \S\ref{sec:FOGGIE}). In the outskirts of the halos, where the gas is closest to virial equilibrium (see Figure~\ref{fig:virial_radius}), $T_\mathrm{mod}$ passes closer to the darkest regions of the mass-weighted temperature distribution than the standard $T_\mathrm{vir}$ does. Both $T_\mathrm{vir}$ and $T_\mathrm{mod}$ fail to describe the temperature of the gas in the inner regions of the halo, where the gas temperature rises. In these inner regions, the halo gas is not in virial equilibrium (see Figure~\ref{fig:virial_radius}), so it is not expected that any temperature derived from the virial theorem will accurate describe this gas. In the inner regions of halos, there are several physical processes occurring that are not captured by an energy budget accounting through the lens of the virial theorem: there are sources (feedback) and sinks (radiative cooling) of energy, the singular isothermal sphere assumption used in both $T_\mathrm{vir}$ and $T_\mathrm{mod}$ does not describe the gravitational potential as well as it does in the outskirts of the halo (Appendix~\ref{sec:SIS}), and an increased gas temperature where the gravitational potential is stronger is expected from hydrostatic equilibrium but not captured by virial equilibrium arguments. For these reasons, we focus on the outskirts of the halo when using the virial theorem to estimate the halo gas temperature (although note that even at large radii, radiative cooling plays a minor role in the gas energy balance; see Appendix~\ref{sec:cooling}). The standard $T_\mathrm{vir}$ overestimates the temperature of the majority of the gas (by mass) by a factor of $\sim2$ at the virial radius, where we would expect the $T_\mathrm{vir}$ to describe the gas temperature best. The modified virial temperature calculated including both turbulence and bulk outflows, $T_\mathrm{mod}^\mathrm{turb+out}$, performs somewhat better in describing the peak of the temperature distribution (darkest shading) near $R_{200}$ than $T_\mathrm{mod}^\mathrm{turb}$ calculated from turbulence alone, without bulk outflows, in Tempest and Squall, whereas it makes no difference in Maelstrom, perhaps indicating that the kinetic energy due to outflows is more important to include in the overall energy balance of lower-mass halos. \begin{figure} \centering \includegraphics[width=\linewidth]{DD2427_temperature_vs_radius_mass-colored_Tempest.pdf} \includegraphics[width=\linewidth]{DD2360_temperature_vs_radius_mass-colored_Squall.pdf} \includegraphics[width=\linewidth]{DD2510_temperature_vs_radius_mass-colored_Maelstrom.pdf} \caption{The mass-weighted temperature of the filament- and satellite-removed CGM gas at times when the region near $R_{200}$ is in virial equilibrium (as indicated in each panel) is shown as a two-dimensional histogram in temperature-radius space, with dark colors indicating the peak of the mass-weighted temperature distribution at a given radius. The standard virial temperature (Equation~\ref{eq:Tvir}) is radius-independent and shown as the orange dashed line. The two ways of calculating the modified virial temperature, with and without bulk outflows (Equations~\ref{eq:Tvirmod_r_turb_out} and~\ref{eq:Tvirmod_r_turb}) are shown as the dotted and solid red lines, respectively.} \label{fig:temp_radius} \end{figure} When the kinetic energy due to bulk outflows is included in the energy balance of gas near $R_{200}$, the corresponding $T_\mathrm{mod}$ is smaller because the $\mathrm{KE}_\mathrm{nt}$ term in Equation~(\ref{eq:Tvirmod}) is larger, driving a larger deviation below the standard $T_\mathrm{vir}$. Because it is unclear how much, if at all, outflows with $v<v_\mathrm{esc}$ contribute to the energy budget of the CGM gas, we report both $T_\mathrm{mod}^\mathrm{turb}$ and $T_\mathrm{mod}^\mathrm{turb+out}$ and do not pick one or the other as a better description of the temperature of the majority by mass of the CGM gas. However, Figure~\ref{fig:temp_time} indicates there are some times when it appears $T_\mathrm{mod}^\mathrm{turb+out}$ passes closer to the peak of the temperature distribution near $R_{200}$ than $T_\mathrm{mod}^\mathrm{turb}$, which indicates there are some times in the halo's history when outflows are an important contributor to the energy budget of the halo gas, and some times when they are not (although note that outflows faster than the escape velocity are never included in $T_\mathrm{mod}^\mathrm{turb+out}$). In addition, at different radii within the halo one or the other form of $T_\mathrm{mod}$ may be a closer description of the peak of the gas temperature distribution, indicating that outflows may only be important to the energy budget at certain radii. We also see from Figure~\ref{fig:temp_radius} that neither form of $T_\mathrm{mod}$ is an appropriate descriptor of the gas temperature at small radii where the assumption of virial equilibrium breaks down, as expected (see \S\ref{subsec:virial_results}). \section{Feedback Drives Deviations from Equilibrium} \label{sec:xcorr} While $T_\mathrm{mod}$ is clearly a better descriptor of the gas temperature in the outskirts of the FOGGIE halos than $T_\mathrm{vir}$ for most each halos' evolution, there are times following strong bursts of star formation when outflows push the halo gas out of virial equilibrium and away from $T_\mathrm{mod}$ or $T_\mathrm{vir}$ (Figure~\ref{fig:temp_time}). Here, we quantify this cross-correlation between the SFR and energy or temperature of the gas near $R_{200}$ explicitly. \begin{figure} \centering \includegraphics[width=\linewidth]{xcorr_energy-SFR_vs_delay-t_Tempest.pdf} \includegraphics[width=\linewidth]{xcorr_energy-SFR_vs_delay-t_Squall.pdf} \includegraphics[width=\linewidth]{xcorr_energy-SFR_vs_delay-t_Maelstrom.pdf} \caption{The cross-correlation between SFR and various energies of the gas near $R_{200}$ as a function of time delay (Equation~\ref{eq:xcorr}). The correlation is positive for $\tau\lesssim1-1.5$ Gyr and peaks at $\tau\sim25-75$ Myr, quantifying what is easy to see by eye in Figure~\ref{fig:virial_time}, that the halo is driven out of virial equilibrium by strong bursts of feedback.} \label{fig:energy_xcorr} \end{figure} Figure~\ref{fig:energy_xcorr} shows a time-delay cross-correlation between the central galaxy's SFR and the energy of the gas at $R_{200}$. The cross-correlation is computed as \begin{equation} \xi(\tau)=\frac{1}{N}\sum_{i}^{N} \frac{[\mathrm{SFR}(t_i) - \overline{\mathrm{SFR}}][\mathrm{E}(t_i-\tau) - \overline{\mathrm{E}}]}{\sigma_\mathrm{SFR}\sigma_\mathrm{E}} \label{eq:xcorr} \end{equation} where SFR$(t_i)$ is the star formation rate and E$(t_i)$ is the energy, which can be VE (Equation~\ref{eq:VE}), $\mathrm{KE}_\mathrm{th}$, or $\mathrm{KE}_\mathrm{nt}$, at time snapshot $t_i$. $\overline{\mathrm{SFR}}$ and $\overline{\mathrm{E}}$ are the averages of SFR and energy over the time from $z=2$ to $z=0$, $\sigma_\mathrm{SFR}$ and $\sigma_\mathrm{E}$ are the standard deviations of SFR and energy over time, $\tau$ is a time-delay shift of one function relative to the other, and the sum is taken over all $N$ time snapshots. This function is normalized such that $\xi(\tau)=1$ would indicate a perfect correlation between SFR and energy at a time delay of $\tau$, $\xi(\tau)=-1$ would indicate a perfect anti-correlation at $\tau$, and $\xi(\tau)=0$ indicates no correlation at $\tau$. We perform this calculation over every snapshot output by the FOGGIE runs, separated by $\sim5$ Myr, in order to capture short-time variations in the energy and temperature of the halo. This is a factor of ten increase in time resolution over the analysis in Sections~\ref{sec:virial} and~\ref{sec:Tmod}. Figure~\ref{fig:energy_xcorr} shows that at time delays $\tau\lesssim1-1.5$ Gyr, SFR and VE, $\mathrm{KE}_\mathrm{nt}$, and $\mathrm{KE}_\mathrm{th}$ (except for Maelstrom, see below) are all positively correlated, peaking at $\tau\sim25$ Myr for Tempest and $\tau\sim75$ Myr for Squall and Maelstrom. This means that stronger star formation is correlated with a higher energy of gas near $R_{200}$ $\sim25-75$ Myr later\footnote{Note that the value of $\tau$ where the cross-correlation peaks is not strictly a travel time of outflows from the galaxy to $R_{200}$ because the duration of the star formation burst also helps set $\tau$.}, and it takes $\sim1-1.5$ Gyr for the energy of the gas near $R_{200}$ to fully ``relax" to what it was before the period of higher star formation, as can also be seen in Figure~\ref{fig:virial_time}. The strong correlation between SFR and gas energy at $R_{200}$ confirms what was suspected from Figure~\ref{fig:virial_time}: strong bursts of feedback, driven by large SFRs, is what drives the gas near $R_{200}$ away from the halo's ``natural state" of virial equilibrium. This further emphasizes why both $T_\mathrm{vir}$ and $T_\mathrm{mod}$ fail at describing the halo gas following a burst of star formation or in the inner regions of the halo most strongly affected by feedback: the virial theorem provides a tool for accounting for different forms of energies in the halo gas, and when the virial energy of the gas defined by equation~(\ref{eq:VE}) is not close to zero, the prerequisite for $T_\mathrm{vir}$ or $T_\mathrm{mod}$ to be descriptive is not met. Interestingly, Squall shows two prominent peaks in the cross-correlation, but the second peak at $\sim800$ Myr is likely driven by the two extremely strong bursts of star formation at $\sim7.5$ Gyr and $\sim8.2$ Gyr (see middle panel of Fig.~\ref{fig:virial_time}) rather than predicting a cause-and-effect behavior. We verify this is the case by capping the SFR at $20 M_\odot$ yr$^{-1}$ and re-calculating the cross-correlation, which greatly diminishes the strength of the second peak without affecting the primary peak at 75 Myr (not shown). For large $\tau$, the cross-correlation samples fewer points and so it can be disproportionately driven by a handful of extreme events. Maelstrom shows the weakest correlation strength between SFR and energy of the gas near $R_{200}$ out of the three halos examined here. It is also the most quiescent of the three halos, with few very strong bursts of SFR that would be expected to drive the halo away from virial equilibrium, and this lack of strong peaks in both the SFR and the energy (see bottom panel of Fig.~\ref{fig:virial_time}) is likely what produces the weakest correlation in Figure~\ref{fig:energy_xcorr}. However, there is still a general trend of positive correlation between VE and $\mathrm{KE}_\mathrm{nt}$ and SFR, with a weak peak at $\sim100$ Myr, that declines over 1 Gyr. Interestingly, there is an anti-correlation between SFR and $\mathrm{KE}_\mathrm{th}$ in Maelstrom roughly constant with time-delay, which is not seen in either Squall or Tempest, but a strong positive correlation with $\mathrm{KE}_\mathrm{nt}$. This indicates that despite Maelstrom's general quiescence compared to the other two halos where it appears bursts of star formation do not heat the gas much, the non-thermal kinetic motions triggered by star formation feedback are still important to the overall energy balance (or lack thereof) of the gas at $R_{200}$. Figure~\ref{fig:temp_xcorr} shows a similar time-delay cross-correlation, this time correlating the SFR with the mass of gas at $R_{200}$ within different temperature bins relative to the standard $T_\mathrm{vir}$ as marked on the figure (calculated with Equation~\ref{eq:xcorr}, but replacing E$(t_i)$ and $\overline{\mathrm{E}}$ with the mass in a temperature bin at $t_i$ and averaged over time, respectively). The two hottest temperature bins ($\gtrsimT_\mathrm{vir}$) in Tempest and Squall are positively correlated with bursts of SFR, indicating that the presence of $\simT_\mathrm{vir}$ gas at $R_{200}$ is due to star formation feedback, \emph{not} that the gas at $R_{200}$ is naturally at $T_\mathrm{vir}$ when the halo is fully relaxed. The two coolest temperature bins ($\lesssimT_\mathrm{vir}$) are anticorrelated with the SFR in Tempest and Maelstrom, indicating that bursts of star formation remove cool gas mass from $R_{200}$. This trend can be seen by eye in Figure~\ref{fig:temp_time}, where the only time the gas at $R_{200}$ is close to or greater than the standard $T_\mathrm{vir}$ (orange dashed line in that figure) is shortly following a burst of feedback, after which the temperature drops again as the halo relaxes. Like the energy cross-correlation, the temperature cross-correlation takes $\sim1-1.5$ Gyr to relax to the state it was prior to the burst of SFR. The highest temperature bin (solid orange) peaks sooner than the next-highest (dashed pink) temperature bin, a signature of the general declining temperature trend after a strong burst of star formation seen in Figure~\ref{fig:temp_time}. In Squall, while the two highest temperature bins are positively correlated with SFR, the two lowest temperature bins are not particularly correlated with SFR in either a positive or a negative direction. This may indicate that Squall has significant cool gas mass in the halo regardless of feedback, and that bursts of feedback simply add more hot gas without removing cool gas near $R_{200}$. Just like above with the energy-SFR cross-correlation, the secondary peak in the hot gas mass in Squall is driven by just two of the strongest starburst events and is greatly reduced if we cap the SFR at $20 M_\odot$ yr$^{-1}$ (not shown). Maelstrom shows the opposite trend, where the two hottest temperature bins are not particularly correlated with SFR while the two coolest temperature bins are strongly anti-correlated with SFR. The anti-correlation of cool gas mass with SFR is expected if feedback heats the gas near $R_{200}$, but lack of correlation with hot gas is unexpected and may just suggest that there are not enough significant peaks in the SFR to drive the gas temperature near $R_{200}$ significantly away from its equilibrium value. This seems to be corroborated by Figure~\ref{fig:temp_time} (bottom panel), where the temperature of the gas near $R_{200}$ does not exhibit as many short deviations to high temperatures as in the other halos. \begin{figure} \centering \includegraphics[width=\linewidth]{xcorr_temp-SFR_vs_delay-t_Tempest.pdf} \includegraphics[width=\linewidth]{xcorr_temp-SFR_vs_delay-t_Squall.pdf} \includegraphics[width=\linewidth]{xcorr_temp-SFR_vs_delay-t_Maelstrom.pdf} \caption{The cross-correlation between SFR and mass in different temperature bins relative to the standard $T_\mathrm{vir}$ as indicated in the figure, as a function of time delay $\tau$ (Equation~\ref{eq:xcorr}). The mass in the warmer temperature bins is positively correlated with SFR while the mass in the cooler bins is anticorrelated, quantifying what is easy to see by eye in Figure~\ref{fig:temp_time}, that temperatures $\gtrsimT_\mathrm{vir}$ are only achievable following a burst of SFR and \emph{not} when the halo is in relaxed virial equilibrium.} \label{fig:temp_xcorr} \end{figure} \section{Implications of a Cooler CGM} \label{sec:implications} In Sections~\ref{sec:virial} through~\ref{sec:xcorr}, we found that across cosmic time and throughout the outskirts of a galactic halo, non-thermal gas motions are critical to understanding the energy partition and the temperature of the halo gas. For the simulated halos studied here, virial equilibrium holds near $R_{200}$ only if non-thermal kinetic energies are included in the energy balance and only when the halo is not being perturbed by strong feedback, proving that the halo gas can be virialized without being fully thermalized. The consequence of this finding is that the standard virial temperature $T_\mathrm{vir}$ overestimates the peak of the gas temperature distribution by a factor of $\sim2$ when the halo is relaxed. Instead, the modified virial temperature, which is calculated taking these non-thermal gas motions into account, is a better descriptor of the halo gas near $R_{200}$. The end result is a somewhat cooler galactic halo than expected from standard virial arguments. While we carefully calculate the contribution to the energy budget of bulk flows here, this may not be possible in many cases, such as in interpreting observations or in analytic models or idealized simulations of $L^*$ galaxy halos. In these cases, we suggest using a halo temperature roughly a factor of 2 lower than the standard virial temperature. The factor of two arises due to the roughly equal contributions of thermal and non-thermal energies to the halo's energy budget throughout most of its evolution (see Figure~\ref{fig:virial_time}), which we suggest as a general rule of thumb in cases where emergent non-thermal kinetic energies cannot be explicitly calculated. Observations of the diffuse gas making up the CGM, especially in the outskirts of galaxy halos, are typically done in absorption line studies against the light from a bright background source. This generally restricts the derived information to at most a handful of lines of sight through any given galaxy's halo \citep[an important exception is M31, for which multiple sightlines through the same galaxy's CGM can be obtained,][]{Lehner2015,Lehner2020}, and restricts the dimensionality of that information to only line-of-sight velocities. Galaxy formation simulations or cosmological simulations can provide more information than these pencil-beam observations, but they may be under-resolving the small-scale structure of the CGM, especially on scales far from the galaxy. In addition, the implementation of star formation and feedback in the central galaxy varies across different simulations and with resolution. It is necessary to develop and analyze analytic models for the CGM to tie the differing information from observations and simulations back to the gas physics that govern the CGM, and it is in the context of these analytic models where a cooler-than-expected CGM has significant implications that we outline below. \subsection{Thermal Pressure of the CGM} \label{subsec:th_pres} Absorption-line surveys of the CGM routinely discover both hot ($T\sim10^6$ K) and cool ($T\sim10^4$ K) gas, frequently in the same line of sight and at the same line-of-sight velocity \citep{Tumlinson2013,Bordoloi2014,Borthakur2015,Werk16, Keeney2017,Berg2018,Chen2018,Muzahid2018}. Ionization modeling of low-ionization state absorption lines produces estimates of the gas density that tend to show that the cool gas density is similar to the hot gas density \citep{Werk2014,Stern2016} despite large temperature differences, and thus the two gas phases are out of pressure equilibrium. However, multiphase CGM models that pose the cold phase is found in small clouds embedded within the volume-filling hot phase generally expect that the cool and hot gas are in pressure equilibrium at the pressure of the hot phase \citep{Mo1996,Maller2004}. An overall cooler CGM can help alleviate this discrepancy somewhat, as a lower temperature for the hot phase reduces its thermal pressure and thus reduces the thermal pressure needed in the cold phase to match it, allowing the cold phase to be more diffuse. A factor of two decrease in hot-phase temperature leads to a factor of two decrease in the expected cold-phase density if the phases are in pressure equilibrium. The detailed multiphase ionization modeling of \citet{Haislmaier2021} finds the warm and cool gas phases may actually be in pressure equilibrium in some cases, but out-of-equilibrium solutions are not entirely ruled out, and those authors also find that the thermal gas pressure of all phases (regardless of whether they are in pressure equilibrium with each other) is lower than typically expected for $\sim L^\star$ halos. A lower thermal pressure may be explained by the cooler-than-expected volume-filling phase of the halo we present in this paper, although it may not be enough to fully rectify thermal pressure differences between phases and a shallower pressure gradient \citep{Voit2019a,Voit2019b} or non-thermal pressure from turbulence or cosmic rays is likely needed \citep{Salem2016,Oppenheimer2018,Butsky2020,Ji2020,Lochhaas2020}. \subsection{Cooling Time of CGM Gas} \label{subsec:tcool} The efficiency of radiative cooling is strongly dependent on temperature and peaks around $T\sim10^5$ K for metal-enriched gas. At these \ temperatures, CGM gas produces many intermediate ions such as \ion{C}{4}, \ion{Si}{4}, and potentially \ion{O}{6}, all species that are frequently found in absorption in the CGM surrounding Milky Way-like galaxies. This intermediate-temperature gas may live in radiatively-cooling interface regions between hot and cold phases, which grow as hot and cold gas turbulently mix together \citep[e.g.,][]{Begelman1990,Slavin1993,Wakker2012,Kwak2015,Ji2019,Fielding2020a,Tan2020}. A cooler hot phase means less mixing is required for gas to reach intermediate temperatures and cool efficiently, perhaps allowing cooling to proceed more quickly than would be expected in a hotter medium. This could lead to more cool gas forming by entraining mass from the hot phase, explaining observations of the cool and intermediate phases. While we find that cooling does not dominate the overall energy balance of the halo at more than a $\sim10\%$ level (see Appendix~\ref{sec:cooling}), the lower gas temperature may seed cooling on small scales that can explain observations without upsetting the global balance. \subsection{CGM Mass Estimates from X-Ray Observations} \label{subsec:xray} X-ray studies observe the hot component of the CGM of both the Milky Way and external galaxies. X-ray emission is strongly dependent on the gas density, so typically the CGM is only observed in X-ray emission in the densest regions closest to massive galaxies. A popular strategy for characterizing the hot CGM gas that emits in X-ray is to fit its density profile with a $\beta$ model, which is a power-law profile where the parameter $\beta$ describes the power. To estimate the total mass of hot gas in a galaxy's CGM, the $\beta$ model is extrapolated out to the virial radius and integrated \citep{Anderson2010,Gupta2012,Das2019}, finding $\sim10^{9-10} M_\odot$ of hot gas within the halo \citep{Anderson2010}. This method assumes that the gas maintains its hot temperature out to the virial radius and that it is only the decline in density that leads to the decrease in X-ray surface brightness below detection limits in the outskirts of galaxy halos. In addition, fits to X-ray spectra may infer gas temperatures higher than the peak of the temperature distribution \citep{Vijayan2021}. Figure~\ref{fig:temp_radius} shows that the gas temperature decreases with increasing radius approaching the virial radius, and is a factor of $\sim2$ lower than the commonly-assumed virial temperature, so that mass estimates of the hot gas from $\beta$ models may not be accurate. If the decrease of gas temperature with increasing radius is what drives the low X-ray surface brightness in the outskirts of galactic halos, rather than lack of gas mass, the gas mass in the halo's volume-filling phase may be higher than estimated. However, the volume-filling gas is not ``hot" ($T > 10^6$ K) but ``warm" ($T = 10^5 - 10^6 K$, see Figure~\ref{fig:temp_radius}), so the \emph{hot gas} contribution to the mass of the halo may be lower than estimated even if the \emph{volume-filling} gas phase contribution to the halo mass is higher than estimated. A detailed analysis of the relative contribution of each gas phase to the mass budget of the CGM is beyond the scope of this paper. \subsection{The Origin of \ion{O}{6}} \label{subsec:OVI} The UV doublet of \ion{O}{6} is the highest-ionization tracer of warm gas that is readily accessible outside the X-ray. \citet{Tumlinson2011} presented correlations of CGM \ion{O}{6} abundance with galaxy properties, finding a bimodality in presence of \ion{O}{6} that depends on SFR of the central galaxy: star-forming galaxies have more \ion{O}{6} in their halos than quiescent galaxies. \citet{Oppenheimer2016} proposed a different source for gas traced by \ion{O}{6}: the ionization fraction of \ion{O}{6} peaks near the virial temperature of roughly Milky Way-mass galaxies such that the \ion{O}{6} bimodality is actually a bimodality in halo mass (and thus virial temperature), rather than relating primarily to SFR. Galaxies living in massive halos have virial temperatures too high for \ion{O}{6} to be prevalent (oxygen ions are instead ionized further to \ion{O}{7} or \ion{O}{8}), and these galaxies are also typically quenched, thus explaining the \ion{O}{6} bimodality with SFR as well. However, \citet{McQuinn2018} showed that there is a slight offset between the halo mass where virial-temperature-tracing \ion{O}{6} is expected to be prevalent and the halo mass where \ion{O}{6} is most frequently observed, such that \ion{O}{6} is detected surrounding more massive halos whose virial temperatures are too large, seemingly, for \ion{O}{6} to survive (see their Figure 3). \citet{McQuinn2018} proposed a spread in gas temperature around the virial temperature as one possible solution to this dilemma, such that some of the gas exists at lower temperatures where \ion{O}{6} can be found. In this paper, we showed the temperature of CGM gas is lower than expected from the classical virial analysis. While we do not yet have enough halos simulated at high resolution to examine this trend with halo mass, the prevalence of the hydrostatic mass bias in galaxy clusters (see \S\ref{subsec:turb}) shows that even very high-mass halos have significant non-thermal gas motions, which should also affect the virial balance and reduce the virial temperature. If the actual temperature of halo gas is lower than expected for halos of all masses, then the halo mass at which the \ion{O}{6} ionization fraction peaks at the virial temperature is larger than expected, potentially explaining why \ion{O}{6} is seen with such abundance surrounding more massive galaxies than expected. The highest-mass halo explored in this paper, Maelstrom, does still show a temperature lower than the standard virial temperature, so it seems likely that halos of all masses will have lower temperatures than expected. We note, however, that without a more rigorous study of what drives the turbulence and other non-thermal gas motions and how those processes may change with halo mass, we cannot derive a halo mass scaling for the modified virial temperature to confirm this scenario. A substantial amount of the \ion{O}{6} in a galaxy halo may arise from a cooler, photoionized phase rather than the warm, volume-filling virialized phase \citep{Stern2018,Strawn2020}. The scenario outlined in this subsection assumes most of the observed \ion{O}{6} arises from the warm phase in collisional ionization equilibrium, rather than from a cool phase in photoionization equilibrium. If \ion{O}{6}-hosting gas is primarily cool, then a trend of \ion{O}{6} column density with halo mass would not be tracing the virial temperature of the halo but rather the amount of cool gas in a halo as a function of halo mass. Reality is likely to be a mixture of both scenarios, and distinguishing between them is beyond the scope of this paper. \subsection{The Importance of Turbulence} \label{subsec:turb} The main result of this study is that non-thermal gas motions, such as turbulence, are important to the energy partition of a virialized halo, and this has important consequences for the temperature of the CGM. Significant turbulent motions also have effects that go beyond just modifying the virial temperature: turbulence can provide pressure support to the CGM \citep{Oppenheimer2018,Lochhaas2020} and it can affect how cool gas condenses out of the hot medium \citep{Voit2018} or mixes with the hot medium to efficiently create more cool gas \citep[e.g.,][]{Fielding2020a}. In particular, turbulent pressure drives halo gas away from purely hydrostatic solutions where it is assumed that thermal pressure exactly balances the gravitational potential. The importance of non-thermal pressure support has been known for some time in galaxy clusters, where the idea of a ``hydrostatic mass bias" is well known \citep{Nagai2007,Piffaretti2008,Lau2009,Lau2013,Shi2015,Shi2016,Biffi2016,Shi2018,Simionescu2019,Gianfagna2020}. The hydrostatic mass bias is the difference between inferred cluster mass from a hydrostatic assumption for cluster gas and the true cluster mass, and most studies find differences on the order of $\sim10-20\%$, driven by a non-thermal pressure contribution on the order of $\sim20-30\%$ of the total pressure \citep{Vazza2011,Nelson2014,He2020}. Clearly, non-thermal gas motions are important in galaxy clusters, and there is no reason to suspect that galaxy-scale halos lack significant non-thermal pressure or energy. Indeed, we have shown in this paper that non-thermal kinetic energy is a significant contribution to the energy balance of galaxy-scale halos, and that this has consequences for the temperature of the halo gas. The consequences of significant non-thermal energy on the pressure of the halo gas will be explored in a forthcoming paper. \citet{Rudie2019} observed the CGM of star-forming galaxies at $z\sim2$ and found that the non-thermal broadening of most ions' absorption lines was small, indicating that thermal motions dominate over turbulence. However, the broadening of \ion{O}{6}, the highest ionization state ion probed in that study, was larger, roughly a few tens of km s$^{-1}$. If \ion{O}{6} traces the warmest phase of gas, this would indicate turbulence roughly on the scale of the simulated turbulence in the warmest gas phases in the FOGGIE halos. \citet{Lehner2014} found a similar result for \ion{O}{6}, but also found roughly half of \ion{C}{4} and \ion{Si}{4} absorption lines at high redshift were broader than would be expected from pure thermal broadening, indicating that there may be turbulence in the warm gas phase probed by these mid-ions as well. \citet{Rudie2019} found lower ionization state ions had narrower absorption lines, indicating less turbulent broadening. If lower ions are found in cool clouds embedded within a warmer halo, each individual cloud may not have significant internal turbulence, leading to narrow individual absorption components, but the collection of cool clouds may trace the turbulence of the hot phase in which they are embedded. If that is the case, it is the velocity dispersion between individual cool-phase components that traces the hot-phase turbulence, which \citet{Rudie2019} find to be $\sim100-200$ km s$^{-1}$. Some of these components may be tracing fast-moving coherent structures like outflows or accretion filaments (and indeed they find a subset of absorbers with velocities above the escape velocity of their host halo). \citet{Zahedy2019} carried out a similar analysis at lower redshift ($z\sim0.4$), and found the low-ion absorption lines had a modest amount of non-thermal broadening. Turbulence clearly plays some role in the CGM, but it is unclear as yet how much, and in what gas phases. Turbulence drives motions that cascade down to smaller scales, all the way to the single-cell resolution scale in simulations. If the resolution in a simulation is poor, meaning that the turbulent cascade is cut off, then the turbulent energy in the smaller scales will not be captured. If the small-scale energy in turbulence is significant, a simulation with poor spatial resolution will underestimate the amount of energy in non-thermal, turbulent motions. A deeper analysis of the driving and structure of turbulence in the FOGGIE simulations is beyond the scope of this paper, but we note that FOGGIE's high spatial resolution in the CGM may be required to capture the consequences of substantial non-thermal motions. For example, \citet{Bennett2020} showed an increase of $\sim80\%$ in turbulent energy near the virial radius with increasing resolution (see their Figure 13), which was balanced by a decrease in thermal energy and thus likely temperature, although they do not discuss temperature explicitly. Assuming a turbulent cascade from large to small scales, the majority of the turbulent energy is located in the large scales on which turbulence is first driven, so it may be that this driving scale is all that needs to be resolved in order to capture the majority of the turbulent energy. \citet{Li2020b} found the driving scale for turbulence in galaxy clusters to be on the order of the scale of feedback, so an analysis of the impact of feedback at different scales in CGM simulations may specify the driving scale and thus enlighten the resolution needed to resolve the bulk of the turbulent energy in the CGM. \section{Summary and Conclusions} \label{sec:summary} In this paper, we derived a modified virial temperature by explicitly including the kinetic energy of non-thermal gas motions in the virial equation for a galaxy halo (Equation~\ref{eq:Tvirmod}). We made two estimates for the non-thermal kinetic energy: one that includes only turbulence (Equation~\ref{eq:KEnt_turb}) and one that includes both turbulence and bulk outflows (Equation~\ref{eq:KEnt_turb_out}). We used the Figuring Out Gas \& Galaxies In Enzo simulations to show how non-thermal kinetic energy contributes to $\sim L^*$ galaxy halos roughly equally to thermal kinetic energy, motivating the need for non-thermal kinetic energy in considerations of virial equilibrium. Even when all forms of energy are accounted for, the gas in galaxy halos is generally not in virial equilibrium throughout much of the halos' evolution (Figure~\ref{fig:virial_time}) and only approaches equilibrium at low redshifts when the halo mass surpasses $\mathrm{few}\times10^{11}M_\odot$ and only when strong bursts of stellar feedback are not perturbing the halo gas (Figure~\ref{fig:energy_xcorr}). Finally, we showed that the modified virial temperature is a closer description of the gas temperature for most of the gas mass in the outskirts of a galaxy halo than the standard virial temperature, which is $\sim2\times$ too large, \emph{even when the halo gas is virialized} (Figures~\ref{fig:temp_time} and~\ref{fig:temp_radius}), suggesting that even the gas in \emph{virialized} halos is not fully \emph{thermalized}. The only times when the standard $T_\mathrm{vir}$ is a good descriptor of the gas near $R_{200}$ is for a short time following a strong burst of feedback (Figure~\ref{fig:temp_xcorr}), which may be difficult to ``catch" in observations and only occurs when the halo gas is not in virial equilibrium --- giving the expected temperature for the wrong reason. A lower-than-expected gas temperature in galaxy halos has important implications for analytic CGM models and the initial conditions of idealized CGM simulations. If gas is cooler, thermal pressures are lower, radiative cooling is more efficient, expected X-ray surface brightnesses are lower, and galaxy halos may be able to maintain higher \ion{O}{6} column densities at larger halo masses than expected (\S\ref{sec:implications}). These consequences of lower temperatures may affect analytic models that derive gas physics processes starting from initial assumptions of virial temperature. They also affect idealized simulations of isolated galaxies, where the initial hot halo is frequently put in by hand at the standard virial temperature at the start of the simulation. \textbf{We suggest that analytic models and idealized simulations adopt the modified virial temperature at a factor of $\sim2$ lower than the standard virial temperature for the initial conditions of any model or simulation.} A lower-than-expected halo temperature due to energy contributions from non-thermal motions is not a unique feature in FOGGIE. This phenomenon should be measurable in any self-consistent cosmological simulation where gaseous halos are built up along with galaxies. However, other cosmological simulations with lower spatial resolution than FOGGIE may not be capturing enough of the energy contained in the small scales of the turbulent cascade in order to make a considerable difference to the overall energy of the halo gas. Indeed, it is possible that at the resolution of FOGGIE, there is still some turbulent energy below the resolution scale that we do not capture, so the magnitude of the difference between standard and modified virial temperatures may be even larger than what we find here. A full analysis of the structure of turbulence in the CGM in FOGGIE is forthcoming. \acknowledgments{ This study was primarily funded by NASA via an Astrophysics Theory Program grant 80NSSC18K1105. We are especially grateful to Mark Voit for comments that helped clarify the key concepts of the paper. We also thank Nicolas Lehner, John O'Meara, Philipp Grete, David H.\ Weinberg, and Claire Kopenhafer for useful discussion. We thank the referee for suggestions that ultimately improved the clarity of the paper. CL and RA were additionally supported by HST GO \#15075. BWO acknowledges support from NSF grants no. AST-1517908, OAC-1835213, and AST-1908109, by NASA ATP grants NNX15AP39G and 80NSSC18K1105, and by HST AR \#14315. RCS appreciates support from a Giacconi Fellowship 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. This research was supported in part by the National Science Foundation under Grant No. NSF PHY-1748958. Resources supporting this work were provided by the NASA High-End Computing (HEC) Program through the NASA Advanced Supercomputing (NAS) Division at Ames Research Center and were sponsored by NASA's Science Mission Directorate; we are grateful for the superb user-support provided by NAS. Resources were also provided by the Blue Waters sustained-petascale computing project, which is supported by the NSF (award number ACI-1238993 and ACI-1514580) and the state of Illinois. Blue Waters is a joint effort of the University of Illinois at Urbana-Champaign and its NCSA. \texttt{Enzo} \citep{Bryan2014,BrummelSmith2019} and \texttt{yt} \citep{Turk2011} are developed by a large number of independent researchers from numerous institutions around the world. This research made use of Astropy (http://www.astropy.org), a community-developed core Python package for Astronomy \citep{Astropy1, Astropy2}. Their commitment to open science has helped make this work possible. This work benefited greatly from copious pictures of the FOGGIE team's cats and dog posted to our Slack channel. \facilities{NASA Pleiades} \software{astropy \citep{Astropy1,Astropy2}, Cloudy \citep{Ferland2017}, Enzo \citep{Bryan2014,BrummelSmith2019}, grackle \citep{Smith2017}, yt \citep{Turk2011} } }
\section{Background}\label{sec:back} We now present an overview of object detection and sampling techniques used in video analytics systems (\autoref{sec:back:obj_det} and \autoref{sec:back:sample}). We later discuss the key techniques used in state-of-the-art systems (\autoref{sec:back:sys}). \subsection{Object Detection}\label{sec:back:obj_det} \begin{figure}[t] \centering \includegraphics[width=0.85\linewidth]{figures/fig_back_obj_det} \caption{\textbf{Object Detection Model} -- Components of the model. } \label{fig:back:obj_det} \end{figure} Object detection models usually contain three components: (1) backbone network, (2) region proposal network (RPN\xspace), and (3) region of interests network (ROI\xspace), as illustrated in~\cref{fig:back:obj_det}. The backbone network extracts the high-level features from a frame. Then, the RPN\xspace and ROI\xspace networks determine the location and type of objects detected in the frame. Data flows from the backbone network to RPN\xspace, and ROI\xspace returns the final prediction results (object category, location within the frame, and confidence score). In machine learning literature, the \textit{oracle} model returns the correct answer to all queries. However, in practice, there is no ground truth for unseen data. Similar to prior efforts, we assume that the most accurate model, which also tends to be the most compute-intensive model, is the oracle model~\cite{blazeit,noscope,chameleon,pp,panorama}. \subsection{Sampling}\label{sec:back:sample} Sampling is a frequently used technique for processing visual data at scale. By processing only a subset of frames using the object detection model, a video analytics system lowers the overall query processing time. For example, \textsc{BlazeIt}\xspace~\cite{blazeit} uses uniformly random sampling to process aggregate queries (\textit{e.g.,}\xspace counting the average number of cars within a given period of time). \textsc{Thia}\xspace uses sampling for a different purpose (elaborated in~\autoref{sec:plan}). A chunk\xspace is a continuous segment of frames within a video. \textsc{Thia}\xspace{'s} \textsc{Optimizer}\xspace constructs plans at chunk\xspace-level granularity (instead of video-level granularity) to lower the query processing time. Query processing time consists of two components: (1) optimization time\xspace, and (2) execution time\xspace. During the optimization phase, \textsc{Thia}\xspace generates a plan for each chunk\xspace. During the execution phase, it runs these plans. \subsection{State-of-the-Art Systems}\label{sec:back:sys} \begin{figure}[t] \centering \includegraphics[width=0.9\linewidth]{figures/fig_back_sys} \caption{\textbf{Architecture of Video Analytics Systems} -- Architecture of two state-of-the-art video analytics systems: (1) \textsc{PP}\xspace~\cite{pp} and (2) \textsc{BlazeIt}\xspace~\cite{blazeit}.} \label{fig:back:sys} \end{figure} \input{tables/tb_back_sys_variants} \cref{tb:back:sys_variants} lists the key characteristics of several state-of-the-art video analytics systems: (1) \textsc{PP}\xspace~\cite{pp}, (2) \textsc{BlazeIt}\xspace~\cite{blazeit} (3) Miris~\cite{miris}, (4) Tahoma~\cite{tahoma}, and (5) Panorama~\cite{panorama}. We present the benefits and limitations of the first two systems in~\autoref{sec:intro}. Their architectures are illustrated in~\cref{fig:back:sys}. Miris~\cite{miris} is a video analytics system that focuses on multi-object tracking. It uses coarse-grained sampling to gain a high-level perspective of the video and then gradually increases the sampling rate to improve the accuracy of tracking. \textsc{Thia}\xspace differs from Miris in two ways. First, it is tailored for object detection. Second, it only samples for query planning (not for query execution). In~\autoref{sec:eval:end2end}, we illustrate the benefits of other optimizations in \textsc{Thia}\xspace by comparing it against a variant of \textsc{Thia}\xspace that only uses \textsc{Fine-Grained Planning}\xspace (\textsc{Thia-Single}\xspace in~\cref{tb:back:sys_variants}). \textsc{Tahoma}~\cite{tahoma} is another closely related analytics system. It constructs a model cascade by combining a chain of image classification models and determines when to short-circuit the inference based on the confidence score of prediction of each model. Unlike \textsc{Tahoma}, \textsc{Thia}\xspace is geared toward object detection. So, the inference result consists of a set of confidence scores for all the objects present in the frame. It is challenging to short-circuit the inference pipeline based on a set of confidence scores. In \textsc{Thia}\xspace, the \textsc{Early Inference}\xspace technique is guided by query accuracy (not model accuracy). In~\autoref{sec:eval:end2end} and~\autoref{sec:eval:mcopt}, we illustrate the limitations of using a model cascade by comparing \textsc{Thia}\xspace against a variant of \textsc{Thia}\xspace that uses \textsc{Fine-Grained Planning}\xspace along with a model cascade (\textsc{Thia-Multi}\xspace in~\cref{tb:back:sys_variants}), instead of a single \textsc{Early Inference}\xspace model \footnote{ \textsc{Thia-Multi}\xspace delivers better performance than a naive model cascade due to the \textsc{Fine-Grained Planning}\xspace technique. With a naive model cascade, the system cannot directly process frames with the optimal model. It must use all the smaller models before stopping the inference at the optimal model. }. Panorama~\cite{panorama} is another state-of-the-art video video analytics system that uses a single model to solve the unbounded vocabulary problem in object recognition. While this system also offers a set of throughput-accuracy tradeoffs similar to \textsc{Thia}\xspace, it is geared towards comparing embeddings from two input frames. So, it selects the EP\xspace based on the delta between two embeddings while extracting the embeddings. Lastly, it clusters these embeddings to recognize the objects in the input frames. In contrast, \textsc{Thia}\xspace uses \textsc{Early Inference}\xspace in the object detection model itself and seeks to reduce optimization time\xspace using the \textsc{Exit Point Estimation}\xspace technique. \section{Conclusion} We presented, \textsc{Thia}\xspace, a video analytics system for efficiently processing visual data at scale. \textsc{Thia}\xspace leverages the early inference technique to support a range of throughput-accuracy tradeoffs. It then adopts a fine-grained approach to query planning and processes different chunks of the video with different exit points to meet the user's requirements. Lastly, \textsc{Thia}\xspace uses a lightweight technique for directly estimating the exit point using a shallow deep learning model to lower the optimization time. We empirically show that these techniques enable \textsc{Thia}\xspace to outperform two state-of-the-art video analytics systems by up to 6.5$\times$\xspace, while providing accurate results even on queries focusing on hard-to-detect events. \section{Limitations} \PP{Accuracy of \textsc{Exit Point Estimation}\xspace model}. The \textsc{Exit Point Estimation}\xspace technique uses a simple neural network to model the optimal EPs\xspace distribution. However, the inaccuracy of this model leads to a minimal drop in overall query accuracy. We plan to study other techniques to reduce the optimization time\xspace in the future. For example, instead of using a deep learning model, a lightweight statistical estimator may be sufficient. A challenge with this approach is that this estimator must accurately map all of the parameters returned by the object detection model (\textit{e.g.,}\xspace a set of bounding boxes and confidence scores) to the appropriate EP\xspace. \PP{Query Support}. Currently, \textsc{Thia}\xspace supports a limited set of queries. To support general-purpose video analytics, we will need to add support for additional types of queries (\textit{e.g.,}\xspace aggregate queries). We plan to integrate the \textsc{Early Inference}\xspace and \textsc{Fine-Grained Planning}\xspace techniques into the query execution engine and the query optimizer of a full-featured video analytics system in the future. \section{\textsc{Early Inference}\xspace}\label{sec:ei} In this section, we present the \textsc{Early Inference}\xspace technique. We first provide an overview of this technique in~\autoref{sec:ei:design}. We then illustrate its utility using a case study with Faster-RCNN~\cite{faster-rcnn} in~\autoref{sec:ei:case}. \subsection{Overview}\label{sec:ei:design} We seek to construct a \textit{single} model with multiple exit points wherein the inference may be short-circuited to improve performance at the expense of accuracy. We do \textit{not} want to construct a collection of models to accomplish this goal. The \textsc{Optimizer}\xspace dynamically adjusts the EP\xspace based on the query. If the query is relatively easy to answer, \textsc{Thia}\xspace delivers higher speedup by stopping the inference earlier (while returning accurate results). We discuss how \textsc{Thia}\xspace estimates the correct EP\xspace for a chunk in~\autoref{sec:plan}. In this section, we focus on how we construct a model with multiple EPs\xspace. As discussed in~\autoref{sec:back:obj_det}, object detection models usually rely on a backbone network that is based on a state-of-the-art image classification model (\textit{e.g.,}\xspace ResNet-50~\cite{resnet-50} and VGG-16~\cite{vgg-16}). Since these classification models are tailored for high accuracy, they consist of a stack of compute-intensive layers that lead to lower inference throughput. The layers in a backbone network are sequentially connected to each other. Our key idea is to provide faster detection results with lower accuracy by using the features from earlier layers in the backbone network. \PP{Model Cascading vs Early Inference:} Researchers have proposed model cascades for face recognition~\cite{face-cascade-1,face-cascade-2}. Similar to \textsc{Early Inference}\xspace, in a model cascade, the features from earlier layers in the backbone network are used for face recognition. However, these techniques differ in two ways. First, face recognition is a binary classification task (\textit{i.e.,}\xspace face exists in the image or not). So, the additional classification layers are only instrumented in this approach. Second, these efforts propose a bespoke architecture to construct the cascade. We instead seek to support early inference in widely used object detection models. To support \textsc{Early Inference}\xspace with a general-purpose object detection model, we introduce additional RPN\xspace and ROI\xspace units in the earlier layers of the backbone network. We modify the number of parameters in these units so that they operate on the feature tensor emitted by the backbone network. As shown in ~\cref{fig:ei:case}, for a given input, \textsc{Optimizer}\xspace may choose to short-circuit the inference using the newly added units to speed up inference. \begin{figure}[t] \centering \includegraphics[width=0.95\columnwidth]{figures/fig_ei_case} \caption{ \textbf{\textsc{Early Inference}\xspace in Faster-RCNN} -- Architecture of a Faster-RCNN model that supports early inference.} \label{fig:ei:case} \end{figure} \subsection{Case Study: Faster-RCNN}\label{sec:ei:case} Faster-RCNN is a state-of-the-art object detector~\cite{faster-rcnn}. We now discuss how we extend this model to support \textsc{Early Inference}\xspace. We next describe how to generalize the training process to other models. \PP{Faster-RCNN with \textsc{Early Inference}\xspace}: The backbone network of Faster-RCNN is the ResNet-50~\cite{resnet-50} model. ResNet-50 consists of five stacked compute blocks, so we extend this model to support five EPs (we could support fewer or additional EPs if needed by instrumenting other layers of the backbone network). The default output of the model corresponds to the fifth EP. We add four additional EPs that provide a wide set of throughput-accuracy tradeoffs (\textit{i.e.,}\xspace EP-1, EP-2, EP-3, and EP-4 in~\cref{fig:ei:case}). We refer to EP-5 as the oracle (since it is the output of the original model). We preserve the structure of RPN and ROI units as is the case of the oracle. However, we modify the first layer in these units to work with the output tensors of the early EPs that vary in size. ~\cref{tb:ei:case:layer} lists the layer configuration of each EP \footnote{We found that upsampling the input channel size to $2048$ does not improve accuracy since the features from earlier EPs are coarse.}. \input{tables/tb_ei_case_layer} \PP{Top-down training}: We adopt a novel top-down training technique for constructing models that support early inference. We start the training process with the following multi-loss function: \[ L(x; Y) = \frac{1}{|E|}\sum_{e \in E} L(\{y_{c}\}, \{y_{t}\}; Y) \] $E$ represents the set of exit points (including the oracle). $L$ denotes the object detection loss function used in Faster-RCNN~\cite{faster-rcnn}. This training step tunes all EPs\xspace. $E$ represents all possible object detection EPs\xspace, including the oracle EP\xspace. We begin with the oracle EP\xspace. The reasons for doing this are twofold. First, the oracle gets the features emitted by the last stage of the backbone network, so training this EP\xspace ensures that all layers converge to the optimal state. Second, we seek to ensure that the oracle EP\xspace in the \textsc{Early Inference}\xspace model delivers the same accuracy as that of the original model. After training the oracle EP\xspace, we freeze all the layer parameters in the backbone network. This ensures that fine-tuning the shallow EPs later does not affect the previously tuned EPs\xspace. We gradually fine-tune the RPN and ROI units starting from EP\xspace-4 through EP\xspace-1. \PP{Throughput-Accuracy Tradeoffs}. ~\cref{tb:ei:case:layer} lists the speedup of shallow EPs\xspace with respect to the the oracle EP\xspace. For a given video frame, this \textsc{Early Inference}\xspace model offers up to a $6.9\times$ speedup when we stop the inference at the first EP. ~\cref{tb:ei:case:layer} also summarizes the true positive and false negative percentage of each EP\xspace on the training dataset with respect to the oracle EP\xspace. These metrics are averaged across all categories. Shallower EPs\xspace return more false negatives and fail to return a few true positives. In other words, they are more likely to not return a positive frame instead of misclassifying a negative frame. If the system were to use a shallow EP\xspace for the entire video or sequence of images, the impact on query accuracy would be significant. Instead, it must use the oracle EP\xspace on some difficult chunks of the video. We cover this \textsc{Fine-Grained Planning}\xspace technique in~\autoref{sec:plan}. In~\autoref{sec:eval}, we demonstrate that \textsc{Thia}\xspace has a tolerable accuracy loss using both \textsc{Early Inference}\xspace and \textsc{Fine-Grained Planning}\xspace techniques. \begin{figure}[t!] \includegraphics[width=0.45\columnwidth]{figures/fig_ei_generalize} \caption{\textbf{Generalization of \textsc{Early Inference}\xspace} -- Application of the \textsc{Early Inference}\xspace technique to a VGG-16 model for image classification.} \label{fig:ei:gen} \end{figure} \PP{Generalization.} The \textsc{Early Inference}\xspace technique generalizes to other models (\textit{e.g.,}\xspace VGG-16~\cite{vgg-16}) and other vision tasks (\textit{e.g.,}\xspace image classification). This is because most of these deep learning models contain similar backbone networks that benefit from the \textsc{Early Inference}\xspace technique. Furthermore, the number of EPs\xspace may be increased or decreased based on the complexity of the model. \cref{fig:ei:gen} illustrates another \textsc{Early Inference}\xspace model based on VGG-16 for an image classification task that is trained on the Flower-102 dataset~\cite{flower-102}. Here, EP\xspace-1 provides a $4.7$$\times$\xspace speedup compared to EP\xspace-8 (\textit{i.e.,}\xspace the oracle EP\xspace). By using all the eight EPs\xspace together, the system achieves a $2.7$$\times$\xspace speedup compared to the oracle EP\xspace with minimal accuracy loss. \section{Model Estimation} \section{Experimental Evaluation}\label{sec:eval} We seek to answer the following questions in our evaluation: \begin{itemize} \item How effective is the \textsc{Early Inference}\xspace technique in reducing the query processing time (\autoref{sec:eval:ei})? \item How much does each technique contribute to the overall performance (\autoref{sec:eval:factor})? \item How effective is the \textsc{Fine-Grained Planning}\xspace compared to the coarse-grained planning (\autoref{sec:eval:plan})? \item What is the time spent on query planning and execution (\autoref{sec:eval:over})? \item How effective is the \textsc{Exit Point Estimation}\xspace technique in reducing the optimization time\xspace (\autoref{sec:eval:me})? \item How effective is \textsc{Thia}\xspace compared to other state-of-the-art systems (\autoref{sec:eval:end2end})? \item How does the \textsc{Early Inference}\xspace technique compare against the model cascade technique (\autoref{sec:eval:mcopt})? \end{itemize} \subsection{Experiment Setup}\label{sec:eval:setup} \PP{Evaluated Systems}. ~\cref{tb:back:sys_variants} lists all the video analytics systems that we compare in our analysis (including the variants of \textsc{Thia}\xspace). In the \textsc{Naive}\xspace system, we apply the oracle EP\xspace on every frame. We normalize the accuracy metrics of other systems against those of the \textsc{Naive}\xspace system. We reimplement two other state-of-the-art systems in our framework for comparative analysis: (1) \textsc{PP}\xspace~\cite{pp}, and (2) \textsc{BlazeIt}\xspace~\cite{blazeit}. In our implementation, the \textsc{PP}\xspace system uses ResNet-34~\cite{resnet-50} to filter out unrelated frames. The \textsc{BlazeIt}\xspace system uses a specialized model (ResNet-34) to accelerate queries. To better understand the performance of \textsc{Thia}\xspace, we examine three variants of our system: (1) \textsc{Thia-Single}\xspace uses only the \textsc{Fine-Grained Planning}\xspace method with the oracle EP\xspace. (2) \textsc{Thia-Multi}\xspace also uses the \textsc{Fine-Grained Planning}\xspace method along with multiple EPs\xspace. Specifically, we use Faster-RCNN models with three backbone networks: ResNet-18, ResNet-34, and ResNet-50~\cite{resnet-50} as three EPs\xspace. (3) \textsc{Thia-EI}\xspace is the closest variant of \textsc{Thia}\xspace. It uses the \textsc{Fine-Grained Planning}\xspace along with the \textsc{Early Inference}\xspace technique (but does not use the \textsc{Exit Point Estimation}\xspace technique). \PP{Datasets}. We evaluate these systems on two datasets: (1) UA-DeTrac~\cite{ua_detrac}, and (2) Jackson-Town dataset from~\cite{blazeit}. Both datasets are obtained from traffic surveillance cameras. We focus on four vehicle categories in both datasets: \texttt{Car}, \texttt{Truck}, \texttt{Bus}, and \texttt{Others}. \PP{Evaluation metrics}. Similar to other video analytics systems~\cite{noscope, blazeit, pp, tahoma, chameleon}, our evaluation normalizes the results with respect to the oracle model (Faster-RCNN model backed by ResNet-50). So, we provide the F-1\xspace score calculated relative to the results of the oracle model. We also report separate precision and recall metrics for each query. This is important since a user might require fine-grained accuracy requirements (\textit{e.g.,}\xspace low precision and high recall). We assume that the decoded video is present on disk. \PP{Queries}. To evaluate these systems, we use the four queries listed in~\cref{tb:mov:queries}. Based on the predicate, the frequency of true positive events and the difficulty of detecting those events vary. \PP{Software and Hardware}. We implement \textsc{Thia}\xspace with the Detectron2~\cite{detectron2} framework in PyTorch~\cite{pytorch}. We evaluate these systems on a server with 44~CPU cores and 256~GB memory along with one Titan Xp GPU with 12~GB memory. \PP{Model Training}. As discussed in~\autoref{sec:ei:case}, we construct the \textsc{Early Inference}\xspace model based on Faster-RCNN. We split the UA-DeTrac dataset into two parts: training and validation subsets. We train the \textsc{Early Inference}\xspace model on the the training subset. We warm up the training process for $1$ epoch, and then each EP\xspace in \textsc{Early Inference}\xspace model is trained for $10$ epochs in a top-down manner. Since the Jackson-Town dataset does not have ground-truth labels, we directly apply the \textsc{Early Inference}\xspace model, which is tailored for the UA-DeTrac dataset. For \textsc{Thia-Multi}\xspace, we train three models: Faster-RCNN based on ResNet-18, Faster-RCNN based on ResNet-34, and Faster-RCNN based on ResNet-50. Each model is trained for 10 epochs. To train the \textsc{Exit Point Estimation}\xspace model, we use $1000$ images from the UA-DeTrac training set. We split these images into training ($200$ images) and validation subsets. We construct the training so that the distribution of different EPs\xspace is balanced. The training data for this model consists of backbone features for those video frames, and the output is the fastest EP\xspace that is accurate enough. We quickly train this shallow network for $20$ epochs. \begin{figure}[t] \centering \includegraphics[width=0.7\linewidth]{figures/fig_eval_ei_time_vs_f1_legend} \includegraphics[width=0.9\linewidth]{figures/fig_eval_ei_time_vs_f1} \caption{\textbf{Impact of \textsc{Early Inference}\xspace} -- Query processing time and F-1\xspace scores delivered by \textsc{Thia-EI}\xspace, \textsc{PP}\xspace, and \textsc{BlazeIt}\xspace (bottom right corner represents the ideal system).} \label{fig:eval:ei:time_vs_f1} \end{figure} \subsection{Impact of \textsc{Early Inference}\xspace}\label{sec:eval:ei} In this experiment, we compare the query processing time of \textsc{Thia-EI}\xspace to that of other video analytics systems. The results are shown in~\cref{fig:eval:ei:time_vs_f1}. The bottom right corner represents the ideal case (faster execution with accurate predictions). \PP{\textsc{Thia-EI}\xspace}. The most notable observation is that \textsc{Thia-EI}\xspace outperforms other systems on most queries. \textsc{Thia-EI}\xspace uses both \textsc{Early Inference}\xspace and \textsc{Fine-Grained Planning}\xspace. On \textsc{Q1}\xspace and \textsc{Q2}\xspace, since the fraction of frames filtered out is limited, using an extra specialized model before the object detector adds additional execution overhead. \textsc{Thia-EI}\xspace consistently reduces the total runtime and also delivers a higher F-1\xspace score compared to other systems. In particular, it is 2 -- 6$\times$\xspace faster than \textsc{Naive}\xspace with a tolerable drop in F-1\xspace score. \PP{\textsc{BlazeIt}\xspace}. On \textsc{Q1}\xspace, \textsc{BlazeIt}\xspace outperforms other systems with respect to query processing time. However, as we discussed in~\autoref{sec:mov}, its specialized model delivers a lower F-1\xspace score. On other queries, since the F-1\xspace score of the specialized model is too low to be useful, \textsc{BlazeIt}\xspace falls back to the oracle model. Even though the specialized model is not effective, \textsc{BlazeIt}\xspace still evaluates the query with the specialized model, so the processing time of \textsc{BlazeIt}\xspace is higher than that of \textsc{Naive}\xspace for \textsc{Q2}\xspace, \textsc{Q3}\xspace, and \textsc{Q4}\xspace. \PP{\textsc{PP}\xspace}. \textsc{PP}\xspace reduces the processing time on \textsc{Q3}\xspace and \textsc{Q4}\xspace. This is because these two queries focus on relatively rare events. So, the model in \textsc{PP}\xspace is able to filter out a significant fraction of frames to accelerate query processing. \begin{figure}[t] \centering \includegraphics[width=\linewidth]{figures/fig_eval_ei_ep_dist} \caption{\textbf{Usage of EPs\xspace in \textsc{Early Inference}\xspace model} -- Percentage of frames processed using the EPs\xspace in the \textsc{Early Inference}\xspace model.} \label{fig:eval:ei:ep_dist} \end{figure} \begin{figure}[t] \centering \includegraphics[width=\linewidth]{figures/fig_eval_factor_analysis} \caption{\textbf{Ablation study} -- Contribution of \textsc{Fine-Grained Planning}\xspace and \textsc{Early Inference}\xspace techniques to the performance of \textsc{Thia-EI}\xspace.} \label{fig:eval:ei:factor_analysis} \end{figure} \subsection{Ablation Study}\label{sec:eval:factor} We next examine how the EP\xspace{s} in a model are used by \textsc{Thia-EI}\xspace while processing queries. The results of this experiment are shown in~\cref{fig:eval:ei:ep_dist}. To better understand the contribution of each technique to the performance of \textsc{Thia-EI}\xspace, we also conduct an ablation study. We measure the execution time\xspace of \textsc{Thia-Single}\xspace and \textsc{Thia-EI}\xspace to illustrate the benefits of \textsc{Fine-Grained Planning}\xspace and \textsc{Early Inference}\xspace techniques, respectively. The results of this study are illustrated in~\cref{fig:eval:ei:factor_analysis}. These two experiments demonstrate that: (1) \textsc{Fine-Grained Planning}\xspace is able to adaptively choose the appropriate EP\xspace for each chunk based on the query and video frames, and (2) \textsc{Fine-Grained Planning}\xspace and \textsc{Early Inference}\xspace techniques have significant impact for rare events; but, in the case of frequent events, the speedup mainly comes from \textsc{Early Inference}\xspace. On \textsc{Q1}\xspace, since positive events appear in majority of the video frames, the impact of \textsc{Fine-Grained Planning}\xspace is minimal. When we add in the \textsc{Early Inference}\xspace technique, \textsc{Thia-EI}\xspace delivers higher speedup by using shallow EPs\xspace for easy-to-detect events, as shown in~\cref{fig:eval:ei:ep_dist}. \textsc{Q1}\xspace demonstrates an extreme scenario wherein the first EP\xspace (EP-1) provides correct predictions on all video frames. In contrast, in the case of \textsc{Q2}\xspace, \textsc{Thia-EI}\xspace must use multiple EPs\xspace due to harder-to-detect events. Here, the \textsc{Optimizer}\xspace reduces the execution time\xspace by carefully choosing the EPs\xspace to use. As shown in~\cref{fig:eval:ei:ep_dist}, while some frames are assigned to the oracle EP\xspace, other frames are assigned to shallow EPs\xspace to reduce execution time\xspace. By reducing the execution time\xspace, \textsc{Thia-EI}\xspace delivers a 4$\times$\xspace speedup over \textsc{Naive}\xspace. Unlike queries focusing on frequent events, the \textsc{Fine-Grained Planning}\xspace technique provides more performance benefits in the case of queries related to rare events, because the \textsc{Optimizer}\xspace decides to skip some chunks during execution (\cref{algo:plan:search:discard}). On \textsc{Q3}\xspace and \textsc{Q4}\xspace, as shown in~\cref{fig:eval:ei:factor_analysis}, \textsc{Fine-Grained Planning}\xspace leads to a 5$\times$\xspace speedup. Nevertheless, the \textsc{Early Inference}\xspace technique is still useful for these queries. \textsc{Thia-EI}\xspace carefully assigns certain video frames to shallow EPs\xspace to improve the performance without losing accuracy. The system is thus accelerated further by 3$\times$\xspace when the \textsc{Early Inference}\xspace technique enabled. \begin{figure}[t] \centering \includegraphics[width=0.6\linewidth]{figures/fig_eval_fp_vs_cp_legend} \includegraphics[width=0.9\linewidth]{figures/fig_eval_fp_vs_cp} \caption{\textbf{Impact of \textsc{Fine-Grained Planning}\xspace} -- Breakdown of query processing time with fine-grained and coarse-grained planning techniques.} \label{fig:eval:plan:breakdown} \end{figure} \begin{figure}[t] \centering \includegraphics[width=0.8\linewidth]{figures/fig_eval_fp_sample} \caption{\textbf{Variation of Execution Time } -- Variation of query execution time across the chunks in the video.} \label{fig:eval:plan:exec_dist} \end{figure} \subsection{Impact of \textsc{Fine-Grained Planning}\xspace}~\label{sec:eval:plan} We demonstrate the benefits of \textsc{Fine-Grained Planning}\xspace by comparing \textsc{Thia-EI}\xspace against a system that uses coarse-grained planning with the same \textsc{Early Inference}\xspace model. With coarse-grained planning, we evaluate all EPs\xspace on $10\%$ of the sampled video frames and pick the EP\xspace that meets the precision and recall constraints. We show a breakdown of the query processing time in~\cref{fig:eval:plan:breakdown}. On all queries, \textsc{Fine-Grained Planning}\xspace provides a better query plans than coarse-grained planning so that the execution time is consistently lower. Moreover, with optimizations like sampling rate bounds and memoization in \textsc{Fine-Grained Planning}\xspace, it does not incur higher optimization time than the naive coarse-grained planning approach. We next measure the distribution of query execution time over the fraction of the video being analysed in~\cref{fig:eval:plan:exec_dist}. An even distribution (\textit{e.g.,}\xspace \textsc{Q1}\xspace and \textsc{Q2}\xspace) suggests that the same query plan is used for a large chunk\xspace. In contrast, an uneven distribution (\textit{e.g.,}\xspace \textsc{Q3}\xspace and \textsc{Q4}\xspace) suggests that the plan changes frequently across the video. \begin{figure}[t] \centering \includegraphics[width=0.6\linewidth]{figures/fig_eval_sys_variant_breakdown_legend} \includegraphics[width=\linewidth]{figures/fig_eval_sys_variant_breakdown} \caption{\textbf{Breakdown of query processing time} -- Components of query processing time (optimization time\xspace and execution time\xspace) associated with \textsc{Naive}\xspace, \textsc{Thia-Single}\xspace, \textsc{Thia-Multi}\xspace, \textsc{Thia-EI}\xspace, and \textsc{Thia}\xspace.} \label{fig:eval:ei:sys_variant_breakdown} \end{figure} \subsection{Processing Time Breakdown}\label{sec:eval:over} We now provide a breakdown of the processing time of \textsc{Thia-EI}\xspace and its variants and compare it against \textsc{Naive}\xspace. Recall that all systems except for \textsc{Naive}\xspace use the \textsc{Fine-Grained Planning}\xspace technique. Though \textsc{Thia-Single}\xspace is only able to use the oracle EP\xspace, it is able to skip frames with no relevant events using \textsc{Fine-Grained Planning}\xspace. The results are shown in~\cref{fig:eval:ei:sys_variant_breakdown}. Access to a set of EPs\xspace allows both \textsc{Thia-EI}\xspace and \textsc{Thia-Multi}\xspace to reduce execution time\xspace in comparison to \textsc{Thia-Single}\xspace and \textsc{Naive}\xspace. The reduction in execution time\xspace is more prominent compared to \textsc{Thia-Single}\xspace for queries focusing on more frequent events. While \textsc{Thia-Multi}\xspace supports multiple EPs\xspace similar to \textsc{Thia-EI}\xspace, \textsc{Thia-EI}\xspace supports multiple EPs\xspace in a single model. So, it has a lower GPU memory footprint, as shown in~\cref{fig:eval:mem}. In addition to that, \textsc{Thia-EI}\xspace offers more flexibility in terms of creating and selecting different EPs\xspace. On \textsc{Q2}\xspace, due to the limited flexibility of \textsc{Thia-Multi}\xspace, it has lower execution time\xspace and also lower accuracy than \textsc{Thia-EI}\xspace. The cons of using multiple EPs\xspace with \textsc{Fine-Grained Planning}\xspace is the increase in optimization time\xspace. This is because the \textsc{Optimizer}\xspace has to evaluate all EPs\xspace to choose an optimal EP\xspace. As illustrated in~\cref{fig:eval:ei:sys_variant_breakdown}, the optimization time\xspace of \textsc{Thia-EI}\xspace and \textsc{Thia-Multi}\xspace is consistently higher than that of \textsc{Thia-Single}\xspace. Increasing this flexibility (\textit{i.e.,}\xspace adding more EPs\xspace) leads to higher sampling overhead. Thus, \textsc{Thia-EI}\xspace has higher optimization time\xspace than \textsc{Thia-Multi}\xspace and both have higher optimization time\xspace than \textsc{Thia-Single}\xspace. This motivates the need for reducing the optimization time\xspace. \begin{figure}[t] \centering \includegraphics[width=\linewidth]{figures/fig_eval_me_training} \caption{\textbf{Accuracy of the \textsc{Exit Point Estimation}\xspace model} -- Variation in validation accuracy over training time.} \label{fig:eval:me:training} \end{figure} \input{tables/tb_eval_me_accuracy} \begin{figure*} \includegraphics[width=0.45\textwidth]{figures/fig_eval_end2end_legend} \includegraphics[width=0.8\textwidth]{figures/fig_eval_end2end} \caption{\textbf{End-to-end Comparison} -- Comparative analysis of speedup, precision, and recall metrics against state-of-the-art video analytics systems.} \label{fig:eval:end2end} \end{figure*} \subsection{Impact of \textsc{Exit Point Estimation}\xspace}\label{sec:eval:me} \PP{Training Time}. Since the \textsc{Optimizer}\xspace needs to train an estimation model for every unique query, we first quantify the training overhead of the \textsc{Exit Point Estimation}\xspace technique. ~\cref{fig:eval:me:training} shows the variation in validation accuracy over training time. The model quickly converges since the \textsc{Thia}\xspace uses a small training set (200 samples) and a two-layer neural network for \textsc{Exit Point Estimation}\xspace. It takes less than ~$5$ seconds ($0.1$\% of total processing time) to train each of these models for all queries. \PP{optimization time\xspace}. We next investigate the efficacy of the \textsc{Exit Point Estimation}\xspace technique in reducing the optimization time\xspace. We integrate the \textsc{Exit Point Estimation}\xspace technique into \textsc{Thia-EI}\xspace to construct \textsc{Thia}\xspace. Using the \textsc{Exit Point Estimation}\xspace technique, \textsc{Thia}\xspace is able to directly predict an appropriate EP\xspace to use for a chunk\xspace. In contrast, \textsc{Thia-EI}\xspace runs inference using all EPs\xspace during optimization phase to select the EP\xspace. As shown in~\cref{fig:eval:ei:sys_variant_breakdown}, \textsc{Thia}\xspace cuts the optimization time\xspace in half. Recall that \textsc{Thia}\xspace uses the object detection EP\xspace{s} for \textsc{Fine-Grained Planning}\xspace. So, the \textsc{Exit Point Estimation}\xspace technique uses the backbone features for choosing a plan for each chunk\xspace. We also measure the overhead of using \textsc{Exit Point Estimation}\xspace. This technique introduces a minimal additional overhead (18~s) even under the highest sampling rate (processing time is in order of thousands of seconds). \PP{execution time\xspace}. Lastly, we discuss the impact of the \textsc{Exit Point Estimation}\xspace technique on planning accuracy (\textit{i.e.,}\xspace choosing the optimal EP\xspace) and execution time\xspace. We measure the planning accuracy relative to \textsc{Thia-EI}\xspace. In~\cref{tb:eval:me_acc}, \texttt{Under} and \texttt{Over} represent the percentage of chunks for which the \textsc{Exit Point Estimation}\xspace technique returns a shallower EP\xspace and a deeper EP\xspace than that returned by \textsc{Thia-EI}\xspace. While shallower estimates hurt query accuracy, deeper estimates increase execution time\xspace. As shown in~\cref{fig:eval:ei:sys_variant_breakdown}, execution time\xspace increases only negligibly for all queries except for \textsc{Q1}\xspace. Since the \textsc{Exit Point Estimation}\xspace technique reduces optimization time\xspace, the total processing time of \textsc{Thia}\xspace is lower than that of \textsc{Thia-EI}\xspace on all queries except for \textsc{Q1}\xspace. This is because \textsc{Q1}\xspace can be accurately answered using the first EP\xspace (\cref{fig:eval:ei:ep_dist}), so deeper estimates increase execution time\xspace. We discuss the impact on query accuracy in \autoref{sec:eval:end2end}. \subsection{End-to-End Comparison}\label{sec:eval:end2end} We report the speedup, precision, and recall metrics with respect to other state-of-the-art systems in~\cref{fig:eval:end2end}. The bars on the left side represent three systems: (1) \textsc{Naive}\xspace, (2) \textsc{BlazeIt}\xspace, and (3) \textsc{PP}\xspace. The latter two video analytics systems use specialized models. The bars on the right side represent variants of \textsc{Thia}\xspace that use one or more techniques presented in this paper. The most notable observation is that systems that have access to a set of EPs\xspace deliver higher performance than those that have access to a single EP\xspace. Unlike \textsc{Thia-Multi}\xspace, which maintains a collection of separate models, the \textsc{Early Inference}\xspace technique offers more flexibility in choosing the optimal EP\xspace. However, this technique increases the optimization time\xspace. We overcome this limitation using the \textsc{Exit Point Estimation}\xspace technique. \textsc{Thia}\xspace consistently delivers higher speedup than other systems. Due to the inaccuracy of the \textsc{Exit Point Estimation}\xspace technique, \textsc{Thia}\xspace has a minimal drop in accuracy. The drop in recall is more prominent because shallow EPs\xspace are unable to recognize hard-to-detect events, which leads to more false negatives. In contrast, the drop in precision is minimal. On \textsc{Q1}\xspace, \textsc{Thia}\xspace improves both precision and recall. This is because the \textsc{Optimizer}\xspace augmented with the \textsc{Exit Point Estimation}\xspace technique overestimates the EPs\xspace for this query, leading to an improvement in accuracy. \begin{figure}[t] \centering \includegraphics[width=\linewidth]{figures/fig_eval_mc_vs_ei} \caption{\textbf{Model Cascade \textit{vs.}\xspace \textsc{Early Inference}\xspace} -- Comparison of the query processing time taken by \textsc{Naive}\xspace, \textsc{Model Cascade}, \textsc{Thia-EI}\xspace, and \textsc{Thia}\xspace.} \label{fig:eval:mc_vs_ei} \end{figure} \subsection{Model Cascade \textit{vs.}\xspace \textsc{Early Inference}\xspace}~\label{sec:eval:mcopt} As we mentioned in~\autoref{sec:back:sys}, \textsc{Thia-Multi}\xspace uses a model cascade~\cite{tahoma}. It differs from the naive model cascade technique in that it uses \textsc{Fine-Grained Planning}\xspace to select EPs\xspace. In contrast, a naive approach determines whether to stop at an EP\xspace based on the a confidence score of the prediction from the previous EP\xspace. \textsc{Thia-Multi}\xspace outperforms the naive approach since shallower EPs\xspace in the model cascade are always executed with the latter technique. As a result, our \textsc{Early Inference}\xspace based systems (\textit{i.e.,}\xspace \textsc{Thia-EI}\xspace and \textsc{Thia}\xspace) outperform the model cascade approach. Since it is challenging to construct a confidence-score based system in the case of object detection, we show the projected performance of the model cascade approach compared to \textsc{Thia-EI}\xspace and \textsc{Thia}\xspace in~\cref{fig:eval:mc_vs_ei}. The \textsc{Early Inference}\xspace based system delivers 2$\times$\xspace speedup compared to \textsc{model cascade}. \begin{figure} \includegraphics[width=0.5\columnwidth]{figures/fig_eval_mem} \caption{\textbf{Memory Footprint} -- Comparison of memory footprint of \textsc{Thia-EI}\xspace and \textsc{Thia-Multi}\xspace (\textit{i.e.,}\xspace a model cascade).} \label{fig:eval:mem} \end{figure} Using multiple models to construct model cascade also increases the memory footprint of the system. As shown in~\cref{fig:eval:mem}, the real-time memory usage of a model cascade increases when we increase the number of EPs\xspace. It has a 5~GB memory footprint with 5 EPs\xspace. In contrast, since the \textsc{Early Inference}\xspace model shares parameters and inference features, it only incurs a 2~GB memory footprint for the same number of EPs\xspace. \begin{figure}[t] \centering \includegraphics[width=\linewidth]{figures/fig_eval_perfect_speedup} \caption{\textbf{Optimality of \textsc{Fine-Grained Planning}\xspace} -- Comparison of execution time of \textsc{Thia-EI}\xspace and \textsc{Thia}\xspace against that with the optimal plan.} \label{fig:eval:perfect_speedup} \end{figure} \subsection{Optimality of \textsc{Fine-Grained Planning}\xspace}\label{sec:eval:perfect} We now examine the quality of the query plans relative to the optimal plan by comparing the execution speedup. The optimal plan is constructed using a brute-force EP\xspace selection on every frame (\textit{i.e.,}\xspace chunk size = 1). The optimal plan is un-achievable in reality because the brute-force selection on every frame significantly increases optimization time\xspace. The results are shown in~\cref{fig:eval:perfect_speedup}. The plans constructed by the \textsc{Optimizer}\xspace are 0.3$\times$\xspace slower than the optimal plan. So, there is still potential for improving the quality of the query plans. We plan to explore techniques for doing so with a tolerable impact on optimization time\xspace in the future. \section{Introduction} \label{sec:intro} Researchers have proposed systems for quickly processing visual data with a tolerable drop in accuracy~\cite{video-db1,video-db2,video-db3,noscope,blazeit,panorama,pp,focus,edge-va1,va1,va2}. These systems detect objects in videos using deep neural networks ({DNN\xspace}s)~\cite{faster-rcnn,mask-rcnn}. The key challenge that these systems tackle is the computational overhead of the underlying object detection model. \PP{Prior Work}. To efficiently process visual data at scale, researchers have proposed two techniques. The first approach, presented in \textsc{BlazeIt}\xspace~\cite{blazeit}, consists of leveraging a specialized, lightweight model to directly answer the query. The second approach, introduced in \textsc{PP}\xspace~\cite{pp}, focuses on filtering irrelevant frames using a lightweight model. The frames that pass through the filtering model are then processed by the heavyweight object detection model (illustrated in~\cref{fig:back:sys}). So, these systems accelerate query processing by \textit{not} processing a subset of video frames using the heavyweight model. However, these techniques suffer from two limitations. With the first approach, the specialized model is unable to provide accurate results for hard-to-detect events. With the second approach, the system is unable to accelerate queries focusing on frequently occurring events. This is because the filter is unable to eliminate a significant fraction of frames in the video. Another line of research, illustrated in \textsc{Tahoma}~\cite{tahoma}, focuses on leveraging a collection of differently sized models to process the frames based on the complexity of the event. However, using such a cascade of models comes with two limitations. First, switching from one model to another in the GPU is expensive. This switching overhead is further exacerbated if we seek to frequently change the model to process different subsets (\textit{i.e.,}\xspace chunk\xspace{s}) of the video to maximize performance. For instance, loading a Faster-RCNN model in PyTorch on an NVIDIA Titan Xp GPU takes 2~s (including framework initialization and model loading). Second, using a collection of models to support different throughput-accuracy tradeoffs does not scale well due to the large GPU memory footprint of these models. Prior efforts have mostly focused on altering the design of the inference pipeline. However, they do not elaborate on how to adapt this pipeline (\textit{e.g.,}\xspace when to use a particular model) based on the chunk\xspace. They choose a single plan for the entire video based on the profiling results obtained on a set of sampled frames. Such a coarse-grained approach to query planning does not leverage the variation in the frequency and detection difficulty of different events in a video. If objects are difficult to detect, this approach leads to less accurate results. On the other hand, if objects are easier to detect, a conservative coarse-grained query plan significantly increases the query processing time (but returns correct results). We defer a detailed discussion of these limitations to~\autoref{sec:mov}. \PP{Our Approach}. In this paper, we present \textsc{Thia}\xspace, a video analytics system for tackling the limitations highlighted above. \textsc{Thia}\xspace leverages three techniques to accelerate queries over visual data. First, it uses a \textit{single} object detection model with multiple points for short-circuiting the inference. These \textit{exit points} (EPs\xspace) offer a set of throughput-accuracy tradeoffs. While processing the query, \textsc{Thia}\xspace uses a shallow EP\xspace to quickly process frames that are irrelevant or contain easy-to-detect events. If the frames contain hard-to-detect events, then \textsc{Thia}\xspace falls back to a deeper EP\xspace in the model to deliver higher accuracy. This \textsc{Early Inference}\xspace technique eliminates the switching overhead and lowers the GPU memory footprint of \textsc{Thia}\xspace . Second, \textsc{Thia}\xspace adopts a fine-grained approach to planning. It processes different chunks of the video using different EPs\xspace to meet both the performance and accuracy requirements (elaborated in~\autoref{sec:plan:need}). This \textsc{Fine-Grained Planning}\xspace technique increases the optimization time\xspace of a query. To lower this overhead, we present a third technique to quickly decide which EP\xspace to use for a given chunk. \textsc{Thia}\xspace uses a shallow model for \textsc{Exit Point Estimation}\xspace instead of running inference on the sampled frames. We evaluate a set of queries focusing on events with different levels of frequency and detection difficulty on two traffic surveillance datasets: UA-DeTrac~\cite{ua_detrac} and Jackson Town~\cite{blazeit}. On all of the queries, \textsc{Thia}\xspace outperforms the state-of-the-art video analytics systems by up to 6.5$\times$\xspace with a tolerable drop in accuracy. \PP{Contributions}. Our research makes the following contributions: \squishitemize \item We present the \textsc{Early Inference}\xspace technique to construct a single model that offers a set of throughput-accuracy tradeoffs for challenging vision tasks like object detection. \item We propose a \textsc{Fine-Grained Planning}\xspace technique that works in tandem with the \textsc{Early Inference}\xspace technique. \item We present the \textsc{Exit Point Estimation}\xspace technique to reduce the optimization overhead of the \textsc{Fine-Grained Planning}\xspace technique. \item We implement all of these techniques in \textsc{Thia}\xspace and show that it outperforms two state-of-the-art video analytics systems on a wide range of queries. \end{list} \section{Motivation} \label{sec:mov} In this section, we discuss the limitations of \textsc{PP}\xspace and \textsc{BlazeIt}\xspace to motivate the need for \textsc{Thia}\xspace. We focus on the four queries described in~\cref{tb:mov:queries}. These queries differ in: (1) frequency of appearance of target objects in the video, and (2) level of difficulty in providing a correct answer to a query. \input{tables/tb_mov_queries} \PP{Limitation \rom{1} -- model specialization overhead}. Both \textsc{PP}\xspace and \textsc{BlazeIt}\xspace rely on specialized models. ~\textsc{PP}\xspace uses a specialized model as a filter. Since each filter detects only one object category, it needs to train multiple lightweight models (\textit{i.e.,}\xspace filters) during runtime to support different object categories. \textsc{BlazeIt}\xspace uses a specialized model to directly return the results. A model may directly return the count of cars in an image, so it must maintain multiple models for different predicates (\textit{e.g.,}\xspace \lstinline[style=SQLStyle]{Count(Car)} is a predicate). With this model specialization technique, these systems need to train and maintain models for different objects and predicates, respectively. We seek to reduce model maintenance overhead by offering a range of accuracy and query execution time tradeoffs in a single model. \PP{Limitation \rom{2} -- frequent events}. The filtering technique used in the \textsc{PP}\xspace system~\cite{pp} relies on data reduction by the filter to achieve speedup. Let's assume the system is processing $N$ frames and that the fraction of frames that is filtered and discarded by the filter is $r$. Let the costs of running the filter and running the object detector be $C_{f}$ and $C_{o}$ per frame, respectively. To obtain a speedup, the data reduction rate must satisfy this constraint: \[ N(C_{f} + (1 - r) \cdot C_{o}) < NC_{o} \equiv r > \frac{C_{f}}{C_{o}} \] This constraint is not met by frequent events (\textit{e.g.,}\xspace \textsc{Q1}\xspace in~\cref{mov:qone}). In this case, since $r$ is small, the filter slows down the overall pipeline since it adds additional overhead. As a result, \textsc{PP}\xspace is slower than \textsc{Naive}\xspace (\textit{i.e.,}\xspace naively running object detector on every frame) for frequent queries like \textsc{Q1}\xspace. ~\textsc{PP}\xspace only provides a 0.93$\times$\xspace speedup compared to \textsc{Naive}\xspace in this case. Instead, for rare queries like \textsc{Q3}\xspace, \textsc{PP}\xspace is able to provide a 1.44$\times$\xspace speedup compared to \textsc{Naive}\xspace. We seek to dynamically adjust the query execution pipeline based on the estimated frequency of the event. \PP{Limitation \rom{3} -- difficult-to-detect objects}. \textsc{BlazeIt}\xspace~\cite{blazeit} uses a specialized model to directly return aggregates (\textit{e.g.,}\xspace number of cars in an image). This approach does not generalize to complex visual datasets. The reasons are twofold. First, the specialized model is designed to be shallow for fast execution. So, it is unable to learn complex patterns. Second, it relies on an ad-hoc subset of videos for training, so the lack of positive examples greatly affects the quality of the model. As shown in~\cref{tb:mov:blazeit_perf}, \textsc{BlazeIt}\xspace returns precise answers for easy-to-answer queries. However, it has a lower recall metric. For hard-to-answer queries (\textit{e.g.,}\xspace \textsc{Q3}\xspace), the specialized model does not offer useful results. So, the system instead falls back to the object detection model. In this case, \textsc{BlazeIt}\xspace runs the specialized model, resulting in lower performance than \textsc{Naive}\xspace. In contrast, \textsc{Thia}\xspace is capable of selecting an optimal plan with good accuracy and performance metrics. \input{tables/tb_mov_blazeit_perf} \PP{Our Approach}. In~\cref{fig:mov:pred_image}, we show two prediction results from our \textsc{Early Inference}\xspace technique (the oracle object detection EP\xspace and a shallow EP\xspace, respectively). We observe that the faster EP\xspace is still able to capture the presence of cars, but it is less accurate in two ways. First, the bounding boxes are not accurate, so multiple bounding boxes are returned for the same object. Second, it tends to miss hard-to-detect objects (\textit{e.g.,}\xspace objects far away or objects with lights). If a user queries for an image with exactly four cars, \textsc{Thia}\xspace uses the oracle exit point to satisfy the precision requirement. However, if the user is only interested in images with cars, \textsc{Thia}\xspace uses the faster exit point to obtain a 6$\times$\xspace speedup. We design \textsc{Thia}\xspace so that it carefully chooses the optimal query execution plan for every chunk\xspace of the video to deliver higher accuracy and speedup. \begin{figure}[t] \begin{subfigure}[t]{0.49\linewidth} \centering \includegraphics[width=0.8\linewidth]{figures/fig_mov_obs_ei5} \caption{\footnotesize{Results of oracle EP\xspace - 1$\times$\xspace speedup.}} \label{fig:mov:pred_image:oracle} \end{subfigure} \begin{subfigure}[t]{0.49\linewidth} \centering \includegraphics[width=0.8\linewidth]{figures/fig_mov_obs_ei1} \caption{\footnotesize{Results of shallow EP\xspace - 6$\times$\xspace speedup.}} \label{fig:mov:pred_image:approx} \end{subfigure} \caption{\textbf{Objects Detection Results} -- Objects detected by (a) oracle, and (b) shallow EP\xspace.} \label{fig:mov:pred_image} \end{figure} \section{Query Planning}\label{sec:plan} We present the \textsc{Fine-Grained Planning}\xspace technique in this section. In~\autoref{sec:plan:need}, we make the case for \textsc{Fine-Grained Planning}\xspace. In~\autoref{sec:plan:detail}, we discuss how \textsc{Thia}\xspace samples frames and constructs chunk\xspace{s} to apply this technique. Lastly, in~\autoref{sec:plan:estimation}, we introduce the \textsc{Exit Point Estimation}\xspace technique for reducing the optimization time\xspace. \begin{figure}[t] \centering \includegraphics[width=\linewidth]{figures/fig_plan_plan_breakdown} \caption{\textbf{Variation of Optimal EP\xspace} -- The fastest, accurate EP\xspace in an \textsc{Early Inference}\xspace model for a sequence of chunks in a video.} \label{fig:plan:plan_breakdown} \end{figure} \subsection{Motivation}\label{sec:plan:need} As we discussed in~\autoref{sec:ei:case}, the \textsc{Early Inference}\xspace model contains a set of EPs\xspace. The goal of the \textsc{Optimizer}\xspace is to choose an optimal (accurate and fast) EP\xspace for every fine-grained chunk of the video at runtime. Our key observation is that the optimal EP\xspace changes at chunk granularity. ~\cref{fig:plan:plan_breakdown} illustrates the {chunk\xspace}-level query plan for \textsc{Q4}\xspace in~\cref{mov:qtwo}. The triangles in~\cref{fig:plan:plan_breakdown} represent the fastest (but still accurate enough) EP\xspace for every chunk\xspace in the video. This example shows that the optimal EP\xspace constantly changes. So, it is essential to dynamically adjust the query plan at \textit{runtime} to achieve both good accuracy and performance. State-of-the-art systems (\textit{e.g.,}\xspace \textsc{BlazeIt}\xspace~\cite{blazeit} and \textsc{PP}\xspace~\cite{pp}) take a coarse-grained approach to planning. They choose a single plan for the entire video based on the accuracy of the model on a set of sampled frames. The limitations of this technique are twofold. \PP{Performance degradation}. Positive events tend to not appear in every chunk of the video (\textit{i.e.,}\xspace selectivity of the predicate is typically high). If we pick a static plan for the entire video, video chunks that are less likely to contain positive events or that contain easy-to-detect events are passed to a more compute-intensive EP\xspace. Thus, the system does not leverage the opportunity to further improve performance by either skipping those chunks or using less compute-intensive EPs\xspace for those chunks. With \textsc{Fine-Grained Planning}\xspace, \textsc{Thia}\xspace uses a faster EP\xspace or directly skips the entire chunk\xspace (\ding{182} in~\cref{fig:plan:plan_breakdown}). \PP{Accuracy loss}. The distribution of the target event and the accuracy of the model vary across the video. A statically selected, shallow EP\xspace will hurt accuracy by missing hard-to-detect events. As shown in~\cref{fig:plan:plan_breakdown}, some {chunk\xspace}s require deeper EPs\xspace to make accurate predictions (\ding{183} in~\cref{fig:plan:plan_breakdown}). With \textsc{Fine-Grained Planning}\xspace, \textsc{Thia}\xspace dynamically adjusts the plan based on the difficulty of detecting the target event. \subsection{Chunking Algorithm}\label{sec:plan:detail} When \textsc{Thia}\xspace gets a query, it first splits the given video into a set of {chunk\xspace}s. It then samples a set of frames from each chunk\xspace and then evaluates the accuracy of all the EPs\xspace in the \textsc{Early Inference}\xspace model on these sampled frames. Using these results, the system selects the best EP\xspace for each chunk\xspace. Lastly, it executes the query using the selected plan. The key components of the algorithm that \textsc{Thia}\xspace uses for chunking videos are as follows: \input{algorithms/algo_query_plan} \PP{\ding{182} Hierarchical Chunking}. The two key decisions made by the \textsc{Optimizer}\xspace are: (1) chunk\xspace size, and (2) sampling rate (\textit{i.e.,}\xspace the number of frames to pick from a chunk). The system delivers higher accuracy with a higher sampling rate since more samples allow it to better estimate the optimal EP\xspace for each chunk. However, this hurts throughput since the system must evaluate the model's behavior on more frames, thereby increasing optimization time\xspace. Choosing the chunk\xspace size is also a challenging task. This is because the duration of an event varies based on the video, so \textsc{Thia}\xspace must dynamically adjust the chunk\xspace size at runtime. To tackle these challenges, \textsc{Thia}\xspace takes a hierarchical approach for picking the chunk\xspace size and the sampling rate for each chunk\xspace. It initially uses a large chunk\xspace size and a low sampling rate. This allows the \textsc{Optimizer}\xspace to gain a rough understanding of the contents of the video based on the inference results collected using the sampled frames. Based on this knowledge, it recursively adjusts the chunk\xspace size and sampling rate. ~\cref{algo:plan:search} presents the hierarchical, recursive technique used by the \textsc{Optimizer}\xspace. As shown in~\cref{algo:plan:search:plan_fast}, the recursive algorithm stops when the chunk\xspace size is smaller than a threshold or if the fastest EP\xspace has been chosen for a given chunk\xspace that contains enough positive frames. In~\cref{algo:plan:search:pick}, the \texttt{PickBestEP} function returns the rate of positive frames in a chunk (\textit{i.e.,}\xspace \texttt{posi\_ratio}) that is obtained from the oracle EP\xspace. It is important to ensure that the chunk\xspace has sufficient positive frames, since the calculated precision and recall metrics of the EPs\xspace do not generalize well without sufficient positive frames. These constraints bound the optimization time\xspace. As shown in~\cref{algo:plan:search:discard}, if there are very few positive frames, then \textsc{Thia}\xspace skips the entire chunk\xspace to reduce both optimization time\xspace and execution time\xspace. Lastly, it gradually reduces the chunk\xspace size and increases the sampling rate, as shown in~\cref{algo:plan:search:recurse}. The intuition is that if the system is not able to select a plan based on its coarse-grained understanding of the chunk, it must sample more frames from that chunk in the next iteration. By using a small chunk\xspace size, the \textsc{Optimizer}\xspace is able to adjust the plans quickly to transient events. \PP{\ding{183} Sampling Rate Bounds}. The \textsc{Optimizer}\xspace gradually increases the sampling rate to improve the quality of its plan. However, this increases the optimization time\xspace and may hurt the overall throughput obtained with the plan. This is because the decrease in the query execution time is not sufficient to justify the increase in the optimization time. To overcome this limitation, the \textsc{Optimizer}\xspace uses the following constraint to bound the initial sampling rate (\cref{algo:plan:estimate:bound}): \[ sampling\_rate * 2^{\ceil{\log{\frac{|V|}{100}}}} \leq 0.1 \] Here, we assume that chunk\xspace{s} must contain at least 100 frames and we seek to bound the final sampling rate to $0.1$ even in the worst-case setting. The maximum depth of the recursive algorithm is $\ceil{\log{\frac{|V|}{100}}}$ (sampling rate is doubled in each iteration). \PP{\ding{184} Memoization of Inference Results}. In~\cref{algo:plan:search:subset_const}, the newly picked samples could be different from those that have already been evaluated. Evaluating all the EPs\xspace on a sample is expensive. To reduce this overhead, the \textsc{Optimizer}\xspace memoizes the inference results and reuses the results of \textit{nearby} frames. This technique is illustrated in~\cref{fig:plan:sampling_reuse}. Without memoization, the results for the second and fourth frames must be obtained again when the sampling rate is increased in the next iteration. \textsc{Thia}\xspace instead reuses the results of nearby frames within the same chunk\xspace. With memoization, it picks the cached results for the third frame instead of running inference on the fourth frame. Thus, it evaluates only the EPs\xspace on the second frame. \PP{\ding{185} Evaluation-Based EP\xspace selection}. To select the best EP\xspace, as shown in~\cref{algo:plan:search:pick}, \textsc{Thia}\xspace evaluates all the EPs\xspace on the sampled frames and compares them with the oracle EP\xspace. It picks the fastest EP\xspace that provides $0.8$ precision and $0.8$ recall. These constraints empirically offer maximal speedup with minimal accuracy loss (\autoref{sec:eval:ei}). Even with all of these optimizations, evaluating the EPs\xspace on a frame comes with non-trivial optimization time\xspace. We next present the \textsc{Exit Point Estimation}\xspace technique for further reducing the optimization time\xspace. \begin{figure}[t] \centering \includegraphics[width=0.8\linewidth]{figures/fig_plan_sampling_reuse} \caption{\textbf{Sampling results no reuse vs reuse} -- an illustrative example about sampling results about performance saving with no reuse and reuse.} \label{fig:plan:sampling_reuse} \end{figure} \subsection{\textsc{Exit Point Estimation}\xspace} \label{sec:plan:estimation} We seek to reduce the optimization time associated with the \textsc{Early Inference}\xspace technique. As we present in~\autoref{sec:eval:over}, it is important to balance the tradeoff between optimization time and execution time to improve the overall query processing time. The \textsc{Exit Point Estimation}\xspace technique consists of using a shallow, two-layer neural network instead of the evaluation step in query planning. The neural network directly returns the optimal EP\xspace based on the backbone features. This allows the \textsc{Optimizer}\xspace to eliminate compute-intensive evaluation of all EPs\xspace. For example, with Faster-RCNN, the inputs to the \textsc{Exit Point Estimation}\xspace model are the features emitted by the fifth stage of the \textsc{Early Inference}\xspace model. To train this neural network, \textsc{Optimizer}\xspace uses $200$ images from the training dataset of the \textsc{Early Inference}\xspace model along with the associated EP\xspace decision. For robust results, \textsc{Thia}\xspace must train a separate \textsc{Exit Point Estimation}\xspace model for each query. However, the overhead of training this model is tolerable because: (1) it is a one-time overhead for each query; and (2) training time for the \textsc{Exit Point Estimation}\xspace model is negligible compared to total query processing time due to the simple structure of the model. We defer an empirical analysis of this optimization to~\autoref{sec:eval:me}. \PP{Estimation-Based EP\xspace selection}. Since the \textsc{Exit Point Estimation}\xspace model directly estimates the optimal EP\xspace for a video frame, it does not return precision and recall metrics for all the EPs\xspace. So, the \textsc{Optimizer}\xspace extrapolates these metrics based on the estimated EP\xspace. We next discuss how this extrapolation is done. Let us split the set of sampled frames into two subsets: (1) those that contain positive events as reported by the oracle EP\xspace (\cref{algo:plan:search:plan_fast} in~\cref{algo:plan:search}), and (2) those that do not contain positive events. We define those two subsets as $S$ and $\widehat{S}$, respectively. For a given video frame $x$, let us denote the EP\xspace estimation model that outputs the optimal EP\xspace for that frame by $OPT_{EP}(x)$. The \textsc{Optimizer}\xspace estimates the number of true positives (TP), false positives (FP), and false negatives (FN) for any EP\xspace $k$ in the \textsc{Early Inference}\xspace as: \begin{align*} &TP_{k} = \sum_{x \for x \in S} g(x), \qquad & g(x) = \begin{dcases} 1, \text{\qquad if } k\geq OPT_{EP}(x)\\ 0, \text{\qquad otherwise} \end{dcases} \\ &FP_{k} = \sum_{x \for x \in \widehat{S}} g'(x), \qquad & g'(x) = \begin{dcases} 1, \text{\qquad if } k< OPT_{EP}(x)\\ 0, \text{\qquad otherwise} \end{dcases} \\ &FN_{k} = \sum_{x \for x \in S} g''(x), \qquad & g''(x) = \begin{dcases} 1, \text{\qquad if } k< OPT_{EP}(x)\\ 0, \text{\qquad otherwise} \end{dcases} \end{align*} Our intuition is that a shallow EP\xspace is less accurate than a deep EP\xspace. So, for a video frame $x$, the estimated optimal EP\xspace (\textit{i.e.,}\xspace $OPT_{EP}(x)$) returns correct results. Then, all EPs\xspace after the estimated optimal EP\xspace (\textit{i.e.,}\xspace k $\geq OPT_{EP}(x)$) should also return correct results, and vice versa. Hence, in the case of positive events, a deeper EP\xspace $k$ than the estimated optimal EP\xspace provides true positive prediction. On the other hand, a shallower EP\xspace $k$ than the estimated optimal EP\xspace provides false negative prediction. In the case of negative events, shallower EP\xspace $k$ than the estimated optimal EP\xspace likely results a false positive. With these projected metrics, the \textsc{Optimizer}\xspace derives the precision and recall metrics for an EP\xspace $k$ as: \[Precision_{k} = \frac{TP_{k}}{TP_{k} + FP_{k}}, Recall_{k} = \frac{TP_{k}}{TP_{k} + FN_{k}}\] Lastly, the \textsc{Optimizer}\xspace picks the fastest EP\xspace that meets the precision and recall constraints (\textit{e.g.,}\xspace 0.8), as discussed earlier. \section{Related Work} \PP{Model Cascade}. Researchers in the area of face detection have proposed models that support a set of EP\xspace{s} that are geared for different accuracy and speed trade-offs~\cite{face-cascade-1,face-cascade-2}. These models return a binary decision and a confidence score (\textit{i.e.,}\xspace whether a face exists). Based on the confidence score, the model chooses the appropriate EP\xspace. In contrast, \textsc{Thia}\xspace uses the estimator to directly pick the EP\xspace. \PP{Query planning}. The authors of Chameleon~\cite{chameleon} observe that an appropriate query plan is critical to gain high performance and accuracy. Similar to the \textsc{Fine-Grained Planning}\xspace technique, it adjusts the execution plan at runtime. To reduce the cost of picking the correct plan, it exploits temporal locality of nearby frames in the video, thereby reducing the profiling cost. To further reduce this cost, it uses a clustering algorithm to explore correlation across videos. \textsc{Thia}\xspace instead uses a shallow neural network to directly estimate the optimal EP\xspace to use for a chunk. \section{System Overview}\label{sec:sys} \cref{fig:sys} illustrates the architecture of \textsc{Thia}\xspace. \PP{\ding{182} \textsc{Fine-Grained Planning}\xspace.} When the system gets a query, the \textsc{Optimizer}\xspace uses the \textsc{Fine-Grained Planning}\xspace technique to construct a query execution plan. It first splits the entire video into a set of small {chunk\xspace}s. The size of a chunk\xspace is determined dynamically at runtime (covered in~\autoref{sec:plan}). For each chunk\xspace, the \textsc{Optimizer}\xspace chooses the optimal plan (\textit{i.e.,}\xspace when to stop inference in the model). Such a fine-grained query plan enables \textsc{Thia}\xspace to deliver higher accuracy and throughput compared to a coarse-grained plan for the entire video. A naive technique for picking the plan consists of running the model on a set of sampled frames from the chunk. While the fine-grained plan reduces the query execution time\xspace (\textsc{Thia-EI}\xspace in~\cref{tb:back:sys_variants}), it increases the query optimization time\xspace, which hurts the overall query processing time (discussed in~\autoref{sec:eval:over}). To reduce the optimization time\xspace, \textsc{Thia}\xspace instead leverages a more lightweight \textsc{Exit Point Estimation}\xspace technique. \PP{\ding{183} \textsc{Exit Point Estimation}\xspace.} \textsc{Thia}\xspace uses \textsc{Exit Point Estimation}\xspace and \textsc{Fine-Grained Planning}\xspace techniques in tandem to reduce the overhead of the \textsc{Optimizer}\xspace. The \textsc{Optimizer}\xspace uses a shallow neural network to directly estimate when to short-circuit the inference in an \textsc{Early Inference}\xspace model. It trains an EP\xspace estimator for every unique query executed in the system. We discuss how \textsc{Thia}\xspace obtains data for training the \textsc{Exit Point Estimation}\xspace model in~\autoref{sec:plan}. \PP{\ding{184} \textsc{Early Inference}\xspace.} The fine-grained query plan constructed by the \textsc{Optimizer}\xspace consists of a list of chunk\xspace{s} and the model chosen for each chunk\xspace. For example, \textsc{Thia}\xspace may skip frames $0$ through $100$, run EP\xspace-1 on frames $101$ through $300$, and evaluate the oracle EP\xspace (\textit{i.e.,}\xspace EP\xspace-3) on frames $300$ through $500$. The \textsc{Execution Engine}\xspace takes this query plan and uses the \textsc{Early Inference}\xspace technique to deliver different accuracy-performance tradeoffs with a single model.
\section{Introduction} \label{intro} Processing on end user devices (on-device processing) as opposed to server-based processing is a valued approach in enabling end user privacy. This strategy extends to many of our machine learned (ML) solutions, such as our predictive keyboard or on-device dictation. Personalization of these ML-based systems is often paramount in order to enable great user experiences. For example, the ability to personalize towards a user's vocabulary and language constructs is highly desirable in the context of both aforementioned systems. Driven by these realities, we set out to address one specific on-device personalization use case around automatic speech recognition (ASR). This use case requires evaluating and tuning the global (i.e., common to all end users) parameters of a personalization algorithm that creates device specific ASR language models by ingesting data that is only available on-device. As explained in more detail in Section \ref{FET}, this initial use case ultimately led us to create a generic system that allows for evaluating and tuning ML systems across end user devices, i.e., a system that allows for `federated evaluation and tuning' (FE\&T). We generalized the system by abstracting away any use case specific bits, focusing on the requirements common to FE\&T, such as federated task distribution and execution, on-device evaluation data storage and task results ingestion and processing on a central server. Federated learning (FL) refers to gradient based optimization of models across end user devices, with applied works of FL focusing on neural models \cite{DBLP:journals/corr/McMahanMRA16, DBLP:journals/corr/KonecnyMRR16, DBLP:journals/corr/KonecnyMYRSB16, DBLP:journals/corr/BonawitzIKMMPRS16, bonawitz2019federated, DBLP:journals/corr/abs-1908-07873, DBLP:journals/corr/abs-1912-04977}. The many FL publications of recent years influenced us to expand our system to better support FL. While we briefly describe these FL specific system additions, FL is not the primary subject of this paper. We instead focus on the application of our system to on-device personalization. Despite us not primarily focusing on FL, we believe FL and in particular the FL system design paper by \cite{bonawitz2019federated} to be the most relevant related work. We briefly discuss \cite{bonawitz2019federated} and other related work in Section \ref{related}. We continue to compare in more detail to \cite{bonawitz2019federated} in Section \ref{system} while describing our system, to help discuss design decisions and attached trade-offs. Section \ref{applications} describes two on-device ML system personalization use cases, including results obtained. We conclude with a brief summary in Section \ref{summary}. \section{Related Work} \label{related} Even without its FL specific extensions, our system bears strong resemblance to the FL system described in \cite{bonawitz2019federated}. This similarity is due to the fact that both systems at their core require federated task distribution and execution, on-device evaluation/training data storage and server-side task results ingestion and processing. We will attempt to provide a more comprehensive comparison of both systems in Section \ref{system}, but want to point out one major difference already here. The system described in \cite{bonawitz2019federated} is custom designed for FL and does not allow for arbitrary distributed computation. The authors however mention in their future work section that they aim to generalize their FL system towards ``federated computation''. Our system was not motivated by and hence not custom built for training neural networks in a federated setting. Instead, on-device ML systems and their evaluation and tuning/personalization in a federated setting was the initial goal. Our system's on-device components therefore do not center around a neural model training library for task execution. Instead, implementation of on-device task execution is delegated to application specific plug-ins that communicate with our system's on-device task scheduling logic, data store and results reporting logic. The computation performed by these plug-ins can be arbitrary. In addition to the aforementioned FL system paper, the larger field of FL \cite{DBLP:journals/corr/McMahanMRA16, DBLP:journals/corr/KonecnyMRR16, DBLP:journals/corr/KonecnyMYRSB16, DBLP:journals/corr/BonawitzIKMMPRS16, bonawitz2019federated, DBLP:journals/corr/abs-1908-07873, DBLP:journals/corr/abs-1912-04977} constitutes related work. This statement remains true even when only considering our system's FE\&T applications. Maybe trivially obvious, FL also requires model evaluation on held-out federated data. More interesting though is the notion of learning, and in particular what is being learned and how learning occurs in federated tuning (FT) compared to FL. FL learns the parameters of, at times large global neural models. In addition, assuming FL is based on federated averaging \cite{DBLP:journals/corr/McMahanMRA16}, learning (gradient descent) primarily occurs on-device, with the central server `simply' combining individual model updates. In FT, learning primarily occurs on the central server and is limited to a comparatively small set of global parameters (e.g., personalization algorithm parameters) that are `simply' evaluated across federated data. Our application example in Section \ref{sub_news} makes this concept more crisp. Finally, the fact that only small sets of global parameters are being learned in FT by centrally sharing evaluation metrics for specific parameter configurations minimizes the attack surface to end user privacy compared to FL, where high dimensional information (model updates) directly related to user data are centrally shared. We will touch on this topic again in Section \ref{system} when we sketch out our FL specific system extensions. Given that the objective in FL is to learn a global neural network, only few FL publications address the topic of (model) personalization in a federated setting. \cite{DBLP:journals/corr/abs-1912-04977} however do include an insightful discussion on this specific topic. This discussion for example includes the observation that leveraging suitable user and context features fed into a global model can help to produce highly personalized model output. The discussion in \cite{DBLP:journals/corr/abs-1912-04977} also makes the connection to (federated) multi-task learning \cite{DBLP:journals/corr/SmithCST17, DBLP:journals/corr/abs-1906-06268}, when considering the local model learning problem as a separate task. In this context, \cite{DBLP:journals/corr/abs-1912-04977} observe that it also might be possible to apply techniques from multi-task learning where the task is to learn models over subsets of clients, which in turn could also yield more personalized model output. The authors of \cite{DBLP:journals/corr/abs-1912-04977} also discuss local model fine-tuning for the purpose of personalization and the connection to meta learning \cite{Thrun}, and cite in this context work by \cite{Jiang2019}, which shows that federated model averaging \cite{DBLP:journals/corr/McMahanMRA16} is equivalent to an algorithm called Reptile \cite{Nichol2018}. Reptile is a form of model-agnostic meta learning (MAML) \cite{Finn2017}. In general, in MAML, the idea is to initialize a model's parameters such that it can be adapted to a new domain, task or data as quickly as possible --- while making sure to avoid overfitting on the new task. Hence, models trained via federated averaging ought to be more amenable to being adapted/personalized subsequently on personal data. Finally, the authors of \cite{DBLP:journals/corr/abs-1912-04977} also point out prior work around fully decentralized personalization over end user devices, e.g., \cite{DBLP:journals/corr/VanhaesebrouckB16, DBLP:journals/corr/BelletGTT17, DBLP:journals/corr/abs-1803-09737}. \section{FE\&T of ML Systems} \label{FET} \subsection{Motivation} The conditions around our initial application (ASR personalization) led us to consider FE\&T of on-device ML systems and to ultimately implement our federated task processing system. The ASR system of our initial use case is a `conventional' ASR system, i.e., it uses multiple component ML models at inference time. In particular, the component ASR model subject to personalization is a statistical (non-neural) grammar that requires highly application specific code for modification. This explains our initial focus on ML systems versus neural models and also helps to explain our desire to provide flexibility in terms of on-device task execution implementation. Further, in context of our initial use case, we operated under the assumption that only `sufficiently anonymized' and `siloed' ML data are available to us. Sufficiently anonymized in this context means that individual data points cannot, in a computationally reasonable manner, be tied back to a specific end user. Siloed ML data refers to the concept that ML data for a specific user cannot be aggregated across different, application specific data silos. These assumptions led us to focus on the questions of how to measure and how to improve user-specific ML system accuracy, especially in the context of personalization data that, in aggregate, remains inaccessible to us server-side. Our focus on on-device systems and their on-device evaluation and personalization (tuning) stems from these considerations. The consideration of federated evaluation (FE) and the attached server side aggregation of individual evaluation results was driven by the fact that on-device evaluation data is non-IID and often rather limited per device. Hence, individual evaluation results suffer from large quantities of uncertainty and only global results, aggregated across many devices offer meaningful insight. Finally, federated tuning presented itself as a natural and simple extension of federated evaluation. A crucial difference is that, instead of evaluating a single ML system, multiple ML systems are created on-device and evaluated, which might work as follows: A default ML system is set as baseline and a set of parameters sent from the server are applied to modify the behavior of the baseline ML system. Accuracy metrics for the baseline and the modified systems are sent back for analysis and to determine the next set of parameters to consider. \subsection{The Challenge of Ground Truth} \label{sub_truth} In order to compute an evaluation metric on-device, we need to store or record an interaction with the to be evaluated ML system. The stored data needs to comprise the inputs to the ML system and the ground truth defining what the ML system's output should ideally have been. Recording the ground truth is often the more challenging aspect also because both positive and negative outcomes need to be covered. Trivially, such data can be collected at the same time the user interacts with the system, such that the tuple of inputs to the system and target output can be stored. To illustrate this, we provide an example: App suggestions leverages the current device context (for example expressed as a vector of relevant variable values) to offer a list of suggested apps. Whenever a user opens an app, either from the home screen, via the search UI or via the app suggestion's UI, we can store on-device both, the current device context vector and the name of the app that was launched. Thus, we are obtaining both, the required app suggestions system input (the device context vector) as well as the name of the app that should ideally be offered prominently by the app suggestion UI. Unfortunately, ground truth cannot always be obtained in such a simple manner. For example, in the context of evaluating ASR accuracy via the established word error rate metric, an error free reference transcript is required. Relying in this case on user interaction derived ground truth -- maybe whenever a user manually edits an automatic transcript -- is problematic, since evaluation data would be highly skewed towards such user caught and corrected error cases. One obvious solution might be to ask the end user to provide relevant ground truth, by for example asking the user to rate individual interactions. Although attractive from the perspective of potentially obtaining high-quality ground truth labels, such data cannot be collected automatically as in the case of the implicit signals, and relies heavily on the good will and participation of users. The quality of such labels is also highly dependent on the user, and may be inconsistent across the individuals providing such labels. As illustrated by the ASR example, collecting ground truth labels on-device can be challenging and is sometimes even impossible. One potential remedy lies within leveraging a semi-supervised ML approach. For instance, one could conceive of a student-teacher training situation, where a slow, but highly accurate ML model is used to provide pseudo ground truth labels that are used to evaluate the actual run-time model. A related approach is to use a proxy evaluation metric that relies on ML system output confidences. In Section \ref{applications}, we will discuss in detail an ASR application specific solution of this form where ASR word confidences\footnote{Word confidences provide an estimate of how likely a word has been correctly recognized.} are used to compute a proxy evaluation metric. \section{System Description} \label{system} To help discuss design choices and associated trade-offs, we will in the following draw parallels to $Sys_{Bon}$, the FL system described in \cite{bonawitz2019federated}. \subsection{High Level System Design} \label{sub_highlevel} Figure \ref{fig:system} shows the high level system design. First to note, and in contrast to $Sys_{Bon}$ is the client side plug-in architecture. Task interpretation and execution is delegated to these application specific system plug-ins. The core system, described in more detail in Section \ref{sub_core} remains task agnostic. This overall system design therefore supports arbitrary federated tasks. Plug-ins that execute FL tasks are required to make use of the private federated learning (PFL) additions, which provide support for federated neural network training where final model updates undergo statistical noising that guarantee differential privacy (DP) \cite{DBLP:journals/fttcs/DworkR14}. More details on these PFL components are provide in Section \ref{sub_FL}. \begin{figure} [h] \vspace{3mm} \centering \includegraphics{SysArchAbstracted.pdf} \caption{System Design Overview.} \label{fig:system} \end{figure} \subsection{Device Participation \& Data Handling} \label{sub_part} {\bf Device participation} is gated by both, system-level preconditions as well as federated task specific preconditions. The latter will be discussed in Section \ref{sub_core} in context of our task scheduler component. In terms of the former, participation is limited to genuine devices, guaranteed via a device attestation mechanism similar to $Sys_{Bon}$. In addition, devices need to be opted into the data collection program, thus enabling end users to opt out of participation. \cite{bonawitz2019federated} does not describe a similar mechanism. Our design choice to limit participation to opt-in devices has the potential to introduce bias. Another source for potential bias is the fact that devices need to be plugged into power, idle, and connected to an unmetered network in order to run federated tasks, which helps avoiding end users being negatively impacted by task execution and results reporting. $Sys_{Bon}$ sets the same preconditions and \cite{bonawitz2019federated} also discuss the potential for bias arising from these preconditions, while observing that mechanisms such as live A/B experiments of the final FL model can help detect any such bias. A/B experimentation (outside of our system's framework) is also a commonly employed by our adopter applications before fully deploying FL models or FT obtained personalization parameters. {\bf On-device data handling}. Our system provides an on-device data store that applications are recommended to use for logging user interaction data and associated ground truth. The data store is automatically purged on data collection program opt-out and write requests are denied if the device is opted out. To help protect against scenarios in which a user's device gets compromised, the data store remains encrypted until first user unlock after a device shutdown or reboot. In addition, the data store provides, per application configurable default implementations for common on-device data retention policies. The functionality provided includes sub-sampling (i.e., store only a random sample of user interactions), automatic deletion after $m$ days and capping the number of records by overwriting the oldest one once $n$ records have been written. These mechanisms help ensure that the amount of application specific data stored is limited and recent, and that no predictable sequence of events (e.g. the most recent ones) nor a long history of events are covered. In $Sys_{Bon}$, on-device data storage and attached retention policies are fully delegated to applications, which in turn have to ensure that their data is accessible for FL by implementing a $Sys_{Bon}$ specific API. The main motivator for us to offer a default on-device data store is ease of adoption. Since on-device computation on application specific data is delegated in our system to application specific plug-ins, there is no requirement for our (core) system to interpret or process this on-device data. {\bf Results data handling}. While data held in our on-device data store never leaves the device, task results derived from this data, i.e., evaluation metrics (FE\&T) and statistically noised model updates (FL) are being send to our servers via encrypted channels. We also share information on the total amount of application specific data records held in the on-device data store as part of our system's health telemetry data, to help gauge the overall size of device populations available for application specific federated task execution. When logging data (results \& telemetry) server-side, we strip away all user and device identifies (e.g., IP addresses) to avoid that such server logged data can be tied back to a specific user or device. Data shared with our servers can be inspected by the end user within the privacy settings on-device. We will further touch on FL results data handling in Section \ref{sub_FL}. \subsection{Core System} \label{sub_core} {\bf On-Device components} include \emph{data store} (see previous section), \emph{task scheduler} and \emph{results manager}. The \emph{results manager} is primarily responsible for sending back the task results and to populate an on-device DB that allows end users to inspect data shared with the server (see previous section for details). In addition to task results, the \emph{results manager} also collects and sends to the server system health related telemetry data. The \emph{task scheduler} periodically connects to our content delivery network (CDN) to download a list of available task descriptors, if the system-level preconditions for device participation are met. Task descriptor download occurs in random order on a per registered plug-in basis to more evenly distribute the globally available compute. Once all task descriptors for a plug-in are downloaded, the scheduler samples exactly one matching (more details below) task for execution by the plug-in. The likelihood for task selection is governed by a sampling rate that is included in the task descriptor. While simple, this task selection mechanism provides an effective means to control how many devices globally attempt to execute a specific task. Task execution is further gated by our on-device matching logic, which examines additional preconditions listed in the task descriptor. These preconditions often refer to device-global variables, such as device or OS type and version. These preconditions can also refer to keys describing the on-device stored data. The latter allows, in a flexible manner, to run a specific task only on data falling out of specific end user interactions, e.g., speech audio recordings made in context of dictation vs. assistant requests. Once all task preconditions are met, the scheduler downloads the actual task including task specific attachments (e.g., models) and hands it over to the plug-in for execution. Logic is included to monitor task download and plug-in task execution times, as well as to abort task execution should a device for example become disconnected from power. Our described, on-device heavy task scheduling logic differs significantly from $Sys_{Bon}$, where task participation is orchestrated by the server. In $Sys_{Bon}$, devices periodically check in with the server and the server selects a subset of devices via reservoir sampling\footnote{\cite{bonawitz2019federated} mention that the selection protocol is amenable to more sophisticated methods.} to participate in a training round. Devices that are not selected receive instructions when to re-connect, thus regulating the pattern of device connections. This mechanism, referred to as `pace steering' by \cite{bonawitz2019federated} ensures that a sufficient number of devices connect to the server simultaneously, which, according to \cite{bonawitz2019federated}, is important to both, the rate of FL task progress and the properties of the Secure Aggregation \cite{DBLP:journals/corr/BonawitzIKMMPRS16} protocol which is optionally available in $Sys_{Bon}$. Compared to our simpler, task specific sample likelihood \footnote{Task sample likelihoods are configured server side.} approach, `pace steering' can therefore be viewed as more sophisticated but somewhat FL task and implementation specific optimization, focusing on synchronization amongst a fixed set of devices, connected simultaneously to the server. In our system design, we did not consider a task specific requirement of having to guarantee a minimum number of devices to connect simultaneously to the server. We primarily focused on having a sufficient number of devices reporting back, asynchronously, within a reasonable amount of time without overwhelming the server with too many concurrent connections. Any synchronization needs in our system are handled by a combination of a central results data base and coordinator scripts, as described in the following section. {\bf Server components} include \emph{task manager}, \emph{data manager} and \emph{developer interface}. The \emph{task manager} is the core component of the server. It manages storage and publication of all tasks and their attachments (e.g., model) to the CDN as well as retiring tasks. Tasks are retired once either a task has been active for a pre-defined time window or once their targeted number of results have been received. Any straggling results arriving server side after a task has been retired are ignored. The \emph{task manager} also monitors the flow of incoming results to ensure that tasks that incur too much traffic do not overwhelm the infrastructure. Lastly, the component also ensures that results from older tasks are regularly and automatically purged from our central results database. The \emph{data manager} drops any sensitive metadata from the incoming HTTP request and forwards results and telemetry information to a central data base. Telemetry data includes high level statistics around average task execution times, error conditions and amounts of available on-device data. The latter helps to gauge the size of federated device populations. The \emph{developer interface} consists of both, a web UI and a python script library. The web UI is primarily used to monitor task status and to inspect telemetry data, but for example also allows to download results. System adopters primarily interact with the system via scripts to schedule tasks and to retrieve and process results available for each task. The server components of $Sys_{Bon}$ are not surprisingly highly specific and optimized to FL. Their implementation focuses on how to efficiently at scale do both, coordinating training rounds and performing aggregation for model averaging. Specifically, $Sys_{Bon}$ performs aggregation of results in memory. Only fully aggregated results are persisted. \cite{bonawitz2019federated} mention that ephemeral, in-memory aggregation improves latency but also minimizes the possibility of attacks within the data center, since no per-device result logs exist. Our design choice to persist per-device results and to delegate results aggregation to adopters stems from our task agnostic design, which requires flexibility. We consider computational inefficiencies and increases in attack surface stemming from this flexibility as less pressing in the context of FE\&T, given that only small dimensional information is centrally shared. The aforementioned considerations become however more pressing in the context of FL. We therefore pursued FL specific system additions to help address these considerations, as described in the next section. \subsection{FL Specific Additions} \label{sub_FL} The many FL publications of recent years inspired us to extend our system to better support FL, using federated averaging \cite{DBLP:journals/corr/McMahanMRA16}. For FL applications, on-device task execution and server-side results processing is (on a high level) identical. Thus, we added common components that provide efficient implementations for both. For on-device task execution, a neural network training library provides \emph{model training} support. Server-side results processing is provided by a central \emph{aggregation service} that combines individual model updates to compute the averaged model of the current training iteration. Aggregation kicks off automatically as soon as a, by the \emph{FL training script} predefined number of individual model updates becomes available in the system's central data base. The \emph{FL training script} is responsible for coordinating the overall model training across multiple training iterations. As discussed at the end of the previous section, storing individual model updates increases risk in the context of attacks in the data center. This is true since the individual model updates contain high dimensional information directly related to on-device stored data \cite{Fredrikson2015ModelIA, Melis2018InferenceAA}. We alleviate these risks by using both, a combination of ad hoc implementation strategies, as well as more formal strategies based on local and central (DP) \cite{DBLP:journals/fttcs/DworkR14}. In terms of a the former, individual model updates are encrypted on-device with a training round specific public key. The encrypted model updates are made available to the \emph{aggregation service} in random order. The \emph{aggregation service} holds the private key ephemerally and performs aggregation of the decrypted individual model updates in-memory. To add DP guarantees, the \emph{local privacy manager} adds a relaxed version of local DP noise to model updates \cite{bhowmick2019protection}. Server side, the \emph{global privacy manager} adds central DP noise to the final, updated model before making it available to the \emph{FL training script}, which coordinates training rounds. To summarize the differences to $Sys_{Bon}$, we use a central DB to temporarily store encrypted, local DP noised individual model updates. Further, we rely on potentially less efficient FL training scripts to coordinate training rounds. Finally, $Sys_{Bon}$ includes an implementation of secure aggregation, which helps to minimize the attack surface to end user privacy by allowing devices to share cryptographically masked updates. The cryptographic noise added to these individual model updates cancels out when computing the aggregate result. As pointed out by \cite{bonawitz2019federated}, secure aggregation however incurs costs that grow quadratically with the number of devices, effectively limiting the cohort sizes to hundreds of devices. \section{On-Device Personalization Applications} \label{applications} Within our system, FL applications have gained traction in recent years. Examples include improving our acoustic keyword trigger models \cite{Granqvist20} or federated learning of language models for an improved predictive keyboard \& error correction experience. However, applications around FE and FT still constitute a large percentage of system usage. Since FE occurs on historic user interaction records it often allows for significantly reduced turn-around times when compared to live A/B experimentation. For this reason, FE can help to quickly identify the most promising ML system or model candidates before exposing end users to these candidates via live A/B experimentation. In the following, we describe two FT applications that center around ML system personalization, to highlight the applicability of FT to on-device personalization. The first application we describe is news personalization. Since on-device ground truth generation is less challenging in the context of news personalization (it can be approximated from user interactions with news content), we are focusing our description on the specific FT approach taken. This focus highlights how and where learning occurs in FT. It also highlights the flexibility our system provides in terms of on-device task execution implementation and server side, typically script based task results processing. The second application we are describing is ASR personalization, which was our initial use case, prompting us to develop our system in the first place. We consider the for this use case challenging problem of on-device ground truth generation as the more interesting aspect, and hence focus our description on this particular aspect. \subsection{News Personalization} \label{sub_news} To help present news based on a user's interests, an on-device personalization algorithm is used. This algorithm is governed by several parameters, such as the half life of the time decay on an article's personalized score. Tuning of these parameters is challenging, since news content is constantly changing, e.g., due to new topics or due to seasonal variations in topic relevance. As a consequence, continuous adaptation of these parameters with quick turnaround times is important, so that the most relevant content can continue to be surfaced despite these changing trends. FT allows us to optimize these parameters quickly to achieve such turnaround times. For news personalization, on-device evaluation/tuning data, including the notion of ground truth, can be derived from user interactions with news content. For example, we can store information on-device for articles a user has read (user tapped headline of news article; positive label), or has viewed but has not read (headline was not tapped; negative label). The on-device system plug-in for this use case accepts ranges of values for each parameter. For example, if the goal is to determine the optimal value of the half life parameter and the developer had no prior notion of what a good value should be, a range covering all possible valid values might be defined. During tuning task execution, the plug-in runs a randomized grid search on the parameter space defined, randomly generating configurations. The configurations are applied to the personalization algorithm which predicts how likely it is that a user will read an article contained in the on-device tuning data set. The predictions are compared the the ground truth labels to calculate a prediction loss for each randomly generated configuration. Running a single FT task iteration results in millions of loss and configuration pairs from thousands of devices. These per iteration results are smoothed server-side by the application specific coordinator script in order to determine the search space for the next iteration, as described in the following. The problem of optimizing $n$ parameters can be implemented as an $n$-dimensional clustering problem with clusters of size $k$, where $k$ can be optimized. The cluster with the minimum prediction loss is identified by the following formula: \[loss = min(\sum_{\hat{r} \in R} \sum_{\hat{n} \in N} ||\hat{r} - \hat{n}|| \cdot loss(\hat{n}) \cdot \frac{1}{|N|})\] $R$ is the set of clusters, and $N$ is the set of nodes within each clusters. This function finds the average loss of the cluster, weighted by the distance of each point to the centroid of the cluster, rewarding clusters that are tightly grouped together (and thus have lower variance) and have low prediction loss (and therefore have a higher accuracy in predictions). The cluster with the minimum prediction loss is used to determine the minimum and maximum values for each of the $n$ dimensions, and this forms the search space for the next FT task iteration. This process is repeated until convergence, yielding a locally optimal set of values for the parameters that were defined in the tuning task. To prove the validity of this approach, we show results from two different FT runs. The FT runs differ in terms of the number of personalization algorithm parameters that are being optimized, as well as in how ground truth (positive and negative labels) was obtained in a rule based manner on-device (e.g., headline of article was tapped or not). Table \ref{table:dodEvals} shows these details, including results for the relative decrease in prediction loss. \begin{table} [h] \vspace{-2mm} \caption{Federated tuning for news personalization.} \vspace{2mm} \begin{center} \begin{tabular}{ ccc } \bf{} & \bf{FT Run 1} & \bf{FT Run 2} \\ \toprule Iterations & 6 & 42\\ \cmidrule{1-3} Parameters & 6 & 11\\ \cmidrule{1-3} Pos. label & tapped & $>= n$ sec in article\\ \cmidrule{1-3} Neg. label & not tapped & not tapped\\ \cmidrule{1-3} Pred. loss & -86\% & -23\%\\ \bottomrule \end{tabular} \end{center} \label{table:dodEvals} \end{table} For both FT runs, live A/B experiments were conducted to measure the impact of the optimized personalization algorithm parameters on end user experience. Table \ref{table:AB} shows the results. \begin{table} [h] \vspace{-2mm} \caption{Live A/B experimentation results.} \vspace{2mm} \begin{center} \begin{tabular}{ ccc } & \multicolumn{2}{c}{\bf{Delta[\%]}} \\ \cline{2-3} \bf{} & \bf{Run 1} & \bf{Run 2} \\ \toprule daily article views & +1.98 & +1.87\\ \cmidrule{1-3} daily time spent & n/a & +0.90\\ \bottomrule \end{tabular} \end{center} \label{table:AB} \end{table} The optimized parameters from FT run 1 resulted in a 1.98\% increase in daily article views, but no statistically significant difference in daily time spent within the application\footnote{Stocks application, which includes news headlines.}. The optimized parameters from FT run 2 resulted in a 1.87\% increase in the daily article views, and a 0.90\% increase in the daily time spent within the application. \subsection{ASR Personalization} \label{sub_pasr} In the following, we are describing a `hybrid' ASR system solution, distributed across end user device and server. This hybrid ASR system computes its final recognition result using server-side ASR system combination, in which the recognition result from a highly personalized on-device ASR system is combined with the results from a more generic server based ASR system. Similar hybrid approaches to ASR personalization have been explored before \cite{georges2014,mcgraw2016,glackin2017}, albeit not to our knowledge in the context of at scale FT of the personalized on-device ASR system. Our ASR engine that transcribes a user's speech input utilizes a generic vocabulary consisting of several hundred thousand words. In order to enable recognition of out-of-vocabulary words and less common language constructs a specific user might utter, the ASR system is able to dynamically load user-specific statistical grammars at run-time using the approach described in \cite{paulik2016method}, which is similar to \cite{novak-2012-look} and the more general class-based language modeling concept described in \cite{brown-92-class}. These dynamic grammars are spliced into the larger, generic (i.e. non-user specific) grammar of the on-device ASR system. The user-specific grammars can be learned on-device from user specific text data sources. These on-device data sources include for example a user's contact list and contact interaction counts, internet search history, frequently visited addresses/points of interest, vocabulary learned from keyboard interactions, named entities discovered in read web pages and news articles, etc. The overall personalization algorithm leverages around 30 parameters that govern both, user-specific grammar compilation and their dynamic application at run-time. For example, these parameters include per sub-grammar global scaling factors, determine what on-device text data sources to use (e.g. based on usage) and influence word n-gram probability estimation from frequency counts (e.g contact call frequencies). FT relies on FE, which in turn requires evaluation data that includes ground truth labels. The raw evaluation data falls out of regular user interactions with the ASR system, for example when a user addresses our assistant or dictates a text message. We sample some of these interactions, safely storing the speech audio in our on-device data store. Ground truth generation is however more complicated. The established evaluation metric in ASR is word error rate (WER) and our objective is to reduce WER. Word error rate is defined as the ratio of the word level Levenshtein distance \cite{Levenshtein} to number of words in the reference transcription: \begin{center} $WER = \frac{\# minimum\ word\ edits}{\# reference\ words}$ \end{center} That is, to compute WER we require our evaluation data to be labeled with manual reference transcriptions, which are not readily available on-device (see also the discussion in Section \ref{sub_truth}). We therefore decided to rely on a semi-supervised learning approach that leverages a machine learned, global word confidence model \cite{evermann-2000-conf,wessel2001,sanchis2003,jiang2005,seigel2011} to estimate word error rate (eWER) in the absence of reference transcriptions. Word confidence models assign noisy probability scores $c(W, D) \in [0,1]$ to each hypothesized word $W$, expressing the likelihood for the word being correctly recognized. To do so, these models use input features $D$ that are typically computed during the ASR decoding process. In the context of this work, it is important to only rely on features $D$ that remain largely independent from personalized grammar influences, e.g. acoustic likelihood scores and phone/word duration features. We estimate the WER for an utterance $\mathbf{U}$ of length $|\mathbf{U}|$ as follows: \begin{center} $eWER(\mathbf{U}) = 100 \times \left(1 - \frac{1}{|\mathbf{U}|}\sum_{W \in \mathbf{U}}{c(W, D)}\right) + \rho$ \end{center} The global calibration factor $\rho$ compensates for the fact that our confidence model cannot account for ASR word deletions. Table \ref{table:ewer} shows how well our eWER metric compares with actual WER measurements. The results shown are in context of a simplified form of personalization towards a single data source, namely contact names in a user's address book without frequency counts. Comparison of estimated and actual WER is possible for this specific type of personalization due to the existence of a small server-side test set that includes contact names derived personalization grammars on a per utterance basis. The first data row in Table \ref{table:ewer} shows results on this centrally held test. Since human created reference transcriptions are available for this test set, we can directly compare actual WER with eWER. The table also lists results for three differently sized, federated test sets. Reference transcriptions, and therefore actual WER values are not available for these federated sets. In fact, these federated test sets remain hidden to us, i.e. we have no access to the underlying audio data nor the associated transcript. If we assume that our centrally held test set is drawn from the same distribution as the federated test sets, WER and eWER values on all these sets should be similar. \begin{table} [h] \vspace{-2mm} \caption{Comparing estimated and actual WER for a simplified form of contact list personalization.} \vspace{2mm} \begin{center} \begin{tabular}{ cccc } \multicolumn{2}{c}{} & \multicolumn{2}{c}{\bf{WER [\%]}} \\ \cline{3-4} \bf{evaluation} & \bf{\# requests} & \bf{actual} & \bf{estimated} \\ \midrule central & 3,654 & 12.0 & 12.1\\ \cmidrule{1-4} & 10k & N/A & 14.4\\ \cmidrule{2-4} federated & 100k & N/A & 13.2 \\ \cmidrule{2-4} & 300k & N/A & 13.1 \\ \end{tabular} \end{center} \label{table:ewer} \end{table} The results on the differently sized federated tests sets show that eWER stabilizes at around 13\% at larger set sizes, comprising 100k and more utterances. We confirmed this behavior via multiple federated evaluation runs (not shown in the table). The need for such rather large federated test set sizes is largely due to the noise in the word error estimates of the machine learned confidence model. However, even at federated test set sizes of 100k and beyond, we still observe a difference of 1\% absolute between the eWER of the federated set and the eWER as well the actual WER observed on the central, human transcribed test set. We determined that this difference stems from the fact that our central test set had been scrubbed of audio recordings that only contain background noise and no audible speech. Based on the objective function of minimizing eWER, we tune via FT the global parameters that govern how each device personalizes its client ASR system from personal data sources. As mentioned at the beginning of this section, we use server-side ASR system combination to combine the result of the on-device ASR system with the result of the server-side ASR system. Thus, the final recognition result is available to us server side, enabling us to measure the impact of the optimized personalization algorithm parameters on the final transcription accuracy in terms of actual WER. To do so, we periodically and randomly sample, from production traffic, several thousand anonymized speech recognition results after ASR system combination and ask human graders to provide reference transcriptions after listening to the temporarily available speech audio. ASR system combination only affects the outcome of approximately 10\% of speech utterances directed to our assistant. Overall, we observe that mostly those utterances are affected by ASR system combination for which the generic server ASR system struggles, i.e. where transcription accuracy suffers from a significantly elevated WER compared to the remaining $\sim$90\% of the speech recognition traffic. The results shown in Table \ref{table:finalASR} relate to 3,851 assistant directed requests where the final automatic transcript changed due to ASR system combination. We can automatically detect utterances for which the final transcript includes words or phrases surfaced by our on-device personalized grammar components. In the following, we refer to these utterances as `user vocabulary' utterances. Utterances for which the final result changed due to ASR system combination but the transcript only includes words and phrases that stem from our generic grammars are in the following referred to as `generic vocabulary' utterances. The first data column in Table \ref{table:finalASR} shows the request count, and the second data row shows the WER that would have been achieved without any personalized on-device ASR. The third data row shows the WER after ASR system combination with the client ASR result. Taking overall traffic into account, roughly 3.9\% (6.1\%) of all assistant directed utterances are user (generic) vocabulary utterances benefiting from personalized client ASR. Especially on user vocabulary utterances, the relative WER reductions of 16.4\% are significant. However, even for generic vocabulary utterances, small relative WER reductions of 1.4\% are achieved, thanks to generic ASR system combination effects. \begin{table} [h] \vspace{-2mm} \caption{Word error rates on utterances affected by system combination.} \vspace{2mm} \begin{center} \begin{tabular}{ lcccc } \toprule & & \multicolumn{2}{c}{\bf{WER[\%]}} \\ \cline{3-4} \bf{Requests with} & \bf{Count} & \bf{Server ASR} & \bf{+Client ASR} \\ \midrule user vocab. & 1,504 & 24.4 & 20.1 \\ generic vocab. & 2,347 & 14.6 & 14.4 \\ \end{tabular} \end{center} \label{table:finalASR} \end{table} \section{Summary} \label{summary} We described the system design of our federated task processing system, which has its roots in federated evaluation (FE) and federated tuning (FT) of ML systems. System development was originally motivated by a specific use case: On-device personalization of an automatic speech recognition (ASR) system, which requires optimization of a global parameter vector that governs how the ASR system is personalized on an end user's device. We provided a detailed description of this initial use case and of one additional personalization use case, highlighting the applicability of FT to on-device ML system personalization. Largely due to the need to support arbitrary evaluation task and tuning task implementations in context of ML systems, our federated task processing system design allows in principle for arbitrary distributed computation. The ability to support arbitrary distributed computation is is partly demonstrated by the described personalization applications, as well as the federated learning (FL) specific systems extensions we have sketched out. These system extensions provide FL support combined with DP guarantees and are thus referred to as `private federated learning' (PFL) extensions. \bibliographystyle{unsrt}
\section{Introduction} \input{sections/introduction.tex} \input{sections/relatedwork.tex} \input{sections/background.tex} \input{sections/methodology.tex} \input{sections/results.tex} \input{sections/conclusion.tex} \section{Background} \label{sec:background} When we work with data that are uniformly sampled in one dimension there is only one possible sampling scheme --- take equally spaced samples along the indepenent axis. The straightforward extension of this to multiple dimensions is to sample evenly in all cardinal directions, i.e. a Cartesian sampling. However, the situation is generally more complex in higher dimensions. To move away from Cartesian lattices and account for this complexity, a function can be sampled according to an invertible matrix. This matrix --- known as the generating matrix --- represents a lattice structure. That is, if we have a real valued function $f(\mathbf{x})$ in some dimension $s$, we define the sampled version of that function with respect to a given lattice as $f_{\mathbf{n}} := f(hL\mathbf{n})$. Here, $h$ is a real valued scale parameter that controls the granularity or coarseness of the sampling pattern (i.e. the sampling rate), $\mathbf{n} \in \mathbb{Z}^s$ and $L$ is the generating matrix of the lattice. In any dimension, the $s \times s$ identity matrix generates a Cartesian sampling. In two dimensions the hexagonal and quincunx lattices are generated by the matrices \begin{equation} L_{HEX}:=\begin{bmatrix} 1 & \frac{1}{2} \\ 0 & \frac{\sqrt3}{2} \end{bmatrix} \;\; \text{and} \;\; L_{QC}:=\begin{bmatrix} 1 & -1 \\ 1 & 1 \end{bmatrix} \end{equation} respectively (Figure~\ref{fig:2d_lattices}). In three dimensions, the BCC and FCC lattices are generated by \begin{equation} L_{BCC}:=\begin{bmatrix} -1 & \phantom{-}1 & \phantom{-}1 \\ \phantom{-}1 & -1 & \phantom{-}1 \\ \phantom{-}1 & \phantom{-}1 & -1 \end{bmatrix} \;\; \text{and} \;\; L_{FCC}:=\begin{bmatrix} 0 & 1 & 1 \\ 1 & 0 & 1 \\ 1 & 1 & 0 \end{bmatrix} \end{equation} respectively (Figure~\ref{fig:lattice_ind}). It is worth noting that a lattice may be generated by any number of different generating matrices --- one may construct an equivalent lattice by carefully choosing vectors in $L\mathbb{Z}^s$. In general, finding a minimal basis for a given generating matrix is an NP-hard problem~\cite{conway2013sphere}, as such it is difficult to find a relationship between matrices that generate the same lattice. While lattice theory is quite deep and general, we only adhere to the case where $L\in\mathbb{Z}^{s\times s}$ and $L$ has full rank. This is because, in practice, we use lattices as array-like data structures and it is not possible to index via real valued numbers. As a consequence, it is not possible for us to directly represent functions on the hexagonal lattice within our framework. However, it is possible to stretch an integer lattice into another non-integer lattice; for example, in Figure~\ref{fig:2d_lattices}, the hexagonal lattice can be seen as a distorted quincunx lattice. Another fundamental object related to a lattice is its {\em Voronoi} region, which is the set of points closest to the lattice site situated at the origin (both Figure~\ref{fig:lattice_ind} and Figure~\ref{fig:2d_lattices} show each lattice's Voronoi region). The Voronoi region of a lattice embodies all the properties of a lattice --- from it one may derive the shortest vector of a lattice (i.e. the shortest vector problem which is NP-complete) as well as set of shortest spanning vectors, the symmetry group of the lattice, packing efficiency etc. ~\cite{conway2013sphere,viterbo1996computing}. Unsurprisingly, computing the Voronoi region of a lattice is NP-complete as well, but for reasonably specified bases in lower dimensions, the problem is tractable via the Diamond Cutting algorithm~\cite{viterbo1996computing}. \begin{figure} \centering \includegraphics[]{images/2d/2d_lattices.pdf} \caption{The square Cartesian (left) quincunx (middle) and hexagonal (right) lattices respectively. Notice the coset structure of the quincunx lattice is two interleaved Cartesian lattices --- denoted by the difference in lattice site coloring. The same applies for the hexagonal lattice, although slightly distorted.} \label{fig:2d_lattices} \end{figure} To reconstruct a function on a given lattice, we choose a basis function $\varphi(\mathbf{x})$, shift it to each lattice site, and modulate it by the coefficient stored at that lattice site. The space of all functions spanned by the lattice shifts of $\varphi$ is defined as the set \begin{equation}\label{eq:conv_sum} \mathbb{V}\left(\varphi,L,h\right) := \left\{ \sum_{\mathbf{n}\in L\mathbb{Z}^s}c_{\mathbf{n}}\varphi\left(\frac{\mathbf{x}}{h}-\mathbf{n}\right) : \mathbf{c} \in l_2 \right\}, \end{equation} where $\mathbf{c}$ is a real-valued coefficient sequence associated with the lattice. Obtaining a good approximation $\tilde{f}(\mathbf{x}) \in \mathbb{V}(\varphi,L,h)$ to $f(\mathbf{x})$ equates to finding an appropriate set $\{c_\mathbf{n}\}$; this is highly dependent on the choice of $\varphi(\mathbf{x})$ and $L$. If we are so lucky that $\varphi(\mathbf{x})$ is interpolating on $L$ (i.e. $\varphi(\mathbf{0}) = 1$ and $\varphi(L\mathbf{n}) = 0$ when $\mathbf{n} \in \mathbb{Z}^s/\{\mathbf{0}\}$), then we may choose $c_{\mathbf{n}} = f(hL\mathbf{n})$. However, in general, some preprocessing must be performed in order to achieve optimal error decay between the original function and its approximation. This is beyond the scope of this article, but the interested reader may refer to some of the related work~\cite{unser2000sampling, blu1999quantitative, usmanThesis}. Since any asymptotic analysis is outside of the scope of this paper, without loss of generalization we set $h=1$. As for specific choices of $\varphi$, box splines have been investigated extensively in scientific visualization. Box splines have many equivalent definitions, but perhaps the most intuitive is the convolutional definition where one successively convolves an indicator function along the $\boldsymbol\xi_i$ direction vectors~\cite{deboorbox}. We collect $n$ of these vectors in an $s \times n$ matrix \begin{equation} \Xi := \begin{bmatrix} \boldsymbol\xi_1 & \boldsymbol\xi_2 & \boldsymbol\cdots & \boldsymbol\xi_n \end{bmatrix}. \end{equation} In our case, we are interested only in matrices where $n \ge s$ and the dimension of the range of $\Xi$ is equal to $s$; we require these for a valid approximation scheme~\cite{deboorbox}. With this, a box spline can be defined recursively as \begin{equation} M_\Xi(\mathbf{x}) := \int_0^1 M_{\Xi/\{\boldsymbol\xi\}}(t\boldsymbol\xi - \mathbf{x}) dt, \quad \text{for} \; n > s, \end{equation} where ${\Xi/\{\boldsymbol\xi\}}$ is interpreted as removing a direction vector $\boldsymbol{\xi}$ from the matrix $\Xi$. When $n=s$, we define $M_\Xi(\mathbf{x})$ as \begin{equation} M_\Xi(\mathbf{x}) := \begin{cases} \frac{1}{\det|\Xi|} & \text{if } \Xi^{-1}\mathbf{x} \in [0,1)^s \\ 0 & \text{otherwise} , \end{cases} \end{equation} which provides a base case for the recursion. The box spline $M_\Xi(\mathbf{x})$ is compactly supported within a polytope defined by the Minkowski sum of the direction vectors in $\Xi$. We denote the support as $\text{supp} \, M_\Xi$; it is given by \begin{equation} \text{supp}\,M_\Xi = \left\{\sum_{k=1}^n a_k \boldsymbol{\xi}_k \;|\; \forall(k)\; a_k \in (0,1) \right\}. \end{equation} $M_\Xi$ is piecewise polynomial within its support. The polynomial pieces are delineated by all $(s-1)$-dimensional hyperplanes spanned by the direction vectors in $\Xi$. Denoting $\mathbb{H}$ as the set of all such hyperplanes, we can define a fine mesh that is formed by the lattice shifts of $M_\Xi$: \begin{equation} \Gamma(\Xi, L) := \bigcup_{H\in\mathbb{H}} H + L\mathbb{Z}^s. \end{equation} Each region of the mesh is a convex polytope that contains a polynomial, typically these are different polynomials, however, it is possible that some regions may share the same polynomial. In general, it is possible to derive the explicit piece-wise polynomial form for each of these regions~\cite{horacsek2016}--- we will use this explicit form in Section~\ref{sec:method} to determine a simpler representation of the convolution sum in Equation~\ref{eq:conv_sum}. Our framework also accounts for Voronoi splines, which can be intuitively defined as successive convolutions of a lattice's indicator region with itself. More precisely, Voronoi splines are defined as \begin{eqnarray} V_0(\mathbf{x}) &:=& \chi_L(\mathbf{x}) \\ V_n(\mathbf{x}) &:=& (V_0 \ast V_{n-1})(\mathbf{x}) \end{eqnarray} where $\ast$ denotes convolution, and $\chi_L(\mathbf{x}) = 1/|\det{L}|$ if $\mathbf{x}$ is in the Voronoi region of the lattice $L$, and $0$ otherwise. Voronoi splines are also piece-wise polynomial, and their piece-wise polynomial form may be obtained by first redefining $V_0(\mathbf{x})$ as the sum of a collection of constant valued box splines; higher order $V_n(\mathbf{x})$ may be obtained by the convolution definition~\cite{mirzargar2010voronoi}. Unrolling the recursion, we obtain $V_n(\mathbf{x}) = V_0(\mathbf{x})^{\ast n}$ where $\ast n$ denotes successive convolutions. If $V_0(\mathbf{x})$ is the sum of box-splines, then one may use the multinomial theorem to expand $V_0(\mathbf{x})^{\ast n}$ into the sum of many box-spline convolutions; convolving a box-spline with another box-spline simply produces a (possibly shifted) box-spline. Thus, by summing all these box-splines, we arrive at the final piece-wise polynomial form. However, these calculations are not trivial. For the BCC lattice, $V_0(\mathbf{x})$ is the sum of 16 box-splines, $V_1(\mathbf{x})$ (analogous to the tri-linear B-spline on the CC lattice) is the sum of 136 box-splines, $V_2(\mathbf{x})$ is the sum of 816 and $V_3(\mathbf{x})$, the sum of 3876~\cite{mirzargar2010voronoi}. While these numbers are not intractably large, keep in mind that one must compute a box-spline's polynomial representation at every iteration, which can take a non-trivial amount of time; on the order of a few dozen minutes, for the splines that sum to $V_3(\mathbf{x})$. Spread across 4 CPU cores, this took us about a month to compute. \section{Conclusion} We presented a generalized framework for analysing multidimensional splines on non-Cartesian (and Cartesian grids), with the target of producing fast evaluation schemes for said spline spaces. While this is the main contribution of the work, we also produced performant code for the notoriously complex Voronoi splines on the FCC and BCC lattice which have not yet had efficient implementations. We also demonstrated the computational behaviour of our approach as spline size increased, showing reasonable computational increase as the support of a spline increases---however we saw that it is difficult to predict performance based on support size alone. Finally, we investigated the performance in 4-dimensions, and provided an imlpementation (and quasi-interpolant filter) for a spline on the $\mathcal{D}_4$ lattice. The entire pipeline of our worksheet is implemented within a SageMath worksheet, and is available on github~\cite{sage, fastsplinegit}. Further details related to the code generation step of our pipeline, as well as detailed performance results are presented in part II of this work~\cite{part2}. Future theoretical work is focused on extending this framework to more classes of splines (i.e. the exponential box splines), designing optimized interpolants and assessing the quality of interpolants in a systematic manner. \section{Experiments \& Results} \label{sec:results} In this work, we validate our methodology by demonstrating that our framework works for many different test cases. While performance is important, and we do report limited performance metrics in this work, we defer in-depth performance analysis to Part II~\cite{part2}. To this end, we choose two simple applications that demonstrate the generality of our framework. The first is volumetric rendering, in which we generate implementations for various different spline lattice combinations, many of which have not had fast GPU implementations. The second application is simply function approximation, however, we do this on the $\mathcal{D}_4$ lattice on the CPU. To our knowledge, there relatively little works that investigate function approximation in this space. We are not aware of any that assess the convergence of such spaces, nor any that provide implementations. We do not ``implement'' Algorithm~\ref{alg:eval} directly; we use it simply as a template for code generation. That is, the input to our pipeline is a list of (polyhedral region, polynomial) pairs, and the output is generated LLVM code~\cite{LLVM}. For our volumetric rendering experiments, we use the LLVM code to generate PTX code, for our other tests we emit x86\_64 assembly. We have constrained ourselves to the CUDA ecosystem as it is the most popular GPGPU platform, however, LLVM contains both a backend for AMD GPUs and a platform agnostic SPIR-V backend that is capable of targing OpenCL + OpenGL devices~\cite{kessenich2018spir}. The details of the code generation stage, and a more detailed breakdown of performance is detailed in part II~\cite{part2}. The processing time for a given interpolant varies based on the spline, higher order splines with large support take much longer, but the process takes typically on the order of hours on an Intel i7 7700 with 16GB of DDR4 RAM at 2333 MHz. However, the processing time of the pipeline is a one time computation, and need not be repeated once an effecient form has been derived. We run our tests on the generated code. \subsection{Volume Rendering} Volume rendering is an illustrative problem as it demonstrates an average case application --- as rays march through the cells in the volume, encountering a new cell will cause a cache miss, however, for points sampled within a cell we get cache hits. Moreover it does not favour any given lattice structure --- a problem that uses slices of a volume along principle lattice directions may favour one case over another. All of our tests were run with the same CPU as above and an NVIDIA GTX 1060 with 6GB ram and no memory or core over-clocks. Compute kernels were set to use a maximum of 128 registers. Table~\ref{tab:interpolants} enumerates the list of interpolants for which we generated code. When generating code, there is a small number of parameters to choose --- we tuned each interpolant separately in order to maximize their performance as detailed in Part II~\cite{part2}. Each test cased was budgeted approximately the same amount of memory to ensure fairness between test results. For our test function, we sampled the Marshner Lobb function~\cite{marschner1994evaluation} at each lattice site, this is the de-facto standard when comparing interpolation kernels --- as one moves further from the center of the volume, the spatial frequency increases, as such reconstruction errors visually depict how frequency content is distorted. Typically, one renders the Marshner Lobb as an iso-surface, however we stick to volumetric rendering to expose the worst case behaviour of the algorithm. The isosurface for a given isovalue may change slightly among grids, thus one grid may terminate earlier than others, our volumetric rendering scheme ensures uniformity of marched rays. Scale was chosen to be equal in each case. Our transfer function was chosen so that the volume was mostly transparent, thus forcing all rays to traverse the entire volume. \setlength{\tabcolsep}{1pt} \renewcommand{\arraystretch}{1.3} \begin{table} \begin{tabular}{lcllccc} Interpolant Name & Lattice & \multicolumn{2}{c}{Direction Matrix} & Order & \# Lookups & Reference \\ \hline\hline \makecell{CC Voronoi Spline 1} & CC & \multicolumn{2}{c}{\scalemath{0.75}{\cctpbsl^{:2}}} & 2 & 8 & \ \\ \makecell{{FCC Voronoi Spline 1}$^\dagger$} & CC & \multicolumn{2}{c}{N\textbackslash{A}} & 2 & 16 & \makecell{\cite{mirzargar2010voronoi}\\ \cite{mirzargar2011quasi}} \\ \makecell{Linear Rhombic$^\dagger$ \\ Dodecahedron} & CC & \multicolumn{2}{c}{\scalemath{0.75}{\bccrodecbs}} & 2 & 16 &\makecell{\cite{entezari2004linear} \\ \cite{retailor}} \\ \makecell{CC Voronoi Spline 2} & CC & \multicolumn{2}{c}{\scalemath{0.75}{\cctpbsl^{:3}}} & 3 & 27 & \ \\ \makecell{BCC Voronoi Spline 1$^\dagger$} & CC & \multicolumn{2}{c}{N\textbackslash{A}} & 2 & 32 & \makecell{\cite{mirzargar2010voronoi}\\ \cite{mirzargar2011quasi}} \\ \makecell{Truncated Rhombic \\ Dodecahedron} & CC & \multicolumn{2}{c}{\scalemath{0.75}{\cczpbs}} & 4 & 53 & \cite{entezari2006extensions} \\ \makecell{FCC Voronoi Spline 2$^\dagger$} & CC & \multicolumn{2}{c}{N\textbackslash{A}} & 3 & 54 & \makecell{\cite{mirzargar2010voronoi} \\ \cite{mirzargar2011quasi}} \\ \makecell{CC Voronoi Spline 3} & CC & \multicolumn{2}{c}{\scalemath{0.75}{\cctpbsl^{:4}}} & 4 & 64 & \ \\ \makecell{Linear Rhombic \\ Dodecahedron} & BCC &\multicolumn{2}{c}{\scalemath{0.75}{\bccrodecbs^{\phantom{:1}}}} & 2 & 4 & \cite{entezari2004linear} \\ \makecell{BCC Voronoi Spline 1$^\dagger$} & BCC & \multicolumn{2}{c}{N\textbackslash{A}} & 2 & 8 & \makecell{\cite{mirzargar2010voronoi}\\ \cite{mirzargar2011quasi}} \\ \makecell{BCC Voronoi Spline 2$^\dagger$} & BCC & \multicolumn{2}{c}{N\textbackslash{A}} & 3 & 27 & \makecell{\cite{mirzargar2010voronoi} \\ \cite{mirzargar2011quasi}} \\ \makecell{Quartic Truncated \\ Rhombic Dodecahedron} & BCC &\multicolumn{2}{c}{\scalemath{0.75}{\bcczpbs}} & 4 & 30 & \cite{kim2013quartic} \\ \makecell{Qunitic Rhombic \\ Dodecahedron} & BCC &\multicolumn{2}{c}{\scalemath{0.75}{\bccrodecbs^{:2}}} & 4 & 32 & \cite{entezari2004linear} \\ \makecell{FCC Voronoi Spline 1$^\dagger$} & FCC & \multicolumn{2}{c}{N\textbackslash{A}} & 2 & 8 & \makecell{\cite{mirzargar2010voronoi} \\ \cite{mirzargar2011quasi}} \\ \makecell{Cubic Truncated \\ Octohedron} & FCC &\multicolumn{2}{c}{\scalemath{0.75}{\fccsix}} & 3 & 16 & \cite{kim2008box} \\ \makecell{FCC Voronoi Spline 2$^\dagger$} & FCC & \multicolumn{2}{c}{N\textbackslash{A}} & 3 & 27 & \makecell{\cite{mirzargar2010voronoi}\\ \cite{mirzargar2011quasi}} \\ \end{tabular} \caption {\label{tab:interpolants} A list of all interpolants and lattices for which we generated code. The notation $:n$ denotes concatenating a matrix with itself $n -1$ times. Splines are named by the shape of their support, and the degree of the polynomial pieces, except for the Voronoi splines. Splines that cannot be generated by a single box spline have N\textbackslash{A} in the Direction Matrix column. Splines marked with a $\dagger$ are ones for which there exists no previous GPU implementation.} \end{table} \subsubsection{Quantitative Results} For every combination of basis function and lattice tested, we obtained reasonable render times, shown in Figure~\ref{fig:results1}. The only case in which performance degraded beyond what we consider reasonable is the BCC Voronoi 2 spline on the BCC lattice --- this is likely due to the complex polynomial structure of the spline combined with the large amount of memory fetches one needs to reconstruct a single value. We do not consider this spline to be real time, however it may be used in progressive rendering approaches to refine a rendered image once user interaction has stopped. A question one might have, based on these results, is how the generated code scales up as the interpolants become more complex. That is, if we require double the memory accesses per reconstruction, it is reasonable to think that a reconstruction would take double the amount of time to complete. Figure~\ref{fig:results2} shows a plot relating the number of points that contribute to a reconstructed point versus the render time, and a least squares fit (with the single outlier point removed). The least squares fit has a slope of approximately 0.6. At first glance this appears quite promising --- one might expect a slope of 1, and 0.6 implies that the cost of doubling the complexity of the spline is less than one might expect. However, the correlation coefficient of these data is approximately 0.45 (with p-value 0.07), thus this correlation is quite weak. Unfortunately, there are too many confounding variables --- remember, we take the best results over all configurations of spline spaces (i.e we mix branch predication, tri-linear lookups, etc.). We will return to this in Part II. \begin{figure} \centering \includegraphics[width=0.8\textwidth]{plots/volrender.pdf} \caption{Reconstruction speed in milliseconds per frame (alternatively FPS) for each test case.} \label{fig:results1} \end{figure} \begin{figure} \centering \includegraphics[width=0.5\textwidth]{plots/runtime.pdf} \caption{Trend of reconstruction speeds. The red line is the least squares fit without the outlier at (27, 700ms) --- this corresponds to the BCC Voronoi 2, which is a very computationally expensive spline on the GPU, it requires the predication of unique sub-regions of evaluation.} \label{fig:results2} \end{figure} \subsubsection{Qualitative Results} While it is not the goal of this work to showcase qualitative visual results, we compare the $V_1$ splines of each lattice on their respective lattice. Figure~\ref{fig:qualitative} shows the qualitative difference for the rendered volumes. These are at similar resolutions, and it is clear that the BCC and FCC outperform the CC lattice. Between the BCC and FCC lattice the comparison is more difficult, there are subtle difference in reconstruction, yet the artifacting seems wholly more isotropic on the BCC lattice. \begin{figure}[ht!] \subfloat[Ground Truth]{ \begin{minipage}[c][1\width]{ 0.38\textwidth} \centering \includegraphics[width=1\textwidth]{images/2d/mlreference.png} \end{minipage}} \subfloat[CC Voronoi 1]{ \begin{minipage}[c][1\width]{ 0.38\textwidth} \centering \includegraphics[width=1\textwidth]{images/cc_x.png} \end{minipage}} \hfill \\ \subfloat[BCC Voronoi 1]{ \begin{minipage}[c][1\width]{ 0.38\textwidth} \centering \includegraphics[width=1.0\textwidth]{images/bcc_x.png} \end{minipage}} \subfloat[FCC Voronoi 1]{ \begin{minipage}[c][1\width]{ 0.38\textwidth} \centering \includegraphics[width=1.05\textwidth]{images/fcc_x.png} \end{minipage}} \caption{Voronoi spline reconstructions on different lattices. Note the much harsher artifacting on the top of the volume for the CC lattice. The FCC and BCC lattices show much smoother reconstructions, with the BCC having slightly less isotropic reconstruction on the top, and the FCC having slightly less isotropic reconstruction on the lower face. These were all rendered with framerates well above 60fps.} \label{fig:qualitative} \end{figure} \subsection{Approximation on the $\mathcal{D}_4$ lattice} To demonstrate that we are not bound to 2 and 3 dimensions, we derive a fast evaluation scheme for the 4-dimensional $\mathcal{D}_4$ lattice. The generating lattice, as well as the direction matrix for our spline are \begin{equation} L_{\mathcal{D}_4}:=\begin{bmatrix} -1 & \phantom{-}0 & \phantom{-}0 & \phantom{-}0 \\ \phantom{-}1 & \phantom{-}0 & -1 & -1 \\ \phantom{-}0 & -1 & \phantom{-}0 & \phantom{-}1 \\ \phantom{-}0 & -1 & \phantom{-}1 & \phantom{-}0 \end{bmatrix} \;\; \text{and} \;\; \Xi_{\mathcal{D}_4}:=\begin{bmatrix} \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & -1 & -1 & -1 & -1 \\ \phantom{-}1 & \phantom{-}1 & -1 & -1 & \phantom{-}1 & \phantom{-}1 & -1 & -1 \\ \phantom{-}1 & -1 & 1 & -1 & \phantom{-}1 & -1 & \phantom{-}1 & -1 \\ \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 & \phantom{-}1 \end{bmatrix} \end{equation} respectively. The geometry of this lattice is similar to that of the FCC lattice; the $\mathcal{D}_4$ lattice consists of 8 Cartesian cosets, shifted to the 3-facets of the 4-dimensional hypercube. The spline we choose is a modification of the one presented by Kim et al., however some direction vectors have been removed to make the space computable in a reasonable amount of time~\cite{kimroot}. The spline $M_{\Xi_{\mathcal{D}_4}}(\mathbf{x})$ is a fourth order spline, but not interpolating, as such it must be pre-filtered to ensure that the error will decay as expected. We used a filter with value $\frac{7}{3}$ at the origin, and $-\frac{1}{18}$ at all $\mathcal{D}_4$ lattice sites at distance $\sqrt{2}$ from the origin. We approximated a Gaussian with mean $\boldmath{0}$ and $\sigma=0.125$. We started with a grid scale $h=0.5$ and successively halved $h$ 10 times, at each iteration we sampled the function on the grid $h\cdot L_{\mathcal{D}_4}$, then measured the $L^2$ error over the domain $[-0.5, 0.5]^4$ via Monte Carlo integration with 10,000 samples. The overall decomposition analysis for the spline took approximately 2 days to compute, and the code generation~\cite{part2} took approximately a day to compute. Again, this is a one time pre-computation; reconstruction, on the other hand, is many orders of magnitude faster, a single point evaluation takes less than a millisecond. \subsubsection{Results} Since the spline $M_{\Xi_{\mathcal{D}_4}}(\mathbf{x})$ is fourth order spline, we expect to see the error decay by a factor of $\frac{1}{16}$ at every iteration. Figure~\ref{fig:d4conv} demonstrates exactly this behaviour. An equivalent tensor-product spline on the 4-dimensional Cartesian lattice would require 256 memory accesses for the same order, whereas this case requires only 240. Perhaps astonishingly, the same spline has the same order on the $\mathcal{D}^\ast_4$ lattice (the dual of the $\mathcal{D}_4$) requiring only 60 memory accesses. The $\mathcal{D}_4$ lattice attains the optimal hyper-sphere packing in 4-dimensions, as such, the $\mathcal{D}^\ast_4$ lattice would be the optimal sampling lattice. However, we stick to the $\mathcal{D}_4$ lattice, as it is more difficult to derive interpolants for; its coset structure contains more shifted lattices than the $\mathcal{D}^\ast_4$ lattice, and is somewhat of a ``stress-test'' for our methodology. \begin{figure}[h!] \centering \includegraphics[width=0.5\textwidth]{plots/convergence.pdf} \caption{Error decay of function approximation as the $\mathcal{D}_4$ lattice becomes finer. The slope of the light grey line indicates the theoretic decay of the approximation space, and the line denotes the actual decay of the approximation error. The function being approximated is a Gaussian. } \label{fig:d4conv} \end{figure} \section{Introduction} Given a set of discrete data points that reside on a lattice, one of the key fundamental operations that one can perform on those data is {\em interpolation}. This appears in many different contexts in science and engineering: one may use interpolation to fill in data between points in time-series data, to fill in missing data between pixels in an image, or missing data between voxels in a volumetric image. In fact, many scientific visualization algorithms require a continuous representation of a signal as an input. As simple as it may seem, interpolation of lattice sampled data can quickly become complicated. To many, interpolation is synonymous with linear interpolation, and if we wish to interpolate in higher dimensions, we can simply linearly interpolate in each dimension separately (i.e. a tensor product extension). However, there is much more freedom available that we may take advantage of when we move past one dimension. For example, there are many alternative interpolants (or \emph{basis functions}) we may choose instead of a simple linear interpolant, many with higher accuracy and/or higher smoothness than a simple linear interpolant. Not only this, but we may have more freedom in terms of where samples are placed when the dimension of the space is $\ge 2$. We say `may' because for some problems, one is forced to use a specific lattice structure - typically the Cartesian lattice, whereas other problems allow lattice choice as a degree of freedom. In this work, we build a framework for interpolation on lattices, and show how to do it {\em fast}. Our work originated in scientific visualization, in particular working with volumetric data, but the observations we make are generally applicable to other domains as well as higher dimensions. We will mainly keep to the 3-dimensional case, but we will note how to generalize to higher dimensions when it is necessary. Returning to the context of scientific visualization, interpolation speed is important in practice because it facilitates interactivity which, in turn, allows for fast iteration over data-sets --- the ability to quickly (visually) explore data is one of the key strengths of visualization. But more often than not, in practice, interpolation boils down to ``use trilinear interpolation'', and it is clear why: trilinear interpolation is fast, it is implemented in hardware for all modern graphics processing units; it is straightforward to use, it inlvolves a single texture fetch instruction for modern GPUs; and it looks ``good enough'' in practice. However, linear interpolation has a number of shortcomings. Perhaps the most obvious is smoothness. Trilinear interpolation is based on a piece-wise linear univariate function extended via tensor product along all three dimensions; this ensures a continuous approximation but introduces discontinuities in the first and higher order derivatives. While this could be mitigated by using filtering methods, there is additional memory overhead associated with such methods~\cite{alim2010gradient}. Linear interpolation also introduces visual artifacts when interpolating at lower resolutions. This is again related to the smoothness of the trilinear interpolant, but also has deeper roots in sampling and approximation theory. In short, the geometry and support of the chosen interpolant dictate how a reconstruction attenuates high-frequency content in the Fourier domain. This gives rise to different types of artifacts in data reconstruction~\cite{retailor}. Thus, there is value in exploring the design space of interpolants with the goal of minimizing error; in practice, one also needs to account for the computational costs associated with different interpolants. Before moving further, we need to clarify what we mean by {\em non-Cartesian computing}. We use the term ``non-Cartesian computing'' to indicate a move away from tensor-product extensions. This can take the form of non-Cartesian lattices --- take Figures~\ref{fig:lattice_ind} and~\ref{fig:2d_lattices} as examples that show the typical cubic Cartesian (CC) and square lattices in three and two dimensions, as well as more efficient non-Cartesian variants, namely the Body Centered Cubic (BCC) lattice, and the Face Centered Cubic (FCC) lattice, both of which have received a good amount of attention in the field of scientific visualization. We may also use the term ``non-Cartesian computing'' to denote the move away from tensor-product interpolants to non-separable interpolants. In the Cartesian world, one typically uses tensor product B-splines as basis functions; however, non tensor-product splines exist, and have been investigated in the literature~\cite{retailor}. One example is the ZP-element which requires fewer memory accesses per reconstruction than the cubic tensor-product B-spline but has similar approximation properties and provides smoother, more isotropic reconstructions~\cite{entezari2006extensions}. When comparing different sampling lattices, one may argue that a true comparison for these lattices would be their Voronoi splines~\cite{mirzargar2010voronoi}, which, until this work, have yet to have a dedicated GPU implementation. \begin{figure*}[ht!] \centering \includegraphics[scale=0.135]{images/CC_2019_ind.png} \includegraphics[scale=0.135]{images/BCC_2019_ind.png} \includegraphics[scale=0.135]{images/FCC_2019_ind.png} \\ \caption{Three trivariate integer lattices. In order from left to right we have the Cartesian (CC), Body Centered Cubic (BCC) and Face Centered Cubic. The different colored lattice sites correspond to the Cartesian cosets within each sampling lattice. The polytope in the center of each grid corresponds to grid's respective Voronoi cell.} \label{fig:lattice_ind} \end{figure*} What do we gain by adding additional complexity to our interpolation and data processing schemes? The seemingly benign difference in lattice and basis function changes the properties of the resulting approximation scheme. In fact, in 2D, an optimal hexagonal sampling scheme (Fig.~\ref{fig:2d_lattices}) yields $14\%$ better approximations when combined with an appropriate interpolant, whereas on the BCC lattice (Fig.~\ref{fig:lattice_ind})--- the optimal sampling lattice in 3D --- the improvement is around $30\%$~\cite{entezari2006towards}. Despite these advantages, the benefits of non-Cartesian computing have remained elusive. This is largely due to the complex algebro-geometric interplay between the lattices and the basis function they are paired with. These basis functions are typically composed of box splines which have intricate piece-wise polynomial structures which are challenging to evaluate in an efficient manner. Most treatments have dealt with evaluation and implementation issues in a somewhat adhoc manner. Our goal in this work is to make the advantage of non-Cartesian computing more tangible --- explicitly, we want to make the use of alternative interpolants/lattices more practical and usable. Our main contribution is a holistic analysis of approximation spaces with a careful focus on fast implementation. We outline a framework for translating interpolation bases into fast interpolation schemes for piece-wise polynomial interpolants. We then show how to use this pipeline to create unified \emph{fast} implementations of many of the interpolants in the non-Cartesian volumetric visualization literature. It is important to mention that we obtain a form of evaluation that is agnostic to platform. We could generate CPU code, GPU code, or Verilog from our intermediate representation. Our GPU implementation takes advantage of the in-built tensor product linear filtering hardware (i.e. linear texture fetches) on contemporary GPUs to reduce the amount of memory accesses needed for reconstruction, however this does not always lead to optimal results. We provide the theoretical analysis in this paper, and in the subsequent work we provide extensive implementation details. In our supplementary material we share the worksheet we use to automate the analysis as well as the code generation module, and pre-generated CUDA PTX code. To summarise, in this part, our contributions are as follows: \begin{itemize} \item We provide a unified framework of analyses for combinations of splines and lattices from the context of scientific visualization. \item We show how to use trilinear interpolation to reduce memory fetches and increase performance of our implementations. \item We provide implementations for many interpolants in the literature that have not yet had robust GPU implementations. \item We show the relative performance between GPU implementations, and show generality by moving towards a 4 dimensional example. \end{itemize} The remainder of this paper is organized as follows. In Section~\ref{sec:related_work}, we review the literature in our native context, scientific visualisation, but we will also pay note to some of the work done in one dimension and in image processing. In Section~\ref{sec:background}, we provide the background necessary for our framework. In Section~\ref{sec:method}, we attack the problem at its root, the convolution sum. We manipulate the convolution sum until it emits a form suitable for fast evaluation --- this can be thought of as unrolling the convolution sum loop. In Section~\ref{sec:results} we generate code for various interpolants (box splines and Voronoi splines) some of which have not yet appeared in the literature. We then evaluate their performance on the CPU and GPU with respect to the application of volume rendering. \section{Methodology} \label{sec:method} The convolution sum in Equation~\ref{eq:conv_sum} is the focus of this section. There are two important parts to evaluating a function of this form; the first is the representation of the coefficient set $c_{\mathbf{n}}$ (i.e. the memory layout), the second is the evaluation of the basis function $\varphi$. Concerning $c_{\mathbf{n}}$, we choose a specific representation in which each $c_{\mathbf{n}}$ corresponds to a fetch from an $s$-dimensional array. Thus, for any lattice, we choose to treat it as a union of shifted Cartesian lattices (also known as a Cartesian coset decomposition). This allows us to use texture memory on GPUs to store each coset, as shown in Figure~\ref{fig:texture_format}. Provided we combine all reads from a given coset, this also allows us to take advantage of data locality (i.e. cache). It also allows us to use trilinear fetches as building blocks for our interpolation schemes --- that is, we attempt to write our interpolation schemes as weighted sums of trilinear texture fetches on the different cosets of the lattice. This does not necessarily reduce computation per evaluation, but rather reduces the number of texture fetches needed to evaluate the convolution sum, and therefore reduces bandwidth. \begin{figure}[t!] \centering \includegraphics[]{images/2d/texture_packing.pdf} \caption{Lattices are broken into their Cartesian coset structure, then stored in separate $s$-dimensional arrays. On the GPU, this translates to a collection of textures. For volumetric data, we decompose the lattice into separate volumetric textures. } \label{fig:texture_format} \end{figure} With the memory layout solidified, we turn to the basis function --- we apply a series of manipulations to ``unroll'' the convolution sum. We build some insight into how to transform $\varphi$ into a more convenient form for evaluation with some running examples. We consider the linear tensor product spline and the Zwart-Powell (ZP) element on the two-dimensional Cartesian lattice. These have direction matrices $$ \Xi_{\text{TP2}} = \begin{bmatrix} 1 &0 &-1& 0\\ 0 & 1 & 0 & -1 \end{bmatrix}, \Xi_{\text{ZP}} = \begin{bmatrix} 1 &0 & 1& 1\\ 1 & 1 & 1 & -1 \end{bmatrix} $$ respectively. On the quincunx lattice, we use a tensor product style spline defined by $$ \Xi_{\text{QC}} = \begin{bmatrix} 2 &0 &-2& 0\\ 0 & 2 & 0 & -2 \end{bmatrix}. $$ These box splines are shown in Figure~\ref{fig:2dsplines}. While this is nowhere near an exhaustive list of interpolants, the examples we provide are simple enough to understand in 2D and show the intricacies of the procedure. \begin{figure}[t!] \includegraphics[width=0.25\textwidth]{./images/tplincc.png} \ \includegraphics[width=0.25\textwidth]{./images/zpelcc.png} \ \includegraphics[width=0.25\textwidth]{./images/tplinqc.png} \caption{Splines used as running examples; from left to right are box splines generated by $\Xi_{TP2}, \Xi_{ZP}$ and $\Xi_{QC}$ respectively. } \label{fig:2dsplines} \end{figure} \subsection{Manipulating the Convolution Sum} We start by reiterating the convolution sum in Equation~(\ref{eq:conv_sum}): \begin{equation} f(\mathbf{x}) := \sum_{\mathbf{n} \in L\mathbb{Z}^s} c_{\mathbf{n}}\varphi(\mathbf{x}-\mathbf{n}). \end{equation} At a high level, our methodology consists of incrementally applying a series of simple algebraic manipulations to this sum so that it can be more effectively mapped to an implementation; be it CPU or GPU. Along the way, we pause and discuss the effects of certain choices and properties of $\varphi$ on an evaluation scheme. The first manipulation we apply is one that has been used to derive fast interpolants on the BCC and FCC lattices~\cite{csebfalvi2013cosine,domonkos2010dc}. In particular, these interpolation schemes take advantage of the fact that an integer lattice can be decomposed into a sum of sub-lattices. We build upon this observation by noting that we may decompose the convolution sum up over \emph{any} coset structure of the lattice. This decomposition is independent of our data representation. For example, one may take a cubic Cartesian lattice and decompose it as two shifted BCC lattices. Within our framework, on the GPU each of these two BCC lattices will in turn have two 3D textures associated with it. Formally, if $G$ is an integer subsampling matrix that yields a sub-lattice of $L$, then there exist $M := |\det G|$ integer vectors $\mathbf{l}_0, \mathbf{l}_1, \cdots, \mathbf{l}_{M-1}$ such that $L\mathbb{Z}^s = \cup_{k=0}^{M-1} GL\mathbb{Z}^s+\mathbf{l}_k$. Note that the lattice sites $GL\mathbb{Z}^s + \mathbf{l}_k$ constitute the coset corresponding to the shift vector $\mathbf{l}_k$. Without loss of generality, we take $\mathbf{l}_0$ to be zero vector of $\mathbb{Z}^s$. We can now write the convolution sum as \begin{equation} \sum_{\mathbf{n} \in L\mathbb{Z}^s} c_{\mathbf{n}} \varphi(\mathbf{x}-\mathbf{n}) = \sum_{k=0}^{M-1}\sum_{\mathbf{m} \in GL\mathbb{Z}^s+\mathbf{l}_k} c_{\mathbf{m}}\varphi(\mathbf{x}-\mathbf{m}), \end{equation} which decomposes the sum over the coset structure of the lattice induced by $G$. Figure~\ref{fig:2d_lattices} shows the Cartesian coset structure of the quincunx lattice. In three dimensions, the BCC lattice emits similar behaviour to this; it consists of two interleaved Cartesian grids where one of the Cartesian grids is shifted by the vector $(1,1,1)$. The FCC lattice is similarly decomposed into Cartesian cosets, as shown in Figure~\ref{fig:lattice_ind}. The matrix $G$ is a parameter choice that must be made depending on what is most appropriate for the device on which we are implementing an interpolation scheme. Currently, for evaluation on the GPU, a reasonable choice is a $G$ such that $GL=D$ where $D$ is a diagonal matrix. In other words, $G$ yields a Cartesian coset structure, and we may store the lattice as a collection of Cartesian lattices, specifically 3D textures (see Figure~\ref{fig:texture_format}). However, it is not always strictly advantageous to do so; if $\varphi$ does not have partition of unity on the sub-lattice generated by $GL$, then this complicates the geometric decomposition of the spline. We will revisit this when we discuss the {\em sub-regions of evaluation} of a spline. While an integer invertible $G$ will still produce a valid evaluation scheme, in practice $G$ must be chosen so that it both produces a simple sub-lattice $GL$ and respects the geometry of $\varphi$. Next, we note that in all practical instances we have a compact basis function $\varphi$ --- either we choose $\varphi$ to be compact, or the finite nature of our data imply a bound on the support of $\varphi$. Thus we change our perspective and rewrite the convolution sum over the support of $\varphi$ shifted to the evaluation point $\mathbf{x}$. From this perspective, any lattice site that falls within the support of this function will contribute to the reconstruction. To simplify notation, we define the set \begin{equation} C_k(\mathbf{x}) := \text{supp} \ \varphi(\cdot -\mathbf{x}) \cap (GL\mathbb{Z}^s + \mathbf{l}_k). \end{equation} As such, $C_k(\mathbf{x})$ is the set of lattice sites on coset $k$ that contribute to the reconstruction at point $\mathbf{x}$. Therefore, we may write \begin{equation} \label{eq:coset_form} \sum_{{\mathbf{n}} \in L\mathbb{Z}^s} c_{\mathbf{n}}\varphi({\mathbf{x}}-{\mathbf{n}}) = \sum_{k=0}^{M-1}\sum_{{\mathbf{m}} \in C_k({\mathbf{x}})} c_{\mathbf{m}}\varphi({\mathbf{x}}-{\mathbf{m}}). \end{equation} So far, we have not strictly required $\varphi$ to be compact, but now we impose the following constraints on $\varphi$: it has partition of unity on $L$, and it is piece-wise polynomial with compact polyhedral support. Partition of unity --- the ability for a reconstruction space to reproduce a constant function --- is a basic requirement for a valid approximation scheme, along with polynomial decay in the Fourier domain~\cite{strang2011fourier}. Compactness is generally not restrictive, almost all $\varphi$ used in practice are compact. The polynomial restriction is slightly restrictive, as it does not allow us to consider the class of exponential box splines~\cite{ron1988exponential}, the CINAPACT splines~\cite{cinapact}, or the cosine weighted spline~\cite{csebfalvi2013cosine} (which is an exponential box spline). From Equation~(\ref{eq:coset_form}), it is clear how the support of $\varphi$ affects the inner summation of this equation --- if there are more lattice sites within the support of $\varphi$, then the inner summation will run over more terms. The effect this has on performance depends on the underlying architecture of the machine and the complexity of $\varphi$. If we can commit memory reads for the $c_{\mathbf{m}}$ while beginning to compute parts of $\varphi$ that do not depend on the coefficients of the summation, we can effectively hide the computation of $\varphi$ in the latency of the memory fetches. Latency hiding of this form is common in GPU compute applications. Moreover, the out-of-order execution units on modern CPUs allow for this behaviour without explicitly coding for it. However, if memory accesses are not an issue (i.e. if we are reading from fast memory, such as cache), then the cost of reconstruction will be dominated by the complexity of $\varphi$, and it would be advantageous to choose $\varphi$ with larger support but lower evaluation time complexity. We now shift our focus to the geometry of $\varphi$. Without loss of generality, we limit our discussion to $C_0(\mathbf{x})$ since all other cases are shifted versions of this base case. Let us choose some $\mathbf{x}$ such that there exists some $\epsilon$-neighborhood around $\mathbf{x}$ for which $C_0(\mathbf{x})$ remains constant. Then there is some larger region $S$ containing $\mathbf{x}$ for which $C_0(\mathbf{x})$ does not change. That is, if we pick any $\mathbf{x,y}\in S$ then $C_0(\mathbf{x}) = C_0(\mathbf{y})$. The closure of these regions tessellate space; Figure~\ref{fig:regions_cc} shows examples of this. For box splines, these correspond to the regions within the finer mesh $\Gamma(\Xi, GL)$ of a the box spline on the lattice $GL$~\cite{deboorbox}. In this work, we refer to these as the {\em sub-regions} of the spline. Note the periodic nature of the sub-regions. They naturally fit into equivalence classes under the following definition: we say that two mesh regions $P$ and $Q$ belong to the same equivalence class if for any $\mathbf{x}\in P$, there exists some lattice shift $\mathbf{k} \in GL\mathbb{Z}^s$ such that $\mathbf{x} + \mathbf{k} \in Q$. Note that there are only finitely many equivalence classes, say $N$ of them, and we denote them as $S_0, S_1, \cdots, S_{N-1}$. We will call the choice of representative mesh regions {\em sub-regions of evaluation}. We define a {\em region of evaluation} as a convex polyhedral collection of sub-regions with hyper-volume $|\det{GL}|$. Note that, since we have hyper-volume $|\det{GL}|$, a region of evaluation will tessellate space with one convex polyhedron about the lattice $GL$. Additionally, while the sub-region equivalence classes are determined by the (decomposed) lattice and $\varphi$, there are multiple possible regions of evaluation for a given $GL$ (see Figure~\ref{fig:regions_cc} and Figure~\ref{fig:regions_qc}). We choose all our regions of evaluation so that they contain or touch the origin, we call the choice of such a region $R$. \begin{figure}[t!] \centering \includegraphics[]{images/2d/mesh_regions.pdf} \caption{Sub-regions and regions of evaluation on the Cartesian lattice for the tensor product box splines defined by $\Xi_{\text{TP}n}$ and the ZP element defined by $\Xi_{\text{ZP}}$. The equivalence classes for the sub-regions of evaluation are denoted by the hue of the region. The sub-regions are collected near the origin to create the region of evaluation.} \label{fig:regions_cc} \end{figure} \begin{figure}[t!] \centering \includegraphics[]{images/2d/mesh_regions_qc.pdf} \caption{Sub-regions and regions of evaluation on the quincunx lattice for the tensor product box spline with no coset matrix, and coset matrix $G=L_{QC}^T$. At the origin are the representative sub-regions of evaluation. Again, the equivalence classes for the sub-regions of evaluation are denoted by the hue of the region. In this figure, note the region of evaluation for the example on the left, shifting a point of evaluation to this region requires more logic than the case in which we use an appropriate coset decomposition, as seen on the right.} \label{fig:regions_qc} \end{figure} The reason we focus on a single region of evaluation $R$ is that it allows us to exploit the shift invariant nature of the approximation space. That is, say we derive a fast evaluation function $\zeta(\mathbf{x})$ with $\zeta(\mathbf{x})=\sum_{k=0}^{M-1}\sum_{{\mathbf{m}} \in C_k({\mathbf{x}})} c_{\mathbf{m}}\varphi({\mathbf{x}}-{\mathbf{m}})$ for $\mathbf{x}\in R$ (but perhaps not outside $R$). The function $\zeta $ necessarily depends on some subset of coefficients $\{c_{\mathbf{i}} : \mathbf{i} \in A\}$ for some fixed $A \subset \mathbb{Z}^s$. Since the region of evaluation tessellates space, for any $\mathbf{x} \in \mathbb{R}^s$ there exists some $\mathbf{k} \in GL\mathbb{Z}^s$ such that $\mathbf{x} - \mathbf{k} \in R$. Thus, we can derive a fast evaluation scheme for all points by shifting the evaluation to $\zeta(\mathbf{x}-\mathbf{k})$ and shifting the coefficients $\{c_{\mathbf{i}+\mathbf{k}} :\mathbf{i} \in A\}$ --- this is a consequence of the ``shift invariance'' property of shift invariant spaces. We define the function \begin{equation} \rho : \mathbb{R}^s \rightarrow GL\mathbb{Z}^s \text{ such that } \mathbf{x}\in \mathbb{R}^s \implies \mathbf{x}-\rho{(\mathbf{x})} \in R \end{equation} to formalize this notion, and assert that this must exist if $R$ tessellates space and has hypervolume equal to $|\det GL |$. Thanks to this shift invariance, we may focus solely on the region of evaluation. To each representative sub-region of evaluation, we associate a function $ \psi_{j}(\mathbf{y}, \mathbf{k})$ that is defined as follows: \begin{equation} \psi_{j}(\mathbf{y}, \mathbf{k}) := \sum_{\mathbf{n} \in C_0(S_j)} c_{\mathbf{n}+\mathbf{k}}\varphi(\mathbf{y}-\mathbf{n}) \quad \text{for } \quad \mathbf{y} \in S_j. \end{equation} For our piece-wise polynomial splines, we may explicitly construct the polynomial representation of $\psi_{j}(\mathbf{y}, \mathbf{k})$. We use a greedy Horner scheme to optimize the evaluation of $\psi_{j}(\mathbf{y}, \mathbf{k})$, computation on the GPU is relatively cheap, at least compared to bandwidth access. We combine all these sub-region functions to a single ``approximation'' function, $\Psi(\mathbf{x}, \mathbf{l})$, with the definition \begin{equation} \label{eq:breakdown} \Psi(\mathbf{x}, \mathbf{l}) := \begin{cases} \psi_0(\mathbf{x}-\rho(\mathbf{x}),\rho(\mathbf{x}) +\mathbf{l}) & \text{if } \mathbf{x} - \rho(\mathbf{x}) \in S_0 \\ \psi_1(\mathbf{x}-\rho(\mathbf{x}),\rho(\mathbf{x}) +\mathbf{l}) & \text{if } \mathbf{x} - \rho(\mathbf{x}) \in S_1 \\ \ & \vdots \\ \psi_{N-1}(\mathbf{x}-\rho(\mathbf{x}),\rho(\mathbf{x}) +\mathbf{l}) & \text{if } \mathbf{x} - \rho(\mathbf{x}) \in S_{N-1}. \\ \end{cases} \end{equation} We can finally write the convolution sum per coset as \begin{equation} \sum_{\mathbf{n} \in C_k(\mathbf{x})} c_{\mathbf{n}}\varphi(\mathbf{x} - \mathbf{n}) = \Psi(\mathbf{x}-\mathbf{l}_k, \mathbf{l}_k). \end{equation} To obtain the final approximation, one only needs to sum this over all cosets. While this is an optimized form, it still contains multiple branches --- we have different cases for each sub-region. Modern CPUs have been heavily optimized to efficiently execute branch heavy code, whereas GPUs have not. The conditional behaviour of $\Psi(\mathbf{x}, \mathbf{l})$ is a major problem for GPU implementations. However, it is possible to use the symmetry of $\varphi$ to eliminate branches. A similar idea has been used to derive fast interpolation schemes on non-Cartesian lattices~\cite{kimeval}. The approach taken in other works has been to encode each different polynomial in BB form, use the sub-regions to determine which coefficient sequence to use in deCasteljau's algorithm~\cite{kimeval}. In this work, we use a slightly more efficient idea --- we use the symmetry of the basis function to encode a change of variable relationship between subregions. This allows us to rely on a small set of polynomials, rather than having one for each sub-region. We first discuss how to determine which sub-region a point lies within without any branches. We then discuss how to eliminate branches in Equation~\ref{eq:breakdown}. \subsection{Branch Free Sub-region Membership} Suppose we have some $\mathbf{x} \in R$, since $R$ is a convex polyhedron, and is the closed union of finitely many convex polyhedra, we know there is a finite set of planes that divide the region of evaluation into the sub-regions of evaluation. We will say we have $Q$ of these planes, and we will call the set of planes $P=\{(\mathbf{p}_0,d_0), (\mathbf{p}_1, d_1), \cdots, (\mathbf{p}_{Q-1},d_{Q-1})\}$. Here $\mathbf{p}_i$ is the normalized orientation of the plane, and $d_i$ is the distance from the origin; explicitly, these planes are the planes that ``cut'' the region of evaluation into sub-regions. Thus, if we have some point $\mathbf{x} \in R$, we can construct an integer $q$ in the range $\left[0, 2^Q\right)$ by assigning its $i^\text{th}$ bit a value of $1$ if $\mathbf{x}$ is on the left side of the plane $p_i$, and $0$ otherwise. This allows us to associate an integer with every single sub-region of evaluation. However, this does not map to the entire range $\left[0, 2^Q\right)$, that is, it is possible that there are more integers in the range $\left[0, 2^Q\right)$ than there are sub-regions. Further, if $Q$ is large, then $q$ may be vastly bigger than $N$. Therefore, we first compress the range $[0,2^Q)$ down to some range $[0,r)$ --- that is, we first construct $q$ as above, then take its remainder upon division with $r$ (i.e. $q\mod r$) where $r$ is chosen so that each subregion maps to a unique integer in $[0,r)$. To find such an $r$, we simply perform a bruteforce search. We then create another (surjective) map $\sigma: \{0, 1, \cdots, r-1\} \rightarrow \{0, 1, \cdots, N-1\} $ that takes $q \mod r$ to a sub-region's index. This is realized by an array of $r$ entries. On a GPU, we store this in fast constant or shared memory. On a CPU, this will hopefully be cached very quickly. Thus, to determine this index we only need $Q$ plane comparisons, one remainder operation and one fast memory lookup (the conditional behaviour of the plane comparison is done on an instruction predicate level, and does not cause any branching). For most of the cases we consider, the number of planes $Q$ turns out to be quite small. The largest $Q$ for box splines in 3D we observe is $9$, which corresponds to the quartic BCC spline ~\cite{kim2013quartic}, and seems to have little effect on reconstruction speed. We did however, notice that for all orders of the Voronoi BCC spline, $Q$ is prohibitively large, $Q>32$. While this does not pose a problem to the theory of this method, if we did not impose the compression of the range $[0,2^Q)$ to $[0,r)$ the mapping to sub-regions would consume over $4GB$ of memory. We can additionally apply this procedure recursively. That is, we determine which octant a reconstruction lies within, then transform it to the positive octant; this approach only works provided the spline has the reflective symmetry necessary, which the BCC Voronoi spline does indeed have, and allows us to reduce our lookup tables further. Note that this does introduce some overhead, as one needs to incorporate another transform in the generated code. \subsection{Branch Free Evaluation via Symmetry Analysis} \begin{figure}[t!] \centering \includegraphics[]{images/2d/region_symmetry.pdf} \caption{Two different reconstructions within the region of evaluation. Each reconstruction point is denoted by an ``x''. Each reconstructed point lies within a different sub-region of evaluation $S_0$ and $S_1$. The lattice sites that contribute to that reconstruction are coloured with the region's respective color.} \label{fig:sub_region_symmetry} \end{figure} To build the intuition for this optimization, we begin with an example. Say we have two regions $S_0$ and $S_1$ that ``appear'' similar, Figure~\ref{fig:sub_region_symmetry} shows an example for two sub-regions. Intuitively we can see that $S_1$ is simply a rotation (or a reflection) of $S_0$. One could easily model this with a rotation matrix $T$ and, to be more general, a translation vector $\mathbf{t}$. That is, we would want $ \psi_1(\mathbf{x}, \mathbf{k}) = \psi_0(T\mathbf{x}-\mathbf{t}, \mathbf{k})$. If this were true, we could store $T$ and $\mathbf{t}$ in a lookup table and implement the piece-wise structure in Equation~\ref{eq:breakdown} as a lookup instead of branch by first looking up $T$ and $\mathbf{t}$, applying them to $\mathbf{x}$, then evaluating a single $\psi$. The situation, however, is slightly more complicated, as we have failed to match the coefficients between $\psi_0$ and $\psi_1$. To make this consistent, we need some ``renaming'' map $\pi$ that renames the $c_\mathbf{n}$ to be consistent with the transformation $T$ and shift $\mathbf{t}$. That is, we desire $T,\mathbf{t},$ and $\pi$ such that \begin{eqnarray*} \psi_0^\pi(T\mathbf{x}-t, \mathbf{k}) & := & \sum_{\mathbf{n} \in C_0(S_0)} c_{\pi(\mathbf{n})+\mathbf{k}}\varphi(T\mathbf{x}-\mathbf{n}- t) \\ & = & \sum_{\mathbf{n} \in C_0(S_1)} c_{\mathbf{n}+\mathbf{k}}\varphi(\mathbf{x}-\mathbf{n}) \\ & = & \psi_1(\mathbf{x}, \mathbf{k}). \end{eqnarray*} If we find such $T, \mathbf{t}$ and $\pi$ then we know for any $\mathbf{x} \in S_1$ then we have $T^{-1}(\mathbf{x}+\mathbf{t}) \in S_0$, and by renaming the memory look-ups, we can use $\psi_0^{\pi^{-1}}(T^{-1}(\mathbf{x}+\mathbf{t}), \mathbf{k})$ to evaluate the sub-region's function. Here, $\pi$ must be an invertible map, and $T$ must be an invertible rigid body transformation. To find such parameters, we first choose a region $S_0$ as our reference sub-region and search for $T, \mathbf{t}$ and $\pi$ for every other sub-region $S_i$. The shift $\mathbf{t}$ is chosen to be the zero vector, or the center of mass for the sub-region; $T$ is chosen from the symmetry group of the spline. We implement this as a combinatorial brute force search. That is, we enumerate all possible pairs of $\mathbf{t}$ and $T$ and check whether this combination yields a valid transformation. Here, ``valid'' means that there exists a $\pi$ such that the above simplification holds. For splines with polynomial sub-regions, we can associate a polynomial with each coefficient lookup $c_\mathbf{m}$ in $\psi_1$, then we apply the transformation to $\psi_2$ and determine the polynomial associated with each $c_\mathbf{m}$ of the transformed sub-region evaluation function. This forms a bipartite graph where the untransformed coefficients are colored in, say blue, and the transformed coefficients are coloured in red; we assign an edge between two points in those sets if their associated polynomial is identical. If there exists a perfect matching between two sets, then we say it is ``valid''. Moreover, the same perfect matching yields the function $\pi$. Perhaps unsurprisingly, $\pi$ is a rigid body transformation in all the cases we consider in this work --- that is, $\pi(\mathbf{n}) = T\mathbf{n} + \mathbf{t}$. In general, there may be instances where it is not possible to find $T, \mathbf{t}$ and $\pi$ for two sub-regions $S_i, S_j, i\ne j$. This is the case for the 6 direction box spline on the FCC lattice --- there are sub-regions with vastly different geometry~\cite{kim2013gpu} . In general, we may have $K$ such unique regions that are not re-writeable in terms of one another, and we collect them in the set $\{\psi_0^\pi, \psi_1^\pi, \cdots, \psi_{K-1}^\pi\}$. To handle these cases, we use branch predication --- we calculate the polynomial within all sub-regions and use a predicate operator to choose the correct region's result at the end of the calculation. This performs unnecessary computation, but avoids the heavy overhead of branching on the GPU~\cite{kim2013efficient}. Algorithm~\ref{alg:eval} summarizes how to use the techniques we have discussed to perform point-wise evaluation. \begin{algorithm} \caption{Branch free evaluation at a point.} \label{alg:eval} \begin{algorithmic}[1] \Procedure{Eval}{$\mathbf{x}$} \State $f \gets 0$ \For{$\mathbf{l} \in \{\mathbf{l}_0,\mathbf{l}_1,\cdots \mathbf{l}_{M-1}\} $} \State $\mathbf{k} \gets \rho(\mathbf{x}-\mathbf{l})$ \Comment{Determine the shift to ROE} \State $\mathbf{x}^\prime \gets \mathbf{x} - \mathbf{k}-\mathbf{l}$ \Comment{Shift ROE} \State $q \gets 0$ \For{$i \in \{0,1,\cdots Q-1\} $} \Comment{Determine BSP index} \State $q \gets (\mathbf{x}^\prime\cdot\mathbf{p}_i - d_i < 0) \ ? \ q : q \mathbin{|} 2^i$ \EndFor \State $SubRegionIndex \gets \sigma(q \% r)$\Comment{Determine the shift to ROE} \State $T^\prime \gets T[SubRegionIndex]$ \State $\mathbf{t}^\prime \gets -T^\prime\mathbf{t}[SubRegionIndex]$ \State $\pi^\prime \gets \pi[SubRegionIndex]$ \State $g \gets 0$ \For{$i \in \{0,1,\cdots, K-1\} $} \State $v \gets {\psi_i^{\pi^\prime}}(T^\prime\mathbf{x}^\prime - \mathbf{t}, \mathbf{k}+\mathbf{l}) $ \State $g \gets PsiIndex[SubRegionIndex] == i \ ? \ v \ : \ 0$ \EndFor \State $f \gets f + g$\Comment{Add the contribution for this coset} \EndFor \State \textbf{return} $f$ \EndProcedure \end{algorithmic} \end{algorithm} \subsection{Reducing Bandwidth Requirements} \begin{figure}[t!] \centering \includegraphics[]{images/2d/lerp_example.pdf} \caption{Replacing two texture fetches $\mathbf{a}$ and $\mathbf{b}$ on the quincunx lattice with a single linear texture fetch. There is a small amount of arithmetic involved in translating $\mathbf{a}$ to $\mathbf{a}^\prime$ but it is neglible. Additionally, textels are often shifted slightly to make the hardware design easier --- they are often shifted by 0.5 in the cardinal directions.} \label{fig:linear_trick} \end{figure} While the above form is appropriate for execution on the GPU, each call to $\psi_i^\pi$ incurs a heavy amount of memory accesses for larger splines. All contemporary GPUs include hardware accelerated linear texture fetches. A naive implementation of the previous sections would use nearest neighbor interpolation to facilitate the coeffecient fetches, however, trilinear texture fetches are only a small constant factor slower (approximately $1.4\times$ on our hardware) and combine up to 8 texture fetches in one instruction. In general, it is not always possible to use trilinear interpolation to reduce 8 texture fetches into 1 --- this is only possible when the basis is separable. However, it is possible to rewrite two memory fetches (that reside on adjacent points of a given Cartesian coset) as a single tri-linear fetch. This offloads some of the reconstruction bandwidth pressure, but may require more computation. Fortunately, on GPUs, computation is relatively cheap compared to bandwidth. To demonstrate this, let us fix a single $\psi_i^\pi$, and suppose that we have two two lattice sites $\mathbf{a}$ and $\mathbf{b}$ that are adjacent on the same Cartesian coset. Then we attempt to find two functions $t(\mathbf{x})$, and $g(\mathbf{x})$ such that \begin{equation}\label{eq:ltrix} g(\mathbf{x})\cdot((1-t(\mathbf{x}))c_{\mathbf{a}} + t(\mathbf{x})c_{\mathbf{b}}) = c_{\mathbf{a}} \varphi(\mathbf{x}-\mathbf{a}) + c_{\mathbf{b}}\varphi(\mathbf{x}-\mathbf{b}). \end{equation} The term $((1-t(\mathbf{x}))c_{\mathbf{a}} + t(\mathbf{x})c_{\mathbf{b}})$ is exactly linear interpolation; this can be easily translated into single texture fetch instruction (and some additional computation for $t(\mathbf{x})$ and $g(\mathbf{x})).$ Explicitly, the solutions $g(\mathbf{x})$ and $t(\mathbf{x})$ are given by $$ g(\mathbf{x}) = \varphi(\mathbf{x}- \mathbf{a}) +\varphi(\mathbf{x}- \mathbf{b}) \ \text{ and } \ t(\mathbf{x}) = \frac{\varphi(\mathbf{x}- \mathbf{b}) }{g(\mathbf{x})} $$ which is easily verified. Note that we require $|g(\mathbf{x})| > 0$ for this to be valid --- to see why this is true in our case, we fix $\mathbf{x}$ within a given sub-region. Since we wish to use Equation~\eqref{eq:ltrix} to replace two fetches in the convolution sum~\eqref{eq:conv_sum}, we know that the basis shifts associated with two coefficients in that sum must contribute to the final sum over the entire sub-region --- they cannot be identically zero. The only other troublesome case is if $\varphi(\mathbf{x}-\mathbf{a}) = -\varphi(\mathbf{x}-\mathbf{b})$ for some $\mathbf{x}$ in the sub-region under investigation. For all the cases we consider, our basis functions are strictly positive, so we need not worry about this --- however, for some interpolating bases, this may present a problem. If we are working with volumetric data, with $\mathbf{a}^\prime$ and $\mathbf{b}^\prime$ defined as the texture coordinates of the lattice sites $\mathbf{a}$ and $\mathbf{b}$ in GPU memory, then we can write Equation~\ref{eq:ltrix} as $$ g(\mathbf{x})\cdot TEX3D(\text{tex\_coset}, \mathbf{a}^\prime + t(\mathbf{x})(\mathbf{b}^\prime - \mathbf{a}^\prime )) $$ where $TEX3D$ is the linear texture fetch built into most GPUs. This is demonstrated in Figure~\ref{fig:linear_trick}. It also possible to perform a similar optimization with groups of 4 points that are arranged as a square (on a Cartesian coset) and groups of 8 arranged as a cube (again, on a Cartesian coset). Algebraically, these cases are much more involved, but the basic principle of solving for two functions $t(\mathbf{x})$ and $g(\mathbf{x})$ remains the same. While we may be able to re-write groups of fetches as a single linear fetch, there are some details that need to be addressed. The first subtlety is that, while it may be possible to cover two memory fetches with one, it may also be possible to group those two memory fetches in a larger group. If every grouped memory fetch is a subset of the total collection of memory fetches, then we seek a minimal {\em set covering} of the total set. \begin{figure}[t!] \centering \includegraphics[scale=1.5]{images/2d/grouping_example.pdf} \caption{The set covering for the tensor product quadratic spline. The middle square is the region of evaluation (there is only one sub-region of evaluation for this spline). The points in red denote the lattice sites that contribute to a reconstruction in the region of evaluation. The highlighted and labeled boxes correspond to the groups of 1, 2, and 4 that can be simplified into a linear texture fetch. Note that, by our heuristic, we would rather evaluate these groups in the order D-C-B-A as opposed to, say, D-B-C-A which would have $4+2+2+2=10$ and $4+3+2+3=12$ cache misses, respectively.} \label{fig:grouping} \end{figure} The set covering problem is NP-complete, however, we only perform this step once as a precomputation. We enumerate all groups of 1, 2, 4 and 8 that can be combined into a single texture fetch and use Algorithm X to find a solution to the minimal set covering problem~\cite{knuth2000dancing}. Once we have a set covering we may still choose an ordering of the memory fetches. We make the assumption that, when a texture fetch occurs, all the points that contribute to that texture fetch are cached --- any neighboring texture fetch may then reuse some of the values that have been cached. To take advantage of this, we create a complete directed-graph in which each node corresponds to one linear texture fetch. To each edge of the graph we assign the number of cache-misses incurred by performing the pair of memory fetches (in order). We then seek a route through this graph that minimizes cache misses --- this reduces to the travelling salesman problem; another NP-complete problem. Again, this is a one-time precomputation, and Figure~\ref{fig:grouping} shows an example of the set covering for the quadratic tensor product spline. \section{Related Work} \label{sec:related_work} Interpolation is a fundamental operation in scientific visualization. Many visualization tasks (volumetric rendering, iso-surface extraction, flow visualization etc.) rely on the interpolation of a continuous function from a discrete set of values. In one dimension, the family of B-splines are the prototypical interpolant --- the linear B-spline is the least computationally expensive in this family, and has received the most attention in practice~\cite{unser1999splines}. However, it is well understood what B-splines are members of the maximal order minimal support (MOMS) family, which are the optimal interpolants for a given support~\cite{blu2001moms}. This is not the only option though, there are other constraints one may wish to design around. For example: arithmetical complexity; total number of memory accesses (i.e. support) needed for a single point reconstruction; and smoothness are all parameters that can be tweaked. If one requires infinite differentiability, then CINAPACT splines are an appropriate interpolant candidate~\cite{cinapact}. The design space for uni-variate interpolants is well understood. Appropriate choice of interpolant is not so clear in higher dimensions. For the domain of scientific visualization, the move to three dimensions allows practitioners the freedom to consider non-seperable splines. In this case, it is clear that the tensor product B-splines are no longer MOMS splines; the generalized ZP-element shows this, since it has lower support than (but the same approximation order as) the cubic B-spline~\cite{entezari2006extensions}. There are multiple works that investigate non-separable basis functions on non-Cartesian lattices; box splines and weighted linear combinations of box splines often appear as popular candidates~\cite{deboorbox, domonkos2010dc, csebfalvi2013cosine}. However, it is fairly well known that evaluating a box spline numerically is quite difficult; the recursive form for box splines is unstable if naively implemented~\cite{boxeval}. One can rectify this by ensuring that any decision made while evaluating a point on the spline's separating hyperplanes is consistent~\cite{boxnumer}. Even then, recursive box spline evaluation is unsuitable for use on the GPU --- the conditional nature and large branching behaviour of the recursive form will lead to {\em branch divergence} and stall execution units on the GPU, leaving its resources underutilized. It is more convenient to work with either the Bernstein B\'ezier (BB) form, or the explicit piece-wise polynomial (PP) form of a box spline which has been characterized in closed form~\cite{horacsek2016}. Mathematically these two forms are equivalent, the BB form is simply one specific factorization of the PP form that lends itself to evaluation with De Castlejau's algorithm. Generally, a polynomial can be factorized in many different ways. The BB form has been used in fast GPU evaluation schemes for box splines on non-Cartesian lattices. In the work of Kim \textit{et al.}~\cite{kim2017}, the symmetry of a box spline is used to create look-up tables of the BB polynomial coefficients. Since these coefficients are rational, they are stored as pairs of integers and any division occurs at run time. This is particularly convenient on the GPU, as it allows one to write one function for De Castlejau's algorithm, and each separate region of the spline to be evaluated is a set of integers that can be looked up based on an analysis of the regions of the spline's mesh at runtime. However, this is somewhat wasteful since most regions within a spline's mesh are related by a rotation and/or a shift (i.e. an affine change of variables). As we will see in Section~\ref{sec:method}, this change of variables allows us to re-write the polynomial within the region of evaluation as a transformation followed by a polynomial evaluation of some chosen reference polynomial (provided the spline has an appropriate structure). This reference polynomial can be evaluated in BB form, however, we choose to use a Horner factorization of the PP form --- this allows us to reduce the amount of operations needed to calculate a given polynomial~\cite{horner1}. This is a generalization of the approach used in the work of Finkbeiner \textit{et al.}~\cite{finkbeiner2010efficient}. On the BCC lattice multiple box splines have been investigated for volumetric visualization. The linear and quintic box splines were among the first used by Entezari \textit{et al.}~\cite{pracbox,entezari2009quasi} for volumetric data visualization. These splines are particularly interesting as they mimic the geometry of the BCC lattice and they attain the same order of approximation as the trilinear and tricubic splines on the CC lattice, but with smaller support. Then there is the quartic box spline of Kim~\textit{et al.} which has even smaller support than the quintic box spline, but the same order of approximation~\cite{kim2013quartic}. Additionally, in that work, Kim~\textit{et al.} proposed a 12-direction box spline with tensor product structure; this box spline has a large support size, but is reasonably fast compared to the other proposed box splines due to its tensor product flavour --- in our implementation, we call the 12-direction box spline the {\em tricubic} box spline on the BCC lattice. The FCC lattice has not received as much attention from researchers as the BCC lattice; we are only aware of few works that investigate box splines on the FCC lattice. In particular, Kim~\textit{et al.} have investigated a six direction box spline that respects the geometry of the FCC lattice~\cite{fccbox, Kim201390}. However, it is also true that the 12-direction box-spline~\cite{kim2013quartic} is usable on the FCC lattice. The proposed splines of Csebfalvi~\textit{et al.} may also be generalized to the FCC lattice~\cite{csebfalvi2013cosine, domonkos2010dc}. We are only aware few works that attempt the use of a non tensor-product box spline on the CC lattice for visualization. The work of Entezari~\textit{et al.} generalizes the Zwart-Powell (ZP) element of two dimensions to three dimensions. This also maintains the same order of approximation as the cubic tensor product spline, but with smaller support~\cite{entezari2006extensions}. Even though this spline tends toward higher fidelity approximations, we are not currently aware of any GPU implementation of this spline, and we provide one in the supplementary material. There is also the work of Csebfalvi~\textit{et al.}, where a shifted and re-weighted box spline is designed so as to map easily to linear interpolation among the cosets of the BCC lattice~\cite{csebfalvi2013cosine}. This method has the advantage of being extremely easy to implement on the GPU, has respectable reconstruction quality and runs at decent speeds compared to trilinear interpolation. There has also been some work investigating the use of splines designed for one lattice on another~\cite{retailor}. The use of direction vectors that do not correspond to principle lattice directions helps distribute frequency content more evenly in the Fourier domain. Another intuitive idea is to look at the Voronoi cell of a lattice and convolve that with itself to obtain an interpolant, Figure~\ref{fig:lattice_ind} shows the CC, BCC and FCC lattices with their Voronoi cells. This produces a valid approximation scheme, but is quite expensive to compute~\cite{mirzargar2010voronoi,van2004hex,mirzargar2011quasi}. Until this work, there was no GPU implementation available for these splines. These fit within our pipeline, and we provide an implementation for the BCC and FCC lattices --- Voronoi splines on the CC lattice correspond to the tensor product B-spline. Finally, while not strictly related to spline evaluation, it is important to discuss {\em quasi-interpolation}, since an approximation space may not harness the full approximation power of a given basis function without proper pre-filtering. Most of the basis functions discussed so far are not interpolating. If a basis is stable (\textit{i.e} it forms a {\em Riesz basis}) then it is possible to process the input data so that the resulting reconstruction interpolates data~\cite{usmanThesis}. However, this does not always yield the best reconstruction. Moreover, some bases cannot be made interpolating, so what is to be done in those cases? Quasi-interpolants ensure that a reconstruction harnesses the full approximation order of a space --- in general it is a good idea to prefilter data with a quasi-interpolant if a basis is not interpolating. This is related to an error kernel analysis, where the data convolved with a filter is guaranteed to decay with the order of the basis~\cite{blu1999quantitative, usmanThesis}. While this is an important ingredient to a good reconstruction scheme, in this work we are not concerned with the approximation properties of a basis function, only on the speed at which it can be evaluated.
\section{Introduction} When observed by telescope, the solar surface appears covered in a granular pattern. These granules are the tops of convective cells transporting hot plasma from the solar interior to the solar surface, thus heating the photospheric layer of the solar atmosphere. \citet{Hale:1908} discovered that sunspots are caused by strong magnetic fields. These strong magnetic fields inhibit the convective motions in the sub-surface layers of the sun resulting in cooler (darker) spots on the solar surface. There are also smaller dark structures observed on the solar disc called pores. Since these discoveries were made, an ongoing effort has been underway to investigate the properties of magnetic fields and dynamics in sunspots and pores \citep[see e.g.][]{Keppens:1996, Solanki:2003, Schlichenmaier:2009, Borrero:2011}. Sunspots are structures composed of two distinctive areas: umbra and penumbra. Magnetic fields within umbrae are stronger and more vertical compared to the penumbra and the magneto-convection within them leads to the formation of umbral dots \citep[e.g.][]{Schussler_etal2006,Ortiz_etal2010}. Magnetic fields within penumbral regions are weaker and more horizontal than in umbrae, and magneto-convection in penumbrae leads to highly elongated cells that form the penumbral filaments \citep[e.g.][]{Rempel2011, Tiwari_etal2013}. Pores, on the other hand, are composed of only one distinctive area that morphologically resembles sunspot umbrae. The non-existence of penumbra around pores has been explained by a simple magnetic flux tube model with a prevailing vertical field \citep[e.g.][]{Simon_etal1970}. Subsequent high spatial resolution observations showed that some pores contain fine bright features, such as light bridges or umbral dots, that reveal magneto-convection \citep[e.g.][]{Sobotka_etal1999, Hirzberger2003, Giordano_etal2008, Sobotka_etal2009}. Since there were no known magnetic properties to define them, umbra-penumbra (UP) boundaries were traditionally defined by a continuum intensity ($I_\mathrm{c}$) threshold. In \cite{Jurcak2011}, the spectropolarimetric analysis of ten sunspots provided the first hint at the invariance of $B_\mathrm{ver}$ on UP boundaries. In an extended analysis of 79 active regions observed with Hinode/SOT-SP, \cite{Jurcak_etal2018} gave statistical proof of the magnetic nature of stable UP boundaries with a critical vertical magnetic field of $B_\mathrm{ver}^\mathrm{crit}~=~1867~\pm~18$~G. The analysis of a long-lived sunspot during its stable phase observed with SDO/HMI resulted in a value of $B_\mathrm{ver}^\mathrm{crit}~=~1693~\pm~15$~G \citep{Schmassmann_etal2018}. The difference between \citet{Jurcak_etal2018} and \citet{Schmassmann_etal2018} has been explained by the different instrument resolutions and analysis methods employed. \begin{figure*} \sidecaption \includegraphics[width=0.7\linewidth]{figures_055Ic/fig_1.eps} \caption{Comparison of continuum intensity maps of the pore on 18 March 2011 observed with Hinode/SOT-SP at 19:45~UT (left) and regular (middle) and deconvolved (right) HMI/SDO maps at 19:48~UT. Isocontours at $I_\mathrm{c}~=~0.55\,I_\mathrm{QS}$ are marked with a white curve.} \label{fig:hinode_to_hmi} \end{figure*} Additionally, unstable sunspots have also been investigated. During the formation of a sunspot, it was found that penumbra partially colonises umbral areas; over several hours, the UP boundary migrates to regions with a stronger $B_\mathrm{ver}$ until $B_\mathrm{ver}^\mathrm{crit}$ is reached and the position of the boundary stabilises \citep{Jurcak_etal2015}. On the other hand, during the decay of a sunspot, $B_\mathrm{ver}$ is neither constant nor strong enough on the UP boundary; the umbra is prone to be disintegrated by convection or magnetic diffusion and this process takes place over several days \citep{Benko_etal2018}. The previously described observational studies have led to the so-called Jur\v c\'ak criterion \citep[first introduced in][]{Schmassmann_etal2018}. This empirical law not only states that stable UP boundaries can be described either by 50\% continuum intensity of the quiet Sun, $I_\mathrm{c}=0.5\,I_\mathrm{QS}$, or by a critical vertical magnetic field $B_\mathrm{ver}^\mathrm{crit}$, it also states that $B_\mathrm{ver}\geq B_\mathrm{ver}^\mathrm{crit}$ only allow for umbral modes of magneto-convection, while umbral areas with $B_\mathrm{ver}~<~B_\mathrm{ver}^\mathrm{crit}$ are unstable and prone to vanish under more vigorous convective modes. These observational results are in agreement with simplified theoretical studies of convective motions in the presence of magnetic fields. In \citeyear{Chandrasekhar1961}, Chandrasekhar derived the effects of inclined magnetic fields on convection; he showed that the convective mode is sensitive to the vertical magnetic field, $B_\mathrm{ver}$, whereas the convective cells shape is sensitive to the horizontal component, $B_{hor}$. This was further supported by the theoretical study of \citet{Gough:1966} on the stabilising effect against overturning convection of the vertical component of the magnetic field, thus expanding the Schwarzschild criterion for convective instability. Stability within this criterion is defined as the hindering of an instability or perturbation to develop overturning convection: Schwarzschild stated that convection sets in when the temperature gradient is steeper than the adiabatic gradient ($\nabla~>~\nabla_\mathrm{ad}$, where $\nabla \equiv d ~\mathrm{ln}T / d~ \mathrm{ln} p$, and \textit{T}, \textit{p} are the local temperature and pressure, respectively). \citet{Gough:1966} derived an extra parameter to expand the Schwarzchild criterion; this new constraint to keep stability depends not only on the pressure, but also on the vertical component of the magnetic field, $B_\mathrm{ver}$. This is a simplistic criterion that does not take into account other processes that influence the triggering of convective motions, such as rotation. Analyses of the relevant observations focusing on the role of $B_\mathrm{ver}$ \citep{Jurcak2011, Jurcak_etal2015, Jurcak_etal2017, Jurcak_etal2018, Schmassmann_etal2018, Benko_etal2018, Lindner:2020} suggest the validity of the theoretical studies by \citet{Chandrasekhar1961} and \citet{Gough:1966}. Although it is not specifically mentioned in any of these observational studies, we understand the $B_\mathrm{ver}^\mathrm{crit}$ value as the photospheric counterpart of the critical vertical field stabilising the sub-photospheric layers against more vigorous modes of (magneto-) convection. Magnetic properties have so far been studied exclusively on umbral boundaries. In this paper, we investigate the magnetic properties on the boundary of an evolving pore to study the applicability of the Jur\v c\'ak criterion to the stability of pores against more vigorous modes of magneto-convection. \section{Data analysis} \label{sec:analysis} In this study, we analyse a pore observed in the active region NOAA 11175 from 09:24~UT on 18 March 2011 ($\mu$~=~0.94, with $\mu=cos \theta$, where $\theta$ is the heliocentric angle) to 12:00~UT on 19 March 2011 ($\mu$~=~0.90). An analysis of the magnetic properties of an evolving pore requires spectropolarimetric data with a temporal cadence that is much higher than the evolutionary timescales of a pore, that is, we require abundant measures during the lifetime of a pore, which typically spans from hours to days. We also require observations with enough spatial resolution to resolve the magnetic structure. The Helioseismic and Magnetic Imager \citep[HMI][]{HMI_Schou2012} on-board the Solar Dynamics Observatory \citep[SDO][]{SDO_Presnell2012} fulfils our requirements. HMI provides full-disc Stokes parameters every 12 minutes, with a pixel scale of $\approx$$0,5''$ and stable conditions. However, the observations are limited by a moderate spatial resolution of $\approx$$1''$. As in any optical setting, spatial resolution is diminished by the convolution of a real image with the point spread function (PSF) of the instrument. Therefore, a proper characterisation of the HMI's PSF could improve the quality of the images. \cite{HMI_PSF_dcon} have modelled HMI's PSF as an Airy function convolved with a Lorentzian; they correct images from both large-scale wave-front errors and long-distance scattering based on tests prior to the launch of SDO \citep{HMI_study_beforelaunch}, and in-flight Venus-transit and Lunar-eclipse observations. Deconvolved HMI maps, that is, regular HMI maps corrected for scattered light using the described PSF model, are in qualitative agreement with sub-arcsecond spatial resolution observations \citep[e.g.][]{HMI_dcon_Norton}. Deconvolved maps exhibit a better spatial resolution, which implies a higher continuum intensity contrast in granulation and darker magnetic structures such as umbrae. Figure~\ref{fig:hinode_to_hmi} compares a sub-arcsecond spatial resolution scan from the spectropolarimeter on-board Hinode satellite \citep{SOT_Tsuneta2008, Hinode_Kosugi2007} to regular and deconvolved HMI maps. The deconvolved image not only exhibits a better spatial resolution, but a more consistent intensity map. Consequently, our analysis of the temporal evolution of a pore was performed using deconvolved HMI maps, specifically HMI data sets \texttt{hmi.B\_720s\_dconS} and \texttt{hmi.Ic\_720s\_dconS} kindly processed for us by A. Norton. Henceforth, every time we mention HMI maps, we are referring to the HMI deconvolved maps. The HMI measures the Stokes parameters at six wavelength positions along the \ion{Fe}{I}~617.3\ nm line on the full-solar disc. The HMI Vector Magnetic Field Pipeline \citep{HMI_Pipeline_Hoeksema2014} automatically computes the photospheric vector magnetic field using the Very Fast Inversion of the Stokes Vector code \citep[VFISV,][]{VFISV_Borrero2011,VFISV_Centeno2014}. For our purposes, we use three inferred parameters:\ magnetic field strength, inclination, and azimuth, which are in a line-of-sight reference frame (LOS). We transfer the magnetic field vector to the local reference frame (LRF) by solving the azimuth ambiguity first. In pores, we can use the solution provided by the ME0 method, a variation of the Minimum-Energy method \citep{disambiguation_metcalf,disambiguation_leka}, available for all HMI data sets. In $180^{\circ}$-rotated HMI maps, $180^{\circ}$ must be added to the azimuth. The transformation of the angular parameters of the magnetic field from LOS to LRF is then performed with the routine \texttt{r\_frame\_sphduo.pro} from the AZAM package \citep{Lites_etal1995}. Thus, we obtain the magnetic parameters necessary for our analysis: magnetic field strength ($B$), magnetic field inclination in LRF ($\gamma$), and the vertical component of the magnetic field ($B_\mathrm{ver}=B\,cos\gamma$). The 24-hour orbital induced variation on the magnetic parameters was calculated on the umbral boundary of a stable sunspot during a period of about ten days by \cite{Schmassmann_etal2018}. They found that $B$ and $B_\mathrm{ver}$ oscillated less than $20\, G$ and $\gamma$ oscillated $0.2\,^{\circ}$. Our analysis of the pore does not allow us to study the orbital induced variations in full, however, based on the analysis by \cite{Schmassmann_etal2018}, the difference is almost negligible compared to the evolutionary changes in $B$, $B_\mathrm{ver}$, and $\gamma$. Continuum intensity maps are normalised to local quiet Sun intensity ($I_\mathrm{QS}$). In order to discard the centre-to-limb and orbital induced variations, local quiet Sun intensity is calculated as the mean continuum intensity of a quiet Sun sub-region close to the studied pore for each frame. For the purpose of defining the boundary of the pore in terms of the continuum intensity, we investigate isocontours in the range $(0.4-0.6)\,I_\mathrm{QS}$. In order to carry out a systematic study of the evolution of magnetic properties on the pore boundary, we need to select a unique intensity isocontour. We are aware that in some cases a unique isocontour does not completely match the boundary of the pore. The dimmer regions of the pore that are not included in the selected isocontour evolve more rapidly than the main structure of the pore. Therefore, we believe that using a higher value of intensity threshold would only contaminate our results by adding rapid variations of the magnetic properties. The chosen isocontour at $I_\mathrm{c}=0.55\,I_\mathrm{QS}$ provides a good visual match to the pore's boundary while avoiding the introduction of strong variations on the magnetic properties. Due to the difference between the formation heights of the continuum intensity and the derived magnetic properties \citep[the \ion{Fe}{I}~617.3\ nm line is more sensitive to magnetic fields around $\log \tau = -1$,][]{FeI_6173_Nazaret2009}, there are projection effects that can influence our analysis. In the case of sunspots, observations in areas away from the disc centre resulted in shifts between intensity and magnetic isocontours \citep{Jurcak_etal2018, Schmassmann_etal2018} or analogically systematic variation of magnetic properties along intensity boundaries \citep{Jurcak2011}. \cite{Schmassmann_etal2018} calculated a shift of 1.3 pixel on a UP boundary at the limb, therefore, the projection effects are negligible in our case study, since the observed pore is located close to the disc centre ($\mu \in [0.90 - 0.94]$). \begin{figure} \centering \includegraphics[width=0.9\linewidth] {figures_055Ic/bfield_i_05Ic_2011_03.eps} \includegraphics[width=0.9\hsize] {figures_055Ic/incl_i_Ic_2011_03.eps} \includegraphics[width=0.9\hsize] {figures_055Ic/bver_i_Ic_2011_03.eps} \caption{Temporal evolution of the averaged magnetic parameters on the boundary of the pore ($I_c=0.55\,I_\mathrm{QS}$). From top to bottom, we show $B$, $\gamma$, and $B_\mathrm{ver}$. The uncertainties are given by the standard deviation of these physical parameters for each observation. The plot is divided in evolutionary stages: first period of formation (For-I), stability (Sta), second period of formation (For-II), and decay (Dec). } \label{fig:bver_evolution} \end{figure} \begin{figure} \centering {\includegraphics[width=1\linewidth]{figures_055Ic/areas_all2011_03.eps}} {\includegraphics[width=1\linewidth]{figures_055Ic/fits_all_2011_03.eps}} \caption{Temporal evolution of the areas of the pore encircled by both intensity and magnetic thresholds.\textit{ Top:} Comparison of the area of the pore encircled by the isocontours $I_c=0.55\,I_{QS}$ (red), $B=1921$~G (orange), and $B_\mathrm{ver}~=~1731$~G (blue). Vertical lines divide the evolutionary stages of the pore as in Fig.~\ref{fig:bver_evolution}.\textit{ Bottom:} Detail of the decaying stage. The straight lines are linear fits of the decay for each of the sub-periods (\textit{1, 2}) with the continuous data available. } \label{fig:areas_evolution} \end{figure} \section{Results} \label{sec:results} We investigate the properties of the magnetic field on the boundary of an evolving pore. The analysis begins when the pore area, defined by $I_c\leq 0.55\,I_\mathrm{QS}$, exceeds five square pixels, which corresponds roughly to 0.72~Mm$^2$. The pore completely disintegrates into multiple areas smaller than 0.72~Mm$^2$ around 18:00~UT on March 19. From 12:00~UT on March 19, the pore is divided into multiple patches, which alternatively fulfil and do not fulfil the size requirement. Hence, in order to have a coherent analysis of the same magnetic structures during the whole evolution of the pore, we stopped the analysis at 12:00~UT. In each frame, we average the values of $\gamma$, $B$, and $B_\mathrm{ver}$ along the intensity isocontour and calculate the standard deviations of these magnetic parameters. We note that when the analysed pore splits into multiple parts, the presented values correspond to the average along all boundaries encircling areas larger than 0.72~Mm$^2$. Temporal evolutions of the averaged $B$, $\gamma$, and $B_\mathrm{ver}$ along the pore boundary are shown in Fig.~\ref{fig:bver_evolution}. It reveals that the temporal evolution of $B_\mathrm{ver}$ on the pore boundary behaves similarly to what has been observed on UP boundaries: $B_\mathrm{ver}$ on UP boundaries increases during the formation of the sunspot until it reaches a maximum stable value \citep{Jurcak_etal2015}, leading to a stage of stability characterised by a critical $B_\mathrm{ver}$ \citep{Jurcak2011} and followed by the decay of the sunspot, during which $B_\mathrm{ver}$ is weaker until the disappearance of the sunspot \citep{Benko_etal2018}. Continuum intensity maps show a stage where the pore does not change significantly. It matches the period in which $B_\mathrm{ver}$ reaches its maximum value in Fig. \ref{fig:bver_evolution}. The combination of both the temporal evolution and continuum intensity maps suggests the existence of a stable stage in the lifetime of the pore with a constant $B_\mathrm{ver}$ that corresponds to the maximum value during its lifetime. Most importantly, this maximum $B_\mathrm{ver}$ value is comparable to the $B_\mathrm{ver}^\mathrm{crit}$ value found on UP boundaries of stable sunspots (see Sect.~\ref{discussion}). \begin{figure*}[h] {\includegraphics[width=\hsize]{figures_055Ic/fig_4.eps}} \caption{SDO/HMI samples of the evolutionary stages during the lifetime of the pore. \textit{Top row}: Intensity maps with intensity ($I_c=0.55\,I_\mathrm{QS}$; white) and magnetic field strength contours ($B=1921$~G; blue). \textit{Second row}: Intensity maps with intensity ($I_c=0.55\,I_\mathrm{QS}$; white) and $B_\mathrm{ver}$ contours ($B_\mathrm{ver}=1731$~G; orange). \textit{Third row}: Maps of magnetic field strength with contours identical to those in top row. \textit{Bottom row}: Maps of $B_\mathrm{ver}$ with contours identical to those in second row.} \label{fig:Ic_maps} \end{figure*} In Fig.~\ref{fig:areas_evolution}, we show the evolution of the pore area defined by the intensity threshold ($I_c\leq0.55\,I_\mathrm{QS}$; red symbols) next to the evolution of areas of the pore limited by magnetic thresholds ($B=1921$~G; orange symbols. $B_\mathrm{ver}=1731$~G; blue symbols). We define the evolutionary stages of the pore based on its size, morphology, and magnetic properties on its boundary. The phases, along with the definition of the magnetic thresholds, are described below. \paragraph{Formation I.} After we started to analyse the pore on the solar surface at 09:24~UT, the pore area increased slowly from 1~Mm$^2$ to 2~Mm$^2$ until approximately 10:30~UT. This phase was accompanied by a strengthening of $B$ on its boundary along with an invariable $\gamma$, that is, the field became, on average, stronger on the pore boundary. We note that $B_\mathrm{ver}$ reached values around 1730~G during this short period of time. These values are comparable to the later identified critical value of $B_\mathrm{ver}$. This initial phase was followed by a sharp increase in the pore area (from 2~Mm$^2$ to 4~Mm$^2$) between 10:30~UT and 11:00~UT, when we found a local maximum of the pore size. During this rapid increase in the pore area, we found, on average, a weaker and more inclined field on the boundary, caused by the newly accumulated magnetic field. Between 11:30~UT and 13:30~UT, the pore area decreased slowly while, on average, $B$ increased and $\gamma$ decreased, resulting into an increase in $B_\mathrm{ver}$, on the boundary of the pore. We call this period of time the Formation~I phase, marked as For-I in Figs.~\ref{fig:bver_evolution} and~\ref{fig:areas_evolution}. In Fig.~\ref{fig:Ic_maps}, the left-most panels show the pore during this phase. The magnetic thresholds do not generally match the intensity boundary of the pore during this phase. \paragraph{Stability.} Between 13:30~UT and 16:30~UT, the pore size was not changing initially and then it slowly increased. We define this as the Stability stage. Within it, both $B$ and $B_\mathrm{ver}$ fluctuate around their maximum value over the pore lifetime. During this phase, the mean values weighted by their standard deviations are $B=1921$~G and $B_\mathrm{ver}=1731$~G. These values are used as thresholds of the magnetic parameters in our analysis based on the similar behaviour and strength of the $B_\mathrm{ver}$ found on the pore boundary and on UP boundaries, as explained above. As a result, the areas of the pore defined by the intensity and magnetic thresholds evolve consistently during the stable phase as shown in Fig.~\ref{fig:areas_evolution}. Accordingly, in Fig.~\ref{fig:Ic_maps}, the second column shows the pore in this phase, where we find a match between isocontours of intensity, $B$, and $B_\mathrm{ver}$. \paragraph{Formation II.} The stable phase was terminated by a rapid growth of the pore caused by an accumulation of new flux in the northern part of the pore. This Formation~II phase lasted from 16:30~UT until 19:30~UT. During this time period, the pore size, defined by the intensity threshold, increased to 20~Mm$^2$. In the first 30~min, the pore expanded to an area with pre-existing magnetic field that strengthened and became more vertical, namely, it is also the areas outlined by $B_\mathrm{ver}=1731$~G and $B = 1921$~G that increased sharply (Fig.~\ref{fig:areas_evolution}, top plot). However, the newly gathered magnetic field is significantly weaker and more horizontal than the original magnetic field and leads to the decrease in the average $B$ and $B_\mathrm{ver}$ (and increase in $\gamma$) on the intensity boundary during the whole Formation~II period (Fig.~\ref{fig:bver_evolution}). During the whole period, the areas of the pore with $B_\mathrm{ver} > 1731$~G and $B > 1921$~G increased, but significantly more slowly than the area encircled by the isocontour $I_\mathrm{c}=0.55\,I_\mathrm{QS}$ (Fig.~\ref{fig:areas_evolution}, top plot). In Fig.~\ref{fig:Ic_maps}, we show the pore in the Formation~II phase in the third column. The magnetic thresholds show two distinctive regions: the original magnetic field with $B>1921$~G and $B_\mathrm{ver}>1731$~G in the southern part and the newly formed northern region with $B<1921$~G and $B_\mathrm{ver}<1731$~G. We note that the southern part of the pore boundary -- where there was no accumulation of new flux -- is mostly outlined by the magnetic thresholds. \paragraph{Decay.} At $\sim$19:30~UT, the decay phase of the pore began. Initially, between 19:30~UT and 23:00~UT, the pore size fluctuated around 21~Mm$^2$ and the areas with $B_\mathrm{ver} > 1731$~G and $B>1921$~G slightly increased. Afterwards, between 23:00~UT and 06:00~UT, the pore decreased in size while regions with $B>1921$~G tend to diminish. However, during this period, areas of the pore with $B_\mathrm{ver} > 1731$~G fluctuated around 10~Mm$^2$. Then both the areas defined by intensity and magnetic thresholds decreased. Decay rates were studied separately during the two sub-periods with the continuous data available (bottom plot in Fig.~\ref{fig:areas_evolution}). We note that during the whole decay process, we observed slight fluctuations of the pore areas as defined both by intensity and magnetic thresholds. These fluctuations are partly caused by relatively fast evolution of outermost structures of the pore with intensities comparable to the intensity threshold and partly caused by the size increase due to occasional small accumulations of magnetic flux. The first sub-period spans from 18~March, 19:30~UT to 19~March, 06:00~UT. During this interval, the pore defined by the intensity isocontour decays at a rate of 0.95~$\mathrm{Mm^2/h}$. Regions with $B>1921$~G decay at a rate of 0.22~$\mathrm{Mm^2/h}$ on average. This implies that regions with $B<1921$~G decay at a rate of 0.73~$\mathrm{Mm^2/h}$, which is 3.4~times faster than regions with a stronger total magnetic field. Regions with $B_\mathrm{ver}>1731$~G decay at a rate of 0.02~$\mathrm{Mm^2/h}$. This implies, as observed in Fig.~\ref{fig:areas_evolution}, that only regions with a weak vertical magnetic field disappear from the solar surface while regions with a strong vertical magnetic field remain almost invariant. Short-term fluctuations of the pore size as defined by intensity and magnetic thresholds are small compared to the overall trend observed in this sub-period. At the end of the first sub-period, we observe a newly accumulated magnetic flux in the northern region that has more significant impact on the size of regions defined by the total magnetic field strength threshold. This indicates an accumulation of a strong but inclined magnetic field. The second sub-period spans from 19~March, 08:48~UT to 12:00~UT. During this interval, the pore size defined by the intensity isocontour decays at a rate of 1.78~$\mathrm{Mm^2/h}$ and it is an identical decay rate as for regions with $B_\mathrm{ver}>1731$~G, while regions with $B>1921$~G decay at a rate of 0.922~$\mathrm{Mm^2/h}$. During this sub-period, the patches of the pore defined by the intensity and $B_\mathrm{ver}$ thresholds are nearly identical, and therefore we observe $B_\mathrm{ver}$ values close to 1731~G during this period (see Fig.~\ref{fig:bver_evolution}). It means that the dissipation of the pore is strictly connected to the disappearance of strong vertical fields. The flux tube is mostly vertical and the total magnetic field strength is, in general, weaker than in previous stages. Fluctuations of the pore regions defined by intensity and magnetic thresholds are significant compared to the mean values during the second sub-period of the decay. Towards the end of the lifetime of the pore, the pore is split into multiple segments. These segments alternately fulfil or do not fulfil the conditions to be included in the analysis and, thus, they cause rapid changes in the pore areas defined by the intensity and magnetic thresholds, which significantly influences the evolving properties and the decay rates, therefore, we have not included this last sub-period in the analysis. In Fig.~\ref{fig:Ic_maps}, the fourth and fifth columns show the pore in the Decay phase. We observe a division of the pore by a light bridge through a region with weak magnetic field. A comparison of the two frames also indicates that the area of the pore with $B_\mathrm{ver}~<~1731$~G ($B~<~1921$~G) is more unstable. We also want to note that during the Decay phase, we find a better match between $I_c$ and $B_\mathrm{ver}$ contours, rather than between $I_c$ and $B$ contours on the southern segment of the pore, which is the most stable region. \section{Discussion and conclusions}\label{sec_conclusions} \label{discussion} In this work, we analyse the magnetic properties on the boundary of an evolving pore with the aim of investigating the role of the vertical component of the magnetic field on the pore stability. More specifically, we study the similarity between the umbra-penumbra (UP) boundaries in sunspots and pore-quiet Sun boundaries in terms of $B_\mathrm{ver}^\mathrm{crit}$ values. The pore stability refers to the effective damping of more vigorous magneto-convective motions and, conversely, the pore instability refers to the ineffective attenuation of vigorous magneto-convective motions within the pore, leading to its dissipation. We use 113 observations of a pore in active region NOAA~11175 taken by SDO/HMI that cover $\sim\,$26.5 hours of the pore evolution. A morphological characterisation of the evolution of the pore, determined from the development of the pore area (Fig.~\ref{fig:areas_evolution}) and from the behaviour of the averaged magnetic parameters along the pore boundary (Fig.~\ref{fig:bver_evolution}), lead us to define four evolving phases: a first formation period (Formation I), a stable period (Stability), a second formation period (Formation II), and a disintegration period (Decay). During the first formation phase, we find that both $B$ and $B_\mathrm{ver}$ are generally increasing on the visual boundary of the pore defined at $I_c=0.55\,I_\mathrm{QS}$. In the later phase of the Formation I period, the pore area decreases until the maximum values of $B$ and $B_\mathrm{ver}$ are reached on the boundary (Fig.~\ref{fig:bver_evolution}). During the Stability phase that follows, the pore boundaries defined by $0.55\,I_\mathrm{QS}$, $B = 1921$~G and $B_\mathrm{ver} = 1731$~G are nearly identical and encircle the same area (Fig.~\ref{fig:areas_evolution}). This stability is disrupted by the accumulation of new magnetic flux of weaker and more horizontal field that causes a sharp increase in the pore size and the subsequent decrease in $B$ and $B_\mathrm{ver}$ on the pore boundary. The pore does not stabilise again and starts to decay immediately after the supply of new magnetic flux is depleted. The mean value of $B_\mathrm{ver}$ found on the pore boundary during the Stability phase is 1731~G. This value is comparable to 1639~G, $B_\mathrm{ver}$ found by \citet{Schmassmann_etal2018} on the UP boundary of a long-lived sunspot, where the authors analysed standard SDO/HMI data at 53\% $I_\mathrm{QS}$. The dissimilarity can be attributed to the use of deconvolved data, which should lead to stronger $B_\mathrm{ver}$ values. The similarity of the $B_\mathrm{ver}$ value on the pore boundary with those found on UP boundaries of stable sunspots \citep[1867~G, 1693~G, 1787~G by][respectively]{Jurcak_etal2018, Schmassmann_etal2018, Lindner:2020} indicates that it is also in pores that the magneto-convection is effectively and stably hindered by the vertical component of the magnetic field. In the analysed pore, we find this critical value to be $B_\mathrm{ver}^\mathrm{crit}$ $\sim$1730~G. Furthermore, in the studied pore, we find that the same applies for a magnetic field strength of 1921~G, the mean value on the pore boundary during the Stability phase. During this phase, the isocontours of intensity and $B$ are in equally good agreement as isocontours of intensity and $B_\mathrm{ver}$. Also, the areas encircled by isocontours of $B=1921$~G and $B_\mathrm{ver}=1731$~G, shown in Fig.~\ref{fig:areas_evolution}, exhibit a comparable evolution. During the Decay phase, we initially observe a much faster disappearance of the pore areas with $B_\mathrm{ver}<1731$~G, namely, granular magneto-convection takes over pore areas with $B_\mathrm{ver} < B_\mathrm{ver}^\mathrm{crit}$. This provides us with a further indication of the important role of $B_\mathrm{ver}^\mathrm{crit}$ in hindering magneto-convection, as stated by the Jur\v c\'ak criterion for stable sunspots. The decay process takes hours and is thus comparable to other case studies. For example, \cite{Jurcak_etal2017} analysed the 12-hour formation of a penumbra at the expense of a pore, which had $B_\mathrm{ver} < B_\mathrm{ver}^\mathrm{crit}$ over the whole process; and \citet{Benko_etal2018} described the decay of a sunspot umbra that spans over several days. We do not know why the decay process is not comparable to the granular life-time or life-time of penumbral filaments. For the first time, we try to directly estimate, the stabilising role of the critical value of the vertical component of the magnetic field by comparing the decay rates of the areas that have $B_\mathrm{ver}>1731$~G and $B_\mathrm{ver}<1731$~G. During the initial sub-period of the pore's decay, we find that areas with $B_\mathrm{ver}>1731$~G do not decay, while areas with $B_\mathrm{ver}<1731$~G progressively disappear until, after the gap in the observations, the areas of the pore defined by the intensity and $B_\mathrm{ver}$ thresholds are nearly identical. Therefore, we observe an increase in the $B_\mathrm{ver}$ value averaged over the intensity boundary of the pore towards the end of the analysed period (see Fig.~\ref{fig:bver_evolution}). As pointed out earlier in this work, we can also use $B$ as a determining parameter for stability in the studied pore. Areas with $B>1921$~G decay 3.4 times slower than pore areas with $B<1921$~G. We note that during the second sub-period of the pore's decay, the decay rates for areas with $B_\mathrm{ver}>1731$~G and $B>1921$~G increased significantly, and regions with $B_\mathrm{ver}>1731$~G decay at the same rate as areas defined by the intensity threshold. This means that the pore decays at a fast rate while having an intense vertical magnetic field, and we do not know the reason for this behaviour. This case study highlights the importance of the $B_\mathrm{ver}^\mathrm{crit}$ value found for sunspots to the stability of pores as well. However, an analysis of a larger sample of pores is necessary in order to investigate if the found $B_\mathrm{ver}^\mathrm{crit} \sim 1730$~G is a unifying parameter for stable boundaries of all pores and if the same unifying parameter could also be $B^\mathrm{crit}~\sim~1920$~G. Statistical analyses of pore lifetimes and decay rates with respect to their magnetic properties is also necessary in order to investigate the stabilising effect of $B_\mathrm{ver}^\mathrm{crit}$. \begin{acknowledgements} We would like to thank the referee for the valuable comments that helped to improve this paper. We also would like to thank A. Norton for providing us deconvolved full-disc vector field maps. This work was supported by project 204119 from the Grant Agency of Charles University and by the Czech Science Foundation grant project 18-06319S. The data is courtesy of NASA/SDO and the HMI science teams. Hinode is a Japanese mission developed and launched by ISAS/JAXA, with NAOJ as domestic partner and NASA and STFC (UK) as international partners. It is operated by these agencies in co-operation with ESA and NSC (Norway). \end{acknowledgements} \bibliographystyle{aa}
\section{Introduction} Lithium superionic conductors (LSCs) are the critical enabling solid electrolyte (SE) component in next-generation all-solid-state rechargeable lithium-ion batteries \cite{tarasconIssuesChallengesFacing2001a, armandBuildingBetterBatteries2008, xuElectrolytesInterphasesLiIon2014, wangDesignPrinciplesSolidstate2015}. Replacing the traditional flammable organic solvent electrolyte, ceramic LSCs exhibit superior safety and are also a potential pathway to higher energy density cell architectures and utilization of lithium metal anodes. As the name implies, a key property of LSCs is a high ionic conductivity, typically ranging from O(10$^{-1}$) mS cm$^{-1}$ to O(10) mS cm$^{-1}$ (rivaling that of liquid electrolytes) at room temperature. The anion chemistry of an LSC has a major influence on their properties. Sulfide LSCs, such as the \ce{Li10GeP2S12} (LGPS) family \cite{kamayaLithiumSuperionicConductor2011b, bronLi10SnP2013, whiteleyEmpoweringLithiumMetal2014, katoHighpowerAllsolidstateBatteries2016a}, \ce{Li7P3S11} \cite{yamaneCrystalStructureSuperionic2007, seinoSulphideLithiumSuper2014a, wenzelInterphaseFormationDegradation2016a, buscheSituMonitoringFast2016, chuInsightsPerformanceLimits2016a} and \ce{Li3PS4} \cite{tachezIonicConductivityPhase1984, liuAnomalousHighIonic2013a, yamadaAllSolidStateLithium2015}, tend to have very high ionic conductivities due to the large, polarizable \ce{S^{2-}}, but suffer from narrow electrochemical stability windows, air- and moisture-sensitivity. Oxide LSCs, such as the \ce{Li7La3Zr2O12} garnet family \cite{muruganFastLithiumIon2007a} and LISICONs \cite{huIonicConductivityLithium1977, kuwanoNewLiIon1980, bruceIonicConductivityLISICON1982}, typically have lower ionic conductivities compared to the sulfides, but are much more electrochemically and chemically stable. Recently, a promising new class of halide LSCs, \ce{Li3YCl6} and \ce{Li3YBr6}, has been discovered that exhibits a good compromise of ionic conductivities (0.51 mS cm$^{-1}$ for \ce{Li3YCl6} and 1.7 mS cm$^{-1}$ for \ce{Li3YBr6}) and electrochemical stabilities between those of the sulfides and oxides \cite{asanoSolidHalideElectrolytes2018}. Molecular dynamics (MD) simulations have been extensively used in the study of ion conduction in LSCs. In particular, \textit{ab initio} MD (AIMD), i.e., simulations where the energies and forces are directly obtained by solving the Schr\"{o}dinger equation via density functional theory (DFT), have emerged as a powerful tool in recent years as they can be transferably and broadly applied to the entire range of LSC chemistries \cite{moFirstPrinciplesStudy2012a, ongPhaseStabilityElectrochemical2013, miaraEffectRbTa2013, dengRationalCompositionOptimization2015, chuInsightsPerformanceLimits2016a, heOriginFastIon2017, zhuLiPSLi2017, dengDataDrivenFirstPrinciplesMethods2017, wangLithiumChloridesBromides2019}. However, the high cost of AIMD simulations means that they are usually performed at elevated temperatures to obtain sufficient diffusion statistics, sometimes far in excess of the melting points of some LSCs, and for relatively short simulation time frames ($\sim$ 100 ps). As a consequence, extrapolated room-temperature ionic conductivity and diffusivity have large error bars \cite{heStatisticalVariancesDiffusional2018}. Further, there may be phase transitions or transitions in diffusion mechanisms occurring between room temperature and simulated high temperatures, invalidating the Arrhenius assumption used in extrapolation. Such non-Arrhenius behavior and phase transitions have been reported in many LSCs, including \ce{Li_{3x}La_{2/3-x}TiO_3} \cite{inagumaHighIonicConductivity1993a, salkusDeterminationNonArrheniusBehaviour2011}, \ce{Li3PS4} \cite{tachezIonicConductivityPhase1984}, and LGPS \cite{kwonSynthesisStructureConduction2015}. Another source of error arises from the fact that most AIMD simulations of LSCs are performed in the NVT ensemble using the equilibrium volume from a 0K density functional theory (DFT) relaxation calculation. The most common DFT functional used is the Perdew-Burke-Ernzerhof (PBE) generalized gradient approximation (GGA) \cite{perdewGeneralizedGradientApproximation1996a}, which tends to overestimate the lattice parameters of solids and differ from experimental values by up to 2-3\% \cite{heydEnergyBandGaps2005,klimesVanWaalsDensity2011}. These differences in lattice parameters can have a major effect on ion diffusion and activation barriers \cite{ongPhaseStabilityElectrochemical2013, moradabadiEffectLatticeDopant2020}. The net result of the mismatch in working temperatures and lattice parameters between simulations and experiments is that room-temperature ionic diffusivity and conductivity of LSCs computed from AIMD simulations often disagree substantially with those measured experimentally, e.g., via electrochemical impedance spectroscopy (EIS). For example, Chu et al. \cite{chuInsightsPerformanceLimits2016a} previously predicted a room-temperature ionic conductivity of 57 mS cm$^{-1}$ for the \ce{Li7P3S11} LSC using AIMD simulations, far in excess of the highest experimentally measured room-temperature ionic conductivity of 17 mS cm$^{-1}$ \cite{seinoSulphideLithiumSuper2014a}. Similarly, Wang et al. \cite{wangLithiumChloridesBromides2019} predicted an ionic conductivity of 14 mS cm$^{-1}$ for the \ce{Li3YCl6} LSC, again far in excess of the experimentally reported 0.51 mS cm$^{-1}$ \cite{asanoSolidHalideElectrolytes2018}. Classical MD simulations using an interatomic potential (IAP) to parameterize the potential energy surface (PES) are a potential solution to enable low-temperature and long-timescale studies. In recent years, machine learning (ML) the PES as a function of local environment descriptors has emerged as an especially promising, and reproducible approach to develop IAPs with near-DFT accuracy in energies and forces \cite{behlerGeneralizedNeuralNetworkRepresentation2007a, bartokGaussianApproximationPotentials2010, thompsonSpectralNeighborAnalysis2015, shapeevMomentTensorPotentials2016a, wangDeePMDkitDeepLearning2018, chenAccurateForceField2017, liStudyLiAtom2017a, liQuantumaccurateSpectralNeighbor2018, dengElectrostaticSpectralNeighbor2019a, liComplexStrengtheningMechanisms2020a, zuoPerformanceCostAssessment2020b, wangLithiumIonConduction2020, huangDeepPotentialGeneration2021}. However, most ML-IAPs that have been developed in the literature still rely on DFT calculations performed using the PBE functional; as such, their performance are still limited by the accuracy of the DFT training data. In this work, we show that the gap between experimental and simulated ionic conductivities in LSCs can be bridged by developing ML-IAPs under the moment tensor potential (MTP) formalism \cite{shapeevMomentTensorPotentials2016a, gubaevAcceleratingHighthroughputSearches2019} using training data from the optB88 van der Waals (vdW) DFT functional \cite{klimesChemicalAccuracyVan2010, klimesVanWaalsDensity2011}. Three LSCs, \ce{Li_{0.33}La_{0.56}TiO3} (LLTO), \ce{Li3YCl6} and \ce{Li7P3S11} spanning a diversity of anion chemistries have been selected as the model systems for investigation, as shown in Figure \ref{fig:lsc}. These LSCs have been selected because of their major interest to the battery research community, as well as the fact that previous AIMD calculations have either yielded large disagreements with experimentally reported room temperature conductivity or else have not been performed as in the case of LLTO. We demonstrate that in all three cases, the discrepancy between computed and measured conductivities can be explained by a transition between quasi-linear Arrhenius regimes arising from the activation of additional diffusion pathways. \begin{figure} \centering \begin{subfigure}[b]{0.49\textwidth} \centering \graphicspath{ {./} } \includegraphics[height=3.5cm]{unitcell_LLTO.png} \caption{\label{subfig:unitcell_LLTO}\ce{Li_{0.33}La_{0.56}TiO3}} \end{subfigure} \begin{subfigure}[b]{0.49\textwidth} \centering \graphicspath{ {./} } \includegraphics[height=4cm]{unitcell_Li3YCl6.png} \caption{\label{subfig:unitcell_LYC}\ce{Li3YCl6}} \end{subfigure} \begin{subfigure}[b]{0.49\textwidth} \centering \graphicspath{ {./} } \includegraphics[height=4cm]{unitcell_Li7P3S11.png} \caption{\label{subfig:unitcell_Li7P3S11}\ce{Li7P3S11}} \end{subfigure} \begin{subfigure}[b]{0.4\textwidth} \centering \graphicspath{ {./} } \includegraphics[height=4cm]{atom_polyhedra_symbols} \end{subfigure} \caption{Crystal structures of (a) \ce{Li_{0.33}La_{0.56}TiO3} (Space group $Pm\bar{3}m$, No. 221), (b) \ce{Li3YCl6} (Space group $P\bar{3}m1$, No. 164), and (c) \ce{Li7P3S11}(Space group $P\bar{1}$, No. 2).} \label{fig:lsc} \end{figure} \section{Material and Methods} \begin{figure} \centering \includegraphics[height=4cm]{MTP_workflow_graffle.pdf} \caption{Flowchart of the stepwise construction of MTPs for LSCs. DFT functionals utilized in each step and the names of the as-trained MTPs were listed.} \label{fig:workflow} \end{figure} Figure \ref{fig:workflow} summarizes the overall workflow for the construction of MTPs for the LSCs investigated in this work as well as the DFT functional choices investigated. \subsection{Structure Construction} \label{Section: construction of supercell} Supercells of LLTO, \ce{Li3YCl6} and \ce{Li7P3S11} with lattice parameters greater than 10 \AA~were constructed to minimize interactions between periodic images. For LLTO, a $3\times3\times1$ supercell of \ce{Li_{0.33}La_{0.56}TiO3}, equivalent to $x = 0.11$ in the general formula of \ce{Li_{3x}La_{2/3-x}TiO_3} \cite{inagumaHighIonicConductivity1993a, haradaLithiumIonConductivity1998, haradaOrderDisorderAsite1999}, was initially generated to enumerate symmetrically distinct orderings of Li/La/Vacancy on the perovskite A site. These orderings were fully relaxed by DFT. The lowest energy ordering was then stacked along the $c$ direction to obtain a $3\times3\times3$ supercell. During relaxation, shifts of the lithium ion position from the A-sites of perovskite were observed (see Figure S1), which is consistent with previous theoretical studies on LLTO \cite{qianLithiumLanthanumTitanium2012,chengIntegratedApproachStructural2014,romeroExperimentalTheoreticalRaman2016}. \ce{Li3YCl6} has previously been identified to be an isomorph of \ce{Li3ErCl6} (ICSD No. 50151, space group $P\bar{3}m1$, No. 164) \cite{asanoSolidHalideElectrolytes2018}. Starting from the experimentally reported disordered \ce{Li3YCl6} structure, the site occupancies were rounded to the nearest rational numbers based on a total of 3 formula units per unit cell (see Table S1) and enumeration of distinct orderings was performed. The lowest energy relaxed structure was then selected to construct a $1\times1\times2$ supercell. A $1\times2\times1$ supercell of \ce{Li7P3S11} was constructed from the experimentally refined crystal structure \cite{yamaneCrystalStructureSuperionic2007}. The formation energies ($E_f$) and energy above the convex hull ($E_{hull}$) for all three LSCs calculated with the PBE and optB88 functionals are given in Table S2. All three LSCs are predicted to have $E_{hull} <$ 0.05 eV/atom. The optB88 $E_f$ are 5-10\% lower than the PBE values, which is consistent with the $\sim$5\% higher atomization energies predicted by optB88 for ionic solids \cite{klimesVanWaalsDensity2011}. \subsection{DFT Calculations and AIMD Simulations} All DFT calculations were performed using the Vienna \textit{ab initio} simulation package (VASP) with the projector augmented-wave (PAW) approach \cite{blochlProjectorAugmentedwaveMethod1994a, kresseEfficientIterativeSchemes1996a}. For initial structural relaxations (Step 1 in Figure \ref{fig:workflow}), spin-polarized calculations were performed with an energy cutoff of 520 eV and a k-point density of at least $64/\text{\AA}^{-3}$, similar to those used in the Materials Project (MP) \cite{jainCommentaryMaterialsProject2013a}. In Step 2, non-spin polarized \textit{ab initio} molecular dynamics (AIMD) simulations using NVT ensemble were carried out on the relaxed supercells with a plane-wave energy cutoff of 280 eV and a minimal $\Gamma$-centered $1\times1\times1$ k-mesh. A time step of 2 fs and the Nose–Hoover thermostat \cite{noseUnifiedFormulationConstant1984, hooverCanonicalDynamicsEquilibrium1985} were used. A similar protocol was followed as previous works \cite{liQuantumaccurateSpectralNeighbor2018, dengElectrostaticSpectralNeighbor2019a, zuoPerformanceCostAssessment2020b}, wherein simulations were performed at three strains (0, $\pm$ 0.05) and four temperatures (300K to 1200K with 300K intervals) to diversify the training structures. The initial structures were heated from 0K to the target temperatures with a temperature gradient of 0.25 K/fs and equilibrated for at least 30 ps. Snapshots were then extracted from a production run of 15 ps at 0.1 ps intervals, i.e., 150 structures for each temperature and strain. Hence, for each LSC, a total of 1800 training structures ($150\times4\text{ temperatures}\times3\text{ strains}$) were generated. In Step 3, static self-consistent calculations were performed on the training structures to obtain accurate energies \& forces for MTP training. These calculations were performed with a higher k-point density of at least $100/\text{\AA}^{-3}$, an energy cutoff of 520 eV and an electronic relaxation convergence condition of $5\times10^{-5}$ eV/atom, which were consistent with those used in MP \cite{jainCommentaryMaterialsProject2013a}. A main goal of this work is to evaluate the choice of the DFT functional on the training data and hence, the performance of the MTP generated. The initial structural relaxations and energy evaluations of symmetrically distinct LLTO and \ce{Li3YCl6} orderings were performed using the PBE \cite{perdewGeneralizedGradientApproximation1996a} functional. Subsequent structural relaxations, AIMD simulations and static energy valuations were performed using either the PBE functional or optB88 vdW functional \cite{klimesChemicalAccuracyVan2010, klimesVanWaalsDensity2011}, as shown in Figure \ref{fig:workflow}. All DFT and AIMD simulations were carried out using fully-automated workflows \cite{dengDataDrivenFirstPrinciplesMethods2017} built on the Python Materials Genomics (pymatgen) \cite{ongPythonMaterialsGenomics2013a} library and FireWorks scientific workflow package \cite{jainFireWorksDynamicWorkflow2015a}. \subsection{MTP Model Training and Verification} \label{section: ML-IAP training and labeling} The moment tensor potential (MTP) formalism has been extensively discussed in earlier works \cite{shapeevMomentTensorPotentials2016a, gubaevAcceleratingHighthroughputSearches2019, zuoPerformanceCostAssessment2020b} and successfully applied to many chemical systems, including metals \cite{shapeevMomentTensorPotentials2016a, novoselovMomentTensorPotentials2019, zuoPerformanceCostAssessment2020b}, boron \cite{podryabinkinAcceleratingCrystalStructure2019}, alloys \cite{gubaevAcceleratingHighthroughputSearches2019}, gas-phase reactions \cite{novikovAutomatedCalculationThermal2018} and cathode coating materials \cite{wangLithiumIonConduction2020}. Briefly, the MTP describes the local environment around each atom in terms of moment tensors $M_{\mu,\nu}$, defined as follows: \begin{equation} M_{\mu,\nu}(\mathbf{n_i}) = \sum_{j}f_{\mu}(|\mathbf{r_{ij}}|,z_i,z_j)\underbrace{\mathbf{r_{ij}} \otimes... \otimes \mathbf{r_{ij}}}_\textrm{$\nu$ times} \label{eqn:mtp descriptor} \end{equation} Here, $\mathbf{n_i}$ denotes the atomic types as well as the relative positions of the $i^{th}$ atom and all of its neighboring atoms. $z_i$ and $z_j$ represent the atomic types (integers from 0 to n-1 for a system with n different types of atoms) of the $i^{th}$ atom and its $j^{th}$ neighbor, respectively, and $\mathbf{r_{ij}}$ is the position vector of the $j^{th}$ neighbor to the $i^{th}$ atom. The radial part of the atomic environment is given by the $f_{\mu}$ term, and the angular part is encoded by the outer product ($\otimes$) of the $\mathbf{r_{ij}}$ vectors, which is a tensor with rank $\nu$. The moment tensors $M_{\mu,\nu}$ are then contracted to basis functions $B_{\alpha}$, which are intrinsically invariant to atomic permutations, rotations and reflections. The energy of the system $E_{\rm{MTP}}$ is then expressed as a linear function of $B_{\alpha}$ as follows: \begin{equation} E_{\rm{MTP}} = \sum_{i=1}^n\sum_{\alpha}\xi_{\alpha}B_{\alpha}(\mathbf{n_i}) \label{eqn:mtp energy} \end{equation} where $n$ and $\alpha$ are the total number of atoms inside the system and the total number of basis functions for each atom, respectively, and $\xi_{\alpha}$ are the coefficients fitted in the training process implemented in the MLIP package. Similarly, the forces and stresses can be expressed as the first and second derivatives of the $E_{\rm{MTP}}$ with respect to $\mathbf{r_{ij}}$ \cite{shapeevMomentTensorPotentials2016a, gubaevAcceleratingHighthroughputSearches2019}. An optimized MTP is then obtained by minimizing the errors in the predicted energies, forces and stresses with respect to the DFT training data. In this work, the energy, force and stress data points are assigned weights of 100:1:0, similar to previous works \cite{liQuantumaccurateSpectralNeighbor2018, dengElectrostaticSpectralNeighbor2019a, zuoPerformanceCostAssessment2020b, liComplexStrengtheningMechanisms2020a}. Two key parameters control the performance trade-off of the MTP. The radius cutoff $R_{cut}$ determines the maximum interaction range between atoms. The larger the $R_{cut}$, the more the atomic interactions encoded in Equation \ref{eqn:mtp descriptor}. The completeness of the basis functions $B_{\alpha}$ is controlled by its maximum level ($lev_{max}$). The larger the $lev_{max}$, the larger the number of terms in the linear expansion in Equation \ref{eqn:mtp energy}, which in turn results in higher computational cost and a greater likelihood of over-fitting. In this work, the $R_{cut}$ was chosen to be 5.0 \AA, a typical value used in previously reported MTPs \cite{podryabinkinActiveLearningLinearly2017, gubaevAcceleratingHighthroughputSearches2019, wangLithiumIonConduction2020}, while the $lev_{max}$ were set as 18 for \ce{Li3YCl6} and \ce{Li7P3S11} and 16 for LLTO based on our convergence tests (see Figure S2-S5). For the fitting, a training:test split of 90:10 was used. In total, seven MTPs were fitted for LLTO, \ce{Li3YCl6} and \ce{Li7P3S11} according to the above discussed procedure. These MTPs are labeled with subscripts indicating the functionals used during the AIMD simulation (Step 2) and static energies and forces evaluations (Step 3). For instance, MTP$_{\mathrm{PBE,optB88}}$ refers to an MTP fitted using the snapshots extracted from AIMD simulations performed using the PBE functional, with energies and forces evaluated using the optB88 functional. It should be noted that MTP$_{\mathrm{optB88,optB88}}$ was fitted only for \ce{Li7P3S11} as a test case and because the results were highly similar to MTP$_{\mathrm{PBE,optB88}}$ (see later Results section), only the latter was fitted for the other two LSCs. Previously, the current authors have also used an alternative approach in which the long-ranged electrostatic interactions were accounted for separately via an Ewald summation of the formal oxidation states prior to fitting the residual interactions via the ML-IAP \cite{dengElectrostaticSpectralNeighbor2019a}. A similar ``electrostatic'' MTP (eMTP) for the LLTO LSC was also developed but the performance was similar to the MTP without separate accounting of electrostatics. It can be concluded that there is significant screening in these materials, and the radius cutoff used above was already sufficient to account for most of the electrostatic interactions (see Figure S6). All training, evaluations and simulations with MTP were performed using MLIP \cite{shapeevMomentTensorPotentials2016a, gubaevAcceleratingHighthroughputSearches2019}, LAMMPS \cite{plimptonFastParallelAlgorithms1995} and the open-source Materials Machine Learning (maml) Python package \cite{maml}. \subsection{QHA Thermal Expansion} Phonon calculations were performed using the supercells (outlined in Section \ref{Section: construction of supercell}) at nine fixed volumes (80\% to 120\% with 5\% intervals of the equilibrium volume at 0K from structural relaxations with PBE and optB88 functionals). Real-space force constants were calculated utilizing the density functional perturbation theory (DFPT) \cite{gonzeDynamicalMatricesBorn1997} method as implemented in VASP, while the real-space force constants from MTPs were generated with the finite displacement approach implemented in the Phonopy \cite{togoFirstPrinciplesPhonon2015a} package. Phonon frequencies were then calculated from the force constants, and the thermal expansion from 0K to 800K was calculated under the quasi-harmonic approximation (QHA). \subsection{Diffusivity and Conductivity Calculations} Classical MD simulations for each LSC were performed using the trained MTPs. Taking advantage of the lower computational cost and linear scaling of MTP calculations with respect to system size, larger supercells with all lattice parameters over 20 \AA~were used for these simulations. Based on benchmarks of the convergence of the ionic conductivity with cell sizes (Figure S7), simulation cells of $3\times3\times2$, $2\times2\times3$ and $3\times2\times2$ AIMD supercells are utilized for LLTO, \ce{Li3YCl6} and \ce{Li7P3S11}, respectively. The time step was set to 1 fs, and the total simulation time was at least 1 ns for all MD simulations. The tracer diffusivity ($D^{*}$) of Li ions was obtained by performing a linear fitting of the mean square displacement (MSD) of all diffusing Li ions with time, according to the Einstein relation \cite{vandervenRechargeableAlkaliIonBattery2020}: \begin{equation} D^{*} = \frac{1}{2dNt} \sum_{i=1}^{N}[\Delta r_i(t)]^2 \end{equation} where $d$ is the number of dimensions in which diffusion occurs ($d$=3 for all three electrolytes), $N$ is the total number of diffusing Li ions, and $\Delta r_i(t)$ is the displacement of the $i^{th}$ Li ion at time $t$. The charge diffusivity ($D_{\sigma}$) of Li ions was calculated from the square net displacement of all diffusing Li ions, as described below \cite{vandervenRechargeableAlkaliIonBattery2020}: \begin{equation} D_{\sigma} = \frac{1}{2dNt} [\sum_{i=1}^{N}\Delta r_i(t)]^2 \end{equation} The Haven ratio is then given by the following equation: \begin{equation} H_R = D^{*}/D_{\sigma} \end{equation} Finally, the ionic conductivity $\sigma (T)$ at temperature $T$ is given by the Nernst-Einstein equation \cite{vandervenRechargeableAlkaliIonBattery2020}: \begin{equation} \sigma (T) = \frac{\rho z^2 F^2}{RT}D_{\sigma}(T) \end{equation} where $\rho$ is the molar density of diffusing ions in the unit cell, $z$, $F$ and $R$ are the charge of Li ions ($z=1$), the Faraday constant and the gas constant, respectively. Arrhenius plots were then generated to determine the temperature-dependent activation energies ($E_a$). \section{Results} \subsection{MTP Validation} \begin{table}[htbp] \centering \caption{Mean absolute errors (MAEs) on energies and forces predictions for fitted MTPs. The MAEs were calculated with respect to static energies and forces from the respective DFT functionals.} \makebox[\linewidth]{ \begin{tabular}{clcccc} \hline\hline \multicolumn{1}{c}{\multirow{2}[0]{*}{LSC}} & \multicolumn{1}{c}{\multirow{2}[0]{*}{MTP}} & \multicolumn{2}{c}{MAE$_{\mathrm{energies}}$ (meV/atom)} & \multicolumn{2}{c}{MAE$_{\mathrm{forces}}$ (eV/\AA)} \\\cline{3-6} & & Training & Test & Training & Test \\\hline \multirow{2}[0]{*}{LLTO} & MTP$_{\mathrm{PBE, PBE}}$ & 1.40 & 1.44 & 0.12 & 0.12 \\ & MTP$_{\mathrm{PBE, optB88}}$ & 1.39 & 1.24 & 0.10 & 0.10 \\\hline \multirow{2}[0]{*}{\ce{Li3YCl6}} & MTP$_{\mathrm{PBE, PBE}}$ & 0.96 & 1.11 & 0.04 & 0.04 \\ & MTP$_{\mathrm{PBE, optB88}}$ & 1.00 & 1.06 & 0.04 & 0.04 \\\hline \multirow{3}[0]{*}{\ce{Li7P3S11}} & MTP$_{\mathrm{PBE, PBE}}$ & 1.77 & 1.92 & 0.09 & 0.08 \\ & MTP$_{\mathrm{PBE, optB88}}$ & 1.70 & 1.78 & 0.08 & 0.08 \\ & MTP$_{\mathrm{optB88, optB88}}$ & 1.79 & 2.07 & 0.09 & 0.09 \\\hline\hline \end{tabular}% } \label{Table: MLIAP evaluation on energies & forces}% \end{table}% Table \ref{Table: MLIAP evaluation on energies & forces} compares the mean absolute errors (MAEs) in energies and forces of the fitted MTPs. In all cases, the MAEs in energies are between 0.96 meV/atom and 2.07 meV/atom, while the MAEs in forces are below 0.20 eV/\AA. These MAEs are similar to or lower than those of other MTPs fitted in the literature \cite{zuoPerformanceCostAssessment2020b, wangLithiumIonConduction2020}, and a substantial improvement over traditional IAPs. The training and test MAEs are generally very similar, indicating that there is little likelihood of overfitting. The MAEs in energies and forces are also uniformly distributed with respect to the different temperatures that training structures were extracted from (see Figure S3-S5), indicating consistently high accuracy of our MTPs to reproduce DFT energies and forces at different temperatures. These results are consistent regardless of the DFT functionals (PBE or optB88) used to generate the training data. Further analysis also found that the local environments sampled by nanosecond NPT MD simulations using the fitted MTP are similar with those sampled by the AIMD training data (Figure S8) and the MAEs in forces are consistently low regardless of local environment (Figure S9). It should be noted that while it is possible that MD simulations under more extreme conditions, e.g., above 1200K, may sample local environments that are substantially different from the AIMD training data and possibly result in higher errors, such conditions are unlikely to be of interest for most applications of the fitted MTPs. \subsection{Lattice Parameters} \label{Section: structural relaxation} \begin{table}[htbp] \centering \caption{Lattice parameters and densities of LSCs relaxed with the PBE and optB88 DFT functionals and the trained MTPs at 0K, in comparison with experimental lattice parameters and densities at room temperature for LLTO \cite{haradaLithiumIonConductivity1998}, \ce{Li3YCl6} \cite{asanoSolidHalideElectrolytes2018} and \ce{Li7P3S11} \cite{yamaneCrystalStructureSuperionic2007}. Values in brackets are the percentage differences between the computed values and the experimental measurements.} \makebox[\linewidth]{ \begin{tabular}{ccccc}\hline\hline & a (\AA) & b (\AA) & c (\AA) & Density (g cm$^{-3}$) \\\hline \multicolumn{5}{l}{LLTO} \\ DFT PBE & 3.96 (2.3\%) & 3.89 (0.5\%) & 3.91 (1.0\%) & 4.84 (-3.0\%) \\ DFT optB88 & 3.95 (2.1\%) & 3.88 (0.3\%) & 3.90 (0.8\%) & 4.88 (-2.2\%) \\ MTP$_{\mathrm{PBE, PBE}}$ & 3.96 (2.3\%) & 3.89 (0.5\%) & 3.90 (0.8\%) & 4.85 (-2.8\%)\\ MTP$_{\mathrm{PBE, optB88}}$ & 3.95 (2.1\%) & 3.87 (0.0\%) & 3.89 (0.5\%) & 4.90 (-1.8\%) \\ Experiment & 3.87 & 3.87 & 3.87 & 4.99 \\\hline \multicolumn{5}{l}{\ce{Li3YCl6}} \\ DFT PBE & 11.17 (-0.3\%) & 11.17 (-0.3\%) & 6.22 (3.2\%) & 2.37 (-3.3\%) \\ DFT optB88 & 11.01 (-1.7\%) & 11.01 (-1.7\%) & 6.02 (-0.2\%) & 2.52 (2.9\%) \\ MTP$_{\mathrm{PBE, PBE}}$ & 11.18 (-0.2\%) & 11.18 (-0.2\%) & 6.27 (4.0\%) & 2.35 (-4.1\%)\\ MTP$_{\mathrm{PBE, optB88}}$ & 11.04 (-1.4\%) & 11.04 (-1.4\%) & 6.08 (0.8\%) & 2.48 (1.2\%) \\ Experiment & 11.20 & 11.20 & 6.03 & 2.45 \\\hline \multicolumn{5}{l}{\ce{Li7P3S11}} \\ DFT PBE & 12.86 (2.9\%) & 6.19 (2.7\%) & 12.69 (1.3\%) & 1.87 (-5.6\%)\\ DFT optB88 & 12.61 (0.9\%) & 6.08 (0.8\%) & 12.62 (0.7\%) & 1.95 (-1.5\%)\\ MTP$_{\mathrm{PBE, PBE}}$ & 12.66 (1.3\%) & 6.33 (5.0\%) & 12.56 (0.2\%) & 1.88 (-5.1\%)\\ MTP$_{\mathrm{PBE, optB88}}$ & 12.52 (0.2\%) & 6.14 (1.8\%) & 12.57 (0.3\%) & 1.95 (-1.5\%)\\ MTP$_{\mathrm{optB88, optB88}}$ & 12.52 (0.2\%) & 6.12 (1.5\%) & 12.66 (1.0\%) & 1.96 (-1.0\%)\\ Experiment & 12.50 & 6.03 & 12.53 & 1.98 \\\hline\hline \end{tabular}} \label{Table:structural relaxation} \end{table}% \begin{figure}[htbp] \centering \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.1cm]{Lattice_mtp_LLTO.pdf} \caption{\label{subfig:Lattice_LLTO}LLTO} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.1cm]{Lattice_mtp_Li3YCl6.pdf} \caption{\label{subfig:Lattice_LYC}\ce{Li3YCl6}} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.1cm]{Lattice_mtp_Li7P3S11.pdf} \caption{\label{subfig:Lattice_Li7P3S11}\ce{Li7P3S11}} \end{subfigure} \caption{\label{fig:MTP lattice}Comparison of the lattice parameters predicted via relaxation with the trained MTPs and the DFT-relaxed values. For each MTP, the relaxation was performed using 36 strained structures constructed by applying strains of -0.15 to 0.15 with 0.05 intervals in six different modes to the DFT relaxed ground-state structure to assess the numerical stability of MTP relaxation. } \end{figure} Table~\ref{Table:structural relaxation} compares the lattice parameters and volumes for the three LSCs from DFT and MTP relaxations with experimental values. It can be seen that the use of the optB88 functional significantly improves the predicted lattice parameters and densities over the PBE functional for \ce{Li3YCl6} and \ce{Li7P3S11} LSCs, while yielding smaller improvements for LLTO LSC. The PBE computed densities underestimate the experimental densities by 3-6\%, consistent with the well-known propensity of PBE to underbind. The optB88 computed densities are within 1-3\% of the experimental densities due to the fact that optB88 functional is less repulsive at short interatomic separations \cite{klimesVanWaalsDensity2011}. As shown in Figure \ref{fig:MTP lattice}, the MTPs are generally able to reproduce the DFT lattice parameters to within 1-2.5\%. It should be noted that the errors with respect to DFT follows the order LLTO $<$ \ce{Li3YCl6} $\sim$ \ce{Li7P3S11}. We hypothesize that this can be attributed to the difference in the potential energy landscapes, \textit{i.e.,} \ce{Li3YCl6} and \ce{Li7P3S11} have shallower potential energy landscapes, which leads to smaller energy changes with lattice parameter variations. This can be seen to some degree in the equation of state plots (see later Figure \ref{fig:EOSQHA}), as the same percentage of change in volume leads to less change in the total energies of \ce{Li3YCl6} and \ce{Li7P3S11}. \subsection{Equations of State and Thermal Expansion} \label{Section: EOS} \begin{figure}[H] \centering \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.5cm]{EOS_LLTO.pdf} \caption{\label{subfig:EOS_LLTO}EOS of LLTO} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.5cm]{EOS_LYC.pdf} \caption{\label{subfig:EOS_LYC}EOS of \ce{Li3YCl6}} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.5cm]{EOS_Li7P3S11.pdf} \caption{\label{subfig:EOS_Li7P3S11}EOS of \ce{Li7P3S11}} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.5cm]{QHA_expansion_LLTO.pdf} \caption{\label{subfig:QHA_LLTO}$\beta$ of LLTO} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.5cm]{QHA_expansion_LYC.pdf} \caption{\label{subfig:QHA_LYC}$\beta$ of \ce{Li3YCl6}} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.5cm]{QHA_expansion_Li7P3S11.pdf} \caption{\label{subfig:QHA_Li7P3S11}$\beta$ of \ce{Li7P3S11}} \end{subfigure} \caption{\label{fig:EOSQHA}Equations of state at 0K (a, b, c) and QHA thermal volume expansion $\beta$ (d, e, f) of LLTO, \ce{Li3YCl6} and \ce{Li7P3S11} calculated from DFT and MTPs. The volumes in the $\beta$ plots (d, e, f) are normalized with respect to the experimentally measured volumes at room temperatures \cite{haradaLithiumIonConductivity1998, asanoSolidHalideElectrolytes2018, yamaneCrystalStructureSuperionic2007}.} \end{figure} Figure \ref{fig:EOSQHA}a-c shows the equation of state (EOS) curves of the three LSCs calculated from DFT and MTPs. In general, the MTP computed EOSs agree well with the corresponding DFT EOSs, further attesting to the robustness of the MTP fitting procedure. In addition to the differences in equilibrium volumes discussed in the preceding section, we note that the optB88 DFT and MTP calculations predict a larger curvature for \ce{Li3YCl6} and \ce{Li7P3S11} LSCs, i.e., the optB88 functional predicts a higher bulk modulus than PBE. These results are consistent with the calculated QHA thermal volume expansion, plotted in Figure~\ref{fig:EOSQHA}d-f. The MTP QHA thermal expansion curves match closely with the corresponding DFT QHA thermal expansion curves. In general, the optB88 DFT and MTP volumes are much closer to the experimental volumes for respective temperatures between 0 and 800K. LLTO has the smallest MTP$_{\mathrm{PBE,optB88}}$ volume expansion coefficient ($\beta_{\mathrm{PBE,optB88}}$) of $1.08\times10^{-5}$ K$^{-1}$ from 300K to 800K, in excellent agreement with the reported low thermal expansion coefficient of $9.35\times10^{-6}$ K$^{-1}$ from X-ray diffraction analysis from 298K to 800K \cite{okumuraComputationalSimulationsLi2006}. \ce{Li3YCl6} and \ce{Li7P3S11} have much higher predicted $\beta_{\mathrm{PBE,optB88}}$ of $5.28\times10^{-5}$ K$^{-1}$ and $4.07\times10^{-5}$ K$^{-1}$, respectively. A slightly higher volume expansion is predicted for \ce{Li3YCl6} by optB88 compared to PBE. \subsection{Ionic Conductivity} \label{Section: Arrhenius plot} \begin{figure}[H] \centering \includegraphics[height=6cm]{Arrhenius_plot_ave.pdf} \footnotesize{ \begin{tabular}{ccccc}\hline\hline & AIMD & MTP$_{\mathrm{PBE, PBE}}$ & MTP$_{\mathrm{PBE, optB88}}$ & Experiment \\ \hline \multicolumn{5}{l}{LLTO} \\ \multirow{2}[0]{*}{$E_a (eV)$} & 0.26 & 0.36 (300-475K) & 0.36 (300-450K) & 0.40 (300K) \cite{inagumaHighIonicConductivity1993a} \\ & (900-1800K) \cite{heOriginFastIon2017} & 0.24 (475-800K) & 0.22 (450-800K) & 0.22 (600K) \cite{salkusDeterminationNonArrheniusBehaviour2011} \\ $\sigma_{300K}$ (mS cm$^{-1}$) & - & 0.97 ($\sigma^{*}$) & 1.04 ($\sigma^{*}$), 1.53 ($\sigma$) & 1-1.3 \cite{inagumaHighIonicConductivity1993a,haradaLithiumIonConductivity1998} \\\hline \multicolumn{5}{l}{\ce{Li3YCl6}}\\ \multirow{2}[0]{*}{$E_a (eV)$} & 0.19 & \multirow{2}[0]{*}{0.16 (300-600K)} & 0.49 (300-425K) & \multirow{2}[0]{*}{0.40 (230-360K) \cite{asanoSolidHalideElectrolytes2018}} \\ & (500-900K) \cite{wangLithiumChloridesBromides2019} & & 0.24 (425-800K) & \\ $\sigma_{300 K}$ (mS cm$^{-1}$) & 14 \cite{wangLithiumChloridesBromides2019} & 152.66 ($\sigma^{*}$) & 0.56 ($\sigma^{*}$), 1.64 ($\sigma$) & 0.51 \cite{asanoSolidHalideElectrolytes2018} \\\hline \multicolumn{5}{l}{\ce{Li7P3S11}} \\ \multirow{2}[0]{*}{$E_a (eV)$} & 0.19 & \multirow{2}[0]{*}{0.18 (300-600K)} & 0.38 (300-400K) & 0.29 (298-373K) \cite{buscheSituMonitoringFast2016} \\ & (400-1200K) \cite{chuInsightsPerformanceLimits2016a} & & 0.19 (400-800K) & 0.18 (300-600K) \cite{chuInsightsPerformanceLimits2016a} \\ $\sigma_{300K}$ (mS cm$^{-1}$) & 57 \cite{chuInsightsPerformanceLimits2016a} & 67.37 ($\sigma^{*}$) & 6.50 ($\sigma^{*}$), 7.51 ($\sigma$) & 4-17 \cite{wenzelInterphaseFormationDegradation2016a,buscheSituMonitoringFast2016,chuInsightsPerformanceLimits2016a,seinoSulphideLithiumSuper2014a} \\ \hline\hline \end{tabular} } \caption{\label{fig:Arrhenius}(Top) Arrhenius plot for LLTO, \ce{Li3YCl6} and \ce{Li7P3S11} from NPT/MD simulations using MTP$_{\mathrm{PBE, PBE}}$ (open markers) and MTP$_{\mathrm{PBE, optB88}}$ (solid markers). The diffusivities were obtained by averaging the mean square displacements from five independent MD simulations at each temperature for at least 1 ns. (Bottom) Room temperature ionic conductivities ($\sigma_{300K}$) and activation energies ($E_a$) for LLTO, \ce{Li3YCl6} and \ce{Li7P3S11}, obtained from MD simulations using MTP$_{\mathrm{PBE, PBE}}$ and MTP$_{\mathrm{PBE, optB88}}$. For MTP$_{\mathrm{PBE, optB88}}$, transitions between two quasi-linear Arrhenius regimes were observed for all three LSCs and the $E_a$ for each regime are reported separately. Available AIMD derived values as well as experimental references are also listed.} \end{figure} Figure \ref{fig:Arrhenius} shows the Arrhenius plots for the three LSCs from MD simulations performed using the MTPs and a summary of the derived activation energies ($E_a$) and conductivities at room temperature ($\sigma_{300K}$) in comparison with experiments and previous AIMD simulations. From the MTP$_{\mathrm{PBE, optB88}}$ Arrhenius plots (filled markers and solid lines), it is immediately apparent that all three LSCs do not exhibit a single linear Arrhenius regime, which is the common assumption made when extrapolating high-temperature (HT) AIMD simulations to room temperature. Transitions between a HT quasi-linear regime with lower $E_a$ and a low-temperature (LT) quasi-linear regime with higher $E_a$ occur at $\sim$ 450K, 425K and 400K for LLTO, \ce{Li3YCl6} and \ce{Li7P3S11}, respectively. In all cases, the MTP$_{\mathrm{PBE,optB88}}$ predicted $\sigma_{300K}$ and $E_a$ are in remarkably good agreement with previously reported experimental values for all three LSCs. In particular, while previous HT AIMD simulations predicted an extraordinarily high $\sigma^{*}_{300K}$ of 57 mS cm$^{-1}$ for \ce{Li7P3S11}, the MTP$_{\mathrm{PBE,optB88}}$ predicted $\sigma^{*}_{300K}$ and $\sigma_{300K}$ are only 6.50 and 7.51 mS cm$^{-1}$, much closer to the 4-17 mS cm$^{-1}$ that have been reported experimentally thus far \cite{wenzelInterphaseFormationDegradation2016a,buscheSituMonitoringFast2016,chuInsightsPerformanceLimits2016a,seinoSulphideLithiumSuper2014a}. We further note that the MTP$_{\mathrm{PBE,optB88}}$ HT $E_a$ are also consistent with those obtained from previous HT AIMD simulations for \ce{Li3YCl6} \cite{wangLithiumChloridesBromides2019} and \ce{Li7P3S11} \cite{chuInsightsPerformanceLimits2016a}. The \ce{Li3YCl6} LSC has only been experimentally studied at 230-360K. Our MTP$_{\mathrm{PBE,optB88}}$ MD simulations predict that \ce{Li3YCl6} would undergo a transition to a lower $E_a$ regime at around 425K; a prediction that would need to be verified by further experiments from the community. The Haven ratios ($H_R$) at 300K are 0.68, 0.34 and 0.87 for LLTO, \ce{Li3YCl6} and \ce{Li7P3S11}, respectively. There are no existing reports of the Haven ratios for these LSCs to the authors' knowledge. However, LLTO has been experimentally reported to possess highly correlated motions at room temperature \cite{bohnkeFastLithiumionConducting2008}, consistent with the computed $H_R$ of 0.68. Further, our calculated $H_R$ for \ce{Li7P3S11} also lies in between the AIMD simulated $H_R$ (0.42, 0.53) \cite{marcolongoIonicCorrelationsFailure2017} and NMR measured $H_R$ (in the order of 1) \cite{kuhnTetragonalLi10GeP2S12Li7GePS82013} of \ce{Li10GeP2S12}, another sulfide LSC. We also note that the MTP$_{\mathrm{PBE, optB88}}$ and MTP$_{\mathrm{PBE, PBE}}$ yield fundamentally different results for \ce{Li3YCl6} and \ce{Li7P3S11}. In both cases, the MTP$_{\mathrm{PBE, PBE}}$ do not predict any transitions between quasi-linear Arrhenius regimes in the simulation temperature range of 300-600K. The activation energies $E_a$ and room temperature ionic conductivities $\sigma_{300K}$ are also severely underestimated and overestimated, respectively, compared to experiments, similar to prior AIMD simulations using the PBE functional. The poor performance of the PBE-based MTP and AIMD simulations can be traced to the substantial overestimation of the lattice parameters by the PBE functional, which can lead to lower activation barriers and higher ionic conductivities \cite{ongPhaseStabilityElectrochemical2013, kuhnNewUltrafastSuperionic2014}. It should be noted that we cannot rule out the possibility that the observed transitions between quasi-Arrhenius regimes are an artifact of the DFT functional used in generating the training data, i.e., optB88, but the generally improved agreement between the predicted room-temperature ionic conductivities and experimental values suggest that the transitions are a real phenomenon. It is our hope that future detailed experiments may shed further light on these predictions. \subsection{Transitions in Diffusion Mechanisms} \begin{figure}[htbp] \centering \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=4cm]{Traj_LLTO_500K_ac_332.png} \caption{\label{subfig:traj_LLTO_500K}LLTO at 500K} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=4cm]{Traj_LYC_500K_bc_322.png} \caption{\label{subfig:traj_LYC_500K}\ce{Li3YCl6} at 500K} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=4cm]{Traj_Li7P3S11_500K_ac_322.png} \caption{\label{subfig:traj_Li7P3S11_500K}\ce{Li7P3S11} at 500K} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=4cm]{Traj_LLTO_300K_ac_332.png} \caption{\label{subfig:traj_LLTO_300K}LLTO at 300K} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=4cm]{Traj_LYC_300K_bc_322.png} \caption{\label{subfig:traj_LYC_300K}\ce{Li3YCl6} at 300K} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=4cm]{Traj_Li7P3S11_300K_ac_322.png} \caption{\label{subfig:traj_Li7P3S11_300K}\ce{Li7P3S11} at 300K} \end{subfigure} \caption{Li trajectories (colored as green) from MTP$_{\mathrm{PBE,optB88}}$ MD simulations of the LLTO, \ce{Li3YCl6} and \ce{Li7P3S11} LSCs at room temperature (300K) and above the transition temperatures. For brevity, only the projection in the crystallographic a-c, b-c and a-c planes are shown for LLTO, \ce{Li3YCl6} and \ce{Li7P3S11}, respectively, at each temperature. The projections in the other crystallographic planes are provided in Figure S10-S12.} \label{fig:trajectories} \end{figure} To understand the reason behind observed transitions between quasi-linear Arrhenius regimes, we have extracted the trajectories from the MTP$_{\mathrm{PBE,optB88}}$ MD simulations of the three LSCs at room temperature and above the transition temperature and plotted them in Figure \ref{fig:trajectories} and Figure S10-S12. In all three LSCs, a substantial change in the number and variety of diffusion pathways is observed. For LLTO, Li diffusion at 300K occurs primarily along b and c directions inside the La-poor layer, which agrees well with experimental observations at room temperature \cite{maMesoscopicFrameworkEnables2016}, but additional diffusion pathways between planes are activated above the transition temperature of 450K (Figure \ref{subfig:traj_LLTO_500K}). Similarly, \ce{Li3YCl6} exhibits quasi-1D diffusion at 300K and 3D diffusion above the transition temperature of 425K. For \ce{Li7P3S11}, Li diffusion is already 3D at 300K but occurs along well-defined pathways. Above the transition temperature of 400K, additional pathways are activated. The decrease in activation energies $E_a$ can be directly traced to the increase in the variety and dimensionality of diffusion in the three LSCs. The most significant reduction in $E_a$ ($\sim$ 0.25 eV) is observed for \ce{Li3YCl6}, which transitions from a quasi-1D to 3D conductor at around 425K. \section{Discussion} Briefly, the above results have shown that the discrepancy between computed and experimentally measured ionic conductivities in the literature can be traced to two effects. First, the choice of the DFT functional can lead to substantial errors in the lattice parameters, which can have a large effect on the predicted activation barriers and ionic conductivities. Second, most AIMD simulations of LSCs in the literature were performed at high temperatures in the NVT ensemble to obtain sufficient hop statistics. Not only does this lead to further errors in the lattice parameters, there is also a strong likelihood that these simulations do not capture transitions in quasi-linear Arrhenius regimes occurring at lower temperatures. These issues can be addressed through carefully-trained ML-IAPs. With a generalizable stepwise workflow for the construction of MTPs for LSCs (see Figure \ref{fig:workflow}), we have consistently generated training structures sampling a range of local environments (see Figure S8) and fitted MTPs to study LLTO, \ce{Li3YCl6} and \ce{Li7P3S11} LSCs. Our results suggest that the choice of DFT functional used in generating the initial and snapshot training structures is relatively unimportant, but the choice of the DFT functional used in the energy and force evaluations to generate the training data is critically important. Here, we show that the use of the optB88 vdW functional for static energy and force calculations and the ns-scale ML-IAP MD at lower temperatures significantly improve the agreement in lattice parameters, activation energies and room-temperature ionic conductivities of the LSCs with experiments. These results have broad implications for ML-IAP development strategy. The typical approach in the literature thus far has been to use the same DFT functional in both the generation of training structures as well as energy/force evaluations. Decoupling these two choices allow one to use a relatively cheap computational method such as PBE functional or even other empirical potentials, for the most expensive step of generating training structures, while using a more expensive but accurate computational method, e.g., SCAN or HSE, for the static energy and force evaluations. While the generation of the DFT training data dominates the computational effort in developing the ML-IAP, it should be noted that the ML-IAPs themselves are many orders of magnitude computationally less expensive than DFT calculations, and more importantly, scales linearly with respect to the number of atoms (see Table S3). It is this linear scaling property, while retaining close to DFT accuracy in energies and forces, that enables the simulations of large systems at long time scales in this work. Our results also have significant implications for LSC development. For all three LSCs investigated, a transition between diffusive regimes is observed at relatively low temperatures (400-450K). In most cases, the activation barriers and ionic conductivities that have been experimentally measured correspond to the low-temperature regime. One potential avenue for further enhancing the ionic conductivities of these and other LSCs is to attempt to stabilize the high-temperature, lower activation energy diffusion regimes at room temperature. This may be achieved by quenching from higher temperatures, compositional modifications (e.g., dopants or substitutions), or mechanical modifications (e.g., introducing strain). By developing ML-IAPs using the approach outlined in this work, MD simulations can provide critical guidance on potential pathways for further LSC optimization. \section{Conclusions} To conclude, we have shown that MTPs trained using optB88 energies and forces can successfully reproduce the experimental lattice parameters, activation energies and room temperature ionic conductivities of the LLTO, \ce{Li3YCl6} and \ce{Li7P3S11} LSCs. In all three LSCs, MD simulations using the trained MTP identify a transition between quasi-linear Arrhenius regimes occurring at relatively low temperatures. These results not only highlight the fundamental limitations in using high-temperature, short time scale AIMD simulations to predict room-temperature properties of materials, but also suggest a potential pathway and strategy to predictive LSC design through the use of machine learning interatomic potentials. \section{Acknowledgements} This work was primarily supported by Nissan Motor Co., Ltd., and Nissan North America Inc. under Award Number 20202446. The authors also acknowledge software infrastructure (pymatgen and atomate) supported by the Materials Project, funded by the US Department of Energy, Office of Science, Office of Basic Energy Sciences, Materials Sciences and Engineering Division under contract no. DE-AC02-05-CH11231: Materials Project program KC23MP, and computing resources provided by the National Energy Research Scientific Computing Center (NERSC), the Triton Shared Computing Cluster (TSCC) at the University of California, San Diego, and the Extreme Science and Engineering Discovery Environment (XSEDE) under grant ACI-1548562. \section{Data Availability} The datasets generated and/or analyzed during the current study are available from the corresponding author on reasonable request. \section{Introduction} \begin{itemize} \item Discuss the role of ionic conductivity for solid electrolytes. \item Discuss the gap between room temperature ionic conductivity of Li3YCl6 and Li7P3S11 from experiment and from AIMD. \item Discuss the known non-Arrhenius behavior in LLTO, beta-LPS, and LGPS systems. \item Discuss the limitation of AIMD simulations on ionic diffusion -- high temperature only, due to low speed. \item Discuss the advantages of ML-IAP. Near-DFT accuracy with orders of magnitude faster speed, allowing ML-IAP to study ionic diffusion in grain boundary structure, amorphous structure, and in room temperature range. \item While ML-IAP can bridge the accuracy/speed trade-off, they are only as accurate as the DFT data that they are trained on. As we know, DFT methods can vary wildly in terms of accuracy of lattice parameters and accounting for effects like vdw. And these can have major effects on ionic conductivity. \end{itemize} \section{Material and methods} \begin{itemize} \item Construction of \ce{Li_{0.33}La_{0.56}TiO3}, \ce{Li3YCl6} ,\ce{Li7P3S11} structures. \item DFT and AIMD calculations. \item MTP model training. \item QHA thermal expansion. \item Diffusivity calculations. \end{itemize} \section{Results} \subsection{Structure relaxation with proper exchange functional} \label{Section: structural relaxation} \begin{table}[htbp] \centering \caption{Structural relaxation by DFT with PBE and optB88 exchange functionals and by MTP at 0 K in comparison with experimental results at room temperature for \ce{Li_{0.33}La_{0.56}TiO3}\cite{fourquetStructuralMicrostructuralStudies1996} and \ce{Li7P3S11}\cite{yamaneCrystalStructureSuperionic2007}, and at 150 K for \ce{Li3YCl6}\cite{schlemInsightsLithiumSubstructure2021}. Percentage data shows the discrepancy of DFT \& ML-IAP results from experimental measurements. For ML-IAPs, training structures were all collected from AIMD trajectorial structures by PBE functional. While training energy \& force were generated from static calculation by PBE and optB88 functionals respectively, for $MTP_{PBE+PBE}$ and $MTP_{PBE+optB88}$.} \makebox[\linewidth]{ \begin{tabular}{cccccc} \hline\hline & DFT PBE & DFT optB88 & $MTP_{PBE+PBE}$ & $MTP_{PBE+optB88}$ & Experiment \\\hline \multicolumn{6}{l}{\ce{Li_{0.33}La_{0.56}TiO3}} \\ a (Å) & 3.96(2.1\%) & 3.95(1.9\%) & 3.96(2.2\%) & - & 3.87 \\ b (Å) & 3.89(0.4\%) & 3.88(0.1\%) & 3.89(0.3\%) & - & 3.87 \\ c (Å) & 3.91(0.9\%) & 3.9(0.6\%) & 3.9(0.8\%) & - & 3.87 \\ density ($g/cm^3$) & 4.84(-3.1\%) & 4.88(-2.3\%) & 4.85(-3\%) & - & 4.99 \\\hline \multicolumn{6}{l}{\ce{Li3YCl6}} \\ a (Å) & 6.22(3.5\%) & 6.02(0.2\%) & 6.27(4.4\%) & 6.08(1.3\%) & 6.00 \\ b (Å) & 11.17(0.1\%) & 11.01(-1.3\%) & 11.18(0.2\%) & 11.04(-1.1\%) & 11.16 \\ c (Å) & 11.17(0.1\%) & 11.01(-1.3\%) & 11.18(0.2\%) & 11.04(-1.1\%) & 11.16 \\ density ($g/cm^3$) & 2.37(-4.4\%) & 2.52(1.6\%) & 2.35(-5.3\%) & 2.48(0.1\%) & 2.48 \\ \multicolumn{6}{l}{\ce{Li7P3S11}} \\ a (Å) & 12.87(3\%) & 12.61(0.9\%) & 12.66(1.3\%) & 12.52(0.1\%) & 12.50 \\ b (Å) & 6.17(2.2\%) & 6.08(0.8\%) & 6.38(5.7\%) & 6.14(1.7\%) & 6.03 \\ c (Å) & 12.68(1.2\%) & 12.62(0.7\%) & 12.56(0.3\%) & 12.57(0.3\%) & 12.53 \\ density ($g/cm^3$) & 1.87(-5.3\%) & 1.95(-1.3\%) & 1.88(-5\%) & 1.95(-1.2\%) & 1.98 \\\hline\hline \end{tabular}% } \label{Table:structural relaxation}% \end{table}% \begin{itemize} \item As shown in Table~\ref{Table:structural relaxation}, PBE overestimates the lattice parameter by almost +3\% with respect to the experimental value. In contrast, the optB88-vdW methods results in a small relative deviation (+1-2\%) from the experimental, thus, significantly improves the estimate for density closer to the experiment. For LYC, the optimal values of optB88-vdW derived lattice constants are smaller than the experimental values by 1.3\%. This is likely due to the fact that optB88-vdW functional is less repulsive at short interatomic separations, which corroborates with earlier observation for other solids. (reference: Phys. Rev. B 2011, 83, 19531) \item Table 1 further shows that optB88 functional predicts lattice better compared to PBE functional. The difference between the former and the latter is significant for \ce{Li7P3S11} and \ce{Li3YCl6}, while insignificant for \ce{Li_{0.33}La_{0.56}TiO3}, with exact percentage gap of 4.0\%, 6.1\%, and 0.8\% in density, respectively. \item For ML-IAP training data, PBE functional was used in AIMD to generate snapshots for all three electrolytes. Static calculations were done to the structure snapshots to obtain accurate energy and force. For the static calculations, optB88 functional was used for \ce{Li7P3S11} and \ce{Li3YCl6}, while PBE functional was used for \ce{Li_{0.33}La_{0.56}TiO3}. ML-IAP generated with this method was verified to reproduce energy and force, lattice relaxation, and QHA thermal expansion by DFT with respective functional used for the static calculations, and detailed analysis was provided in section 3.2, 3.3, and 3.4. \end{itemize} \subsection{ML-IAP verification} \subsubsection{Energy and force} \begin{table}[H] \centering \caption{Evaluation of the prediction accuracy on training and testing energy and force for ML-IAP of the three different electrolyte systems. DFT exchange funcionals applied to generate AIMD trajectorial structures and static energy \& force were also given.} \makebox[\linewidth]{ \begin{tabular}{ccccccc} \hline\hline \multicolumn{1}{c}{\multirow{2}[0]{*}{Electrolyte systems}} & \multicolumn{2}{c}{Training data} & \multicolumn{2}{c}{$MAE_{energy}$ (meV/atom)} & \multicolumn{2}{c}{$MAE_{force}$ (eV/Å)}\\\cline{2-7} & \multicolumn{1}{c}{Structure} & \multicolumn{1}{c}{Energy \& Force} & Training & Testing & Training & Testing \\ \hline \ce{Li_{0.33}La_{0.56}TiO3} & PBE & PBE & 1.40 & 1.44 & 0.122 & 0.121 \\\hline{} \multirow{2}[0]{*}{\ce{Li3YCl6}} & PBE & PBE & 0.96 & 1.11 & 0.043 & 0.042 \\ & PBE & optB88 & 1.00 & 1.06 & 0.042 & 0.041 \\\hline{} \multirow{2}[0]{*}{\ce{Li7P3S11}} & PBE & PBE & 1.77 & 1.92 & 0.085 & 0.085 \\ & PBE & optB88 & 1.70 & 1.78 & 0.084 & 0.083 \\\hline\hline \end{tabular}% } \label{Table: MLIAP evaluation on energy & force}% \end{table}% \begin{itemize} \item For all the 5 as-trained ML-IAPs, MAE in training and testing energy were lower than 2 meV/atom, while MAE in training and testing force were below 150 meV/Å. These MAE values of energy and force were low compared with literature results. Also, the discrepancies between training and testing MAE were generally small, indicating low possibilities of overfitting. \item It was worth noting that 3 of the ML-IAPs were trained by static energy \& force and AIMD trajectorial structures both generated with PBE functional, while the other 2 were trained by AMID trajectorial structures generated with PBE functional and static energy \& force obtained with optB88 functional. The low MAE values in all 5 cases indicated the capability of ML-IAP to learn and reproduce static energy \& force of both PBE and optB88 functionals, no matter which functional was applied to generate the AIMD trajectorial structures. Therefore, to fit a ML-IAP to surrogate DFT with specific functional, training energy \& force should be obtained by DFT static calculation with the target functional, while training structures can be obtained from AIMD with typical PBE functional. This rule was also proved by the structural relaxation, equation of states, and QHA thermal expansion studies in Section \ref{Section: structural relaxation}, \ref{Section: EOS}, and \ref{Section: QHA}. \end{itemize} \subsubsection{Equation of States} \label{Section: EOS} \begin{figure}[H] \label{Figure: EOS} \centering \begin{subfigure}[b]{0.3\textwidth} \centering \graphicspath{ {./figures/} } \includesvg[height=3.5cm]{EOS_LLTO.svg} \caption{\label{subfig:EOS_LLTO}\ce{Li_{0.33}La_{0.56}TiO3}} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \graphicspath{ {./figures/} } \includesvg[height=3.5cm]{EOS_LYC.svg} \caption{\label{subfig:EOS_LYC}\ce{Li3YCl6}} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \graphicspath{ {./figures/} } \includesvg[height=3.5cm]{EOS_Li7P3S11.svg} \caption{\label{subfig:EOS_Li7P3S11}\ce{Li7P3S11}} \end{subfigure} \caption{Equation of states at 0 K of \ce{Li_{0.33}La_{0.56}TiO3}, \ce{Li3YCl6}, and \ce{Li7P3S11} studied by DFT and ML-IAPs. Volumes were ranged from 80 \% to 120 \% of the averaged volumes of relaxed cells from DFT with PBE and optB88 functionals with 5 \% intervals. Results from DFT with PBE and optB88 functionals were colored as blue and orange, respectively. Results from ML-IAPs trained with static energy \& force from PBE and optB88 functionals were colored as green and red. The training structures were all obtained from AIMD with PBE functional, respectively.} \end{figure} \begin{itemize} \item Fig. \ref{subfig:EOS_LLTO} showed little difference in equation of states of \ce{Li_{0.33}La_{0.56}TiO3} studied by PBE and optB88 functionals. Their equilibrium volume as well as energy change vs. volume were matching very well. These observations were in good agreement with the structural relaxation results. In Section \ref{Section: structural relaxation}, Table \ref{Table:structural relaxation} showed that the difference between the equilibrium densities at 0 K from the two functionals was 0.8 \%, which is nearly unnoticeable compared to the 5 \% volume intervals in Fig. \ref{subfig:EOS_LLTO}. \item Fig. \ref{subfig:EOS_LYC} and \ref{subfig:EOS_Li7P3S11} showed clear discrepancies between the equation of states studied by DFT PBE and optB88 functionals, in both \ce{Li3YCl6} and \ce{Li7P3S11} solid electrolytes. The discrepancies between equilibrium volumes were around one volume interval, namely 5 \% of the averaged volumes of DFT relaxed cells the two functionals. And these large discrepancies in volume with respect to the same relative energy became even larger with lattice expansion and compression. Again, the results in equation of states for those two systems agreed well with structural relaxation in Section \ref{Section: structural relaxation}. For both \ce{Li3YCl6} and \ce{Li7P3S11} solid electrolytes, gaps of around 5 \% were observed in the equilibrium densities from PBE and optB88 functionals. \item In all three electrolyte systems, ML-IAPs perfectly reproduced the equation of states results from the same DFT functionals as functionals used to generate static energy \& force training data. \end{itemize} \subsubsection{QHA thermal expansion} \label{Section: QHA} \begin{figure}[H] \label{Figure: QHA} \centering \begin{subfigure}[b]{0.3\textwidth} \centering \graphicspath{ {./figures/} } \includesvg[height=3.5cm]{QHA_expansion_LLTO.svg} \caption{\label{subfig:QHA_LLTO}\ce{Li_{0.33}La_{0.56}TiO3}} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \graphicspath{ {./figures/} } \includesvg[height=3.5cm]{QHA_expansion_LYC.svg} \caption{\label{subfig:QHA_LYC}\ce{Li3YCl6}} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \graphicspath{ {./figures/} } \includesvg[height=3.5cm]{QHA_expansion_Li7P3S11.svg} \caption{\label{subfig:QHA_Li7P3S11}\ce{Li7P3S11}} \end{subfigure} \caption{QHA thermal expansion of \ce{Li_{0.33}La_{0.56}TiO3}, \ce{Li3YCl6}, and \ce{Li7P3S11} from 0 to 1000 K studied by DFT and ML-IAPs. For each system, volumes were normalized with respect to the equilibrium volume at 0 K obtained from DFT optB88 functional and QHA. Results from DFT with PBE and optB88 functionals were colored as blue and orange, respectively. Results from ML-IAPs trained with static energy \& force from PBE and optB88 functionals were colored as green and red, respectively. } \end{figure} \begin{itemize} \item As shown in Fig. \ref{subfig:QHA_LLTO}, the normalized volumes of \ce{Li_{0.33}La_{0.56}TiO3} from DFT optB88 and DFT PBE were very close to each other in the full temperature range, with discrepancy less than 1\%. DFT and MTP results both showed that the QHA thermal expansion of \ce{Li_{0.33}La_{0.56}TiO3} was insignificant, with an overall increase below 1\% from 0 K to 1000 K. This result was in excellent agreement with the reported low thermal expansion coefficient as $9.35\times10^{-6} K^{-1}$ by X-ray diffraction analysis of La0.56Li0.33TiO3 from 298 to 800 K, indicating volume expansion within 0.5 \% from 298 to 800 K. \item In both Fig. \ref{subfig:QHA_LYC} and \ref{subfig:QHA_Li7P3S11}, constant discrepancies around 5\% in normalized volumes were observed between DFT PBE and DFT optB88 results throughout the full temperature range from 0 to 1000 K. Along with structural relaxation and equation of states studies at 0 K in Section \ref{Section: structural relaxation} and \ref{Section: EOS}, these QHA thermal expansion results further strengthened the importance of optB88 functional for accurate volumetric simulations of \ce{Li3YCl6} and \ce{Li7P3S11} systems. \item All 5 ML-IAPs showed generally great agreement in normalized volumes from 0 to 1000 K with DFT results by the same functional applied to generate their training energy and force. Considering different effects of optB88 functional to the three systems, which has already been fully discussed in the above sections, ML-IAP trained with energy \& force generated by optB88 functional were selected to further study the Li-ion diffusion inside \ce{Li3YCl6} and \ce{Li7P3S11} systems, while ML-IAP trained with energy \& force obtained from PBE functional was applied to study the non-Arrhenius behaviour of \ce{Li_{0.33}La_{0.56}TiO3} solid electrolyte. \end{itemize} \subsection{Ionic conductivity} \graphicspath{ {./figures/} } \begin{figure}[H] \includesvg[width=8cm, height=8cm]{Arrhenius_log_sigma.svg} \centering \caption{Arrhenius plot of \ce{Li_{0.33}La_{0.56}TiO3}, \ce{Li3YCl6}, and \ce{Li7P3S11} from 300 K to 800 K, colored as red, green, and blue.} \label{Figure: Arrhenius_log_sigma} \end{figure} \begin{table}[htbp] \centering \caption{Ionic conductivities and activation energies of Li-ion diffusion in \ce{Li_{0.33}La_{0.56}TiO3}, \ce{Li3YCl6}, and \ce{Li7P3S11} studied by MTP, experiments, and AIMD. Temperature ranges and points with respect to activation energies were provided.} \makebox[\linewidth]{ \begin{tabular}{cclc} \hline\hline & MTP & \multicolumn{1}{c}{Experiment} & AIMD \\\hline \multicolumn{4}{l}{\ce{Li_{0.33}La_{0.56}TiO3}} \\ \multirow{2}[0]{*}{$E_{activation}$ (eV)} & 0.36 (300 - 475 K) & \multicolumn{1}{c}{0.40 (300 K)\cite{inagumaHighIonicConductivity1993a}, 0.30 (300 K)\cite{salkusDeterminationNonArrheniusBehaviour2011}} & - \\ & 0.24 (475 - 800 K) & \multicolumn{1}{c}{0.15 (500 K)\cite{inagumaHighIonicConductivity1993a}, 0.22 (600 K)\cite{salkusDeterminationNonArrheniusBehaviour2011}} & - \\ $\sigma_{300 K}$ (mS/cm) & 0.97 & \multicolumn{1}{c}{1\cite{inagumaHighIonicConductivity1993a}} & - \\\hline \multicolumn{4}{l}{\ce{Li3YCl6}} \\ \multirow{2}[0]{*}{$E_{activation}$ (eV)} & 0.53 (300 - 400 K) & \multicolumn{1}{c}{\multirow{2}[0]{*}{0.40 (230 - 360 K)\cite{asanoSolidHalideElectrolytes2018}}} & \multirow{2}[0]{*}{0.19 (500 - 900 K)\cite{wangLithiumChloridesBromides2019}} \\ & 0.26 (400 - 800 K) & & \\ $\sigma_{300 K}$ (mS/cm) & 0.46 & \multicolumn{1}{c}{0.5\cite{asanoSolidHalideElectrolytes2018}} & 14\cite{wangLithiumChloridesBromides2019} \\\hline \multicolumn{4}{l}{\ce{Li7P3S11}} \\ \multirow{2}[0]{*}{$E_{activation}$ (eV)} & 0.29 (300 - 525 K) & \multicolumn{1}{c}{0.29 (298 - 373 K)\cite{buscheSituMonitoringFast2016}} & \multirow{2}[0]{*}{0.19 (400 - 1200 K)\cite{chuInsightsPerformanceLimits2016a}} \\ & 0.18 (525 - 800 K) & \multicolumn{1}{c}{0.18 (300 - 600 K)\cite{chuInsightsPerformanceLimits2016a}} & \\ $\sigma_{300 K}$ (mS/cm) & 9.00 & \multicolumn{1}{c}{4\cite{wenzelInterphaseFormationDegradation2016a}, 8.6\cite{buscheSituMonitoringFast2016}, 11.6\cite{chuInsightsPerformanceLimits2016a}, 17\cite{seinoSulphideLithiumSuper2014a}} & 53\cite{chuInsightsPerformanceLimits2016a} \\ \hline\hline \end{tabular}% } \label{Table: Ionic conductivity and activation energy}% \end{table}% \begin{itemize} \item The ionic conductivity of \ce{Li_{0.33}La_{0.56}TiO3} predicted by MTP at 300 K was 0.97 mS/cm, which is matching perfectly with the extrapolated value of 0.98 mS/cm in Fig. \ref{Figure: Arrhenius_log_sigma}. Both of them are in remarkable agreement with the experimentally measured room temperature ionic conductivity of 1 mS/cm.\cite{inagumaHighIonicConductivity1993a} According to the author's knowledge, this was the first time for a theoretical simulation to successfully predict the room temperature ionic conductivity of \ce{Li_{0.33}La_{0.56}TiO3}, resulting from ML-IAP's capability to study ionic diffusion in room temperature regime. \item Fig. \ref{Figure: Arrhenius_log_sigma} clearly showed non-Arrhenius behavior of \ce{Li_{0.33}La_{0.56}TiO3}, with a transition in slope around 450 to 500 K, which was in excellent agreement with experimentally observed transition temperature regime from 450 to 550 K.\cite{salkusDeterminationNonArrheniusBehaviour2011} For temperature from 475 to 800 K, the activation energy was calculated to be 0.24 eV, matching greatly with the reported activation barrier of 0.22 eV at around 600 K from impedance spectroscopy measurements for \ce{Li_{0.33}La_{0.56}TiO3}.\cite{bohnkeFastLithiumionConducting2008} For temperature from 300 to 475 K, the activation energy was calculated to be 0.36 eV. This value was also inside the range of experimentally examined room temperature activation barriers for \ce{Li_{0.33}La_{0.56}TiO3}, from 0.30 eV\cite{bohnkeFastLithiumionConducting2008} to 0.40 eV\cite{inagumaHighIonicConductivity1993a}. \item The ionic conductivity of \ce{Li3YCl6} predicted by MTP at 300 K was 0.46 mS/cm, which is matching perfectly with the extrapolated value of 0.44 mS/cm in Fig. \ref{Figure: Arrhenius_log_sigma}. Both of them are in excellent agreement with the experimentally measured room temperature ionic conductivity of 0.50 mS/cm. Non-Arrhenius behavior was also observed inside \ce{Li3YCl6}, with a sharp change in activation energy at temperature of 400 K. For temperature from 300 K to 400 K, the activation energy was calculated to be 0.53 eV. This value was 0.13 eV larger than the experimentally examined room temperature activation barriers of 0.40 eV. This discrepancy was possibly resulted from the different temperature range for the estimation of activation energy from experiment, which was done from 230 K to 360 K. Though MTP MD was orders of magnitude faster than AIMD, ionic diffusion below room temperature was still a too slow process to simulate, leaving the above explanation as a hypothesis. For temperature from 400 K to 700 K, the activation energy was calculated to be 0.26 eV. This value is interestingly matching with the activation energy of 0.19 eV reported by existing AIMD simulations. This matching could be foreseen, as AIMD simulations were done only in temperature higher than 400K, above the transition point. As the AIMD simulations were done with PBE functional, the overestimation of volume by PBE functional to \ce{Li3YCl6} resulted in the 0.07 eV lower activation energy from AIMD at above 400 K, compared with MTP MD results at above 400 K. \item The ionic conductivity of \ce{Li7P3S11} predicted by MTP at 300 K was 9.00 mS/cm, which was again matching perfectly with the extrapolated value of 8.48 mS/cm in Fig. \ref{Figure: Arrhenius_log_sigma}. Both of them are in the order of 10 mS/cm, matching with the widely reported room temperature ionic conductivity of 4 mS/cm, 8.6 mS/cm, 11.6 mS/cm, and 17 mS/cm by impedance spectroscopy measurements. In Fig. \ref{Figure: Arrhenius_log_sigma}, a slight transition in slope was observed at around 500 to 550 K. For temperature from 300 to 525 K and from 525 to 800 K, the activation energy was calculated to be 0.29 and 0.18 eV, respectively. On the other hand, the room temperature activation energies reported from experiments varied in the range from 0.18 eV to 0.29 eV. It was suspected by the author that this wide range of reported activation energies was resulted from the non-Arrhenius behavior of \ce{Li7P3S11} and different temperature regimes the experiments were conducted. As listed in Table \ref{Table: Ionic conductivity and activation energy}, the experimentally measure activation energies of 0.18 and 0.29 eV were measured from 300 to 600 K and from 298 to 373 K, respectively. Another hypothesis was that the discrepancy between activation energies were from the structural differences of \ce{Li7P3S11} synthesized under different conditions, so that a low activation energy of 0.18 eV could be achieved by maintaining the meta-stable structure at higher temperature. More structural characterization with careful temperature control on \ce{Li7P3S11} with activation barrier as low as 0.18 eV are required to further understand this discrepancy in experiment. \end{itemize} \section{Discussion} \begin{itemize} \item Non-Arrhenius behaviors were clearly observed in all the three electrolyte systems. Though the transition points were intrinsically different, ranging from 400 K to 600 K, there was a common trend that the activation energies below transition temperatures were higher than above transition temperatures. The simulated non-Arrhenius behaviors in \ce{Li3YCl6} and \ce{Li7P3S11} requires further experimental verification. \item In those systems, extrapolation from high temperature regimes to 300 K with an assumption of temperature independent activation energy would lead to large overestimation for ionic conductivities at 300 K. This explains the reason why AIMD simulations overestimated a few times or even one order of magnitude higher the room temperature ionic conductivities of \ce{Li3YCl6} and \ce{Li7P3S11}. \item With ML-IAP's accuracy and speed, the accurate simulation of ionic diffusion inside superionic conductors can be extended from high temperature to 300 K. This enables theoretical prediction to overcome the non-Arrhenius behavior and directly study the ionic diffusion at 300 K, making simulation results on ionic conductivity more reliable. \item To further understand and improve the ionic conductivities of solid electrolytes, the transition in activation energy through temperature has to be further characterised. \end{itemize} \section{Conclusions} \begin{itemize} \item Discrepancy of AIMD and expt is often driven by the Non-Arrhenius behaviour and inaccurate estimate for volume. Developing an accurate MTP potential leads to the prediction of Non-Arrhenious diffusion behaviour and estimation for RT conductivity. Choice of exchange correlation function and inclusion of dispersion correction rectifies the volume error and results in accurate prediction of conductivity. \item PBE functional and optB88 functional was compared by their performance on lattice relaxation of the three solid electrolytes. Compared to optB88 functional, PBE functional overestimated the volume of \ce{Li3YCl6} and \ce{Li7P3S11}, while their difference in \ce{Li_{0.33}La_{0.56}TiO3} was insignificant. \item ML-IAP were successfully trained for the three electrolyte systems and were verified to excellently reproduce DFT results on energy, force, structural relaxation, and QHA thermal expansion. \item The as-trained ML-IAP successfully simulated the room temperature ionic conductivities of all the respective electrolyte system, with excellent agreement with experimental measurements on ionic conductivities and activation energies. \end{itemize} \section{Acknowledgements} \section*{References} \section{Introduction} Lithium superionic conductors (LSCs) are the critical enabling solid electrolyte (SE) component in next-generation all-solid-state rechargeable lithium-ion batteries \cite{tarasconIssuesChallengesFacing2001a, armandBuildingBetterBatteries2008, xuElectrolytesInterphasesLiIon2014, wangDesignPrinciplesSolidstate2015}. Replacing the traditional flammable organic solvent electrolyte, ceramic LSCs exhibit superior safety and are also a potential pathway to higher energy density cell architectures and utilization of lithium metal anodes. As the name implies, a key property of LSCs is a high ionic conductivity, typically ranging from O(10$^{-1}$) mS cm$^{-1}$ to O(10) mS cm$^{-1}$ (rivaling that of liquid electrolytes) at room temperature. The anion chemistry of an LSC has a major influence on their properties. Sulfide LSCs, such as the \ce{Li10GeP2S12} (LGPS) family \cite{kamayaLithiumSuperionicConductor2011b, bronLi10SnP2013, whiteleyEmpoweringLithiumMetal2014, katoHighpowerAllsolidstateBatteries2016a}, \ce{Li7P3S11} \cite{yamaneCrystalStructureSuperionic2007, seinoSulphideLithiumSuper2014a, wenzelInterphaseFormationDegradation2016a, buscheSituMonitoringFast2016, chuInsightsPerformanceLimits2016a} and \ce{Li3PS4} \cite{tachezIonicConductivityPhase1984, liuAnomalousHighIonic2013a, yamadaAllSolidStateLithium2015}, tend to have very high ionic conductivities due to the large, polarizable \ce{S^{2-}}, but suffer from narrow electrochemical stability windows, air- and moisture-sensitivity. Oxide LSCs, such as the \ce{Li7La3Zr2O12} garnet family \cite{muruganFastLithiumIon2007a} and LISICONs \cite{huIonicConductivityLithium1977, kuwanoNewLiIon1980, bruceIonicConductivityLISICON1982}, typically have lower ionic conductivities compared to the sulfides, but are much more electrochemically and chemically stable. Recently, a promising new class of halide LSCs, \ce{Li3YCl6} and \ce{Li3YBr6}, has been discovered that exhibits a good compromise of ionic conductivities (0.51 mS cm$^{-1}$ for \ce{Li3YCl6} and 1.7 mS cm$^{-1}$ for \ce{Li3YBr6}) and electrochemical stabilities between those of the sulfides and oxides \cite{asanoSolidHalideElectrolytes2018}. Molecular dynamics (MD) simulations have been extensively used in the study of ion conduction in LSCs. In particular, \textit{ab initio} MD (AIMD), i.e., simulations where the energies and forces are directly obtained by solving the Schr\"{o}dinger equation via density functional theory (DFT), have emerged as a powerful tool in recent years as they can be transferably and broadly applied to the entire range of LSC chemistries \cite{moFirstPrinciplesStudy2012a, ongPhaseStabilityElectrochemical2013, miaraEffectRbTa2013, dengRationalCompositionOptimization2015, chuInsightsPerformanceLimits2016a, heOriginFastIon2017, zhuLiPSLi2017, dengDataDrivenFirstPrinciplesMethods2017, wangLithiumChloridesBromides2019}. However, the high cost of AIMD simulations means that they are usually performed at elevated temperatures to obtain sufficient diffusion statistics, sometimes far in excess of the melting points of some LSCs, and for relatively short simulation time frames ($\sim$ 100 ps). As a consequence, extrapolated room-temperature ionic conductivity and diffusivity have large error bars \cite{heStatisticalVariancesDiffusional2018}. Further, there may be phase transitions or transitions in diffusion mechanisms occurring between room temperature and simulated high temperatures, invalidating the Arrhenius assumption used in extrapolation. Such non-Arrhenius behavior and phase transitions have been reported in many LSCs, including \ce{Li_{3x}La_{2/3-x}TiO_3} \cite{inagumaHighIonicConductivity1993a, salkusDeterminationNonArrheniusBehaviour2011}, \ce{Li3PS4} \cite{tachezIonicConductivityPhase1984}, and LGPS \cite{kwonSynthesisStructureConduction2015}. Another source of error arises from the fact that most AIMD simulations of LSCs are performed in the NVT ensemble using the equilibrium volume from a 0K density functional theory (DFT) relaxation calculation. The most common DFT functional used is the Perdew-Burke-Ernzerhof (PBE) generalized gradient approximation (GGA) \cite{perdewGeneralizedGradientApproximation1996a}, which tends to overestimate the lattice parameters of solids and differ from experimental values by up to 2-3\% \cite{heydEnergyBandGaps2005,klimesVanWaalsDensity2011}. These differences in lattice parameters can have a major effect on ion diffusion and activation barriers \cite{ongPhaseStabilityElectrochemical2013, moradabadiEffectLatticeDopant2020}. The net result of the mismatch in working temperatures and lattice parameters between simulations and experiments is that room-temperature ionic diffusivity and conductivity of LSCs computed from AIMD simulations often disagree substantially with those measured experimentally, e.g., via electrochemical impedance spectroscopy (EIS). For example, Chu et al. \cite{chuInsightsPerformanceLimits2016a} previously predicted a room-temperature ionic conductivity of 57 mS cm$^{-1}$ for the \ce{Li7P3S11} LSC using AIMD simulations, far in excess of the highest experimentally measured room-temperature ionic conductivity of 17 mS cm$^{-1}$ \cite{seinoSulphideLithiumSuper2014a}. Similarly, Wang et al. \cite{wangLithiumChloridesBromides2019} predicted an ionic conductivity of 14 mS cm$^{-1}$ for the \ce{Li3YCl6} LSC, again far in excess of the experimentally reported 0.51 mS cm$^{-1}$ \cite{asanoSolidHalideElectrolytes2018}. Classical MD simulations using an interatomic potential (IAP) to parameterize the potential energy surface (PES) are a potential solution to enable low-temperature and long-timescale studies. In recent years, machine learning (ML) the PES as a function of local environment descriptors has emerged as an especially promising, and reproducible approach to develop IAPs with near-DFT accuracy in energies and forces \cite{behlerGeneralizedNeuralNetworkRepresentation2007a, bartokGaussianApproximationPotentials2010, thompsonSpectralNeighborAnalysis2015, shapeevMomentTensorPotentials2016a, wangDeePMDkitDeepLearning2018, chenAccurateForceField2017, liStudyLiAtom2017a, liQuantumaccurateSpectralNeighbor2018, dengElectrostaticSpectralNeighbor2019a, liComplexStrengtheningMechanisms2020a, zuoPerformanceCostAssessment2020b, wangLithiumIonConduction2020, huangDeepPotentialGeneration2021}. However, most ML-IAPs that have been developed in the literature still rely on DFT calculations performed using the PBE functional; as such, their performance are still limited by the accuracy of the DFT training data. In this work, we show that the gap between experimental and simulated ionic conductivities in LSCs can be bridged by developing ML-IAPs under the moment tensor potential (MTP) formalism \cite{shapeevMomentTensorPotentials2016a, gubaevAcceleratingHighthroughputSearches2019} using training data from the optB88 van der Waals (vdW) DFT functional \cite{klimesChemicalAccuracyVan2010, klimesVanWaalsDensity2011}. Three LSCs, \ce{Li_{0.33}La_{0.56}TiO3} (LLTO), \ce{Li3YCl6} and \ce{Li7P3S11} spanning a diversity of anion chemistries have been selected as the model systems for investigation, as shown in Figure \ref{fig:lsc}. These LSCs have been selected because of their major interest to the battery research community, as well as the fact that previous AIMD calculations have either yielded large disagreements with experimentally reported room temperature conductivity or else have not been performed as in the case of LLTO. We demonstrate that in all three cases, the discrepancy between computed and measured conductivities can be explained by a transition between quasi-linear Arrhenius regimes arising from the activation of additional diffusion pathways. \begin{figure} \centering \begin{subfigure}[b]{0.49\textwidth} \centering \graphicspath{ {./} } \includegraphics[height=3.5cm]{unitcell_LLTO.png} \caption{\label{subfig:unitcell_LLTO}\ce{Li_{0.33}La_{0.56}TiO3}} \end{subfigure} \begin{subfigure}[b]{0.49\textwidth} \centering \graphicspath{ {./} } \includegraphics[height=4cm]{unitcell_Li3YCl6.png} \caption{\label{subfig:unitcell_LYC}\ce{Li3YCl6}} \end{subfigure} \begin{subfigure}[b]{0.49\textwidth} \centering \graphicspath{ {./} } \includegraphics[height=4cm]{unitcell_Li7P3S11.png} \caption{\label{subfig:unitcell_Li7P3S11}\ce{Li7P3S11}} \end{subfigure} \begin{subfigure}[b]{0.4\textwidth} \centering \graphicspath{ {./} } \includegraphics[height=4cm]{atom_polyhedra_symbols} \end{subfigure} \caption{Crystal structures of (a) \ce{Li_{0.33}La_{0.56}TiO3} (Space group $Pm\bar{3}m$, No. 221), (b) \ce{Li3YCl6} (Space group $P\bar{3}m1$, No. 164), and (c) \ce{Li7P3S11}(Space group $P\bar{1}$, No. 2).} \label{fig:lsc} \end{figure} \section{Material and Methods} \begin{figure} \centering \includegraphics[height=4cm]{MTP_workflow_graffle.pdf} \caption{Flowchart of the stepwise construction of MTPs for LSCs. DFT functionals utilized in each step and the names of the as-trained MTPs were listed.} \label{fig:workflow} \end{figure} Figure \ref{fig:workflow} summarizes the overall workflow for the construction of MTPs for the LSCs investigated in this work as well as the DFT functional choices investigated. \subsection{Structure Construction} \label{Section: construction of supercell} Supercells of LLTO, \ce{Li3YCl6} and \ce{Li7P3S11} with lattice parameters greater than 10 \AA~were constructed to minimize interactions between periodic images. For LLTO, a $3\times3\times1$ supercell of \ce{Li_{0.33}La_{0.56}TiO3}, equivalent to $x = 0.11$ in the general formula of \ce{Li_{3x}La_{2/3-x}TiO_3} \cite{inagumaHighIonicConductivity1993a, haradaLithiumIonConductivity1998, haradaOrderDisorderAsite1999}, was initially generated to enumerate symmetrically distinct orderings of Li/La/Vacancy on the perovskite A site. These orderings were fully relaxed by DFT. The lowest energy ordering was then stacked along the $c$ direction to obtain a $3\times3\times3$ supercell. During relaxation, shifts of the lithium ion position from the A-sites of perovskite were observed (see Figure S1), which is consistent with previous theoretical studies on LLTO \cite{qianLithiumLanthanumTitanium2012,chengIntegratedApproachStructural2014,romeroExperimentalTheoreticalRaman2016}. \ce{Li3YCl6} has previously been identified to be an isomorph of \ce{Li3ErCl6} (ICSD No. 50151, space group $P\bar{3}m1$, No. 164) \cite{asanoSolidHalideElectrolytes2018}. Starting from the experimentally reported disordered \ce{Li3YCl6} structure, the site occupancies were rounded to the nearest rational numbers based on a total of 3 formula units per unit cell (see Table S1) and enumeration of distinct orderings was performed. The lowest energy relaxed structure was then selected to construct a $1\times1\times2$ supercell. A $1\times2\times1$ supercell of \ce{Li7P3S11} was constructed from the experimentally refined crystal structure \cite{yamaneCrystalStructureSuperionic2007}. The formation energies ($E_f$) and energy above the convex hull ($E_{hull}$) for all three LSCs calculated with the PBE and optB88 functionals are given in Table S2. All three LSCs are predicted to have $E_{hull} <$ 0.05 eV/atom. The optB88 $E_f$ are 5-10\% lower than the PBE values, which is consistent with the $\sim$5\% higher atomization energies predicted by optB88 for ionic solids \cite{klimesVanWaalsDensity2011}. \subsection{DFT Calculations and AIMD Simulations} All DFT calculations were performed using the Vienna \textit{ab initio} simulation package (VASP) with the projector augmented-wave (PAW) approach \cite{blochlProjectorAugmentedwaveMethod1994a, kresseEfficientIterativeSchemes1996a}. For initial structural relaxations (Step 1 in Figure \ref{fig:workflow}), spin-polarized calculations were performed with an energy cutoff of 520 eV and a k-point density of at least $64/\text{\AA}^{-3}$, similar to those used in the Materials Project (MP) \cite{jainCommentaryMaterialsProject2013a}. In Step 2, non-spin polarized \textit{ab initio} molecular dynamics (AIMD) simulations using NVT ensemble were carried out on the relaxed supercells with a plane-wave energy cutoff of 280 eV and a minimal $\Gamma$-centered $1\times1\times1$ k-mesh. A time step of 2 fs and the Nose–Hoover thermostat \cite{noseUnifiedFormulationConstant1984, hooverCanonicalDynamicsEquilibrium1985} were used. A similar protocol was followed as previous works \cite{liQuantumaccurateSpectralNeighbor2018, dengElectrostaticSpectralNeighbor2019a, zuoPerformanceCostAssessment2020b}, wherein simulations were performed at three strains (0, $\pm$ 0.05) and four temperatures (300K to 1200K with 300K intervals) to diversify the training structures. The initial structures were heated from 0K to the target temperatures with a temperature gradient of 0.25 K/fs and equilibrated for at least 30 ps. Snapshots were then extracted from a production run of 15 ps at 0.1 ps intervals, i.e., 150 structures for each temperature and strain. Hence, for each LSC, a total of 1800 training structures ($150\times4\text{ temperatures}\times3\text{ strains}$) were generated. In Step 3, static self-consistent calculations were performed on the training structures to obtain accurate energies \& forces for MTP training. These calculations were performed with a higher k-point density of at least $100/\text{\AA}^{-3}$, an energy cutoff of 520 eV and an electronic relaxation convergence condition of $5\times10^{-5}$ eV/atom, which were consistent with those used in MP \cite{jainCommentaryMaterialsProject2013a}. A main goal of this work is to evaluate the choice of the DFT functional on the training data and hence, the performance of the MTP generated. The initial structural relaxations and energy evaluations of symmetrically distinct LLTO and \ce{Li3YCl6} orderings were performed using the PBE \cite{perdewGeneralizedGradientApproximation1996a} functional. Subsequent structural relaxations, AIMD simulations and static energy valuations were performed using either the PBE functional or optB88 vdW functional \cite{klimesChemicalAccuracyVan2010, klimesVanWaalsDensity2011}, as shown in Figure \ref{fig:workflow}. All DFT and AIMD simulations were carried out using fully-automated workflows \cite{dengDataDrivenFirstPrinciplesMethods2017} built on the Python Materials Genomics (pymatgen) \cite{ongPythonMaterialsGenomics2013a} library and FireWorks scientific workflow package \cite{jainFireWorksDynamicWorkflow2015a}. \subsection{MTP Model Training and Verification} \label{section: ML-IAP training and labeling} The moment tensor potential (MTP) formalism has been extensively discussed in earlier works \cite{shapeevMomentTensorPotentials2016a, gubaevAcceleratingHighthroughputSearches2019, zuoPerformanceCostAssessment2020b} and successfully applied to many chemical systems, including metals \cite{shapeevMomentTensorPotentials2016a, novoselovMomentTensorPotentials2019, zuoPerformanceCostAssessment2020b}, boron \cite{podryabinkinAcceleratingCrystalStructure2019}, alloys \cite{gubaevAcceleratingHighthroughputSearches2019}, gas-phase reactions \cite{novikovAutomatedCalculationThermal2018} and cathode coating materials \cite{wangLithiumIonConduction2020}. Briefly, the MTP describes the local environment around each atom in terms of moment tensors $M_{\mu,\nu}$, defined as follows: \begin{equation} M_{\mu,\nu}(\mathbf{n_i}) = \sum_{j}f_{\mu}(|\mathbf{r_{ij}}|,z_i,z_j)\underbrace{\mathbf{r_{ij}} \otimes... \otimes \mathbf{r_{ij}}}_\textrm{$\nu$ times} \label{eqn:mtp descriptor} \end{equation} Here, $\mathbf{n_i}$ denotes the atomic types as well as the relative positions of the $i^{th}$ atom and all of its neighboring atoms. $z_i$ and $z_j$ represent the atomic types (integers from 0 to n-1 for a system with n different types of atoms) of the $i^{th}$ atom and its $j^{th}$ neighbor, respectively, and $\mathbf{r_{ij}}$ is the position vector of the $j^{th}$ neighbor to the $i^{th}$ atom. The radial part of the atomic environment is given by the $f_{\mu}$ term, and the angular part is encoded by the outer product ($\otimes$) of the $\mathbf{r_{ij}}$ vectors, which is a tensor with rank $\nu$. The moment tensors $M_{\mu,\nu}$ are then contracted to basis functions $B_{\alpha}$, which are intrinsically invariant to atomic permutations, rotations and reflections. The energy of the system $E_{\rm{MTP}}$ is then expressed as a linear function of $B_{\alpha}$ as follows: \begin{equation} E_{\rm{MTP}} = \sum_{i=1}^n\sum_{\alpha}\xi_{\alpha}B_{\alpha}(\mathbf{n_i}) \label{eqn:mtp energy} \end{equation} where $n$ and $\alpha$ are the total number of atoms inside the system and the total number of basis functions for each atom, respectively, and $\xi_{\alpha}$ are the coefficients fitted in the training process implemented in the MLIP package. Similarly, the forces and stresses can be expressed as the first and second derivatives of the $E_{\rm{MTP}}$ with respect to $\mathbf{r_{ij}}$ \cite{shapeevMomentTensorPotentials2016a, gubaevAcceleratingHighthroughputSearches2019}. An optimized MTP is then obtained by minimizing the errors in the predicted energies, forces and stresses with respect to the DFT training data. In this work, the energy, force and stress data points are assigned weights of 100:1:0, similar to previous works \cite{liQuantumaccurateSpectralNeighbor2018, dengElectrostaticSpectralNeighbor2019a, zuoPerformanceCostAssessment2020b, liComplexStrengtheningMechanisms2020a}. Two key parameters control the performance trade-off of the MTP. The radius cutoff $R_{cut}$ determines the maximum interaction range between atoms. The larger the $R_{cut}$, the more the atomic interactions encoded in Equation \ref{eqn:mtp descriptor}. The completeness of the basis functions $B_{\alpha}$ is controlled by its maximum level ($lev_{max}$). The larger the $lev_{max}$, the larger the number of terms in the linear expansion in Equation \ref{eqn:mtp energy}, which in turn results in higher computational cost and a greater likelihood of over-fitting. In this work, the $R_{cut}$ was chosen to be 5.0 \AA, a typical value used in previously reported MTPs \cite{podryabinkinActiveLearningLinearly2017, gubaevAcceleratingHighthroughputSearches2019, wangLithiumIonConduction2020}, while the $lev_{max}$ were set as 18 for \ce{Li3YCl6} and \ce{Li7P3S11} and 16 for LLTO based on our convergence tests (see Figure S2-S5). For the fitting, a training:test split of 90:10 was used. In total, seven MTPs were fitted for LLTO, \ce{Li3YCl6} and \ce{Li7P3S11} according to the above discussed procedure. These MTPs are labeled with subscripts indicating the functionals used during the AIMD simulation (Step 2) and static energies and forces evaluations (Step 3). For instance, MTP$_{\mathrm{PBE,optB88}}$ refers to an MTP fitted using the snapshots extracted from AIMD simulations performed using the PBE functional, with energies and forces evaluated using the optB88 functional. It should be noted that MTP$_{\mathrm{optB88,optB88}}$ was fitted only for \ce{Li7P3S11} as a test case and because the results were highly similar to MTP$_{\mathrm{PBE,optB88}}$ (see later Results section), only the latter was fitted for the other two LSCs. Previously, the current authors have also used an alternative approach in which the long-ranged electrostatic interactions were accounted for separately via an Ewald summation of the formal oxidation states prior to fitting the residual interactions via the ML-IAP \cite{dengElectrostaticSpectralNeighbor2019a}. A similar ``electrostatic'' MTP (eMTP) for the LLTO LSC was also developed but the performance was similar to the MTP without separate accounting of electrostatics. It can be concluded that there is significant screening in these materials, and the radius cutoff used above was already sufficient to account for most of the electrostatic interactions (see Figure S6). All training, evaluations and simulations with MTP were performed using MLIP \cite{shapeevMomentTensorPotentials2016a, gubaevAcceleratingHighthroughputSearches2019}, LAMMPS \cite{plimptonFastParallelAlgorithms1995} and the open-source Materials Machine Learning (maml) Python package \cite{maml}. \subsection{QHA Thermal Expansion} Phonon calculations were performed using the supercells (outlined in Section \ref{Section: construction of supercell}) at nine fixed volumes (80\% to 120\% with 5\% intervals of the equilibrium volume at 0K from structural relaxations with PBE and optB88 functionals). Real-space force constants were calculated utilizing the density functional perturbation theory (DFPT) \cite{gonzeDynamicalMatricesBorn1997} method as implemented in VASP, while the real-space force constants from MTPs were generated with the finite displacement approach implemented in the Phonopy \cite{togoFirstPrinciplesPhonon2015a} package. Phonon frequencies were then calculated from the force constants, and the thermal expansion from 0K to 800K was calculated under the quasi-harmonic approximation (QHA). \subsection{Diffusivity and Conductivity Calculations} Classical MD simulations for each LSC were performed using the trained MTPs. Taking advantage of the lower computational cost and linear scaling of MTP calculations with respect to system size, larger supercells with all lattice parameters over 20 \AA~were used for these simulations. Based on benchmarks of the convergence of the ionic conductivity with cell sizes (Figure S7), simulation cells of $3\times3\times2$, $2\times2\times3$ and $3\times2\times2$ AIMD supercells are utilized for LLTO, \ce{Li3YCl6} and \ce{Li7P3S11}, respectively. The time step was set to 1 fs, and the total simulation time was at least 1 ns for all MD simulations. The tracer diffusivity ($D^{*}$) of Li ions was obtained by performing a linear fitting of the mean square displacement (MSD) of all diffusing Li ions with time, according to the Einstein relation \cite{vandervenRechargeableAlkaliIonBattery2020}: \begin{equation} D^{*} = \frac{1}{2dNt} \sum_{i=1}^{N}[\Delta r_i(t)]^2 \end{equation} where $d$ is the number of dimensions in which diffusion occurs ($d$=3 for all three electrolytes), $N$ is the total number of diffusing Li ions, and $\Delta r_i(t)$ is the displacement of the $i^{th}$ Li ion at time $t$. The charge diffusivity ($D_{\sigma}$) of Li ions was calculated from the square net displacement of all diffusing Li ions, as described below \cite{vandervenRechargeableAlkaliIonBattery2020}: \begin{equation} D_{\sigma} = \frac{1}{2dNt} [\sum_{i=1}^{N}\Delta r_i(t)]^2 \end{equation} The Haven ratio is then given by the following equation: \begin{equation} H_R = D^{*}/D_{\sigma} \end{equation} Finally, the ionic conductivity $\sigma (T)$ at temperature $T$ is given by the Nernst-Einstein equation \cite{vandervenRechargeableAlkaliIonBattery2020}: \begin{equation} \sigma (T) = \frac{\rho z^2 F^2}{RT}D_{\sigma}(T) \end{equation} where $\rho$ is the molar density of diffusing ions in the unit cell, $z$, $F$ and $R$ are the charge of Li ions ($z=1$), the Faraday constant and the gas constant, respectively. Arrhenius plots were then generated to determine the temperature-dependent activation energies ($E_a$). \section{Results} \subsection{MTP Validation} \begin{table}[htbp] \centering \caption{Mean absolute errors (MAEs) on energies and forces predictions for fitted MTPs. The MAEs were calculated with respect to static energies and forces from the respective DFT functionals.} \makebox[\linewidth]{ \begin{tabular}{clcccc} \hline\hline \multicolumn{1}{c}{\multirow{2}[0]{*}{LSC}} & \multicolumn{1}{c}{\multirow{2}[0]{*}{MTP}} & \multicolumn{2}{c}{MAE$_{\mathrm{energies}}$ (meV/atom)} & \multicolumn{2}{c}{MAE$_{\mathrm{forces}}$ (eV/\AA)} \\\cline{3-6} & & Training & Test & Training & Test \\\hline \multirow{2}[0]{*}{LLTO} & MTP$_{\mathrm{PBE, PBE}}$ & 1.40 & 1.44 & 0.12 & 0.12 \\ & MTP$_{\mathrm{PBE, optB88}}$ & 1.39 & 1.24 & 0.10 & 0.10 \\\hline \multirow{2}[0]{*}{\ce{Li3YCl6}} & MTP$_{\mathrm{PBE, PBE}}$ & 0.96 & 1.11 & 0.04 & 0.04 \\ & MTP$_{\mathrm{PBE, optB88}}$ & 1.00 & 1.06 & 0.04 & 0.04 \\\hline \multirow{3}[0]{*}{\ce{Li7P3S11}} & MTP$_{\mathrm{PBE, PBE}}$ & 1.77 & 1.92 & 0.09 & 0.08 \\ & MTP$_{\mathrm{PBE, optB88}}$ & 1.70 & 1.78 & 0.08 & 0.08 \\ & MTP$_{\mathrm{optB88, optB88}}$ & 1.79 & 2.07 & 0.09 & 0.09 \\\hline\hline \end{tabular}% } \label{Table: MLIAP evaluation on energies & forces}% \end{table}% Table \ref{Table: MLIAP evaluation on energies & forces} compares the mean absolute errors (MAEs) in energies and forces of the fitted MTPs. In all cases, the MAEs in energies are between 0.96 meV/atom and 2.07 meV/atom, while the MAEs in forces are below 0.20 eV/\AA. These MAEs are similar to or lower than those of other MTPs fitted in the literature \cite{zuoPerformanceCostAssessment2020b, wangLithiumIonConduction2020}, and a substantial improvement over traditional IAPs. The training and test MAEs are generally very similar, indicating that there is little likelihood of overfitting. The MAEs in energies and forces are also uniformly distributed with respect to the different temperatures that training structures were extracted from (see Figure S3-S5), indicating consistently high accuracy of our MTPs to reproduce DFT energies and forces at different temperatures. These results are consistent regardless of the DFT functionals (PBE or optB88) used to generate the training data. Further analysis also found that the local environments sampled by nanosecond NPT MD simulations using the fitted MTP are similar with those sampled by the AIMD training data (Figure S8) and the MAEs in forces are consistently low regardless of local environment (Figure S9). It should be noted that while it is possible that MD simulations under more extreme conditions, e.g., above 1200K, may sample local environments that are substantially different from the AIMD training data and possibly result in higher errors, such conditions are unlikely to be of interest for most applications of the fitted MTPs. \subsection{Lattice Parameters} \label{Section: structural relaxation} \begin{table}[htbp] \centering \caption{Lattice parameters and densities of LSCs relaxed with the PBE and optB88 DFT functionals and the trained MTPs at 0K, in comparison with experimental lattice parameters and densities at room temperature for LLTO \cite{haradaLithiumIonConductivity1998}, \ce{Li3YCl6} \cite{asanoSolidHalideElectrolytes2018} and \ce{Li7P3S11} \cite{yamaneCrystalStructureSuperionic2007}. Values in brackets are the percentage differences between the computed values and the experimental measurements.} \makebox[\linewidth]{ \begin{tabular}{ccccc}\hline\hline & a (\AA) & b (\AA) & c (\AA) & Density (g cm$^{-3}$) \\\hline \multicolumn{5}{l}{LLTO} \\ DFT PBE & 3.96 (2.3\%) & 3.89 (0.5\%) & 3.91 (1.0\%) & 4.84 (-3.0\%) \\ DFT optB88 & 3.95 (2.1\%) & 3.88 (0.3\%) & 3.90 (0.8\%) & 4.88 (-2.2\%) \\ MTP$_{\mathrm{PBE, PBE}}$ & 3.96 (2.3\%) & 3.89 (0.5\%) & 3.90 (0.8\%) & 4.85 (-2.8\%)\\ MTP$_{\mathrm{PBE, optB88}}$ & 3.95 (2.1\%) & 3.87 (0.0\%) & 3.89 (0.5\%) & 4.90 (-1.8\%) \\ Experiment & 3.87 & 3.87 & 3.87 & 4.99 \\\hline \multicolumn{5}{l}{\ce{Li3YCl6}} \\ DFT PBE & 11.17 (-0.3\%) & 11.17 (-0.3\%) & 6.22 (3.2\%) & 2.37 (-3.3\%) \\ DFT optB88 & 11.01 (-1.7\%) & 11.01 (-1.7\%) & 6.02 (-0.2\%) & 2.52 (2.9\%) \\ MTP$_{\mathrm{PBE, PBE}}$ & 11.18 (-0.2\%) & 11.18 (-0.2\%) & 6.27 (4.0\%) & 2.35 (-4.1\%)\\ MTP$_{\mathrm{PBE, optB88}}$ & 11.04 (-1.4\%) & 11.04 (-1.4\%) & 6.08 (0.8\%) & 2.48 (1.2\%) \\ Experiment & 11.20 & 11.20 & 6.03 & 2.45 \\\hline \multicolumn{5}{l}{\ce{Li7P3S11}} \\ DFT PBE & 12.86 (2.9\%) & 6.19 (2.7\%) & 12.69 (1.3\%) & 1.87 (-5.6\%)\\ DFT optB88 & 12.61 (0.9\%) & 6.08 (0.8\%) & 12.62 (0.7\%) & 1.95 (-1.5\%)\\ MTP$_{\mathrm{PBE, PBE}}$ & 12.66 (1.3\%) & 6.33 (5.0\%) & 12.56 (0.2\%) & 1.88 (-5.1\%)\\ MTP$_{\mathrm{PBE, optB88}}$ & 12.52 (0.2\%) & 6.14 (1.8\%) & 12.57 (0.3\%) & 1.95 (-1.5\%)\\ MTP$_{\mathrm{optB88, optB88}}$ & 12.52 (0.2\%) & 6.12 (1.5\%) & 12.66 (1.0\%) & 1.96 (-1.0\%)\\ Experiment & 12.50 & 6.03 & 12.53 & 1.98 \\\hline\hline \end{tabular}} \label{Table:structural relaxation} \end{table}% \begin{figure}[htbp] \centering \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.1cm]{Lattice_mtp_LLTO.pdf} \caption{\label{subfig:Lattice_LLTO}LLTO} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.1cm]{Lattice_mtp_Li3YCl6.pdf} \caption{\label{subfig:Lattice_LYC}\ce{Li3YCl6}} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.1cm]{Lattice_mtp_Li7P3S11.pdf} \caption{\label{subfig:Lattice_Li7P3S11}\ce{Li7P3S11}} \end{subfigure} \caption{\label{fig:MTP lattice}Comparison of the lattice parameters predicted via relaxation with the trained MTPs and the DFT-relaxed values. For each MTP, the relaxation was performed using 36 strained structures constructed by applying strains of -0.15 to 0.15 with 0.05 intervals in six different modes to the DFT relaxed ground-state structure to assess the numerical stability of MTP relaxation. } \end{figure} Table~\ref{Table:structural relaxation} compares the lattice parameters and volumes for the three LSCs from DFT and MTP relaxations with experimental values. It can be seen that the use of the optB88 functional significantly improves the predicted lattice parameters and densities over the PBE functional for \ce{Li3YCl6} and \ce{Li7P3S11} LSCs, while yielding smaller improvements for LLTO LSC. The PBE computed densities underestimate the experimental densities by 3-6\%, consistent with the well-known propensity of PBE to underbind. The optB88 computed densities are within 1-3\% of the experimental densities due to the fact that optB88 functional is less repulsive at short interatomic separations \cite{klimesVanWaalsDensity2011}. As shown in Figure \ref{fig:MTP lattice}, the MTPs are generally able to reproduce the DFT lattice parameters to within 1-2.5\%. It should be noted that the errors with respect to DFT follows the order LLTO $<$ \ce{Li3YCl6} $\sim$ \ce{Li7P3S11}. We hypothesize that this can be attributed to the difference in the potential energy landscapes, \textit{i.e.,} \ce{Li3YCl6} and \ce{Li7P3S11} have shallower potential energy landscapes, which leads to smaller energy changes with lattice parameter variations. This can be seen to some degree in the equation of state plots (see later Figure \ref{fig:EOSQHA}), as the same percentage of change in volume leads to less change in the total energies of \ce{Li3YCl6} and \ce{Li7P3S11}. \subsection{Equations of State and Thermal Expansion} \label{Section: EOS} \begin{figure}[H] \centering \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.5cm]{EOS_LLTO.pdf} \caption{\label{subfig:EOS_LLTO}EOS of LLTO} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.5cm]{EOS_LYC.pdf} \caption{\label{subfig:EOS_LYC}EOS of \ce{Li3YCl6}} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.5cm]{EOS_Li7P3S11.pdf} \caption{\label{subfig:EOS_Li7P3S11}EOS of \ce{Li7P3S11}} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.5cm]{QHA_expansion_LLTO.pdf} \caption{\label{subfig:QHA_LLTO}$\beta$ of LLTO} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.5cm]{QHA_expansion_LYC.pdf} \caption{\label{subfig:QHA_LYC}$\beta$ of \ce{Li3YCl6}} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=3.5cm]{QHA_expansion_Li7P3S11.pdf} \caption{\label{subfig:QHA_Li7P3S11}$\beta$ of \ce{Li7P3S11}} \end{subfigure} \caption{\label{fig:EOSQHA}Equations of state at 0K (a, b, c) and QHA thermal volume expansion $\beta$ (d, e, f) of LLTO, \ce{Li3YCl6} and \ce{Li7P3S11} calculated from DFT and MTPs. The volumes in the $\beta$ plots (d, e, f) are normalized with respect to the experimentally measured volumes at room temperatures \cite{haradaLithiumIonConductivity1998, asanoSolidHalideElectrolytes2018, yamaneCrystalStructureSuperionic2007}.} \end{figure} Figure \ref{fig:EOSQHA}a-c shows the equation of state (EOS) curves of the three LSCs calculated from DFT and MTPs. In general, the MTP computed EOSs agree well with the corresponding DFT EOSs, further attesting to the robustness of the MTP fitting procedure. In addition to the differences in equilibrium volumes discussed in the preceding section, we note that the optB88 DFT and MTP calculations predict a larger curvature for \ce{Li3YCl6} and \ce{Li7P3S11} LSCs, i.e., the optB88 functional predicts a higher bulk modulus than PBE. These results are consistent with the calculated QHA thermal volume expansion, plotted in Figure~\ref{fig:EOSQHA}d-f. The MTP QHA thermal expansion curves match closely with the corresponding DFT QHA thermal expansion curves. In general, the optB88 DFT and MTP volumes are much closer to the experimental volumes for respective temperatures between 0 and 800K. LLTO has the smallest MTP$_{\mathrm{PBE,optB88}}$ volume expansion coefficient ($\beta_{\mathrm{PBE,optB88}}$) of $1.08\times10^{-5}$ K$^{-1}$ from 300K to 800K, in excellent agreement with the reported low thermal expansion coefficient of $9.35\times10^{-6}$ K$^{-1}$ from X-ray diffraction analysis from 298K to 800K \cite{okumuraComputationalSimulationsLi2006}. \ce{Li3YCl6} and \ce{Li7P3S11} have much higher predicted $\beta_{\mathrm{PBE,optB88}}$ of $5.28\times10^{-5}$ K$^{-1}$ and $4.07\times10^{-5}$ K$^{-1}$, respectively. A slightly higher volume expansion is predicted for \ce{Li3YCl6} by optB88 compared to PBE. \subsection{Ionic Conductivity} \label{Section: Arrhenius plot} \begin{figure}[H] \centering \includegraphics[height=6cm]{Arrhenius_plot_ave.pdf} \footnotesize{ \begin{tabular}{ccccc}\hline\hline & AIMD & MTP$_{\mathrm{PBE, PBE}}$ & MTP$_{\mathrm{PBE, optB88}}$ & Experiment \\ \hline \multicolumn{5}{l}{LLTO} \\ \multirow{2}[0]{*}{$E_a (eV)$} & 0.26 & 0.36 (300-475K) & 0.36 (300-450K) & 0.40 (300K) \cite{inagumaHighIonicConductivity1993a} \\ & (900-1800K) \cite{heOriginFastIon2017} & 0.24 (475-800K) & 0.22 (450-800K) & 0.22 (600K) \cite{salkusDeterminationNonArrheniusBehaviour2011} \\ $\sigma_{300K}$ (mS cm$^{-1}$) & - & 0.97 ($\sigma^{*}$) & 1.04 ($\sigma^{*}$), 1.53 ($\sigma$) & 1-1.3 \cite{inagumaHighIonicConductivity1993a,haradaLithiumIonConductivity1998} \\\hline \multicolumn{5}{l}{\ce{Li3YCl6}}\\ \multirow{2}[0]{*}{$E_a (eV)$} & 0.19 & \multirow{2}[0]{*}{0.16 (300-600K)} & 0.49 (300-425K) & \multirow{2}[0]{*}{0.40 (230-360K) \cite{asanoSolidHalideElectrolytes2018}} \\ & (500-900K) \cite{wangLithiumChloridesBromides2019} & & 0.24 (425-800K) & \\ $\sigma_{300 K}$ (mS cm$^{-1}$) & 14 \cite{wangLithiumChloridesBromides2019} & 152.66 ($\sigma^{*}$) & 0.56 ($\sigma^{*}$), 1.64 ($\sigma$) & 0.51 \cite{asanoSolidHalideElectrolytes2018} \\\hline \multicolumn{5}{l}{\ce{Li7P3S11}} \\ \multirow{2}[0]{*}{$E_a (eV)$} & 0.19 & \multirow{2}[0]{*}{0.18 (300-600K)} & 0.38 (300-400K) & 0.29 (298-373K) \cite{buscheSituMonitoringFast2016} \\ & (400-1200K) \cite{chuInsightsPerformanceLimits2016a} & & 0.19 (400-800K) & 0.18 (300-600K) \cite{chuInsightsPerformanceLimits2016a} \\ $\sigma_{300K}$ (mS cm$^{-1}$) & 57 \cite{chuInsightsPerformanceLimits2016a} & 67.37 ($\sigma^{*}$) & 6.50 ($\sigma^{*}$), 7.51 ($\sigma$) & 4-17 \cite{wenzelInterphaseFormationDegradation2016a,buscheSituMonitoringFast2016,chuInsightsPerformanceLimits2016a,seinoSulphideLithiumSuper2014a} \\ \hline\hline \end{tabular} } \caption{\label{fig:Arrhenius}(Top) Arrhenius plot for LLTO, \ce{Li3YCl6} and \ce{Li7P3S11} from NPT/MD simulations using MTP$_{\mathrm{PBE, PBE}}$ (open markers) and MTP$_{\mathrm{PBE, optB88}}$ (solid markers). The diffusivities were obtained by averaging the mean square displacements from five independent MD simulations at each temperature for at least 1 ns. (Bottom) Room temperature ionic conductivities ($\sigma_{300K}$) and activation energies ($E_a$) for LLTO, \ce{Li3YCl6} and \ce{Li7P3S11}, obtained from MD simulations using MTP$_{\mathrm{PBE, PBE}}$ and MTP$_{\mathrm{PBE, optB88}}$. For MTP$_{\mathrm{PBE, optB88}}$, transitions between two quasi-linear Arrhenius regimes were observed for all three LSCs and the $E_a$ for each regime are reported separately. Available AIMD derived values as well as experimental references are also listed.} \end{figure} Figure \ref{fig:Arrhenius} shows the Arrhenius plots for the three LSCs from MD simulations performed using the MTPs and a summary of the derived activation energies ($E_a$) and conductivities at room temperature ($\sigma_{300K}$) in comparison with experiments and previous AIMD simulations. From the MTP$_{\mathrm{PBE, optB88}}$ Arrhenius plots (filled markers and solid lines), it is immediately apparent that all three LSCs do not exhibit a single linear Arrhenius regime, which is the common assumption made when extrapolating high-temperature (HT) AIMD simulations to room temperature. Transitions between a HT quasi-linear regime with lower $E_a$ and a low-temperature (LT) quasi-linear regime with higher $E_a$ occur at $\sim$ 450K, 425K and 400K for LLTO, \ce{Li3YCl6} and \ce{Li7P3S11}, respectively. In all cases, the MTP$_{\mathrm{PBE,optB88}}$ predicted $\sigma_{300K}$ and $E_a$ are in remarkably good agreement with previously reported experimental values for all three LSCs. In particular, while previous HT AIMD simulations predicted an extraordinarily high $\sigma^{*}_{300K}$ of 57 mS cm$^{-1}$ for \ce{Li7P3S11}, the MTP$_{\mathrm{PBE,optB88}}$ predicted $\sigma^{*}_{300K}$ and $\sigma_{300K}$ are only 6.50 and 7.51 mS cm$^{-1}$, much closer to the 4-17 mS cm$^{-1}$ that have been reported experimentally thus far \cite{wenzelInterphaseFormationDegradation2016a,buscheSituMonitoringFast2016,chuInsightsPerformanceLimits2016a,seinoSulphideLithiumSuper2014a}. We further note that the MTP$_{\mathrm{PBE,optB88}}$ HT $E_a$ are also consistent with those obtained from previous HT AIMD simulations for \ce{Li3YCl6} \cite{wangLithiumChloridesBromides2019} and \ce{Li7P3S11} \cite{chuInsightsPerformanceLimits2016a}. The \ce{Li3YCl6} LSC has only been experimentally studied at 230-360K. Our MTP$_{\mathrm{PBE,optB88}}$ MD simulations predict that \ce{Li3YCl6} would undergo a transition to a lower $E_a$ regime at around 425K; a prediction that would need to be verified by further experiments from the community. The Haven ratios ($H_R$) at 300K are 0.68, 0.34 and 0.87 for LLTO, \ce{Li3YCl6} and \ce{Li7P3S11}, respectively. There are no existing reports of the Haven ratios for these LSCs to the authors' knowledge. However, LLTO has been experimentally reported to possess highly correlated motions at room temperature \cite{bohnkeFastLithiumionConducting2008}, consistent with the computed $H_R$ of 0.68. Further, our calculated $H_R$ for \ce{Li7P3S11} also lies in between the AIMD simulated $H_R$ (0.42, 0.53) \cite{marcolongoIonicCorrelationsFailure2017} and NMR measured $H_R$ (in the order of 1) \cite{kuhnTetragonalLi10GeP2S12Li7GePS82013} of \ce{Li10GeP2S12}, another sulfide LSC. We also note that the MTP$_{\mathrm{PBE, optB88}}$ and MTP$_{\mathrm{PBE, PBE}}$ yield fundamentally different results for \ce{Li3YCl6} and \ce{Li7P3S11}. In both cases, the MTP$_{\mathrm{PBE, PBE}}$ do not predict any transitions between quasi-linear Arrhenius regimes in the simulation temperature range of 300-600K. The activation energies $E_a$ and room temperature ionic conductivities $\sigma_{300K}$ are also severely underestimated and overestimated, respectively, compared to experiments, similar to prior AIMD simulations using the PBE functional. The poor performance of the PBE-based MTP and AIMD simulations can be traced to the substantial overestimation of the lattice parameters by the PBE functional, which can lead to lower activation barriers and higher ionic conductivities \cite{ongPhaseStabilityElectrochemical2013, kuhnNewUltrafastSuperionic2014}. It should be noted that we cannot rule out the possibility that the observed transitions between quasi-Arrhenius regimes are an artifact of the DFT functional used in generating the training data, i.e., optB88, but the generally improved agreement between the predicted room-temperature ionic conductivities and experimental values suggest that the transitions are a real phenomenon. It is our hope that future detailed experiments may shed further light on these predictions. \subsection{Transitions in Diffusion Mechanisms} \begin{figure}[htbp] \centering \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=4cm]{Traj_LLTO_500K_ac_332.png} \caption{\label{subfig:traj_LLTO_500K}LLTO at 500K} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=4cm]{Traj_LYC_500K_bc_322.png} \caption{\label{subfig:traj_LYC_500K}\ce{Li3YCl6} at 500K} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=4cm]{Traj_Li7P3S11_500K_ac_322.png} \caption{\label{subfig:traj_Li7P3S11_500K}\ce{Li7P3S11} at 500K} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=4cm]{Traj_LLTO_300K_ac_332.png} \caption{\label{subfig:traj_LLTO_300K}LLTO at 300K} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=4cm]{Traj_LYC_300K_bc_322.png} \caption{\label{subfig:traj_LYC_300K}\ce{Li3YCl6} at 300K} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=4cm]{Traj_Li7P3S11_300K_ac_322.png} \caption{\label{subfig:traj_Li7P3S11_300K}\ce{Li7P3S11} at 300K} \end{subfigure} \caption{Li trajectories (colored as green) from MTP$_{\mathrm{PBE,optB88}}$ MD simulations of the LLTO, \ce{Li3YCl6} and \ce{Li7P3S11} LSCs at room temperature (300K) and above the transition temperatures. For brevity, only the projection in the crystallographic a-c, b-c and a-c planes are shown for LLTO, \ce{Li3YCl6} and \ce{Li7P3S11}, respectively, at each temperature. The projections in the other crystallographic planes are provided in Figure S10-S12.} \label{fig:trajectories} \end{figure} To understand the reason behind observed transitions between quasi-linear Arrhenius regimes, we have extracted the trajectories from the MTP$_{\mathrm{PBE,optB88}}$ MD simulations of the three LSCs at room temperature and above the transition temperature and plotted them in Figure \ref{fig:trajectories} and Figure S10-S12. In all three LSCs, a substantial change in the number and variety of diffusion pathways is observed. For LLTO, Li diffusion at 300K occurs primarily along b and c directions inside the La-poor layer, which agrees well with experimental observations at room temperature \cite{maMesoscopicFrameworkEnables2016}, but additional diffusion pathways between planes are activated above the transition temperature of 450K (Figure \ref{subfig:traj_LLTO_500K}). Similarly, \ce{Li3YCl6} exhibits quasi-1D diffusion at 300K and 3D diffusion above the transition temperature of 425K. For \ce{Li7P3S11}, Li diffusion is already 3D at 300K but occurs along well-defined pathways. Above the transition temperature of 400K, additional pathways are activated. The decrease in activation energies $E_a$ can be directly traced to the increase in the variety and dimensionality of diffusion in the three LSCs. The most significant reduction in $E_a$ ($\sim$ 0.25 eV) is observed for \ce{Li3YCl6}, which transitions from a quasi-1D to 3D conductor at around 425K. \section{Discussion} Briefly, the above results have shown that the discrepancy between computed and experimentally measured ionic conductivities in the literature can be traced to two effects. First, the choice of the DFT functional can lead to substantial errors in the lattice parameters, which can have a large effect on the predicted activation barriers and ionic conductivities. Second, most AIMD simulations of LSCs in the literature were performed at high temperatures in the NVT ensemble to obtain sufficient hop statistics. Not only does this lead to further errors in the lattice parameters, there is also a strong likelihood that these simulations do not capture transitions in quasi-linear Arrhenius regimes occurring at lower temperatures. These issues can be addressed through carefully-trained ML-IAPs. With a generalizable stepwise workflow for the construction of MTPs for LSCs (see Figure \ref{fig:workflow}), we have consistently generated training structures sampling a range of local environments (see Figure S8) and fitted MTPs to study LLTO, \ce{Li3YCl6} and \ce{Li7P3S11} LSCs. Our results suggest that the choice of DFT functional used in generating the initial and snapshot training structures is relatively unimportant, but the choice of the DFT functional used in the energy and force evaluations to generate the training data is critically important. Here, we show that the use of the optB88 vdW functional for static energy and force calculations and the ns-scale ML-IAP MD at lower temperatures significantly improve the agreement in lattice parameters, activation energies and room-temperature ionic conductivities of the LSCs with experiments. These results have broad implications for ML-IAP development strategy. The typical approach in the literature thus far has been to use the same DFT functional in both the generation of training structures as well as energy/force evaluations. Decoupling these two choices allow one to use a relatively cheap computational method such as PBE functional or even other empirical potentials, for the most expensive step of generating training structures, while using a more expensive but accurate computational method, e.g., SCAN or HSE, for the static energy and force evaluations. While the generation of the DFT training data dominates the computational effort in developing the ML-IAP, it should be noted that the ML-IAPs themselves are many orders of magnitude computationally less expensive than DFT calculations, and more importantly, scales linearly with respect to the number of atoms (see Table S3). It is this linear scaling property, while retaining close to DFT accuracy in energies and forces, that enables the simulations of large systems at long time scales in this work. Our results also have significant implications for LSC development. For all three LSCs investigated, a transition between diffusive regimes is observed at relatively low temperatures (400-450K). In most cases, the activation barriers and ionic conductivities that have been experimentally measured correspond to the low-temperature regime. One potential avenue for further enhancing the ionic conductivities of these and other LSCs is to attempt to stabilize the high-temperature, lower activation energy diffusion regimes at room temperature. This may be achieved by quenching from higher temperatures, compositional modifications (e.g., dopants or substitutions), or mechanical modifications (e.g., introducing strain). By developing ML-IAPs using the approach outlined in this work, MD simulations can provide critical guidance on potential pathways for further LSC optimization. \section{Conclusions} To conclude, we have shown that MTPs trained using optB88 energies and forces can successfully reproduce the experimental lattice parameters, activation energies and room temperature ionic conductivities of the LLTO, \ce{Li3YCl6} and \ce{Li7P3S11} LSCs. In all three LSCs, MD simulations using the trained MTP identify a transition between quasi-linear Arrhenius regimes occurring at relatively low temperatures. These results not only highlight the fundamental limitations in using high-temperature, short time scale AIMD simulations to predict room-temperature properties of materials, but also suggest a potential pathway and strategy to predictive LSC design through the use of machine learning interatomic potentials. \section{Acknowledgements} This work was primarily supported by Nissan Motor Co., Ltd., and Nissan North America Inc. under Award Number 20202446. The authors also acknowledge software infrastructure (pymatgen and atomate) supported by the Materials Project, funded by the US Department of Energy, Office of Science, Office of Basic Energy Sciences, Materials Sciences and Engineering Division under contract no. DE-AC02-05-CH11231: Materials Project program KC23MP, and computing resources provided by the National Energy Research Scientific Computing Center (NERSC), the Triton Shared Computing Cluster (TSCC) at the University of California, San Diego, and the Extreme Science and Engineering Discovery Environment (XSEDE) under grant ACI-1548562. \section{Data Availability} The datasets generated and/or analyzed during the current study are available from the corresponding author on reasonable request. \section{Introduction} \begin{itemize} \item Discuss the role of ionic conductivity for solid electrolytes. \item Discuss the gap between room temperature ionic conductivity of Li3YCl6 and Li7P3S11 from experiment and from AIMD. \item Discuss the known non-Arrhenius behavior in LLTO, beta-LPS, and LGPS systems. \item Discuss the limitation of AIMD simulations on ionic diffusion -- high temperature only, due to low speed. \item Discuss the advantages of ML-IAP. Near-DFT accuracy with orders of magnitude faster speed, allowing ML-IAP to study ionic diffusion in grain boundary structure, amorphous structure, and in room temperature range. \item While ML-IAP can bridge the accuracy/speed trade-off, they are only as accurate as the DFT data that they are trained on. As we know, DFT methods can vary wildly in terms of accuracy of lattice parameters and accounting for effects like vdw. And these can have major effects on ionic conductivity. \end{itemize} \section{Material and methods} \begin{itemize} \item Construction of \ce{Li_{0.33}La_{0.56}TiO3}, \ce{Li3YCl6} ,\ce{Li7P3S11} structures. \item DFT and AIMD calculations. \item MTP model training. \item QHA thermal expansion. \item Diffusivity calculations. \end{itemize} \section{Results} \subsection{Structure relaxation with proper exchange functional} \label{Section: structural relaxation} \begin{table}[htbp] \centering \caption{Structural relaxation by DFT with PBE and optB88 exchange functionals and by MTP at 0 K in comparison with experimental results at room temperature for \ce{Li_{0.33}La_{0.56}TiO3}\cite{fourquetStructuralMicrostructuralStudies1996} and \ce{Li7P3S11}\cite{yamaneCrystalStructureSuperionic2007}, and at 150 K for \ce{Li3YCl6}\cite{schlemInsightsLithiumSubstructure2021}. Percentage data shows the discrepancy of DFT \& ML-IAP results from experimental measurements. For ML-IAPs, training structures were all collected from AIMD trajectorial structures by PBE functional. While training energy \& force were generated from static calculation by PBE and optB88 functionals respectively, for $MTP_{PBE+PBE}$ and $MTP_{PBE+optB88}$.} \makebox[\linewidth]{ \begin{tabular}{cccccc} \hline\hline & DFT PBE & DFT optB88 & $MTP_{PBE+PBE}$ & $MTP_{PBE+optB88}$ & Experiment \\\hline \multicolumn{6}{l}{\ce{Li_{0.33}La_{0.56}TiO3}} \\ a (Å) & 3.96(2.1\%) & 3.95(1.9\%) & 3.96(2.2\%) & - & 3.87 \\ b (Å) & 3.89(0.4\%) & 3.88(0.1\%) & 3.89(0.3\%) & - & 3.87 \\ c (Å) & 3.91(0.9\%) & 3.9(0.6\%) & 3.9(0.8\%) & - & 3.87 \\ density ($g/cm^3$) & 4.84(-3.1\%) & 4.88(-2.3\%) & 4.85(-3\%) & - & 4.99 \\\hline \multicolumn{6}{l}{\ce{Li3YCl6}} \\ a (Å) & 6.22(3.5\%) & 6.02(0.2\%) & 6.27(4.4\%) & 6.08(1.3\%) & 6.00 \\ b (Å) & 11.17(0.1\%) & 11.01(-1.3\%) & 11.18(0.2\%) & 11.04(-1.1\%) & 11.16 \\ c (Å) & 11.17(0.1\%) & 11.01(-1.3\%) & 11.18(0.2\%) & 11.04(-1.1\%) & 11.16 \\ density ($g/cm^3$) & 2.37(-4.4\%) & 2.52(1.6\%) & 2.35(-5.3\%) & 2.48(0.1\%) & 2.48 \\ \multicolumn{6}{l}{\ce{Li7P3S11}} \\ a (Å) & 12.87(3\%) & 12.61(0.9\%) & 12.66(1.3\%) & 12.52(0.1\%) & 12.50 \\ b (Å) & 6.17(2.2\%) & 6.08(0.8\%) & 6.38(5.7\%) & 6.14(1.7\%) & 6.03 \\ c (Å) & 12.68(1.2\%) & 12.62(0.7\%) & 12.56(0.3\%) & 12.57(0.3\%) & 12.53 \\ density ($g/cm^3$) & 1.87(-5.3\%) & 1.95(-1.3\%) & 1.88(-5\%) & 1.95(-1.2\%) & 1.98 \\\hline\hline \end{tabular}% } \label{Table:structural relaxation}% \end{table}% \begin{itemize} \item As shown in Table~\ref{Table:structural relaxation}, PBE overestimates the lattice parameter by almost +3\% with respect to the experimental value. In contrast, the optB88-vdW methods results in a small relative deviation (+1-2\%) from the experimental, thus, significantly improves the estimate for density closer to the experiment. For LYC, the optimal values of optB88-vdW derived lattice constants are smaller than the experimental values by 1.3\%. This is likely due to the fact that optB88-vdW functional is less repulsive at short interatomic separations, which corroborates with earlier observation for other solids. (reference: Phys. Rev. B 2011, 83, 19531) \item Table 1 further shows that optB88 functional predicts lattice better compared to PBE functional. The difference between the former and the latter is significant for \ce{Li7P3S11} and \ce{Li3YCl6}, while insignificant for \ce{Li_{0.33}La_{0.56}TiO3}, with exact percentage gap of 4.0\%, 6.1\%, and 0.8\% in density, respectively. \item For ML-IAP training data, PBE functional was used in AIMD to generate snapshots for all three electrolytes. Static calculations were done to the structure snapshots to obtain accurate energy and force. For the static calculations, optB88 functional was used for \ce{Li7P3S11} and \ce{Li3YCl6}, while PBE functional was used for \ce{Li_{0.33}La_{0.56}TiO3}. ML-IAP generated with this method was verified to reproduce energy and force, lattice relaxation, and QHA thermal expansion by DFT with respective functional used for the static calculations, and detailed analysis was provided in section 3.2, 3.3, and 3.4. \end{itemize} \subsection{ML-IAP verification} \subsubsection{Energy and force} \begin{table}[H] \centering \caption{Evaluation of the prediction accuracy on training and testing energy and force for ML-IAP of the three different electrolyte systems. DFT exchange funcionals applied to generate AIMD trajectorial structures and static energy \& force were also given.} \makebox[\linewidth]{ \begin{tabular}{ccccccc} \hline\hline \multicolumn{1}{c}{\multirow{2}[0]{*}{Electrolyte systems}} & \multicolumn{2}{c}{Training data} & \multicolumn{2}{c}{$MAE_{energy}$ (meV/atom)} & \multicolumn{2}{c}{$MAE_{force}$ (eV/Å)}\\\cline{2-7} & \multicolumn{1}{c}{Structure} & \multicolumn{1}{c}{Energy \& Force} & Training & Testing & Training & Testing \\ \hline \ce{Li_{0.33}La_{0.56}TiO3} & PBE & PBE & 1.40 & 1.44 & 0.122 & 0.121 \\\hline{} \multirow{2}[0]{*}{\ce{Li3YCl6}} & PBE & PBE & 0.96 & 1.11 & 0.043 & 0.042 \\ & PBE & optB88 & 1.00 & 1.06 & 0.042 & 0.041 \\\hline{} \multirow{2}[0]{*}{\ce{Li7P3S11}} & PBE & PBE & 1.77 & 1.92 & 0.085 & 0.085 \\ & PBE & optB88 & 1.70 & 1.78 & 0.084 & 0.083 \\\hline\hline \end{tabular}% } \label{Table: MLIAP evaluation on energy & force}% \end{table}% \begin{itemize} \item For all the 5 as-trained ML-IAPs, MAE in training and testing energy were lower than 2 meV/atom, while MAE in training and testing force were below 150 meV/Å. These MAE values of energy and force were low compared with literature results. Also, the discrepancies between training and testing MAE were generally small, indicating low possibilities of overfitting. \item It was worth noting that 3 of the ML-IAPs were trained by static energy \& force and AIMD trajectorial structures both generated with PBE functional, while the other 2 were trained by AMID trajectorial structures generated with PBE functional and static energy \& force obtained with optB88 functional. The low MAE values in all 5 cases indicated the capability of ML-IAP to learn and reproduce static energy \& force of both PBE and optB88 functionals, no matter which functional was applied to generate the AIMD trajectorial structures. Therefore, to fit a ML-IAP to surrogate DFT with specific functional, training energy \& force should be obtained by DFT static calculation with the target functional, while training structures can be obtained from AIMD with typical PBE functional. This rule was also proved by the structural relaxation, equation of states, and QHA thermal expansion studies in Section \ref{Section: structural relaxation}, \ref{Section: EOS}, and \ref{Section: QHA}. \end{itemize} \subsubsection{Equation of States} \label{Section: EOS} \begin{figure}[H] \label{Figure: EOS} \centering \begin{subfigure}[b]{0.3\textwidth} \centering \graphicspath{ {./figures/} } \includesvg[height=3.5cm]{EOS_LLTO.svg} \caption{\label{subfig:EOS_LLTO}\ce{Li_{0.33}La_{0.56}TiO3}} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \graphicspath{ {./figures/} } \includesvg[height=3.5cm]{EOS_LYC.svg} \caption{\label{subfig:EOS_LYC}\ce{Li3YCl6}} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \graphicspath{ {./figures/} } \includesvg[height=3.5cm]{EOS_Li7P3S11.svg} \caption{\label{subfig:EOS_Li7P3S11}\ce{Li7P3S11}} \end{subfigure} \caption{Equation of states at 0 K of \ce{Li_{0.33}La_{0.56}TiO3}, \ce{Li3YCl6}, and \ce{Li7P3S11} studied by DFT and ML-IAPs. Volumes were ranged from 80 \% to 120 \% of the averaged volumes of relaxed cells from DFT with PBE and optB88 functionals with 5 \% intervals. Results from DFT with PBE and optB88 functionals were colored as blue and orange, respectively. Results from ML-IAPs trained with static energy \& force from PBE and optB88 functionals were colored as green and red. The training structures were all obtained from AIMD with PBE functional, respectively.} \end{figure} \begin{itemize} \item Fig. \ref{subfig:EOS_LLTO} showed little difference in equation of states of \ce{Li_{0.33}La_{0.56}TiO3} studied by PBE and optB88 functionals. Their equilibrium volume as well as energy change vs. volume were matching very well. These observations were in good agreement with the structural relaxation results. In Section \ref{Section: structural relaxation}, Table \ref{Table:structural relaxation} showed that the difference between the equilibrium densities at 0 K from the two functionals was 0.8 \%, which is nearly unnoticeable compared to the 5 \% volume intervals in Fig. \ref{subfig:EOS_LLTO}. \item Fig. \ref{subfig:EOS_LYC} and \ref{subfig:EOS_Li7P3S11} showed clear discrepancies between the equation of states studied by DFT PBE and optB88 functionals, in both \ce{Li3YCl6} and \ce{Li7P3S11} solid electrolytes. The discrepancies between equilibrium volumes were around one volume interval, namely 5 \% of the averaged volumes of DFT relaxed cells the two functionals. And these large discrepancies in volume with respect to the same relative energy became even larger with lattice expansion and compression. Again, the results in equation of states for those two systems agreed well with structural relaxation in Section \ref{Section: structural relaxation}. For both \ce{Li3YCl6} and \ce{Li7P3S11} solid electrolytes, gaps of around 5 \% were observed in the equilibrium densities from PBE and optB88 functionals. \item In all three electrolyte systems, ML-IAPs perfectly reproduced the equation of states results from the same DFT functionals as functionals used to generate static energy \& force training data. \end{itemize} \subsubsection{QHA thermal expansion} \label{Section: QHA} \begin{figure}[H] \label{Figure: QHA} \centering \begin{subfigure}[b]{0.3\textwidth} \centering \graphicspath{ {./figures/} } \includesvg[height=3.5cm]{QHA_expansion_LLTO.svg} \caption{\label{subfig:QHA_LLTO}\ce{Li_{0.33}La_{0.56}TiO3}} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \graphicspath{ {./figures/} } \includesvg[height=3.5cm]{QHA_expansion_LYC.svg} \caption{\label{subfig:QHA_LYC}\ce{Li3YCl6}} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \graphicspath{ {./figures/} } \includesvg[height=3.5cm]{QHA_expansion_Li7P3S11.svg} \caption{\label{subfig:QHA_Li7P3S11}\ce{Li7P3S11}} \end{subfigure} \caption{QHA thermal expansion of \ce{Li_{0.33}La_{0.56}TiO3}, \ce{Li3YCl6}, and \ce{Li7P3S11} from 0 to 1000 K studied by DFT and ML-IAPs. For each system, volumes were normalized with respect to the equilibrium volume at 0 K obtained from DFT optB88 functional and QHA. Results from DFT with PBE and optB88 functionals were colored as blue and orange, respectively. Results from ML-IAPs trained with static energy \& force from PBE and optB88 functionals were colored as green and red, respectively. } \end{figure} \begin{itemize} \item As shown in Fig. \ref{subfig:QHA_LLTO}, the normalized volumes of \ce{Li_{0.33}La_{0.56}TiO3} from DFT optB88 and DFT PBE were very close to each other in the full temperature range, with discrepancy less than 1\%. DFT and MTP results both showed that the QHA thermal expansion of \ce{Li_{0.33}La_{0.56}TiO3} was insignificant, with an overall increase below 1\% from 0 K to 1000 K. This result was in excellent agreement with the reported low thermal expansion coefficient as $9.35\times10^{-6} K^{-1}$ by X-ray diffraction analysis of La0.56Li0.33TiO3 from 298 to 800 K, indicating volume expansion within 0.5 \% from 298 to 800 K. \item In both Fig. \ref{subfig:QHA_LYC} and \ref{subfig:QHA_Li7P3S11}, constant discrepancies around 5\% in normalized volumes were observed between DFT PBE and DFT optB88 results throughout the full temperature range from 0 to 1000 K. Along with structural relaxation and equation of states studies at 0 K in Section \ref{Section: structural relaxation} and \ref{Section: EOS}, these QHA thermal expansion results further strengthened the importance of optB88 functional for accurate volumetric simulations of \ce{Li3YCl6} and \ce{Li7P3S11} systems. \item All 5 ML-IAPs showed generally great agreement in normalized volumes from 0 to 1000 K with DFT results by the same functional applied to generate their training energy and force. Considering different effects of optB88 functional to the three systems, which has already been fully discussed in the above sections, ML-IAP trained with energy \& force generated by optB88 functional were selected to further study the Li-ion diffusion inside \ce{Li3YCl6} and \ce{Li7P3S11} systems, while ML-IAP trained with energy \& force obtained from PBE functional was applied to study the non-Arrhenius behaviour of \ce{Li_{0.33}La_{0.56}TiO3} solid electrolyte. \end{itemize} \subsection{Ionic conductivity} \graphicspath{ {./figures/} } \begin{figure}[H] \includesvg[width=8cm, height=8cm]{Arrhenius_log_sigma.svg} \centering \caption{Arrhenius plot of \ce{Li_{0.33}La_{0.56}TiO3}, \ce{Li3YCl6}, and \ce{Li7P3S11} from 300 K to 800 K, colored as red, green, and blue.} \label{Figure: Arrhenius_log_sigma} \end{figure} \begin{table}[htbp] \centering \caption{Ionic conductivities and activation energies of Li-ion diffusion in \ce{Li_{0.33}La_{0.56}TiO3}, \ce{Li3YCl6}, and \ce{Li7P3S11} studied by MTP, experiments, and AIMD. Temperature ranges and points with respect to activation energies were provided.} \makebox[\linewidth]{ \begin{tabular}{cclc} \hline\hline & MTP & \multicolumn{1}{c}{Experiment} & AIMD \\\hline \multicolumn{4}{l}{\ce{Li_{0.33}La_{0.56}TiO3}} \\ \multirow{2}[0]{*}{$E_{activation}$ (eV)} & 0.36 (300 - 475 K) & \multicolumn{1}{c}{0.40 (300 K)\cite{inagumaHighIonicConductivity1993a}, 0.30 (300 K)\cite{salkusDeterminationNonArrheniusBehaviour2011}} & - \\ & 0.24 (475 - 800 K) & \multicolumn{1}{c}{0.15 (500 K)\cite{inagumaHighIonicConductivity1993a}, 0.22 (600 K)\cite{salkusDeterminationNonArrheniusBehaviour2011}} & - \\ $\sigma_{300 K}$ (mS/cm) & 0.97 & \multicolumn{1}{c}{1\cite{inagumaHighIonicConductivity1993a}} & - \\\hline \multicolumn{4}{l}{\ce{Li3YCl6}} \\ \multirow{2}[0]{*}{$E_{activation}$ (eV)} & 0.53 (300 - 400 K) & \multicolumn{1}{c}{\multirow{2}[0]{*}{0.40 (230 - 360 K)\cite{asanoSolidHalideElectrolytes2018}}} & \multirow{2}[0]{*}{0.19 (500 - 900 K)\cite{wangLithiumChloridesBromides2019}} \\ & 0.26 (400 - 800 K) & & \\ $\sigma_{300 K}$ (mS/cm) & 0.46 & \multicolumn{1}{c}{0.5\cite{asanoSolidHalideElectrolytes2018}} & 14\cite{wangLithiumChloridesBromides2019} \\\hline \multicolumn{4}{l}{\ce{Li7P3S11}} \\ \multirow{2}[0]{*}{$E_{activation}$ (eV)} & 0.29 (300 - 525 K) & \multicolumn{1}{c}{0.29 (298 - 373 K)\cite{buscheSituMonitoringFast2016}} & \multirow{2}[0]{*}{0.19 (400 - 1200 K)\cite{chuInsightsPerformanceLimits2016a}} \\ & 0.18 (525 - 800 K) & \multicolumn{1}{c}{0.18 (300 - 600 K)\cite{chuInsightsPerformanceLimits2016a}} & \\ $\sigma_{300 K}$ (mS/cm) & 9.00 & \multicolumn{1}{c}{4\cite{wenzelInterphaseFormationDegradation2016a}, 8.6\cite{buscheSituMonitoringFast2016}, 11.6\cite{chuInsightsPerformanceLimits2016a}, 17\cite{seinoSulphideLithiumSuper2014a}} & 53\cite{chuInsightsPerformanceLimits2016a} \\ \hline\hline \end{tabular}% } \label{Table: Ionic conductivity and activation energy}% \end{table}% \begin{itemize} \item The ionic conductivity of \ce{Li_{0.33}La_{0.56}TiO3} predicted by MTP at 300 K was 0.97 mS/cm, which is matching perfectly with the extrapolated value of 0.98 mS/cm in Fig. \ref{Figure: Arrhenius_log_sigma}. Both of them are in remarkable agreement with the experimentally measured room temperature ionic conductivity of 1 mS/cm.\cite{inagumaHighIonicConductivity1993a} According to the author's knowledge, this was the first time for a theoretical simulation to successfully predict the room temperature ionic conductivity of \ce{Li_{0.33}La_{0.56}TiO3}, resulting from ML-IAP's capability to study ionic diffusion in room temperature regime. \item Fig. \ref{Figure: Arrhenius_log_sigma} clearly showed non-Arrhenius behavior of \ce{Li_{0.33}La_{0.56}TiO3}, with a transition in slope around 450 to 500 K, which was in excellent agreement with experimentally observed transition temperature regime from 450 to 550 K.\cite{salkusDeterminationNonArrheniusBehaviour2011} For temperature from 475 to 800 K, the activation energy was calculated to be 0.24 eV, matching greatly with the reported activation barrier of 0.22 eV at around 600 K from impedance spectroscopy measurements for \ce{Li_{0.33}La_{0.56}TiO3}.\cite{bohnkeFastLithiumionConducting2008} For temperature from 300 to 475 K, the activation energy was calculated to be 0.36 eV. This value was also inside the range of experimentally examined room temperature activation barriers for \ce{Li_{0.33}La_{0.56}TiO3}, from 0.30 eV\cite{bohnkeFastLithiumionConducting2008} to 0.40 eV\cite{inagumaHighIonicConductivity1993a}. \item The ionic conductivity of \ce{Li3YCl6} predicted by MTP at 300 K was 0.46 mS/cm, which is matching perfectly with the extrapolated value of 0.44 mS/cm in Fig. \ref{Figure: Arrhenius_log_sigma}. Both of them are in excellent agreement with the experimentally measured room temperature ionic conductivity of 0.50 mS/cm. Non-Arrhenius behavior was also observed inside \ce{Li3YCl6}, with a sharp change in activation energy at temperature of 400 K. For temperature from 300 K to 400 K, the activation energy was calculated to be 0.53 eV. This value was 0.13 eV larger than the experimentally examined room temperature activation barriers of 0.40 eV. This discrepancy was possibly resulted from the different temperature range for the estimation of activation energy from experiment, which was done from 230 K to 360 K. Though MTP MD was orders of magnitude faster than AIMD, ionic diffusion below room temperature was still a too slow process to simulate, leaving the above explanation as a hypothesis. For temperature from 400 K to 700 K, the activation energy was calculated to be 0.26 eV. This value is interestingly matching with the activation energy of 0.19 eV reported by existing AIMD simulations. This matching could be foreseen, as AIMD simulations were done only in temperature higher than 400K, above the transition point. As the AIMD simulations were done with PBE functional, the overestimation of volume by PBE functional to \ce{Li3YCl6} resulted in the 0.07 eV lower activation energy from AIMD at above 400 K, compared with MTP MD results at above 400 K. \item The ionic conductivity of \ce{Li7P3S11} predicted by MTP at 300 K was 9.00 mS/cm, which was again matching perfectly with the extrapolated value of 8.48 mS/cm in Fig. \ref{Figure: Arrhenius_log_sigma}. Both of them are in the order of 10 mS/cm, matching with the widely reported room temperature ionic conductivity of 4 mS/cm, 8.6 mS/cm, 11.6 mS/cm, and 17 mS/cm by impedance spectroscopy measurements. In Fig. \ref{Figure: Arrhenius_log_sigma}, a slight transition in slope was observed at around 500 to 550 K. For temperature from 300 to 525 K and from 525 to 800 K, the activation energy was calculated to be 0.29 and 0.18 eV, respectively. On the other hand, the room temperature activation energies reported from experiments varied in the range from 0.18 eV to 0.29 eV. It was suspected by the author that this wide range of reported activation energies was resulted from the non-Arrhenius behavior of \ce{Li7P3S11} and different temperature regimes the experiments were conducted. As listed in Table \ref{Table: Ionic conductivity and activation energy}, the experimentally measure activation energies of 0.18 and 0.29 eV were measured from 300 to 600 K and from 298 to 373 K, respectively. Another hypothesis was that the discrepancy between activation energies were from the structural differences of \ce{Li7P3S11} synthesized under different conditions, so that a low activation energy of 0.18 eV could be achieved by maintaining the meta-stable structure at higher temperature. More structural characterization with careful temperature control on \ce{Li7P3S11} with activation barrier as low as 0.18 eV are required to further understand this discrepancy in experiment. \end{itemize} \section{Discussion} \begin{itemize} \item Non-Arrhenius behaviors were clearly observed in all the three electrolyte systems. Though the transition points were intrinsically different, ranging from 400 K to 600 K, there was a common trend that the activation energies below transition temperatures were higher than above transition temperatures. The simulated non-Arrhenius behaviors in \ce{Li3YCl6} and \ce{Li7P3S11} requires further experimental verification. \item In those systems, extrapolation from high temperature regimes to 300 K with an assumption of temperature independent activation energy would lead to large overestimation for ionic conductivities at 300 K. This explains the reason why AIMD simulations overestimated a few times or even one order of magnitude higher the room temperature ionic conductivities of \ce{Li3YCl6} and \ce{Li7P3S11}. \item With ML-IAP's accuracy and speed, the accurate simulation of ionic diffusion inside superionic conductors can be extended from high temperature to 300 K. This enables theoretical prediction to overcome the non-Arrhenius behavior and directly study the ionic diffusion at 300 K, making simulation results on ionic conductivity more reliable. \item To further understand and improve the ionic conductivities of solid electrolytes, the transition in activation energy through temperature has to be further characterised. \end{itemize} \section{Conclusions} \begin{itemize} \item Discrepancy of AIMD and expt is often driven by the Non-Arrhenius behaviour and inaccurate estimate for volume. Developing an accurate MTP potential leads to the prediction of Non-Arrhenious diffusion behaviour and estimation for RT conductivity. Choice of exchange correlation function and inclusion of dispersion correction rectifies the volume error and results in accurate prediction of conductivity. \item PBE functional and optB88 functional was compared by their performance on lattice relaxation of the three solid electrolytes. Compared to optB88 functional, PBE functional overestimated the volume of \ce{Li3YCl6} and \ce{Li7P3S11}, while their difference in \ce{Li_{0.33}La_{0.56}TiO3} was insignificant. \item ML-IAP were successfully trained for the three electrolyte systems and were verified to excellently reproduce DFT results on energy, force, structural relaxation, and QHA thermal expansion. \item The as-trained ML-IAP successfully simulated the room temperature ionic conductivities of all the respective electrolyte system, with excellent agreement with experimental measurements on ionic conductivities and activation energies. \end{itemize} \section{Acknowledgements} \section*{References}
\section{Introduction}\label{sec1} Real numbers form a field $\mathbf{R}$, i.e., they have arithmetics of addition, subtraction, multiplication, and division, and the multiplication of two real numbers is commutative. This leads to the convenience in solving systems of linear equations of real coefficients, which has a fundamental importance in many science and engineering applications. A natural question is what happens to vectors of real values, i.e., real vectors. When the dimension of real vectors is $2$, they also form a field that is the complex number field, by simply introducing the imaginary unit $\mathbf{i}=\sqrt{-1}$ as follows. For a two dimensional real vector $[x, y]$, let $z=x+ \mathbf{i} y$. Then, all $z$ form the complex number field $\mathbf{C}$ and all the arithmetics of real vectors $[x, y]$ correspond to that of complex numbers $z$. However, for real vectors of dimension $3$ or higher, they do not form a field, although all $4$ dimensional real vectors form the domain of quaternionic numbers and all $8$ dimensional real vectors form the domain of octonionic numbers \cite{ref10}. There exist arithmetics for $4$ dimensional real vectors and also for $8$ dimensional real vectors but their multiplications are not commutative. This non-cummtativity may cause a lot of inconvenience for the arithmetics of real vectors. Although higher dimensional real vectors do not form a field, if the real field is replaced by a smaller subfield or a finite field, the corresponding vectors may form a field. For example, assume all the components of vectors of a fixed dimension $m$ take values in a finite field $\mathbf{E}$. Let $\alpha$ be a root of a primitive polynomial $p(x)$ of degree $m$ over $\mathbf{E}$ \cite{ref0, ref1}. Then, all the $m$ dimensional vectors of components taking values in $\mathbf{E}$ form another finite field $\mathbf{F}$ that is an extension of field $\mathbf{E}$ of degree $[\mathbf{F}:\mathbf{E}]=m$. This plays the fundamental role in Reed-Solomon (RS) codes and BCH codes in error correction coding \cite{ref2}. The rationale is explained in more details in Section \ref{sec5}. Another example is rational vectors, i.e., vectors with all components taking values in the rational field $\mathbf{Q}$. For $m$ dimensional rational vectors, let $\alpha$ have its minimal polynomial of degree $m$ over $\mathbf{Q}$. Then, all the $m$ dimensional rational vectors form a field $\mathbf{Q}(\alpha)$ that is an algebraic number field and is an extension of $\mathbf{Q}$ of degree $m$. Therefore, all the $m$ dimensional rational vectors have the $4$ arithmetics as real numbers and the multiplication of any two $m$ dimensional rational vectors is commutative. Since real values can be approximated by rational values to an arbitrary precision, in this paper we propose to use rational vectors to approximate real vectors in their arithmetics within an $\epsilon$ range, called $\epsilon$-arithmetics. We also define the complex conjugate of a real vector and then define inner product and linear convolution of two real vectors and two real vector sequences (called vector-valued signals). Thus, the proposed $\epsilon$ arithmetics provide similar linear processing for general real vector-valued signals as that for complex-valued signals. This will broaden the linear processing of the conventional real or complex-valued signals, such as linear filtering, ARMA modeling, and least squares fitting to a set of data. Note that algebraic number fields have been applied in signal processing, mostly in fast algorithms \cite{ref3, ref4}, communications, such as coding \cite{ref5} and space-time coding \cite{ref6, ref7, ref8}, and cryptography, such as lattice based cryptography \cite{ref9}. However, all these existing applications are different from what is proposed in this paper for the arithmetics of addition, subtraction, multiplication, and division (in what follows, arithmetics always mean these four operations) of real vectors, which are used to linearly process real vector-valued signals of any fixed vector size with real vector-valued coefficients of the same vector size, similar to the conventional real or complex scalar-valued signals. This paper is organized as follows. In Section \ref{sec2}, we define $\epsilon$-arithmetics for real vectors. In Section \ref{sec3}, we define complex conjugate of a real vector and inner products for two real vectors and two real vector sequences. In Section \ref{sec4}, we define convolution and linear filtering for finite length real vector-valued signals. In Section \ref{sec5}, we have some discussions. In Section \ref{sec5}, we conclude this paper. \section{$\epsilon$-Arithmetics}\label{sec2} We first briefly introduce an algebraic number field, an extension of the rational field $\mathbf{Q}$. Let $\alpha$ be an algebraic number with its minimal polynomial $p(x)$ of degree $m$ over the rational field $\mathbf{Q}$, i.e., $p(x)$ is the polynomial of lowest degree with coefficients in the rational field $\mathbf{Q}$ such that $\alpha$ is a root of the polynomial. Then, \begin{equation}\label{1} \mathbf{Q}(\alpha)=\{ \left. q_1+q_2\alpha+\cdots + q_m \alpha^{m-1} \right| q_i\in \mathbf{Q}, 1\leq i\leq m \} \end{equation} is an algeraic number field and an extension of $\mathbf{Q}$ of degree $m$. Thus, all elements in $\mathbf{Q}(\alpha)$ have the $4$ conventional arithmetics and the multiplication is commutative. Let $\mathbf{Q}[x]$ denote the ring of all polynomials over $\mathbf{Q}$, i.e., polynomials with rational coefficients. Then, the field $\mathbf{Q}(\alpha)$ is isomorphic to $\mathbf{Q}[x]/(p(x))$, the field of all polynomials under modulo $p(x)$ operation, i.e., $\mathbf{Q}(\alpha)\cong \mathbf{Q}[x]/(p(x))$. We next introduce the arithmetics for rational vectors. For any $m$ dimensional rational vector $\mathbf{q}=[q_1,q_2,\cdots, q_m]\in \mathbf{Q}^m$, we map $\mathbf{q}$ to the element $q_1+q_2\alpha+\cdots +q_m \alpha^{m-1}$ in $\mathbf{Q}(\alpha)$ and it is clear that this mapping is one-to-one and onto. We define the arithmetics of these $m$ dimensional rational vectors as that of their mapped elements in the algebraic number field $\mathbf{Q}(\alpha)$: $$ [q_{11},q_{12},\cdots,q_{1m}]\circ [q_{21},q_{22},\cdots,q_{2m}] $$ \begin{equation}\label{2} \stackrel{\Delta}{=}\sum_{i=1}^m q_{1i}\alpha^{i-1} \circ \sum_{i=1}^m q_{2i}\alpha^{i-1} \end{equation} where ${\bf q}_j=[q_{j1},q_{j2},\cdots, q_{jm}]\in \mathbf{Q}^m$ for $j=1,2$, and $\circ$ is an arithmetic operation, i.e., one of addition, subtraction, multiplication and division. Since $\mathbf{Q}(\alpha)$ is a field, the right hand side of (\ref{2}) is also an element in $\mathbf{Q}(\alpha)$, and thus has an expression $q_1+q_2\alpha+\cdots +q_m \alpha^{m-1}$ for some $q_i\in \mathbf{Q}$, $1\leq i\leq m$. Then, $$ [q_{11},q_{12},\cdots,q_{1m}]\circ [q_{21},q_{22},\cdots,q_{2m}] $$ \begin{equation}\label{201} =[q_1,q_2,\cdots,q_m]\in \mathbf{Q}^m. \end{equation} With $\mathbf{Q}(\alpha)\cong \mathbf{Q}[x]/(p(x))$, the addition, subtraction, multiplication of two rational vectors of dimension $m$ are easy to implement. To do division, we only need to know how to implement the inverse of a non-zero rational vector $[q_1,q_2,\cdots, q_m]\neq 0 \in \mathbf{Q}^m$. Let $q(\alpha)=q_1+q_2\alpha+\cdots+q_m\alpha^{m-1} \neq 0 \in \mathbf{Q}(\alpha)$. Let its inverse be $\bar{q}(\alpha)=\bar{q}_1+\bar{q}_2\alpha +\cdots +\bar{q}_m \alpha^{m-1}$, i.e., \begin{equation}\label{202} \bar{q}(\alpha) q(\alpha) =1 \mod p(\alpha). \end{equation} Since $p(x)$ is a minimal polynomial over $\mathbf{Q}$, $q(x)$ and $p(x)$ are co-prime over $\mathbf{Q}$. From B\'{e}zout's identity and using Euclidean algorithm, one can find\footnote{It can be done by using Matlab easily.} two polynomials of rational coefficients $u(x), v(x)\in \mathbf{Q}[x]$ such that \begin{equation}\label{203} u(\alpha) q(\alpha)+ v(\alpha) p(\alpha)=1, \end{equation} which implies $u(\alpha)q(\alpha)=1 \mod p(\alpha)$, and thus we have $\bar{q}(\alpha)=(q(\alpha))^{-1}=u(\alpha) \mod p(\alpha)$ in (\ref{202}). Then, $([q_1,q_2,\cdots,q_m])^{-1}=[\bar{q}_1,\bar{q}_2,\cdots, \bar{q}_m] \in \mathbf{Q}^m$. A detailed Matlab code to compute the inverse of a real vector can be found in the Appendix. With the inverse calculation of a non-zero $m$ dimensional rational vector, the divisions of non-zero $m$ dimensional rational vectors follow immediately. Note that, since the algebraic number field $\mathbf{Q}(\alpha)$ is a subfield of the complex number field $\mathbf{C}$, the arithmetic, $\circ$, in (\ref{2}) on the algebraic number field $\mathbf{Q}(\alpha)$ is also the same as that on the complex number field, i.e., the conventional $+,-,\times, \div$ for complex numbers. From the above definition of the arithmetics for rational vectors, one can see that different algebraic numbers $\alpha$ define different arithmetics for the same rational vectors. Let us see two examples. Let $m=4$, $\alpha_1=\sqrt{2}+\sqrt{3}$, and its minimal polynomial is $p_1(x)=x^4-10 x^2+1$, and let $\alpha_2=\exp(2\pi \mathbf{i}/5)$, and the minimal polynomial is $p_2(x)=x^4+x^3+x^2+x+1$. In fact, $\alpha_2$ is a cyclotomic number and its generated algebraic number field is a cyclotomic field \cite{ref1}. For simplicity, consider two $4$ dimensional rational vectors, $[1,1,1,1]$ and $[1,1,-1,-1]$, and their multiplications following (\ref{2}) and the two algebraic numbers $\alpha_1$ and $\alpha_2$. For the multiplication of the two rational vectors with $\alpha_1$, following (\ref{2}) and $\alpha_1^4=10\alpha_1^2-1$ due to $p_1(\alpha_1)=0$, we have \begin{eqnarray*} & [1,1,1,1]\cdot [1,1,-1,-1]\\ = & 1 +\alpha_1 -\alpha_1^2 -\alpha_1^3\\ & +1 + \alpha_1 -9 \alpha_1^2 -\alpha_1^3\\ & +1 +\alpha_1 -9 \alpha_1^2 -9 \alpha_1^3\\ & +9 +\alpha_1-89 \alpha_1^2-9 \alpha_1^3\\ = & 10+4\alpha_1 -108 \alpha_1^2 -20 \alpha_1^3\\ = & [12, 4, -108, -20]. \end{eqnarray*} For the multiplication of the two rational vectors with $\alpha_2$, following (\ref{2}) and $\alpha_2^4=-\alpha_2^3-\alpha_2^2-\alpha_2-1$ due to $p_2(\alpha_2)=0$, we have \begin{eqnarray*} & [1,1,1,1]\cdot [1,1,-1,-1]\\ = & 1 +\alpha_2 -\alpha_2^2 -\alpha_2^3\\ & +1 + 2\alpha_2 + 2 \alpha_2^2 \\ & +\alpha_2 +2 \alpha_2^2 + 2 \alpha_2^3\\ & -2 -2\alpha_2- \alpha_2^2\\ = & 2\alpha_2 +2 \alpha_2^2 +\alpha_2^3\\ = & [0,2,2,1]. \end{eqnarray*} One can see that the above two multiplication results of the same two rational vectors are much different. We now introduce $\epsilon$-arithmetics for real vectors for a fixed algebraic number $\alpha$ with its minimal polynomial of degree $m$ over $\mathbf{Q}$. Consider the $m$ dimensional real vector space $\mathbf{R}^m$ for $m\geq 3$. Let $\epsilon>0$ be an arbitrary small positive number. Let $$ {\bf r}_1=[r_{11},r_{12},\cdots, r_{1m}], {\bf r}_2 = [r_{21},r_{22},\cdots, r_{2m}]\in \mathbf{R}^m $$ be two arbitrary $m$ dimensional real vectors. Their $\epsilon$-arithmetics are defined as follows. Find two $m$ dimensional rational vectors ${\bf q}_1, {\bf q}_2\in \mathbf{Q}^m$ in the $\epsilon$ ranges of ${\bf r}_1, {\bf r}_2$: \begin{equation}\label{3} \| {\bf r}_j-{\bf q}_j\|<\epsilon, \,\,\, j=1,2, \end{equation} where $\| \cdot \|$ is a norm for $m$ dimensional vectors, such as $l_2$ or $l_{\infty}$ norm, and if any ${\bf r}_j$ is rational, then ${\bf q}_j={\bf r}_j$, $j=1$ or/and $2$. The $\epsilon$-arithmetic operation for two $m$ dimensional vectors ${\bf r}_1$ and ${\bf r}_2$ is defined as \begin{equation}\label{4} {\bf r}_1 \circ {\bf r}_2 \stackrel{\Delta}{=} {\bf q}_1\circ {\bf q}_2, \end{equation} where $\circ$ is an arithmetic operation, such as $+,-,\times, \div$, and ${\bf q}_1\circ {\bf q}_2$ is defined in (\ref{2})-(\ref{201}). From the above definition of $\epsilon$-arithmetics, clearly the $\epsilon$-arithmetic result of two real vectors ${\bf r}_j$, $j=1,2$, is not unique, even for a fixed algebraic number $\alpha$ in (\ref{2}). This is because a rational vector ${\bf q}_j$ in (\ref{3}) in the $\epsilon$ range of the real vector ${\bf r}_j$ is not unique. In fact, the above $\epsilon$-arithmetics in (\ref{4}) can be defined as a set-valued mappings, where ${\bf r}_1 \circ {\bf r}_2$ is equal to a set of $ {\bf q}_1\circ {\bf q}_2$ in (\ref{4}) for non-empty sets of ${\bf q}_1$ and ${\bf q}_2$ in the $\epsilon$ ranges of ${\bf r}_1$ and ${\bf r}_2$ in (\ref{3}), respectively. Although this is the case, since rational numbers are dense in the real field $\mathbf{R}$, this $\epsilon$ can be made arbitrarily small, such as a computer numerical error level. In this case, within the numerical precision range, the error (or difference) in the $\epsilon$-arithmetics from different rational vector approximations in the $\epsilon$ ranges of two real vectors is negligible, or just the computer numerical error. Note that this may be similarly done as in \cite{ref4} by using arbitrary large integers in getting rational vectors with a desired precision. We know that all real values stored in computers must be rational. Therefore, in terms of practical computations on computers, the $\epsilon$-arithmetics for real vectors can be made the same as the arithmethics for rational vectors. Thus, for notational convenience and without confusion in understanding, for two real vectors ${\bf r}_j=[r_{j1},r_{j2},\cdots, r_{jm}]\in \mathbf{R}^m$, $j=1,2$, their arithmetic $\circ$ is also written as \begin{equation}\label{2000} {\bf r}_1\circ {\bf r}_2 =\sum_{i=1}^m r_{1i}\alpha^{i-1} \circ \sum_{i=1}^m r_{2i}\alpha^{i-1}, \end{equation} and use the following abusively for ${\bf r}=[r_1,r_2,\cdots, r_m]\in \mathbf{R}^m$: \begin{equation}\label{2001} {\bf r}=\sum_{i=1}^m r_i \alpha^{i-1}. \end{equation} Note that because the $\epsilon$-arithmetics for real vectors using approximated rational vectors are defined in (\ref{2}) with only a fixed $m$ finite opeartions, they are robust to the approximation errors. For a real vector that is in an $\epsilon$ range of $0$, then it is treated as $0$. Otherwise, its division is also robust to an approximation error. This means that when $\epsilon$ is small enough, the differences of $\epsilon$-arithmetic operations using different rational vector approximations of real vectors is negligible in practical calculations of $\epsilon$-arithmetics. A detailed Matlab code to compute the product of two real vectors can be found in the Appendix. With the above $\epsilon$-arithmetics for real vectors, one is able to systematically solve systems of linear equations over real vectors: \begin{equation}\label{5} \sum_{j=1}^J {\bf a}_{lj} \cdot {\bf x}_j ={\bf b}_l, \,\,\, l=1,2,...,L, \end{equation} where ${\bf a}_{lj}$, ${\bf b}_l$ are known real vectors of dimension $m$ in $\mathbf{R}^m$ and ${\bf x}_j$ are unknown real vectors of dimension $m$ to solve. It may have applications in, for example, the least squares fitting to a set of data, which may be broader than the conventional least squares fitting. As a remark, for convenience, the above real vector ${\bf r}\in \mathbf{R}^m$ always corresponds to the algebraic number $\alpha$ with its minimal polynomial $p(x) \in \mathbf{Q}[x]$ of degree $m$, unless otherwise specified. \section{Complex Conjugate and Inner Product of Real Vectors}\label{sec3} In this section, we define complex conjugate and inner product for real vectors when the algebraic number $\alpha$ is a real number or cyclotomic number $\exp(2\pi\mathbf{i}/p)$ for a prime number $p$ with $p>2$. When the algebraic number $\alpha$ is real, the complex conjugate of a real vector ${\bf r}$ is defined as itself, i.e., ${\bf r}^* ={\bf r}$. When the algebraic number $\alpha$ is cyclotomic $\exp(2\pi\mathbf{i}/p)$ for a prime number $p$ with $p>2$, the complex conjugate of $\alpha$ is $$ \alpha^* =\exp(-2\pi\mathbf{i}/p)=\alpha^{-1}=\exp(2\pi\mathbf{i}(p-1)/p) $$ \begin{equation}\label{3.1} =\alpha^{(p-1)} =-\sum_{i=0}^{p-2}\alpha^{i}, \end{equation} since, in this case, the minimal polynomial is $1+\alpha+\cdots +\alpha^{p-1}$ \cite{ref1}. Then, for a real vector ${\bf r}=[r_1,r_2,\cdots,r_m]\in \mathbf{R}^m$, its complex conjugate ${\bf r}^*$ is defined as $$ {\bf r}^* \stackrel{\Delta}{=}\sum_{i=1}^m r_i (\alpha^*)^{i-1} = \sum_{i=1}^m r_i \alpha^{-(i-1)} $$ \begin{equation}\label{3.2} = \sum_{i=1}^m r_i \alpha^{(i-1)m} =\sum_{i=1}^m r_i \left( -\sum_{k=0}^{m-1}\alpha^k\right)^{i-1}, \end{equation} where $m=p-1$. Clearly $({\bf r}^*)^*={\bf r}$. Let us see a simple example when $p=3$. Then, $m=2$ and $$ {\bf r}^* = r_1 -r_2(1+\alpha)=r_1-r_2 -r_2\alpha =[r_1-r_2, -r_2]. $$ This is just for an illustration, since for $m=2$ dimensional real vectors, one may simply use the complex field $\mathbf{C}$ for the arithmetics. For two real vectors ${\bf r}_{j}=[r_{j1},r_{j2},\cdots,r_{jm}]\in \mathbf{R}^m$, $j=1,2$, their inner product is defined as \begin{equation}\label{3.3} \langle {\bf r}_1, {\bf r}_2\rangle ={\bf r}_1 \cdot {\bf r}_2^*, \end{equation} where ${\bf r}_2^*$ is the complex conjugate of ${\bf r}_2$. Clearly, we have $\langle {\bf r}_1, {\bf r}_2 \rangle =(\langle {\bf r}_2, {\bf r}_1 \rangle)^*$. For two real vector sequences $\bar{{\bf r}}_j=\{{\bf r}_{j,l}\}_{1\leq l\leq L}$ of dimension $m$ and length $L$ for $j=1,2$, their inner product is defined as: \begin{equation}\label{3.4} \langle \bar{{\bf r}}_1, \bar{{\bf r}}_2 \rangle \stackrel{\Delta}{=} \sum_{l=1}^L {\bf r}_{1,l} \cdot {\bf r}_{2,l}^*, \end{equation} where ${\bf r}_{2,l}^*$ is the complex conjugate of ${\bf r}_{2,l}$. Two real vectors ${\bf r}_i$, $i=1,2$, are called orthogonal if their inner product defined in (\ref{3.3}) is 0. Two real vector sequences $\bar{\bf r}_i$, $i=1,2$, of length $L$ are called orthogonal, if their inner product defined in (\ref{3.4}) is $0$. For the inner product of two real vectors defined in (\ref{3.3}), it can be expanded as \begin{equation}\label{3.5} \langle {\bf r}_1, {\bf r}_2\rangle =\sum_{i=1}^m r_{1i}\alpha^{i-1} \sum_{i=1}^m r_{2i} (\alpha^*)^{i-1}. \end{equation} Let us see an example of $4$ dimensional real vectors in $\mathbf{R}^4$ with $\alpha=\sqrt{2}+\sqrt{3}$ and its minimal polynomial $p(x)=x^4-10x^2+1$. In this case, by some algebra the inner product of ${\bf r}_{j}=[r_{j1},r_{j2},r_{j3},r_{j4}]\in \mathbf{R}^4$, $j=1,2$, is \begin{eqnarray} \langle {\bf r}_1, {\bf r}_2\rangle & = & [r_{11}r_{21}-r_{12}r_{24} -r_{13}r_{23}\nonumber \\ & & \hspace{0.3in} -r_{14}(r_{22}+10 r_{24}), \nonumber \\ & & r_{11}r_{22}+r_{12}r_{21}-r_{13}r_{24}-r_{14}r_{23}, \nonumber \\ & & r_{11}r_{23}+r_{12}(r_{22}+10r_{24})+r_{13}(r_{21}+10r_{23}) \nonumber \\ & & \hspace{0.3in} +r_{14}(10r_{22}+99r_{24}), \nonumber \\ & & r_{11}r_{24}+r_{12}r_{23}+r_{13}(r_{22}+10r_{24}) \nonumber \\ & & \hspace{0.3in} +r_{14}(r_{21}+10r_{23})]. \label{3.6} \end{eqnarray} When ${\bf r}_2={\bf r}_1={\bf r}=[r_1,r_2,\cdots, r_m]\in \mathbf{R}^m$, the squared norm of ${\bf r}$ becomes \begin{eqnarray*} \langle {\bf r}, {\bf r} \rangle & = & [r_1^2-r_3^2-10r_4^2-2r_2r_4,\\ & & 2r_1r_2-2r_3r_4, \\ & & r_2^2+10r_3^2+99r_4^2+2r_1r_3+20r_2r_4, \\ & & 2r_1r_4+2r_2r_3+20r_3r_4]. \end{eqnarray*} From (\ref{3.5}), the right hand side is the product of two polynomials and the coefficients of the product of two polynomials would come from the convolution of the two vectors in general, i.e., the inner product of the real vectors would be their convolution. From (\ref{3.6}), one can see that it is clearly not true here, which is due to the modulo $p(x)=x^4-10x^2+1$ operation, i.e., $\alpha^4=10\alpha^2-1$, in the product of two polynomials. If the product of two polynomials in the right hand side of (\ref{3.5}) was under the modulo $p(x)=x^4-1$, i.e., $\alpha^4=1$, then, the inner product $\langle {\bf r}_1, {\bf r}_2\rangle$ would be the circular convolution of the two vectors: \begin{eqnarray*} \langle {\bf r}_1, {\bf r}_2\rangle & = & (r_{11}+r_{12}\alpha+r_{13}\alpha^2+r_{14}\alpha^3)\\ & & \cdot (r_{21}+r_{22}\alpha^{-1}+r_{23}\alpha^{-2}+r_{24}\alpha^{-3})\\ & = & [r_{11}r_{21}+r_{12}r_{22}+r_{13}r_{23}+r_{14}r_{24},\\ & & r_{11}r_{24}+r_{12}r_{21}+r_{13}r_{22}+r_{14}r_{23}, \\ & & r_{11}r_{23}+r_{12}r_{24}+r_{13}r_{21}+r_{14}r_{22}, \\ & & r_{11}r_{22}+r_{12}r_{23}+r_{13}r_{24}+r_{14}r_{21}]. \end{eqnarray*} This would correspond to the product of the $4$-point DFTs of the two vectors of size $4$. It means that the four point evenly spaced samplings in the frequency domain determines the vector of length $4$. However, $p(x)=x^m-1$ cannot be a minimal polynomial for any positive integer $m>1$ and thus the inner product of two real vectors cannot be a circular convolution in general. As another comparison, we consider the algebraic number $\alpha=\alpha_2$ in Section \ref{sec2}, i.e., $\alpha=\exp(2\pi\mathbf{i}/5)$. Then, $\alpha^5=1$ and $\alpha^4=-(\alpha^3+\alpha^2+\alpha+1)$. In this case, by some algebra we have \begin{eqnarray*} \langle {\bf r}_1, {\bf r}_2\rangle & = & (r_{11}+r_{12}\alpha+r_{13}\alpha^2+r_{14}\alpha^3)\\ & & \cdot (r_{21}+r_{22}\alpha^{-1}+r_{23}\alpha^{-2}+r_{24}\alpha^{-3})\\ & = & [r_{11}(r_{21}-r_{22})+r_{12}(r_{22}-r_{23})\\ & & \hspace{0.3in} +r_{13}(r_{23}-r_{24})+r_{14}r_{24},\\ & & -r_{11}r_{22}+r_{12}(r_{21}-r_{23})\\ & & \hspace{0.3in} +r_{13}(r_{22}-r_{24})+r_{14}r_{23},\\ & & r_{11}(r_{24}-r_{22})-r_{12}r_{23}\\ & & \hspace{0.3in} +r_{13}(r_{21}-r_{24})+r_{14}r_{22},\\ & & r_{11}(r_{23}-r_{22})+r_{12}(r_{24}-r_{23})\\ & & \hspace{0.3in} +r_{13}(r_{21}-r_{24})+r_{14}r_{21}]. \end{eqnarray*} For two general $m$ dimensional real vectors ${\bf r}_1$ and ${\bf r}_2$ with a general algebraic number $\alpha$ with its minimal polynomial $p(x)=p_1+p_2x+\cdots +p_mx^{m-1}+x^m$ for some $p_i\in \mathbf{Q}$, $1\leq i\leq m$, if $\alpha^*\in \mathbf{Q}(\alpha)$ as \begin{equation}\label{3.7} \alpha^* =\sum_{i=1}^m a_i \alpha^{i-1}, \end{equation} where $a_i\in \mathbf{Q}$, $1\leq i\leq m$, then their inner product can be similarly defined as (\ref{3.5}): \begin{eqnarray*} \langle {\bf r}_1, {\bf r}_2\rangle & = & \sum_{i=1}^m r_{1i}\alpha^{i-1} \sum_{i=1}^m r_{2i} (\alpha^*)^{i-1}\\ & = & \sum_{i=1}^m r_{1i}\alpha^{i-1} \sum_{i=1}^m r_{2i} \left( \sum_{k=1}^m a_k \alpha^{k-1}\right)^{i-1}\\ & = & \sum_{i=1}^m r_i \alpha^{i-1}\\ & = & [r_1,r_2,\cdots,r_m], \end{eqnarray*} where, after the polynomial expansions, each $r_i$, $1\leq i\leq m$, is a linear function of $r_{1k}r_{2n}$, $1\leq k, n\leq m$, with coefficients in $\mathbf{Q}$ that are some functions of $p_{l_1}, a_{l_2}$, $1\leq l_1,l_2\leq m$. For the inner product of two real vectors, from (\ref{3.5}), one can see that the right hand side is a product of two complex numbers. Thus, $\langle {\bf r}_1, {\bf r}_2\rangle =0$ if and only if either ${\bf r}_1=0$ or ${\bf r}_2=0$. Then, $\langle {\bf r}, {\bf r}\rangle =0$ if and only if ${\bf r}=0$. And two real vectors are orthogonal if and only if one of them is $0$. It is also not hard to see that for a real vector sequence $\bar{\bf r}$, $\langle \bar{\bf r}, \bar{\bf r}\rangle =0$ if and only if $\bar{\bf r}=0$, i.e., the $0$ sequence. For two rational vector sequences $\bar{\bf q}_i$, $i=1,2$, of length $L$, from (\ref{3.4}), (\ref{3.3}), and (\ref{3.5}), they are orthogonal if and only if their corresponding sequences of complex numbers are orthogonal. This implies that there are at most $L$ many orthogonal rational vector sequences of length $L$. Furthermore, from Gram-Schmidt orthogonalization procedure, it is not hard to see that there exist $L$ many orthogonal real vector sequences of length $L$. \section{Convolution and Linear Filtering of Real Vector-Valued Signals}\label{sec4} With the above inner product for real vectors, it is easy to define a convolution of two real vector sequences (or called real vector-valued signals). Let ${\bf r}_j(n)$, $j=1,2$, be two real vector-valued signals of finite length, i.e., for each integer $n$ in a finite range, ${\bf r}_j(n)$ is a real vector defined as before and $0$ for other $n$ for $j=1,2$. Their convolution is defined as \begin{equation}\label{4.1} {\bf r}_1(n) \ast {\bf r}_2 (n) = \sum_k \langle {\bf r}_1 (k), {\bf r}_2(n-k)\rangle = \sum_k {\bf r}_1(k)\cdot {\bf r}_2^*(n-k). \end{equation} It is clear that when the vector size is $2$ and the primitive element $\alpha= \mathbf{i}$, the above convolution coincides with the convolution of two complex-valued signals. For a general vector size, since the $\epsilon$-arithmetic operations of real vectors, i.e., approximated rational vectors, are all commutative, all the properties of convolutions for complex-valued signals hold for general real vector-valued signals. Thus, if one real vector-valued signal is treated as a filter impulse response, say ${\bf h}(n)={\bf r}_1(n)$, and the other is an input signal, ${\bf s}(n)={\bf r}_2(n)$, the above convolution is the linear filtering of a real vector-valued input signal ${\bf s}(n)$ to a real vector-valued system ${\bf h}(n)$. Note that the above definition of convolution only applies to finite length real vector-valued signals. This is because in the $\epsilon$-arithmetics for real vectors, it uses rational approximations within an $\epsilon$ range. When there are infinitely many $\epsilon$-arithmetics in a summation, the approximation error may blow up, no matter how small an $\epsilon$ is. Fortunately, in practice all signals in computations have finite length and thus the above convolution for finite length real vector-valued signals is sufficient. \section{Some Discussions}\label{sec5} After the earlier definitions of arithmetics, inner product, convolution, and linear filtering for real vectors and vector-valued signals, one might ask whether there are any applications. To explain some of their potential applications, we first explain how the arithmetics of vectors of finite many elements (in finite fields) are used in discovering better error correction codes. In error correction codes, it is well-known that in order to have computationally efficient encoding and decoding, one usually uses linear codes \cite{ref2}. Before using vector arithmetics (or finite fields), linear block error correction codes were binary linear block codes where generator matrices are binary, i.e., matrix entries are either $0$ or $1$. This may strongly limit the possibilities and choices of good generator matrices. In order to have more choices for good generator matrices, it is critical to expand the choices of binary elements of the entries in a generator matrix. One common way to do so is to generalize binary scalar values $0$ and $1$ to vectors of binary values, i.e., binary vectors. Then, the question is how to do the arithmetics for binary vectors. In error correction coding, to correct errors it is important to be able to solve systems of linear equations over, in this case, binary vectors. To do so, it is important to have all arithmetics for binary vectors. As what was mentioned in Introduction, the field extension over the binary field $\{0,1\}$ provides such a property, i.e., it provides all the arithmetics for vectors of finite many elements. This is the foundation on how RS codes and BCH codes are constructed \cite{ref2}. Without finite fields (or arithmetics of vectors of finite many elements), it would not exist RS codes or BCH codes that have been widely used in our daily life electronics. Let us see an example for the above rationale. Consider a binary linear block code with a generator matrix of size $3\times 2$, i.e., $2$ input binary symbols produce $3$ output binary symbols. In this case, there are total $2^6=64$ possible generator matrices to choose. Now we replace every element in a $3\times 2$ binary generator matrix by a binary vector of size $m=4$, i.e., an element in Galois field GF($2^4$). As an example, consider the following binary $3\times 2$ generator matrix: $$ \left[ \begin{array}{cc} 1 & 0 \\ 0 & 1\\ 1 & 1 \end{array} \right]. $$ We now replace $0$ by $[0,0,0,0]$ and $1$ by $[1,0,0,0]$ in the above binary matrix and obtain \begin{equation}\label{5.1} \left[ \begin{array}{cc} $[1,0,0,0]$ & $[0,0,0,0]$ \\ $[0,0,0,0]$ & $[1,0,0,0]$\\ $[1,0,0,0]$ & $[1,0,0,0]$ \end{array} \right]. \end{equation} In this case, the encoding is to multiply this $3\times 2$ matrix with a $2\times 1$ information symbol vector of two binary vectors of size $4$ from the right. Note that a $2\times 1$ information symbol vector of two binary vectors of size $4$ is the same as a $8\times 1$ binary vector as a whole. Thus, if the above encoding over GF($2^4$) needs to be compared with a linear binary encoding, for example, one might ask whether it corresponds to a valid binary linear block code? If it does, the binary generator matrix would be $$ \left[ \begin{array}{cccccccc} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0\\ 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \end{array} \right], $$ by lining up the binary components in the binary vectors of size $4$ in each row in the matrix in (\ref{5.1}) into a new row. One can then clearly see that this binary matrix is $3\times 8$ and not even invertible from the left, i.e., it cannot be a valid generator matrix for a decodable binary linear block code. In other words, the linear encoding over finite field GF($2^4$) does not correspond to a binary linear block code. There are much more valid linear block codes over a larger size finite field than those over the binary field. The same idea as the binary vectors can be applied to real vectors. The vectorized linear processing broadens the scalar linear processing and provides much more degrees of freedom and convenience, while the linear arithmetics of real vectors provide the convenience in finding solutions in practical applications. In addition to the linear filtering proposed in Section \ref{sec4}, another application is the least squares fitting to a set of data. With the $\epsilon$-arithmetics defined for real vectors in this paper, compared to the conventional least squares scalar fitting, the least squares vector fitting is more flexible and therefore, better fitting performance can be expected. A similar application is the linear autoregressive and moving average (ARMA) model fitting in time series. In summary, the $\epsilon$-arithmetics introduced in this paper will open the door to enlarge the pool of all the existing linear processing techniques of scalar-valued signals. Another potential application is in image processing, such as image compression. Usually, image pixels are correlated in two dimensions, while the conventional vector based signal processing techniques, such as vector transforms (VT) first proposed and applied in image compression by Li in \cite{vt1, vt2} and investigated later in \cite{vt3, vt66, vt4, vt5, vt6, vt7, vt8}, vector Karhunen-Lo\`{e}ve transform (KLT) \cite{vt7}, and vector-valued wavelets \cite{vt9}, may only decorrelate signals in one dimension. And they are usually applied row-wise and coloumn-wise separately. An extended VT called average optimal VT was proposed in \cite{vt8} for a two dimensional image by doing average in one dimension first and doing VT in the other dimension second to the blocks of the image. With the arithmetics for real vectors proposed in this paper, for a block of an image, we may treat it as a real vector-valued signal, i.e., consider its first dimenion as a vector value ${\bf r}$ and the second dimension as the vector $[{\bf r}_1, {\bf r}_2, \cdots, {\bf r}_L]$ of the vector values ${\bf r}_i$ for $i=1,2,...,L$. Then, we may apply a vector-valued signal processing technique, such as VT, vector KLT, or vector-valued wavelets, to this vector. This proposed processing might be possible to decorrelate a two dimensional image along both dimensions simultaneously. We believe that it will provide a significantly new technique for image processing. Note that what is proposed in this paper is different from matrix KLT and matrix-valued wavelets for processing matrix-valued signals directly in \cite{vt10}. As a remark, an issue about the $\epsilon$-arithmetics for real vectors defined in this paper is the choice of an algebraic number $\alpha$ that determines the $\epsilon$-arithmetics for real vectors. As mentioned earlier, different algebraic numbers $\alpha$ provide different $\epsilon$-arithmetics for real vectors and the difference may be large. Then, the question is which algebraic number $\alpha$ is needed or better. The answer to this question might depend on the application scenario. \section{Concluding Remarks}\label{sec6} It is known that real vectors of dimension higher than $2$ do not form a field. In other words, one cannot do arithmetics for real vectors of dimension higher than $2$ similar to that for real numbers. This may limit the capability of solving systems of linear equations over real vectors of a finite dimension. In this paper, we have proposed $\epsilon$-arithmetics for real vectors by using approximations of rational vectors that form algebraic number fields. We have also defined the complex conjugate of a real vector, inner product, and convolutions of two real vectors and two real vector sequences (or called vector-valued signals). This may lead to systematic linear processing for real vector-valued signals with real vector-valued coefficients, such as linear filtering, least squares fitting, and ARMA modeling to real vector-valued signals. The $\epsilon$-arithmetics proposed in this paper for real vectors provide the same convenience as that for complex numbers in linear processing, while they broaden the conventional linear processing of scalar-valued signals. It is believed that the study in this paper will open a door to the signal processing community. \section*{Appendix: Matlab Codes to Compute Real Vector Multiplication and Inverse} Below are Matlab function codes to compute the product of real vectors ${\bf p}_1$ and ${\bf p}_2$, and the inverse ${\bf p}^{-1}$ of a real vector ${\bf p}$, for a given minimal polynomial $q(x)$. The vector of the coefficients of $q(x)$ is ${\bf q}$. In all real vectors, i.e., all coefficient vectors of polynomials, in the following Matlab codes, their components are in the decreasing order: ${\bf q}(1)=q_{m}$, ${\bf q}(2)=q_{m-1}$, ..., ${\bf q}(m)=q_1$, if $q(x)=\sum_{k=0}^{m-1} q_{k+1} x^{k}$. This is opposite to the descriptions in this paper, where they are in the increasing order. In other words, the orders of vector components in the paper and in the following Matlab codes are the reverse of each other. \subsection*{Real Vector Multiplication} \begin{itemize} \item[] $p1$ and $p2$ are are two real vectors of dimension $m$ to multiply. \item[] $p1$, $p2$, and $q$ are row coefficient vectors of polynomials as $p(x)$ and $q(x)$. \item[] $q(x)$ is a minimal polynomial of degree $m-1$. \item[] In a polynomial, the order of $x$ is from high to low. For example, if $p=[2,1,3]$, then $p(x)=2x^2+x+3$. \item[] The output mvec is the product of $p1$ and $p2$. \end{itemize} \vspace{0.3in} function[mvec]=vectormultiply(p1,p2,q) syms x; psize=size(p1); qsize=size(q); mvec=0$\ast$p1; pp1=x.\^{}[psize(2)-1:-1:0]$\ast$p1\'{}; pp2=x.\^{}[psize(2)-1:-1:0]$\ast$p2\'{}; qq=x.\^{}[qsize(2)-1:-1:0]$\ast$q\'{}; pp=pp1$\ast$pp2; [Q,R]=quorem(pp,qq,x); mv=sym2poly(R); mvsize2=size(mv); mvsize=mvsize2(2); mvec(psize(2)-mvsize+1:1:psize(2))=mv; \subsection*{Inverse of a Real Vector} \begin{itemize} \item[] $p$ is a real vector of dimension $m$ to have its inverse. \item[] $p$ and $q$ are row coefficient vectors of polynomials $p(x)$ and $q(x)$, respectively. \item[] $q(x)$ is a minimal polynomial of degree $m-1$. \item[] In a polynomial, the order of $x$ is from high to low. For example, if $p=[2,1,3]$, then $p(x)=2x^2+x+3$. \item[] The output ivec is the inverse of real vector $p$. \end{itemize} \vspace{0.3in} function[ivec]=vectorinverse(p,q) syms x; psize=size(p); qsize=size(q); ivec=0$\ast$p; pp=x.\^{}[psize(2)-1:-1:0]$\ast$p\'{}; qq=x.\^{}[qsize(2)-1:-1:0]$\ast$q\'{}; [g,c,d]=gcd(pp,qq,x); iv=sym2poly(c); ivsize2=size(iv); ivsize=ivsize2(2); ivec(psize(2)-ivsize+1:1:psize(2))=iv;
\section{Introduction} The standard model (SM) of particle physics predicts with great accuracy a tremendous number of experimental results covering a wide energy range up to the TeV scale accessible at the CERN LHC~\cite{LHC}. Still, it does not provide explanations for several key observations such as the existence of dark matter and energy, or the masses of neutrinos. More generally, there exists a number of indications that the SM only corresponds to a low-energy approximation to a more fundamental theory beyond the standard model (BSM). Various BSM models postulate the existence of new particles or mechanisms to address these shortcomings. However the SM does not predict the energy scale at which new physics may appear, and extensive research efforts notably carried out by the ATLAS~\cite{ATLAS} and CMS~\cite{CMS} experiments at the LHC covering a large phase space region did not yet indicate the presence of new physics. The large top quark mass of about 173 GeV and its Yukawa coupling to the Higgs boson close to unity suggest that it may play a special role within the SM, and that its closer study may shed light on the electroweak symmetry breaking mechanism. Many BSM theories predict sizeable deviations of the top quark's couplings with respect to SM predictions. Moreover, most of the canonical top quark processes have now reached the precision era at the LHC, and their uncertainties are systematics-dominated. This motivates carrying out an ambitious research program in the top quark sector in order to reveal new physics effects indirectly through precision measurements. \section{Effective field theory} One of the main theoretical frameworks to interpret potential deviations in a model-independent way is that of effective field theory (EFT). One key assumption of this approach is that the new physics is characterized by some unknown energy scale $\Lambda$ way beyond the energy reach of the LHC. Under this assumption, the SM Lagrangian is expanded with additional operators of higher mass dimensions ($d > 4$) representing new interactions between SM fields, whose coupling strengths are described by Wilson coefficients (WCs). Constraints placed on WCs may then be mapped onto any UV-complete model. An EFT thus offers a well-motivated and general framework to maximize the discovery potential of massive BSM states at the LHC and beyond. For a given basis of operators, i.e. any complete and minimal set of operators at a given order, there is a large number of operators to consider: for instance there are already 59 independent operators impacting the top quark at dimension 6, and this number grows exponentially with mass dimension. Since constraining this huge parameter space would require a wealth of data and the combination of a large number of analyses targeting different final states (which is the ultimate goal), it is natural to make motivated assumptions regarding the nature of new physics to restrict the considered phase space. Most LHC EFT analyses up to now have considered dimension-6 operators only, which are in general expected to describe most new physics effects since higher-order operators are suppressed by powers of $\Lambda$; and operators of dimension 5 or 7 lead to lepton flavor violation and are only relevant in specific analyses. Most useful guidelines and prescriptions on relevant assumptions are provided in a note arising from the LHCTopWG~\cite{saavedra2018interpreting}, which summarizes the fruitful outcomes of a collaboration between theorists and experimentalists. \section{Different approaches to EFT} Within the CMS Top group, four different strategies have been identified and employed so far to constrain EFT operators. They can broadly be classified on a spectrum ranging from post-measurement reinterpretations towards direct EFT measurements carried out at the detector level. In the following, we detail each approach with its pros and cons, and provide recent examples of CMS top quark analyses in which they were adopted. \subsection{Reinterpretation of an inclusive measurement} A first approach consists in reinterpreting a cross section measurement a posteriori. Its value can be parameterized with the EFT operators of interest, which makes it possible to constrain their WCs in a straightforward manner. The main advantages of this approach are its good scalability and its ease of combination with other measurements obtained with any experiment. It also does not require the generation of any dedicated Monte-Carlo simulated sample including the impact of EFT operators. On the other hand, such reinterpretations typically rely on assumptions regarding new physics, which usually does not only impact the cross section itself, but also the kinematic distributions of the objects used in an analysis for event selection and signal extraction. This approach was adopted to reinterpret the cross section measurement of the four-top process by CMS~\cite{4top}. This analysis is particularly challenging since the signal has an expected SM cross section $\sigma(SM) = 9.2$~fb, 5 orders of magnitude smaller than that of the main $t\bar{t}$ background. The four-top process is highly sensitive to four-heavy-quark operators. The signal cross section was parameterized at the generator level with several EFT operators as: \begin{equation} \sigma_{t\bar{t}t\bar{t}} = \sigma_{t\bar{t}t\bar{t}}^{SM} + \frac{1}{\Lambda^2} \sum_k C_k \sigma_k^{(1)} + \frac{1}{\Lambda^4} \sum_{j \leq k} C_j C_k \sigma_{j,k}^{(2)} \, , \end{equation} where the linear terms $C_k \sigma_k^{(1)}$ represent the interference terms of the SM and dimension-6 EFT contributions, while the quadratic terms include two components: the squared contributions from diagrams containing one EFT operator, and the interference terms for two diagrams both including the insertion of one operator. This parameterization was used to translate the measured cross section into 95\% CL upper limits on each individual WC, while marginalizing over the other operators. \subsection{Reinterpretation of an unfolded differential measurement} A second approach consists in reinterpreting a differential measurement unfolded at the generator level. Such reinterpretations may be combined with other results if bin-to-bin correlation matrices are provided, and require the generation of differential Monte-Carlo sample including EFT effects at the generator level. Differential measurements of quantities sensitive to EFT make it possible to also exploit shape information and typically lead to tighter constraints compared to inclusive ones, but ignore the effects that new physics may have on the detector acceptance and selection efficiencies. This procedure was followed in the CMS measurement of the differential $t\bar{t}$ cross section as a function of kinematic observables of the top quarks, of its decay products and of the $t\bar{t}$ system~\cite{tt1}. This analysis targeted the dileptonic opposite-sign final state. The measurements were unfolded both to the parton and particle levels, in full and fiducial phase spaces respectively. The angular separation between the two leptons $\Delta \phi (\ell\ell)$ was simulated at generator level using the RIVET framework and parameterized with the $\mathcal{O}_{tG}$ operator at next-to-leading order (NLO) in QCD. This operator modifies SM vertices and introduces new coupling structures, thus impacting both the yield and kinematics of the $t\bar{t}$ process. It is directly related to the top quark chromomagnetic dipole moment (CMDM), which is predicted to have a small value within the SM and is modified in several BSM models (2HDM, SUSY, technicolor, etc.). Limits were set on $\mathcal{O}_{tG}$ at the particle level at NLO. The higher accuracy in QCD was found to enhance the effects of this operator, and to significantly reduce theoretical scale uncertainties compared to LO predictions. Using the same data and targeting the same final state, a CMS measurement~\cite{tt2} of the differential $t\bar{t}$ cross section performed as a function of polarization and spin correlation observables was used to constrain $\mathcal{O}_{tG}$ via a simultaneous $\chi^2$ fit to several kinematic observables sensitive to spin correlations. Exploiting these powerful variables allowed to improve the sensitivity to $\mathcal{O}_{tG}$ by about 30\% compared to the previous analysis. \subsection{Hybrid measurement performed at detector level} A third approach dubbed ``hybrid measurement'' relies on the EFT parameterization of yields or differential distributions at the generator level; this parameterization is then translated to the detector level under SM assumptions to extract the results. This approach was adopted in a search for new physics targeting the $t\bar{t}$ and $tW$ processes in the dileptonic final state~\cite{np}. Limits on six different operators were extracted from a simultaneous fit to counting experiments and neural network discriminants in several categories. This constituted a first important step towards more global fits wherein EFT effects are considered in more than one process. A CMS measurement of the $t\bar{t}Z$ cross section in $3\ell$ and $4\ell$ final states set limits on several EFT operators using a more involved procedure~\cite{ttz}: first, LO generator level samples were produced on a fine grid over the theory phase space (i.e. both at SM and non-SM points); ratios were computed at different points with respect to the SM prediction to scale the distributions of interest, before applying any event selection; finally, these weights were translated to the detector level and applied to the nominal NLO signal sample to emulate the EFT contributions. The validity of the entire procedure was verified in closure tests. Two-dimensional differential distributions were used to extract limits both within the EFT and anomalous coupling frameworks. \subsection{Direct EFT measurement} Finally the direct measurement approach minimizes the number of SM assumptions to make, and makes it possible to consider EFT effects in all sensitive processes at once. It offers maximal control over correlations and systematic uncertainties. However, it requires the generation of samples including EFT effects up to the detector level. A recent CMS analysis~\cite{top19001} employed this approach for the first time in the top quark sector to constrain a set of 16 relevant operators. It considered EFT effects in five associated production modes of the top quark with gauge and Higgs bosons ($t\bar{t}Z$, $t\bar{t}W$, $tZq$, $t\bar{t}H$, $tHq$) in multilepton final states. Simulated samples including EFT effects were passed through a full simulation of the CMS detector, and events were categorized based on lepton, jet and b jet multiplicities to enhance the separation between different processes. The postfit yields are shown for different categories in Fig.~\ref{fig:1}. Both 1D and 2D limits were extracted for each operator, while either setting the other operators to zero or profiling them. This represents an important step towards direct measurements including EFT effects in all relevant processes. \begin{figure}[!h] \centering \includegraphics[height=9cm]{./Figure_003-c} \caption{Postfit yields in several multilepton categories from Ref.~\cite{top19001}. The yields of five top quark processes are parameterized with 16 different WCs, which get constrained in a fit to the data.} \label{fig:1} \end{figure} \FloatBarrier \iffalse \begin{figure}[htb] \centering \includegraphics[height=1.5in]{magnet} \caption{Plan of the magnet used in the mesmeric studies.} \label{fig:magnet} \end{figure} \begin{table}[t] \begin{center} \begin{tabular}{l|ccc} Patient & Initial level($\mu$g/cc) & w. Magnet & w. Magnet and Sound \\ \hline Guglielmo B. & 0.12 & 0.10 & 0.001 \\ Ferrando di N. & 0.15 & 0.11 & $< 0.0005$ \\ \hline \end{tabular} \caption{Blood cyanide levels for the two patients.} \label{tab:blood} \end{center} \end{table} \fi
\section{Introduction} \label{sec:intro} Lensed quasars can be used to study the quasars themselves, the lensing galaxies, and the intervening and associated intergalactic medium \citep{zahedy}. The best-known use of strongly lensed quasars is measuring the Hubble parameter $H_0$ \citep{refsdal,treumarshall}. While the many applications of gravitational lensing have long been known, their systematic exploitation has been relatively recent, enabled by the advent of multiple wide field surveys, most notably Gaia \citep{delchambre}. A crucial prerequisite for drawing conclusions from lensed quasars is a model for the mass of the lens. There are many possible models and multiple degeneracies among them \citep{schneidersluse} that preclude determination of a unique projected two-dimensional gravitational potential using only four quasar images. In this paper, we explore one such degeneracy, \added{first identified by \citet{kassiolakovner},} between external shear and ellipticity, in a restricted variant of the singular isothermal elliptical potential (SIEP+XS). It is a close cousin of the singular isothermal elliptical mass (SIE+XS) most often used in literature \citep[e.g.][]{kks}. We assume that ellipticity and shear are aligned in the same direction (possibly with different signs). It is a \textit{virtue} of this model that shear and ellipticity are completely degenerate if it is constrained by only the four image positions of a quadruply lensed quasar (henceforth a ``quad''). We show that adding an additional constraint, the measured position of the lensing galaxy, breaks the degeneracy. We then use the measured positions for a sample of single-lens quads to do just this. Shear and ellipticity are the two principal sources of the asymmetry needed for a quadruply lensed quasar. While a singular isothermal sphere (SIS) with no external shear produces only two images, increasing ellipticity or shear increases the probability of having four images \citep{huterer}. Although it is also possible to have ``naked cusps'' with only three images in cases of very high shear ($\gamma > 1/3$), these configurations are known to be very rare among systems discovered so far \citep{finch}. By breaking the degeneracy of shear and ellipticity, we can ascertain, for a given system, which of them plays the larger role in producing four images. Until now the samples available for such an analysis have been small. \replaced{\citet{wong} analyze 6 quads and \citet{shajib} analyze 13. Neither paper}{\citet{kks}, \citet{wong}, and \citet{shajib} analyze, respectively, 4, 6, and 13 quads. None of these papers} explicitly addresses the question, but the precepts described below can be used to determine the relative contributions of ellipticity and shear. The contributions are roughly equal for the \citet{wong} sample but the ellipticities contribute somewhat more in the \citet{shajib} sample. Most of the lenses from both samples are included in the uniform analysis below. In Section \ref{sec:background}, we give an analytic description of the SIEP+XS model, report the main results of \citet{witt1996} and \citet{wynne}, and explain the degeneracy between shear and ellipticity and how they relate to the probability of producing four images. In Section \ref{sec:method}, we explain how we use the model and observed positions of lensing galaxies to estimate the dominant factor in each system. In Section \ref{sec:results}, we describe the results and estimate errors of this method for known single-lens systems. In Section \ref{sec:discussion}, we test our method with a simulated mock \replaced{catalogue}{catalog} created by \citet{oguri} and compare the decompositions obtained on observed systems with the simulated systems. \section{Background} \label{sec:background} \subsection{Restricted SIEP+XS model} The model we use for the lensing potential is \explain{removed unnecessary line break} % \begin{multline}\label{eq:psi} \psi(x,y) = b\sqrt{q_\text{pot}\left(x-x_{g}\right)^2 + \frac{\left(y-y_g\right)^2}{q_\text{pot}}} \\- \frac{\gamma}{2}\left(\left(x-x_s\right)^2 - \left(y-y_s\right)^2\right), \end{multline} % where $\mathbf{r} = (x,y)$ is the position in the plane of the sky in a frame aligned with the axes of the potential, $(x_g, y_g)$ is the position of the lensing galaxy, $(x_s, y_s)$ is the true position of the source (quasar), $b$ characterizes the lens strength, $q_\text{pot}$ is axis ratio of the potential, and $\gamma$ is shear\footnote{Note that shear is centered on the source and not on the galaxy in our model. One model can be obtained from the other by adding a wedge potential, which shifts the images but does not change the relative positions \citep{gorenstein}.}. $\psi$ is the conventional definition of the lens potential: % \begin{equation} \psi(\mathbf{r}) = \frac{D_{ls}}{D_l D_s}\frac{2}{c^2}\int_0^\infty \Phi\left(D_l \mathbf{r}, z\right)\,\mathrm{d}z, \end{equation} % where $\Phi$ is the Newtonian gravitational potential of the lens, $z$ is the line-of-sight coordinate, and $D_l$, $D_s$, $D_{ls}$ are respectively the angular-diameter distances to the lens, to the source, and between the lens and the source, and % \begin{equation}\label{eq:lensequation} \mathbf{r} - \mathbf{r}_s = \boldsymbol{\nabla}\psi(\mathbf{r}) \end{equation} % is the deflection of the image \citep{bourassa1975}. This model has two interesting geometric properties: \begin{enumerate} \item All four image positions, the source, and the center of the lensing galaxy lie on a rectangular hyperbola, described by the equation % \begin{equation}\label{eq:hyperbola} \frac{y-y_s}{x-x_s} = \left(\frac{1+\gamma}{1-\gamma}\right)\frac{1}{q_\text{pot}^2}\frac{y-y_g}{x-x_g}. \end{equation} \item All four images a) lie on an ellipse that is b) aligned with the asymptotes of hyperbola and c) centered on the source d) which itself lies on the hyperbola, described by the equation % \begin{equation}\label{eq:ellipse} \left(x-x_s\right)^2 + \left(\frac{1-\gamma}{1+\gamma}\right)^2 q_\text{pot}^2 (y-y_s)^2 = \frac{b^2q_\text{pot}}{\left(1+\gamma\right)^2}. \end{equation} \end{enumerate} The first property is shown by \citet{witt1996} \added{to hold} for both the SIEP and SIS+XS \replaced{models and the}{models.\footnote{\citet{zhaopronk} describe a broader class of quasi-elliptical models that can be fit by a ``semi-hyperbolic'' curve.} The} second property is shown by \citet{wynne} \added{to hold} for a SIEP model; \replaced{they are also}{both properties also hold} true for our model (as we derive in Appendix \ref{app:geom}). An example of the two properties is shown in Figure \ref{fig:galpos}a. \explain{Changed color bar of Figure 1b to be two-sided.} \begin{figure*}[htb!] \gridline{\fig{rl0147wrap_whitespaced.pdf}{0.348\textwidth}{(a)} \fig{galaxy_predictions.pdf}{0.56\textwidth}{(b)}} \caption{(a) Image positions of system PS J0147+4630 and the best-fit hyperbola and ellipse passing through them. (b) Predicted positions of the galaxy center of system PS J0147+4630 for different values of shear \added{and ellipticity}. $\gamma$ indicates \added{the} position for pure shear ($\eta = 0$), $\eta$ indicates \added{the} position for pure ellipticity ($\gamma = 0)$, the cross marker indicates the observed position, the star marker indicates the predicted position of the source. \added{The offset from the hyperbola is discussed further in Section \ref{sec:method}.}\label{fig:galpos}} \end{figure*} \subsection{Degeneracy of shear and ellipticity} As can be seen from the equation of the second property, the axis ratio of the ellipse passing through the four images (which we will call the ``deflection'' ellipse) is % \begin{equation} \label{eq:qell} q_\text{ell} = \left(\frac{1-\gamma}{1+\gamma}\right) q_\text{pot}. \end{equation} % \deleted{As shown in Appendix \ref{app:imageequivalence}, the same four-image configuration may be produced only with pure shear or an equivalent amount of pure ellipticity (or any combination of them, given that $q_\text{ell}$ is the same).} To handle shear and ellipticity symmetrically, we define \textit{semi-ellipticity} $\eta$ so that $q_\text{pot} = (1-\eta)/(1+\eta)$. It follows that % \begin{equation} \eta \equiv \frac{1-q_\text{pot}}{1+q_\text{pot}} = \frac{e_\text{pot}}{2-e_\text{pot}}, \end{equation} % where $e_\text{pot} = 1 - q_\text{pot}$ is the conventional definition of ellipticity (flattening). Note that for small values of ellipticity, $\eta \approx e/2$. We have also implicitly assumed that $\gamma$ and $\eta$ are parallel; otherwise, they denote components parallel to the effective quadrupole. Equation (\ref{eq:qell}) now rewrites as % \begin{equation} q_\text{ell} = \left(\frac{1-\gamma}{1+\gamma}\right)\left( \frac{1-\eta}{1+\eta}\right), \end{equation} % which makes it clear that a given \replaced{quadruple}{deflection ellipse} can be produced by an equal value of pure shear $\gamma$ or an equal value of pure semi-ellipticity $\eta$ as they produce the same flattening of the \deleted{deflection }ellipse. We also define \textit{effective quadrupole} $\Gamma_\text{eff}$ so that % \begin{equation} q_\text{ell} = \frac{1-\Gamma_\text{eff}}{1+\Gamma_\text{eff}}, \end{equation} % which is the value of shear (or semi-ellipticity) needed to produce a given \replaced{quadruple}{deflection ellipse} if it was a system with pure shear (or pure ellipticity). Introducing semi-ellipticity provides an easy way to determine the dominant cause of asymmetry (flattening of the deflection ellipse) in a given system -- it is the one with a higher absolute value. Note that as we define $q_\text{ell} < 1$, the parameter with a higher absolute value must be positive. \added{If one similarly substitutes the semi-ellipticity for the axis ratio in equation (\ref{eq:hyperbola}) for our hyperbola, one finds that shear and semi-ellipticity do \textit{not} enter in the same functional form. We show in Appendix \ref{app:imageequivalence}, that the \textit{identical hyperbola} is recovered if we simultaneously change the galaxy position.} Paralleling the development in \citet{wynne}, we show that in the aligned frame with the origin at the center of the hyperbola, \added{the position of the galaxy is given by} \begin{equation} \label{eq:xgal} x_g = \left(\frac{1+\gamma}{1-\gamma}\right)\frac{1}{q_\text{pot}^2} x_s \end{equation} and \begin{equation} \label{eq:ygal} y_g = \left(\frac{1-\gamma}{1+\gamma}\right) q_\text{pot}^2 y_s. \end{equation} The same four-image configuration may \added{therefore} be produced\deleted{ only} with pure shear\replaced{ or}{,} an equivalent amount of pure ellipticity\replaced{ (}{, }or any combination of them, given that $q_\text{ell}$ is the same\deleted{)}. \added{A number of investigators have previously reported variants and generalizations of this result. \citet{kassiolakovner} have found that for any assumed circular potential with external shear, there is an elliptical potential of the same functional form with no shear that leaves ``unchanged the qualitative properties of the lensing'', as do all members of a one-dimensional intermediate family. They define a $\gamma^2_\text{inv}$ that reduces to our $\Gamma_\text{eff}$ for the case of aligned shear and no external convergence.} \added{A variant of the \citet{kassiolakovner} result was rediscovered by \citet{wittmao}, who noted that the lens equation for an elliptical power law potential with an aligned external shear can be transformed into the lens equation for an equivalent pure elliptical potential. \citet{jinan} finds that a singular isothermal elliptical mass distribution (SIE) with an external shear can be modeled with an equivalent pure SIE ``provided that the deviation from circular symmetry is small'' and goes on to say that this can be generalized to yielding ``a certain degeneracy'' involving the shear, ellipticity and their relative orientations.} \added{In Appendix \ref{app:imageequivalence} we explicitly exhibit the one-dimensional family of models, including the SIEP ($\gamma = 0$), the SIS+XS ($q_\text{pot} = 1$), and the range of models in between (and beyond) that produce identical image configurations with a common $q_\text{ell}$.} \subsection{Probability of having four images} Although $\gamma$ and $\eta$ are symmetric in terms of the flattening, they do not have symmetric contributions to the probability of producing four images. Assuming a random distribution of visible quasars in the sky \added{and neglecting magnification bias (which is discussed in Section \ref{sec:magbias})}, the probability of a given lens having a quadruply lensed quasar is \deleted{directly }proportional to the area of the \replaced{astroid}{astroidal} caustic -- the region in the sky where a source would be quadruply lensed \citep{finch}. As derived in Appendix \ref{app:caustic}, the area of the \replaced{astroid}{astroidal} caustic of a lens potential described by equation (\ref{eq:psi}) is % \begin{equation} A = \frac{3\pi b^2 \left(\left(1-q_\text{pot}^2\right)+\left(1+q_\text{pot}^2\right)\gamma\right)^2}{8(1-\gamma^2)q_\text{pot}^2} \end{equation} \added{This result is consistent with the result of \citet{jinan} for an SIE with external shear}. As a lowest-order approximation with $|\gamma| \ll 1$ and $|\eta| \ll 1$ we have $q_\text{pot} \approx 1-2\eta$ and % \begin{equation} A \approx \frac{3\pi b^2}{2}\left(\gamma + 2\eta\right)^2 \end{equation} % Therefore, in the limit of small $\gamma$ and $\eta$, shear and ellipticity have equal contributions to the probability of producing a quadruplet if $|\gamma| = |2\eta|$. One way to measure the contributions of $\gamma$ and $\eta$ in the general case is to compare the values of $A(\gamma, \eta=0)$ and $A(\gamma=0, \eta)$. Knowing that $q_\text{pot} = (1-\eta)/(1+\eta)$, we obtain \begin{align} A_\gamma \equiv A(\gamma, \eta=0) &= \frac{3\pi b^2}{2}\frac{\gamma^2}{1-\gamma^2}\\ A_\eta \equiv A(\gamma=0, \eta) &= \frac{3\pi b^2}{2}\frac{4\eta^2}{\left(1-\eta^2\right)^2} \end{align} Henceforth, we will call a system with known $\gamma$ and $\eta$ values \textit{shear-dominated} if $A_\gamma > A_\eta$ and \textit{ellipticity-dominated} if $A_\gamma < A_\eta$. \section{Methodology} \label{sec:method} \explain{Moved equations (\ref{eq:xgal}) and (\ref{eq:ygal}) to Section 2.2} As explained in the previous section, it is not possible to differentiate external shear and ellipticity of the potential in our model using only the four image positions\replaced{. However, the galaxy position needed to produce a given configuration is not the same for different proportions of shear and ellipticity.}{, but they can be differentiated by additionally knowing the galaxy position.} Because $x_s$ and $y_s$ are fixed and uniquely determined by the rectangular hyperbola and the deflection ellipse, \replaced{with}{and} the coefficient \replaced{this time}{is} proportional to $q_\text{pot}^2$ \added{in equations (\ref{eq:xgal}) and (\ref{eq:ygal})} as opposed to $q_\text{pot}$ in equation (\ref{eq:qell}), $x_g$ and $y_g$ are not fixed, even if $q_\text{ell}$ stays fixed. Therefore, if we also know the position of the lensing galaxy, we can estimate the proportion of shear and ellipticity by comparing the observed galaxy position with our model and choosing the proportion that gets the modeled galaxy position closest to it. An example is shown in Figure \ref{fig:galpos}b, where the system appears to be shear-dominated according to our method. We use this method for 39 known quadruply lensed quasar systems with a single lensing galaxy that have accurate data for the positions of the four images and the position of the galaxy, listed in Table \ref{tab:systems} in Appendix \ref{app:positions}. We have excluded systems with multiple lensing galaxies because our model assumes only one lens. To gauge the uncertainty in our estimated proportions of shear and ellipticity, we use both the distance between the true (observed) galaxy position and the hyperbola, as well as the published galaxy position uncertainty, which is especially important for systems with small $\Gamma_\text{eff}$, where the estimated proportion is very sensitive to change in position and having the true position randomly aligned with the hyperbola could lead to a significant underestimation of the uncertainty. We \added{conservatively} take \begin{equation} \Delta \theta = \Delta \theta_d + \Delta \theta_p, \end{equation} where $\Delta \theta_d$ is the angular distance between the true and the best derived galaxy position and $\Delta \theta_p$ is the published uncertainty of the true galaxy position (maximum of $\alpha \cos \delta$ and $\delta$ uncertainty). We then consider a possible predicted galaxy position to be in $1\sigma$ range if its distance from the best derived position is less than $\Delta \theta$, and we estimate $\Delta \gamma$ to be half of the range of the $\gamma$ values in the $1\sigma$ range. Similarly, we consider points on the hyperbola closer than $2\Delta \theta$ to be in $2\sigma$ range. In summary, our method is the following: \begin{enumerate} \item Find the best-fit hyperbola and deflection ellipse passing through the four images (explained in more detail in Appendix \ref{app:fitting}). \item Use the best fit to calculate predicted positions of the galaxy for different shear and ellipticity decompositions in the frame aligned with the asymptotes of the hyperbola using equations (\ref{eq:xgal}) and (\ref{eq:ygal}). \item Convert the predicted positions back to the observed frame and find the one closest to the observed position of the galaxy to determine the best decomposition. \item Use the published galaxy position uncertainty and the distance of the observed and the closest derived position to estimate the uncertainty of our method. \end{enumerate} \explain{This sentence might be misleading without context, because we minimized distances to hyperbola/ellipse, not to intersection points. If we minimized distances to intersection points, then higher weights are possibly not needed.} \deleted{When fitting the hyperbola and ellipse through the images, we used higher weights for images closer to each other because they gave significantly better fits for systems with two very close images (see appendix \ref{app:fitting}).} \section{Results} \label{sec:results} The estimated \replaced{proportions}{shear and ellipticity decompositions} for 31 out of 39 systems with a low enough modeling error ($\Delta \gamma / \Gamma_\text{eff} < 0.5$) are shown in Figure \ref{fig:gammavseta}a. The signs of $\eta$ and $\gamma$ are chosen so that $q_\text{ell} < 1$ (i.e. $\Gamma_\text{eff} > 0$). We conclude that out of the 39 systems: \begin{itemize} \item \textbf{10 are reliably shear-dominated}\\ ($A_\gamma > A_\eta$ for every position in $2\sigma$ range) \item \textbf{5 are provisionally shear-dominated}\\ ($A_\gamma > A_\eta$ for every position in $1\sigma$ range) \item \textbf{13 are uncertain}\\ ($A_\gamma = A_\eta$ for some position in $1\sigma$ range) \item \textbf{5 are provisionally ellipticity-dominated}\\ ($A_\eta > A_\gamma$ for every position in $1\sigma$ range) \item \textbf{6 are reliably ellipticity-dominated}\\ ($A_\eta > A_\gamma$ for every position in $2\sigma$ range) \end{itemize} Estimated \replaced{proportions}{decompositions} for all 39 systems are given in Table \ref{tab:results}. \begin{figure*}[htb!] \gridline{\fig{gamma_vs_eta_useful_with_texts.pdf}{0.47\textwidth}{(a)} \fig{oguri_comparison_with_texts.pdf}{0.47\textwidth}{(b)}} \caption{(a) Estimated shear and ellipticity values of 31 observed single-lens systems with an acceptably low modeling error ($\Delta \gamma / \Gamma_\text{eff} < 0.5$). Black bars indicate estimated $1\sigma$ uncertainty range. (b) Comparison of true and estimated shear and ellipticity components (parallel to the effective quadrupole) of 2233 simulated quadruply lensed quasar systems in the mock \replaced{catalogue}{catalog} of \citet{oguri}. Results have been averaged by dividing the graph into boxes. Black dots and the corresponding numbers show the center and the number of systems in each box. Red dots show the mean estimated decomposition. Their offsets from the black dots show the systematic error. Black bars show the random error (RMS difference). The dotted gray line indicates points where ellipticity and shear contribute equally to the probability of producing four images ($A_\gamma = A_\eta$). \label{fig:gammavseta}} \end{figure*} \startlongtable \begin{deluxetable}{lDDDD} \tablecaption{Estimated shear and ellipticity values of all 39 analyzed single-lens systems \label{tab:results}} \tablehead{ \colhead{System name} & \twocolhead{$\gamma$} & \twocolhead{$\eta$} & \twocolhead{$\Delta \gamma$} & \twocolhead{$\Gamma_\text{eff}$} } \decimals \startdata J0029-3814 & 0.445 & -0.113 & 0.016 & 0.350 \\ J0030-1525 & -0.034 & 0.100 & 0.002 & 0.066 \\ PS J0147+4630 & 0.195 & -0.030 & 0.018 & 0.166 \\ SDSS J0248+1913 & 0.120 & -0.017 & 0.043 & 0.104 \\ ATLAS J0259-1635 & 0.014 & 0.054 & 0.010 & 0.068 \\ DES J0405-3308 & -0.012 & 0.032 & 0.043 & 0.020 \\ DES J0420-4037 & 0.021 & 0.019 & 0.011 & 0.040 \\ HE0435-1223 & 0.049 & 0.026 & 0.019 & 0.075 \\ J0530-3730 & 0.088 & 0.040 & 0.026 & 0.128 \\ J0659+1629 & 0.013 & 0.066 & 0.033 & 0.079 \\ B0712+472 & 0.078 & 0.028 & 0.003 & 0.106 \\ HS0810+2554 & 0.011 & 0.008 & 0.051 & 0.019 \\ RXJ0911+0551 & 0.271 & 0.030 & 0.003 & 0.299 \\ SDSS0924+0219 & 0.041 & 0.017 & 0.005 & 0.058 \\ J1042+1641 & -0.028 & 0.056 & 0.044 & 0.028 \\ PG1115+080 & 0.109 & 0.001 & 0.009 & 0.110 \\ RXJ1131-1231 & 0.118 & 0.020 & 0.011 & 0.138 \\ J1131-4419 & 0.002 & 0.031 & 0.007 & 0.033 \\ J1134-2103 & 0.295 & 0.045 & 0.066 & 0.336 \\ SDSS1138+0314 & 0.110 & -0.010 & 0.019 & 0.100 \\ SDSS J1251+2935 & 0.080 & 0.038 & 0.004 & 0.118 \\ HST12531-2914 & 0.258 & -0.088 & 0.081 & 0.174 \\ SDSS J1330+1810 & -0.030 & 0.078 & 0.012 & 0.048 \\ HST14113+5211 & 0.260 & 0.015 & 0.077 & 0.273 \\ H1413+117 & 0.137 & -0.027 & 0.155 & 0.110 \\ HST14176+5226 & 0.162 & 0.000 & 0.144 & 0.162 \\ B1422+231 & 0.174 & 0.057 & 0.006 & 0.229 \\ SDSS J1433+6007 & 0.162 & 0.032 & 0.036 & 0.193 \\ J1537-3010 & 0.209 & -0.062 & 0.045 & 0.148 \\ PS J1606-2333 & 0.240 & -0.034 & 0.154 & 0.207 \\ J1721+8842 & 0.108 & 0.013 & 0.008 & 0.121 \\ J1817+27 & -0.095 & 0.120 & 0.091 & 0.025 \\ WFI2026-4536 & 0.115 & -0.008 & 0.037 & 0.107 \\ DES J2038-4008 & 0.028 & 0.066 & 0.010 & 0.094 \\ B2045+265 & 0.145 & 0.018 & 0.005 & 0.163 \\ J2100-4452 & 0.034 & 0.037 & 0.012 & 0.071 \\ J2145+6345 & 0.112 & 0.038 & 0.061 & 0.150 \\ J2205-3727 & 0.041 & 0.038 & 0.004 & 0.079 \\ WISE J2344-3056 & -0.163 & 0.229 & 0.147 & 0.069 \\ \enddata \end{deluxetable} \explain{Replaced old section title Discussion} \section{Comparison with simulated catalog} \label{sec:discussion} To test our method and to compare \replaced{the results with what is currently known about lensing galaxies}{our results with the current best estimates of lens properties}, we also use our algorithm to estimate the shear and ellipticity components of simulated quadruply lensed quasar systems in the mock \replaced{catalogue}{catalog} created by \citet{oguri}, which predicts the distribution of such systems in future optical imaging surveys. The mock \replaced{catalogue}{catalog} includes 2233 quadruplets with known image positions and shear and ellipticity values. Because the \replaced{catalogue}{catalog} uses an elliptical mass density model for the galaxies instead of elliptical lensing potential (which is a good approximation for small ellipticities), we first convert the axis ratio of mass density to axis ratio of lensing potential using the relation \begin{equation} q_\text{pot} = \frac{\tan^{-1}\left(\sqrt{1-q_\text{mass}^2}/q_\text{mass}\right)}{\tanh^{-1}\left(\sqrt{1-q_\text{mass}^2}\right)}, \end{equation} which is discussed in more detail in Appendix \replaced{$\ref{app:potmassrelation}$}{\ref{app:potmassrelation}}. Additionally, we only compare the components parallel to the effective quadrupole with our estimates since our model assumes that shear and ellipticity are aligned. If the real shear and semi-ellipticity values are $\gamma_\text{tot}$ and $\eta_\text{tot}$ and the angle between them is $\phi$, we first find the direction of the effective quadrupole by adding two vectors with the same lengths in a double-angled space (where the angle between the two vectors is $2\phi$). We then find the parallel components $\gamma$ and $\eta$ by calculating the projections of the two individual vectors on that direction in the same space. After converting $\gamma_\text{tot}$ and $q_\text{mass}$ to $\gamma$ and $\eta$, we compare these values with the estimates from our algorithm based on the image and galaxy positions. The deviations of predicted and estimated true values are shown in Figure \ref{fig:gammavseta}b, where red dots indicate the systematic error and black bars indicate the random error. We see that the estimated values are generally consistent with the true values, especially for systems with small ellipticity. However, we notice that there is a significant discrepancy between the estimated shear and ellipticity values of observed systems and systems in the mock \replaced{catalogue}{catalog}. We estimate 62\% of the observed systems to be shear-dominated compared to only 10\% of the systems in the mock \replaced{catalogue}{catalog}, which suggests that shear is a more important factor in quadruply lensed systems than has been previously assumed. Even if our method is subject to systematic error, the systematic difference in estimates between observed and simulated systems implies that there are shortcomings in the ranges of ellipticities and shears used by \citet{oguri} to create their mock \replaced{catalogue}{catalog}. We note that \citet{collett} and \citet{goldstein} have used similarly narrow ranges of shears in forecasting the rates of lensed supernovae. The observed range of shears is more nearly consistent with those calculated by \citet{holderschechter} using N-body simulations. In our calculation of the effective quadrupole for the \citet{oguri} \replaced{catalogue}{catalog}, we combine shear and semi-ellipticity as if vectors in our double-angled space. Figure \ref{fig:gammavseta}b shows that the systematic errors in the relative contributions of shear and ellipticity to the effective quadrupole are small. The perpendicular components of shear and semi-ellipticity affect the image positions differently, but for the extreme case with $\gamma = \eta$ at $45^{\circ}$ to each other, those non-cancelling perpendicular components are only half the size of effective shear. For the \citet{shajib} sample, the average difference between the total shear and its component projected onto the effective shear \added{is} $0.015$. The corresponding average for the semi-ellipticity is $0.010$. While we attribute the difference between Figures \ref{fig:gammavseta}b and \ref{fig:gammavseta}a to errors in the underlying intrinsic shear and ellipticity distributions adopted by \citet{oguri}, one must ask whether differential selection effects might contribute to that difference. \replaced{The mock lens catalogue has a magnitude limit on the third brightest lensed image and a minimum separation between the two most distant images. \citet{finch} show that the mean magnification for purely sheared systems is roughly a factor of two larger than for purely flattened systems. We suspect that this also applies to the individual images for a given hyperbola and ellipse. The unmagnified limiting magnitude for a pure shear system is therefore $0.75$ magnitudes fainter than for a pure ellipticity system. But the area of a pure shear caustic (and hence the cross section for quadruple lensing) is one quarter that of a pure ellipticity caustic. Therefore, the surface density of quasars must increase as $10^{0.8m}$ -- much more rapidly than observed at the relevant apparent magnitudes -- for the two effects to cancel. The mock catalogue therefore favors flattened systems. The observed sample is drawn from many different surveys, each with different magnitude and separation criteria, but the flux from the third brightest image and the largest separation (or perhaps the larger distance of the two brighter images from the third) are likely to have played a similarly dominant role in their selection. The observed sample is somewhat brighter, so the additional magnification of the sheared systems may have figured more prominently, but not enough to account for an increase from 10\% shear prevalence to 62\%.} {The mock lens catalog has a magnitude limit on the third brightest lensed image and a minimum separation between the two most distant images. The observed sample is drawn from many different surveys, each with different magnitude and separation criteria, but the flux from the third brightest image and the largest separation (or perhaps the larger distance of the two brighter images from the third) are likely to have played a similarly dominant role in their selection. It is therefore not obvious how differences in selection effects would offset the mock and observed lenses from each other.} \section{Magnification bias}\label{sec:magbias} \added{While the magnification selection effects for our observed sample may not be different from those of the mock catalog, such effects \textit{do} affect the location of \textit{the boundary} between ellipticity and shear dominated systems.} \added{\citet{finch} show that the mean magnification for purely sheared systems is roughly a factor of two larger than for purely flattened systems. We suspect that this also applies to the individual images for a given hyperbola and ellipse. The unmagnified limiting magnitude for a pure shear system is therefore $0.75$ magnitudes fainter than for a pure ellipticity system.} \added{But the area of a pure shear caustic (and hence the cross section for quadruple lensing) is one quarter that of a pure ellipticity caustic. Therefore, the surface density of quasars must increase as $10^{0.8m}$ -- much more rapidly than observed at the relevant apparent magnitudes -- for the two effects to cancel. If they did exactly cancel, the opening angle between the dotted lines in Figures \ref{fig:gammavseta}a and \ref{fig:gammavseta}b would be $90^\circ$ rather than $45^\circ$. For a less steep rise in the number magnitude relation, the opening angle would be only somewhat larger than $45^\circ$. This would lead to a correspondingly stronger conclusion regarding shear dominance.} \section{Conclusion} Using the geometric properties of the \added{restricted} SIEP+XS model, we analyzed 39 observed quadruply lensed quasar systems with a single lensing galaxy. Comparing the observed galaxy center with the model, we estimated the shear and ellipticity components parallel to the effective quadrupole for each system. Using the deviation between the \replaced{true}{known input} and model galaxy position as well as the published uncertainty, we estimated the uncertainty of each decomposition and found that 15 systems out of 39 are reliably or provisionally shear-dominated while 11 systems are reliably or provisionally ellipticity-dominated. We also tested our method with the simulated mock \replaced{catalogue}{catalog} of \citet{oguri} and while the decompositions seem to be mostly consistent with the true shear and ellipticity values, the systematic difference between observed and simulated systems suggests that the effect of external shear has been underestimated in creating the mock \replaced{catalogue}{catalog}. \added{\citet{oguri} have made their code available and it would appear to be a straightfoward matter to adjust the parameters governing the mean ellipticity and mean shear. We would suggest that users of their code iterate on their input parameters so as to yield a selected median semi-ellipticity of $0.05$ and a selected median shear of $0.12$. Decreasing the input ellipticity and increasing the input shear will have opposite effects on the total number of selected systems.} \acknowledgements We thank Drs. Philip Marshall and Masamune Oguri for comments on the manuscript. This research is based on observations made with the NASA/ESA Hubble Space Telescope obtained from the Space Telescope Science Institute, which is operated by the Association of Universities for Research in Astronomy, Inc., under NASA contract NAS5-26555, as part of programs HST-GO-15320 and HST-GO-15652. \clearpage
\section{Introduction} \label{Section 1: Introduction} \subsection{Thermoacoustic instability in can-annular combustors} \zw{Thermoacoustic instabilities} are caused by the constructive interaction of unsteady combustion and the acoustics of the chamber. This dynamic phenomenon is highly undesirable because it crucially restricts the operating range of the engine \cite{keller95} and it remains a major challenge to the development of high-performance, low-emission combustion systems, in particular stationary gas turbines \tr{\cite{POINSOT20171}}. For examples of an experimental investigation of a thermoacoustic instability caused by a practical swirling flame, the reader is referred to \cite{Paschereit20001025}. Nonlinear dynamics of free and forced self-excited turbulent premixed flames are studied experimentally in \cite{LI2013947,BALUSAMY20153229}, respectively. \nc{Passive damping of the resulting pulsations can be achieved by perforated liners \cite{Zhao2011725liner} or Helmholtz dampers \cite{Zhao20091672helmholtz}}. \nc{A discussion on the application of Helmholtz dampers in gas turbine combustors was given in \cite{Bellucci2004271}. Feedback control of combustion oscillations was applied in \cite{Evesque20031709,Li2016} and reviewed in \cite{Dowling2005151}.} \dr{Instabilities can occur due to interaction of the flames with low-frequency eigenmodes of the combustion chamber, with respect to which the flames are compact (see, e.g., \cite{crocco1951aspects,keller1985thermally,schuller_poinsot_candel_2020}), or with high-frequency transversal eigenmodes of the chamber, with respect to which the flames are non-compact (see, e.g., \cite{OCONNOR20151,hummel2016theory,BUSCHHAGEN20195181}). We restrict ourselves to the former case in this work. } \zw{The study of thermoacoustic instabilities dates back to the work of \cite{Rayleigh1878explanation}.} While much research over the last decade in this field has been devoted to understanding the fundamental phenomena associated with thermoacoustic instabilities in \textit{annular} combustors \fc{(see, e.g., \cite{Noiray2013dynamicnature,Ghirardo2013})}, present high-efficiency H-class gas turbines exclusively feature \textit{can-annular} combustor architectures. In this type of system, combustion takes place in a number of cans (typically 12 or 16), without any thermodynamic coupling between the cans. \tr{Yet, the} annular turbine inlet, common to all cans, provides for \fc{aeroacoustic} coupling between adjacent cans. \fc{Acoustic} coupling also occurs through the plenum, affecting especially azimuthal modes. However, the pressure drop across the can burners can, to a certain extent, decouple the plenum acoustics from the can acoustics. Although not always present in gas turbine designs, crossfire tubes between the cans also allow for acoustic coupling. \zw{There exist concepts for future applications to integrate the first vane into the individual cans, which would acoustically decouple the cans at their outlet \cite{Rosic10}. } \zw{Only} little literature exists on the subject \tr{of thermoacoustic instabilities in can-annular combustors}. Nonetheless, work performed at Siemens \cite{bethke2002thermoacoustic,krebs2005thermoacoustic,Kaufmann08,Farisco17}, General Electric \cite{Bethke19,MOON2020178,MOON2021295} and Ansaldo Energia Switzerland \cite{ghirardo18,ghirardo2020effect} shows that industry itself has started investigating the physics of can-annular combustors. In their numerical study, \cite{bethke2002thermoacoustic} use the \tr{finite element method (FEM)} and the Helmholtz equation to describe the effect of the can-to-can coupling. Practical aspects of the design of industrial can-annular combustion chambers are discussed in \cite{krebs2005thermoacoustic}. In \cite{Kaufmann08}, mode shapes measured from a single-can test rig are successfully compared to a model of a quarter of an engine with 16 cans in total. Compressible large-eddy simulations (LES) are employed by \cite{Farisco17} to model the coupling between the fluid dynamics and acoustics to study the reflection coefficient and transfer functions between neighboring cans. \cite{Bethke19} combine LES with a reduced-order network model to analyze the dynamics of push-push and push-pull modes in a two-can combustor. \ei{The difference between the push-push and push-pull mode are that the former describes acoustic pressure oscillations where all cans are synchronized (in phase), while for the latter there is a phase difference of $\pi$ between neighboring cans.} In the latter reference, the authors test various mitigation strategies for thermoacoustic instabilities, such as fuel split variations, fuel injection location change from nozzle to nozzle within each can and cross-talk blockage. They demonstrate experimentally that these measures significantly reduce the acoustic pressure amplitudes generated by the investigated modes. \cite{MOON2020178} analyze experimentally the thermoacoustic dynamics of a four-can system. From the results, the conclusion is made that ``longitudinal-mode instabilities in a can-annular combustion system will preferentially emerge in the form of out-of-phase interactions''. On the same experimental setup, \cite{MOON2021295} study the effect of rotational asymmetry on the thermoacoustics of their can-annular system. We also mention the recently published experimental study of \cite{JEGAL2020}, who investigate the influence of non-identical flame transfer functions (FTFs) in two coupled can combustors on the development of self-excited thermoacoustic oscillations. \zw{\cite{ghirardo18} present a network model where an assumed impedance boundary condition (BC) is used to quantify the influence of the purely reactive can-to-can communication on the frequency spectrum and on the nature of the modes that appear in the can-annular combustor. The effect of asymmetry of the FTF, i.e. each of the cans exhibits its own FTF, is also explored in their work. The mode shapes in the cans are computed numerically with the FEM from the Helmholtz equation. A subsequent work investigates the influence of noise and nonlinearities in the same model \cite{ghirardo2020effect}. A similar approach is adopted by \cite{YOON2020115774}, who develops a low-order network model of a can-annular combustor with 12 cans. He uses an empirical expression to model the acoustic coupling, and successfully compares mode shapes obtained from his low-order model to FEM simulations of the Helmholtz equation. In \cite{vonSaldern2020analysis}, a FTF is computed from a solver based on the G equation to model the heat release fluctuations of the flame and the Rayleigh conductivity of a compact circular aperture with bias flow is used for the (purely reactive) acoustic can-to-can coupling. The authors study the linear stability of the modeled can-annular combustor. In their follow-up study, they investigate thermoacoustic limit cycles with the same model \cite{vonSaldern2020nonlinear}.} \nc{The dynamics of two coupled thermoacoustic oscillators under asymmetric forcing is investigated in \cite{Sahay2021}.} \nc{In two recent studies, the can-annular system is simplified to a network model, where the azimuthal pressure dynamics are represented by the coupling of longitudinal acoustic modes through compact apertures \cite{Fournier2021_1,Fournier2021_2}. In the latter study, the same Rayleigh conductivity is used as in \cite{vonSaldern2020analysis}, and the model equations are simplified using Bloch boundary conditions to study the coupling in more detail. Focusing on reactive coupling effects, the modeled phase response of the connecting gap is successfully compared to experiments.} In the present work, a coupled oscillator model is combined with Howe's Rayleigh conductivity of a turbulent wake in a rectangular aperture of thickness $h$ \cite{HOWE1997} to perform a linear stability analysis of an idealized can-annular combustor. \nc{Similar to Ref. \cite{Fournier2021_2}, we assume longitudinal thermoacoustic modes in the cans which communicate through such compact apertures, and we don't resolve in more detail the azimuthal pressure dynamics.} We provide below elementary first-principles calculations to quantify the validity range of this assumption. For this, we consider plane waves propagating in two identical acoustic waveguides of length $L$ closed at one of their ends and connected by a duct, a generic system which is obtained by ``unwrapping'' two coupled cans (see Fig. \ref{Figure 0}). From the linearized mass and momentum balances and with the assumptions of lossless one-dimensional (1D) propagation and compact area expansion at both sides of the connecting duct of length $d$, we can write the transfer matrix between the acoustic pressure and velocity at $x=0$ and at $x=L+d$ as \begin{eqnarray} && \begin{pmatrix} p(0)\\ \rho c u(0) \end{pmatrix}= \nonumber\\ &&\overbrace{\begin{pmatrix} \cos{kL} \cos{kd}-\mathcal{R} \sin{kL}\sin{kd} & i \cos{kL}\sin{kd}+i\mathcal{R}\sin{kL}\cos{kd}\\ i \sin{kL}\cos{kd}+i\mathcal{R}\cos{kL}\sin{kd} & -\sin{kL}\sin{kd}+\mathcal{R}\cos{kL}\cos{kd} \end{pmatrix}}^{\boldsymbol{M}}\begin{pmatrix} p(L+d)\\ \rho c u(L+d) \end{pmatrix}, \nonumber \end{eqnarray} where $p=p(x)$ and $u=u(x)$ are the acoustic pressure and velocity, respectively, $x$ is the longitudinal coordinate, $k$ is the wavenumber, $\rho$ is the ambient density, $c$ is the ambient speed of sound, $\mathcal{R}=A_a/A$ is the area ratio, $A$ is the cross-section area of the waveguides and $A_a$ is the cross-section area of the connecting duct. Under the same assumptions, we can then write the transfer matrix $\mathcal{M}$ between $x=0$ and $x=2L+d$, where \begin{eqnarray} \boldsymbol{\mathcal{M}}=\begin{pmatrix} M_{11}\cos{kL}+M_{12}(i\sin{kL}/\mathcal{R}) & M_{11}(i\sin{kL})+M_{12}(\cos{kL}/\mathcal{R})\\ M_{21}\cos{kL}+M_{22}(i\sin{kL}/\mathcal{R})& M_{21}(i\sin{kL})+M_{22}(\cos{kL}/\mathcal{R}) \end{pmatrix}. \end{eqnarray} If now $kd\ll 1$, the following approximation holds: \begin{equation} \boldsymbol{M}\approx \begin{pmatrix} \cos{kL}-kd \mathcal{R}\sin{kL} & i kd \cos{kL}+i\mathcal{R}\sin{kL}\\ i \sin{kL}+i k d\mathcal{R}\cos{kL} & -k d \sin{kL}+\mathcal{R}\cos{kL} \end{pmatrix}. \end{equation} For brevity, we write now $p(0)\rightarrow p_1$, $u(0)\rightarrow u_1$, $p(2L+d)\rightarrow p_2$ and $u(2L+d)\rightarrow u_2$. Assuming $u_2=0$ (velocity node at the end of the second can), the normalized impedance $Z_1=p_1/\rho c u_1$ is given by the ratio $\mathcal{M}_{11}/\mathcal{M}_{21}$. If we assume that the upstream end of the first can is also closed, then $Z_1\rightarrow \infty$, or $\mathcal{M}_{21}\rightarrow 0$, which leads to the following characteristic equation: \begin{equation} 2\sin{kL}\cos{kL}+kd\Big[\mathcal{R}\cos^2{kL}-\dfrac{1}{\mathcal{R}}\sin^2{kL}\Big]=0, \label{Compactness condition} \end{equation} whose roots are the eigenfrequencies of the pair of coupled cans sketched in Fig. \ref{Figure 0}. We now examine in which parameter range this condition will be satisfied. We begin with the limit case of completely separated cavities, $\mathcal{R}\rightarrow 0$. One solution satisfying Eq. \eqref{Compactness condition} is $\sin{kL}=0$, which corresponds to the half-wavelength mode of a single can, with wavelength $\lambda\approx2L$. If now, in addition to $kd\ll 1$, $kL \ll 1$, we have $k=\sqrt{2 A_a/V_\mathrm{w} d}$, where $V_\mathrm{w}$ is the volume of a single waveguide, corresponding to a Helmholtz mode of two resonators in series, each with volume $V_\mathrm{w}$, neck length $d$ and cross section $A_a$. In the general case, after some algebra and replacing the duct length $d$ with $D=d+2l_c$, where $l_c$ is the end correction at one end of the compact coupling duct of length $d$ \cite{howe2014acoustics}, Eq. \eqref{Compactness condition} can be rearranged to yield $\tan{\mathrm{H}_L}=(1\pm \sqrt{5})/(\mathrm{H}_L \dfrac{D}{L \mathcal{R}} )$, where only the positive root is physically relevant, $\mathrm{H}_L=\omega L/c$ is the Helmholtz number and $\omega=k c$. The end correction can be roughly approximated by the hydraulic radius: $l_c\approx \sqrt{A_a/\pi}$, and in the limit case of a thin orifice $D\rightarrow 2\sqrt{A_a/\pi}$. We note, however, that $l_c$ is also affected by the aeroacoustic coupling between the cans, which may increase or decrease the effective attached mass at the aperture and which will be investigated in the following sections of this paper. We now consider a third limit case: For small $D /L \mathcal{R}\ll 1$ but moderate $\mathcal{R}\approx 1$, i.e., when the duct between the waveguides is very short and nearly open, we infer from Eq. \eqref{Compactness condition} that $\mathrm{H}_L\approx \pi/2$, which corresponds to the half-wavelength mode of a double cavity with wavelength $\lambda\approx4L$. These results are illustrated in Fig. \eqref{Figure 0}. Shown are the right-hand-side (RHS) and left-hand-side (LHS) of Eq. \eqref{Compactness condition} for $D /L \mathcal{R}=0.1$ and $5$. Conditions representative of the limiting cases analyzed above are denoted by $\textbf{A}$, $\textbf{B}$ and $\textbf{C}$, respectively. $\textbf{A}$ corresponds to the weakly coupled case with Helmholtz modes in the cavities, $\textbf{B}$ is the weakly coupled case with half-wavelength modes in the coupled cavities, and $\textbf{C}$ is the case of a nearly open duct, also with $D/L\ll 1$, filled by a half-wavelength mode spanning both cavities. The present study is concerned only with cases $\textbf{A}$ and $\textbf{B}$, which correspond to the weak coupling scenarios, for which the diameter and the effective length of the connecting aperture are small with respect to both the can length and the can diameter. Importantly, we note that $\textbf{A}$, $\textbf{B}$ and $\textbf{C}$ may be identified as push-pull modes, when, in the former two cases, the phase difference between the oscillation of the modes in both cavities happens to be exactly $\pi$, and because in the latter case the acoustic pressure on either side of the aperture always satisfies this phase condition. Therefore, when we denote some phase pattern by the push-pull mode in our study below, this should not be understood in an exclusive sense, but in the context of the parameter range considered in this work ($\mathcal{R}<D/L< 1$). \begin{figure}[!t] \begin{psfrags} \psfrag{a}{$0$} \psfrag{b}{$15$} \psfrag{c}{$30$} \psfrag{d}{$0$} \psfrag{e}{$\pi$} \psfrag{f}{$2\pi$} \psfrag{g}{$A$} \psfrag{h}{$A_a$} \psfrag{i}{$L$} \psfrag{j}{$d$} \psfrag{k}{$L$} \psfrag{l}{ \textbf{A} Helmholtz mode } \psfrag{m}{\begin{tabular}{@{}l@{}} \textbf{B} Half-wave, single cavity ($\lambda\approx 2L$) \\ $\dfrac{D}{L}$ small, nearly closed ($ \mathcal{R}< \dfrac{D}{L}< 1$) \end{tabular}} \psfrag{n}{\begin{tabular}{@{}l@{}} \textbf{C} Half-wave, double cavity ($\lambda\approx 4L$) \\ $\dfrac{D}{L}$ small, nearly open ($\mathcal{R}\approx 1$) \end{tabular}} \psfrag{o}{\textbf{A}} \psfrag{p}{\textbf{B}} \psfrag{q}{\textbf{C}} \psfrag{r}{$0.1$} \psfrag{s}{$0.1$} \psfrag{t}{$\dfrac{D}{L\mathcal{R}}$} \psfrag{u}{$5$} \psfrag{v}{$x$} \psfrag{w}{$\textcolor{cgr}{\boldsymbol{\tan{\mathrm{H}_L}}}=\textcolor{cor}{\boldsymbol{\dfrac{1+ \sqrt{5}}{\mathrm{H}_L \frac{D}{L\mathcal{R}} }}}$} \psfrag{A}{$0.2$} \psfrag{x}{$\mathrm{H}_L$} \psfrag{B}{$D=d$ $+$ end corrections,\quad $\mathcal{R}=A_a/A$} \psfrag{C}{$u=0$} \psfrag{Z}{\begin{tabular}{@{}l@{}} Weak \\ coupling \end{tabular}} \psfrag{W}{\begin{tabular}{@{}l@{}} Strong \\ coupling \end{tabular}} \centerline{\includegraphics[width=0.9\textwidth]{Figure_0.eps}} \end{psfrags} \caption{Graphical representation of the equation defining the eigenfrequencies of two coupled cavities of cross-section area $A$ connected by a duct of cross-section area $A_a$. Shown are the RHS and LHS of Eq. \eqref{Compactness condition} for $D /L\mathcal{R}=0.1$ and $5$. Conditions illustrating the three limit cases are denoted by $\textbf{A}$, $\textbf{B}$ and $\textbf{C}$, respectively. $\textbf{A}$ corresponds to the low-frequency coupling involving Helmholtz modes in the cavities. This is a weak coupling scenario. $\textbf{B}$ is also a weakly coupled scenario with half-wavelength modes in the coupled cavities with small aperture (small $\mathcal{R}$) such that $\mathcal{R}<D/L<1$, and $\textbf{C}$ is the case of strong coupling with large aperture and thus $\mathcal{R}$ approaching $1$, which leads to half-wavelength mode along both cavities combined. The present study is concerned only with the limit cases $\textbf{A}$ and $\textbf{B}$.}\label{Figure 0} \end{figure} By taking into account the acoustic-hydrodynamic interaction in the apertures between the cans, we observe resistive effects due to the coupling which have either been neglected or not investigated in detail in previous studies \cite{ghirardo18,ghirardo2020effect,YOON2020115774,vonSaldern2020analysis,vonSaldern2020nonlinear,Fournier2021_1,Fournier2021_2}. Our model describes simultaneously the can acoustics and the turbulent wake dynamics in the apertures. Previous works on thermoacoustic instabilities in can-annular combustors paid less attention to the fluid dynamics underlying the coupling and more to the flame dynamics in the individual cans, which were modeled with more complex FTFs. By shifting the focus to the coupling, we aim to better understand the intriguing thermoacoustics that result from the collective behavior of the cans. \subsection{Acoustic coupling between neighboring cans} \vi{For low Mach numbers, the fluid motion in the apertures between the cans can be approximated as incompressible (see p. 33 in \cite{howe_1998}). By Howe's energy corollary, vorticity fluctuations in an incompressible, turbulent shear layer or wake can increase or decrease the acoustic energy of a sound field they interact with \cite{Howe1980407}. In our model, the Rayleigh conductivity $K_R$ describes the interaction between the can acoustics and the turbulent wake in the aperture between the cans. $K_R$ has dimension length. In Howe's theory of flow-excited deep cavity oscillations, positive imaginary and real parts of $K_R$ are associated with amplification of the sound field by the mean flow and reduction of the oscillation frequency, respectively (see p. 443 in \cite{howe_1998}).} \dr{To compute $K_R$, we follow Howe's derivation for uniform, two-sided grazing turbulent flow over a rectangular aperture of thickness $h$ \cite{HOWE1997}. Rayleigh conductivity models for different geometries are found, e.g., in chapters 5 and 6 of \cite{howe_1998}. The centerpiece of the model is a turbulent wake of thickness $h$, the can spacing, which is bounded by two vortex sheets. The wake separates the hot gas streams of adjacent cans. This is an idealized model for the turbulent fluid motion in the aperture. The (complex) displacement of the vortex sheet $\zeta$ represents the coherent (at the acoustic frequency) vorticity fluctuations in the aperture that arise from the forced motion of the turbulent wake.} \zw{From the Rayleigh conductivity, we can compute the acoustic impedance, which appears in the BCs of the Helmholtz equation governing the can acoustics \cite{jing1999experimental,SUN2002557,Tiemo20}. } \zw{The model for the acoustic coupling is sketched in Fig. \ref{Figure 1}. Figure \ref{Figure 1}\textbf{(a)} shows the turbine inlet at $\tilde{x}=0$, the casings of the 12 cans, the local and global coordinate systems $(x,y,z)$ and $(\tilde{x},\tilde{y},\tilde{z})$, respectively, the thickness $h$ of the casing of neighbouring cans, the height of the coupling aperture $B$ and the width of the cans at the turbine inlet $C$. Figure \ref{Figure 1}\textbf{(b)} shows a typical mean axial velocity profile in the aperture, the bulk velocity of the combustion products $U_\mathrm{tot}$ and the real part of the vortex sheet displacement $\mathrm{Re}(\zeta)$.} \begin{figure}[!t] \begin{psfrags} \psfrag{a}{\footnotesize \textcolor{green1}{\bf First row of turbine vanes}} \psfrag{b}{\footnotesize \textcolor{violet}{\bf Casing of neighbouring cans}} \psfrag{A}{\hspace{1.5cm} \small \bf (a) Axial view of turbine inlet} \psfrag{B}{\hspace{1cm} \small \bf (b) Radial view of can outlet and turbine inlet} \psfrag{c}{$\tilde{z}$} \psfrag{d}{$\tilde{y}$} \psfrag{e}{$\tilde{x}$} \psfrag{f}{\textcolor{purple1}{$C$}} \psfrag{g}{\textcolor{purple1}{$B$}} \psfrag{h}{\textcolor{purple1}{ $h$}} \psfrag{i}{$z$} \psfrag{j}{$y$} \psfrag{y}{$x$} \psfrag{k}{\footnotesize \bf \textcolor{brown1}{ \begin{tabular}{@{}c@{}} High Mach \\ region \end{tabular}}} \psfrag{l}{\hspace{-5.3cm} \bf \footnotesize \textcolor{darkblue1}{\begin{tabular}{@{}c@{}} Mean \\ axial\\ velocity \end{tabular}}} \psfrag{m}{\footnotesize \bf \textcolor{lightblue2}{\begin{tabular}{@{}c@{}} Turbulent \\ wake \end{tabular}}} \psfrag{n}{\footnotesize \bf \textcolor{orange1}{Vortex sheet}} \psfrag{o}{\textcolor{darkblue1}{$U_\mathrm{tot}$}} \psfrag{p}{\textcolor{darkblue1}{$0$}} \psfrag{q}{\hspace{0.1cm}\footnotesize \bf \textcolor{gray}{ \begin{tabular}{@{}c@{}} Low Mach \\ region \end{tabular}}} \psfrag{r}{ \textcolor{orange1}{ $\mathrm{Re}(\zeta)$}} \psfrag{s}{$x$} \psfrag{t}{\textcolor{purple1}{$W$}} \psfrag{u}{$y$} \psfrag{v}{\textcolor{purple1}{$h$}} \psfrag{w}{$z$} \psfrag{x}{$0$} \centerline{\includegraphics[width=1\textwidth]{Figure_1.eps}} \end{psfrags} \caption{\zw{Sketch of the model for the acoustic coupling between the cans. \textbf{(a)} Turbine inlet at $\tilde{x}=0$ and the casings of the 12 cans. Shown are the local and global coordinate systems $(x,y,z)$ and $(\tilde{x},\tilde{y},\tilde{z})$, respectively, the thickness $h$ of the casing of neighbouring cans, the height of the coupling aperture $B$ and the width of the cans at the turbine inlet $C$. \textbf{(b)} Sketch of the turbine inlet region, showing a typical mean axial velocity profile in the aperture, the bulk velocity of the combustion products $U_\mathrm{tot}$ and the real part of the vortex sheet displacement $\mathrm{Re}(\zeta)$. }}\label{Figure 1} \end{figure} \zw{In the model, vorticity disturbances are advected at a constant mean axial velocity $U<U_\mathrm{tot}$. We assume that $U$ and $U_\mathrm{tot}$ are related by $U=U_\mathrm{tot}/2$. This approximation accounts for the sharp drop-off of the mean flow speed in the presence of the turbulent boundary layer at the wall.} \ei{Due to this drop-off, vorticity fluctuations in the aperture are advected at a lower speed than the bulk velocity $U_\mathrm{tot}$.} The assumption that $U=U_\mathrm{tot}/2$ is now briefly discussed. According to Howe, ``the fluid within the volume of the aperture [$\dots$] is assumed to be in a mean state of rest'' \cite{HOWE1997}. This motivates the choice for $U$: inside the aperture, $U\approx0$, while far away from the wall, $U\approx U_\mathrm{tot}$. At the edge of the turbulent wake, we approximate $U$ by $U_\mathrm{tot}/2$, which is in agreement with classical estimates in literature (see p. 456 in \cite{howe_1998}). To further justify this assumption, we compare Fig. 10 in \cite{CHEN2020115547} (measured acoustic impedance of a rectangular slot) to Fig. 4 in \cite{Howe1996} (Rayleigh conductivity for a rectangular slot). In the former work, $\mathrm{Re}(Z)$ has a first local minimum at around (a) $\omega W/U_\mathrm{tot}\approx2$. In the latter work, $\mathrm{Im}(K_R)$ has a local maximum around (b) $\omega W/2U\approx2.4$. Assuming (a) and (b) describe the same point ($\mathrm{Im}(K_R)>0$ or $\mathrm{Re}(Z)<0$ both imply amplification of the sound field by the mean flow in the aperture \cite{Tiemo20}), this implies $U/U_\mathrm{tot}\approx0.42$ for the experiments of \cite{CHEN2020115547}. We also mention the study in \cite{Tiemo20}, where a Rayleigh conductivity model was calibrated to experimental results to obtain a predictive model of the acoustic impedance of a side branch aperture. After calibration, the value of $U/U_\mathrm{tot}$ obtained therein is within $1$ percent of $0.5$ ($U$ corresponds to $U_-$ in their notation). \vi{The present study focuses on the perturbation of the frequency spectrum of a ring of thermoacoustic oscillators by mean flow effects on the acoustic coupling. We note that in reality, when a thermoacoustic instability occurs and the sound field reaches finite amplitudes, the acoustics lead to changes of the mean flow itself, and the problem becomes nonlinear. The nonlinear saturation of a forced shear layer over a T-junction by large-amplitude acoustic forcing was studied numerically in \cite{boujo_bauerheim_noiray_2018}. Their results are consistent with aeroacoustic experiments on a similar configuration presented in \cite{bourquard_faure-beaulieu_noiray_2021}. Such nonlinear effects are neglected in the present work, which is restricted to linearized dynamics. \nc{We mention that aeroacoustic characterization of T-junctions based on LES and system identification is performed in \cite{Foller2010}.}} \subsection{Bloch modes} \zw{We now turn to a different topic, which is also central to this work. Bloch wave theory was developed in the $20$th century to model the wave-like behavior of electrons in crystal lattices, where they are subject to a periodic potential due to the atoms \cite{bloch1929quantenmechanik}. A more modern account of the theory is found, e.g., in \cite{kittel1996introduction}. The main result states that in a perfectly periodic Hermitian system, in our case the Helmholtz equation, the wave function, in our case the acoustic pressure $\hat{p}$, can be written as a plane wave with periodic amplitude. } \cite{mensah2016efficient} have extended Bloch wave theory to thermoacoustic systems by making use of inherent discrete rotational symmetries of typical combustion chamber designs to compute thermoacoustic eigenmodes of an annular combustor. By imposing periodic BCs, they obtain a significant reduction of the computational effort for determining the thermoacoustic modes in their system. Their results were used by \cite{ghirardo18} to derive equivalent BCs in their study of the thermoacoustic modes \zw{in} a can-annular combustor. The same theory was also applied by \cite{Haeringer19} in the time domain to reduce the computational cost of fluid dynamics simulations for the modelling of limit cycle oscillations in (can-)annular combustors. \cite{haeringer2020strategy} employ Bloch wave theory to derive equivalent reflection coefficients that represent the can-to-can coupling. They propose a strategy to impose such reflection coefficients at the acoustic terminations of a single-can test rig by installing passive acoustic elements such as straight ducts or Helmholtz resonators, to mimic the thermoacoustic behavior of a full engine. \zw{In our application of Bloch wave theory, we follow the approach presented by \cite{vonSaldern2020analysis}, who use a Bloch wave ansatz to derive equivalent boundary conditions for a modeled can-annular combustor in the frequency domain. This enables the analysis of a can-annular system by considering a single can, thus reducing the number of equations by a factor $N$. Indirect experimental evidence of Bloch modes in real-world gas turbines is provided by the spectrograms shown in Fig. 8 of \cite{ghirardo18}, where pressure signals from different cans were decomposed into Bloch modes using the discrete Fourier transform. Direct evidence of Bloch modes occurring in a four-can system, showing wave-like phase patterns along the annulus, is presented in Figs. 5 and 6 in \cite{MOON2020178}.} \zw{Based on the results of \cite{ghirardo18} and \cite{mensah2016efficient}, we identify azimuthal phase patterns in our model, which we call Bloch modes. Different Bloch modes are distinguished by the Bloch wavenumber $b$ which determines the relative phase between the acoustic pressure fields of adjacent cans.} \dr{When the acoustic pressure is visualized at a fixed axial position, Bloch modes appear as rotating waves spinning around the turbine annulus \cite{emenheiser2016patterns}. These apparent waves can occur because neighboring cans communicate through the apertures at the turbine inlet. The Bloch modes we consider are not ``true'' azimuthal waves, which may arise in the annular plenum before the burner or at the turbine inlet, because the medium is not modeled as a continuum, but as discrete control volumes with individual, but coupled internal dynamics. } \ei{Instabilities of azimuthal waves in a discrete fluid-dynamical system are encountered in a different context by \cite{couchman_turton_bush_2019} and \cite{couchman_bush_2020}, who combine theoretical and experimental methods to study of the dynamics of a ring of bouncing droplets.} \subsection{Overview} \zw{The paper is structured as follows: We discuss the key assumptions of our study in $\S$\ref{Section: setting}. In $\S$\ref{Section 2: Thermoacoustics}, a coupled oscillator model of an idealized can-annular combustor is derived from a unimodal projection of the Helmholtz equation. Using a Bloch wave ansatz, the resulting system of $N$ ordinary differential equations (ODEs) is then reduced to a single equation for the frequency spectrum. In $\S$\ref{Section 5: Results}, a parameter study is performed on the spectrum to determine the linear stability of the system at different conditions. We discuss and give a physical interpretation of our results. Our conclusions are summarized in $\S$\ref{Section 6: Conclusions}.} \section{Set-up \label{Section: setting}} \dr{In the present work, the internal dynamics of the individual cans are simplified to a minimum, and special emphasis is placed on modeling the can-to-can communication. Following \cite{YOON2020115774}, we assume a closed BC at the turbine inlet, where the high Mach number in the first row of turbine vanes leads to full reflection of incident acoustic energy. Interested readers can refer to \cite{WEILENMANN2021115799} for a recent experimental study on sound reflection by high-Mach and choked nozzle flows. A generalized model for nozzles with losses is presented in \cite{DeDomenico2019212}. } \dr{The cans are modeled as unimodal thermoacoustic oscillators. A linear relation between the acoustic pressure and the coherent heat release rate fluctuations is used, which is justified at small enough acoustic pressure amplitudes \cite{Noiray16}.} \vi{In our model, the flame drives a single natural (longitudinal) eigenmode $\psi_k$ of the can. In a first approximation, we assume that the mode shape of $\psi_k$ is unperturbed by the thermo- and aeroacoustic interactions and that the acoustic pressure signal is close to harmonic. These are often reasonable assumptions in practice \cite{Lieuwen03,culick2006unsteady}.} \dr{The above assumptions imply that we restrict ourselves to conditions near the stability limit of a thermoacoustic system where the observed power spectral density (PSD) of the acoustic pressure signal shows an isolated peak near $\omega_k$, which is much larger than all other observed peaks. We note that there can also arise situations where multiple modes are closely spaced, leading to nonlinear interactions between them \cite{Acharya2018309}. We further restrict our study to small perturbations of the frequency spectrum by the coupling, assuming that the thermoacoustic interaction of the sound field and the flames is the dominant source of acoustic energy.} \dr{Low-order oscillator models of thermoacoustic instabilities have been validated in prior studies performed by our group \cite{Noiray16,boujo2016quantifying,NOIRAY_DENISOV17,BONCIOLINI20195351}, and are well understood in terms of their accuracy compared to higher-order models that include several eigenmodes, explicit time delay and non-antisymmetric nonlinear flame response to acoustic perturbations \cite{BONCIOLINI2021396}. As is shown in Fig. 17 of the latter reference, the simplest model, which is based on a single eigenmode, does not reproduce the PSD over a broad frequency range, but it is sufficient to qualitatively represent the spectral content in the vicinity of the governing eigenfrequency.} \ei{We approximate the thermoacoustic dynamics in each individual can by the 1D Helmholtz equation with fluctuating heat release rate. Under this assumption, each can exhibits the same internal dynamics as a Rijke tube, albeit with different boundary conditions. Following \cite{ghirardo18}, we neglect low-Mach effects and assume zero mean flow in the can volume. A derivation of the wave equation for this classic example can be found, e.g., in \cite{Maling63}. For a discussion of thermoacoustic oscillations in a Rijke tube in the presence of a temperature gradient, the reader is referred to \cite{rott_1984}. We also mention the more recent studies of self-sustained oscillations in Rijke tubes in Refs. \cite{Matveev2003689,Balasubramanian2008,Juniper2011272,Magri2013183,Rigas2015}.} \dr{Let us now briefly discuss some of the simplifying assumptions of our model. First, we neglect the effect of the mean flow on the internal acoustics of the cans but take into its effects on the aeroacoustic coupling between the cans. This approximation, which greatly simplifies our analysis, is in line with our intent to focus on the effect of the aeroacoustic coupling in the apertures on the linear stability of can-annular combustors.} \vi{Secondly, we consider an idealized can-annular combustor where the cans are represented by acoustic waveguides with constant cross-section connected by compact rectangular apertures. This is an abstraction of the typical geometry of a can in an industrial can-annular combustor, which is shown in Fig. 1 of \cite{ghirardo18}. As discussed therein, the cans' cross-section shape changes from circular to nearly rectangular at the turbine inlet while the cross-section area remains roughly constant, and neighboring cans are connected by rectangular apertures whose dimensions are much smaller than the can length.} \dr{Thirdly, the geometry considered in \cite{HOWE1997} and used in this work is an aperture in an infinite plate of thickness $h$. This idealized configuration does not feature the accelerated flow downstream of the aperture, which is found in the first row of turbine vanes of the present configuration, and it just requires the simple Green's function for infinite half-spaces. We nonetheless take this model as a first approximation of the Rayleigh conductivity in the apertures because (a) the dynamics of the vortex sheets is mainly governed by the Kutta condition at the upstream edge of the apertures \cite{howe_1981} and is weakly influenced by the downstream flow, and (b) the scope of this work is to provide a simplified analysis of the physical phenomena that define the linear stability of can-annular combustors.} \dr{In future studies, the present thermoacoustic model could be extended to include mean flow effects on the can acoustics and a more detailed representation of the problem geometry. A method for including mean flow effects on zero-Mach thermoacoustic network models is presented in \cite{Motheau2014246}. The Rayleigh conductivity we use could also be refined by extending the model to finite aperture sizes, using more complex Green's functions which take into account finite Mach number effects. This is done in \cite{Yang2016294}, where a semi-analytical model for the acoustic impedance of finite-length circular holes with bias flow is derived by extending the classic model of Howe for acoustically compact holes \cite{howe1979theory}.} \nc{The present work focuses on the linear stability of the system and we therefore do not investigate nonlinear phenomena pertaining to such can-annular configurations, such as amplitude death and quenching (see, e.g., \cite{Biwa2015,Biwa2016,Thomas18AmpDeathinCoup,Dange2019,Hyodo2020}).} \section{Model derivation} \label{Section 2: Thermoacoustics} \subsection{Dynamics of the thermoacoustic system} In this section, we derive a thermoacoustic model of an idealized can-annular combustor. The system consists of $N$ identical cans, numbered by the integer $j=1,...,N$. We follow the convention that a positive \zw{increment} in $j$ implies a clockwise shift around the streamwise axis. In the following, $\hat{f}$ denotes the Laplace transform \cite{debnath2014integral} of a function $f(t)$, $t\in \mathbb{R}$. To avoid confusion, we use bracketed subscripts on variables to refer to different cans, so that $a_{(j)}$ denotes a variable quantity $a$ in the $j^\mathrm{th}$ can. \zw{The $j^{\mathrm{th}}$ can is enclosed by the control volume $\mathcal{V}_{j}$ with boundary $\sigma_{j}$ (see Fig. \ref{Figure 2}). In the frequency domain, the Helmholtz equation and the corresponding BCs read \cite{Maling63}} \begin{alignat}{2} \frac{\partial^2 \hat{p}_{(j)}(s,x)}{\partial x^2}-\left(\frac{s}{c_{j}}\right)^2\hat{p}_{(j)}(s,x)&=-s\frac{\gamma_{j}-1}{c_j^2}\hat{Q}_{(j)}(s,x)\quad& \text{in $\mathcal{V}_{j}$},\label{Helmholtz eq.}\\ \frac{\hat{p}_{(j)}(s,x)}{\hat{\boldsymbol{u}}_{(j)}(s,x)\cdot \boldsymbol{n}}&=Z_{(j)}(s,x)\quad& \text{on $\sigma_{j}$} \label{BC for Helmholtz eq.}. \end{alignat} In Eqs. \eqref{Helmholtz eq.} and \eqref{BC for Helmholtz eq.}, $\hat{p}_{(j)}$ and $\hat{\boldsymbol{u}}_{(j)}$ denote the acoustic pressure and velocity in the $j^{\mathrm{th}}$ can, $s=\nu+\mathrm{i} \omega$ is the Laplace variable, where $\omega$ and $\nu$ are the angular frequency and growth rate of thermoacoustic oscillations at a frequency $f=\omega/2\pi$, respectively, $\mathrm{i}$ is the imaginary unit, $\gamma_{j}$ and $c_j$ are the specific heat ratio and the ambient speed of sound in the $j^{\mathrm{th}}$ can, respectively, $\boldsymbol{n}$ is the outward facing normal vector to the boundary $\sigma_{j}$, $Z_{(j)}$ is the acoustic impedance on $\sigma_{j}$ and $\hat{Q}_{(j)}$ is the unsteady heat release rate fluctuations per unit \fc{volume in} the flame \fc{region}. By symmetry, we set $\gamma_{j}\equiv \gamma$ and $c_j \equiv c \hspace{0.2cm} \forall j$ in the following. \begin{figure}[!t] \begin{psfrags} \psfrag{a}{\textbf{(a)}} \psfrag{b}{\textbf{(b)}} \psfrag{c}{\hspace{0.1cm}\textcolor{purple1}{$W$}} \psfrag{d}{$\tilde{x}$} \psfrag{e}{\textcolor{purple1}{$L$}} \psfrag{f}{$0$} \psfrag{g}{\hspace{0.05cm}\textcolor{red}{\footnotesize \begin{tabular}{@{}c@{}} Cross-section \\ area $A$ \end{tabular}}} \psfrag{h}{\footnotesize Burner outlet} \psfrag{i}{\footnotesize \bf Flame} \psfrag{j}{\footnotesize Can outlet} \psfrag{k}{\footnotesize \begin{tabular}{@{}c@{}} First row of \\ turbine vanes \end{tabular}} \psfrag{l}{$\hat{p}_{(j)}$} \psfrag{m}{$\hat{u}_{(j)}$} \psfrag{n}{$\sigma_j$} \psfrag{o}{$\mathcal{V}_{j}$} \psfrag{p}{$\hat{Q}$} \psfrag{q}{$\hat{p}_{d,(j-1)}$} \psfrag{r}{\textcolor{orange}{$\sigma_{2,j}$}} \psfrag{s}{\textcolor{orange}{$\hat{u}_{(j-1,j)}$}} \psfrag{t}{\textcolor{cyan}{$\sigma_{4,j}$}} \psfrag{u}{\textcolor{red}{$\sigma_{1,j}$}} \psfrag{v}{\textcolor{red}{$\hat{u}_{d,(j)}$}} \psfrag{w}{$\hat{p}_{d,(j)}$} \psfrag{x}{\textcolor{orange1}{$\sigma_{3,j}$}} \psfrag{y}{\textcolor{orange1}{$\hat{u}_{(j,j+1)}$}} \psfrag{z}{$\hat{p}_{d,(j+1)}$} \centerline{\includegraphics[width=1\textwidth]{Figure_2.eps}} \end{psfrags} \caption{\zw{Sketch of the thermoacoustic model of the $j^{\mathrm{th}}$ can. The dimensions are not true to scale. In \textbf{(a)}, $\mathcal{V}_{j}$ denotes the control volume, $A$ the cross-section area and $L$ the length of the can, respectively. $\hat{Q}$ is the unsteady heat release rate across the flame front. The boundary $\sigma_j$ is divided into 4 parts: $\sigma_{1,j}$ at the can walls and burner outlet, $\sigma_{2,j}$ and $\sigma_{3,j}$ at the coupling interfaces, where the $j^{\mathrm{th}}$ can is connected to the $(j-1)^{\mathrm{th}}$ and $(j+1)^{\mathrm{th}}$ cans, respectively, and $\sigma_{4,j}$ at the turbine inlet at $\tilde{x}=L$. The acoustic velocity in streamwise direction and the acoustic pressure in the $j^{\mathrm{th}}$ can are denoted by $\hat{u}_{(j)}$ and $\hat{p}_{(j)}$, respectively, and $\hat{u}_{d,(j)}$ and $\hat{p}_{d,(j)}$ denote these quantities in the downstream section of each can, i.e., immediately upstream of the outlet of the cans. In \textbf{(b)}, the transverse acoustic velocity on $\sigma_{2,j}$, which results from the pressure difference $\hat{p}_{d,(j-1)}-\hat{p}_{d,(j)}$ across the aperture, is denoted by $\hat{u}_{(j-1,j)}$. Similarly, $\hat{u}_{(j,j+1)}$ denotes the transverse acoustic velocity on $\sigma_{3,j}$.}}\label{Figure 2} \end{figure} \zw{The thermoacoustic model of the $j^{\mathrm{th}}$ can is sketched in Fig. \ref{Figure 2}. The dimensions are not true to scale. In Fig. \ref{Figure 2}\textbf{(a)}, $\mathcal{V}_{j}$ denotes the control volume, $A$ the cross-section area and $L$ the length of the can, respectively.} \ei{As discussed in $\S$\ref{Section: setting}, for simplicity, we assume a constant cross-section area along the can, because the details of the can geometry and acoustic-flame interactions are not in the scope of this study, which considers an idealized system.} \zw{$W$ is the width of the apertures between the cans, which are assumed to be rectangular with height $B$ (see Fig. \ref{Figure 1}). $\hat{Q}$ is the unsteady heat release rate across the flame front. The boundary $\sigma_j$ is divided into 4 parts: $\sigma_{1,j}$ at the can walls and burner outlet, $\sigma_{2,j}$ and $\sigma_{3,j}$ at the coupling interfaces, where the $j^{\mathrm{th}}$ can is connected to the $(j-1)^{\mathrm{th}}$ and $(j+1)^{\mathrm{th}}$ cans, respectively, and $\sigma_{4,j}$ at the turbine inlet at $\tilde{x}=L$. In Fig. \ref{Figure 2}, the acoustic velocity in streamwise direction and the acoustic pressure are denoted by $\hat{u}_{(j)}$ and $\hat{p}_{(j)}$, respectively, and $\hat{u}_{d,(j)}$ and $\hat{p}_{d,(j)}$ denote these quantities in the downstream section of each can, i.e., immediately upstream of the outlet of the cans: \begin{align} \hat{u}_{d,(j)}(s)=&\,\hat{u}_{(j)}(s,\tilde{x}=L-W), \label{ds 1}\\ \hat{p}_{d,(j)}(s)=&\,\hat{p}_{(j)}(s,\tilde{x}=L-W), \label{ds 2} \end{align} with $L\gg W$, so that $W$ can be dropped from the argument on the RHS of Eqs. \eqref{ds 1} and \eqref{ds 2}, respectively. The transverse acoustic velocity on $\sigma_{2,j}$, which results from the pressure difference $\hat{p}_{d,(j-1)}-\hat{p}_{d,(j)}$ across the aperture, is denoted by $\hat{u}_{(j-1,j)}$. Similarly, $\hat{u}_{(j,j+1)}$ denotes the transverse acoustic velocity on $\sigma_{3,j}$. } The parameter values used in the numerical examples throughout this work are listed in Table \ref{Table 1}. These values are in the range of those found in realistic H-class gas turbines. \begin{table}[!ht] \centering \begin{tabular}{l l l} \hline \textbf{Parameter} & \textbf{Meaning} & \textbf{Value}\\ \hline $N$ & Number of cans & $12$ \\ $W$ & Aperture width & $\{5,2\}$ cm\\ $B$ & Aperture height & $25$ cm \\ $A_a=WB$ & \zw{Cross-section area of the aperture }& $\{125,50\}$ cm$^2$ \\ $A$ & Cross-section area of the cans & $0.15$ m$^2$ \\ $L$ & Can length & $1.2$ m \\ $V=AL$ & Can Volume & $0.18$ m$^3$\\ \fc{$\omega_k$} & Natural eigenfrequency & $800$ rad/s\\ \fc{$\nu_0/\omega_k$} & \zw{Normalized base growth rate} & $\{3\%,-1.2\%\}$\\ \fc{$h/W$} & \zw{Normalized can spacing}& $\in[0,0.5]$\\ $U_\mathrm{tot}$ & \fc{Bulk velocity of combustion products} & $\{40,30\}$ m/s \\ $U=U_\mathrm{tot}/2$ & \fc{Vorticity disturbance advection speed} & $\{20,15\}$ m/s\\ $c$ & \zw{Ambient speed of sound} & $800$ m/s \\ \hline \end{tabular} \caption{Parameter values used in the numerical examples in this work. \label{Table 1}} \end{table} \zw{As discussed in $\S$\ref{Section: setting}, we restrict our analysis to low-frequency longitudinal eigenmodes whose wavelengths are large compared to the dimensions of the aperture $W$ and $B$. Since the boundaries $\sigma_{2,j}$, $\sigma_{3,j}$ are assumed to be compact with respect to the wavelength of the acoustic pressure oscillations in the can, the spatial dependence of the impedance $Z_{(j)}$ on these parts of the boundary can be neglected.} \vi{We assume that the thermoacoustic dynamics in the cans are dominated by a single eigenmode $\psi_{k}$ with corresponding modal amplitude $\hat{\eta}_{(j),k}$ and eigenfrequency $\omega_k$. This assumption is expected to be satisfied in a frequency range around $f_k=\omega_k/2\pi$, and is confirmed by the acoustic pressure spectrograms from a real engine shown in Fig. 8 in \cite{ghirardo18}, where one can observe that the active modes are spread around $\pm 5\%$ of $f_k$.} Expanding the acoustic pressure in terms of $\psi_k$ yields \begin{align} \hat{p}_{(j)}(s,x)=&\,\hat{\eta}_{(j),k}(s) \psi_{k}(x). \label{Modal expansion of complex pressure amplitude}\\ \hat{\boldsymbol{u}}_{(j)}(s,x)=&- \frac{\hat{\eta}_{(j),k}(s) \boldsymbol{\nabla} \psi_{k}(x)}{s \rho}, \label{Modal expansion of complex velocity amplitude} \end{align} where $\hat{\eta}_{(j),k}$ is the dominant modal amplitude defined by \begin{align} \hat{\eta}_{(j),k}=&\,\frac{s \rho c^2}{s^2+\omega_k^2}\frac{1}{V_j\Lambda_j}\left(\frac{\gamma-1}{\rho c^2} \int_{\mathcal{V}_{j}} \hat{Q}_{(j)}(s,x)\psi_{k}(x)dV\right.\nonumber\\ &-\left.\hat{\eta}_{(j),k}\int_{\sigma_{j}} \frac{|\psi_{k}(x)|^2}{Z_{(j)}(s,x)}dS\right),\quad j={1,...,N}, \label{Dominant modal amplitude} \end{align} where $\Lambda_j=1/V_j \int_{\mathcal{V}_j} |\psi_k|^2 dV$ is the mode normalization factor and $V_j=\mathrm{Vol}(\mathcal{V}_j)$ is the volume of $\mathcal{V}_j$. By symmetry, $V_j\equiv V$, $\Lambda_j\equiv \Lambda$ and $Z_{(j)}\equiv Z\hspace{0.2cm}\forall j$. \ei{Equation \eqref{Dominant modal amplitude}, which is derived in the supplementary material, describes the projection of the Helmholtz equation \eqref{Helmholtz eq.} onto the eigenmode $\psi_k$ \cite{morse1986theoretical,NOIRAY20122753}.} \zw{It involves the acoustic impedance $Z_{(j)}$ at the boundary $\sigma_j$ as an unkown. } \zw{The unimodal projection resulting in Eqs. \eqref{Modal expansion of complex pressure amplitude} and \eqref{Modal expansion of complex velocity amplitude} is performed under the assumptions that the system trajectories $p$ remain close to (a) the origin and (b) the linear eigenspace of the unforced Helmholtz equation spanned by $\psi_k$. These assumptions ensure that (a) the acoustic pressure signal is quasi-sinusoidal, which is a standard assumption of low-order thermoacoustic models \cite{Noiray16,Lieuwen03,culick2006unsteady,BONCIOLINI2021396}, and that (b) Eqs. \eqref{Modal expansion of complex pressure amplitude} and \eqref{Modal expansion of complex velocity amplitude} approximate well the acoustic pressure dynamics.} \zw{In the following, we drop the subscript $k$ on $\eta_{(j),k}$. To arrive at an expression for $Z$, we use the Rayleigh conductivity, which is defined as follows \cite{HOWE1997,howe_1998,Howe1996}: \begin{equation} K_R=-\frac{s \rho \hat{\Phi}}{[\hat{p}]} \label{Rayleigh conductivity for projected HH derivation} \end{equation} where $\hat{\Phi}$ is the outward facing coherent volume flux through the aperture, resulting from oscillatory motion of the vortex sheet, and $[\hat{p}]$ is the acoustic pressure difference across the aperture. By equating the coherent volume flux $\hat{\Phi}$ to the acoustic volume flux through the aperture $A_a \hat{u}_a$, where $A_a=WB$ is the aperture area and $\hat{u}_a$ is the transverse acoustic velocity of the fluid in the aperture, we obtain a relation between $K_R$ and the specific acoustic impedance $Z_s=Z/\rho c$ \cite{jing1999experimental,SUN2002557,Tiemo20}: \begin{equation} Z_s=\frac{[\hat{p}]}{\rho c \hat{u}_a}=-\frac{s A_a}{c K_R}. \label{Rayleigh conductivity} \end{equation} We define the heat release rate of the flame $\hat{q}_{(j)}$ as follows:} \zw{\begin{equation} \hat{q}_{(j)}=\,\frac{\gamma-1}{V\Lambda}s\int_{\mathcal{V}_{j}}\hat{Q}_{(j)}(s,x)\psi_{k}(x)dV. \label{q} \end{equation} We model $\hat{q}_{(j)}$ as a linear function of the modal amplitude $\hat{\eta}_{(j)}$, which is justified for small enough acoustic pressure amplitudes (see, e.g., Fig. 2 in \cite{Noiray16}). Hence we write $\hat{q}_{(j)}=s\beta \hat{\eta}_{(j)}$, where $\beta$ is a real number describing the coherent flame response to acoustic perturbations. When $\beta$ is positive, the thermoacoustic feedback is constructive.} \zw{We assume a mode normalization factor of $\Lambda=1/2$, which is exact for the longitudinal eigenmodes $\psi_k=\cos{(k \pi x/L )}$, $k\in\mathbb{N}$, of can combustors corresponding to the following limit case: $Z(s,x)\rightarrow \infty$ for $x\in\sigma_{1,j}$ and $W\rightarrow 0$. Because the coupling interfaces are acoustically compact, we set $dS =A_a \delta (\tilde{x}-L) d\tilde{x}$ on $\sigma_{2,j}$ and $\sigma_{3,j}$. As stated in $\S$\ref{Section: setting}, following \cite{YOON2020115774}, we assume a pressure antinode $\psi_k(\tilde{x}=L)=1$ at the turbine inlet.} \ei{Under the above assumptions, following the steps detailed in the supplementary material, the projected Helmholtz equation \eqref{Dominant modal amplitude} can be rewritten as follows:} \zw{\begin{equation} (s^2-2\nu_0 s+ \omega_k ^2) \hat{\eta}_{(j)}= s\varkappa(s)(\hat{\eta}_{(j-1)}+\hat{\eta}_{(j+1)}-2\hat{\eta}_{(j)}),\quad j={1,...,N} \label{Dynamics of dominant modal amplitude}, \end{equation} where $\nu_0=(\beta-\alpha_0)/2$ is the thermoacoustic growth rate and we have defined the damping constant $\alpha_0$ and the frequency-dependent coupling term $\varkappa$ as follows: \begin{align} \alpha_0=&\,\frac{2\rho c^2}{V}\int_{\sigma_{1,j}} \frac{|\psi_k(x)|^2}{Z(s,x)}\mathrm{d}S,\label{Alpha, no Bloch theory}\\ \varkappa(s)=&-\frac{4 c^2 \mathcal{R} K_R(s)}{s V }.\label{Beta, no bloch theory} \end{align} In our low-order model, all dissipative effects at the boundary $\sigma_{1,j}$ are compounded into the damping constant $\alpha_0$, which, for simplicity, is assumed to be real and positive. For constructive thermoacoustic feedback, if $\beta>0$ exceeds $\alpha_0$, the growth rate $\nu_0$ becomes positive and an instability occurs \cite{NOIRAYSCHUERMANS2013152}. \cite{boujo2016quantifying} present a method to measure $\beta$ and $\alpha_0$ separately. In practice, $\nu_0$ depends on the operating condition parameters such as the equivalence ratio or the operating pressure. } \zw{For $\omega\approx\omega_k$, the system of ODEs \eqref{Dynamics of dominant modal amplitude} describes the linear dynamics in the frequency domain of the dominant modal amplitudes $\hat{\eta}_{(j)}$, $j=1,...,N$, in an idealized can-annular combustor with $N$ cans.} \subsection{Aeroacoustic coupling} \label{Section 3: Coupling} \zw{In this section, following \cite{HOWE1997}, we derive the Rayleigh conductivity $K_R$ defined in Eq. \eqref{Rayleigh conductivity for projected HH derivation} which determines the frequency-dependent coupling term $\varkappa$ in Eq. \eqref{Dynamics of dominant modal amplitude}.} \zw{For simplicity, we adopt the notation used in \cite{HOWE1997} with a complex angular frequency $\omega_c=\omega+\mathrm{i}\nu$. The forced hydrodynamic motion of the turbulent wake forming between neighboring cans is modeled as two vortex sheets separated by the can spacing $h$ which are subject to an oscillating pressure load $[p]e^{-\mathrm{i} \omega_c t}$, where $[p]=p_+-p_-$ and $p_\pm$ are the uniform pressure components on either side of the aperture. The vortex sheets separate two regions of constant mean axial velocity $U$. The pressure load causes a (complex) displacement of the vortex sheet $\zeta(\omega_c,\xi) e^{-\mathrm{i} \omega_c t}$ across the aperture, where $\zeta$ is the amplitude of the vortex sheet displacement and $\xi$ is a scaled streamwise variable defined as $\xi=2x/W-1$, which originates in the middle of the aperture and is equal to $\pm1$ at its edges. For compactness, the dependence of $\zeta$ on $\omega_c$ is suppressed below.} \ei{One finds that for $\omega\in\mathbb{R}$, $K_R$ depends only on the nondimensional Strouhal number \begin{equation} \mathrm{St}=\frac{\omega W}{2U}, \end{equation} which combines the acoustic oscillation frequency $\omega$ and the frequency of the hydrodynamic vorticity fluctuations in the turbulent wake $W/U$.} \zw{By expressing the pressure perturbations on either side of the wake in terms of the velocity potentials $\phi_\pm$ and requiring the pressure on either side to be equal, Howe arrives at the following equation: \begin{equation} p_+-\rho\left(-i\omega_c+U_+\frac{\partial}{\partial x}\right)\phi_+=p_--\rho\left(-i\omega_c+U_-\frac{\partial}{\partial x}\right)\phi_-+h\omega_c^2 \zeta, \label{Unsteady Bernoulli equation, not appendix} \end{equation} where $U_\pm$ are the axial mean flow speeds on either side of the aperture and $\phi_\pm$ are the velocity potentials associated with the velocity component normal to the aperture plane \cite{HOWE1997}. The last term on the RHS of \eqref{Unsteady Bernoulli equation, not appendix} accounts for the pressure difference induced by the finite thickness of the aperture $h$. Expressions for $\phi_\pm$ are given in Eq. (2.3) of \cite{HOWE1997}: \begin{equation} \phi_\pm(x,z)=\mp\frac{1}{2\pi}\int_{0}^{W} \int_{0}^{B} \frac{ v_\pm(\bar{x}) }{\sqrt{(x-\bar{x})^2+(z-\bar{z})^2}}\mathrm{d}\bar{z}\mathrm{d}\bar{x}, \label{Velocity potential, original form} \end{equation} where $\bar{x}$ and $\bar{z}$ are integration variables corresponding to $x$ and $z$, respectively. The normal velocity just above and below the wake, $v_{\pm}$, is expressed in terms of $\zeta$:} \zw{\begin{equation} v_{\pm}(x)=\left(-i\omega_c+U_\pm\frac{\partial}{\partial x}\right)\zeta(x). \label{velocity in terms of zeta} \end{equation} Consistent with Refs. \cite{howe_1998,HOWE1997}, assuming strongly correlated fluid motion in spanwise direction $z$, we neglected the dependence of $\zeta$ on $z$ in Eqs. \eqref{Velocity potential, original form} and \eqref{velocity in terms of zeta}.} \vi{Details of the derivation are explained in the supplementary material.} \zw{By combining Eq. \eqref{Velocity potential, original form} with Eq. \eqref{velocity in terms of zeta}, performing the integration over $\bar{z}$ in Eq. \eqref{Velocity potential, original form} and taking the average of Eq. \eqref{Unsteady Bernoulli equation, not appendix} over the spanwise direction $z$, Howe arrives at the following equation: \begin{eqnarray} &&\int^1_{-1}\zeta'(\mu)\{\ln |\xi-\mu|+L_+(\xi,\mu)\}d\mu \nonumber\\ &&\quad\quad\quad-\pi\mathrm{St}_c^2\left(\frac{h}{W}\right)\int^1_{-1}\zeta'(\mu)G(\xi,\mu)d\mu+(\lambda_+ +\lambda_- \xi) e^{\mathrm{i} \mathrm{St}_c \xi}=1, \label{Equation for zeta, full model} \end{eqnarray} where $|\xi|<1$, $\zeta'=-\rho|\omega_c|^2 W \zeta/\pi [p]$, $\mathrm{St}_c=\omega_c W/2U$ is the Strouhal number based on the complex frequency $\omega_c$, $\mu$ is an integration variable corresponding to $\xi$, $\lambda_\pm$ are constants of integration,} \zw{\begin{equation} G(\xi,\mu)=-H(\xi-\mu)(\xi-\mu)e^{\mathrm{i}\mathrm{St}_c(\xi-\mu)}, \label{Green's function, not appendix} \end{equation} where $H(\cdot)$ is the Heaviside function and} \zw{\begin{eqnarray} L_+(\xi,\mu)=-\ln \{2B/W+\sqrt{(2B/W)^2+(\xi-\mu)^2}\}+\quad\quad\quad\nonumber\\ \sqrt{1+(W/2B)^2(\xi-\mu)^2}-(W/2B)|\xi-\mu|. \end{eqnarray} \dr{Equation \eqref{Equation for zeta, full model} can be understood as a condition for the spanwise average pressure continuity across the vortex sheet \cite{Howe1996} and coincides, up to a typographical error (a factor 2 before the second integral), with Eq. (2.11) in \cite{HOWE1997}. Note that for comparison, the terms involving $\lambda_\pm$ need to be replaced according to the remark on p. 356 in the latter reference.}} \zw{We seek the solution $\zeta'(\xi)$, $\xi\in[-1,1]$, of Eq. \eqref{Equation for zeta, full model} satisfying the Kutta condition, which states that the vortex sheet leaves the upstream edge leave the upstream edge smoothly \cite{howe_1981}:} \zw{\begin{equation} \zeta'(-W/2)=\frac{\partial \zeta' }{\partial x}(-W/2)=0. \label{Kutta condition} \end{equation} From this solution $\zeta'$, using $\Phi=i\omega_c \int^W_0 \int^B_0 \zeta dx dz$ and the fact that $\hat{\Phi}/[\hat{p}]=\Phi/[p]$, the Rayleigh conductivity \eqref{Rayleigh conductivity for projected HH derivation} can be computed from the following formula \cite{HOWE1997}:} \zw{\begin{equation} K_R(\omega_c)=-\frac{\pi B}{2} \int^1_{-1}\zeta'(\mu,\omega_c)d\mu. \label{KR from Howe model} \end{equation} To obtain $K_R(s)$, one has to evaluate } \zw{\begin{equation} K_R(s)=K_R(\omega_c^*), \end{equation} where $(\cdot)^*$ denotes the complex conjugate. The conjugate of $\omega_c$ appears because of different conventions in the definitions of $\omega_c$ and the Laplace variable $s=\mathrm{i}\omega_c^*$. Equation \eqref{Equation for zeta, full model} is an integral equation which is here solved numerically using Gauss-Legendre quadrature with 15 ($\S$\ref{Subsection parameter study}) or 40 nodes ($\S$\ref{Subsection discussion}). Details of the numerical method used to solve Eq. \eqref{Equation for zeta, full model} are discussed in the supplementary material.} \zw{For large aspect ratios $B/W\gg 1$ and vanishing wall thickness $h/W\ll 1$, the following formula for the thin-wall approximation of $K_R$ can be derived \cite{HOWE1997,howe_1981}: \begin{equation} K_R(\omega_c)=\frac{\pi B}{2\big[F(\mathrm{St}_c)+\ln (8B/\mathrm{e}W)\big]}, \label{KR, thin wall, infinite b} \end{equation} where $\mathrm{e}$ is Euler's number and \begin{equation} F(\mathrm{St}_c)=\frac{J_0(\mathrm{St}_c)K(\mathrm{St}_c)-\big[J_0(\mathrm{St}_c)-2K(\mathrm{St}_c)\big]M(\mathrm{St}_c)}{\mathrm{St}_c\big(J_0(\mathrm{St}_c)J_1(\mathrm{St}_c)+\mathrm{St}_c\{J_1(\mathrm{St}_c)^2+[J_0(\mathrm{St}_c)-2 \mathrm{i} J_1(\mathrm{St}_c)]^2\}\big)}, \label{F from Howe} \end{equation} where $K(x)=\mathrm{i} x \left[J_0(x)-\mathrm{i}J_1(x) \right]$, $M(x)=\left[J_0(x)-\mathrm{i}x(J_0(x)+ \mathrm{i} J_1(x)\right]$ and $J_0$ and $J_1$ are Bessel functions of the first kind \cite{bowman2012introduction}. In the case of vanishing mean flow, $U\equiv 0$. For the thin-wall approximation \eqref{KR, thin wall, infinite b}, this implies $F\equiv0$ \cite{Howe1996} and \begin{equation} K_R=\frac{\pi B}{2\ln (8B/\mathrm{e}W)}. \label{KR, no-flow} \end{equation} } \begin{figure}[!t] \begin{psfrags} \psfrag{a}{$0$} \psfrag{b}{$2$} \psfrag{c}{$4$} \psfrag{d}{$6$} \psfrag{e}{$8$} \psfrag{f}{$10$} \psfrag{g}{$1$} \psfrag{h}{$0.5$} \psfrag{i}{$0$} \psfrag{j}{$-0.5$} \psfrag{k}{$0$} \psfrag{l}{$-0.2$} \psfrag{m}{$-0.4$} \psfrag{n}{$-0.2$} \psfrag{o}{$-0.8$} \psfrag{p}{$-0.2$} \psfrag{q}{$-0.4$} \psfrag{r}{$-0.6$} \psfrag{s}{$1.4$} \psfrag{G}{$1.5$} \psfrag{S}{$-1$} \psfrag{A}{$2.8$} \psfrag{B}{$2$} \psfrag{C}{$1.2$} \psfrag{D}{$0.4$} \psfrag{E}{$-0.4$} \psfrag{F}{$1.6$} \psfrag{G}{$1$} \psfrag{H}{$0.4$} \psfrag{I}{$-0.4$} \psfrag{t}{\hspace{0.07cm}$\omega W / 2U$} \psfrag{u}{\hspace{0.28cm}$\mathrm{Re}(K_R/B)$} \psfrag{v}{\hspace{0.26cm}$\mathrm{Im}(K_R/B)$} \psfrag{W}{\textcolor{krgreen}{$0.1$}} \psfrag{w}{b} \psfrag{X}{\textcolor{krorange}{$0.5$}} \psfrag{W}{\textcolor{krblue}{$h/W=0$}} \psfrag{Y}{\textcolor{krred}{\begin{tabular}{@{}c@{}} no- \\ flow \end{tabular}}} \psfrag{Z}{$h/W$} \psfrag{M}{\hspace{-0.04cm}\textcolor{krgreen}{$0.02$}} \psfrag{T}{\textcolor{krpurple}{$0.06$}} \psfrag{1}{$0$} \psfrag{2}{$0.1$} \psfrag{3}{\textcolor{krcyan}{$0.2$}} \centerline{\includegraphics{Figure_3.eps}} \end{psfrags} \caption{\dr{Real and imaginary parts of the normalized Rayleigh conductivity $K_R/B$ as a function of the Strouhal number $\mathrm{St}=\omega W/2U\in[0,10]$, $\omega\in\mathbb{R}$ for different values of the can spacing $h/W\in\{0,0.02,0.06,0.1,0.2,0.5\}$ and aspect ratio $B/W=5$. The arrow indicates the direction of increasing can spacing $h/W$. The blue curve corresponds to the thin-wall approximation \eqref{KR, thin wall, infinite b}. For $h/W>0$, the curves are computed from Eq. \eqref{Equation for zeta, full model}. The no-flow limit of the thin-wall approximation \eqref{KR, no-flow} is shown in red. Regions where $\mathrm{Im}(K_R)>0$ indicate amplification the sound field by the acoustic-hydrodynamic interaction. } }\label{Figure 3} \end{figure} \zw{The real and imaginary parts of the normalized Rayleigh conductivity $K_R/B$ are plotted in Fig. \ref{Figure 3} as a function of the Strouhal number $\mathrm{St}=\omega W/2U\in[0,10]$, $\omega\in\mathbb{R}$ for different values of the can spacing $h/W\in\{0,0.02,0.06,0.1,0.2,0.5\}$ and aspect ratio $B/W=5$. The blue curve corresponds to the thin-wall approximation \eqref{KR, thin wall, infinite b}. For $h/W>0$, the curves are computed from Eq. \eqref{Equation for zeta, full model}. The no-flow limit of the thin-wall approximation \eqref{KR, no-flow} is shown in red. Regions where $\mathrm{Im}(K_R)>0$ indicate amplification the sound field by the mean flow. Indeed, it is straightforward to show using Eq. \eqref{Rayleigh conductivity} that $\mathrm{Im}(K_R)>0$ is equivalent to a reflection coefficient $R=(Z_s-1)/(Z_s+1)$ of the aperture with magnitude $|R|>1$, meaning that incident acoustic waves are reflected with an increased amplitude \cite{Tiemo20}. We note that for the parameter values listed in Table \ref{Table 1}, we have $B/W\geq5$, so that the assumption of a large aspect ratio in the derivation of the thin-wall approximation is roughly satisfied. } \zw{We see in Fig. \ref{Figure 3} that, when the can spacing $h/W$ is increased, the amplification, measured by the maximum of $\mathrm{Im}(K_R)$, first increases and then decreases until around $h/W\approx 0.5$, the amplification is fully suppressed. For higher values of $h/W$, the acoustic-hydrodynamic interaction is purely dissipative. This is consistent with the study presented in Fig. 3 in \cite{HOWE1997}, albeit for a different value of the aspect ratio $B/W$.} \dr{We see in Fig. \ref{Figure 3} that the thin-wall approximation in Eq. \eqref{KR, thin wall, infinite b} does not converge to its no-flow limit for $\mathrm{St}\rightarrow\infty$. This leads to the question of up to which value of the Strouhal number the thin-wall approximation can be considered a qualitatively correct representation of the reflection coefficient $R$ of the aperture under turbulent grazing flow. In previous work by our group on a similar configuration, impedance measurements have been presented over a frequency range where, on a part of this range, $|R|$ exceeds $1$ \cite{bourquard_faure-beaulieu_noiray_2021}. If such measurements are available, one can fit numerically the first undulation (damping at low Strouhal number and the first amplification region) to the experiments to obtain a physics-based quantitative model of the aperture's reflection coefficient \cite{Tiemo20}. Beyond the first undulation, the physical meaning of the thin-wall approximation \eqref{KR, thin wall, infinite b} is unclear, because it predicts the same repeating behavior, alternating between dissipative to amplifying for all Strouhal numbers. This implies a rough limit of validity of the thin-wall approximation \eqref{KR, thin wall, infinite b} at around $\mathrm{St}=4$, because this is where the first undulation in the imaginary part of $K_R$ ends. This means that the model is only valid for sufficiently high velocities (or sufficiently small apertures/frequencies), and will break down, as we decrease $U$, before we reach the no-flow limit, which therefore deserves a separate discussion. There is no such a priori limit of validity for the general Rayleigh conductivity model with $h/W>0$. The curves in Fig. \ref{Figure 3} suggest that the general model predicts the same qualitative behavior in the no-flow limit as Eq. \eqref{KR, no-flow}, namely that the acoustic-hydrodynamic interaction is purely reactive in that limit. } \dr{Despite the shortcomings of the thin-wall approximation discussed above, using the analytical formula in Eq. \eqref{KR, thin wall, infinite b} significantly reduces the computational cost of (repeatedly) computing the frequency-dependent coupling term $\varkappa$ in Eq. \eqref{Beta, no bloch theory} compared to using the numerical solution $K_R$ of the integral equation \eqref{Equation for zeta, full model}. As we see in Fig. \ref{Figure 3}, for $\mathrm{St}\leq4$, the thin-wall approximation and the general model are qualitatively similar up to a wall thickness of $h/W\approx 0.02$. In the present study, we consider the aeroacoustic interaction of low-frequency thermoacoustic modes through compact apertures under turbulent grazing flow, which typically occurs at low to moderate Strouhal numbers $\mathrm{St}<4$, so that using the thin-wall approximation \eqref{KR, thin wall, infinite b} is justified for small enough $h/W$. To study the influence of the can spacing $h$ on the frequency spectrum, the numerical solution of Eq. \eqref{Equation for zeta, full model} is required.} \subsection{Bloch wave ansatz} \label{Section 4: Bloch wave theory} \zw{In this section, we use a Bloch wave ansatz to simplify the system of ODEs \eqref{Dynamics of dominant modal amplitude}, which describes the linear dynamics in the frequency domain of the dominant modal amplitudes $\hat{\eta}_{(j)}$, $j=1,...,N$. Following \cite{mensah2016efficient}, we assume that the acoustic pressure in the cans is a Bloch wave. In the present context, this means it is an eigenfunction of the translation operator $\mathrm{T}[\cdot]$, which is defined by} \zw{\begin{equation} \mathrm{T}\, [\hat{p}_{(j)}]=\hat{p}_{(j+1)}. \end{equation} By making use of the general statement derived in \cite{mensah2016efficient}, \cite{ghirardo18} show that if $\hat{p}_{(j)}$ is a Bloch-wave, it can be expressed as } \zw{\begin{equation} \hat{p}_(j)(s,x)=\Psi(s,x) e^{\mathrm{i}\theta b}, \end{equation} where $b$ is the Bloch wavenumber, $\theta=-2\pi j/N$ is the discrete azimuthal coordinate along the ring of can combustors and $\Psi(s,x)$ is the same in every can. The minus sign appears because we use a different convention for the can order than \cite{ghirardo18}. } \zw{In the present work, the quantity of interest is the downstream acoustic pressure $\hat{p}_{d,(j)}$, which is spatially constant due to the assumption of acoustically compact coupling apertures. Indeed, with the unimodal expansion \eqref{Modal expansion of complex pressure amplitude}, it can be written as $\hat{p}_{d,(j)}(s)=\hat{\eta}_{(j)}(s)\psi_k(\tilde{x}=L)$. Using $\psi_k(\tilde{x}=L)=1$, the Bloch wave ansatz simplifies to \begin{equation} \hat{\eta}_{(j)}(s)=\Psi(s) e^{\mathrm{i}\theta b}\quad\forall j, \label{Simplified Bloch wave ansatz} \end{equation} where $\Psi\in\mathbb{C}$ is spatially constant. Different values of $b$ correspond to different azimuthal phase patterns along the turbine annulus \cite{ghirardo18}, which we call Bloch modes in the following.} \zw{We visualize all possible distinct Bloch modes with non-negative $b$ for $N=12$ in Fig. \ref{Figure 4}. The color bar indicates the value of the phase of the modal amplitude $\hat{\eta}_{(j)}$. The respective Bloch modes for negative $b$ can be obtained by reversing the can order. } \begin{figure}[!t] \begin{psfrags} \psfrag{a}{\hspace{0.1cm}$\arg\hat{\eta}_{(j)}$} \psfrag{b}{(b)} \psfrag{c}{c} \psfrag{d}{d} \psfrag{e}{e} \psfrag{f}{f} \psfrag{g}{g} \psfrag{h}{h} \psfrag{i}{0} \psfrag{j}{$\pi$} \psfrag{k}{$2\pi$} \psfrag{l}{\hspace{0.1cm}$b=0$} \psfrag{m}{\hspace{0.1cm}$b=1$} \psfrag{n}{\hspace{0.1cm}$b=2$} \psfrag{o}{\hspace{0.1cm}$b=3$} \psfrag{p}{\hspace{0.1cm}$b=4$} \psfrag{q}{\hspace{0.1cm}$b=5$} \psfrag{r}{\hspace{0.1cm}$b=6$} \centerline{\includegraphics{Figure_4.eps}} \end{psfrags} \caption{\zw{All possible distinct Bloch modes with non-negative Bloch wavenumber $b$ in a ring of $N=12$ oscillators. The color bar indicates the value of the phase of the modal amplitude $\hat{\eta}_{(j)}$. The respective Bloch modes for negative $b$ can be obtained by reversing the can order.}}\label{Figure 4} \end{figure} \zw{Using Eq. \eqref{Simplified Bloch wave ansatz}, we express the modal amplitudes of neighboring cans as follows: \begin{equation} \hat{\eta}_{(j+1)}=\hat{\eta}_{(j)} e^{-\mathrm{i}\frac{ 2\pi b}{N}} \quad \text{and} \quad \hat{\eta}_{(j-1)}=\hat{\eta}_{(j)} e^{\mathrm{i}\frac{ 2\pi b}{N}}, \label{Bloch boundary conditions} \end{equation} where $b\in \left]\mathrm{ceil}\left(-N/2\right),\mathrm{floor}\left(N/2\right)\right]$. Substituting Eq. \eqref{Bloch boundary conditions} into Eq. \eqref{Dynamics of dominant modal amplitude} and assuming a nonzero perturbation $\eta_{(j)}\neq 0$ yields} \zw{\begin{equation} s^2-\big[2\nu_0 -4\varkappa(s)\sin^2(\pi b/N) \big]s+ \omega_k ^2=0,\quad j={1,...,N} \label{Dynamics of dominant modal amplitude, bloch theory}, \end{equation} where the trigonometric identity $1-\cos{x}=2\sin^2{(x/2)}$ was used. The complex solutions $s$ of equation \eqref{Dynamics of dominant modal amplitude, bloch theory} describe the frequency spectrum $(\omega,\nu)$ of our model. Because $\sin^2(\cdot)$ is an even function, the spectrum is degenerate with respect to positive and negative values of $b$.} \zw{In Eq. \eqref{Dynamics of dominant modal amplitude, bloch theory}, the coupling between neighboring cans is now described implicitly in terms of the the Bloch wavenumber $b$. For computational purposes, it is useful to rewrite Eq. \eqref{Dynamics of dominant modal amplitude, bloch theory} as follows: \begin{equation} s^2-2 \nu_0 s +\omega_{k} ^2- b_0 K_R(s)\sin ^2(\pi b/N)=0 \label{Frequency spectrum, effect of mean flow}, \end{equation} where $b_0=16 \mathcal{R} c^2/ V>0 $. In this work, Eq. \eqref{Frequency spectrum, effect of mean flow} was solved numerically for $s=\mathrm{i}\omega+\nu$ using the $\textit{fsolve}$ function with default options in MATLAB 2020b \cite{MATLAB:2020}.} \section{Results \label{Section 5: Results}} \subsection{Parameter study\label{Subsection parameter study}} \zw{In this section, we perform a parameter study on the frequency spectrum of the thermoacoustic model derived in $\S$\ref{Section 2: Thermoacoustics}. To do this, we vary different parameters and repeatedly solve Eq. \eqref{Frequency spectrum, effect of mean flow} at each point.} \zw{As stated in $\S$\ref{Section: setting}, we restrict ourselves to the study of small perturbations of the frequency spectrum by the coupling. By the implicit function theorem, if $x_0$ is a zero of a function $f(x)$, then for $\partial f/\partial x|_{x=x_0} \neq0$ and small enough $\varepsilon>0$, the perturbed function $f(x)+\varepsilon f_1(x)$ has a zero $x_0+\varepsilon x_1$ near $x_0$. Hence, for a small enough perturbation $b_0 K_R(s)\sin ^2(\pi b/N)$, there exists, given $\omega_k\neq\nu_0$, a solution of Eq. \eqref{Frequency spectrum, effect of mean flow} near the unperturbed solution $s_0=\nu_0+\mathrm{i}\sqrt{\omega_{k} ^2-\nu_0^2}$, which corresponds to a thermoacoustic instability of an isolated can. In this work, we focus on these perturbed solutions and do not consider other solutions that may emerge far away from $s_0$ from the zeros of $K_R$. } \zw{We begin by studying the influence of the natural eigenfrequency $\omega_k$ on the frequency spectrum in Fig. \ref{Figure 5}.} \ei{Note that there can be several longitudinal eigenmodes for which the aperture remains compact, and their eigenfrequency will depend on the speed of sound, the can length, the impedance BCs and the mode order. Therefore it is not straightforward to give a general expression of this eigenfrequency as a function of the physical parameters and we decide to simply \textit{assume} there exists a longitudinal mode with a given $\omega_k$ and base growth rate $\nu_0$. We compute the frequency spectrum $(\omega,\nu)$ for this mode as a function of the Bloch wavenumber $b$. If a (stable or unstable) mode with mode shape $\psi_k$ and spectrum $(\omega_k,\nu_0)$ does exist, this tells us whether or not, under perturbation by the aeroacoustic coupling, this mode is linearly stable and at what frequency the system oscillates.} \zw{In Fig. \ref{Figure 5}\textbf{(a)} and \textbf{(b)}, we show the frequency spectrum $(\omega,\nu)$ as a function of the normalized eigenfrequency $\mathrm{St}_k=\omega_k W / 2U$ for the first set of parameters in Table \ref{Table 1} and vanishing can spacing $h/W$. \ei{In this and in the following figures, the dashed black line marks the stability border $\nu=0$ and the arrow indicates the direction of increasing Bloch wavenumber $b$.} For each $\omega_k$, we assume an unstable mode with positive base growth rate $\nu_0$ equal to $3\%$ of $\omega_k$. Figure \ref{Figure 5}\textbf{(a)} shows that at low values of $\mathrm{St}_k$, the coupling has a dissipative effect, effectively damping some Bloch modes over a range of $\omega_k$ around $\mathrm{St}_k\approx 0.4$. In Fig. \ref{Figure 5}, we see that the eigenfrequency $\omega$ of the Bloch modes is increased by the coupling until about $\mathrm{St}_k\approx0.5$ and then decreased for higher values of $\mathrm{St}_k$. The effect of the coupling diminishes with increasing $\mathrm{St}_k$, and only negligible effects are observed above $\mathrm{St}_k=2$.} \ei{In Fig. \ref{Figure 5}\textbf{(c)} and \textbf{(d)}, we show the frequency spectrum $(\omega,\nu)$ for the second set of parameters in Table \ref{Table 1} with vanishing can spacing $h/W$. We assume stable modes with negative base growth rate $\nu_0$ equal to $-1.2\%$ of $\omega_k$. We see in Fig. \ref{Figure 5}\textbf{(c)} that the coupling makes some Bloch modes unstable around $\mathrm{St}_k\approx 3.4$. Figure \ref{Figure 5}\textbf{(d)} shows that in the domain shown, the frequency $\omega$ is strictly decreased by the coupling.} \zw{Going from Fig. \ref{Figure 5}\textbf{(c)} and \textbf{(d)} to Fig. \ref{Figure 5}\textbf{(e)} and \textbf{(f)}, the can spacing is changed from $h/W=0$ to a finite value of $h/W=0.5$, while all other parameters are unchanged. We observe that the coupling-induced instability shown in \ref{Figure 5}\textbf{(e)} is completely suppressed by the increased can spacing, while the frequency curves $\omega(\omega_k)$ shown in Fig. \ref{Figure 5}\textbf{(f)} remain qualitatively similar to those in Fig. \ref{Figure 5}\textbf{(d)}.} \zw{We see in Fig. \ref{Figure 5} that the push-push mode with $b=0$ is unaffected by the coupling and that higher-order Bloch modes are more strongly affected by the coupling than lower-order ones, which is expected from Eq. \eqref{Frequency spectrum, effect of mean flow}.} \begin{figure}[!t] \begin{psfrags} \psfrag{a}{$0.05$} \psfrag{b}{$0$} \psfrag{c}{$-0.05$} \psfrag{d}{$-0.1$} \psfrag{e}{$0$} \psfrag{f}{$1$} \psfrag{g}{$2$} \psfrag{h}{$3$} \psfrag{i}{$4$} \psfrag{j}{$1.2$} \psfrag{k}{$1.1$} \psfrag{l}{$1$} \psfrag{m}{$0.9$} \psfrag{n}{$0.1$} \psfrag{o}{$0$} \psfrag{p}{$-0.1$} \psfrag{q}{$-0.2$} \psfrag{r}{$2$} \psfrag{s}{$2.5$} \psfrag{t}{$3$} \psfrag{u}{$3.5$} \psfrag{v}{$4$} \psfrag{w}{$1$} \psfrag{x}{$0.9$} \psfrag{y}{$0.8$} \psfrag{z}{$0.7$} \psfrag{A}{$0$} \psfrag{B}{$-0.04$} \psfrag{C}{$-0.08$} \psfrag{D}{$1$} \psfrag{E}{$0.9$} \psfrag{F}{$0.8$} \psfrag{G}{$\nu/\omega_k$} \psfrag{H}{$\omega/\omega_k$} \psfrag{I}{\hspace{0.35cm}Norm. growth rate } \psfrag{J}{\hspace{0.35cm}Norm. \dr{frequency} } \psfrag{K}{Unstable} \psfrag{L}{Stable} \psfrag{M}{\hspace{0.3cm}\begin{tabular}{@{}c@{}} Instability \\ suppressed \end{tabular}} \psfrag{N}{\hspace{0.3cm}\begin{tabular}{@{}c@{}} Coupling-induced \\ instability \end{tabular}} \psfrag{O}{\hspace{0.04cm} \begin{tabular}{@{}c@{}} Dissipative \\ coupling \end{tabular}} \psfrag{P}{\textbf{(a)}} \psfrag{Q}{\textbf{(b)}} \psfrag{R}{\textbf{(c)}} \psfrag{S}{\textbf{(d)}} \psfrag{T}{\textbf{(e)}} \psfrag{U}{\textbf{(f)}} \psfrag{V}{$\mathrm{St}_k$} \psfrag{W}{$b$} \includegraphics[width=0.9\textwidth,center]{Figure_5.eps} \end{psfrags} \caption{\zw{Frequency spectrum $(\omega,\nu)$ as a function of the normalized eigenfrequency $\mathrm{St}_k=\omega_k W / 2U$. The dashed black line marks the stability border $\nu=0$. \ei{The arrow indicates the direction of increasing Bloch wavenumber $b$.} In \textbf{(a)} and \textbf{(b)}, for the first set of parameters in Table \ref{Table 1}, we assume for each $\omega_k$ an unstable mode with positive base growth rate $\nu_0$ equal to $3\%$ of $\omega_k$. The insets \textbf{(c)}, \textbf{(d)}, \textbf{(e)} and \textbf{(f)} correspond to the second set of parameters in Table \ref{Table 1}, where we assumed stable modes with negative base growth rate $\nu_0$ equal to $-1.2\%$ of $\omega_k$. Vanishing can spacing $h/W$ was assumed in \textbf{(a)}-\textbf{(d)}, while in \textbf{(e)} and \textbf{(f)}, a finite value $h/W=0.5$ was used.}}\label{Figure 5} \end{figure} \zw{A parameter study in the root locus plane is presented in Fig. \ref{Figure 6}, where the frequency spectrum $(\omega,\nu)$ is plotted for the first set of parameters in Table \ref{Table 1} as a function of \textbf{(a)} the normalized eigenfrequency $\mathrm{St}_k=\omega_k W / 2U$, \textbf{(b)} the bulk velocity of the combustion products $U_\mathrm{tot}$, \textbf{(c)} the aperture with $W$ and \textbf{(d)} the normalized base growth rate $\nu_0/\omega_k$. In Fig. \ref{Figure 6}\textbf{(e)} and \textbf{(f)}, the spectrum $(\omega,\nu)$ is plotted as a function of the $\mathrm{St}_k$ for the second set of parameters in Table \ref{Table 1}. Going from Fig. \ref{Figure 6}\textbf{(e)} to \textbf{(f)}, the can spacing is increased from $h/W=0$ to $h/W=0.5$. The insets in Fig. \ref{Figure 6}\textbf{(a)}, \textbf{(e)} and \textbf{(f)} correspond to Fig. \ref{Figure 5}\textbf{(a)} and \textbf{(b)}, Fig. \ref{Figure 5}\textbf{(c)} and \textbf{(d)} and Fig. \ref{Figure 5}\textbf{(e)} and \textbf{(f)}, respectively. } \ei{The red symbols in Fig. \ref{Figure 6}\textbf{(b)} mark the no-flow limit of the thin-wall approximation \eqref{KR, no-flow},} \zw{for which Eq. \eqref{Frequency spectrum, effect of mean flow} has the following exact solution: \begin{equation} s_{1,2}(b)=\nu_0 \pm \mathrm{i} \sqrt{\omega_{k} ^2-\omega_b^2 \sin ^2(\pi b/N)-\nu_0^2}, \label{Solution for frequency spectrum} \end{equation} where $\omega_b^2=8 \pi c^2 \mathcal{R} B/ V \ln (8B/\mathrm{e}W)>0$ and only the solution branch with positive imaginary part is considered.} \ei{Equation \eqref{Solution for frequency spectrum} implies that in the case of zero mean flow, the coupling between the cans is purely reactive, altering the reduced frequency $\sqrt{\omega_{k} ^2-\nu_0^2}$ of a single can but leaving the growth rate $\nu_0$ unchanged. If we set $\beta\equiv0$, this is consistent with the results shown in Fig. 11 in \cite{ghirardo18}, where purely reactive coupling between the cans was assumed, for the case of no flame response.} \begin{figure}[!t] \begin{psfrags} \psfrag{a}{$\nu/\omega_k$} \psfrag{b}{$\omega/\omega_k$} \psfrag{c}{$\nu$} \psfrag{d}{$\omega$} \psfrag{e}{$\mathrm{St}_k$} \psfrag{f}{$U_\mathrm{tot}$ [m/s]} \psfrag{g}{$W$ [cm]} \psfrag{h}{$\nu_0/\omega_k$} \psfrag{k}{$1.2$} \psfrag{l}{$1.1$} \psfrag{m}{$1$} \psfrag{n}{$0.9$} \psfrag{o}{$-0.2$} \psfrag{p}{$-0.1$} \psfrag{q}{$0$} \psfrag{r}{$0.1$} \psfrag{u}{$4$} \psfrag{t}{$3$} \psfrag{s}{$2$} \psfrag{m}{$1$} \psfrag{P}{$b$} \psfrag{v}{$0.8$} \psfrag{y}{$40$} \psfrag{x}{$80$} \psfrag{w}{$120$} \psfrag{z}{$0.6$} \psfrag{A}{$0.4$} \psfrag{C}{$-0.4$} \psfrag{B}{$-0.6$} \psfrag{D}{$6$} \psfrag{E}{$4$} \psfrag{F}{$2$} \psfrag{G}{$850$} \psfrag{H}{$800$} \psfrag{I}{$750$} \psfrag{J}{$700$} \psfrag{K}{$-400$} \psfrag{L}{$-200$} \psfrag{N}{$-0.3$} \psfrag{O}{$0.7$} \psfrag{F}{$2$} \psfrag{Z}{$0.3$} \psfrag{Q}{\textbf{(a)}} \psfrag{R}{\textbf{(b)}} \psfrag{S}{\textbf{(c)}} \psfrag{T}{\textbf{(d)}} \psfrag{U}{\textbf{(e)}} \psfrag{V}{\textbf{(f)}} \includegraphics[width=0.85\textwidth,center]{Figure_6.eps} \end{psfrags} \caption{\zw{Parameter study in the root locus plane. The dashed black line marks the stability border $\nu=0$. \ei{The arrows indicate the direction of increasing Bloch wavenumber $b$.} For the first set of parameters in Table \ref{Table 1}, the frequency spectrum $(\omega,\nu)$ is plotted as a function of \textbf{(a)} the normalized eigenfrequency $\mathrm{St}_k=\omega_k W / 2U$, \textbf{(b)} the bulk velocity of the combustion products $U_\mathrm{tot}$, \textbf{(c)} the aperture with $W$ and \textbf{(d)} the normalized base growth rate $\nu_0/\omega_k$. \ei{The red symbols in \textbf{(b)} mark the no-flow limit of the thin-wall approximation \eqref{KR, no-flow}.} In \textbf{(e)} and \textbf{(f)}, the spectrum $(\omega,\nu)$ is plotted as a function of $\mathrm{St}_k$ for the second set of parameters in Table \ref{Table 1}. Going from Fig. \ref{Figure 6}\textbf{(e)} to \textbf{(f)}, the can spacing is increased from $h/W=0$ to $h/W=0.5$.}}\label{Figure 6} \end{figure} \zw{The parameter study in the root locus plane is continued in Fig. \ref{Figure 7}, where, for the first set of parameters in Table \ref{Table 1}, the frequency spectrum $(\omega,\nu)$ is plotted as a function of \textbf{(a)} the ambient speed of sound $c$, \textbf{(b)} the can length $L$, \textbf{(c)} the aperture height $B$ and \textbf{(d)} the cross-section area of the cans $A$. \ei{In Fig. \ref{Figure 7}\textbf{(a)} and \textbf{(b)}, it was assumed that $\omega_k$ varies proportional to $c$ and $1/L$, respectively, starting from the parameter values in Table \ref{Table 1}.} In Fig. \ref{Figure 7}\textbf{(d)}, all higher-order Bloch mode spectra (not shown) follow the same curve as the shown mode with $b=1$, but for the same range of values of $A$, they extend farther into the left half-space and end at a lesser growth rate $\nu/\omega_k$.} \begin{figure}[!t] \begin{psfrags} \psfrag{a}{$1.1$} \psfrag{b}{$1$} \psfrag{c}{$0.9$} \psfrag{d}{$-0.2$} \psfrag{e}{$-0.1$} \psfrag{f}{$0$} \psfrag{k}{\hspace{0.2cm}$\nu/\omega_k$} \psfrag{o}{$\omega/\omega_k$} \psfrag{p}{$1000$} \psfrag{q}{$750$} \psfrag{r}{$500$} \psfrag{s}{$1.5$} \psfrag{t}{$1.15$} \psfrag{u}{$0.8$} \psfrag{v}{$0.36$ } \psfrag{w}{$0.21$} \psfrag{x}{$0.06$ } \psfrag{A}{\textbf{(a)}} \psfrag{B}{\textbf{(b)}} \psfrag{C}{\textbf{(c)}} \psfrag{D}{$c$ [m/s]} \psfrag{E}{$L$ [m]} \psfrag{F}{$B$ [m]} \psfrag{G}{$b$} \psfrag{X}{$-0.2$} \psfrag{Y}{$0.25$} \psfrag{Z}{$0.15$} \psfrag{W}{$0.05$} \psfrag{I}{\textbf{(d)}} \psfrag{J}{$b=1$} \psfrag{K}{$0$} \psfrag{H}{$A$ [m$^2$]} \includegraphics[width=0.87\textwidth,center]{Figure_7.eps} \end{psfrags} \caption{\ei{Parameter study in the root locus plane for the first set of parameters in Table \ref{Table 1} and vanishing can spacing $h/W$. The dashed black line marks the stability border $\nu=0$. \ei{The arrows indicate the direction of increasing Bloch wavenumber $b$.} The frequency spectrum $(\omega,\nu)$ is plotted as a function of \textbf{(a)} the ambient speed of sound $c$, \textbf{(b)} the can length $L$, \textbf{(c)} the aperture height $B$ and \textbf{(d)} the cross-section area of the cans $A$. In Fig. \textbf{(a)} and \textbf{(b)}, it was assumed that the eigenfrequency $\omega_k$ varies proportional to $c$ and $1/L$, respectively, starting from the parameter values in Table \ref{Table 1}. In \textbf{(d)}, all higher-order Bloch mode spectra (not shown) follow the same curve as the shown mode with $b=1$.}}\label{Figure 7} \end{figure} \ei{The influence of the can spacing $h/W$ on the frequency spectrum is investigated in Fig. \ref{Figure 8}, which shows the transition from Fig. \ref{Figure 6}\textbf{(e)} to \textbf{(f)} in more detail. Shown is the spectrum $(\omega,\nu)$ as a function of the normalized eigenfrequency $\mathrm{St}_k=\omega_k W / 2U$ for different values of $h/W\in\{0,0.02,0.06,0.1,0.2,0.5\}$. The colors above the insets correspond to those of the Rayleigh conductivity curves in Fig. \ref{Figure 3}. } \begin{figure}[!t] \begin{psfrags} \psfrag{a}{$\nu/\omega_k$} \psfrag{b}{$\omega/\omega_k$} \psfrag{c}{$\nu$} \psfrag{d}{$\omega$} \psfrag{e}{$\mathrm{St}_k$} \psfrag{f}{$U$ [m/s]} \psfrag{g}{$W$ [mm]} \psfrag{h}{$\nu_0/\omega_k$ [-]} \psfrag{k}{$1.2$} \psfrag{l}{$1.1$} \psfrag{m}{$1$} \psfrag{n}{$0.9$} \psfrag{o}{$-0.2$} \psfrag{p}{$-0.1$} \psfrag{q}{$0$} \psfrag{r}{$0.1$} \psfrag{u}{$4$} \psfrag{t}{$3$} \psfrag{s}{$2$} \psfrag{m}{$1$} \psfrag{P}{$b$} \psfrag{v}{$0.8$} \psfrag{y}{$60$} \psfrag{x}{$40$} \psfrag{w}{$20$} \psfrag{z}{$0.6$} \psfrag{A}{$0.4$} \psfrag{C}{$-0.4$} \psfrag{B}{$-0.6$} \psfrag{D}{$6$} \psfrag{E}{$4$} \psfrag{F}{$2$} \psfrag{G}{$850$} \psfrag{H}{$800$} \psfrag{I}{$750$} \psfrag{J}{$700$} \psfrag{K}{$-400$} \psfrag{L}{$-200$} \psfrag{N}{$-0.3$} \psfrag{O}{$0.7$} \psfrag{F}{$2$} \psfrag{Z}{$0.3$} \psfrag{Q}{(a)} \psfrag{R}{(b)} \psfrag{S}{(c)} \psfrag{T}{(d)} \psfrag{U}{(e)} \psfrag{V}{(f)} \psfrag{1}{\hspace{0.2cm}\textcolor{krblue}{$h/W=0$}} \psfrag{2}{\hspace{0cm}\textcolor{krgreen}{$h/W=0.02$}} \psfrag{3}{\hspace{0cm}\textcolor{krpurple}{$h/W=0.06$}} \psfrag{4}{\hspace{0.1cm}\textcolor{black}{$h/W=0.1$}} \psfrag{5}{\hspace{0.1cm}\textcolor{krcyan}{$h/W=0.2$}} \psfrag{6}{\hspace{0.1cm}\textcolor{krorange}{$h/W=0.5$}} \includegraphics[width=0.93\textwidth,center]{Figure_8_rasterize.eps} \end{psfrags} \caption{\ei{Transition from Fig. \ref{Figure 6}\textbf{(e)} to \textbf{(f)} in more detail. Shown is the frequency spectrum $(\omega,\nu)$ as a function of the normalized eigenfrequency $\mathrm{St}_k=\omega_k W / 2U$ for different values of the can spacing $h/W\in\{0,0.02,0.06,0.1,0.2,0.5\}$. The dashed black line marks the stability border $\nu=0$. The arrow indicates the direction of increasing Bloch wavenumber $b$. The colors above the insets correspond to those of the Rayleigh conductivity curves in Fig. \ref{Figure 3}.}}\label{Figure 8} \end{figure} \subsection{Discussion \label{Subsection discussion}} \zw{We now discuss and give a physical interpretation of the results presented in $\S$\ref{Subsection parameter study}.} \ei{For nominally unstable conditions, our model predicts that the aeroacoustic coupling between the cans may effectively damp certain Bloch modes over a range of $\omega_k$ around $\omega_k W/U_\mathrm{tot}\approx 0.4$. Under different conditions, the coupling can lead to instabilities in nominally stable systems. Increasing the can width to around $h/W\approx 0.5$ fully suppresses the coupling-induced instability. To the authors' knowledge, these coupling-induced phenomena have not been previously described.} \ei{We have identified several parameters that influence the stability of the Bloch modes: The eigenfrequency $\omega_k$, the bulk velocity of the combustion products $U_\mathrm{tot}$, the aperture width $W$, the base growth rate $\nu_0$, the ambient speed of sound $c$, the can length $L$, the aperture height $B$ and the cross-section area of the cans $A$.} \zw{In the absence of mean flow in the cans, the coupling between the cans is purely reactive and does not affect the linear stability of the system.} \zw{We give the following physical interpretation of the results of the parameter study. It is observed in Figs. \ref{Figure 5}, \ref{Figure 6}, \ref{Figure 7} and \ref{Figure 8} that Bloch modes with higher Bloch wavenumber $b$ are more strongly affected by the coupling. To explain this, note that the larger the phase difference between neighboring cans, the larger the apparent acoustic pressure difference at the coupling aperture at a given time. This pressure difference difference drives, through Eq. \eqref{Unsteady Bernoulli equation, not appendix}, the acoustic-hydrodynamic interaction, which may, depending on the value of the Strouhal number, act amplifying or dissipative on the sound field in the control volume. Therefore, the larger the Bloch wavenumber, the stronger the influence of the acoustic coupling between the cans on the linear stability of the Bloch modes.} \ei{This interpretation is exemplified in Fig. \ref{Figure 9}, which visualizes the acoustic-hydrodynamic interaction corresponding to a coupling-induced instability for the second set of parameters in Table \ref{Table 1}. For simplicity, vanishing can spacing $h/W$ was assumed.} \zw{Shown in Fig. \ref{Figure 9}\textbf{(a)} and \textbf{(b)} are the normalized acoustic pressure distribution at a given time instant and the real part of the normalized vortex sheet displacement $\mathrm{Re}\big[\zeta' e^{(-\mathrm{i}\omega + \nu) t}\big]$ at 4 equally spaced points in time during an acoustic cycle with period $T=2\pi/\omega$, respectively, for the Bloch mode with $b=5$. \gc{For visualization purposes, $\zeta'$ is scaled with the normalized pressure difference between the cans.} The insets in Fig. \ref{Figure 9}\textbf{(c)} and \textbf{(d)} show the same for the Bloch mode with $b=2$. In these cases, the normalized frequency spectrum $(\omega/\omega_k,\nu/\omega_k)$ is $(0.899,1.53\times 10^{-2})$ for $b=5$ and $(0.978,-6.19\times 10^{-3})$ for $b=2$. In this example, the higher apparent pressure differences across the coupling interfaces lead to an instability of a higher-order Bloch mode, while the lower-order Bloch mode remains stable. Note that the periods $T$ are different for the cases shown in Fig. \ref{Figure 9} \textbf{(b)} and \textbf{(d)}, respectively, and that the Bloch mode with $b=2$ oscillates at a $9\%$ higher frequency than the one with $b=5$.} \zw{The large displacements of the vortex sheet at the downstream edge of the aperture shown in Fig. \ref{Figure 9} are characteristic of Howe's theory (see p. 437 in \cite{howe_1998}). This typical spatial behavior of the vortex sheet displacement, which is enabled by the Kutta condition \eqref{Kutta condition}, is a simplified representation of the violent motions and acoustic energy production that occurs when pockets of coherent vorticity shed from the upstream edge make contact with the downstream edge \cite{howe_1981}. In reality, shedding of discrete vortices can take place where the shear layer rolls up before the turbine inlet. Vortex sheet roll-up has been revisted recently by \cite{Devoria2018299}. A numerical study on acoustic sound production by grazing turbulent flow over a T-junction aperture including examples of discretely shed vortices is presented in \cite{Bauerheim20}.} \begin{figure}[!t] \begin{psfrags} \psfrag{a}{\hspace{0.1cm}$\hat{\eta}_{j}/\hat{\eta}_{j,\mathrm{max}}$} \psfrag{b}{$\xi$} \psfrag{f}{$1$} \psfrag{g}{$0$} \psfrag{h}{$-1$} \psfrag{i}{$1$} \psfrag{j}{$-1$} \psfrag{K}{$\hspace{3.7cm}$ \begin{tabular}{@{}c@{}} Bloch mode with $b=5$ \\ Norm. acoustic pressure \end{tabular}} \psfrag{L}{$\hspace{3.98cm}$Bloch mode with $b=2$} \psfrag{N}{$\hspace{2.7cm}$Norm. vortex sheet displacement $\mathrm{Re}\big[\zeta'(t)\big]$} \psfrag{P}{$\hspace{3.4cm}$Norm. vortex sheet displacement $\zeta'(t)$} \psfrag{k}{1} \psfrag{l}{2} \psfrag{m}{$3$} \psfrag{n}{$4$} \psfrag{o}{$5$} \psfrag{p}{$6$} \psfrag{q}{$7$} \psfrag{r}{$8$} \psfrag{s}{$9$} \psfrag{t}{$10$} \psfrag{u}{$11$} \psfrag{v}{$12$} \psfrag{A}{\textbf{(a)}} \psfrag{B}{\textbf{(b)}} \psfrag{C}{$\pi$} \psfrag{D}{$\dfrac{3\pi}{2}$} \psfrag{1}{\hspace{0.3cm}\ei{Can number $j$}} \psfrag{X}{$\textcolor{red}{\zeta'(t)}$} \psfrag{Y}{$\textcolor{red}{\zeta'(t)}$} \psfrag{M}{\hspace{0.3cm}$7$} \psfrag{Q}{\textbf{(a)}} \psfrag{R}{\textbf{(b)}} \psfrag{S}{\textbf{(c)}} \psfrag{T}{\textbf{(d)}} \includegraphics[width=0.93\textwidth,center]{Figure_9.eps} \end{psfrags} \caption{\zw{Visualization of the acoustic-hydrodynamic interaction corresponding to a coupling-induced instability for the second set of parameters in Table \ref{Table 1}.} \ei{Vanishing can spacing $h/W$ was assumed.} \zw{Shown in \textbf{(a)} and \textbf{(b)} are the normalized acoustic pressure distribution at a given time instance and the real part of the normalized vortex sheet displacement $\mathrm{Re}\big[\zeta' e^{(-\mathrm{i}\omega + \nu) t}\big]$ at 4 equally spaced points in time during an acoustic cycle with period $T=2\pi/\omega$, respectively, for a Bloch mode with $b=5$. \gc{For visualization purposes, $\zeta'$ is scaled with the normalized pressure difference between the cans.} Shown in \textbf{(c)} and \textbf{(d)} is the same for a Bloch mode with $b=2$. The normalized frequency spectrum $(\omega/\omega_k,\nu/\omega_k)$ is $(0.899,1.53\times 10^{-2})$ for $b=5$ and $(0.978,-6.19\times 10^{-3})$ for $b=2$. Note that the periods $T$ are different for the two cases shown in \textbf{(b)} and \textbf{(d)}, respectively, and that the Bloch mode with $b=2$ oscillates at a $9\%$ higher frequency than the one with $b=5$.}}\label{Figure 9} \end{figure} \section{Conclusions} \label{Section 6: Conclusions} \zw{We have derived a coupled oscillator model of a thermoacoustic instability in an idealized can-annular combustor. By combining the unimodal projection of the Helmholtz equation for the can acoustics, a detailed fluid-dynamical model for the can-to-can communication and a Bloch wave ansatz, we derived a single equation for the frequency spectrum. We performed a parameter study and identified two special conditions: one where the aeroacoustic coupling acts dissipative on the nominally unstable thermoacoustic system and one where amplifying coupling leads to an instability in a nominally stable system. We identified several model parameters which influence the system stability, including the bulk velocity of the combustion products $U_\mathrm{tot}$, whose effect on the system stability has not been considered in previous studies. We gave a physical interpretation of our results, arguing that higher-order Bloch modes more strongly drive the acoustic-hydrodynamic interaction between the cans due to higher apparent pressure differences at the coupling interfaces. This leads to a stronger influence of the coupling on these higher-order modes. We believe the present analysis, which highlights the effect of the fluid motion in the apertures between the cans on the thermoacoustic instability, can further the rational development of mitigation measures against instabilities in real-world gas turbines.} \vskip6pt \enlargethispage{20pt} \dataccess{The datasets used for generating the plots and results in the present study can be directly obtained from the numerical simulation of the related mathematical equations in the manuscript.} \aucontribute{T. P. carried out the formal analysis and the investigation, performed the simulations and the model validation, wrote the original draft and revised the manuscript. N. N. conceived and supervised the study, helped carry out the formal analysis and the investigation, critically reviewed and edited the original draft. All authors gave final approval for publication and agree to be held accountable for the work performed therein.} \competing{The authors declare that they have no competing interests.} \funding{This project is funded by the Swiss National Science Foundation under Grant agreement 184617. } \vskip2pc \bibliographystyle{RS}
\section{Conclusion} This paper utilize a two-stage framework for ASTE tasks. We first extract the target and opinion words by sequence labeling. Then, we use the perceivable pairs at the second stage to make target/opinion words aware the target-opnion-tuples they are currently in, which enhance the target-opinion correlation and further improve matching accuracy. Moreover, we use the compound computations to accelerate training and inference, and restricted attention field to reduce mutual interference. Results from detailed experiments show that our method achieves good performance on four datasets and gets more significant performance advantages in complex situations. \section{Related Work} In this section, we will briefly review works on sentiment analysis and triplet extraction. Aspect-level Sentiment Analysis (ABSA) proposed by \cite{sentiment2014} has recently been receiving attention from the research community. In ABSA, many different kinds of tasks have been developed. One is defined as analyzing a specified aspect's sentiment polarity in a sentence \cite{dong2014adaptive,ma2017interactive,tang2020dependency}. Other two kinds of sentiment analysis do not specify the aspects in advance, which has a strong similarity with Aspect Sentiment Triplet Extraction (ASTE). Aspect-sentiment pair extraction \cite{li2019unified}, which extracts the aspect word and its sentiment polarity from the sentence. And aspect-opinion co-extraction \cite{li2018aspect} tends to extract aspects and opinions simultaneously. The above two tasks are both subsets of the ASTE task. The ASTE task can analyze the sentiment polarity of the target, and give opinion words as the classification basis, which is more practical in actual scenarios. In addition to the ASTE, another influential triplet extraction task in the NLP community is Joint Entity and Relation Extraction (JERE). The goal of JERE is to extract entities from sentences and give the relationships between the extracted entities. In terms of model granularity when matching, the existing work on JERE can be divided into token level models \cite{zhang2017end,zheng2017joint} and span level models \cite{wadden2019entity,zhong2020frustratingly}. The Joint Matching and Sentiment Classification part of our framework is inspired by those span level models, emphasizing that spans need to be explicitly recognized and perceived by the model. The most similar work with us in JERE is ~\citet{zhong2020frustratingly}, we list the main differences between our framework and theirs from the perspective of the model structure below: {$i)$} the entities of the their JERE task may overlap, they use a span-based method for entity extraction, which is relatively inefficient because it requires searching all possible spans in the sentence. Since there is no overlap between target and opinion in our task, we adopt token classification method to obtain the range of target and opinion. In the ASTE task, this will be more efficient than their method. {$ii)$} Our marker tokens will form the Perceivable Pairs based on the pairing of target and opinion, rather than the simple pairwise combinations. {$iii)$} We use different segment id to distinguish the original input and marker combinations (Perceivable Pair) part in matching stage. {$iv)$} They put all possible marker combinations in the sentence at one time only at inference time but not at training time due to model performance. In our framework, we put all possible the marker combinations (Perceivable Pair) in the sentence at the same time during training and does not affect the performance of the model, so all sentence is only calculate once during training and inference. \section{Introduction}\label{chap: intro} \textbf{A}spect-\textbf{B}ased \textbf{S}entiment \textbf{A}nalysis (\textbf{ABSA}) \cite{liu2012sentiment,ma2017interactive,zhao2019modeling} task aims at identifying the sentiment associated with a specified target in a sentence. It constitutes a corner stone for sentiment analysis \cite{feldman2013techniques,zhang2018deep} applied in different scenarios such as social media \cite{agarwal2011sentiment}, e-commerce \cite{fang2015sentiment}, and the press industry \cite{godbole2007large}. In this paper, we focus on the \textbf{A}spect \textbf{S}entiment \textbf{T}riplet \textbf{E}xtraction (\textbf{ASTE}) task. ASTE is expanded from ABSA however has two major differences: $i)$ ASTE does not specify target entities in the sentence, instead practitioners are required to exhaustively extract all entities along with related sentiment. $ii)$ For all extracted sentiment, the corresponding rationale, which we call ``opinion'', should also be included in the final output. In Figure \ref{fig:data_fig}, the opinion word ``\textit{High}'' indicates a \textit{negative} attitude towards the target ``\textit{price}'' in the triplet {(price, NEG, High)}. \begin{figure}[t] \centering \includegraphics[width=0.5\textwidth]{figure/task_fig.pdf} \caption{An example of ASTE. The target words are colored yellow, and the opinion words are colored red.} \label{fig:data_fig} \end{figure} The prior work can be roughly divided into two categories, namely tagging-based methods and matching-based methods. To assign proper sentiment polarities to the corresponding target-opinion pairs, a principled tagging-based method \cite{xu2020position} allocates a composite tag (e.g. a tuple) to each word in the sentence, which indicates the positions of target and opinion words and related sentiment. But such tagging methods fail to handle the one-opinion many-targets situations as illustrated in Figure \ref{fig:data_fig}. Different from the tagging-based methods, the matching-based methods adopt a ``first extract and then match'' pipeline. Different extraction methods correspond to specific model configurations on subtask combination, e.g. \citet{peng2020knowing} extracts target-polarity tuples and opinion words while \citet{zhang2020multi} obtain target words, opinion words and sentiment polarities separately via a multi-task learning framework. Both \citet{peng2020knowing} and \citet{zhang2020multi} perform pairwise matching after extraction. The potential risks in prior work include $i)$ the defective subtask combination. According to human perception, people naturally judge the sentiment based on target-opinion pairs, e.g. negative for ``high price'' and positive for ``high service''. Comparing with independently retrieving target, opinion and sentiment opponents \cite{zhang2020multi} or matching target-polarity tuples with opinion words \cite{peng2020knowing}, obtaining target-opinion tuples at the first stage and then assigning corresponding sentiment polarity would be a better subtask combination. $ii)$ the inefficiency in handling ``many targets to one opinion'' and ``many opinions to one target'' situations. Taking the opinion word ``high'' in Figure \ref{fig:data_fig} as an example, in phrase ``high price'' it means ``expensive'', when paired with ``service'', ``high'' refers to ``good quality''. However in prior work \cite{peng2020knowing,zhang2020multi}, they first obtain the representation of word ``high'' through sentence encoders. Then while matching targets ``service'' or ``price'', they use the \textit{same} representation for the opinion word ``high'' regardless of the ambiguity in different target-opinion word collocations. To this end, we use a two-stage framework that first extracts target and opinion words in the sentence and then judges the sentiment polarity with target-opinion-tuple-aware representation. The subtask setting adheres to human cognition, i.e. making the judgement (sentiment polarity) according to the supporting evidence (target-opinion pairs). To mitigate the ambiguity in different target-opinion word collocation, we enumerate all possible target-opinion pairs and append them to the input sentence. In the ``many targets to one opinion'' and ``many opinions to one target'' situations, while matching different targets and opinions, we would choose the corresponding pair representation in the input sequence. Specifically in the first stage, we exploit a BERT-based \cite{devlin2018bert} tagging model to extract the target words and opinion words from input sentences like previous work \cite{peng2020knowing,xu2020position}. But we do not perform any other additional tasks such as sentiment classification like them at this stage. In the second stage, inspired by the mark tokens in the relation classification task~\cite{zhang2019ernie,soares2019matching,zhong2020frustratingly}, we use a group of artificial tags to form a specific \textit{Perceivable Pair} for each target-opinion pair and append them to the input sentence. Follow the settings of \cite{zhong2020frustratingly}, the \textit{perceivable pairs} share the same position embedding with the related words in the input sentence to explicitly point out the positions of target and opinion spans. With BERT encoder, when determining the sentiment polarity for a potential target-opinion pair, we retrieve the corresponding perceivable pair representation from the input sequence for 4-way sentiment classification. Apart from \textit{positive, neutral, negative} labels, we assign ``\textit{N/A}'' labels to the target-opinion pairs which can not constitute sentiment triples. As there may be many target-opinion pairs in the sequence. To avoid negative interference between them, we adopt the attention constraint from \cite{zhong2020frustratingly}. So when encoding a certain target-opinion pair in the input sequence, the model can only leverage the sentence representation and does not have the access to other target-opinion pairs to avoid negative interference. We summarize our contributions as follows: \begin{itemize} \item We use a two-stage framework in ASTE which extracts target-opinion pairs and then judges their sentiment polarity. The subtask combination achieves good performance and comports with human cognition. \item We utilize sequential input representation with perceivable pairs and restricted attention to enhance the correlation between target-opinion pairs, which resolves ambiguity in word collocation. \item We conducted experiments on four datasets, the experimental results show the effectiveness of our model. In addition, empirically our model performs better in complex situations like ``many-to-one'' relations and multiple triplets in one sentence. \end{itemize} \subsection{Ablation Study} To verify the effects of the components in our framework, we conduct some ablation experiments. The results are shown in Table \ref{tab:analysis_results}. We first verified the effectiveness of perceivable pairs by removing the start tag and the end tag of perceivable pairs, respectively. The experimental results are given in Table \ref{tab:analysis_results} a) and b). It can be seen that the performance has shown some decline. This shows that perceivable pairs are fully effective in indicating complete term spans. After that, we completely remove the perceivable pairs from the sequence and only use the representation of the term for matching like previous matching-based methods. The results are shown in Table \ref{tab:analysis_results} c). We notice that the performance has dropped more significantly than the previous two experiments, which shows the perceivable pairs inserted into the sequence can establish the correlation between them by making target/opinion words aware the target-opinion-tuple they are current in. Finally, we removed the tag segment's special segment id and merged it with the original sequence into one segment. The experimental results are shown in d). Since perceivable pairs are artificially added tokens, they may confuse the model if they are not distinguished from the original input. Then we conducted two experiments on the restricted attention field. We first removed the restricted attention field in the tag segment. All perceivable pairs in tag segment can be seen by other pairs, but the tokens in the original sequence remain the same as before. The experimental results are shown in Table \ref{tab:analysis_results} e). Performance has dropped significantly. As discussed before, perceivable pairs are effective because they establish a strong correlation between target-opinion pairs. After removing the attention field restriction in the tag segment, tags in perceivable pairs can see all other tags in the sentence instead of being limited to the specific target-opinion pair. Thus the correlation is significantly weakened. Therefore, the performance of the model is significantly declined. Then we go one step further and remove all restricted attention field, so all tokens in the sequence could see other tokens without any restriction. The experimental results are shown in f), exhibiting a more obvious decline than e). At this time, the pairwise correlation of the target-opinion pair no longer exists, and the original tokens see a large number of artificial tokens, which also affect their representation. \subsection{Case study on Perceivable Pairs} \begin{figure}[t] \centering \includegraphics[width=0.45\textwidth]{figure/fig_case_study.pdf} \caption{Visual comparison of the attention weight between target word (\textit{service}) and corresponding start tag in perceivable pairs. } \label{fig:case_study} \end{figure} \begin{figure}[t] \centering \includegraphics[width=0.45\textwidth]{figure/complex.pdf} \caption{Performance comparison in complex situations with multiple triplets in a sentence. Due to limited space, we only show the results of the \texttt{14Lap} dataset. All the models mentioned in this figure use BERT as the encoder.} \label{fig:data_complex} \end{figure} \begin{table}[t] \centering \scalebox{0.7}{ \begin{tabular}{lccc|ccc} \toprule \multirow{2}{*}{\textbf{Models}} & \multicolumn{3}{c}{\texttt{14Lap}} & \multicolumn{3}{c}{\texttt{15Rest}} \\ & $P.$ & $R.$ & $F_1$& $P.$ & $R.$ & $F_1$ \\ \midrule Ours &70.18&59.07&64.15&68.36&69.54&68.95 \\ \midrule OTE-MTL$_{\scriptscriptstyle \text{+ BERT}}$ & 64.33 & 42.15 & 50.93 &59.37 &43.68& 50.33 \\ JET$^o_{\scriptscriptstyle \text{+ BERT}}$& 60.49&37.55&46.34&67.59&41.95&51.77\\ JET$^t_{\scriptscriptstyle \text{+ BERT}}$ & 59.62&35.63&44.60&68.00&29.31&40.96\\ \bottomrule \end{tabular} } \caption{Performance comparison in complex situations with one-to-many correspondence. All the models mentioned in this table use BERT as the encoder. Due to limited space, we only list the results of two datasets. Similar results can be seen on other datasets.} \label{tab:ont_to_many} \end{table} To better explore the effect of perceivable pairs in the model, we conducted a case study. We feed the sequence with perceivable pairs into BERT, and check the attention weight of the target word (\textit{service}) and its corresponding start tag in perceivable pair respectively. The result is shown in Figure \ref{fig:case_study}. It turns out that the former will pay attention to all the opinion words (\textit{Great} and \textit{dreadful}) in the sentence, but only \textit{dreadful} really needs to be focused. While the latter using perceivable pairs focus on the truly important words (\textit{service} and \textit{dreadful}). Moreover, it can be seen from the attention weight distribution that those tags in perceivable pair establish a strong correlation between the target-opinion pair. The final sentiment classification result using only the original representation of the \textit{service} in the sentence is incorrectly classified as positive. In contrast, the classification based on perceivable pair is correct and marked as negative. The comparison of the two results also shows the actual effect of the perceivable pairs. \subsection{Model performance in complex situations} We examined the performance comparison between our method and other baseline models in complex situations where there are multiple triplets in a sentence. The results are shown in Figure \ref{fig:data_complex}. As the number of triplets increases, the performance gap between our framework and other models becomes more obvious. Since our method uses different perceivable pairs to model all possible target-opinion pairs, as the number of triplets in the sentence increases, our method will not be greatly affected. We also investigated the one-to-many problem in which a word appears in multiple triplets in a sentence. We extract this part of the data for experiments, and the results are shown in Table \ref{tab:ont_to_many}. It can be seen that in the one-to-many situation, our model also has significant performance advantages. Since our model utilizes the restricted attention field to isolate different target-opinion combinations of the same word, it will not be affected much in the complex scenario like one-to-many. \section{Methodology} This section will introduce our approach in detail. An overview of our approach is shown in Figure \ref{fig:main}. We use a sequence labeling model to jointly extract the targets and opinions in the sentence first. Then assign perceivable pairs to all possible target-opinion pairs to mitigate the ambiguity in different target-opinion word collocation. After that, following \citet{zhong2020frustratingly}, we use the compound computation mechanism to improve computational efficiency and the restricted attention field to reduce the mutual influence. Finally, we take the representations of perceivable pairs as the basis for matching to get the final result. \subsection{Target and Opinion Extraction} Our target and opinion word extraction component is a sequence labeling model based on BERT \cite{devlin2018bert} with a $\rm B, I, O, E, S$ tagging system\footnote{$\rm B, I, O, E, S$ denotes ``B-begin'', ``I-inside'', ``O-outside'', ``E-end'' and ``S-single''.} , where there are four types of labels $\rm B$, $\rm I$, $\rm E$, $\rm S$ with $\rm Target$ and $\rm Opinion$ (e.g., $\rm B-Target$), and 9 types in total for both target and opinion, as well as an unmarked label $\rm O$. Given an input sequence with $l$ tokens $X=w_1, w_2, ..., w_l$, we first let tokens obtain contextualized representations $R_e=\{r_{e_1}, r_{e_2}, ..., r_{e_l}\}$ through BERT. Then we do token classification to get the extraction distributions: \begin{equation} P^e_i = {\rm softmax}(r_{e_i}\textbf{W}_e+b_e) \end{equation} where $\textbf{W}_e\in \mathbb{R}^{d\times 9}$, $b_e \in \mathbb{R}^{9} $, $d$ is the dimension of encoding vectors. We extract target and opinion jointly. Correspondingly, we use cross-entropy as the loss function at this stage, which is defined as follows: \begin{equation} \mathcal{L}_e = \sum_{i=1}^l -y^e_i{\rm log}P^e_i \end{equation} where $y^e_i$ is the one-hot vector of ground truth label. After obtaining the classification result of each token, we will merge them into the corresponding target set $C_t$ and opinion set $C_o$ for subsequent models: \begin{equation} \begin{aligned} C_t&=\{t_1, t_2, .. t_m\} \\ C_o&=\{o_1, o_2, ..., o_n\} \end{aligned} \end{equation} where $m$, $n$ are the number of target and opinion words, respectively. \subsection{Joint Matching and Sentiment Classification} \subsubsection{Perceivable Pairs} As discussed in Chapter \ref{chap: intro}, to well learn the word representation in a specific target-opinion pair, we need to let target/opinion words aware the target-opinion-tuple they are currently in. Therefore, we add the artificial tags named perceivable pair which correspond to the predicted targets and opinions from the first stage into the sentence. Indicating the span boundaries with the artificial tokens has been widely used in many Joint Entity and Relation Extraction models~\cite{zhang2019ernie,soares2019matching,zhong2020frustratingly}. We use the similar settings to enhance the connection between the specific target and opinion. Each perceivable pair contains four kinds of tags which correspond to the start and end of target and opinion, respectively. Each perceivable pair is defined as: \begin{equation} A_{ij} = \{ \texttt{T-B}_{i}, \texttt{T-E}_{i}, \texttt{O-B}_{j}, \texttt{O-E}_{j}\} \end{equation} where $i$, $j$ represents the $i$-th target and $j$-th opinion in $X$. \subsubsection{Compound Computations} Commonly, more than one target or opinion may appear in a sentence. If we need to obtain the representations of each possible perceivable pair of targets and opinions, we will get $m*n$ sequences. Each of them is composed of the sentence $X$ and one possible perceivable pair, as the input of the encoder. This will bring a high computation load for the model. Following the methods from \cite{zhong2020frustratingly}, we use compound computation which simultaneously considers all the possible perceivable pairs in one sequence to solve this problem. We first get all the perceivable pairs $A_{ij}$ and concatenate them together as the segment $X_{ts}$. \begin{equation} \begin{aligned} X_{ts} = &\{ A_{11}, A_{12}, ..., A_{1n} , \\ & ~~A_{21}, A_{22}, ..., A_{2n} , \\ & ~~... , \\ & ~~A_{m1}, A_{m2}, ..., A_{mn} \} \end{aligned} \end{equation} where $m,n$ are the number of targets and opinions. Then we concatenate the original sequence $X$ with $X_{ts}$ and get the new sequence: \begin{equation} X_p= X + X_{ts} \end{equation} At the same time, the perceivable pairs keep their corresponding position information by sharing their position embeddings with the boundary tokens of the corresponding span: \begin{equation} \begin{aligned} {\rm Position}(\texttt{T-B}_i)&= {\rm Position}(t_{i-{\rm start}}) \\ {\rm Position}(\texttt{T-E}_i)&= {\rm Position}(t_{i-{\rm end}}) \\ {\rm Position}(\texttt{O-B}_j)&= {\rm Position}(o_{j-{\rm start}}) \\ {\rm Position}(\texttt{O-E}_j)&= {\rm Position}(o_{j-{\rm end}}) \end{aligned} \end{equation} Finally, different from~\cite{zhong2020frustratingly}, we use different segment id for each token in the sequence $X_p$ to distinguish the original sentence and newly added perceivable pairs, as shown in Figure \ref{fig:bert}. \subsubsection{Restricted Attention Field} Since multiple perceivable pairs occur simultaneously in the same sequence, they interfere each other and may confuse the model. To reduce their interference, we also adopt the restricted attention field from~\cite{zhong2020frustratingly} to let different types of tokens have different activated attention fields. For each token in $X_{ts}$, its attention field includes its corresponding perceivable pair and the original sequence $X$. Meanwhile, each token in the segment $X_{ts}$ is not visible to tokens in $X$. Figure \ref{fig:bert} shows an example sequence composed of the original sentence and the four perceivable pairs, which are distinguished by five different colors. In the last row, for each token we use square(s) to denote its attention field, meaning this token will attend to the segments with the corresponding colors. Formally, the attention field of tokens can be defined as follows: \begin{equation} {\rm AttnField}(w_i)=\left\{ \begin{aligned} & X, & w_i \notin X_{ts}\\ & X \cup A_{ij}, & w_i \in X_{ts} \end{aligned} \right. \end{equation} where $w_i, w_j \in A_{ij}$ . \subsubsection{Matching} We put the modified sequence $X_{p}$ into BERT to obtain the correlation-enhanced representation: \begin{equation} \begin{aligned} R_{p} = \{& h_\texttt{[CLS]}, h_1, ..., \\ &h_\texttt{[SEP]}, ..., H_{ij}, ..., h_\texttt{[SEP]} \} \end{aligned} \end{equation} where $H_{ij} = \{ h_{\texttt{T-B}_{i}}, h_{\texttt{T-E}_{i}}, h_{\texttt{O-B}_{j}}, h_{\texttt{O-E}_{j}} \}$. After that, we fuse the representation of the target $i$ and opinion $j$ in $A_{ij}$ as the representation of the perceivable pair: \begin{equation} r_{ij} = [h_{\texttt{T-B}_i}; h_{\texttt{O-B}_j}] \end{equation} where $;$ represents vector concatenation. Finally, the representation $r_{ij}$ is used to predict their matching result and sentiment polarity: \begin{equation} P^m_{ij} = {\rm softmax}(r_{ij}\textbf{W}_m+b_m) \end{equation} where $\textbf{W}_m \in \mathbb{R}^{2d\times 4}$, $b_m \in \mathbb{R}^{4}$. Each pair of target and opinion will be classified into four categories: \begin{equation} L_m=\{\texttt{POS},\texttt{NEU}, \texttt{NEG}\} \cup \{\texttt{O}\} \end{equation} where the label \texttt{O} indicates that this pair of words does not match. Here, we use cross-entropy as the loss function. The total loss of a sentence is the sum of each possible target-opinion pair's loss in the sentence, which is defined as follows: \begin{equation} \mathcal{L}_m = -\sum_{i=1}^p \sum_{j=1}^q y^m_{ij}{\rm log}P^m_{ij} \end{equation} where $p$ and $q$ are the number of targets and opinions in the sentence, respectively. $y^m_{ij}$ is the one-hot vector of the ground-truth label of matching and sentiment polarity. \section{Experiments and Analysis} \subsection{Datasets} We utilize datasets created by \cite{xu2020position} named ASTE-DATA-V2 in our experiment. Compared to ASTE-Data-V1 proposed by \cite{peng2020knowing}, the V2 version contains cases where one target/opinion is associated with multiple opinions/targets, which is very common in actual scenarios. The overview of datasets is listed in Table \ref{tab:dataset}. The division of the dataset is consistent with that of \cite{xu2020position}. \subsection{Baselines} We compare our method with the following baseline models, some pipeline-based methods are modified by \cite{peng2020knowing} for this task: \begin{itemize} \item \textbf{CMLA+} is modified from CMLA \cite{wang2017coupled}. CMLA uses the attention mechanism to capture the relationship between words and jointly extract target and opinion, and CMLA+ further adds an MLP on CMLA to determine whether a triplet is correct in the matching stage. \item \textbf{RINANTE+} is modified from RINANTE \cite{dai2019neural}. RINANTE is based on LSTM-CRF and fuses rules as weak supervision to capture words' dependency relations in a sentence. The way RINANTE+ determines the correctness of a triplet is the same as CMLA+. \item \textbf{Li-unified-R} \cite{li2019unified} extracts targets, sentiment and opinion spans respectively based on a multi-layer LSTM neural architecture. The way Li-unified-R determines the correctness of a triplet is the same as CMLA+. \item \newcite{peng2020knowing} co-extracts targets with sentiment, and opinion spans like \cite{li2019unified}, and uses GCN to capture dependency information to enhance the co-extraction. The way to determine the correctness of a triplet is also the same as CMLA+. \item \textbf{OTE-MTL} \cite{zhang2020multi} is a multi-task learning framework to extract aspect terms and opinion terms jointly and simultaneously parses sentiment dependencies between them. \item \textbf{GTS} \cite{wu-etal-2020-grid} address the ASTE task in an end-to-end fashion with one unified grid tagging task. They designed an gird inference strategy to exploit mutual indication for more accurate extractions. Their models have two variants that use Glove and BERT to initialize the encoder layer. \item \textbf{JET} \cite{xu2020position} converts the ASTE task into several sequence labeling subtasks. In this method, JET$^t$ takes the target words as the labeling object, and the label includes the span of the target, the sentiment polarity, and the offset of the paired opinion. JET$^o$ is similar to JET$^t$ expect the labeling objectives are opinion words. \end{itemize} \input{figure/analysis_results} \subsection{Evaluation Metrics} We use precision, recall, and micro $F_1$ as the evaluation metrics of triple extraction, which is consistent with the previous works. Only if all the elements of a triplet, i.e., target, opinion, and their corresponding sentiment polarity are correct, it will be regarded as a correct result in evaluation. It is noted that the results of some models are directly taken from~\cite{xu2020position}. And in the original paper of OTE-MTL \cite{zhang2020multi} and GTS \cite{wu-etal-2020-grid}, they use ASTE-DATA-V1 datasets for training and evaluation. So we re-run their models on ASTE-DATA-V2 datasets. All the baselines implemented by us use their default hyper-parameters and report the best results of 5 different random seeds for a fair comparison. \subsection{Implementation Details} We implement our models based on HuggingFace’s \texttt{Transformers} library \cite{wolf-etal-2020-transformers} and use \texttt{bert-base-uncased} \cite{devlin2018bert} as the base encoders. We optimize our models with a learning rate of 5e-5 by Adam, random seed range of $[1, 5]$. The max sequence length is set to 256, and the batch size is 8. We train 3 epochs for target and opinion extraction stage and 10 epochs for the matching stage for all the experiments. We select the final model based on the performance on development set with the hyperparameters above, and report its results on the test set. All experiments are conducted on a Linux server with Intel Xeon E5-2680, 256G of RAM and Nvidia RTX 3090. \subsection{Method Comparison} Table \ref{tab:main_results} reports the experimental results of our model against other baseline methods. Our model achieves state-of-the-art results on \texttt{14Lap}, \texttt{16Rest}, close to \textbf{GTS} in \texttt{14Rest}, and slightly behind \textbf{GTS} in \texttt{15Rest}. And our model achieves the best overall $F_1$ of the four datasets, which prove the effectiveness of the model. First, due to the strong expressive ability of BERT, the performance of the model can be improved. More importantly, our model's performance is much better than other models with BERT like {JET}$_{\scriptscriptstyle \text{+ BERT}}$. Because our model can traverse all possible target-opinion pairs to match, which overcome the shortcomings of tagging-based models that cannot handle one-to-many situations. Then, compared with OTE-MTL, which is also a matching-based method, the performance of our method is significantly better. OTE-MTL only selects the terms' original representation as the basis for matching, which cannot reflect target-opinion pairs' correlation. This may be the actual reason for the performance difference. Finally, GTS combines the representations of target and opinion and generates specific representations for each target-opinion pair like ours. But the word representations used for combining still remain the same for different target-opinion pairs. While our model generates specific word representations for the same word in each possible pair, then combines those specific word representations to generate pair representations to establish correlations within target-opinion pairs, which results in performance improvement.
\section{Introduction} \label{sec:intro} The past few years have witnessed the detection of two interstellar bodies passing through the solar system on hyperbolic orbits. The discoveries of the irregular body ‘Oumuamua \citep{meech2017} and the comet Borisov \citep{jewitt2019} sparked immediate interest in characterization of these objects and facilitated wide-ranging speculation regarding the possibility that our solar system is more broadly contaminated by minor bodies of extra-solar origin (e.g., \citealt{siraj2019,namouni}). Although no current evidence indicates that any specific objects in the solar system are of extrinsic origin \citep{morby2020}, the question of whether or not any such objects reside in interplanetary or trans-Neptunian space is of considerable interest. Motivated by these issues, this paper reconsiders the capture of external bodies by our solar system. The calculation of the capture cross sections is the first step in assessing whether or not the solar system presently contains quasi-permanently trapped interstellar bodies. This treatment also provides constraints on the expected orbits of any such material. The dynamics of the outer solar system represents one of the oldest problems in theoretical astrophysics. Starting more than two centuries ago, classic studies include the long-term stability of the solar system \citep{lagrange1776,laplace1799}, the origin of comets \citep{laplace1806}, and orbital anomalies that led to the discovery of Neptune \citep{leverrier,adams1846}. Over recent decades, the outer solar system has revealed itself to be increasingly complicated, with the discovery of the Kuiper Belt \citep{luujewitt}, dozens of dwarf planets (starting with \citealt{sedna}, or perhaps \citealt{tombaugh}), high-inclination objects \citep{bp519}, and aligned extreme trans-Neptunian objects \citep{sheptruj2016} that led to the hypothesis of a possible ninth planet \citep{batbrown,pninereview}. The more recent discovery of interstellar objects \citep{meech2017,jewitt2019} adds to the intrigue. Both the complex orbital architecture of the solar system and the presence of interloping objects motivates this present study. The goal is to determine cross sections for the capture of foreign bodies by the solar system, and to obtain a deeper understanding of the capture process. The possible capture of interstellar bodies by the solar system also has a long history. The general problem of interacting binaries was considered by \cite{heggie1975}, where the subset of `resonant' encounters lead to capture. Subsequent studies have carried out numerical explorations of the capture process specifically for our solar system, often considering only the Sun-Jupiter system (see, e.g., \citealt{valtonen1982,valtonen1983,siraj2019}). Additional studies consider capture for specific scenarios, including capture by compact objects \citep{pineault}, capture of interstellar objects from the field \citep{lingamloeb,hands2020}, the formation of wide binaries \citep{kouwenhoven}, and the possible capture of Planet Nine \citep{liadams2016,mustill}. Most of these previous studies calculate the capture rate by sampling a given distribution of encounter speeds between the incoming body and the solar system. These studies generally use the field star velocity distribution, with dispersion $\sim40$ km/s \citep{binneytremaine} or that appropriate for the solar birth cluster \citep{zwart2009,adams2010,pfalzner2013,parker2020}, where the velocity dispersion is expected to be $\sim1$ km/s \citep{ladalada}. Notice, however, that the velocity distribution for rocks (or planets) ejected by solar systems will not generally have a simple Maxwellian form.\footnote{As one example, the distribution of speeds for planets ejected from crowded solar systems has the approximate form $dP/dv=4v/(1+v^2)^3$ (e.g., \citealt{moorhead}).} The objective of this paper is to extend the aforementioned previous work concerning the capture of interstellar bodies by the solar system. Whereas most studies determine capture rates and cross sections for a given distribution of velocities, this work finds the cross section $\sigma(v_\infty)$ as a function of relative velocity. The results can then be integrated (after the fact) for any distribution of velocities of interest. This approach is much more computationally expensive than previous treatments, but is made possible with current computational capabilities. Specifically, this paper reports the results from $\sim5\times10^8$ fly-by simulations. In addition, we carry out the simulations for solar systems models including all four giant planets. Although earlier work \citep{heggie1975,pineault} provides analytic estimates for the cross sections, exact forms are not available (primarily due to the lack of an analytic solution to the gravitational three-body problem). We revisit this issue using a different (but equivalent) set of approximations. We then compare the numerical and analytic results for the cross section as a function of velocity, and find good agreement. \section{Dynamics of the Rock Capture Process} \label{sec:capture} This section presents an analytic description of the rock capture process. The capture of an incoming body occurs through the time dependence of the gravitational potential of the solar system. In this treatment, we consider the incoming orbit in two regimes. In the outer regime, at large distances, the rock executes a hyperbolic orbit about the center of mass of the solar system. In the inner regime, at closer distances, the rock can enter into the sphere of influence of individual solar system members (e.g., the Sun or Jupiter), and then be described by a hyperbolic orbit around that body. Under favorable conditions, the deflection by the solar system body during the close encounter can lead to energy loss and capture in the center of mass frame. This effect is essentially the inverse of the gravitational slingshot mechanism by which satellites are boosted through planetary encounters. Note that by dividing the orbit into two regimes, we are implicitly assuming that 3-body effects are not important. For the sake of definiteness, we consider only one planet at a time, and work in the limit where the masses of the rock $\mu$, the planet $m$, and the star $M$ obey the ordering \begin{equation} \mu \ll m \ll M\,. \label{ordering} \end{equation} The incoming orbit of the rock is characterized by its asymptotic speed $v_\infty$ and impact parameter $b$. For given input variables $(v_\infty,b)$, we can define the orbital elements and related physical quantities, including the specific energy and angular momentum, \begin{equation} E = {1\over2} v_\infty^2 \qquad {\rm and} \qquad J = b v_\infty \,, \end{equation} the semi-major axis and eccentricity, \begin{equation} |a| = -a = {GM \over v_\infty^2} \qquad {\rm and} \qquad e^2 = 1 + b^2/a^2 \,, \end{equation} and the perihelion distance \begin{equation} r_p = p = a(1-e) = |a| (e-1) \,. \label{perihelion} \end{equation} Note that, by convention, the semi-major axis $a<0$. To fully characterize the orbit, one must also specify the inclination angle of the incoming trajectory. It is useful to define the effective cross section for hyperbolic orbits to enter the giant planet region of the solar system. In order for the incoming rock to experience the time-dependence of the gravitational potential, the perihelion $r_p$ must be smaller than the semi-major axis $a_p$ of the planet of interest. This condition implies that the impact parameter $b$ is bounded from above by $b^2 \le a_p^2 + 2 a_p |a|$, where $a$ is the semi-major axis of the incoming orbit. The nominal cross section $\sigma_0$ for orbit crossing is thus given by \begin{equation} \sigma_0 = \pi \left[ a_p^2 + 2 a_p |a| \right] \approx 2\pi {GM \over v_\infty^2} a_p \,, \label{sigmazero} \end{equation} where the final equality holds for essentially all incoming speeds of interest ($v_\infty^2<GM/a_p$). The capture cross section will be some fraction of the fiducial cross section (\ref{sigmazero}).\footnote{Note that the interpretation of this fiducial cross section would be more complicated if the planetary orbit had significant eccentricity. Nonetheless, one can always scale the results to the expression of equation (\ref{sigmazero}).} \subsection{Gravitational Slingshot Mechanism for Close Encounters} \label{sec:slingshot} \begin{figure}[h] \centering \includegraphics[width=1\textwidth]{schematic.pdf} \caption{Examples of capture events. In each frame, the dotted black line denotes the rock's initial (unbound) orbit; the solid black line denotes the rock's trajectory after a perturbation; and the arrows specify the direction of the orbit. The yellow circle represents the Sun, the filled red circle represents Jupiter's sphere of influence drawn at the epoch of the rock's closest approach, and the red line marks Jupiter's orbit. The top row shows a capture by Jupiter: the left panel is in the frame of the solar system's barycenter, and the right panel is in Jupiter's rest frame. Note that the rock gets well inside of Jupiter's sphere of influence, but does not actually collide with the planet. The bottom row shows a capture by the Sun: the left panel is in the frame of the solar system's barycenter, and the right panel is in the Sun's rest frame. If the target (Sun or planet) has a component $U$ of its velocity moving away from the incoming rock as it approaches periapsis, then the encounter causes the rock to lose energy in the inertial reference frame, thereby allowing the rock to potentially enter into a bound orbit.} \label{fig:encounter} \end{figure} For the inner regime defined above, we consider close encounters of incoming rocks on initially hyperbolic trajectories with much larger target bodies (either the Sun or one of the giant planets). We can define the coordinate system so that the rock approaches the target body from the $+\xhat$ direction and from the $+\yhat$ direction, where the angle of the incoming trajectory is $\theta$ in the center of mass frame (see the first panel in Figure \ref{fig:encounter}). The rock initially has speed $v_\infty$ in the inertial reference frame and the target body has speed $U$. In the frame of the target, the incoming rock has velocity \begin{equation} {\bf v}_{1tar} = \left( - [v_{x} - U] , v_y \right) \end{equation} and the outgoing velocity has the form \begin{equation} {\bf v}_{2tar} = \left( + [v_{x} - U] , v_y \right) \,. \end{equation} This second equation assumes that the encounter is symmetric, i.e., the outgoing trajectory of the rock is the mirror image of the incoming trajectory. This approximation thus assumes that the larger body does not change its velocity (consistent with the ordering of equation [\ref{ordering}]) and that the encounter time is short compared to the orbital period. In the center of mass reference frame, the incoming velocity has the form \begin{equation} {\bf v}_{1cm} = \left( - v_{x}, v_y \right) = \left( - v \cos\theta, v \sin\theta \right) \,, \end{equation} whereas the outgoing velocity becomes \begin{equation} {\bf v}_{2cm} = \left( + [v_{\rm x} - 2U], v_y \right) = \left( + [v \cos\theta - 2U], v \sin\theta \right) \,. \end{equation} The final speed is then given by the expression \begin{equation} v_2^2 = [v \cos\theta - 2U]^2 + v^2 \sin^2\theta = v^2 - 4Uv \cos\theta + 4U^2 \,. \label{vtwocm} \end{equation} Note that this discussion assumes that the encounter is symmetric in the reference frame of the capturing body. This approximation is expected to be valid because only close encounters with the body result in capture events, and such close encounters will be symmetric to leading order. The discussion thus far has implicitly assumed that the target is moving in the $-\xhat$ direction. In general, however, the target can also have a $\yhat$ component to its velocity. Because of the geometry of the encounter, however, only the $\xhat$ component of the rock velocity changes (in this approximation). We can thus incorporate the more general case by interpreting the velocity $U$ as the component of the target velocity in the $-\xhat$ direction. With this definition of $U$, the final speed still obeys equation (\ref{vtwocm}). \subsection{Solar Close Encounters} \label{sec:starslingshot} When the rock is far away from the Sun, it effectively orbits the center of mass of the system. When the radial distance of the rock becomes sufficiently small, however, its orbit is determined by the location of the Sun. We can delineate the boundary between these two regimes by considering the acceleration (and hence forces) in an accelerating reference frame. As expected, the orbit of Jupiter provides an approximate boundary between the outer problem (hyperbolic orbit about the center of mass of the solar system) and the inner problem (close encounter with the Sun). When the rock enters the sphere of influence of the Sun, its speed is given by \begin{equation} v^2 = v_\infty^2 + {2GM \over r} \,, \label{v2sun} \end{equation} where $r<a_J$ is the location of the rock. It will then execute a (hyperbolic) orbit around the Sun. Due to the motion of the Sun about the center of mass of the solar system, the post-encounter velocity will be given by \begin{equation} v_2^2 = v^2 - 4Uv \cos\theta + 4U^2 \,, \end{equation} where $U$ is the component of the solar velocity in the direction of the perihelion of the orbit and $\theta$ defines the shape of the hyperbola. Capture of the rock requires that $v_2^2<v^2-v_\infty^2$, so that we obtain the constraint \begin{equation} v_\infty^2 < 4Uv \cos\theta - 4U^2 \,. \label{vlimit} \end{equation} Here, the angle $\theta$ is determined by the parameters of the original hyperbolic orbit about the Sun, so that \begin{equation} \cos\theta = {1 \over e} = {|a| \over (a^2 + b^2)^{1/2}} \,, \label{deftheta} \end{equation} where $a$ is the semi-major axis and $b$ is the impact parameter. The capture constraint thus becomes \begin{equation} v_\infty^2 < 4 \alpha {m \over M} \left({GM\over a_J}\right)^{1/2} \left[ v_\infty^2 + {2GM \over r_p} \right]^{1/2} {|a| \over (a^2 + b^2)^{1/2}} + {\cal O} \left( {m^2\over M^2} \right) \,, \end{equation} where we have assumed that the speed $U$ is some fraction of the speed of the Sun in its orbit about the center of mass. Specifically, we define the parameter $\alpha$ such that \begin{equation} U \equiv \alpha {m \over M} \left({GM\over a_J}\right)^{1/2} \,, \end{equation} where $m$ is the mass of Jupiter. Since the speed of the incoming rock $v\gg{U}$ for the close encounters of interest, we ignore the $U^2$ term. Finally, we evaluate the rock velocity at the perihelion position $r_p$ (see equation [\ref{perihelion}]), as this location corresponds to where the close encounter takes place. Working to consistent order, the expression for the capture constraint can be written in the form \begin{equation} v_\infty^2 < 4 \alpha {m \over M} \left({GM\over a_J}\right)^{1/2} \left[ {4GM|a| \over b^2} \right]^{1/2} = 8 \alpha {m \over M} \left({GM\over a_J}\right)^{1/2} {GM \over b v_\infty} \,. \label{vinflimit} \end{equation} The constraint can be written as a limit on the impact parameter, i.e., \begin{equation} b < 8 \alpha {m \over M} \left({GM\over a_J}\right)^{3/2} \, v_\infty^{-3} a_J \approx 93\,\,{\rm au}\,\,\alpha \left({v_\infty\over1\,\,{\rm km/s}}\right)^{-3}\,. \label{bmax} \end{equation} If one requires that the rocky body is not only captured, but is captured into an orbit with semi-major axis less than some maximum value $a_{\rm max}$, then the left-hand-side of equation (\ref{vinflimit}) can be replaced with $v_\infty^2 + v_{\rm x}^2$, where $v_{\rm x}^2\equiv$ $GM/a_{\rm max}$. Finally, note that this treatment implicitly assumes that $U>0$. If the Sun is moving in the opposite direction, the encounter would cause the incoming rocky body to gain energy, and capture does not take place. Given the approximations presented above, the resulting cross section for capture can be written in the from \begin{equation} \sigma = 64 \pi \alpha^2 a_J^2 \left({m \over M}\right)^2 \left({GM\over a_J}\right)^3 {1 \over v_\infty^2 (v_\infty^2 + v_{\rm x}^2)^2} \,. \label{sunsigma} \end{equation} This cross section is specified up to the constant $\alpha$, which is expected to be of order (but less than) unity. This form is consistent with those derived earlier by other means \citep{heggie1975,pineault,valtonen1983}. Notice that this derivation breaks down for sufficiently high incoming speeds, $v_\infty\gta8$ km/s, as shown in Appendix \ref{sec:bound}. \subsection{Planetary Close Encounters} \label{sec:planslingshot} Another channel for capture occurs through close encounters with the giant planets, most often Jupiter, which will be considered in this discussion. Equation (\ref{sigmazero}) represents the cross section for an incoming rock to enter the sphere of radius $a_J$. Only a fraction of the incoming trajectories $f_1 = \rsoi^2/4a_J^2$ will enter the sphere of influence of Jupiter,\footnote{Note that the sphere of influence, as defined here, corresponds to the location where the incoming trajectory switches from a two-body problem with central mass $M$ to a two-body problem with central mass $m$ in the matched conics approximation. The boundary $\rsoi$ is comparable to, but not equivalent to, the Hill radius $R_H=a(m/3M)^{1/3}$.} delineated by $\rsoi\approx{a_J}(m/M)^{2/5}$ \citep{batebook}. However, not all of the orbits that enter the sphere of influence will pass close enough to the planet to experience significant deflection. As a result, we must estimate the smaller fraction $f_2$ of trajectories that allow for capture. As a rough approximation, significant deflection requires $\cos\theta$ to be of order (but still less than) unity, which in turn implies $b_{hp}\sim|a|_{hp}$ (equation [\ref{deftheta}]), where $(a_{hp},b_{hp})$ correspond to the elements of the hyperbolic orbit around the planet. When the rock encounters the planet, its speed in the solar reference frame is given by equation (\ref{v2sun}) evaluated at $r\approx a_J$. The asymptotic speed $(v_\infty)_{hp}$ for the hyperbolic orbit about the planet depends on the planetary motion, but will typically be of the same order. We can thus write \begin{equation} (v_\infty^2)_{hp} = v_\infty^2 + \beta {GM \over a_J} \equiv v_\infty^2 + v_{\rm z}^2 \,, \end{equation} where $\beta$ is a dimensionless factor of order unity and where the second equality defines the velocity scale $v_{\rm z}$. The semi-major axis of the hyperbolic planetary encounter is given by \begin{equation} (|a|)_{hp} = {G m \over (v_\infty^2)_{hp} } = {Gm \over v_\infty^2 + v_{\rm z}^2} \sim {m\over M} a_J \,. \end{equation} Since we require $b_{hp}\lta|a|_{hp}$ and $|a|_{hp}\ll\rsoi$, the fraction $f_2=a_{hp}^2/4 a_J^2$. The resulting cross section for capture due to planetary encounters has the form \begin{equation} \sigma = {\gamma \pi \over 2} {GM \over v_\infty^2} a_J \left( {Gm \over a_J \left( v_\infty^2 + v_{\rm z}^2 \right)} \right)^2 = {\gamma \pi a_J^2 \over 2} \left({m\over M}\right)^2 \left( {GM \over a_J} \right)^3 {1 \over v_\infty^2 \left( v_\infty^2 + v_{\rm z}^2 \right)^2} \,, \label{plansigma} \end{equation} where we have introduced a dimensionless factor $\gamma$ that is expected to be of order unity. Note that this expression has a form similar to that of equation (\ref{sunsigma}), which corresponds to the capture cross section for solar encounters. Keep in mind, however, that the velocity scales are different and are expected to obey the ordering $v_{\rm x}<v_{\rm z}$. \subsection{Energy Distribution of Newly Bound Orbits} \label{sec:energy} Using the results from the previous section, we can write the post-encounter speed of the rock in the form \begin{equation} v_2^2 \approx v^2 - 4Uv \cos\theta\,. \end{equation} The semi-major axis $a_b$ of the bound orbit is defined so that \begin{equation} {GM \over a_b} = 2 {GM\over r} - v_2^2 = 4Uv \cos\theta - v_\infty^2 \,. \end{equation} Let us now define a scale length $b_0$ according to \begin{equation} b_0 \equiv 8 {m \over M} \left({GM\over a_J}\right)^{3/2} {a_J \over v_\infty^3} \alpha\, \sim 100\,\, {\rm au} \left({v_\infty\over1\,{\rm km/s}}\right)^{-3} \,. \end{equation} With this construction, the semi-major axis of the bound orbit is given by \begin{equation} {GM \over a_b v_\infty^2} = {b_0 \over b} - 1 \qquad \Rightarrow \qquad a_b = {a_0 b \over b_0-b} = {a_0 \chi \over 1 - \chi} \,, \label{atochi} \end{equation} where we let $a_0=|a|$ denote the (magnitude of) the semi-major axis of the initial hyperbolic orbit, and where the final equality defines $\chi\equiv{b}/b_0$. The criterion for obtaining a bound orbit (from the previous section) is equivalent to the requirement $b<b_0$ $(\chi<1)$. Since the cross section depends on $b^2$, the distribution of impact parameters will be weighted towards larger values. This finding, in turn, implies that typical bound orbits will have final semi-major axes comparable to the starting (negative, hyperbolic) semi-major axis of the incoming orbit. For $v_\infty=1$ km/s, for example, bound orbits will typically have $a_b\sim1000$ au. In order to obtain tighter orbits comparable to the size of the solar system (or even the Kuiper belt), we need $a_b\lta100$ au, which in turn implies that $b\lta b_0/10\sim10$ au. If we assume that the impact parameters $b$ are uniformly distributed over an area, with a maximum value $b_0$, then the probability distribution for the dimensionless quantity $\chi$ has the simple form $dP = 2 \chi d\chi$. Using equation (\ref{atochi}), we can determine the probability distribution for the semi-major axes of the bound orbits, i.e., \begin{equation} {dP \over da_b} = {2 a_b a_0 \over (a_b + a_0)^3} \,. \label{adistrib} \end{equation} As written, this distribution is normalized over the interval $0<a_b<\infty$. Note that the distribution of equation (\ref{adistrib}) corresponds to the semi-major axes of the bodies when they are captured. The orbital elements of the captured objects will continue to evolve (e.g., through continued close encounters with the planets), so that quasi-stable orbits will display a different distribution (which should be explored further in future work). \section{Numerical Results} \label{sec:simulaitons} The cross sections derived in the previous section made use of a number of approximations. In this section we use a suite of more than 500 million simulations to numerically compute the capture cross section. \subsection{Simulation Details} We sample rocks of mass $10^{-9}$ $M_{\odot}$ isotropically on the sphere at a barycentric distance of $10^{9}$ au. Each rock's velocity unit vector is uniquely defined by its position on the sphere, pointing directly toward the solar system barycenter. We then assign each rock an impact parameter at some random angle in its plane tangent to the sphere. We randomly sample the impact parameter uniformly given the condition that the maximum pericenter distance $q_{\text{max}} \leq 12$ au---comfortably above the largest pericenter distance for capture not attributable to chance close encounters with a giant planet. Finally we scale the rock's velocity unit vector by a factor \begin{equation} v = \sqrt{v_{\infty}^2 + \frac{2\mu}{r}} \label{eq:v_correction} \end{equation} where $\mu = G\sum_i m_i$ and $i \in \{ \text{Sun, Jupiter, Saturn, Uranus, Neptune} \}$. In Equation \ref{eq:v_correction}, $v_{\infty}$ is the rock's field (or cluster) velocity at infinity, and the second term accounts for the kinetic energy that the rock gains by falling from infinity to a barycentric distance $r$. The above procedure gives us a state vector, from which we compute a body's Keplerian orbital elements. To save computation time, we use these elements to propagate each rock along its unperturbed hyperbolic orbit to a barycentric distance of 1,000 au. This approximation (that the solar system is a point mass with all of its mass at the barycenter) should be accurate to about one part in $10^9$, since the solar system's quadrupole term goes like $r^{-3}$. Once we have performed the analytic propagation of the rock, we use NASA's development ephemerides to initialize the solar system at a random date in a 200--year range around the arbitrarily chosen Julian Date $2459010.5$. This ensures that our results are not affected by some exceptional coincidence in the initial phases of the giant planets' orbits. When we have initialized our rock and the solar system, we use \texttt{Rebound's} \texttt{IAS15} integrator \citep{rebound} to evolve the system numerically. For each simulation, we conserve the system's total energy to better than one part in $10^{14}$---much smaller than the fraction of the system's energy attributable to the rock. Therefore we are confident in the accuracy of our integrations. For each integration, there are three possible outcomes: the rock may be captured; undergo a collision with another body; or be ejected from the system. If at any point during the simulation the rock's energy drops below zero, we consider it to be captured and end the simulation. If the rock undergoes a collision or if the rock is unbound and exiting the solar system with a barycentric distance greater than 40 au, we end the simulation and determine that the rock was not captured. We then follow up on our captured objects, integrating for $51\%$ of an orbital period to ensure that each object is truly bound (as opposed to having a transient bound osculating semi-major axis due to the phases of the giant planets). If during our followup the object's apocenter distance exceeds 1 parsec, we consider it to be lost to cluster or galactic tides. Current models of solar system formation predict that the giant planets formed in a more compact arrangement, and then migrated to their current orbits. To account for this we ran a set of simulations with the compact solar system model presented in \citet{tsiganis2005}. The cross section we calculate with this model differs from that calculated using the solar system at the current epoch by less than 1 percent, so our calculations should be equally applicable to the pre-and-post-instability architectures of the solar system. \subsection{Capture Cross Section} Since we sampled events uniformly in impact parameter, we can calculate the capture cross section as \begin{equation} \sigma = \frac{2\pi b_{\text{max}}}{N} \sum_i b_i \delta_i \end{equation} where $b_{\text{max}}$ is the maximum impact parameter sampled, $N$ is the number of events, and $\delta_i$ is a Kronecker delta that is 1 if the event resulted in capture, and 0 otherwise. We display our results in Figure \ref{fig:CrossSection}. As we expect, $\sigma (v_\infty)$ goes like $v_{\infty}^{-2}$ in the low-speed limit, and like $v_{\infty}^{-6}$ in the high-speed limit. To facilitate the use of the cross section in analytic calculations we fit $\sigma(v_\infty)$ with the simple function \begin{equation} \sigma(v_\infty) = \frac{\sigma_0}{u^2 (u^2 + 1)^2} \label{eq:analytic_sigma} \end{equation} where $u \equiv v_{\infty}/v_\sigma$ and $v_\sigma$ is a velocity scale determined by the properties of the planet ejecting the rock. We find the data are best fit by parameter values $\sigma_0 = 232,250$ au$^2$ and $v_\sigma = 0.4179$ km/s. Keep in mind that these cross sections apply for capture into any bound orbit. The scale $\sigma_0$ for the cross section obtained from fitting our numerical results can be compared to the analytic estimates of the previous section. If we evaluate equation (\ref{sunsigma}) in the high speed limit, then agreement between the analytic and numerical estimates implies that $\sigma_0$ = $64\pi\alpha^2a_J^2(m/M)^2(v_\sigma/v_J)^6$, where $v_J$ is the orbital speed of Jupiter. The expressions are equal if the dimensionless parameter $\alpha\approx0.21$. The analytic and numerical results are in agreement for all incoming speeds if we identify the scales $v_x$ and $v_\sigma$, which is equivalent to considering captures with a maximum (post-encounter) semimajor axis $a_{\rm max}\approx5090$ au. Notice also that $v_\sigma\sim{v_x}\sim(Gm/a_J)^{1/2}$ (see also Appendix \ref{sec:dimension}). Similarly, equation (\ref{plansigma}) agrees with the numerical result in the high speed limit if the dimensionless parameter $\gamma\approx5.8$. \begin{figure}[ht] \centering \includegraphics[width=1\textwidth]{cross.pdf} \caption{Capture cross section (in au$^2$) as a function of the asymptotic speed $v_{\infty}$ (in km/s). The black points represent the numerically calculated cross sections, and the corresponding error bars represent one standard deviation. The red curve represents the best fit of equation (\ref{eq:analytic_sigma}) to the data. The blue dashed line shows a power-law of the form $\sigma\sim v_{\infty}^{-6}$, as expected in the limit of high velocity. The green dashed line shows a power-law of the form $\sigma\sim v_{\infty}^{-2}$, as expected in the low velocity limit. The shaded regions indicate the parameter space where captures due the Sun (green) and planets (blue) dominate, although the boundaries are not sharp.} \label{fig:CrossSection} \end{figure} Note that the ensemble of numerical simulations is confined to speeds $v_\infty \le 15$ km/s. This upper limit is invoked for a number of reasons. Due to the steep power-law fall-off of the capture cross section, relatively few capture events take place at higher speeds, so additional computation leads to diminishing returns. In addition to the steep dependence with $v_\infty$, the numerical data indicate that the power-law begins to break at a comparable speed. Some type of break is expected: For $v_\infty$ greater than $\sim10$ km/s, capture by close encounters with the Sun becomes ineffective (see Appendix \ref{sec:bound}). It is noteworthy that the capture cross section at $v_\infty\approx13$ km/s is comparable to the geometrical area of the Sun ($\sim7\times10^{-5}$ au$^2$). For larger encounter speeds, incoming rocky bodies are thus more likely to collide with the Sun than be captured into a bound orbit.\footnote{For completeness, we note that due to gravitational focusing, the collision cross section with the Sun is larger than the capture cross section for speeds $v_\infty>2-3$ km/s.} \section{Analysis of Captured Objects} \label{sec:analysis} In this section we examine the orbital elements of our captured objects to gain insight into the mechanics of the capture process. In Figure \ref{fig:b}, we show the impact parameter (and pericenter distance) distribution of the unperturbed orbits of our captured objects for asymptotic speeds $v_{\infty}$ of 1 and 2 km/s. Each histogram displays a clear relative peak at the pericenter distances corresponding to the orbit of Jupiter, along with a much smaller peak for the orbit of Saturn. Comparison of the two histograms indicates that somewhere between 1 and 2 km/s, the dominant capture process switches from that due to the motion of the solar system barycenter to close encounters with a giant planet (especially Jupiter). \begin{figure}[ht] \centering \includegraphics[width=1\textwidth]{b_dist.pdf} \includegraphics[width=1\textwidth]{b_dist2.pdf} \caption{Histograms of the (unperturbed) impact parameter distribution of captured objects for asymptotic speeds $v_\infty$ of 1 km/s (top) and 2 km/s (bottom). For convenience, we also indicate the pericenter distance of the unperturbed orbit. Both plots show relative peaks at pericenter distances corresponding to the orbits of Jupiter and Saturn. As $v_{\infty}$ increases, close encounters with the giant planets become more important for capture.} \label{fig:b} \end{figure} In Figure \ref{fig:aeq}, we show the post-capture eccentricity as a function of semi-major axis for a subset of the captured objects with $v_{\infty}$ of 1 km/s (top panel) and 2 km/s (bottom panel). The figure also includes equi-pericenter curves corresponding to integer multiples of the spheres of influence of Jupiter and Saturn. The numerical results for captures display a relative overdensity of points with pericenter distances at Jupiter and Saturn, indicating that these captures are (likely) attributable to close encounters. \begin{figure}[ht] \centering \includegraphics[width=1\textwidth]{aeq.pdf} \caption{Post-capture eccentricity versus semi-major axis of captured objects for incoming speeds of 1 km/s (top) and at 2 km/s (bottom). The orange and red regions correspond to integer multiples of the radius of influence centered at the the semimajor axis of the orbits of Jupiter and Saturn, respectively.} \label{fig:aeq} \end{figure} In Figure \ref{fig:ainc}, we show the kernel density representations for the post-capture inclination semi-major axis, and eccentricity for $v_{\infty}$ = 0.5, 1, and 2 km/s. While captures become increasingly rare for higher-velocity events, the resulting semi-major axes of the captured objects are typically smaller than those for objects captured in low-velocity events. This trend is important for assessing object retention, as captured bodies with semi-major axes $a \gtrsim 1000$ au are more likely to be stripped from the solar system by interacting with passing stars (in the solar birth cluster) or the galactic tides (in the field). It is noteworthy that capture events readily produce highly-inclined and even retrograde objects. This finding indicates that capture is yet another potential channel for the production of the observed populations of highly-inclined and retrograde centaurs, which are currently best explained by the putative Planet Nine \citep{pninereview}. However, it is important to note that the orbits of the captured objects will evolve over time. As a result, the captured objects do not represent a long-term stable population. As the orbits of the captured objects evolve, some will become more eccentric until they collide with the Sun; some will undergo scattering events or interactions with the Galactic tides and be ejected from the solar system; some will be frozen into the inner Oort cloud by passing stars; and some will continue to evolve on stable or quasi-stable orbits (either by becoming caught in resonances with the giant planets, or by achieving orbits that otherwise avoid close encounters). Because most capture events resulted in high-eccentricity orbits, we have rather low statistics for small values of eccentricity. Despite the data limitations, though, it is clear that as $v_{\infty}$ increases, the low-eccentricity tail of the distribution becomes fatter. \begin{figure}[ht] \centering \includegraphics[width=1\textwidth]{ainc.pdf} \caption{(Top) Gaussian kernel density estimate of the post-capture inclination distribution (with $i$ measured from the ecliptic plane) of captured objects at speeds $v_\infty$ = 0.5, 1, and 2 km/s. (Center) Gaussian kernel density estimate of the post-capture semi-major axis distribution of captured objects for $v_\infty$ = 0.5, 1, and 2 km/s. (Bottom) Relative fraction (in logarithmic scale) of the post-capture eccentricity distribution of captured objects for $v_\infty$ = 0.5, 1, and 2 km/s. Note that these curves represent probability distribution functions; there will be fewer captures in the high-speed case than in the low-speed case.} \label{fig:ainc} \end{figure} \section{Applications} \label{sec:apply} \subsection{Velocity Averaged Cross Sections} \label{sec:meansigma} This paper determines the velocity dependent cross section $\sigma(v_\infty)$, which can be fit with a function of the form \begin{equation} \sigma(v_\infty) = {\sigma_0 \over u^2 (1 + u^2)^2} \qquad {\rm where} \qquad u \equiv {v_\infty \over v_\sigma} \,. \label{sigofv} \end{equation} The capture rate for rocky bodies by our solar system is given by \begin{equation} \Gamma = n_R \langle \sigma v_\infty \rangle \,, \label{rockrate} \end{equation} where $n_R$ is the number density of rocks that the solar system encounters. The capture rate depends on the velocity-averaged cross section, which is given by the integral \begin{equation} \langle \sigma v_\infty \rangle = \int_0^\infty v_\infty f(v_\infty) \sigma(v_\infty) dv_\infty \,, \end{equation} where $f(v_\infty)$ is the distribution of encounter velocities of the rocky bodies. The distribution of relative speeds $f(v_\infty)$ depends on the environment. In the solar birth cluster, $f(v_\infty)$ is determined by the processes that eject the rocky bodies from their original planetary systems. In general, the clusters are not sufficiently long-lived for the rocks to attain a thermal distribution of speeds. Instead, they are expected to retain the velocity distribution resulting from the ejection process. If ejection occurs through scattering interactions with giant planets, then $f(v_\infty)$ takes the approximate form \begin{equation} f(v_\infty) = {4 v_\infty/v_p \over (1 + v_\infty^2/v_p^2)^3} \,, \label{veldist} \end{equation} where the velocity scale $v_p^2\approx GM_\ast/a_p$, where $a_p$ is the semi-major axis of the planet that scatters the rocks (e.g., see \citealt{moorhead} for a derivation). Note that the distribution (\ref{veldist}) is normalized over the entire interval $0\le{v_\infty}\le\infty$. In practice, the distribution will have a maximum value determined by the escape speed from the planets that scatter the rocky bodies. Notice also that the full distribution will be a convolution of the distribution of ejection speeds from each planet that scatters rocky material. As an approximation, we consider only a single distribution and interpret the velocity scale $v_p$ as a typical value. As a result, $v_p$ is expected to be comparable to the orbit speed of outer planets, i.e., $v_p \sim 10$ km/s. Finally, we are assuming that equation (\ref{veldist}) corresponds to the distribution of {\it relative} speeds between the rocks and the solar system (e.g., see the discussion of \citealt{binneytremaine}). Putting the above considerations together, we can write the velocity averaged cross section in the form \begin{equation} \langle \sigma v_\infty \rangle = \sigma_0 {v_\sigma^3 \over v_p^2} \int_0^\infty {4 du \over (1+\eta^2 u^2)^3 (1+u^2)^2} = \sigma_0 {v_\sigma^3 \over v_p^2} I(\eta) \,, \label{sigvelx} \end{equation} where $u=v_\infty/v_\sigma$ (as before), we have defined $\eta\equiv v_\sigma/v_p$, and where the second equality defines the integral function $I(\eta)$. The dimensionless function $I(\eta)$ can be evaluated to obtain \begin{equation} I(\eta) = \pi {(1 + \eta)(1 + 3\eta) + 3\eta^3/4 \over (1+\eta)^4} \,. \end{equation} Note that $I\to\pi$ in the limit $\eta\to0$, and in practice $\eta\sim1/10$. As a result, a good approximation for the capture cross section takes the form \begin{equation} \langle \sigma v_\infty \rangle \approx \pi \sigma_0 {v_\sigma^3 \over v_p^2} \,. \end{equation} For comparison, we can determine the velocity averaged cross section for the scenario where the cluster rocks are virialized and have the same (Maxwellian) velocity distribution as the stars.\footnote{In general, we expect the stars to reach virial equilibrium much faster than the rocky ejecta. The stars start their cluster trajectories with sub-virial speeds, but then fall toward the cluster core where interactions take place, and equilibrium is rapidly realized (in a few Myr, e.g., \citealt{proszkow}). In contrast, the rocks are ejected with speeds much larger than the virial speed and have little chance for interactions to slow them down. Moreover, the stellar virialization starts as soon as stars form, whereas the planet formation and the subsequent ejection of rocks occurs many Myr later.} In this limit, $\langle\sigma{v_\infty}\rangle$ can be written in the form \begin{equation} \langle \sigma v_\infty \rangle = \sigma_0 {v_\sigma^2 \over s} \sqrt{2\over\pi} \int_0^\infty {v_\infty dv_\infty \over s^2} {\exp[-v_\infty^2/2s^2] \over (1 + v_\infty^2/v_\sigma^2)^2} \,, \end{equation} where $s$ is the velocity dispersion of the distribution. Note that the value of $s$ for the distribution of relative speeds is larger than the value $s_0$ for the velocity distribution of the stars in the clusters ($s=\sqrt{2}s_0$). Here we define the variable $w\equiv v_\infty/s$ and the parameter $\xi=s/v_\sigma$, so that \begin{equation} \langle \sigma v_\infty \rangle = \sigma_0 {v_\sigma^2 \over s} \sqrt{2\over\pi} \int_0^\infty wdw {\exp[-w^2/2] \over (1 + \xi^2 w^2)^2} \equiv \sigma_0 {v_\sigma^2 \over s} \sqrt{2\over\pi} J(\xi) \,, \label{sigvelg} \end{equation} where the second equality defines the integral function $J(\xi)$. The exact form for $J(\xi)$ can be found. If we define $\mu=1/(2\xi^2)=v_\sigma^2/(2s^2)$, then \begin{equation} J (\xi) = J(\mu) = \mu \left[ 1 - \mu\,{\rm e}^\mu\,E_1(\mu) \right]\,, \label{jexact} \end{equation} where $E_1(x)$ is the exponential integral \citep{abrasteg}. In the limit $\xi\to0$ ($\mu\to\infty$), the function $J=1$; in the opposite limit $\xi\gg1$ ($\mu\to0$), $J=\mu=1/(2\xi^2)$. A good working approximation for the cross section of equation (\ref{sigvelg}) thus has the form \begin{equation} \langle \sigma v_\infty \rangle \approx \sigma_0 {v_\sigma^4 \over s} {\sqrt{2/\pi} \over v_\sigma^2 + 2 s^2} \,, \end{equation} which is exact in the limits and has a relative error less than $\sim20\%$ over the entire range $0\le\xi\le\infty$. One can use equations (\ref{sigvelg}) and (\ref{jexact}) if higher accuracy is required. \subsection{Rock Capture in the Birth Cluster} \label{sec:rockmass} Using the results derived above, we can estimate the total mass in rocky bodies that were captured while the Sun remained in its birth cluster. The capture rate is given by equation (\ref{rockrate}), with velocity-averaged cross section specified through equations (\ref{sigvelg}) and (\ref{jexact}). The rocky bodies will have a distribution of sizes $g(R)$, which is defined here such that \begin{equation} n_R = \int_0^\infty g(R) dR \qquad {\rm and} \qquad \rho_R = \int_0^\infty g(R) m(R) dR \,, \end{equation} where $m(R)$ is the mass of the rock as a function of its size. With these definitions, the capture rate $\Gamma$ can be converted into a mass accretion rate given by \begin{equation} {\dot M} = \rho_R \langle \sigma v_\infty \rangle \,, \end{equation} where $\rho_R$ is the mass density of the cluster in the form of rocks. Given that each planetary system in the cluster is expected to eject a few Earth masses of rocky material (e.g., \citealt{RiceLaughlin2019}), the density $\rho_R$ is given by \begin{equation} \rho_R = {\alpha M_\oplus N_\ast \over V} = \alpha M_\oplus n_\ast \,, \end{equation} where $\alpha$ is a dimensionless factor of order unity and $n_\ast$ is the number density of stars. For completeness, note that the inclusion of icy planetesimals will increase this density estimate. In any case, the total mass in rocky bodies captured by the solar system during its cluster phase can be written in the form \begin{equation} (\Delta M)_R = \alpha M_\oplus \left[ \int_0^\infty n_\ast dt \right] \langle \sigma v_\infty \rangle \equiv \alpha M_\oplus \langle n_\ast \rangle \tau \langle \sigma v_\infty \rangle \,. \label{mtotal} \end{equation} The final equality defines the mean density of the cluster, where $\tau$ is its effective lifetime. A number of studies have found upper bounds on the product $\langle{n_\ast}\rangle\tau$ by requiring that the solar system is not overly disrupted, including considerations of the planetary orbits \citep{al2001,adams2010,gdawg2015}, the Kuiper Belt \citep{newdawg}, and the orientation of the plane of the cold classicals \citep{yuri}. This work indicates that the product is bounded by $\langle{n_\ast}\rangle\tau\lta$ $2\times10^4$ pc$^{-3}$ Myr. If we take $v_\sigma$ = 0.5 km/s, $v_p$ = 10 km/s, and $\sigma_0$ = $2\times10^5$ au$^2$, then the velocity averaged capture cross section becomes $\langle\sigma{v_\infty}\rangle$ $\approx$ 800 au$^2$ km/s. With this cross section, the total mass in captured rocky material from equation (\ref{mtotal}) is about $(\Delta M)_R\sim10^{-3}M_\oplus$. Of course, most of this material will be ejected back into the cluster or the field. The retention rate of material in the inner Oort cloud is $\sim 1\%$ \citep{Brasser2006}, so we would expect $\sim10^{-5}M_\oplus$ to be captured in the inner Oort cloud. Note that if rocks ejected from planetary systems in clusters follow the velocity distribution of equation (\ref{veldist}), then some fraction of the material will leave the cluster during its first crossing. The high speed tail of the velocity distribution will thus be de-populated. In practice, however, most of the capture events arise from the low-speed portion of the distribution, so that the correction for the loss of high speed material is modest. We can also estimate the mass of rocks captured while the solar system is in the field. In this case, we expect the rocky material to encounter the solar system with a velocity distribution comparable to that of the field stars, i.e., a Gaussian distribution with $s\sim40$ km/s. In this case, the velocity averaged cross section $\langle\sigma{v_\infty}\rangle\approx0.08$ au$^2$ km/s. If we also assume that each planetary system ejected the same mass in rocks during its formative phases, then the density of rocky material will be proportional to the stellar density (we are thus assuming negligible losses). As a result, the product $\langle{n_\ast}\rangle\tau\sim460$ pc$^{-3}$ Myr, and the expected mass in captured rocks is about $(\Delta M)_R\approx$ $2\times10^{-9}M_\oplus$. Using the approximate retention rate of $1\%$, we would expect only $\sim 2\times10^{-11}M_\oplus$ of these rocks to remain in the inner Oort cloud. This inventory of captured alien material from the field is exceedingly small, roughly the equivalent of one 5 km body. Rock capture during the birth cluster phase is thus expected to produce the dominant contribution (by roughly a factor of one million). These latter objects are expected to have radiogenic ages comparable to ordinary solar system bodies, but might be identified by different (unusual) chemical composition. Note that the values presented here are highly approximate. Not all of the rocks will be captured in the inner Oort cloud, so that the retention fraction could be smaller than assumed here (most of the captured interstellar bodies initially have Jupiter-crossing orbits, whereas the planetesimals in the Oort cloud could have different origins). In any case, most of the captured objects will be ejected, and some will eventually collide with the Sun. Although these calculations provide working order-of-magnitude estimates, in forthcoming work we will refine these projections by numerically investigating the long-term behavior of the captured bodies from this work. \section{Conclusions} \label{sec:conclude} This paper has revisited the problem of capturing interstellar objects on initially hyperbolic trajectories into bound states. Using an ensemble of 500 million numerical fly-by simulations, the main result of this study is the determination of our solar system's capture cross section as a function of encounter speed (see Figure \ref{fig:CrossSection}). The resulting capture cross section shows the power-law velocity dependence $\sigma \sim v_\infty^{-2}$ in the limit of low speeds and the dependence $\sigma \sim v_\infty^{-6}$ in the limit of high speeds. The capture cross section $\sigma(v_\infty)$ over the entire range of asymptotic speeds can be fit with the function given in equation (\ref{sigofv}). This paper also presents an analytic treatment of the capture problem using the approximation of matched conics and the (inverse) gravitational slingshot effect (Section \ref{sec:capture}). These arguments show that capture by both close encounters with the Sun (Section \ref{sec:starslingshot}), and by close encounters with a giant planet (Section \ref{sec:planslingshot}), have the same nearly velocity dependence as that seen in the numerical simulations (namely $\sigma\sim v_\infty^{-2}$ at low speeds and $\sigma\sim v_\infty^{-6}$ at high speeds). The capture events can be classified as either close encounters with the Sun or close encounters with giant planets. At low speeds, encounters with the Sun dominate the capture cross section. At higher speeds, close encounters with Jupiter dominate. Close encounters with the other giant planets contribute to the cross section, but do not dominate the dynamics. More specifically, for the particular case of $v_\infty$ = 1 km/s, capture events due to close encounters with Jupiter are $\sim100$ times more likely than captures due to Saturn. The frequency of close encounters with Uranus and Neptune are smaller (than for Saturn) by an additional factor of $\sim100$. With the capture cross section as a function of velocity specified, the effective mean cross section $\langle v \sigma \rangle$/$\langle{v}\rangle$ can be determined for any distribution of encounter speeds. For the case of a Maxwellian distribution and a power-law distribution motivated by rock ejection, the mean cross section can be evaluated analytically (see Section \ref{sec:meansigma}). Finally, as an application of the capture cross section, we estimate the total mass $(\Delta M)_R$ in the Oort cloud that originates from other planetary solar systems (Section \ref{sec:rockmass}). The mass accreted while the Sun lived within its birth cluster is of order $(\Delta M)_R\sim10^{-5}M_\oplus$, about a million time larger than the mass subsequently accreted from the field. Although the capture cross section for the solar system is now well-characterized, many avenues for future research remain. The simulations of this paper consider the capture of interstellar objects and the resulting cross sections include all capture events, independent of their residence time in the solar system as bound objects. Future work should determine how long captured bodies can remain bound to the Sun, since many such objects are expected to be ejected from the system or to collide with other solar system members. The residence time (ejection time) should thus be determined for each type of orbit displayed by the captured objects. With these results in place, one can make a refined estimate of the current population of alien objects in the solar system, along with their expected orbital properties. \acknowledgements We would like to thank David Gerdes, Hsing-Wen Lin, and Larissa Markwardt for helpful discussions during the preparation of this manuscript. This material is based upon work supported by the National Aeronautics and Space Administration under Grant No. NNX17AF21G issued through the SSO Planetary Astronomy Program and by the National Science Foundation under Grant No. AST-2009096.
\section{Introduction} Alignment of mental models among the members of a team is critical to achieving effective teamwork. In absence of shared understanding \cite{converse1993shared} about the goals, plans and context of the team, teamwork often results in preventable errors \cite{baker2005medical, kolander2019flight}. For instance, lack of shared mental models between members of a flight crew can result in aviation accidents \cite{kolander2019flight}. Similarly, misalignment between members of a surgical team can lead to preventable harm and adverse events \cite{wahr2013patient}. Teams can adopt best practices (such as team training and debriefing) to improve their mental model sharing \cite{van2011team, salas2013developing, neily2010association}. Nevertheless, the possibility of preventable error persists due to the impact of execution-time factors, such as high workload, surgical flow disruptions or fatigue \cite{zenati2019first}. Informed by the challenges of teamwork in the cardiac operating room (Fig.~\ref{fig:teamwork-or}), our goal is to mitigate preventable errors of human teams performing goal-oriented and time-critical tasks. Team assessments, through questionnaires and metrics of evaluating team fluency, provide one avenue for teams to improve shared understanding and teamwork \cite{britton2017assessing, macalpine2017evaluating, dias2021dissecting}. However, due to their inherent post-hoc nature, it is difficult to utilize these assessments during time-critical tasks and alleviate preventable errors arising due to execution-time factors. Moreover, while collaborating, it is not easy for team members to self-assess their teamwork, due to distributed cognition and the partially observable nature of collaboration. \begin{figure} \centerline{% \includegraphics[width=0.65\columnwidth]{img/teamwork-or.png} } \caption{Teamwork in the cardiac operating room: Surgery being performed by a team of surgeons, anesthesiologists, perfusionists, and nurses.} \label{fig:teamwork-or} \end{figure} We posit that augmenting post-hoc assessments with on-the-fly interventions can help mitigate preventable errors caused due to execution-time factors. We envision a digital team member (\emph{AI Coach}) that can assess and improve teamwork by monitoring the team members during their collaborative task execution and providing timely interventions. Due to the advances in surgical data science, sensing hardware and software \cite{maier2020surgical, kennedy2020sensors, kennedy2020computer, kim2018intelligent}, the opportunity is ripe to develop such an execution-time tool. However, several challenging problems need to be resolved to realize its vision. For instance, based on the sensed information, the AI Coach would need to infer whether the mental models (a latent quantity) are aligned. Similarly, it would need to identify when to provide interventions to improve teamwork. In this work, we describe our research towards realizing one such capability: namely, execution-time inference of the alignment of team member’s mental models. We focus on teams with fixed membership and performing sequential collaborative tasks in stochastic environments. Specifically, we consider collaborative tasks that can be represented as a partially observable variant of Markov decision processes (MDPs), where the latent variables represent the team’s preference (or, equivalently, mental model) regarding collaborative task execution \cite{oliehoek2016concise}. In the ideal case each team member should maintain the same preference; however, in practice, team members may have different estimates of the “shared” preference (i.e., misalignment of mental models) due to ineffective team communications, lack of expertise, or a variety of execution-time factors. To infer and \emph{predict} misalignment of mental models, we provide a Bayesian approach that leverages prior knowledge about the collaborative task and data of the team members’ task execution (namely, actions and observable states of the task). As an exemplary application, we demonstrate our approach using two simulated collaboration scenarios, inspired by teamwork during cardiac surgery procedures (e.g., CABG, SAVR, etc): namely (a) protamine administration to reverse heparin and (b) surgical tool handovers. In the experiments conducted on simulated tasks, our approach could infer model misalignment with over 75\% recall. Encouraged by these results, in our ongoing work, we are extending our approach to enable its use in a simulated operating room (OR). The paper concludes with a brief discussion of this ongoing and future work, with emphasis on the computational challenges. \section{Representing Collaborative Tasks} \label{sec:task-model} A mathematical representation of teamwork is necessary to enable automated reasoning of team behavior. Motivated by the variety of teaming contexts, research on human teaming, multi-agent systems and human-robot collaboration has led to several formalism to represent teamwork \cite{grosz1999evolution, schurr2004steam, amir2016mip}. Here, we utilize a multi-agent and partially observable variant of MDPs, to represent goal-oriented collaborative tasks of interest. MDPs provide a framework to represent sequential decision-making tasks \cite{oliehoek2016concise}. They are specified by a set of states $s \in \mathcal{S}$, which represent the task context; a set of actions $a \in \mathcal{A}$, which represent the actions that can be taken while performing the task; a transition model $T: \mathcal{S} \times \mathcal{A} \times \mathcal{S} \rightarrow [0,1]$, which specifies the distribution over the next task state given current state and action; and a reward function $R: \mathcal{S} \rightarrow \Re$, which specifies the reward of reaching a state and can encode task goals. As MDPs can encode stochastic outcomes and goals, they provide a useful framework to represent real-world sequential tasks. MDPs, however, represent tasks with one decision-maker. To represent teams, we consider its multi-agent variants, where the action represents joint action of a team. Specifically, for a team with $n$ members, the joint action is represented as $a = [a_1, a_2, \cdots, a_n]$, thereby enabling modeling of multiple decision-makers. The task progress (through the transition model), now, depends on the joint action (i.e., action of each team member). The behavior of a team, for a fully observable multi-agent MDP, can be specified using $n$ policies, where $\pi_i(a_i | s)$ denotes the policy of the $i$-th team member. In real-world tasks, the state may not be fully observable. Especially for humans, their preferences or (partial) understanding of the task may influence their behavior. Similarly, for human teams, situation awareness may influence each team member’s policy. Thus, we augment the task state, with a latent feature $x \in X$, which denotes the team member’s latent preferences regarding the task. In general, the latent feature may evolve during the task; however, here, we limit our scope to time-invariant latent states. Thus, the collaborative task can be described using the tuple $(\mathcal{S}, \mathcal{X}, \mathcal{A}, T, R)$. Next, we instantiate this task model for two scenarios inspired by teamwork in the OR. \subsection{Protamine Administration} \label{sec:protamine_description} Cardiac surgery is performed by a team of surgeons, anesthesiologists, perfusionists, and nurses (as shown in Figs.~\ref{fig:teamwork-or}-\ref{fig.tooldeliveryenv}); in academic medical centers, a subset of the team can be trainees (e.g. residents, fellows, students) with limited task experience. After successful weaning of the patient from the cardioplumonary bypass machine, alongside removal of the venous and arterial cannulas, protamine needs to be administered to reverse the anticoagulant effect of heparin and restore normal blood coagulation. The resident anesthesiologist (RA) administers protamine after receiving a verbal request from the attending surgeon (AS), after which the surgeon begins removing the cannulas. One caveat is that a patient may be allergic to protamine leading to a life-threatening “protamine reaction” syndrome; hence, protamine needs to be administered intravenously incrementally over 5-10 minutes and not as a single intravenous bolus. Administration of protamine as a bolus (i.e., all at once) can lead to a protamine reaction with refractory vasoplegia unless action is not taken quickly and efficiently by the team; however, due to limited prior experience, an RA can have an incorrect mental model of the team's strategy (incremental vs. bolus administration). In a prior documented case in the literature, protamine administration was conducted by the RA improperly as a bolus, despite the oversight of the attending anesthesiologist \cite{zenati2019first}. Meanwhile, physical barriers including the sterile drape separating the RA from the AS preclude explicit awareness of such an error by the team unless verbally communicated. Thus, misalignment of mental models may occur if the team is not proceeding through the surgical steps as expected. If an AI Coach can infer this lack of shared mental models (between the AS and RA), it can help prevent associated adverse outcomes. Thus, as our first task, we represent the collaboration between the AS and RA during protamine administration using the task model. The goal of the team (encoded as $R$) is to safely administer protamine and successfully remove cannulas while avoiding any adverse outcomes. The observable component of the task state $s \in \mathcal{S}$ is defined by the following features: protamine administration phase ($s_1$, a Boolean variable denoting whether the surgical workflow is in the protamine administration phase), status of protamine dosage ($s_2$, indicating the percentage amount of protamine administered), number of cannulas removed ($s_3$), and patient state ($s_4$, indicating the patient state, as measured by the vitals and categorized as nominal, allergic, and adverse). In addition to the observable features, which can be measured using sensors and instrumentation in the operating room \cite{kennedy2020computer, kennedy2020sensors}, the team behavior depends on the proper understanding of the task. In particular, the team may have one of two mental states regarding protamine administration: bolus or incremental (especially because heparin is always given as a bolus). These mental states correspond to the latent state $x \in \mathcal{X}$ in the task model, as they cannot be measured by a physiological sensor. The surgeon is modeled to have the following actions $a_1 \in \mathcal{A}_1$: request protamine, remove cannula, and No-op. Similarly, the anesthesiologist can take the following actions $a_2 \in \mathcal{A}_2$: administer incremental dosage, administer bolus, communicate, and No-op. The transition model $T$ represents the effect of team members' actions on the task state. The task begins prior to the protamine administration phase $(s_1 = 0)$, and transitions to the protamine administration phase $(s_1 = 1)$ after the surgeon's `request' action. The `remove cannula' action updates the status of cannula removal $(s_3)$ deterministically. Similarly, the protamine administration actions update the status of protamine administration $(s_2)$; specifically, `bolus' changes $s_2 = 100\%$, where `incremental dosage' increments $s_2$ first by a test dosage and, subsequently, by $25\%$. The incremental dosage leads to an allergic reaction with $0.01$ probability. Similarly, bolus administration of protamine leads to an adverse reaction with $0.8$ probability. The No-op and `communicate' actions do not change the task state; however, we posit that a more engaged resident (with the correct task understanding) is likely to communicate more often. The scenario terminates after the goal is achieved or when the patient exhibits adverse or allergic reaction, after which the surgical team adopts specific protocols to restore the patient's stability. \subsection{Surgical Tool Delivery} \label{sec:tooldelivery_description} As the second task, we model the handovers (between scrub and circulating nurses) encountered in surgery. To model this task, we consider a grid-world representation of the operating area (Fig.~\ref{fig.tooldeliveryenv}) and focus on the sub-team of surgeon, scrub nurse (SN), and circulating nurse (CN). During the preoperational stage, required surgical tools are prepared and placed in the sterile area next to the operating table. However, every so often, an additional tool (or item, such as sutures) may be required to be delivered from outside the sterile area. In such situations, SN may ask the CN to deliver the requisite tool. Incorrect tool delivery, due to lack of shared mental models arising from ineffective communication of the surgeon’s preferences, can delay the surgery and lead to preventable harm in time-critical situations. In such situations, an AI Coach can help detect model misalignment and mitigate delivery of incorrect tools. In our simulated environment, the CN can move in a 5-by-5 grid world (Fig.~\ref{fig.tooldeliveryenv}), while the surgeon and SN are limited to the sterile area. The task begins with the SN having sterile sutures and scalpels. Additional sutures are located in the cabinet in the operating room, while scalpels in the storage area (in an adjacent room). During the task, SN may require additional sutures or replacement scalpel (i.e, $\mathcal{X} = \{\textit{Sutures}, \textit{Scalpel}\}$), and communicate this requirement to CN. If the CN misunderstands the SN's request, the team members will have misaligned mental models $\mathcal{X}$. \begin{figure} \centerline{% \includegraphics[width=0.9\columnwidth]{img/tooldelivery-world.png} } \caption{The tool delivery environment. Circulating nurse (CN) cannot enter the sterilized area (circled with green line), while the scrub nurse (SN) cannot retrieve unsterilized items. Hence, during the course of the surgery, SN may solicit CN's help to acquire items from the cabinet or storage area.} \label{fig.tooldeliveryenv} \vspace{-1em} \end{figure} The requirement of additional items depends on observable features of the surgery. For instance, if the scalpel falls off of the sterile field and become contaminated, the SN is more likely to request replacement scalpel. Similarly, if the next step in surgery involves suturing, the SN is more likely to request sutures. Thus, in addition to the latent feature $x$, we model the task using the following observable features $s \in \mathcal{S}$: tool positions, patient status, request status, and position of the circulating nurse. The goal of the collaboration scenario (encoded as $R$) is for the team to have access to the correct tool. Transition model encodes the effect of team member's action on the task state. For instance, tool position changes if they are picked and delivered by the CN. \section{Online Inference of Model Alignment} \label{sec:bayesian_approach} As demonstrated above, the task model can be used to represent a variety of collaborative tasks. In these tasks, both observable and latent features influence the team. While observable features $s$ are shared among the team, the value of latent feature $x$ can differ across teammates. For instance, during tool delivery, the circulating nurse might retrieve the incorrect tool, due to an incorrect assumption about the requested tool (i.e., the latent feature of the task). Such misalignment can lead to lack of shared situation awareness, poor collaboration, and preventable harm. Hence, towards the goal of developing an AI Coach that can mitigate preventable harm, in this section, we provide an algorithm to infer model alignment (or lack thereof) through observation of team's task execution. \subsection{Problem Statement} To arrive at the algorithm, we first provide a mathematical description of the problem statement. For a given task specification, we assume that each team member as well as the AI Coach can observe (through sensors) the task's observable features and, thus, maintains a shared understanding of the state component $s$. However, each team member can potentially maintain a different understanding regarding the latent feature $x$, where the estimate of $i$-th team member is denoted as $\hat{x}_i$. Further, the policy of the $i$-th team member depends on both latent and observable features, and is denoted as $\pi_i(a_i | s, \hat{x}_i)$. In a team with shared understanding, all team members will maintain the same estimate of the latent feature (i.e., $\hat{x}_1 = \hat{x}_2 = \cdots = \hat{x}_n$). However, if the estimates differ, the team members will have misaligned mental models. The AI Coach seeks to infer this model misalignment given the task model $(\mathcal{S}, \mathcal{X}, \mathcal{A}, T, R)$, team members' policies $(\pi_1, \pi_2, \cdots, \pi_n)$, and data of team's task execution (i.e., $s,a$-sequences). The task execution sequences are represented as $\tau = (s^0, a^0, s^1, a^1, ... s^k, a^k)$, where the subscript denote the sequence indices, $s^0$ denotes the initial task state, and $k$ denotes the sequence length. Note that only observable state features can be sensed, thus the task execution data excludes latent feature of the task state $(x)$. \subsection{Inference Algorithm} We adopt a Bayesian approach to infer model misalignment. To estimate the quantity of interest $(x)$, in addition to data, Bayesian algorithms require specification of prior probability $p(x)$ and likelihood model $p(\text{data} | x)$. Here, we utilize the task and policy specifications to arrive at the likelihood model, while noting that, in general, its specification is non-trivial. In our ongoing work, we are actively developing approaches to learn these models from training data, for the case where team members' policies are difficult to specify. In our case, the Bayesian algorithm seeks to infer the latent state $\hat{x}^i$ for each member of the team. Let us denote this joint estimate as $\hat{\mathbf{x}} = (\hat{x}_1, \hat{x}_2, ... \hat{x}_n)$. Given the data, the posterior probability is computed as follows, \begin{align} p( \hat{\mathbf{x}} | \tau) &\propto p(\tau | \hat{\mathbf{x}}) p(\hat{\mathbf{x}}) \nonumber = p(s^0, \mathbf{a}^0, s^1, \cdots, s^{t}| \hat{\mathbf{x}}) p(\hat{\mathbf{x}}) \nonumber \\ &= p(\hat{\mathbf{x}}) p(s^0) \prod_{j=0}^{k-1} T(s^{j+1} | \mathbf{a}^{j}, s^{j}) P(\mathbf{a}^{j} | s^{j}, \hat{\mathbf{x}}) \nonumber \\ &\propto \prod_{i=1}^{n} \left( p(\hat{x}_i) \prod_{j=0}^{k-1} \pi_i (a^{j}_{i} | s^{j}, \hat{x}_i) \right) \label{eq:x-posterior-probability}, \end{align} where, we assume that the prior probabilities and policies corresponding to each team member are independent, i.e., \begin{align} p(\hat{\mathbf{x}}) &= p(\hat{x}_1) p(\hat{x}_2) \cdots p(\hat{x}_n) \\ P(\mathbf{a} | s, \hat{\mathbf{x}}) &= \pi_1 (a_{1} | s, \hat{x}_1) \pi_2 (a_{2} | s, \hat{x}_2) \cdots \pi_n (a_{n} | s, \hat{x}_n). \end{align} Given \ref{eq:x-posterior-probability}, the latent state is inferred as the maximum posteriori estimate. In the inferred latent state of each agent are not identical, then the algorithm reports a model misalignment. \section{Experiments} \label{sec:experiments} To evaluate the inference approach, we utilize the collaboration scenarios described in Sec.~\ref{sec:task-model}. For each scenario, we implement the Markovian task model (detailed in Sec.~\ref{sec:protamine_description}-\ref{sec:tooldelivery_description}), specify ground truth policies of the team members, and generate synthetic data of task execution using the task and policy specifications. Execution sequences are created by first assigning latent states $\hat{x}_i$ to the team member and, then iteratively, (a) sampling team members' action $a$ using their policy, latent state $\hat{x}_i$, and task state $s$, and (b) sampling the next state $s'$ in the sequence using the transition model $T(s' | s, a)$, until the task termination criteria is reached. \subsection{Protamine Administration} We generate $300$ task sequences for the simulated protamine administration task, where model misalignment could occur due to incorrect task understanding. In our simulations, the AS always expects incremental protamine administration, while the RA may (incorrectly) administer it as a bolus with probability $0.5$. We describe the team member's policies next. The scenario begins prior to protamine administration phase, during which the RA may communicate (e.g., ask for supervision, provide updates) with AS. We model that an RA which communicates more often is less likely to have an incorrect understanding of the task (i.e., misaligned mental model). During the task, the AS initiates the protamine administration phase through a verbal communication, after which protamine is administered bolus or incrementally by the RA based on their task understanding $\hat{x}$. Cannula removal is interleaved with the protamine administration. The AI Coach can sense the observable state $s$, team's actions $a$, and seeks to infer $\hat{\mathbf{x}}$. Among the $300$ task sequences generated, in $155$ the team exhibits model misalignment. We evaluate the inference performance with both full and partial task sequences. \textbf{Post-hoc performance} As the AI coach can monitor the amount of protamine administered, with full task sequences, it can always infer model misalignment accurately. While post-hoc inference of misalignment does not prevent the anesthesiologist from performing the erroneous action (bolus), it can help identify near-miss events (i.e., where the incorrect action did not lead to an adverse outcome; $31$ out of $300$ in our synthetic data) and help the team achieve a shared mental model for subsequent surgeries. \textbf{Execution-time performance} Since the algorithm does not impose any condition on the length of sequence, it can also provide an estimate during the task (i.e., given partial task execution). For the current task, we evaluate this capability for when the surgeon requests protamine (i.e., before a potential error). Even with a partial task sequence, the algorithm results in overall estimation accuracy of 66.3\%. In life-critical tasks, where the goal of AI Coach is to mitigate adverse outcomes, false alarms are less critical. Among the $155$ sequences with misaligned mental models, the algorithm could predict model misalignment in $119$ cases, i.e., exhibiting 76.8\% recall. \subsection{Surgical Tool Delivery} For the tool delivery task, we generate $300$ synthetic task sequences and $271$ samples among them include the situation where a tool was requested. The task sequences include the positions of the tools and CN, patient status (i.e., whether an incision has been made or not), item request status (i.e., whether SN has requested an item from CN), and actions of the team members. While the AI Coach can sense when an item request is made, to reflecting sensing capabilities in the OR, it cannot detect which item was requested in our simulations. Thus, the inference algorithm needs to infer the latent states (i.e., tool being requested, $\hat{x}$) for both SN and CN, to estimate model alignment. Similar to the protamine case, we evaluate both the post-hoc and execution-time performance. On average, the full sequences are $\approx 30$ steps; while the partial sequences include $7$ steps (2 steps before the request and 5 steps after the request). The inference algorithm results in 75.9\% and 98.5\% recall with partial and full sequences, respectively. \section{Discussions} In this paper, we propose the problem of inferring mental model alignment in collaborative tasks and provide an execution-time approach to infer model alignment using observable features of team behavior. Through computer simulations of surgery-inspired collaborative scenarios, we provide proof-of-concept results that demonstrate that the inference of model alignment is computationally feasible and can help mitigate preventable harm. For instance, in the protamine administration scenario, the proposed approach could predict model misalignment (and associated errors) 76.8\% given task model, policy specifications, and partial task sequences. Further, even in the challenging tool delivery task where multiple strategies may be valid (e.g., request of either tool is valid in the tool delivery domain), the inference algorithm could infer model misalignment with 75.9\% recall with partial task sequences (i.e., before the tool is delivered). In addition to mitigating preventable harm, thus, this execution-time inference of can also help improve team's task performance. For instance, an AI Coach that provides interventions based on inferred model misalignment, can help in the early detection of incorrect tool delivery; note that, without an AI Coach, the team would realize their error only after it is made. Encouraged by these results, we are working towards the vision of realizing an AI Coach for human teams by relaxing the requirement of model specification and addressing associated sensing challenges. For instance, the proposed approach assumes accurate specification of team members' policies and complete observablity of their actions, both of which might be difficult to meet in practice. Hence, we are exploring learning-based approaches to arrive at team policies in presence of latent states \cite{osa2018algorithmic, unhelkar2019learning}. To address the challenges associated with state and action observability, the development of an AI Coach would be greatly enhanced by nuanced surgical tool detection and people tracking methodology. The possibilities of incorporating these approaches into the OR are steadily increasing as surgical data science takes hold in surgical environments \cite{kennedy2020computer}. Additionally, robust and sensitive psychophysiological sensors equipped to team members may provide insight into impending mental model misalignments and function to provide automated feedback on team members' cognitive states. \bibliographystyle{IEEEtran}
\section{Introduction} \label{Introsec} As a rule of thumb, interacting many-body systems in more than one dimension are difficult to analyze, and controllable routes to the inclusion of interactions are rare. One such approach is to consider a non-interacting ``majority" system, couple it to a small number of quantum impurities, and study interaction effects on the impurities only. If the majority system is a conventional metal, the impurities are transformed into so-called Fermi polarons \cite{chevy2006universal} \footnote{Here, we understand the polaron as a mobile quasiparticle, and not as a static impurity as recently studied in a topological system in Ref.\ \cite{PhysRevLett.125.240601}}, which by now are routinely observed in ultracold-gas \cite{schirotzek2009observation,Kostall2012,Koschorreck2012,PhysRevLett.118.083602,PhysRevLett.122.093401} and also solid state experiments \cite{sidler2017fermi} -- for a review, see for instance Refs.\ \cite{massignan2014polarons, Levinsen2015, schmidt2018universal}. In these systems, the local kinematic properties of the impurities are modified by the interaction with the medium, while the medium itself is unmodified if the impurity density is small. The next logical question to ask is whether global topological characteristics of the medium \cite{RevModPhys.89.040502} can influence the impurity as well: Can a topologically trivial impurity inherit the topological quantum numbers of the medium? Such an interaction-induced topology is a fundamentally interesting prospect. Furthermore, this question is of high relevance to current cold-atom experiments, where a broad family of topological band structures have been realized \cite{RevModPhys.91.015005}. Topological and polaronic physics are thus well-controlled (and highly active) but largely separate fields in cold-atom research, and it is thus worthwhile and intriguing to combine them together. This goal has been approached in a few recent theoretical works, mainly from two perspectives: Either interaction effects are strong such that an impurity-majority bound state is formed \cite{Grusdt2016, PhysRevB.100.075126, PhysRevX.10.041058, baldelli2021tracing}, and the impurity inherits the topological quantum numbers of the majority, or, alternatively, one can study the problem in weak coupling \cite{PhysRevB.99.081105, *PhysRevB.102.119903}, as previously done by some of us, with the majority forming a Chern insulator. This perturbative approach is well-controlled and does not require additional regularization. As a diagnostic tool for the inherited topological properties of the impurity particles, Ref.\ \cite{PhysRevB.99.081105, *PhysRevB.102.119903} numerically computed the impurity Hall drag for majority particles governed by the Haldane lattice model \cite{PhysRevLett.61.2015}. It was found that the Hall drag is neither quantized nor simply follows the majority phase diagram, and even vanishes in the center of the topological phase; however, it exhibits a sharp jump upon tuning the insulator across its topological phase transition. In this work, we introduce a generic (continuum) Dirac model of a Chern insulator. This model follows the same universal physics as the Haldane model, but allows for an analytical understanding of the phenomena numerically observed in Ref.\ \cite{PhysRevB.99.081105, *PhysRevB.102.119903}. With a diagrammatical approach, we show that the Hall drag can be split into two drag contributions exerted by majority particles and holes, respectively. These two contributions counteract each other, and completely cancel at the particle-hole symmetric point. This is reminiscent of Coulomb drag in two-layer systems \cite{kamenev1995coulomb, PhysRevB.76.081401,RevModPhys.88.025003}, and explains the observed vanishing of the drag in the center of the majority topological phase. If particle-hole symmetry is broken, the impurity Hall drag can be non-vanishing even if the majority Chern insulator is in the trivial phase. To understand the observed jump across the topological phase transition, one should view the majority system as a combination of Dirac-like fermions with linear dispersion, and ``spectator'' fermions \cite{bernevig2013topological} with a quadratic dispersion. At the phase transition, the spectator fermions change smoothly, but the Dirac fermions feel the gap closing and exhibit a singular Berry curvature. We show that this singularity is integrated over in the expression for the impurity Hall drag, which leads to a jump proportional to the change in Chern number, including the correct sign. This is the only clear manifestation of topology in weak-coupling impurity transport. We derive an analytical formula for the jump, and validate all results numerically for the Haldane lattice model. To supplement the theoretical results, we present a detailed discussion on how to detect the Hall drag and jump with various experimental techniques. A particular promising approach is to use circular dichroism, that is, measuring impurity excitation rates upon driving the system with left and right circularly polarized fields \cite{tran2017probing, PhysRevA.97.061602, PhysRevLett.122.166801, asteria2019measuring}. A systematic method of computing the excitation rates in an interacting many-body system is presented along the way. The remainder of this paper is structured as follows: In Sec.\ \ref{dragDiracsec} we present the continuum Dirac model and the evaluation of the impurity drag. In Sec.\ \ref{jumpsec}, we investigate the jump across the topological phase transition. The drag including its jump at the topological transition is analyzed for the Haldane model in Sec.\ \ref{Haldanemodel}. The different measurement protocols are detailed in Sec.~\ref{dichroismsec}, with special focus on the dichroic measurement. Conclusions and outlook are presented in Sec.\ \ref{conclusionsec}. Some technical details are relegated to Appendices. \section{Drag transconductivity in the continuum model} \label{dragDiracsec} We start by computing the impurity drag in a generic continuum model and consider the following two-dimensional Bloch Hamiltonian for majority particles indexed by a pseudospin $\uparrow$: \begin{align} \label{contham} &H_\uparrow({\boldsymbol{k}}) = \sum_{i = 0}^3 \psi_\uparrow^\dagger({\boldsymbol{k}}) h_i({\boldsymbol{k}}) \sigma_i \psi_\uparrow({\boldsymbol{k}})\ , \\ \notag &\psi_\uparrow({\boldsymbol{k}}) = \left(c_{\uparrow,A}({\boldsymbol{k}}), c_{\uparrow,B} ({\boldsymbol{k}})\right)^T\ , \\ \notag & h_1({\boldsymbol{k}}) = k_x\ , \quad h_2({\boldsymbol{k}}) = k_y\ , \quad h_3({\boldsymbol{k}}) = m + d_1k^2, \\ \notag & h_0({\boldsymbol{k}}) = d_2k^2, \quad k = |{\boldsymbol{k}}|\ , \end{align} with $\sigma_0 = \mathbbm{1}$ and $\sigma_i$ with $i = 1,2,3$ being the Pauli matrices. Throughout this paper we will work in units where $\hbar = c = e = 1$; all quantities are measured in appropriate powers of the (inverse) physical fermion mass, while momenta are rescaled by the band velocity. Equation \eqref{contham} can be seen as a low-energy approximation to a microscopic tight-binding Hamiltonian with a two-sublattice structure ($A,B$) and broken time-reversal invariance. The eigenenergies corresponding to \eqref{contham} read \begin{align} \epsilon_{\uparrow; 1,2}({\boldsymbol{k}}) = h_0({\boldsymbol{k}}) \mp h({\boldsymbol{k}}), \quad h({\boldsymbol{k}}) = \sqrt{k^2 + h_3(k)^2} \ . \end{align} Without the terms $d_1, d_2$ (which have physical dimensions (mass)$^{-1}$), Eq.\ \eqref{contham} describes a gapped Dirac cone with mass gap $m$. The term $d_1$ serves as a UV regularizer and makes the dispersion quadratic at higher energies while preserving particle-hole symmetry, $\epsilon_{\uparrow,1}({\boldsymbol{k}}) = - \epsilon_{\uparrow,2}({\boldsymbol{k}})$. The symmetry is broken for finite $d_2$. We assume $|d_1| > |d_2|$, thus the lower (upper) band is filled (empty). For general $d_2$, the Hamiltonian \eqref{contham} is in the Altland-Zirnbauer class A \cite{ryu2010topological}, and gives rise to a quantized Chern number $\mathcal{C}$. As shown below, it reads \begin{align} \label{Cexp} \mathcal{C}&= \frac{1}{2\pi} \int \!d{\boldsymbol{k}} \frac{1}{2}\frac{(m-d_1 k^2)}{(k^2 + (m+ d_1k^2)^2)^{3/2}} \\ &= \frac{1}{2}\left[\text{sign}(m) - \text{sign}(d_1)\right] \ . \notag \end{align} The integrand of Eq.\ \eqref{Cexp} is nothing but the Berry curvature $\mathcal{F}_{xy}(k)$. As visualized in Fig.\ \ref{contbands}, for $m\rightarrow 0$ $\mathcal{F}_{xy}(k)$ consists of a sharp half-quantized peak for $k\lesssim m$, arising from the Dirac fermions, on top of a broad background from high-energy ``spectator'' fermions \cite{bernevig2013topological}. Both types of fermions effectively contribute a half-integer Chern number, such that the total Chern number is quantized to an integer. \begin{figure} \centering \includegraphics[width=.9\columnwidth]{fig1.pdf} \caption{Berry curvature for $d_1 = -1$ and $m = \pm 0.1$ (full lines), $m = \pm 0.2$ (dashed lines). The inset shows a zoom-in on small values of $\mathcal{F}_{xy}(k)$, highlighting the sign-change of the Berry curvature in the trivial phase.} \label{contbands} \end{figure} As explicit in Eq.\ \eqref{Cexp}, $\mathcal{C}$ does not depend on the particle-hole symmetry breaking parameter $d_2$. This is in line with the geometrical interpretation of $\mathcal{C}$ as a winding number \footnote{For the winding number construction one should view momentum space as compactified, $\mathbb{R}_2 \rightarrow S_2$}, which is independent of the term $h_0$ commuting with the Hamiltonian \cite{PhysRevLett.121.086810}. As a preparation for the later calculations, it is useful to recap the computation of $\mathcal{C}$ explicitly as $\mathcal{C} = -2\pi {\sigma}_{xy}$ \cite{PhysRevLett.49.405, kohmoto1985topological}, with $\sigma_{xy}$ the transconductivity; the conductivity quantum is $\sigma_0 = e^2/\hbar = 1/2\pi$ with the chosen units. In linear response, $\sigma_{xy}$ is proportional to the retarded current-current correlation function, which may be obtained by analytical continuation from imaginary time: \begin{align} \label{sigmaxy1} \sigma_{xy} = \lim_{\omega \rightarrow 0} \frac{1}{-i\omega A_0} \left[ - \braket{\hat{J}_\uparrow^x \hat{J}_\uparrow^y}(i\Omega) \bigg|_{i\Omega \rightarrow \omega + i0^+} \right], \end{align} with $A_0$ the system area, and $\hat{J}_\uparrow$ the current operators at vanishing external momentum. The imaginary time correlator in Eq.\ \eqref{sigmaxy1} can be written as \begin{align} \label{JJG} &-\braket{\hat{J}_\uparrow^x \hat{J}_\uparrow^y}(i\Omega) = \\ \notag& A_0\int_k G_{\uparrow,\alpha}(\omega_k,{\boldsymbol{k}}) G_{\uparrow,\beta}(\Omega + \omega_k, {\boldsymbol{k}}) J^x_{\uparrow,\alpha\beta}({\boldsymbol{k}}) J^y_{\uparrow,\beta\alpha}({\boldsymbol{k}}), \\ & \int_k \equiv \int \frac{d{\boldsymbol{k}} d\omega_k}{(2\pi)^3}, \quad G_{\uparrow,\alpha}(\omega_k,{\boldsymbol{k}}) = \frac{1}{i\omega_k - \epsilon_{\uparrow,\alpha}({\boldsymbol{k}})} \ , \notag \end{align} where $\alpha,\beta$ refer to band indices and the Einstein summation convention is implied. $J_{\uparrow,\alpha\beta}^{x/y}$ are current matrix element in the diagonal basis (see App.\ \ref{BasisrotSec} for details). The standard diagrammatical representation of Eq.\ \eqref{JJG} is shown in Fig.\ \ref{bubblediag}. The Matsubara Green function $G_{\uparrow,1}$ describes the propagation of a hole in the filled lower band, while $G_{\uparrow,2}$ represents a particle in the upper band. The frequency integral in Eq.\ \eqref{JJG} only receives contributions when $\alpha \neq \beta$, and thus one can view creation of virtual particle-hole pairs as the origin of the conductivity. These quasiparticles are virtual, since the external field does not provide enough energy ($\Omega \rightarrow 0$) to overcome the band gap. \begin{figure} \centering \includegraphics[width=.9\columnwidth]{fig2.pdf} \caption{Diagram representing Eq.\ \eqref{JJG}, with $\alpha = 1, \beta = 2$.} \label{bubblediag} \end{figure} Evaluation of Eqs.\ \eqref{JJG} and \eqref{sigmaxy1} is straightforward. One finds \begin{align} \notag \sigma_{xy} &= -i\int\!\frac{d{\boldsymbol{k}}}{(2\pi)^2} \frac{J_{\uparrow,12}^x({\boldsymbol{k}}) J^y_{\uparrow,21}({\boldsymbol{k}})-J_{\uparrow,21}^x({\boldsymbol{k}}) J^y_{\uparrow,12}({\boldsymbol{k}})}{(\epsilon_{\uparrow,1}({\boldsymbol{k}}) - \epsilon_{\uparrow,2}({\boldsymbol{k}}))^2} \\& = -\frac{1}{2\pi} \mathcal{C} \ . \label{sigmaCrel} \end{align} Inserting current matrix elements and dispersions into Eq.\ \eqref{sigmaCrel} produces Eq.\ \eqref{Cexp}. After this noninteracting prelude, we are ready to attack the polaron problem. We consider a minority particle species indexed by $\downarrow$, with a trivial quadratic Hamiltonian $H_\downarrow({\boldsymbol{p}})$: \begin{align} \label{trivialHam} &H_\downarrow({\boldsymbol{p}}) = \epsilon_\downarrow({\boldsymbol{p}}) c^\dagger_\downarrow({\boldsymbol{p}})c_\downarrow({\boldsymbol{p}}), \quad \epsilon_\downarrow({\boldsymbol{p}}) = \frac{p^2}{2M} \ . \end{align} We can view the impurities as governed by a similar tight-binding Hamiltonian as the majority, but with a chemical potential almost at the bottom of the lower band, around which the dispersion is approximated by an effective mass $M$. Higher impurity bands can be safely neglected. The majority and minority particles interact via an onsite-interaction $H_\text{int}$ \cite{PhysRevB.99.081105, *PhysRevB.102.119903}, which does not distinguish between the sublattices (recall that the sublattices give rise to the two-band structure): \begin{align} &H_\text{int} = \frac{g}{A_0}\sum_{\ell = A,B}\sum_{{\boldsymbol{k}},{\boldsymbol{p}},{\boldsymbol{q}}} c^\dagger_{\uparrow, \ell} ({\boldsymbol{k}} +{\boldsymbol{q}}) c_{\uparrow,\ell} ({\boldsymbol{k}}) c^\dagger_\downarrow({\boldsymbol{p}}-{\boldsymbol{q}}) c_\downarrow({\boldsymbol{p}}) = \notag \\ \notag & \frac{g}{A_0} \sum_{{\boldsymbol{k}},{\boldsymbol{p}},{\boldsymbol{q}}} c^\dagger_{\uparrow, \alpha} ({\boldsymbol{k}} +{\boldsymbol{q}}) c_{\uparrow,\beta} ({\boldsymbol{k}}) c^\dagger_\downarrow({\boldsymbol{p}}-{\boldsymbol{q}}) c_\downarrow({\boldsymbol{p}}) W_{\alpha\beta}({\boldsymbol{k}},{\boldsymbol{q}}), \\ &W_{\alpha\beta}({\boldsymbol{k}},{\boldsymbol{q}}) \equiv \left[U_\uparrow^\dagger({\boldsymbol{k}}+{\boldsymbol{q}}) U_\uparrow({\boldsymbol{k}}) \right]_{\alpha\beta}\ , \label{Hint} \end{align} where we have rotated to the band space in the second line. Now we imagine a constant and uniform force $\boldsymbol{E} = E \textbf{e}_y$ acting on both majority and minority particles \footnote{Note that $e = 1$ is the effective charge corresponding to this force and might not be directly related to the electron charge}. Due to the interaction $H_\text{int}$, a transverse impurity current $J_{\downarrow}^x$ will be induced; without interaction, there is none due to time reversal symmetry of the impurities. To quantify this effect, we must compute the Hall drag transconductivity \begin{align} \label{dragtrans1} \sigma_{\downarrow\uparrow} \equiv \lim_{\omega \rightarrow 0} \frac{1}{-i\omega A_0} \left[ - \braket{\hat{J}_\downarrow^x \hat{J}_\uparrow^y}(i\Omega) \bigg|_{i\Omega \rightarrow \omega + i0^+} \right] \ . \end{align} This computation will be done to second order in the impurity-majority coupling $g$, since the first order contribution vanishes \cite{PhysRevB.99.081105, *PhysRevB.102.119903}; thus, attractive and repulsive interactions lead to the same result. We point out that such perturbative expansion is well-controlled for small $g$, and no resummation is needed, in contrast with the recent evaluation of longitudinal polaron drag in the metallic case \cite{PhysRevX.9.041019}. \begin{figure}[H] \centering \includegraphics[width=\columnwidth]{fig3.pdf} \caption{Leading contributions to the drag transconductivity. Dashed lines represent impurities, dotted lines interaction matrix elements $W$, see Eq.\ \eqref{Hint}. The energy-momentum structure of the central part and the colored elements are explained in the main text.} \label{dragdiags} \end{figure} As in the case of Coulomb drag in two-layer systems \cite{kamenev1995coulomb}, the $\mathcal{O}(g^2)$ contribution corresponds to the two diagrams shown in Fig.\ \ref{dragdiags}. We evaluate these diagrams to leading order in the small impurity density $n_\downarrow$. The diagrams involve an impurity loop and are therefore proportional to $n_\downarrow$, unlike the single-particle polaron diagrams which have an impurity ``backbone'' \cite{PhysRevB.77.125101, *PhysRevB.77.020408}. It is convenient to identify the impurity lines that represent filled states ($\hat{=}$ impurity holes). Since these carry vanishing momenta in the small density limit, impurity lines coupled to the current vertex, $J_\downarrow^x({\boldsymbol{q}}) = q_x/M$, are excluded. Thus, the central (red) line corresponds to a filled state. We may set its momentum to zero as done in Fig.\ \ref{dragdiags}, and the integration over filled states then simply produces a factor of $n_\downarrow$. Identification of the red line with a filled state also fixes the (red) index of the central majority line in order for the $\tilde{\omega}$ integral (see Fig.\ \ref{dragdiags}) to be non-vanishing. Schematically the top diagram in Fig.\ \ref{dragdiags} describes the scattering of an impurity with a particle, with momentum transfer ${\boldsymbol{q}}$, and the bottom diagram the scattering with a hole, with momentum transfer $-{\boldsymbol{q}}$. Therefore, the net momentum transfer and drag vanish in the particle-hole symmetric case \cite{kamenev1995coulomb, PhysRevB.76.081401,RevModPhys.88.025003}, as will be seen explictly below. The remaining evaluation of the diagrams is straightforward (see App.\ \ref{appdragsec}). We obtain \begin{widetext} \begin{align} \label{maineqdragcont} &\sigma_{\downarrow\uparrow} = -2 g^2 n_\downarrow \int \frac{d{\boldsymbol{k}}}{(2\pi)^2} \frac{d{\boldsymbol{q}}}{(2\pi)^2} \ \text{Im} \left\{ J^y_{\uparrow,12}({\boldsymbol{k}}) W^{22}({\boldsymbol{k}} - {\boldsymbol{q}}, {\boldsymbol{q}}) W^{21}({\boldsymbol{k}},-{\boldsymbol{q}})\right\} \frac{q_x}{M} \frac{1}{\left({\epsilon_{\uparrow,1}}({\boldsymbol{k}}) - {\epsilon_{\uparrow,2}}({\boldsymbol{k}})\right)^2} \left(d({\boldsymbol{k}},{\boldsymbol{q}}) + c({\boldsymbol{k}},{\boldsymbol{q}}) \right) , \\ \label{cddef} & d({\boldsymbol{k}},{\boldsymbol{q}}) = \frac{2\epsilon_{\uparrow,1}({\boldsymbol{k}}) - \epsilon_{\uparrow,2}({\boldsymbol{k}}) - \epsilon_{\uparrow,2}({\boldsymbol{k}} - {\boldsymbol{q}}) - \epsilon_\downarrow({\boldsymbol{q}})}{\left({\epsilon_{\uparrow,1}}({\boldsymbol{k}})- {\epsilon_{\uparrow,2}}({\boldsymbol{k}}-{\boldsymbol{q}})-\epsilon_\downarrow({\boldsymbol{q}})\right)^3} \ , \quad c({\boldsymbol{k}},{\boldsymbol{q}}) = \frac{2 {\epsilon_{\uparrow,2}}({\boldsymbol{k}}) - {\epsilon_{\uparrow,1}}({\boldsymbol{k}}) - {\epsilon_{\uparrow,1}}({\boldsymbol{k}}-{\boldsymbol{q}}) + \epsilon_\downarrow({\boldsymbol{q}})}{({\epsilon_{\uparrow,1}}({\boldsymbol{k}}-{\boldsymbol{q}}) - {\epsilon_{\uparrow,2}}({\boldsymbol{k}}) - \epsilon_\downarrow({\boldsymbol{q}}))^3} \ . \end{align} \end{widetext} Here, $c,d$ represent the contributions of the ``direct'' (top in Fig.\ \ref{dragdiags}) and ``crossed'' (bottom) diagrams. When flipping $d_2 \rightarrow - d_2$, we have $\epsilon_1 \rightarrow - \epsilon_2$ and vice versa, thus ${\sigma_{\downarrow\uparrow}}$ is antisymmetric in $d_2$. In particular, it vanishes in the particle-hole symmetric case, $d_2 = 0$. Numerical evaluation of Eq.\ \eqref{maineqdragcont} as function of $d_2$ is shown in Fig.\ \ref{contplotnums}(a). Let us point out that the complete cancellation of $\sigma_{\downarrow\uparrow}$ at $d_2 = 0$ only occurs to second order, $\mathcal{O}(g^2)$, and is not expected in higher order, as can be shown explicitly for the Haldane model (see below). In Fig.\ \ref{contplotnums}(b), ${\sigma_{\downarrow\uparrow}}$ is depicted as function of $m$ for non-zero $d_2$, tuning the majority system from the trivial phase with $\mathcal{C} = 0$ to a non-trivial one, $\mathcal{C} = 1$. While ${\sigma_{\downarrow\uparrow}}$ exhibits a clear jump when the majority particles undergo a topological phase transition (see next section), it is neither constant in the non-trivial phase, nor does it vanish in the trivial phase: For the majority particles, time-reversal symmetry is broken everywhere in the phase diagram, but for $\mathcal{C} = 0$ the transconductivity contributions of the ``Dirac'' and ``spectator'' fermions cancel exactly, as long as the chemical potential is in the gap and the lower majority band is completely filled. In the case of the gapless impurity band, such cancellation is not guaranteed, and the impurity Hall drag therefore does not vanish in the non-trivial phase. \begin{figure}[H] \centering \includegraphics[width=.9\columnwidth]{fig4.pdf} \caption{Impurity transconductivity $\sigma_{\downarrow\uparrow}$ from numerical evaluation of Eq.\ \eqref{maineqdragcont}. Lines are guides for the eye. (a) $\sigma_{\downarrow\uparrow}$ as function of $d_2$ for $M=1, m = 0.2, d_1 = -1$. (b) $\sigma_{\downarrow\uparrow}$ as function of $m$ for $M=1, d_1 = -1, d_2 = 0.5$.} \label{contplotnums} \end{figure} \section{The jump across the phase transition for the continuum model} \label{jumpsec} Another salient feature of Fig.\ \ref{contplotnums}(b) is the discontinuous change of the drag transconductivity which occurs upon crossing the topological phase boundary $m=0$. This jump can be understood as arising from a singular contribution of Dirac fermions: When the gap closes, the Dirac part of the majority Berry curvature ($\propto m$ in Eq.\ \eqref{Cexp}) evolves into a delta-function, $\text{sign}(m) \delta^{(2)}({\boldsymbol{k}})$ -- compare also Fig.\ \ref{contbands}. In contrast, the part corresponding to the spectator fermions ($\propto d_1$ in Eq.\ \eqref{Cexp}) is smooth across the transition. In the expression for the impurity drag \eqref{maineqdragcont}, a singular Dirac contribution $\propto \text{sign}(m) \delta^{(2)}({\boldsymbol{k}})$ arises as well. This singular contribution changes sign across the transition, and so induces the jump $\Delta {\sigma_{\downarrow\uparrow}}$ in the Hall drag, with a sign determined by the change in Chern number $\Delta\mathcal{C}$. To extract $\Delta {\sigma_{\downarrow\uparrow}}$ we can set ${\boldsymbol{k}} = 0$ in all parts of Eq.\ \eqref{maineqdragcont} which are non-singular as ${\boldsymbol{k}} \rightarrow 0$. As detailed in App.\ \ref{contjumpapp}, in this way we obtain \begin{widetext} \begin{align} \label{sigmaDiracfirst} &\sigma_{\downarrow\uparrow,\text{Dirac}} = \\&\notag g^2 n_\downarrow \int \frac{d{\boldsymbol{k}}}{(2\pi)^2} \frac{d{\boldsymbol{q}}}{(2\pi)^2} \ \frac{\text{Im} \left\{ J^y_{\uparrow,\text{Dirac},12}({\boldsymbol{k}}) J^x_{\uparrow, \text{Dirac},21}({\boldsymbol{k}})\right\}}{\left({\epsilon_{\uparrow,1}}({\boldsymbol{k}}) - {\epsilon_{\uparrow,2}}({\boldsymbol{k}})\right)^2} \frac{q_x^2}{M q\sqrt{1+(d_1 q)^2}}\left( \frac{1}{(\epsilon_\downarrow({\boldsymbol{q}}) + {\epsilon_{\uparrow,2}}({\boldsymbol{q}}))^2} - \frac{1}{(\epsilon_\downarrow({\boldsymbol{q}}) - {\epsilon_{\uparrow,1}}({\boldsymbol{q}}))^2} \right) \ , \end{align} \end{widetext} where $J^{x/y}_{\uparrow,\text{Dirac}}({\boldsymbol{k}})$ represents the majority current carried by the Dirac (i.e., not the spectator) fermions. Compared to Eq.\ \eqref{maineqdragcont} the ${\boldsymbol{k}}$ and ${\boldsymbol{q}}$ integrals in Eq.\ \eqref{sigmaDiracfirst} have factorized. The ${\boldsymbol{k}}$ integral, which simplifies to an integral over a delta function as $m \rightarrow 0$, is nothing but the Chern number contribution of the Dirac fermions, cf.\ Eq.\ \eqref{sigmaCrel}. It evaluates to $(1/8\pi ) \text{sgn}(m)$. Performing the remaining ${\boldsymbol{q}}$ integral, one finds \begin{align} \label{diracfinal} \sigma_{\downarrow\uparrow,\text{Dirac}} = - \frac{g^2 n_\downarrow}{(2\pi)^4} \cdot \frac{4\pi^2 d_2 M\cdot\text{sign}(m)}{1+ 4M (|d_1| + (d_1^2 - d_2^2) M)} \ . \end{align} Defining $\Delta{\sigma_{\downarrow\uparrow}}$ as the jump of Hall drag when going from the trivial to the topological phase, with change in Chern number $\Delta \mathcal{C}$, Eq.\ \eqref{diracfinal} leads to the final result: \begin{align} \label{deltasigmaC} \Delta{\sigma_{\downarrow\uparrow}} = \Delta \mathcal{C}\cdot \frac{g^2 n_\downarrow}{(2\pi)^4}\left(- \frac{8\pi^2 d_2 M}{1+ 4M (|d_1| + (d_1^2 - d_2^2) M)}\right) \ . \end{align} As a check, in Fig.\ \ref{contjump} this formula is compared with a numerical evaluation of the jump from Eq.\ \eqref{maineqdragcont} as function of the impurity mass $M$, yielding excellent agreement. Note that both Hall drag and jump will vanish in the limits $M \to 0 \ \text{or} \ M \to \infty$: In the former limit, the impurity cannot interact efficiently with the majority particles due to the large kinetic energy cost, while in the latter the impurity is immobile and cannot be dragged. \begin{figure} \centering \includegraphics[width=.95\columnwidth]{fig5.pdf} \caption{Jump of the Hall drag $\Delta{\sigma_{\downarrow\uparrow}}$ in the continuum model as function of $M$, with $d_1 = -1, d_2 = 0.5$. The dashed line corresponds to Eq.\ \eqref{deltasigmaC}, points are computed numerically by evaluating Eq.\ \eqref{maineqdragcont} at two points $m = \pm 0.001$ close to the phase boundary. Numerical errors are of the order of the points size. \textit{Inset}: The smooth contribution of the spectator fermions, obtained numerically from Eq.\ \eqref{maineqdragcont}.} \label{contjump} \end{figure} While the Dirac part of the Hall drag, $\sigma_{\downarrow\uparrow,\text{Dirac}}$, changes sign at the transition, there is also a small smooth background contribution from the spectator fermions, to be denoted $\sigma_{\downarrow\uparrow,\text{spec}}$. This contribution can be extracted numerically from Eq.\ \eqref{maineqdragcont} as \begin{align} \sigma_{\downarrow\uparrow,\text{spec}}= \frac{1}{2}\left[{\sigma_{\downarrow\uparrow}}(m = 0^+) + {\sigma_{\downarrow\uparrow}}(m = 0^-) \right]\ , \end{align} see the inset to Fig.\ \ref{contjump}. We note in passing that the jump of ${\sigma_{\downarrow\uparrow}}$ is reminiscient of the recently shown \cite{PhysRevLett.126.076603} change of sign in the Hall \textit{coefficient} for a single-particle gapless Dirac cone upon variation of the particle density. \section{Drag and jump in the Haldane lattice model} \label{Haldanemodel} The general behaviour of $\sigma_{\downarrow\uparrow}$ to leading order, $\mathcal{O}(g^2)$, is not limited to the continuum model \eqref{contham}, but will hold in other Chern insulators as well. As another example, we consider a situation \cite{PhysRevB.99.081105, *PhysRevB.102.119903} where the majority particles are described by the Haldane model on the honeycomb lattice \cite{PhysRevLett.61.2015}, with Hamiltonian \begin{align} \label{Haldaneham} H_\uparrow({\boldsymbol{k}}) &= \sum_{i = 0}^3 \psi_\uparrow^\dagger({\boldsymbol{k}}) \left(h_i({\boldsymbol{k}}) \sigma_i \right) \psi_\uparrow({\boldsymbol{k}})\ ,\\ \notag \psi_\uparrow({\boldsymbol{k}}) &= \left(c_{\uparrow,A}({\boldsymbol{k}}), c_{\uparrow,B} ({\boldsymbol{k}})\right)^T, \ \quad {\boldsymbol{k}}_i = {\boldsymbol{k}} \cdot \boldsymbol{u}_i\ , \\ \notag h_0({\boldsymbol{k}}) &= -2t^\prime \cos(\phi) \left[ \cos({\boldsymbol{k}}_1 - {\boldsymbol{k}}_2) + \cos({\boldsymbol{k}}_1) + \cos({\boldsymbol{k}}_2) \right] \ , \\ \notag h_1({\boldsymbol{k}}) &= - \left[1 + \cos({\boldsymbol{k}}_1) + \cos({\boldsymbol{k}}_2)\right]\ , \\ \notag h_2({\boldsymbol{k}}) &= -\left[(\sin({\boldsymbol{k}}_1) + \sin({\boldsymbol{k}}_2)\right], \\ \notag h_3({\boldsymbol{k}}) &= \\& \notag \hspace{-2em} \Delta/2 + 2t^\prime \sin(\phi) \left[ \sin({\boldsymbol{k}}_1 - {\boldsymbol{k}}_2) + \sin({\boldsymbol{k}}_2) - \sin({\boldsymbol{k}}_1)\right] \ , \end{align} where $ \ {\boldsymbol{u}_1} = (3/2, \sqrt{3}/2)^T, \ {\boldsymbol{u}_2}= (3/2, - \sqrt{3}/2)^T$, and the lattice constant and nearest neighbour hopping amplitude are set to 1. The reciprocal lattice vectors are given by $\boldsymbol{b}_1 = (2\pi/3,2\pi/\sqrt{3})^T, \ \boldsymbol{b}_2 = (-2\pi/3,2\pi/\sqrt{3})^T$. The model is parametrized by the next-nearest-neighbour hopping $t^\prime$, the angle $\phi$ quantifying the time-reversal symmetry breaking, and the sublattice potential offset $\Delta$. For given values of $t^\prime, \phi, \Delta$, the majority chemical potential is implicitly placed in the gap (its precise value is irrelevant). The well-known topological phase diagram of the Haldane model is shown in Fig.\ \ref{haldane_allfig}(a). The impurity particles are governed by the tight-binding model for graphene (i.e., $t^\prime = \Delta = 0$), with the chemical potential at the bottom of the lower band \cite{PhysRevB.99.081105} {by setting $h_0({\boldsymbol{k}}) = 3$}. The impurity-majority interaction, Eq.\ \eqref{Hint}, is straigthforwardly modified to account for the impurity multi-band structure. The Hall drag ${\sigma_{\downarrow\uparrow}}$ can then be derived in analogy to the continuum model, see App.~\ref{Haldaneapp} for details; the only minor change is the appearance of diagonalizing unitary matrices $U_\downarrow({\boldsymbol{q}})$ for the impurity. Numerical evaluation of ${\sigma_{\downarrow\uparrow}}$ is presented in Figs.\ \ref{haldane_allfig}(b)--(d). Now, the particle-hole symmetric case where $\epsilon_1 = - \epsilon_2$ corresponds to $\phi = \pm \pi/2$, and ${\sigma_{\downarrow\uparrow}}$ vanishes accordingly \cite{PhysRevB.102.119903}. Furthermore, one can easily demonstrate the symmetry ${\sigma_{\downarrow\uparrow}}(\phi) = - {\sigma_{\downarrow\uparrow}}(\pi - \phi)$, see App.\ \ref{Haldaneapp} below Eq.\ \eqref{haldanedragformula}. This symmetry is readily seen in Fig.\ \ref{haldane_allfig}(c), which shows a cut through the phase diagrams for fixed $\Delta = 0$. Combined with the symmetry ${\sigma_{\downarrow\uparrow}}(\phi) = - {\sigma_{\downarrow\uparrow}}(-\phi)$ inherited from the Haldane model, this gives the Hall drag a periodicity \begin{align} {\sigma_{\downarrow\uparrow}}(\phi) = {\sigma_{\downarrow\uparrow}}(\phi + \pi)\ , \end{align} apparent in Fig.\ \ref{haldane_allfig}(b). This remarkable manifestation of particle-hole antisymmetry is in stark contrast to the pure majority case, where the Chern number only has the trivial periodicity $\mathcal{C}(\phi) = \mathcal{C}(\phi + 2\pi)$, see Fig.\ \ref{haldane_allfig}(a). At the special particle-hole symmetric parameter points, $\phi = \pm \pi/2, \Delta =0$, one can also get insight into the behavior of ${\sigma_{\downarrow\uparrow}}$ to higher order in $g$ (see App.\ \ref{antapp}): employing a particle-hole transformation which also exchanges band indices of the majority particles, it can be shown that at these points the Hall drag is antisymmetric in $g$ to all orders. So while there is no $\mathcal{O}(g)$ contribution, and the leading order, $\mathcal{O}(g^2)$, must vanish, at order $\mathcal{O}(g^3)$ the Hall drag will be nonzero. \\ \begin{figure*} \centering \includegraphics[width=\textwidth]{fig6.pdf} \caption{Impurity Hall drag ${\sigma_{\downarrow\uparrow}}$ in the Haldane model. (a) Majority phase diagram. $\Delta_0 = 6\sqrt{3}t^\prime$ is the value of $\Delta$ where the phase transition occurs for $\phi = \pi/2$. (b) ${\sigma_{\downarrow\uparrow}}$ from numerical evaluation of Eq.\ \eqref{haldanedragformula} for $t^\prime = 0.2$. Cuts through the phase diagram along the dashed lines are shown in the next panels. (c) ${\sigma_{\downarrow\uparrow}}$ as function of $\phi$ for $\Delta = 0$ and two values of $t^\prime$. (d) ${\sigma_{\downarrow\uparrow}}$ as function of $\Delta$ for $\phi = \pi/4$ and same two values of $t^\prime$. The abscissa is rescaled by $\Delta_0(t^\prime)$. } \label{haldane_allfig} \end{figure*} In the numerics, the jump of ${\sigma_{\downarrow\uparrow}}$ across the topological phase transition is again prominent, and clearly delineates the topological phases of the parent Haldane model. Its origin is analogous to the continuum model -- it comes from a sign-changing contribution of Dirac fermions, which becomes singular upon gap closing. The only significant difference is that there are now two Dirac cones in the problem, but except at the special points $\phi = 0,\pi$, the gap closes at only one of them. In the language employed for the continuum model, states near the Dirac cone with open gap count as spectator fermions. A detailed analysis of the jump leads to (see App.\ \ref{Haldaneapp}) \begin{align} \label{haldanejumpmain} \Delta{\sigma_{\downarrow\uparrow}} = \Delta \mathcal{C} \cdot \frac{g^2 n_\downarrow}{(2\pi)^4} \cdot f(t^\prime, \phi) , \end{align} where $f(t^\prime, \phi)$ is a numerical function defined in Eq.\ \eqref{sigmadirachald}. It involves the remaining ${\boldsymbol{q}}$ integral, which is difficult to evaluate analytically in the lattice case. In Fig.\ \ref{Haldanejump}(a), $\Delta{\sigma_{\downarrow\uparrow}}$ is depicted as a function of $\phi$. It is maximal as $\phi \rightarrow 0^+, \pi^-$, where the particle-hole asymmetry of the dispersion (away from the Dirac points) is largest. Again, the jump occurs on top of a smooth background contribution from the spectator fermions, presented in Fig.\ \ref{Haldanejump}(b). It too is maximal as $\phi \rightarrow 0^+, \pi^-$, approaching $1/2\Delta{\sigma_{\downarrow\uparrow}}$: close to these angles, the spectator contribution is almost fully determined by the second Dirac cone, which has a very small gap. Accordingly, the values of the sign-changing drag contribution, $\sigma_{\downarrow\uparrow, \text{Dirac}}$, and the almost Dirac-like background contribution are the same. \begin{figure} \centering \includegraphics[width=.95\columnwidth]{fig7.pdf} \caption{(a) Jump of the Hall drag $\Delta{\sigma_{\downarrow\uparrow}}$ in the Haldane model as function of $\phi$, with $t^\prime = 0.2$ and $\Delta = \Delta_c$ tuned to the transition line. The dashed line corresponds to formula \eqref{haldanejumpmain}, points are computed numerically by evaluating Eq.\ \eqref{haldanedragformula} at two points close to the phase boundary, with $\Delta = \Delta_c \pm 0.001$ (filled circles). For comparison, a numerical evaluation with $\Delta = \Delta_c \pm 0.1$ is also shown (empty circles), which yields qualitative agreement only. (b) Smooth contribution from spectator fermions, obtained numerically from \eqref{haldanedragformula}. Horizontal lines correspond to $\Delta{\sigma_{\downarrow\uparrow}}(\phi = 0^+, \pi^-)/2.$} \label{Haldanejump} \end{figure} \section{Measurement of the Hall drag} \label{dichroismsec} We now discuss how to detect ${\sigma_{\downarrow\uparrow}}$ experimentally. In a solid state system, the total transversal conductivity $\sigma_{xy, \text{tot}}$ is an easily accessible quantity, typically obtained from a resistivity measurement. Since the majority particles form a Chern insulator, their contribution to $\sigma_{xy, \text{tot}}$ is quantized, and the Hall drag contribution ${\sigma_{\downarrow\uparrow}}$ can in principle be read off by subtracting this quantized value from $\sigma_{xy, \text{tot}}$. In practice, however, it may be necessary to use the specific parameter dependence of ${\sigma_{\downarrow\uparrow}}$ to separate it from $\sigma_{xy, \text{tot}}$. ${\sigma_{\downarrow\uparrow}}$ can for example be obtained as the contribution to $\sigma_{xy, \text{tot}}$ proportional to the impurity density $n_\downarrow$, or by subtracting measurements of $\sigma_{xy, \text{tot}}$ at two particle-hole inverted points of the phase diagram. Chern insulators have also been successfully realized in ultracold gas systems. Here, an established technique for measuring topological quantum numbers \cite{Aidelsburger2015,PhysRevA.102.063316} is the in-situ observation of the center of mass displacement of the atomic cloud upon the action of an external force. In the present polaron context, this measurement would have to be performed in a state-dependent manner to extract the Hall drag. In addition, one could conduct either a state-dependent time-of-flight measurement \cite{PhysRevLett.109.095302, Wu83}, or Raman spectroscopy (as recently implemented for polarons \cite{PhysRevX.10.041019}), to infer the in-trap momentum distribution of the impurity, in view of evaluating the current response of the impurity to an applied force. All these transport experiments would extract the Hall drag from the linear current response to an external, linearly polarized electric field, which is the standard point of view. However, recent theoretical works have shown \cite{tran2017probing, PhysRevA.97.061602, PhysRevLett.122.166801,PhysRevResearch.2.033385,PhysRevB.103.035114} that topological invariants can also be obtained from a measurement of excitation rates to second order in the amplitudes of circularly polarized fields, which was verified in the experiment of Ref.\ \cite{asteria2019measuring}. For the Hall drag ${\sigma_{\downarrow\uparrow}}$, a relation to an impurity excitation rate can be established as well, as we now show. Measuring such excitation rates may be a simpler route to detect ${\sigma_{\downarrow\uparrow}}$ experimentally, in both ultracold gas and solid state systems. To set the stage, we first rephrase the results of Ref.\ \cite{tran2017probing} for the majority sector (non-interacting Chern insulator). The particles are coupled to external left or right circular polarized electrical fields: \begin{align} \textbf{E}_{\pm}(t) = 2E \left(\cos(\omega t),\ \pm \sin(\omega t)\right)^T \ , \end{align} with $\omega$ a fixed drive frequency. In the temporal gauge, the time-dependent light-matter Hamiltonian reads \begin{align} \label{Hpmup} &H_{\uparrow,\pm}(t) = \frac{2 E}{\omega} \left( \hat{J}^x_\uparrow \sin(\omega t) \mp \hat{J}^y_{\uparrow} \cos(\omega t) \right) \ . \end{align} When this perturbation is switched on, particles are excited from the lower to the upper band. One can define the associated depletion rates of initially occupied states with momentum ${\boldsymbol{k}}$, $\Gamma_{\uparrow,\pm}({\boldsymbol{k}},\omega)$, which depend on the polarization of the driving field (``circular dichroism''). In Ref.\ \cite{tran2017probing}, these rates are obtained from Fermi's Golden Rule. Let $\Delta\Gamma_\uparrow(\omega)$ be the difference in total depletion rates for a fixed frequency $\omega$, $\Delta \Gamma_\uparrow(\omega) \equiv 1/2 \sum_{\boldsymbol{k}} (\Gamma_{\uparrow,+}({\boldsymbol{k}},\omega) - \Gamma_{\uparrow,-}({\boldsymbol{k}},\omega))$. Then the Chern number $\mathcal{C}$ follows the simple relation \footnote{Note that we use a different sign convention for $\mathcal{C}$ than Ref.\ \cite{tran2017probing}}: \begin{align} \label{dichrobasic} A_0 E^2 \mathcal{C} = - \int_{0}^\infty \ d\omega \Delta \Gamma_\uparrow (\omega) \ . \end{align} This integration has to be understood as an average of $\Delta\Gamma_\uparrow(\omega)$ over different drive frequencies, obtained by repeating the experiment many times \cite{asteria2019measuring}. \begin{figure}[b] \centering \includegraphics[width=.75\columnwidth]{fig8.pdf} \caption{On-shell self-energy diagram. Incoming and outgoing fermion lines represent particles from the lower band, the intermediate line a particle from the upper band, and the wiggly lines the circularly polarized electrical fields. The Feynman rules are explained in App.\ \ref{dichroapp}.} \label{rate_nonint} \end{figure} For our purposes here, it is useful to rederive the result \eqref{dichrobasic} from diagrammatic perturbation theory. This is achieved by relating the depletion rate to the on-shell retarded self-energy as \begin{align} \Gamma_{\pm, \uparrow}({\boldsymbol{k}},\omega) = - 2 \text{Im}\left[\Sigma_\pm(\epsilon_{\uparrow,1}({\boldsymbol{k}}), {\boldsymbol{k}}; \omega) \right] \ . \end{align} In turn, the self-energy to second order in $H_{\uparrow,\pm}$ can be represented by the Feynman diagram of Fig.\ \ref{rate_nonint}, plus the diagram with the $\hat{J}^x_\uparrow, \hat{J}_\uparrow^y$ vertices interchanged. The necessary Feynman rules in energy-momentum space are easily derived from $H_{\uparrow, \pm}$, and are detailed in App.\ \ref{dichroapp}. There are also processes involving $(\hat{J}^x_\uparrow)^2, (\hat{J}^y_\uparrow)^2$, but they cancel in $\Delta \Gamma_\uparrow(\omega)$. Working directly in the real frequency space for convenience, $\Delta \Gamma_\uparrow(\omega)$ can then be directly written down as \begin{align} &\Delta\Gamma_\uparrow(\omega) \notag = - \sum_{\boldsymbol{k}} \text{Im} \left[ \Sigma_+(\epsilon_1({\boldsymbol{k}}), {\boldsymbol{k}}; \omega)- \Sigma_{-}(\epsilon_1({\boldsymbol{k}}), {\boldsymbol{k}}; \omega)\right]= \\ \notag & -\sum_{\boldsymbol{k}} \frac{E^2}{\omega^2}\text{Im}\bigg[ \left(2iJ_{\uparrow,21}^x({\boldsymbol{k}})J^y_{\uparrow,12}({\boldsymbol{k}}) - 2iJ_{\uparrow,21}^y({\boldsymbol{k}}) J_{\uparrow,12}^x({\boldsymbol{k}}) \right) \\ & \qquad \qquad \qquad \times \frac{1}{\omega + \epsilon_{\uparrow,1}({\boldsymbol{k}}) -\epsilon_{\uparrow,2}({\boldsymbol{k}}) + i0^+} \bigg] \ . \label{DeltaGammasome} \end{align} Integrating over $\omega$, we find: \begin{align} \label{majratemycomp} &\int_0^\infty d\omega \Delta\Gamma_\uparrow(\omega) = \\ \notag &\frac{4\pi E^2 A_0}{(2\pi)^2} \int d{\boldsymbol{k}} \int_0^\infty d\omega \frac{\delta(\omega - (\epsilon_{\uparrow,2}({\boldsymbol{k}}) -\epsilon_{\uparrow,1}({\boldsymbol{k}})))}{\omega^2} \\ \notag & \times \text{Im} \left[ J_{\uparrow,12}^x({\boldsymbol{k}}) J_{\uparrow,21}^y({\boldsymbol{k}}) \right] \overset{\eqref{sigmaCrel}}{=} - A_0 E^2 \mathcal{C}\ , \end{align} in agreement with Eq.\ \eqref{dichrobasic}. To summarize, we have related the majority Chern number to the differential depletion rate of filled states from the lower band when the system is subjected to a circular perturbation. We can now extend this idea to the impurity case. We consider our previous interacting majority-impurity setup, with a small number of impurities prepared in the lower band, and couple both majority and impurity particles to the circular fields. On their own, the impurities would not experience a differential depletion because of the time reversal invariance of the impurity Hamiltonian. Only due the interaction with the majority particles such differential depletion will set in, corresponding to occupation of higher momentum states. Note that, for strong impurity-majority interactions, it will rather be polaronic (dressed impurity) states which are depleted. For weak coupling, however, such band-dressing effects can be neglected (to order $\mathcal{O}(g^2)$), and we can think in terms of bare impurities in lieu of polarons. In technical terms, our Feynman diagrams will not contain any impurity self-energy insertions. Let us couple the impurities to the circular fields in the same way as the majority particles, Eq.\ \eqref{Hpmup}. We consider the depletion rate of the filled impurity state with vanishing momentum $\Gamma_{\downarrow,\pm}({\boldsymbol{{0}}},\omega) \equiv \Gamma_{\downarrow,\pm}(\omega) $, which is of most interest when the impurity density is small. Since non-vanishing contributions to $\Delta \Gamma_\downarrow(\omega)$ must involve majority scattering, to order $\mathcal{O}(g^2)$ there are two classes of relevant diagrams; representative diagrams are shown in Fig. \ref{imp_rate}. \begin{figure*} \centering \includegraphics[width=.95\textwidth]{fig9.pdf}\caption{Non-vanishing contributions to the impurity depletion rate $\Gamma_{\downarrow,\pm}({\boldsymbol{{0}}},\omega)$. Panels (a), (b): Diagrams not related to the drag, which are particle-hole symmetric. Panels (c), (d): Diagrams related to the drag. These two diagrams differ in the orientation of the field lines and the band index structure of the majority particles. } \label{imp_rate} \end{figure*} Consider first the two diagrams \ref{imp_rate}(a), \ref{imp_rate}(b) in the top row of the Figure. These diagrams describe processes where only the majority particles are excited by the external fields. Since they do not involve an impurity current, they are not related to the drag. Two additional diagrams where the direction of the external field lines is inverted can be drawn as well. The structural difference between Fig.\ \ref{imp_rate}(a) and \ref{imp_rate}(b) is the orientation of the majority lines, which maps to an inverted energy-momentum transfer on the impurity (marked red). Thus, similar to the drag diagrams of Fig.\ \ref{dragdiags}, the diagrams are related by particle-hole symmetry. However, the contributions of these diagrams add up rather than cancel, since they do not contain an impurity current operator, $J_\downarrow({\boldsymbol{q}})$, which is odd in ${\boldsymbol{q}}$. Therefore, as can be verified by a straightforward evaluation (cf.\ App.\ \ref{dichroapp}, Eq.\ \eqref{extraEq}), the total contribution $\Delta\Gamma_{\downarrow,\text{ph}}$ of these diagrams obeys $\Delta \Gamma_{\downarrow,\text{ph}}(\phi) = \Delta \Gamma_{\downarrow,\text{ph}}(\pi - \phi)$ for the Haldane and $\Delta \Gamma_{\downarrow,\text{ph}}(d_2) = \Delta \Gamma_{\downarrow,\text{ph}}(-d_2)$ for the continuum model. As a result, in an experiment these processes can be projected out by subtracting $\Delta \Gamma_{\downarrow,\text{ph}}(\phi) - \Delta \Gamma_{\downarrow,\text{ph}}(\pi - \phi)$, which leaves out only the antisymmetric drag contribution. Another way to separate $\Delta\Gamma_{\downarrow,\text{ph}}$ from the drag is to have a different coupling constant between external field and impurities, which is feasible in the ultracold gas setup where the circular perturbation can for example be implemented by lattice shaking \cite{PhysRevLett.115.073002, asteria2019measuring}. Since $\Delta\Gamma_{\downarrow,\text{ph}}$ is independent of the coupling to the impurities, it can again be eliminated by subtracting measurements obtained for two different impurity couplings. Let us assume either such elimination implicitly, and move on to the two diagrams of Fig.\ \ref{imp_rate}(c), \ref{imp_rate}(d). In essence, they correspond to the drag transconductivity diagram of Fig.\ \ref{dragdiags} (top), with the central (red) impurity line cut. The two other diagrams in this class have crossed interaction lines, akin to the ``crossed'' diagrams of Fig.\ \ref{dragdiags} (bottom). Evaluation of these four diagrams is straightforward, see App.\ \ref{dichroapp}. Summation over the filled impurity states simply yields: \begin{align} \sum_{{\boldsymbol{p}}, \text{filled}} \Gamma_{\downarrow,\pm}({\boldsymbol{p}},\omega) \simeq \sum_{{\boldsymbol{p}}, \text{filled}} \Gamma_{\downarrow,\pm}(\omega) = A_0 n_\downarrow \Gamma_{\downarrow,\pm}(\omega)\ . \end{align} For the integrated differential depletion rate, one then finds \begin{align} \int_0^\infty d\omega \Delta \Gamma_{\downarrow, xy}(\omega) = 2\pi A_0 E^2 {\sigma_{\downarrow\uparrow}} \ , \end{align} as naively expected from Eq.\ \eqref{majratemycomp}. However, the impurity depletion rate also receives contribution from processes involving the currents $\hat{J}_\downarrow^y$, $\hat{J}_\uparrow^x$. Per the Feynman rules (cf.\ App.\ \ref{dichroapp}), these diagrams come with a relative minus sign, and then yield a factor of two for the total differential rate, since $\sigma_{xy,\downarrow\uparrow} = - \sigma_{yx, \downarrow\uparrow}$ for both the continuum and the Haldane model, as one can check easily. Modulo the antisymmetrization discussed above, we therefore have \begin{align} \label{dichrofinal} {\sigma_{\downarrow\uparrow}}= \frac{1}{4\pi A_0 E^2} \int_0^\infty d\omega \Delta \Gamma_{\downarrow}(\omega) \ . \end{align} This result can also be rephrased in terms of excitation instead of depletion rates. Since the impurities are initially prepared at the bottom of the band, one can write \begin{align} \label{absorption rates} \int_0^\infty d\omega \Delta \Gamma_\downarrow(\omega) = \sum_{{\boldsymbol{q}}>0} \ \int_0^\infty d\omega \Delta\Gamma_{\downarrow, \text{exc}}({\boldsymbol{q}}, \omega) \ , \end{align} meaning that the impurities are excited \textit{into} states with higher momentum which are initially empty. These ${\boldsymbol{q}}$-states correspond to the intermediate impurity lines in Fig.\ \ref{imp_rate}. Via Eq.\ \eqref{dichrofinal} we can then define a ${\boldsymbol{q}}$-resolved impurity drag as \begin{align} {\sigma_{\downarrow\uparrow}} \equiv \sum_{{\boldsymbol{q}}>0} {\sigma_{\downarrow\uparrow}}({\boldsymbol{q}}) \ . \end{align} This provides an alternative view on, say, the topological jump $\Delta{\sigma_{\downarrow\uparrow}}$. For the Haldane model, it can be phrased as $\Delta{\sigma_{\downarrow\uparrow}} = \Delta \mathcal{C} \int d{\boldsymbol{q}} f_\text{jump}({\boldsymbol{q}})$, where $f_{\text{jump}}({\boldsymbol{q}})$ is a known function, see Eqs.\ \eqref{haldanejumpmain}, \eqref{sigmadirachald}. If the excitation rates defined in Eq.\ \eqref{absorption rates} can be experimentally detected in ${\boldsymbol{q}}$-resolved fashion (for instance with band mapping techniques \cite{PhysRevLett.94.080403, Tarruell2012, Jotzu2014}), so can the ${\boldsymbol{q}}$-resolved impurity drag ${\sigma_{\downarrow\uparrow}}({\boldsymbol{q}})$. Measuring ${\sigma_{\downarrow\uparrow}}({\boldsymbol{q}})$ at two points in the phase diagram close to the topological boundary then gives direct access to $f_\text{jump}({\boldsymbol{q}})$. Taken the other way around, supposing that $f_{\text{jump}}({\boldsymbol{q}})$ is known for the model realized in the experiment, at each ${\boldsymbol{q}}$-point an independent estimate of the change in Chern number across the phase transition $\Delta \mathcal{C}$ is possible. \section{Conclusions} \label{conclusionsec} In this work we have studied to which extent a topologically trivial impurity can be Hall-dragged by majority excitations in a Chern insulator, looking at two different models in a controlled perturbative setting. Since the impurity Hall drag is sensitive to the dispersion of the majority particles and holes, there is no one-to-one correspondence to the Chern number; nevertheless, the change in Chern number across a topological transition is clearly reflected by a discontinuous jump in the drag transconductivity ${\sigma_{\downarrow\uparrow}}$. This jump arises from the integrated singular Berry curvature of the majority fermions.The transconductivity can be extracted either from transport experiments, or from a measurement of impurity excitation rates upon driving the system by a circularly polarized field. A worthwhile goal for future study is the extension to the strong-coupling limit, in particular the analysis of impurity-majority bound state formation. These bound states may have rather rich physics: They could inherit the topological characteristics of the majority particles \cite{Grusdt2016, PhysRevB.100.075126}, have opposite chirality as found for Haldane model in the two-body limit \cite{PhysRevA.97.013637}, or even be topological when the single-particle state are trivial \cite{PhysRevA.101.023620, Olekhno2020,PhysRevResearch.2.013348}. \section*{Acknowledgments} We thank A.\ Kamenev for helpful discussions. D.P.\ acknowledges funding by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany's Excellence Strategy -- EXC-2111 -- 390814868, and is particularly grateful to the Max-Planck-Institute for the Physics of Complex Systems Dresden (MPIPKS) for hospitality during the intermediate stage of this project. N.G.\ has been supported by the FRS-FNRS (Belgium) and the ERC Starting Grant TopoCold. P.M.\ has been supported by the Spanish MINECO (FIS2017-84114-C2-1- P), and EU FEDER Quantumcat. G.M.B.\ acknowledges support from the Independent Research Fund Denmark-Natural Sciences via Grant No.\ DFF-8021-00233B, and US Army CCDC Atlantic Basic and Applied Research via grant W911NF-19-1-0403. M.G.\ has been supported by the Israel Science Foundation (Grant No.\ 227/15) and the US-Israel Binational Science Foundation (Grant No.\ 2016224). \\ \label{conclusionsec}
\section{Background \& Motivation} \subsection{Prior Work} \label{related_work} While there has been a substantial amount of effort aimed towards finding new forms of approximation \cite{Omer,Patterns2010,ICSE2010,Hoffmann2009,LoopPerforation,Hoffmann2011,Flikker,Memoization,Relax,Axilog,Parrot,Palem2,Sampson2011}, there is a lack of solutions that helps the user to both develop their own approximation methods, and then specifying the approximation level to enforce for a single application. Hardware approximation computes inexactly in return for reduced energy, area, or time \cite{lingamneni2013,Chippa2013}. Approximate multipliers \cite{Zervakis16,Khaing10,Kulkarni11} and adders \cite{Du12, Zhu10} are widely advocated for energy-efficient computing. State-of-the-art neural network training platforms offer 16 bit floating point hardware systems that provide up to 4x performance gain comparing to traditional 32 bit systems \cite{Fleischer2018}. Recent proposals promote putting many different approximate units or customized accelerators on a single core \cite{MultipleFpu}. Thus, it is beneficial to include multiple FPUs on a chip for higher energy efficiency\cite{Palem4} but this requires tedious hand-tuning. Therefore, the challenge is how to figure out which FPU to use in each part of the program. This is the challenge that motivates NEAT. Languages support approximation allowing the specification of variants for key functionality and formal analysis of their effects \cite{ansel2011,bornholt2014,chisel}. Approximation Knobs provide a way to lend performance and energy gains to existing power knobs\cite{Knobs}. Quora is a quality programmable processor where the notion of quality is codified in the instruction set of the processor \cite{PrecisionScaling}. Another example of user-defined approximation is Green, which is a system that allows programmers to supply approximate versions of loops and while-blocks that terminate early \cite{Baek2010}. On the contrary to these programming language techniques, our proposal lets users easily---through our programmable substitution rules---examine and change the accuracy of FLOPs, giving them more control over the floating point computations in a program. Performing precision tuning at fine grain is available through software libraries. EnerJ proposes to declare approximate data via type qualifiers\cite{Sampson2011}. MPFR adds to its arbitrary-precision representation the support for rounding modes, exceptions and special values as defined in the IEEE 754 standard\cite{fousse2007}. FlexFloat reduces floating point emulation time by providing a C/C++ interface for supporting multiple FP formats. These techniques require source code instrumentation (changing $float$ and $double$ variables definition to custom parameters) or intending to yield more precise computation (for instance floating points numbers with more than 128 bits). NEAT focuses on energy efficiency by reducing precision while only requiring the program binary. Convolutional Neural Networks (CNNs) include a significant amount of floating point computation in the training and inference stages. A large body of research has been focused towards CNN precision scaling\cite{sakr2019,Venkataramani2014,Zhang2015,Grigorian2015,Courbariaux2015,Han2016}. For example, WAGE quantizes weights to 2 bits while activation, errors, and gradient are 8 bits respectively\cite{wu2018}. FLEXpoint presents a new format with 16 bits mantissa to train CNNs with full precision\cite{Koster2017}. Another piece of research demonstrates the successful training with 8-16 bits floating point numbers with full accuracy\cite{wang2018}. Other, tangentially related approaches create networks with early exit points \cite{ALERT1,ALERT2}, but those are not related to the problem of changing numerical precision. Prior approaches either change the training architecture or apply a coarse-grain precision level for all layers. Differently, NEAT generates precision tuning analysis at different granularities by offering WP and CIP solutions without modifying the application internal structure or exhaustive precision exploration. While prior work mainly develops \emph{mechanisms} that enable approximation to provide energy and runtime savings at different domains, they do not help users make more informed decisions about approximation. These techniques mostly are not flexible about how much, where, and when to approximate, and only provide discrete approximation knobs which leads to more conservative design choices. NEAT does not propose new mechanisms but helps users answer the questions above. \subsection{Motivation} \label{motivation} Current inexact functional units in addition to approximate software libraries create an opportunity to exploit quality-energy tradeoffs. While an FPU accounts for 2-5\% area on the chip, the floating point instructions consume significantly more energy compared to other classes of instructions such as integer, memory, and control\cite{McKeown18, balkind2016}. Figure \ref{fig:epi_chart} illustrates the energy per instruction (EPI) results for different classes of instructions of 64-bit 32nm processor. With random operands, a 64-bit floating point add consumes 400 pJ, and a division operation could go as high as 680 pJ. For a 32-bit versions, the energy consumption is 350 and 420 pJ respectively. \begin{figure}[t] \centering \includegraphics[width=1\linewidth]{images/epi.png} \caption{Energy Per Instruction for different classes of instructions.} \label{fig:epi_chart} \end{figure} As expected with regards to the type of operations, executing the floating point instructions emerges as a major contributor to the total energy consumption. Recent empirical studies have shown up to 50\% of the energy consumed in a core and memory is related to floating point instructions\cite{McKeown18}. Thus, exploiting reduced bitwidth at instruction level (bit truncation) to generate Floating Point Implementations (FPI) could facilitate higher energy efficiency. Another useful insight from Figure \ref{fig:epi_chart} is the relationship between computation and memory accesses. For example, three \texttt{add} operations consume the same amount of energy as a \texttt{ldx} instruction. Hence, looking from an energy efficiency point of view, reducing the memory traffic could be as efficient as optimizing the floating point arithmetic operations\cite{McKeown18}. A body of literature has focused on providing tool supports that allow users to define several approximations for different components of the application \cite{EnerJ,Relax,Accept,Parrot,Hoffmann2011,Patterns2010,ICSE2010,Hoffmann2009}. Petabricks provides language extensions that expose tradeoffs between time and accuracy to the compiler\cite{ansel2011}. The compiler then runs dynamic autotuning to generate optimized elements to achieve the target accuracy. However, autotuners need to be determined on a per-application basis by the user. OpenTuner provides fully-customizable configuration representation and ensembles of search techniques to find an optimal solution\cite{Ansel2014}. Both autotuning techniques are supposed to help programmers but Petabricks requires a separate language and both require users to implement all alternatives before the search can be conducted. NEAT also helps users deal with approximation, but instead of requiring users to implement all possible alternatives, they simply describe programmable rules that are then used to automatically generate the alternatives. Hence, there is a need for a generic framework that provides multiple precision levels, accommodates custom user-defined floating point implementation, and does not require code refactoring. NEAT provides such a solution. NEAT generates insightful information for precision tuning at function level for floating point programs. \iffalse Prior work has proposed extended floating point type system to enable trans-precision computing on low-power systems. MPFR is a widely used library which provides multi- ple precision arithmetic with a high dynamic range [18]. For lower precision levels, FlexFloat is introduced for dynamic floating point types with less than 32 bits. However, theses techniques are extremely slow and require partial or full code refactoring to accommodate the precision levels. Also, they do not provide helpful insight about what is the best precision level at different parts of the source code. Additionally, they come short to explore replacing floating point arithmetic operations with user-defined implementations. Over the past decade, CNNs have been successful in achieving higher accuracy by employing larger and deeper models - requiring 10s of exa FLOPs and Gigabytes of storage. Precision scaling in proposed to speed up the CNNs without compromising the accuracy\cite{wu2018,wang2018, sakr2019}. Learning with lower precision leads into more efficient bit space and energy utilization. Finding the minimum precision level for a specific layers of network without exhaustive precision search is a key challenge. This section needs some serious restructuring. I think all the text is mostly useable, but I do not see two distinct subsections. It actually feels like the same material stated in two different places. I think it should be changed in the following ways: (1) merge what is here into one section, (2) add an argument about how all of these things are \emph{mechanisms} that enable approximation, but not have ways to help general users make decisions about how and when (etc) to use approximation in their programs. The add a paragraph that talks about Jason Ansel's work on (1) extending petabricks to support approximation and (2) OpenTuner. Talk about how both are supposed to help programmers but the first requires a separate language and both require users to implement all alternatives before the search can be conducted. Then you can say that NEAT is also supposed to help users deal with approximation, but instead of requiring users to implement all possible alternatives, they simply describe rules that are then used to automatically generate the alternatives. \fi \section{Conclusion} In this work, we proposed NEAT, a tool for automated precision tuning of floating point applications. NEAT provides mechanisms for programmers trying to explore the tradeoff space of combinations of approximate floating point implementations without extensive source code refactoring. We evaluate NEAT on various benchmarks with whole-program and per-function placement rules. We found out at the finer granularity, up to 54\% and 74\% energy savings are available in FPU and memory transmissions respectively. We empirically show that NEAT performs robustly on unseen inputs as well. We also perform a case study on a digit recognition CNN programs to find optimal precision level requirements for each layer. \paragraph*{Acknowledgments} This research is supported by NSF(CCF-1439156, CNS-1526304, CCF-1823032, CNS-1764039). Additional support comes from the Proteus project under the DARPA BRASS program and a DOE Early Career award. \section{Experimental Results} \label{evaluation} We evaluate the efficacy and flexibility of NEAT to provide floating point approximation analysis. In general, NEAT generates useful information on precision tuning of applications which can be used at design stage of a software or convoyed to other layers of system such as compilers or hardware (\textit{e.g.} building a set of reduced-precision FPUs). Section \ref{ss:fp_PD} inspects the floating point profiling of NEAT for the applications. The primary challenge of automatic precision tuning is creating approximation configurations. We examine the NEAT's flexibility to produce customized FPI definitions in Sections \ref{ss:fpu_energy_saving} and \ref{ss:mem_insns}. Moreover, the main mechanism of NEAT---programmable placement rules---are investigated in Sections \ref{ss:flex_precision_level} and \ref{ss:func_call_stack}. To navigate through the immense configuration space, NEAT comes with a tunable genetic exploration algorithm which is used in Sections above (from \ref{ss:fp_PD} through \ref{ss:fpu_energy_saving}). Although, to ensure robustness of NEAT on unseen data, we evaluate the difference between predicted accuracy and energy on training and test data to demonstrate that NEAT finds configurations that are robust across different test inputs that were not seen in training \ref{ss:coeff_cov}. Finally in section \ref{ss:nn_integration_eval}, we evaluate NEAT's general applicability to find appropriate reduced precision floating point configurations by evaluating it on a problem that has seen a tremendous amount of attention from human experts recently: trading accuracy for precision in neural network inference. We find that NEAT can use the whole-program rule to automatically find a single floating point precision that is similar to those reported by human experts. Further, we find that by using different floating point implementations for different layers, NEAT produces even greater energy savings for the same accuracy. \subsection{Evaluation platform} \label{ss:eval_platform} We evaluate NEAT by exploring the tradeoff spaces of the placement rules for a variety of benchmarks. Table \ref{tbl:benchmarks} lists the applications from Parsec 3.0 \cite{Bienia2011} and Rodinia 3.1 \cite{Che2009} suites with the configuration space size (default precision optimization target) and training and test inputs for each benchmark. These benchmarks cover domains from finance to image processing. \newcolumntype{E}[1]{>{\hsize=#1\hsize\centering\tiny\arraybackslash}X}% \newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}} \begin{table*}[tb] \centering \caption{Benchmarks Used for Evaluation.} \footnotesize \begin{tabularx}{0.95\textwidth}{|C{0.8}|C{1.1}|C{1.1}|C{1}|} \hline \textbf{Benchmarks } & \textbf{Training inputs} & \textbf{Test inputs} & \textbf{Possible Configuration Space}\\ \hline Blackscholes & 10 lists with 100K initial prices & 30 lists with 100K initial prices & $24^4$ \\ \hline Bodytrack & Sequence of 5 frames & Sequence of 20 frames & $24^{24}$ \\ \hline Fluidanimate & 5 fluids with 15K+ particle & 15 fluids with 15K+ particle & $24^9$ \\ \hline Ferret & 5 databases of 16 images & 15 databases of 16 images & $24^{12}$ \\ \hline Heartwall & Sequence of 15 frames & Sequence of 60 frames & $24^4$ \\ \hline Kmeans & 10 vectors with 512 data points & 30 vectors with 512 data points & $24^9$ \\ \hline Particlefilter & Sequence of 32 frames & Sequence of 128 frames & $53^{10}$ \\ \hline Radar & Sequence of 10 frames & Sequence of 40 frames & $24^{13}$ \\ \hline \end{tabularx} \label{tbl:benchmarks} \end{table*} To create FPIs, we use bit truncation. For the single precision floating point numbers ($float$ type in C), we have 24 different FPIs corresponding to the mantissa bits. Similarly, we created 53 FPIs for the double precision floating point numbers. For the whole-program approach, the size of the tradeoff space is the total number of possible FPIs which are 24 and 53 points. For the per-function approaches, we consider the top 10 functions with most FLOPs to enforce the FP rules, so each of the top 10 functions may use a different FPI. In each experiment, at most 400 configurations in the tradeoff space (less than $6^{-12}$ of all possible configurations) have been evaluated through NEAT's genetic algorithm. \subsection{Floating Point Precision Distribution} \label{ss:fp_PD} NEAT can be used to analyze the type, distribution, and the intensity of the FLOPs in a program. Figure \ref{fig:fpDist} depicts the ratio of single and double precision FLOPs for each benchmark. \begin{figure}[tb] \begin{center} \input{figs/flopsBreakdown.tex} \caption{Floating Point Type Breakdown for Benchmarks. While most benchmarks have a dominant FP type, some carry both.} \label{fig:fpDist} \end{center} \end{figure} Most of the benchmarks hold the same precision level across the source for correctness and portability. For example, \texttt{Bodytrack}, \texttt{Heartwall}, and \texttt{Kmeans} are all implemented with $float$ type while \texttt{Canneal} is mainly using $double$. However, for some benchmarks such as \texttt{Ferret}, \texttt{Particlefilter}, and \texttt{Srad} due to including external libraries, there is a mixture of both precision levels. In this case, users might choose the optimization target to be enforced. Specifying the right target opens up further opportunities for additional energy savings. \subsection{FPU Energy Saving} \label{ss:fpu_energy_saving} NEAT provides the FPU energy estimation consumed by the FLOPs. We compare two rules: whole program (WP) and currently-in-progress (CIP). As a reminder, WP uses one floating point implementation through the entirety of the program, while CIP is free to choose a separate implementation for each of the top 10 functions (by FLOP count) in the program. For \texttt{Particlefilter}, we set the optimization target to double precision as most of the FLOPs are $double$. For the rest of the benchmarks, we apply the single precision optimization. We consider the top 10 FLOP intensive functions for the CIP placement. Although, one might ask how much of the FLOPs are included in the top 10 functions. For all benchmarks, at least 98\% FLOPs were coming from the top 10 functions, thus NEAT covers almost all of the FLOPs in the program. Figure \ref{fig:fpu_energy} illustrates the lower convex hull of normalized FPU energy and the error rate (also referred to as accuracy loss). The error rate metric is the relative error of a configuration comparing against the highest quality configuration (baseline) where no approximation happens. The horizontal axis is the error rate while the Noramlized Energy Consumption (NEC) to the baseline is shown vertically (on the y-axis). The lower the curve is, the more efficient configuration is found which means higher energy efficiency. Since users generally do not care about extremely inaccurate outputs, only error rates less than 20\% is shown in the subfigures. The results show that f we assign multiple FPIs at the function level, NEAT will retrieve more energy efficient configurations that are not explorable if we use single FPI for the whole program. This result further demonstrates NEAT's value in design space exploration. \begin{figure*}[t] \centering \begin{subfigure}{.24\linewidth} \input{figs/LCH_curves/Blackscholes-lch.tex} \label{fig:fpu_energy_Radar} \end{subfigure} \begin{subfigure}{.24\linewidth} \input{figs/LCH_curves/Bodytrack-lch.tex} \label{fig:fpu_energy_Bodytrack} \end{subfigure} \begin{subfigure}{.24\linewidth} \input{figs/LCH_curves/Ferret-lch.tex} \label{fig:fpu_energy_Ferret} \end{subfigure} \begin{subfigure}{.24\linewidth} \input{figs/LCH_curves/Fluidanimate-lch.tex} \label{fig:fpu_energy_Fluidanimate} \end{subfigure} \begin{subfigure}{.24\linewidth} \input{figs/LCH_curves/Heartwall-lch.tex} \label{fig:fpu_energy_Heartwall} \end{subfigure} \begin{subfigure}{.24\linewidth} \input{figs/LCH_curves/Kmeans-lch.tex} \label{fig:fpu_energy_Kmeans} \end{subfigure} \begin{subfigure}{.24\linewidth} \input{figs/LCH_curves/Particlefilter-lch.tex} \label{fig:fpu_energy_Particlefilter} \end{subfigure} \begin{subfigure}{.24\linewidth} \input{figs/LCH_curves/Radar-lch.tex} \label{fig:fpu_energy_Radar} \end{subfigure} \caption{Lower Convex Hulls of FPU energy and Error Rates for the WP and CIP. Values are normalized to the baseline.} \label{fig:fpu_energy} \vspace{-0.5em} \end{figure*} With a minimal error in final output of the benchmark, NEAT reduces the FPU energy up to 60\%. For some applications such as \texttt{Blackscholes}, \texttt{Fluidanimate}, and \texttt{Particlefilter} the FPU energy savings are more considerable. These benchmarks have less than 10 FLOP intensive functions. Therefore first, CIP covers all the FLOPs in the program. Second, since the tradeoff space is relatively smaller, NSGA-II searches a larger portion of the tradeoff space in the same exploration time. For \texttt{Fluidanimate} and \texttt{Ferret} benchmarks, there are only three and two configurations where the WP outperforms the CIP. The reason is that NEAT's genetic algorithm fails to explore those specific configurations as it is a heuristic algorithm. The same pattern can be seen for the \texttt{Radar} benchmark as well where the CIP does not dominate the whole-program approach. The \texttt{Heartwall} benchmark has only two FLOP functions where they are very sensitive to the bit width adjustment and any modification leads to more than 20\% error. Consequently, NEAT is not able to decrease FPU energy to less than 71\% of the baseline with reasonable error rate. The opposite scenario happens for the \texttt{Particlefilter} application where the major FLOP functions do not impact the quality of output considerably, hence NEAT aggressively reduces the FPU energy without causing much error. For a more detailed comparison, we re-illustrate a quantized representation of the previous plot. Figure \ref{fig:fpuEnergyErrorThresholds} displays how the FPU energy savings enhance as the tolerated error threshold increases. Higher bars indicate more energy savings. By harmonic mean, applying the CIP versus WP approach results in 7\%, 12\%, and 13\% more energy savings at 1\%,5\%, and 10\% error rate, respectively. \begin{figure*}[tb] \begin{center} \input{figs/fpuEnergy.tex} \caption{FPU Energy Savings at Different Error Rates, normalized to the baseline. Higher the bars, the more energy efficient is.} \label{fig:fpuEnergyErrorThresholds} \end{center} \end{figure*} The steeper slope in the lower convex hull curves in subplots of Figure \ref{fig:fpu_energy} translates into higher bars in Figure \ref{fig:fpuEnergyErrorThresholds} as the error threshold increases. The \texttt{Blackscholes} and \texttt{Particlefilter} benchmarks demonstrate such behavior. On the contrary, by increasing the error threshold in \texttt{Particlefilter} and \texttt{Radar} applications, the FPU energy savings do not inflate similarly. From these graphs, we draw two conclusions. First, specifying the FPIs placement at a finer granularity results in more efficient FPI to function mappings. In other words, per-function rules use less energy with the same error comparing to use a single FPI for the whole application. This type of insight is really only achievable with the an automated system like NEAT. Second, if higher error rates are allowed, NEAT achieves higher efficiency of FPU energy. Thus, NEAT can navigate the whole tradeoffs space and give users a range of options depending on tolerable error rate. \subsection{Memory Instructions} \label{ss:mem_insns} Main memory (DRAM) consumes as much as half of the total system power in a computer today, due to the increasing demand for memory capacity and bandwidth \cite{Malladi12}. Hence, reducing the memory traffic directly derives into substantial energy savings. NEAT estimates the memory energy with accounting only accesses to/from an off-chip memory by keeping track of memory operations such as MOVSS and MOVSD. Figure \ref{fig:fpMemoryEnergyErrorThresholds} depicts memory accesses energy for a range of error rates for both whole-program (WP) and per-function (CIP) approaches respectively across the benchmarks. Same as before, higher bars indicate higher energy efficiency. Values are normalized to non-approximated version of the application, that acts as a baseline. On harmonic mean, increasing the error rate from 1\% to 10\% results in 3.2-10.5\% less energy consumption. \begin{figure*}[tb] \begin{center} \input{figs/fpMemoryEnergy.tex} \caption{Memory Transfer Energy Savings at Different Error Rates, normalized to the baseline.} \label{fig:fpMemoryEnergyErrorThresholds} \end{center} \end{figure*} If the FLOP functions are memory intensive, reducing the precision bits results in lower memory bandwidth, and consequently more energy savings. That is the reason why benchmarks such as \texttt{Bodytrack}, \texttt{Fluidanimate}, and \texttt{Radar} reduces the memory energy by more than 60\%. In rest of the benchmarks, the FLOP functions were solely compute intensive. To put the experiments above to a conclusion, we illustrate the WP rule as a sample for prior work \cite{wu2018} which tries to find a single most optimal approximation for the whole application. The per-function rules of NEAT show off the ability of the replacement rules to allow programmers to explore a richer set of tradeoffs without having to come up with whole new implementations of existing program functionality. \subsection{Flexible Precision Level} \label{ss:flex_precision_level} In previous sections, we observed some benchmarks have a mixture of both $float$ and $double$ FLOPs. To choose the right optimization target, we compare the energy and accuracy of selected benchmarks in both single and double optimization targets. The FPI to function mapping is CIP in this experiment. \begin{figure}[tb] \begin{center} \input{figs/fpuEnergyDualPrecisionOpt.tex} \caption{FPU Energy Savings with Different Optimization Targets for NEAT.} \label{fig:fpuEnergyDualPrecisionOpt} \end{center} \end{figure} Figure \ref{fig:fpuEnergyDualPrecisionOpt} shows the normalized energy savings for both single and double optimization targets. As expected, if we choose the optimization target to be the same as the FP type which has larger ratio in FLOP distribution, higher energy savings would be achieved. This observation can be easily justified by the looking back at Section \ref{ss:fp_PD}. Both \texttt{Canneal} and \texttt{Particlefilter} contain more 64-bit than 32-bit FLOPs. Thus, double precision as NEAT directive is the right choice to achieve substantially higher energy efficiency. \texttt{Ferret} requires special attention as it is not obvious how to choose the optimization target based on FLOP distribution ratio since it has almost equal amount of $float$ and $double$ FLOPs. At the 10\% error rate, NEAT saves up to 92\% of FPU energy corresponding to $double$ instructions while only 38\% savings is available if we consider only $float$ instructions. There are two reasons for the discrepancy. One is that generally $double$ FLOPs yield more precise output, but they use more precision bits in return. Thus, NEAT has more freedom to cut down unnecessary floating point bits while not losing much accuracy because the $double$ baseline is already more accurate than the $float$ one. Second, the $double$ functions in \texttt{Ferret} are not accuracy sensitive, meaning that enforcing approximation on these functions would not excessively change the quality of the output. This is a great example of how NEAT determines the most efficient configurations for any benchmark regardless of how their floating point precision is specified in the source (or binary). \subsection{Function Call Stack} \label{ss:func_call_stack} As we mentioned in section \ref{exec_flops}, if we map an FPI to a function, depending on the caller, the quality of output could change. While on most benchmarks, CIP and FCS approaches produce the same result, on the \texttt{Radar} they differ. Hence, we examine the impact of the caller of the FFT function on the energy and accuracy of the benchmark. Figure \ref{fig:funcCallStak} illustrates the FPU energy savings normalized to a baseline for CIP and FCS placement rules. FCS was able to explore a handful of more optimal configurations, resulting in 7\% more energy savings at 1\% accuracy loss comparing to CIP without extra runtime overhead. At 5\% and 10\% error rate, the additional energy savings are 4\% and 2\% respectively. \begin{figure}[tb] \begin{center} \input{figs/functionCallStack.tex} \caption{Comparison of CIP and FCS for the FPU Energy Savings in Radar.} \label{fig:funcCallStak} \end{center} \end{figure} \subsection{Sensitivity to Input Changes} \label{ss:coeff_cov} Since we employ a heuristic exploration technique, we ensure that NEAT produces statistically sound results by evaluating each application with multiple inputs divided into training and test sets. We take the median of normalized accuracy loss and FPU energy for each set of inputs, compute a linear least squares fit of training data to test data, and compute the correlation coefficient of each fit. Higher correlation coefficients imply less input sensitivity; i.e. the behavior of configurations found during training data is a good predictor of test behavior. \begin{table}[tb] \centering \caption{Correlation Coefficients for Error Rates and FPU energy.} \footnotesize \begin{tabularx}{0.5\textwidth}{|C{1}|C{1}|C{1}|} \hline \textbf{Benchmark } & \textbf{Error Rates} & \textbf{FPU Energy}\\ \hline Blackscholes & 0.999 & 0.999\\ \hline Bodytrack & 0.958 & 0.989\\ \hline Fluidanimate & 0.995 & 1.0\\ \hline Ferret & 0.973 & 1.0\\ \hline Heartwall & 0.999 & 1.0\\ \hline Kmeans & 0.932 & 1.0\\ \hline Particlefilter & 0.991 & 1.0\\ \hline Radar & 0.992 & 1.0\\ \hline \end{tabularx} \label{tbl:corr_coeff} \end{table} Table \ref{tbl:corr_coeff} show the correlation coefficient (R-values) for accuracy loss and FPU energy for each benchmark. Due to heuristic nature of exploration technique, it might be possible to select configurations that perform differently on unseen data. For instance, \texttt{Kmeans} clearly stresses the difference between training and test inputs. Although, all benchmarks have uniformly high R-values on accuracy loss and FPU energy---at least $0.93$. This demonstrates that NEAT's search techniques are robust and the accuracy and energy results they predict on training inputs hold up well for test inputs. The robustness of the energy results is, perhaps, not surprising as those should be highly predictable (simpler FLOP implementations should predictably lower energy). The robustness of the accuracy results is perhaps more surprising as it not intuitively obvious that floating point implementations that work well for one set of inputs would also work for another set. \subsection{Neural Network Integration} \label{ss:nn_integration_eval} The energy and resource constraints in neural networks creates an intriguing challenge. More recently, a growing body of literature have tried to sacrifice the precision of training and inference for the lower runtime and energy consumption\cite{das2018}. NEAT can be used to identify the FLOP intensive sections of the network and then provide the minimum precision required for the computation without considerable model accuracy reductions. This tradeoff (small accuracy loss for large energy savings) is well known, and we perform this study not to claim a new result here, but to demonstrate that NEAT's automated approach can produce the same types of savings for this problem that have been produced by human domain experts. We also believe that using NEAT's programmable replacement rules to create DNNs with differing precision throughout the network is a new contribution that would (due to the size of the search space) be quite difficult even for human experts. We use a hand-written digit classification with the MNIST dataset which includes 60K images and 10K labels. For the CNN, we consider the LeNet-5 model with the architecture summary listed in Table \ref{tbl:lenet5_arch}. The LeNet-5 architecture consists of two sets of convolutional and average pooling layers, followed by a flattening convolutional layer, then two fully-connected layers and finally a softmax classifier\cite{lecun1999}. \begin{table*}[ht] \centering \caption{LeNet-5 Architecture Summary.} \footnotesize \begin{tabularx}{0.95\textwidth}{C{0.9}|C{1.3}|C{0.9}|C{0.9}|C{1}|C{1}} \multicolumn{2}{c|}{\textbf{Layer}} & \textbf{Feature Map} & \textbf{Size} & \textbf{Kernel Size} & \textbf{Activation}\\ \hline Input & Image & 1 & 32x32 & - & -\\ 1 & Convolutional(1) & 6 & 28x28 & 5x5 & tanh\\ 2 & Average Pooling(1) & 6 & 14x14 & 2x2 & tanh\\ 3 & Convolutional(2) & 16 & 10x10 & 5x5 & tanh\\ 4 & Average Pooling(2) & 16 & 5x5 & 2x2 & tanh\\ 5 & Convolutional(3) & 120 & 1x1 & 5x5 & tanh\\ 6 & Fully Connected & - & 84 & - & tanh\\ Output & Fully Connected & - & 10 & - & softmax\\ \end{tabularx} \label{tbl:lenet5_arch} \end{table*} \newcolumntype{E}[1]{>{\hsize=#1\hsize\centering\tiny\arraybackslash}X}% \newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}} \begin{table*}[h!] \centering \caption{Mantissa Bits For Single Precision FP Recommended by NEAT for Each Layer at Different Error Rates.} \footnotesize \begin{tabularx}{0.95\textwidth}{|C{1}|C{1}|C{1}|C{1}|C{1}|C{1}|C{1}|C{1}|C{1}|} \hline \textbf{Layers / Error Rates } & \textbf{Conv 1} & \textbf{Avg Pool 1} & \textbf{Conv 2} & \textbf{Avg Pool 2} & \textbf{Conv 3} & \textbf{FC} & \textbf{Tanh} & \textbf{Internal Func.} \\ \hline 1 \% & 10 & 23 & 14 & 4 & 19 & 4 & 20 & 17\\ \hline 5 \% & 10 & 5 & 5 & 16 & 13 & 4 & 18 & 15\\ \hline 10 \% & 6 & 16 & 12 & 9 & 13 & 1 & 17 & 11\\ \hline \end{tabularx} \label{tbl:pred_precison_bits} \end{table*} Figure \ref{fig:mnist_flopBreakdown} shows the FLOPs breakdown for CNN training with minibatch size of 4, learning rate of 1, and 30 epochs. We first measured how much of the operations are floating point to determine the applicability of NEAT. For the inference, more than 73\% of operations were FLOPs which makes NEAT absolutely beneficial to apply. Next, we analyze the FLOP distribution between the layers. We observe that more than 69\% of floating point computation happens in the convolutional layers where they extract interesting features in an image. Activation phases and internal compute functions are responsible for the majority of remainder. Finally, we show that the number of FLOPs decreases as we approach the latter layers of the CNN since the size of transferred data between layers reduces as well. \begin{figure}[t] \centering \begin{subfigure}{0.95\linewidth} \includegraphics[width=0.95\textwidth]{images/mnist_flopBreakdown.png} \end{subfigure} \caption{32-bit FLOP breakdown per layer in digit recognition CNN.} \label{fig:mnist_flopBreakdown} \vspace{-1.5em} \end{figure} To apply the FPI to function placement rules for a CNN, there are two options. First, apply one FPI per layer category (we refer to as PLC) meaning that all convolutional layers use the same precision level. The second approach is to apply a different FPI Per Layer Instance (PLI) where in this case the first and third layers might use distinct precision levels, however, they are both convolutional layers. Picking the right FPI placement policy is not trivial for the CNNs. Unlike the WP versus CIP rules where one has significantly larger tradeoff space, the PLC and PLI tradeoff spaces are both large enough that heuristic exploration is required. Thus, any of these rules could outperform the other with the same exploration time. For the PLC, NEAT explores a larger portion of the tradeoff space, leading to locating efficient configurations more quickly. On the other hand, PLI examines FPI mappings at a finer granularity, hence it has a higher chance of discovering more optimal configurations. \begin{figure} \begin{subfigure}[b]{0.53\columnwidth} \fcolorbox{white}{white}{\hspace*{-27pt} \input{figs/LCH_curves/tinyDNN-lch.tex}} \caption{} \label{fig:tinyDNNLCH} \end{subfigure} \begin{subfigure}[b]{0.45\columnwidth} \fcolorbox{white}{white}{\hspace*{-15pt} \input{figs/tinyDNN-barPlot.tex}} \caption{} \label{fig:tinyDNNBarChart} \end{subfigure} \caption{Comparison of PLC and PLC replacements for the CNN. (a) Lower Convex Hull Curves of Energy and Error Rate. (b) Quantized Energy Savings at Different Error Rates.} \label{fig:tinyDNNMNIST} \end{figure} Figure \ref{fig:tinyDNNLCH} illustrates the lower convex hull of normalized FPU energy and accuracy for both approaches. The accuracy loss is the error difference to the baseline configuration without approximation. The baseline recognition accuracy in the inference stage is 99.04\% with a full accurate trained model. Each point in the tradeoff space demonstrates an FPI to layer (category or instance) mapping. Closer points to the origin indicate higher energy efficiency. As can be seen, the lower convex hull of the PLI (finer granularity) outperforms the PLC curve for the error rates of less than 20\%. The quantized representation of FPU energy versus error rates tradeoff space is shown in Figure \ref{fig:tinyDNNBarChart} for both PLC and PLI placements. Similar to previous evaluation, finer granularity results in higher energy efficiency. With 1\%, 5\%, and 10\% accuracy loss, NEAT with PLI placements achieves 6\%, 4\%, and 3\% more energy savings compared to the default configuration. NEAT's programmable placement rules allow developers to analyze various precision levels for different components of their neural network without requiring them to instrument the source code or re-design the architecture. Since the FPIs are based on the bit truncation of mantissa, using the above analysis, NEAT finds the required precision bits for each layer in the LeNet-5 network under accuracy loss constraints. By default, each layer is implemented with single precision floating point numbers (24 mantissa bits) bits. Table \ref{tbl:pred_precison_bits} demonstrates the mantissa bits required for every layer in the network. These precisions could later be integrated with the MPFR library in C \cite{fousse2007} or mpmath library in Python \cite{Johansson2010}. \iffalse Training with low precision reduces latency and compu-tation demand for training as well as memory overhead forweights storage. For simulation, LeNet-5 for MNIST wastrained with the full 32-bit precision, and truncated the fullyconnected layer weights to have 6, 8, 16, and 32 bit widths.We apply fine tuning to make all the bit-width cases havethe recognition accuracy of 0.9629. The proposed compressiontechnique is applied to the weights trained with four differ-ent target bit widths (6, 8, 16, 32). The compression ratioat Sometimes the main developers provide macros for users to define their desired precision level. For benchmarks like \texttt{Blackscholes} and \texttt{Srad}, we evaluated the NEAT with single precision optimization if the macro in the source code of benchmark was set to $float$ and similarly, we employed double precision optimization with definition of $double$ in the source code. Figure XXX shows the FPU energy savings in both cases for a selected benchmarks when running the per-function (CIP) \todo[inline]{Add figure for the fptype benchmarks. Then analyze the plot. BL, FA, HW, SR, SW} \fi \section{System Design} \label{framework} In this section, we describe our solution which generates insightful information about floating point precision tuning for applications. This tool, named Navigating Energy and Accuracy tradeoffs (referred to as NEAT) allows users to collect energy and performance data from applications using custom implementations of floating-point arithmetic. The main challenge of precision tuning is constructing the right configuration of floating point precisions for the application. This configuration space might be extremely large to fairly small, ranging in complexity from using a different floating point implementation for each dynamic floating point instruction, using a different implementation for different function calls, or just picking a single floating point implementation for the entire application. NEAT provides such flexibility in the granularity of enforcing floating point approximations by introducing the programmable placement rules and then automatically searching the accuracy and energy tradeoff space to find the optimal frontier. Figure \ref{fig:design} illustrates the NEAT system from the user perspective. Users specify: (1) the application that they want to understand (this could be just a binary and requires no special changes), (2) whether NEAT should consider double or single precision (or both), a set of alternative implementations for floating-point arithmetic, and (4) the programmable placement rules that describe when, where, and how in the program to replace the standard floating point operations with one of the alternative implementations. NEAT then runs the program as a pin tool and intercepts all floating point operations of the specified type and replacing them according to the rules. NEAT will perform multiple runs of the application, collect statistics on floating point usage, accuracy, and estimated energy. NEAT offers a profiling mode where the user collects precision analysis such as quantity and frequency of FLOPs for the application before applying any FPIs. Ultimately, NEAT can repeatedly test different assignments of floating point operations to find the frontier of optimal configurations; i.e., assignments of floating point operations to different regions of the code. This section describes NEAT's inputs, internals, and outputs. \begin{figure}[t] \centering \includegraphics[width=\linewidth]{images/NEAT_design.png} \caption{NEAT Design} \label{fig:design} \end{figure} \subsection{NEAT Inputs} \label{NEAT_inputs} User inputs of NEAT includes: a user application to instrument, a precision level as the optimization target, the desired FP arithmetic implementations, and a set of FPI to function mappings (programmable placement rules). NEAT receives the binary of the program and instruments the floating point instructions. Unlike other precision tuning tools, NEAT does not require the source code of the program. Then, NEAT expects the optimization target which can be either single or double precision. There are two reasons behind including optimization objective. First, for most of the programs, the same precision level is held across the code base for the data structures and the functions. Second, if we consider both $float$ and $double$ FLOPs to optimize, the configuration space of FPIs combinations would explode excessively. Next, users specify multiple FPIs for any individual arithmetic instruction such as addition, subtraction, multiplication, and division for each operand. At last, NEAT expects a mapping between the candidate code sections and the FPIs to calculate each FLOP in a program. By default, NEAT enforces the FPIs at the function level, meaning all FLOPs executed within a specific function will be using the same customized FPI. Any function that has at least one FLOP can be considered as a candidate for approximation. \subsection{NEAT Internal Structure} \label{internal_structure} The NEAT dynamic instrumentation tool was written in C++ using the Intel Pin instrumentation system \cite{Luk05}. NEAT performs run-time instrumentation to facilitate the analysis and replacement of floating-point arithmetic operations during the execution of compiled C and C++ binaries. \subsubsection{Intel Pin Tool} \label{pintool} The Pin instrumentation system was chosen as the backbone for this tool because of its clean API and efficient implementation. The Pin API makes it possible to write instrumentation routines to observe and alter the architectural state of a process. Pin uses a JIT compiler to generate a new instrumented code that can be executed without the extra runtime overhead from instrumentation. \subsubsection{Floating Point Operations} \label{flops} For the purposes of this tool, we identify floating-point arithmetic operations as the Streaming SIMD Extensions (SSE) instructions for scalar arithmetic. These instructions are included in a SIMD instruction set extension to the x86 architecture and operate on 32-bit or 64-bit floating point numbers. More specifically, the instructions we use for our definition of floating-point operation are ADDSS, SUBSS, MULSS, DIVSS, ADDSD, SUBSD, MULSD, and DIVSD. \subsubsection{Floating Point Arithmetic Implementation} \label{fpi} Custom hardware units or accelerators have been considered for enriching the quality versus energy tradeoff spaces. Approximate adders \cite{Verma08,Zhu10,Du12} and multipliers \cite{Kulkarni11, Khaing10,Zervakis16} have been designed as a solution for lower power consumption and high performance. In the presence of inexact hardware units, NEAT provides information on how to efficiently redirect the arithmetic instructions to these units. The floating point formats with a lower number of bits emerge an appealing opportunity to reduce the energy consumption since it allows simplification of both hardware units and reduction of memory bandwidth required to transfer the data between the memory and registers. The FPI can be as simple as bit truncation in the FP format representation, enforcing direct approximation to the operands or result of arithmetic operations, or redirecting instruction to approximate hardware units or software libraries. \subsubsection{Execution of Floating Point Instructions} \label{exec_flops} Defining an FPI is fairly trivial. The main challenge with enforcing FPI dynamically is the way to specify the exact mapping between FPI and the FLOPs. NEAT allows users to define placement rules that determine which FPI is used to calculate each FLOP in a program. Every time a FLOP is about to be calculated in the user application, NEAT examines all of the mappings and captures information about the current state of the application, and use them to determine which FPI will be applied to calculate the result of the FLOP. \def\tabularxcolumn#1{m{#1}} \newcolumntype{D}[1]{>{\hsize=#1\hsize\centering\bfseries\footnotesize\arraybackslash}X}% \newcolumntype{E}[1]{>{\hsize=#1\hsize\centering\footnotesize\arraybackslash}X}% \newcolumntype{F}[1]{>{\hsize=#1\hsize\centering\tiny\arraybackslash}X}% \begin{table}[tb] \centering \caption{Built-in Placement Rules in NEAT.} \footnotesize \begin{tabularx}{0.45\textwidth}{E{0.7}|E{1.6}|E{0.7}} \textbf{Placement Rule} & \textbf{Description} & \textbf{tradeoff Space Size} \\ \hline WP & one FPI for the whole program & $24 - 53 $\\ CIP & one FPI for the currently in progress function & $24^{10} - 53^{10}$ \\ FCS & one FPI for the most recent function on the call stack & $24^{10} - 53^{10}$ \\ \end{tabularx} \label{Tab:neat_placement_rules} \end{table} NEAT comes packaged with three predefined sets of FPI placements for the applications the cover many use-cases and show off its versatility. Table \ref{Tab:neat_placement_rules} includes the default placement rules and the corresponding tradeoff space size. Sets of rules are specified as C++ routines that accept the program state as input and return a single FPI as output. The first set applies the same FPI for every FLOP in the whole-program (WP) regardless of the current function and the program state. For finer granularity, the user can register callbacks through NEAT that can be executed whenever a function is entered or exited in the instrumented application. This allows more complex information to be collected about the program state, such as the call stack of the application. The second set of placement rules allows the user to specify a map of function names to FPIs and employs each FPI for the FLOPs in the corresponding currently in progress (CIP) function. Similarly, the third set of placement rules uses callbacks registered with NEAT to keep track of the function call stack (FCS) of the program. Instead of inspecting the current function, NEAT first checks the most recent function on the call stack. If no functions in the call stack match the names of those in the user-supplied map, a default implementation is used. To highlight the difference between CIP and FCS, we analyzed the structure of 7 functions in a benchmark shown in Figure \ref{fig:radar_design}. The \texttt{radar} is an embedded real-time signal processing application that is used to find moving targets on the ground \cite{Lebak05,Hoffmann2012}. It includes both a low-pass filter (LPF) and pulse compression (PC). Both of these components use a Fast Fourier Transform (FFT) as a part of their computation. \begin{figure}[t] \centering \includegraphics[width=0.75\linewidth]{images/radar_design.png} \caption{FCS placement considers FFT function call stack before selecting the approximate FPI.} \label{fig:radar_design} \end{figure} With the CIP option, NEAT enforces the same FPI every time the FFT function is called. For the FCS option, NEAT distinguishes between the two occurrences of FFT based on who has made the function call. Therefore, NEAT uses one FPI for the FFT in the Low Pass Filter (LPF) stage and a second FPI for the FFT in the Process Pulse (PC) stage. Empirically, we have found the results of FCS and CIP for most of the benchmarks do not differ as the callers of a FLOP intensive functions are the same. The \texttt{radar} is an example where multiple functions make numerous calls to the same FLOP-intensive function that is accuracy sensitive. \subsection{Outputs} \label{NEAT_outputs} There are five outputs from this tool: the output from the user application, a trace of the operands and result of every FLOP executed by the program, the estimated FPU energy of FLOPs in the execution of the program, the estimated energy of off-chip memory accesses of the program, and the number of FLOPs executed per function in the program. The trace of the FLOPs executed by the instrumented application is written to a file while the application is running. If FPIs are supplied to NEAT by the user, the result of each operation will be printed after the operation is calculated with the chosen FPI. The operands and result of each operation are printed as hexadecimal numbers so that there is no confusion in rounding the floating-point values. NEAT reports total energy consumed in FPU by using energy per instruction (EPI) of different classes floating-point operations. We extracted the energy model of $fadd$, $fmul$ and $fdiv$ for single and double precision operations provided in related work \cite{McKeown18}. To this end, NEAT counts the number of bits manipulated in the operands and results of every FLOP in the instrumented program. Modifying the bit width in the exponent and sign of a floating-point number changes the accuracy significantly where the quality of output becomes unacceptable. Hence, NEAT only focuses on mantissa bits. NEAT counts the number of zeroes in the binary representation of the floating-point number, starting with the least significant bit, and then subtracts it from available mantissa bits in the floating type (24/53 bits in single/double precision respectively) to calculate the number of manipulated bits. NEAT uses the EPI models and the number of manipulated bits per FLOP to estimate the total floating-point energy consumed in the FPU. NEAT also records the total number of bits used in FLOPs in the execution of the program is output to a file after the termination of the application. Unlike the FPU energy estimation, this metric can be used as a platform-independent way to evaluate the approximate amount of power used by FLOPs when instrumenting a program. Currently, the memory accounts for more than 25\% of energy spent in a large scale system. While on average, each single precision FLOP takes 400 pJ to execute, a byte read from memory consumes 1.5 nJ \cite{Borkar11}. Accordingly, NEAT counts the total number of bits transmitted to/from memory and then estimates the total memory access energy of the instrumented program \cite{Malladi12}. This allows NEAT to yield a better energy estimation of the program in a real system. NEAT generates in-detail statistics about the floating point instructions in the program. Users might operate NEAT to profile the application before performing precision tuning to first, decide whether NEAT is useful to their application and second, what type of FPIs, which functions, and how to map them. In general, NEAT is a tool used at program design time. NEAT allows users to evaluate many points on the accuracy/energy tradeoff curve without having to implement all possible alternatives. After profiling with NEAT, users can then select a point and implement it with confidence that it will provide the desired behavior. Future work would explore additional machione learning techniques to configure the floating point usage differently for different functions in the program \cite{ding2019,ESP,LEO,Imes2018}. Another promising line of work is using a runtime system to dynamically tune floating point usage to maintain either energy or accracy constraints in a changing workload \cite{Copper,caloree,POET,FSE2015,FSE2017,coadapt,Meantime,TAAS2017,ASPLOS2018,bard,proteus}, or possibly implementing this control scheme in hardware \cite{Grape,CASH,MERLOT}. \section{NEAT Interface and Runtime} \label{user_procedure} We explain how the user can manage floating point precision scaling with the NEAT framework explained in the previous section. We specify the information that NEAT expects to receive from the users and then, discuss steps to execute the runtime engine of NEAT. The NEAT procedure follows as: 1. \textbf{Profile the Program}: User runs the application. NEAT records the single and double precision instructions and the functions associated with them, and generates the detailed report in csv format. 2. \textbf{Assign FP Optimization Target}: Since the applications usually use the same precision level across the source code, NEAT enhances either single or double precision instructions at the same time. At this point, the user defines the directive for NEAT to target 32 or 64 bit FLOPs. 3. \textbf{Develop FPIs}: Users might define multiple FPIs to be explored by NEAT. NEAT supports FPIs developed in a number of different ways. An FPI can be created by truncating mantissa bits of the FLOP representation or injecting direct approximation to the operands or results of floating point arithmetic operations. For example, approximating the inverse function \cite{Zhang2014} or $sin$ function using a neural network\cite{Eldridge2014} is considered an FPI, too. The FPI can be applied to one or more floating point arithmetic instruction. For instance, one benchmark might include numerous accumulations but few divisions. Thus, the user defines an FPI with enforcing 8 precision bits for the add/sub arithmetic instructions and 24 precision bits for the multiply instructions. The user develops an FPI by creating an instance of the $FpImplementation$ virtual class. Furthermore, user might customize the subroutine of $PerformOperation$ to modify the operands or results of a floating point instruction directly. 4. \textbf{Register FPI Placement Rules and Functions}: NEAT expects to receive a mapping between FPIs and when to enforce them. For the WP approach, the user only needs to instantiate $Register\_FP\_selector$ class with the desired FPI as the argument. For the per-function rules, NEAT by default considers the top 10 FLOP intensive functions. The user might pre-profile the program to detect and select any number of functions. The user then should provide a mapping between functions and FPIs by defining a $pair <functionName , FPI* >$ map data structure. Next, the user should combine the map with one of the pre-packaged placement rules (CIP or FCS). This mapping is also referred as a \textit{configuration}. Finally, the user creates an instance of $Register\_FP\_selector$ class and passes the map and placement strategy as the input arguments. At the runtime, the user passes the registered instance name via \texttt{fp\_selector\_name} command line flag to NEAT. This interface is simple, but provides a quite flexible approach to replacing standard floating point operations with the approximate version. For example, the user can provide several maps and then their instantiation of the selector class can look at the current program context to select the desired map. This allows NEAT to explore many different options for a single function within a program. For example, users can specify that the map should depend on the function call stack so that different FP implementations will be used for the same function based on where it was called from. 5. \textbf{Activate Exploration Scripts}: If CIP or FCS schema is selected, the tradeoff space of FPI to function mappings (configurations) becomes too huge to explore exhaustively. Hence, NEAT uses the NSGA-II genetic exploration technique to search for energy efficient configurations \cite{NSGA-II}. If the user desires to enhance the exploration phase of the configuration space further, NEAT provides an interface through the command line flags to manually modify the tuning parameters of NSGA-II such as population size, number of generations, or convergence threshold. 6. \textbf{Analyze the Output}: NEAT reports detailed energy and performance data per configuration. Moreover, a python script is provided to generate scatter plots of tradeoff space with the lower convex hulls. At the completion of these steps, the user finds information about the most appropriate precision level for each individual function or the whole program. \section{Introduction} Early work in approximate computing demonstrates the tremendous energy and execution time reductions by making a variety of arithmetic and logic functional units available \cite{earlywork,CMOS,Palem4,DisciplinedProgramming}. Reduced-precision methods advocate less numerical precision for the data storage and computation to achieve higher performance and energy efficiency \cite{PrecisionScaling, wang2018, das2018,sakr2019}. The proliferation of both different approximate functional units and reduced-precision software methods creates tremendous opportunity, but it also creates a new problem. While designing for reduced precision has long been common in specialized application domains---for example, digital signal processing \cite{Boutros2018}---the proliferation of these techniques means that general programmers will now have to consider the implications of such designs. Specifically, it is up to programmers decide which level of approximation to use at different points in their application and navigate through this immense tradeoff space enacted by allowing multiple approximations within a single program. Consider 10 different levels of approximation available to be enforced at the function level for a moderate-sized program with 10 functions. Programmers attempting to design for energy efficiency and accuracy in this scenario face two separate, but related, challenges. First, is the challenge of correctly (in terms of achieved accuracy) implementing 10 different versions of each candidate function (one version for each available level of precision). Second is the challenge of searching the resulting tradeoff space with ${10}^{10}$ points to explore. The tradeoff space could be even larger if we exploit data type approximation where each variable in the program could acquire a different level of approximation\cite{fousse2007, Sampson2011, bornholt2014, tagliavini2018}. Constructing a large number of alternative implementations and then navigating such an immense tradeoff space is likely beyond the abilities of even domain experts. Thus, we need an automated precision tuning framework that can both generate alternative implementations and then explore the induced tradeoff space. In this paper, we propose one mechanism that helps address both of the above challenges: \emph{programmable placement rules for approximate floating point computation}. We argue that asking programmers to implement $N$ different versions of key functions is unnecessarily burdensome and generating all possible approximations of each function will make the search space prohibitively large. The programmable rules are a compromise, where programmers can encode their knowledge of the application into concise rules about which functions can be approximated, by how much, and when it might be permissible to do so. These rules can then be used by an automated tool to generate a candidate set of approximate function implementations which is much smaller than the set of all possible approximations. To address the challenges of creating and selecting from a large number of approximation alternatives, we propose NEAT---Navigating Energy Approximation tradeoffs---a tool that helps users explore different levels of approximation within a program without detailed instrumentation and without laboriously creating many alternative implementations of functions. NEAT accepts a user program, a set of approximate floating point implementations, and a set of programmable placement rules for when to use a specific implementation within a program. NEAT then runs the program and dynamically replaces floating point operations (FLOPs) with the approximate version as specified by the rules. NEAT reports the program's output with the estimation of floating point unit (FPU) and memory access energy alongside an itemized report of FLOPs in the program. Thus, NEAT helps developers explore the configuration space of floating point implementations (FPI) without requiring them to have deep numerical expertise. We implement NEAT for x86 using the Pin binary instrumentation system \cite{Luk05}. We demonstrate NEAT's value by comparing the approximations produced by different placement rule sets. In the first, we write a simple rule that picks a single floating point implementation for the entire program; \textit{i}.\textit{e}.{} the rule is a simple one-to-one replacement (whole-program rule) common to many proposed approximation methods; e.g., those that use a single, reduced precision for machine learning \cite{Du2014} or scientific simulation \cite{Palem4}. In the second, we allow the top 10 executed functions with the most FLOPs to each use a different approximation (per-function rules). Either we use the currently-in-progress function (CIP) or the most recent function on the call stack (FCS) as the target to apply the approximate floating point implementation. For all rules, NEAT uses a genetic algorithm to guide exploration of the enormous resulting search space. We evaluate NEAT on a selected set of benchmarks from Parsec 3.0\cite{Bienia2011} and Rodinia 3.1\cite{Che2009} suites which covers a variety of real-world applications. For the FPIs, we applied mantissa bitwidth tuning. On average, the per-function placement retrieves more energy-optimal floating point implementations than the whole-program approach, providing 22.1\% and 3.2\% energy savings in FPU and memory respectively with an allowance of 1\% accuracy loss. To ensure the robustness of NEAT, we include multiple inputs for each application which are divided into training and test sets to evaluate whether NEAT produces statistically sound results. We also extend the evaluation by including a digit recognition application that is implemented with a neural network and MNIST dataset. For any accuracy target, NEAT provides the required precision level for each layer. NEAT is also released as opensource, so others could evaluate or use it freely. In summary, this paper proposes: \begin{itemize} \item The NEAT framework that helps users explore the tradeoff space of reduced precision floating point combinations while not requiring hand tuning or code instrumentation. \item A case study that compares whole-program vs. per-function approximation placements for a variety of benchmarks. Also, NEAT offers a separated placement solution based on the caller function, useful for the high frequency invoked functions. \item Robustness on unseen inputs with a high correlation coefficient. NEAT finds statistically meaningful approximations that are not sensitive to input data and are more likely to be efficient on an unseen set of inputs. \item A demonstration of NEAT's applicability to Convolutional Neural Networks (CNN), providing precision computation modes per layer resulting in energy savings with minimal loss of model accuracy. \end{itemize} \section{Appendix} \bibliographystyle{IEEEtranS}
\section{Introduction} \footnote{\DIFaddbegin \DIFadd{TODO }\DIFaddend Scientific thoughts and contributions welcome \DIFaddbegin \DIFadd{from the GZ Team}} \DIFadd{Morphology is a key driver of galaxy evolution}\DIFaddend . For example, bars are thought to move gas inwards \citep{Sakamoto1999} driving star formation \citep{Sheth2004, Jogee2005}\DIFdelbegin \DIFdel{. Bulges are strongly linked to central }\DIFdelend \DIFaddbegin \DIFadd{, and bulges are linked to global quenching \mbox \citep{Masters2011} }\hspace{0pt and inside-out }\DIFaddend quenching \citep{Spindler2017,Lin2019}. \DIFaddbegin \DIFadd{Morphology also traces other key drivers, such as the merger history of a galaxy. }\DIFaddend Mergers support galaxy assembly \citep{Wang2011, Martin2017}, though their relative contribution is an open question \citep{Casteels2014}, and may create tidal features, bulges, and disks\DIFaddbegin \DIFadd{, allowing past mergers to be measured }\DIFaddend \citep{Hopkins2010, Fontanot2011, Brooks2015}. Unpicking the complex interplay between morphology and galaxy evolution requires measurements of detailed morphology \DIFdelbegin \DIFdel{at scale}\DIFdelend \DIFaddbegin \DIFadd{in large samples}\DIFaddend . While modern surveys reveal exquisite morphological detail, they image far more galaxies than scientists can visually classify. Galaxy Zoo solves this problem by asking members of the public to volunteer as `citizen scientists' and provide classifications through a web interface. \DIFdelbegin \DIFdel{We (the Galaxy Zoo collaboration) provide }\DIFdelend \DIFaddbegin \DIFadd{Galaxy Zoo has provided }\DIFaddend morphology measurements for surveys including SDSS \citep{Lintott2008, Willett2013} and \DIFdelbegin \DIFdel{HST \mbox \citep{Simmons2017, Willett2017a}}\hspace{0pt . }\DIFdelend \DIFaddbegin \DIFadd{large HST programs \mbox \citep{Simmons2017, Willett2017a}}\hspace{0pt . }\DIFaddend Knowing the morphology of homogeneous samples of hundreds of thousands of galaxies supports science only possible at scale. \DIFaddbegin \DIFadd{The catalogues produced by the collective effort of Galaxy Zoo volunteers have been used as the foundation of a large number of studies of galaxy morphology, with the method's ability to provide estimates of confidence alongside classification especially valuable. }\DIFaddend Galaxy Zoo measures subtle effects in large populations \citep{Masters2010, Willett2015, Hart2017}; identifies unusual populations that challenge standard physics \DIFdelbegin \DIFdel{\mbox \citep{Simmons2013}}\hspace{0pt }\DIFdelend \DIFaddbegin \DIFadd{\mbox \citep{Simmons2013,Tojeiro2013,Kruk2017}}\hspace{0pt }\DIFaddend ; and finds individually interesting objects that \DIFdelbegin \DIFdel{probe new physics }\DIFdelend \DIFaddbegin \DIFadd{provide unique data on broader galaxy evolution questions }\DIFaddend \citep{Lintott2009}. Here, we present the first volunteer classifications of galaxy images collected by the Dark Energy Camera Legacy Survey (DECaLS, \citealt{Dey2018}). \DIFdelbegin \DIFdelend \DIFaddbegin \DIFadd{This work represents the first systematic engagement of volunteers with low-redshift images as deep as those provided by DECaLS, and thus represents a more reliable catalogueue of detailed morphology than has hitherto been available. }\DIFaddend Our volunteer classifications were sourced over three separate Galaxy Zoo \DIFaddbegin \DIFadd{DECaLS (GZD) }\DIFaddend classification campaigns, \DIFdelbegin \DIFdel{GZD-A, GZD-B, and GZD-C}\DIFdelend \DIFaddbegin \DIFadd{GZD-1, GZD-2, and GZD-5}\DIFaddend , which classified galaxies first released in DECaLS Data Releases 1, 2, and 5 respectively. The \DIFdelbegin \DIFdel{primary difference is that GZD-C }\DIFdelend \DIFaddbegin \DIFadd{key practical differences are that GZD-5 }\DIFaddend uses an improved decision tree aimed at better identification of mergers and weak bars\DIFaddbegin \DIFadd{, and includes galaxies with just 5 total votes as well as galaxies with 40 or more. We collect approximately }{\notebds \DIFadd{TODO}} \DIFadd{million responses from Galaxy Zoo volunteers, recording 40 or more classifications for }{\notebds \DIFadd{TODO}} \DIFadd{galaxies and 5 or more for an additional }{\notebds \DIFadd{TODO}} \DIFadd{galaxies}\DIFaddend . For the first time \DIFaddbegin \DIFadd{in a Galaxy Zoo data release}\DIFaddend , we also provide automated classifications made using Bayesian deep learning \DIFdelbegin \DIFdel{. Our classifier predicts posteriors for how the crowd would have described each galaxy. We provide posteriors for all decision tree questions}\footnote{\DIFdel{Excluding the final `Is there anything odd?' question as it is multiple-choice} \addtocounter{footnote}{-1 \DIFdel{. Our classifier is as accurate as asking 5-15 volunteers, depending on the question}\DIFdelend \DIFaddbegin \DIFadd{\mbox \citep{Walmsley2020GalaxyLearning}}\hspace{0pt }\DIFaddend . By using \DIFdelbegin \DIFdel{Bayesian }\DIFdelend deep learning to scale our crowd, we can \DIFdelbegin \DIFdel{provide detailed classifications for an additional }\DIFdelend \DIFaddbegin \DIFadd{make detailed classification for all }\DIFaddend {\notebds TODO} galaxies \DIFdelbegin \DIFdel{not feasible to classify }\DIFdelend \DIFaddbegin \DIFadd{in our target sample, which is not feasible }\DIFaddend using volunteers alone. \DIFaddbegin \DIFadd{Bayesian deep learning allows us to learn from uncertain volunteer responses and to estimate the uncertainty of our predictions. Our classifier predicts posteriors for how volunteers would have answered all decision tree questions}\footnote{\DIFadd{Excluding the final `Is there anything odd?' question as it is multiple-choice}}\DIFadd{, with an accuracy comparable to asking 5 to 15 volunteers, depending on the question. }\DIFaddend In Section \ref{imaging}, we describe the observations used and the creation of RGB images suitable for classification. In Section \ref{volunteer_classifications}, we give an overview of the volunteer classification process and detail the new decision trees used. In Section \ref{sec:volunteer_analysis}, we investigate the effects of improved imaging and improved decision trees, and we compare our results to other morphological measurements. Then, in Section \ref{sec:automated}, we describe the design and performance of our automated classifier - an ensemble of Bayesian convolutional neural networks. Finally, in Section \ref{sec:usage}, we provide guidance (and \DIFdelbegin \DIFdel{code samples}\DIFdelend \DIFaddbegin \DIFadd{example code}\DIFaddend ) for effective use of the classifications. \section{Imaging} \label{imaging} \subsection{Observations} Our galaxy images are created from data collected by the DECaLS survey \citep{Dey2018}. DECaLS uses the Dark Energy Camera (DECam, \citealt{Flaugher2015}) at the 4m Blanco telescope at Cerro Tololo Inter-American Observatory, near La Serena, Chile. DECam has a roughly hexagonal $3.2 \deg^2$ field of view with a pixel scale of 0.262 arcsec$^2$ per pixel. The median \DIFaddbegin \DIFadd{point spread function }\DIFaddend FWHM is 1.29, 1.18 and 1.11 for $g$, $r$, and $z$, respectively\DIFdelbegin \footnote{\DIFdel{In Data Release 5, from which the images uploaded to Galaxy Zoo were generated.} \addtocounter{footnote}{-1 \DIFdelend . The DECaLS survey contributes targeting images for the upcoming spectroscopic galaxy survey DESI. DECaLS is responsible for the DESI footprint in the Southern Galactic Cap (SGC) and the $\delta \leq 34$ region of the Northern Galactic Cap (NGC), totalling 10,480 deg$^2$\footnote{The remaining DESI footprint is being imaged by DECaLS' companion surveys, MzLS and BASS \DIFdelbegin \DIFdel{\mbox \cite{Dey2018}}\hspace{0pt }\DIFdelend \DIFaddbegin \DIFadd{\mbox \citep{Dey2018}}\hspace{0pt }\DIFaddend }. 1130 deg$^2$ of the SGC DESI footprint are already being imaged by DECam through the Dark Energy Survey (DES, \citealt{TheDarkEnergySurveyCollaboration2005}) so DECaLS does not repeat this part of the DESI footprint. \DIFdelbegin \DIFdel{DESI requires imaging capable of $5\sigma$ detections of a reference $g=24$, $r=23$, $z=22.5$ AB mag galaxy with an exponential light profile of half-light radius $r_\text{half}=0.45$ arcsec. DESI also requires that depth be as uniform as possible across the survey. To meet these requirements, }\DIFdelend DECaLS implements a 3-pass strategy to tile the sky. Each pass is slightly offset (approx 0.1-0.6 $\deg$). The choice of pass and exposure time for each observation is optimised in real time based on the observing conditions recorded for the previous targets, as well as the interstellar dust reddening, sky position, and estimated observing conditions of possible next targets. This allows a near-uniform depth across the survey. \DIFaddbegin \DIFadd{In DECaLS DR1, DR2, and DR5, from which our images are drawn, the median $5\sigma$ point source depths for areas with 3 observations was approximately (AB) $g$=24.65, $r$=23.61, and $z$=22.84}\footnote{\DIFadd{See https://www.legacysurvey.org/dr5/description/ and related pages}}\DIFadd{. }\DIFaddend The DECaLS survey completed observations in March 2019. \subsection{Selection} \label{sec:selection} We identify galaxies in the DECaLS imaging using the NASA-Sloan Atlas v1.0.0 (NSA). \DIFaddbegin \DIFadd{NSA v1.0.0 was not published but the columns used here are identical to those in NSA v1.0.1, released in SDSS DR13 \mbox \citep{Albareti2017}}\hspace{0pt . }\DIFaddend As the NSA was \DIFdelbegin \DIFdel{itself }\DIFdelend derived from SDSS \DIFdelbegin \DIFdel{DR11 imaging }\DIFdelend \DIFaddbegin \DIFadd{DR8 imaging \mbox \citep{Aihara2011}}\hspace{0pt }\DIFaddend , this data release only includes galaxies which are within both the DECaLS and SDSS \DIFdelbegin \DIFdel{DR11 footprint, and which are above the SDSS spectroscopic target selection limit of $M_r=17.77$}\DIFdelend \DIFaddbegin \DIFadd{DR8 footprint}\DIFaddend . In effect, we are using deeper DECaLS imaging of the galaxies previously \DIFdelbegin \DIFdel{cataloged in SDSS DR11}\DIFdelend \DIFaddbegin \DIFadd{imaged in SDSS DR8}\DIFaddend . Figure \ref{fig:footprints} shows the resulting GZ DECaLS sky coverage. \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/gz2_decals_coverage.png} \caption{Sky coverage of GZ DECaLS (equatorial coordinates), \DIFaddbeginFL \DIFaddFL{resulting from the imaging overlap of DECaLS DR5 and SDSS DR8, }\DIFaddendFL shown in red. Darker areas indicate more galaxies. \DIFdelbeginFL \DIFdelFL{Overlaid sky }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{Sky }\DIFaddendFL coverage of \DIFdelbeginFL \DIFdelFL{GZ2}\DIFdelendFL \DIFaddbeginFL \DIFaddFL{Galaxy Zoo 2, which used images sourced from SDSS DR7}\DIFaddendFL , shown in light blue. \DIFaddbeginFL \DIFaddFL{The NSA includes galaxies imaged by SDSS DR8, including galaxies newly imaged at the Southern Galactic Cap (approx. $2500\deg^2$)}\DIFaddendFL } \label{fig:footprints} \end{figure} \DIFaddbegin \DIFadd{We chose to use the NSA as our base catalogue because it includes useful ancillary data from SDSS spectroscopy and it covers the nearby bright and extended galaxies most appropriate for detailed morphology measurements. Specifically, our use of the NSA introduces two implicit cuts. First, the NSA only includes galaxies above $m_r=17.77$, the SDSS spectroscopic target selection limit. Second, the NSA only covers redshifts of $z=0.15$ or below. To these implicit cuts, we add an explicit cut requiring Petrosian radius (}\texttt{\DIFadd{PETROTHETA}}\DIFadd{) of at least 3 arcseconds, to ensure the galaxy is sufficiently extended for meaningful classification. }\DIFaddend If the coordinates of each galaxy had been imaged in g, r and z, \DIFaddbegin \DIFadd{and the galaxy passed the selection cuts above, }\DIFaddend we acquired a combined FITS cutout of the grz bands from the DECaLS cutout service (www.legacysurvey.org). \DIFdelbegin \DIFdel{GZD-A and GZD-B }\DIFdelend \DIFaddbegin \DIFadd{Galaxy Zoo presents volunteers with 424 pixel galaxy images. GZD-1 and GZD-2 }\DIFaddend acquired 424 pixel \DIFaddbegin \DIFadd{FITS }\DIFaddend cutouts directly from the cutout service. To ensure that galaxies typically fit well within a 424 pixel image, cutouts were downloaded with \DIFdelbegin \DIFdel{a }\DIFdelend \DIFaddbegin \DIFadd{an interpolated }\DIFaddend pixel scale $s$ of \begin{equation} s = \max(\min(p_{50} * 0.04, p_{90}*0.02), 0.1) \end{equation} where $p_{50}$ is the Petrosian 50\%-light radius and $p_{90}$ is the Petrosian 90\%-light radius. For \DIFdelbegin \DIFdel{GZD-C}\DIFdelend \DIFaddbegin \DIFadd{GZD-5}\DIFaddend , to avoiding banding artifacts caused by the \DIFdelbegin \DIFdel{use of nearest neighbour interpolation by }\DIFdelend \DIFaddbegin \DIFadd{interpolation method of }\DIFaddend the DECaLS cutout service, each FITS image was downloaded at the \DIFaddbegin \DIFadd{fixed }\DIFaddend native telescope resolution of 0.262 arcsec$^2$ per pixel\DIFdelbegin \DIFdel{(to a maximum of 0.1” pixel $^-1$ for highly extended sources) and resized locally }\DIFdelend \DIFaddbegin \footnote{\DIFadd{Up to a maximum of 512 pixels per side. Highly extended galaxies were downloaded at reduced resolution such that the FITS had exactly 512 pixels per side.}}\DIFadd{, with enough pixels to cover the same area as 424 pixels at the interpolated pixel scale $s$. These individually-sized FITS were then resized locally up to the interpolated pixel scale $s$ }\DIFaddend by Lanczos interpolation \citep{Lanczos1938}. Image processing is otherwise identical between campaigns. Galaxies with incomplete imaging, defined as more than 20\% missing \DIFdelbegin \DIFdel{flux }\DIFdelend \DIFaddbegin \DIFadd{pixels }\DIFaddend in any band, were discarded. \DIFdelbegin \footnote{\DIFdel{Important TODO - apply this cut to DR1/2 post-hoc. DR1/2 used 20\% over all bands}} \addtocounter{footnote}{-1 \DIFdel{GZD-A included all galaxies with complete imaging . GZD-B and GZD-C included only galaxies with a Petrosian radius (}\texttt{\DIFdel{PETROTHETA}} \DIFdel{of at least 3 arcseconds. For consistency, we apply the }\texttt{\DIFdel{PETROTHETA}} \DIFdel{> 3 cut to GZD-A post-hoc. }\DIFdelend \DIFaddbegin \DIFadd{For GZD-1/2, 92,960 of 101,252 galaxies had complete imaging (91.8\%). For GZD-5, 216,106 of 247,746 galaxies not in DECaLS DR1/2 had complete imaging (87.2\%). }{\notebds \DIFadd{TODO - the GZD-5 count needs a check against the final classifications, to make sure we have in fact classified all 216k}} \DIFaddend \subsection{RGB Image Construction} \DIFdelbegin \DIFdelend We convert the measured \textit{grz} fluxes into RGB images. To use the \textit{grz} bands as RGB colors\DIFdelbegin \DIFdel{of typically similar intensity}\DIFdelend , we multiply the flux values in each band by 125.0, 71.43, and 52.63, respectively. \DIFaddbegin \DIFadd{These numbers are chosen by eye such that typical subjects show an appropriate range of color once mapped to RGB channels. }\DIFaddend For background pixels with \DIFdelbegin \DIFdel{signal-to-noise}\DIFdelend \DIFaddbegin \DIFadd{very low flux, and therefore high variance in the proportion of flux per band}\DIFaddend , naively colouring by the measured flux creates a speckled effect \DIFdelbegin \DIFdel{caused by high relative variance in flux \mbox \citep{Willett2017a}}\hspace{0pt . }\DIFdelend \DIFaddbegin \DIFadd{\mbox \citep{Willett2017a}}\hspace{0pt . As an extreme example, a pixel with 1 photon in the $g$ band and no photons in $r$ or $z$ would be rendered entirely red. }\DIFaddend To remove these colourful speckles, we desaturate pixels with \DIFdelbegin \DIFdel{low signal-to-noise}\DIFdelend \DIFaddbegin \DIFadd{very low flux}\DIFaddend . We first \DIFdelbegin \DIFdel{calculate the }\DIFdelend \DIFaddbegin \DIFadd{estimate the total }\DIFaddend per-pixel \DIFdelbegin \DIFdel{standard error on the mean photon count }\DIFdelend \DIFaddbegin \DIFadd{photon count $N$ }\DIFaddend assuming an exposure time of 90 seconds per band and a mean photon frequency of 600nm. \DIFaddbegin \DIFadd{Poisson statistics imply the standard deviation on the total mean flux in that pixel is proportional to $\sqrt{N}$. }\DIFaddend For pixels with a standard \DIFdelbegin \DIFdel{error }\DIFdelend \DIFaddbegin \DIFadd{deviation }\DIFaddend below 100, we \DIFdelbegin \DIFdel{multiply the }\DIFdelend \DIFaddbegin \DIFadd{scale the per-band }\DIFaddend deviation from the mean \DIFdelbegin \DIFdel{pixel value }\DIFdelend \DIFaddbegin \DIFadd{per-pixel flux }\DIFaddend by a factor of 1\% of the standard \DIFdelbegin \DIFdel{error, reducing the saturation . }\DIFdelend \DIFaddbegin \DIFadd{deviation. The effect is to reduce the saturation of low-flux pixels in proportion to the standard deviation of the total flux. Mathematically, we set } \begin{equation} \DIFadd{X^{\prime}_{ijc} = \overline{X_{ij}} + \alpha X_{ijc} \quad \text{where} \quad \alpha = \min(0.01 \sqrt{\overline{X_{ij}}T / \lambda}, 1) \quad }\end{equation} \DIFadd{where $X_{ijc}$ and $X^{\prime}_{ijc}$ are the flux at pixel $ij$ in channel $c$ before and after desaturation, $\overline{X_{ij}}$ is the mean flux across bands at pixel $ij$, $T$ is the mean exposure time (here, 90 seconds) and $\lambda$ is the mean photon wavelength (here, 600nm). }\DIFaddend Pixel values were scaled by $\text{sinh}^{-1}(x)$ to compensate for the high dynamic range typically found in galaxy flux, creating images which can show both bright cores and faint outer features. To remove the very brightest and darkest pixels, we linearly rescale the pixel values to lie on the (-0.5, 300) interval and then clip the pixel values to 0 and 255 respectively. We use these final values to create an RGB image using \texttt{pillow} \citep{Kemenade2020Python-pillow/Pillow7.1.2}. The \DIFdelbegin \DIFdel{code used to download the FITS cutouts and convert them to RGB imagesis available on Github for \DIFdel{, \DIFdel{and \DIFdel{. We also provide the images used...TODO}\footnote{\DIFdel{Chris is talking with the Bod about this}} \addtocounter{footnote}{-1 \DIFdelend \DIFaddbegin \DIFadd{images, and the code used to create them, are available on Zenodo \mbox \cite{}}\hspace{0pt . }\DIFaddend \section{Volunteer Classifications} \label{volunteer_classifications} \DIFdelbegin \DIFdel{Since the first Galaxy Zoo project launched in 2007, distributed classification by a crowd of volunteers has been used for analysis in projects ranging from the discovery of gravitational lenses \mbox \citep{Marshall2016} }\hspace{0pt to monitoring solar storms \mbox \citep{Tucker-Hood2015}}\hspace{0pt . The catalogues produced by the collective effort of Galaxy Zoo volunteers have been used as the foundation of a large number of studies of galaxy morphology, with the method's ability to provide estimates of confidence alongside classification especially valuable. This work represents the first systematic engagement of volunteers with low-redshift images as deep as those provided by DeCALS, and thus represents a more reliable catalogue of detailed morphology than has hitherto been available. \DIFdel{This iteration of the Galaxy Zoo project used the infrastructure made available by the Zooniverse platform; in particular, the \DIFdel{. The platform allows for the rapid creation of citizen science projects, and presents participating volunteers with one of a subject set of images chosen either randomly, or through criteria described in section \ref{sec:retirement}. \DIFdelend Volunteer classifications for GZ DECaLS were collected during three campaigns. \DIFdelbegin \DIFdel{GZD-A and GZD-B }\DIFdelend \DIFaddbegin \DIFadd{GZD-1 and GZD-2 }\DIFaddend classified all 99,109 galaxies passing the criteria above from DECALS DR1 and DR2, respectively. \DIFdelbegin \DIFdel{GZD-A }\DIFdelend \DIFaddbegin \DIFadd{GZD-1 }\DIFaddend ran from September 2015 to February 2016, and \DIFdelbegin \DIFdel{GZD-B }\DIFdelend \DIFaddbegin \DIFadd{GZD-2 }\DIFaddend from April 2016 to February 2017. \DIFdelbegin \DIFdel{GZD-C }\DIFdelend \DIFaddbegin \DIFadd{GZD-5 }\DIFaddend classified 262,000 DECALS DR5-only galaxies passing the criteria above. \DIFdelbegin \DIFdel{GZD-C }\DIFdelend \DIFaddbegin \DIFadd{GZD-5 }\DIFaddend ran from March 2017 to October 2020. \DIFdelbegin \DIFdel{GZD-C }\DIFdelend \DIFaddbegin \DIFadd{GZD-5 }\DIFaddend used more complex retirement criteria aimed at improving our automated classification (\ref{sec:retirement}) and an improved decision tree aimed at better identification of weak bars and minor mergers (\ref{sec:comparison_of_decision_trees}). \DIFaddbegin \DIFadd{This iteration of the Galaxy Zoo project used the infrastructure made available by the Zooniverse platform; in particular, the }\href{https://github.com/zooniverse/panoptes}{open source Panoptes platform}\DIFadd{. The platform allows for the rapid creation of citizen science projects, and presents participating volunteers with one of a subject set of images chosen either randomly, or through criteria described in section \ref{sec:retirement}. } \DIFaddend \subsection{Retirement} \label{sec:retirement} \DIFdelbegin \DIFdel{Unlike previous data releases, GZ DECALS galaxies each received different numbers of classifications (Figure \ref{fig:classification_counts}). \DIFdelend \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/latest_totals_per_dr.pdf} \caption{\DIFdelbeginFL \DIFdelFL{GZD-A}\DIFdelendFL \DIFaddbeginFL \DIFaddFL{GZD-1}\DIFaddendFL , \DIFdelbeginFL \DIFdelFL{GZD-B }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{GZD-2 }\DIFaddendFL and \DIFdelbeginFL \DIFdelFL{GZD-C }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{GZD-5 }\DIFaddendFL classification counts. \DIFdelbeginFL \DIFdelFL{GZD-A }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{GZD-1 }\DIFaddendFL has 40-60 classifications, \DIFdelbeginFL \DIFdelFL{GZD-B }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{GZD-2 }\DIFaddendFL has approximately 40, and \DIFdelbeginFL \DIFdelFL{GZD-C }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{GZD-5 }\DIFaddendFL has either approximately 5 or approximately 40. 4.6\% of \DIFdelbeginFL \DIFdelFL{GZD-C }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{GZD-5 }\DIFaddendFL galaxies received more than 40 classifications due to mistaken duplicate uploads. TODO DR5 will change slightly on final \DIFdelbeginFL \DIFdelFL{catalog }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{catalogue }\DIFaddendFL creation.} \label{fig:classification_counts} \end{figure} How many volunteer classifications should each galaxy receive? Ideally, all galaxies would receive enough classifications to be confident in the average response (i.e. the vote fraction) while still classifying all the target galaxies within a reasonable timeframe. However, the size of modern surveys make this increasingly impractical. \DIFdelbegin \footnote{\DIFdel{TODO optional - can include a years figure here} \addtocounter{footnote}{-1 \DIFdelend \DIFaddbegin \DIFadd{Collecting 40 volunteer classifications for all }{\notebds \DIFadd{TODO}} \DIFadd{galaxies in this data release would take at least }{\notebds \DIFadd{TODO}} \DIFadd{years}\DIFaddend . Therefore, \DIFdelbegin \DIFdel{beginning }\DIFdelend \DIFaddbegin \DIFadd{unlike previous data releases, GZ DECALS galaxies each received different numbers of classifications (Figure \ref{fig:classification_counts}). Beginning }\DIFaddend part-way through \DIFdelbegin \DIFdel{GZD-C}\DIFdelend \DIFaddbegin \DIFadd{GZD-5}\DIFaddend , we prioritise classifications for the galaxies expected to most improve our machine learning models, and rely more heavily on those models for classifying the remainder. For \DIFdelbegin \DIFdel{GZD-A and GZD-B}\DIFdelend \DIFaddbegin \DIFadd{GZD-1 and GZD-2}\DIFaddend , all galaxies received at least 40 classifications (as with previous data releases). \DIFdelbegin \DIFdel{GZD-A }\DIFdelend \DIFaddbegin \DIFadd{GZD-1 }\DIFaddend galaxies have between 40 and 60 classifications, selected \DIFdelbegin \DIFdel{randomly, while GZD-B }\DIFdelend \DIFaddbegin \DIFadd{at random, while GZD-2 }\DIFaddend galaxies all have approximately 40. For \DIFdelbegin \DIFdel{GZD-C}\DIFdelend \DIFaddbegin \DIFadd{GZD-5}\DIFaddend , galaxies classified until June 2019 also received approximately 40 classifications. From June 2019, we introduced an active learning system. Using active learning, galaxies expected to be the most informative for training our deep learning model received 40 classifications, and all remaining galaxies received at least 5 classifications. Galaxies receiving \DIFdelbegin \DIFdel{more than }\DIFdelend 5 \DIFdelbegin \DIFdel{votes }\DIFdelend for `artifact' were retired early. By `most informative', we mean the galaxies which, if classified, would most improve the performance of our model. We describe our method for estimating which galaxies would be most informative in \cite{Walmsley2020GalaxyLearning}. Briefly, the most informative galaxies are identified as those where a convolutional neural network being repeatedly permuted with MC Dropout \DIFdelbegin \DIFdel{\mbox \citealt{Gal2016Uncertainty}}\hspace{0pt ) }\DIFdelend \DIFaddbegin \DIFadd{\mbox \citep{Gal2016Uncertainty} }\hspace{0pt }\DIFaddend will confidently disagree with itself on the correct prediction \citep{Houlsby2014}. We emphasise that \DIFdelbegin \textit{\DIFdel{the number of classifications each galaxy received under active learning is not random} \DIFdel{. If you require a random sample of galaxies with more than five volunteer classifications , you should exclude these galaxies. They can be identified with the column }\texttt{\DIFdel{active\_learning\_on} \DIFdel{.}\footnote{\DIFdel{TODO make sure this is included in final catalog, using subject\_group column}} \addtocounter{footnote}{-1 \DIFdel{You may also use the posteriors from our deep learning classifier}\footnote{\DIFdel{Man, this really needs a name now.} \addtocounter{footnote}{-1 \DIFdel{, which are comparable across all GZ DECaLS galaxies (Section \ref{sec:automated})}\DIFdelend \DIFaddbegin \DIFadd{the number of classifications each galaxy received under active learning }\textit{\DIFadd{is not random}}\DIFadd{. For details on handling this and other selection effects, see Sec. \ref{sec:usage}}\DIFaddend . \subsection{Decision Trees} \label{sec:decision_trees_intro} The questions and answers we ask our volunteers define the measurements we can publish. It is therefore critical that the Galaxy Zoo decision tree matches the science goals of the research community. {\notebds Help requested for \DIFdelbegin \DIFdel{GZDA}\DIFdelend \DIFaddbegin \DIFadd{GZD-1}\DIFaddend /\DIFdelbegin \DIFdel{B }\DIFdelend \DIFaddbegin \DIFadd{2 }\DIFaddend changes - this was before my time, please expand changes and motivations vs the previous tree (possibly CANDELS?) TODO. May need to rewrite bulge change in this context, because we might have gone 4 -> 3 -> 5...} For \DIFdelbegin \DIFdel{GZDC}\DIFdelend \DIFaddbegin \DIFadd{GZD-5}\DIFaddend , we made three further changes. Several Galaxy Zoo studies (e.g. \citealt{Skibba2012, Masters2012, Willett2013, Kruk2018}) found that galaxies selected with 0.2<$p_\mathrm{bar}$<0.5 in GZ2 correspond to `weak bars' when compared with expert classification such as those in \cite{Nair2010}. Therefore, to increase the detection of bars, we changed the possible answers to the ”Does this galaxy have a bar?” question from `Yes' or `No' to `Strong', `Weak' or `No'. We define a strong bar as one that is clearly visible and extending across a large fraction of the size of the galaxy. A weak bar is smaller and fainter relative to the galaxy, and can appear more oval than the strong bar, while still being longer in one direction than the other. Our definition of strong vs. weak bar is similar that of \cite{Nair2010}, with the exception that they also have an `intermediate' classification. \DIFaddbegin \DIFadd{We added examples of galaxies with `weak bars' to the Field Guide and provided a new icon for this classification option, as shown in Figure \ref{fig:decision_tree}. }\DIFaddend Second, to allow for more fine-grained measurements of bulge size, we increased the number of "How prominent is the central bulge?" answers from 3 (`No', `Obvious', `Dominant') to 5 (`No Bulge', `Small', `Moderate', `Large', `Dominant'). Third, we modified the `Merging' question from `Merging', `Tidal', `Both', or `None', to the more phenomenological `Merging', `Major Disturbance', `Minor Disturbance', or `No'. Our goal was to present more direct answers to our volunteers and to better distinguish major and minor mergers, to support recent scientific interest in the role of major and minor mergers on mass assembly \citep{Lopez-Sanjuan2010, Kaviraj2013}, black hole accretion \citep{Alexander2012, Simmons2017a}, and morphology \citep{Hopkins2009a, Lotz2011, Lofthouse2017}. We made this final "merger" change two months after launching \DIFdelbegin \DIFdel{GZD-C}\DIFdelend \DIFaddbegin \DIFadd{GZD-5}\DIFaddend , and so the {\notebds TODO \%} of galaxies fully classified before that date do not have responses to this question, while {\notebds the TODO \%} of galaxies that were being classified when the change was made have fewer responses to this question. We also make several improvements to the illustrative icons shown for each answer. These icons are the most visible guide for volunteers as to what each answer means (complementing the tutorial, help text, field guide, and `Talk' forum). \DIFdelbegin \DIFdel{TODO Text to follow once icons are displayed below \DIFdelend \DIFaddbegin \DIFadd{Figure \ref{fig:decision_tree} shows the GZD-5 decision tree with new icons as shown to volunteers. The decision tree used in GZD-1 and GZD-2 is shown in Figure \ref{fig:gzda_tree} in Appendix \ref{sec:decision_trees}. }\DIFaddend \DIFdelbegin \DIFdel{TODO help requested showing the icons in a nice format. I have saved all of them \DIFdel{. Being white ontransparent backgrounds they need a dark grey color }\DIFdelend \DIFaddbegin \DIFadd{For `Smooth or Featured?', we changed the`Smooth' icon to include three example galaxies at various ellipticities, and the `Featured' icon to include an edge-on disk rather than a ring galaxy. For `Edge On?', we replaced the previous tick icon with a new descriptive icon, and the previous cross icon with the `Smooth' icon above. We also modified the text to no longer specify `exactly' edge on, and renamed the answers from `Yes' and `No' to `Yes - Edge On Disk' and 'No - Something Else'. For `Bulge?', we created new icons }\DIFaddend to match the \DIFdelbegin \DIFdel{site to be visible, and arranged nicely. \DIFdelend \DIFaddbegin \DIFadd{change from four to five answers. For `Bar', we replaced the previous tick and cross icons with new descriptive icons for `Strong Bar', `Weak Bar' and `No Bar'. For `Merger?', we added new descriptive icons to match the updated answers. } \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/dr5_tree_with_icons_new_format_inverted_004.png} \caption{\DIFaddFL{Classification decision tree for GZD-5, with new icons as shown to volunteers.}} \label{fig:decision_tree} \end{figure} \DIFaddend \section{Volunteer Analysis} \label{sec:volunteer_analysis} \subsection{Improved Feature Detection from DECaLS imagery} \label{comparison_to_gz2} The images used in GZ DECaLS are \DIFdelbegin \DIFdel{significantly }\DIFdelend deeper and higher resolution than were available for GZ2. The GZ2 primary sample \citep{Willett2013} uses images from SDSS DR7 \citep{Abazajian2009}, which are 95\% complete to $r=22.2$ with a median seeing of 1.4\arcsec and a CCD resolution of 0.396\arcsec$^2$ per pixel \citep{York2000}. In contrast, GZ DECaLS uses images from DECaLS DR2 to DR5, which have a median 5$\sigma$ point source depth of $r=23.6$, a seeing better than 1.3\DIFdelbegin \DIFdel{" }\DIFdelend \DIFaddbegin \arcsec \DIFaddend for at least one observation, and a CCD resolution of 0.262\arcsec$^2$ per pixel \citep{Dey2018}. We expect the improved imaging to reveal morphology not previously visible, particularly for features which are faint (e.g. tidal features, low surface brightness spiral arms) or intricate (e.g. weak bars, flocculent spiral arms). Our changes to the decision tree (Sec. \ref{sec:decision_trees_intro}) were partly made to better exploit this improved imaging. To investigate the consequences of improved imaging, we compare galaxies classified in both GZ2 and GZ DECalS. Galaxies will typically be classified by both projects if they are inside both the SDSS DR7 Legacy \DIFdelbegin \DIFdel{Catalog }\DIFdelend \DIFaddbegin \DIFadd{catalogue }\DIFaddend (i.e. the source GZ2 \DIFdelbegin \DIFdel{catalog}\DIFdelend \DIFaddbegin \DIFadd{catalogue}\DIFaddend ) and DECaLS DR5 footprints (broadly, North Galactic Cap galaxies with $-35 < \delta < 0$) and match the selection criteria of each project (see \citealt{Willett2013} and Sec. \ref{sec:selection}). GZ2's $r < 17.0$ cut, with no corresponding GZ DECaLS magnitude cut, means that the the odds of any given GZ2 galaxy being in GZ DECaLS is close to random (for an isotropic sky) but only the brighter half of suitably-located GZ DECaLS galaxies are in GZ2. To exclude the effect of modifying the decision tree in \DIFdelbegin \DIFdel{GZD-C }\DIFdelend \DIFaddbegin \DIFadd{GZD-5 }\DIFaddend (addressed separately in Sec \ref{sec:comparison_of_decision_trees}), we use only GZ DECaLS classifications from \DIFdelbegin \DIFdel{GZD-A and GZD-B}\DIFdelend \DIFaddbegin \DIFadd{GZD-1 and GZD-2}\DIFaddend . 33,124 galaxies were classified in both GZ2 and \DIFdelbegin \DIFdel{GZD-A or GZD-B}\DIFdelend \DIFaddbegin \DIFadd{GZD-1 or GZD-2}\DIFaddend . We find that volunteers successfully recognise newly-visible morphology features. Figure \ref{fig:featured_comparison} compares the distribution of vote fractions to "Is this galaxy smooth or featured?" for GZ2 and GZ DECaLS. Ambiguous galaxies, with `featured' fractions between approx. 0.25 and 0.75, are consistently reported as more featured (median absolute increase of 0.13, median percentage increase of 22\%) with the deeper GZ DECaLS images. \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/featured_comparison.pdf} \caption{Comparison of `Featured' fraction for galaxies classified in both GZ2 and GZ DECaLS. Ambiguous galaxies are consistently reported as more featured in GZ DECaLS, which we attribute to the significantly improved imaging depth of DECaLS.} \label{fig:featured_comparison} \end{figure} The shift towards featured galaxies is an accurate response to the \DIFdelbegin \DIFdel{improved imaging}\DIFdelend \DIFaddbegin \DIFadd{new iamges}\DIFaddend , rather than systematics from (for example) a changing population of volunteers. Figure \ref{fig:featured_galaxies_big_shift} compares the GZ2 and GZ DECaLS images of a random sample of galaxies drawn from the 1000 cross-classified galaxies with the largest increase in `featured' fraction. In all of these galaxies (and for a clear majority of galaxies in similar samples), volunteers are correctly recognising newly visible detailed features. \begin{figure} \includegraphics[width=\columnwidth,trim={0 5cm 0 5cm},clip]{figures/featured_galaxies_big_shift.png} \caption{GZ2 and GZ DECaLS images for 6 galaxies drawn randomly from the 1000 galaxies classified in both projects with the largest increase in `featured' vote fraction (reported fractions shown in red). The increased fraction accurately reflects the increased visibility of detailed morphology from improved imaging.} \label{fig:featured_galaxies_big_shift} \end{figure} We observe a similar pattern in the vote fractions of spiral arms and bars for featured galaxies. For galaxies consistently considered featured (i.e. where both projects reported a `featured' vote fraction of at least 0.5), the median vote fraction for spiral arms increased from 0.84 to 0.9, and for bars from 0.21 to 0.24. This suggests that even for galaxies where some details were already visible (and hence were considered featured), improved imaging makes our volunteers more \DIFdelbegin \DIFdel{confident in their classifications. }\footnote{\DIFdel{This may be a slight stretch?}} \addtocounter{footnote}{-1 \DIFdelend \DIFaddbegin \DIFadd{likely to identify specific features. } \DIFadd{Why can we now see new features? We believe that the improved depth of DECaLS ($r=23.6$ vs $r=22.2$ for SDSS) is revealing faint features that were previously ambiguous. There may also be contributions from the modified image processing approach and from the shift between using $gri$ bands (SDSS) to $grz$ bands (DECaLS), which might make older stars more prominent. }\DIFaddend Comparing classifications made using the same possible answers on the same galaxies shows how improved DECaLS imaging leads to ambiguous galaxies being correctly reported as more featured, and to spiral arms and bars being reported with more confidence. However, \DIFdelbegin \DIFdel{volunteer }\DIFdelend \DIFaddbegin \DIFadd{volunteers }\DIFaddend are also sensitive to which questions are asked and how those questions are asked. We measure the impact of our changes to the decision tree for \DIFdelbegin \DIFdel{GZD-C }\DIFdelend \DIFaddbegin \DIFadd{GZD-5 }\DIFaddend in the next section. \subsection{Improved Weak Bar Detection from GZD-5 Decision Tree} \label{sec:comparison_of_decision_trees} To measure the effect of the new decision tree on bar sensitivity, we compare the classifications made using each tree against expert classifications. \citealt{Nair2010} (hereafter NA10) classified all 14,034 SDSS DR4 galaxies at $0.01 < z < 0.05$ with $g < 16$. Of those, 1,601 were imaged by DECaLS DR1/2 and classified by volunteers during \DIFdelbegin \DIFdel{GZD-A}\DIFdelend \DIFaddbegin \DIFadd{GZD-1}\DIFaddend /\DIFdelbegin \DIFdel{B. }\DIFdelend \DIFaddbegin \DIFadd{2. }\DIFaddend We re-classified these galaxies during \DIFdelbegin \DIFdel{GZD-C }\DIFdelend \DIFaddbegin \DIFadd{GZD-5 }\DIFaddend to measure the effect of the new bar answers, as compared to the expert classifications of NA10. Note that because NA10 used shallower SDSS images, NA10's classifications are best used as positive evidence; while NA10 finding a bar in SDSS images implies a visible bar in DECaLS images, NA10 not finding a bar may not always exclude a visible bar in DECaLS. \DIFaddbegin \DIFadd{To exclude smooth galaxies, we require $f_{\text{featured}} > 0.25$ (as measured by GZD-5), selecting a featured sample of 956 galaxies classified by NA10, GZD-1/2, and GZD-5. }\DIFaddend Figure \ref{fig:bar_any_comparison} compares volunteer classifications for expert-labelled calibration galaxies made using each tree. We find that barred and unbarred galaxies are significantly better separated \DIFaddbegin \DIFadd{with the Strong/Weak/None answers than with Yes/No answers}\DIFaddend . Of 239 Nair-identified bars \DIFaddbegin \DIFadd{(of any type)}\DIFaddend , 196 (82\%) receive a majority vote for being barred by volunteers using the new tree, up from 124 (52\%) with the previous tree. \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/bar_any_comparison.pdf} \caption{ Left: Distribution of fraction of \DIFdelbeginFL \DIFdelFL{GZD-A}\DIFdelendFL \DIFaddbeginFL \DIFaddFL{GZD-1}\DIFaddendFL /\DIFdelbeginFL \DIFdelFL{B }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{2 }\DIFaddendFL volunteers answering `Yes' (not `No' to `Does this galaxy have a bar?', split by expert classification from NA10 of barred (blue) or unbarred (orange). Right: as left, but for \DIFdelbeginFL \DIFdelFL{GZD-C }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{GZD-5 }\DIFaddendFL volunteers answering `Strong' or `Weak' (not `No'). Volunteers are substantially better at identifying barred galaxies using the \DIFdelbeginFL \DIFdelFL{GZD-C }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{GZD-5 }\DIFaddendFL three-answer question. } \label{fig:bar_any_comparison} \end{figure} \DIFdelbegin \DIFdel{Figure \ref{fig:bar_answer_comparison} investigates GZDC responses for bars labelled Strong, Weak or No by \mbox \cite{Nair2010} }\hspace{0pt to determine our new explicit sensitivity to weak bars . As might be expected, ‘obvious’ weak bars appear rare; very few galaxies have Weak $\geq$ 0.8. However, weak bars are now separable with a cut at Weak $\geq$ 0.3 and another cut at Strong $\leq$ 0.6. \DIFdel{Help requested from Sandor to write a final sentence, something like - we hope that this will help researchers understand weak bars and the effect of }\DIFdelend \DIFaddbegin \DIFadd{NA10 classified barred galaxies into five subtypes: Strong, Intermediate, Weak, Nuclear, Ansae, and Peanut (plus None, implicitly). We can use the first three subtypes as a measurement of expert-classified bar strength, and therefore evaluate how our volunteers respond to }\DIFaddend bars \DIFdelbegin \DIFdel{on AGN fueling. \DIFdel{I don't have a similar comparison for the effect of the bulge size or mergers question - perhaps I should? \DIFdelend \DIFaddbegin \DIFadd{of different strengths. Following the approach to defining summary metrics of \mbox \cite{Masters2019}}\hspace{0pt , we summarise the bar vote fractions into a single volunteer estimate of bar strength, $B_\text{vol} = f_{\text{strong}} + 0.5 f_{\text{weak}}$, and compare the distribution of $B$ for each expert-classified bar strength (Figure \ref{fig:bar_answer_comparison}). We find that the volunteer bar strength estimates increase smoothly with expert-classified bar strength, though individual galaxies vary substantially. This suggests that typical bar strength in galaxy samples can be successfully inferred from volunteer votes. }\DIFaddend \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/bar_answer_comparison_grid.pdf} \DIFdelbeginFL \DIFdelFL{Distribution of vote fractions for each GZDC answer(`Strong', `Weak', and `No') plus a combined `Strong + Weak' answer, split by expert classification from NA10 of Strong Bar (blue), Weak Bar (orange), or No Bar (green). }} \DIFdelendFL \DIFaddbeginFL \caption{ \DIFaddFL{Distributions of volunteer bar strength estimates, $B_\text{vol} = f_{\text{strong}} + 0.5 f_{\text{weak}}$, split by expert-classified (NA10) bar strength. Individual galaxies are shown with rug plots (14 Strong, 114 Intermediate, 99 Weak, and 717 None). Volunteer bar strength estimates increase smoothly with expert-classified bar strength, though individual galaxies vary substantially. }} \DIFaddendFL \label{fig:bar_answer_comparison} \end{figure} \DIFaddbegin \DIFadd{The addition of the `weak bar' answer in GZD-5 significantly improves sensitivity to bars compared with previous versions of the decision tree. Additionally, volunteer votes across the three answers may be used to infer bar strength. We hope that the detailed bar classifications in our catalogueue will help researchers better understand the properties of strong and weak bars and their influence on host galaxies. } \DIFaddend \subsection{Consensus and Debiasing} Galaxy Zoo data releases have previously included two post-hoc modifications to the volunteer classifications; consensus aggregation, to reduce the influence of strongly atypical \DIFdelbegin \DIFdel{users}\DIFdelend \DIFaddbegin \DIFadd{volunteers}\DIFaddend , and redshift debiasing, to estimate the vote fractions a galaxy might have received had it been observed at a specific redshift. \DIFdelbegin \DIFdel{Consensus aggregation}\DIFdelend \DIFaddbegin \DIFadd{User weighting}\DIFaddend , as introduced in Galaxy Zoo 2 \citep{Willett2013}, assigns each user an aggregation weight of (initially) one, and iteratively reduces that weight for \DIFdelbegin \DIFdel{users }\DIFdelend \DIFaddbegin \DIFadd{volunteers }\DIFaddend who typically disagree with the consensus. This method affects relatively few \DIFdelbegin \DIFdel{users }\DIFdelend \DIFaddbegin \DIFadd{volunteers }\DIFaddend and therefore causes only a small shift in vote fractions - in Galaxy Zoo 2, for example, approximately 95\% of \DIFdelbegin \DIFdel{users }\DIFdelend \DIFaddbegin \DIFadd{volunteers }\DIFaddend had a weighting of one (i.e. unaffected), 94.8\% of galaxies had a change in vote fraction of no more than 0.1 for any question, and the mean change in vote fraction across all questions and galaxies was 0.0032. \DIFdelbegin \DIFdel{Here, chose to }\DIFdelend \DIFaddbegin \DIFadd{Because user weighting causes only a small shift in vote fractions, we choose to instead }\DIFaddend adopt a simpler \DIFdelbegin \DIFdel{method; we }\DIFdelend \DIFaddbegin \DIFadd{and more direct method. In the first Galaxy Zoo question, volunteers are asked if a galaxy is smooth, featured, or a `Star or Artifact'. We know how common artifacts are, and so we can }\DIFaddend identify and discount \DIFdelbegin \DIFdel{users }\DIFdelend \DIFaddbegin \DIFadd{volunteers }\DIFaddend who report artifacts at far higher rates than statistically plausible. Specifically, we assume a generous true artifact ratio $f_a=0.2$ (i.e. 1 in 5 galaxies being correctly classified as artifacts), a ratio substantially higher than the classifications of both experienced ($N > 100$) volunteers and the authors would suggest (approx. $f_a\leq0.1$). We calculate the likelihood that a perfect user with $N$ total classifications would have encountered $k$ Binomially-distributed artifacts, $p={N \choose k}k^{f_a}(N-k)^{1-f_a}$. We can therefore calculate the (one-tailed) $p$-value under the null hypothesis of a perfect user identifying $k$ or more artifacts from $N$ galaxies given a true artifact ratio $f_a=0.2$, $p(K \geq k|N, f_a) = 1 - p(K - 1 \leq k|N, f_a)$, and discount \DIFdelbegin \DIFdel{users }\DIFdelend \DIFaddbegin \DIFadd{volunteers }\DIFaddend below a chosen $p$-value. This statistical model is only approximate, and so we choose the extreme $p$-value of $10^{-12}$, noting that the discounted \DIFdelbegin \DIFdel{users }\DIFdelend \DIFaddbegin \DIFadd{volunteers }\DIFaddend are similar within several orders of magnitude. The result is that \DIFdelbegin \DIFdel{users }\DIFdelend \DIFaddbegin \DIFadd{volunteers }\DIFaddend are only discounted if they report an artifact fraction of at least 50\% for \DIFdelbegin \DIFdel{users }\DIFdelend \DIFaddbegin \DIFadd{volunteers }\DIFaddend with $\approx50$ classifications, or $\approx30\%$ for \DIFdelbegin \DIFdel{users }\DIFdelend \DIFaddbegin \DIFadd{volunteers }\DIFaddend with at least 1000 classifications (Figure \ref{fig:artifact_fractions}). 2.1\% of \DIFdelbegin \DIFdel{users }\DIFdelend \DIFaddbegin \DIFadd{volunteers }\DIFaddend (1,120) are discounted. \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/count_v_artifact.pdf} \caption{ Per-user artifact fraction vs. classifications by that user. 76\% of \DIFdelbeginFL \DIFdelFL{users }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{volunteers }\DIFaddendFL report an artifact fraction of 0.1 or below (i.e. they classify less than 10\% of galaxies as artifacts. Red: approximate boundary chosen to discount \DIFdelbeginFL \DIFdelFL{users }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{volunteers }\DIFaddendFL with statistically atypical artifact fractions. } \label{fig:artifact_fractions} \end{figure} We investigated the possibility of clusters of atypical \DIFdelbegin \DIFdel{users }\DIFdelend \DIFaddbegin \DIFadd{volunteers }\DIFaddend across questions by analysing the per-user vote fractions with either a two-dimensional visualisation using UMAP \citep{McInnes2018} or with clustering using HDBSCAN \citep{McInnes2017}. We find no strong evidence that such clusters exist. {\notebds Sandor and Steven to write debiasing section} \section{Automated Classifications} \label{sec:automated} Combining citizen science with automated classification allow us to do better science than \DIFdelbegin \DIFdel{than }\DIFdelend with either alone. The clearest benefit is that automated classification scales \DIFaddbegin \DIFadd{well with sample size}\DIFaddend . For GZ DECaLS, classifying all \DIFdelbegin \DIFdel{324,000 }\DIFdelend \DIFaddbegin \DIFadd{311,488 }\DIFaddend suitable galaxies using volunteers alone is infeasible; collecting \DIFdelbegin \DIFdel{forty }\DIFdelend \DIFaddbegin \DIFadd{40 }\DIFaddend classifications per galaxy, the standard from previous Galaxy Zoo projects, would take around five years - by which time we expect new surveys to start. Automated classification also evolves - as the quality of our models improves, so too will the quality of our classifications. And automated classification is replicable - other researchers may run our open-source code and recover our classifications (within stochasticity), or create equivalent classifications for new galaxies. Finally, and of particular relevance to researchers using this data release, automated classification allows us to retroactively update the decision tree. Because our classifier learns to make predictions from \DIFdelbegin \DIFdel{GZD-C }\DIFdelend \DIFaddbegin \DIFadd{GZD-5 }\DIFaddend classifications, using the improved tree with better detection of mergers and weak bars, we can then predict what our volunteers would have said for the \DIFdelbegin \DIFdel{GZD-A and GZD-B }\DIFdelend \DIFaddbegin \DIFadd{GZD-1 and GZD-2 }\DIFaddend galaxies \textit{had we been using the improved tree at that time}. Our specific automated classification approach offers several qualitative benefits over previous work. First, through careful consideration of uncertainty, we can both learn from uncertain volunteer responses and predict posteriors (rather than point estimates) for new galaxies. Second, by predicting the answers to every question with a single model (similarly to \citealt{Dieleman2015}, and unlike more recent work \DIFdelbegin \footnote{\DIFdel{Could cite here, but it feels a bit snarky} \addtocounter{footnote}{-1 \DIFdel{)}\DIFdelend \DIFaddbegin \DIFadd{e.g. \mbox \citealt{Sanchez2017, Khan2018}}\hspace{0pt }\DIFaddend , we improve performance by sharing representations between tasks \citep{Caruana1997} - intuitively, knowing how to recognise spiral arms can also help you count them. Learning from every galaxy to predict every answer uses our valuable volunteer effort as efficiently as possible. \subsection{Bayesian Deep Learning Classifier} We require a model which can: \begin{enumerate} \item Learn efficiently from volunteer responses of varying (i.e. heteroskedastic) uncertainty \item Predict posteriors for those responses on new galaxies, for every question \end{enumerate} In previous work \citep{Walmsley2020GalaxyLearning} we modelled volunteer responses as being binomially distributed and trained our model to make maximum likelihood estimates using the loss function \begin{equation} \mathcal{L} = k \log f^w(x) + (N-k) \log(1-f^w(x)) \end{equation} where, for some target question, $k$ is the number of responses (successes) of some target answer, $N$ is the total number of responses (trials) to all answers, and $f^w(x) = \hat{\rho}$ is the predicted probability of a volunteer giving that answer. This binomial assumption, while broadly successful, broke down for galaxies with vote fractions $\frac{k}{N}$ close to 0 or 1, where the Binomial likelihood is extremely sensitive to $f^w(x)$, and for galaxies where the question asked was not appropriate (e.g. predict if a featureless galaxy has a bar). Instead, in this work, the model predicts a distribution $p(\rho|f^w(x))$ and $\rho$ is then drawn from that distribution. For binary questions, one could parametrise $p(\rho|f^w(x))$ with the Beta distribution (being flexible and defined on the unit interval), and predict the Beta distribution parameters $f^w(x) = (\hat{\alpha}, \hat{\beta}$ by minimising \begin{equation} \mathcal{L} = \int Bin(k|\rho, N) Beta(\rho|\alpha, \beta) d\alpha d\beta \end{equation} where the Binomial and Beta distributions are conjugate and hence this integral can be evaluated analytically. In practice, we would like to predict the responses to questions with more than two answers, and hence we replace each distribution with its multivariate counterpart; Beta($\rho|\alpha, \beta$) with Dirichlet($\vec{\rho}|\vec{\alpha})$, and Binomial($k|\rho, N$) with Multinomial($\vec{k}|\vec{\rho}, N$). \begin{equation} \label{multivariate_per_q_likelihood} \mathcal{L}_q = \int Multi(\vec{k}|\vec{\rho}, N) Dirichlet(\vec{\rho}| \vec{\alpha}) d\vec{\alpha} \end{equation} where $\vec{k}, \vec{\rho}$ and $\vec{\alpha}$ are now all vectors with one element per answer. For the base architecture, we use the EfficientNet B0 model \citep{Tan2019a}. The EfficientNet family of models include several architectural advances over the standard convolutional neural network architectures commonly used within astrophysics (e.g. \citealt{Huertas-Company2015a, Dieleman2015, Khan2019DeepSurvey, Cheng2019, Ferreira2020GalaxyData}), including auto-ML \citep{Tan2018, He2019}, depthwise convolutions \citep{Howard2017}, bottleneck layers \citep{Iandola2016}, and squeeze-and-excitation optimisation \citep{Hu2018}. The EfficientNet B0 model was identified using multi-objective neural architecture search \citep{Tan2018}, optimising for both accuracy and FLOPS (i.e. computational cost of prediction). This \DIFdelbegin \DIFdel{balance }\DIFdelend \DIFaddbegin \DIFadd{balancing }\DIFaddend of accuracy and FLOPS is \DIFdelbegin \DIFdel{highly desirable }\DIFdelend \DIFaddbegin \DIFadd{particularly useful }\DIFaddend for astrophysics researchers with limited access to GPU resources, leading to a model capable of making reliable predictions on hundreds of millions of galaxies. \DIFdelbegin \footnote{\DIFdel{Not quite happy with the last sentence}} \addtocounter{footnote}{-1 \DIFdelend We modify the final EfficientNet B0 layer output units to give predictions smoothly between 1 and 100 (using softmax activation), which is appropriate for Dirichlet parameters $\vec{\alpha}$. $\vec{\alpha}$ elements below 1 can lead to bimodal `horseshoe' posteriors, and $\vec{\alpha}$ elements above approximately 100 can lead to extremely confident predictions in extreme $\rho$, both of which are implausible for galaxy morphology posteriors. We would like our (single) model to predict the answer to every question in the Galaxy Zoo tree. To do this, our architecture uses one output unit per answer (i.e. for 13 questions with a total of 20 answers, we use 20 output units). We calculate the (negative log) likelihood per question (Eqn. \ref{multivariate_per_q_likelihood}), and then, treating the errors in our answers to each question as independent events, calculate the total loss as \begin{equation} \log \mathcal{L} = \sum_q \mathcal{L}_q(\vec{k_q}, N_q, \vec{f^w_q}) \end{equation} where, for question $q$, $N_q$ is the total answers, $\vec{k_q}$ is the observed votes for each answer, and $\vec{f^w_q}$ is the values of the output units corresponding to those answers (which we interpret as the Dirichlet $\vec{\alpha}$ parameters in Eqn. \ref{multivariate_per_q_likelihood}). We train our model using the \DIFdelbegin \DIFdel{GZD-C }\DIFdelend \DIFaddbegin \DIFadd{GZD-5 }\DIFaddend volunteer classifications. Because the training set includes both active-learning-selected galaxies with at receiving at least 40 classifications and the remaining \DIFdelbegin \DIFdel{GZD-C }\DIFdelend \DIFaddbegin \DIFadd{GZD-5 }\DIFaddend galaxies with as low as 5 classifications, it is crucial that the model is able to learn efficiently from labels of varying uncertainty\footnote{Deliberate repeat}. Unlike \cite{Walmsley2020GalaxyLearning}, which trained one model per question and needed to filter galaxies where that question asked may not be appropriate, we can predict answers to all questions and learn from all labelled galaxies. \DIFaddbegin \DIFadd{Specifically, }{\notebds \DIFadd{TODO details on final training - which images (png), scaling, augmentations, num. models, loss function details}}\DIFadd{. } \DIFaddend Code for our deep learning classifier is available at...TODO \subsection{Results} \label{sec:automated_results} Our model successfully predicts posteriors for volunteer votes to each question. We show example posteriors in Fig \ref{fig:example_posterior_smooth}, Fig. \ref{fig:example_posterior_spiral}, and Fig. \ref{fig:example_posterior_bar}. \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/placeholder_smooth_dists.png} \caption{TODO GZ2 PLACEHOLDER Example posteriors for predicting volunteer votes to the question `Is this galaxy smooth or featured?', next to the corresponding image shown to volunteers. Color denotes each individual model in the ensemble, with individual dropout forward passes shown as traces. The observed vote fraction is shown in black.} \label{fig:example_posterior_smooth} \end{figure} \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/placeholder_spiral_dists.png} \caption{TODO GZ2 PLACEHOLDER As above, but for the question `Does this galaxy have spiral arms?'} \label{fig:example_posterior_spiral} \end{figure} \begin{figure} \centering \includegraphics[width=0.7\columnwidth]{figures/placeholder_bulge_size.png} \caption{TODO GZ2 PLACEHOLDER Example posteriors for predicting .... (I will change this to bars once I repeat for DECaLS)} \label{fig:example_posterior_bar} \end{figure} To aid intuition for the typical performance, we reduce both the vote fraction labels and the posteriors down to discrete classifications, and present the confusion matrices (Figure \ref{fig:confusion_matrices}). Here and throughout this section, to remove galaxies for which the question is not relevant, we only count galaxies where at least half the volunteers were asked that question. Performance is generally excellent, with a mean accuracy of {\notebds TODO and F1 scores from TODO to TODO. We observe some confusion between similar answers TODO}. In Appendix A, we provide a gallery of the galaxies with the highest expected vote fractions for a selection of answers. Discrete classification metrics are of limited use beyond building intuition, as our labels are uncertain; because vote fractions are approximate (we cannot ask infinitely many volunteers) and because many galaxies are genuinely ambiguous, no classifier should achieve perfect accuracy. We can mitigate the ambiguity in \DIFaddbegin \DIFadd{classifications of }\DIFaddend galaxies by measuring regression metrics on the vote fractions, without rounding to discrete classifications. Figure \ref{fig:mean_deviation_bar} shows the mean deviations between the model predictions (mean posteriors) and the observed vote fractions, by question, for retired test set galaxies. The model is typically well within 10\% of the observed vote fractions. The volunteer vote fractions against which we compare our predictions remain uncertain for most galaxies. We aim to predict the true vote fraction, i.e. the vote fraction from $\lim_{N \to \infty}$ volunteers, but we only know the vote fraction from $N$ volunteers. However, 387 pre-active-learning galaxies were erroneously uploaded twice or more, and so received more than 75 classifications each. We can compare our predictions against these confidently-known galaxies. We can also \DIFdelbegin \DIFdel{simulate }\DIFdelend \DIFaddbegin \DIFadd{calculate }\DIFaddend the deviations from asking fewer ($N << 75$) volunteers \DIFaddbegin \DIFadd{by artificially truncating the number of votes collected}\DIFaddend , and ask - how many volunteer responses would we need to have errors similar to that of our model? Figure \ref{fig:deviation_vs_volunteers} shows the model and volunteer deviations for a representative selection of questions; the model predictions are as accurate as asking around 10 volunteers.\footnote{The model is, in this strict sense, \DIFaddbegin \DIFadd{slightly }\DIFaddend superhuman.} We can also measure if our posteriors correctly estimate this uncertainty. Figure \ref{fig:calibration} shows the calibration of our posteriors for the two binary questions in GZDC - edge-on disk, and spiral arms. We find that calibration is excellent. Our model is correctly uncertain. \begin{figure} \centering \includegraphics[width=0.48\columnwidth]{figures/mean_cm_decals_n2_m0_allq_smooth-or-featured.png} \includegraphics[width=0.48\columnwidth]{figures/mean_cm_decals_n2_m0_allq_disk-edge-on.png} \includegraphics[width=0.48\columnwidth]{figures/mean_cm_decals_n2_m0_allq_has-spiral-arms.png} \includegraphics[width=0.48\columnwidth]{figures/mean_cm_decals_n2_m0_allq_spiral-arm-count.png} \includegraphics[width=0.48\columnwidth]{figures/mean_cm_decals_n2_m0_allq_spiral-winding.png} \includegraphics[width=0.48\columnwidth]{figures/mean_cm_decals_n2_m0_allq_bar.png} \includegraphics[width=0.48\columnwidth]{figures/mean_cm_decals_n2_m0_allq_bulge-size.png} \includegraphics[width=0.48\columnwidth]{figures/mean_cm_decals_n2_m0_allq_merging.png} \includegraphics[width=0.48\columnwidth]{figures/mean_cm_decals_n2_m0_allq_edge-on-bulge.png} \includegraphics[width=0.48\columnwidth]{figures/mean_cm_decals_n2_m0_allq_how-rounded.png} \caption{Confusion matrices for each question, made on an evaluation set of 2,765 randomly-selected galaxies with $N > 36$ (i.e. the highly-classified subset of the full 10,000 galaxy evaluation set). Discrete classifications are made by rounding the vote fraction (label) and mean posterior (prediction) to the nearest integer. \DIFaddbeginFL \DIFaddFL{The matrices then show the counts of rounded predictions (x axis) against rounded labels (y axis). }\DIFaddendFL To avoid \DIFdelbeginFL \DIFdelFL{this }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{the }\DIFaddendFL loss of information \DIFaddbeginFL \DIFaddFL{from rounding}\DIFaddendFL , we strongly urge researchers not to treat Galaxy Zoo classifications as discrete, and to use the full vote fractions where possible.} \label{fig:confusion_matrices} \end{figure} \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/mean_deviation_bar.pdf} \caption{Mean absolute deviations between the model predictions and the observed vote fractions, by question, for the retired test set galaxies. The model is typically well within 10\% of the observed vote fractions.} \label{fig:mean_deviation_bar} \end{figure} \begin{figure} \centering \DIFdelbeginFL \DIFdelendFL \DIFaddbeginFL \includegraphics[width=\columnwidth]{figures/vs_all_votes_smooth-or-featured.pdf} \DIFaddendFL \DIFdelbeginFL \DIFdelendFL \DIFaddbeginFL \includegraphics[width=\columnwidth]{figures/vs_all_votes_bar.pdf} \includegraphics[width=\columnwidth]{figures/vs_all_votes_has-spiral-arms.pdf} \includegraphics[width=\columnwidth]{figures/vs_all_votes_bulge-size.pdf} \DIFaddendFL \caption{\DIFdelbeginFL \DIFdelFL{TODO PLACEHOLDER AWAITING FINAL MODEL + PRETTIFYING Comparison of vote fraction deviations }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{Mean errors }\DIFaddendFL vs. \DIFaddbeginFL \DIFaddFL{the }\DIFaddendFL true ($N > 75$) vote fractions for \DIFaddbeginFL \DIFaddFL{either a truncated ($N=0$ to $N=20$) number of }\DIFaddendFL volunteers (solid) \DIFdelbeginFL \DIFdelFL{and }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{or the }\DIFaddendFL automated \DIFaddbeginFL \DIFaddFL{classifier }\DIFaddendFL (dashed). Asking \DIFdelbeginFL \DIFdelFL{more }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{only a few }\DIFaddendFL volunteers \DIFdelbeginFL \DIFdelFL{makes }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{gives a noisy estimate of }\DIFaddendFL the \DIFaddbeginFL \DIFaddFL{true }\DIFaddendFL vote fraction\DIFdelbeginFL \DIFdelFL{estimate }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{. Asking }\DIFaddendFL more \DIFdelbeginFL \DIFdelFL{precise}\DIFdelendFL \DIFaddbeginFL \DIFaddFL{volunteers reduces this noise}\DIFaddendFL . \DIFdelbeginFL \DIFdelFL{The model }\DIFdelendFL \DIFaddbeginFL \DIFaddFL{For some number of volunteers, the noise in the vote fraction is similar to the error of the automated classifier, meaning they make classifications of similar accuracy; this number is where the solid and dashed lines intersect. We find the automated classifier }\DIFaddendFL has a similar accuracy to approx. 5 to 15 volunteers, depending on the question. \DIFaddbeginFL {\notebds \DIFaddFL{TODO - using preliminary model, these numbers may change slightly}} \DIFaddendFL } \label{fig:deviation_vs_volunteers} \end{figure} \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/calibration_single_model_disk-edge-on.pdf} \includegraphics[width=\columnwidth]{figures/calibration_single_model_has-spiral-arms.pdf} \caption{Calibration curves (TODO these are for a single model, not the full ensemble, will hopefully improve slightly for a nice comparison) for the two binary GZ DECaLS questions. \DIFaddbeginFL \DIFaddFL{The $x$-axis shows the credible interval width - for data-dominated posteriors, roughly 30\% of galaxies should have vote fractions within their 30\% credible interval. The $y$-axis shows what percentage actually do fall within each interval width. }\DIFaddendFL Calibration for both questions is excellent.} \label{fig:calibration} \end{figure} The ultimate measure of success is whether our predictions are useful for science. \cite{Masters2019} (hereafter M19), which used GZ2 classifications to investigate the relationship between bulge size and winding angle and found - contrary to a conventional view of the Hubble sequence - no strong correlation. We repeat this analysis using our (deeper) DECaLS data, using either volunteer or automated classification, to check if the automated classifications lead to the same science results as the volunteers. Specifically, we select a clean sample of face-on spiral galaxies using M19's vote fraction cuts of $f_{\text{feat}} > 0.43$, $f_{\text{not-edge-on}} > 0.715$, and $f_{\text{spiral-yes}} > 0.619$. We also make a cut of $f_{\text{merging=none}} > 0.5$, analogous to M19's $f_{\text{odd}}$ cut, to remove galaxies with ongoing mergers or with otherwise disturbed features. For the volunteer vote fractions, we can only use either \DIFdelbegin \DIFdel{GZD-A}\DIFdelend \DIFaddbegin \DIFadd{GZD-1}\DIFaddend /\DIFdelbegin \DIFdel{B or GZD-C }\DIFdelend \DIFaddbegin \DIFadd{2 or GZD-5 }\DIFaddend classifications, since former decision tree had three bulge size answers and the latter had five; we choose \DIFdelbegin \DIFdel{GZD-C }\DIFdelend \DIFaddbegin \DIFadd{GZD-5 }\DIFaddend to benefit from the added precision of additional answers. For the automated classifications, we use a model trained on \DIFdelbegin \DIFdel{GZD-C to predict GZD-C }\DIFdelend \DIFaddbegin \DIFadd{GZD-5 to predict GZD-5 }\DIFaddend decision tree vote fractions (including the five bulge answers) for every GZ DECaLS galaxy. We calculate the bulge size and winding angle We calculate bulge size and spiral winding following Eqn. 1 and 3 in M19, trivially generalising the bulge size calculation to allow for five bulge size answers: \begin{gather} W_{\text{avg}} = 0.5 f_{\text{medium}} + 1.0 f_{\text{tight}} \\ B_{\text{avg}} = 0.25 f_{\text{small}} + 0.5 f_{\text{moderate}} + 0.75 f_{\text{large}} + 1.0 f_{\text{dominant}} \end{gather} Both classification methods find no correlation between bulge size and spiral winding, consistent with M19.\footnote{\DIFdelbegin \DIFdel{If we're honest, }\DIFdelend I might even say we find a weak anti-correlation?}. Figure \ref{fig:masters_repeat} shows the distribution of bulge size against spiral winding using either volunteer predictions (fractions) or the deep learning predictions (expected fractions) for the sample of featured face-on galaxies selected above. The distributions are indistinguishable, with the automated method offering a substantially larger (approx 6x) sample size. We hope this demonstrates the accuracy and scientific value of our automated classifier. \begin{figure} \centering \includegraphics[width=0.49\columnwidth]{figures/bulge_winding_corr_humans.pdf} \includegraphics[width=0.49\columnwidth]{figures/bulge_winding_corr_ml.pdf} \caption{Distribution of bulge size vs. spiral winding, using responses from volunteers (left) or our automated predictions (right). We observe no clear correlation between bulge size and spiral winding, consistent with M19. The distributions are consistent between volunteers and our automated method.} \label{fig:masters_repeat} \end{figure} \section{Usage} \label{sec:usage} \subsection{Catalogues} Volunteer and automated classifications are available through \href{data.galaxyzoo.org}{data.galaxyzoo.org}. We release four \DIFdelbegin \DIFdel{catalogs }\DIFdelend \DIFaddbegin \DIFadd{catalogues }\DIFaddend - two with volunteers, and two automated. \texttt{gz\_decals\_volunteers\_ab} includes the volunteer classifications \DIFdelbegin \DIFdel{from GZD-A and GZD-B, }\DIFdelend \DIFaddbegin \DIFadd{for TODO galaxies from GZD-1 and GZD-2. Classifications are }\DIFaddend made using the \DIFdelbegin \DIFdel{GZD-A}\DIFdelend \DIFaddbegin \DIFadd{GZD-1}\DIFaddend /\DIFdelbegin \DIFdel{B }\DIFdelend \DIFaddbegin \DIFadd{2 }\DIFaddend decision tree (\DIFdelbegin \DIFdel{Sec \ref{sec:decision_trees_intro}). These galaxies may be straightforwardly used as a random sample. }\DIFdelend \DIFaddbegin \DIFadd{Fig. \ref{fig:gzda_tree}). All galaxies have at least 40 classifications. This catalogue is ideal for researchers needing standard morphology measurements on a reasonably large sample, with minimal complexity. 33,124 galaxies were previously classified in GZ2; the GZD-1/2 classifications are better able to detect faint features due to deeper DECaLS imaging, and so should be preferred.} \DIFaddend \texttt{gz\_decals\_volunteers\_c} \DIFdelbegin \DIFdel{similarly }\DIFdelend includes the volunteer classifications from \DIFdelbegin \DIFdel{GZD-C, }\DIFdelend \DIFaddbegin \DIFadd{GZD-5. Classifications are }\DIFaddend made using the improved \DIFdelbegin \DIFdel{GZD-C decision tree }\DIFdelend \DIFaddbegin \DIFadd{GZD-5 decision tree which adds more detail for bars and mergers }\DIFaddend (Sec. \ref{sec:comparison_of_decision_trees}). This \DIFdelbegin \DIFdel{catalog is made up of subsets selected randomly, selected by active learning for intense classification, or selected for only $N=5$ classification (Sec \ref{sec:retirement}). }\DIFdelend \DIFaddbegin \DIFadd{catalogue includes TODO galaxies, but each galaxy does not have the same number of classifications. }{\notebds \DIFadd{intuitive summary stats}}\DIFadd{. The selection effects for how many classifications each galaxy receives are detailed below in Sec. \ref{sec:selection_effects}. This catalogue may be useful to researchers who prefer a larger sample than }\texttt{\DIFadd{gz\_decals\_volunteers\_ab}} \DIFadd{at the cost of more uncertainty and the introduction of selection effects, or who need detailed bar or merger measurements for a small number of galaxies (}{\notebds \DIFadd{TODO}}\DIFadd{). We use }\texttt{\DIFadd{gz\_decals\_volunteers\_c}} \DIFadd{to train our deep learning classifier. }\DIFaddend The automated classifications are made using our Bayesian deep learning classifier, trained on \DIFdelbegin \DIFdel{GZD-C labels }\DIFdelend \DIFaddbegin \texttt{\DIFadd{gz\_decals\_volunteers\_c}} \DIFaddend to predict the answers to the \DIFdelbegin \DIFdel{GZD-C }\DIFdelend \DIFaddbegin \DIFadd{GZD-5 }\DIFaddend decision tree for all GZ DECaLS galaxies \DIFaddbegin \DIFadd{(including those in GZD-1 and GZD-2)}\DIFaddend . \texttt{gz\_decals\_auto\_posteriors} contains the predicted posteriors for each answer - specifically, the Dirichlet concentration parameters that encode the posteriors. We hope this \DIFdelbegin \DIFdel{catalog }\DIFdelend \DIFaddbegin \DIFadd{catalogue }\DIFaddend will be helpful to researchers analysing galaxies in Bayesian frameworks. \DIFaddbegin \DIFaddend \texttt{gz\_decals\_auto\_fractions} reduces those posteriors to the automated equivalent of previous Galaxy Zoo data releases, containing the expected vote fractions (mean posteriors) and a measure of the uncertainties on those fractions (90\% highest posterior density credible intervals), in both raw and debiased (\ref{sec:volunteer_analysis}) form. We hope this \DIFdelbegin \DIFdel{catalog }\DIFdelend \DIFaddbegin \DIFadd{catalogue }\DIFaddend will be useful to researchers seeking detailed \DIFdelbegin \DIFdel{and robust morphology classifications at scale, who require known errors }\DIFdelend \DIFaddbegin \DIFadd{morphology classifications on the largest possible sample, who might benefit from error bars }\DIFaddend but do not need full posteriors. We also release Jupyter notebooks showing how to use each catalogue on \href{link_on_publication}{GitHub}. These demonstrate how to load and query each \DIFdelbegin \DIFdel{catalog }\DIFdelend \DIFaddbegin \DIFadd{catalogue }\DIFaddend with pandas, and how to create callable posteriors from the Dirichlet concentration parameters. \DIFaddbegin \subsection{Selection Effects for Total Classifications} \label{sec:selection_effects} \DIFadd{The GZD-1/2 catalogue reports at least 40 classifications for all galaxies imaged by DECaLS DR1/2 and passing the appropriate selection cuts (Section \ref{sec:selection}). Additional classifications above 40 are assigned independently of the galaxy properties. The selection function for total classifications in the GZD-5 catalogue is more complex. In practice, if you require a strictly random sample of GZD-5 galaxies with more than five volunteer classifications, you should exclude galaxies where `random\_selection' is False. You may also consider using the posteriors from our deep learning classifier}\footnote{Man, this really needs a name now.}\DIFadd{, which are comparable across all GZ DECaLS galaxies (Section \ref{sec:automated}). Below, we describe the GZD-5 total classification selection effects. } \DIFadd{Early galaxies were initially uploaded row-by-row from the NASA-Sloan Atlas, each (eventually) receiving 40 classifications. We also uploaded two additional subsets. For the first, 1387 galaxies were targeted for classification to support an external research project. Of these, 1210 would have otherwise received five classifications. These 1210 galaxies with additional classifications are identified with the `targeted' group and should be excluded. For the second, we reclassified the 1262 galaxies classified in both GZD-1/2 and the \mbox \cite{Nair2010} }\hspace{0pt expert visual morphology classification catalogue to measure the effect of our new decision tree (results are shown in Sec. \ref{sec:comparison_of_decision_trees}. Both the GZD-1/2 and GZD-5 classifications are reported in the respective catalogues (Section \ref{sec:usage}. For a strictly random selection, the GZD-5 classifications of these calibration galaxies should be excluded as they would not otherwise have been reclassified. } \DIFadd{We then implemented active learning (Sec \ref{sec:retirement}, prioritising TODO galaxies from the remaining pool of TODO galaxies not yet uploaded. The galaxies are identified with the groups `active\_priority' (selected for 40 classifications) and `active\_baseline' (the remainder). For a strictly random selection, both groups should be excluded. } \DIFadd{Finally, we note that TODO galaxies were erroneously uploaded more than once. The images are equivalent and so our catalogues report the aggregate classifications across all uploads of the same galaxy. In consequence, these galaxies have substantially more total classifications. } \DIFaddend \subsection{Suggested Cuts} Researchers are often interested in identifying specific galaxy populations. {\notebds TODO for Becky - science sentences with a couple of examples. Something like - the population may provide a useful test case, such as two-armed spirals, bulgeless disks, and so forth. Researchers may wish to compare across populations, or to isolate a specific population}. For preliminary analysis, these populations may be roughly identified using cuts on the vote fractions. Table \ref{tab:suggested_cuts} shows our suggested cuts for populations of common interest, based on visual inspection by the authors \DIFaddbegin \DIFadd{and chosen for high specificity (low contamination) at the cost of low sensitivity (completeness)}\DIFaddend . We urge the reader to adjust these \DIFaddbegin \DIFadd{cuts }\DIFaddend to suit the sensitivity and specificity of their science case, to add additional cuts to better select their desired population, and to make their own visual inspection to verify the selected population is as intended. For a full analysis, we suggest the reader avoid cuts by appropriately weighting ambiguous galaxies, or take advantage of the posteriors provided by our automated classifier. \DIFdelbegin \DIFdel{not sure how to make this table full width - anyone know? \DIFdelend \begin{table*} \centering \begin{tabular}{ |p{2.5cm}||p{4cm}|p{1.4cm} |p{4cm}} \hline Population & Approx. Cut & Q. Votes & Notes\\ \hline Featured Disk & $\texttt{featured} > 0.7$ & - & \\ Disk & $\texttt{featured} > 0.3$ & - & Will include featureless S0 \\ Elliptical & $\texttt{smooth} > 0.7$ & - & \\ \hline Strong Bar & $\texttt{strong bar} > 0.8$ & 20 & \\ Weak Bar & $\texttt{weak bar} > 0.8$ & 20 & \\ Any Bar & $\texttt{strong bar} + \texttt{weak bar} > 0.6$ & 20 & \\ \hline Merger & $\texttt{merger} > 0.7$ & - & \\ Merger or Overlap & $\texttt{merger} > 0.3$ & - & To remove overlaps, redshifts or inspection required. \\ Post-Merger & $\texttt{major disturb.} > 0.6$ & - & \\ Asymmetric or Low Surface Brightness & $\texttt{minor disturb.} > 0.4$ & - & \\ \hline \end{tabular} \caption{Suggested cuts for rough identification of galaxy populations, based on visual inspection by the authors. Q. votes is the minimum number of total votes for that question; for example, to identify strong bars, require at least 20 total votes to the question `Does this galaxy have a bar?'. This ensures enough votes to calculate reliable vote fractions. } \label{tab:suggested_cuts} \end{table*} \section{Discussion} What does a classification mean? The comparison of GZ2 and GZ DECaLS images (Fig. \ref{fig:featured_galaxies_big_shift}) highlights that our classifications aim to characterise the clear features of an image, and not what an expert might infer from that image. For example, we might see an image of a galaxy which is broadly smooth, and so answer smooth, even though our astronomical understanding might suggest that the faint features around the galaxy core are likely indicative of spiral arms that would be revealed given deeper images. This situation occurs in several galaxies in Fig. \ref{fig:featured_galaxies_big_shift}. These `raw' classifications \DIFdelbegin \DIFdel{, of the galaxy as pictured, }\DIFdelend will be most appropriate for researchers working on computer vision or on particularly low-redshift, well-resolved galaxies. The redshift-debiased classifications, which are effectively an estimate of galaxy features \textit{not clearly seen} in the image, will be most appropriate for researchers especially interested in fainter features or studying the redshift evolution of galaxies and their properties. We showed in Sec. \ref{sec:comparison_of_decision_trees} that changing the available answers significantly improves our ability to identify weak bars. This highlights that our classifications are only defined in the context of the answers presented. One cannot straightforwardly compare classifications made using different decision trees. Our scientific interests and our understanding of volunteers both evolve, and so our decision trees must also evolve to match them. However, only the last few years of volunteer classifications will use the latest decision tree (based on previous data releases), placing an upper limit on the number of galaxies with compatible classifications at any one time. Our automated classifier resolves this here by allowing us to retrospectively apply the \DIFdelbegin \DIFdel{GZD-C }\DIFdelend \DIFaddbegin \DIFadd{GZD-5 }\DIFaddend decision tree (with better weak bar detection, among other changes) to galaxies only classified by volunteers in \DIFdelbegin \DIFdel{GZD-A and GZD-C}\DIFdelend \DIFaddbegin \DIFadd{GZD-1 and GZD-5}\DIFaddend . This flexibility ensures that Galaxy Zoo will remain able to answer the most pertinent research questions at scale. We have shown (\ref{sec:automated_results}) that our automated classifier is generally highly accurate, well-calibrated, and leads to at least one equivalent science result. However, we cannot exclude the possibility of unexpected systematic biases or of adversarial behaviour from particular images. Avoiding subtle biases and detecting overconfidence on out-of-distribution data remain open computer science research questions, often driven by \DIFdelbegin \DIFdel{importantnoble terrestrial applicationsgoals \mbox \citep{Szegedy2014,Hendrycks2016,Eykholt2017,Smith2018,Hendrycks2019,Geirhos2019,Papernot2016,Moosavi-Dezfooli2017,Ren2019,Chun2020,Yang2020,Margalef-Bentabol2020}}\hspace{0pt }\DIFdelend \DIFaddbegin \DIFadd{important terrestrial applications \mbox \citep{Szegedy2014,Hendrycks2016,Eykholt2017,Smith2018,Geirhos2019,Ren2019,Yang2020,Margalef-Bentabol2020}}\hspace{0pt }\DIFaddend . Volunteers also have biases (e.g a preference for recognising left-handed spirals, \citealt{Land2008}) and \DIFdelbegin \DIFdel{adversarial images }\DIFdelend \DIFaddbegin \DIFadd{struggle with images of an adversarial nature }\DIFaddend (e.g. confusing edge-on disks with cigar-shaped ellipticals), \DIFdelbegin \DIFdel{thoughbut }\DIFdelend \DIFaddbegin \DIFadd{though }\DIFaddend these can often be discovered and resolved through discussion with the community and by adapting the website. We believe the future of morphology classification is in the \DIFdelbegin \DIFdel{intelligent}\footnote{\DIFdel{Thoughtful?}} \addtocounter{footnote}{-1 \DIFdelend \DIFaddbegin \DIFadd{thoughtful }\DIFaddend combination of volunteers and machine learning. Such combinations will be more than just faster; they will be replicable, uniform, error-bounded, and quick to adapt to new tasks. They will let us ask new questions - draw the spiral arms, select the bar length, separate the merging galaxies pixelwise - which would be infeasible with volunteers alone for all but the smallest samples. And they will find the interesting, unusual and unexpected galaxies which challenge our understanding and inspire new research directions. \DIFdelbegin \DIFdel{push us forwards. }\DIFdelend The best combination of volunteer and machine is unclear. Our experiment with active learning is one possible approach, but (when compared to random selection) suffers from complexity to implement, an unknown selection function, and no guarantee - or even clear final measurement of - an improvement in model performance. Many other approaches are suggested in astrophysics \citep{Wright2017,Beck2018,Wright2019,Dickinson2019} and in citizen science and human-computer interaction more broadly \citep{Chang2017,Wilder2020,Liu2020,Bansal2019}. We will continue to search for and experiment with strategies to create the most \DIFdelbegin \DIFdel{useful science data}\DIFdelend \DIFaddbegin \DIFadd{effective contribution to research by volunteers. } \section{Conclusion} We have presented Galaxy Zoo DECaLS; detailed galaxy morphology classifications for 311,488 galaxies imaged by DECaLS DR5 and within the SDSS DR11 footprint. Classifications were collected from volunteers on the Zooniverse citizen science platform over three campaigns, GZD-1, GZD-2, and GZD-5, where GZD-5 used an improved decision tree leading to better identification of weak bars and mergers. All galaxies receive at least five volunteer classifications; galaxies in GZD-1 and GZD-2 receive at least 40, while in GZD-5 only a prioritised subset receive 40. Volunteer classifications are then used to train a deep learning classifier to classify all galaxies. This classifier is able to both learn from uncertain volunteer responses and predict full posteriors, rather than point estimates, for what volunteers would have said. We show that the deep learning classifier is accurate and well-calibrated. We release both volunteer and automated classifications at \href{data.galaxyzoo.org}{data.galaxyzoo.org}, and provide guidance and code examples. \section*{\DIFadd{Acknowledgements}} \label{sec:acknowledgements} \DIFadd{The data in this paper are the result of the efforts of the Galaxy Zoo volunteers, without whom none of this work would be possible. Their efforts are individually acknowledged at }\href{http://authors.galaxyzoo.org}{http://authors.galaxyzoo.org}\DIFadd{. We would also like to thank our volunteer translators; }{\notebds \DIFadd{copy names from /about/team at last minute}} \DIFadd{We would like to thank Dustin Lang for creating the }\href{wwww.legacysurvey.org}{legacysurvey.org} \DIFadd{cutout service and for contributing image processing code. } \DIFadd{MW acknowledges funding from the Science and Technology Funding Council (STFC) Grant Code ST/R505006/1. We also acknowledge support from STFC under grant ST/N003179/1. } {\notebds \DIFadd{TODO all authors, please add your acknowledgements and funding here}} \DIFadd{This research made use of the open-source Python scientific computing ecosystem, including SciPy \mbox \citep{Jones2001}}\hspace{0pt , Matplotlib \mbox \citep{Hunter2007}}\hspace{0pt , scikit-learn \mbox \citep{Pedregosa2011}}\hspace{0pt , scikit-image \mbox \citep{VanderWalt2014} }\hspace{0pt and Pandas \mbox \citep{McKinney2010}}\hspace{0pt . } \DIFadd{This research made use of Astropy, a community-developed core Python package for Astronomy \mbox \citep{TheAstropyCollaboration2018}}\hspace{0pt . } \DIFadd{This research made use of TensorFlow \mbox \citep{tensorflow2015-whitepaper}}\hspace{0pt }\DIFaddend . \DIFaddbegin {\notebds \DIFadd{Not sure how to properly arrange these large figures and appendices - can anyone help?}} \DIFaddend \section*{Appendix A} \begin{figure*} \centering \includegraphics[width=\textwidth]{figures/decals_m0_allq_top_n_bar_strong.png} \caption{Galaxies automatically classified as most likely (highest mean posterior) to be strongly barred.} \label{fig:bar_strong_grid} \end{figure*} \begin{figure*} \centering \includegraphics[width=\textwidth]{figures/decals_m0_allq_top_n_edge-on-bulge_none.png} \caption{Galaxies automatically classified as most likely (highest mean posterior) to be edge-on with no bulge.} \label{fig:edge_on_no_bulge_grid} \end{figure*} \begin{figure*} \centering \includegraphics[width=\textwidth]{figures/decals_m0_allq_top_n_merging_merger.png} \caption{Galaxies automatically classified as most likely (highest mean posterior) to be mergers.} \label{fig:merger_grid} \end{figure*} \begin{figure*} \centering \includegraphics[width=\textwidth]{figures/decals_m0_allq_top_n_spiral-arm-count_1.png} \caption{Galaxies automatically classified as most likely (highest mean posterior) to have exactly one spiral arm.} \label{fig:spiral_1_grid} \end{figure*} \begin{figure*} \centering \includegraphics[width=\textwidth]{figures/decals_m0_allq_top_n_spiral-winding_loose.png} \caption{Galaxies automatically classified as most likely (highest mean posterior) to have loosely wound spiral arms.} \label{fig:winding_loose_grid} \DIFaddbeginFL \end{figure*} \section*{\DIFadd{Appendix B}} \label{sec:decision_trees} \begin{figure*} \centering \includegraphics[width=\textwidth]{figures/gz4_d_tree_crop.pdf} \caption{\DIFaddFL{Decision tree used in GZD-1 and GZD-2, with icons as shown to volunteers.}} \label{fig:gzda_tree} \DIFaddendFL \end{figure*} \bibliographystyle{mnras} \section{Introduction} Morphology is a key driver and tracer of galaxy evolution. For example, bars are thought to move gas inwards \citep{Sakamoto1999} driving and/or shutting down star formation \citep{Sheth2004, Jogee2005}, and bulges are linked to global quenching \citep{Masters2011,Fang2013,Bluck2014} and inside-out quenching \citep{Spindler2017,Lin2019}. Morphology also traces other key drivers, such as the merger history of a galaxy. Mergers support galaxy assembly \citep{Wang2011, Martin2018a}, though their relative contribution is an open question \citep{Casteels2014}, and may create tidal features, bulges, and disks, allowing past mergers to be identified \citep{Hopkins2010, Fontanot2011, Kaviraj2014, Brooks2015}. Unpicking the complex interplay between morphology and galaxy evolution requires measurements of detailed morphology in large samples. While modern surveys reveal exquisite morphological detail, they image far more galaxies than scientists can visually classify. Galaxy Zoo solves this problem by asking members of the public to volunteer as `citizen scientists' and provide classifications through a web interface. Galaxy Zoo has provided morphology measurements for surveys including SDSS \citep{Lintott2008, Willett2013} and large HST programs \citep{Simmons2017, Willett2017a}. Knowing the morphology of homogeneous samples of hundreds of thousands of galaxies supports science only possible at scale. The catalogues produced by the collective effort of Galaxy Zoo volunteers have been used as the foundation of a large number of studies of galaxy morphology (see \citealt{Masters2019a} for a review), with the method's ability to provide estimates of confidence alongside classification especially valuable. Galaxy Zoo measures subtle effects in large populations \citep{Masters2010, Willett2015, Hart2017Stars}; identifies unusual populations that challenge standard astrophysics \citep{Simmons2013,Tojeiro2013,Kruk2017}; and finds unexpected and interesting objects that provide unique data on broader galaxy evolution questions \citep{Lintott2009,Cardamone2009,Keel2015}. Here, we present the first volunteer classifications of galaxy images collected by the Dark Energy Camera Legacy Survey (DECaLS, \citealt{Dey2018}). This work represents the first systematic engagement of volunteers with low-redshift images as deep as those provided by DECaLS, and thus represents a more reliable catalogue of detailed morphology than has hitherto been available. These detailed classifications include the presence and strength of bars and bulges, the count and winding of spiral arms, and the indications of recent or ongoing mergers. Our volunteer classifications were sourced over three separate Galaxy Zoo DECaLS (GZD) classification campaigns, GZD-1, GZD-2, and GZD-5, which classified galaxies first released in DECaLS Data Releases 1, 2, and 5 respectively. The key practical differences are that GZD-5 uses an improved decision tree aimed at better identification of mergers and weak bars, and includes galaxies with just 5 total votes as well as galaxies with 40 or more. Across all campaigns, we collect 7,496,325 responses from Galaxy Zoo volunteers, recording 30 or more classifications in at least one campaign for 139,919 galaxies and fewer (approximately 5 classifications) for an additional 173,870 galaxies, totalling 313,789 classified galaxies. For the first time in a Galaxy Zoo data release, we also provide automated classifications made using Bayesian deep learning \citep{Walmsley2020}. By using our volunteer classifications to train a deep learning algorithm, we can make detailed classifications for all 313,789 galaxies in our target sample, providing morphology measurements faster than would be possible than relying on volunteers alone. Bayesian deep learning allows us to learn from uncertain volunteer responses and to estimate the uncertainty of our predictions. It also allows us to identify which galaxies, if labelled, would be most informative for training our classifier (active learning). We chose to partially focus our volunteers on such informative galaxies, requesting 40 classifications per informative galaxy and only 5 for the remainder. Our classifier predicts posteriors for how volunteers would have answered all decision tree questions\footnote{Excluding the final `Is there anything odd?' question as it is multiple-choice}, with an accuracy comparable to asking 5 to 15 volunteers, depending on the question, and achieving approximately 99\% accuracy on every question for galaxies where the volunteers are confident (volunteer vote fractions below 0.2 or above 0.8). In Section \ref{imaging}, we describe the observations used and the creation of RGB images suitable for classification. In Section \ref{volunteer_classifications}, we give an overview of the volunteer classification process and detail the new decision trees used. In Section \ref{sec:volunteer_analysis}, we investigate the effects of improved imaging and improved decision trees, and we compare our results to other morphological measurements. Then, in Section \ref{sec:automated}, we describe the design and performance of our automated classifier - an ensemble of Bayesian convolutional neural networks. Finally, in Section \ref{sec:usage}, we provide guidance (and example code) for effective use of the classifications. \section{Imaging} \label{imaging} \subsection{Observations} Our galaxy images are created from data collected by the DECaLS survey \citep{Dey2018}. DECaLS uses the Dark Energy Camera (DECam, \citealt{Flaugher2015}) at the 4m Blanco telescope at Cerro Tololo Inter-American Observatory, near La Serena, Chile. DECam has a roughly hexagonal 3.2 square degree field of view with a pixel scale of 0.262 arcsec per pixel. The median point spread function FWHM is $1 \farcs 29$, $1 \farcs 18$ and $1\farcs 11$ for $g$, $r$, and $z$, respectively. The DECaLS survey contributes targeting images for the upcoming Dark Energy Spectroscopic Instrument (DESI). DECaLS is responsible for the DESI footprint in the Southern Galactic Cap (SGC) and the $\delta \leq 34$ region of the Northern Galactic Cap (NGC), totalling 10,480 square degrees\footnote{The remaining DESI footprint is being imaged by DECaLS' companion surveys, MzLS and BASS \citep{Dey2018}}. 1130 square degrees of the SGC DESI footprint are already being imaged by DECam through the Dark Energy Survey (DES, \citealt{TheDarkEnergySurveyCollaboration2005}) so DECaLS does not repeat this part of the DESI footprint. DECaLS implements a 3-pass strategy to tile the sky. Each pass is slightly offset (approx 0.1-0.6 $\deg$). The choice of pass and exposure time for each observation is optimised in real-time based on the observing conditions recorded for the previous targets, as well as the interstellar dust reddening, sky position, and estimated observing conditions of possible next targets. This allows a near-uniform depth across the survey. In DECaLS DR1, DR2, and DR5, from which our images are drawn, the median $5\sigma$ point source depths for areas with 3 observations was approximately (AB) $g$=24.65, $r$=23.61, and $z$=22.84\footnote{See https://www.legacysurvey.org/dr5/description/ and related pages}. The DECaLS survey completed observations in March 2019. \subsection{Selection} \label{sec:selection} We identify galaxies in the DECaLS imaging using the NASA-Sloan Atlas v1.0.0 (NSA). As the NSA was derived from SDSS DR8 imaging \citep{Aihara2011}, this data release only includes galaxies that are within both the DECaLS and SDSS DR8 footprint. In effect, we are using deeper DECaLS imaging of the galaxies previously imaged in SDSS DR8. This ensures our morphological measurements have a wealth of ancillary information derived from SDSS and related surveys, and allows us to measure any shift in classifications vs. Galaxy Zoo 2 using the subset of SDSS DR8 galaxies classified both in this work and in Galaxy Zoo 2 (Sec. \ref{sec:volunteer_analysis}). Figure \ref{fig:footprints} shows the resulting GZ DECaLS sky coverage. NSA v1.0.0 was not published but the values of the columns used here are identical to those in NSA v1.0.1, released in SDSS DR13 \citep{Albareti2017}; only the column naming conventions are different. \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/gz2_decals_coverage.png} \caption{Sky coverage of GZ DECaLS (equatorial coordinates), resulting from the imaging overlap of DECaLS DR5 and SDSS DR8, shown in red. Darker areas indicate more galaxies. Sky coverage of Galaxy Zoo 2, which used images sourced from SDSS DR7, shown in light blue. The NSA includes galaxies imaged by SDSS DR8, including galaxies newly imaged at the Southern Galactic Cap (approx. $2500\deg^2$)} \label{fig:footprints} \end{figure} Selecting galaxies with the NSA introduces two implicit cuts. First, the NSA primarily includes galaxies brighter than $m_r=17.77$, the SDSS spectroscopic target selection limit. Galaxies fainter than $m_r=17.77$ are included only if they are in deeper survey areas (e.g. Stripe82) or were measured using `spare' fibres after all brighter galaxies in a given field were covered; we suggest researchers enforce their own magnitude cut according to their science case. Second, the NSA only covers redshifts of $z=0.15$ or below. To these implicit cuts, we add an explicit cut requiring Petrosian radius (the NSA v1.0.0 \texttt{PETROTHETA}\footnote{Azimuthally-averaged SDSS-style Petrosian radius, derived from the r band. See \cite{Albareti2017} and the \href{https://data.sdss.org/datamodel/files/ATLAS_DATA/ATLAS_MAJOR_VERSION/nsa.html}{NSA v1.0.1 data model}.} column) of at least 3 arcseconds, to ensure the galaxy is sufficiently extended for meaningful classification. For each galaxy, if the coordinates had been imaged in the $g$, $r$ and $z$ bands, and the galaxy passed the selection cuts above, we acquired a combined FITS cutout of the $grz$ bands from the DECaLS cutout service (www.legacysurvey.org). Galaxy Zoo presents volunteers with $424 \times 424$ pixel square galaxy images. GZD-1 and GZD-2 acquired $424 \times 424$ pixel square FITS cutouts directly from the cutout service. To ensure that galaxies typically fit well within a 424 pixel image, cutouts were downloaded with an interpolated pixel scale $s$ of \begin{equation} s = \max(\min(0.04 p_{50}, 0.02 p_{90}), 0.1) \end{equation} where $p_{50}$ is the Petrosian 50\%-light radius and $p_{90}$ is the Petrosian 90\%-light radius. Approximately 1\% of galaxies have incorrectly large radii reported in the NSA (typically as a result of foreground stars or other interloping sources) and this causes the field to be incorrectly large and hence the target galaxy to appear incorrectly small. To allow researchers to mitigate this issue, we flag images for which there are more source pixels away from the centre than near the centre; specifically, for which the mean distance of all likely source pixels\footnote{Arbitrarily defined as pixels with double the 20th percentile band-averaged value after the scaling in Sec. \ref{sec:image_construction}.} exceeds 161 (approximately the expected value for all pixels). We find by eye that this simple procedure identifies the worst-affected galaxies. We report the mean source pixel distance and distance flags as \texttt{wrong\_size\_statistic} and \texttt{wrong\_size\_warning}, respectively. For GZD-5, to avoid banding artifacts caused by the interpolation method of the DECaLS cutout service, each FITS image was downloaded at the fixed native telescope resolution of 0.262 arcsec$^2$ per pixel\footnote{Up to a maximum of 512 pixels per side. Highly extended galaxies were downloaded at reduced resolution such that the FITS had exactly 512 pixels per side.}, with enough pixels to cover the same area as 424 pixels at the interpolated pixel scale $s$. These individually-sized FITS were then resized locally up to the interpolated pixel scale $s$ by Lanczos interpolation \citep{Lanczos1938}. Image processing is otherwise identical between campaigns. Galaxies with incomplete imaging, defined as more than 20\% missing pixels in any band, were discarded. For GZD-1/2, 92,960 of 101,252 galaxies had complete imaging (91.8\%). For GZD-5, 216,106 of 247,746 galaxies not in DECaLS DR1/2 had complete imaging (87.2\%)\footnote{Note that these numbers do not sum to the total number of galaxies classified across both campaigns because some galaxies are shared between campaigns.}. \subsection{RGB Image Construction} \label{sec:image_construction} We convert the measured \textit{grz} fluxes into RGB images following the methodology of \cite{Lupton2004}. To use the \textit{grz} bands as RGB colours, we multiply the flux values in each band by 125.0, 71.43, and 52.63, respectively. These numbers are chosen by eye\footnote{By Dustin Lang, who we gratefully acknowledge.} such that typical subjects show an appropriate range of color once mapped to RGB channels. For background pixels with very low flux, and therefore high variance in the proportion of flux per band, naively colouring by the measured flux creates a speckled effect \citep{Willett2017a}. As an extreme example, a pixel with 1 photon in the $g$ band and no photons in $r$ or $z$ would be rendered entirely red. To remove these colourful speckles, we desaturate pixels with very low flux. We first estimate the total per-pixel photon count $N$ assuming an exposure time of 90 seconds per band and a mean photon frequency of 600nm. Poisson statistics imply the standard deviation on the total mean flux in that pixel is proportional to $\sqrt{N}$. For pixels with a standard deviation below 100, we scale the per-band deviation from the mean per-pixel flux by a factor of 1\% of the standard deviation. The effect is to reduce the saturation of low-flux pixels in proportion to the standard deviation of the total flux. Mathematically, we set \begin{equation} X^{\prime}_{ijc} = \overline{X_{ij}} + \alpha (X_{ijc} - \overline{X_{ij}}) \quad \text{where} \quad \alpha = \min(0.01 \sqrt{\overline{X_{ij}}T / \lambda}, 1) \quad \end{equation} where $X_{ijc}$ and $X^{\prime}_{ijc}$ are the flux at pixel $ij$ in channel $c$ before and after desaturation, $\overline{X_{ij}}$ is the mean flux across bands at pixel $ij$, $T$ is the mean exposure time (here, 90 seconds) and $\lambda$ is the mean photon wavelength (here, 600\,nm). Pixel values were scaled by $\text{arcsinh}(x)$ to compensate for the high dynamic range typically found in galaxy flux, creating images which can show both bright cores and faint outer features. To remove the very brightest and darkest pixels, we linearly rescale the pixel values to lie on the $(-0.5,\ 300)$ interval and then clip the pixel values to 0 and 255 respectively. We use these final values to create an RGB image using \texttt{pillow} \citep{Kemenade2020}. The images are available on Zenodo at \href{https://doi.org/10.5281/zenodo.4573248}{https://doi.org/10.5281/zenodo.4573248}. The code used to download the FITS cutouts and convert them to RGB images is available on GitHub for \href{https://github.com/willettk/decals/blob/b55170aadbfd6ceccd078d6119821db00311e9dd/python/decals.py}{GZD-1}, \href{https://github.com/willettk/decals/blob/master/python/decals_dr2.py}{GZD-2} and \href{https://github.com/zooniverse/decals/blob/master/decals/a_download_decals/get_images/download_images_threaded.py}{GZD-5}. \section{Volunteer Classifications} \label{volunteer_classifications} Volunteer classifications for GZ DECaLS were collected during three campaigns. GZD-1 and GZD-2 classified all 99,109 galaxies passing the criteria above from DECALS DR1 and DR2, respectively. GZD-1 ran from September 2015 to February 2016, and GZD-2 from April 2016 to February 2017. GZD-5 classified 262,000 DECALS DR5-only galaxies passing the criteria above. GZD-5 ran from March 2017 to October 2020. GZD-5 used more complex retirement criteria aimed at improving our automated classification (\ref{sec:retirement}) and an improved decision tree aimed at better identification of weak bars and minor mergers (\ref{sec:comparison_of_decision_trees}). This iteration of the Galaxy Zoo project used the infrastructure made available by the Zooniverse platform; in particular, the \href{https://github.com/zooniverse/panoptes}{open source Panoptes platform} \citep{TheZooniverseTeam2020}. The platform allows for the rapid creation of citizen science projects, and presents participating volunteers with one of a subject set of images chosen either randomly, or through criteria described in section \ref{sec:retirement}. \subsection{Selecting Total Classifications} \label{sec:retirement} \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/latest_totals_per_dr.pdf} \caption{GZD-1, GZD-2 and GZD-5 classification counts, excluding implausible classifications (Sec. \ref{sec:volunteer_weighting}). GZD-1 has approximately 40-60 classifications, GZD-2 has approximately 40, and GZD-5 has either approximately 5 or approximately 30-40. 5.9\% of GZD-5 galaxies received more than 40 classifications due to mistaken duplicate uploads.} \label{fig:classification_counts} \end{figure} How many volunteer classifications should each galaxy receive? Ideally, all galaxies would receive enough classifications to be confident in the average response (i.e. the vote fraction) while still classifying all the target galaxies within a reasonable timeframe. However, the size of modern surveys make this increasingly impractical. Collecting 40 volunteer classifications for all 314,000 galaxies in this data release would have taken around eight years without further promotion efforts. The larger data sets of future surveys will only be more challenging. In anticipation of future classification demands, we have therefore implemented a variable retirement rate here \citep[motivated and described further in][]{Walmsley2020}. Unlike previous data releases, GZ DECaLS galaxies each received different numbers of classifications (Figure \ref{fig:classification_counts}). Beginning part-way through GZD-5, we prioritise classifications for the galaxies expected to most improve our machine learning models, and rely more heavily on those models for classifying the remainder. For GZD-1 and GZD-2, all galaxies received at least 40 classifications\footnote{Note that because classifications from volunteers who respond `artifact' at implausibly high rates are discounted, the total classifications in Fig. \ref{fig:classification_counts} and the published catalog are slightly lower - see Sec. \ref{sec:volunteer_weighting}.} (as with previous data releases). GZD-1 galaxies have between 40 and 60 classifications, selected at random, while GZD-2 galaxies all have approximately 40. For GZD-5, galaxies classified until June 2019 also received approximately 40 classifications. From June 2019, we introduced an active learning system. Using active learning, galaxies expected to be the most informative for training our deep learning model received 40 classifications, and the remaining galaxies received at least 5 classifications. By `most informative', we mean the galaxies which, if classified, would most improve the performance of our model. We describe our method for estimating which galaxies would be most informative in full in \cite{Walmsley2020}. Briefly, we use a convolutional neural network to make repeated predictions for the probability that $k$ of $N$ total volunteers select `Featured' to the `Smooth or Featured' question\footnote{`Artifact' answers are sufficiently rare that we chose to ignore votes for this answer when calculating which galaxies to label.}. For each prediction, we randomly permute the network with MC Dropout \citep{Gal2016Uncertainty}, approximating (roughly) training many networks to make predictions on the same dataset. It can be shown that, under some assumptions, the most informative galaxies will be the galaxies with confidently different predictions under each MC Dropout permutation; that is, where the permuted networks confidently disagree \citep{Houlsby2014}. Formally, we acquire (label with volunteers) the galaxies with the highest estimated mutual information, given by: \begin{equation} \label{eqn:acquisition} \begin{split} \mathbb{I}[k, w] & = \\ & - \sum_{k=0}^{N} \langle\text{Bin}(k|f^w(x), N)\rangle \log[ \langle\text{Bin}(k|f^w(x), N)\rangle] \\ & + \langle \sum_{k=0}^{N} \text{Bin}(k|f^w(x), N) \log[ \text{Bin}(k|f^w(x), N)] \rangle \end{split} \end{equation} where $f^w(x)$ is the output of the neural network trained to predict the typical volunteer response following \cite{Walmsley2020} and $\text{Bin}(k|f^w(x), N)$ is the probability for $k$ of $N$ volunteers to answer `Featured' to `Smooth or Featured' given that network-estimated typical response. Angled brackets indicate the expectation over the distribution of weights, approximated as the expectation over MC Dropout permutations. In short, the negative term gives the entropy of the volunteer vote distribution given the mean model predictions, and the positive term gives the mean entropy from the predictions of each permuted model. The difference between these terms measures the degree of confident disagreement between permuted models. See \cite{Walmsley2020} for more. We used the same architecture and loss function as in \cite{Walmsley2020} while concurrently developing the more sophisticated classifier introduced in this Section. The initial training set was all GZD-5 galaxies fully classified ($N > 36$) by the time of activation. Each active learning cycle proceeded as follows. The model was retrained with all galaxies fully classified by the cycle start date. Next, unlabelled galaxies were ranked by mutual information (Eqn. \ref{eqn:acquisition}) and the most informative 1000 of a random 32768\footnote{To allow for out-of-memory shuffling, binary-encoded galaxy images were stored in `shards' of 4096 galaxies each. 32,768 corresponds to 8 such shards} galaxies were uploaded. Once those galaxies were fully classified by volunteers (typically in 1-4 weeks) the cycle was repeated. 6,939 total galaxies were uploaded in total\footnote{Technical errors with duplicate uploads led to some active-learning-prioritised galaxies receiving more than 40 classifications; the median number of classifications is 44.}. We chose to select from a subset of galaxies not yet classified for two reasons. The first was for computational efficiency: calculating the acquisition function requires making 5 predictions per galaxy. The second was that ad hoc experiments showed that galaxies with the very highest acquisition function values were often highly unusual and might be \textit{too} unusual to learn from effectively. We also added a retirement rule to retire galaxies receiving 5 classifications of `artifact', to help avoid volunteers being presented with these prioritised artifacts. We emphasise that the number of classifications each galaxy received under active learning \textit{is not random}. Figure \ref{fig:active_learning_metadata} shows how active-learning-prioritised galaxies are dramatically more featured and slightly more extended than the previously-classified random galaxies, matching our intuition that small `smooth' elliptical galaxies are easier to classify and hence less informative than extended `featured' galaxies. For details on handling this and other selection effects, see Sec. \ref{sec:usage}. \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/active_learning_featured_and_petrotheta.pdf} \caption{`Featured' vote fraction and Petrosian radius (as measured by the NSA \texttt{PETROTHETA} column) for galaxies selected either at random (prior to enabling active learning) or prioritised as informative. Prioritised galaxies are dramatically more featured and slightly more extended than the previously-classified random galaxies.} \label{fig:active_learning_metadata} \end{figure} \subsection{Decision Trees} \label{sec:decision_trees_intro} The questions and answers we ask our volunteers define the measurements we can publish. It is therefore critical that the Galaxy Zoo decision tree matches the science goals of the research community. The questions in a given Galaxy Zoo workflow are designed to be answerable even by a classifier with little or no astrophysical background. This motivates a focus primarily on the appearance of the galaxy, rather than incorporating physical interpretations which would require prior knowledge of galaxies. As an example, the initial question in all decision trees from Galaxy Zoo 2 onwards has asked the viewer to distinguish primarily between ``smooth'' and ``featured'' galaxies, rather than ``elliptical'' and ``disk'' galaxies. This distinction between descriptive and interpretive classification is not always perfectly enforced. For example, the ``features'' response to the initial question is worded as ``features or disk'', and a later question asks whether the galaxy is ``merging or disturbed'', which requires some interpretation\footnote{The step from visual description to interpretation may explain why a model trained by \cite{Fischer2018} on expert T-Type labels makes more confident predictions than volunteers on whether a subset of low-mass GZ2 galaxies show spiral structure; see \cite{Peterken2021}.}. To aid classifiers, all iterations of Galaxy Zoo have therefore included illustrative icons in the classification interface. Additional help is also available; in the current project, the interface includes a brief tutorial, a detailed field guide with multiple examples of each type of galaxy, and specific help text available for each individual classification task. The largest workflow change between Galaxy Zoo versions was between the original Galaxy Zoo (GZ1) and Galaxy Zoo 2 (GZ2). GZ1 presented classifiers with a single task per galaxy, a choice between smooth/elliptical, multiple versions of featured/disk (including edge-on, face-on, and directionality of spiral structure), and merger. GZ2 re-classified the brightest quarter of the GZ1 sample in much greater detail, including a branched, multi-task decision tree. Subsequent changes to the decision tree for different versions of Galaxy Zoo have been mostly iterative in nature, driven in part by the data itself and in part by experience-based reflection which revealed minor adjustments that could help classifiers provide more accurate information. As an example of the former, a new branch was added for GZ-Hubble and GZ-CANDELS to capture information on star-forming clumps in classifications of higher-redshift galaxies. As an example of the latter, the final 2 tasks of GZ2 have been adjusted over multiple versions to facilitate reliable identification of rare features. Such adjustments have generally been minimized to avoid complicating comparisons with previous campaigns. The decision tree used for GZD-1 and GZD-2 has three modifications vs. the Galaxy Zoo 2 decision tree \citep{Willett2013}. The `Can't Tell' answer to `How many spiral arms are there?' was removed, the number of answers to `How prominent is the central bulge?' was reduced from four to three, and `Is the galaxy currently merging, or is there any sign of tidal debris?' was added as a standalone question. For GZD-5, we made three further changes. Several Galaxy Zoo studies (e.g. \citealt{Skibba2012, Masters2012, Willett2013, Kruk2018}) found that galaxies selected with 0.2<$p_\mathrm{bar}$<0.5 in GZ2 correspond to `weak bars' when compared with expert classification such as those in \cite{Nair2010}. Therefore, to increase the detection of bars, we changed the possible answers to the `Does this galaxy have a bar?' question from `Yes' or `No' to `Strong', `Weak' or `No'. We define a strong bar as one that is clearly visible and extending across a large fraction of the size of the galaxy. A weak bar is smaller and fainter relative to the galaxy, and can appear more oval than the strong bar, while still being longer in one direction than the other. Our definition of strong vs. weak bar is similar that of \cite{Nair2010}, with the exception that they also have an `intermediate' classification. We added examples of galaxies with `weak bars' to the Field Guide and provided a new icon for this classification option, as shown in Figure \ref{fig:decision_tree}. Second, to allow for more fine-grained measurements of bulge size, we increased the number of `How prominent is the central bulge?' answers from three (`No', `Obvious', `Dominant') to five (`No Bulge', `Small', `Moderate', `Large', `Dominant'). We also re-included the `Can't Tell' answer. Third, we modified the `Merging' question from `Merging', `Tidal', `Both', or `None', to the more phenomenological `Merging', `Major Disturbance', `Minor Disturbance', or `No'. Our goal was to present more direct answers to our volunteers and to better distinguish major and minor mergers, to support recent scientific interest in the role of major and minor mergers on mass assembly \citep{Lopez-Sanjuan2010, Kaviraj2013Minor}, black hole accretion \citep{Alexander2012, Simmons2017a}, and morphology \citep{Hopkins2009a, Lotz2011, Lofthouse2017}. We made this final `merger' change two months after launching GZD-5; 6722 GZD-5 galaxies (2.7\%) were fully classified before that date and so do not have responses from volunteers to this question. We also make several improvements to the illustrative icons shown for each answer. These icons are the most visible guide for volunteers as to what each answer means (complementing the tutorial, help text, field guide, and `Talk' forum). Figure \ref{fig:decision_tree} shows the GZD-5 decision tree with new icons as shown to volunteers. The decision tree used in GZD-1 and GZD-2 is shown in Figure \ref{fig:gzda_tree}. For the `Smooth or Featured?' question, we changed the `Smooth' icon to include three example galaxies at various ellipticities, and the `Featured' icon to include an edge-on disk rather than a ring galaxy. For `Edge On?', we replaced the previous tick icon with a new descriptive icon, and the previous cross icon with the `Featured' icon above. We also modified the text to no longer specify `exactly' edge on, and renamed the answers from `Yes' and `No' to `Yes - Edge On Disk' and 'No - Something Else'. For `Bulge?', we created new icons to match the change from four to five answers. For `Bar', we replaced the previous tick and cross icons with new descriptive icons for `Strong Bar', `Weak Bar' and `No Bar'. For `Merger?', we added new descriptive icons to match the updated answers. \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/dr5_tree_with_icons_new_format_larger_arrows_inverted.png} \caption{Classification decision tree for GZD-5, with new icons as shown to volunteers. Questions shaded with the same colours are at the same level of branching in the tree; grey have zero dependent questions, green one, blue two, and purple three. } \label{fig:decision_tree} \end{figure} Changes to the decision tree complicate comparisons other Galaxy Zoo projects. As we show in the following sections, the available answers will affect the sensitivity of volunteers to certain morphological features, and so morphology measurements made with different decision trees may not be directly comparable. This difficulty in comparison has historically required us to be conservative in our changes to the decision tree. However, the advent of effective automated classifications allows us to retrospectively make classifications using any preferred decision tree. Specifically, in this work, we train our automated classifier to predict what volunteers would have said using the GZD-5 decision tree, for galaxies which were originally classified by volunteers using the GZD-1/2 decision tree (Section \ref{sec:bayesian_classifier}). \section{Volunteer Analysis} \label{sec:volunteer_analysis} \subsection{Improved Feature Detection from DECaLS imagery} \label{comparison_to_gz2} The images used in GZ DECaLS are deeper and higher resolution than were available for GZ2. The GZ2 primary sample \citep{Willett2013} uses images from SDSS DR7 \citep{Abazajian2009}, which are 95\% complete to $r=22.2$ with a median seeing of 1 \farcs 4 and a plate scale of 0\farcs396 per pixel \citep{York2000}. In contrast, GZ DECaLS uses images from DECaLS DR2 to DR5, which have a median 5$\sigma$ point source depth of $r=23.6$, a seeing better than 1\farcs3 for at least one observation, and a plate scale of 0\farcs262 per pixel \citep{Dey2018}\footnote{See also http://www.legacysurvey.org/dr5/description/}. We expect the improved imaging to reveal morphology not previously visible, particularly for features which are faint (e.g. tidal features, low surface brightness spiral arms) or intricate (e.g. weak bars, flocculent spiral arms). Our changes to the decision tree (Sec. \ref{sec:decision_trees_intro}) were partly made to better exploit this improved imaging. To investigate the consequences of improved imaging, we compare galaxies classified in both GZ2 and GZ DECalS. Galaxies will typically be classified by both projects if they are inside both the SDSS DR7 Legacy catalogue (i.e. the source GZ2 catalogue) and DECaLS DR5 footprints (broadly, North Galactic Cap galaxies with $-35 < \delta < 0$) and match the selection criteria of each project (see \citealt{Willett2013} and Sec. \ref{sec:selection}). GZ2's $r < 17.0$ cut, with no corresponding GZ DECaLS magnitude cut, means that the the odds of any given GZ2 galaxy being in GZ DECaLS is close to random (for an isotropic sky) but only the brighter half of suitably-located GZ DECaLS galaxies are in GZ2. To exclude the effect of modifying the decision tree in GZD-5 (addressed separately in Sec \ref{sec:comparison_of_decision_trees}), we use only GZ DECaLS classifications from GZD-1 and GZD-2. 33,124 galaxies were classified in both GZ2 and GZD-1 or GZD-2. We find that volunteers successfully recognise newly-visible morphology features. Figure \ref{fig:featured_comparison} compares the distribution of vote fractions to `Is this galaxy smooth or featured?' for GZ2 and GZ DECaLS. Ambiguous galaxies, with `featured' fractions (before debiasing) between approx. 0.25 and 0.75, are consistently reported as more featured (median absolute increase of 0.13, median percentage increase of 22\%) with the deeper GZ DECaLS images. \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/featured_comparison.pdf} \caption{Comparison of `Featured' fraction for galaxies classified in both GZ2 and GZ DECaLS. Ambiguous galaxies are consistently reported as more featured in GZ DECaLS, which we attribute to the significantly improved imaging depth of DECaLS.} \label{fig:featured_comparison} \end{figure} The shift towards featured galaxies is an accurate response to the new images, rather than systematics from (for example) a changing population of volunteers. Figure \ref{fig:featured_galaxies_big_shift} compares the GZ2 and GZ DECaLS images of a random sample of galaxies drawn from the 1000 cross-classified galaxies with the largest increase in `featured' fraction. In all of these galaxies (and for a clear majority of galaxies in similar samples), volunteers are correctly recognising newly visible detailed features. \begin{figure} \includegraphics[width=\columnwidth,trim={0 5cm 0 5cm},clip]{figures/featured_galaxies_big_shift.png} \caption{GZ2 and GZ DECaLS images for 6 galaxies drawn randomly from the 1000 galaxies classified in both projects with the largest increase in `featured' vote fraction (reported fractions shown in red). The increased fraction accurately reflects the increased visibility of detailed morphology from improved imaging.} \label{fig:featured_galaxies_big_shift} \end{figure} We observe a similar pattern in the vote fractions of spiral arms and bars for featured galaxies. For galaxies consistently considered featured (i.e. where both projects reported a `featured' vote fraction of at least 0.5), the median vote fraction for spiral arms increased from 0.84 to 0.9, and for bars from 0.21 to 0.24. This suggests that even for galaxies where some details were already visible (and hence were considered featured), improved imaging makes our volunteers more likely to identify specific features. We argue the improved depth of DECaLS ($r=23.6$ vs $r=22.2$ for SDSS) is revealing low surface brightness features that were previously ambiguous. There may also be contributions from the modified image processing approach and from the shift between using $gri$ bands (SDSS) to $grz$ bands (DECaLS), which might make older stars more prominent. Comparing classifications made using the same possible answers on the same galaxies shows how improved DECaLS imaging leads to ambiguous galaxies being correctly reported as more featured, and to spiral arms and bars being reported with more confidence. However, volunteers are also sensitive to which questions are asked and how those questions are asked. We measure the impact of our changes to the decision tree `Bar' question for GZD-5 in the next section. \subsection{Improved Weak Bar Detection from GZD-5 Decision Tree} \label{sec:comparison_of_decision_trees} To measure the effect of the new decision tree on bar sensitivity, we compare the classifications made using each tree against expert classifications. \citealt{Nair2010} (hereafter NA10) classified all 14,034 SDSS DR4 galaxies at $0.01 < z < 0.05$ with $g < 16$. Of those, 1497 were imaged by DECaLS DR1/2 and classified by volunteers during GZD-1/2. We re-classified these galaxies during GZD-5 to measure the effect of the new bar answers, as compared to the expert classifications of NA10. Note that because NA10 used shallower SDSS images, NA10's classifications are best used as positive evidence; while NA10 finding a bar in SDSS images implies a visible bar in DECaLS images, NA10 not finding a bar may not always exclude a visible bar in DECaLS. To exclude smooth galaxies, which are unbarred by definition in our schema, we require $f_{\text{featured}} > 0.25$ (as measured by GZD-5), selecting a featured sample of 807 galaxies classified by NA10, GZD-1/2, and GZD-5. Figure \ref{fig:bar_any_comparison} compares volunteer classifications for expert-labelled calibration galaxies made using each tree. We find that barred and unbarred galaxies are significantly better separated with the Strong/Weak/None answers than with Yes/No answers. Of 220 Nair-identified bars (of any type), 184 (84\%) receive a majority vote for being barred by volunteers using the new tree, up from 120 (55\%) with the previous tree. \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/bar_any_comparison.pdf} \caption{ Left: Distribution of fraction of GZD-1/2 volunteers answering `Yes' (not `No' to `Does this galaxy have a bar?', split by expert classification from NA10 of barred (blue) or unbarred (orange). Right: as left, but for GZD-5 volunteers answering `Strong' or `Weak' (not `No'). Volunteers are substantially better at identifying barred galaxies using the GZD-5 three-answer question. } \label{fig:bar_any_comparison} \end{figure} NA10 classified barred galaxies into five subtypes: Strong, Intermediate, Weak, Nuclear, Ansae, and Peanut (plus None, implicitly). We can use the first three subtypes as a measurement of expert-classified bar strength, and therefore evaluate how our volunteers respond to bars of different strengths. Following the approach to defining summary metrics of \cite{Masters2019}, we summarise the bar vote fractions into a single volunteer estimate of bar strength, $B_\text{vol} = f_{\text{strong}} + 0.5 f_{\text{weak}}$, and compare the distribution of $B$ for each expert-classified bar strength (Figure \ref{fig:bar_answer_comparison}). We find that the volunteer bar strength estimates increase smoothly with expert-classified bar strength, though individual galaxies vary substantially. This suggests that typical bar strength in galaxy samples can be successfully inferred from volunteer votes. \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/bar_answer_comparison_grid.pdf} \caption{ Distributions of volunteer bar strength estimates, $B_\text{vol} = f_{\text{strong}} + 0.5 f_{\text{weak}}$, split by expert-classified (NA10) bar strength. Individual galaxies are shown with rug plots (15 Strong, 110 Intermediate, 87 Weak, and 377 None). Volunteer bar strength estimates increase smoothly with expert-classified bar strength, though individual galaxies vary substantially. } \label{fig:bar_answer_comparison} \end{figure} The addition of the `weak bar' answer in GZD-5 significantly improves sensitivity to bars compared with previous versions of the decision tree. Additionally, volunteer votes across the three answers may be used to infer bar strength. We hope that the detailed bar classifications in our catalogue will help researchers better understand the properties of strong and weak bars and their influence on host galaxies. \subsection{Classification Modifications} \label{sec:classification_modificatons} Galaxy Zoo data releases have previously included two post-hoc modifications to the volunteer classifications; volunteer weighting, to reduce the influence of strongly atypical volunteers, and redshift debiasing, to estimate the vote fractions a galaxy might have received had it been observed at a specific redshift. We describe each modification below. \subsubsection{Volunteer Weighting} \label{sec:volunteer_weighting} Volunteer weighting, as introduced in Galaxy Zoo 2 \citep{Willett2013}, assigns each volunteer an aggregation weight of (initially) one, and iteratively reduces that weight for volunteers who typically disagree with the consensus. This method affects relatively few volunteers and therefore causes only a small shift in vote fractions - in Galaxy Zoo 2, for example, approximately 95\% of volunteers had a weighting of one (i.e. unaffected), 94.8\% of galaxies had a change in vote fraction of no more than 0.1 for any question, and the mean change in vote fraction across all questions and galaxies was 0.0032. The most significant change in final vote fractions is caused by down-weighting rare (approx. 1\%) volunteers who repeatedly disagree with consensus by answering `artifact' at implausibly high rates (including 100\%) for many galaxies. Answering artifact ends the classification and shows the next galaxy, and so we hypothesise that these rare volunteers are primarily interested in seeing many galaxies rather than contributing meaningful classifications. There are very few such volunteers, but because answering artifact allows classifications to be submitted very quickly, they have an outsize effect on the aggregate vote fractions. Figure \ref{fig:artifact_fractions} shows the distribution of reported artifact rates for volunteers with at least 150 total classifications. We expect the true fraction of artifacts to be less than 0.1, and the vast majority of volunteers report artifact rates consistent with this. However, the distribution is bimodal, with a small second peak around 1.0 (i.e. volunteers reporting every galaxy as an artifact). To remove the implausible mode, we discard the classifications of volunteers with at least 150 total classifications and reported artifact rates greater than 0.5. In GZD-1/2, 1.1\% (643) of volunteers are excluded, discarding 11\% (483,081) of classifications. In GZD-5, 0.03\% (543) volunteers are excluded, discarding 5.3\% (249,592) of classifications. \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/gzd_artifact_hists.pdf} \caption{ Distribution of reported `artifact' rates by volunteer (i.e. how often each volunteer answered `artifact' over all the galaxies they classified). The vast majority report artifact rates consistent with those of the authors (below 0.1), but a very small subset report implausibly high artifact rates $(> 0.5)$ and consequently have their classifications discarded. Only volunteers with at least 150 classifications are shown; the distribution for volunteers with fewer classifications is not bimodal. } \label{fig:artifact_fractions} \end{figure} We investigated the possibility of other groups of atypical volunteers giving similar answers across questions by analysing the per-user vote fractions with either a two-dimensional visualisation using UMAP \citep{McInnes2018} or with clustering using HDBSCAN \citep{McInnes2017}. We find no strong evidence that such clusters exist. \subsubsection{Redshift Debiasing} \label{sec:redshift_debiasing} \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/dr5_debiased_vote_frac.pdf} \caption{Number of GZD-5 galaxies with $f > 0.5$ for each of the questions debiased using the method described \ref{sec:redshift_debiasing}. The solid lines indicate the original vote fractions and the dashed lines indicate the debiased vote fractions. The total sample here is composed of galaxies in the luminosity-limited sample with $f > 0.5$, 58,916 galaxies. For most questions and answers, debiasing successfully flattens the redshift trends. For `Smooth or Featured' and `Bulge Prominence', redshift debiasing overcorrects.} \label{fig:debiasing} \end{figure} Galaxies at higher redshifts appear fainter and smaller on the sky, making it harder to detect detailed morphological features than if the galaxy were closer. This creates a bias in visual classifications (whether human or automated) where galaxies of the same intrinsic morphology are less likely to be classified as having detailed features as redshift increases \citep{Bamford2009}. Redshift debiasing is an attempt to mitigate this bias by estimating how a galaxy would appear if it were at a fixed low redshift (here, $z=0.02$). We use the method described in \citet{Hart2016} to remove the redshift bias, which we briefly summarise here and refer the reader to their Section 3 for full details. We assume the morphological properties of galaxies (as probed by our decision tree) over the redshift window covered by Galaxy Zoo DECaLS ($0.02<z<0.15$, approximately 1.5 Gyr) do not evolve significantly for galaxies of similar intrinsic brightness and physical size, and so, for a luminosity-limited sample, any change we observe to the vote fraction distribution as a function of redshift is purely a consequence of imaging. If so, we can estimate the vote fractions which would be observed if each galaxy were at low redshift by modifying the vote fractions of higher-redshift galaxies such that they have the same overall distribution as their low-redshift counterparts in brightness and size. We base the debiasing on a \textit{luminosity-limited sample}, selected between $0.02<z<0.15$ and $-21.5>M_r>-23$. We consider the galaxies with at least 30 votes for the first question (`Smooth or Featured') after volunteer weighting (above), for a total of 87,617 galaxies in GZD-1/2 and 58,916 galaxies in GZD-5. For each question, separately, we define a subset of galaxies to which we apply the debiasing procedure. Each subset is defined using a cut of $f > 0.5$ for the chain of preceding questions (for example, for the bar question, we require $f_{\text{feat}} \times f_{\text{not edge-on}} > 0.5$). A further cut of $N > 5$ (where N is the number of classifications) is also imposed to ensure that each galaxy has been classified by a significant number of people. We bin the subset of galaxies by $M_r$, $\log(R_{50})$ and $z$ for each answer in turn. We use the \texttt{voronoi\_2d\_binning} package from \cite{Cappellari2003} to ensure the bins will have an approximately equal number of galaxies (with a minimum of 50). We then match vote fraction distributions on a bin-by-bin basis, such that the cumulative distribution of vote fractions at each redshift is shifted to be similar to that of the lowest redshift sample ($0.02<z<0.03$). This method aims to keep the fraction of galaxies above a given threshold constant with redshift. The effect of redshift bias and redshift debiasing question is shown in Fig. \ref{fig:debiasing}. To illustrate, consider the `Smooth or Featured' question (top left). In a luminosity-limited sample, there should be the same fraction of galaxies with features (selected with $f_{\text{feat}} > 0.5$) at all redshifts. However, we observe that the fraction of `featured' galaxies decreases, and the fraction of `smooth' galaxies increases (solid lines). We attribute this to redshift bias; some galaxies that would be considered featured if imaged at low redshift appear as `fuzzy blobs' at high redshift and are instead classified as smooth. After applying redshift debiasing, the debiased fractions (dashed lines) change more gradually with redshift. For most questions and answers, the redshift trend is successfully flattened (recall that for every size and luminosity bin, we enforce no change in the vote fraction distribution with redshift). For `Smooth or Featured' and `Bulge Prominence', the debiasing procedure overcorrects and hence reverses the redshift trend. For statistical studies it is important to test for the presence of a classification bias with redshift and correct it where necessary. Such a correction has proven essential in studies of the morphology density relation \citep{Bamford2009} and when characterising populations with different spiral arm properties \citep{Hart2016}. However, while debiasing can be extremely useful, there are caveats to its usage. It is sometimes helpful to think of the original classifications as a lower limit to the probability of features of a given type existing in a galaxy. Debiasing predicts what the classifications would be if the same galaxy were imaged at lower redshift, which is typically more featured than the original classifications. There is substantial uncertainty in this prediction, however, and this is currently not captured by the debiased vote fractions, which are reported without error bars. In some investigations it may be helpful to consider that the true classification for a given galaxy is likely to be in between the original classification and the debiased classification. At the same time, the debiased classifications are not strictly upper limits. They are based on the lowest-redshift classifications within the dataset itself, which themselves are at a non-zero redshift, and so there are likely differences in the debiased classifications and the `true' debiased classification that would be assigned if we could image the galaxy at arbitrarily-low redshift. As these corrections are applied uniformly, however, they are useful when considering overall populations of galaxies within a given dataset and over the redshift ranges where the correction is relevant. In particular, when \emph{comparing} different morphological types, some of the systematic errors in the debiasing may cancel out. Uncertainties in the debiasing will also decrease as the sample size increases. For these reasons, we strongly suggest that users of the debiased classifications only use them to consider populations of galaxies rather than individual or small samples, and to consider that there may still be some residual trends and uncertainties that are hard to model with current methods. \section{Automated Classifications} \label{sec:automated} Combining citizen science with automated classification allows us to do better science than with either alone. The clearest benefit is that automated classification scales well with sample size. For GZ DECaLS, classifying all 311,488 suitable galaxies using volunteers alone is infeasible; collecting 40 classifications per galaxy, the standard from previous Galaxy Zoo projects, would take around eight years without further promotion efforts - by which time we expect new surveys to start. Automated classification also evolves - as the quality of our models improves, so too will the quality of our classifications. And automated classification is replicable from scratch without requiring a crowd - other researchers may run our open-source code and recover our classifications (within stochasticity), or create equivalent classifications for newly-imaged galaxies. Finally, and of particular relevance to researchers using this data release, automated classification allows us to retroactively update the decision tree. Because our classifier learns to make predictions from GZD-5 classifications, using the improved tree with better detection of mergers and weak bars, we can then predict what our volunteers would have said for the GZD-1 and GZD-2 galaxies \textit{had we been using the improved tree at that time}. Our specific automated classification approach offers several qualitative benefits over previous work. First, through careful consideration of uncertainty, we can both learn from uncertain volunteer responses and predict posteriors (rather than point estimates) for new galaxies. Second, by predicting the answers to every question with a single model (similarly to \citealt{Dieleman2015}, and unlike more recent work e.g. \citealt{Sanchez2018, Khan2018, Walmsley2020}), we improve performance by sharing representations between tasks \citep{Caruana1997} - intuitively, knowing how to recognise spiral arms can also help you count them. Learning from every galaxy to predict every answer uses our valuable volunteer effort as efficiently as possible. This is particularly effective because we aim to predict detailed morphology, and hence learn to create a detailed representation of each galaxy. \subsection{Bayesian Deep Learning Classifier} \label{sec:bayesian_classifier} We require a model which can: \begin{enumerate} \item Learn efficiently from volunteer responses of varying (i.e. heteroskedastic) uncertainty. \item Predict posteriors for those responses on new galaxies, for every question. \end{enumerate} In previous work \citep{Walmsley2020} we modelled volunteer responses as being binomially distributed and trained our model to make maximum likelihood estimates using the loss function \begin{equation} \mathcal{L} = k \log f^w(x) + (N-k) \log(1-f^w(x)) \end{equation} where, for some target question, $k$ is the number of responses (successes) of some target answer, $N$ is the total number of responses (trials) to all answers, and $f^w(x) = \hat{\rho}$ is the predicted probability of a volunteer giving that answer. This Binomial assumption, while broadly successful, broke down for galaxies with vote fractions $\frac{k}{N}$ close to 0 or 1, where the Binomial likelihood is extremely sensitive to $f^w(x)$, and for galaxies where the question asked was not appropriate (e.g. predict if a featureless galaxy has a bar). Instead, in this work, the model predicts a distribution $p(\rho|f^w(x))$ and $\rho$ is then drawn from that distribution. For binary questions, one could parametrise $p(\rho|f^w(x))$ with the Beta distribution (being flexible and defined on the unit interval), and predict the Beta distribution parameters $f^w(x) = (\hat{\alpha}, \hat{\beta})$ by minimising \begin{equation} \mathcal{L} = \int \text{Bin}(k|\rho, N) \text{Beta}(\rho|\alpha, \beta) d\alpha d\beta \end{equation} where the Binomial and Beta distributions are conjugate and hence this integral can be evaluated analytically. In practice, we would like to predict the responses to questions with more than two answers, and hence we replace each distribution with its multivariate counterpart; Beta($\rho|\alpha, \beta$) with Dirichlet($\vec{\rho}|\vec{\alpha})$, and Binomial($k|\rho, N$) with Multinomial($\vec{k}|\vec{\rho}, N$). \begin{equation} \label{multivariate_per_q_likelihood} \mathcal{L}_q = \int \text{Multi}(\vec{k}|\vec{\rho}, N) \text{Dirichlet}(\vec{\rho}| \vec{\alpha}) d\vec{\alpha} \end{equation} where $\vec{k}, \vec{\rho}$ and $\vec{\alpha}$ are now all vectors with one element per answer. The Dirichlet-Multinomial distribution is much more flexible than the Binomial, allowing our model to express uncertainty through wider posteriors and confidence through narrower posteriors. We believe this is a novel approach. For the base architecture, we use the EfficientNet B0 model \citep{Tan2019a}. The EfficientNet family of models includes several architectural advances over the standard convolutional neural network architectures commonly used within astrophysics (e.g. \citealt{Huertas-Company2015a, Dieleman2015, Khan2018, Cheng2019, Ferreira2020}), including auto-ML-derived structure \citep{Tan2018, He2019}, depthwise convolutions \citep{Howard2017}, bottleneck layers \citep{Iandola2016}, and squeeze-and-excitation optimisation \citep{Hu2018}. The EfficientNet B0 model was identified using multi-objective neural architecture search \citep{Tan2018}, optimising for both accuracy and FLOPS (i.e. computational cost of prediction). This balancing of accuracy and FLOPS is particularly useful for astrophysics researchers with limited access to GPU resources, leading to a model capable of making reliable predictions on hundreds of millions of galaxies. In short, the architecture is similar to traditional convolutional neural networks, being composed of a series of convolutional blocks of decreasing resolution and increasing channels. Each convolutional block uses mobile inverted bottleneck convolutions following MobileNetV2 \citep{Sandler2018}, which combine computationally efficient depthwise convolutions with residual connections between bottlenecks (as opposed to residual connections between blocks with many channels, as in e.g. ResNet \citep{He2016}). EfficientNet B0 has 5.3 million parameters. We modify the final EfficientNet B0 layer output units to give predictions smoothly between 1 and 100 (using softmax activation), which is appropriate for Dirichlet parameters $\vec{\alpha}$. $\vec{\alpha}$ elements below 1 can lead to bimodal `horseshoe' posteriors, and $\vec{\alpha}$ elements above approximately 100 can lead to extremely confident predictions in extreme $\rho$, both of which are implausible for galaxy morphology posteriors. These constraints may cause the most extreme galaxies to have predicted vote fractions which are slightly less extreme than volunteers would record, but we do not anticipate this to affect practical use; whether a galaxy is extremely likely to have a bar or merely highly likely is rarely of scientific consequence. We would like our single model to predict the answer to every question in the Galaxy Zoo tree. To do this, our architecture uses one output unit per answer (i.e. for 13 questions with a total of 20 answers, we use 20 output units). We calculate the (negative log) likelihood per question (Eqn. \ref{multivariate_per_q_likelihood}), and then, treating the errors in the model's answers to each question as independent events, calculate the total loss as \begin{equation} \log \mathcal{L} = \sum_q \mathcal{L}_q(\vec{k_q}, N_q, \vec{f^w_q}) \end{equation} where, for question $q$, $N_q$ is the total answers, $\vec{k_q}$ is the observed votes for each answer, and $\vec{f^w_q}$ is the values of the output units corresponding to those answers (which we interpret as the Dirichlet $\vec{\alpha}$ parameters in Eqn. \ref{multivariate_per_q_likelihood}). We train our model using the GZD-5 volunteer classifications. Because the training set includes both active-learning-selected galaxies receiving at least 40 classifications and the remaining GZD-5 galaxies with around 5 classifications, it is crucial that the model is able to learn efficiently from labels of varying uncertainty. Unlike \cite{Walmsley2020}, which trained one model per question and needed to filter galaxies where that question asked may not be appropriate, we can predict answers to all questions and learn from all labelled galaxies. We train or evaluate our models using the 249,581 (98.5\%) GZD-5 galaxies with at least three volunteer classifications. Learning from galaxies with even fewer (one or two) classifications should be possible in principle, but we do not attempt it here as we do not expect galaxies with so few classifications to be significantly informative. The Dirichlet concentrations (distribution parameters) used to calculate our metrics are predicted by three identically-trained models, each making 5 forward passes with random dropout configurations and augmentations. We ensemble all 15 forward passes by simply taking the mean posterior given the total votes recorded, which may be interpreted as the posterior of an equally-weighted mixture of Dirichlet-Multinomial distributions. This mean posterior can then be used to calculate credible intervals (error bars) and in standard statistical analyses. We develop our approach using a conventional 80/20 train-test split, and make a new split before calculating the final metrics reported here. For the published automated classifications, where we aim simply to make the best predictions possible rather than to test performance, we train on all 249,581 galaxies with at least 3 votes (98.5\%). We also train five rather then three models to maximise performance. Training each model on an NVIDIA V100 GPU takes around 24 hours. We then make predictions (using the updated GZD-5 schema) on all 313,789 galaxies in all campaigns. Each prediction (forward pass) takes approx. 6ms, equating to approx. 160ms for each published posterior. Starting from the galaxy images shown to volunteers (Section \ref{sec:image_construction}), we take an average over channels to remove color information and avoid biasing our morphology predictions \citep{Walmsley2020}, then resize and save the images as 300x300x1 matrices. We then apply random augmentations when loading each image into memory, creating a unique randomly-modified image to be used as input to the network. We first apply random horizontal and vertical flips, followed by an aliased rotation by a random angle in the range (0, $\pi$), with missing pixels being filled by reflection on the boundaries. Finally, we crop the image about a random centroid to 224x224 pixels, effectively zooming in slightly towards a random off-center point. We also apply these augmentations at test time to marginalise our posteriors over any unlearned variance. We train using the Adam \citep{Kingma2015} optimizer and a batch size of 128. We end training once the model loss fails to improve for 10 consecutive epochs. Code for our deep learning classifier, including extensive documentation and several worked examples, is available at \href{https://github.com/mwalmsley/zoobot}{https://github.com/mwalmsley/zoobot}. \subsection{Results} \label{sec:automated_results} Our model successfully predicts posteriors for volunteer votes to each question. We show example posteriors for a question with two answers, `Does this galaxy have spiral arms' (Yes/No), in Fig. \ref{fig:example_posterior_spiral}, and a question with three answers, `Does this galaxy have a bar' (Strong/Weak/None), in Fig. \ref{fig:example_posterior_bar}. In Appendix A, we provide a gallery of the galaxies with the highest expected vote fractions for a selection of answers, to visually demonstrate the quality of the most confident machine classifications. \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/example_spiral_predictions_inc_n40.pdf} \caption{Posteriors for `Does this galaxy have spiral arms?', split by ensemble model (bold colours) and, within each model, dropout forward passes (faded colours). The number of volunteers answering `Yes' (not known to classifier) is shown with a black dashed line. Galaxies are selected at random from the test set, provided the spiral question is relevant (defined as a vote fraction of 0.5 or more to the preceding answer, `Featured'). The image presented to volunteers is shown to the right. The model input is a cropped, downsized, greyscale version (Sec \ref{sec:bayesian_classifier}). The Dirichlet-Multinomial posteriors are strictly only defined at integer votes; for visualisation only, we show the $\Gamma$-generalised posteriors between integer votes.} \label{fig:example_posterior_spiral} \end{figure} \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/example_bar_predictions_inc_n40.pdf} \caption{Posteriors for `Does this galaxy have a bar?', for the same random galaxies selected in Fig. \ref{fig:example_posterior_spiral}. Each point is colored by the predicted probability of volunteers giving that many `Strong', `Weak', and (implicitly, as the total answers is fixed) `None' votes. The volunteer answer (not known to classifier) is circled. For clarity, only the mean posterior across all models and dropout forward passes is shown.} \label{fig:example_posterior_bar} \end{figure} To aid intuition for the typical performance, we reduce both the vote fraction labels and the posteriors down to discrete classifications by rounding the vote fractions and mean posteriors to 0 or 1, and calculate classification metrics (Table \ref{tab:ml_metrics}) and confusion matrices (Figure \ref{fig:confusion_matrices}). Here and throughout this section, we calculate performance on the 11,346 galaxies in the (random) test set with at least 34\footnote{Corresponding to the typical `full' retirement limit of approximately 40 classifications before discarding implausible classifications, see Sec. \ref{sec:volunteer_weighting}} classifications (such that the typical volunteer answer is well-measured). To remove galaxies for which the question is not relevant, we only count galaxies where at least half the volunteers were asked that question. We report two sets of classification metrics; metrics for all (relevant) galaxies, and only for galaxies where the volunteers are confident (defined as having a vote fraction for one answer above 0.8, following \citealt{DominguezSanchez2019}). The performance on confident galaxies is useful to measure because such galaxies have a clear correct label. For such galaxies, performance is near-perfect; we achieve better than 99\% accuracy for most questions, with the lowest accuracy (for spiral arm count) being 98.6\%. The confusion matrices reflect this, showing little notable confusion for any question. Reported performance on all galaxies will be lower than on confident galaxies as the correct labels are uncertain. Our measured vote fractions are approximations of the theoretical `true' vote fractions (as we cannot ask infinitely many volunteers), and many galaxies are genuinely ambiguous and do not have a meaningful `correct' answer. No classifier should achieve perfect accuracy on galaxies where the volunteers themselves are not confident. Nonetheless, performance is more than sufficient for scientific use; accuracy ranges from 77.4\% (spiral arm count) to 98.7\% (disk edge on). We observe some moderate confusion between similar answers, particularly between No or Weak bar, Moderate or Large bulges, and Two or Three spiral arms, which matches our intuition for the answers that volunteers might confuse and so likely reflects ambiguity in the training data. More surprisingly, there is also confusion between Two spiral arms and Can't Tell. Figure \ref{fig:confused_spirals} shows random examples of spirals where the most common volunteer answer was Two, but the classifier predicted Can't Tell, and vice versa. In both cases, the galaxies generally have diffuse or otherwise subtle spiral arms embedded in a bright disk, confusing both human and machine. This highlights the difficulty in using classification metrics to assess performance on ambiguous galaxies. \begin{table} \begin{subtable}[h]{\columnwidth} \centering \begin{tabular}{l | l | l | l | l | l} \toprule Question & Count & Accuracy & Precision & Recall & F1 \\ \midrule Smooth Or Featured & 11346 & 0.9352 & 0.9363 & 0.9352 & 0.9356 \\ Disk Edge On & 3803 & 0.9871 & 0.9871 & 0.9871 & 0.9871 \\ Has Spiral Arms & 2859 & 0.9349 & 0.9364 & 0.9349 & 0.9356 \\ Bar & 2859 & 0.8185 & 0.8095 & 0.8185 & 0.8110 \\ Bulge Size & 2859 & 0.8419 & 0.8405 & 0.8419 & 0.8409 \\ How Rounded & 6805 & 0.9314 & 0.9313 & 0.9314 & 0.9313 \\ Edge On Bulge & 506 & 0.9111 & 0.9134 & 0.9111 & 0.8996 \\ Spiral Winding & 1997 & 0.7832 & 0.8041 & 0.7832 & 0.7874 \\ Spiral Arm Count & 1997 & 0.7742 & 0.7555 & 0.7742 & 0.7560 \\ Merging & 11346 & 0.8798 & 0.8672 & 0.8798 & 0.8511 \\ \end{tabular} \caption{Classification metrics for all galaxies} \end{subtable} \newline \vspace*{0.25 cm} \newline \begin{subtable}[h]{\columnwidth} \centering \begin{tabular}{l | l | l | l | l | l} \toprule Question & Count & Accuracy & Precision & Recall & F1 \\ \midrule Smooth Or Featured & 3495 & 0.9997 & 0.9997 & 0.9997 & 0.9997 \\ Disk Edge On & 3480 & 0.9980 & 0.9980 & 0.9980 & 0.9980 \\ Has Spiral Arms & 2024 & 0.9921 & 0.9933 & 0.9921 & 0.9924 \\ Bar & 543 & 0.9945 & 0.9964 & 0.9945 & 0.9951 \\ Bulge Size & 237 & 1.0000 & 1.0000 & 1.0000 & 1.0000 \\ How Rounded & 3774 & 0.9968 & 0.9968 & 0.9968 & 0.9968 \\ Edge On Bulge & 258 & 0.9961 & 0.9961 & 0.9961 & 0.9961 \\ Spiral Winding & 213 & 0.9906 & 1.0000 & 0.9906 & 0.9953 \\ Spiral Arm Count & 659 & 0.9863 & 0.9891 & 0.9863 & 0.9871 \\ Merging & 3108 & 0.9987 & 0.9987 & 0.9987 & 0.9987 \\ \end{tabular} \caption{Classification metrics for galaxies where volunteers are confident} \end{subtable} \caption{Classification metrics on all galaxies (above) or on galaxies where volunteers are confident for that question (i.e. where one answer has a vote fraction above 0.8). Multi-class precision, recall and F1 scores are weighted by the number of true galaxies for each answer. Classifications on confident galaxies are near-perfect.}. \label{tab:ml_metrics} \end{table} We can mitigate the ambiguity in classifications of galaxies by measuring regression metrics on the vote fractions, without rounding to discrete classifications. Figure \ref{fig:mean_deviation_bar} shows the mean deviations between the model predictions (mean posteriors) and the observed vote fractions, by question, for test set galaxies with approximately 40 volunteer responses. Performance is again excellent, with the predictions typically well within 10\% of the observed vote fractions. Predicting spiral arm count is relatively challenging, as noted above. Predicting answers to the `Merger' question of `None' (i.e. not a merger) is also challenging, perhaps because of the rarity of counter-examples. The volunteer vote fractions against which we compare our predictions are themselves uncertain for most galaxies. We aim to predict the true vote fraction, i.e. the vote fraction from $\lim_{N \to \infty}$ volunteers, but we only know the vote fraction from $N$ volunteers. However, 387 pre-active-learning galaxies were erroneously uploaded twice or more, and so received more than 75 classifications each. The vote fractions for these $N > 75$ galaxies will be very similar to the $\lim_{N \to \infty}$ true vote fraction limit, allowing us to accurately measure the mean vote fraction error of our machine learning predictions. We can also calculate the mean vote fraction error (vs. the $N > 75$ vote fractions) from asking fewer ($N << 75$) volunteers by artificially truncating the number of votes collected, and ask - how many volunteer responses to that question would we need to have errors similar to that of our model? Note that the actual number of volunteers needed to be shown that galaxy to achieve an equivalent mean squared error will be higher for questions only asked given certain previous answers (i.e. all but `Smooth or Featured?' and `Merger?'), as some will give different answers to preceding questions and so not be asked that question. Figure \ref{fig:deviation_vs_volunteers} shows the model and volunteer mean errors for a representative selection of questions; the model predictions are as accurate as asking that question to around 10 volunteers.\footnote{The model is, in this strict sense, slightly superhuman.} We can also measure if our posteriors correctly estimate this uncertainty. As a qualitative test, Figure \ref{fig:binned_uncertainty} shows a random selection of galaxies binned by `Smooth or Featured' vote fraction prediction entropy, measuring the model's uncertainty. Prediction entropy is calculated as the (discrete) Shannon entropy $\sum_{\omega} p(\omega)\log(p(\omega))$ over all possible combinations of votes $\omega$, assuming 10 total votes for this question (our results are robust to other choices of total votes). Unusual, inclined or poorly-scaled galaxies have highly uncertain (high entropy) votes, while smooth and especially clearly featured galaxies have confident (low entropy) votes. The most uncertain galaxies (not shown) are so poorly scaled (due to incorrect estimation of the Petrosian radius in the NASA-Sloan Atlas) that they are barely visible. These results match our intuition and demonstrate that our posteriors provide meaningful uncertainties. More quantitatively, Figure \ref{fig:calibration} shows the calibration of our posteriors for the two binary questions in GZD-5 - `Edge-on Disk' and `Has Spiral Arms'. A well-calibrated posterior dominated by data (i.e. where the prior has minimal effect) will include the measured value within any bounds as often as the total probability within those bounds. We calculate calibration by, for each galaxy, iterating through each symmetric highest posterior density credible interval (i.e. starting from the posterior peak and moving the bounds outwards) and recording both the total probability inside the bounds and whether the recorded volunteer vote is inside the bounds. We then group (bin) by total probability and record the empirical frequency with which the votes lie within bounds of that total probability. In short, we are checking if, for all X, the observed value (vote fraction) falls within X\% of the posterior interval X\% of the time \citep{Cook2006, Levasseur2017}. We find that calibration on these binary questions is excellent. Our classifier is correctly uncertain. \begin{figure*} \includegraphics[width=.5\textwidth]{figures/confusion/cm_decals_dr_full_ensemble_paired_smooth-or-featured.png} \includegraphics[width=.5\textwidth]{figures/confusion/cm_decals_dr_full_ensemble_paired_disk-edge-on.png} \includegraphics[width=.5\textwidth]{figures/confusion/cm_decals_dr_full_ensemble_paired_has-spiral-arms.png} \includegraphics[width=.5\textwidth]{figures/confusion/cm_decals_dr_full_ensemble_paired_spiral-arm-count.png} \includegraphics[width=.5\textwidth]{figures/confusion/cm_decals_dr_full_ensemble_paired_spiral-winding.png} \hspace{52pt}\textit{All Galaxies} \hspace{52pt} \textit{High Volunteer Confidence} \caption{ Confusion matrices for each question, made on the test set of 11,346 galaxies in the (random) test set with at least 34 votes. Discrete classifications are made by rounding the vote fraction (label) and mean posterior (prediction) to the nearest integer. The matrices then show the counts of rounded predictions (x axis) against rounded labels (y axis). To avoid the loss of information from rounding, we encourage researchers not to treat Galaxy Zoo classifications as discrete, and instead to use the full vote fractions or posteriors where possible. } \label{fig:confusion_matrices} \end{figure*} \begin{figure*} \includegraphics[width=.5\textwidth]{figures/confusion/cm_decals_dr_full_ensemble_paired_bar.png} \includegraphics[width=.5\textwidth]{figures/confusion/cm_decals_dr_full_ensemble_paired_bulge-size.png} \includegraphics[width=.5\textwidth]{figures/confusion/cm_decals_dr_full_ensemble_paired_merging.png} \includegraphics[width=.5\textwidth]{figures/confusion/cm_decals_dr_full_ensemble_paired_edge-on-bulge.png} \includegraphics[width=.5\textwidth]{figures/confusion/cm_decals_dr_full_ensemble_paired_how-rounded.png} \caption{Confusion matrices for test set galaxies where the volunteers are confident in that question, defined as having the vote fraction for one answer above 0.8. Such confident galaxies are expected to have a clearly correct label, making correct and incorrect predictions straightforward to measure but also making the classification task easier. To avoid the loss of information from rounding, we encourage researchers not to treat Galaxy Zoo classifications as discrete, and instead to use the full vote fractions or posteriors where possible. } \end{figure*} \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/mean_deviation_bar.pdf} \caption{Mean absolute deviations between the model predictions and the observed vote fractions, by question, for the test set galaxies with approximately 40 volunteer responses. The model is typically well within 10\% of the observed vote fractions.} \label{fig:mean_deviation_bar} \end{figure} \begin{figure} \centering \includegraphics[width=.9\columnwidth]{figures/vs_all_votes_smooth-or-featured.pdf} \includegraphics[width=.9\columnwidth]{figures/vs_all_votes_bar.pdf} \includegraphics[width=.9\columnwidth]{figures/vs_all_votes_has-spiral-arms.pdf} \includegraphics[width=.9\columnwidth]{figures/vs_all_votes_bulge-size.pdf} \caption{Mean error on the true ($N > 75$) vote fractions for either a truncated ($N=0$ to $N=20$) number of volunteers (solid) or the automated classifier (dashed). Asking only a few volunteers gives a noisy estimate of the true vote fraction. Asking more volunteers reduces this noise. For some number of volunteers, the noise in the vote fraction is similar to the error of the automated classifier, meaning they have a similar mean error vs. the true vote fraction; this number is where the solid and dashed lines intersect. We find the automated classifier has a similar mean error to approx. 5 to 15 volunteers, depending on the question. } \label{fig:deviation_vs_volunteers} \end{figure} \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/ml_2_vols_cant.png} \includegraphics[width=\columnwidth]{figures/ml_cant_vols_2.png} \caption{Random spiral galaxies where the classifier confuses the most likely volunteer vote for spiral arm count between `2' and `Can't Tell'. Above: galaxies where the classifier predicted `2' but more volunteers answered `Can't Tell'. Below: vice versa, galaxies where the classifier predicted `Can't Tell' but more volunteers answered `2'. Red text shows the volunteer (vol.) and machine-learning-predicted (ML) vote fractions for each answer. Counting the spiral arms is challenging, even for the authors. This highlights the difficulty in assessing performance by reducing the posteriors to classifications and then comparing against uncertain true labels.} \label{fig:confused_spirals} \end{figure} \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/binned_uncertain_10k_test_smooth_feat.png} \caption{Galaxies binned by `Smooth or Featured' vote prediction entropy, measuring the model's uncertainty in the votes. Bins (columns) are equally spaced (boundaries noted above). Five random galaxies are shown per bin. Unusual, inclined or poorly-scaled galaxies have highly uncertain (high entropy) votes, while smooth and especially clearly featured galaxies have confident (low entropy) votes, matching our intuition and demonstrating that our posteriors provide meaningful uncertainties.} \label{fig:binned_uncertainty} \end{figure} \begin{figure} \centering \includegraphics[width=\columnwidth]{figures/disk-edge-on-coverage_all.pdf} \includegraphics[width=\columnwidth]{figures/spiral-arm-coverage_all.pdf} \caption{Calibration curves for the two binary GZ DECaLS questions. The $x$-axis shows the credible interval width - for data-dominated posteriors, roughly (e.g.) 30\% of galaxies should have vote fractions within their 30\% credible interval. The $y$-axis shows what percentage actually do fall within each interval width. We split calibration by galaxies with few votes (and hence typically wider posteriors) and more votes (narrower posteriors). Only credible intervals with at least 100 measurements are shown. Calibration for both questions is excellent.} \label{fig:calibration} \end{figure} The ultimate measure of success is whether our predictions are useful for science. \citealt{Masters2019} (hereafter M19) used GZ2 classifications to investigate the relationship between bulge size and winding angle and found - contrary to a conventional view of the Hubble sequence - no strong correlation. We repeat this analysis using our (deeper) DECaLS data, using either volunteer or automated classification, to check if the automated classifications lead to the same science results as the volunteers. Specifically, we select a clean sample of face-on spiral galaxies using M19's vote fraction cuts of $f_{\text{feat}} > 0.43$, $f_{\text{not-edge-on}} > 0.715$, and $f_{\text{spiral-yes}} > 0.619$. We also make a cut of $f_{\text{merging=none}} > 0.5$, analogous to M19's $f_{\text{odd}}$ cut, to remove galaxies with ongoing mergers or with otherwise disturbed features. For the volunteer vote fractions, we can only use either GZD-1/2 or GZD-5 classifications, since the former decision tree had three bulge size answers and the latter had five; we choose GZD-5 to benefit from the added precision of additional answers. To avoid selection effects (Sec. \ref{sec:selection_effects}) we only use galaxies classified prior to active learning being activated. For the automated classifications, we use a model trained on GZD-5 to predict GZD-5 decision tree vote fractions (including the five bulge answers) for every GZ DECaLS galaxy (313,798). This allows us to expand our sample size from 5,378 galaxies using GZD-5 volunteers only to 43,672 galaxies using our automated classifier. We calculate bulge size and spiral winding following Eqn. 1 and 3 in M19, trivially generalising the bulge size calculation to allow for five bulge size answers: \begin{gather} \label{eqn:summary_stats} W_{\text{avg}} = 0.5 f_{\text{medium}} + 1.0 f_{\text{tight}} \\ B_{\text{avg}} = 0.25 f_{\text{small}} + 0.5 f_{\text{moderate}} + 0.75 f_{\text{large}} + 1.0 f_{\text{dominant}} \end{gather} Both classification methods find no correlation between bulge size and spiral winding, consistent with M19. Figure \ref{fig:masters_repeat} shows the distribution of bulge size against spiral winding using either volunteer predictions (fractions) or the deep learning predictions (expected fractions) for the sample of featured face-on galaxies selected above. The distributions are indistinguishable, with the automated method offering a substantially larger (approx 8x) sample size. We hope this demonstrates the accuracy and scientific value of our automated classifier. \begin{figure} \centering \includegraphics[width=0.49\columnwidth]{figures/bulge_winding_corr_humans_final.pdf} \includegraphics[width=0.49\columnwidth]{figures/bulge_winding_corr_ml_final.pdf} \caption{Distribution of bulge size vs. spiral winding, using responses from volunteers (left) or our automated predictions (right). We observe no clear correlation between bulge size and spiral winding, consistent with M19. The distributions are consistent between volunteers and our automated method. We hope this demonstrates the accuracy and scientific value of our automated classifier.} \label{fig:masters_repeat} \end{figure} \section{Usage} \label{sec:usage} \subsection{Catalogues} We release two volunteer catalogues and two automated catalogues, available at \href{https://doi.org/10.5281/zenodo.4573248}{https://doi.org/10.5281/zenodo.4573248}. \texttt{gz\_decals\_volunteers\_ab} includes the volunteer classifications for 92,960 galaxies from GZD-1 and GZD-2. Classifications are made using the GZD-1/2 decision tree (Fig. \ref{fig:gzda_tree}). All galaxies received at least 40 classifications, and consequently have approximately 30-40 after volunteer weighting (Sec. \ref{sec:volunteer_weighting}). This catalogue is ideal for researchers needing standard morphology measurements on a reasonably large sample, with minimal complexity. 33,124 galaxies in this catalogue were also previously classified in GZ2; the GZD-1/2 classifications are better able to detect faint features due to deeper DECaLS imaging, and so should be preferred. \texttt{gz\_decals\_volunteers\_c} includes the volunteer classifications from GZD-5. Classifications are made using the improved GZD-5 decision tree which adds more detail for bars and mergers (Sec. \ref{sec:comparison_of_decision_trees}). This catalogue includes 253,286 galaxies, but each galaxy does not have the same number of classifications. 59,337 galaxies have at least 30 classifications (after denoising), and the remainder have far fewer (approximately 5). The selection effects for how many classifications each galaxy receives are detailed below in Sec. \ref{sec:selection_effects}. This catalogue may be useful to researchers who prefer a larger sample than \texttt{gz\_decals\_volunteers\_ab} at the cost of more uncertainty and the introduction of selection effects, or who need detailed bar or merger measurements for a small number of galaxies. We use \texttt{gz\_decals\_volunteers\_c} to train our deep learning classifier. The automated classifications are made using our Bayesian deep learning classifier, trained on \texttt{gz\_decals\_volunteers\_c} to predict the answers to the GZD-5 decision tree for all GZ DECaLS galaxies (including those in GZD-1 and GZD-2). \texttt{gz\_decals\_auto\_posteriors} contains the predicted posteriors for each answer - specifically, the Dirichlet concentration parameters that encode the posteriors. We hope this catalogue will be helpful to researchers analysing galaxies in Bayesian frameworks. \texttt{gz\_decals\_auto\_fractions} reduces those posteriors to the automated equivalent of previous Galaxy Zoo data releases, containing the expected vote fractions (mean posteriors). Note that not all vote fractions are relevant for every galaxy; we suggest assessing relevance using the estimated fraction of volunteers that would have been asked each question, which we also include. We hope this catalogue will be useful to researchers seeking detailed morphology classifications on the largest possible sample, who might benefit from error bars but do not need full posteriors. We also release Jupyter notebooks showing how to use each catalogue on \url{www.github.com} (full link on publication). These demonstrate how to load and query each catalogue with \texttt{pandas} \citep{McKinney2010}, and how to create callable posteriors from the Dirichlet concentration parameters. The automated catalogues may be interactively explored at \href{https://share.streamlit.io/mwalmsley/galaxy-poster/gz_decals_mike_walmsley.py}{https://share.streamlit.io/mwalmsley/galaxy-poster/gz\_decals\_mike\_walmsley.py}. \subsection{Selection Effects for Total Classifications} \label{sec:selection_effects} The GZD-1/2 catalogue reports at least 40 classifications for all galaxies imaged by DECaLS DR1/2 and passing the appropriate selection cuts (Section \ref{sec:selection}). Additional classifications above 40 are assigned independently of the galaxy properties. The selection function for total classifications in the GZD-5 catalogue is more complex. In practice, if you require a strictly random sample of GZD-5 galaxies with more than five volunteer classifications, you should exclude galaxies where `random\_selection' is False. You may also consider using the posteriors from our deep learning classifier, which are comparable across all GZ DECaLS galaxies (Section \ref{sec:automated}). Below, we describe the GZD-5 total classification selection effects. Early galaxies were initially uploaded row-by-row from the NASA-Sloan Atlas, each (eventually) receiving 40 classifications. We also uploaded two additional subsets. For the first, 1355 galaxies were targeted for classification to support an external research project. Of these, 1145 would have otherwise received five classifications. These 1145 galaxies with additional classifications are identified with the `targeted' group and should be excluded. For the second, we reclassified the 1497 galaxies classified in both GZD-1/2 and the \cite{Nair2010} expert visual morphology classification catalogue to measure the effect of our new decision tree (results are shown in Sec. \ref{sec:comparison_of_decision_trees}). Both the GZD-1/2 and GZD-5 classifications are reported in the respective catalogues (Section \ref{sec:usage}. Similarly to the targeted galaxies, 651 of these calibration galaxies would have otherwise received five classifications, are identified with the `calibration' group, and should be excluded. We then implemented active learning (Sec \ref{sec:retirement}), prioritising 6,939 galaxies from the remaining pool of 199,496 galaxies not yet uploaded. The galaxies are identified with the groups `active\_priority' (the galaxies identified as `most informative' and selected for 40 classifications) and `active\_baseline' (the remainder). For a strictly random selection, both groups should be excluded, leaving the galaxies classified prior to the introduction of active learning. Finally, we note that 14,960 (5.9\%) of GZD-5 galaxies received more than 40 classifications due to being erroneously uploaded more than once. The images are identical and so we report the aggregate classifications across all uploads of the same galaxy. \subsection{Suggested Usage of Vote Fractions} The most appropriate usage of the Galaxy Zoo DECaLS vote fractions depends on the specific science case. Many galaxies have ambiguous vote fractions (e.g. roughly similar vote fractions for both disk and elliptical morphologies) because of observational limitations like image resolution, or because the galaxy morphology is truly in-between the available answers (perhaps because the galaxy has an unusual feature such as polar rings, \citealt{Moiseev2011}, or because the galaxy is undergoing a morphological transition). To make best use of such galaxies, we recommend that, where possible, readers use the vote fractions as statistical weights in their analysis. For example, when investigating the differences in the stellar mass distributions of elliptical and disk galaxies, the disk (elliptical) vote fractions can be used as weights when plotting the distributions, resulting in the galaxies with the highest vote fraction for disk (elliptical) morphology dominating the resulting distribution. This ensures that each galaxy contributes to the analysis, without excluding galaxies with ambiguous vote fractions. For examples of using vote fractions as weights, see \cite{Smethurst2015} and \cite{Masters2019}. Using the vote fractions as weights is not appropriate for all science cases. For example, if galaxies of a particular morphology need to be isolated to form a sample for observational follow-up (e.g. overlapping pairs, see \citealt{Keel2013}, and `bulgeless' galaxies, see \citealt{Simmons2017a,Smethurst2019}), or if the fraction of a certain morphological type of galaxy is to be calculated \citep[e.g. bar fraction, see][]{Simmons2014}. These science cases require a cut on the appropriate vote fraction to be chosen. However, readers should be aware that making cuts on the vote fractions is a crude method to identify galaxies of certain morphologies and will result in an incomplete sample. Table \ref{tab:suggested_cuts} shows our suggested cuts for populations of common interest, based on visual inspection by the authors and chosen for high specificity (low contamination) at the cost of low sensitivity (completeness). We urge the reader to adjust these cuts to suit the sensitivity and specificity of their science case, to add additional cuts to better select their desired population, and to make their own visual inspection to verify the selected population is as intended. For a full analysis, we once again suggest the reader avoid cuts by appropriately weighting ambiguous galaxies, or take advantage of the posteriors provided by our automated classifier. \begin{table*} \centering \begin{tabular}{ |p{2.5cm}||p{4cm}|p{1.4cm} |p{4cm}} \hline Population & Approx. Cut & Q. Votes & Notes\\ \hline Featured Disk & $\texttt{featured} > 0.7$ & 5 & \\ Disk & $\texttt{featured} > 0.3$ & 5 & Will include featureless S0 \\ Elliptical & $\texttt{smooth} > 0.7$ & 5 & \\ \hline Edge-on Disk & $\texttt{yes} > 0.8$ & 5 & \\ Not Edge-on Disk & $\texttt{yes} < 0.3$ & 5 & \\ \hline Strong Bar & $\texttt{strong bar} > 0.8$ & 20 & \\ Weak Bar & $\texttt{weak bar} > 0.8$ & 20 & \\ Any Bar & $\texttt{strong bar} + \texttt{weak bar} > 0.6$ & 20 & \\ \hline Spiral Arms & $\texttt{spiral arms} > 0.6$ & 20 & \\ No Spiral Arms & $\texttt{spiral arms} < 0.3$ & 20 & Primarily ringed or irregular\\ \hline Spiral Count & $\texttt{spiral count \{n\}} > 0.75$ & 30 & One-armed spirals are often mergers \\ \hline Round Edge-on Bulge & $\texttt{edge-on bulge rounded} > 0.6$ & 10 & \\ Boxy Edge-on Bulge & $\texttt{edge-on bulge boxy} > 0.3$ & 10 & Rare - visual inspection required\\ No Edge-on Bulge & $\texttt{edge-on bulge none} > 0.5$ & 10 & \\ \hline Merger & $\texttt{merger} > 0.7$ & 10 & \\ Merger or Overlap & $\texttt{merger} > 0.3$ & 10 & To remove overlaps, redshifts or inspection required. \\ Post-Merger & $\texttt{major disturb.} > 0.6$ & 10 & \\ Asymmetric or Low Surface Brightness & $\texttt{minor disturb.} > 0.4$ & 10 & \\ \end{tabular} \caption{Suggested cuts for \textit{rough} identification of galaxy populations, based on visual inspection by the authors. Q. votes is the minimum number of total votes for that question; for example, to identify strong bars, require at least 20 total votes to the question `Does this galaxy have a bar?'. This ensures enough votes to calculate reliable vote fractions. Assumes that all previous questions are filtered with the suggested cuts. For continuous measurements such as bulge size and spiral winding, we suggest combining all answers into a summary statistic like Eqn. \ref{eqn:summary_stats}.} \label{tab:suggested_cuts} \end{table*} \section{Discussion} What does a classification mean? The comparison of GZ2 and GZ DECaLS images (Fig. \ref{fig:featured_galaxies_big_shift}) highlights that our classifications aim to characterise the clear features of an image, and not what an expert might infer from that image. For example, volunteers might see an image of a galaxy that is broadly smooth, and so answer smooth, even though our astronomical understanding might suggest that the faint features around the galaxy core are likely indicative of spiral arms that would be revealed given deeper images. This situation occurs in several galaxies in Fig. \ref{fig:featured_galaxies_big_shift}. These `raw' classifications will be most appropriate for researchers working on computer vision or on particularly low-redshift, well-resolved galaxies. The redshift-debiased classifications, which are effectively an estimate of galaxy features \textit{not clearly seen} in the image, will be most appropriate for researchers especially interested in fainter features or studying links between our estimated intrinsic visual morphologies and other galaxy properties. We showed in Sec. \ref{sec:comparison_of_decision_trees} that changing the answers available to volunteers significantly improves our ability to identify weak bars. This highlights that our classifications are only defined in the context of the answers presented. One cannot straightforwardly compare classifications made using different decision trees. Our scientific interests and our understanding of volunteers both evolve, and so our decision trees must also evolve to match them. However, only the last few years of volunteer classifications will use the latest decision tree (based on previous data releases), placing an upper limit on the number of galaxies with compatible classifications at any one time. Our automated classifier resolves this here by allowing us to retrospectively apply the GZD-5 decision tree (with better weak bar detection, among other changes) to galaxies only classified by volunteers in GZD-1 and GZD-2. This flexibility ensures that Galaxy Zoo will remain able to answer the most pertinent research questions at scale. We have shown (\ref{sec:automated_results}) that our automated classifier is generally highly accurate, well-calibrated, and leads to at least one equivalent science result. However, we cannot exclude the possibility of unexpected systematic biases or of adversarial behaviour from particular images. Avoiding subtle biases and detecting overconfidence on out-of-distribution data remain open computer science research questions, often driven by important terrestrial applications \citep{Szegedy2014,Hendrycks2016,Eykholt2017,Smith2018,Geirhos2019,Ren2019,Yang2020,Margalef-Bentabol2020}. Volunteers also have biases (e.g a slight preference for recognising left-handed spirals, \citealt{Land2008}) and struggle with images of an adversarial nature (e.g. confusing edge-on disks with cigar-shaped ellipticals), though these can often be discovered and resolved through discussion with the community and by adapting the website. We believe the future of morphology classification is in the thoughtful combination of volunteers and machine learning. Such combinations will be more than just faster; they will be replicable, uniform, error-bounded, and quick to adapt to new tasks. They will let us ask new questions - draw the spiral arms, select the bar length, separate the merging galaxies pixelwise - which would be infeasible with volunteers alone for all but the smallest samples (e.g. \citealt{Lingard2020}). And they will find the interesting, unusual and unexpected galaxies which challenge our understanding and inspire new research directions. The best combination of volunteer and machine is unclear. Our experiment with active learning is one possible approach, but (when compared to random selection) suffers from complexity to implement, an unknown selection function, and no guarantee - or even clear final measurement of - an improvement in model performance. Many other approaches are suggested in astrophysics \citep{Wright2017,Beck2018,Wright2019,Dickinson2019,Martin2020,Lochner2020} and in citizen science and human-computer interaction more broadly \citep{Chang2017,Wilder2020,Liu2020,Bansal2019}. We will continue to search for and experiment with strategies to create the most effective contribution to research by volunteers. \section{Conclusion} We have presented Galaxy Zoo DECaLS; detailed galaxy morphology classifications for 311,488 galaxies imaged by DECaLS DR5 and within the SDSS DR11 footprint. The increased depth of DECaLS imaging allows us to better resolve faint morphological features than with previous Galaxy Zoo data releases using SDSS imaging (Fig. \ref{fig:featured_comparison}). Classifications were collected from volunteers on the Zooniverse citizen science platform over three campaigns, GZD-1, GZD-2, and GZD-5. GZD-5 used an improved decision tree (Fig. \ref{fig:decision_tree}) aimed at best exploiting the deeper DECaLS images to identify weak bars, mergers, and tidal features. All galaxies receive at least five volunteer classifications (Fig. \ref{fig:classification_counts}). Galaxies in GZD-1 and GZD-2 receive at least 40. In GZD-5, two subsets receive 40: a random subset and a subset of galaxies prioritised as most likely to be informative for training machine learning models. These informative galaxies were identified following the method introduced by \cite{Walmsley2020} as the galaxies with the highest mutual information between model parameters and volunteer labels - intuitively, the galaxies on which several machine learning models confidently disagree. Volunteer classifications were then used to train deep learning models to classify all galaxies. Our models are able to both learn from uncertain volunteer responses and predict full posteriors (rather than point estimates) for what volunteers would have said. This was achieved by interpreting the model predictions as the parameters for Dirichlet-Multinomial distributions and training to maximise the corresponding likelihood (Eqn. \ref{multivariate_per_q_likelihood}). We also approximate marginalising over model weights (i.e. Bayesian deep learning) by training an ensemble of 5 models where each model makes predictions with MC Dropout. The resulting ensemble is accurate (Fig. \ref{fig:confusion_matrices}-\ref{fig:deviation_vs_volunteers}) and well-calibrated (Fig. \ref{fig:calibration}). We release both volunteer and automated classification catalogues at \href{data.galaxyzoo.org}{data.galaxyzoo.org}. The volunteer catalogues include the total and mean volunteer responses for each question to each galaxy, and are split into the GZD-1/2 and GZD-5 campaigns (due to the modified decision tree). The automated catalogue includes predictions for every galaxy in any campaign. We share the predicted Dirichlet-Multinomial parameters that encode the full posteriors as well as the expected vote fractions that those posteriors imply. The expected vote fractions may used in a similar manner to previous volunteer-only data releases, while the posteriors support more complex statistical analyses. We also provide guidance and code examples. \section{Galaxies with Confident Automated Classifications} To intuitively demonstrate the performance of our automated classifier, we show, for a selection of detailed morphology questions, the galaxies with the most confident automated classifications for that question. We show the galaxies with the highest mean posterior for being strongly barred (Fig. \ref{fig:bar_strong_grid}), edge-on and bulgeless (Fig \ref{fig:edge_on_no_bulge_grid}), one-armed spirals (Fig. \ref{fig:spiral_1_grid}), loosely wound spirals (Fig. \ref{fig:winding_loose_grid}) and mergers (Fig. \ref{fig:merger_grid}). We present the galaxies here as shown to Galaxy Zoo volunteers (in color and at 424x424 pixel resolution), but the model makes predictions on more challenging greyscale 224x224 pixel images. \begin{figure*} \centering \includegraphics[height=0.7\textheight,trim=140 160 140 150, clip]{figures/ml_top_n_bar_strong.jpg} \caption{Galaxies automatically classified as most likely (highest mean posterior) to be strongly barred.} \label{fig:bar_strong_grid} \end{figure*} \begin{figure*} \centering \includegraphics[height=0.7\textheight,trim=140 160 140 150, clip]{figures/ml_top_n_edge-on-bulge_none.jpg} \caption{Galaxies automatically classified as most likely (highest mean posterior) to be edge-on with no bulge.} \label{fig:edge_on_no_bulge_grid} \end{figure*} \begin{figure*} \centering \includegraphics[height=0.7\textheight,trim=140 160 140 150, clip]{figures/ml_top_n_spiral-arm-count_1.jpg} \caption{Galaxies automatically classified as most likely (highest mean posterior) to have exactly one spiral arm.} \label{fig:spiral_1_grid} \end{figure*} \begin{figure*} \centering \includegraphics[height=0.7\textheight,trim=140 160 140 150, clip]{figures/ml_top_n_spiral-winding_loose.jpg} \caption{Galaxies automatically classified as most likely (highest mean posterior) to have loosely wound spiral arms.} \label{fig:winding_loose_grid} \end{figure*} \begin{figure*} \centering \includegraphics[height=0.7\textheight,trim=140 160 140 150, clip]{figures/ml_top_n_merger_dedup.jpg} \caption{Galaxies automatically classified as most likely (highest mean posterior) to be mergers, with automatic `featured' vote fraction > 0.5. Only one thumbnail per galaxy pair is shown.} \label{fig:merger_grid} \end{figure*} \end{document}
\section{Introduction} As a reliability requirement, modern power grids must have the ability to withstand $N-1$ contingencies. However, $N-1$ analysis fails to capture high-impact scenarios due to increasing threats from cyber and physical domains that can cause multiple elements to disfunction or malfunction concurrently, potentially leading to cascading failures in the system and large-scale blackouts. as evident from recent examples~\cite{Real_Time_Contingency1,Real_Time_Contingency2,NYBlackoutCause}. The well-known Northeast blackout in 2003 affected 55 million people, and was caused by cascading failure. A cascading failure refers to a sequence of dependent events, where the initial failure of one or more components trigger the sequential failure of other components\cite{cascading_failure1, cascading_failure2}. Identifying and protecting the critical components that can trigger a cascading failure is an important need that would enable grid operators to prevent cascading failures and operate the system reliably. Contingency analysis, a key problem in power system operation, is a systematic study of the impact of an individual or a group of system component failures on the overall system~\cite{NERC}. In general, $N-x$ contingency analysis, where $x\ge2$, studies the impact of various combinations of $x$ individual components failing concurrently~\cite{Group_betweenness}. The number of multiple components assessed in a $N-x$ contingency analysis grows exponentially with $x$. For instance, the number of contingency cases for $N-1$ analysis is 20000 for a system with 20000 components, while the number of contingency cases for $N-2$ and $N-3$ analyses are approximately $10^8$ and $10^{12}$; this clearly becomes intractable as $x$ increases~\cite{Group_betweenness} To identify the influence of an element in a network, numerous studies have utilized different variations of centrality metrics in graph theory, including betweenness centrality, closeness centrality, graph centrality, stress centrality, degree centrality, and more. The approach in~\cite{Group_betweenness} modifies the betweenness centrality metric to identify multiple critical components whose loss can trigger cascading failures. The betweenness centrality metric is employed to identify the most critical component in power grids~\cite{Electrical_centrality, Centrality_Measures}. The study in~\cite{gorton2009high} applies the graph edge betweenness centrality metric to identify critical components in the large-scale power systems. In addition, various electrical properties have been proposed to be considered together with centrality metrics to increase the accuracy of critical component identification, such as the admittance matrix \cite{structural_vulnerability_analysis}, electrical distance \cite{Structural_vulnerability}, and the maximal load demand and the capacity of generators \cite{electrical_betweenness} to identify critical elements in power systems. A key important factor in identifying critical components in electric power grids is the impact that the loss of components might have on the system operation. None of the above studies consider the impact of component loss in identifying critical components. Our previous work~\cite{PreviousWork} applies Line Outage Distribution Factors (LODFs)~\cite{multiple_contingency} and betweenness centrality metrics to identify multiple critical branches in electric power grids. In this work, we improve upon the approach in~\cite{PreviousWork} to search in a wider area in the corresponding graph of the electric power grid, which enables the method to evaluate coupled critical branches that may be far away from each other. These geographically distributed coupled elements may be missed in the previous approach, and they are important to identify. Unlike the previous approach, which constructs the subgraph only with nearby branches, this work introduces a new parameter \textit{distance} that enlarges the searching graph. From the numerical results, the new approach can find more subsets of critical branches that cause more severe contingencies. The main contributions of this paper are thus as follows: \begin{enumerate} \item A new parameter \textit{distance} is introduced to enlarge the subgraph for the group betweenness centrality approach to identify critical branches. \item The resulting method is applied and evaluated on 200-bus and 500-bus synthetic grids, and the method's \textit{distance} and \textit{searching level} parameters are varied. \item From the contingency analysis results and comparison with ~\cite{PreviousWork}, the new approach can find more subsets of critical branches causing more violations. \end{enumerate} This paper is organized as follows. Section~\ref{Related Work} reviews the method in \cite{PreviousWork} on how to utilize LODFs and group betweenness centrality to find critical branches in large scale power grids. Section~\ref{Methodology} presents the improved approach for finding the most critical branches in a wider area. Section~\ref{Numerical_results} empirically evaluates the proposed approach in 200- and 500-bus synthetic power grids. Section~\ref{Conclusion} concludes the paper and discusses future work. \section{Related Work} \label{Related Work} This section reviews how LODFs and group centrality betweenness are utilized in the method proposed by the authors in \cite{PreviousWork} to identify critical multiple element contingencies. This method is a precursor to the extension developed in this paper. \subsection{Line Outage Distribution Factors} \label{LODF} To incorporate LODFs as a metric to identify the importance of a selected branch, in the method proposed in \cite{PreviousWork}, the mean of the absolute value of the remaining branches' LODFs after the selected branch's outage is normalized with the standard deviation. Equation~\eqref{eq:Measures} shows the metric $NLODF(i)$ based on normalized absolute values of LODFs, \begin{subequations} \begin{align} \label{eq:Measures} & NLODF(i)=\frac {mean(abs(LODFs))}{std(abs(LODFs))}\\ \label{eq:Measure} & M(i)=PF(i)\times min\{NLODF(i),1\} \end{align} \end{subequations} \noindent where $PF(i)$ is the power flow in line $i$ during the normal operation; $mean\left({\,\cdot\,}\right)$, $std\left({\,\cdot\,}\right)$, and $abs\left({\,\cdot\,}\right)$ indicate the mean, the standard deviation, and the absolute functions, respectively. The $min$ function in~\eqref{eq:Measure} enforces that $NLODF(i)$ is less than or equal to one, e.g., when an islanding situation is encountered. \subsection{Group Betweenness Centrality} \label{Group_Betweenness_Centrality} The betweenness centrality for an element in the graph can be defined as the frequency at which that element (i.e., a node or edge) is in the shortest path between the node pairs of the entire graph. To apply the betweenness centrality into $N-x$ contingency analysis to identify multiple branches in a graph, the method in \cite{PreviousWork} extends the betweenness centrality metric to the group betweenness centality (GBC) metric. The method can then be utilized to identify multiple critical branches simultaneously in a graph. The GBC metric is mathematically represented as follows: \begin{equation} \label{eq:GBC} GBC(E)=\sum_{s=1}^{n} \sum_{t=1}^{ n}\frac{\sigma(s,t|E)}{\sigma(s,t)} ,s,t\not\in E, s\neq t \end{equation} \noindent The $E$ in equation~\eqref{eq:GBC} represents the subset of edges of interest, $\sigma(s,t)$ is the number of shortest paths between $s$ and $t$, and $\sigma(s,t|E)$ is the number of shortest paths between $s$ and $t$ that contain any element in $E$. \section{The Framework of Identifying Critical Branches Over the Whole Grid} \label{Methodology} The proposed method extends upon \cite{PreviousWork} that constructs the searching graph using \textit{searching level} ($sl$), which only considers branches that are around the desired branch. In this paper, we enlarge the searching graph by looking at branches that are far away from the desired branch. Thus, we introduce a new parameter, \textit{distance} ($d$), that quantifies the distance between the branches with the highest $M$ value and other desired branches of interest. The $sl$ parameter will then define a larger searching graph based on the branches of interest. Then, by using the $GBC$ and $LODFs$, the proposed approach identifies the critical multiple-element branch contingencies in a wider area. Figure~\ref{fig:flowchart} summarizes the multiple steps of the proposed method for identifying critical branches. First, based on the system information, we compute the $NLODF$ and $M$ for each line. Then, we select the first $a\%$ of the branches with the highest value as the starting point to construct each subgraph. The $d$ determines the distance between the line with the highest $M$ value and other desired branches of interest. For instance, for $N-3$ contingency analysis, we first select the line with the highest $M$ value and then find the branches with high $M$ in the vicinity of the first selected line within $d$-hop distance from the first selected line. Once these branches are determined, we use $sl$ to find the nodes that are within the $sl$-hop distance from both ends of the selected branches. Note that $sl\geq d$ in order to guarantee the connectivity of the sub-graph. All these nodes create a graph which is a sub-graph of the underlying graph of the test case. At last, we apply the $GBC$ for each subgraph and identify the $X$ most critical branches in each subgraph. \begin{figure}[h!] \centering \includegraphics[scale=0.54,trim={0.0cm 0.0cm 0.0cm 0.0 cm},clip]{HICSS_Framework.png} \caption{Critical Branches Identification Framework} \label{fig:flowchart} \vspace{-0.2cm} \end{figure} To construct the subgraph, the proposed approach first selects the branches with highest $M$, which is shown with green star ends in Figure~\ref{fig}. Based on the $d$ parameter, the method then selects the neighboring branches that have high $M$ and are within $d$-hop distance, which are shown with yellow diamond ends in Figure~\ref{fig}. The green star nodes and yellow diamond nodes constitute the desired branches, which are the bone nodes in subgraph. Then, the subgraph selects branches that are within $sl$-hop distance from the ends of these desired branches, which are shown with red triangle ends in Figure~\ref{fig}. All colored nodes in Figure~\ref{fig} are the subgraph for one of the first $a\%$ of the most impactful branches in the grid. \begin{figure}[t!] \centering \includegraphics[width=7.5cm]{figure2.jpg} \caption{The equivalent graph of the pglib\_opf\_case162\_ieee\_dtc test cases~\cite{pglib} with the $d$ = 3 and $sl$ = 3. The green star nodes show both ends of the line whose outage has the highest $M$. The yellow diamond nodes show other high impact branches in the grid that are within 3 hop-distance to the green star nodes. The red triangle nodes are within 3-hop distance from the desired branches (green star nodes and yellow diamond nodes).} \vspace{-0.5cm}\label{fig} \end{figure} \section{Numerical Results} \label{Numerical_results} In this section, we apply our approach to two synthetic test cases, a 200-bus and 500-bus case respectively, from the benchmark library for electric power grids in Texas A\&M University~\cite{benchmarking_library}. We implement our approach in Python and use ESA~\cite{ESA} to communicate with PowerWorld Simulator to collect LODFs. The results are computed using a laptop with an i7 1.80 GHz processor and 16 GB of RAM. \begin{itemize} \item \textbf{200-Bus Test System} \end{itemize} This 200-bus synthetic test is a relatively small size test system system with 245 branches and 49 generators~\cite{benchmarking_library} and it is selected to evaluate the effectiveness of the proposed method. Both brute force and the proposed contingency analysis methods have been applied in this case and find the same critical lines for the $N-1$ and $N-2$ contingency analysis. Comparing the computational time of both methods for $N-2$ contingency analysis, the proposed algorithm can find the result within 100 seconds for $sl=3$, while it took 230 seconds for the brute force search. For $x>2$, the brute force method can be hardly applied. This makes the proposed approach a good candidate to perform a higher order $N-x$ contingency analysis in larger test cases where it is not possible to find critical lines by the brute force search method. \begin{table*} \centering \caption{Results from Applying the Proposed Approach to 200-bus Test System with $d=4$ and $sl=4$.} \begin{tabular}{|c|c|c|} \hline X & Critical Line & Violations \tabularnewline \hline \hline 1 & {[}189, 187{]} & \ Reserve Limit\tabularnewline \hline 2 & {[}189, 187{]}, {[}187, 121{]} & Reserve limit\tabularnewline \hline \rowcolor{lightgray} 2 & {[}189, 187{]}, {[}136,133{]} & Reserve limit\tabularnewline \hline 2 & {[}136, 133{]}, {[}135, 133{]} & 1 Overflow and Reserve limit\tabularnewline \hline 3 & {[}189, 187{]}, {[}187, 121{]}, {[}154, 149{]} & Reserve Limit\tabularnewline \hline \rowcolor{lightgray}3 & {[}189,187{]}, {[}136, 133{]}, {[}135, 133{]} & Unsolved\tabularnewline \hline 3 & {[}136, 133{]}, {[}135, 133{]}, {[}125, 123{]} & 2 Overflow, 18 Undervoltage and Reserve Limit\tabularnewline \hline \rowcolor{lightgray}4 & {[}189, 187{]}, {[}136, 133{]}, {[}135, 133{]}, {[}125, 123{]} & Unsolved\tabularnewline \hline 4 & {[}189, 187{]}, {[}187, 121{]}, {[}154, 149{]}, {[}152, 149{]} & 2 Overflow\tabularnewline \hline \rowcolor{lightgray}5 & {[}189, 187{]}, {[}136, 133{]}, {[}135, 133{]}, {[}125, 123{]}, {[}126, 123{]} & Unsolved\tabularnewline \hline 5 & {[}189, 187{]}, {[}187, 121{]}, {[}154, 149{]}, {[}152, 149{]}, {[}153, 149{]} & Unsolved\tabularnewline \hline 5 & {[}136, 133{]}, {[}135, 133{]}, {[}125, 123{]}, {[}126, 123{]}, {[}127, 123{]} & Unsolved \tabularnewline \hline \end{tabular} \label{table:200_bus} \end{table*} \begin{figure}[t!] \centering \subfloat{\includegraphics[trim={1mm 1mm 1mm 1mm}, clip,height=1.9 in,width=3 in]{200Bussl3.png}\label{200bus_level3}} \vspace{-0.01cm} \subfloat{\includegraphics[trim={1mm 1mm 1mm 1mm}, clip,height=1.9 in,width=3 in]{200Bussl4.png}\label{200bus_level4}} \caption{Computation Time for 200 Bus Case Against Different \textit{Search Level}, \textit{Distance} and \textit{X}}\label{allscenarios_200} \vspace{-0.5cm} \end{figure} The proposed algorithm is utilized to solve different levels of the $N-x$ contingency analysis for 200-bus test systems. The contingency analysis for different combinations of $d$ and $sl$ are solved to evaluate the impact of these parameters on finding the critical branches in the underlying test system. The results for 200-bus test system for $sl=4$ and $d=4$ are tabulated in Table~\ref{table:200_bus}. The first column in this table lists the order of the contingency analysis (i.e., $x$ in the $N-x$ term). The second and the third columns represent critical branches and contingency violation types, respectively. Various types of limit violations, including \emph{reserve limit}, \emph{overflow}, \emph{undervoltage}, and \emph{unsolved} are considered in this paper. Note that the \emph{unsolved} case mirrors the situation where there is no solution for the power flow equations. The types of contingency violations in the third column are found via removing the listed critical branches in the second column. The proposed algorithm can find more critical branches with more severe contingencies for 200-bus test system compare to the approach in~\cite{PreviousWork}, which are highlighted in Table~\ref{table:200_bus}. Finding new critical branches by the proposed algorithm authenticate its superiority on our previous approach. The one-line diagram of the 200-bus test cases and the corresponding violations caused by the outage of branches [136, 133], [135, 133], and [125, 123] is depicted in Figure~\ref{200buscase}. The execution time of the proposed algorithm for various contingency levels ($x$) and different combinations of $sl$ and $d$ are visualized in Figure~\ref{allscenarios_200}. Figure~\ref{allscenarios_200} shows that the execution time for a specific contingency level often linearly increases by $d$ increment. The important point is that the execution time of contingency analysis for specific search level and distance increases linearly as $x$ increases. This characteristic qualifies the proposed approach for performing different levels of contingency analysis in larger test cases where the problem is computationally intractable for traditional contingency analysis methods. \begin{figure}[t!] \centering \includegraphics[scale=0.32,trim={0.0cm 0.0cm 0.0cm 0.0 cm},clip]{200buscasecontingency.png} \caption{200-bus Test System after Outages of Following Branches [136,133][135,133][125,123]} \label{200buscase} \vspace{-0.5cm} \end{figure} \begin{itemize} \item \textbf{500-Bus Test System} \end{itemize} With 597 branches and 90 generators, the 500-bus test system can challenge the ability of different approaches in identifying critical branches in electric power grids. The 500-bus test system is resilient enough that it is hard to identify a limit violation even by randomly removing multiple branches. Nevertheless, the proposed algorithm easily identifies multiple limit violations caused by outage of few branches. For instance, the outage of the following branches, i.e. [162, 220], [23, 386], and [87, 141], cause an overflow violation in the system. Multiple limit violations caused by few line outages are listed in Table~\ref{tab:500_1} and Table~\ref{tab:500_2} for different values of $sl$ and $d$. Although the 500-bus test system is resilient, the proposed approach is able to find multiple limit violations caused by three to five line outages. This verifies the ability of the proposed approach in solving contingency analysis in relatively large test systems. Compare to our previous approach in~\cite{PreviousWork}, the proposed approach identifies new critical branches in 500-bus test system, which are listed in highlighted rows in Table~\ref{tab:500_1} and Table~\ref{tab:500_2}. This verifies that the proposed algorithm can search for critical branches in the system more efficiently compare to the previous approach in~\cite{PreviousWork}. \begin{figure}[t] \centering \subfloat{\includegraphics[trim={1mm 1mm 1mm 1mm}, clip,height=1.9 in,width=3 in]{500Bussl3.png}\label{500bus_level3}} \vspace{-0.01cm} \subfloat{\includegraphics[trim={1mm 1mm 1mm 1mm}, clip,height=1.9 in,width=3 in]{500Bussl4.png}\label{500bus_level4}} \caption{Computation Time for 500 Bus Case Against Different \textit{Search Level}, \textit{Distance} and \textit{X}} \vspace{-0.5cm} \label{500bus_time} \end{figure} The computational time for solving different levels of contingency analysis problems for 500-bus test system for various $d$ and $sl$ are shown in Figure~\ref{500bus_time}. Similar to computational times of contingency analysis in 200-bus test system, the computational time of contingency analysis for 500-bus test system linearly increases by $d$ increment for specific $sl$ and contingency analysis level, i.e. $x$. Comparing the the plots in Figure~\ref{500bus_time} shows that the computational time is more sensitive to the $sl$ rather than the $d$. It is because the number of neighboring nodes (i.e. red triangle nodes in Figure~\ref{fig}) that needs to be evaluated increases by the search level value. However, the computational time increases linearly with increment in $sl$ and $d$, which makes the proposed approach tractable for rendering contingency analysis in large test systems. \begin{table*}[h!] \caption{Results from Applying the Proposed Approach to 500-bus Test System with $d=2$ and $sl=3$. } \label{tab:results_for_500_bus_level3} \centering \begin{tabular}{|c|c|c|} \hline x & Critical Line & Violations\tabularnewline \hline \hline 3 & {[}142, 141{]}, {[}424, 423{]}, {[}87, 141{]} & 3 Overflow\tabularnewline \hline 3 & {[}162, 220{]}, {[}23, 386{]}, {[}87, 141{]} & 1 Overflow\tabularnewline \hline 4 & {[}162, 220{]}, {[}23, 386{]}, {[}87, 141{]}, {[}247, 246{]} & Unsolved\tabularnewline \hline 4 & {[}142, 141{]}, {[}424, 423{]}, {[}87, 141{]}, {[}247, 246{]} & Unsolved\tabularnewline \hline 5 & {[}162, 220{]}, {[}23, 386{]}, {[}87, 141{]}, {[}247, 246{]}, {[}437, 428{]} & Unsolved\tabularnewline \hline \rowcolor{lightgray}5 & {[}162, 220{]}, {[}23, 386{]}, {[}142, 141{]}, {[}424, 423{]}, {[}87, 141{]} & 5 Overflow\tabularnewline \hline 5 & {[}142, 141{]}, {[}424, 423{]}, {[}87, 141{]}, {[}247, 246{]}, {[}402, 401{]} & Unsolved\tabularnewline \hline \end{tabular} \label{tab:500_1} \end{table*} \begin{table*} \caption{Results from Applying the Proposed Approach to 500-bus Test System with $d=2$ and $sl=4$.} \label{tab:results_for_500_bus_level4} \centering \begin{tabular}{|c|c|c|} \hline X & Critical Line & Violations\tabularnewline \hline \hline 3 & {[}142, 141{]}, {[}424, 423{]}, {[}87, 141{]} & 3 Overflow\tabularnewline \hline 4 & {[}162, 220{]}, {[}23, 386{]}, {[}87, 141{]}, {[}247, 246{]} & Unsolved\tabularnewline \hline 5 & {[}142, 141{]}, {[}424, 423{]}, {[}87, 141{]}, {[}247, 246{]}, {[}402, 401{]} & Unsolved\tabularnewline \hline \rowcolor{lightgray}5 & {[}268, 267{]}, {[}213, 212{]}, {[}105, 104{]}, {[}408, 407{]}, {[}36, 35{]}{]} & 2 Overvoltage\tabularnewline \hline \end{tabular} \label{tab:500_2} \end{table*} \begin{figure}[h!] \centering \includegraphics[scale=0.32,trim={0.0cm 0.0cm 0.0cm 0.0 cm},clip]{500buscasecontingency.JPG} \caption{500-bus Test System after Outage of the Following Branches [162, 220][23, 386][142, 141][424, 423][87, 141]} \label{500buscase} \vspace{-0.5cm} \end{figure} \section{Conclusion and Future Work} \label{Conclusion} The proposed approach provides a computationally tractable approach to identify critical multiple-element branch contingencies by exploiting the group betweenness centrality and LODFs. The capability of the proposed method in finding critical branches in electric power grids is examined by two synthetic grids and different $N-x$ contingency analyses in these systems. The obtained results demonstrate that the proposed method computes the high-impact multiple-element contingencies in realistic synthetic test systems. The proposed approach can help power system operators to identify critical branches and make proper decisions to preserve power system reliability via protecting these critical branches against natural incidents, cyber-attacks, etc. For future work, there are two potential ways to improve the framework's efficiency and speed. First, from the results on computation times, it is obvious that the required computation time increases as the subgraph size increases. However, a larger subgraph is not guaranteed to identify all critical branches. It is more efficient to create subgraphs without too much overlapping. Obtaining the appropriate parameter pair of $d$ and $sl$ through analyzing subgraphs' overlapping situation for each case can improve the overall efficiency. Secondly, the proposed method is searching critical branches repeatedly over each subgraph. Thus, applying the framework with parallel computing can improve its speed greatly, which can make it more applicable in industry. \section{Acknowledgement} \label{Acknowledgement} The work described in this paper was supported by funds from the US Department of Energy under award DE-OE0000895 and the National Science Foundation under Grant 1916142. \bibliographystyle{ieeetr} \section{Introduction} As a reliability requirement, modern power grids must have the ability to withstand $N-1$ contingencies. However, $N-1$ analysis fails to capture high-impact scenarios due to increasing threats from cyber and physical domains that can cause multiple elements to disfunction or malfunction concurrently, potentially leading to cascading failures in the system and large-scale blackouts. as evident from recent examples~\cite{Real_Time_Contingency1,Real_Time_Contingency2,NYBlackoutCause}. The well-known Northeast blackout in 2003 affected 55 million people, and was caused by cascading failure. A cascading failure refers to a sequence of dependent events, where the initial failure of one or more components trigger the sequential failure of other components\cite{cascading_failure1, cascading_failure2}. Identifying and protecting the critical components that can trigger a cascading failure is an important need that would enable grid operators to prevent cascading failures and operate the system reliably. Contingency analysis, a key problem in power system operation, is a systematic study of the impact of an individual or a group of system component failures on the overall system~\cite{NERC}. In general, $N-x$ contingency analysis, where $x\ge2$, studies the impact of various combinations of $x$ individual components failing concurrently~\cite{Group_betweenness}. The number of multiple components assessed in a $N-x$ contingency analysis grows exponentially with $x$. For instance, the number of contingency cases for $N-1$ analysis is 20000 for a system with 20000 components, while the number of contingency cases for $N-2$ and $N-3$ analyses are approximately $10^8$ and $10^{12}$; this clearly becomes intractable as $x$ increases~\cite{Group_betweenness} To identify the influence of an element in a network, numerous studies have utilized different variations of centrality metrics in graph theory, including betweenness centrality, closeness centrality, graph centrality, stress centrality, degree centrality, and more. The approach in~\cite{Group_betweenness} modifies the betweenness centrality metric to identify multiple critical components whose loss can trigger cascading failures. The betweenness centrality metric is employed to identify the most critical component in power grids~\cite{Electrical_centrality, Centrality_Measures}. The study in~\cite{gorton2009high} applies the graph edge betweenness centrality metric to identify critical components in the large-scale power systems. In addition, various electrical properties have been proposed to be considered together with centrality metrics to increase the accuracy of critical component identification, such as the admittance matrix \cite{structural_vulnerability_analysis}, electrical distance \cite{Structural_vulnerability}, and the maximal load demand and the capacity of generators \cite{electrical_betweenness} to identify critical elements in power systems. A key important factor in identifying critical components in electric power grids is the impact that the loss of components might have on the system operation. None of the above studies consider the impact of component loss in identifying critical components. Our previous work~\cite{PreviousWork} applies Line Outage Distribution Factors (LODFs)~\cite{multiple_contingency} and betweenness centrality metrics to identify multiple critical branches in electric power grids. In this work, we improve upon the approach in~\cite{PreviousWork} to search in a wider area in the corresponding graph of the electric power grid, which enables the method to evaluate coupled critical branches that may be far away from each other. These geographically distributed coupled elements may be missed in the previous approach, and they are important to identify. Unlike the previous approach, which constructs the subgraph only with nearby branches, this work introduces a new parameter \textit{distance} that enlarges the searching graph. From the numerical results, the new approach can find more subsets of critical branches that cause more severe contingencies. The main contributions of this paper are thus as follows: \begin{enumerate} \item A new parameter \textit{distance} is introduced to enlarge the subgraph for the group betweenness centrality approach to identify critical branches. \item The resulting method is applied and evaluated on 200-bus and 500-bus synthetic grids, and the method's \textit{distance} and \textit{searching level} parameters are varied. \item From the contingency analysis results and comparison with ~\cite{PreviousWork}, the new approach can find more subsets of critical branches causing more violations. \end{enumerate} This paper is organized as follows. Section~\ref{Related Work} reviews the method in \cite{PreviousWork} on how to utilize LODFs and group betweenness centrality to find critical branches in large scale power grids. Section~\ref{Methodology} presents the improved approach for finding the most critical branches in a wider area. Section~\ref{Numerical_results} empirically evaluates the proposed approach in 200- and 500-bus synthetic power grids. Section~\ref{Conclusion} concludes the paper and discusses future work. \section{Related Work} \label{Related Work} This section reviews how LODFs and group centrality betweenness are utilized in the method proposed by the authors in \cite{PreviousWork} to identify critical multiple element contingencies. This method is a precursor to the extension developed in this paper. \subsection{Line Outage Distribution Factors} \label{LODF} To incorporate LODFs as a metric to identify the importance of a selected branch, in the method proposed in \cite{PreviousWork}, the mean of the absolute value of the remaining branches' LODFs after the selected branch's outage is normalized with the standard deviation. Equation~\eqref{eq:Measures} shows the metric $NLODF(i)$ based on normalized absolute values of LODFs, \begin{subequations} \begin{align} \label{eq:Measures} & NLODF(i)=\frac {mean(abs(LODFs))}{std(abs(LODFs))}\\ \label{eq:Measure} & M(i)=PF(i)\times min\{NLODF(i),1\} \end{align} \end{subequations} \noindent where $PF(i)$ is the power flow in line $i$ during the normal operation; $mean\left({\,\cdot\,}\right)$, $std\left({\,\cdot\,}\right)$, and $abs\left({\,\cdot\,}\right)$ indicate the mean, the standard deviation, and the absolute functions, respectively. The $min$ function in~\eqref{eq:Measure} enforces that $NLODF(i)$ is less than or equal to one, e.g., when an islanding situation is encountered. \subsection{Group Betweenness Centrality} \label{Group_Betweenness_Centrality} The betweenness centrality for an element in the graph can be defined as the frequency at which that element (i.e., a node or edge) is in the shortest path between the node pairs of the entire graph. To apply the betweenness centrality into $N-x$ contingency analysis to identify multiple branches in a graph, the method in \cite{PreviousWork} extends the betweenness centrality metric to the group betweenness centality (GBC) metric. The method can then be utilized to identify multiple critical branches simultaneously in a graph. The GBC metric is mathematically represented as follows: \begin{equation} \label{eq:GBC} GBC(E)=\sum_{s=1}^{n} \sum_{t=1}^{ n}\frac{\sigma(s,t|E)}{\sigma(s,t)} ,s,t\not\in E, s\neq t \end{equation} \noindent The $E$ in equation~\eqref{eq:GBC} represents the subset of edges of interest, $\sigma(s,t)$ is the number of shortest paths between $s$ and $t$, and $\sigma(s,t|E)$ is the number of shortest paths between $s$ and $t$ that contain any element in $E$. \section{The Framework of Identifying Critical Branches Over the Whole Grid} \label{Methodology} The proposed method extends upon \cite{PreviousWork} that constructs the searching graph using \textit{searching level} ($sl$), which only considers branches that are around the desired branch. In this paper, we enlarge the searching graph by looking at branches that are far away from the desired branch. Thus, we introduce a new parameter, \textit{distance} ($d$), that quantifies the distance between the branches with the highest $M$ value and other desired branches of interest. The $sl$ parameter will then define a larger searching graph based on the branches of interest. Then, by using the $GBC$ and $LODFs$, the proposed approach identifies the critical multiple-element branch contingencies in a wider area. Figure~\ref{fig:flowchart} summarizes the multiple steps of the proposed method for identifying critical branches. First, based on the system information, we compute the $NLODF$ and $M$ for each line. Then, we select the first $a\%$ of the branches with the highest value as the starting point to construct each subgraph. The $d$ determines the distance between the line with the highest $M$ value and other desired branches of interest. For instance, for $N-3$ contingency analysis, we first select the line with the highest $M$ value and then find the branches with high $M$ in the vicinity of the first selected line within $d$-hop distance from the first selected line. Once these branches are determined, we use $sl$ to find the nodes that are within the $sl$-hop distance from both ends of the selected branches. Note that $sl\geq d$ in order to guarantee the connectivity of the sub-graph. All these nodes create a graph which is a sub-graph of the underlying graph of the test case. At last, we apply the $GBC$ for each subgraph and identify the $X$ most critical branches in each subgraph. \begin{figure}[h!] \centering \includegraphics[scale=0.54,trim={0.0cm 0.0cm 0.0cm 0.0 cm},clip]{HICSS_Framework.png} \caption{Critical Branches Identification Framework} \label{fig:flowchart} \vspace{-0.2cm} \end{figure} To construct the subgraph, the proposed approach first selects the branches with highest $M$, which is shown with green star ends in Figure~\ref{fig}. Based on the $d$ parameter, the method then selects the neighboring branches that have high $M$ and are within $d$-hop distance, which are shown with yellow diamond ends in Figure~\ref{fig}. The green star nodes and yellow diamond nodes constitute the desired branches, which are the bone nodes in subgraph. Then, the subgraph selects branches that are within $sl$-hop distance from the ends of these desired branches, which are shown with red triangle ends in Figure~\ref{fig}. All colored nodes in Figure~\ref{fig} are the subgraph for one of the first $a\%$ of the most impactful branches in the grid. \begin{figure}[t!] \centering \includegraphics[width=7.5cm]{figure2.jpg} \caption{The equivalent graph of the pglib\_opf\_case162\_ieee\_dtc test cases~\cite{pglib} with the $d$ = 3 and $sl$ = 3. The green star nodes show both ends of the line whose outage has the highest $M$. The yellow diamond nodes show other high impact branches in the grid that are within 3 hop-distance to the green star nodes. The red triangle nodes are within 3-hop distance from the desired branches (green star nodes and yellow diamond nodes).} \vspace{-0.5cm}\label{fig} \end{figure} \section{Numerical Results} \label{Numerical_results} In this section, we apply our approach to two synthetic test cases, a 200-bus and 500-bus case respectively, from the benchmark library for electric power grids in Texas A\&M University~\cite{benchmarking_library}. We implement our approach in Python and use ESA~\cite{ESA} to communicate with PowerWorld Simulator to collect LODFs. The results are computed using a laptop with an i7 1.80 GHz processor and 16 GB of RAM. \begin{itemize} \item \textbf{200-Bus Test System} \end{itemize} This 200-bus synthetic test is a relatively small size test system system with 245 branches and 49 generators~\cite{benchmarking_library} and it is selected to evaluate the effectiveness of the proposed method. Both brute force and the proposed contingency analysis methods have been applied in this case and find the same critical lines for the $N-1$ and $N-2$ contingency analysis. Comparing the computational time of both methods for $N-2$ contingency analysis, the proposed algorithm can find the result within 100 seconds for $sl=3$, while it took 230 seconds for the brute force search. For $x>2$, the brute force method can be hardly applied. This makes the proposed approach a good candidate to perform a higher order $N-x$ contingency analysis in larger test cases where it is not possible to find critical lines by the brute force search method. \begin{table*} \centering \caption{Results from Applying the Proposed Approach to 200-bus Test System with $d=4$ and $sl=4$.} \begin{tabular}{|c|c|c|} \hline X & Critical Line & Violations \tabularnewline \hline \hline 1 & {[}189, 187{]} & \ Reserve Limit\tabularnewline \hline 2 & {[}189, 187{]}, {[}187, 121{]} & Reserve limit\tabularnewline \hline \rowcolor{lightgray} 2 & {[}189, 187{]}, {[}136,133{]} & Reserve limit\tabularnewline \hline 2 & {[}136, 133{]}, {[}135, 133{]} & 1 Overflow and Reserve limit\tabularnewline \hline 3 & {[}189, 187{]}, {[}187, 121{]}, {[}154, 149{]} & Reserve Limit\tabularnewline \hline \rowcolor{lightgray}3 & {[}189,187{]}, {[}136, 133{]}, {[}135, 133{]} & Unsolved\tabularnewline \hline 3 & {[}136, 133{]}, {[}135, 133{]}, {[}125, 123{]} & 2 Overflow, 18 Undervoltage and Reserve Limit\tabularnewline \hline \rowcolor{lightgray}4 & {[}189, 187{]}, {[}136, 133{]}, {[}135, 133{]}, {[}125, 123{]} & Unsolved\tabularnewline \hline 4 & {[}189, 187{]}, {[}187, 121{]}, {[}154, 149{]}, {[}152, 149{]} & 2 Overflow\tabularnewline \hline \rowcolor{lightgray}5 & {[}189, 187{]}, {[}136, 133{]}, {[}135, 133{]}, {[}125, 123{]}, {[}126, 123{]} & Unsolved\tabularnewline \hline 5 & {[}189, 187{]}, {[}187, 121{]}, {[}154, 149{]}, {[}152, 149{]}, {[}153, 149{]} & Unsolved\tabularnewline \hline 5 & {[}136, 133{]}, {[}135, 133{]}, {[}125, 123{]}, {[}126, 123{]}, {[}127, 123{]} & Unsolved \tabularnewline \hline \end{tabular} \label{table:200_bus} \end{table*} \begin{figure}[t!] \centering \subfloat{\includegraphics[trim={1mm 1mm 1mm 1mm}, clip,height=1.9 in,width=3 in]{200Bussl3.png}\label{200bus_level3}} \vspace{-0.01cm} \subfloat{\includegraphics[trim={1mm 1mm 1mm 1mm}, clip,height=1.9 in,width=3 in]{200Bussl4.png}\label{200bus_level4}} \caption{Computation Time for 200 Bus Case Against Different \textit{Search Level}, \textit{Distance} and \textit{X}}\label{allscenarios_200} \vspace{-0.5cm} \end{figure} The proposed algorithm is utilized to solve different levels of the $N-x$ contingency analysis for 200-bus test systems. The contingency analysis for different combinations of $d$ and $sl$ are solved to evaluate the impact of these parameters on finding the critical branches in the underlying test system. The results for 200-bus test system for $sl=4$ and $d=4$ are tabulated in Table~\ref{table:200_bus}. The first column in this table lists the order of the contingency analysis (i.e., $x$ in the $N-x$ term). The second and the third columns represent critical branches and contingency violation types, respectively. Various types of limit violations, including \emph{reserve limit}, \emph{overflow}, \emph{undervoltage}, and \emph{unsolved} are considered in this paper. Note that the \emph{unsolved} case mirrors the situation where there is no solution for the power flow equations. The types of contingency violations in the third column are found via removing the listed critical branches in the second column. The proposed algorithm can find more critical branches with more severe contingencies for 200-bus test system compare to the approach in~\cite{PreviousWork}, which are highlighted in Table~\ref{table:200_bus}. Finding new critical branches by the proposed algorithm authenticate its superiority on our previous approach. The one-line diagram of the 200-bus test cases and the corresponding violations caused by the outage of branches [136, 133], [135, 133], and [125, 123] is depicted in Figure~\ref{200buscase}. The execution time of the proposed algorithm for various contingency levels ($x$) and different combinations of $sl$ and $d$ are visualized in Figure~\ref{allscenarios_200}. Figure~\ref{allscenarios_200} shows that the execution time for a specific contingency level often linearly increases by $d$ increment. The important point is that the execution time of contingency analysis for specific search level and distance increases linearly as $x$ increases. This characteristic qualifies the proposed approach for performing different levels of contingency analysis in larger test cases where the problem is computationally intractable for traditional contingency analysis methods. \begin{figure}[t!] \centering \includegraphics[scale=0.32,trim={0.0cm 0.0cm 0.0cm 0.0 cm},clip]{200buscasecontingency.png} \caption{200-bus Test System after Outages of Following Branches [136,133][135,133][125,123]} \label{200buscase} \vspace{-0.5cm} \end{figure} \begin{itemize} \item \textbf{500-Bus Test System} \end{itemize} With 597 branches and 90 generators, the 500-bus test system can challenge the ability of different approaches in identifying critical branches in electric power grids. The 500-bus test system is resilient enough that it is hard to identify a limit violation even by randomly removing multiple branches. Nevertheless, the proposed algorithm easily identifies multiple limit violations caused by outage of few branches. For instance, the outage of the following branches, i.e. [162, 220], [23, 386], and [87, 141], cause an overflow violation in the system. Multiple limit violations caused by few line outages are listed in Table~\ref{tab:500_1} and Table~\ref{tab:500_2} for different values of $sl$ and $d$. Although the 500-bus test system is resilient, the proposed approach is able to find multiple limit violations caused by three to five line outages. This verifies the ability of the proposed approach in solving contingency analysis in relatively large test systems. Compare to our previous approach in~\cite{PreviousWork}, the proposed approach identifies new critical branches in 500-bus test system, which are listed in highlighted rows in Table~\ref{tab:500_1} and Table~\ref{tab:500_2}. This verifies that the proposed algorithm can search for critical branches in the system more efficiently compare to the previous approach in~\cite{PreviousWork}. \begin{figure}[t] \centering \subfloat{\includegraphics[trim={1mm 1mm 1mm 1mm}, clip,height=1.9 in,width=3 in]{500Bussl3.png}\label{500bus_level3}} \vspace{-0.01cm} \subfloat{\includegraphics[trim={1mm 1mm 1mm 1mm}, clip,height=1.9 in,width=3 in]{500Bussl4.png}\label{500bus_level4}} \caption{Computation Time for 500 Bus Case Against Different \textit{Search Level}, \textit{Distance} and \textit{X}} \vspace{-0.5cm} \label{500bus_time} \end{figure} The computational time for solving different levels of contingency analysis problems for 500-bus test system for various $d$ and $sl$ are shown in Figure~\ref{500bus_time}. Similar to computational times of contingency analysis in 200-bus test system, the computational time of contingency analysis for 500-bus test system linearly increases by $d$ increment for specific $sl$ and contingency analysis level, i.e. $x$. Comparing the the plots in Figure~\ref{500bus_time} shows that the computational time is more sensitive to the $sl$ rather than the $d$. It is because the number of neighboring nodes (i.e. red triangle nodes in Figure~\ref{fig}) that needs to be evaluated increases by the search level value. However, the computational time increases linearly with increment in $sl$ and $d$, which makes the proposed approach tractable for rendering contingency analysis in large test systems. \begin{table*}[h!] \caption{Results from Applying the Proposed Approach to 500-bus Test System with $d=2$ and $sl=3$. } \label{tab:results_for_500_bus_level3} \centering \begin{tabular}{|c|c|c|} \hline x & Critical Line & Violations\tabularnewline \hline \hline 3 & {[}142, 141{]}, {[}424, 423{]}, {[}87, 141{]} & 3 Overflow\tabularnewline \hline 3 & {[}162, 220{]}, {[}23, 386{]}, {[}87, 141{]} & 1 Overflow\tabularnewline \hline 4 & {[}162, 220{]}, {[}23, 386{]}, {[}87, 141{]}, {[}247, 246{]} & Unsolved\tabularnewline \hline 4 & {[}142, 141{]}, {[}424, 423{]}, {[}87, 141{]}, {[}247, 246{]} & Unsolved\tabularnewline \hline 5 & {[}162, 220{]}, {[}23, 386{]}, {[}87, 141{]}, {[}247, 246{]}, {[}437, 428{]} & Unsolved\tabularnewline \hline \rowcolor{lightgray}5 & {[}162, 220{]}, {[}23, 386{]}, {[}142, 141{]}, {[}424, 423{]}, {[}87, 141{]} & 5 Overflow\tabularnewline \hline 5 & {[}142, 141{]}, {[}424, 423{]}, {[}87, 141{]}, {[}247, 246{]}, {[}402, 401{]} & Unsolved\tabularnewline \hline \end{tabular} \label{tab:500_1} \end{table*} \begin{table*} \caption{Results from Applying the Proposed Approach to 500-bus Test System with $d=2$ and $sl=4$.} \label{tab:results_for_500_bus_level4} \centering \begin{tabular}{|c|c|c|} \hline X & Critical Line & Violations\tabularnewline \hline \hline 3 & {[}142, 141{]}, {[}424, 423{]}, {[}87, 141{]} & 3 Overflow\tabularnewline \hline 4 & {[}162, 220{]}, {[}23, 386{]}, {[}87, 141{]}, {[}247, 246{]} & Unsolved\tabularnewline \hline 5 & {[}142, 141{]}, {[}424, 423{]}, {[}87, 141{]}, {[}247, 246{]}, {[}402, 401{]} & Unsolved\tabularnewline \hline \rowcolor{lightgray}5 & {[}268, 267{]}, {[}213, 212{]}, {[}105, 104{]}, {[}408, 407{]}, {[}36, 35{]}{]} & 2 Overvoltage\tabularnewline \hline \end{tabular} \label{tab:500_2} \end{table*} \begin{figure}[h!] \centering \includegraphics[scale=0.32,trim={0.0cm 0.0cm 0.0cm 0.0 cm},clip]{500buscasecontingency.JPG} \caption{500-bus Test System after Outage of the Following Branches [162, 220][23, 386][142, 141][424, 423][87, 141]} \label{500buscase} \vspace{-0.5cm} \end{figure} \section{Conclusion and Future Work} \label{Conclusion} The proposed approach provides a computationally tractable approach to identify critical multiple-element branch contingencies by exploiting the group betweenness centrality and LODFs. The capability of the proposed method in finding critical branches in electric power grids is examined by two synthetic grids and different $N-x$ contingency analyses in these systems. The obtained results demonstrate that the proposed method computes the high-impact multiple-element contingencies in realistic synthetic test systems. The proposed approach can help power system operators to identify critical branches and make proper decisions to preserve power system reliability via protecting these critical branches against natural incidents, cyber-attacks, etc. For future work, there are two potential ways to improve the framework's efficiency and speed. First, from the results on computation times, it is obvious that the required computation time increases as the subgraph size increases. However, a larger subgraph is not guaranteed to identify all critical branches. It is more efficient to create subgraphs without too much overlapping. Obtaining the appropriate parameter pair of $d$ and $sl$ through analyzing subgraphs' overlapping situation for each case can improve the overall efficiency. Secondly, the proposed method is searching critical branches repeatedly over each subgraph. Thus, applying the framework with parallel computing can improve its speed greatly, which can make it more applicable in industry. \section{Acknowledgement} \label{Acknowledgement} The work described in this paper was supported by funds from the US Department of Energy under award DE-OE0000895 and the National Science Foundation under Grant 1916142. \bibliographystyle{ieeetr}
\section{Introduction} A contractive representation of a semigroup $P$ on a Hilbert space $\mathcal{H}$ is a semigroup homomorphism $T:P\to\bh{H}$ such that $\|T_p\| \leq 1$ for every $p\in P$. If $p$ is not invertible in $P$ the operator $T_p$ does not have to be isometric. For example, any contractive operator $A\in\bh{H}$ gives rise to a contractive representation $T:\mathbb{N}\to\bh{H}$ by $T(n)=A^n$. Nevertheless, a celebrated theorem of Sz.\ Nagy's shows that a contractive representation of $\mathbb{N}$ is always the compression of an isometric representation. In other words, there exists an isometry $V$ on a larger Hilbert space $\mathcal{K}\supset\mathcal{H}$, such that \[ A^n = P_{\mathcal{H}} V^n \big|_\mathcal{H} \qquad (n\in\mathbb{N}).\] The operator $V$ is called an isometric dilation of $T$. Nagy's dilation theorem has been generalized in several directions. Examples include Ando's dilation for commuting contractions \cite{Ando1963}, Brehmer's regular dilation \cite{Brehmer1961}, and Frazho-Bunce-Popescu's dilation of row contractions \cite{Frazho1982, Bunce1984, Popescu1989}. In his seminal work on $\mathrm{C}^*$-algebras of quasi-lattice ordered semigroups \cite{Nica1992}, Nica abstracts a notion of covariance (Nica-covariance) from the left-regular representation and uses it to define a sensible notion of universal semigroup $\mathrm{C}^*$-algebra. The study of Nica-covariant representations transformed the study of semigroup $\mathrm{C}^*$-algebras into a very active area, and guided its development until the inception of a vast generalization in work of X. Li \cite{XLi2012}. Early developments include the semigroup crossed product techniques from \cite{LacaRaeburn1996}, applications to Artin monoids \cite{CrispLaca2002,CrispLaca2007}; more recent ones include the analysis of right LCM semigroups \cite{BLS2017, Starling2015}. Meanwhile, dilation theory also developed as an important tool in connecting various types of semigroup representations, as, for example, dilation theorems for lattice ordered semigroups \cite{Fuller2013,BLi2014} and right LCM semigroups \cite{Li2017, BLi2019}. The study of semigroup representations and semigroup $\mathrm{C}^*$-algebras is closely related to the study of semigroup dynamical systems. For example, the Cuntz algebra $\mathcal{O}_n$ can be realized as a crossed product of a certain semigroup dynamical system over a UHF algebra of type $n^\infty$. Moreover, as pointed out in \cite{Nica1992} and formally established in \cite{LacaRaeburn1996}, $\mathrm{C}^*$-algebras of quasi-lattice ordered semigroups also possess a crossed product structure, of a canonical action of the semigroup on the commutative diagonal algebra. This construction also motivated the study of boundary quotients, an analogue of the Cuntz algebras in the realm of semigroup $\mathrm{C}^*$-algebras. On the other hand, in the realm of non-self-adjoint operator algebras, semigroup dynamical systems play a central role in the construction of various semicrossed product algebras and the computation of their $\mathrm{C}^*$-envelope \cite{EvgElias2012, DK2012, DFK2014, Li2020env}. Dilation theory is often a useful tool in these studies. In this paper, we consider a class of dynamical systems over cancellative right LCM semigroups, which we call {\em right LCM dynamical systems}. In general, the semigroup action $\alpha$ for a semigroup dynamical system only encodes the semigroup multiplication via $\alpha_p\alpha_q=\alpha_{pq}$, and any additional structure of the semigroup is often lost. For example, even if the semigroup has a lattice structure, there is no reason to expect that this structure will be reflected by a semigroup action, although in some cases it is indeed automatically preserved, e.g. the action by endomorphisms that lead to the Bost-Connes algebra. It was the analysis of this specific example that led to the consideration of semigroup actions that ``respect the lattice structure" \cite[Definition 3]{Laca1998}, and our first step is to extend this definition to actions by right LCM semigroups, see Definition \ref{df.respectLCM} below. In the study of semigroup dynamical systems $(\mathcal{A},P,\alpha)$, an isometric covariant representation is a pair $(\pi,V)$ where $\pi$ is a $*$-representation of the $\mathrm{C}^*$-algebra $\mathcal{A}$, $V$ is an isometric representation of the semigroup $P$, and the $P$-action $\alpha$ is encoded by the covariance relation: \[V(p) \pi(a) V(p)^* = \pi(\alpha_p(a)).\] We can similarly define a contractive covariant representation to be a pair $(\phi, T)$ where $\phi$ is a unital $*$-preserving linear map, which need not be multiplicative, and $T$ is a contractive representation of the semigroup $P$. Again, the $P$-action is encoded by the covariance relation: \[T(p) \phi(a) T(p)^* = \phi(\alpha_p(a)).\] Our main result, Theorem \ref{thm.dym.dilation}, states that a contractive covariant representation $(\phi,T)$ can be dilated to an isometric covariant representation $(\pi,V)$ if and only if $\phi$ is a unital completely positive map. In the special case when the semigroup is trivial, i.e. $P=\{e\}$, our theorem recovers the celebrated Stinespring's dilation theorem for unital completely positive maps. The paper is organized as follows. In Section \ref{sec.prelim} we give a brief overview of semigroups and their representations. In Section \ref{sect.LCMDynSys} we define right LCM semigroup dynamical systems and their isometric and \tcb{contractive} covariant representations, Definitions \ref{df.CovariantPair} and \ref{df.ContractiveCovariantPair}. In order to study dilations on semigroup dynamical systems in \tcb{S}ection \ref{sect.Naimark}, we first define the notion of kernel systems, Definition \ref{df.kernel} and then develop a general framework to deal with dilations of our semigroup dynamical systems, Theorem \ref{thm.kernel.dilation}. This can be viewed as a generalization of the Naimark dilation theorem for positive definite Toeplitz kernels, a major tool in the study of dilation theory of semigroup representations \cite{Popescu1999b, BLi2019}. In section \ref{sect.dilation} we prove our main result, Theorem \ref{thm.dym.dilation}, by first building a kernel system $K$ from a contractive covariant representation $(\phi,T)$, Definition \ref{df.K}, and then proving that this kernel system is positive if and only if $\phi$ is a unital completely positive map, Proposition \ref{prop.positive.ucp}. The proof is then concluded by showing that when $\phi$ is unital completely positive, the minimal Naimark dilation for $K$ \tcb{is} an isometric covariant representation. One major motivation for this paper comes from the dynamical systems arising from semigroup $\mathrm{C}^*$-algebras and their boundary quotients, and we explore such connections in section \ref{sect.exLCM}. As a highlight, we characterize all representations that can be dilated to a representation of the boundary quotient, Corollary \ref{cor.QDilation}. Finally, in section \ref{sect.example}, we explore some additional constructions of right LCM semigroup dynamical systems and their dilation theory, yielding several new results on dilating unital completely positive maps satisfying certain relations. \section{Preliminaries}\label{sec.prelim} \subsection{Semigroups and representations} A semigroup $P$ is a set with an associative multiplication. An element $e\in P$ is called the identity if $ex=xe=x$ for all $x\in P$. A semigroup with an identity is called a monoid. An element $p\in P$ need not have an inverse; when it does, it is called \emph{a unit}. The set of all units is denoted by $P^*$, which is a group on its own. A semigroup $P$ is called \emph{left-cancellative} if for any $p,x,y\in P$ with $px=py$, we must have $x=y$. We can similarly define the notion of right-cancellative, and we say a semigroup is \emph{cancellative} if it is both left and right cancellative. It is often convenient to assume that the semigroup $P$ embeds inside a group $G$, in which case $P$ must be cancellative. However, the converse is false: cancellative semigroups need not embed in groups, and it is often a challenging task to verify whether a semigroup can be embedded in a group. For example, it was only relatively recently that all Artin monoids were shown to embed in their corresponding Artin groups \cite{Paris2002}. Throughout this paper, unless stated otherwise, we assume the semigroup $P$ is cancellative and contains an identity $e$. Nica first defined and studied quasi-lattice ordered groups in \cite{Nica1992}. Consider a semigroup $P$ inside a group $G$ with $P\cap P^{-1}=\{e\}$. The semigroup $P$ defines a partial order on $G$ by $x\leq y$ when $x^{-1}y\in P$. This order is called a \emph{quasi-lattice order} if, for any finite $F\subset G$ with a common upper bound, there exists a least common upper bound. The pair $(G,P)$ is called a \emph{quasi-lattice ordered group}, and we often refer to $P$ as a \emph{quasi-lattice ordered semigroup}. Nica's work has been extended to more general classes of semigroups, for example, right LCM semigroups \cite{BLS2017}, which are a large class of semigroups that closely resemble quasi-lattice ordered semigroups. A left-cancellative semigroup $P$ is called a \emph{right LCM semigroup} if for any $p,q\in P$, either $pP\cap qP=\emptyset$ or else $pP\cap qP=rP$ for some $r\in P$. Here, the element $r$ can be seen as a least-common upper bound of $p,q$. Since we do not preclude non-trivial units in $P$, it is possible that the choice of $r$ is not unique. Nevertheless, for $r,s\in P$, $rP=sP$ precisely when $r=su$ for some unit $u\in P^*$. It is easy to see that quasi-lattice ordered semigroups, and more generally the weak quasi-lattice ordered semigroups from \cite{ABCD2019}, are right LCM, but the converse does not hold. Quasi-lattice ordered and right LCM semigroups cover a wide range of familiar semigroups. Subsemigroups of $\mathbb{R}^+$, the free semigroup $\mathbb{F}_n^+$, right-angled Artin monoids $A_\Gamma^+$ are all quasi-lattice ordered, and hence right LCM. Finite-type Artin monoids are in fact lattice ordered semigroups \cite{BrieskornSaito1972}. However, it is unknown whether all Artin monoids are quasi-lattice ordered semigroups inside their corresponding Artin groups. Nevertheless, since for right LCM semigroups the least common upper bound is only required for semigroup elements, we do know that Artin monoids are right LCM \cite[Proposition 4.1]{BrieskornSaito1972}, in fact, they are weak quasi-lattice ordered. A \emph{contractive representation} $T$ of a semigroup $P$ is a unital semigroup homomorphism $T:P\to\bh{H}$ such that each $T(p)$ is a contraction. The representation is called isometric (resp.\ unitary) if each $T(p)\in\bh{H}$ is an isometry (resp.\ a unitary operator). An elementary argument shows that when $u$ is invertible in $P$, then $T(u)$ must be unitary. So the restriction of a contractive representation to the group of units $P^*$ is a unitary representation. Just like with groups, an important representation of a semigroup is its left regular representation $\lambda:P\to\mathcal{B}(\ell^2(P))$ defined by $\lambda(p)\delta_q=\delta_{pq}$ on the standard orthonormal basis $\{\delta_p\}_{p\in P}$. It follows from the left-cancellation that $\lambda(p)$ maps the orthonormal basis to an orthonormal set, and thus $\lambda$ is an isometric representation. The reduced semigroup $\mathrm{C}^*$-algebra of $P$, often denoted as $\mathrm{C}^*_\lambda(P)$ is the {$\mathrm{C}^*$-algebra} generated by the image of $\lambda$. One might be tempted to define the semigroup $\mathrm{C}^*$-algebra as the universal $\mathrm{C}^*$-algebra with respect to isometric representations of the semigroup. Murphy proved that under such \tcb{a} definition, the universal object for isometric representations of $\mathbb{N}^2$ is not nuclear, which is undesirable as the universal object for an abelian semigroup as simple as $\mathbb{N}^2$. The issue is resolved by requiring that the range projections commute. This was abstracted and generalized by Nica, leading to what is now known as the Nica-covariance condition. In terms of a right LCM semigroup $P$, an isometric representation $V:P\to\bh{H}$ is called \emph{Nica-covariant} if for any $p,q\in P$, \[V(p)V(p)^*V(q)V(q)^* = \begin{cases} V(r)V(r)^*, &\mbox{ if } pP\cap qP=rP\tcb{;} \\ 0, &\mbox{ if } pP\cap qP=\emptyset\tcb{.} \end{cases} \] One can easily verify that, for the left-regular representation $\lambda$, the range projection $\lambda(p)\lambda(p)^*$ is the orthogonal projection onto the subspace $\ell^2(pP)$, and thus satisfies the Nica-covariance condition. For a right LCM semigroup $P$, the universal $\mathrm{C}^*$-algebra of the isometric Nica-covariant representations is called the semigroup $\mathrm{C}^*$-algebra, which is often denoted as $\mathrm{C}^*(P)$. \begin{example} Consider the semigroup $P=\mathbb{N}^2$, which is the free abelian semigroup generated by two generators $e_1,e_2$. An isometric representation $V:\mathbb{N}^2\to\bh{H}$ is uniquely determined by its value on two commuting generators $V_i=V(e_i)$, $i=1,2$. Here, $V_1, V_2$ must commute because $e_1,e_2$ commute. Since $e_1P\cap e_2P=(e_1+e_2)P$, the Nica-covariance condition requires that \[V_1V_1^* V_2V_2^* = V_1V_2 (V_1V_2)^*.\] One can easily check that this is equivalent to requiring that $V_1$ and $V_2$ are $\ast$-commuting, i.e., $V_1$ commutes with both $V_2$ and $V_2^*$. \end{example} \begin{example} Consider the free semigroup $P=\mathbb{F}_n^+$, with $n$ free generators $e_1,\cdots,e_n$. An isometric representation $V:\mathbb{F}^+_n\to\bh{H}$ is uniquely determined by $n$ non-commuting isometries $V_i=V(e_i)$. Since $e_i P\cap e_j P=\emptyset$ for all $i\neq j$, the Nica-covariance condition requires that $V_i V_i^*$ are pairwise orthogonal projections. This is often characterized by a single condition $\sum_{i=1}^n V_iV_i^*\leq I$. \end{example} \subsection{Semigroup dynamical systems} Suppose $\mathcal{A}$ is a unital $\mathrm{C}^*$-algebra and $P$ is a semigroup. A $P$-action on $\mathcal{A}$ is a map $\alpha$ that sends each $p\in P$ to a $\ast$-endomorphism $\alpha_p:\mathcal{A}\to\mathcal{A}$ that satisfies $\alpha_p\circ \alpha_q=\alpha_{pq}$ and $\alpha_e=id$. Throughout this paper, we always assume that each $\alpha_p$ is injective because this plays a crucial role in our constructions. The action $\alpha$ is called automorphic if each $\alpha_p$ is a $\ast$-automorphism of $\mathcal{A}$. Whenever $p$ is invertible, $\alpha_p$ must be a $\ast$-automorphism. A \emph{semigroup dynamical system} is a triple $(\mathcal{A},P,\alpha)$ where $\mathcal{A}$ is a unital $\mathrm{C}^*$-algebra, $P$ is a left-cancellative semigroup\tcb{, and $\alpha$ is a $P$-action on $A$}. When each $\alpha_p$ is injective, we say that $\alpha$ is an injective $P$-action on $\mathcal{A}$. For each $p\in P$, we denote $\mathcal{A}_p=\alpha_p(\mathcal{A})$, which is a $\mathrm{C}^*$-subalgebra of $\mathcal{A}$. This subalgebra has a unit $\alpha_p(1)$. Since $\alpha$ is a $\ast$-endomorphism, $\alpha_p(1)$ is always an orthogonal projection. Moreover, certain ordering on the semigroup is preserved by $\alpha_p(1)$. \begin{lemma}\label{lm.LCM.N.1} If $(\mathcal{A},P,\alpha)$ is a semigroup dynamical system, then $\alpha_x(1)\alpha_y(1)=\alpha_y(1)$ for $x,y,p\in P$ with $y=xp$. \end{lemma} \begin{proof} $\alpha_x(1)\alpha_y(1)=\alpha_x(1)\alpha_x(\alpha_p(1))=\alpha_x(\alpha_p(1))=\alpha_y(1).\qedhere$ \end{proof} \begin{remark} If $P$ is a right LCM semigroup with $P^* =\{e\}$, then one can define a partial order by $x\leq y$ whenever there exists a $p\in P$ with $y=xp$. In this case Lemma \ref{lm.LCM.N.1} proves that $\alpha_x(1) \geq \alpha_y(1)$ whenever $x\leq y$. \end{remark} If $p\in P^*$, then $\mathcal{A}_p=\mathcal{A}$ since $\alpha_p$ is a $\ast$-automorphism. If $pP=qP$, then $p=qu$ for some $u\in P^*$, in which case $\mathcal{A}_p=\mathcal{A}_q$. Semigroup dynamical systems occur naturally in many well-known $\mathrm{C}^*$-algebraic constructions. For example, the Cuntz algebra $\mathcal{O}_n$ can be constructed from a semigroup dynamical system via a single $\ast$-endomorphism $\alpha$ acting on a UHF algebra of type $n^\infty$. The single $\ast$-endomorphism induces a $\mathbb{N}$-action on the UHF algebra. An important class of semigroup dynamical systems that are central to this paper arises from considering semigroup $\mathrm{C}^*$-algebras. \begin{example} Let $P$ be a right LCM semigroup and $V:P\to\bh{H}$ be a universal Nica-covariant isometric representation of $P$. The diagonal algebra is defined by \[\mathcal{D}_P=\overline{\lspan}\{V(p)V(p)^*: p\in P\},\] and is a commutative $\mathrm{C}^*$-algebra because the Nica-covariance condition implies that $V(p)V(p)^*V(q)V(q)^*$ is either $0$ or $V(r)V(r)^*$ for some $r\in P$, and the set of such $r$ only depends on the intersection $pP \cap qP$. The semigroup $P$ acts on $\mathcal{D}_P$ naturally via $\alpha_p:\mathcal{D}_P\to\mathcal{D}_P$, where $\alpha_p(x)=V(p)xV(p)^*$. We shall study this dynamical system in more detail in section \ref{sect.exLCM}. \end{example} \section{Right LCM Dynamical System}\label{sect.LCMDynSys} \subsection{The LCM condition} Recall that if $p,q$ are two elements in a right LCM semigroup $P$ and if $pP\cap qP=rP$, then $r$ behaves like a least common upper bound of $p$ and $q$. In this paper we focus on dynamical systems that respect this feature of right LCM semigroups in a sense made precise in the following definition that generalizes \cite[Definition 3]{Laca1998}. \begin{definition}\label{df.respectLCM} Let $P$ be a right LCM semigroup. An injective $P$-action $\alpha$ on a $\mathrm{C}^*$-algebra $\mathcal{A}$ \emph{respects the right LCM} if each $\alpha_p(\mathcal{A})$ is an ideal of $\mathcal{A}$, and for any $p,q\in P$, \[ \alpha_p(1) \alpha_q(1) = \begin{cases} \alpha_r(1), &\mbox{ if } pP\cap qP=rP; \\ 0, &\mbox{ if } pP\cap qP=\emptyset. \end{cases} \] A \emph{right LCM dynamical system} is a dynamical system $(\mathcal{A},P,\alpha)$ in which $\alpha$ respects the right LCM. \end{definition} Even though the choice of $r$ such that $rP=pP\cap qP$ may not be unique, the condition introduces no ambiguity. The reason is that when $rP=sP$, then $r=su$ for some unit $u\in P^*$, hence $\alpha_u$ is a $\ast$-automorphism so that $\alpha_u(1)=1$ and $\alpha_r(1)=\alpha_s(1)$. For each $p\in P$ we denote $E_p :=\alpha_p(1)$ which is clearly a projection and is the identity of the ideal $\mathcal{A}_p :=\alpha_p(\mathcal{A}) = E_p \mathcal{A} E_p$. The right LCM condition manifests itself in a right LCM dynamical system in many ways. One of them is through the intersection of ideals $\{\mathcal{A}_p\}$. \begin{proposition} Let $(\mathcal{A},P,\alpha)$ be a right LCM dynamical system. Then for every $p,q\in P$, \[\mathcal{A}_p \cap \mathcal{A}_q = \begin{cases} \mathcal{A}_r, &\mbox{ if } pP\cap qP=rP; \\ \{0\}, &\mbox{ if } pP\cap qP=\emptyset. \end{cases}\] \end{proposition} \begin{proof} If $a\in \mathcal{A}_p\cap \mathcal{A}_q$, then $aE_pE_q= aE_q=a$. If $pP\cap qP=\emptyset$, then $E_pE_q=0$ and thus $a=0$. If $pP\cap qP=rP$, then $E_pE_q=E_r$ and thus $a\in \mathcal{A}_r$, proving $\mathcal{A}_p\cap \mathcal{A}_q \subset \mathcal{A}_r$. To prove the reverse inclusion, suppose $r\in pP\cap qP$ and write $r=pp_0=qq_0$ for some $p_0,q_0\in P$, so $\mathcal{A}_r = \alpha_{pp_0}(\mathcal{A}) \subset \alpha_p(\mathcal{A}) = \mathcal{A}_p$ and similarly for $q$. This proves $\mathcal{A}_r\subseteq \mathcal{A}_p \cap \mathcal{A}_q$. \end{proof} \begin{proposition}\label{prop.equivLCM} Let $P$ be a right LCM monoid. A dynamical system $(\mathcal{A}, P, \alpha)$ is a right LCM dynamical system if and only if for every $p,q\in P$, \begin{equation}\label{eq:rightlcmsyst-charact} \mathcal{A}_p \mathcal{A}_q := \{ab: a\in \mathcal{A}_p, b\in \mathcal{A}_q\}=\begin{cases} \mathcal{A}_r, &\mbox{ if } pP\cap qP=rP;\\ \{0\}, &\mbox{ if } pP\cap qP=\emptyset. \end{cases} \end{equation} \end{proposition} \begin{proof} Suppose $(\mathcal{A}, P, \alpha)$ is a right LCM dynamical system. For any $a,b\in\mathcal{A}$, consider $\alpha_p(a)\alpha_q(b)=\alpha_p(a) E_pE_q \alpha_p(b)$. When $pP\cap qP=\emptyset$, $E_pE_q=0$ and $\alpha_p(a)\alpha_q(b)=0$, and hence $\mathcal{A}_p\mathcal{A}_q=\{0\}$. When $pP\cap qP=rP$, $E_pE_q=E_r \in\mathcal{A}_r$, and $\alpha_p(a)E_r\alpha_p(b)\in \mathcal{A}_r$ since $\mathcal{A}_r$ is an ideal. Therefore, $\mathcal{A}_p\mathcal{A}_q\subseteq \mathcal{A}_r$. To see the other inclusion, take any $\alpha_r(a)\in \mathcal{A}_r$, since $E_r=E_pE_q$, we have $\alpha_r(a)=\alpha_r(a) E_p E_q$, where $\alpha_r(a) E_p\in \mathcal{A}_p$ and $E_q\in \mathcal{A}_q$. Hence, $\mathcal{A}_p\mathcal{A}_q=\mathcal{A}_r$. To prove the converse, suppose $(\mathcal{A}, P, \alpha)$ satisfies equation \eqref{eq:rightlcmsyst-charact}. Let $p\in P$ and set $q=e\in P$. We have $\mathcal{A}_e=\mathcal{A}$. Since $pP\cap eP=pP$, we must have $\mathcal{A}_p\mathcal{A} \subseteq \mathcal{A}_p$ and $\mathcal{A}\cA_p\subseteq \mathcal{A}_p$. This implies that $\mathcal{A}_p$ is an ideal. For any $p,q\in P$, it suffices to prove that $E_p=\alpha_p(1)$ satisfies the right LCM condition. If $pP\cap qP=\emptyset$, then $E_pE_q\in \mathcal{A}_p\mathcal{A}_q=\{0\}$ so that $E_pE_q=0$. If $pP\cap qP=rP$, then $E_pE_q\in \mathcal{A}_p\mathcal{A}_q\subseteq \mathcal{A}_r$. Therefore, $E_pE_q=\alpha_r(a)$ for some $a\in \mathcal{A}$. Since $r=pp_0=qq_0$ for some $p_0,q_0\in P$, $\mathcal{A}_r\subseteq \mathcal{A}_p,\mathcal{A}_q$. Hence, for any $\alpha_r(b)\in \mathcal{A}_r$, \[\alpha_r(ab)=E_pE_q\alpha_r(b)=\alpha_r(b)=\alpha_r(b)E_pE_q=\alpha_r(ba).\] Since $\alpha_r$ is injective, $a$ must be the identity and $E_p E_q=E_r$. Therefore, $\alpha$ respects the right LCM. \end{proof} \begin{remark} One has to be cautious that our definition of the product $\mathcal{A}_p\mathcal{A}_q$ does not correspond to the product ideal of two ideals, which is usually defined to be the closure of the linear span of products and satisfies \[\overline{\lspan}\{ab:a\in I, b\in J\}=I\cap J.\] In general, the product set $\{ab: a\in I, b\in J\}$ is not an ideal, so it is crucial for Proposition \ref{prop.equivLCM} that we take advantage of the right LCM condition of our semigroup dynamical systems. \end{remark} As an immediate corollary, we obtain the following factorization property. \begin{corollary} For a right LCM dynamical system and $p,q\in P$, \[\mathcal{A}_p\mathcal{A}_q = \mathcal{A}_p\cap \mathcal{A}_q.\] \end{corollary} Even though each $\alpha_p$ is not a $\ast$-automorphism, our injectivity assumption ensures that it does have a left-inverse, defined on all of $\mathcal{A}$. \begin{proposition}\label{prop.left.inv} For each $p\in P$, let $\alpha_p^{-1} : \mathcal{A}_p\to \mathcal{A}$ be the inverse of $\alpha_p$ and define $\alpha_{p^{-1}}:\mathcal{A}\to\mathcal{A}$ by \[\alpha_{p^{-1}}(a) = \alpha_p^{-1}(\alpha_p(1) a)\] Then $\alpha_{p^{-1}}$ is well defined, $\alpha_{p^{-1}} \circ \alpha_p=id$, and $\alpha_p \alpha_{p^{-1}} = \operatorname{Mult}_{\alpha_p(1)}$ is the multiplication operator by $\alpha_p(1)$. \end{proposition} \begin{proof} Since $\mathcal{A}_p$ is an ideal, $\alpha_p(1)a\in\mathcal{A}_p$. Since $\alpha_p$ is injective, $\alpha_{p^{-1}}(a)$ is well defined. For any $a\in A$, \[\alpha_{p^{-1}}(\alpha_p(a))=\alpha_p^{-1}(\alpha_p(1)\alpha_p(a))=\alpha_p^{-1}(\alpha_p(a))=a,\] and, \[\alpha_{p}(\alpha_{p^{-1}}(a))=\alpha_p(\alpha_p^{-1}(\alpha_p(1)a))=\alpha_p(1) a. \qedhere\] \end{proof} The map $\alpha_{p^{-1}}$ has many nice properties. \begin{proposition}\label{prop.left.inv2} For a right LCM dynamical system $(\mathcal{A},P,\alpha)$ and for every $p, q \in P$, and $a\in \mathcal{A}$ we have \begin{enumerate} \item $\alpha_{p^{-1}}(a)=\alpha_p^{-1} (a \alpha_p(1))=\alpha_p^{-1} (\alpha_p(1) a \alpha_p(1))$; \smallskip\item $\alpha_{p^{-1}}$ is a surjective $\ast$-endomorphism on $\mathcal{A}$; and \smallskip\item $\alpha_{(pq)^{-1}}(a)=\alpha_{q^{-1}}(\alpha_{p^{-1}}(a)).$ \end{enumerate} \end{proposition} \begin{proof} For (1), since $\alpha_p(\mathcal{A})$ is an ideal of $\mathcal{A}$, the elements $\alpha_p(1)a$ and $a\alpha_p(1)$ are in $ \alpha_p(\mathcal{A})$, and therefore, \[\alpha_p(1)a = \alpha_p(1)a\alpha_p(1) = a\alpha_p(1).\] Since $\alpha_p$ is injective, the inverses under $\alpha_p$ of these three terms are all equal to $\alpha_{p^{-1}}(a)=\alpha_p^{-1}(\alpha_p(1)a)$. For (2), it is easy to verify that $\alpha_{p^{-1}}$ is a $\ast$-preserving linear map since $\alpha_p$ is. To see it is multiplicative, let $a,b\in \mathcal{A}$; then \[\alpha_p (\alpha_{p^{-1}}(ab)) = \alpha_p(1) a b \] On the other hand \[\alpha_p (\alpha_{p^{-1}}(a)\alpha_{p^{-1}}(b)) = \alpha_p(1) a \alpha_p(1) b = \alpha_p(1) a b,\] which gives the result because $\alpha_p$ is injective For (3), recall notice that $\alpha_{pq}(1)=\alpha_{pq}(1)\alpha_p(1)$, and $\alpha_p(1)(a)=\alpha_p(\alpha_{p^{-1}}(a))$, and compute \begin{align*} \alpha_{(pq)^{-1}}(a) &= \alpha_{pq}^{-1} (\alpha_{pq}(1)a) \\ &= \alpha_q^{-1}(\alpha_p^{-1}(\alpha_{pq}(1)\alpha_p(1) a)) \\ &= \alpha_q^{-1}(\alpha_p^{-1}(\alpha_p( \alpha_q(1) \alpha_{p^{-1}}(a)))) \\ &= \alpha_q^{-1}(\alpha_q(1) \alpha_{p^{-1}}(a) ) \\ &= \alpha_{q^{-1}}(\alpha_{p^{-1}}(a)).\qedhere \end{align*} \end{proof} \begin{example} A right LCM semigroup $P$ is called \emph{semi-lattice ordered} if $pP\cap qP\neq \emptyset$ for every $p,q\in P$. If a semi-lattice ordered monoid $P$ acts by $\ast$-automorphisms of $\mathcal{A}$, then $\alpha_p(1)=1$ and $\mathcal{A}_p=\mathcal{A}$ for all $p\in P$, so the system $(\mathcal{A}, P, \alpha)$ is always a right LCM dynamical system. \end{example} \begin{example} Let $X$ be a compact Hausdorff space and suppose that there exists a collection of clopen subsets $\{X_p\}_{p\in P}$ and a $P$-action $\beta$ on $X$ such that each $\beta_p:X\to X_p$ is a homeomorphism from $X$ onto $X_p$. This induces a $P$-action $\alpha$ on the unital commutative $\mathrm{C}^*$-algebra $C(X)$, where $\alpha_p:C(X)\to C(X_p)\subseteq C(X)$ is given by \[\alpha_p(f)=f\circ \beta_p^{-1}\] The action $\alpha$ is an LCM action if $X_p$ satisfies $X_p\cap X_q\subseteq X_r$ if $pP\cap qP=rP$, and $X_p\cap X_q=\emptyset$ if $pP\cap qP=\emptyset$. Indeed, we have $\alpha_p(C(X))=C(X_p)$ and thus $\alpha_p(C(X))\alpha_q(C(X))=C(X_p\cap X_q)$. \end{example} \begin{example} Unfortunately, not all dynamical systems respect the right LCM. For example, the Cuntz algebra $\mathcal{O}_n$ is closely related to the semigroup dynamical system $(\mathcal{A}, \mathbb{N}, \alpha)$ where $\mathcal{A}$ is the UHF algebra of type $n^\infty$ and the action $\alpha$ is determined by $\alpha_1(a)=e_{11}\otimes a$. This is not a right LCM dynamical system because the UHF algebra is a simple $\mathrm{C}^*$-algebra, and so the proper subalgebra $\alpha_1(\mathcal{A})$ cannot be an ideal. \end{example} \subsection{Dynamical systems over $\mathbb{F}_k^+$ and AF-algebras} It is clear that if $(\mathcal{A},\mathbb{F}_k^+,\alpha)$ is an injective dynamical system, then the action $\alpha$ is uniquely determined by the endomorphisms $\alpha_1, \cdots, \alpha_k$ associated to the generators. We would like to use this to provide a simple characterization of right LCM semigroup dynamical systems over the free semigroup $\mathbb{F}_k^+$. \begin{proposition}\label{prop.LCM.N} An injective semigroup dynamical system $(\mathcal{A},\mathbb{F}_k^+,\alpha)$ is a right LCM dynamical system if and only if for each $1\leq i\leq k$, $\alpha_i(\mathcal{A})$ is an ideal of $\mathcal{A}$, and for all $1\leq i,j\leq k$ with $i\neq j$, $\alpha_i(1)\alpha_j(1)=0$. \end{proposition} \begin{proof} First assume that $\alpha_i(\mathcal{A})$ is an ideal of $\mathcal{A}$ for all $1\leq i\leq k$. We first prove that $\alpha_w(\mathcal{A})$ is an ideal of $\mathcal{A}$ for every word $w=w_1w_2\cdots w_n\in\mathbb{F}_k^+$. Since $\alpha_i(\mathcal{A})$ is an ideal of $\mathcal{A}$ and $\alpha_i$ is injective, we can define $\alpha_{i^{-1}}(x)=\alpha_i^{-1}(\alpha_i(1)x)$ which is a left-inverse for $\alpha_i$. If $a,b\in \mathcal{A}$, then \begin{align*} \alpha_w(a) b &= \alpha_{w_1}(\alpha_{w_2w_3\cdots w_n}(a)) \alpha_{w_1}(1) b \\ &= \alpha_{w_1}(\alpha_{w_2w_3\cdots w_n}(a)) \alpha_{w_1}(\alpha_{w_1^{-1}}(b)) \\ &= \alpha_{w_1}(\alpha_{w_2w_3\cdots w_n}(a)\alpha_{w_1^{-1}}(b)). \end{align*} Letting $b_1:=\alpha_{w_1^{-1}}(b)$ we can use a similar argument to show that \begin{align*} \alpha_w(a) b &= \alpha_{w_1}(\alpha_{w_2w_3\cdots w_n}(a)b_1) \\ &= \alpha_{w_1w_2}(\alpha_{w_3\cdots w_n}(a) \alpha_{w_2^{-1}}(b_1)). \end{align*} Repeating this process, we see that $\alpha_w(a) b\in\alpha_w(\mathcal{A})$. By the Proposition \ref{prop.left.inv2}, the same argument can be made for multiplication by $b$ from the left. This proves that $\alpha_w(\mathcal{A})$ is an ideal. Now, for all $1\leq i,j\leq k$ with $i\neq j$, $\alpha_i(1)\alpha_j(1)=0$. For any two elements $x,y\in\mathbb{F}_k^+$, we write $x=x_1x_2\cdots x_n$ and $y=y_1y_2\cdots y_m$. Without loss of generality, we may assume that $n\leq m$. There are two possibilities: if $x\mathbb{F}_k^+\cap y\mathbb{F}_k^+\neq\emptyset$, then it must be the case that $y=xp$ for some $p\in \mathbb{F}_k^+$ and $x\mathbb{F}_k^+\cap y\mathbb{F}_k^+=y\mathbb{F}_k^+$. In this case, Lemma \ref{lm.LCM.N.1} proves that $\alpha_x(1)\alpha_y(1)=\alpha_y(1)$. Otherwise, there must be an index $1\leq s\leq n$ such that $x_t=y_t$ for all $1\leq t< s$ but $x_s\neq y_s$. In this case, $\alpha_{x_s}(1)\alpha_{y_s}(1)=0$, and thus for every $a,b\in \mathcal{A}$, \[\alpha_{x_s}(a)\alpha_{y_s}(b)=\alpha_{x_s}(a)\alpha_{x_s}(1)\alpha_{y_s}(1)\alpha_{y_s}(b)=0.\] As a result, $\alpha_x(1)\alpha_y(1)=0$. Therefore, the action $\alpha$ respects the right LCM and thus we have a right LCM dynamical system. The converse follows easily from Proposition \ref{prop.equivLCM}. \end{proof} In particular, the right LCM condition is easy to verify when $k=1$ and the semigroup $\mathbb{F}_k^+$ is reduced to $\mathbb{N}$. \begin{corollary} An injective semigroup dynamical system $(\mathcal{A},\mathbb{N},\alpha)$ is a right LCM dynamical system if and only if $\alpha_1(\mathcal{A})$ is an ideal of $\mathcal{A}$. \end{corollary} Next, we construct a non-trivial example of a dynamical system over an AF-algebra. One may refer to \cite{KenCStarByExample} for the basic background on AF-algebras and Bratteli diagrams. \begin{example} Consider the AF-algebra $\mathcal{A}$ with the following Bratteli diagram: \begin{equation} \begin{tikzpicture} \draw[->] (1.25,0) -- (3.25,1); \draw[->] (1.25,0) -- (3.25,-1); \draw[->] (3.75,1) -- (5.75,1.5); \draw[->] (3.75,1) -- (5.75,0.5); \draw[->] (3.75,-1) -- (5.75,-0.5); \draw[ ->] (3.75,-1) -- (5.75,-1.5); \node at (1,0) {$2$}; \node at (3.5,1) {$2$}; \node at (3.5,-1){$2$}; \node at (6,1.5){$2$}; \node at (6,0.5){$2$}; \node at (6,-0.5){$2$}; \node at (6,-1.5){$2$}; \node at (6.6,0) {$\cdots$}; \label{fig:Bratteli} \end{tikzpicture} \end{equation} and notice that $\mathcal{A}$ is isomorphic to $C(X)\otimes M_2$, where $X$ is the Cantor set. Fix $n$ momentarily and write $0$ for the zero matrix in $\oplus_{i=1}^{2^n} M_2$. The map $\alpha_1: \oplus_{i=1}^{2^n} M_2 \to \oplus_{i=1}^{2^{n+1}} M_2$ defined by $\alpha_1(a)=a\oplus 0$ is a $\ast$-endomorphism of $\mathcal{A}$. One can easily verify that its image, corresponding to the upper branch of the Bratteli diagram, is an ideal of $\mathcal{A}$. Therefore, the dynamical system $(\mathcal{A}, \mathbb{N},\alpha)$ is a right LCM dynamical system. Here, the map $\alpha_1$ exploits the self-similar property of the given Bratteli diagram. One can also define $\alpha_2(a)=0\oplus a$ and an $\mathbb{F}_2^+$ action by sending each generator $e_i$ to $\alpha_i$. Since the image of $\alpha_i$ are ideals and $\alpha_1(1)=1\oplus 0$ is orthogonal to $\alpha_2(1)=0\oplus 1$, $(\mathcal{A}, \mathbb{F}_2^+,\alpha)$ is a right LCM dynamical system by Proposition \ref{prop.LCM.N}. We shall study dilation results for such systems in Example \ref{ex.dilation.Fk}. \end{example} \subsection{Covariant representations} To study operator algebras associated with dynamical systems, it is useful to have a presentation in terms of a convenient notion of covariance that encodes the dynamics. We define one that is suitable for right LCM dynamical systems. \begin{definition}\label{df.CovariantPair} An {\em isometric covariant representation} $(\pi,V)$ of a right LCM dynamical system $(\mathcal{A},P,\alpha)$ is given by \begin{enumerate} \item a unital $\ast$-homomorphism $\pi:\mathcal{A}\to\bh{H}$ and \item an isometric representation $V:P\to\bh{H}$ \end{enumerate} such that for every $p\in P$ and $a\in \mathcal{A}$, \[V(p) \pi(a) V(p)^* = \pi(\alpha_p(a)).\] \end{definition} \begin{definition}\label{df.ContractiveCovariantPair} A {\em contractive covariant representation} $(\phi,T)$ of a right LCM dynamical system $(\mathcal{A},P,\alpha)$ is given by \begin{enumerate} \item a unital $\ast$-preserving linear map $\phi:\mathcal{A}\to\bh{H}$ and \item a {contractive representation} $T:P\to\bh{H}$ \end{enumerate} such that for every $p\in P$ and $a\in \mathcal{A}$, \[T(p) \phi(a) T(p)^* = \phi(\alpha_p(a)).\] \end{definition} \begin{remark} There are several different notions one could have used to define contractive covariant representations of a semigroup dynamical system. For instance, in the study of semicrossed product algebras by abelian lattice ordered semigroups \cite{DFK2014} (see also \cite{Peters1984}), the requirement is usually \[\phi(a) T(p) = T(p) \phi(\alpha_p(a)).\] The commutativity of the semigroup is required in this definition. For non-abelian semigroups, one may also consider the covariance condition \[T(p) \phi(a) = \phi(\alpha_p(a))T(p).\] \end{remark} \begin{remark} If $(\pi, V)$ is an isometric covariant representation, then $$V(p)^* \pi(a) V(p) = \pi(\alpha_{p^{-1}} (a))$$ for all $p\in P$ and $a\in\mathcal{A}$. Indeed, \begin{align*} V(p)^* \pi(a) V(p) &= V(p)^* V(p)\pi(1) V(p)^* \pi(a) V(p) \\ &= V(p)^* \pi(\alpha_p(1)) \pi(a) V(p) \\ &= V(p)^* \pi(\alpha_p(1)a) V(p) \\ &= V(p)^* \pi(\alpha_p(\alpha_{p}^{-1}(\alpha_p(1)a))) V(p) \\ &= V(p)^* V(p) \pi(\alpha_{p^{-1}}(a)) V(p)^* V(p) = \pi(\alpha_{p^{-1}} (a)). \end{align*} However, the analogous property may fail for general contractive covariant representations because $T(p)^*T(p)$ may not be the identity and the map $\phi$ may not be multiplicative. \end{remark} \begin{remark} If the action $\alpha$ is $\ast$-automorphic, then $\alpha_p(1)=1=V(p)V(p)^*$ for all $p\in P$. So every isometric covariant representation $(\pi,V)$ is in fact a unitary representation of $P$. \end{remark} \begin{definition} Let $(\phi,T)$ be a contractive covariant representation of the right LCM dynamical system $(\mathcal{A},P,\alpha)$ on a Hilbert space $\mathcal{H}$. An {\em isometric covariant dilation} of $(\phi,T)$ is an isometric covariant representation $(\pi, V)$ on a Hilbert space $\mathcal{K}$ containing $\mathcal{H}$, such that \begin{enumerate} \medskip \item $\phi(a) = P_\mathcal{H} \pi(a)\Big|_\mathcal{H}$\ for every $a\in \mathcal{A}$, and \medskip \item $T(p) = P_\mathcal{H} V(p)\Big|_\mathcal{H} $ \ for every $p\in P$. \end{enumerate} In other words, $(\phi,T)$ is the compression of $(\pi,V)$ to the subspace $\mathcal{H}$ of $\mathcal{K}$. \end{definition} Let $(\pi,V)$ be an isometric covariant representation of a right LCM dynamical system $(\mathcal{A}, P,\alpha)$ on $\bh{K}$. Suppose $\mathcal{H}\subseteq \mathcal{K}$ is co-invariant for $V$ (this means that $\mathcal{H}$ is invariant for all the $V(p)^*$ with $p\in P$). Then we can build a contractive covariant pair $(\phi,T)$ by compressing $(\pi,V)$ to the corner of $\mathcal{H}$. That is, we define $\phi:\mathcal{A}\to\bh{H}$ and $T:P\to\bh{H}$ by \[\phi(a):=P_\mathcal{H} \pi(a)\bigg|_\mathcal{H} \qquad \text{and} \qquad T(p):=P_\mathcal{H} V(p) \bigg|_\mathcal{H}.\] The operators $\pi(a)$ and $V(p)$, when written as $2\times 2$ operator matrices with respect to $\mathcal{H}\oplus \mathcal{H}^\perp$ have the form \[ \pi(a) =\begin{bmatrix} \phi(a) & * \\ * & * \end{bmatrix} \qquad \text{and} \qquad V(p) = \begin{bmatrix} T(p) & 0 \\ * & * \end{bmatrix} \] where the $0$ in the upper right hand corner for $V(p)$ reflects the fact that $\mathcal{H}$ is invariant for $V(p)^*$. Therefore, keeping track of the upper left corner of the matrix, which is the only relevant one for the compression, we compute \begin{align*} \begin{bmatrix} \phi(\alpha_p(a)) & * \\ * & * \end{bmatrix} &= \pi(\alpha_p(a)) \\ &= V(p)\pi(a)V(p)^* \\ &= \begin{bmatrix} T(p) & 0 \\ * & * \end{bmatrix} \begin{bmatrix} \phi(a) & * \\ * & * \end{bmatrix} \begin{bmatrix} T(p)^* & * \\ 0 & * \end{bmatrix} \\ &= \begin{bmatrix} T(p)\phi(a)T(p)^* & * \\ * & * \end{bmatrix}, \end{align*} where we used the covariance of $(\pi,V)$ in the second line. Hence, after compressing to $\mathcal{H}$, we get $T(p)\phi(a)T(p)^*=\phi(\alpha_p(a))$. Moreover, one can easily verify that $\phi$ is a unital $\ast$-preserving linear map (not necessarily multiplicative) and $T$ is a representation of $P$. Therefore, we have showed that the compression of an isometric covariant representation $(\pi,V)$ to a subspace that is co-invariant for $V$ is a contractive covariant representation $(\phi,T)$, of which the given $(\pi,V)$ is obviously a covariant isometric dilation. The main focus of this paper is the reverse process: {\em When does a given contractive covariant representation $(\phi,T)$ of a right LCM dynamical system $(\mathcal{A}, P,\alpha)$ have an isometric covariant dilation $(\pi,V)$?} A moment's thought reveals that to be realized as the compression of a $\ast$-homomorphic representation $\pi$, the given $\phi$ would have to be a unital completely positive map to begin with. As it turns out, this is all we need to assume in order to guarantee there exists an isometric covariant dilation. Before we prove this, in Theorem \ref{thm.dym.dilation}, we need to develop the necessary machinery about dilations in the next section. \section{Naimark Dilation on Semigroup Dynamical Systems}\label{sect.Naimark} The goal of this section is to prove a generalization of Naimark's dilation theorem valid for semigroup dynamical systems. Throughout the section, we only require that $P$ be a left-cancellative semigroup. In particular we do not assume that the semigroup is right LCM or even if it is, that the dynamical system respects the LCM structure. A \emph{Toeplitz kernel} for a left-cancellative semigroup $P$ is a map $K:P\times P\to\bh{H}$ such that \[ K(e,e)=I, \quad K(p,q)=K(q,p)^*, \quad \text{and} \quad K(rp,rq)=K(p,q) \] for all $p,q,r\in P$. A Toeplitz kernel is \emph{positive definite} if for any choice of $p_1,\cdots, p_n\in P$, the operator matrix $[K(p_i, p_j)]$ is positive. The original Naimark dilation establishes that positive definite Toeplitz kernels arise from certain isometric representations. The following generalization of Naimark's theorem is due to Popescu. \begin{theorem}[Theorem 3.2 of \cite{Popescu1999b}] Let $P$ be a left-cancellative unital semigroup and let $K$ be a unital kernel for $P$ on the Hilbert space $\mathcal{H}$. Then $K$ is a positive definite Toeplitz kernel if and only if there exists a (minimal) isometric representation $V:P\to\bh{K}$ on some Hilbert space $\mathcal{K}\supset\mathcal{H}$, such that for every $p,q\in P$, \[ K(p,q)=P_\mathcal{H} V(p)^* V(q) \Big|_\mathcal{H} \quad\text{ and } \quad \overline{\operatorname{span}} \{V(p)h: p\in P, \ h\in \mathcal{H}\} = \mathcal{K}.\] The minimal dilation is unique up to unitary equivalence. \end{theorem} \subsection{Kernel systems} We first define and study kernel systems associated to semigroup dynamical systems. These prove to be an essential tool in dilation. The kernel system defined here can be seen as a strengthened version of positive definite Toeplitz kernels on semigroups, as in the traditional Naimark dilation. When $(\mathcal{A},P,\alpha)$ is a semigroup dynamical system, we define $\mathcal{A}_{p,q}=\{\alpha_p(1) a \alpha_q(1): a\in \mathcal{A}\}$ to be the `off diagonal' corner of the $\mathrm{C}^*$-algebra $\mathcal{A}$ corresponding to $p,q \in P$. One can easily verify that if $a\in \mathcal{A}_{p,q}$, then $a^*\in \mathcal{A}_{q,p}$. \begin{remark} Notice that when $(\mathcal{A},P,\alpha)$ is a right LCM dynamical system, then $\mathcal{A}_{p,q}=\alpha_p(\mathcal{A})\cap \alpha_q(\mathcal{A})=\alpha_p(\mathcal{A})\alpha_q(\mathcal{A})$. This is because in this case $\alpha_p(\mathcal{A}),\alpha_q(\mathcal{A})$ are ideals so that for any $a\in \mathcal{A}$, $\alpha_p(1)a\alpha_q(1)\in \alpha_p(\mathcal{A})\cap \alpha_q(\mathcal{A})$. Conversely, if $a\in \alpha_p(\mathcal{A})\cap \alpha_q(\mathcal{A})$, then $a=\alpha_p(1)a\alpha_q(1)\in \mathcal{A}_{p,q}$. \end{remark} \begin{lemma} \label{lem:oldremark4.4} Suppose $(\mathcal{A},P,\alpha)$ is a semigroup dynamical system. Then $\alpha_r(\mathcal{A}_{p,q})\subseteq \mathcal{A}_{rp,rq}$ for every $p,q, r\in P$. Moreover, $\alpha_r(\mathcal{A}_{p,q})= \mathcal{A}_{rp,rq}$ for every $p,q,r\in P$ if and only if $\alpha_r(\mathcal{A}_{e,e})$ is hereditary for every $r\in P$. \end{lemma} \begin{proof} For the first assertion, take $a=\alpha_p(1) b \alpha_q(1)\in\mathcal{A}_{p,q}$ and notice that \[\alpha_r(a)=\alpha_{rp}(1) \alpha_r(b) \alpha_{rq}(1)\in \mathcal{A}_{rp,rq}.\] If equality holds for every $r,p,q$, then, then in particular, $\alpha_r(\mathcal{A})=\alpha_r(\mathcal{A}_{e,e})=\mathcal{A}_{r,r} =\alpha_r(1)\mathcal{A}\alpha_r(1)$, hence $\alpha_r(\mathcal{A})$ is hereditary by \cite[Lemma 4.1]{Murphy1996}. Conversely, assume $\alpha_r(\mathcal{A})$ is hereditary for every $r$; then \[\alpha_r(\mathcal{A}_{p,q}) = \alpha_{rp}(1) \alpha_r(\mathcal{A}) \alpha_{rq}(1) = \alpha_{rp}(1) \alpha_r(1) \mathcal{A} \alpha_r(1) \alpha_{rq}(1) = \mathcal{A}_{rp,rq},\] and equality holds. \end{proof} We use $e$ for the identity element in the semigroup, $1$ for the unit of the $\mathrm{C}^*$-algebra $\mathcal{A}$, and $I$ for the identity operator on a Hilbert space. \begin{definition}\label{df.kernel} Let $(\mathcal{A},P,\alpha)$ be a semigroup dynamical system and define \[\Lambda_{(\mathcal{A},P,\alpha)}=\{(p,a,q): p,q\in P, a\in \mathcal{A}_{p,q}\}.\] A \emph{kernel system} for $(\mathcal{A},P,\alpha)$ on a Hilbert space $\mathcal{H}$ is a map $K:\Lambda_{(\mathcal{A},P,\alpha)}\to\bh{H}$. We say that $K$ is \begin{enumerate} \item \emph{unital} if $K(e,1,e)=I$, \item \emph{Hermitian} if $K(p,a,q)^*=K(q,a^*,p)$, \item \emph{Toeplitz} if $K(p, a, q)=K(rp, \alpha_r(a), rq)$ (notice that $(rp, \alpha_r(a), rq) \in \Lambda_{(\mathcal{A},P,\alpha)}$ by Lemma~\ref{lem:oldremark4.4}), \item \emph{linear} if $K(p, a,q)+\lambda K(p,b,q)=K(p, a+\lambda b,q)$ for every $a,b\in \mathcal{A}_{p,q}$ and $\lambda\in\mathbb{C}$, \item \emph{positive} if for every choice $p_1,\cdots, p_n\in P$ and $a_1,\cdots, a_n\in \mathcal{A}$ with $a_i\in \mathcal{A} \alpha_{p_i}(1)$, we have \[ [K(p_i, a_i^* a_j, p_j)]\geq 0,\] \item \emph{bounded} if for any $p_1,\cdots, p_n\in P$ and $a_1,\cdots, a_n\in \mathcal{A}$ with $a_i\in \mathcal{A} \alpha_{p_i}(1)$, and for every $a\in A$, \[ [K(p_i, a_i^* a^* a a_j, p_j)]\leq \|a\|^2 [K(p_i, a_i^* a_j, p_j)],\] \item \emph{continuous} if for every $p,q\in P$, and every sequence $(a_n)$ in $\mathcal{A}_{p,q}$ that converges to $a\in \mathcal{A}_{p,q}$, then $K(p,a_n,q)$ also converges to $K(p,a,q)$ (in norm). \end{enumerate} \end{definition} \begin{lemma}\label{lm.bounded} Every linear positive kernel system $K$ is bounded. \end{lemma} \begin{proof} Let $p_1,\cdots, p_n\in P$, and for each $i = 1,2, \ldots n$ choose $a_i\in \mathcal{A} \alpha_{p_i}(1)$. For each $a\in\mathcal{A}$, define $b_i = (\|a\|^2I-a^*a)^{1/2} a_i$, which is again in $\mathcal{A} \alpha_{p_i}(1)$. The positivity of $K$ implies that the operator matrix \[[K(p_i, b_i^* b_j, p_j)] = [K(p_i, a_i^* (\|a\|^2I - a^* a) a_j, p_j)]\] is positive definite. The linearity of $K$ implies that \[[K(p_i, a_i^* (\|a\|^2I - a^* a) a_j, p_j)] = \|a\|^2 [K(p_i, a_i^* a_j, p_j)] - [K(p_i, a_i^* a^* a a_j, p_j)] \geq 0,\] which gives the desired inequality, proving that $K$ is bounded. \end{proof} \begin{lemma}\label{lm.cts} If $K$ is a unital, Hermitian, Toeplitz, linear, positive kernel system, then $\|K(p,a,q)\|\leq \|a\|$, for all $p,q\in P$ and $a\in \mathcal{A}_{p,q}$, and thus $K$ is continuous. \end{lemma} \begin{proof} Fix $p,q\in P$ and $a\in \mathcal{A}_{p,q}$. Let $a_1=\alpha_p(1)$ and $a_2=a$, the positivity assumption ensures that \[\begin{bmatrix} K(p,\alpha_p(1),p) & K(p,a,q) \\ K(q, a^*, p) & K(q, a^*a, q) \end{bmatrix} \geq 0. \] By Lemma \ref{lm.bounded}, $K$ is also bounded so that \[K(q,a^*a,q)\leq \|a\|^2 K(q,\alpha_q(1),q)=\|a\|^2 K(e,I,e)=\|a\|^2 I.\] Also note that $K(p,\alpha_p(1),p)=K(e,I,e)=I$ because $K$ is Toeplitz. Therefore, \[\begin{bmatrix} K(p,\alpha_p(1),p) & K(p,a,q) \\ K(q, a^*, p) & \|a\|^2 I \end{bmatrix} \geq \begin{bmatrix} K(p,\alpha_p(1),p) & K(p,a,q) \\ K(q, a^*, p) & K(q, a^*a, q) \end{bmatrix} \geq 0 \] This can only happen when $K(q,a^*,p)K(p,a,q)=K(p,a,q)^* K(p,a,q)\leq \|a\|^2 I$ (by using for example \cite[Lemma 14.13]{NestAlgebra}). Therefore, $\|K(p,a,q)\|\leq \|a\|$ as desired. \end{proof} It is often easier to verify the properties of a kernel system on a dense subset of $\mathcal{A}$; the following proposition shows that it is also enough. \begin{proposition} Suppose $(\mathcal{A},P,\alpha)$ is a semigroup dynamical system and let $\mathcal{A}_0$ be a unital dense $\ast$-subalgebra of $\mathcal{A}$ that is invariant under $\alpha$. Then every unital, Hermitian, Toeplitz, linear, positive kernel system $K_0$ on $(\mathcal{A}_0,\alpha,P)$ can be extended to a unital, Hermitian, Toeplitz, linear, positive kernel system $K$ on $(\mathcal{A},\alpha,P)$. \end{proposition} \begin{proof} If $a_n\in\mathcal{A}_{p,q}$ converges to $a\in \mathcal{A}_{p,q}$, linearity and Lemma \ref{lm.cts} give \[\|K_0(p,a_n,q)-K_0(p,a_m,q)\|=\|K_0(p,a_n-a_m,q)\|\leq \|a_n-a_m\|.\] Therefore, $K_0(p,a_n,q)$ is a Cauchy sequence that converges in $\bh{H}$. Define $K(p,a,q) :=\lim_{n\to\infty} K_0(p,a_n,q)$. One can easily verify that $K$ is unital, Hermitian, Toeplitz (since the $\alpha_p$ are continuous $\ast$-endomorphisms), and linear. For positivity, pick $p_1,\cdots,p_n\in P$ and $a_1,\cdots,a_n\in\mathcal{A}$ with $a_i\in \mathcal{A} \alpha_{p_i}(1)$. For each $i$, pick a sequence $a_{i,n}$ in $\mathcal{A}\alpha_{p_i}(1)$ that converges to $a_i$. Then $K_0(p_i, a_{i,n}^* a_{j,n}, p_j)$ converges to $K(p_i, a_i^* a_j, p_j)$, and since the matrix $[K_0(p_i, a_{i,n}^* a_{j,n}, p_j)]$ is positive definite so is $[K(p_i, a_i^* a_j, p_j)] $. This proves $K$ is positive. \end{proof} \subsection{Naimark dilation for kernel systems} Naimark dilation is a powerful tool in the study of dilation theory on semigroups because it explicitly constructs isometric representations of the semigroup via positive definite kernels \cite{Popescu1999b, BLi2014, BLi2019}. With the additional $\mathrm{C}^*$-algebra $\mathcal{A}$ in our definition of the kernel system, we aim to establish an extended version of Naimark dilation theorem that explicitly constructs both a representation of the $\mathrm{C}^*$-algebra $\mathcal{A}$ and an isometric representation of the semigroup $P$. The usual way of constructing a kernel is by compressing an isometric covariant representation to a subspace. The next proposition shows that this also works for kernel systems. We emphasize that only the weaker covariance condition is involved in the process. \begin{proposition} Let $(\pi,V)$ be an isometric representation of a semigroup dynamical system $(\mathcal{A}, \alpha, P)$ on a Hilbert space $\mathcal{K}$ that satisfies the (weak) covariance condition $\pi(\alpha_p(a))V(p)=V(p)\pi(a)$. Suppose $\mathcal{H}$ is a subspace of $\mathcal{K}$ and define $K:\Lambda_{(\mathcal{A},P,\alpha)}\to\bh{H}$ by \[K(p,a,q)=P_\mathcal{H} V(p)^* \pi(a) V(q) \bigg|_\mathcal{H}.\] Then $K$ satisfies conditions (1) to (6) in Definition \ref{df.kernel}. \end{proposition} \begin{proof} For condition (1), notice that $K(e, 1, e)=P_\mathcal{H} V(e)^* \pi(1) V(e)\bigg|_\mathcal{H}$ is equal to $I$ because $V$ is an isometric representation with $V(e)=I$ and $\pi(1)=I$. For condition (2), simply compute \[K(p,a,q)^* = P_\mathcal{H} (V(p)^* \pi(a) V(q))^* \bigg|_\mathcal{H} = P_\mathcal{H} V(q)^* \pi(a^*) V(p) \bigg|_\mathcal{H}=K(q, a^*, p)\] For condition (3), \[V(rp)^* \pi(\alpha_r(a)) V(rq) = V(p)^* V(r)^* \pi(\alpha_r(a)) V(r) V(q)=V(p)^* V(r)^* V(r) \pi(a) V(q)\] cancelling $ V(r)^* V(r)= I$ and compressing down to $\mathcal{H}$ gives $K(rp,\alpha_r(a),rq)= K(p,a,q)$. For condition (4), \[V(p)^*\pi(a+\lambda b) V(q)=V(p)^*\pi(a)V(q) + \lambda V(p)^* \pi(b) V(q),\] again, compressing down to $\mathcal{H}$ gives $K(p,a+\lambda b,q)=K(p,a,q)+\lambda K(p,b,q)$. For condition (5), fix $p_1,\cdots, p_n\in P$ and $a_1,\cdots, a_n\in \mathcal{A}$ with $a_i\in \mathcal{A}\alpha_{p_i}(1)$, and define an $1\times n$ operator matrix $R$ to be \[R:=\begin{bmatrix} \pi(a_1) V(p_1) & \cdots & \pi(a_n) V(p_n) \end{bmatrix}. \] Then, \[R^* R=[V(p_i)^* \pi(a_i^* a_j) V(p_j)]\geq 0\] Compressing down to $\mathcal{H}$ proves that $[K(p_i, a_i^* a_j, p_j)]\geq 0$. Finally, condition (6) follows from linearity, positivity, and Lemma \ref{lm.bounded}. \end{proof} The extended Naimark dilation theorem tackles the converse. \begin{theorem}\label{thm.kernel.dilation} Let $K:\Lambda_{(\mathcal{A},P,\alpha)}\to\bh{H}$ be a kernel system that satisfies conditions (1) to (5) of Definition \ref{df.kernel}. Then there exists a Hilbert space $\mathcal{K} \supseteq \mathcal{H}$, an isometric representation $V:P\to\bh{K}$ and a $\ast$-homomorphism $\pi:\mathcal{A}\to\bh{K}$ satisfying \[V(p) \pi(a) = \pi(\alpha_p(a)) V(p) \qquad \text{ for } p,q \in P, \ a\in \mathcal{A},\] such that \[K(p,a,q)=P_\mathcal{H} V(p)^* \pi(a) V(q) \bigg|_\mathcal{H} \qquad \text{ for } (p,a,q)\in\Lambda_{(\mathcal{A},P,\alpha)}.\] Moreoever, $(\pi, V)$ can be taken to be minimal in the sense that \[\mathcal{K} = \overline{\lspan}\{\pi(a) V(p)h: p\in P, a\in \mathcal{A}\alpha_{p}(1), h\in \mathcal{H}\subset\mathcal{K}\}.\] Such a minimal dilation $(\pi, V)$ is unique up to unitary equivalence. \end{theorem} \begin{proof} Consider the discrete space $\mathcal{X} := \{(p,a): p\in P, a\in\mathcal{A} \alpha_p(1)\}$, and write $\delta_{p,a} \otimes h$ for the (elementary) function that equals $h$ at $(p,a)$ and is zero everywhere else. Let \[\mathcal{K}_0: =C_c(\mathcal{X}; \mathcal{H}) =\lspan\{\delta_{p,a}\otimes h: p\in P, a\in\mathcal{A} \alpha_p(1), h\in\mathcal{H}\}. \] If $(p,a)$ and $(q,b)$ are in $\mathcal{X}$, then $b^* a \in \alpha_q(1) \mathcal{A} \alpha_p(1)=\mathcal{A}_{q,p}$, so we may define \[\langle\delta_{p,a}\otimes h, \delta_{q,b}\otimes k\rangle := \langle K(q,b^*a, p) h, k\rangle\] which can be extended uniquely to a sesquilinear form on $\mathcal{K}_0$. This sesquilinear form is positive definite because for every $k=\sum_{i=1}^n \delta_{p_i, a_i}\otimes h_i$, \begin{align*} \langle k, k\rangle &= \sum_{i=1}^n \sum_{j=1}^n \langle K(p_j, a_j^* a_i, p_i) h_i, h_j\rangle \\ &= \left\langle [K(p_j, a_j^* a_i, p_i)] \begin{bmatrix} h_1 \\ \vdots \\ h_n\end{bmatrix}, \begin{bmatrix} h_1 \\ \vdots \\ h_n\end{bmatrix} \right\rangle\geq 0, \end{align*} where the last inner product is in $\mathcal{H}^n$. Define $\|k\|=\langle k,k\rangle^{1/2}$. The sesquilinear form $\langle\cdot, \cdot\rangle$ is a pre-inner product that satisfies the Cauchy-Schwarz inequality $|\langle k,h\rangle|^2\leq \|k\| \|h\|$. If we now let \[\mathcal{N}:=\{k\in \mathcal{K}_0: \|k\|=0\}=\{k\in\mathcal{K}_0: \langle k,h\rangle =0\mbox{ for all }h\in\mathcal{K}_0\},\] we see that $\mathcal{N}$ is a linear subspace of $\mathcal{K}_0$ and that $\langle \cdot,\cdot\rangle$ becomes an inner product on the quotient $\mathcal{K}_0/\mathcal{N}$. The completion of $\mathcal{K}_0/\mathcal{N}$ with respect to the associated norm will be denoted $\mathcal{K}$. On the image of ${\mathcal{K}_0/ \mathcal{N}}$ in this completion the inner product is given by \[\langle k+\mathcal{N}, h+\mathcal{N}\rangle = \langle k, h\rangle\] and the norm is $\|k+\mathcal{N}\|=\langle k+\mathcal{N}, k+\mathcal{N}\rangle^{1/2}$. Since \[ \langle \delta_{e,1}\otimes h, \delta_{e,1}\otimes k\rangle = \langle K(e,1,e)h, k\rangle =\langle h, k\rangle, \] the Hilbert space $\mathcal{H}$ naturally embeds in $\mathcal{K}$ via $h\to \delta_{e,1}\otimes h$. Notice that if $b\in \mathcal{A}\alpha_q(1)$, then $\alpha_p(b)\in \mathcal{A}\alpha_{pq}(1)$, so that $(pq,\alpha_p(b)) \in \mathcal{X}$ and we may define $V(p):\mathcal{K}_0\to\mathcal{K}_0$ by \[V(p)\delta_{q,b}\otimes h = \delta_{pq,\alpha_p(b)}\otimes h,\] for $p,q\in P$ and $b\in \mathcal{A}\alpha_q(1)$. The operator $V(p)$ is isometric because for every linear combination $k=\sum_{i=1}^n \delta_{p_i, a_i}\otimes h_i$, \begin{align*} \|V(p)k\|^2 &= \|\sum_{i=1}^n \delta_{pp_i, \alpha_p(a_i)}\otimes h_i\|^2 \\ &= \sum_{i=1}^n \sum_{j=1}^n \langle K(pp_j, \alpha_p(a_j)^* \alpha_p(a_i), pp_i) h_i, h_j\rangle \\ &= \sum_{i=1}^n \sum_{j=1}^n \langle K(pp_j, \alpha_p(a_j^* a_i), pp_i) h_i, h_j\rangle \\ &= \sum_{i=1}^n \sum_{j=1}^n \langle K(p_j, a_j^* a_i, p_i) h_i, h_j\rangle = \|k\|^2; \end{align*} where we have used the Toeplitz condition in the last line. Noticing now that if $b\in \mathcal{A}\alpha_q(1)$ and $a\in \mathcal{A}$, then $ab\in\mathcal{A}\alpha_q(1)$, so that $(q,ab) \in \mathcal{X}$, we define a map $\pi(a): \mathcal{K}_0\to\mathcal{K}_0$ by first letting \[\pi(a) (\delta_{q,b}\otimes h)=\delta_{q,ab}\otimes h\] and then extending it by linearity. In order to show that $\pi(a)$ is bounded, we take $k=\sum_{i=1}^n \delta_{p_i, a_i}\otimes h_i$ and compute \begin{align*} \|\pi(a)k\|^2 &= \|\sum_{i=1}^n \delta_{p_i, a a_i}\otimes h_i\|^2 \\ &= \sum_{i=1}^n \sum_{j=1}^n \langle K(p_j, a_j^* a^*a a_i, p_i) h_i, h_j\rangle \\ &\leq \|a\|^2 \sum_{i=1}^n \sum_{j=1}^n \langle K(p_j, a_j^* a_i, p_i) h_i, h_j\rangle \\ &= \|a\|^2 \|k\|^2, \end{align*} where the inequality holds because the kernel $K$ is assumed to be bounded. Since $V(p)$ and $\pi(a)$ are both bounded on $\mathcal{K}_0$ and leave $\mathcal{N}$ invariant, they determine bounded linear operators on $\mathcal{K}$, which we also denote by $V(p)$ and $ \pi(a)$. We now verify that $(\pi, V)$ has the desired properties. \noindent\textbf{Claim 1}. $V:P\to\bh{K}$ is an isometric representation. We have proved each $V(p)$ is an isometry. Let $p,q\in P$; then \begin{align*} V(p)V(q)\delta_{r,a}\otimes h &= \delta_{pqr,\alpha_{p}(\alpha_q(a))}\otimes h \\ &= \delta_{pqr,\alpha_{pq}(a)}\otimes h \\ &=V(pq)\delta_{r,a}\otimes h. \end{align*} Therefore, $V(pq)=V(p)V(q)$. That $V(e)=I$ is obvious from the definition. \noindent \textbf{Claim 2}. $\pi:\mathcal{A}\to\bh{K}$ is a unital $\ast$-homomorphism. It is clear that $\pi(1)=I$. To prove $\pi$ is a homomorphism, pick any $a,b\in\mathcal{A}$. It suffices to show that $\pi(a)\pi(b) = \pi(ab)$ on a set that has dense linear span, so choose $(r,c) \in \mathcal{X}$ and $h\in \mathcal{H}$; then \[\pi(a)\pi(b)\delta_{r,c}\otimes h=\delta_{r,abc}\otimes h=\pi(ab)\delta_{r,c} \otimes h.\] It remains to show that $\pi(a^*)=\pi(a)^*$, and for this it suffices to prove that for every pair of elementary functions $\delta_{p,b}\otimes h$ and $ \delta_{q,c}\otimes k$ in $\mathcal{K}$, we have \[\langle \pi(a^*)\delta_{p,b}\otimes h, \delta_{q,c}\otimes k\rangle = \langle \pi(a)^*\delta_{p,b}\otimes h, \delta_{q,c}\otimes k\rangle\] To verify this we compute \begin{align*} \langle \pi(a^*)\delta_{p,b}\otimes h, \delta_{q,c}\otimes k\rangle &= \langle \delta_{p,a^* b}\otimes h, \delta_{q,c}\otimes k\rangle \\ &= \langle K(q,c^* a^* b,p)h, k\rangle \\ &= \langle \delta_{p,b}\otimes h, \delta_{q,ac}\otimes k\rangle \\ &= \langle \delta_{p,b}\otimes h, \pi(a)\delta_{q,c}\otimes k\rangle. \end{align*} \noindent \textbf{Claim 3}. $K(p,a,q)=P_\mathcal{H} V(p)^* \pi(a) V(q) \bigg|_\mathcal{H}$. For any $h,k\in \mathcal{H}$, which embed in $\mathcal{K}$ as $\delta_{e,1}\otimes h, \delta_{e,1}\otimes k$, \begin{align*} \langle V(p)^* \pi(a) V(q) \delta_{e,1}\otimes h, \delta_{e,1}\otimes k\rangle &= \langle \pi(a) V(q) \delta_{e,1}\otimes h, V(p) \delta_{e,1}\otimes k\rangle \\ &= \langle \delta_{q,a}\otimes h, \delta_{p, \alpha_p(1}\otimes k\rangle \\ &= \langle K(p, \alpha_p(1) a, q)h, k\rangle\\ &= \langle K(p, a, q)h, k\rangle \end{align*} Here, we use the fact that $a\in \mathcal{A}_{p,q}=\alpha_p(1)\mathcal{A}\alpha_q(1)$ and thus $\alpha_p(1) a=a.$ \noindent\textbf{Claim 4}. $V(p) \pi(a) = \pi(\alpha_p(a)) V(p)$. Take any elementary function $\delta_{b,r}\otimes h\in \mathcal{K}$. Then \begin{align*} V(p)\pi(a) \delta_{b,r}\otimes h &= \delta_{\alpha_p(ab), pr}\otimes h \\ &= \delta_{\alpha_p(a)\alpha_p(b), pr}\otimes h \\ &= \pi(\alpha_p(a)) V(p) \delta_{b,r}\otimes h. \end{align*} Since $V(p)\pi(a)$ and $\pi(\alpha_p(a)) V(p)$ are bounded linear operators, the equality also holds for every vector in $\mathcal{K}$. \noindent\textbf{Claim 5}. $(\pi,V)$ is minimal. Since $\pi(a)V(p)h=\delta_{a,p}\otimes h$ we have \begin{multline*}\lspan\{\pi(a)V(p)h: p\in P, a\in \mathcal{A} \alpha_p(1), h\in \mathcal{H}\} = \\ \lspan\{\delta_{a,p}\otimes h: p\in P, a\in \mathcal{A} \alpha_p(1), h\in \mathcal{H}\}, \end{multline*} which is clearly dense in $\mathcal{K}$. \noindent\textbf{Claim 6}. $(\pi,V)$ is unique up to unitary equivalence. Suppose $\widetilde{\pi}$ and $\widetilde{V}$ is another minimal dilation on a Hilbert space $\widetilde{\mathcal{K}}$ and consider \[x=\sum_{i\in F} \widetilde{\pi}(a_i) \widetilde{V}(p_i) h_i, \qquad y=\sum_{i\in F} \widetilde{\pi}(a_i) \widetilde{V}(p_i) k_i.\] Their $\widetilde{\mathcal{K}}$ inner product is given by \[ \langle x,y\rangle = \sum_{i,j\in F} \langle \widetilde{V}(p_i)^* \widetilde{\pi}(a_i^* a_j) \widetilde{V}(p_j) h_j, k_i\rangle.\] Since $K(p,a,q)=P_\mathcal{H} V(p)^* \pi(a) V(q)\bigg|_\mathcal{H}$ for all $(p,a,q)\in \Lambda_{(\mathcal{A},P,\alpha)}$, \[\langle \widetilde{V}(p_i)^* \widetilde{\pi}(a_i^* a_j) \widetilde{V}(p_j) h_j, k_i\rangle = \langle K(p_i, a_i^* a_j, p_j) h_j, k_i\rangle.\] Therefore, \[\langle x,y\rangle = \sum_{i,j\in F} \langle K(p_i, a_i^* a_j, p_j) h_j, k_i\rangle.\] A similar argument can be applied to the two vectors \[Ux=\sum_{i\in F} \pi(a_i) V(p_i) h_i, \qquad Uy=\sum_{i\in F} \pi(a_i) V(p_i) k_i,\] proving that $\langle Ux, Uy\rangle = \langle x,y\rangle$ for all $x,y\in \lspan\{\widetilde{\pi}(a)\widetilde{V}(p)h: p\in P, a\in \mathcal{A} \alpha_p(1),h\in\mathcal{H}\}$. Therefore, $U$ can be extended to a unitary on its closure $\widetilde{\mathcal{K}}$. It is routine to check that $\widetilde{\pi}(a)=U^* \pi(a) U$ and $\widetilde{V}(p)=U^* V(p) U$ for all $a\in \mathcal{A}$ and $p\in P$. This establishes that the minimal dilation $(\pi, V)$ is unique up to unitary equivalence and completes the proof. \end{proof} Notice that Theorem \ref{thm.kernel.dilation} only involves the weaker covariance condition $V(p)\pi(a)=\pi(\alpha_p(a))V(p)$, and that, in principle, the minimal dilation $(\pi,V)$ may not satisfy the stronger covariance condition $V(p)\pi(a)V(p)^*=\pi(\alpha_p(a))$. A major difficulty is that the construction is not explicit about the vectors $V(p)^*\delta_{q,b}\otimes h$. However, in the particular case when $V(p)V(p)^*=\pi(\alpha_p(1))$ holds for all $p\in P$, then we can recover the covariance condition, as the following proposition shows. \begin{proposition}\label{prop.cov.equiv} Suppose $\pi:\mathcal{A}\to\bh{K}$ is a unital $\ast$-homomorphism and $V:P\to\bh{K}$ is an isometric representation. Then the following are equivalent: \begin{enumerate} \item For every $p\in P$ and $a\in \mathcal{A}$, \[V(p)\pi(a)V(p)^*=\pi(\alpha_p(a)).\] \item For every $p\in P$ and $a\in \mathcal{A}$, \[V(p)\pi(a)=\pi(\alpha_p(a))V(p).\] and $V(p)V(p)^*=\pi(\alpha_p(1))$. \end{enumerate} \end{proposition} \begin{proof} The conditions in (2) follow from (1) by multiplying $V(p)$ on the right hand side and setting $a=1$. To see the converse, assume (2) holds and multiply $V(p)^*$ on the right on both sides, \begin{align*} V(p)\pi(a)V(p)^* &= \pi(\alpha_p(a))V(p)V(p)^* \\ &= \pi(\alpha_p(a)) \pi(\alpha_p(1)) \\ &= \pi(\alpha_p(a)). \qedhere \end{align*} \end{proof} \begin{remark} The connection between the covariance relations $V(p)\pi(a)=\pi(\alpha_p(a))V(p)$ and $V(p)\pi(a)V(p)^*=\pi(\alpha_p(a))$ is further explored in \cite{Li2020env}, where it is shown that when the semigroup is abelian, the former relation can be dilated to the latter one. \end{remark} \begin{remark} Even though our main focus is on right LCM dynamical systems, our version of generalized Naimark dilation can be applied to a much wider range of semigroup dynamical systems. Recall the semigroup dynamical system arising from the Cuntz algebra $\mathcal{O}_k$. Let $S_1, \cdots, S_k$ be isometries that generate $\mathcal{O}_k$, and for any word $w=w_1w_2\cdots w_n\in\mathbb{F}_k^+$, let $|w|=n$ be the length of the word $w$ and $S_w=S_{w_1}S_{w_2}\cdots S_{w_n}$. Recall that the core $\mathcal{A}=\overline{\lspan}\{S_\mu S_\nu^*: |\mu|=|\nu|\}$ of $\mathcal{O}_k$ is isomorphic to the UHF algebra of type $k^\infty$. One can define the action $\alpha_1(x)=e_{11}\otimes x$ on the UHF core, which is the same as $\alpha_1(x)=S_1 x S_1^*$. We have a semigroup dynamical system $(\mathcal{A},\mathbb{N},\alpha)$, where the $\mathbb{N}$-action $\alpha$ is induced by the single $\ast$-endomorphism $\alpha_1$ via $\alpha_n:=\alpha_1^n$. For every $m,n \in \mathbb{N}$, one can explicitly compute the corner $\mathcal{A}_{n,m}=\alpha_n(1)\mathcal{A} \alpha_m(1)$ as \begin{align*} \mathcal{A}_{n,m}&=\overline{\lspan}\{S_\mu S_\nu^*: |\mu|=|\nu|, \mu=\underbrace{1\cdots 1}_{n}\mu', \nu=\underbrace{1\cdots 1}_{m}\nu'\} \\ &=\overline{\lspan}\{S_1^n S_{\mu'} S_{\nu'}^* S_1^{*m}: |\mu'|+n=|\nu'|+m\} \\ \end{align*} Let $T_1,\cdots,T_k$ be contractions in $\bh{H}$ such that $\sum_{i=1}^k T_i T_i^*=I$. For any $w\in\mathbb{F}_k^+$, we denote $T_w$ in a similar way as $S_w$. One can define a kernel system $K$ by \[K(n, S_1^n S_{\mu'} S_{\nu'}^* S_1^{*m}, m)=T_{\mu'} T_{\nu'}^*.\] This kernel is from the compression of the identity map of $\mathcal{A}$ and the isometric representation $V(n)=S_1^n$. Therefore, it does satisfy all the conditions in Definition \ref{df.kernel}. This is not surprising due to the well-known dilation theorem of Popescu, \cite[Theorem~3.2]{Popescu1999b}, whereby the $T_i$ can be dilated to Cuntz isometries. \end{remark} \section{Covariant Pairs and Dilation}\label{sect.dilation} We turn our attention back to right LCM dynamical systems. The goal of this section is to prove the following result, which can be seen as an equivariant version of Stinespring's theorem for right LCM dynamical systems. \begin{theorem}\label{thm.dym.dilation} Let $(\phi,T)$ be a contractive covariant representation of a right LCM dynamical system $(\mathcal{A},P,\alpha)$. Then there exists an isometric covariant dilation $(\pi,V)$ of $(\phi,T)$ if and only if $\phi$ is a unital completely positive map. Moreover, the dilation $(\pi,V)$ can be taken to be minimal and the minimal dilation is unique up to unitary equivalence. \end{theorem} \begin{remark} Consider the trivial case where $P=\{e\}$. Then Theorem \ref{thm.dym.dilation} is simply Stinespring's dilation theorem which states that every unital completely positive map can be dilated to a $\ast$-homomorphism. For nontrivial $P$, Stinespring's theorem only gives a $\ast$-homomorphic dilation $\pi$ of the unital completely positive map $\phi$. Surprisingly, it also allows us to construct an isometric dilation $V$ alongside, such that $(\pi, V)$ satisfies the covariance condition. \end{remark} The proof is divided into two parts. First we construct a kernel system $K$ from a contractive covariant representation $(\phi,T)$ and show, in a series of lemmas and propositions, that the kernel system $K$ enjoys all the nice properties from Definition \ref{df.kernel} whenever $\phi$ is unital completely positive. This allows us to invoke Theorem \ref{thm.kernel.dilation} to obtain a $\ast$-homomorphism $\pi$ of the $\mathrm{C}^*$-algebra and an isometric representation $V$ of the semigroup. Then the proof is concluded by verifying that $(\pi,V)$ satisfies the covariance condition from Definition \ref{df.CovariantPair}. We begin by constructing kernel systems from contractive covariant representations. \begin{lemma}\label{lem:welldefined} Let $(\phi,T)$ be a contractive covariant representation of the injective right LCM dynamical system $(\mathcal{A}, P, \alpha)$. Suppose that $rP=sP=pP\cap qP$. Then \[T(p^{-1}r) \phi(\alpha_r^{-1}(a)) T(q^{-1}r)^* = T(p^{-1}s) \phi(\alpha_s^{-1}(a)) T(q^{-1}s)^* \] \end{lemma} \begin{proof} If $rP=sP=pP\cap qP$, then $r=su$ for some invertible element $u\in P$, so we have \begin{align*} T(p^{-1}r) \phi(\alpha_r^{-1}(a)) T(q^{-1}r)^* &= T(p^{-1} s) T(u) \phi(\alpha_u^{-1}(\alpha_s^{-1}(a))) T(u)^* T(q^{-1} s)^* \\ &= T(p^{-1}s) \phi(\alpha_s^{-1}(a)) T(q^{-1}s)^*. \qedhere \end{align*} \end{proof} \begin{definition}\label{df.K} The \emph{kernel system $K$ associated with a contractive covariant representation $(\phi,T)$} is the function on $\Lambda_{(\mathcal{A},P,\alpha)}$ defined by \[ K(p,a,q):=\begin{cases}T(p^{-1}r) \phi(\alpha_r^{-1}(a)) T(q^{-1}r)^* & \text{ if } rP=pP\cap qP \neq \emptyset;\\ 0& \text{ if } pP\cap qP = \emptyset. \end{cases} \] Notice $K$ is well-defined because of Lemma~\ref{lem:welldefined}. \end{definition} \begin{lemma}\label{lm.Kdef2} Suppose that $a\in \mathcal{A}_s$ for some $s\in pP\cap qP$. Then \[K(p,a,q)=T(p^{-1}s) \phi(\alpha_s^{-1}(a)) T(q^{-1}s)^*.\] \end{lemma} \begin{proof} Let $pP\cap qP=rP$; since $s\in rP$ we have $s=rt$ for some $t\in P$. We have, \begin{align*} \tcb{T(p^{-1}s) \phi(\alpha_s^{-1}(a)) T(q^{-1}s)^* } &= T(p^{-1}r) T(t) \phi(\alpha_s^{-1}(a)) T(t)^* T(q^{-1}r)^* \\ &= T(p^{-1}r) \phi(\alpha_t(\alpha_s^{-1}(a))) T(q^{-1}r)^* \\ &= T(p^{-1}r) \phi(\alpha_r^{-1}(a)) T(q^{-1}r)^* \\ &= K(p,a,q). \qedhere \end{align*} \end{proof} \begin{lemma}\label{lm.Kpullout} Let $p,q\in P$ and $r\in qP$. Let $a\in \mathcal{A}_p\mathcal{A}_r\subseteq \mathcal{A}_p\mathcal{A}_q$. Then \[K(p,a,q)=K(p,a,r)T(q^{-1}r)^*.\] \end{lemma} \begin{proof} In the case when $pP\cap rP=\emptyset$, $a\in \mathcal{A}_p\mathcal{A}_r=\{0\}$ and thus $a=0$, and either side becomes $0$. Assume otherwise that $pP\cap rP=sP\subset pP\cap qP$. Then $s\in pP\cap qP$, and thus by Lemma \ref{lm.Kdef2}, \begin{align*} K(p,a,q) &= T(p^{-1} s) \phi(\alpha_s^{-1}(a)) T(q^{-1}s)^* \\ &= T(p^{-1} s) \phi(\alpha_s^{-1}(a)) T(r^{-1}s)^* T(q^{-1} r)^* \\ &= K(p,a,r)T(q^{-1}r)^*. \qedhere \end{align*} \end{proof} \begin{proposition}\label{prop.Kbasic} Let $K$ be the kernel system associated with $(\phi,T)$. Then $K$ is unital, Hermitian, Toeplitz, and linear. \end{proposition} \begin{proof} The kernel $K$ is unital because $K(e,1,e)=T(e) \phi(1) T(e)^*=I$. To see $K$ is Hermitian, consider first the case when $pP\cap qP=\emptyset$; then $K(p,a,q)^*=0=K(q,a^*,p)$. Next consider the case $pP\cap qP=rP$ and use the fact that $\phi$ and $\alpha_r$ are $\ast$-maps: \begin{align*} K(p,a,q)^* &= \left( T(p^{-1}r) \phi(\alpha_r^{-1}(a)) T(q^{-1}r)^*\right)^* \\ &= T(q^{-1}r) \phi(\alpha_r^{-1}(a))^* T(p^{-1}r)^* \\ &= T(q^{-1}r) \phi(\alpha_r^{-1}(a^*)) T(p^{-1}r)^* \\ &= K(q,a^*,p). \end{align*} To see that $K$ is Toeplitz, assume first $pP\cap qP=\emptyset$; then it is clear that $rpP\cap rqP=r\cdot (pP\cap qP)=\emptyset$, and $K(p,a,q)=0=K(rp,\alpha_r(a),rq)$. Assume next $pP\cap qP=sP$; then $rpP\cap rqP=rsP$, and \begin{align*} K(rp, \alpha_r(a), rq) &= T((rp)^{-1} rs) \phi(\alpha_{rs}^{-1}(\alpha_r(a))) T((rq)^{-1} rs)^* \\ &= T(p^{-1}s) \phi(\alpha_s^{-1}(a)) T(q^{-1}s)^* \\ &= K(p,a,q). \end{align*} Finally, the linearity of $K$ follows from that of $\phi$ and $\alpha_r$. \end{proof} \begin{lemma}\label{lm.Kpos1} Suppose $p_1,\cdots, p_n\in P$ have a least common multiple $r\in \bigcap_{i=1}^n p_i P$, and let $a_1,\cdots,a_n\in \mathcal{A}_r$. If $\phi$ is completely positive, then the operator matrix $[K(p_i, a_i^* a_j, p_j)]$ is positive definite. \end{lemma} \begin{proof} For each $i$, write $r=p_i q_i$ for some $q_i\in P$ and $a_i=\alpha_r(b_i)$ for $b_i\in \mathcal{A}$. Let $b_i=\alpha_r^{-1}(a_i)$. By Lemma \ref{lm.Kdef2}, \begin{align*} K(p_i, a_i^* a_j, p_j) &= T(p_i^{-1} r) \phi(\alpha_r^{-1}(a_i^* a_j)) T(p_j^{-1} r)^* \\ &= T(p_i^{-1} r) \phi(b_i^* b_j) T(p_j^{-1} r)^*. \end{align*} Let $A=[\phi(b_i^* b_j)]$, $B=[b_i^* b_j]$, and $D$ be the $n\times n$ diagonal matrix with diagonal entries $T(p_i^{-1}r)$. Then \begin{align*} [K(p_i, a_i^* a_j, p_j)] &= D A D^* = D \phi^{(n)}(B) D^*. \end{align*} Since $B$ is obviously positive and $\phi$ is completely positive, the matrix $[K(p_i, a_i^* a_j, p_j)]$ is positive definite. \end{proof} \begin{lemma}\label{lm.EWF} Let $F=\{p_1,\cdots,p_n\}\subset P$ and for each subset $ W\subseteq F$ define \[E_{W,F}= \Big(\prod_{p\in W} E_p \Big) \Big( \prod_{p\in F\backslash W} (I-E_p)\Big).\] Then \begin{enumerate} \smallskip\item $E_{W,F}$ is an orthogonal projection. \smallskip\item For each $p\in F\backslash W$ and $a\in\mathcal{A}_p$, $aE_{W,F}=E_{W,F}a=0$. \smallskip\item For any $W_1\neq W_2\subseteq F$, $E_{W_1, F} E_{W_2, F}=0$. \smallskip\item \ $\sum_{W\subseteq F} E_{W,F}=I$. \end{enumerate} \end{lemma} \begin{proof} Since $\{E_p: p\in F\}$ is a family of commuting projections, their products (and products of their orthogonal complements $I-E_q$) are projections. For $a\in \mathcal{A}_p$ we have $a(I-E_p)=(I-E_p)a=0$ and thus $a E_{W,F}=E_{W,F}a=0$ whenever $p\notin W$. In particular, for any $W_1\neq W_2\subseteq F$, there exists $p\in F$ that is an element for exactly one of $W_1, W_2$. Without loss of generality, assume $p\in W_1$ but $p\notin W_2$. We have $E_{W_1, F} E_p=E_{W_1, F}$, but $E_p E_{W_2, F}=0$. Therefore, $E_{W_1, F} E_{W_2, F}=0$. Finally, $I=\prod_{p\in F} (E_p + (I-E_p))$. Expanding the product derives the desired equality. \end{proof} \begin{proposition}\label{prop.positive.ucp} $K$ is positive if and only if $\phi$ is completely positive. \end{proposition} \begin{proof} Notice that $K(e,a,e)=\phi(a)$ for every $a\in\mathcal{A}$. Assume that $K$ is positive. Given any positive $n\times n$ operator matrix $A=[a_{i,j}]\in M_n(\mathcal{A})$, we can find $B=[b_{i,j}]\in M_n(\mathcal{A})$ with $A=BB^*$. We have \[\phi(A)=\phi(BB^*)= \sum_{k=1}^n [\phi(b_{i,k}b_{j,k}^*)]_{n\times n} = \sum_{k=1}^n [K(e, b_{i,k} b_{j,k}^*,e)]_{n\times n}\geq 0,\] proving that $\phi$ is completely positive. Conversely, assume that $\phi$ is completely positive. Let $F=\{p_1,\cdots, p_n\} \subset P$ and $a_i\in \mathcal{A}_{p_i}$. We need to prove that the operator matrix $[K(p_i, a_i^* a_j, p_j)]$ is positive definite. By Lemma \ref{lm.EWF}(4) and the linearity of $K$, \[[K(p_i, a_i^* a_j, p_j)]=\sum_{W\subseteq F} [K(p_i, a_i^* E_{W,F} a_j, p_j)].\] Hence it suffices to prove that for all $W\subseteq F$, \[[K(p_i, a_i^* E_{W,F} a_j, p_j)]\geq 0.\] For each $W\subseteq F$ and each $j\notin W$ we have $E_{W,F}a_j=0$. Therefore, the entries of the matrix $[K(p_i, a_i^* E_{W,F} a_j, p_j)]$ vanish outside the $|W|\times |W|$ submatrix \[S_W=[K(p_i, a_i^* E_{W,F} a_j, p_j)]_{i,j\in W}.\] If $\bigcap_{p_i\in W} p_iP=\emptyset$, then $\prod_{p_i\in W} E_{p_i}=0$ so that $E_{W,F}=0$, in which case $S_W$ is the zero matrix. Otherwise, by the right LCM condition, $\bigcap_{p_i\in W} p_iP=rP$ for some $r\in P$ and $c_i:=a_i E_{W,F}\in \mathcal{A}_r$. Since $E_{W,F}$ is a projection, $c_i^* c_j = a_i^* E_{W,F} a_j$. Therefore, $S_W=[K(p_i, c_i^* c_j, p_j)]\geq 0$ by Lemma \ref{lm.Kpos1}. \end{proof} We are now ready to prove Theorem \ref{thm.dym.dilation}. \begin{proof}[Proof of Theorem \ref{thm.dym.dilation}] Assume first $\phi$ has a dilation; then it is a compression of a $\ast$-homomorphism, and thus must be unital completely positive. Conversely, assume that $\phi$ is unital completely positive. Define a kernel system $K$ as in Definition \ref{df.K}. Proposition \ref{prop.positive.ucp} proves that $K$ is positive. By Proposition \ref{prop.Kbasic} and Theorem \ref{thm.kernel.dilation}, there exists a $\ast$-homomorphism $\pi:\mathcal{A}\to\bh{K}$ and an isometric representation $V:P\to\bh{K}$ on some Hilbert space $\mathcal{K}\supset \mathcal{H}$, such that \[\phi(a)=P_\mathcal{H} \pi(a)\bigg|_\mathcal{H} \quad \text{ and } \quad T(p) = P_\mathcal{H} V(p)\bigg|_\mathcal{H} \] for all $a\in \mathcal{A}$ and $p\in P$. Moreover, by Theorem~\ref{thm.kernel.dilation}, $(\pi,V)$ satisfies the weaker covariance relation $V(p)\pi(a)=\pi(\alpha_p(a))V(p)$. To see $(\pi,V)$ is in fact an isometric covariant representation, by Proposition \ref{prop.cov.equiv}, it suffices to prove that $V(p)V(p)^*=\pi(\alpha_p(1))$ for all $p\in P$. We claim that for every $\delta_{q,b}\otimes h\in \mathcal{K}$, \begin{equation}\label{eq:claim} V(p)^* \delta_{q,b}\otimes h=\begin{cases} \delta_{p^{-1} r, \alpha_{p^{-1}}(b)}\otimes T(q^{-1}r)^* h, &\mbox{ if } pP\cap qP=rP;\\0, & \mbox{ if } pP\cap qP=\emptyset . \end{cases} \end{equation} Pick any $\delta_{s,c}\otimes k\in\mathcal{K}$; then \begin{align*} \langle V(p)^* \delta_{q,b}\otimes h, \delta_{s,c}\otimes k\rangle &= \langle \delta_{q,b}\otimes h, V(p) \delta_{s,c}\otimes k\rangle \\ &= \langle \delta_{q,b}\otimes h, \delta_{ps,\alpha_p(c)}\otimes k\rangle \\ &= \langle K(ps, \alpha_p(c)^* b, q) h, k\rangle. \end{align*} Assume first $pP\cap qP=rP$. Then \begin{align*} \langle \delta_{p^{-1} r, \alpha_{p^{-1}}}(b)\otimes T(q^{-1}r)^* h, \delta_{s,c} \otimes k\rangle &= \langle K(s, c^* \alpha_{p^{-1}}(b), p^{-1}r) T(q^{-1}r)^* h, k\rangle \\ &= \langle K(ps, \alpha_p(c)^* b, r) T(q^{-1}r)^* h, k\rangle, \end{align*} where we have used the Toeplitz property of $K$ in the last line. By Lemma \ref{lm.Kpullout} we get \begin{align*} \langle \delta_{p^{-1} r, \alpha_{p^{-1}}}(b)\otimes T(q^{-1}r)^* h, \delta_{s,c} \otimes k\rangle &= \langle K(ps, \alpha_p(c)^* b, r)T(q^{-1}r)^* h, k\rangle \\ &= \langle K(ps, \alpha_p(c)^* b, q)h, k\rangle \\ &= \langle V(p)^* \delta_{q,b}\otimes h, \delta_{s,c}\otimes k\rangle. \end{align*} Therefore, $V(p)^* \delta_{q,b}\otimes h=\delta_{p^{-1} r, \alpha_{p^{-1}}(b)}\otimes T(q^{-1}r)^* h$, proving the first case in \eqref{eq:claim}. Assume next $pP\cap qP=\emptyset$. Then $psP\cap qP=\emptyset$, hence $\mathcal{A}_{ps}\mathcal{A}_q=\{0\}$, which implies that $\alpha_p(c)^* b =0$. Thus $\langle V(p)^* \delta_{q,b}\otimes h, \delta_{s,c}\otimes k\rangle=0$ for arbitrary $\delta_{s,c}\otimes k\in \mathcal{K}$. Hence $V(p)^* \delta_{q,b}\otimes h=0$, proving the second case in \eqref{eq:claim} and completing the proof of the claim. In order to conclude that $V(p)V(p)^*=\pi(\alpha_p(1))$, since both sides are bounded linear operators, and since the dilation is minimal, it suffices to show that $V(p)V(p)^* \delta_{q,b}\otimes h$ equals $\pi(\alpha_p(1)) \delta_{q,b}\otimes h = \delta_{q,\alpha_p(1) b}\otimes h$ for all $(q,b)\in \mathcal{X}$ and $h\in \mathcal{H}$. Assume first $pP\cap qP=rP$. Then equation \eqref{eq:claim} shows that \begin{align*} V(p)V(p)^* \delta_{q,b}\otimes h &= V(p) \delta_{p^{-1} r, \alpha_{p^{-1}}(b)}\otimes T(q^{-1}r)^* h \\ &= \delta_{r, \alpha_p(\alpha_{p^{-1}}( b))}\otimes T(q^{-1}r)^* h \\ &=\delta_{r, \alpha_p(1)b}\otimes T(q^{-1}r)^* h. \end{align*} Now let $\delta_{s,c}\otimes k\in\mathcal{K}$ and compute, \begin{align*} \langle \delta_{r, \alpha_p(1) b}\otimes T(q^{-1}r)^* h, \delta_{s,c}\otimes k\rangle &= \langle K(s, c^* \alpha_p(1) b, r) T(q^{-1}r)^* h, k\rangle \\ &= \langle K(s, c^* \alpha_p(1) b, q) h, k\rangle \\ &= \langle \delta_{q, \alpha_p(1) b}\otimes h, \delta_{s,c}\otimes k\rangle. \end{align*} where we have applied Lemma \ref{lm.Kpullout} in the second equality. So in this case we have \[ V(p)V(p)^* \delta_{q,b}\otimes h= \delta_{r, \alpha_p(1) b}\otimes T(q^{-1}r)^* h = \delta_{q, \alpha_p(1) b}\otimes h = : \pi(\alpha_p(1)) (\delta_{q,b}\otimes h). \] Assume now that $pP\cap qP=\emptyset$. Equation \eqref{eq:claim} shows that $ V(p)^* \delta_{q,b}\otimes h=0$ and hence $V(p)V(p)^* \delta_{q,b}\otimes h =0$. On the other hand, $(q,b) \in \mathcal{X}$ implies $\alpha_q(1) b =b$ so $\alpha_p(1)b = \alpha_p(1) \alpha_q(1) b=0$. Recall now that, by definition, \[\langle \delta_{q,0}\otimes h, \delta_{r,a}\otimes k\rangle =\langle K(r,0,q) h, k\rangle,\] for every $\delta_{r,a}\otimes k\in \mathcal{K}_0$, and since $K(r,0,q)=0$, we conclude that in the present case $\pi(\alpha_p(1)) (\delta_{q,b}\otimes h) = 0 = \delta_{q,\alpha_p(1) b}\otimes h$. Hence $V(p)V(p)^*=\pi(\alpha_p(1))$. We know from Theorem \ref{thm.kernel.dilation} that the dilation satisfies the weak covariance condition and now that we have verified $V(p)V(p)^*=\pi(\alpha_p(1))$ we may use Proposition \ref{prop.cov.equiv} to conclude that $(\pi, V)$ is an isometric covariant representation. The minimality of $(\pi,V)$ and its uniqueness are established by Theorem \ref{thm.kernel.dilation}, completing the proof. \end{proof} \section{Dilations on Right LCM Semigroups}\label{sect.exLCM} \subsection{Nica-covariance and dilation} The main motivation of this paper comes from the recent development of dilation theory on right LCM semigroups in \cite{BLi2019} where it is shown that a contractive representation $T:P\to\bh{H}$ admits an isometric Nica-covariant dilation if and only if \begin{equation}\label{eq.dilation} \sum_{U\subseteq F} (-1)^{|U|} T(\vee U)T(\vee U)^* \geq 0 \qquad \text{for all finite }F\subset P. \tag{$\diamond$} \end{equation} In trying to interpret this dilation result, we noticed the key role played by the semigroup dynamical system $(\mathcal{D}_P, P, \alpha)$ based on the diagonal C*-algebra $\mathcal{D}_P:=\overline{\lspan}\{E_p=V(p)V(p)^*: p\in P\}$ of the semigroup $\mathrm{C}^*$-algebra. Recall that $\mathcal{D}_P:=\overline{\lspan}\{E_p=V(p)V(p)^*: p\in P\}$ is commutative by the Nica-covariance condition and that $P$ acts on $\mathcal{D}_P$ by $\alpha_p(x)=V(p)xV(p)^*$. The system $(\mathcal{D}_P, P, \alpha)$ is the template we used for the definition of right LCM dynamical systems. Indeed, Nica-covariance implies that \begin{align*} \alpha_p(1)\alpha_q(1) &= E_p E_q = \begin{cases} E_r = \alpha_r(1), & \mbox{ if } pP\cap qP=rP; \\ 0, & \mbox{ if } pP\cap qP=\emptyset. \end{cases} \end{align*} Using this one can easily check that $\alpha_p(\mathcal{D}_P)$ is an ideal in $\mathcal{D}_P$, showing that $(\mathcal{D}_P,P,\alpha)$ is a right LCM dynamical system in the sense of Definition~\ref{df.respectLCM}. \begin{proposition}\label{prop.positive.DP} Let $\phi:\mathcal{D}_P\to\bh{H}$ be a unital $\ast$-preserving linear map. Then the following are equivalent: \begin{enumerate} \item $\phi$ is positive\tcb{.} \item $\phi$ is completely positive. \item For each finite $F\subset P$ and $W\subseteq F$, \[\phi\left(\bigg( \prod_{f\in W} E_f \bigg)\bigg( \prod_{f\in F\backslash W} (I-E_f) \bigg)\right)\geq 0.\] \item For each finite $F\subset P$ \[\phi\bigg(\prod_{f\in F} (I-E_f) \bigg)\geq 0.\] \end{enumerate} \end{proposition} \begin{proof} Recall that $\mathcal{D}_P$ is a commutative $\mathrm{C}^*$-algebra, so (1) and (2) are equivalent. For a finite subset $F\subset P$ and $W\subseteq F$, define \[ E_{W,F}=\bigg(\prod_{p\in W} E_p \bigg)\bigg( \prod_{p\in F\backslash W} (I-E_p)\bigg). \] For fixed $F$, one can apply Lemma \ref{lm.EWF} to show that the family $\{E_{W,F}\}_{W\subseteq F}$ consists of orthogonal projections with mutually orthogonal ranges that sum up to $I$. An element $x\in \lspan\{E_p: p\in F\}$ can therefore be written as $x=\sum_{W\subseteq F} \lambda_{W,F} E_{W,F}$, and it is positive if and only if $\lambda_{W,F}\geq 0$ for all $W\subseteq F$ such that $E_{W,F} \neq 0$. Therefore, $\phi$ is positive if and only if $\phi(E_{W,F})\geq 0$ for all finite $F\subset P$ and $W\subseteq F$, which proves the equivalence between (1) and (3). It is easy to see that (3) implies (4) by taking $W=\emptyset$. To see the converse notice that, by Nica-covariance, either $\prod_{f\in W} E_f =0$, in which case $\phi(E_{W,F})=0$ and (3) holds, or else $\prod_{f\in W} E_f =E_r$ for $rP = \bigcap_{f\in W} fP$. In the latter case, for each $f\in F\backslash W$, \[E_r E_f =\begin{cases} E_s, &\mbox{ if } rP\cap fP=sP; \\ 0, &\mbox{ if } rP\cap fP=\emptyset .\\ \end{cases} \] Therefore, \[V(r)^*(I-E_f) = \begin{cases} (I-E_{r^{-1}s(f)}) V(r)^*, &\mbox{ if } rP\cap fP=s(f) P; \\ V(r)^*, &\mbox{ if } rP\cap fP=\emptyset .\\ \end{cases} \] Next let $F_0=\{r^{-1}s(f): s(f) P=rP\cap fP, \ f\in F\backslash W, \text{ and } rP\cap fP \neq \emptyset\}$. We have \begin{align*} E_r \prod_{f\in F\backslash W} (I-E_f) &= V(r) \prod_{f\in F_0} (I-E_f)V(r)^*. \\ &= \alpha_r( \prod_{f\in F_0} (I-E_f)). \end{align*} By (4), $\phi( \prod_{f\in F_0} (I-E_f))\geq 0$. Therefore, \begin{align*} \phi(E_{W,F}) &= \phi(\alpha_r(\prod_{f\in F_0} (I-E_f))) = T(r) \phi(\prod_{f\in F_0} (I-E_f)) T(r)^* \geq 0, \end{align*} so (3) holds in this case too. \end{proof} {For each contractive representation $T:P\to\bh{H}$ one can define $\phi_T(E_p)=T(p)T(p)^*$. Since the projections $E_p$ are linearly independent this can be extended by linearity to all of $\lspan\{E_p=V(p)V(p)^*: p\in P\}$. It is not immediate that $\phi_T$ can be extended to a contractive positive map on $\mathcal{D}_P$. The following lemma gives a criterion for when this is possible.} \begin{lemma} \label{lem:extension} Suppose $T:P\to\bh{H}$ is a contractive representation, let $\phi_T(E_p):=T(p)T(p)^*$ and extend $\phi_T$ linearly to $\lspan\{E_p=V(p)V(p)^*: p\in P\}$. The following are equivalent \begin{enumerate} \item The map $\phi_T$ extends to a positive map on $\mathcal{D}_P=\overline{\lspan}\{E_p=V(p)V(p)^*: p\in P\}$. \item For each finite $F\subset P$ and $W\subseteq F$, \[\phi_T\left(\bigg( \prod_{f\in W} E_f \bigg)\bigg( \prod_{f\in F\backslash W} (I-E_f) \bigg)\right)\geq 0.\] \item For each finite $F\subset P$ \[\phi_T\bigg(\prod_{f\in F} (I-E_f) \bigg)\geq 0.\] \end{enumerate} \end{lemma} \begin{proof} The equivalence among (2) and (3) follows in the same way as the proof of Proposition \ref{prop.positive.DP}. It is obvious that (1) implies (2) since each $\bigg( \prod_{f\in W} E_f \bigg)\bigg( \prod_{f\in F\backslash W} (I-E_f) \bigg)\geq 0$. For the converse, pick any $x=\sum_{p\in F} \lambda_p E_p$ with $\|x\| =1$. By Lemma~\ref{lm.EWF}, \[ x = \left(\sum_{W\subseteq F} E_{W,F}\right) x = \sum_{W\subseteq F} \sum_{p\in F} \lambda_p E_{W,F} E_p= \sum_{W\subseteq F} (\sum_{p\in W} \lambda_p) E_{W,F}. \] Let $\mu_W=\sum_{p\in W} \lambda_p$. Since $\{E_{W,F}\}$ is a collection of pairwise orthogonal projections, \[ \|x\|=\max_{W\subset F, E_{W,F}\neq 0} |\mu_W| = 1. \] To prove $\phi_T$ can be extended by continuity to $\mathcal{D}_P$, it suffices to prove that $\|\phi_T(x)\|\leq 1$ and thus $\phi_T$ is contractive. This is equivalent to proving that the $2\times 2$ operator matrix $\begin{bmatrix} I & \phi_T(x) \\ \phi_T(x)^* & I\end{bmatrix}$ is positive definite. Since \[ \begin{bmatrix} I & \phi_T(x) \\ \phi_T(x)^* & I\end{bmatrix} = \sum_{W\subseteq F} \begin{bmatrix} \phi_T(E_{W,F}) & \mu_W \phi_T(E_{W,F}) \\ \overline{\mu_W} \phi_T(E_{W,F}) & \phi_T(E_{W,F})\end{bmatrix} \] and each $\phi_T(E_{W,F})$ is positive by (2), this operator matrix is always positive. \end{proof} As an application of our Theorem~\ref{thm.dym.dilation}, we recover the following dilation theorem from \cite{BLi2019}. \begin{theorem}\cite[Theorem~3.9]{BLi2019}\label{thm.LCM.Dilation} Let $T:P\to\bh{H}$ be a contractive unital representation of a right LCM semigroup. The following are equivalent: \begin{enumerate} \item $T$ has an isometric Nica-covariant dilation; \item For any finite set $F\subset P$, \[\sum_{U\subseteq F} (-1)^{|U|} T(\vee U)T(\vee U)^* \geq 0.\] \end{enumerate} \end{theorem} \begin{proof} Suppose (1) holds. We may assume that the dilation $V$ is minimal and hence $\mathcal{H}$ is co-invariant. Let $E_f := V_fV_f^*$. From the inclusion-exclusion principle, for every finite $F\subset P$, \[\prod_{f\in F} (I-E_f) = \sum_{U\subseteq F} (-1)^{|U|} E_{\vee U},\] where we set $E_{\vee U}=0$ when $\bigcap_{p\in U} pP=\emptyset$, and $E_{\vee U}=E_r$ when $\bigcap_{p\in U} pP=rP$. That (1) implies (2) is now easy to see because $\sum_{U\subseteq F} (-1)^{|U|} T(\vee U)T(\vee U)^*$ is the compression of $\prod_{f\in F} (I-E_f) $ to the co-invariant subspace $\mathcal{H}$. Suppose now that $T$ is a contractive unital representation of $P$ such that (2) holds and define $\phi(E_r):=T(r)T(r)^*$. Then condition (3) in Lemma~\ref{lem:extension} also holds. By condition (1) in Lemma~\ref{lem:extension} we can extend $\phi$ to a contractive representation of $\mathcal{D}_P$, which we also denote by $\phi$, such that $(\phi,T)$ is a contractive covariant pair. Since $T$ satisfies (2), Proposition \ref{prop.positive.DP} implies that $\phi$ is positive, hence completely positive. Theorem~\ref{thm.dym.dilation} does the rest. \end{proof} \subsection{Nica spectrum and boundary quotient} The diagonal $\mathcal{D}_P$ is a unital commutative $\mathrm{C}^*$-algebra, which is isomorphic to $C(\Omega_P)$ for a compact Hausdorff space $\Omega_P$. The space $\Omega_P$ is called the Nica-spectrum of $P$, and one can refer to \cite{Nica1992, Laca1999, CrispLaca2007} for more detailed descriptions. The action $\alpha$ by injective endomorphisms of $\mathcal{D}_P$ induces an action $\hat\alpha$ of $P$ by surjective maps of $\Omega_P$ to itself. A compact subset $K\subset \Omega_P$ is called {\em \tcb{$\hat\alpha$}-invariant} if both $K$ and its complement are invariant, i.e. $\hat\alpha_p(K) \subseteq K$ and $\hat\alpha_p(\Omega_P\backslash K) \subseteq \Omega_P\backslash K$. Notice that in the case of a group one of the inclusions implies the other, but for semigroup actions, both inclusions have to be required. \begin{proposition} Let $K\subset \Omega_P$ be a closed $\hat \alpha$-invariant subset of $\Omega_P$. Then $(C(K),P,\alpha)$ is also a right LCM dynamical system. \end{proposition} \begin{proof} Let $\Omega_{P,p}=\hat{\alpha}_p(\Omega_P)$ and $K_p=\hat{\alpha}_p(K)$. Since $K$ and its complement are invariant for $\alpha$, \[K_p\cap K_q \subset \Omega_{P,p}\cap \Omega_{P,q}\cap K \quad p,q\in P.\] If $pP\cap qP=\emptyset$, then $\Omega_{P,p}\cap \Omega_{P,q}=\emptyset$ and also $K_p\cap K_q$. If $pP\cap qP=rP$, then \[\Omega_{P,p}\cap \Omega_{P,q}\cap K=\Omega_{P,r}\cap K=K_r\subseteq K_p\cap K_q.\] and thus $K_p\cap K_q=K_r$. Therefore, $\mathcal{A}_p=\alpha_p(C(K))=C(K_p)$ and $\mathcal{A}_p\mathcal{A}_q\subseteq C(K_p\cap K_q)$, which becomes $\{0\}$ when $pP\cap qP=\emptyset$ and becomes $C(K_r)$ when $pP\cap qP=rP$. \end{proof} Observe that $C(\Omega_P)=\mathcal{D}_P=\overline{\lspan}\{E_p=V(p)V(p)^*\}$. Thus, for every contractive representation $(\phi,T)$ of the dynamical system, \[\phi(E_p)=\phi(\alpha_p(1))=T(p)T(p)^*.\] This relation remains true when we consider $(C(K),P,\alpha)$ for any invariant subset $K$. \begin{theorem} Let $K$ be a closed invariant subset of $\Omega_P$ and $(\phi,T)$ be a contractive covariant representation of $(C(K),P,\alpha)$. Then the following are equivalent: \begin{enumerate} \item There exists an isometric covariant dilation $(\pi, V)$ of $(\phi,T)$. \item $\phi$ is positive. \item For each finite $F\subseteq P$, \[\sum_{U\subseteq F} (-1)^{|U|} T(\vee U)T(\vee U)^* \geq 0.\] \end{enumerate} \end{theorem} \begin{proof} That (1) implies (2) is easy to see, and (2) $\iff$ (3) follows from covariance and Proposition~\ref{prop.positive.DP}. Suppose now (2) holds. Since $C(K)$ is commutative $\phi$ is completely positive, hence (1) holds by Theorem~\ref{thm.dym.dilation}. \end{proof} An important invariant subspace of $\Omega_P$ is the boundary spectrum $\partial \Omega_P$, which consists of the closure of the set of maximal elements in $\Omega_P$ \cite[Definition 5.1]{BRSW2014}, see also \cite{Laca1999}. The boundary quotient corresponding to the boundary spectrum can be characterized via foundation sets. By definition, a finite set $F\subset P$ is a \emph{foundation set} if for all $p\in P$, there exists $f\in F$ such that $fP\cap pP\neq \emptyset$. Let $I_\infty$ be the ideal of $\mathcal{D}_P$ generated by the projections $ \prod_{f\in F}(I-E_f)$ for every foundation set $F$. Then \[ C(\partial \Omega_P) = \mathcal{D}_P / I_\infty. \] The \emph{boundary quotient} $\mathrm{C}^*$-algebra $\mathcal{Q}(P)$ is the universal $\mathrm{C}^*$-algebra generated by Nica-covariant representations $V$ with the additional requirement that \begin{equation}\label{eq:boundaryrelations} \prod_{f\in F}(I-V_fV_f^*)=0 \mbox{ for every foundation set }F. \end{equation} This can also be realized as the cross-product $\partial \mathcal{D}_P \rtimes P$. For more detailed studies of the boundary quotient $\mathrm{C}^*$-algebras, one may refer to \cite{Laca1999, CrispLaca2007, Starling2015}. \begin{example} Consider the free semigroup $\mathbb{F}_n^+$. A Nica-covariant representation $V$ is uniquely determined by its value on the $n$ generators $V_1, \cdots, V_n$. In this case, the Nica-covariance condition is equivalent to saying that the generating isometries $V_1,\cdots, V_n$ have orthogonal ranges, or in short, \[\sum_{i=1}^n V_i V_i^*\leq I.\] The universal $\mathrm{C}^*$-algebra (or the semigroup $\mathrm{C}^*$-algebra for $\mathbb{F}_n^+$) is thus the Toeplitz-Cuntz algebra $\mathcal{TO}_n$. However, the boundary quotient requires further that $\sum_{i=1}^n V_i V_i^*=I$, and the boundary quotient semigroup $\mathrm{C}^*$-algebra for $\mathbb{F}_n^+$ is the Cuntz algebra $\mathcal{O}_n$. \end{example} A contractive representation of the boundary quotient dynamical system $(C(\partial \Omega_P), P, \alpha)$ is uniquely determined by a contractive representation $T:P\to\bh{H}$ with the additional requirement that for every foundation set $F\subset P$, \[\sum_{U\subseteq F} (-1)^{|U|} T(\vee U)T(\vee U)^* = 0.\] As a corollary of Theorem~\ref{thm.LCM.Dilation}, we establish a condition for a contractive representation to be dilated to an isometric representation of the boundary quotient. \begin{corollary}\label{cor.QDilation} Let $T:P\to\bh{H}$ be a contractive representation of a right LCM semigroup $P$ such that for each foundation set $F\subset P$, \[\sum_{U\subseteq F} (-1)^{|U|} T(\vee U)T(\vee U)^* = 0.\] Then, the following are equivalent: \begin{enumerate} \item There exists a Nica covariant isometric dilation $V:P\to\bh{K}$ satisfying \eqref {eq:boundaryrelations}\tcb{.} \item For each finite $F\subseteq P$, \[\sum_{U\subseteq F} (-1)^{|U|} T(\vee U)T(\vee U)^* \geq 0.\] \end{enumerate} \end{corollary} \section{Dilation on $C(\Omega_P)\otimes \mathcal{A}$}\label{sect.example} In this section we build more examples of right LCM dynamical systems, starting from automorphic actions. Throughout we fix a right LCM semigroup $P$ with trivial unit group $P^\ast=\{e\}$, so that whenever $pP\cap qP=rP$, the choice of $r$ is unique. As before, $\Omega_P$ denotes its Nica-spectrum and $\partial \Omega_P$ denotes the boundary of $\Omega_P$. \subsection{A dynamical system on $C(\Omega_P)\otimes \mathcal{A}$} Suppose $\beta$ is a $\ast$-automorphic $P$-action on the unital C*-algebra $\mathcal{A}$. The system $(\mathcal{A}, P, \beta)$ is not necessarily a right LCM dynamical system, in fact it cannot be when there exist elements $p,q$ such that $pP\cap qP=\emptyset$, because then $\beta_p(\mathcal{A})\beta_q(\mathcal{A})=\mathcal{A}\neq \{0\}$. Our first goal is to construct a right LCM dynamical system on the $\mathrm{C}^*$-algebra $\widetilde{\mathcal{A}}:=C(\Omega_P)\otimes \mathcal{A} $ of continuous $\mathcal{A}$-valued functions on $\Omega_P$, and then give conditions under which unital completely positive maps on $\mathcal{A}$ can be lifted to $\widetilde{\mathcal{A}}$. Recall the natural right LCM dynamical system $(C(\Omega), P, \alpha)$ where $\alpha_p(V_qV_q^*)=V_{pq} V_{pq}^*$, and define $\widetilde{\alpha}$ on $\widetilde{\mathcal{A}}$ by \[\widetilde{\alpha_p}(f\otimes a) = \alpha_p(f)\otimes \beta_p(a).\] In other words, $\widetilde{\alpha}=\alpha \otimes \beta$, which is clearly a $P$-action on $\widetilde{\mathcal{A}}$ by $\ast$-endomorphisms. \begin{lemma} The semigroup dynamical system $(\widetilde{\mathcal{A}}, P, \widetilde{\alpha})$ is a right LCM dynamical system. \end{lemma} \begin{proof} Since $\beta_p$ is a $\ast$-automorphism, the image $\widetilde{\alpha_p}(\widetilde{\mathcal{A}})$ is $\alpha_p(C(\Omega_P))\otimes \mathcal{A}$. Since $(C(\Omega_P),P,\alpha)$ is a right LCM dynamical system, by Proposition \ref{prop.equivLCM}, \[\alpha_p(C(\Omega_P)) \alpha_q(C(\Omega_P)) = \begin{cases} \alpha_r(C(\Omega_P)), &\mbox{ if } pP\cap qP=rP; \\ \{0\}, &\mbox{ if } pP\cap qP=\emptyset. \end{cases} \] This relation is preserved by tensor products, and another application of Proposition \ref{prop.equivLCM} shows that $(\widetilde{\mathcal{A}}, P, \widetilde{\alpha})$ is a right LCM dynamical system. \end{proof} Next, given a unital completely positive map $\phi:\mathcal{A}\to\bh{H}$ and a contractive representation $T:P\to\bh{H}$, we hope to construct a covariant representation $(\widetilde{\phi}, T)$ for the right LCM dynamical system $(\widetilde{\mathcal{A}}, P, \widetilde{\alpha})$. Note that $\phi$ and $T$ do not need to satisfy any covariance relation by themselves. Recall $C(\Omega_P)\cong \mathcal{D}_P$ is the closed linear span of the projections $E_p=V_p V_p^*$ and define \[\widetilde{\phi}(E_p\otimes a) = T(p) \phi(\beta_p^{-1}(a)) T(p)^*.\] For every finite $F\subset P$, we define a map $\phi_F:\mathcal{A}\to\bh{H}$ as follows. If a subset $U \subset F$ has an upper bound, we let $s_U $ be the least upper bound of $U$, so that $s_U P=\bigcap_{p\in U} pP$ and $s_U$ is uniquely determined because we are assuming $P$ has no nontrivial units. If $U$ has no upper bound, so that $\bigcap_{p\in U} pP=\emptyset$, then by convention we say $\tcb{s_U} =\infty$ and we let $T(\infty) =0$. Then we define \[\phi_F(a) = \sum_{U\subseteq F} (-1)^{|U|} T(s_U) \phi(\beta_{s_U}^{-1} (a)) T(s_U)^*.\] \begin{proposition}\label{prop.tensor.UCP} Suppose $\beta$ is a $\ast$-automorphic $P$-action on $\mathcal{A}$, $\phi:\mathcal{A}\to\bh{H}$ is a unital completely positive map and $T:P\to\bh{H}$ is a contractive representation. Let $\widetilde{\phi}$ and $\phi_F$ be as above. The pair $(\widetilde{\phi},T)$ can be extended to a contractive covariant representation of $(\widetilde{\mathcal{A}}, P, \widetilde{\alpha})$ with unital completely positive $\widetilde{\phi}$ if and only if $\phi_F$ is completely positive for all finite $F\subset P$. \end{proposition} \begin{proof} For each finite subset $F \subset P$ and $a\in \mathcal{A}$ we have \begin{align*} \phi_F(a) &= \sum_{U\subseteq F} (-1)^{|U|} T(s_U) \phi(\beta_{s_U}^{-1} (a)) T(s_U)^* \\ &= \sum_{U\subseteq F} (-1)^{|U|} \widetilde{\phi}(E_{s_U} \otimes a) \\ &= \widetilde{\phi}(E_F \otimes a). \end{align*} where $E_F = \sum_{U\subseteq F} (-1)^{|U|} E_{s_U}=\prod_{p\in F} (I - E_p)$ is an orthogonal projection in $C(\Omega_P)$. If $(\widetilde{\phi},T)$ is a contractive covariant representation with $\widetilde{\phi}$ a unital completely positive map, then $\phi_F$ must be completely positive. For the converse, we first show that for every $p,q\in P$ and $a\in \mathcal{A}$, \begin{align*} \widetilde{\phi}(\widetilde{\alpha_p}(E_q\otimes a)) &= \widetilde{\phi}(E_{pq}\otimes \beta_p(a)) \\ &= T(p)T(q) \phi(\beta_{pq}^{-1}(\beta_p(a)) T(q)^* T(p)^* \\ &= T(p) T(q) \phi(\beta_q^{-1}(a)) T(q)^* T(p)^* \\ &= T(p) \widetilde{\phi}(E_q\otimes a) T(p)^*. \end{align*} Therefore, for any $x\in\lspan\{E_q\otimes a: q\in P, a\in \mathcal{A}\}$, \[\widetilde{\phi}(\widetilde{\alpha_p}(x)) = T(p) \widetilde{\phi}(x) T(p)^*.\] Next, for each $W\subseteq F$ we define \[\phi_{W,F}(a) = \widetilde{\phi}\Big(\Big(\prod_{e\in W} E_e \prod_{f\in F\backslash W} (I-E_f) \Big)\otimes a\Big).\] We claim that $\phi_{W,F}$ is completely positive. If $\bigcap_{e\in W} eP=\emptyset$, we have $\prod_{e\in W} E_e=0$ so the claim is trivially satisfied. Otherwise, $\bigcap_{e\in W} eP=rP$ for some $r\in P$, and $\prod_{e\in W} E_e=E_r$. Define $F_0=\{r^{-1}s: sP=rP\cap fP, f\in F\backslash W\}$. Then, for each $f\in F\backslash W$, either $fP\cap rP=\emptyset$ and $E_r (I-E_f)=E_r$, or $fP\cap rP=sP$ so that $E_r(I-E_f) = E_r - E_s = \alpha_r (I-E_{r^{-1}s})$. Therefore, \begin{align*} \phi_{W,F}(a) &= \widetilde{\phi}(\alpha_r(\prod_{p\in F_0} (I-E_p))\otimes a) \\ &= \widetilde{\phi}(\widetilde{\alpha_r}( E_{F_0} \otimes \beta_r^{-1}(a) )) \\ &= T(r) \phi_{F_0}(\beta_r^{-1}(a)) T(r)^*. \end{align*} Since $\phi_{F_0}$ is completely positive, composing with a $\ast$-automorphism $\beta_r^{-1}$ and conjugating with a contraction $T(r)$ yields another completely positive map $\phi_{W,F}$. This completes the proof of the claim. Let $C_0(\Omega_P)=\lspan\{E_p\}$, which is dense in $C(\Omega_P)$. We first extend $\widetilde{\phi}$ to $\widetilde{\mathcal{A}_0}=C_0(\Omega_P)\otimes \mathcal{A}$. This extension is clearly unital because $\widetilde{\phi}(I\otimes 1)=T(e) \phi(1) T(e)^* = I$. To prove that $\widetilde{\phi}$ is completely positive, pick any $x_1,\cdots, x_n\in \widetilde{\mathcal{A}_0}$. Since $C_0(\Omega_P)=\lspan\{E_p\}$, one can find a finite subset $F\subset P$ and elements $\{a_{f,i}\}_{f\in F, 1\leq i\leq n} \subset \mathcal{A}$, such that \[x_i = \sum_{f\in F} E_f \otimes a_{f,i}.\] For each $W\subseteq F$, let $E_{W,F}=\prod_{e\in W} E_e \prod_{f\in F\backslash W} (I-E_f)$. From Lemma~\ref{lm.EWF}, $\{E_{W,F}\}_{W\subseteq F}$ are orthogonal projections and they are pairwise orthogonal. Moreover, for each $f\in F$, the projection $E_f$ decomposes as \[E_f = \sum_{f\in W} E_{W,F}.\] Therefore, rearranging and combining terms, we can rewrite \[x_i=\sum_{W\subseteq F} E_{W,F}\otimes a_{W,F,i}\] for some $a_{W,F,i}\in \mathcal{A}$, and thus \[x_i^* x_j = \sum_{W\subseteq F} E_{W,F}\otimes a_{W,F,i}^* a_{W,F,j}.\] It follows that the matrix \begin{align*} [\widetilde{\phi}(x_i^*x_j)] &= \sum_{W\subseteq F} [\widetilde{\phi} (E_{W,F}\otimes a_{W,F,i}^* a_{W,F,j})] \\ &= \sum_{W\subseteq F} [\phi_{W,F}(a_{W,F,i}^* a_{W,F,j})] \end{align*} is positive because $\phi_{W,F}$ is completely positive for each $W$. This shows that $\widetilde{\phi}$ is unital completely positive on $\widetilde{\mathcal{A}_0}$. Since completely positive maps are also completely contractive, $\widetilde{\phi}$ can be extended by continuity to a unital completely positive map on $\widetilde{\mathcal{A}}$. \end{proof} When we apply Theorem \ref{thm.dym.dilation} to $(\widetilde{\phi},T)$ we obtain the following strengthening of Theorem~\ref{thm.LCM.Dilation}. \begin{theorem}\label{thm.tensor.dilation} Suppose $\beta$ is a $\ast$-automorphic $P$-action on the unital $\mathrm{C}^*$-algebra $\mathcal{A}$. Let $\phi:\mathcal{A}\to\bh{H}$ be a unital completely positive map on $\mathcal{A}$ and let $T:P\to\bh{H}$ be a contractive representation of the right LCM semigroup $P$. The following are equivalent: \begin{enumerate} \item There exist a $\ast$-homomorphism $\pi:\mathcal{A}\to\bh{K}$ and an isometric representation $V:P\to\bh{K}$ on a Hilbert space $\mathcal{K}\supset \mathcal{H}$ such that for $a,b\in \mathcal{A}$ and $p,q\in P$, if $pP\cap qP=rP$, then \begin{equation}\label{eqn:multipl-dilation} V(p)\pi(\beta_p^{-1}(a))V(p)^* V(q)\pi(\beta_q^{-1}(b))V(q)^* = V(r) \pi(\beta_r^{-1}(ab)) V(r)^*; \end{equation} and if $pP\cap qP=\emptyset$, then $V(p)$ and $V(q)$ have orthogonal ranges. \noindent Moreover, $\pi$ and $V$ are dilations for $\phi$ and $T$, respectively, and $\mathcal{H}$ is co-invariant for $V$. \item For each finite $F\subset P$, the map $\phi_F:\mathcal{A}\to\bh{H}$ defined by \[ \phi_F(a) = \sum_{U\subseteq F} (-1)^{|U|} T(s_U) \phi(\beta_{s_U}^{-1} (a)) T(s_U)^* \] is completely positive. \end{enumerate} \end{theorem} \begin{proof} Assume first that (2) holds and let $(\widetilde{\phi},T)$ be the contractive covariant representation of the system $(\widetilde{\mathcal{A}}, P, \widetilde{\alpha})$ from Proposition \ref{prop.tensor.UCP}. The map $\widetilde{\phi}$ is unital and completely positive, therefore, by Theorem \ref{thm.dym.dilation}, $(\widetilde{\phi},T)$ admits an isometric covariant dilation $(\widetilde{\pi},V)$ on $\bh{K}$ for $\mathcal{K}\supset\mathcal{H}$ in which $\mathcal{H}$ is co-invariant for $V$. Define $\pi:\mathcal{A}\to\bh{K}$ by $\pi(a)=\widetilde{\pi}(I\otimes a)$. One can easily verify that $\pi$ is a $\ast$-homomorphism that is a dilation for $\phi$ and that {$\widetilde{\pi}(E_p\otimes a)=V(p)\pi(\beta_p^{-1}(a)) V(p)^*$.} Notice that \[ E_p\otimes a \cdot E_q\otimes b = \begin{cases} E_r\otimes ab, &\mbox{ if } pP\cap qP=rP; \\ 0, &\mbox{ if } pP\cap qP=\emptyset. \end{cases} \] If $pP\cap qP=rP$, then \begin{align*} V(p)\pi(\beta_p^{-1}(a) )V(p)^* V(q)\pi(\beta_q^{-1}(b))V(q)^* &=\widetilde{\pi}(E_p\otimes a) \widetilde{\pi}(E_q\otimes b) \\ &= \widetilde{\pi}(E_r\otimes ab) \\ &= V(r) \pi(\beta_r^{-1}(ab)) V(r)^* , \end{align*} and if $pP\cap qP=\emptyset$, then \[ \widetilde{\pi}(E_p\otimes 1) \widetilde{\pi}(E_q\otimes 1)=V(p)V(p)^* V(q)V(q)^*=0 \] so that $V(p)$ and $V(q)$ have orthogonal ranges. Conversely, assume now (1) holds. Then $\pi$ is a $\ast$-homomorphism and thus unital completely positive. Therefore, one can extend $\pi$ and $V$ to obtain a contractive covariant representation $(\widetilde{\pi},V)$ of $(\widetilde{\mathcal{A}},P,\widetilde{\alpha})$. From the construction, $\widetilde{\pi}(E_p\otimes a)=V(p) \pi(\beta_p^{-1}(a)) V(p)^*$, and thus by equation \eqref{eqn:multipl-dilation}, $\widetilde{\pi}$ is multiplicative. Therefore, $\widetilde{\pi}$ is a $\ast$-homomorphism of $\widetilde{\mathcal{A}}$. For each finite $F\subset P$, we have \[\widetilde{\pi}_F(a)=\widetilde{\pi}((\prod_{f\in F} (I-E_f)) \otimes a)= \sum_{U\subseteq F} (-1)^{|U|} V(s_U) \pi(a) V(s_U)^*. \] which shows that $\widetilde{\pi}_F$ is a (non-unital) $\ast$-homomorphism of $\mathcal{A}$. Since $\pi$ and $ V$ are dilations of $\phi$ and $T$ and $\mathcal{H}$ is co-invariant for $V$, projecting to the corner of $\mathcal{H}$ obtains $\phi_F(a)$, which is thus completely positive. \end{proof} \begin{remark} In the special case when $\mathcal{A}=\mathbb{C}$, a unital completely positive map $\phi$ on $\mathcal{A}$ is uniquely determined by $\phi(x)=xI$. In this case, condition (2) is reduced to that in Theorem \ref{thm.LCM.Dilation}. \end{remark} One can use a similar technique to obtain a strengthened version of Corollary \ref{cor.QDilation}. \begin{corollary}\label{cor.tensor.QP} Suppose that in addition to the conditions in Theorem~\ref{thm.tensor.dilation}, we also have that, \begin{equation}\label{cor.tensor.QP.eq1} \sum_{U\subseteq F} (-1)^{|U|} T(s_U)\phi(\beta_{s_U}^{-1}(a))T(s_U)^* =0 \end{equation} for every (finite) foundation set $F\subset P$. Let $V$ be the resulting dilation from Theorem \ref{thm.tensor.dilation}. Then \begin{equation}\label{cor.tensor.QP.eq2} \sum_{U\subseteq F} (-1)^{|U|} V(s_U)\pi(\beta_{s_U}^{-1}(a))V(s_U)^* =0 \end{equation} for every (finite) foundation set $F\subset P$. \end{corollary} \begin{proof} Notice first that the kernel of the quotient $C(\Omega_P)\otimes \mathcal{A} \to C(\partial \Omega_P)\otimes \mathcal{A}$ is the ideal generated by $E\otimes a$ where the projection $E$ is associated to a foundation set. Hence, condition \pref{cor.tensor.QP.eq1} ensures that the map $\tilde \phi$ from the pair $(\tilde{\phi},T)$ obtained in Proposition \ref{prop.tensor.UCP} factors through this quotient. This gives a pair $(\dot{\tilde{\phi}}, T)$ for the LCM system on the quotient $\dot{\tilde \mathcal{A}}: =C(\partial \Omega_P)\otimes \mathcal{A}$. The equivalent conditions in Theorem~\ref{thm.tensor.dilation} ensure that $\tilde{\phi}$ is completely positive and hence so is $\dot{\tilde{\phi}}$. Therefore, we can dilate $(\dot{\tilde{\phi}},T)$ to an isometric covariant representation $(\rho,V)$ of the $\dot{\tilde \mathcal{A}} $ system. Letting $\pi(a) := \rho(I\otimes a)$ for $a \in \mathcal{A}$ gives a pair $(\pi,V)$ satisfying the required equation \eqref{cor.tensor.QP.eq2}. \end{proof} \subsection{Examples from $\mathbb{F}_k^+$} \begin{example}\label{ex.dilation.Fk} Let us consider the case when $P=\mathbb{F}_2^+$. Suppose $\mathcal{A}$ is any unital $\mathrm{C}^*$-algebra with a unital completely positive map $\phi:\mathcal{A}\to\bh{H}$ and two $\ast$-automorphisms $\beta_1,\beta_2$. Suppose that $T_1,T_2\in\bh{H}$ are two contractions such that for all $a\in A$, \[\phi(a) = T_1 \phi(\beta_1^{-1}(a)) T_1^* + T_2 \phi(\beta_2^{-1}(a)) T_2^* \] We would like to claim that $\tcb{(\phi, T)}$ can be dilated to a $\ast$-homomorphism $\pi:\mathcal{A}\to\bh{K}$ and isometries $V_1,V_2\in\bh{K}$ such that \[\pi(a) = V_1 \pi(\beta_1^{-1}(a)) V_1^* + V_2 \pi(\beta_2^{-1}(a)) V_2^*\] We first build $C(\partial \Omega_P)\otimes \mathcal{A}$ as an inductive limit of the following system: let $\mathcal{A}_1=\mathcal{A}$, and $\mathcal{A}_{n+1} = \mathcal{A}_n \oplus \mathcal{A}_n$ with connecting map $\varphi_n:\mathcal{A}_n \to \mathcal{A}_{n+1}$ by $\varphi_n(a)=a\oplus a$. One can verify that the inductive limit $\widetilde{\mathcal{A}}\cong C(X)\otimes \mathcal{A}$, where $X$ is the Cantor set. Define two $\ast$-endomorphisms $\alpha_1, \alpha_2$ on $\widetilde{\mathcal{A}}$ by $\alpha_1(a)=\beta_1(a)\oplus 0$ and $\alpha_2(a)=0\oplus \beta_2(a)$ for $a\in \mathcal{A}_n$. This extends to an $\mathbb{F}_2^+$-action on $\widetilde{\mathcal{A}}$, by sending generator $e_i$ to $\alpha_i$, $i=1,2$. By Proposition \ref{prop.LCM.N}, the resulting dynamical system is a right LCM dynamical system since ranges of $\alpha_i$ are both ideals in $\widetilde{\mathcal{A}}$ and their ranges are orthogonal to one another. \begin{figure}[h] \centering \begin{tikzpicture} \draw[->] (1.25,0) -- (3.25,0.75); \draw[dashed,->] (1.25,0) -- (3.25,-.75); \draw[->] (3.75,.75) -- (5.75,1.5); \draw[dashed,->] (3.75,.75) -- (5.75,-0.5); \draw[->] (3.75,-.75) -- (5.75,0.5); \draw[dashed, ->] (3.75,-.75) -- (5.75,-1.5); \node at (1,0) {$\mathcal{A}$}; \node at (3.5,.75) {$\mathcal{A}$}; \node at (3.5,-.75){$\mathcal{A}$}; \node at (6,1.5){$\mathcal{A}$}; \node at (6,0.5){$\mathcal{A}$}; \node at (6,-0.5){$\mathcal{A}$}; \node at (6,-1.5){$\mathcal{A}$}; \node at (2, 0.6) {$\alpha_1$}; \node at (2, -0.6) {$\alpha_2$}; \node at (4.5, 0.55) {$\alpha_2$}; \node at (4.5, -0.55) {$\alpha_1$}; \node at (4.5, 1.3) {$\alpha_1$}; \node at (4.5, -1.3) {$\alpha_2$}; \end{tikzpicture} \label{fig:Fk} \end{figure} Let $\phi_1=\phi:\mathcal{A}_1\to\bh{H}$, and recursively define $\phi_{n+1}:\mathcal{A}_{n+1}=\mathcal{A}_n\oplus \mathcal{A}_n\to\bh{H}$ by \[\phi_{n+1}(a\oplus b) = T_1 \phi_n(\beta_1^{-1}(a)) T_1^* + T_2 \phi_n(\beta_2^{-1}(b)) T_2^*.\] Since $\phi_1$ is unital completely positive, the map $a\mapsto T_i \phi(\beta_i^{-1}(a))T_i^*$ is completely positive, $\phi_2$ is also a unital completely positive map. Inductively, each $\phi_n$ is a unital completely positive map. Notice that \begin{align*} \phi_2(\varphi_1(a)) &= \phi_2(a\oplus a) \\ &= T_1 \phi(\beta^{-1}(a)) T_1^* + T_2 \phi(\beta^{-1}(a)) T_2^* \\ &= \phi_1(a), \end{align*} and inductively, $\phi_{n+1}(\varphi_n(a))=\phi_n(a)$. \begin{figure}[h] \centering \begin{tikzpicture} \draw[->] (1.25,-3) -- (3.25,-3); \draw[->] (3.75,-3) -- (5.75,-3); \draw[->] (6.25,-3) -- (8.25,-3); \draw[->] (1,-3.2) -- (1, -4.3); \draw[->] (3.5,-3.2) -- (3.5, -4.3); \draw[->] (6,-3.2) -- (6, -4.3); \draw[->] (1.5,-4.5) -- (3,-4.5); \draw[->] (4,-4.5) -- (5.5,-4.5); \draw[->] (6.5,-4.5) -- (8.25,-4.5); \node at (1, -3) {$\mathcal{A}_1$}; \node at (3.5, -3) {$\mathcal{A}_2$}; \node at (6, -3) {$\mathcal{A}_3$}; \node at (8.8, -3) {$\cdots$}; \node at (1, -4.5) {$\mathcal{B}(\mathcal{H})$}; \node at (3.5, -4.5) {$\mathcal{B}(\mathcal{H})$}; \node at (6, -4.5) {$\mathcal{B}(\mathcal{H})$}; \node at (8.8, -4.5) {$\cdots$}; \node at (2.25, -2.7) {$\varphi_1$}; \node at (4.75, -2.7) {$\varphi_2$}; \node at (1.7, -3.75) {$\phi_1=\phi$}; \node at (3.75, -3.75) {$\phi_2$}; \node at (6.25, -3.75) {$\phi_3$}; \end{tikzpicture} \label{fig:Fk1} \end{figure} The maps $\phi_n$ can be extended to a unital completely positive map $\widetilde{\phi}$ on the inductive limit $\widetilde{\mathcal{A}}$. Moreover, for each $a\in \mathcal{A}_n$, \[\phi_{n+1}(\alpha_1(a))=\phi_{n+1}(\beta_1(a)\oplus 0)=T_1 \phi_n(a) T_1^*,\] and, \[\phi_{n+1}(\alpha_2(a))=\phi_{n+1}(0\oplus \beta_2(a))=T_2 \phi_n(a) T_2^*.\] We have for all $a\in \widetilde{\mathcal{A}}$, \[\widetilde{\phi}(\alpha_i(a)) = T_i \widetilde{\phi}(a) T_i^*.\] We can view $(T_1,T_2)$ as a contractive representation $T$ of $\mathbb{F}_2^+$ by sending generator $e_i$ to $T_i$. The resulting pair $(\widetilde{\phi},T)$ is a contractive covariant representation of $(\widetilde{\mathcal{A}},\mathbb{F}_2^+, \alpha)$. Therefore, by Theorem \ref{thm.dym.dilation}, it dilates to an isometric covariant representation $(\widetilde{\pi}, V)$ on some Hilbert space $\mathcal{K}\supset\mathcal{H}$. Define $\pi:\mathcal{A}\to\bh{K}$ by $\pi(a)=\widetilde{\pi}(a)$ for all $a\in \mathcal{A}=\mathcal{A}_1\subset\widetilde{\mathcal{A}}$. We have \begin{align*} \pi(a) &= \widetilde{\pi}(a) \\ &= \widetilde{\pi}(a\oplus a) \\ &= \widetilde{\pi}(\alpha_1(\beta_1^{-1}(a))) + \widetilde{\pi}(\alpha_2(\beta_2^{-1}(a))) \\ &= V_1 \widetilde{\pi}(\beta_1^{-1}(a)) V_1^* + V_2 \widetilde{\pi}(\beta_2^{-1}(a)) V_2^* \\ &= V_1 \pi(\beta_1^{-1}(a)) V_1^* + V_2 \pi(\beta_1^{-1}(a)) V_2^*. \end{align*} Therefore, the pair $(\phi,T)$ gets dilated to the pair $(\pi,V)$, and the relation \[\phi(a)=T_1\phi(\beta_1^{-1}(a))T_1^*+T_2\phi(\beta_1^{-1}(a))T_2^*,\] is preserved as \[\pi(a)=V_1\pi(\beta_1^{-1}(a))V_1^* + V_2\pi(\beta_1^{-1}(a))V_2^*.\] One should also notice that by setting $a=I$, one gets $V_1V_1^*+V_2V_2^*=I$. Therefore $V_1$ and $V_2$ have orthogonal ranges. \end{example} One can easily generalize Example \ref{ex.dilation.Fk} to $\mathbb{F}_k^+$ and obtain the following corollary. \begin{corollary}\label{cor.dilation.Fk} Let $\phi:\mathcal{A}\to\bh{H}$ be a unital completely positive map on a unital $\mathrm{C}^*$-algebra $\mathcal{A}$. Let $\beta_1,\cdots,\beta_n$ be $\ast$-automorphisms of $\mathcal{A}$. Suppose that $T_1,\cdots,T_k\in\bh{H}$ are contractions such that for any $a\in \mathcal{A}$, \[\phi(a) = \sum_{i=1}^k T_i \phi(\beta_i^{-1}(a)) T_i^*.\] Then there exists a $\ast$-homomorphism $\pi:\mathcal{A}\to\bh{K}$ on a Hilbert space $\mathcal{K}\supset\mathcal{H}$ and isometries $V_1,\cdots,V_k\in\bh{K}$ with orthogonal ranges, such that \[\pi(a) = \sum_{i=1}^k V_i \pi(\beta_i^{-1}(a)) V_i^*\] and $\pi, V$ are dilations of $\phi, T$, and $\mathcal{H}$ is co-invariant for $V$. \end{corollary} \begin{example} Let $\phi:\mathbb{C}\to\bh{H}$ by $\phi(x)=xI$ and $\beta_i$ be identity on $\mathcal{A}$. Let $T_1,\cdots, T_k\in\bh{H}$ such that $\sum_{i=1}^k T_i T_i^*=I$. Then it is clear that \[\phi(x) = \sum_{i=1}^k T_i \phi(x) T_i^*.\] Corollary \ref{cor.dilation.Fk} implies that we can dilate $(\phi, T)$ to a $\ast$-homomorphism $\pi:\mathbb{C}\to\bh{K}$ and isometries $V_1,\cdots,V_k\in\bh{K}$ with orthogonal ranges, and \[\pi(x)=\sum_{i=1}^k V_i \pi(x) V_i^*.\] But $\pi(x)=xI$ is the only choice for $\pi$, and thus $\sum_{i=1}^k V_i V_i^*=I$. This is precisely Popescu's dilation of row contractions. \end{example} \begin{example} Let $\phi:M_k\to M_k$ be the map $\phi(E_{i,j})=\delta_{i,j}E_{i,j}$. In other words, $\phi$ maps a matrix $A$ to its diagonal. One can easily verify that $\phi$ is unital completely positive map but $\phi$ is not multiplicative for any $k\geq 2$. Let $\beta_i$ be the identity map on $M_k$ for each $i$, and define $T_i=E_{i,1}$. Then for each $A\in M_k$, $\phi(A)=\diag(A_{11},\cdots, A_{kk})$, and one can check that \[\phi(A)=\sum_{i=1}^k T_i \phi(A) T_i^*.\] Corollary \ref{cor.dilation.Fk} implies that we can dilate $\tcb{(\phi, T_i)}$ into a $\ast$-homomorphism $\pi: M_k\to\bh{K}$ and isometries $V_i$ with orthogonal ranges, such that for each $A\in M_k$, \[\pi(A)=\sum_{i=1}^k V_i \pi(A) V_i^*.\] \end{example} \begin{example} Let $X$ be a compact Hausdorff space and $\mu$ be a probability measure on $X$. One can define a unital completely positive map $\phi: C(X)\to\mathbb{C}$ by $\phi(f)=\int_X fd\mu$. Pick $t_1,\cdots, t_k\in\mathbb{C}$ such that $\sum_{i=1}^k |t_i|^2=1$, and thus \[\phi(f) =\sum_{i=1}^k t_i \phi(f) \overline{t_i}.\] Corollary \ref{cor.dilation.Fk} implies that there exists a $\ast$-homomorphism $\pi:C(X)\to\bh{K}$ and isometries $V_1,\cdots,V_k\in\bh{K}$ with orthogonal ranges. Here, $\mathcal{K}=\mathbb{C}\oplus \mathcal{K}_1$ and with respect to such decomposition, \[\pi(f) = \begin{bmatrix} \int_X f(x) d\mu & * \\ * & * \end{bmatrix},\] and, \[V_i = \begin{bmatrix} t_i & 0 \\ * & * \end{bmatrix}.\] Moreover, for each $f\in C(X)$, \[\pi(f) = \sum_{i=1}^k V_i \pi(f) V_i^*.\] \end{example}
\section{Introduction} \begin{comment} [Some of this material will probably be moved to the introduction.] There is now broad consensus that the $\Lambda$CDM\ model provides the best current fit to all the available cosmological data [cite]. Some groups [\cite{Ryan_1, Ryan_2, Cao_Ryan_Ratra, Cao_Ryan_Khadka_Ratra} others?] have found evidence of small departures from the $\Lambda$CDM\ model (such as dynamical dark energy or large-scale spatial curvature), in the available data, but these findings have generally not been significant enough to dethrone $\Lambda$CDM\ from its position as the ``Standard Model of Cosmology''. The power law model is no exception [to this]. Early investigations of this model found that it can describe some [combinations][sets] of data better than $\Lambda$CDM\ [cite]. These studies, however, typically used limited data sets, or data combinations consisting entirely of measurements of a single kind (fitting the power law model to standard candle data only, for example). My findings are [not inconsistent] with the findings of earlier studies; when the power law model is fitted to GRB data, it provides a slightly better fit to those data than does the $\Lambda$CDM\ model. However, all of the other data sets I examined favor the $\Lambda$CDM\ model over the power law model. When these independent sets (consisting of cosmic chronometer, standard ruler, and standard candle) of data are combined, the $\Lambda$CDM\ model is clearly favored over the power law model. It has already been shown that primordial nucleosynthesis sets a severe constraint on the power law model [cite], and that the power law model can not describe the dynamics of the Universe during both the nucleosynthesis and the matter-dominated eras.\footnote{[During the nucleosynthesis era, the data favor $\beta = ...$, whereas during the matter-dominated era, the data favor $\beta = ...$. These are clearly disjoint values, and they cannot be reconciled without introducing extra complexity to the power law model (such as the addition of a mechanism that forces $\beta$ to change is value drastically between the two eras). Given that the power law model is intended to be a simpler alternative to the $\Lambda$CDM\ model, such additional complexity appears unjustified. But see \cite{Gumjudpai}]} [Defenders of the power law model] could argue that the Universe only undergoes power law expansion at late times; by limiting the scope of the power law model, they can plausibly argue that the constraints set by primordial nucleosynthesis on the parameter[s] of this model can be avoided. I [believe] I have shown, in this paper, that such a [defense] can not be sustained, because the power law model also does not fit several independent sets of low redshift data as well as the $\Lambda$CDM\ model fits these data. \end{comment} \begin{comment} [[This was originally in Sec. 4. Maybe it belongs in the intro somewhere?][You know, I don't think I need this. I can find other ways of making similar points elsewhere. Maybe mention this in the intro. Probably best to hold off until you've read all of the background papers.]Of the many studies which have investigated the power law model, most have only sought to constrain the parameters of this model, without comparing the quality of the model fit to that of the standard $\Lambda$CDM\ model (or any other model). I am only aware of two studies \cite{Shafer_2016, Tutusaus_et_al_2016} that ] \end{comment} There is now broad consensus that the $\Lambda$CDM\ model \begin{comment} is sufficient to describe \end{comment} adequately describes the dynamics of the Universe, on large scales, throughout most of its history \cite{Planck_overview}. Some groups \cite{Cao_Ryan_Khadka_Ratra, Cao_Ryan_Ratra, Ryan_2, Ryan_1, Ooba_Ratra_Sugiyama_2017_NFLCDM, Park_Ratra_2018_FLCDM, Ooba_Ratra_Sugiyama_2017_NFpCDM, Ooba_Ratra_Sugiyama_2017_NFXCDM, Park_Ratra_2018_FXCDM_NFXCDM, Park_Ratra_2018_FpCDM_NFpCDM, Ooba_Ratra_Sugiyama_2018_FpCDM, zhang_et_al_2017a, wang_pogosian_zhao_zucca_2018, zhang_lee_geng_2018, Handley_2019, Di_Valentino_et_al_2020, Luo_et_al_2020} have found evidence of departures from the $\Lambda$CDM\ model (such as dynamical dark energy or large-scale spatial curvature), but these findings have generally not risen to the level of significance necessary to unseat $\Lambda$CDM\ from its position as the standard model of cosmology.\footnote{The evidence of large-scale spatial curvature, in particular, has recently been challenged by an analysis of Hubble parameter data \cite{Vagnozzi_et_al_2021}.} Instead of introducing alternative cosmological models, a more direct way to look for cracks in the standard model is to constrain the form of the scale factor, $a(t)$, independently of a specific model, using observational data. \begin{comment} More radical alternatives to the standard model are conceivable, however, and they make definite, testable predictions for the form that the scale factor $a(t)$ takes as a function of cosmic time $t$. It is therefore of some interest to use observational data to place constraints directly on the scale factor, rather than constraining the parameters of alternative cosmological models, models which may or may not be more complex than $\Lambda$CDM. [One way to arrive at these alternatives is to use observational data to directly constrain the form of the scale factor, $a(t)$, as a function of cosmic time $t$ [Another approach to testing the expansion history of the universe is to directly constrain the scale factor, $a(t)$, as a function of cosmic time $t$, instead of searching for departures from $\Lambda$CDM\ by introducing more complex models (that is, models having more free parameters than $\Lambda$CDM).] [There is a broad class of such models/theories [There are several such models/theories ...] in which the scale factor takes the form of a power law $a(t) \propto t^{\beta}$ with a constant exponent $\beta$. \end{comment} The $\Lambda$CDM\ model makes a definite, testable prediction of the scale factor's evolution with cosmic time $t$, and while this evolution appears to be in good agreement with the available data, one could ask whether a simpler expansion history may describe these data equally well or better. For example, one could propose that the scale factor take a power law form $a(t) \propto t^{\beta}$, where $\beta$ is a constant exponent. This ansatz has many virtues, one of which is its simplicity. Power law expansion only depends on the single parameter $\beta$, and the functional form $t^{\beta}$ is easy to integrate analytically when it appears in the integral $\int \frac{dt}{a(t)}$ (as in the computation of the co-moving distance scale). Additionally, power law expansion with $\beta \geq 1$ has neither a horizon problem nor a flatness problem, and produces a universe whose age is compatible with the ages of the oldest known objects in the Universe (these being globular clusters and high-redshift galaxies \cite{Dev_Jain_Lohiya_2008, Sethi_Dev_Jain_2005}). \begin{comment} One such alternative is the power law model, in which the scale factor takes the form of a power law $a(t) \propto t^{\beta}$ with a constant exponent $\beta$. One of the virtues of this model is its simplicity: it only depends on the single parameter $\beta$, and the functional form $t^{\beta}$ is easy to integrate analytically when it appears in the form $\int \frac{dt}{a(t)}$ (as in the computation of the co-moving distance scale). Additionally, the power law model with $\beta \geq 1$ does not suffer from the horizon or flatness problems, and produces a universe whose age is compatible with the ages of the oldest known objects in the Universe (these being globular clusters and high-reshift galaxies) \cite{Dev_Jain_Lohiya_2008, Sethi_Dev_Jain_2005}. \end{comment} Power law expansion is also a predicted feature of some alternative gravity theories that are designed to solve the cosmological constant problem \cite{Dev_Jain_Lohiya_2008, Sethi_Dev_Jain_2005}. Many investigators have found that $\beta \approx 1$ is favored by various independent low-redshift probes, such as cosmic chronometers ($H(z)$) \cite{Dev_Jain_Lohiya_2008}, gravitational lensing statistics \cite{Dev_Safonova_Deepak_Lohiya_2002}, Type Ia supernovae (SNe Ia) \cite{Dev_Sethi_Lohiya_2001, Kumar_2012, Rani_et_al_2015, Sethi_Dev_Jain_2005}, baryon acoustic oscillations (BAO) \cite{Shafer_2016, Tutusaus_et_al_2016}, quasar angular sizes (QSO) \cite{Jain_Dev_Alcaniz_2003}, galaxy cluster gas mass fractions \cite{Zhu_Alcaniz_Liu_2008}, and the combination of $H(z)$ + BAO + SNe Ia + gamma-ray burst distance moduli (GRB) \cite{Haridasu_AAP_2017}. Other data sets, however, favor $\beta \approx$ 1.2-1.6 \cite{Dev_Jain_Lohiya_2008, Dolgov_Halenka_Tkachev_2014, Kumar_2012, Shafer_2016, Tutusaus_et_al_2016}; see Table \ref{tab:beta_fits}. \begin{comment} Several investigators have claimed that the power law model with $\beta \approx 1$ provides a good fit to several kinds of low redshift data such as cosmic chronometer ($H(z)$) \cite{Dev_Jain_Lohiya_2008}, gravitational lensing statistics \cite{Dev_Safonova_Deepak_Lohiya_2002}, Type Ia supernova (SN Ia) \cite{Dev_Sethi_Lohiya_2001, Kumar_2012, Rani_et_al_2015, Sethi_Dev_Jain_2005}, baryon acoustic oscillation (BAO) \cite{Shafer_2016, Tutusaus_et_al_2016}, quasar angular size (QSO) \cite{Jain_Dev_Alcaniz_2003}, and cluster gas mass fraction data \cite{Zhu_Alcaniz_Liu_2008} (though other data sets favor $\beta \approx$ 1.2-1.6 \cite{Dev_Jain_Lohiya_2008, Dolgov_Halenka_Tkachev_2014, Kumar_2012, Shafer_2016, Tutusaus_et_al_2016}). See Table \ref{tab:beta_fits}. \end{comment} \begin{comment} Some studies have also found that power law expansion with $\beta = 1$ can explain the observed abundances of [certain] elements \cite{Lohiya_Batra_Mahajan_Mukherjee_1999, Sethi_Batra_Lohiya_1999}, and can thus account for primordial nucleosynthesis. These conclusions have been challenged by other studies, which find that the observed abundances of [helium, deuterium, lithium...] set a severe constraint on the value of $\beta$ within the power law model, requiring $\beta \approx$ 0.55-0.58 \cite{Kaplinghat_Steigman_Tkachev_1999, Kaplinghat_Steigman_Walker_2000, Kumar_2012}. \end{comment} Some studies have also found that power law expansion with $\beta = 1$ can produce the right amount of primordial helium to match current observations \cite{Lohiya_Batra_Mahajan_Mukherjee_1999, Sethi_Batra_Lohiya_1999}, and so may be able to account for the synthesis of other light elements. These conclusions are challenged by the results of other studies, which find that $\beta \approx$ 0.55-0.58 is required to produce the right abundances \cite{Kaplinghat_Steigman_Walker_2000, Kaplinghat_Steigman_Tkachev_1999, Kumar_2012}. If these latter studies are correct, then the values of $\beta$ favored by primordial nucleosynthesis are clearly disjoint with those favored by low redshift measurements, and it is difficult to see how they can be reconciled without introducing extra complexity to the power law ansatz (such as the addition of a mechanism that forces $\beta$ to change its value between the two eras; see e.g. \cite{Gumjudpai, Gumjudpai_Thepsuriya_2012, Kaeonikhom_Gumjudpai_Saridakis_2011, Rangdee_Gumjudpai_2014, Wei_2004}).\footnote{For recent efforts to provide an account of primordial nucleosynthesis within a power law ansatz, see \cite{Singh_Lohiya_2015_arXiv, Singh_Lohiya_2015_JCAP}.} Given that power law expansion (whatever underlying cosmological model may be required to produce it) is intended to offer a simpler alternative to the expansion history predicted by the $\Lambda$CDM\ model, such additional complexity seems unjustified, and the power law ansatz with constant $\beta$ appears to be ruled out on these grounds. \begin{comment} Studies of the power law model during the nucleosynthesis era, however, paint a different picture. Several researchers have found that elemental abundance data favor $\beta \approx$ 0.55-0.58 \cite{Kaplinghat_Steigman_Tkachev_1999, Kaplinghat_Steigman_Walker_2000, Kumar_2012}, in striking contrast to those values favored by low redshift measurements, listed in Table \ref{tab:beta_fits}. These are clearly disjoint values, and it is difficult to see how they can be reconciled without introducing extra complexity to the power law model (such as the addition of a mechanism that forces $\beta$ to change its value between the two eras; see e.g. \cite{Gumjudpai, Gumjudpai_Thepsuriya_2012, Kaeonikhom_Gumjudpai_Saridakis_2011, Rangdee_Gumjudpai_2014, Wei_2004}). Given that the power law model is intended to be a simpler alternative to the $\Lambda$CDM\ model, such additional complexity seems unjustified. Other studies [cite] find that a coasting cosmology with $\beta \approx 1$ can correctly reproduce observed elemental abundances, but these appear to have been rebutted by [cite]. \end{comment} \begin{comment} It has also been shown that the requirements of primordial nucleosynthesis set a severe constraint on the power law model [cite], and that a power law model with a constant $\beta$ can not describe the dynamics of the Universe during both the nucleosynthesis and the present eras. \end{comment} \begin{comment} \footnote{During the nucleosynthesis era, the data favor $\beta \approx$ 0.55-0.58 \cite{Kaplinghat_Steigman_Walker_2000, Kaplinghat_Steigman_Tkachev_1999, Kumar_2012}, whereas during late times, low redshift data favor $\beta \approx$ 1-1.5 (see Table \ref{tab:beta_fits}). These are clearly disjoint values, and they cannot be reconciled without introducing extra complexity to the power law model (such as the addition of a mechanism that forces $\beta$ to change its value between the two eras; see e.g. \cite{Gumjudpai, Gumjudpai_Thepsuriya_2012, Kaeonikhom_Gumjudpai_Saridakis_2011, Rangdee_Gumjudpai_2014, Wei_2004}). Given that the power law model is intended to be a simpler alternative to the $\Lambda$CDM\ model, such additional complexity seems unjustified. Other studies [cite] find that a coasting cosmology with $\beta \approx 1$ can correctly reproduce observed elemental abundances, but these appear to have been rebutted by [cite].} \end{comment} \begin{comment} or that [variations on this model] can explain observed elemental abundances as well as [or better than] $\Lambda$CDM\ [cite] \end{comment} \begin{table*} \centering \caption{Fits to power law exponent from other low redshift measurements.} \begin{tabular}{ccc} \hline \hline Reference & $\beta$ & Data type(s) used \\ \hline \cite{Dev_Jain_Lohiya_2008} & $1.07^{+0.11}_{-0.08}$ & $H(z)$\\ & $1.42^{+0.08}_{-0.07}$ & SN Ia\\ \cite{Dev_Safonova_Deepak_Lohiya_2002} & $1.09\pm0.3$ & Gravitational lensing statistics\\ & $1.13^{+0.4}_{-0.3}$ & \\ \cite{Dev_Sethi_Lohiya_2001} & $1.004\pm0.043$ & SN Ia\\ \cite{Dolgov_Halenka_Tkachev_2014} & $1.52 \pm 0.15$ & SN Ia\\ & $1.55 \pm 0.13$ & \\ & $1.3$ & BAO\\ \cite{Jain_Dev_Alcaniz_2003} & $1.0\pm0.3$ & QSO\\ \cite{Kumar_2012} & $1.22_{-0.16}^{+0.21}$ & $H(z)$\\ & $1.61_{-0.12}^{+0.14}$ & SN Ia\\ \cite{Rani_et_al_2015} & $1.05_{-0.066}^{+0.071}$ & $H(z)$\\ & $1.44^{+0.26}_{-0.18}$ & SN Ia\\ \cite{Sethi_Dev_Jain_2005} & $1.04^{+0.07}_{-0.06}$ & SN Ia\\ \cite{Shafer_2016} & $0.93$ & BAO\\ & $1.44$-$1.56$ & SN Ia\\ \cite{Tutusaus_et_al_2016} & $0.908\pm0.019$ & BAO\\ & $1.55\pm0.13$ & SN Ia\\ \cite{Zhu_Alcaniz_Liu_2008} & $1.14\pm0.05$ & Galaxy cluster gas mass fraction\\ \cite{Haridasu_AAP_2017} & $1.08 \pm 0.04$ & $H(z)$ + BAO + SNe Ia + GRB\\ \hline \hline \end{tabular} \label{tab:beta_fits} \end{table*} \begin{comment} Table caption: [check these against Table 2 in \cite{Dev_Jain_Lohiya_2008} and other tables in other papers.] \end{comment} \begin{comment} \cite{Gumjudpai} & & $H(z)$, BAO, SNe Ia, QSO ages, cluster gas mass fraction\\ \cite{Rangdee_Gumjudpai_2014} & & BAO, SNe Ia, $H_0$\\ \cite{Kaeonikhom_Gumjudpai_Saridakis_2011} & & BAO, $H_0$\\ \end{comment} \begin{comment} [supernova data [add \cite{Dev_Sethi_Lohiya_2001} after you've read it] [lensing statistics; add \cite{Dev_Safonova_Deepak_Lohiya_2002} you've finished reading it] certain combinations of cosmological data [GIVE NUMBERS (make table?)] \cite{Zhu_Alcaniz_Liu_2008}, \cite{Sethi_Dev_Jain_2005}, maybe also \cite{Dolgov_Halenka_Tkachev_2014} [are you sure that this is what Zhu et al claim?][Power law with $\beta \approx 1$ fits older QSO data \cite{Jain_Dev_Alcaniz_2003}[others] \end{comment} \begin{comment} [Regarding Kaplinghat et al 1999, see 'Comment on "Observational constraints on power-law cosmologies"', and also see "Pouring cold water", which I believe rebuts "Comment" (maybe Kumar MNRAS does, too, and maybe also look at Sethi Dev Jain 2005 PLB).] \end{comment} A defender of power law expansion who does not wish to make the expansion history more complex by introducing a time-variable $\beta$ could attempt to save it by arguing that: 1.) The findings of \cite{Kaplinghat_Steigman_Walker_2000, Kaplinghat_Steigman_Tkachev_1999, Kumar_2012} are simply incorrect, and the power law exponent has the value $\beta \approx 1$ during both the nucleosynthesis era and the present era, or 2.) The Universe only undergoes power law expansion at late times, and the power law ansatz with $\beta \approx 1$ adequately describes low redshift observations only. The latter option is, on its face, plausible. After all, the standard $\Lambda$CDM\ model holds that the Universe follows power law expansion during both the matter-dominated and radiation-dominated eras, so it might be reasonable to limit the scope of the power law ansatz by suggesting that it only applies after the era of nucleosynthesis.\footnote{In \cite{Kolb_1989}, one of the earliest papers on the subject, the author proposes that, if a hypothetical form of matter called ``K-matter'' were to dominate the energy budget at late times, this would lead to a ``coasting'' cosmic expansion with $\beta = 1$ (with $\beta$ taking on different values in earlier eras).} We must be careful not to push this argument too far, however, because any scale factor $a(t)$ can presumably be approximated by a power law over some arbitrarily short time period. What is at issue is not whether the Universe follows power law expansion during some (relatively) brief portion or portions of its history, but whether it follows power law expansion throughout all (or most) of its history. If it can be shown that the power law ansatz fits low redshift observational data as well as or better than $\Lambda$CDM\ over an appreciable range of redshifts, then option (2) is validated (and option 1 may be validated as well, if one can marshal a strong argument against the findings of \cite{Kaplinghat_Steigman_Walker_2000, Kaplinghat_Steigman_Tkachev_1999, Kumar_2012}). If, on the other hand, the power law model fails to provide a good fit to the available low redshift data, then both (1) and (2) are falsified. \begin{comment} Both of these options can be falsified by testing the power law model against low redshift data, because if (1.) is correct (and if the power law exponent is assumed not to vary in time), then $\beta$ will have the same value during the era of nucleosynthesis that it has now \end{comment} \begin{comment} [Defenders of the power law model] could argue that the Universe only undergoes power law expansion at late times; by limiting the scope of the power law model, they can plausibly argue that the constraints set by primordial nucleosynthesis on the parameter[s] of this model can be avoided. [This is not a controversial move. After all, it is well-known that the scale factor can be approximated by a power law during the eras of radiation domination and matter domination. The question that I seek to answer in this paper is whether or not the power law model is a good description in the present, $\Lambda$-dominated era. [Be careful with this claim. I think $\Lambda$ only takes over around z of about 3/4 (see H(z) plot.]] \end{comment} \begin{comment} While it is true that the power law model can provide an adequate fit to some data, these data tend to be [either limited in number] or of a single kind ([only standard candle data, for example]). It has been shown in the literature, however, that when the power law model is fitted to several independent data sets consisting of different kinds of measurements, [it performs poorly. \cite{Rani_et_al_2015, Shafer_2016, Tutusaus_et_al_2016} [others]. \end{comment} A few studies \cite{Rani_et_al_2015, Shafer_2016, Tutusaus_et_al_2016, Haridasu_AAP_2017} have been conducted along these lines. These studies find that, when power law expansion is tested using multiple independent data sets ($H(z)$ alone and $H(z)$ + BAO + SNe Ia + CMB in \cite{Rani_et_al_2015}, BAO + SNe Ia in \cite{Shafer_2016}, BAO + SNe Ia + CMB in \cite{Tutusaus_et_al_2016}, and $H(z)$ + BAO + SNe Ia + GRB in \cite{Haridasu_AAP_2017}), it performs poorly compared to $\Lambda$CDM. Here I continue in this vein by fitting the expansion histories predicted by the power law ansatz and the $\Lambda$CDM\ model to a data set consisting of cosmic chronometer, standard ruler, and standard candle data, some of which have not yet been used to test power law expansion (see Sec. \ref{sec:Data} for a description of the data). \begin{comment} Here I test this claim by fitting the power law model, along with a fiducial $\Lambda$CDM\ model, to several combinations of cosmic chronometer, standard ruler, and standard candle data, some of which have not previously been used to test the power law model (See Sec. \ref{sec:Data} for a description of the measurements I use). [Only a few papers (\cite{Shafer_2016, Tutusaus_et_al_2016}) have performed model comparison tests of the power law cosmology. Mention this [as a deficiency of earlier studies? That is, several papers that examined PL only fitted beta; they didn't do model comparison so their conclusions aren't very compelling], and connect what they did with what you did]. \end{comment} I use simple model comparison statistics (the same as those used in \cite{Rani_et_al_2015, Shafer_2016, Tutusaus_et_al_2016, Haridasu_AAP_2017}; see Sec. \ref{sec:Methods}) to compare the quality of the fit in both cases. I discuss my results in Sec. \ref{sec:Results} and draw my conclusions in Sec. \ref{sec:Conclusion}. \begin{comment} Early investigations of this model found that it can describe some [combinations][sets] of data better than $\Lambda$CDM\ [cite]. These studies, however, typically used limited data sets, or data combinations consisting entirely of measurements of a single kind (fitting the power law model to standard candle data only, for example). My findings are [not inconsistent] with the findings of earlier studies; when the power law model is fitted to GRB data, it provides a slightly better fit to those data than does the $\Lambda$CDM\ model. However, all of the other data sets I examined favor the $\Lambda$CDM\ model over the power law model. When these independent sets (consisting of cosmic chronometer, standard ruler, and standard candle) of data are combined, the $\Lambda$CDM\ model is clearly favored over the power law model. It has already been shown that primordial nucleosynthesis sets a severe constraint on the power law model [cite], and that the power law model can not describe the dynamics of the Universe during both the nucleosynthesis and the matter-dominated eras.\footnote{[During the nucleosynthesis era, the data favor $\beta = ...$, whereas during the matter-dominated era, the data favor $\beta = ...$. These are clearly disjoint values, and they cannot be reconciled without introducing extra complexity to the power law model (such as the addition of a mechanism that forces $\beta$ to change is value drastically between the two eras). Given that the power law model is intended to be a simpler alternative to the $\Lambda$CDM\ model, such additional complexity appears unjustified. []]} [Defenders of the power law model] could argue that the Universe only undergoes power law expansion at late times; by limiting the scope of the power law model, they can plausibly argue that the constraints set by primordial nucleosynthesis on the parameter[s] of this model can be avoided. I [believe] I have shown, in this paper, that such a [defense] can not be sustained, because the power law model also does not fit several independent sets of low redshift data as well as the $\Lambda$CDM\ model fits these data. My results are consistent with, and complementary to, other recent studies which have investigated the fit of the power law model to low redshift data [cite]. These results, along with the constraints set by primordial nucleosynthesis, [strongly disfavor the power law model] [show that the power law model is not a viable alternative to the $\Lambda$CDM\ model.] \end{comment} \section{Theory} Under the power law ansatz, the scale factor $a(t)$ takes the form \begin{equation} \label{eq:a} a(t) = kt^{\beta}, \end{equation} where $k$ and $\beta$ are constants. From the definition of redshift, $\frac{a_0}{a(t)} := 1 + z$ ($a_0$ is the current value of the scale factor and $z$ is the redshift) and eq. (\ref{eq:a}), we can write \begin{equation} \frac{a_0}{kt^{\beta}} = 1 + z, \end{equation} from which it follows that \begin{equation} \label{eq:1/t} \frac{1}{t} = \left[\frac{k}{a_0}\left(1 + z\right)\right]^{1/\beta}. \end{equation} The definition of the Hubble parameter, $H(t) := \frac{\dot{a(t)}}{a(t)}$, with the overdot denoting the time derivative, implies $H(t) = \frac{\beta}{t}$. Therefore eq. (\ref{eq:1/t}) can be written in the form \begin{equation} \label{eq:Hz_PL} H(z) = H_0\left(1 + z\right)^{1/\beta}, \end{equation} where I have defined the present value of the Hubble constant to be $H_0 := \beta\left(\frac{k}{a_0}\right)^{1/\beta}$. The power law ansatz therefore has two free parameters: $H_0$ and $\beta$. My fiducial model in this paper is the spatially flat $\Lambda$CDM\ model. In this model, at late times, the Hubble parameter can be written as a function of the redshift $z$ in the form \begin{equation} \label{eq:Hz_LCDM} H(z) = H_0 \sqrt{\Omega_{m0}\left(1 + z\right)^3 + 1 - \Omega_{m0}}, \end{equation} where $H_0$ is the Hubble constant and $\Omega_{m0}$ is the current value of the non-relativistic matter density. The $\Lambda$CDM\ model also has two free parameters: $H_0$ and $\Omega_{m0}$. Because of the relatively low redshifts of the data I use (see Table \ref{tab:Data}) I neglect the contribution that radiation makes to the energy budget. The data that I use depend on several kinds of distance measurements (see Sec. \ref{sec:Data}). These are the Hubble distance \begin{equation} \label{eq:D_H} D_{\rm H}(z) = \frac{c}{H(z)}, \end{equation} the transverse co-moving distance \begin{equation} \label{eq:D_M} D_{\rm M}(z) = \frac{c}{H_0}\int^z_0 \frac{dz'}{E(z')}, \end{equation} where $E(z) := H(z)/H_0$, the angular diameter distance \begin{equation} \label{eq:D_A} D_{\rm A}(z) = \frac{D_{\rm M}(z)}{1 + z}, \end{equation} the volume-averaged angular diameter distance \begin{equation} \label{eq:D_V} D_{\rm V}(z) = \left[\frac{cz}{H_0}\frac{D_{\rm M}^2(z)}{E(z)}\right]^{1/3}, \end{equation} and the luminosity distance \begin{equation} \label{eq:D_L} D_{\rm L}(z) = (1 + z)D_{\rm M}(z), \end{equation} as defined in \cite{Farooq_thesis, Hogg}. Note that $D_{\rm M}(z)$ only has the form shown in eq. (\ref{eq:D_M}) in the special case that the Universe is spatially flat on large scales, which I assume in this paper; for open and closed universes the integral on the right-hand side is more complicated. \begin{comment} [The transverse co-moving distance is \begin{equation} D_{\rm M}(z) = \begin{cases} D_{\rm C} & \text{if}\ \Omega_{k0} = 0,\\ \vspace{1mm} \frac{c}{H_0\sqrt{\Omega_{k0}}}{\rm sinh}\left[\sqrt{\Omega_{k0}}\frac{D_C H_0}{c}\right] & \text{if}\ \Omega_{k0} > 0, \\ \vspace{1mm} \frac{c}{H_0\sqrt{|\Omega_{k0}|}}{\rm sin}\left[\sqrt{|\Omega_{k0}|}\frac{D_C H_0}{c}\right] & \text{if}\ \Omega_{k0} < 0, \end{cases} \end{equation} where \begin{equation} \label{eq:D_H} D_{\rm H} = \frac{c}{H(z)}, \end{equation} and with $E(z) := H(z)/H_0$. The luminosity distance is defined as \cite{Hogg}] \end{comment} \section{Data} \label{sec:Data} \begin{table*} \centering \caption{Data used in this paper.} \begin{tabular}{ccc} \hline \hline Data type & Number of data points & Redshift range\\ \hline $H(z)$ & 31 & $0.070 \leq z \leq 1.965$ \\ BAO & 11 & $0.38 \leq z \leq 2.334$\\ QSO & 120 & $0.462 \leq z \leq 2.73$\\ GRB & 119 & $0.48 \leq z \leq 8.2$\\ HIIG & 153 & $0.0088 \leq z \leq 2.42935$\\ \hline \hline \end{tabular} \label{tab:Data} \end{table*} In Table \ref{tab:Data} I list the types of measurements I use, the number of measurements of each type, and the redshift ranges within which the measurements lie. The cosmic chronometer data consist of measurements of the Hubble parameter as a function of the redshift $z$ ($H(z)$), taken from \cite{Simon_Verde_Jimenez_2005, Stern_et_al_2010, Moresco_et_al_2012, Zhang_et_al_2014, Moresco_2015, Moresco_et_al_2016, Ratsimbazafy_et_al_2017}, and listed in \cite{Ryan_1}; see that paper for more details. To fit the power law and $\Lambda$CDM\ expansion histories to the cosmic chronometer data, I compute $H(z)$ theoretically using eqs. (\ref{eq:Hz_PL}) and (\ref{eq:Hz_LCDM}). I use two sets of standard ruler measurements in this paper. The first set consists of measurements of the quantities $H(z)$, $D_{\rm H}(z)$, $D_{\rm M}(z)$, $D_{\rm A}(z)$, and $D_{\rm V}(z)$, defined in eqs. (\ref{eq:Hz_PL}-\ref{eq:D_V}), and scaled by the value that the sound horizon $r_{\rm s}$ takes at the baryon drag epoch. These measurements are the same as those listed in Table 1 of \cite{Cao_Ryan_Ratra_2021}. See that paper, as well as \cite{Cao_Ryan_Khadka_Ratra, Cao_Ryan_Ratra, Ryan_2, Ryan_1} for more details, and for references to the original literature. To compute the size of the sound horizon, I use the approximate formula \begin{equation} \label{eq:r_s} r_{\rm s}=55.154\frac{{\rm exp}[-72.3(\Omega_{\nu 0}h^2+0.0006)^2]}{(\Omega_{\rm b 0}h^2)^{0.12807}(\Omega_{m0}h^2 - \Omega_{\nu 0}h^2)^{0.25351}} \hspace{1mm}{\rm Mpc}, \end{equation} where $\Omega_{m0}$, $\Omega_{b0}$, and $\Omega_{\nu 0}$ are the dimensionless energy density parameters of non-relativistic matter, of baryons, and of neutrinos, respectively, and $h := H_0/100$ km s$^{-1}$ Mpc$^{-1}$ \cite{Aubourg_et_al_2015}. Following \cite{Carter_2018}, I set $\Omega_{\nu 0} = 0.0014$, which leaves two additional free parameters ($\Omega_{m0}$ and $\Omega_{b0}h^2$) when power law expansion is fitted to data combinations containing BAO data, and one additional free parameter ($\Omega_{b0}h^2$) when the $\Lambda$CDM\ model is fitted to the same data combinations. The second set of standard ruler data consists of measurements of the angular sizes $\theta_{\rm obs}$, in milliarcseconds (mas), of intermediate-luminosity quasars (QSO). The angular size of a quasar can be computed theoretically via \begin{equation} \label{eq:th_th} \theta_{\rm th}(z) = \frac{l_{\rm m}}{D_{\rm A}(z)}, \end{equation} where $D_{\rm A}(z)$ is given by eq. (\ref{eq:D_A}) and $l_{\rm m} = 11.03 \pm 0.25$ pc is the characteristic linear size of the quasars in the sample. This quantity can then be compared to $\theta_{\rm obs}$ to determine the quality of the fit of the given expansion history to the QSO data. The QSO angular size measurements are listed, and $l_{\rm m}$ is determined, in \cite{Cao_et_al2017b}; see that paper and \cite{Ryan_2} for discussion and details. \begin{comment} [\footnote{Specifically, $l_m$ is the radius at which the jets of the QSOs tend to become opaque (when observed at frequency $f \sim 2$ GHz; see Ref. \cite{Cao_et_al2017b}).}] \end{comment} I use two sets of standard candle data in this paper. The first set consists of measurements of the luminosities, fluxes, and velocity dispersions of HII starburst galaxies (HIIG), from which the distance moduli of these galaxies can be computed. The HIIG data consist of a low redshift ($0.0088 \leq z \leq 0.16417$) set of 107 measurements from \cite{Chavez_2014}, plus a high redshift ($0.636427 \leq z \leq 2.42935$) set of 46 measurements from \cite{G-M_2019}. Subsets of these data, which were generously provided to me by Ana Luisa Gonz\'{a}lez-Mor\'{a}n,\footnote{Private communications, 2019 and 2020.} have been used in several studies to constrain cosmological parameters \cite{Cao_Ryan_Ratra, Cao_Ryan_Ratra_2021, Cao_Ryan_Khadka_Ratra, Chavez_2012, Chavez_2016, G-M_2019, Terlevich_2015}. See \cite{Cao_Ryan_Ratra} for a detailed description of how the distance modulus can be computed. Briefly, if one knows the luminosity $L$, flux $f$, and velocity dispersion $\sigma$ of an HII galaxy, one can use these quantities to compute a distance modulus $\mu_{\rm obs}$. This quantity can then be compared to the theoretical distance modulus \begin{equation} \label{eq:mu_theo} \mu_{\rm th} = 5{\rm log}D_{\rm L}(z) + 25, \end{equation} where $D_{\rm L}(z)$ is given by eq. (\ref{eq:D_L}), to determine the quality of the fit of the given expansion history to the data. The second set of standard candle data consists of measurements of the bolometric fluence $S_{\rm bolo}$ and observed peak energy $E_{\rm p, obs}$ of 119 gamma-ray bursts from \cite{Dirirsa_2019} (GRB). Given a knowledge of the bolometric fluence of a source, one can compute the energy radiated isotropically in the source's rest frame \begin{equation} \label{eq:E_iso} E_{\rm iso} = \frac{4\pi D_{\rm L}^2}{1 + z}S_{\rm bolo}. \end{equation} GRBs can be standardized through the Amati relation \cite{Amati_2009, Amati_2008} \begin{equation} \label{eq:Amati} {\rm log} E_{\rm iso} = a + b{\rm log}\left[\left(1 + z\right)E_{\rm p, obs}\right], \end{equation} which connects the observed peak energy of a given GRB to its isotropic radiated energy (here $a$ and $b$ are free parameters which I vary when fitting the power law and $\Lambda$CDM\ expansion histories to the GRB data). The GRB likelihood function also contains a parameter which describes the extrinsic scatter of the GRBs in the sample ($\sigma_{\rm ext}$) \cite{D'Agostini_2005}. As in \cite{Cao_Ryan_Khadka_Ratra}, I vary this parameter freely when fitting the power law and $\Lambda$CDM\ expansion histories to the GRB data. By comparing the value of ${\rm log} E_{\rm iso}$ as computed from eq. (\ref{eq:E_iso}) to that computed from eq. (\ref{eq:Amati}), one can determine the quality of the ansatz or model fit. For more details about the GRB analysis, see \cite{Cao_Ryan_Khadka_Ratra, Khadka_Ratra_2020}. \begin{comment} [which can be used to compute their distance moduli in the following way]: \begin{equation} \label{eq:mu_obs} \mu_{\rm obs} = 2.5\log L - 2.5\log f - 100.2, \end{equation} where $L$ is the luminosity of the galaxy [in units of], and $f$ is its flux [in units of] (see \cite{G-M_2019, Terlevich_2015}). It turns out that the luminosity of an HII galaxy is correlated with its velocity dispersion, so that \begin{equation} \label{eq:logL} \log L = b\log \sigma + a, \end{equation} (see \cite{Terlevich_2015}). In this paper I use the values \begin{equation} \label{eq:Gordon_b} b = 5.022 \pm 0.058, \end{equation} and \begin{equation} \label{eq:Gordon_a} a = 33.268 \pm 0.083, \end{equation} which are the same as those used in \cite{Cao_Ryan_Khadka_Ratra, Cao_Ryan_Ratra}. To compare [models], eq. \ref{eq:mu_obs} can be compared to the theoretical distance modulus \begin{equation} \label{eq:mu_th} \mu_{\rm th}\left(\textbf{p}, z\right) = 5\log D_{L}\left(\textbf{p}, z\right) + 25, \end{equation} \end{comment} \begin{comment} [The isotropic radiated energy $E_{\rm iso}$ of a source in its rest frame at a luminosity distance $D_L$ is \begin{equation} \label{Eiso} E_{\rm iso}=\frac{4\pi D_L^2}{1+z}S_{\rm bolo}, \end{equation} where $S_{\rm bolo}$ is the bolometric fluence, and $D_L$ (defined below) depends on $z$ and on the parameters of our cosmological models. $E_{\rm iso}$ is connected to the source's peak energy output $E_{\rm p}$ via the Amati relation \cite{Amati_2008, Amati_2009} \begin{equation} \label{eq:Amati} \log E_{\rm iso} = a + b\log E_{\rm p}, \end{equation} where $a$ and $b$ are free parameters that we vary in our model fits.\footnote{$\log=\log_{10}$ is implied hereinafter.} Note here that the peak energy $E_{\rm p} = (1+z)E_{\rm p, obs}$ where $E_{\rm p, obs}$ is the observed peak energy.] \end{comment} \begin{comment} I use $H(z)$, BAO, QSO, HIIG, and GRB. to obtain constraints on the parameters of the power-law model. This data set is the same as that used recently in Ref. \cite{Cao_Ryan_Khadka_Ratra}. The number of data points I use, along with redshift ranges of each of the data types, can be found in Table \ref{tab:Data}. The $H(z)$ data are compiled in \cite{Ryan_1}, the BAO data are compiled in [cite], the QSO data are compiled in [cite], the HIIG data are compiled in [cite], and the GRB data are compiled in [cite]. See those papers, along with \cite{Cao_Ryan_Khadka_Ratra} [others of mine?] for descriptions of how these measurements are obtained and of their associated systematic uncertainties [do I want to say anything about this here?] \end{comment} There is some overlap between the cosmic chronometer data I use in this paper and those that were used in \cite{Dev_Jain_Lohiya_2008, Kumar_2012, Rani_et_al_2015} to constrain the parameters of simple (constant $\beta$) power law expansion. Many of the measurements these authors used are the same as mine, although I use a larger, more up-to-date set (which is the same as the set of $H(z)$ data used to constrain the simple power law ansatz in \cite{Haridasu_AAP_2017}, though I add one point from \cite{Ratsimbazafy_et_al_2017}). I use a different sample of QSO data than does \cite{Jain_Dev_Alcaniz_2003}, and my BAO measurements have all been updated relative to those of \cite{Dolgov_Halenka_Tkachev_2014, Shafer_2016, Tutusaus_et_al_2016, Haridasu_AAP_2017}. GRB data were used to constrain the power law ansatz in \cite{Haridasu_AAP_2017}, and many, but not all, of these data are the same as those I use here (additionally, my data set is larger and contains newer measurements). To my knowledge, HIIG data have never been used to constrain power law expansion. Because these data are independent of the $H(z)$, BAO, QSO, and GRB data sets, I obtain tight constraints on the parameters of the power law ansatz when I fit it to these data in combination with the $H(z)$, BAO, QSO, and GRB data (see Sec. \ref{sec:Results}). \begin{comment} There is a little overlap between the cosmic chronometer data I use in this paper and those that have previously been used to constrain the parameters of the simple (constant $\beta$) power law model. In particular, such data were used in \cite{Dev_Jain_Lohiya_2008, Kumar_2012, Rani_et_al_2015}. Many of the measurements these authors used are the same as mine, although I use a larger, more up-to-date set. I use a different sample of QSO data than does \cite{Jain_Dev_Alcaniz_2003}, and my BAO measurements have all been updated relative to those of \cite{Dolgov_Halenka_Tkachev_2014, Shafer_2016, Tutusaus_et_al_2016, Haridasu_AAP_2017}. To my knowledge, neither HIIG data nor GRB data have been used to constrain the parameters of power law models. Because these data are independent of the $H(z)$, BAO, and QSO data sets, I obtain tight constraints on the parameters of the power law model when I fit it to these data in combination with the $H(z)$, BAO, and QSO data (see Sec. \ref{sec:Results}). \end{comment} \begin{comment} To determine the goodness-of-fit of the parameters of the power-law cosmology using the Pantheon SNe Ia, I compute \begin{equation} \chi^2 = \Delta \textbf{m}^{\rm T} \cdot \textbf{C}^{-1} \cdot \Delta \textbf{m} \end{equation} where $\textbf{C}^{-1}$ is the inverse of the covariance matrix (defined below), and \begin{equation} \label{eq:Delta_m} \Delta \textbf{m} = \textbf{m}_{\rm th} - \textbf{m}_{\rm obs}. \end{equation} In eq. (\ref{eq:Delta_m}), $\textbf{m}_{\rm obs}$ is a vector containing the observed magnitudes of each supernova in the sample, and \begin{equation} \label{eq:m_th} \textbf{m}_{\rm th} = 5{\rm log_{10}}\left[\left(1 + z_{\rm hel}\right)\int^{z_{\rm cmb}}_0 \frac{d \tilde{z}}{E\left(\tilde{z}\right)}\right] + M \end{equation} is model-predicted magnitude at each redshift (see Ref. \cite{Deng_Wei}). In eq. (\ref{eq:m_th}), $z_{\rm hel}$ is the heliocentric redshift, $z_{\rm cmb}$ is the redshift in the CMB frame [I need to explain these], $E\left(z\right) := H\left(z\right)/H_0$, and $M$ is a nuisance parameter to be marginalized over. I carry out the marginalization of $M$ analytically, following the method of Ref. \cite{Conley_2011}; this produces \begin{equation} \chi^2_{\rm marg} = a + {\rm log_{10}}\left(\frac{e}{2\pi}\right) - \frac{b^2}{e}, \end{equation} where $a := \Delta \tilde{\textbf{m}}^{\rm T}\cdot \textbf{C}^{-1}\tilde{\textbf{m}}$, $b := \Delta \tilde{\textbf{m}}^{\rm T}\cdot \textbf{C}^{-1}\textbf{I}$, $e := \Delta \textbf{I}^{\rm T}\cdot \textbf{C}^{-1}\textbf{I}$, $\textbf{I}$ is the unit vector, and $\Delta \tilde{\textbf{m}} = \Delta \textbf{m} - M\textbf{I}$. [Define covariance matrix] \end{comment} \begin{comment} \begin{table*} \centering \begin{tabular}{c|c|c} Data type & Number of data points & Redshift range\\ \hline $H(z)$ & 31 & $0.070 \leq z \leq 1.965$ \\ BAO & 11 & $0.38 \leq z \leq 2.34$\\ QSO & 120 & $0.462 \leq z \leq 2.73$\\ GRB & 119 & $0.48 \leq z \leq 8.2$\\ HIIG & 153 & $0.0088 \leq z \leq 2.42935$\\ SNe Ia (Pantheon) & 1048 & $0.01012 \leq z \leq 2.26$\\ SNe Ia (DES) & 20 & $0.015 \leq z \leq 0.7026$\\ \hline \end{tabular} \caption{Data used in this paper.} \label{tab:Data} \end{table*} \end{comment} \section{Methods} \label{sec:Methods} \begin{comment} [Only two studies have done model comparison...] [In contrast to \cite{Tutusaus_et_al_2016}, which uses SN, CMB, and BAO data, I rely solely on low redshift ($z \lesssim 8$) measurements, so as to test whether or not the power law model can adequately describe the evolution of the late Universe, independently of early-Universe physics.] \end{comment} \begin{comment} Do I need this?: [[DON'T MENTION THIS UNTIL SEC. 4]Some of the BAO measurements are correlated, and some are not. See [cite] and Sec. \ref{sec:Methods} for a description of how I analyze these data]. \end{comment} The methods that I use to compare the expansion histories predicted by the power law ansatz and the $\Lambda$CDM\ model are largely the same as the methods used in \cite{Cao_Ryan_Ratra, Cao_Ryan_Ratra_2021, Cao_Ryan_Khadka_Ratra, Rani_et_al_2015, Ryan_Evidence, Ryan_2, Ryan_1, Shafer_2016, Tutusaus_et_al_2016}, which I briefly summarize here. For each combination of data that I study, I compute the quantity \begin{equation} \chi^2_{\rm min} := -2{\rm ln}\mathcal{L}_{\rm max} \end{equation} where the likelihood function $\mathcal{L}$ depends on the parameters of the expansion history under consideration. The likelihood function takes a different form depending on the data combination that is used to compute it; these forms are described in \cite{Cao_Ryan_Khadka_Ratra} and \cite{Cao_Ryan_Ratra}.\footnote{Some of the BAO data that I use are correlated, so it is necessary to take their covariance matrices into account when computing $\chi^2_{\rm min}$. See \cite{Cao_Ryan_Ratra_2021} and \cite{Ryan_2} for the covariance matrices of the correlated data.} For expansion histories having the same number of parameters, the best-fitting history is that which has a smaller value of $\chi^2_{\rm min}$. As in \cite{Cao_Ryan_Ratra, Cao_Ryan_Khadka_Ratra}, I use the \textsc{Python} module \textsc{emcee} \cite{Foreman-Mackey_Higg_Lang_Goodman_2013} to sample the likelihood function $\mathcal{L}$, and I use the \textsc{Python} module \textsc{getdist} \cite{Lewis_2019} both to generate the one- and two-dimensional likelihood contours shown in left and right panels of Fig. \ref{fig:ZBQGH_marginalized} and to compute the one-dimensional marginalized best-fitting values (sample means) and 68\% uncertainties (two-sided limits) of the model/ansatz parameters. When comparing expansion histories with different numbers of parameters, the $\chi^2$ function is not necessarily the most informative statistic to use, because it gives simple and complex expansion histories equal weight. For this reason, I also use the corrected Akaike Information Criterion: \begin{equation} {\rm AICc} := {\rm AIC} + \frac{2n(n+1)}{N - n - 1}, \end{equation} where \begin{equation} {\rm AIC} := \chi^2_{\rm min} + 2n, \end{equation} is the Akaike Information Criterion (suitable in the limit that $N >> n$), and the Bayes Information Criterion: \begin{equation} {\rm BIC} := \chi^2_{\rm min} + n {\rm ln} N, \end{equation} \cite{Liddle_2007}. In the equations above, $n$ is the number of parameters and $N$ is the number of data points.\footnote{In previous work \cite{Cao_Ryan_Ratra, Cao_Ryan_Ratra_2021, Cao_Ryan_Khadka_Ratra, Ryan_2, Ryan_1}, my collaborators and I used the AIC and BIC to compare the quality of cosmological model fits to data. Here I use the AICc in place of the AIC because the AICc is more appropriate for smaller data sets (like the $H(z)$ and BAO sets), because it approaches the AIC in the limit that $N$ is large, and to facilitate the comparison of my results with the results of \cite{Shafer_2016, Tutusaus_et_al_2016}, both of which used the AICc in their analyses.} The AICc and BIC punish expansion histories that have a greater number of parameters, favoring those with fewer parameters. In this sense, the AICc and BIC provide a quantitative basis for choosing which expansion history provides the most parsimonious fit to a given set of data. \section{Results and Discussion} \label{sec:Results} \begin{table*} \caption{Best-fitting parameters of the power law ansatz.} \label{tab:PL_BFP_Om} \centering \resizebox{\columnwidth}{!}{% \begin{tabular}{cccccccccccc} \hline \hline Data type & $H_0$ (km s$^{-1}$ Mpc$^{-1}$) & $\beta$ & $\Omega_{m0}$ & $\Omega_{b0} h^2$ & $a$ & $b$ & $\sigma_{\rm ext}$ & $\nu$ & $\chi^2_{\rm min}/\nu$ & AICc & BIC\\ \hline $H(z)$ & 61.92 & 0.9842 & - & - & - & - & - & 29 & 0.5721 & 21.02 & 23.46 \\ BAO & 89.78 & 0.9206 & 0.6192 & 0.03819 & - & - & - & 7 & 1.513 & 25.26 & 20.18\\ QSO & 61.83 & 0.9673 & - & - & - & - & - & 118 & 2.991 & 357.1 & 362.6\\ BAO+QSO & 60.57 & 0.9213 & 0.2030 & 0.07690 & - & - & - & 127 & 2.864 & 372.0 & 383.2\\ GRB & 72.34 & 0.7530 & - & - & 49.99 & 1.115 & 0.4010 & 114 & 1.138 & 140.3 & 153.7\\ HIIG & 70.99 & 1.251 & - & - & - & - & - & 151 & 2.725 & 415.5 & 421.5\\ GRB+HIIG & 70.31 & 1.158 & - & - & 50.12 & 1.157 & 0.4066 & 267 & 2.039 & 554.7 & 572.5\\ All Data & 63.06 & 0.9470 & 0.2234 & 0.06706 & 50.16 & 1.144 & 0.4025 & 427 & 2.229 & 966.2 & 994.4\\ \hline \hline \end{tabular}% } \end{table*} The best-fitting values of the parameters of the power law ansatz (namely, those that minimize the $\chi^2$ function), are recorded in columns 2-8 of Table \ref{tab:PL_BFP_Om}. The number of degrees of freedom, \begin{equation} \nu := N - n \end{equation} is recorded in column 9 of this table. Columns 10-12 record, respectively, the minimum value of the reduced $\chi^2$ function, and the minimum values of the AICc and BIC. Similarly, the best-fitting values of the parameters of the $\Lambda$CDM\ model are recorded in columns 2-7 of Table \ref{tab:LCDM_BFP_Om}, with the number of degrees of freedom in column 8, the minimum value of the reduced $\chi^2$ function in column 9, and the minimum values of the AICc and BIC in columns 10 and 11, respectively. In Table \ref{tab:1d_BFP_PL}, in columns 2 and 3, I record the sample means and two-sided uncertainties of the marginalized parameters of the power law ansatz (I exclude the parameters $\Omega_{m0}$, $\Omega_{b0}h^2$, $a$, $b$, $\sigma_{\rm ext}$ from this table because they're nuisance parameters for the power law ansatz). In column 4 I record the sample mean and two-sided uncertainties (computed from the sample mean and two-sided uncertainties of $\beta$) of the current value of the deceleration parameter \begin{equation} \label{eq:q} q_0 = \frac{1}{\beta} - 1. \end{equation} In column 5 I record $\Delta \chi^2_{\rm min}$, which I define as the difference between the value of $\chi^2_{\rm min}$ as computed within the power law ansatz for a given data combination, and the value of $\chi^2_{\rm min}$ as computed within the $\Lambda$CDM\ model for the same data combination. The relative probabilities $e^{-\rm \Delta AICc/2}$ and $e^{-\rm \Delta BIC/2}$ of the power law ansatz I record in columns 6 and 7, where $\Delta$AICc and $\Delta$BIC are defined in the same way as $\Delta \chi^2_{\rm min}$. In columns 2 and 3 of Table \ref{tab:1d_BFP_LCDM}, I record the sample means and two-sided uncertainties of the marginalized parameters of the $\Lambda$CDM\ model, excluding the nuisance parameters $\Omega_{b0}h^2$, $a$, $b$, and $\sigma_{\rm ext}$. In column 4 of Table \ref{tab:1d_BFP_LCDM} I record the sample mean and two-sided uncertainties (computed from the sample mean and two-sided uncertainties of $\Omega_{m0}$) of the current value of the deceleration parameter \begin{equation} q_0 = \frac{\Omega_{m0}}{2} - \Omega_{\Lambda} = \frac{3}{2}\Omega_{m0} - 1. \end{equation} The prior probabilities of all parameters are flat, and non-zero within the ranges $20$ km s$^{-1}$ Mpc$^{-1}$ $\leq H_0 \leq 100$ km s$^{-1}$ Mpc$^{-1}$, $0.25 \leq \beta \leq 4$, $0.1 \leq \Omega_{m0} \leq 0.7$, $0.005 \leq \Omega_{b0}h^2 \leq 0.1$, $40 \leq a \leq 60$, $0 \leq b \leq 5$, and $0 \leq \sigma_{\rm ext} \leq 10$. \begin{table*} \caption{Best-fitting parameters of the $\Lambda$CDM\ model.} \label{tab:LCDM_BFP_Om} \centering \resizebox{\columnwidth}{!}{% \begin{tabular}{ccccccccccc} \hline \hline Data type & $H_0$ (km s$^{-1}$ Mpc$^{-1}$) & $\Omega_{m0}$ & $\Omega_{b0} h^2$ & $a$ & $b$ & $\sigma_{\rm ext}$ & $\nu$ & $\chi^2_{\rm min}/\nu$ & AICc & BIC\\ \hline $H(z)$ & 68.15 & 0.3196 & - & - & - & - & 29 & 0.5000 & 18.93 & 21.37\\ BAO & 74.01 & 0.2967 & 0.03133 & - & - & - & 8 & 1.124 & 18.43 & 16.19\\ QSO & 68.69 & 0.3154 & - & - & - & - & 118 & 2.983 & 356.1 & 361.6\\ BAO+QSO & 69.51 & 0.2971 & 0.02459 & - & - & - & 128 & 2.821 & 367.3 & 375.7\\ GRB & 75.65 & 0.7000 & - & 49.98 & 1.108 & 0.4012 & 114 & 1.141 & 140.6 & 154.0\\ HIIG & 71.81 & 0.2756 & - & - & - & - & 151 & 2.720 & 414.8 & 420.8\\ GRB+HIIG & 71.45 & 0.2950 & - & 50.17 & 1.136 & 0.4035 & 267 & 2.031 & 552.5 & 570.3\\ All Data & 70.07 & 0.2949 & 0.02542 & 50.19 & 1.135 & 0.4040 & 428 & 2.148 & 931.6 & 955.8\\ \hline \hline \end{tabular}% } \end{table*} The two-dimensional confidence contours and one-dimensional likelihoods of the power law ansatz, for several combinations of data, are shown in the left panel of Fig. \ref{fig:ZBQGH_marginalized}. The contours and likelihoods associated with the $H(z)$ data are shown as dotted blue curves, those associated with the BAO + QSO data combination are shown as dash-dotted red curves, those associated with the GRB + HIIG combination are shown as dashed green curves, and those associated with the combination of all the data are shown as solid black curves (I combine the standard ruler and standard candle data in these plots to reduce visual clutter). The right panel of Fig. \ref{fig:ZBQGH_marginalized} shows the two-dimensional confidence contours and one-dimensional likelihoods of the $\Lambda$CDM\ model, for the same data combinations. From the marginalized parameter fits in Table \ref{tab:1d_BFP_PL}, I find that the best-fitting value of $\beta$ from the $H(z)$, QSO, GRB, and HIIG data is consistent with $\beta = 1$ to within 1-2$\sigma$, in agreement with many of the studies quoted in Table \ref{tab:beta_fits}. This translates to the best-fitting value of $q_0$ being within 1-2$\sigma$ of $q_0 = 0$ for each of these data sets, consistent with a coasting universe. The BAO data, however, are not consistent with $\beta = 1$, the best-fitting value of $\beta$ for this data set being more than 4$\sigma$ away from unity. This means, as reflected in the best-fitting $q_0$ value, that when the power law ansatz is fitted to the BAO data, these data favor a slowly decelerating universe (rather than a coasting one) to more than 4$\sigma$. The BAO + QSO combination also favors a slowly decelerating universe to more than 4$\sigma$. When these data are combined with the $H(z)$, GRB, and HIIG data, the error bars on $\beta$ and $q_0$ tighten, and the central values of these parameters move slightly closer to $\beta = 1$ and $q_0 = 0$, respectively, though the best-fitting value of $q_0$ is still inconsistent with a coasting universe to more than 3$\sigma$ (see also Fig. \ref{fig:ZBQGH_marginalized}). \begin{comment} consistent with a coasting universe \cite{Dev_Sethi_Lohiya_2001, Dev_Safonova_Deepak_Lohiya_2002} \end{comment} \begin{comment} \cite{Dev_Safonova_Deepak_Lohiya_2002, Jain_Dev_Alcaniz_2003, Rani_et_al_2015, Zhu_Alcaniz_Liu_2008} [others?][The studies quoted in Table \ref{tab:beta_fits} \end{comment} From Tables \ref{tab:PL_BFP_Om} and \ref{tab:LCDM_BFP_Om}, we can see that the best-fitting power law ansatz has greater $\chi^2/\nu$, AICc, and BIC values than the best-fitting $\Lambda$CDM\ model across all data combinations, except when these models are fitted to GRB data alone. In this case, power law expansion provides a slightly better fit to the data compared to the expansion history predicted by $\Lambda$CDM. When we examine the relative probabilities $e^{-\Delta{\rm AICc}/2}$ and $e^{-\Delta{\rm BIC}/2}$ in Table \ref{tab:1d_BFP_PL}, we find that the power law ansatz produces a slightly better fit to the GRB data than does $\Lambda$CDM. This preference for the power law ansatz over the $\Lambda$CDM\ model is unique to the GRB data, however, as all other data combinations favor the $\Lambda$CDM\ model, with the relative probability of power law expansion ranging from a high of $0.7047$ (HIIG data) to a low of $4.151 \times 10^{-9}$ (full data set). \begin{comment} [Similar to how Ryskin's model fits supernovae data; compare to other papers that use SN or other standard candle data. Maybe say something about how my collaborators and I are currently looking at SN data; would be interesting to use SN data in conjunction with my other data sets, this will be explored in future work etc. Is Melia's model favored by standard candles?] \end{comment} \begin{table*} \caption{Marginalized best-fitting parameters and model comparison statistics for the power law ansatz. The BAO data alone do not place a tight upper limit on the best-fitting value of $H_0$, and the GRB data do not constrain $H_0$ at all, so these limits are omitted from the table.} \label{tab:1d_BFP_PL} \centering \resizebox{\columnwidth}{!}{% \begin{tabular}{ccccccc} \hline \hline Data type & $H_0$ (km s$^{-1}$ Mpc$^{-1}$) & $\beta$ & $q_0$ & $\Delta\chi^2_{\rm min}$ & $e^{-\Delta{\rm AICc}/2}$ & $e^{-\Delta{\rm BIC}/2}$\\ \hline $H(z)$ & $62.46^{+2.693}_{-2.694}$ & $1.013^{+0.06983}_{-0.1038}$ & $-0.01283^{+0.1012}_{-0.06805}$ & 2.090 & 0.3517 & 0.3517\\ BAO & $72.68_{-8.788}$ & $0.9211^{+0.01653}_{-0.01652}$ & $0.08566_{-0.01948}^{+0.01947}$ & 1.595 & 0.03288 & 0.1360\\ QSO & $63.22^{+4.088}_{-4.091}$ & $1.045^{+0.1142}_{-0.2054}$ & $-0.04306_{-0.1046}^{+0.1881}$ & 0.9498 & 0.6065 & 0.6065\\ BAO+QSO & $60.60 \pm 1.108$ & $0.9219^{+0.01645}_{-0.01646}$ & $0.08472_{-0.01946}^{+0.01937}$ & 2.626 & 0.09537 & 0.02352\\ GRB & - & $0.8707_{-0.2782}^{+0.1197}$ & $0.1485^{+0.3670}_{-0.1579}$ & -0.3534 & 1.162 & 1.162\\ HIIG & $71.30_{-1.814}^{+1.813}$ & $1.310_{-0.1988}^{+0.1219}$ & $-0.2366^{+0.1158}_{-0.07103}$ & 0.6886 & 0.7047 & 0.7047\\ GRB+HIIG & $70.58 \pm 1.755$ & $1.199^{+0.1016}_{-0.1535}$ & $-0.1660_{-0.07067}^{+0.1068}$ & 2.209 & 0.3329 & 0.3329\\ All Data & $63.11^{+0.7886}_{-0.7890}$ & $0.9466^{+0.01593}_{-0.01594}$ & $0.05641_{-0.01778}^{+0.01779}$ & 32.53 & $3.067 \times 10^{-8}$ & $4.151 \times 10^{-9}$\\ \hline \hline \end{tabular}% } \end{table*} \begin{comment} BAO & $72.68^{+26.87}_{-8.785}$ & $0.9211^{+0.01653}_{-0.01652}$ & $0.08566_{-0.01948}^{+0.01947}$ & 1.595 & 0.03288 & 0.1360\\ GRB & $59.99^{+27.21}_{-27.22}$ & $0.8707_{-0.2782}^{+0.1197}$ & $0.1485^{+0.3670}_{-0.1579}$ & -0.3534 & 1.162 & 1.162\\ \end{comment} \begin{comment} In a similar fashion, \cite{Dolgov_Halenka_Tkachev_2014}, \cite{Rani_et_al_2015}, and \cite{Sethi_Dev_Jain_2005} [others; see spreadsheet] \end{comment} It is interesting that the best case to be made for power law expansion comes from the standard candle data, as the GRB data favor the power law ansatz and the HIIG data do not strongly disfavor it. In a similar fashion, \cite{Dolgov_Halenka_Tkachev_2014}, \cite{Rani_et_al_2015}, and \cite{Sethi_Dev_Jain_2005} find that standard candle data (in the form of SN Ia measurements) alone do not rule out or strongly disfavor power law expansion. However, when the GRB and HIIG data are combined, with each other and with the cosmic chronometer and standard ruler data, it is the $\Lambda$CDM\ model that comes out on top. Cosmic chronometer ($H(z)$) data alone also do not favor power law expansion, and neither does the standard ruler (BAO + QSO) combination. Of these three data sets, the QSO set has the least discriminating power, perhaps because of the wide dispersion of the measurements it contains (see the lower left panel of Fig. \ref{fig:Hz/1+z}); as with the HIIG data, power law expansion is not strongly ruled out by QSO data alone. The BAO data have the most discriminating power of any solo data set, the fit of the power law ansatz to these data having the smallest relative probabilities compared to $\Lambda$CDM. This is also true of the standard candle set (BAO + QSO), which gives a smaller relative probability than either the cosmic chronometer or standard candle (GRB + HIIG) set when the power law ansatz is fitted to this data combination. When the power law ansatz is fitted to the full data set, the relative probabilities decrease drastically, to the point that power law expansion appears to be very strongly ruled out, at $z \lesssim 8$, in favor of the $\Lambda$CDM\ model. These results are in broad agreement with the findings of \cite{Rani_et_al_2015, Shafer_2016, Tutusaus_et_al_2016, Haridasu_AAP_2017}, although they differ somewhat in the details. In particular, using a set of $H(z)$ data that is slightly different from mine, \cite{Rani_et_al_2015} finds much stronger evidence against power law expansion than I do.\footnote{They quote $\chi^2_{\rm min}/\nu = 1.8131$ for the fit of the power law ansatz to their $H(z)$ data, and $\chi^2_{\rm min}/\nu = 0.7174$ for the fit of the $\Lambda$CDM\ model to these data, for a difference of $\Delta \chi^2_{\rm min}/\nu = 1.096$. For these same models, I find only $\Delta \chi^2_{\rm min}/\nu = 0.0721$} Both \cite{Shafer_2016} and \cite{Tutusaus_et_al_2016} use BAO data (a smaller set than mine) to test power law expansion. Contrary to my results, the BAO measurements they use favor power law expansion, although they both find that it is strongly disfavored when BAO data are combined with independent probes (SN Ia in \cite{Shafer_2016, Tutusaus_et_al_2016} and SN Ia + CMB in \cite{Tutusaus_et_al_2016}). Using $H(z)$ + BAO + SNe Ia + GRB data, \cite{Haridasu_AAP_2017} also find that power law expansion is strongly ruled out in favor of $\Lambda$CDM\ ($\Delta$BIC = 28.02), though their combined data set prefers a slightly larger value of $\beta$ ($1.08 \pm 0.04$) than my combined data set, with larger error bars. \begin{comment} [the power law model becomes an indefensible alternative to the $\Lambda$CDM\ model.] \end{comment} \begin{table*} \centering \caption{Marginalized best-fitting parameters of the $\Lambda$CDM\ model. The BAO data alone do not place a tight upper limit on the value of $H_0$, and the GRB data do not constrain $H_0$ at all, so these limits are excluded from the table.} \begin{tabular}{cccc} Data type & $H_0$ & $\Omega_{m0}$ & $q_0$\\ \hline \hline $H(z)$ & $67.73^{+3.078}_{-3.077}$ & $0.3323^{+0.04983}_{-0.06988}$ & $-0.5016^{+0.07474}_{-0.1048}$\\ BAO & $83.47_{-4.272}$ & $0.2982^{+0.01547}_{-0.01771}$ & $-0.5527^{+0.2321}_{-0.02657}$\\ QSO & $67.28^{+4.901}_{-5.039}$ & $0.3642^{+0.08152}_{-0.1503}$ & $-0.4537^{+0.1223}_{-0.2254}$\\ BAO+QSO & $69.58 \pm 1.379$ & $0.2975^{+0.01529}_{-0.01746}$ & $-0.5538^{+0.02294}_{-0.02619}$\\ GRB & - & $0.4767_{-0.07217}$ & $-0.2850_{-0.10826}$ \\ HIIG & $71.70^{+1.819}_{-1.820}$ & $0.2893^{+0.05099}_{-0.07016}$ & $-0.5661^{+0.07649}_{-0.1052}$ \\ GRB+HIIG & $71.41^{+1.794}_{-1.795}$ & $0.3073^{+0.05140}_{-0.07055}$ & $-0.5391^{+0.07710}_{-0.1058}$ \\ All Data & $70.13 \pm 0.9590$ & $0.2943^{+0.01368}_{-0.01523}$ & $-0.5586^{+0.2052}_{-0.2284}$ \\ \hline \hline \end{tabular} \label{tab:1d_BFP_LCDM} \end{table*} \begin{comment} BAO & $83.47^{+16.39}_{-4.272}$ & $0.2982^{+0.01547}_{-0.01771}$ & $-0.5527^{+0.2321}_{-0.02657}$\\ GRB & $60.08 \pm 27.17$ & $0.4767^{+0.2214}_{-0.07217}$ & $-0.2850^{+0.3321}_{-0.10826}$ \\ \end{comment} That power law expansion is ruled out in favor of the $\Lambda$CDM\ model, from an analysis of $H(z)$, BAO, QSO, GRB, and HIIG data, is a strong statement, and should not be accepted uncritically. Though I believe I have made a good case against the power law ansatz, a few caveats must also be mentioned: \begin{figure*} \caption{The left panel shows one- and two-dimensional constraints on the parameters of the power law ansatz from several combinations of data, and the right panel shows one- and two-dimensional constraints on the $\Lambda$CDM\ model from the same combinations of data (nuisance parameters excluded).} \label{fig:ZBQGH_marginalized} \centering \resizebox{\columnwidth}{!}{% \includegraphics[scale=1]{ZBQGH_combined_updated_label.pdf} \includegraphics[scale=1]{FLCDM_ZBQGH_combined_updated_label.pdf}% } \end{figure*} \begin{comment} \caption{One- and two-dimensional constraints on the parameters of the power law model. Blue dotted curves correspond to the $H(z)$ data, red dash-dotted curves correspond to the standard ruler (BAO + QSO) data, green dashed curves correspond to the standard candle (GRB + HIIG) data, and the black solid curves correspond to the full data set.} \end{comment} 1.) The results that are shown in Tables \ref{tab:PL_BFP_Om}-\ref{tab:1d_BFP_LCDM} do not take the finite detection significance of the BAO data into account. As discussed in \cite{Ruiz_et_al_2012, Shafer_2016, Tutusaus_et_al_2016}, for a weak BAO signal, one must account for the possibility that the BAO feature in the large-scale matter power spectrum has not actually been detected. To do this, one must replace the standard gaussian $\chi^2$ function $\chi^2_{\rm G} := -2{\rm ln}\mathcal{L}_{\rm G}$ with \begin{equation} \label{eq:finite_chi2} \chi^2 := \frac{\chi^2_{\rm G}}{\sqrt{1 + \left(\frac{S}{N}\right)^{-4}\chi^4_{\rm G}}}, \end{equation} where $S/N$, the signal-to-noise ratio, is the detection significance of the BAO feature. As described in \cite{Cao_Ryan_Ratra_2021}, three of the BAO measurements I use in this paper are uncorrelated, and the rest are correlated. To test the robustness of my results, I replaced the gaussian likelihoods of the uncorrelated BAO measurements with their counterparts defined by eq. (\ref{eq:finite_chi2}) and performed the BAO analysis again. I found no significant change in the results when I did this, which is perhaps not surprising; in Fig. 11 of \cite{Ruiz_et_al_2012}, the authors show that accounting for the finite detection significance of BAO data only has the effect of widening the confidence contours (primarily the $3\sigma$ contour) a little, and that this widening almost disappears when BAO data are combined with other probes. With that said, I did not investigate the effect of the detection significance of the correlated BAO data on the model fits, and I do not know how large the effect is for these data. However, based on the above considerations as they apply to the uncorrelated BAO data, I do not expect the effect of the detection significance of the uncorrelated BAO data to be a significant factor affecting the validity of my results. \begin{comment} 2.) The fit to all data combinations ($H(z)$ data excepted), across both models, gives reduced $\chi^2$ values that are all greater than unity (and are, on average, $\geq 2$). The fit to the $H(z)$ data produces, for both the power law and $\Lambda$CDM\ models, reduced $\chi^2$ values comparable to 0.5. The larger reduced $\chi^2$ values suggest that neither the power law model nor the $\Lambda$CDM\ model is a particularly good fit to the data (though the reduced $\chi^2$ values of the $\Lambda$CDM\ model are consistently lower than those of the power law model for all data combinations, GRB alone excepted), or that the uncertainties of these data combinations have been underestimated, or both. The reduced $\chi^2$ values of the $H(z)$ data suggest, [contrariwise][to the contrary] on the other hand, that the uncertainties of these data have been overestimated. This possible overestimation of the $H(z)$ uncertainties has previously been noted by myself and my collaborators (see [cite]), and is [perhaps] apparent in Fig. \ref{fig:Hz/1+z}. [Though I believe that the case against the power law model from my findings is strong ...] [I may be overstating the case with regard to BAO and GRB data, here. Their reduced $\chi^2$ values are mostly around 1.1, so they're probably fine. It's really only the QSO and HIIG data that have too-large reduced chi-squared values; maybe I should focus on these instead]. \end{comment} 2.) The fits to the QSO and HIIG data give reduced $\chi^2$ values that are all $>2$. The fit to the $H(z)$ data gives, for both the power law ansatz and $\Lambda$CDM\ model, reduced $\chi^2$ values comparable to 0.5. The larger reduced $\chi^2$ values suggest that neither the power law ansatz nor the $\Lambda$CDM\ model is a particularly good fit to the QSO or the HIIG data (though the reduced $\chi^2$ values of the $\Lambda$CDM\ model are consistently lower for these data than those of the power law ansatz), or that the uncertainties of these data have been underestimated, or both.\footnote{As in \cite{Cao_Ryan_Ratra, Cao_Ryan_Khadka_Ratra, Cao_Ryan_Ratra_2021}, I only consider the statistical errors of the HIIG data. The systematic uncertainties of the HIIG data are the subject of an ongoing investigation by Roberto Terlevich and his colleagues, the results of which will be published in a forthcoming paper (Roberto Terlevich, private communication, 2021).} The reduced $\chi^2$ values of the $H(z)$ data suggest, on the other hand, that the uncertainties of these data have been overestimated. The possible overestimation of the $H(z)$ uncertainties has previously been noted by myself and my collaborators (see \cite{Cao_Ryan_Khadka_Ratra}), and is perhaps apparent in Fig. \ref{fig:Hz/1+z}. My collaborators and I have also previously noted the possible underestimation of the QSO and HIIG error bars \cite{Cao_Ryan_Ratra, Ryan_2}. That the power law ansatz has consistently higher values of $\chi^2_{\rm min}$ for all data sets (GRB excepted) alone and in combination (with the measurements presumably having mostly independent systematics), argues against its validity as a description of cosmic expansion for $z \lesssim 8$, though the argument could be made stronger with a better understanding of the error bars on the measurements. \begin{comment} \begin{figure*} \centering \includegraphics[scale=1.24]{FLCDM_ZBQGH_combined_H0.pdf} \caption{One- and two-dimensional constraints on the parameters of the $\Lambda$CDM\ model. Blue dotted curves correspond to the $H(z)$ data, red dash-dotted curves correspond to the standard ruler (BAO + QSO) data, green dashed curves correspond to the standard candle (GRB + HIIG) data, and the black solid curves correspond to the full data set.} \label{fig:FLCDM_ZBQGH_marginalized} \end{figure*} \end{comment} 3.) The $H(z)$ data are somewhat correlated with the QSO data. These data are correlated because some cosmic chronometer data were used to obtain the characteristic angular size $l_m$ of the QSO data. As described in \cite{Cao_et_al2017b}, using the Gaussian Process method \cite{Seikel_Clarkson_Smith_2012}, 24 $H(z)$ measurements at $z \leq 1.2$ were interpolated to produce a cosmological model independent Hubble parameter function $H(z)$. This function was then integrated to produce the angular diameter distances used, in conjunction with angular size measurements $\theta_{\rm obs}$, to obtain $l_m = 11.03 \pm 0.25$ pc. This correlation has been noted in the literature \cite{Cao_Ryan_Ratra_2021} and I currently believe that the parameter constraints from QSO data alone are wide enough that the correlation between these data and $H(z)$ data is not significant. With that said, the magnitude of this correlation is not currently known in detail, and a defender of power law expansion could point to this as a weakness of my study. One could solve this problem by treating $l_m$ as a free parameter in the cosmological model fits, although this tends to produce parameter constraints that are so wide as to be nearly uninformative.\footnote{Shulei Cao, private communication, 2021.} \begin{comment} [My collaborators and I are currently working to understand this issue better.] \end{comment} \begin{comment} [3.) Say something about non-Gaussianity of BAO likelihood functions? Do I understand this well enough to discuss it?] [4.) Feels like there should be another caveat, but I can't remember what it was. Something to do with GRB or HIIG? Maybe say something about reliability of determination of HIIG a and b parameters? Do I know enough about this?] [$\beta \approx 1$ agrees with other studies; see Table [...]. Notable that HIIG data, which cover the same redshift range as H(z), BAO, and QSO, give a significantly different best-fitting value of $\beta$.] \end{comment} \begin{comment} \begin{table*} \centering \begin{tabular}{c|c|c|c|c|c|c|c|c|c|c|c|c} Data type & $H_0$ & $\beta$ & $\Omega_{m0}$ & $\Omega_{b0} h^2$ & $a$ & $b$ & $\sigma_{\rm ext}$ & $\nu$ & $\chi^2_{\rm min}/\nu$ & AIC & AICc & BIC\\ \hline $H(z)$ & 61.92 & 0.9842 & - & - & - & - & - & 29 & 0.5721 & 20.59 & 21.02 & 23.46 \\ \hline BAO & 89.78 & 0.9206 & 0.6192 & 0.03819 & - & - & - & 7 & 1.513 & 22.59 & 29.26 & 24.18\\ QSO & 61.83 & 0.9673 & - & - & - & - & - & 118 & 2.991 & 357.0 & 357.1 & 362.6\\ \hline BQ & 60.57 & 0.9213 & 0.2030 & 0.07680 & - & - & - & 127 & 2.864 & 371.7 & 372.0 & 383.2\\ \hline GRB & 59.47 & 0.7558 & - & - & 50.16 & 1.116 & 0.4005 & 114 & 1.138 & 139.8 & 140.3 & 153.7\\ HIIG & 70.99 & 1.251 & - & - & - & - & - & 151 & 2.725 & 415.4 & 415.5 & 421.5\\ \hline GH & 70.31 & 1.158 & - & - & 50.12 & 1.157 & 0.4066 & 267 & 2.039 & 554.5 & 554.7 & 572.5\\ \hline ZBQGH & 63.06 & 0.9470 & 0.2234 & 0.06706 & 50.16 & 1.144 & 0.4025 & 427 & 2.229 & 965.9 & 966.2 & 994.4\\ \hline \end{tabular} \caption{Power law BFP} \label{tab:PL_BFP_Om} \end{table*} \end{comment} \begin{comment} \begin{table*} \centering \begin{tabular}{c|c|c|c|c|c|c|c|c|c|c|c} Data type & $H_0$ & $\Omega_{m0}$ & $\Omega_{b0} h^2$ & $a$ & $b$ & $\sigma_{\rm ext}$ & $\nu$ & $\chi^2_{\rm min}/\nu$ & AIC & AICc & BIC\\ \hline $H(z)$ & 68.15 & 0.3196 & - & - & - & - & 29 & 0.5000 & 18.50 & 18.93 & 21.37\\ \hline BAO & 74.01 & 0.2967 & 0.03133 & - & - & - & 8 & 1.124 & 15.00 & 18.43 & 16.19\\ QSO & 68.69 & 0.3153 & - & - & - & - & 118 & 2.983 & 356.0 & 356.1 & 361.6\\ \hline BQ & 69.51 & 0.2971 & 0.02459 & - & - & - & 128 & 2.821 & 367.1 & 367.3 & 375.7\\ \hline GRB & \\ HIIG & \\ \hline GH & \\ \hline ZBQGH & \\ \hline \end{tabular} \caption{$\Lambda$CDM\ BFP} \label{tab:LCDM_BFP_Om} \end{table*} \end{comment} \begin{comment} \begin{table*} \begin{tabular}{c|c|c|c|c|c|c|c|c} Data type & $H_0$ & $\beta$ & $q$ & $\Delta\chi^2_{\rm min}$ & $\Delta$AICc & $\Delta$BIC & ${\rm exp}[-\Delta{\rm AICc}/2]$ & ${\rm exp}[-\Delta{\rm BIC}/2]$\\ \hline $H(z)$ & $62.46^{+0.02693}_{-0.02694}$ & $1.013^{+0.08821}_{-0.08878}$ & $-0.01283_{-0.08596}^{+0.08652}$ & 2.090 & 2.090 & 2.090 & 0.3517 & 0.3517\\ \hline BAO & $72.68^{+18.85}_{-19.26}$ & $0.9211^{+0.01653}_{-0.01652}$ & $0.08566_{-0.01948}^{+0.01947}$ & 1.595 & 10.83 & 7.990 & 0.004449 & 0.01841\\ QSO & $63.22^{+4.088}_{-4.091}$ & $1.045^{+0.1648}_{-0.1679}$ & $-0.04306_{-0.1509}^{+0.1538}$ & 0.9498 & 1.000 & 1.000 & 0.6065 & 0.6065\\ \hline BQ & $60.60^{+0.01108}_{-0.01108}$ & $0.9219^{+0.01645}_{-0.01646}$ & $0.08472_{-0.01936}^{+0.01937}$ & 2.626 & 4.700 & 7.500 & 0.09537 & 0.02352\\ \hline GRB & $59.95^{+27.22}_{-27.21}$ & $0.8707_{-0.2208}^{+0.2074}$ & $0.1485^{+0.2912}_{-0.2736}$ \\ HIIG & $71.30_{-1.815}^{+1.814}$ & $1.311_{-0.1659}^{+0.1642}$ & $-0.2372^{+0.09652}_{-0.09554}$\\ \hline GH & $70.58^{+0.01755}_{-0.01755}$ & $1.199^{+0.1298}_{-0.1307}$ & $-0.1660_{-0.0903}^{+0.0909}$ \\ \hline ZBQGH & $63.10^{+0.007863}_{-0.007858}$ & $0.9466^{+0.01595}_{-0.01593}$ & $0.05641_{-0.01780}^{+0.01778}$\\ \hline \end{tabular} \caption{1d BFP PL} \label{tab:1d_BFP} \end{table*} \end{comment} \begin{comment} \begin{table*} \centering \begin{tabular}{c|c|c|c|c|c|c|c|c|c|c|c} Data type & $H_0$ & $\beta$ & $\Omega_{b0} h^2$ & $\Omega_{c0} h^2$ & $a$ & $b$ & $\sigma_{\rm ext}$ & $\nu$ & $\chi^2_{\rm min}/\nu$ & AIC & BIC\\ \hline $H(z)$ & 61.92 & 0.9842 & - & - & - & - & - & 29 & 0.5721 & 20.59 & 23.46 \\ BAO & 58.25 & 0.9206 & 0.0409 & 0.0464 & - & - & - & 7 & 1.513 & 18.59 & 20.18\\ QSO & 61.83 & 0.9674 & - & - & - & - & - & 118 & 2.992 & 357.0 & 362.6\\ GRB & 88.88 & 0.7505 & - & - & 49.80 & 1.115 & 0.4002 & 114 & 1.139 & 139.76 & 153.7\\ HIIG & 70.99 & 1.251 & - & - & - & - & - & 151 & 2.724 & 415.5 & 421.5\\ P & 85.09 & 1.492 & - & - & - & - & - & 1046 & 0.9914 & 1041 & 1051\\ D & 89.19 & 1.277 & - & - & - & - & - & 18 (should be 19) & 1.417 & 29.50 & 31.49\\ \hline All & 64.70 & 1.020 & 0.0417 & 0.0662 & 50.14 & 1.155 & 0.4087 & 1495 & 1.411 & 2123 & 2160\\ \hline \end{tabular} \caption{Power law BFP} \label{tab:PL_BFP} \end{table*} \end{comment} \begin{comment} \begin{table*} \centering \begin{tabular}{c|c|c|c|c|c|c|c|c|c|c} Data type & $H_0$ & $\Omega_{b0} h^2$ & $\Omega_{c0} h^2$ & $a$ & $b$ & $\sigma_{\rm ext}$ & $\nu$ & $\chi^2_{\rm min}/\nu$ & AIC & BIC\\ \hline $H(z)$ & \\ BAO & 79.66 & 0.0416 & 0.1458 & - & - & - & 8 & 1.124 & 15.00 & 16.19 \\ QSO & 68.69 & 0.0717 & 0.0764 & - & - & - & 117 & 3.009 & 358.0 & 366.4\\ GRB & \\ HIIG & \\ P & \\ D & \\ \hline \end{tabular} \caption{$\Lambda$CDM\ BFP} \label{tab:LCDM_BFP} \end{table*} \end{comment} \begin{comment} \begin{figure} \centering \includegraphics[scale=0.5]{PL_Om_run7_ZBQGH_600000.pdf} \caption{TEMP} \label{fig:ZBQGH} \end{figure} \end{comment} \section{Conclusion} \label{sec:Conclusion} In this paper, I analyzed a set of cosmic chronometer ($H(z)$), standard ruler (BAO and QSO), and standard candle (GRB and HIIG) data to find out whether simple power law expansion (with a constant exponent $\beta$) fits these data as well as or better than the expansion history predicted by the standard $\Lambda$CDM\ model. Using simple model comparison statistics, similar to what I and many others have used to test alternatives to the $\Lambda$CDM\ model, I found that the power law ansatz does not provide a good fit to the data when compared to $\Lambda$CDM. Any cosmological model that predicts power law expansion with a constant exponent is therefore not a viable candidate to replace the $\Lambda$CDM\ model at $z \lesssim 8$. \begin{comment} [Some of this material will probably be moved to the introduction.] There is now broad consensus that the $\Lambda$CDM\ model provides the best current fit to all the available cosmological data [cite]. Some groups \cite{Ryan_1, Ryan_2, Cao_Ryan_Ratra, Cao_Ryan_Khadka_Ratra, Ooba_Ratra_Sugiyama_2017_NFLCDM, Park_Ratra_2018_FLCDM, Ooba_Ratra_Sugiyama_2017_NFpCDM, Ooba_Ratra_Sugiyama_2017_NFXCDM, Park_Ratra_2018_FXCDM_NFXCDM, Park_Ratra_2018_FpCDM_NFpCDM, Ooba_Ratra_Sugiyama_2018_FpCDM, zhang_et_al_2017a, wang_pogosian_zhao_zucca_2018, zhang_lee_geng_2018} have found evidence of small departures from the $\Lambda$CDM\ model (such as dynamical dark energy or large-scale spatial curvature), in the available data, but these findings have generally not been significant enough to dethrone $\Lambda$CDM\ from its position as the ``Standard Model of Cosmology''. The power law model is no exception [to this]. Early investigations of this model found that it can describe some [combinations][sets] of data better than $\Lambda$CDM\ [cite]. These studies, however, typically used limited data sets, or data combinations consisting entirely of measurements of a single kind (fitting the power law model to standard candle data only, for example). My findings are [not inconsistent] with the findings of earlier studies; when the power law model is fitted to GRB data, it provides a slightly better fit to those data than does the $\Lambda$CDM\ model. However, all of the other data sets I examined favor the $\Lambda$CDM\ model over the power law model. When these independent sets (consisting of cosmic chronometer, standard ruler, and standard candle) of data are combined, the $\Lambda$CDM\ model is clearly favored over the power law model. It has already been shown that primordial nucleosynthesis sets a severe constraint on the power law model [cite], and that the power law model can not describe the dynamics of the Universe during both the nucleosynthesis and the matter-dominated eras.\footnote{[During the nucleosynthesis era, the data favor $\beta = ...$, whereas during the matter-dominated era, the data favor $\beta = ...$. These are clearly disjoint values, and they cannot be reconciled without introducing extra complexity to the power law model (such as the addition of a mechanism that forces $\beta$ to change is value drastically between the two eras). Given that the power law model is intended to be a simpler alternative to the $\Lambda$CDM\ model, such additional complexity appears unjustified. But see \cite{Gumjudpai}]} [Defenders of the power law model] could argue that the Universe only undergoes power law expansion at late times; by limiting the scope of the power law model, they can plausibly argue that the constraints set by primordial nucleosynthesis on the parameter[s] of this model can be avoided. I [believe] I have shown, in this paper, that such a [defense] can not be sustained, because the power law model also does not fit several independent sets of low redshift data as well as the $\Lambda$CDM\ model fits these data. \end{comment} My results are consistent with, and complementary to, other recent studies which have investigated how well power law expansion fits low redshift data. These results, along with the constraints set by primordial nucleosynthesis, show that the simple power law ansatz does not adequately describe the evolution of the Universe over the course of its history. \begin{comment} It may be the case, as some have argued [cite], that a power law model with $\beta \approx 1$ can produce the right elemental abundances, but that does not change the fact that a power law model with $\beta \approx 1$ does not describe the Universe as it is now. Others have argued that $\beta$ needs to be closer to 0.55 in order to fit the observed elemental abundances \end{comment} \section{Acknowledgments} \begin{comment} I would like to thank Shulei Cao, Narayan Khadka, Lado Samushia, and Bharat Ratra for their helpful comments and technical advice. This work was partially funded by Department of Energy grant DE-SC0011840. \end{comment} I thank Shulei Cao, Narayan Khadka, Lado Samushia, and Bharat Ratra for their helpful comments on an early draft of this paper. This work was partially funded by Department of Energy grant DE-SC0011840. The computing for this project was performed on the Beocat Research Cluster at Kansas State University, which is funded in part by NSF grants CNS-1006860, EPS-1006860, EPS-0919443, ACI-1440548, CHE-1726332, and NIH P20GM113109.
\section{Introduction} \label{sec:intro} It is now well accepted that supermassive black holes (SMBHs) lie at the center of most massive galaxies. Strong correlations have supported the idea that they evolve with their host galaxies and feedback from the AGN has been shown to regulate star formation \citep[for a review, see][]{Kormendy2013_ARAA}. Powerful, AGN-driven outflows are believed to suppress star formation \citep{Rupke2017,U2019} in high mass galaxies, leading their hosts to the well-defined red sequence. The general consensus regarding feedback in dwarf galaxies (M$_\star$ $<$ 10$^{10}$ M$_\odot$) is that stellar processes, such as starbursts and supernovae, provide the main source of quenching \citep[eg.,][]{Veilleux2005,Veilleux2020,Heckman2017}. However, the growing rate of AGN detections in dwarf galaxies \citep{Reines2013,Moran2014,Sartori2015} necessitates a closer look at AGN feedback in the low-mass regime. Evidence of AGN-driven feedback in dwarf galaxies is already starting to emerge. \citet{Penny2018} present a sample of dwarf galaxies with AGN line ratios and kinematically disturbed gas at their centers, possibly due to AGN feedback. In addition, \citet{Bradford2018} found a sample of isolated ($>$ 1Mpc), gas-depleted dwarfs with optical line ratios indicative of AGN activity, which suggests that AGN may play a role in clearing gas from dwarf galaxies. The shallower gravitational potential wells of dwarf galaxies allow feedback mechanisms to have a more profound effect on the global interstellar medium (ISM). Although this means dwarf galaxies are more susceptible to external environmental effects, strong outflows may be capable of driving gas beyond the dark matter halo. To investigate this possibility, \citet{Manzano2019}, hereafter MK19, observed a sample of 29 isolated dwarf galaxies with optical and IR signatures suggestive of AGN activity. Nine of these show fast outflows with median speed of $\sim$645 km s$^{-1}$, higher than the median host escape velocities of $\sim$300 km s$^{-1}$. If the outflows are of AGN origin, this would suggest that AGN feedback could eject material beyond the dark matter halo and have a substantial impact on the star formation rate. Furthermore, follow-up integral field spectroscopy done by \citet[][hereafter L20]{Liu2020} of this sample show spatially extended outflows up to 3 kpc in a number of these targets. In addition, they detect outflow velocities greater than 500 km s$^{-1}$ in six of these galaxies. Indeed, a small but non-negligible fraction (up to 6$\%$) of the ionized outflowing gas has the necessary speeds to escape their galaxy. However, line ratios from star-forming processes can sometimes mimic those of AGN and some contamination exists between the AGN and star-forming regions of the Baldwin, Phillips $\&$ Terlevich \citep[hereafter BPT;][]{Baldwin1981} diagram \citep[eg.,][]{Allen2008,Rich2011}. Moreover, L20 found core-collapse supernovae to be energetic enough to drive the mass outflow rates ($3\times10^{-3}$ --- 0.3 $\rm{M_{\odot}\; yr^{-1}}$) seen in their sample and thus the contribution of stellar processes in driving the outflows can not be formally ruled out. To further characterize the kinematics of outflows, coronal lines (CLs) have been used as an additional tracer of outflows. CLs are forbidden transitions from highly ionized ($>$100 eV) species with widths suggesting the coronal line region lies between the broad and narrow line regions \citep{DeRobertis1984,DeRobertis1986,Penston1984,Erkens1997,Rodriguez2002,Rodriguez2006}. Due to the high energies needed for their ionization, CLs are excellent indicators of AGN activity. They are often observed blueshifted relative to the systemic velocity of the host galaxy and thus are believed to be linked with outflows. \citet{Muller2011} have measured outflow speeds upwards of 1500 km s$^{-1}$ through CL emission and the velocity fields suggest the outflows are of biconical shape, with collimation likely due to the torus \citep[see Standard Model,][]{Antonucci1993}. In this article, we present follow-up NIR spectroscopy of the nine dwarf galaxies from MK19 and L20 that show optical AGN line ratios and fast outflows. Through NIR diagnostics, we aim to confirm the presence of AGN activity and characterize the outflows through NIR emission lines. Details of the sample selection, observations, and data reduction are summarized in Section \ref{sec:Observations}. Analysis of the data, including spectra fitting and AGN diagnostics are covered in Section \ref{sec:Analysis}. In Section \ref{sec:Discussion}, we discuss the NIR emission lines and outflow characteristics. Throughout this article, we adopt a standard $\Lambda$CDM cosmology with $H_0$ = 70 km s$^{-1}$ Mpc$^{-1}$, $\Omega_M$ = 0.3, and $\Omega_\Lambda$ = 0.7. \section{Data and Observations} \label{sec:Observations} \subsection{Sample Selection} \label{Selection} \begin{deluxetable*}{ccccccccc} \caption{Observation Log} \label{tab:obs_log} \tablehead{\colhead{Galaxy} & \colhead{Date} & \colhead{Redshift} & \colhead{Exp. Time\tablenotemark{a}} & \colhead{Slit PA} & \colhead{Ext. Ap.} & \colhead{S/N\tablenotemark{b}} & \colhead{Airmass} & \colhead{Telluric} \\ \colhead{} & \colhead{(YYYY-mm-dd)} & \colhead{} & \colhead{} & \colhead{(degrees)} & \colhead{(arcsec)} & \colhead{} & \colhead{} & \colhead{}} \startdata SDSS J010005.93-011058.89\tablenotemark{c} & 2017-10-28 & 0.05151 & 8 x 240s & 51 & 1.89 & 25 & 1.12 & HD18571\\ SDSS J081145.29+232825.72 & 2019-01-24 & 0.01573 & 12 x 240s & 45 & 1.63 & 13 & 1.58 & BD-001836\\ SDSS J084025.54+181858.99 & 2019-01-24 & 0.01498 & 8 x 240s & 101 & 1.63 & 17 & 1.34 & HD74721\\ SDSS J084234.50+031930.68\tablenotemark{d} & 2019-01-24 & 0.02882 & 8 x 240s & 277 & 1.63 & 18 & 1.28 & HD74721\\ SDSS J090613.76+561015.22\tablenotemark{d} & 2019-01-24 & 0.04664 & 12 x 240s & 239 & 1.51 & 20 & 1.31 & HD92573\\ SDDS J095418.15+471725.11\tablenotemark{d} & 2019-01-24 & 0.03266 & 10 x 240s & 144 & 1.63 & 18 & 1.18 & HD92573\\ SDSS J100551.18+125740.65\tablenotemark{d} & 2018-10-24 & 0.00949 & 6 x 240s & 65 & 1.90 & 23 & 1.60 & HD77332\\ SDSS J100935.66+265648.99\tablenotemark{d} & 2019-01-24 & 0.01436 & 8 x 240s & 226 & 1.63 & 18 & 1.03 & HD86986\\ SDSS J144252.78+205451.67 & 2019-01-24 & 0.04262 & 9 x 240s & 101 & 1.52 & 14 & 1.24 & HD124773 \enddata \tablenotetext{a}{Exposures were typically done in ABBA nodding.} \tablenotetext{b}{Average continuum signal-to-noise ratio across all orders.} \tablenotetext{c}{SDSS J0100-0110 was observed with NIRSPEC. All other targets were observed with NIRES.} \tablenotetext{d}{Indicates galaxies with coronal line detections. See Section \ref{subsec:coronal_detections}.} \end{deluxetable*} Our sample of nine dwarf galaxies comes from the AGN sample of MK19. Briefly, \citet{Reines2013}, \citet{Moran2014}, and \citet{Sartori2015} have identified hundreds of dwarf galaxies with optical and IR signatures indicative of AGN activity. MK19 created a subsample of candidate AGN whose optical line ratios place them above the star-forming region of the BPT and Veilleux $\&$ Osterbrock 1987 \citep[hereafter VO87;][]{Veilleux1987} line ratio diagrams or that have \ion{He}{2} $\lambda$4686 emission \citep[see][]{Shirazi2012}. They obtained Keck LRIS \citep[eg.,][]{Oke1995,Rockosi2010} spectroscopy of 29 of these galaxies, nine of which show blue asymmetries in their [\ion{O}{3}] $\lambda$5007 profile. This blue wing is often regarded as an indicator of outflowing gas, where the asymmetry arises due to the redshifted gas being blocked from our line of sight. These nine dwarf galaxies with spatially extended outflows form our sample for this article. Their stellar masses range from 8.77 $<$ log($\rm{M_{*}/M_{\odot}}$) $<$ 9.97 (median of 9.34) and all have redshift z $<$ 0.05. \subsection{Observations and Reductions} \label{Observe} NIR spectroscopy was obtained on three separate dates: on 2017-10-29 using Keck II NIRSPEC \citep{McLean1998}, and on 2018-10-25 and 2019-01-25 with Keck II NIRES \citep{Wilson2004}. NIRSPEC is a NIR echelle spectrograph with a wavelength coverage from 0.9 --- 5.5 $\mu$m. The NIRSPEC-7 filter was used in low-resolution mode with a cross-dispersion angle of 35.31 degrees. This resulted in a wavelength coverage of $\sim$1.97 --- 2.39 $\mu$m. The $42''\times0.76''$ slit was used and a spectral resolution of 196 km s$^{-1}$ (R $\approx$ 1500) at 2.20 $\mu$m was measured with a seeing of $\sim$0.50$''$. Observations throughout the night were done under mostly clear conditions. Note that these observations were done before the NIRSPEC upgrade. NIRES is a NIR echelette spectrograph with the slit being 18$''\times0.55''$ and the wavelength coverage set from 0.94 --- 2.45 $\mu$m across five orders. There is a small gap in coverage between 1.85 and 1.88 $\mu$m, but this is a region of low atmospheric transmission. The average spectral resolution of the five orders range between 84 --- 89 km s$^{-1}$ (R $\approx$ 3400) and these differ less than 5$\%$ for each galaxy. Observations on 2018-10-25 were taken under variable and heavy cloud cover, however the majority of our sample was observed on 2019-01-25, where cloud cover was light. Individual exposures for all sets of observations were four minutes each and were done using the standard ABBA nodding. A telluric standard star, typically of A0 spectral class with measured magnitudes in $J$, $H$, and $K$-bands, was observed either directly before or after the target galaxy to correct for the atmospheric absorption features. Typical airmass differences with the target were below 0.10. A summary of the NIR observations is shown in Table \ref{tab:obs_log}. In addition to the Keck NIRES and LRIS observations, follow-up optical IFU observations with Keck KCWI \citep{Morrissey2018} and Gemini GMOS \citep{Allington2002, Gimeno2016} were done to obtain high spatial resolution of the outflows. The details of this analysis are discussed in L20. Four of our targets (J0811+2328, J0906+5610, J0954+4717, and J1005+1257) were observed with the \textit{Chandra X-ray Observatory}. \citet{Baldassare2017a} report hard X-ray emission that is likely originating from the AGN in J0906+5610 and J0954+4717. Additionally, \citet{Wang2016} provide fluxes, corrected for galactic absorption, for J0811+2328 and J1005+1257, from which we calculated a luminosity using the cosmology listed above. We discuss these results in Section \ref{subsec:Detection_Rate}. The data were reduced using two modified pipelines. The first provided flat fielding and a robust background subtraction by using techniques described in \citet{Kelson2003} and \citet{Becker2009}. In short, this routine maps the 2D science frame and models the sky background before rectification, thus reducing the possibility of artifacts appearing due to the binning of sharp features. The sky subtraction attained with this procedure is excellent, despite the strong OH lines present in the NIR; the procedure is also quite insensitive to cosmic rays and hot pixels, and is reliable regardless of skyline intensity. Rectification, telluric correction, wavelength calibration, and extraction were all done with a slightly modified version of \textsc{REDSPEC}.\footnote{\url{https://www2.keck.hawaii.edu/inst/nirspec/redspec.html}} Telluric correction was done by dividing by the spectrum of the telluric standard star and multiplying by a blackbody curve of the same temperature. Strong OH skylines were used for wavelength calibration and the 1D spectra were then median combined. Flux calibration of individual exposures was done using the telluric star and the Spitzer Science center unit converter\footnote{http://ssc.spitzer.caltech.edu/warmmission/propkit/pet/magtojy/} to convert the magnitude of the star to the associated flux in that band. A small corrective factor ($<$5\%) was introduced due to the differences between the center NIR bands and that of the wavelength coverage. \section{Analysis} \label{sec:Analysis} \subsection{Spectral Fitting} \label{subsec:Fitting} \subsubsection{NIR Fitting} \label{subsubsec:NIR_fit} We fit all NIR spectra using \textsc{emcee}, an affine invariant Markov Chain Monte Carlo (MCMC) ensemble sampler \citep{Foreman-Mackey2013}. A narrow Gaussian component, along with a second order polynomial for the continuum, were fit simultaneously for each emission line. We determined whether a second Gaussian component was needed to fit the emission lines using the following \textit{F}-test: \textit{F} = $(\sigma_{single})^{2}/(\sigma_{double})^{2}$, where $\sigma$ is the standard deviation of the residuals using either single or double Gaussian components. If \textit{F} $>$ 2.0, then adding an extra component is justifiable and we added a component that is constrained to be broader and lower in amplitude than the first component to avoid degeneracies (see Appendix \ref{appendix:CL_detail} for example figures). Both the narrow and broad components were treated as Gaussians with amplitude, full-width half-maximum (FWHM), and velocity offset from rest-frame wavelength as free variables. We list all detected emission line fluxes and widths in Appendix \ref{appendix:CL_detail}. Note that we only report 2$\sigma$ detections and those with a FWHM greater than the resolution element. As discussed in Section \ref{subsec:Detection_Rate}, we also use NIR absorption features in our analysis. These were also fit with MCMC in a similar fashion, the main difference being the amplitude was restricted to be negative. The fitting was done simultaneously with that of emission lines in order to keep the continuum level consistent across all measurements. Although we ran the \textit{F}-test as defined above, only one gaussian was needed for all the absorption fits. The widths and depth of the absorption features used in our analysis are also listed in Appendix \ref{appendix:CL_detail}. \subsubsection{SDSS Fitting} \label{subsubsec:SDSS_fit} SDSS spectra are available for our entire sample and these provide full wavelength coverage from 4000 \AA\; to 9000 \AA, which includes the [\ion{O}{2}] $\lambda\lambda$7320, 7330 doublet that is outside the LRIS coverage. The SDSS spectra were fit using Bayesian AGN Decomposition Analysis for SDSS Spectra \citep[{\textsc{BADASS,}\footnote{\url{https://github.com/remingtonsexton/BADASS2}}}][]{Sexton2020}, a spectral analysis tool that fits the stellar and Fe II features. Absorption features were fit using the penalized Pixel Fitting \citep[\textsc{pPXF}\footnote{\url{https://www-astro.physics.ox.ac.uk/~mxc/software/}};][]{Cappellari2004} and \ion{Fe}{2} emission was fit using \ion{Fe}{2} templates. All of these components were fit simultaneously, allowing for a detailed and robust analysis of the spectrum. The code allows the user to test for the presence of outflows by setting various constraints on parameters such as minimum amplitude, minimum width, and velocity offset. The profile of [\ion{O}{3}] $\lambda$5007 is often used as a tracer of outflows since it is isolated and in a region free of significant absorption. Through [\ion{O}{3}] $\lambda$5007, we detect strong outflows in the SDSS spectra of six galaxies: J0100-0110, J0811+2328, J0842+0319, J0906+5610, J0954+4717, and J1005+1257 at a $>$ 95$\%$ confidence based on the \textit{F}-test model comparison included in the code. J1009+2656 is a little more uncertain with a 89$\%$ confidence. We do not detect outflows (confidence $<$ 55$\%$) for J0840+1818 and J1442+2054, likely due to the lower resolution of SDSS. These results are consistent with the KCWI results from L20 who found outflows in all targets but J0840+1818 (note that J1442+2054 was not observed with KCWI). \subsection{Extinction} \label{subsec:Extinction} We note that L20 reports extinction values calculated from the H$\gamma$/H$\beta$ Balmer decrement. However, for J0100-0110 and J0811+2328, they used H$\alpha$/H$\beta$ measurements from SDSS due to weak H$\gamma$ emission in their spectra. In addition, they did not observe J1442+2054. We thus opted to use the H$\alpha$/H$\beta$ Balmer decrement measured from SDSS for our entire sample. To quantify the extinction, we used the intrinsic line ratio of H$\alpha$/H$\beta$ = 3.1, typically used for AGN \citep[eg.,][]{Veilleux1987,Osterbrock1992}, and a Cardelli reddening law \citep{Cardelli1989} with an extinction factor of $R_V$ = 3.1. We used the narrow-line flux measurements from the SDSS data (see Section \ref{subsubsec:SDSS_fit}), where we have decomposed the H$\alpha$ and H$\beta$ emission into narrow and broad (outflow) components. For the two galaxies, J0840+1818 and J1442+2054, where no outflow component was detected, we used the full emission line to obtain a flux. These values of the Balmer decrement and E(B-V) for each galaxy are listed in Table \ref{tab:extinction} and all flux values in Appendix \ref{appendix:CL_detail} reflect extinction corrected fluxes. Note that three galaxies, J0840+1818, J0842+0319, and J0906+5610, have Balmer decrements slightly below the intrinsic ratio so we did not apply any extinction correction to them. Our results are slightly different but generally agree with those calculated by L20. The discrepancies are likely caused by the different line ratios (H$\gamma$/H$\beta$ versus H$\alpha$/H$\beta$) and line profiles used, where we only used the narrow profile while L20 used the full (narrow + broad) profile. When comparing the effect of these two methods, the difference in flux measurements amounts to $<$ 5\% for the majority of our sample. For the rest of this article, we use these extinction corrected flux values unless otherwise specified. \begin{deluxetable}{ccc} \caption{Measured Extinction Values of the Sample} \label{tab:extinction} \tablehead{\colhead{Galaxy} & \colhead{H$\alpha/\rm{H}\beta$ Balmer Decrement} & \colhead{E(B-V)}} \startdata J0100--0110 & 3.47$\pm$0.27 & 0.115\\ J0811+2328 & 3.71$\pm$0.34 & 0.182\\ J0840+1818 & 3.06$\pm$0.17 & 0.000\\ J0842+0319 & 3.03$\pm$0.14 & 0.000\\ J0906+5610 & 2.94$\pm$0.18 & 0.000\\ J0954+4717 & 3.25$\pm$0.08 & 0.049\\ J1005+1257 & 5.75$\pm$0.27 & 0.624\\ J1009+2656 & 3.65$\pm$0.10 & 0.166\\ J1442+2054 & 3.69$\pm$0.15 & 0.176 \enddata \tablecomments{An intrinsic ratio of H$\alpha/\rm{H}\beta$ = 3.1 and a Cardelli reddening law were used.} \end{deluxetable} \begin{figure*} \centering \epsscale{1.1} \plotone{Main_CL_box_plot.pdf} \caption{Zoom-in plots of the spectral regions around the most prominent NIR CLs, where the flux has been normalized to unity and the systemic redshift was used to shift the spectra to rest-frame wavelength. Dotted blue (detections) and red (non-detections) indicate the rest-frame wavelength of CLs. MCMC fits to the emission and absorption line profiles are shown as solid green lines.\\ \label{fig:Main_CL_box}} \end{figure*} \subsection{Coronal Line Detections} \label{subsec:coronal_detections} 55$\%$ (5/9) of our sample have NIR CL emission within the spectral window of 0.94 --- 2.45 $\mu$m (see Table \ref{tab:obs_log}). For a similar spectral window and galaxy type, Sy1 and Sy2, this rate is consistent with others found in the literature: 66$\%$ \citep[36 out of 54,][]{Rodriguez2011}, 25$\%$\citep[5 out of 20,][]{Mason2015}, and 43$\%$ \citep[44 out of 102,][]{Lamperti2017}. Our detections predominately come from sulfur and silicon species: [\ion{S}{8}] 0.9913 $\mu$m, [\ion{S}{9}] 1.2523 $\mu$m, [\ion{Si}{10}] 1.4305 $\mu$m, and [\ion{Si}{6}] 1.9630 $\mu$m. We also detect [\ion{Ca}{8}] 2.3214 $\mu$m but it falls within the CO(3-1) absorption band at 2.3226 $\mu$m, making their measurements more uncertain. All of the detected NIR CLs are shown in Figure \ref{fig:Main_CL_box}, where we include our MCMC fits to the emission line profiles. We do not detect other common NIR CLs, such as [\ion{Fe}{13}] 1.0747 $\mu$m, [\ion{S}{11}] 1.9196 $\mu$m, and [\ion{Al}{9}] 2.0450 $\mu$m. The most prominent CL is [\ion{Si}{6}] and is detected in four of the five galaxies with CL detections. This is not surprising since it has a lower IP level than other CLs and is not near any absorption features. In three of these four galaxies, we find broad [\ion{Si}{6}] emission and thus use a two component fit to the profile, in accordance with the \textit{F}-test mentioned in Section \ref{subsubsec:NIR_fit}. Details of the multi-component fits to [\ion{Si}{6}] and plots of the entire spectra are presented in Appendix \ref{appendix:CL_detail}. No NIR CL emission is detected in the other four galaxies. To investigate this, we plot total [\ion{Si}{6}] flux versus WISE \textit{W}2 (4.6 $\mu$m) flux in Figure \ref{fig:SiVI_W2}. Note that one galaxy, J0842+0319, has a CL detection, [\ion{Ca}{8}], but does not show any [\ion{Si}{6}] emission. Upper limit fluxes to the non-[\ion{Si}{6}] detections were calculated by integrating over a Gaussian with a width equaling the resolution element and amplitude equalling the 1$\sigma$ noise level where [\ion{Si}{6}] should appear. This value was multiplied by three to obtain the 3$\sigma$ upper limit that is plotted in Figure \ref{fig:SiVI_W2}. We also plot the AGN sample (black dots) from \citet{Muller2018}, from which we derive the plotted line of best fit. This relation (J. Cann, private communication) provides an expected value for [\ion{Si}{6}] based on \textit{W}2 flux. Our non-detections lie below most of our [\ion{Si}{6}] measurements, suggesting that deeper observations may be required to detect any CL emission. Further discussion on our non-detections is covered in Section \ref{subsec:Detection_Rate}. The optical data also reveal a number of CLs, particularly in those with NIR CL detections. 55$\%$ (5/9) of our sample have strong optical CL emission. The most common detections in our sample include [\ion{Ne}{5}] $\lambda$3426, [\ion{Fe}{7}] $\lambda$6087, and [\ion{Fe}{10}] $\lambda$6374. Less common lines include [\ion{Ne}{5}] $\lambda$3346, and [\ion{Fe}{7}] $\lambda$5721. Most galaxies that have NIR CL emission also have optical CL emission, the only exceptions are J0840+1818 and J0842+0319, where the latter only shows NIR CL emission. For J0840+1818, MK19 report the detection of [\ion{Ne}{5}] $\lambda$3426 but we do not find any NIR CLs. No other significant detections are seen in the rest of the sample. Additional details for each galaxy are covered in Appendix \ref{appendix:CL_detail}. For the remainder of this article, we label galaxies as either having NIR CL emission or not. \begin{figure} \centering \epsscale{1.1} \plotone{SiVI_W2.pdf} \caption{[\ion{Si}{6}] flux vs W2 (4.6 $\mu$m) flux. Galaxies in our sample with detected [\ion{Si}{6}] emission are shown as blue stars. J0842+0319, the one object with a CL detection but no [\ion{Si}{6}] emission, is shown as a purple cross. Objects without any CL detections are shown as red crosses. For these latter two, the crosses represent 3$\sigma$ upper limit fluxes to [\ion{Si}{6}]. The solid line is the best-fit line to the data found in \citet{Muller2018}. \label{fig:SiVI_W2}} \end{figure} \subsection{AGN Diagnostic Plots} \label{subsec:AGN_diagnostic} \begin{figure*} \gridline{\fig{SIII_SII.pdf}{0.34\textwidth}{} \fig{OII_relation.pdf}{0.64\textwidth}{}} \caption{AGN diagnostic plots derived by \citet{Osterbrock1992}. We plot our sample as blue (CL detection) and red (non-CL detection) stars. Our sample falls within the scatter of other galaxies hosting AGN, further confirming the presence of AGN. \label{fig:AGN_relations}} \end{figure*} Although there is evidence for AGN activity in our dwarf galaxy sample, including optical BPT/VO87 AGN line ratios, the addition of NIR lines allows us to run additional AGN diagnostics. With the inclusion of [\ion{S}{3}] $\lambda$9531, we can test our sample with the AGN diagnostics presented in \citet{Osterbrock1992}. Specifically we use the [\ion{S}{3}] $\lambda\lambda$9069+9531/H$\alpha$ versus [\ion{S}{2}] $\lambda\lambda$6718+6732/H$\alpha$, [\ion{S}{3}] $\lambda\lambda$9069+9531/H$\alpha$ versus [\ion{O}{2}] $\lambda\lambda$7320+7330/H$\alpha$, and [\ion{S}{2}] $\lambda\lambda$6718+6732/H$\alpha$ versus [\ion{O}{2}] $\lambda\lambda$7320+7330/H$\alpha$ (their Figures 4, 5 and 7). All three of these relations are plotted in Figure \ref{fig:AGN_relations}, where we include the AGN and star-forming samples from \citet{Osterbrock1992}. We overplot narrow-line fluxes of our sample as stars and exclude the galaxies with no measurable [\ion{O}{2}] $\lambda\lambda$7320, 7330. J0100-0110 is also omitted since its [\ion{S}{3}] $\lambda$9531 is outside the wavelength coverage of NIRSPEC. Since [\ion{S}{3}] $\lambda$9069 is outside the wavelength coverage of NIRES, we use the intrinsic flux ratio of [\ion{S}{3}] $\lambda$9531/$\lambda$9069 = 2.6 to obtain flux values for [\ion{S}{3}] $\lambda$9069. In all three relations, our dwarf sample falls within the scatter of the AGN sample in \citet{Osterbrock1992}. As discussed in Section \ref{subsec:coronal_detections}, not every galaxy in our sample show CLs. To check if this has any effect, we separate our sample into two groups: those with CL emission and those without. We find that they all lie in similar regions and we see no clear distinction between them in all three relations. While no single line ratio can confidently separate AGN activity from star formation, our dwarf sample shows optical and NIR line ratios that, when considered collectively, strongly suggest the presence of AGN. \section{Discussion} \label{sec:Discussion} \subsection{Detection Rate of Coronal Lines} \label{subsec:Detection_Rate} Although CLs are excellent tracers of AGN activity, they do not always appear in AGN spectra and a number of reasons have been proposed to explain this. In general, CL detections decrease with increasing IP and our results agree with this; we do not detect any of the high-IP CLs, [\ion{Fe}{13}] 1.0747 $\mu$m (330.8 eV) and [\ion{S}{11}] 1.9196 $\mu$m (447.1 eV). Stellar absorption features can also affect detection rates by attenuating the CL emission profile. Such is the case with [\ion{Ca}{8}] which falls within the CO (3-1) absorption feature. In addition, Ca and Al species can be affected by metallicity and depletion onto dust. Moreover, telluric absorption from the atmosphere always has to be contended with in ground-based observations. In nearby low-luminosity AGN, circumnuclear stellar populations can dominate the NIR continuum and thus drown out any CL emission. Bright AGN, particularly at high redshift, can also hamper CL emission due to their strong continuum. These effects can be seen in the results of \citet{Rodriguez2011} who found that many galaxies with stars contributing $\sim$90$\%$ of the continuum do not show CL emission. They also found their CL detection rate decreased by 17$\%$ when selecting galaxies with a redshift $>$ 0.05. Our coverage of $J$, $H$, and $K$-bands allows us to estimate the contribution of circumnuclear stellar populations. The CO(6-3) absorption at 1.62 $\mu$m can provide an estimate to the flux contribution of red giants to the $H$-band continuum \citep{Martins2010}, where the continuum level arises due to stellar and AGN contribution. For a population of GKM giants, the typical observed depth of the absorption is $\sim$20$\%$ of the continuum \citep{Schinnerer1998}. Our sample ranges from 7$\%$ - 14$\%$ (median of 11$\%$), suggesting a large contribution to the $H$-band continuum from red giants, up to 70$\%$. The weighted average of the depth of galaxies with no CL detections is 28$\%$ deeper than those with CL emission. One possibility is that a larger population of red giants near the center could be the cause of the deeper absorption, and are thus directly increasing the continuum level. Alternatively, a shallower CO absorption may be indicative of a stronger AGN contribution to the continuum, which would likely lead to stronger CL emission that is more easily detectable. \citet{Baldassare2017a} report 0.5-7 keV X-ray luminosities for J0906+5610 and J0954+4717, from which we convert to $L_{\rm{2-10 keV}}$ using \textsc{PIMMS}\footnote{\url{https://cxc.harvard.edu/toolkit/pimms.jsp}}. This results in a $L_{\rm{2-10 keV}}$ of 2.89 $\times$ 10$^{40}$ erg s$^{-1}$ and 6.12 $\times$ 10$^{39}$ erg s$^{-1}$ for J0906+5610 and J0954+4717, respectively. Additionally, using 0.3-8 keV fluxes from \citet{Wang2016}, we calculated 2-10 keV luminosities for J0811+2328 (1.33 $\times$ 10$^{39}$ erg s$^{-1}$) and J1005+1257 (5.20 $\times$ 10$^{39}$ erg s$^{-1}$). Although J0811+2328 does have the lowest X-ray luminosity, we find no clear distinctions between galaxies with CL detections and those without. We do note, however, that these X-ray luminosities are about two orders of magnitude lower than the $L_{\rm{2-10 keV}}$ -- $L_{\rm{W2}}$ relation discussed in \citet{Secrest2015}. Indeed, all four targets have $L_{\rm{2-10 keV}}$/$L_{\rm{W2}}$ $<$ -2.1. Similar low $L_X$ have been reported in low-mass galaxies \citep{Dong2012,Simmonds2016,Cann2020}, suggesting obscuration of the X-ray source emission or that AGN in dwarf galaxies are X-ray weak compared to their MIR emission. \subsection{Coronal Line and Outflow Kinematics} \label{subsec:Kinematics} Photoionization is widely considered as the main excitation mechanism behind CL emission, although \citet{Rodriguez2006} found that their models more precisely matched emission line ratios from their data when shocks were included. If, however, photoionization is the principle excitation mechanism behind CLs then we expect a correlation between the FWHM and IP. Emission from a high IP line would suggest that the emitting gas is located closer to the central ionizing source and thus be deeper in the gravitational well, causing a broadening of its emission line profile. Because of their high range of IPs ($\sim$100 eV -- 500 eV), CLs are ideal in investigating the gas kinematics near the AGN. Indeed, positive correlations between line width and IP have been found in past studies \citep[eg.,][]{DeRobertis1984,DeRobertis1990,Veilleux1991} for optical high ionization lines. A positive trend has also been found between line width and critical density in these studies. Similar trends between line width and IP for NIR lines have been seen in some galaxies \citep{Rodriguez2002} but larger samples are starting to show more varied CL widths \citep[eg.,][]{Rodriguez2011,Villar_Martin2015,Cerqueira2020}, and in many cases no trends are found at all. \citet{Rodriguez2011} find a positive slope up to $\sim$300 eV, after which the slope turns negative (i.e. higher IP, lower FWHM). They attribute this to the increase in electron density when approaching the central AGN. Due to densities exceeding the critical densities of the high IP CL ions, these lines may be suppressed. Specifically, collisional de-excitation could reduce emission associated with the broader, high velocity components, thus causing us to only see the narrow emission and explaining the decrease in FWHM at high IPs. \begin{figure*} \centering \epsscale{1.1} \plotone{IP_FWHM.pdf} \caption{FWHM versus IP (top panels) and critical density (bottom panels) for our sample with NIR CL detections. Low-ionization optical emission lines are plotted as open circles while all NIR emission lines are plotted as filled circles. \label{fig:IP_FWHM}} \end{figure*} \begin{deluxetable}{cccccc} \caption{Emission Lines with IP and Critical Densities} \label{tab:Ion_Pot} \tablehead{\colhead{Emission Line} & \colhead{IP} & \colhead{log($n_e$)} & \colhead{Emission Line} & \colhead{IP} & \colhead{log($n_e$)}\\ \colhead{ $\mu$m} & \colhead{eV} & \colhead{cm$^{-3}$} & \colhead{ $\mu$m} & \colhead{eV} & \colhead{cm$^{-3}$}} \startdata H$\alpha$ & 13.6 & --- & $[\rm{Fe\;II}]$1.2567 & 7.9 & 5.0\\ $[\rm{O\;III}]$0.5007 & 54.9 & 5.85 & $[\rm{Si\;X}]$1.4305 & 351.1 & 8.8\\ $[\rm{S\;III}]$0.9531 & 23.3 & 5.8 & $[\rm{Fe\;II}]$1.6435 & 16.2 & 4.7\\ $[\rm{S\;VIII}]$0.9913 & 280.9 & 10.6 & $[\rm{Si\;VI}]$1.9630 & 166.8 & 8.8\\ $[\rm{Si\;IX}]$1.2523 & 328.2 & 9.4 & $[\rm{Ca\;VIII}]$2.3214 & 127.7 & 7.9 \enddata \end{deluxetable} We run a similar analysis by plotting narrow-component FWHM versus IP and critical density for the CLs detected in our sample in Figure \ref{fig:IP_FWHM}. We have also included optical (open circles) and NIR low-ionization lines to draw comparisons (see Table \ref{tab:Ion_Pot}). In two galaxies, J0906+5610 and J1005+1257, the widths peak around 250 -- 300 eV and subsequently decrease, consistent with collisional de-excitation of the broader components of high IP ions. The CL emission in the other three galaxies have lower S/N so it is difficult to evaluate any trends. Aside from these low S/N measurements (as indicated by their error bars), these CLs have widths consistent with the lower IP lines. However, some uncertainty may arise from overestimating/underestimating the broad/narrow component of the line profile. For instance, the relatively small width of [\ion{Si}{6}] (166.8 eV) in J0954+4717, where we have added a secondary broad component, could be due to overestimating the broad component. Regardless, our results are consistent with the recent reports finding no clear trends between FWHM and IP. Critical density, defined as the density when the collision rate matches the radiative de-excitation rate, is plotted against FWHM in the bottom panels of Figure \ref{fig:IP_FWHM}. Consistent with past works \citep{DeRobertis1986,Veilleux1991b,Ferguson1997}, we find linear correlation in some galaxies, with varying degrees of slope. Regardless, we find a stronger correlation of FWHM increasing with critical density, consistent with past studies. Table \ref{tab:outflow_vel} lists the kinematic properties of the narrow and broad (outflow) components of [\ion{O}{3}] and [\ion{Si}{6}], where the [\ion{O}{3}] values come from L20. The higher spectral resolution of the IFU data of L20 allowed for the decomposition of the emission line profile into two or three components. Generally, the C1 component traces the gas in the narrow-line region while C2 and C3 represent the broader and bluer components to the multi-component fit, and thus likely trace the outflow. For J0811+2328, only one component (C1) was fit but it is blueshifted relative to the stellar velocity and broader than the stellar velocity dispersion, and thus L20 suggest that it is likely part of the outflow. For v$_{50}$, the median velocity offset of the profile relative to systemic velocity, we take the minimum values (i.e. maximum blue offset) for [\ion{O}{3}]. The velocity of an outflow is often calculated through the use of W$\rm{_{80}}$, the width containing 80$\%$ of the flux of an emission line \citep{Harrison2014}. For a single Gaussian profile, W$\rm{_{80}}$ = 1.09$\times$FWHM. To measure W$\rm{_{80}}$ for [\ion{Si}{6}] , we use the full profile due to the relatively large uncertainties in the broad component. We can define the outflow velocity as, \begin{equation} \label{eq:outflow_vel} v_{\rm{out}} = -v_{50} + \frac{\rm{W_{80}}}{2} \end{equation} Although C1 likely traces the narrow-line gas, L20 and \citet{Manzano2020} find cases where outflowing gas can be represented as a single-component profile. For this reason, we include $\rm{v_{out}}$ calculations for all [\ion{O}{3}] components. In addition, for [\ion{Si}{6}] $\rm{v_{out}}$, we use v$_{50}$ of the full profile if a multi-component fit was used. This is because of the large uncertainties associated with the broad component fits. \begin{deluxetable*}{cccccccc} \tablecaption{Outflow Properties} \label{tab:outflow_vel} \tablehead{\colhead{Galaxy} & \colhead{$[\rm{O\;III}]$} & \colhead{$[\rm{O\;III}]$ $\rm{v_{50}}$} & \colhead{$[\rm{Si\;VI}]$ $\rm{v_{50}}$} & \colhead{$[\rm{O\;III}]$ $\rm{W_{80}}$ ($\rm{v_{out}}$)} & \colhead{$[\rm{Si\;VI}]$ $\rm{W_{80}}$ ($\rm{v_{out}}$)} & \colhead{log(L$_{[\rm{SiVI}]}$)} & \colhead{log(L$\rm{_{AGN}}$)}\\ \colhead{ } & \colhead{Component} & \colhead{(km s$^{-1}$)} & \colhead{(km s$^{-1}$)} & \colhead{(km s$^{-1}$)} & \colhead{(km s$^{-1}$)} & \colhead{($\rm{erg\; s^{-1}}$)} & \colhead{($\rm{erg\; s^{-1}}$)}\\ \colhead{(1)} & \colhead{(2)} & \colhead{(3)} & \colhead{(4)} & \colhead{(5)} & \colhead{(6)} & \colhead{(7)} & \colhead{(8)}} \startdata J0100--0110 & Total & -130 & --- & 440 (350) & --- & $<$ 38.49 & 43.3\\ & C1 & -60 & --- & 210 (165) & --- & --- & \\ & C2 & -240 & --- & 650 (565) & --- & --- & \\ J0811+2328 & C1 & -60 & --- & 220 (170) & --- & $<$ 37.95 & 41.8\\ J0840+1818 & C1 & -30 & --- & 130 (95) & --- & $<$ 38.10 & 41.9\\ J0842+0319 & Total & -110 & --- & 700 (460) & --- & $<$ 38.42 & 42.7\\ & C1 & -60 & --- & 220 (170) & --- & --- & \\ & C2 & -160 & --- & 750 (535) & --- & --- & \\ J0906+5610 & Total & -50 & 90, -600 & 670 (385) & 970 (535) & 42.48 & 43.3\\ & C1 & -50 & --- & 140 (120) & --- & --- & \\ & C2 & 30 & --- & 680 (310) & --- & --- & \\ & C3 & -150 & --- & 1250 (775) & --- & --- & \\ J0954+4717 & Total & -10 & 17, 60 & 530 (275) & 650 (300) & 42.09 & 43.6\\ & C1 & 0 & --- & 100 (50) & --- & --- & \\ & C2 & -70 & --- & 430 (285) & --- & --- & \\ & C3 & -80 & --- & 1100 (630) & --- & --- & \\ J1005+1257 & Total & -60 & -70, -100 & 680 (400) & 1350 (770) & 43.04 & 43.2\\ & C1 & -40 & --- & 120 (100) & --- & --- & \\ & C2 & -100 & --- & 710 (455) & --- & --- & \\ & C3 & -200 & --- & 1200 (800) & --- & --- & \\ J1009+2656 & Total & -50 & -100 & 150 (125) & 108 (155) & 41.59 & 42.9\\ & C1 & -30 & --- & 100 (80) & --- & --- & \\ & C2 & -60 & --- & 480 (300) & --- & --- & \enddata \tablecomments{Columns: (1) Galaxy name. (2) Components of the [\ion{O}{3}] fit according to L20. In general, the C3 component traces the faster, broader outflow component while C2 traces the more narrow outflow component. C1 generally traces the gas of the narrow-line region. (3) Minimum values (i.e. maximum blue offset from the systemic velocity) of $\rm{v_{50}}$ based on [\ion{O}{3}] $\lambda$5007 measurements from L20. (4) $\rm{v_{50}}$ values for [\ion{Si}{6}]. The first value is for the narrow component, followed by the broad component. (5) Maximum $\rm{W_{80}}$ values based on [\ion{O}{3}] $\lambda$5007 measurements from L20. In parentheses are $\rm{v_{out}}$ values as defined in Equation \ref{eq:outflow_vel}. (6) $\rm{W_{80}}$ of the outflow based on the full [\ion{Si}{6}] profile. $\rm{v_{out}}$ values are in parentheses. (7) Total luminosity of [\ion{Si}{6}]. Upper limits are included for galaxies without [\ion{Si}{6}] detections (see Section \ref{subsec:coronal_detections} for details). (8) Extinction-corrected AGN luminosity as derived from [\ion{O}{3}] $\lambda$5007 in L20. Extinction values used were derived in this article.} \end{deluxetable*} Our data show the outflow velocities seen in [\ion{Si}{6}], measured through either W$\rm{_{80}}$ or $\rm{v_{out}}$, are generally faster than those seen in [\ion{O}{3}]. The main exception to this are the velocities seen in the C3 components. This is likely due to combining the narrow and broad components of [\ion{Si}{6}] when calculating W$\rm{_{80}}$ and v$_{50}$. Using only the broad component, we find velocities to be consistent or higher than those of C3, albeit with much higher uncertainty. This overall trend of higher velocities seen in [\ion{Si}{6}] than [\ion{O}{3}] implies a decelerating outflow, one where a high velocity wind originates near the AGN and slows down as it approaches the outer, lower ionization gas. We also note that the objects with the fastest outflows and broadest profiles seen in [\ion{O}{3}], J0906+5610, J0954+4717, and J1005+1257, have the broadest [\ion{Si}{6}] emission. This is perhaps unsurprising since we are observing the same outflow, just at different locations. We also list the bolometric AGN luminosities (L$\rm{_{AGN}}$) in Table \ref{tab:outflow_vel}. These values were derived from the observed [\ion{O}{3}] $\lambda$5007 flux in L20. Empirical bolometric correlation factors from \citet{Lamastra2009} were used: L$\rm{_{AGN}}$ = 87 L$_{[\rm{O\;III}]}$ for 38 $<$ log(L$_{[\rm{O\;III}]}$) $<$ 40 and L$\rm{_{AGN}}$ = 142 L$_{[\rm{O\;III}]}$ for 40 $<$ log(L$_{[\rm{O\;III}]}$) $<$ 42. To correct for extinction, we applied the extinction values listed in Table \ref{tab:extinction}. We find no strong correlation between AGN luminosity and outflow speeds but there is a trend for the more luminous AGN to have a higher number and more luminous CL detections. If we assume a simple biconical outflow starting close to the AGN \citep[for a detailed analysis, see][]{Muller2011}, highly ionized gas (i.e. CLs) could more easily be sent out to farther, possibly less obscured regions due to a fast outflow. Although it is difficult to make any firm conclusions due to the CL region being unresolved in our data, it appears that faster outflows may result in stronger and broader CL emission. \subsection{Ionization and Origin of the Outflows} \label{subsec:Origins} In this section, we investigate whether AGN or stellar processes (or both) are the primary source of ionization and the driving mechanism for the outflows. \subsubsection{AGN or Stellar Ionization?} \label{subsubsec:Ionization_vs} The analysis of line ratios by L20 indicates that AGN are the primary source of ionization in our sample. However, they note that ionization from shocks, possibly originating from starburst driven-winds \citep{Sharp2010}, can not be ruled out. To investigate this further, we compare line ratios in our sample to ionization models found in the literature. \citet{Riffel2013} and \citet{Colina2015} plot [\ion{Fe}{2}] 1.64 $\mu$m/Br$\gamma$ versus $\rm{H_2}$ 2.12 $\mu$m/Br$\gamma$ to separate AGN from star-forming samples. However, the five galaxies with obtainable line ratios fall within the overlap between the AGN and SNe-dominated distributions \citep[see Figure 5 from][]{Colina2015}. We instead use the flux ratios of [\ion{Si}{6}]/Br$\gamma$ and [\ion{Fe}{2}] 1.64 $\mu$m/Br$\gamma$, where [\ion{Fe}{2}] is a sensitive indicator of shocks \citep{U2013} and Br$\gamma$ serves as an indicator of stellar activity and the ionizing radiation field. We compare these ratios to the AGN ionization models from \citet{Groves2004a,Groves2004b} and shock models from \citet{Allen2008}. We extracted these models from the \textsc{ITERA} library \citep{Groves2010} and plotted them in Figure \ref{fig:shocks}. The shock model (Figure \ref{fig:shocks}, left) takes into account both the shocked gas and precursor gas, which lies ahead of the shock front. Quick inspection of shock-only model (not plotted) shows a shift towards higher [\ion{Fe}{2}]/Br$\gamma$ ratios, farther away from our measured line ratios. We thus focus our analysis on the shock + precursor model (hereafter simply shock model) since the individual regions cannot be resolved in our data. Free parameters for the shock model include the shock velocity v$\rm{_{shock}}$ (10 -- 1000 km s$^{-1}$) and the magnetic field parameter $B/n^{1/2}$ (10$^{-4}$ -- 10 $\mu$G cm$^{3/2}$), where $B$ is the transverse magnetic field. The AGN model free parameters include the power law index $\alpha$ and the ionization parameter $U$, where $U\equiv n_{\rm{ion}}/n_{\rm{e}}$, where $n_{\rm{ion}}$ is the density of the ionizing photons and $n_{\rm{e}}$ is the electron density. The model uses a simple power law, $F_\nu \propto \nu^{\alpha}$, where 5eV $< \nu <$ 1,000eV \citep[see][for further details]{Groves2004a,Groves2004b}. \begin{figure*} \gridline{\fig{shock_ratios.pdf}{0.5\textwidth}{(a)} \fig{AGN_ratios.pdf}{0.5\textwidth}{(b)}} \caption{$\rm{Log_{10}}$([\ion{Si}{6}]/$\rm{Br}\gamma)$ versus $\rm{log_{10}}$(\ion{Fe}{2}/$\rm{Br}\gamma)$ for (a) shock + precursor and (b) AGN model plots. Free parameters for the shock + precursor gridlines are the shock velocity v$\rm{_{shock}}$ and magnetic field parameter B. Free parameters for the AGN gridlines are the power law index $\alpha$ and the ionization parameter $U$. The four galaxies with detected [\ion{Si}{6}] emission are plotted as black circles with error bars. Metallicity was set to solar and a gas density of n = 1000 cm$^{-3}$ was assumed.\label{fig:shocks}} \end{figure*} To estimate the CL gas density, \citet{Landt2015a,Landt2015b} use line ratios of the [\ion{Fe}{7}] $\lambda\lambda\lambda$3759, 5159, 6087 optical CLs. Although we do not detect all these lines in our optical data, some targets do have two [\ion{Fe}{7}] emission lines that are measurable. For these targets, we calculated an upper limit flux to the third [\ion{Fe}{7}] line and obtained a rough estimate of the gas density. These values are consistent with a density of 1000 cm$^{-3}$. In addition, L20 used the \ion{S}{2} $\lambda$6716/\ion{S}{2} $\lambda$6731 line ratio \citep[eg.,][]{Sanders2016} and obtained values $\sim$ 500 cm$^{-3}$ for most of their sample. They thus use a density of 1000 cm$^{-3}$ in their models. Therefore, in both of our models, we use a gas density of 1000 cm$^{-3}$. Lastly, metallicity was set to solar. We use the total flux for each emission line and plot the ratios over the shock model (Figure \ref{fig:shocks}, left) and AGN model (Figure \ref{fig:shocks}, right). It is clear that the line ratios are well within the AGN model parameters (-2.0 $\lesssim$ $\alpha$ $\lesssim$ -1.2 and -3.3 $\lesssim$ log($U$) $\lesssim$ -2.0). As for the shock models, the line ratios are offset by more than 0.5 dex and all have systematically larger [\ion{Fe}{2}]/Br$\gamma$ ratios. In order to match the measured data, it appears a relatively large magnetic parameter ($> 10^3$) is required. Thus it is likely that AGN are the dominant ionizing source in our sample, though a small contribution from shocks cannot be formally ruled out. \subsubsection{AGN or Stellar Driven Winds?} \label{subsubsec:driving_force_vs} The matter of identifying the driving force behind the outflows is a difficult but important issue to investigate. Outflowing winds are often cited coming from either AGN or starburst activity \citep[eg.,][]{Fabian2012,Rupke2018,Veilleux2020}, though distinguishing between the two is often difficult. L20 investigated the energies associated with the outflows in our sample and found that the AGN are more than powerful enough to drive them. However, they found that typical core collapse supernovae can also provide the necessary energy output needed. One avenue of checking the likelihood of starburst driven-winds in our sample is to estimate the age of a stellar population. The CN absorption features at 1.1 $\mu$m have been shown to serve as an indicator of an intermediate-aged stellar population \citep{Maraston2005, Riffel2007}. This band most notably arises from carbon stars where there is an excess of carbon that is not bonded in CO molecules. To form a carbon star, a third 'dredge-up' during the thermally pulsing asymptotic giant branch (TP-AGB) is necessary and this constrains the stellar population age to be within 0.3 -- 2 Gyr. Thus CN absorption would identify a younger to intermediate aged stellar population and signify an occurrence of starburst activity. The absence of CN absorption, however, may not necessarily imply an absence of a young to intermediate-aged stellar population. \citet{Riffel2009} and \citet{Martins2013} report cases with no CN absorption but with known intermediate populations and vice versa. But as they point out, this is not to say that CN does not trace an intermediate population. Overlap with strong emission from \ion{He}{1} 1.08 $\mu$m and Pa$\gamma$ can partially or fully obstruct the CN absorption. Telluric absorption, particularly in galaxies with low redshift (z $<$ 0.01), may also interfere with CN detection. Even with proper correction from a telluric standard, the residuals can have substantial effects on the signal to noise on the CN features. Visual inspection of our spectra shows no interference from strong emission lines but we do find significant telluric absorption in the region of CN in two cases (see Appendix \ref{appendix:CL_detail} for more details). For the rest, this lack of CN absorption would indicate that much of the CO absorption comes from older red giants (see Section \ref{subsec:Detection_Rate}). This is also consistent with the stellar population age estimates of at least several Gyrs modeled from optical LRIS spectra \citep{Manzano_Thesis}. This apparent deficit of young stars would suggest a lack of starburst that could drive the outflows we see, making the outflows more likely to be driven by AGN. \section{Conclusion} \label{sec:Conclusion} We have presented Keck NIR spectroscopy of a sample of dwarf galaxies with strong evidence of AGN activity and have shown the outflows detected are likely AGN-driven. Eight galaxies were observed with Keck NIRES, providing full wavelength coverage from 0.9 -- 2.4 $\mu$m, and one galaxy with Keck NIRSPEC, with wavelength coverage from 1.97 -- 2.39 $\mu$m. The main results are summarized below.\\ \textbullet\; NIR CLs (IP $>$ 100 eV) are detected in 5/9 (55$\%$) galaxies in our sample, consistent with detection rates found in larger mass studies. Due to their high ionization potentials, CL emission is highly indicative of AGN activity. Coupled with optical and other NIR AGN diagnostics, there is strong evidence for AGN activity in these dwarf galaxies. \textbullet\; For the four galaxies without NIR CL emission, we suspect a strong contribution from a population of red giants that could be dominating the continuum level and hamper any weak CL emission. The deeper CO(6-3) absorption at 1.62 $\mu$m in these galaxies indicates a larger population of old stars. Alternatively, the deeper CO absorption may be indicative of weaker AGN that would result in more elusive CL emission. \textbullet\; No clear trends are found between the widths of the CLs and their IPs. Two galaxies show a decrease in width after peaking around 250 -- 300 eV. As noted in previous works, this is likely due to collisional de-excitation caused by the high density environments near the central ionizing source. In addition, we see a positive trend between the FWHM and the critical densities in these two galaxies. The other galaxies show CL widths that are consistent with lower IP lines and their widths are not as tightly correlated with critical densities. \textbullet\; The outflow velocities measured from [\ion{Si}{6}] emission are generally faster than those measured from [\ion{O}{3}]. This indicates the presence of a decelerating outflow. We also find that the galaxies with the highest [\ion{Si}{6}] luminosity also have the fastest outflows measured in [\ion{O}{3}]. \textbullet\; Examination of ionization models reveals that NIR emission line ratios of our sample are more consistent with AGN models than with shock + precursor models. This indicates that AGN are the main ionizing source, though a smaller contribution from shocks cannot be formally dismissed. \textbullet\; The lack of CN absorption at 1.1 $\mu$m suggests a lack of young/intermediate (0.3 -- 2.0 Gyr) circumnuclear stars in our sample. This goes against the scenario where the outflows are produced by starburst activity, suggesting AGN as the main driving force of the outflows. \acknowledgments We thank the referee for their time and helpful comments on this work. We also thank Lisa Prato for her assistance with \textsc{REDSPEC} and George Becker for assisting with the NIR reduction pipeline. We thank Dr. Percy Gomez and Dr. Sherry Yeh for supporting our Keck observations. Partial support for this project was provided by the National Science Foundation, under grant No. AST 1817233. S.V. and W. L. acknowledge partial support for this work provided by NASA through grants HST GO-15662.001A and GO-15915.001A from the Space Telescope Science Institute, which is operated by AURA, Inc., under NASA contract NAS 5-26555. We also thank Dr. Randy Campbell and the support provided by the Keck Visiting Scholars Program. 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 authors wish to recognize and acknowledge the very significant cultural role and reverence that the summit of Mauna Kea has always had within the indigenous Hawaiian community. We are most fortunate to have the opportunity to conduct observations from this mountain. Funding for the SDSSI/II has been provided by the Alfred P. Sloan Foundation, the Participating Institutions, the National Science Foundation, the U.S. Department of Energy, the National Aeronautics and Space Administration, the Japanese Monbukagakusho, the Max Planck Society, and the Higher Education Funding Council for England. The SDSS WebSite is \url{http://www.sdss.org/}. The SDSS is managed by the Astrophysical Research Consortium for the Participating Institutions. The Participating Institutions are the American Museum of Natural History, Astrophysical Institute Potsdam, University of Basel, University of Cambridge, Case Western Reserve University, University of Chicago, Drexel University, Fermilab, The Institute for Advanced Study, the Japan Participation Group, Johns Hopkins University, The Joint Institute for Nuclear Astrophysics, the Kavli Institute for Particle Astrophysics and Cosmology, the Korean Scientist Group, the Chinese Academy of Sciences (LAMOST), Los Alamos National Laboratory, the Max Planck Institute for Astronomy (MPIA), the Max Planck Institute for Astrophysics (MPA), New Mexico State University, Ohio State University, University of Pittsburgh, University of Portsmouth, Princeton University, the United States Naval Observatory, and the University of Washington. \software{\textsc{BADASS} \citep{Sexton2020} \url{https://github.com/remingtonsexton/BADASS2}), \textsc{pPXF} \citep{Peng2002, Peng2010}, \textsc{PyRAF} (PyRAF is a product of the Space Telescope Science Institute, which is operated by AURA for NASA), \textsc{REDSPEC} (\url{https://www2.keck.hawaii.edu/inst/nirspec/redspec.html})}
\section{Proofs From Section \ref{sec:model}} \label{app:clm} \convexity* \begin{proof}[Proof of Claim~\ref{clm:convexity}] Fix any $\vec{\epsilon}$ such that $\epsilon_j$ is a concave mapping of $\mathcal{H}$. We use induction on $j$ to prove this claim. The base case $j=0$ follows from the assumption that $\mathcal{H}$ is convex. Now suppose $\mathcal{F}_{(j-1)}^{\vec{\epsilon}}$ is convex for some $j \ge 1$. Let $h_1, h_2 \in \mathcal{F}_{(j)}^{\vec{\epsilon}}$ and $\alpha \in (0,1)$. We want to show that $f:=\alpha h_1 + (1-\alpha)h_2 \in \mathcal{F}_{(j)}^{\vec{\epsilon}}$. First note that $f \in \mathcal{F}_{(j-1)}^{\vec{\epsilon}}$ because $h_1, h_2 \in \mathcal{F}_{(j)}^{\vec{\epsilon}} \subseteq \mathcal{F}_{(j-1)}^{\vec{\epsilon}}$. We also have that \begin{align*} \max_{ \left\{ i_1, \ldots, i_j \right\} \subseteq [K] } \sum_{r=1}^j L_{i_r} (f) &\le \max_{ \left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j \left\{ \alpha L_{i_r} (h_1) + (1-\alpha) L_{i_r} (h_2) \right\} \\ &\le \alpha \cdot \max_{ \left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (h_1) + (1-\alpha) \cdot \max_{ \left\{ i_1, \ldots, i_j \right\} \subseteq [K] } \sum_{r=1}^j L_{i_r} (h_2) \\ &\le \min_{g \in \mathcal{F}_{(j-1)}^{\vec{\epsilon}} } \max_{\left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (g) + \alpha \epsilon_j (h_1) + (1-\alpha) \epsilon_j (h_2) \\ &\le \min_{g \in \mathcal{F}_{(j-1)}^{\vec{\epsilon}} } \max_{\left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (g) + \epsilon_j (f) \end{align*} \noindent as desired, where the first inequality follows by convexity of $L_z$, the third inequality follows because $h_1, h_2 \in \mathcal{F}_{(j)}^{\vec{\epsilon}}$, and the last one follows by conacvity of $\epsilon_j$. This establishes our claim. \end{proof} \relationship* \begin{proof}[Proof of Claim~\ref{clm:relationship}] Let $\vec{\epsilon} = \vec{0}$. Before we prove the claim, note that we can use the fact that $\bar{h}$ is an ordering of the losses to omit the maximization terms in the definition of (convex approximate) $\mathcal{F}_{(j)}^{\vec{\epsilon}}$ and rewrite it for $j \ge 1$ as follows: \[ \mathcal{F}_{(j)}^{\vec{\epsilon}} = \left\{ h \in \mathcal{F}_{(j-1)}^{\vec{\epsilon}}: \sum_{r=1}^j L_{\bar{h}(r)} (h) \le \min_{g \in \mathcal{F}_{(j-1)}^{\vec{\epsilon}} } \sum_{r=1}^j L_{\bar{g}(r)} (g) + \epsilon_j \right\} \] This formulation of $\mathcal{F}_{(j)}^{\vec{\epsilon}}$ helps us establish the claim that $\mathcal{H}_{(j)}^{\vec{0}} = \mathcal{F}_{(j)}^{\vec{0}}$. Now we use induction on $j$ to prove the claim. Note that $\mathcal{H}_{(0)}^{\vec{0}} = \mathcal{F}_{(0)}^{\vec{0}} = \mathcal{H}$ and $\mathcal{H}_{(1)}^{\vec{0}} = \mathcal{F}_{(1)}^{\vec{0}}$ trivially hold. Now suppose $\mathcal{H}_{(j-1)}^{\vec{0}} = \mathcal{F}_{(j-1)}^{\vec{0}}$ for some $j \ge 2$. We will show that $\mathcal{F}_{(j)}^{\vec{0}} \subseteq \mathcal{H}_{(j)}^{\vec{0}}$ and $\mathcal{H}_{(j)}^{\vec{0}} \subseteq \mathcal{F}_{(j)}^{\vec{0}}$. Let $f \in \mathcal{F}_{(j)}^{\vec{0}}$. First, we have that $f \in \mathcal{H}_{(j-1)}^{\vec{0}} = \mathcal{F}_{(j-1)}^{\vec{0}}$. Second, \begin{align*} L_{\bar{f}(j)} (f) &= \sum_{r=1}^j L_{\bar{f}(r)} (f) - \sum_{r=1}^{j-1} L_{\bar{f}(r)} (f) \\ &= \min_{g \in \mathcal{F}_{(j-1)}^{\vec{0}} } \sum_{r=1}^j L_{\bar{g}(r)} (g) - \sum_{r=1}^{j-1} L_{\bar{f}(r)} (f) \\ &= \min_{g \in \mathcal{F}_{(j-1)}^{\vec{0}} } \left\{ L_{\bar{g}(j)} (g) + \sum_{r=1}^{j-1} L_{\bar{g}(r)} (g) \right\} - \sum_{r=1}^{j-1} L_{\bar{f}(r)} (f) \\ &= \min_{g \in \mathcal{F}_{(j-1)}^{\vec{0}} } L_{\bar{g}(j)} (g) \\ &= \min_{g \in \mathcal{H}_{(j-1)}^{\vec{0}} } L_{\bar{g}(j)} (g) \end{align*} implying that $f \in \mathcal{H}_{(j)}^{\vec{0}}$. Note that the second equation follows because $f \in \mathcal{F}_{(j)}^{\vec{0}}$. The fourth one follows because for all $g \in \mathcal{F}_{(j-1)}^{\vec{0}}$, $\sum_{r=1}^{j-1} L_{\bar{g}(r)} (g) = \sum_{r=1}^{j-1} L_{\bar{f}(r)} (f)$. The last one follows because $\mathcal{H}_{(j-1)}^{\vec{0}} = \mathcal{F}_{(j-1)}^{\vec{0}}$ by induction assumption. So far we have showed that $\mathcal{F}_{(j)}^{\vec{0}} \subseteq \mathcal{H}_{(j)}^{\vec{0}}$. It remains to show that $\mathcal{H}_{(j)}^{\vec{0}} \subseteq \mathcal{F}_{(j)}^{\vec{0}}$ too. Suppose $f \in \mathcal{H}_{(j)}^{\vec{0}}$. First, note that $f \in \mathcal{F}_{(j-1)}^{\vec{0}} = \mathcal{H}_{(j-1)}^{\vec{0}}$. We also have that \begin{align*} \sum_{r=1}^j L_{\bar{f}(r)} (f) &= \sum_{r=1}^j \min_{g \in \mathcal{H}_{(r-1)}^0 } L_{\bar{g}(r)} (g) \\ &\le \sum_{r=1}^j \min_{g \in \mathcal{H}_{(j-1)}^{\vec{0}} } L_{\bar{g}(r)} (g) \\ &\le \min_{g \in \mathcal{H}_{(j-1)}^{\vec{0}} } \sum_{r=1}^j L_{\bar{g}(r)} (g) \\ &= \min_{g \in \mathcal{F}_{(j-1)}^{\vec{0}} } \sum_{r=1}^j L_{\bar{g}(r)} (g) \end{align*} implying that $f \in \mathcal{F}_{(j)}^{\vec{0}}$. Here, the first equation and the first inequality follow because $f \in \mathcal{H}_{(j)}^{\vec{0}}$ and that $\mathcal{H}_{(j)}^{\vec{0}} \subseteq \mathcal{H}_{(j-1)}^{\vec{0}} \subseteq \ldots \subseteq \mathcal{H}_{(0)}^{\vec{0}}$. The last equation follows by induction assumption that $\mathcal{H}_{(j-1)}^{\vec{0}} = \mathcal{F}_{(j-1)}^{\vec{0}}$. So we have showed that $\mathcal{H}_{(j)}^{\vec{0}} \subseteq \mathcal{F}_{(j)}^{\vec{0}}$ and this completes the proof. \end{proof} \section{Proofs from Section \ref{sec:finding}} \label{app:finding} \thmdunno* \begin{proof}[Proof of Theorem~\ref{thm:dunno}] We first show the following Lemma: \begin{lemma}\label{lem:aux} Let $x_{+} \triangleq \max (x,0)$ for $x \in \mathbb{R}$. We have that the strategies $((\hat{h}, \hat{\eta}_j), \hat{\lambda})$ satisfy the following: \[ \sum_{r=1}^{j} \sum_{\{i_1,\ldots,i_r\} \subseteq [K]} \hat{\lambda}_{\{i_1,i_2, \ldots,i_r\}} \cdot \left( L_{i_1} (\hat{h}) + \ldots + L_{i_r} (\hat{h}) - \hat{\eta}_r \right) \ge B \max_{\overset{1 \le r \le j}{\{i_1,\ldots,i_r\} \subseteq [K]}} \left( L_{i_1} (\hat{h}) + \ldots + L_{i_r} (\hat{h}) - \hat{\eta}_r \right)_{+} - \nu \] \end{lemma} \begin{proof}[Proof of Lemma~\ref{lem:aux}] Let $\lambda \in \Lambda_j$ be the best response of the Auditor to $(\hat{h}, \hat{\eta}_j)$: $\lambda = \lambda_\text{best} (\hat{h}, \hat{\eta}_j)$. Then we have by the $\nu$-approximate equilibrium guarantee that \[ \mathcal{L}_j \left( (\hat{h}, \hat{\eta}_j), \hat{\lambda} \right) \ge \mathcal{L}_j \left( (\hat{h}, \hat{\eta}_j), \lambda \right) - \nu \] The proof is complete by expanding the Lagrangian terms in the above inequality. We have \[ \mathcal{L}_j \left( (\hat{h}, \hat{\eta}_j), \hat{\lambda} \right) = \hat{\eta}_j + \sum_{r=1}^j \sum_{\{i_1, \ldots, i_r\} \subseteq [K]} \hat{\lambda}_{\{i_1, i_2, \ldots, i_r\}} \cdot \left( L_{i_1} (\hat{h}) + \ldots + L_{i_r} (\hat{h}) - \hat{\eta}_r \right) \] and \begin{align*} \mathcal{L}_j \left( (\hat{h}, \hat{\eta}_j), \lambda \right) &= \hat{\eta}_j + \sum_{r=1}^j \sum_{\{i_1, \ldots, i_r\} \subseteq [K]} \lambda_{\{i_1, i_2, \ldots, i_r\}} \cdot \left( L_{i_1} (\hat{h}) + \ldots + L_{i_r} (\hat{h}) - \hat{\eta}_r \right) \\ &= \hat{\eta}_j + B \max_{\overset{1 \le r \le j}{\{i_1,\ldots,i_r\} \subseteq [K]}} \left( L_{i_1} (\hat{h}) + \ldots + L_{i_r} (\hat{h}) - \hat{\eta}_r \right)_{+} \end{align*} where the second equation follows by the definition of $\lambda$. \end{proof} With this Lemma in hand we can prove the theorem. Let $(h,\eta_j)$ be any feasible solution to the optimization problem~\eqref{eq:opt-problem}. We have that \[ \mathcal{L}_j \left( (h, \eta_j), \hat{\lambda} \right) \le \eta_j \] because all of the components of $\hat{\lambda} \in \Lambda_j$ are nonnegative and that the constraints of \eqref{eq:opt-problem} are all satisfied by $(h,\eta_j)$. We also have by the $\nu$-approximate equilibrium guarantee that \begin{equation}\label{eq:upper} \mathcal{L}_j \left( (\hat{h}, \hat{\eta}_j), \hat{\lambda} \right) \le \mathcal{L}_j \left( (h, \eta_j), \hat{\lambda} \right) + \nu \le \eta_j + \nu \end{equation} But Lemma~\ref{lem:aux} implies the following lower bound on $\mathcal{L}_j \left( (\hat{h}, \hat{\eta}_j), \hat{\lambda} \right)$: \begin{align}\label{eq:lower} \begin{split} \mathcal{L}_j \left( (\hat{h}, \hat{\eta}_j), \hat{\lambda} \right) &= \hat{\eta}_j + \sum_{r=1}^{j} \sum_{\{i_1,\ldots,i_r\} \subseteq [K]} \hat{\lambda}_{\{i_1,i_2, \ldots,i_r\}} \cdot \left( L_{i_1} (\hat{h}) + \ldots + L_{i_r} (\hat{h}) - \hat{\eta}_r \right) \\ &\ge \hat{\eta}_j + B \max_{\overset{1 \le r \le j}{\{i_1,\ldots,i_r\} \subseteq [K]}} \left( L_{i_1} (\hat{h}) + \ldots + L_{i_r} (\hat{h}) - \hat{\eta}_r \right)_{+} - \nu \\ &\ge \hat{\eta}_j - \nu \end{split} \end{align} Combining Equations~\eqref{eq:upper} and \eqref{eq:lower} implies $ \hat{\eta}_j \le \eta_j + 2\nu $, and since this condition holds for every feasible $(h, \eta_j)$, we get that \[ \hat{\eta}_j \le OPT_j \left( \eta_1, \ldots, \eta_{j-1} \right) + 2\nu \] which proves the first part of the theorem. Once again using Equations~\eqref{eq:upper} and \eqref{eq:lower}, \begin{align*} \max_{\overset{1 \le r \le j}{\{i_1,\ldots,i_r\} \subseteq [K]}} \left( L_{i_1} (\hat{h}) + \ldots + L_{i_r} (\hat{h}) - \hat{\eta}_r \right) &\le \max_{\overset{1 \le r \le j}{\{i_1,\ldots,i_r\} \subseteq [K]}} \left( L_{i_1} (\hat{h}) + \ldots + L_{i_r} (\hat{h}) - \hat{\eta}_r \right)_{+} \\ &\le \frac{\eta_j - \hat{\eta}_j + 2\nu}{B} \\ &\le \frac{jL_M + 2\nu}{B} \end{align*} where we use the fact that $\eta_j, \hat{\eta}_j \in [0, jL_M]$. In other words, for all $r \le j$ we have the following guarantee: \[ \max_{\left\{ i_1, \ldots, i_r \right\} \subseteq [K]} \sum_{s=1}^r L_{i_r} (\hat{h}) \le \hat{\eta}_{r} + \frac{jL_M + 2 \nu}{B}. \] \end{proof} \section{Proofs from Section \ref{sec:reg}} \label{app:reg} \regthm* \begin{proof} We will show that for every round $j$, the model $\hat{\theta}_j$ computed by our algorithm is $(j,\alpha)$-convex lexicographic fair, and as a consequence, the very last model ($\hat{\theta}_\ell$) is $(\ell,\alpha)$-convex lexicographic fair. Fix any round $j \le \ell$. Let $(\theta^t, \eta_j^t, \lambda^t)_{t=1}^T$ be the sequence of plays in the no-regret dynamics of Algorithm~\ref{alg:nr-regression} in this round. First, note that by the decomposition given in Equation~\eqref{eq:decomposition}, we have \begin{align*} &\sum_{t=1}^T \mathcal{L}_j \left( (\theta^t, \eta_j^t), \lambda^t \right) - \min_{\theta \in \Theta, \eta_j \in [0, j\cdot L_M]} \sum_{t=1}^T \mathcal{L}_j \left( (\theta, \eta_j), \lambda^t \right) \\ &= \left\{ \sum_{t=1}^T \mathcal{L}_j^1 \left( \theta^t, \lambda^t \right) - \min_{\theta \in \Theta} \sum_{t=1}^T \mathcal{L}_j^1 \left( \theta, \lambda^t \right) \right\} + \left\{ \sum_{t=1}^T \mathcal{L}_j^2 \left( \eta_j^t, \lambda^t \right) - \min_{\eta_j \in [0, j\cdot L_M]} \sum_{t=1}^T \mathcal{L}_j^2 \left( \eta_j, \lambda^t \right) \right\} \end{align*} In other words, we can decompose the regret of the Learner into two terms: one is the regret of gradient descent plays corresponding to $\theta$, and the other one is the corresponding regret of gradient descent plays for $\eta_j$. Note that by Equations~\eqref{eq:grad-model} and \eqref{eq:grad-eta} we have the following bounds on the norm of gradients for the Learner. We also use the fact that when the Auditor is best responding, $w_r (\lambda^t)$ can be simplified as in Fact~\ref{fact:efficient}. \[ \left\Vert \nabla_\theta \mathcal{L}_j \left( (\theta, \eta_j), \lambda^t \right) \right\Vert_2 \le \sum_{r=1}^K \left\vert w_r (\lambda^t) \right\vert \cdot \left\Vert \nabla_\theta L_r (\theta) \right\Vert_2 \le j B G \] \[ \left\Vert \nabla_{\eta_j} \mathcal{L}_j \left( (\theta, \eta_j), \lambda^t \right) \right\Vert_2 = \left\vert 1 - \sum_{\{i_1, \ldots, i_j\} \subseteq [K]} \lambda^t_{\{i_1, i_2, \ldots, i_j\}} \right\vert \le 1 + B \] Now letting $\eta = \frac{D}{jBG\sqrt{T}}$ and $\eta' = \frac{jL_M}{(1+B)\sqrt{T}}$ in Algorithm~\ref{alg:nr-regression} and using the regret bound of Online Projected Gradient Desccent (Theorem~\ref{thm:gdregret}), we have \[ \sum_{t=1}^T \mathcal{L}_j^1 \left( \theta^t, \lambda^t \right) - \min_{\theta \in \Theta} \sum_{t=1}^T \mathcal{L}_j^1 \left( \theta, \lambda^t \right) \le jBGD\sqrt{T} \] \[ \sum_{t=1}^T \mathcal{L}_j^2 \left( \eta_j^t, \lambda^t \right) - \min_{\eta_j \in [0, j\cdot L_M]} \sum_{t=1}^T \mathcal{L}_j^2 \left( \eta_j, \lambda^t \right) \le j (B+1) L_M \sqrt{T} \] and therefore the regret of the Learner can be bounded by \[ \sum_{t=1}^T \mathcal{L}_j \left( (\theta^t, \eta_j^t), \lambda^t \right) - \min_{\theta \in \Theta, \eta_j \in [0, j\cdot L_M]} \sum_{t=1}^T \mathcal{L}_j \left( (\theta, \eta_j), \lambda^t \right) \le j (GD + L_M) (B+1) \sqrt{T} :=\nu_j T \] Let $\nu_j \triangleq j (GD + L_M) (B+1) / \sqrt{T}$. Now using the guarantees of the no-regret dynamics (Theorem~\ref{thm:noregret}), the average play of the players $(\hat{\theta}, \hat{\eta}_j, \hat{\lambda})$ forms a $\nu_j$-approximate equilibrium of the game in the sense that \[ \mathcal{L}_j \left( (\hat{\theta}, \hat{\eta}_j), \hat{\lambda} \right) \le \min_{\theta \in \Theta, \eta_j \in [0, j\cdot L_M]} \mathcal{L}_j \left( (\theta, \eta_j), \hat{\lambda} \right) + \nu_j, \quad \mathcal{L}_j \left( (\hat{\theta}, \hat{\eta}_j), \hat{\lambda} \right) \ge \max_{\lambda \in \Lambda_j} \mathcal{L}_j \left( (\hat{\theta}, \hat{\eta}_j), \lambda \right) - \nu_j \] Finally, using Theorem~\ref{thm:dunno} we can turn these into the following guarantees. First, \begin{equation}\label{eq:firstbound} \hat{\eta}_j \le OPT_j \left( \hat{\eta}_1, \ldots, \hat{\eta}_{j-1} \right) + 2\nu_j \end{equation} and second, for all $r \le j$, \begin{equation}\label{eq:secondbound} \max_{\left\{ i_1, \ldots, i_r \right\} \subseteq [K]} \sum_{s=1}^r L_{i_r} (\hat{\theta}_j) \le \hat{\eta}_{r} + \frac{jL_M + 2 \nu_j}{B} \end{equation} Define $\epsilon_r \triangleq \hat{\eta}_r - OPT_r \left( \hat{\eta}_1, \ldots, \hat{\eta}_{r-1} \right)$ for all $r \le j$ ($\epsilon$'s here are basically \emph{constant} mappings in $\mathbb{R}^\mathcal{H}$). We immediately have from Equation~\eqref{eq:firstbound} that: $\epsilon_r \le 2 \nu_r$, for all $r \le j$. Now let $\vec{\epsilon} = (\epsilon_1, \ldots, \epsilon_j)$, and let $\mathcal{F}_{(0)}^{\vec{\epsilon}} = \Theta$ be the initial model class. Note that according to Definition~\ref{def:convexlexifair} and given the defined $\vec{\epsilon}$, we have for every $r \le j$, \[ \min_{\theta \in \mathcal{F}_{(r-1)}^{\vec{\epsilon}} } \max_{\left\{ i_1, \ldots, i_r \right\} \subseteq [K]} \sum_{s=1}^r L_{i_r} (\theta) \equiv OPT_r \left( \hat{\eta}_1, \ldots, \hat{\eta}_{r-1} \right) \] And therefore, by Equation~\eqref{eq:secondbound}, for all $r \le j$: \begin{align*} \max_{\left\{ i_1, \ldots, i_r \right\} \subseteq [K]} \sum_{s=1}^r L_{i_r} (\hat{\theta}_j) &\le \hat{\eta}_{r} + \frac{j L_M + 2 \nu_r}{B} \\ &= OPT_r \left( \hat{\eta}_1, \ldots, \hat{\eta}_{r-1} \right) + \epsilon_r + \frac{j L_M + 2 \nu_r}{B} \\ &= \min_{g \in \mathcal{F}_{(r-1)}^{\vec{\epsilon}} } \max_{\left\{ i_1, \ldots, i_r \right\} \subseteq [k]} \sum_{s=1}^r L_{i_r} (g) + \epsilon_r + \frac{j L_M + 2 \nu_r}{B} \end{align*} which completes the proof by the choice of $\nu_r = \frac{ \alpha}{2}$ for all $r \le j$ (to guarantee that $\Vert \vec{\epsilon} \Vert_\infty \le \alpha$), and $B= \frac{\alpha + j L_M}{\alpha}$. Note that this setting of parameters, together with $\nu_j = j (GD + L_M) (B+1) / \sqrt{T}$, implies that \[ T = \frac{4 j^2 (GD + L_M)^2 (2 \alpha + j L_M)^2}{\alpha^4} \] \end{proof} \section{Proofs from Section \ref{sec:class}} \label{app:class} \mainthm* \begin{proof} We will show that for any round $j$, the model $\hat{\theta}_j$ computed by Algorithm~\ref{alg:fair-classification} is $(j,\alpha)$-convex lexifair. Fix any round $j$. We prove the claim in the following steps. \begin{enumerate} \item \emph{The Learner's regret}: First, we invoke Theorem~\ref{thm:ftplregret} (the regret guarantee of the FTPL algorithm) and the fact that the payoff function of the game (the Lagrangian $\mathcal{L}_j$) is separable for the Learner, to write the expected regret of the distributions maintained by the Learner's FTPL algorithm, i.e. ($p^1, \ldots, p^T$) and $(D^1, \ldots, D^T)$, as follows: \begin{align*} R_L &\triangleq \frac{1}{T}\sum_{t=1}^T \mathbb{E}_{h \sim p^t, \eta_j \sim D^t} \left[ \mathcal{L}_j \left( (h,\eta_j), \lambda^t \right) \right] - \frac{1}{T} \min_{h \in \mathcal{H} (S), \eta_j \in \{0,j\}} \sum_{t=1}^T \mathcal{L}_j \left( (h,\eta_j), \lambda^t \right) \\ &\le \frac{2 n^{3/2} B}{n_{min} \sqrt{T}} + \frac{2 (1+B)}{\sqrt{T}} \end{align*} Note that we have $\vert c_i (\lambda) \vert \le B/n_{min}$ where $n_{min} \triangleq \min_{1 \le k \le K} n_k$ is the smallest group size, and $\vert c (\lambda) \vert \le 1 + B$. Also, note that the above regret guarantee holds for the following choices of the learning rates $\eta$ and $\eta'$ for the FTPL algorithm. \[ \eta = \frac{n_{min}}{B} \sqrt{\frac{1}{nT}} \quad \text{and} \quad \eta' = \frac{1}{1+B} \sqrt{\frac{1}{T}} \] \item \emph{The Auditor's regret}: At each round $t$ of the game, the Auditor is best responding to $(\hat{p}^t, D^t)$ of the Learner where $\hat{p}^t$ is the empirical distribution of the $m$ sampled hypotheses from $p^t$. Therefore, the Auditor is \emph{approximately} best responding to $(p^t, D^t)$, and consequently, it is accumulating some regret over the course of the algorithm. We show the Auditor's regret is small using a uniform convergence bound which holds with high probability over the random draws of the $m$ sampled hypotheses from $p^t$. We first remind the reader of Chernoff-Hoeffding's concentration bound in Lemma~\ref{lem:chernoff}, and then move on to argue about the uniform convergence bound in Lemma~\ref{lem:concentration}. Finally, the Auditor's regret is computed in Lemma~\ref{lem:auditorregret} using the result of Lemma~\ref{lem:concentration}. \begin{lemma}[Chernoff-Hoeffding's Concentration]\label{lem:chernoff} Let $X_1, X_2, \ldots, X_n$ be $i.i.d.$ draws from a distribution with mean $\mu$ and support $[a,b] \subset \mathbb{R}$. We have that with probability at least $1-\delta$ over the random draws, \[ \left\vert \frac{1}{n} \sum_{i=1}^n X_i - \mu \right\vert \le (b-a) \sqrt{\frac{\log \left( 2 / \delta \right)}{2n}} \]. \end{lemma} \begin{lemma}\label{lem:concentration} Let $p$ be any distribution over $\mathcal{H}(S)$, and let $\hat{p}$ be the empirical distribution of $m$ $i.i.d.$ draws from $p$. We have that for any $\delta$, with probability at least $1-\delta$ over the random draws from $p$, for any distribution $D$ over the interval $[0,j]$, \[ \max_{\lambda \in \Lambda_j} \left\vert \mathbb{E}_{h \sim \hat{p}, \eta_j \sim D} \left[ \mathcal{L}_j \left( (h,\eta_j), \lambda \right) \right] - \mathbb{E}_{h \sim p, \eta_j \sim D} \left[ \mathcal{L}_j \left( (h,\eta_j), \lambda \right) \right] \right\vert \le KB\sqrt{\frac{\log \left( 2K/\delta\right)}{2m}}. \] \end{lemma} \begin{proof}[Proof of Lemma~\ref{lem:concentration}] We have that for any $\lambda \in \Lambda_j$, by the decomposition given in Equation~\ref{eq:decomposition}, \begin{align*} \left\vert \mathbb{E}_{h \sim \hat{p}, \eta_j \sim D} \left[ \mathcal{L}_j \left( (h,\eta_j), \lambda \right) \right] - \mathbb{E}_{h \sim p, \eta_j \sim D} \left[ \mathcal{L}_j \left( (h,\eta_j), \lambda \right) \right] \right\vert &= \left\vert \mathbb{E}_{h \sim \hat{p}} \left[ \mathcal{L}_j^1 \left( h, \lambda \right) \right] - \mathbb{E}_{h \sim p} \left[ \mathcal{L}_j^1 \left( h, \lambda \right) \right] \right\vert \\ &\le \sum_{r=1}^K \left\vert w_r (\lambda) \right\vert \cdot \left\vert \mathbb{E}_{h \sim \hat{p}} \left[ L_r (h)\right] - \mathbb{E}_{h \sim p} \left[ L_r (h)\right] \right\vert \\ &\le B \sum_{r=1}^K \left\vert \mathbb{E}_{h \sim \hat{p}} \left[ L_r (h)\right] - \mathbb{E}_{h \sim p} \left[ L_r (h)\right] \right\vert \\ &\le KB\sqrt{\frac{\log \left( 2K/\delta\right)}{2m}} \end{align*} where the last inequality holds with probability $1-\delta$ and follows from Lemma~\ref{lem:chernoff} and a union bound. \end{proof} \begin{lemma}[Auditor's Regret]\label{lem:auditorregret} Let ($p^1, \ldots, p^T$) and $(D^1, \ldots, D^T)$ be the sequence of distributions maintained by the Learner's FTPL algorithm, and let $\left( \lambda^1, \lambda^2, \ldots, \lambda^T\right)$ be the sequence of Auditor's plays in Algorithm~\ref{alg:nr-classification}. We have that for every $\delta$, with probability at least $1-\delta/2$, the regret of the Auditor is bounded as follows: \begin{align*} R_A &\triangleq \frac{1}{T} \max_{\lambda \in \Lambda_j} \sum_{t=1}^T \mathbb{E}_{h \sim p^t, \eta_j \sim D^t} \left[ \mathcal{L}_j \left( (h,\eta_j), \lambda \right) \right] - \frac{1}{T} \sum_{t=1}^T \mathbb{E}_{h \sim p^t, \eta_j \sim D^t} \left[ \mathcal{L}_j \left( (h,\eta_j), \lambda^t \right) \right] \\ &\le KB\sqrt{\frac{2\log \left( 4KT/\delta\right)}{m}} \end{align*} \end{lemma} \begin{proof}[Proof of Lemma~\ref{lem:auditorregret}] We know that the regret of the Auditor to $(\hat{p}^1, \ldots, \hat{p}^T)$ and $(D^1, \ldots, D^T)$ is zero. In other words, \[ \max_{\lambda \in \Lambda_j} \sum_{t=1}^T \mathbb{E}_{h \sim \hat{p}^t, \eta_j \sim D^t} \left[ \mathcal{L}_j \left( (h,\eta_j), \lambda \right) \right] - \sum_{t=1}^T \mathbb{E}_{h \sim \hat{p}^t, \eta_j \sim D^t} \left[ \mathcal{L}_j \left( (h,\eta_j), \lambda^t \right) \right] \le 0 \] We have by Lemma~\ref{lem:concentration} that, with probability at least $1-\delta$, for any $\lambda \in \Lambda_j$, \begin{align*} &\left\vert \mathbb{E}_{h \sim \hat{p}^t, \eta_j \sim D^t} \left[ \mathcal{L}_j \left( (h,\eta_j), \lambda \right) \right] - \mathbb{E}_{h \sim p^t, \eta_j \sim D^t} \left[ \mathcal{L}_j \left( (h,\eta_j), \lambda \right) \right] \right\vert \le KB\sqrt{\frac{\log \left( 2K/\delta\right)}{2m}} \end{align*} A union bound over $t \in [T]$ completes the proof. \end{proof} We can now continue with the remaining steps of the proof. \item \emph{Equilibrium guarantees of the average play}: Let $\bar{p} = \frac{1}{T} \sum_{t=1}^t p^t $ and $\bar{D} = \frac{1}{T} \sum_{t=1}^t D^t$ and $\bar{\lambda} = \frac{1}{T} \sum_{t=1}^t \lambda^t$ form the average play of the players. We have that $((\bar{p}, \bar{D}), \bar{\lambda})$ is a $(R_L+R_A)$-approximate equilibrium of the game by Theorem~\ref{thm:noregret}. \item \emph{Additional error due to sampling from $\bar{p}$}: Finally, the algorithm outputs a sparse version of $\bar{p}$: $\hat{p}$ which is the empirical distribution over $m$ $i.i.d.$ draws from $\bar{p}$. We need to show that the additional regret (let's call it $R$) due to this approximation is small. But note we can simply bound $R$ by Lemma~\ref{lem:concentration}: for any $\delta$, with probability at least $1-\delta/2$, we have \[ R \le KB\sqrt{\frac{2\log \left( 4K/\delta\right)}{m}}. \] \item \emph{Final equilibrium guarantees}: We have that strategies of the players $((\hat{p}, \bar{D}), \bar{\lambda})$ form a $(R_L + R_A + R)$-approximate equilibrium of the game where, \[ R_L + R_A + R \le \nu \triangleq \frac{2 n^{3/2} B}{n_{min} \sqrt{T}} + \frac{2 (1+B)}{\sqrt{T}} + KB\sqrt{\frac{2\log \left( 4KT/\delta\right)}{m}} + KB\sqrt{\frac{2\log \left( 4K/\delta\right)}{m}}. \] \item The rest of the proof is similar to the proof of Theorem~\ref{thm:lexifair-reg}. In particular, similar to the proof of Theorem~\ref{thm:lexifair-reg}, we can now apply Theorem~\ref{thm:dunno} to get turn the equilibrium guarantees into the following guarantees for our lexifair notion: with probability at least $1-\delta$, \begin{equation}\label{eq:firstbound2} \hat{\eta}_j \le OPT_j \left( \hat{\eta}_1, \ldots, \hat{\eta}_{j-1} \right) + 2\nu, \end{equation} and second, for all $r \le j$, \begin{equation}\label{eq:secondbound2} \max_{\left\{ i_1, \ldots, i_r \right\} \subseteq [K]} \sum_{s=1}^r L_{i_r} (\hat{p}_j) \le \hat{\eta}_{r} + \frac{j + 2 \nu}{B}. \end{equation} Define $\epsilon_r \triangleq \hat{\eta}_r - OPT_r \left( \hat{\eta}_1, \ldots, \hat{\eta}_{r-1} \right)$ for all $r \le j$. We immediately have from Equation~\eqref{eq:firstbound2} and a union bound that: with probability at least $1-\delta$, $\epsilon_r \le 2 \nu'$, for all $r \le j$, where \[ \nu' = \frac{2 n^{3/2} B}{n_{min} \sqrt{T}} + \frac{2 (1+B)}{\sqrt{T}} + KB\sqrt{\frac{2\log \left( 4jKT/\delta\right)}{m}} + KB\sqrt{\frac{2\log \left( 4jK/\delta\right)}{m}} \ge \nu. \] Note that $\nu'$ is basically $\nu$ with $\delta$ being replaced by $\delta/j$ because of the union bound over the first $j$ rounds. Now let $\vec{\epsilon} = (\epsilon_1, \ldots, \epsilon_j)$, and let $\mathcal{F}_{(0)}^{\vec{\epsilon}} = \Delta \mathcal{H}$ be the initial model class. Note that according to Definition~\ref{def:convexlexifair} and given the defined $\vec{\epsilon}$, we have for every $r \le j$, \[ \min_{p \in \mathcal{F}_{(r-1)}^{\vec{\epsilon}} } \max_{\left\{ i_1, \ldots, i_r \right\} \subseteq [K]} \sum_{s=1}^r L_{i_r} (p) \equiv OPT_r \left( \hat{\eta}_1, \ldots, \hat{\eta}_{r-1} \right) \] And therefore, by Equation~\eqref{eq:secondbound2}, for all $r \le j$: \begin{align*} \max_{\left\{ i_1, \ldots, i_r \right\} \subseteq [K]} \sum_{s=1}^r L_{i_r} (\hat{p}_j) &\le \hat{\eta}_{r} + \frac{j + 2 \nu}{B} \\ &= OPT_r \left( \hat{\eta}_1, \ldots, \hat{\eta}_{r-1} \right) + \epsilon_r + \frac{j + 2 \nu}{B} \\ &= \min_{p \in \mathcal{F}_{(r-1)}^{\vec{\epsilon}} } \max_{\left\{ i_1, \ldots, i_r \right\} \subseteq [k]} \sum_{s=1}^r L_{i_r} (p) + \epsilon_r + \frac{j + 2 \nu}{B} \\ &\le \min_{p \in \mathcal{F}_{(r-1)}^{\vec{\epsilon}} } \max_{\left\{ i_1, \ldots, i_r \right\} \subseteq [k]} \sum_{s=1}^r L_{i_r} (p) + \epsilon_r + \frac{j + 2 \nu'}{B} \end{align*} which completes the proof by the choice of $\nu' = \frac{\alpha}{2}$, and $B= \frac{\alpha + j}{\alpha}$. Note that this setting of parameters implies that \[ m=\frac{K^2 n_{min}^2 T \log \left( 4jKT/\delta\right)}{2 n^3}, \quad T = \frac{256 \left(2 \alpha + j \right)^2 n^3}{\alpha^4 n_{min}^2}. \] \end{enumerate} \end{proof} \section{No-Regret Learning Algorithms} \label{app:gd+ftpl} \subsection{Online Projected Gradient Descent}\label{subsec:gd} Consider an online setting where a learner is playing against an adversary. The learner's action space is some Euclidean subspace $\Theta \subseteq \mathbb{R}^d$ which is equipped with the $\ell_2$ norm denoted by $\left\Vert \cdot \right\Vert_2$. At every round $t$ of the interaction between the learner and the adversary, the learner picks an action $\theta^t \in \Theta$ and the adversary chooses a loss function $\ell^t: \Theta \to \mathbb{R}_{\ge 0}$. The learner then incurs a loss of $\ell^t(\theta^t)$ at that round. Suppose the learner is using some algorithm $\mathcal{A}$ to update its actions from round to round. The goal for the learner is that the regret of $\mathcal{A}$ defined as \[ R_\mathcal{A}(T) \triangleq \sum_{t=1}^T \ell^t (\theta^t) - \min_{\theta \in \Theta} \sum_{t=1}^T \ell^t (\theta) \] grows sublinearly in $T$. When $\Theta$ and the loss functions played by the adversary are convex, a standard choice of algorithm to use for the learner is \emph{Online Projected Gradient Descent} (Algorithm~\ref{alg:descent}), where in each round, the algorithm updates its action $\theta^{t+1}$ for the next round by taking a step in the opposite direction of the gradient of the loss function evaluated at the action of that round: $\nabla \ell^{t} (\theta^{t})$. The updated action is then projected onto the feasible action space $\Theta$: $\text{Proj}_{\Theta} (\theta) \triangleq \argmin_{\theta' \in \Theta} \left\Vert \theta - \theta' \right\Vert_2$. Note if the loss functions are not differentiable, we can use subgradients (which are defined given the convexity of the loss functions) instead of gradients and the guarantees will remain. \begin{algorithm}[t] \KwIn{learning rate $\eta$} Initialize the learner $\theta^1 \in \Theta$\; \For{$t=1, 2, \ldots$}{ Learner plays action $\theta^{t}$\; Adversary plays loss function $\ell^t$\; Learner incurs loss of $\ell^t (\theta^t)$\; Learner updates its action: \[ \theta^{t+1} = \text{Proj}_{\Theta} \left( \theta^{t} - \eta \nabla \ell^{t} (\theta^{t}) \right) \] } \caption{Online Projected Gradient Descent} \label{alg:descent} \end{algorithm} \begin{thm}[Regret for Online Projected Gradient Descent \cite{GD}]\label{thm:gdregret} Suppose $\Theta \subseteq \mathbb{R}^d$ is convex, compact and has bounded diameter $D$: $\sup_{\theta, \theta' \in \Theta} \left\Vert \theta - \theta' \right\Vert_2 \le D$. Suppose for all $t$, the loss functions $\ell^t$ are convex and that there exists some $G$ such that $\left\Vert \nabla \ell^t (\cdot) \right\Vert_2 \le G$. Let $\mathcal{A}$ be Algorithm~\ref{alg:descent} run with learning rate $\eta = D/(G \sqrt{T})$. We have that for every sequence of loss functions $(\ell^1, \ell^2, \ldots, \ell^T)$ played by the adversary, $R_\mathcal{A}(T) \le GD \sqrt{T}$. \end{thm} \subsection{Follow the Perturbed Leader}\label{subsec:ftpl} Follow the Perturbed Leader is another no-regret learning algorithm that can sometimes be applied even when the action space of the learner is too large to run gradient descent (over an appropriately convexified space). In this case, Follow the Perturb Leader can be applied given access to an optimization oracle. Consider an online setting, where again a learner is playing against an adversary. Here assume the learner's action space is $A \subseteq \{0,1\}^d$. At every round $t$, the learner chooses an action $a^t \in A$ and then the adversary plays a loss vector $\ell^t \in \mathbb{R}^d$. The learner then incurs a loss of $\langle \ell^t, a^t \rangle$ which is the inner product if $a^t$ and $\ell^t$. Suppose the learner is using some algorithm $\mathcal{A}$ to pick its actions in every round. The goal for the learner is to ensure that the regret of $\mathcal{A}$ defined as \[ R_\mathcal{A}(T) \triangleq \sum_{t=1}^T \langle \ell^t, a^t \rangle - \min_{a \in \mathcal{A}} \sum_{t=1}^T \langle \ell^t, a \rangle \] grows sublinearly in $T$. \emph{Follow the Perturbed Leader (FTPL)} (\cite{KALAI2005291}), which is described in Algorithm~\ref{alg:ftpl}, can provide guarantees in this setting. This algorithm perturbs the cumulative loss vector with appropriately scaled noise and then picks an action that minimizes the loss. Note that to implement it, we only require the ability to solve for the $\argmin$ --- i.e. we need an optimization oracle. The guarantees of this algorithm are stated below. \begin{algorithm}[t] \KwIn{learning rate $\eta$} Initialize the learner $a^1 \in A$\; \For{t = 1,2, \ldots}{ Learner plays action $a^{t}$\; Adversary plays loss vector $\ell^t$\; Learner incurs loss of $\langle \ell^t, a^t \rangle$\; Learner updates its action: \[ a^{t+1} = \argmin_{a \in A} \left\{ \left\langle \sum_{s \le t} \ell^s , a \right\rangle + \frac{1}{\eta} \left\langle \xi^t , a \right\rangle \right\} \] where $\xi^t \sim Uniform \left( [0,1]^d \right)$, independent of every other randomness. } \caption{Follow the Perturbed Leader (FTPL)} \label{alg:ftpl} \end{algorithm} \begin{thm}[Regret of FTPL \cite{KALAI2005291}]\label{thm:ftplregret} Suppose for all $t$, $\ell^t \in [-M,M]^d$. Let $\mathcal{A}$ be Algorithm~\ref{alg:ftpl} run with learning rate $\eta = 1/(M \sqrt{dT})$. We have that for every sequence of loss vectors $(\ell^1, \ell^2, \ldots, \ell^T)$ played by the adversary, $\mathbb{E} \left[ R_\mathcal{A}(T) \right] \le 2 M d^{3/2} \sqrt{T}$, where expectation is taken with respect to the randomness in $\mathcal{A}$. \end{thm} \section{A Standard Uniform Convergence Theorem} \label{sec:VC} In this section, we state a standard uniform convergence theorem for binary classifiers (with 0/1 loss) that have bounded VC-dimension. We observe that the standard bound easily extends to randomized classifiers (i.e. distributions over classifiers in a finite VC class) because of the linearity of expectation. \begin{thm} \label{thm:generalization} Fix any $\delta>0$. Let $d_\mathcal{H}$ be the VC dimension of the class $\mathcal{H}$, and let $n_1,..,n_K$ be the sample sizes of groups $k=1,...,K$ in sample $S$ drawn from distribution $\mathcal{P}$, and let $n=n_1 + \ldots + n_K$ be the total sample size. Recall that $L_k(h,S)$ denotes the error rate of $h$ on the $n_k$ samples of group $k$ in $S$, and let $L_k(h,\mathcal{P})$ denote the expected error of $h$ with respect to $\mathcal{P}$ conditioned on group $k$. Then with probability at least $1-\delta$ over the randomness of $S$, for every randomized classifier $p \in \Delta \mathcal{H}$, and every group $k \in [K]$: \[ |L_k(p,\mathcal{P}) - L_k(p,S)| = O\left( \sqrt{\frac{\log \left(K/\delta \right) + d_\mathcal{H} \log{n}}{\min_k n_k}}\right) \] \end{thm} \begin{proof} Fix any group $k$. A standard uniform convergence argument tells us that with probability $1-\delta$ over the $n_k$ samples from group $k$, for every (deterministic) $h \in \mathcal{H}$, the generalization gap is of order \cite{vapnik, kearnsVazirani}: \[ |L_k(h,\mathcal{P}) - L_k(h,S) | \leq \epsilon_k = O\left(\sqrt{\frac{\log{(1/\delta)} + d_\mathcal{H} \log n_k}{n_k}}\right) \] Now consider a randomized model $p \in \Delta \mathcal{H}$, which is distribution over $\mathcal{H}$. We have that \[ \left\vert L_k(p,\mathcal{P}) - L_k(p,S) \right\vert = \left\vert \mathbb{E}_{h \sim p} [L_k(h,\mathcal{P})] - \mathbb{E}_{h \sim p} [L_k(h,S)] \right\vert \le \mathbb{E}_{h \sim p} \left\vert L_k(h,\mathcal{P}) - L_k(h,S) \right\vert \] and as a consequence, for every group $k$, we have with probability $1-\delta$ that \[ \max_{p \in \Delta \mathcal{H} }\left\vert L_k(p,\mathcal{P}) - L_k(p,S) \right\vert \le \max_{h \in \mathcal{H} }\left\vert L_k(h,\mathcal{P}) - L_k(h,S) \right\vert \le \epsilon_k \] The proof is complete by a union bound over $K$ groups. \end{proof} \section{A Generalization Theorem for Lexifairness (Definition~\ref{def:lexifair})} \label{sec:lexifair-generalization} In this section we prove a generalization theorem for Definition~\ref{def:lexifair}. The proof style is identical to that of Theorem~\ref{thm:convex-generalization}. We also make use of the following simple fact: \begin{fact}\label{fact:order} Let $a = (a_1, \ldots, a_n)$ and $b = (b_1, \ldots, b_n)$ be such that for all $i$, $|a_i - b_i| \le \epsilon$ for some $\epsilon$. Let $a_{(i)}$ and $b_{(i)}$ denote the $i$'th highest number in $a$ and $b$, respectively. We have that for all $i$, $|a_{(i)} - b_{(i)}| \le \epsilon$. \end{fact} \begin{thm}(Generalization for Lexifairness) Fix any distribution $\mathcal{P}$. Suppose for every $\delta > 0$, there exists $\beta(\delta)$ such that the following uniform convergence bound holds. \[ \Pr_{S} \left[ \max_{h \in \mathcal{H}, k \in [K]} \left\vert L_k \left(h, S \right) - L_k \left(h, \mathcal{P} \right)\right\vert > \beta(\delta) \right] < \delta \] where $S$ is a data set sampled $i.i.d.$ from $\mathcal{P}$. We have that for every data set $S$ sampled $i.i.d.$ from $\mathcal{P}$, if a model $h$ satisfies $(\ell, \alpha)$-lexicographic fairness with respect to $S$, then with probability at least $1-\delta$ it also satisfies $(\ell, \alpha')$-lexicographic fairness with respect to $\mathcal{P}$ for $\alpha' = \alpha + 2 \beta (\delta)$. \end{thm} \begin{proof} Fix a distribution $\mathcal{P}$ and a data set $S$ sampled $i.i.d.$ from $\mathcal{P}$. Suppose $h$ satisfies $(\ell, \alpha)$-lexicographic fairness with respect to $S$. Therefore, according to our lexifairness definition, there exists a sequence of mappings $\vec{\epsilon} = (\epsilon_1, \ldots, \epsilon_\ell)$ where $\epsilon_j \in \mathbb{R}^{\mathcal{H}}$, and a sequence of function classes $\{\mathcal{H}_{(j)}^{\vec{\epsilon}} (S)\}_j$ such that \[ \max_{1 \le j \le \ell} \left\{ \max_{h' \in \mathcal{H}} \epsilon_j (h') \right\} \le \alpha \] and that for all $j \le \ell$: \begin{equation}\label{eq:something3} L_{\bar{h}_S(j)} (h, S) \le \min_{g \in \mathcal{H}^{\vec{\epsilon}}_{(j-1)} (S)} L_{\bar{g}_S (j)} (g, S) + \epsilon_j (h) + \alpha \end{equation} where recall that $\mathcal{H}^{\vec{\epsilon}}_{(0)} (S) = \mathcal{H}$ and that for all $j \in [\ell]$, \[ \mathcal{H}_{(j)}^{\vec{\epsilon}} (S) = \left\{h' \in \mathcal{H}^{\vec{\epsilon}}_{(j-1)} (S): L_{\bar{h'} _S (j)} (h', S) \le \min_{g \in \mathcal{H}^{\vec{\epsilon}}_{(j-1)} (S)} L_{\bar{g}_S (j)} (g, S) + \epsilon_j (h') \right\} \] Let us define a mapping $\nu_j^1 : \mathcal{H} \to \mathbb{R}$ such that for every $h' \in \mathcal{H}$, \[ \nu_j^1 (h') \triangleq L_{\bar{h'}_\mathcal{P} (j)} (h', \mathcal{P}) - L_{\bar{h'}_S (j)} (h', S) \] I.e., $\nu_j^1 (h')$ is the $j$'th highest error induced by $h'$ on the distribution $\mathcal{P}$ minus the $j$'th highest error induced by $h'$ on the sample $S$. Also define \[ \nu_j^2 \triangleq \min_{g \in \mathcal{H}_{(j-1)}^{\vec{\epsilon}}(S) } L_{\bar{g}_S (j)} (g, S) - \min_{g \in \mathcal{H}_{(j-1)}^{\vec{\epsilon}}(S) } L_{\bar{g}_\mathcal{P} (j)} (g, \mathcal{P}) \] Now define for every $h' \in \mathcal{H}$, $\tau_j (h') \triangleq \epsilon_j (h') + \nu_j^1 (h') + \nu_j^2$ and let $\mathcal{H}_{(j)}^{\vec{\tau}} (\mathcal{P})$ be defined according to our lexifairness definition with the sequence of mappings defined by $\vec{\tau} = (\tau_1, \ldots, \tau_\ell)$. In other words, $\mathcal{H}_{(0)}^{\vec{\tau}} (\mathcal{P}) = \mathcal{H}$, and for all $j \in [\ell]$, \[ \mathcal{H}^{\vec{\tau}}_{(j)} (\mathcal{P}) \triangleq \left\{h' \in \mathcal{H}^{\vec{\tau}}_{(j-1)} (\mathcal{P}): L_{\bar{h'}_\mathcal{P}(j)} (h, \mathcal{P}) \le \min_{g \in \mathcal{H}^{\vec{\tau}}_{(j-1)} (\mathcal{P})} L_{\bar{g}_\mathcal{P} (j)} (g, \mathcal{P}) + \tau_j (h') \right\} \] \begin{clm}\label{clm:something4} For all $j$, $\mathcal{H}_{(j)}^{\vec{\tau}} (\mathcal{P}) = \mathcal{H}_{(j)}^{\vec{\epsilon}} (S)$. \end{clm} \begin{proof} We use induction on $j$. For $j=0$, we have $\mathcal{H}_{(0)}^{\vec{\tau}} (\mathcal{P}) = \mathcal{H}_{(0)}^{\vec{\epsilon}} (S) = \mathcal{H}$. For $j \ge 1$, we have \begin{align*} h' \in \mathcal{H}_{(j)}^{\vec{\tau}} (\mathcal{P}) &\Longleftrightarrow h' \in \mathcal{H}_{(j-1)}^{\vec{\tau}}(\mathcal{P}), \ L_{\bar{h'}_\mathcal{P}(j)} (h, \mathcal{P}) \le \min_{g \in \mathcal{H}^{\vec{\tau}}_{(j-1)} (\mathcal{P})} L_{\bar{g}_\mathcal{P} (j)} (g, \mathcal{P}) + \tau_j (h') \\ &\Longleftrightarrow h' \in \mathcal{H}_{(j-1)}^{\vec{\epsilon}} (S), \ L_{\bar{h'}_\mathcal{P}(j)} (h, \mathcal{P}) \le \min_{g \in \mathcal{H}^{\vec{\epsilon}}_{(j-1)} (S)} L_{\bar{g}_\mathcal{P} (j)} (g, \mathcal{P}) + \tau_j (h') \\ &\Longleftrightarrow h' \in \mathcal{H}_{(j-1)}^{\vec{\epsilon}} (S), \ L_{\bar{h'} _S (j)} (h', S) \le \min_{g \in \mathcal{H}^{\vec{\epsilon}}_{(j-1)} (S)} L_{\bar{g}_S (j)} (g, S) + \epsilon_j (h') \\ &\Longleftrightarrow h' \in \mathcal{H}_{(j)}^{{\vec{\epsilon}}}(S) \end{align*} where the second line follows from the induction assumption ($\mathcal{H}_{(j-1)}^{\vec{\tau}}(\mathcal{P}) = \mathcal{H}_{(j-1)}^{\vec{\vec{\epsilon}}}(S)$) and the third line follows from the definition of $\tau_j$. This establishes our claim. \end{proof} We have that for all $j \le \ell$, the model $h$ satisfies \begin{align*} L_{\bar{h}_\mathcal{P} (j)} (h, \mathcal{P}) &= L_{\bar{h}_S(j)} (h, S) + \nu_j^1 (h) \\ &\le \min_{g \in \mathcal{H}^{\vec{\epsilon}}_{(j-1)} (S)} L_{\bar{g}_S (j)} (g, S) + \epsilon_j (h) + \alpha + \nu_j^1 (h) \\ &= \min_{g \in \mathcal{H}^{\vec{\epsilon}}_{(j-1)} (S)} L_{\bar{g}_\mathcal{P} (j)} (g, \mathcal{P}) + \nu_j^2 + \epsilon_j (h) + \alpha + \nu_j^1 (h) \\ &= \min_{g \in \mathcal{H}^{\vec{\tau}}_{(j-1)} (\mathcal{P})} L_{\bar{g}_\mathcal{P} (j)} (g, \mathcal{P}) + \tau_j (h) + \alpha \end{align*} where the first inequality follows from Equation~\eqref{eq:something3}. The third line follows from the definition of $\nu_j^2$. The last equality follows from Claim~\ref{clm:something4} and the fact that $\tau_j (h) = \epsilon_j (h) + \nu_j^1 (h) + \nu_j^2$. The proof is complete by the uniform convergence bound provided in the theorem statement and the fact that if two vector of group errors (in our case, one computed on the data set $S$ and another on the distribution $\mathcal{P}$) are close component-wise, then their sorted versions are also close component-wise (See Fact~\ref{fact:order}). Therefore, with probability at least $1-\delta$ over the random draws of the data set $S$, we have $\max_{h' \in \mathcal{H}} \vert \nu_j^1 (h') \vert \le \beta(\delta)$ and $\vert \nu_j^2 \vert \le \beta(\delta)$, and hence for all $j \le \ell$, \begin{align*} \Vert \tau \Vert_\infty &= \max_{1 \le j \le \ell} \left\{ \max_{h' \in \mathcal{H}} \tau_j (h') \right\} \\ &\le \max_{1 \le j \le \ell} \left\{ \max_{h' \in \mathcal{H}} \epsilon_j (h') \right\} + \max_{1 \le j \le \ell} \left\{ \max_{h' \in \mathcal{H}} \vert \nu_j^1 (h') \vert + \vert \nu_j^2 \vert \right\}\\ &\le \alpha + 2 \beta(\delta) \end{align*} \end{proof} Same as before, we can now instantiate the above theorem in a classification setting where we have standard VC-type uniform convergence bound. \begin{cor}[Generalization for Lexifairness: Classification Setting] Suppose $\mathcal{H}$ is a class of binary classifiers with VC dimension $d_\mathcal{H}$ and let $L_z( p ) = \mathbb{E}_{h \sim p} \left[ L_z (h )\right]$ for any randomized model $p \in \Delta \mathcal{H}$ where $L_z (h) = \mathds{1} \left\{ h(x) \neq y \right\}$ is the zero-one loss. We have that for every $\mathcal{P}$, every data set $S \equiv \{ G_k \}_k$ of size $n$ sampled $i.i.d.$ from $\mathcal{P}$, if a model $p \in \Delta \mathcal{H}$ satisfies $(\ell, \alpha)$-lexicographic fairness with respect to $S$, then with probability at least $1-\delta$ it also satisfies $(\ell, 2 \alpha)$-lexicographic fairness with respect to $\mathcal{P}$ provided that \[ \min_{1 \le k \le K} \left\vert G_k \right\vert = \Omega \left( \frac{ d_\mathcal{H} \log \left( n \right) + \log \left( K / \delta \right) }{\alpha^2} \right) \] \end{cor} \section{Introduction} \label{sec:intro} Most notions of statistical group fairness ask that a model approximately equalize some error statistic across demographic groups. Often this is motivated as a tradeoff: the goal is to lower the error of the most disadvantaged group, and if doing so requires increasing the error on some more advantaged group, so be it---this is a cost that we are willing to pay in the name of equity. But solutions which equalize group errors do \emph{not} in general mediate a clean tradeoff in which losses in accuracy on more advantaged groups result in increases in accuracy on less advantaged groups: instead, generically (i.e. except in the very special case in which the Bayes optimal error is identical for all groups), a constraint of equalizing group error rates may require \emph{artificially increasing} the error on at least one group, without any corresponding benefit to any other group. A partial answer to this criticism of standard notions of group fairness is the classical notion of \emph{minimax fairness}, recently studied by \cite{minimax1,minimax2} in the context of supervised learning. Minimax fairness asks for a model which minimizes the error of the group \emph{most disadvantaged} by the model---i.e. the group with maximum group error. In doing so, it realizes the promise of equal error solutions in that it trades off higher error on populations more advantaged by the model for lower error on populations less advantaged by the model when this is possible---but without artificially increasing the error of any group when doing so. Indeed, it is not hard to see that a minimax model necessarily \emph{weakly Pareto dominates} an equal error rate model, in the sense that group errors are only lower in the minimax solution \emph{simultaneously for all groups}. This narrative is most sensible if there are only two demographic groups of interest. If there are more than two groups, there may be many different minimax optimal models that have very different error profiles for groups other than the max error group. How should we choose amongst these? Prior work \cite{minimax2} has broken ties by optimizing for overall classification accuracy. But why should we entirely give up on the goal of optimizing for the most disadvantaged, partially enunciated in the motivation of minimax fairness, once we have fixed the error of only one of many groups? In this paper we propose the natural continuation of this idea, which we call \emph{lexicographic minimax fairness}. Informally speaking, this notion recurses on the idea that we wish to minimize the cost of the least well off. A model that satisfies lexicographic fairness, which we call a \emph{lexifair} model, will minimize the maximum error $\gamma_1$ on any group, amongst all possible models (i.e. a lexifair model is a also a minimax model). Further, amongst the set of all minimax models, a lexifair model must minimize the error of the group with the second highest error $\gamma_2$. Amongst all of these models, it further minimizes the error of the group with the third highest error $\gamma_3$, and so on.\footnote{It is easy to see that there are cases in which a lexifair model may have arbitrarily smaller errors than a minimax model on all but the worst-off group.} \subsection{Our Contributions} Our first contribution is a definition of (approximate) lexicographic minimax fairness. Correctly defining an actionable notion of lexicographic minimax fairness is surprisingly subtle. For standard computational and statistical reasons, it will not be possible to exactly match the distributional lexicographically optimal error rates $\gamma_1,\gamma_2,\gamma_3,$ etc. But as we will observe, these lexicographically optimal error rates can be arbitrarily unstable, in the sense that amongst the set of models that have minimax error larger than $\gamma_1$ by even an arbitrarily small margin, the value of the optimal lexifair error on the third highest error group $\gamma_3'$ can be arbitrarily larger than $\gamma_3$ (See our example in Section \ref{sec:stability}). An implication of this is that the vectors of errors $\gamma$, $\gamma'$ representing exact lexifair solutions in and out of sample can be entirely incomparable and arbitrarily different from one another. Hence we need a definition of approximate lexifairness that accounts for this instability, and allows for sensible statements about approximation and generalization. Another challenge arises in the interaction between our definitions and our (desired) algorithms. A constraint on the \emph{highest} error amongst all groups, which arises in defining minimax error, is convex, and hence amenable to algorithmic optimization. However, naive specifications of lexifairness involve constraints on the second highest group errors, the third highest group errors, and more generally $k$th highest errors. These are non-convex constraints when taken in isolation. However, as it turns out, a constraint on the second highest error becomes convex when we restrict attention to minimax optimal classifiers, and more generally, a constraint on the $k$th highest error becomes convex once the values of the lower order group errors are constrained to their lexifair values. We show this by giving a clearly convex variant of our lexifair definition, specified by exponentially many \emph{linear constraints}, which replace constraints on the $k$'th highest error groups with constraints on the \emph{sums} of all $k$-tuples of group errors. We then show that our definition of ``convex lexifairness'' is equivalent to our original notion of lexifairness, at least in the exact case (absent approximation). We give our formal definitions in Section \ref{sec:gooddef}. With our notion of approximate lexifairness in hand and our convexified constraints, we give \emph{oracle-efficient} algorithms for finding approximate lexifair models in both the regression and classification case. This means that our algorithms are efficient reductions to the problem of unconstrained (that is, standard non-fair) learning over the same model class. Despite the worst-case intractability of most natural learning problems even absent fairness considerations, a desirable feature of oracle-efficient algorithms is that they can be implemented using any of the common and practical heursitics for non-fair learning, often with good empirical success~\cite{kearns2019empirical,kearns2019average, jung2019elicitation, agarwal2018reductions}. Our algorithms are based on solving the corresponding constrained optimization problem by recasting it as a (Lagrangian) minmax optimization problem, and using no-regret dynamics. Because our ``convexified'' lexifairness constraints are exponentially numerous, the ``constraint player'' in our formulation has exponentially many strategies --- but as we show, we can efficiently optimize over her strategy space using an efficient separation oracle. Hence the constraint player can always play according to a ``best response'' strategy in our simulated dynamics. When our base model class is continuous and our loss function convex (as it is with e.g. linear regression), then the ``learner'' in our dynamics can play gradient descent over parameter space. In this case, our oracle efficient-algorithms are in fact fully polynomial time algorithms because our reduction to weighted learning problems involves only \emph{non-negative} weights, which preserves convexity. In the classification case, when our loss function is \emph{non-convex}, we can convexify it by considering the set of all probability distributions over base models. Here the parameters we optimize over become the weights of the probability distribution, and our loss function (i.e. the expected loss over the choice of a random model) becomes linear in our (enormous) parameter space. In this case, we are effectively solving a linear program that has both exponentially many variables and exponentially many constraints --- but we are nevertheless able to do so in an oracle-efficient manner by making appropriate use of the Follow the Perturbed Leader algorithm \cite{KALAI2005291} for no-regret learning. Finally, we prove a generalization theorem, showing that if we have a dataset $S$ (sampled i.i.d. from an underlying distribution) that has sufficiently many samples from each group, and if we have a model that is approximately lexifair for $S$, then the model is also approximately lexifair on the underlying distribution. This is significantly more involved than just a standard uniform convergence argument --- which would simply state that our in and out of sample errors on each group are close to one another --- because approximate lexifairness additionally depends on the precise \emph{relationship} between these group errors. Nevertheless, we show that uniform convergence is a sufficient condition to guarantee that in-sample lexifairness bounds correspond to out of sample lexifairness bounds. \subsection{Related Work} \input{relatedWork} \section{Model and Definitions} \label{sec:model} Let $\mathcal{Z} = \mathcal{X} \times \mathcal{Y}$ be an arbitrary data domain. Each data point in our setting is a pair $z = (x,y)$ where $x \in \mathcal{X}$ is the feature vector and $y \in \mathcal{Y}$ is the response variable (i.e. the label). Let $\mathcal{X}$ consist of points belonging to $K$ (not necessarily disjoint) groups $\mathcal{G}_1, \ldots, \mathcal{G}_K$, so we can write $\mathcal{X} = \cup_{k=1}^K \mathcal{G}_k.$ We write $\mathcal{P}$ to denote an arbitrary distribution over $\mathcal{Z}$, and $\mathcal{P}_k$ to denote the marginal distribution induced by $\mathcal{P}$ on the $k$th group $\mathcal{G}_k \times \mathcal{Y}$. Let $S = \{z_i\}_{i=1}^n$ be a data set of size $n$, which for the purposes of proving generalization bounds, we will take to consist of $n$ data points drawn i.i.d. from $\mathcal{P}$. Denote the points in S that are contained in $\mathcal{G}_k$ by $G_k$, so we can write $S = \cup_{k=1}^K G_k$. Let $\mathcal{H} \subseteq \left\{ h: \mathcal{X} \to \mathcal{Y} \right\}$ be the model class of interest, and let $L: \mathcal{H} \times \mathcal{Z} \to \mathbb{R}_{+}$ be a loss function that takes a data point $z$ and a model $h$ as inputs, and outputs the loss of $h$ on $z$. For instance, in the case of classification and zero-one loss, we have $L(h,z) = \mathds{1} \left[ h(x) \neq y \right]$. We will abuse notation and write $L_z (\cdot)$ for $L(\cdot, z)$ for any data point $z$. Throughout the paper, for any distribution $\mathcal{P}$, we write the expected loss of a model $h$ over $\mathcal{P}$ as: \[ L_{\mathcal{P}} (h) \triangleq L(h, \mathcal{P}) \triangleq \mathbb{E}_{z \sim \mathcal{P}} \left[ L_z ( h )\right] \] We slightly abuse notation and write $L_S(h)$ to denote the empirical loss on a dataset $S$. Here and throughout the paper when $S$ plays the role of a distribution, we interpret that as the \emph{uniform distribution} over the points in $S$, and accordingly, $z \sim S$ as a point sampled \emph{uniformly at random} from $S$. Until Section \ref{sec:generalization}, we will work exclusively with sample quantities, and so for simplicity of notation, let us define $L_k (h) \triangleq L_{G_k} (h)$ to denote the \emph{sample} loss of a model $h$ on the $k$'th group. When necessary, we will write $L_k \left(h, \mathcal{P} \right)$ to denote $L_{\mathcal{P}_k} \left(h \right)$, the corresponding \emph{distributional} loss of $h$ on the $k$'th group. For any model $h$ and any data set $S = \cup_k \{ G_k \}$, let $\bar{h}_S$ be the ordering induced on the groups $\{ G_k \}_{k=1}^K$ by the loss of $h$, breaking ties arbitrarily. In other words, $\bar{h}_S: [K] \to [K]$ is any bijection such that the following condition holds: $ L_{\bar{h}_S(1)} (h) \ge L_{\bar{h}_S(2)} (h) \ge \ldots \ge L_{\bar{h}_S(K)} (h) $. The corresponding distributional ordering of the groups by any model $h$ is defined similarly: for any model $h$ and any distribution $\mathcal{P}$ over $\mathcal{Z}$, let $\bar{h}_\mathcal{P}: [K] \to [K]$ be the ordering induced on the groups $\{ \mathcal{G}_k \}_{k=1}^K$ by the expected loss of $h$, breaking ties arbitrarily. In other words, $\bar{h}_\mathcal{P}$ is any bijection such that the following condition holds: $ L_{\bar{h}_\mathcal{P} (1)} (h, \mathcal{P}) \ge L_{\bar{h}_\mathcal{P} (2)} (h, \mathcal{P}) \ge \ldots \ge L_{\bar{h}_\mathcal{P} (K)} (h, \mathcal{P}) $. When the distribution (data set) is clear from context, we elide the dependence on the distribution (data set) and simply write $\bar{h}$ for $\bar{h}_\mathcal{P}$ ($\bar{h}_S$). Our definition of lexifairness will be given recursively. At the base level, we define $\mathcal{H}_{(0)} = \mathcal{H}$ to be the set of all models in our class. Then recursively for all $1 \le j \le K$, we define: \[ \gamma_j \triangleq \min_{h \in \mathcal{H}_{(j-1)}} L_{\bar{h}(j)}(h), \quad \mathcal{H}_{(j)} \triangleq \left\{ h \in \mathcal{H}_{(j-1)}: L_{\bar{h}(j)}(h) = \gamma_j \right\} \] In words, $\gamma_j$ is the smallest error that any model in $\mathcal{H}_{(j-1)}$ obtains on the group that has the $j$th highest error, and $\mathcal{H}_{(j)}$ is the set of \emph{all} models in $\mathcal{H}_{(j-1)}$ that attain this minimum --- i.e. that have $j$th highest error equal to $\gamma_j$. Thus, $\gamma_1$ is the minimax error --- i.e. the highest group error for the model that is chosen to \emph{minimize} the maximum group error. Similarly, $\gamma_2$ is the error of the second highest group for all minimax optimal models that further minimize the error of the second highest group, and so on. With this notation in hand, we can define exact lexifairness as follows: \begin{definition}[Exact Lexicographic Fairness]\label{def:exactlexifair} Let $1 \le \ell \le K$. We say a model $h \in \mathcal{H}$ satisfies level-$\ell$ (exact) lexicographic fairness (lexifairness) if for all $j \le \ell$, $L_{\bar{h}(j)} (h) \le \gamma_j$. \end{definition} Minimax fairness corresponds to level-1 lexifairness. This is a definition of \emph{exact} lexifairness, in that it permits no approximation to the error rates --- i.e. we require $L_{\bar{h}(j)} (h) \le \gamma_j$ for all $j$, and hence $L_{\bar{h}(j)} (h) = \gamma_j$ for all $j$. For a variety of reasons, we will need definitions that tolerate approximation. For example, because we inevitably have to train on a fixed dataset, but want our guarantees to generalize to new datasets drawn from the same distribution, we will need to accommodate statistical approximation. The optimization techniques we will bring to bear will also only be able to \emph{approximate} lexifairness, even in sample. But it turns out that defining a sensible approximate notion of lexifairness is more subtle than it first appears. \subsection{Approximate Lexifairness: Stability and Convexity} We begin with the ``obvious'' but ultimately flawed definition of approximate lexifairness (Definition~\ref{def:failedlexifair}), and then explain why it is lacking in stability. This will lead us to the definitions we finally adopt: Definition \ref{def:lexifair} and its \emph{convexified} version (Definition~\ref{def:convexlexifair}), which we show is equivalent (Claim \ref{clm:relationship}), and for which we can develop efficient algorithms. \subsubsection{The Challenge of Stability} \label{sec:stability} The most natural seeming definition of approximate lexifairness begins with our notion of exact lexifairness (Definition \ref{def:exactlexifair}), and adds slack to all of the inequalities contained within. In other words, we attempt to find a model that has sorted group errors $\gamma_1',\gamma_2',\ldots,\gamma_K'$ that pointwise approximate the optimal lexifair vector of sorted group errors $\gamma_1,\ldots,\gamma_K$. \begin{definition}[A Flawed Definition]\label{def:failedlexifair} Let $1 \le \ell \le K$ and $\alpha \ge 0$. We say a model $h \in \mathcal{H}$ satisfies $(\ell, \alpha)$-lexicographic fairness if for all $j \le \ell$, $L_{\bar{h}(j)} (h) \le \gamma_j + \alpha$. \end{definition} To see the problem with the above definition, consider a setting with three groups, and a model class $\mathcal{H}$ that contains all distributions (or randomized classifiers) over two pure classifiers $ \{h_1,h_2\}$. Imagine that $h_1$ induces the (unsorted) vector of group error rates $\langle 0.5, 0.5, 0 \rangle$, and $h_2$ induces the (unsorted) vector of group error rates $\langle 0.5 + 2\alpha, 0, 0.5 \rangle$, for some arbitrarily small $\alpha > 0$. Note that it is easy to construct distributions over labeled instances with exactly these group error vectors by simply arranging each classifier to disagree with the labels on the specified fraction of a group. So, for simplicity we abstract away the data and directly discuss the error vectors. The minimax group error for this model class is $\gamma_1 = 0.5$, and is achieved only by $h_1$ which has error 0.5 on the first and second groups. Since the largest group error of $h_2$ is also on the first group with value $0.5 + 2\alpha > 0.5$, any distribution over $\{h_1,h_2\}$ that places a non-zero probability on $h_2$ will therefore violate the (exact) minimax constraint. This in turn implies that $\mathcal{H}_{(1)} = \{ h_1 \}$. Therefore, the only exact lexifair model is $h_1$ and thus $\gamma_1 = 0.5$, $\gamma_2 = 0.5$, $\gamma_3 = 0$. However, imagine that because of estimation error (as is inevitable if we are learning based on a finite sample) or optimization error (since we generally don't have access to exact optimization oracles in learning settings), we slightly misestimate the minimax group error $\gamma_1$ to be $\gamma_1' = 0.5 + \alpha$. If we now optimize, allowing the largest group error to be as much as $\gamma_1' = 0.5 +\alpha$, we may now find randomized classifiers which put weight as large as 0.5 on $h_2$. The uniform distribution over $\{ h_1, h_2\}$ induces the unsorted vector of group errors $\langle 0.5 + \alpha, 0.25, 0.25 \rangle$. The induced error on the second group (which is now also the group with second largest error) of 0.25 is considerably \emph{smaller} than $\gamma_2 = 0.5$. So far this appears to be all right, since $\gamma'_2 < \gamma_2$. But if we now attempt to optimize the error of the third highest error $\gamma'_3$, \emph{subject to the constraint} that the largest group error is (close to) $\gamma'_1$ and the second largest group error is (close to) $\gamma_2'$, we now find that we are forced to settle for third highest group error $\gamma'_3 \approx 0.25$, which is considerably \emph{larger} than the value of the third highest group's error of $\gamma_3 = 0$ in the exact lexifair solution. This example highlights a fundamental \emph{instability} of our first (flawed) attempt at defining approximate lexifairness: even arbitrarily small estimation (or optimization) error introduced to the minimax error rate $\gamma_1$ can result in large, non-monotonic effects for later group errors --- enforcing even a valid \emph{upper bound} on $\gamma_1$ can cause $\gamma_3$ to increase substantially, and these effects compound even further if we have more than three groups. \subsubsection{A Stable and Convex Definition} \label{sec:gooddef} With the proceeding example of the instability inherent in our (flawed) Definition \ref{def:failedlexifair}, we now give the definition of approximate lexifairness that we begin with: \begin{definition}[Approximate Lexicographic Fairness]\label{def:lexifair} Fix a distribution $\mathcal{P}$. Let $1 \le \ell \le K$ and $\alpha \ge 0$. For any sequence of mappings $\vec{\epsilon} = \left( \epsilon_1, \epsilon_2, \ldots, \epsilon_\ell \right)$ where $\epsilon_j \in \mathbb{R}^{\mathcal{H}}$, define $\mathcal{H}^{\vec{\epsilon}}_{(0)} (\mathcal{P}) \triangleq \mathcal{H}$, and recursively for all $1 \le j \le \ell$ define: \[ \mathcal{H}^{\vec{\epsilon}}_{(j)} (\mathcal{P}) \triangleq \left\{h \in \mathcal{H}^{\vec{\epsilon}}_{(j-1)} (\mathcal{P}): L_{\bar{h}(j)} (h, \mathcal{P}) \le \min_{g \in \mathcal{H}^{\vec{\epsilon}}_{(j-1)} (\mathcal{P})} L_{\bar{g}(j)} (g, \mathcal{P}) + \epsilon_j (h) \right\} \] and let $\Vert \vec{\epsilon} \Vert_\infty = \max_{1 \le j \le \ell} \max_{h \in \mathcal{H}} \epsilon_j (h)$. We say a model $h \in \mathcal{H}$ satisfies $(\ell, \alpha)$-lexicographic fairness (``lexifairness'') with respect to $\mathcal{P}$ if there exists $\vec{\epsilon}$ with $\Vert \vec{\epsilon} \Vert_\infty \le \alpha$ such that for all $j \le \ell$: \[ L_{\bar{h}(j)} (h, \mathcal{P}) \le \min_{g \in \mathcal{H}^{\vec{\epsilon}}_{(j-1)} (\mathcal{P})} L_{\bar{g}(j)} (g, \mathcal{P}) + \epsilon_j (h) + \alpha \] When we prove bounds on empirical lexifairness, we simply take the distribution to be the uniform distribution over the data set $S$. When the distribution is clear from context, we will write $ \mathcal{H}_{(j)}^{\vec{\epsilon}}$ and elide the dependence on the distribution. \end{definition} Note that there are two distinctions between Definition \ref{def:lexifair} and Definition \ref{def:failedlexifair}. First, the recursively defined sets $\mathcal{H}^{\vec{\epsilon}}_{(j)}$ now incorporate some $\epsilon_j (\cdot)$ slack in their parameterization which will help capture statistical (or optimization) error. Second (and crucially), we now call a solution $(\ell,\alpha)$-approximately lexifair if it satisfies our requirements for \emph{some} sequence of relaxations $\vec{\epsilon}$ that is component-wise less than $\alpha$ for all models $h$. It is this second point that avoids the instability and non-monotonicity that arises from Definition \ref{def:failedlexifair}. We observe that Definition \ref{def:lexifair} is a strict weakening of Definition \ref{def:failedlexifair}: \begin{clm} Definition~\ref{def:lexifair} is a relaxation of Definition~\ref{def:failedlexifair}: if a model satisfies $(\ell,\alpha)$-lexicographic fairness according to Definition~\ref{def:failedlexifair}, then it also satisfies $(\ell,\alpha)$-lexicographic fairness according to Definition~\ref{def:lexifair}. \end{clm} \begin{proof} If a model satisfies $(\ell,\alpha)$-lexicographic fairness according to Definition~\ref{def:failedlexifair}, then by taking $\vec{\epsilon} = \vec{0}$, it also meets the conditions of Definition~\ref{def:lexifair}. \end{proof} We now face another definitional challenge. A priori, Definition \ref{def:lexifair} appears to be highly non-convex, because it constrains the second highest group error, the the third highest group error, etc.\footnote{E.g., if we have two groups and two models which induce group errors $(0.5,0)$ and $(0, 0.5)$ respectively, both solutions have a second-highest error of 0 --- but convex combinations have a second highest error strictly greater than 0. So absent other structure, upper bounding the second highest group error of a model corresponds to a non-convex constraint. But note that in this two-group example, the non-convexity dissapears if we restrict attention to minimax optimal models. This is what we will take advantage of more generally.} This is in contrast to standard equal-error notions of fairness, or minimax fairness (which constrains only the highest group error) that \emph{are} convex in the sense that a distribution over fair models remains fair. Without convexity of this sort, the algorithmic problem of finding a fair model becomes much more challenging. But in fact (at least for $\alpha = 0$), Definition \ref{def:lexifair} \emph{does} give a convex constraint. To see this, we first introduce an alternative notion of \emph{convex lexifairness}, and then show that it actually represents the exact same constraint as lexifairness when the approximation parameter $\alpha = 0$. \begin{definition}[Convex Lexicographic Fairness]\label{def:convexlexifair} Fix a distribution $\mathcal{P}$. Let $1 \le \ell \le K$ and $\alpha \ge 0$. For any sequence of mappings $\vec{\epsilon} = \left( \epsilon_1, \epsilon_2, \ldots, \epsilon_\ell \right)$ where $\epsilon_j \in \mathbb{R}^{\mathcal{H}}$, define $\mathcal{F}^{\vec{\epsilon}}_{(0)} (\mathcal{P}) \triangleq \mathcal{H}$, and recursively for all $1 \le j \le \ell$ define: \[ \mathcal{F}_{(j)}^{\vec{\epsilon}} (\mathcal{P}) \triangleq \left\{ h \in \mathcal{F}_{(j-1)}^{\vec{\epsilon}}(\mathcal{P}): \max_{ \left\{ i_1, \ldots, i_j \right\} \subseteq [K] } \sum_{r=1}^j L_{i_r} (h, \mathcal{P}) \le \min_{g \in \mathcal{F}_{(j-1)}^{\vec{\epsilon}}(\mathcal{P}) } \max_{\left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (g, \mathcal{P}) + \epsilon_j (h) \right\} \] and let $\Vert \vec{\epsilon} \Vert_\infty = \max_{1 \le j \le \ell} \max_{h \in \mathcal{H}} \epsilon_j (h)$. We say a model $h \in \mathcal{H}$ satisfies $(\ell, \alpha)$-convex lexicographic fairness with respect to $\mathcal{P}$ if there exists $\vec{\epsilon}$ with $\Vert \vec{\epsilon} \Vert_\infty \le \alpha$ such that for all $j \le \ell$: \[ \max_{ \left\{ i_1, \ldots, i_j \right\} \subseteq [K] } \sum_{r=1}^j L_{i_r} (h, \mathcal{P}) \le \min_{g \in \mathcal{F}_{(j-1)}^{\vec{\epsilon}}(\mathcal{P}) } \max_{\left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (g, \mathcal{P}) + \epsilon_j (h) + \alpha. \] When we prove bounds on empirical convex lexifairness, we simply take the distribution to be the uniform distribution over the data set $S$. When the distribution is clear from context, we will write $ \mathcal{F}_{(j)}^{\vec{\epsilon}}$ and elide the dependence on the distribution. \end{definition} Here, we have replaced constraints on the $j$'th highest group error with constraints on the \emph{sum} of group errors over all $\approx K^j$ subsets of groups of size $j$. This has replaced a single constraint with many constraints, but each is convex, and hence the resulting set of constraints defined by $\mathcal{F}_{(j)}^{\vec{\epsilon}}$ is convex. We will formally prove this in the following claim. \begin{restatable}[Convexity of $\mathcal{F}_{(j)}^{\vec{\epsilon}}$]{clm}{convexity}\label{clm:convexity} Let $L_z: \mathcal{H} \to \mathbb{R}_{\ge 0}$ be a convex loss function. If the initial model class $\mathcal{H}$ is convex, then for all $j$ and all $\vec{\epsilon}$ such that the mappings $\epsilon_j \in \mathbb{R}^\mathcal{H}$ are concave, the set $\mathcal{F}_{(j)}^{\vec{\epsilon}}$ is convex. \end{restatable} The proof can be found in Appendix \ref{app:clm}, and proceeds by straightforward induction. We note that while some classes of models naturally satisfy the convexity conditions of the above claim with respect to their corresponding parameters (e.g. linear and logistic regression), this claim will apply to arbitrary classification models with zero-one loss as well. In these settings, we will convexify the class of models by considering the set of all probability distributions over deterministic models. The loss of a distribution (i.e. a randomized model) is then defined as the \emph{expected} loss, when the model is sampled from the corresponding distribution. Hence, by linearity of expectation, our loss functions will be convex (linear) in the parameters --- i.e.~the weights --- of these distributions. It turns out that our notion of \emph{convex} lexifairness is identical to our notion of lexifairness (and so our original definition in fact specified a convex set of constraints), at least when the approximation parameter $\alpha = 0$. We prove this in the following claim: \begin{restatable}[Relationship between $\mathcal{F}_{(j)}^{\vec{\epsilon}}$ and $\mathcal{H}_{(j)}^{\vec{\epsilon}}$ when $\vec{\epsilon} = \vec{0}$]{clm}{relationship}\label{clm:relationship} For all $j$, and $\vec{\epsilon} = \vec{0}$, we have $\mathcal{F}_{(j)}^{\vec{\epsilon}} = \mathcal{H}_{(j)}^{\vec{\epsilon}}$. \end{restatable} The intuition for the claim is the following. The sets $\mathcal{H}_{(j)}$ in Definition \ref{def:lexifair} constrain the error of the group that has the $j$'th highest error. In contrast, the sets $\mathcal{F}_{(j)}$ from Definition \ref{def:convexlexifair} constrain the \emph{sum} of the errors for all possible $j$-tuples of groups. Amongst all of these constraints, the binding one will be the constraint corresponding to the $j$ groups that have the \emph{largest} errors. But because (inductively) the errors of the top $j-1$ error groups have already been appropriately constrained in $\mathcal{F}_{(j-1)}$, this reduces to a constraint on the $j$'th highest error group, as desired. These constraints are numerous, but each is convex, and so the resulting set of constraints can be seen to be convex. See Appendix \ref{app:clm} for the full proof of Claim \ref{clm:relationship}, which proceeds by induction. We emphasize that despite the complexity of our final Definition \ref{def:convexlexifair}, what we have shown is that it is in fact a relaxation of our initial, natural definition of exact lexifairness (Definition \ref{def:exactlexifair}) --- and in particular Definitions \ref{def:exactlexifair}, \ref{def:lexifair}, and \ref{def:convexlexifair} coincide exactly when $\alpha = 0$. We do not know the precise relationship between our definitions of approximate lexifairness and approximate convex lexifairness for $\alpha > 0$ --- but because both are smooth relaxations of the same base definition, both should be viewed as capturing the same intuition as Definition \ref{def:exactlexifair} (exact lexifairness) when $\alpha$ is small. \section{Game Theory and No-Regret Learning Preliminaries} \subsection{No-Regret Dynamics}\label{subsec:noregret} In this subsection, we briefly review the seminal result of Freund and Schapire \cite{fs1996}: Under certain conditions, two-player zero-sum games can be (approximately) solved by having access to a no-regret online learning algorithm for one of the players. Suppose in this subsection that $S_1$ and $S_2$ are two vector spaces over the field of real numbers. Consider a zero-sum game with two players: a player with strategies in $S_1$ (the minimization player) and another player with strategies in $S_2$ (the maximization player). Let $U: S_1 \times S_2 \to \mathbb{R}_{\ge 0}$ be the payoff function of this game. For every strategy $s_1 \in S_1$ of player one and every strategy $s_2 \in S_2$ of player two, the first player gets utility $-U(s_1, s_2)$ and the second player gets utility $U(s_1, s_2)$. \begin{definition}[Approximate Equilibrium]\label{def:nuapprox} A pair of strategies $(s_1, s_2) \in S_1 \times S_2$ is said to be a $\nu$-approximate minimax equilibrium of the game if the following conditions hold: \[ U(s_1, s_2) - \min_{s'_1 \in S_1} U(s'_1, s_2) \le \nu, \quad \max_{s'_2 \in S_2} U(s_1, s'_2) - U(s_1, s_2) \le \nu \] \end{definition} In other words, $(s_1, s_2)$ is a $\nu$-approximate equilibrium of the game if neither player can gain more than $\nu$ by deviating from their strategies. Freund and Schapire \cite{fs1996} proposed an efficient framework for approximately solving the game: In an iterative fashion, have one of the players play according to a no-regret learning algorithm, and let the second player (approximately) best respond to the play of the first player. The empirical average of each player's actions over a sufficiently long sequence of such play will form an approximate equilibrium of the game. The formal statement is given in the following theorem. \begin{thm}[No-Regret Dynamics \cite{fs1996}]\label{thm:noregret} Let $S_1$ and $S_2$ be convex, and suppose the utility function $U$ is convex-concave: $U(\cdot, s_2): S_1 \to \mathbb{R}_{\ge 0}$ is convex for all $s_2 \in S_2$, and $U(s_1, \cdot): S_2 \to \mathbb{R}_{\ge 0}$ is concave for all $s_1 \in S_1$. Let $(s_1^1, s_1^2, \ldots, s_1^T)$ be the sequence of play for the first player, and let $(s_2^1, s_2^2, \ldots, s_2^T)$ be the sequence of play for the second player. Suppose for $\nu_1,\nu_2 \ge 0$, the regret of the players jointly satisfies \[ \sum_{t=1}^T U(s_1^t, s_2^t) - \min_{s_1 \in S_1} \sum_{t=1}^T U(s_1, s_2^t) \le \nu_1 T, \quad \max_{s_2 \in S_2} \sum_{t=1}^T U(s_1^t, s_2) - \sum_{t=1}^T U(s_1^t, s_2^t) \le \nu_2 T \] Let $\bar{s}_1 = \frac{1}{T}\sum_{t=1}^T s_1^t \in S_1$ and $\bar{s}_2 = \frac{1}{T}\sum_{t=1}^T s_2^t \in S_2$ be the empirical average play of the players. We have that the pair $(\bar{s}_1, \bar{s}_2)$ is a $(\nu_1+\nu_2)$-approximate equilibrium of the game. \end{thm} \emph{No regret} online learning algorithms are algorithms that can guarantee the conditions of Theorem \ref{thm:noregret} against arbitrary adversaries. We will use two no-regret online learning algorithms: \emph{Online Projected Gradient Descent}, which we will use in regression settings in which models are represented by parameters in a Euclidean space, and \emph{Follow the Perturbed Leader (FTPL)}, which we will use in binary classification settings. We will make use of these no-regret learning algorithms in our proposed algorithm for learning a lexifair model; full explanations and pseudocode for both are in Appendix \ref{app:gd+ftpl}. \section{Finding Lexifair Models} \label{sec:finding} In this section we focus on developing the tools required to prove the following (informally stated) theorem. The formal claims are provided in Theorems~\ref{thm:lexifair-reg} and \ref{thm:lexifair-clf}. \begin{thm}[Informal] Suppose the model class $\mathcal{H}$ is convex and compact, and that the loss function $L_z: \mathcal{H} \to \mathbb{R}_{\ge 0}$ is convex for all data points $z \in \mathcal{Z}$. There exists an efficient algorithm that returns a model which is $(\ell, \alpha)$-convex lexicographic fair (according to Definition~\ref{def:convexlexifair}), for any given $\ell$ and $\alpha$. \end{thm} We will propose algorithms for both classification and regression settings. The algorithms we propose proceed inductively to solve the minimax problems defined recursively by our convex lexifair definition. The first minimax problem is the one that minimizes the maximum group error rate: $\min_{h \in \mathcal{H}} \max_{k \in [K]} L_k (h)$. Let us denote the estimated value (computed by the first phase of our algorithm) for this minimax problem by $\eta_1$. The second minimax problem is minimizing the maximum sum of any two group error rates subject to the constraint that all group error rates are at most $\eta_1$: the estimated value for this minimax problem is called $\eta_2$. The rest of the minimax problems are defined in a similar inductive fashion: suppose at round $j \le \ell$, we are given some estimates $(\eta_1, \ldots, \eta_{j-1})$ for the first $j-1$ minimax values. Now using these estimates, the new minimax problem for the sum of any $j$ group error rates can be stated as follows. \begin{equation}\label{eq:opt-problem-old} \min_{\overset{h \in \mathcal{H}:}{\overset{\forall r \le j-1, \, \forall \{i_1, \ldots, i_r\} \subseteq [K]}{L_{i_1} (h) + \ldots + L_{i_r} (h) \le \eta_r}}} \left\{ \max_{\left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (h) \right\} \end{equation} We can reformulate this optimization problem by calling the objective $\max_{\left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (h) := \eta_j$ and introducing a new set of constraints which require that any sum of $j$ group error rates must be at most $\eta_j$. Note that this new formulation introduces a new variable, $\eta_j$, to the optimization problem. We therefore have that the optimization problem~\eqref{eq:opt-problem-old} is equivalent to \begin{equation}\label{eq:opt-problem} \min_{\overset{h \in \mathcal{H}, \eta_j \in [0,j \cdot L_M]:}{\overset{\forall r \le j, \, \forall \{i_1, \ldots, i_r\} \subseteq [K]}{L_{i_1} (h) + \ldots + L_{i_r} (h) \le \eta_r}}} \eta_j \triangleq \text{OPT}_j \left( \eta_1, \ldots, \eta_{j-1} \right) \end{equation} which is a constrained convex optimization problem given that the model class $\mathcal{H}$ and the loss function $L$ are convex. Here $L_M = \max_{z,h} L_z(h)$ is an upper bound on the loss function which identifies the range of feasible values for $\eta_j$: $[0, j \cdot L_M]$. Recall that in this round, $(\eta_1, \ldots, \eta_{j-1})$ are given from the previous rounds, and $\eta_j$ is a variable in the optimization problem. We denote the optimal value of the optimization problem~\eqref{eq:opt-problem} by $\text{OPT}_j \left( \eta_1, \ldots, \eta_{j-1} \right)$. \subsection{Formulation as a Two-Player Zero-Sum Game} Optimization problem \eqref{eq:opt-problem} is written as a constrained optimization problem, but we can express it equally well as an unconstrained minimax problem via Lagrangian duality. The corresponding Lagrangian can be written as: \begin{equation}\label{eq:lagrangian} \mathcal{L}_j \left( (h, \eta_j), \lambda \right) = \eta_j + \sum_{r=1}^j \sum_{\{i_1, \ldots, i_r\} \subseteq [K]} \lambda_{\{i_1, i_2, \ldots, i_r\}} \cdot \left( L_{i_1} (h) + \ldots + L_{i_r} (h) - \eta_r \right) \end{equation} where we introduce one dual variable $\lambda$ for every inequality constraint in the optimization problem~\eqref{eq:opt-problem}, and index the dual variables by their corresponding constraint. Therefore, there are $q_j =\sum_{r=1}^j \binom{K}{r}$ dual variables in this round. Solving optimization problem~\eqref{eq:opt-problem} is equivalent to solving the following minimax problem: \begin{equation}\label{eq:minimax} \min_{h \in \mathcal{H}, \eta_j \in [0,j \cdot L_M]} \max_{\lambda \in \mathbb{R}^{q_j}_{\ge 0}} \mathcal{L}_j \left( (h, \eta_j), \lambda \right) = \max_{\lambda \in \mathbb{R}^{q_j}_{\ge 0}} \min_{h \in \mathcal{H}, \eta_j \in [0,j \cdot L_M]} \mathcal{L}_j \left( (h, \eta_j), \lambda \right) \end{equation} where the minimax theorem holds because 1) the range of the primal variables, i.e. $\mathcal{H}$ and $[0, j \cdot L_M]$, is convex and compact, the range for the dual variable ($\mathbb{R}^q_{\ge 0}$) is convex, and 2) $\mathcal{L}_j \left( (h, \eta_j), \lambda \right)$ is convex in its primal variables $(h, \eta_j)$ and concave in the dual variable $\lambda$. Therefore we focus on solving the minimax problem \eqref{eq:minimax} which can be seen as solving a two-player zero-sum game with payoff function $\mathcal{L}_j \left( (h, \eta_j), \lambda \right)$. Using the no-regret dynamics of \cite{fs1996} (see Section \ref{subsec:noregret}), we will have the primal player (or \emph{Learner}) with strategies $(h, \eta_j) \in \mathcal{H} \times [0, j \cdot L_M]$ play a no-regret learning algorithm and let the dual player (or \emph{Auditor}) with strategies $\lambda \in \Lambda_j = \{\lambda \in \mathbb{R}_{\ge 0}^{q_j} : \Vert \lambda \Vert_1 \le B \}$ best respond. Here we place an upper bound $B$ on the $\ell_1$-norm of the dual variable to guarantee convergence of our algorithms. This nuisance parameter will be set optimally in our algorithms, and we note that the minimax theorem continues to hold in the presence of this upper bound on $\lambda$. We will first analyze the best response problem for both players --- i.e. the problem of optimizing the Lagrangian for one of the players \emph{fixing} the strategy of the other player. \subsection{The Auditor's Best Response} Fixing the $(h, \eta_j)$ variables of the Learner and the estimated values $(\eta_1, \ldots, \eta_{j-1})$ from previous rounds, the Auditor can best respond by solving \[ \argmax_{\lambda \in \Lambda_j} \mathcal{L}_j \left( (h, \eta_j), \lambda \right) \equiv \argmax_{\lambda \in \Lambda_j} \sum_{r=1}^{j} \sum_{\{i_1,\ldots,i_r\} \subseteq [K]} \lambda_{\{i_1,i_2, \ldots,i_r\}} \cdot \left( L_{i_1} (h) + \ldots + L_{i_r} (h) - \eta_r \right) \] Since the objective is linear in the dual variables $\lambda$, the Auditor can without loss of generality best respond by putting all its mass $B$ on the variable $\lambda_{\{i_1,i_2, \ldots,i_r\}}$ corresponding to the most violated constraint, if one exists. In particular, given any model $h \in \mathcal{H}$ and any ordering $\bar{h}$ induced by $h$ on the groups, we have that the Auditor's best response $\lambda_\text{best} (h, \eta_j)$ is \[ \lambda_\text{best} (h, \eta_j) = \begin{cases} 0 \in \mathbb{R}^{q_j} & \text{if }\forall r \le j: \, L_{\bar{h}(1)} (h) + \ldots + L_{\bar{h}(r)} (h) \le \eta_r \\ \lambda^\star \in \mathbb{R}^{q_j} & \text{if }\exists r \le j: \, L_{\bar{h}(1)} (h) + \ldots + L_{\bar{h}(r)} (h) > \eta_r \end{cases} \] where the entries of $\lambda^\star$ are defined as follows. \begin{equation}\label{eq:lambdastar} \lambda^\star_{\{i_1,i_2,\ldots,i_r\}} = \begin{cases} B & \text{if } \{i_1,i_2,\ldots,i_r\} = \{ \bar{h}(1), \bar{h}(2), \ldots, \bar{h}(r^\star) \} \\ 0 & \text{Otherwise} \end{cases} \end{equation} where $r^\star \in \argmax_{r \le j} \left( L_{\bar{h}(1)} (h) + \ldots + L_{\bar{h}(r)} (h) - \eta_r \right)$. Note that the Auditor's best response can be computed efficiently because it only requires sorting the vector of error rates across $K$ groups. We summarize the best response algorithm for the Auditor in Algorithm~\ref{alg:auditorbest}. \begin{algorithm}[t] \KwIn{Learner's play $(h, \eta_j)$, previous estimates $(\eta_1, \ldots, \eta_{j-1})$} Compute $L_k (h)$ for all groups $k \in [K]$\; Find the top $j$ elements of vector $(L_1 (h), \ldots, L_K (h))$ and call them: $L_{\bar{h}(1)} (h) \ge \ldots \ge L_{\bar{h}(j)} (h)$\; \lIf{$\forall r \le j: \, L_{\bar{h}(1)} (h) + \ldots + L_{\bar{h}(r)} (h) \le \eta_r$}{ $\lambda_{out} = 0$} \lElse{ Let $r^\star \in \argmax_{r \le j} \left( L_{\bar{h}(1)} (h) + \ldots + L_{\bar{h}(r)} (h) - \eta_r \right)$, $\lambda_{out} = \lambda^\star$ as in Equation~\eqref{eq:lambdastar} } \KwOut{$\lambda_{out} \in \Lambda_j$} \caption{The Auditor's Best Response ($\lambda_\text{best}$): $j$th round} \label{alg:auditorbest} \end{algorithm} \subsection{The Learner's Best Response} Given dual weights $\lambda \in \Lambda_j$ chosen by the Auditor, the Learner can best respond by solving \[ \argmin_{h \in \mathcal{H}, \eta_j \in [0, j \cdot L_M]} \mathcal{L}_j \left( (h, \eta_j), \lambda \right). \] We note that the objective function $\mathcal{L}_j \left( (h, \eta_j), \lambda \right)$ can be decomposed into three terms: one that depends only on the model $h$, another that depends only on $\eta_j$, and finally one that is constant (with respect to $(h, \eta_j)$). Therefore, this optimization problem is separable for the Learner --- the decomposition is formally described below. \begin{equation}\label{eq:decomposition} \mathcal{L}_j \left( (h, \eta_j), \lambda \right) = \mathcal{L}_j^1 \left( h, \lambda \right) + \mathcal{L}_j^2 \left( \eta_j, \lambda \right) + C_j \left( \lambda \right) \end{equation} where \begin{equation}\label{eq:learner-p} \mathcal{L}_j^1 \left( h, \lambda \right) \triangleq \sum_{r=1}^K w_r (\lambda) L_r (h), \ \text{where} \ w_r (\lambda) \triangleq \sum_{s=0}^{j-1} \sum_{\{i_2,\ldots,i_s\} \subseteq [K] \setminus \{r\}} \lambda_{\{r,i_2,\ldots,i_s\}} \end{equation} \begin{equation}\label{eq:learner-eta} \mathcal{L}_j^2 \left( \eta_j, \lambda \right) \triangleq \left( 1 - \sum_{\{i_1, \ldots, i_j\} \subseteq [K]} \lambda_{\{i_1, i_2, \ldots, i_j\}} \right) \eta_j \end{equation} \begin{equation}\label{eq:constant} C_j \left( \lambda \right) \triangleq - \sum_{r=1}^{j-1} \sum_{\{i_1, \ldots, i_r\} \subseteq [K]} \lambda_{\{i_1, i_2, \ldots, i_r\}} \cdot \eta_r \end{equation} Given this decomposition of the Lagrangian, the best response $(h,\eta_j)$ of the Learner to the variables $\lambda$ of the Auditor is as follows: \[ (h,\eta_j) = \left( \argmin_{h \in \mathcal{H}} \mathcal{L}_j^1 \left( h, \lambda \right) , \argmin_{\eta_j \in [0, j\cdot L_M]} \mathcal{L}_j^2 \left( \eta_j, \lambda \right) \right) \] Note that the first optimization problem is a weighted minimization problem over the class $\mathcal{H}$, and the second one is a simple minimization of a linear function. Furthermore, even though in general computing the sums in Equations~\eqref{eq:learner-p} and \eqref{eq:learner-eta} can be computationally hard (because they are sums over exponentially many terms), \emph{when the Auditor is best responding (which will be the case in our algorithms), these sums can be computed efficiently}. We formally state this claim in Fact~\ref{fact:efficient}. \begin{fact}\label{fact:efficient} When the Auditor is using its best response algorithm (Algorithm~\ref{alg:auditorbest}) to respond to the Learner, the Auditor will either output zero or identify a single subset $C$ of groups ($\vert C \vert \le j$) on which the constraints are violated maximally. In the former case, $w_r (\lambda) = 0$ for all $r$ and $1 - \sum_{\{i_1, \ldots, i_j\} \subseteq [K]} \lambda_{\{i_1, i_2, \ldots, i_j\}} = 1$. In the latter case, we have \[ w_r (\lambda)=B \cdot \mathds{1} \left[ r \in C \right], \quad 1 - \sum_{\{i_1, \ldots, i_j\} \subseteq [K]} \lambda_{\{i_1, i_2, \ldots, i_j\}} = 1 - B \cdot \mathds{1} \left[ \vert C \vert = j \right] \] \end{fact} \subsection{Solving the Game with No-Regret Dynamics} Having analyzed the best response problem for both players, we now focus on developing efficient algorithms to approximately solve the two-player zero-sum game defined above, which corresponds to finding an approximate convex lexifair model. The algorithms we propose use no-regret dynamics (see Section~\ref{subsec:noregret}) in which the Learner plays a no-regret learning algorithm and the Auditor best responds according to Algorithm~\ref{alg:auditorbest}. As a consequence, we get that the empirical average of the played strategies $((\hat{h}, \hat{\eta}_j), \hat{\lambda})$ of the players over the course of the iterative algorithms will form a $\nu$-approximate equilibrium of the game for some small value of $\nu \ge 0$ (according to Definition~\ref{def:nuapprox}). Then, by the following theorem, we can turn these equilibrium guarantees into the fairness guarantees of the output model $\hat{h}$. Its proof can be found in Appendix \ref{app:finding}. We remark that what we mean by the empirical average will depend on the setting. If we are in a setting in which the loss function is convex in the model parameters (e.g. logistic or linear regression), then we can actually average the model parameters, and output a single deterministic model. Alternately, if we are in a classification setting in which the loss function (e.g. zero-one loss) is non-convex in the model parameters, then by averaging, we mean using the randomized model that corresponds to the uniform distribution over the empirical play history. \begin{restatable}{thm}{thmdunno} \label{thm:dunno} At round $j$, let $(\hat{\eta}_1, \ldots, \hat{\eta}_{j-1})$ be any given estimated minimax values from the previous rounds and let the strategies $((\hat{h}, \hat{\eta}_j), \hat{\lambda})$ form a $\nu$-approximate equilibrium of the game for this round, i.e., \[ \mathcal{L}_j \left( (\hat{h}, \hat{\eta}_j), \hat{\lambda} \right) \le \min_{h \in \mathcal{H}, \eta_j \in [0, j\cdot L_M]} \mathcal{L}_j \left( (h, \eta_j), \hat{\lambda} \right) + \nu, \quad \mathcal{L}_j \left( (\hat{h}, \hat{\eta}_j), \hat{\lambda} \right) \ge \max_{\lambda \in \Lambda_j} \mathcal{L}_j \left( (\hat{h}, \hat{\eta}_j), \lambda \right) - \nu \] We have that \begin{equation*} \hat{\eta}_j \le OPT_j \left( \hat{\eta}_1, \ldots, \hat{\eta}_{j-1} \right) + 2\nu \end{equation*} and for all $r \le j$, \begin{equation*} \max_{\left\{ i_1, \ldots, i_r \right\} \subseteq [K]} \sum_{s=1}^r L_{i_r} (\hat{h}) \le \hat{\eta}_{r} + \frac{j L_M + 2 \nu}{B}. \end{equation*} \end{restatable} We will next instantiate this general result to give concrete algorithms for learning convex lexifair models in the regression and classification settings respectively. \section{Finding Lexifair Regression Models} \label{sec:reg} Suppose in this section that $\mathcal{Y} \subseteq \mathbb{R}$ and $\mathcal{H}$ is a class of models in which each model is parametrized by some $d$-dimensional vector in $\mathbb{R}^d$: $\mathcal{H} = \left\{ h_\theta: \theta \in \Theta \right\}$ where $\Theta \subseteq \mathbb{R}^d$. In this parametric setting we can think of each parameter $\theta \in \Theta$ as a model and write the loss function as a function of $\theta$. Suppose the loss function $L_z: \Theta \to \mathbb{R}_{\ge 0}$ is differentiable for all $z$.\footnote{If it is not differentiable we can use sub-gradients instead of gradients.} We will have the Learner play according to the Online Projected Gradient Descent algorithm (see Appendix~\ref{subsec:gd}) where the gradients of the corresponding loss function of the game for the Learner (i.e. $\mathcal{L}_j \left( (\theta, \eta_j), \lambda \right)$) can be computed using Equations~\eqref{eq:learner-p} and \eqref{eq:learner-eta}, and the decomposition given in~\eqref{eq:decomposition}: \begin{equation}\label{eq:grad-model} \nabla_\theta \mathcal{L}_j \left( (\theta, \eta_j), \lambda \right) = \nabla_\theta \mathcal{L}_j^1 \left( \theta, \lambda \right) = \sum_{r=1}^K w_r (\lambda) \nabla_\theta L_r (\theta), \end{equation} \begin{equation}\label{eq:grad-eta} \nabla_{\eta_j} \mathcal{L}_j \left( (\theta, \eta_j), \lambda \right) = \nabla_{\eta_j} \mathcal{L}_j^2 \left( \eta_j, \lambda \right) = 1 - \sum_{\{i_1, \ldots, i_j\} \subseteq [K]} \lambda_{\{i_1, i_2, \ldots, i_j\}}. \end{equation} The algorithm for this setting is given as Algorithm~\ref{alg:fair-regression}, which makes calls to a subroutine (Algorithm~\ref{alg:nr-regression}) that solves the two-player zero-sum games defined above by having the Learner play Online Projected Gradient Descent (see Appendix ~\ref{app:gd+ftpl}) and the Auditor best respond using Algorithm~\ref{alg:auditorbest}. Note that since the Auditor is best responding, computing the sums in Equations~\eqref{eq:grad-model} and \eqref{eq:grad-eta} can be done efficiently per Fact~\ref{fact:efficient}. \begin{restatable}[Lexifairness for Regression]{thm}{regthm}\label{thm:lexifair-reg} Suppose $\Theta \subseteq \mathbb{R}^d$ is convex, compact, and bounded with diameter $D$: $\sup_{\theta, \theta' \in \Theta} \left\Vert \theta - \theta' \right\Vert_2 \le D$. Suppose the loss function $L_z: \Theta \to \mathbb{R}_{\ge 0}$ is convex and that there exists constants $L_M$ and $G$ such that $L_z (\cdot) \le L_M$ and $\Vert \nabla_\theta L_z (\cdot) \Vert_2 \le G$, for all data points $z \in \mathcal{Z}$. We have that for any $\ell \le K$ and any $\alpha \ge 0$, the model $\hat{\theta}_\ell \in \Theta$ output by Algorithm~\ref{alg:fair-regression} is $(\ell,\alpha)$-convex lexicographic fair. \end{restatable} The proof of this theorem (which can be found in Appendix \ref{app:reg}) involves bounding the regret of each player, and then appealing to Theorem \ref{thm:dunno}. \begin{algorithm}[t] \KwIn{$S = \cup_{k=1}^K G_k$ data set consisting of $K$ groups, $(\ell,\alpha)$ desired fairness parameters, loss function parameters $L_M$ and $G$, diameter $D$ of the model class $\Theta$} \For{$j=1,2, \ldots, \ell$}{ Set $T_j = \frac{4 j^2 (GD + L_M)^2 (2 \alpha + j L_M)^2}{\alpha^4}$\; Set $B_j = \frac{\alpha + j L_M}{\alpha}$\; $(\hat{\theta}_j, \hat{\eta}_j) = \mathtt{RegNR} (T_j, B_j; \hat{\eta}_1, \ldots, \hat{\eta}_{j-1})$ (Calling Algorithm~\ref{alg:nr-regression}) } \KwOut{$(\ell,\alpha)$-convex lexifair model $\hat{\theta}_\ell$} \caption{$\mathtt{LexiFairReg}$: Finding a Lexifair Regression Model} \label{alg:fair-regression} \end{algorithm} \begin{algorithm}[t] \KwIn{Number of rounds $T$, dual variable upper bound $B$, previous estimates $(\eta_1, \ldots, \eta_{j-1})$} Set learning rates $\eta = \frac{D}{jBG\sqrt{T}}$ and $\eta' = \frac{jL_M}{(1+B)\sqrt{T}}$\; Initialize the Learner: $\theta^1 \in \Theta, \eta_j^1 \in [0, j \cdot L_M]$\; \For{$t=1,2, \ldots, T$}{ Learner plays $(\theta^t, \eta_j^t)$\; Auditor best responds: $\lambda^t = \lambda_\text{best} (\theta^t, \eta_j^t ; (\eta_1, \ldots, \eta_{j-1}))$ using Algorithm~\ref{alg:auditorbest}\; Learner updates its actions using Projected Gradient Descent: \[ \theta^{t+1} = \text{Proj}_\Theta \left( \theta^{t} - \eta \cdot \nabla_\theta \mathcal{L}_j (\theta^{t}, \eta_j^{t}, \lambda^{t}) \right) \] \[ \eta_j^{t+1} = \text{Proj}_{[0, j \cdot L_M]} \left(\eta_j^{t} - \eta' \cdot \nabla_{\eta_j} \mathcal{L}_j (\theta^{t}, \eta_j^{t}, \lambda^{t}) \right) \] where the gradients are given in Equations~\eqref{eq:grad-model} and \eqref{eq:grad-eta}. } \KwOut{the average play $\hat{\theta} = \frac{1}{T} \sum_{t=1}^T \theta^t \in \Theta$, and $\hat{\eta}_j = \frac{1}{T} \sum_{t=1}^T \eta_j^t \in [0, j\cdot L_M]$.} \caption{$\mathtt{RegNR}$: $j$th round} \label{alg:nr-regression} \end{algorithm} \section{Finding Lexifair Classification Models} \label{sec:class} Suppose in this section that $\mathcal{Y} = \{0,1\}$ and our model class $\mathcal{H}$ is the probability simplex over a class of deterministic binary classifiers. We slightly abuse notation and write $\mathcal{H}$ for the given class of deterministic classifiers and write $\Delta \mathcal{H} \triangleq \{ p: p \text{ is a distribution over } \mathcal{H} \}$ for the probability simplex, and work with $\Delta \mathcal{H}$ as our model class. Let the loss function be zero-one loss: for any $h \in \mathcal{H}$: $L_z (h) = \mathbbm{1} \left\{ h(x) \neq y \right\}$. The loss of any randomized model $p$ on data point $z$ is defined as the \emph{expected loss} of $h$ on $z$ when $h$ is sampled from $\mathcal{H}$ according to the distribution $p$. In other words, \[ L_z( p ) \triangleq \mathbb{E}_{h \sim p} \left[ L_z (h )\right], \] which is convex (linear) in the model $p$ (weights of the distribution). We will also assume that the model class $\mathcal{H}$ has finite VC dimension: $d_\mathcal{H} < \infty$. Sauer's Lemma below will then imply that for any finite dataset, $\mathcal{H}$ induces only finitely many labelings. This will serve two purposes. First, it allows us to write the optimization problem as a linear program with \emph{finitely many} variables, and therefore appeal to strong duality. Second, it allows us to pose the Learner's best response problem as an $n$-dimensional \emph{linear optimization} problem, over the only exponentially many labelings of the $n$ data points. This is what will allow us to apply Follow the Perturbed Leader and obtain oracle-efficient no-regret learning guarantees for the Learner. Here we are following an approach similar to that of \cite{kearns2018preventing}. \begin{lemma}[Sauer's Lemma]\label{lem:sauer} Let $S = \{z_i = (x_i,y_i)\}_{i=1}^n$ be a data set of size $n$ and $\mathcal{H}$ be a model class with VC dimension $d_\mathcal{H}$. Let $\mathcal{H} (S) \triangleq \left\{ \left( h(x_1), h(x_2), \ldots, h(x_n) \right): h \in \mathcal{H} \right\}$ be the set of all labelings induced by $\mathcal{H}$ on data set $S$. We have that $\vert \mathcal{H} (S) \vert = O(n^{d_\mathcal{H}})$. \end{lemma} Recall that given some $\lambda \in \Lambda_j$ of the Auditor, the best response of the Learner is separable and given by \[ (p,\eta_j) = \left( \argmin_{p \in \Delta \mathcal{H}} \mathcal{L}_j^1 \left( p, \lambda \right) , \argmin_{\eta_j \in [0, j]} \mathcal{L}_j^2 \left( \eta_j, \lambda \right) \right), \] where $\mathcal{L}_j^1 \left( p, \lambda \right)$ and $\mathcal{L}_j^2 \left( \eta_j, \lambda \right)$ are given in Equations~\eqref{eq:learner-p} and \eqref{eq:learner-eta}, respectively, and we use $L_M = 1$ because our loss function in this section is the zero-one loss. We can now apply Sauer's Lemma and the fact that $\mathcal{L}_j^1 \left( p, \lambda \right)$ is linear in the weights of the distribution $p$ to rewrite the first optimization problem as \[ \argmin_{p \in \Delta \mathcal{H}} \mathcal{L}_j^1 \left( p, \lambda \right) \quad \underset{\longrightarrow}{\text{Sauer's}} \quad \argmin_{p \in \Delta \mathcal{H} (S)} \mathcal{L}_j^1 \left( p, \lambda \right) \quad \underset{\longrightarrow}{\text{linearity}} \quad \argmin_{h \in \mathcal{H} (S)} \mathcal{L}_j^1 \left( h, \lambda \right), \] which is an optimization problem over finitely many variables (weights over $\mathcal{H}(S)$). Note we can further rewrite this optimization problem as a cost sensitive classification problem which can be solved by calling a \emph{Cost Sensitive Classification Oracle} for $\mathcal{H}$ (CSC($\mathcal{H}$)). Recall from Equation~\eqref{eq:learner-p} that $\mathcal{L}_j^1 \left( h, \lambda \right) = \sum_{r=1}^K w_r (\lambda) L_r (h)$. We have that \[ \argmin_{h \in \mathcal{H} (S)} \sum_{r=1}^K w_r (\lambda) L_r (h) \equiv \argmin_{h \in \mathcal{H} (S)} \sum_{i=1}^n \left\{ c^1_i (\lambda) h(x_i) + c_i^0 (\lambda) \left( 1 - h(x_i) \right) \right\} \] where $ c_i^1 (\lambda) = (1-y_i) \sum_{r=1}^K (w_r (\lambda)/n_r) \mathds{1} \left\{ i \in G_r \right\} $ is the cost of classifying data point $i$ as a positive (1) example, and $ c_i^0 (\lambda) = y_i \sum_{r=1}^K (w_r (\lambda) / n_r) \mathds{1} \left\{ i \in G_r \right\} $ is the cost of classifying data point $i$ as a negative (0) example. Here $n_r$ is the size of the $r$'th group: $n_r = \vert G_r \vert$. By using a linear transformation of the cost vectors, we have \[ \argmin_{h \in \mathcal{H} (S)} \sum_{r=1}^K w_r (\lambda) L_r (h) \equiv \argmin_{h \in \mathcal{H} (S)} \sum_{i=1}^n c_i (\lambda) h(x_i) \] where the vector of costs is given as follows: \[ \forall 1 \le i \le n: \quad c_i (\lambda) \triangleq \left( 1 - 2 y_i \right) \sum_{r=1}^K \frac{w_r (\lambda)}{n_r} \mathds{1} \left\{ i \in G_r \right\} \] Let us also define $c(\lambda) \triangleq 1 - \sum_{\{i_1, \ldots, i_j\} \subseteq [K]} \lambda_{\{i_1, i_2, \ldots, i_j\}}$ which is the coefficient of $\eta_j$ in $\mathcal{L}_j^2 \left( \eta_j, \lambda \right)$. We can therefore write the best response of the Learner to $\lambda \in \Lambda_j$ of the Auditor in the classification setting of this section as \[ (h,\eta_j) = \left( \argmin_{h \in \mathcal{H}(S)} \sum_{i=1}^n c_i ( \lambda ) h(x_i) , \, \argmin_{\eta_j \in [0, j]} c ( \lambda ) \eta_j \right) \] Now to get no-regret guarantees for the Learner we use the Follow the Perturbed Leader (FTPL) algorithm (see Appendix~\ref{subsec:ftpl}). At any round $t$ of the two-player zero-sum game, given the history $(\lambda^1, \ldots, \lambda^{t-1})$ (best response plays) of the Auditor, the Learner solves \[ (h,\eta_j) = \left( \argmin_{h \in \mathcal{H}(S)} \sum_{i=1}^n \left( c_i \left( \sum_{s < t} \lambda^s \right) + \frac{1}{\eta} \xi_i \right) h(x_i) , \, \argmin_{\eta_j \in [0, j]} \left( c \left(\sum_{s < t} \lambda^s \right) + \frac{1}{\eta'} \xi \right) \eta_j \right) \] where $\xi, \xi_i \sim Uniform[0,1]$ for all $i$. At any round $t$, let's denote the true distributions (one over $\mathcal{H}(S)$ and another over the interval $[0,j]$) maintained by the Learner's FTPL algorithm by $p^t$ and $D^t$. Since $p^t$ is a distribution over an exponentially large domain ($\vert \mathcal{H} (S) \vert = O(n^{d_\mathcal{H}})$), we can only represent a sparse version of it efficiently by sampling from it. On the other hand, $D^t$, which is a one dimensional distribution, can be represented by a scaled Bernoulli random variable as follows: \[ D^t = j \cdot Bern(q^t) \quad \text{where} \quad q^t = \min \left( 1, - \eta' c \left(\sum_{s < t} \lambda^s \right) \cdot \mathds{1} \left[ c \left(\sum_{s < t} \lambda^s \right) \le 0 \right] \right) \] The algorithm for this setting is given in Algorithm~\ref{alg:fair-classification} which makes calls to a subroutine that implements the no-regret dynamics described above (Algorithm~\ref{alg:nr-classification}). Note that as mentioned earlier, we cannot efficiently represent the FTPL distribution $p^t$ for the Learner, and therefore, we work with the empirical distribution $\hat{p}^t$ of $m$ $i.i.d.$ draws from $p^t$ in Algorithm~\ref{alg:nr-classification}. This makes the best response plays of the Auditor (to the pair $(\hat{p}^t, D^t)$), \emph{approximate} best responses to the actual FTPL distributions $(p^t, D^t)$ of the Learner, and consequently, the Auditor accumulates some regret over the course of the algorithm. Finally, note that the no-regret dynamics of Algorithm~\ref{alg:nr-classification} must output the average play: $(\bar{p}, \bar{D})$ where $\bar{p} = (1/T) \sum_{t=1}^T p^t$ and $\bar{D} = (1/T) \sum_{t=1}^T D^t$. However, once again we cannot represent the average play $\bar{p}$ efficiently because it can be a distribution over an exponentially large domain. We therefore need to sample from this distribution and take the empirical distribution of this sample as our final output, and this final sampling scheme will introduce additional error on top of the regret of the players. Putting it all together, which requires carefully analyzing the game, including the regret of the players and the additional error due to sampling from $\bar{p}$, results in the following Theorem. Its proof can be found in Appendix \ref{app:class}. \begin{algorithm}[t] \KwIn{$S = \cup_{k=1}^K G_k$ data set consisting of $K$ groups, $(\ell,\alpha)$ desired fairness parameters} Let $n = \vert S \vert$ and $n_{min} = \min_k \vert G_k \vert$\; \For{$j=1,2, \ldots, \ell$}{ Set $T_j = \frac{256 \left(2 \alpha + j \right)^2 n^3}{\alpha^4 n_{min}^2}$\; Set $B_j = \frac{\alpha + j}{\alpha}$\; Set $m_j = \frac{K^2 n_{min}^2 T_j \log \left( 4jKT_j/\delta\right)}{2 n^3}$\; $(\hat{p}_j, \hat{\eta}_j) = \mathtt{ClfNR} (T_j, B_j, m_j; \hat{\eta}_1, \ldots, \hat{\eta}_{j-1})$ (Calling Algorithm~\ref{alg:nr-classification}) } \KwOut{$(\ell,\alpha)$-convex lexifair model $\hat{p}_\ell$} \caption{$\mathtt{LexiFairClf}$: Finding a Lexifair Classification Model} \label{alg:fair-classification} \end{algorithm} \begin{algorithm}[t] \KwIn{$T$ number of rounds, $B$ dual variable's upper bound, $m$ number of samples to draw, previous estimates $(\eta_1, \ldots, \eta_{j-1})$} Set learning rates $\eta = \frac{n_{min}}{B} \sqrt{\frac{1}{nT}}$, $\eta' = \frac{1}{1+B} \sqrt{\frac{1}{T}}$ where $n_{min}$ is the size of the smallest group.\; Initialize the Learner $\hat{p}^1 \in \Delta \mathcal{H}$, $D^{1} \in \Delta ([0,j])$\; \For{$t=1,2, \ldots, T$}{ Learner plays actions $(\hat{p}^t, D^t)$\; Auditor Best Responds: $\lambda^t = \lambda_\text{best} (\hat{p}^t, \mathbb{E}_{x \sim D^t} [x])$ using Algorithm~\ref{alg:auditorbest}\; Update the running sum: $\bar{\lambda}^t = \sum_{s \le t} \lambda^s$\; Sample from the Learner's FTPL distribution: \\ \For{s = 1,2, \ldots, m}{ Draw $\xi_i \sim U[0,1]$ for all $i \le n$. Call the oracle CSC$(\mathcal{H})$ to solve \[ h^s = \argmin_{h \in \mathcal{H}} \sum_{i=1}^n \left( c_i \left( \bar{\lambda}^t \right) + \frac{1}{\eta} \xi_i \right) h(x_i) \] } Let $\hat{p}^{t+1}$ be the empirical distribution over $\{h^s\}_{s=1}^m$\; Let $D^{t+1} = j \cdot Bern(q^t)$ where $q^t = \min \left( 1, - \eta' c \left(\bar{\lambda}^t \right) \cdot \mathds{1} \left[ c \left(\bar{\lambda}^t \right) \le 0 \right] \right)$\; } Sample from the average distribution $\bar{p} = \frac{1}{T} \sum_{t=1}^T p^t$: \\ \For{s = 1,2, \ldots, m}{ Draw a random number $t \in [T]$\; Draw $\xi_i \sim U[0,1]$ for all $i \le n$. Call the oracle CSC$(\mathcal{H})$ to solve \[ h^s = \argmin_{h \in \mathcal{H}} \sum_{i=1}^n \left( c_i \left( \bar{\lambda}^t \right) + \frac{1}{\eta} \xi_i \right) h(x_i) \] } Let $\hat{p}$ be the empirical distribution over $\{h^s\}_{s=1}^m$\; Let $\bar{D}$ be the average distribution: $\bar{D} = \frac{1}{T} \sum_{t=1}^T D^t$\; Let $\hat{\eta}_j = \mathbb{E}_{x \sim \bar{D}} \left[ x \right]$\; \KwOut{randomized model $\hat{p} \in \Delta \mathcal{H}$, and estimate $\hat{\eta}_j \in [0,j]$.} \caption{$\mathtt{ClfNR}$: $j$th round} \label{alg:nr-classification} \end{algorithm} \begin{restatable}[Lexifairness for Classification]{thm}{mainthm}\label{thm:lexifair-clf} Let $\mathcal{H}$ be any class of binary classifiers with finite VC dimension, and let $L_z( p ) = \mathbb{E}_{h \sim p} \left[ L_z (h )\right]$ for any randomized model $p \in \Delta \mathcal{H}$ where $L_z (h) = \mathds{1} \left\{ h(x) \neq y \right\}$ is the zero-one loss. Fix any $\ell \le K$ and any $\alpha \ge 0$. We have that for any $\delta > 0 0$, with probability at least $1-\delta$, the model $\hat{p}_\ell \in \Delta \mathcal{H}$ output by Algorithm~\ref{alg:fair-classification} is $(\ell,\alpha)$-convex lexicographic fair. \end{restatable} \section{Generalization} \label{sec:generalization} In this section, we turn our attention to out of sample bounds. Standard uniform convergence statements would tell us that if we have enough samples from every group, then our in-sample group errors are good estimates of our out of sample group errors. However, this alone does not directly imply that we satisfy approximate lexifairness out of sample. We prove this is the case below. Our ability to prove out of sample bounds crucially relies on our definitional choices that removed the instability of the naive Definition \ref{def:failedlexifair}. Specifically, we show that if: \begin{enumerate} \item Our base class $\mathcal{H}$ satisfies a standard uniform convergence bound across every group (so that we can control the maximum gap between in and out of sample error across every $h \in \mathcal{H}$, within each group $k$), and \item We have a model that is approximately convex lexifair on our dataset $S \sim \mathcal{P}^n$, then \end{enumerate} then our model is also appropriately convex lexifair on the underlying distribution (with some loss in the approximation parameter). \begin{thm}[Generalization for Convex Lexifairness]\label{thm:convex-generalization} Fix any distribution $\mathcal{P}$. Suppose for every $\delta > 0$, there exists $\beta(\delta)$ such that the following uniform convergence bound holds. \[ \Pr_{S} \left[ \max_{h \in \mathcal{H}, k \in [K]} \left\vert L_k \left(h, S \right) - L_k \left(h, \mathcal{P} \right)\right\vert > \beta(\delta) \right] < \delta \] where $S$ is a data set sampled $i.i.d.$ from $\mathcal{P}$. We have that for every data set $S$ sampled $i.i.d.$ from $\mathcal{P}$, if a model $h$ satisfies $(\ell, \alpha)$-convex lexicographic fairness with respect to $S$, then with probability at least $1-\delta$ it also satisfies $(\ell, \alpha')$-convex lexicographic fairness with respect to $\mathcal{P}$ for $\alpha' = \alpha + 2 \ell \beta (\delta)$. \end{thm} \begin{proof} Fix a distribution $\mathcal{P}$ and a data set $S$ sampled $i.i.d.$ from $\mathcal{P}$. Suppose $h$ satisfies $(\ell, \alpha)$-convex lexicographic fairness with respect to $S$. Therefore, according to our convex lexifairness definition, there exists a sequence of mappings $\vec{\epsilon} = (\epsilon_1, \ldots, \epsilon_\ell)$ where $\epsilon_j \in \mathbb{R}^{\mathcal{H}}$, and a sequence of function classes $\{\mathcal{F}_{(j)}^{\vec{\epsilon}} (S)\}_j$ such that \[ \max_{1 \le j \le \ell} \left\{ \max_{h' \in \mathcal{H}} \epsilon_j (h') \right\} \le \alpha \] and that for all $j \le \ell$: \begin{equation}\label{eq:something} \max_{ \left\{ i_1, \ldots, i_j \right\} \subseteq [K] } \sum_{r=1}^j L_{i_r} (h, S) \le \min_{g \in \mathcal{F}_{(j-1)}^{\vec{\epsilon}}(S) } \max_{\left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (g, S) + \epsilon_j (h) + \alpha \end{equation} where recall that $\mathcal{F}^{\vec{\epsilon}}_{(0)} (S) = \mathcal{H}$ and that for all $j \in [\ell]$, \[ \mathcal{F}_{(j)}^{\vec{\epsilon}} (S) = \left\{ h' \in \mathcal{F}_{(j-1)}^{\vec{\epsilon}}(S): \max_{ \left\{ i_1, \ldots, i_j \right\} \subseteq [K] } \sum_{r=1}^j L_{i_r} (h', S) \le \min_{g \in \mathcal{F}_{(j-1)}^{\vec{\epsilon}}(S) } \max_{\left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (g, S) + \epsilon_j (h') \right\} \] Let us define a mapping $\nu_j^1 : \mathcal{H} \to \mathbb{R}$ such that for every $h' \in \mathcal{H}$, \[ \nu_j^1 (h') \triangleq \max_{ \left\{ i_1, \ldots, i_j \right\} \subseteq [K] } \sum_{r=1}^j L_{i_r} (h', \mathcal{P}) - \max_{ \left\{ i_1, \ldots, i_j \right\} \subseteq [K] } \sum_{r=1}^j L_{i_r} (h', S) \] and let \[ \nu_j^2 \triangleq \min_{g \in \mathcal{F}_{(j-1)}^{\vec{\epsilon}}(S) } \max_{\left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (g, S) - \min_{g \in \mathcal{F}_{(j-1)}^{\vec{\epsilon}}(S) } \max_{\left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (g, \mathcal{P}) \] Now define for every $h' \in \mathcal{H}$, $\tau_j (h') \triangleq \epsilon_j (h') + \nu_j^1 (h') + \nu_j^2$ and let $\mathcal{F}_{(j)}^{\vec{\tau}} (\mathcal{P})$ be defined according to our convex lexifairness definition with the sequence of mappings defined by $\vec{\tau} = (\tau_1, \ldots, \tau_\ell)$. In other words, $\mathcal{F}_{(0)}^{\vec{\tau}} (\mathcal{P}) = \mathcal{H}$, and for all $j \in [\ell]$, \[ \mathcal{F}_{(j)}^{\vec{\tau}} (\mathcal{P}) = \left\{ h' \in \mathcal{F}_{(j-1)}^{\vec{\tau}}(\mathcal{P}): \max_{ \left\{ i_1, \ldots, i_j \right\} \subseteq [K] } \sum_{r=1}^j L_{i_r} (h', \mathcal{P}) \le \min_{g \in \mathcal{F}_{(j-1)}^{\vec{\tau}}(\mathcal{P}) } \max_{\left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (g, \mathcal{P}) + \tau_j (h') \right\}. \] \begin{clm}\label{clm:something2} For all $j$, $\mathcal{F}_{(j)}^{\vec{\tau}} (\mathcal{P}) = \mathcal{F}_{(j)}^{\vec{\epsilon}} (S)$. \end{clm} \begin{proof} We use induction on $j$. For $j=0$, we have $\mathcal{F}_{(0)}^{\vec{\tau}} (\mathcal{P}) = \mathcal{F}_{(0)}^{\vec{\epsilon}} (S) = \mathcal{H}$. For $j \ge 1$, we have \begin{align*} h' \in \mathcal{F}_{(j)}^{\vec{\tau}} (\mathcal{P}) &\Longleftrightarrow h' \in \mathcal{F}_{(j-1)}^{\vec{\tau}}(\mathcal{P}), \ \max_{ \left\{ i_1, \ldots, i_j \right\} \subseteq [K] } \sum_{r=1}^j L_{i_r} (h', \mathcal{P}) \le \min_{g \in \mathcal{F}_{(j-1)}^{\vec{\tau}}(\mathcal{P}) } \max_{\left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (g, \mathcal{P}) + \tau_j (h') \\ &\Longleftrightarrow h' \in \mathcal{F}_{(j-1)}^{{\vec{\epsilon}}}(S), \ \max_{ \left\{ i_1, \ldots, i_j \right\} \subseteq [K] } \sum_{r=1}^j L_{i_r} (h', \mathcal{P}) \le \min_{g \in \mathcal{F}_{(j-1)}^{{\vec{\epsilon}}}(S) } \max_{\left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (g, \mathcal{P}) + \tau_j (h') \\ &\Longleftrightarrow h' \in \mathcal{F}_{(j-1)}^{{\vec{\epsilon}}}(S), \ \max_{ \left\{ i_1, \ldots, i_j \right\} \subseteq [K] } \sum_{r=1}^j L_{i_r} (h', S) \le \min_{g \in \mathcal{F}_{(j-1)}^{\vec{\epsilon}}(S) } \max_{\left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (g, S) + \epsilon_j (h') \\ &\Longleftrightarrow h' \in \mathcal{F}_{(j)}^{{\vec{\epsilon}}}(S) \end{align*} where the second line follows from the induction assumption ($\mathcal{F}_{(j-1)}^{\vec{\tau}}(\mathcal{P}) = \mathcal{F}_{(j-1)}^{\vec{\vec{\epsilon}}}(S)$) and the third line follows from the definition of $\tau_j$. This establishes our claim. \end{proof} We have that for all $j \le \ell$, the model $h$ satisfies \begin{align*} \max_{ \left\{ i_1, \ldots, i_j \right\} \subseteq [K] } \sum_{r=1}^j L_{i_r} (h, \mathcal{P}) &= \max_{ \left\{ i_1, \ldots, i_j \right\} \subseteq [K] } \sum_{r=1}^j L_{i_r} (h, S) + \nu_j^1 (h) \\ &\le \min_{g \in \mathcal{F}_{(j-1)}^{\vec{\epsilon}}(S) } \max_{\left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (g, S) + \epsilon_j (h) + \alpha + \nu_j^1 (h) \\ &= \min_{g \in \mathcal{F}_{(j-1)}^{\vec{\epsilon}}(S) } \max_{\left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (g, \mathcal{P}) + \nu_j^2 + \epsilon_j (h) + \alpha + \nu_j^1 (h) \\ &= \min_{g \in \mathcal{F}_{(j-1)}^{\vec{\tau}}(\mathcal{P}) } \max_{\left\{ i_1, \ldots, i_j \right\} \subseteq [K]} \sum_{r=1}^j L_{i_r} (g, \mathcal{P}) + \tau_j (h) + \alpha \end{align*} where the first inequality follows from Equation~\eqref{eq:something}. The third line follows from the definition of $\nu_j^2$. The last equality follows from Claim~\ref{clm:something2} and the fact that $\tau_j (h) = \epsilon_j (h) + \nu_j^1 (h) + \nu_j^2$. The proof is complete by the uniform convergence bound provided in the theorem statement. With probability at least $1-\delta$ over the random draws of the data set $S$, we have $\max_{h' \in \mathcal{H}} \vert \nu_j^1 (h') \vert \le j\beta(\delta)$ and $\vert \nu_j^2 \vert \le j\beta(\delta)$, and hence for all $j \le \ell$, \begin{align*} \Vert \tau \Vert_\infty &= \max_{1 \le j \le \ell} \left\{ \max_{h' \in \mathcal{H}} \tau_j (h') \right\} \\ &\le \max_{1 \le j \le \ell} \left\{ \max_{h' \in \mathcal{H}} \epsilon_j (h') \right\} + \max_{1 \le j \le \ell} \left\{ \max_{h' \in \mathcal{H}} \vert \nu_j^1 (h') \vert + \vert \nu_j^2 \vert \right\}\\ &\le \alpha + 2 l \beta(\delta) \end{align*} \end{proof} We can now instantiate the above theorem in a classification setting in which we have VC-type convergence bounds. A corollary that we get by applying standard uniform convergence bounds for finite VC classes (See Appendix \ref{sec:VC}) is the following: \begin{cor}[Generalization for Convex Lexifairness: Classification Setting] Suppose $\mathcal{H}$ is a class of binary classifiers with VC dimension $d_\mathcal{H}$ and let $L_z( p ) = \mathbb{E}_{h \sim p} \left[ L_z (h )\right]$ for any randomized model $p \in \Delta \mathcal{H}$ where $L_z (h) = \mathds{1} \left\{ h(x) \neq y \right\}$ is the zero-one loss. We have that for every $\mathcal{P}$, every data set $S \equiv \{ G_k \}_k$ of size $n$ sampled $i.i.d.$ from $\mathcal{P}$, if a model $p \in \Delta \mathcal{H}$ satisfies $(\ell, \alpha)$-convex lexicographic fairness with respect to $S$, then with probability at least $1-\delta$ it also satisfies $(\ell, 2 \alpha)$-convex lexicographic fairness with respect to $\mathcal{P}$ provided that \[ \min_{1 \le k \le K} \left\vert G_k \right\vert = \Omega \left( \frac{l^2 \left( d_\mathcal{H} \log \left( n \right) + \log \left( K / \delta \right) \right)}{\alpha^2} \right) \] \end{cor} We have here proven a generalization theorem for convex lexifairness (Definition~\ref{def:convexlexifair}) which is the definition that our algorithms satisfy. We also prove a generalization theorem for lexifairness (Definition~\ref{def:lexifair}) in Appendix~\ref{sec:lexifair-generalization}. \subsection*{Acknowledgements} Supported in part by the Warren Center for Network and Data Sciences, NSF grant CCF-1763307 and the Simons Collaboration on the Theory of Algorithmic Fairness. \bibliographystyle{plainnat}
\section{Abstract} As we rapidly approach the frontiers of ultra large computing resources, software optimization is becoming of paramount interest to scientific application developers interested in efficiently leveraging all available on-Node computing capabilities and thereby improving a requisite science per watt metric. The scientific application of interest here is the Basic Math Library (BML) that provides a singular interface for linear algebra operation frequently used in the Quantum Molecular Dynamics (QMD) community. The provisioning of a singular interface indicates the presence of an abstraction layer which in-turn suggests commonalities in the code-base and therefore any optimization or tuning introduced in the core of code-base has the ability to positively affect the performance of the aforementioned library as a whole. With that in mind, we proceed with this investigation by performing a survey of the entirety of the BML code-base, and extract, in form of micro-kernels, common snippets of code. Since the data structure of the core BML code-base is well established we pursue less invasive optimization strategies, that is, we focus our effort on optimizing at the thread level as opposed to modifying the data-structures for performance at the Single Instruction Multiple Data (SIMD) scale. We incorporate several active and passive directives/pragmas that aid to inform the compiler on nature of the data-structures and algorithms. Following that, we introduce several optimization strategies into these micro-kernels including 1.) Strength Reduction 2.) Memory Alignment for large arrays 3.) Non Uniform Memory Access (NUMA) aware allocations to enforce data locality and 4.) appropriate thread affinity and bindings to enhance the overall multi-threaded performance. After introducing these optimizations, we benchmark the micro-kernels and compare the run-time before and after optimization for several target architectures. Finally we use the results as a guide to propagating the optimization strategies into the BML code-base. As a demonstration, herein, we test the efficacy of these optimization strategies by comparing the benchmark and optimized versions of the code using a 1.) matrix-matrix multiplication using the ELLPACK format and 2.) a full simulation using ExaSP2, a proxy application for linear scaling electronic structure calculations. The results of the optimization are promising and in agreement with findings in literature. \section{Introduction} The optimization of electronic structure codes requires different efforts including the improvement of solvers, and the adaptation of basic operations to novel computer architectures. With the advent of the exascale computing architectures, the aforementioned adaptation requires thorough modifications in order to maximize the use of the computational capacity \cite{noauthor_undated-za,CoPA-Exascale}. Furthermore, in the specific case of electronic structure calculations, different chemical systems require specific solver as well as specific architecture adaptation, and generally, what is beneficial for some systems will not necessarily be for others. QMD technique requires solving for the electronic structure of the physical system to advance the positions of the atoms at each simulation time-step. Solving for the electronic structure is generally a task that involves a high computational cost due to the fact that the number of arithmetic operations scale with the cube of the number of atoms. In order to alleviate this computational cost, various $\mathcal{O}(N)$ complexity algorithms have been proposed \cite{Bowler2012-ew,Goedecker1999-wt}. These algorithms typically approximate the solution with an error that can be controlled by means of an adjustable parameter. They are typically iterative, and require linear algebra operations in each iteration \cite{Niklasson2002-rl,Mniszewski2019-qt}. For optimal performance however, these linear scaling codes have to be optimized at both the vector and thread level. Optimizing data structure for improved parallelism is challenging and can be somewhat disruptive, therefore, we focus on optimizing at the thread level. One of the primary purposes of multi-core computer technology is latency hiding. However, at the cost of latency hiding is the inherent programmability challenges needed to be circumvented in order to achieve high performance gains in software applications, measured in terms of improvements in floating point operations (FLOPS) or run-time. Therefore, herein, we attempt to optimize the Basic Matrix Library (BML) software for performance gains in terms of run-time. BML is a collection of matrix data formats (for dense and sparse) and basic matrix operations designed to help electronic structures codes run efficiently on various platforms~\cite{Bock2018}\cite{bml_github}\cite{bml}. We focus on several strategies namely (i) Strength Reduction (SR), (ii) memory alignment (MA) to prevent cache contention, (iii) memory initialization with an understanding of first touch (FT) policy on Linux system, and (iv) thread affinity and binding (A\&B) optimizations that works in conjunction with all the aforementioned techniques for optimal performance. The rest of this manuscript is organized in the format delineated below. Section~\ref{section:methodology} expands on the optimizations techniques implemented in the BML~\cite{bml} software. It is preceded by section~\ref{section:brief}, where we brief on the overall approach taken to optimizing the BML~\cite{bml} software. This is followed by section~\ref{section:targetarchitecture}, which discusses the target computer architectures used for evaluating the performance of the BML~\cite{bml} code-base before and after optimization. \cref{section:SR,section:NUMA-allocations,section:MA,section:AB} discusses and demonstrates in detail the optimization techniques introduced into the BML~\cite{bml} software namely Strength Reduction (SR)~\cite{park2012efficient,godbolt2020optimizations,adedoyin2017,vladimirov2015fine, waite2012compiler,sheldon2001strength,amarasinghe1999strength,cocke1977algorithm,allen1981reduction}, NUMA aware allocations to enforce data locality~\cite{tate2014programming,denoyellenuma,adedoyin2017,Asai2017-1,Asai2017-2}, Memory Alignment (MA)~\cite{Intel-2013-1,ALESSANDRINI2016375,JEFFERS2013107, Eltablawy2017,Vladimirov2015,Application2017,Asai2017-5,Vladimirov2012} for large arrays and appropriate thread affinity and bindings (AB)~\cite{VictorEijkhout-1,eijkhout2017parallel,Intel-2019-1,Intel-2019-2,openmp-1} to enhance multi-threaded performance, respectively. \cref{section:SR,section:NUMA-allocations,section:MA,section:AB} is also accompanied by sample implementation of in form of code snippets demonstrating the implementation of the aforementioned optimizations techniques. It also shows individual results of performance improvements. \cref{section:results-1} combines all the aforementioned optimization techniques and introduces them into the BML software \cite{bml}. Following that we generate several pseudo system matrices representing metals, semi conductors and soft matter ranging in size from 1000 to 32000 and evaluate the efficacy of these optimizations by measuring the performance differences of BML's EllPACK matrix-matrix multiply algorithm before and after tuning \cite{bml}. \cref{section:results-2} evaluates the performance of ExaSP2, a proxy application for performing QMD calculations that relies on the BML~\cite{bml} software for its linear algebra computations. System matrices representing semi conductors and soft matter of size 32000 are evaluated for performance. \cref{section:conclusion} contains a discussion summary of the findings herein. \section{Methodology} \label{section:methodology} \subsection{Brief} \label{section:brief} Performance optimization of a large code-base can be a daunting task therefore, herein we introduce carefully designed subroutines, henceforth referred to as micro-kernels, that are representative of the methods in the un-optimized BML~\cite{bml} software. For the ease of evaluating the effects of the optimizing techniques introduced herein, we design the micro-kernels such that complex code behaviour e.g. cache trashing, branching and non-unit stride access are avoided though present in BML's~\cite{bml} ELLPACK subroutine. At a latter time, we plan to address the effects of such complex behaviour as they impede on overall performance. We proceed by optimizing this micro-kernels in a step by step manner while being mindful of the compile time difference that may be introduced while building and linking the actual BML software \cite{bml}. The target algorithm is memory bandwidth bound as it is a sparse matrix-matrix multiply algorithm with the ratio of FLOP to byte of data (n) requested from memory of $\textup{O}(\textup{n}<3)$ . \subsection{Target Architecture:} \label{section:targetarchitecture} The target multi-core platform experimented with herein are recent releases of Intel architectures namely Intel's Sky-lake Gold, Sky-lake Platinum, Cascade Lake with and without support for Intel's Optane\texttrademark DC persistent memory. Table~\ref{tab:hardware__specs} contains the specification details of the aforementioned architectures. \input{tables/arch} \subsection{Micro-Kernel Performance Evaluation - Strength Reduction:} \label{section:SR} Strength Reduction~\cite{park2012efficient,godbolt2020optimizations,adedoyin2017,vladimirov2015fine, waite2012compiler,sheldon2001strength,amarasinghe1999strength,cocke1977algorithm,allen1981reduction}, is an optimization procedure, driven either via human intervention or software compiler, where by high latency (costly) operations are substituted with their lower latency (cheaper) counterpart while maintaining mathematical correctness. SR or approach approximate strength reduction (ASR) techniques can vary from very simple ~\cite{adedoyin2017,vladimirov2015fine} to more complex and involving substitutions\cite{park2012efficient, godbolt2020optimizations,waite2012compiler,sheldon2001strength,amarasinghe1999strength,cocke1977algorithm, allen1981reduction}. The need for SR tuning in the BML~\cite{bml} software, though not prevalent, is a low hanging fruit therefore we evaluate the performance difference between atypical occurrences of in-loop division with multiplications. Listing~\ref{lis:strengthreduction-OFF} is a code snippet of the micro-kernel atypical of the occurrences in the BML software \cite{bml}. Listing~\ref{lis:strengthreduction-ON} is a SR substitutions where we replace divisions within a loop with a single multiplication. Figure~\ref{fig:SR-All} is a run-time comparison of the benchmark (BHMK) vs. optimized (TUNED) micro-kernels for multiple dual socket Intel architectures using Intel 17 compiler. The performance of the optimized (TUNED) micro-kernel is approximately 2X across multiple thread sizes and varying architectures. \begin{figure} \centering \begin{filecode-0}[] \lstinputlisting{code/strengthreduction-OFF.c} \end{filecode-0} \caption{ Micro-kernel without strength reduction representative of the subroutines in BML~\cite{bml} before tuning.} \label{lis:strengthreduction-OFF} \end{figure} \begin{figure} \begin{filecode-1}[] \lstinputlisting{code/strengthreduction-ON.c} \end{filecode-1} \caption{Micro-kernel with strength reduction applied.} \label{lis:strengthreduction-ON} \end{figure} \begin{figure}[h!] \includegraphics[width=\textwidth]{figures/SR-All-new.png} \caption{Performance in run-time for the benchmark (BHMK) vs. optimized (TUNED) micro-kernel for SR for Cascade Lake (Top-Left), Sky-Lake Gold (Top-Right), Sky-Lake Platinum (Bottom-Left) and Cascade Lake with Intel Optane Technology (Bottom-Right).} \label{fig:SR-All} \end{figure} \subsection{Micro-Kernel Performance Evaluation - NUMA Aware Data} \label{section:NUMA-allocations} Data locality in the BML~\cite{bml} software is tuned for by ensuring that 1.) malloc-ed memory is initialized in a parallel region with the ``First Touch'' policy in mind and 2.) the affinity and binding settings for the initialization and computation loops for data used in multi-threaded regions are specified carefully such that computational data remains NUMA local. The ``First Touch'' policy with respect to memory allocation and memory page assignment on Linux systems, is associated with the physical location of memory (NUMA~\cite{lameter2013numa} domain) at the point in which the actual memory addresses get modified (initialization). At the point of modification, the memory pages get assigned and further associated with that specific NUMA domain. Therefore, the First Touch policy determines memory page ownership \cite{Intel-2013-1}. Consideration for NUMA in order to avoid needless data movement (data locality) can be implemented to cater to different levels of parallelism which may include the SIMD, Thread and Node level. Several researchers~\cite{tate2014programming,denoyellenuma,adedoyin2017,Asai2017-1,Asai2017-2} have shown that the aforementioned approach improves the overall performance of computational algorithms by avoiding needless data movement. Prior to optimization for data locality, atypical linear algebra operations performed using the BML API required three steps namely 1.) memory allocation and initialization followed by 2.) the linear algebra calculation of interest and 3.) Memory de-allocation. The memory allocation and initialization step above is typically achieved in BML via two calls, one to \verb|malloc()| and the other to \verb|memset()|. This is also achieved via a single call to \verb|calloc()|. \begin{figure} \begin{filecode-0 \lstinputlisting{code/non-numaaware.c} \end{filecode-0} \caption{Micro-kernel without consideration for data locality representative of the subroutines in BML~\cite{bml} before tuning.} \label{lis:nonnumaaware} \end{figure} \begin{figure} \begin{filecode-1 \lstinputlisting{code/numaaware.c} \end{filecode-1} \caption{Micro-kernel with consideration for data locality representative of the subroutines in BML~\cite{bml} after tuning.} \label{lis:numaaware} \end{figure} The second step involving the Linear algebra operation of interest, e.g. a Matrix-Matrix multiply calculation, is typically comprised of a multi-threaded loop in a parallel region written using the OpenMP paradigm. With the First Touch policy in mind, step one and two are in conflict given that they are performed in a serial and parallel region, respectively. The first step is a serial operation with an associated performance penalty as the memory pages become associated with the specific NUMA domain they were first touched. Listing~\ref{lis:nonnumaaware} is a code snippet of the micro-kernel atypical of the occurrences in the BML software. Listing~\ref{lis:numaaware} is a NUMA aware data initialization that ensures data locality in the computational loop by first touching data in a parallel region (lines 7-10) a opposed to (listing~\ref{lis:nonnumaaware} lines 7-9) using \verb|memset()| to initially modify malloc-ed data. Figure~\ref{fig:NUMA__unaware} is a pictorial illustration of a simplified modern multi-core computer showing computational cores and memories (RAM) associated with two NUMA domains. NUMA domain zero (core:0 and Memory:0) and one (core:1 and Memory:1) have an associate compute core and memory colored in blue and red respectively. To minimizes obscurity, we simplified the physical description of each NUMA domain (0 and 1) and further assume that each core is actually multiple cores each with multiple levels of associated cache hierarchy and bandwidth infrastructure. The blue banks of memory located on NUMA:0 (red) represent data initialized on Memory:0 that potentially get moved to NUMA:1 (blue) during computation. This movement leads to additional performance penalty (higher latency) when performing computation on non-local data. This needles computational expense may also lead to cross NUMA domain cache conflict. Figure~\ref{fig:NUMA__aware} shows a snap-shot of the preferred association of data and computational core in a compute loop. A completely disjoint subset of data associated with distinct NUMA domains is ideal, though in practice may require careful software design. Figure~\ref{fig:FT-All} is run-time comparison of the benchmark (BHMK) vs. optimized (TUNED) micro-kernels for multiple dual socket Intel architectures using Intel 17 compiler. The performance of the optimized (TUNED) micro-kernel is at best 3X for high thread counts and 2X on average on all architectures. In conjunction with NUMA aware allocations is the careful specification of thread affinity and binding to ensure thread placement is consistent with data location, in addition, the specified number of threads per core is consistent with the arithmetic intensity of the application under consideration, and finally that threads migration is avoided. Others authors~\cite{9101899,hildenbrand2020dynamic, mason2020unexpected,barrera2020modeling,wagle2018numa,wang2016predicting} have demonstrated the challenges associated with non-locality of data and have proposed several solutions. \begin{figure}[h!] \includegraphics[width=\textwidth]{figures/NUMA-unaware-10.png} \caption{Illustration of modern multi-core architectures with multiple NUMA domains. Showing the effect of programming without considerations for ``First Touch” policies on Linux systems. During simulation data present on NUMA:0 is fetched from NUMA:1. } \label{fig:NUMA__unaware} \end{figure} \begin{figure}[h] \includegraphics[width=\textwidth]{figures/NUMA-aware-10.png} \caption{Illustration of modern multi-core architectures with multiple NUMA domains. Showing the effect of programming with considerations for ``First Touch” policies on Linux systems. During simulation data present on NUMA:0 is fetched from NUMA:0 and vice-versa.} \label{fig:NUMA__aware} \end{figure} \begin{figure}[h!] \includegraphics[width=\textwidth]{figures/FT-All-new.png} \caption{Performance in run-time for the benchmark (BHMK) vs. optimized (TUNED) micro-kernel for data locality for Cascade Lake (Top-Left), Sky-Lake Gold (Top-Right), Sky-Lake Platinum (Bottom-Left) and Cascade Lake with Intel Optane Technology (Bottom-Right).} \label{fig:FT-All} \end{figure} \subsection{Micro-Kernel Performance Evaluation - Memory Alignment:} \label{section:MA} The application of memory alignment, as demonstrated by~\cite{Intel-2013-1,ALESSANDRINI2016375,JEFFERS2013107, Eltablawy2017,Vladimirov2015,Application2017,Asai2017-5,Vladimirov2012}, is primarily for the purpose of preventing cache contention on multi-core computer hardware. Cache contention on multi-core hardware occurs when multiple hardware threads attempt to use the same line of cache. Figure~\ref{fig:MA-Illustration} is an illustration of a simplified modern multi-core computer architecture containing four cores and showing two cache lines belonging to core:2 (purple) and core:3 (blue). Listing~\ref{lis:MA-OFF} is a code snippet of the micro-kernel atypical of the occurrences of memory allocation in the BML software. Listing~\ref{lis:MA-ON} is a code snippet of the micro-kernel reflecting memory alignment that ensures minimal cache contention in the computational loop. Listing~\ref{lis:MA-ON} shows aligned memory allocations using Intel compiler ~\cite{Intel-2013-1} (lines 2-4), hinting the compiler (lines 11-13) and a complementary aligned memory de-allocation (lines 18-20). A similar API that allows for aligned memory allocation is available with the GCC compiler~\cite{Linux-1}. \begin{figure} \centering \includegraphics[scale=0.5,angle=90]{figures/MemoryAlignment-1.png} \caption{An Illustration of the need for memory alignment on multi-core architectures. Showing contention between core:2 and core:3.} \label{fig:MA-Illustration} \end{figure} \begin{figure} \begin{filecode-0 \lstinputlisting{code/memoryalignment-OFF.c} \end{filecode-0} \caption{Memory allocation in BML software.} \label{lis:MA-OFF} \end{figure} \begin{figure} \begin{filecode-1 \lstinputlisting{code/memoryalignment-ON.c} \end{filecode-1} \caption{Memory allocation with memory alignment in BML software.} \label{lis:MA-ON} \end{figure} Figure~\ref{fig:MA-All} is comparison of the run-time of the benchmark (BHMK) vs. optimized (TUNED) micro-kernels for multiple dual socket Intel architectures using Intel 17 compiler. The performance of the optimized (TUNED) micro-kernel is at best 11X for high thread counts and 5X on average across all architectures. \begin{figure} \includegraphics[width=\textwidth]{figures/MA-All-new.png} \caption{Performance in run-time for the benchmark (BHMK) vs. optimized (TUNED) micro-kernel for memory alignment for Cascade Lake (Top-Left), Sky-Lake Gold (Top-Right), Sky-Lake Platinum (Bottom-Left) and Cascade Lake with Intel Optane Technology (Bottom-Right).} \label{fig:MA-All} \end{figure} \subsection{Micro-Kernel Performance Evaluation - Thread Binding and Affinity:} \label{section:AB} The purpose of rectifying the previously utilized thread binding and affinity settings used while performing linear algebra computations in BML~\cite{bml} is to ensure that sub-optimal hardware utilization is prevented. Two known issues that degrade performance when using multi-core computers are 1.) thread migration and 2.) the utilization of non-equivalent threads during simulation. Thread migration is a process whereby operational threads migrate or move from core to core during simulations. This behaviour affects the repeatably during performance testing or bench-marking. Non-equivalent thread utilization is a scenario whereby operational threads do not have the same associated resources (L1, L2 or L3/LLC cache). This also affects repeatably during performance testing or bench-marking. It occurs as a result of a lack of specificity in the environment variables that control the binding and affinity of thread to hardware core(s) and/or socket(s). Preventing thread migration and appropriately specifying the correct thread binding and affinity using Intels's API~\cite{VictorEijkhout-1,eijkhout2017parallel,Intel-2019-1,Intel-2019-2}, requires setting two environment variables namely $\texttt{KMP\char`_ AFFINITY}$ and $\texttt{KMP\char`_HW\char`_SUBSET}$. $\texttt{KMP\char`_ AFFINITY}$ controls the thread placement which is highly dependent on the predominant arithmetic intensity (AI) of the application. Figure~\ref{fig:NUMA__unaware} is a pictorial representation of a thread placement specified as ``scatter". In addition, setting both environment variable prevent thread migration. $\texttt{KMP\char`_HW\char`_SUBSET}$ determines the number of active threads and is set in the following format $\texttt{<\#1>s,2t,<\#2>c}$. \textup{c},\textup{t},\textup{s} stand for cores per socket, threads per core, and number of active sockets, respectively. As an example, for a dual socket hardware with twenty-four cores and two hardware threads per core, $\texttt{KMP\char`_HW\char`_SUBSET}$ set to $\texttt{1t,2s,24c}$ implies that forty-eight threads are operational on that node at one thread per core. Similarly, $\texttt{2s,2t,24c}$ implies that forty-eight threads are operational on each socket with a total of ninety-six total threads (two threads per core). Table~\ref{aff-and-bind-setting} shows the best practice guidelines for configuring the affinity and binding of an application depending on the procedure with the dominant AI using Intel and OpenMP API. \input{tables/affinity} \begin{figure} \includegraphics[width=\textwidth]{figures/Node__ThreadAffinity__scatter} \caption{An illustration of a modern dual socket multi-core architecture. Showing a coordination of memory initialization with thread binding and affinity with considerations for “First Touch” policies on Linux systems.} \label{fig:NUMA__unaware} \end{figure} \section{Results} \label{section:results} \subsection{Brief} \label{section:results-brief} In order to demonstrate of the viability of the aforementioned optimizations we proceed following the three steps delineated below. First, we generate chemically relevant system matrices following the techniques discussed in section~\ref{section:results-1} representing Metals, Semi Conductors and Soft Matter. Second, we evaluate the performance of BML ELLPACK matrix-matrix multiply algorithm for each system. Third, in order to demonstrate the viability of the aforementioned optimizations in a full simulation, we use ExaSP2, a spectral projection proxy application\cite{SMniszewski-1} for carrying out QMD computations. Following that, we establish a benchmark run-time for ExaSP2 to determine signature of the SP2-Basic algorithm which will inform on the condition in which the best performance gains in run-time is achieved. After establishing the representative/dominant AI, we compare the performance of the BHMK to that of the TUNED for those specific cases. \subsection{On the Generation of Model Hamiltonian System Matrices} \label{section:results-1} \input{figures/model-Hamiltonian} Chemically relevant system matrices typically fall under the following categories namely 1.) Metals, 2.) Semi Conductors or 3.) Soft Matter. Figure~\ref{fig:modelH} is a schematic representation of the model Hamiltonian matrices. These model systems are constructed by coupling arrays of two-level systems with A and B as atomic type of orbitals. Given that, A and B orbitals have onsite energies $\epsilon_{\textup{A}}$ and $\epsilon_{\textup{B}}$, respectively. A coupling between the same type of orbital, that is, comprising of only A type or B type, is given by either $\delta_{\textup{A}_{i}\textup{A}_{j}}$ or $\delta_{\textup{B}_{i}\textup{B}_{j}}$. Similarly, a coupling of elements between different orbitals, that is A and B, is given by $\delta_{\textup{A}_{i}\textup{B}_{j}}$. All couplings between orbitals are modulated by an exponential dumping factor computed as $\exp(\textup{k}|\textup{j}-\textup{i}|)$, where k is the decaying constant, and i and j are the positions of both orbitals. All the couplings and onsite energies are in units of electron Volts(eV). We also introduced a randomization parameter that adds noise to couplings and onsite energies. This noise is introduced as $\textup{param}(1 + r \times \textup{RAND})$, where RAND is a random number chosen between -1 and 1 and param represents any of the coupling or onsite energies involved. A module that enables the generation of these Hamiltonian system matrix has been recently added to the PROGRESS~\cite{2016progress} library. Figure~\ref{fig:systemsH} is a plot of the total DOS computed out of different model Hamiltonian matrices. The Fermi Level of the system is set to be 0.0 eV. System matrices representing Metals were generated by setting: \begin{equation*} \delta_{A_iA_j} = -1.0, \;\;\; \delta_{B_iB_j} = -1, \;\;\; k = -0.01, \end{equation*} and the rest of the parameters to 0.0, resulting in a sparsity of 0.98\%. For system matrices representing Semi Conductors, the parameters set to: \begin{equation*} \delta_{B_iB_j} = -1.0, \;\;\; \delta_{AB} = -2.0, \;\;\; k = -0.01, \end{equation*} and the rest of the parameters to 0.0, resulting in a sparsity of 94\% sparse. Soft Matter systems matrices were generated by setting: \begin{equation*} \delta_{B_iB_j} = -1.0, \;\;\; \delta_{AB} = -1.0, \;\;\; \epsilon_A = -10.0, \;\;\; k = -0.1, \;\;\; r = 1.0, \end{equation*} resulting in a sparsity of 82\% sparse. Figure~\ref{fig:MatrixPlot-Metals-SemiCond-SoftMatt} is a matrix plot using the BML Ellpack format for Metals, Semi Conductors and Soft Matter. \input{figures/totalDOS} \subsection{Performance Evaluation using System Matrices} \label{section:results-2} Figure~\ref{fig:MatrixPlot-Metals-SemiCond-SoftMatt} is a matrix plot of three systems namely metals, semi conductors and soft matter. It serves as a visual representation of the density of each system; with metal being the most dense. Figure~\ref{fig:BMLEllpackX2-Metals}, \ref{fig:BMLEllpackX2-SemiConductor} and \ref{fig:BMLEllpackX2-SoftMatter} show the performance of the benchmark (BHMK) vs. optimized (TUNED) BML matrix-matrix multiply algorithm using the ELLPACK format for the aforementioned systems on four different architectures. Matrix-matrix multiplications with metals (Figure~\ref{fig:BMLEllpackX2-Metals}), shows a 15\% to 30\% improvement on average in the optimized version of the BML library for larger matrix sizes on every architecture. Semi conductors (Figure~\ref{fig:BMLEllpackX2-SemiConductor}), show excellent improvement in the optimized code for all matrix sizes experimented with. On average, the 32k matrices are improved by over 100 folds. Figure~\ref{fig:BMLEllpackX2-SoftMatter}, (soft matter systems) shows similar improvements to that semi conductors. On average, the 32k matrices are improved by over 50 folds across all architectures. \input{figures/matrix-plot-1} \begin{figure} \includegraphics[width=\textwidth]{figures/X2-Multiply-Metal-All-.png} \caption{Performance in run-time for the benchmark (BHMK) vs. optimized (TUNED) BML ELLPACK matrix-matrix multiply for Metals computed on Cascade Lake (Top-Left), Sky-Lake Gold (Top-Right), Sky-Lake Platinum (Bottom-Left) and Cascade Lake with Intel Optane Technology (Bottom-Right).} \label{fig:BMLEllpackX2-Metals} \end{figure} \begin{figure} \includegraphics[width=\textwidth]{figures/X2-Multiply-SemiConductor-All-.png} \caption{Performance in run-time for the benchmark (BHMK) vs. optimized (TUNED) BML EllPACK matrix-matrix multiply for Semi Conductor computed on Cascade Lake (Top-Left), Sky-Lake Gold (Top-Right), Sky-Lake Platinum (Bottom-Left) and Cascade Lake with Intel Optane Technology (Bottom-Right).} \label{fig:BMLEllpackX2-SemiConductor} \end{figure} \begin{figure} \includegraphics[width=\textwidth]{figures/X2-Multiply-SoftMatter-All-.png} \caption{Performance in run-time for the benchmark (BHMK) vs. optimized (TUNED) BML EllPACK matrix-matrix multiply for Soft Matter computed on Cascade Lake (Top-Left), Sky-Lake Gold (Top-Right), Sky-Lake Platinum (Bottom-Left) and Cascade Lake with Intel Optane Technology (Bottom-Right).} \label{fig:BMLEllpackX2-SoftMatter} \end{figure} \subsection{Performance Evaluation using an ExaSP2 Application:} \label{section:results-3} The procedures that make up the SP2-Basic algorithm can be decomposed into two types namely the initialization and SP2 calculation step. The initialization step involves reading in the Hamiltonian (Read Hamiltonian) matrix and other miscellaneous initialization sub-steps (Init. Misc.). The SP2 calculation step involves a matrix-matrix multiplication (SP2 Loop X2) and a matrix norm (SP2 Loop Norm) calculation. All other steps within the SP2 calculation are categories under (SP2 Loop Misc.). For this exercise, only Semi Conductor and Soft Matter where experimented with as they are appropriate for an SP2 calculation. The ELLPACK matrix format and corresponding algorithms were used to represent both systems. In addition, since the overall performance of each system has shown repeat-ability across all four architectures, only Intel Cascade Lake and Skylake Platinum were used here. Figure~\ref{fig:ExaSP2SemiCondCascadeLake}, \ref{fig:ExaSP2SoftMattCascadeLake}, \ref{fig:ExaSP2SemiCondSkylakePlatinum} and \ref{fig:ExaSP2SoftMattSkylakePlatinum} is a comparison of the benchmark (BHMK) vs. optimized (TUNED) ExaSP2 for both systems. On Intel Cascade Lake (figure~\ref{fig:ExaSP2SemiCondCascadeLake} and \ref{fig:ExaSP2SoftMattCascadeLake}), both systems show an improvement in run-time by over four folds (4x) while other subroutines vary from four (4x) to twelve (12x) folds. \begin{figure} \includegraphics[width=\textwidth]{figures/cascade-lake-semicond.png} \caption{Performance in run-time for the benchmark (BHMK) vs. optimized (TUNED) ExaSP2 for Semi Conductor simulated on Intel's Cascade Lake. Showing run-time of individual subroutines.} \label{fig:ExaSP2SemiCondCascadeLake} \end{figure} \begin{figure} \includegraphics[width=\textwidth]{figures/cascade-lake-softmatt.png} \caption{Performance in run-time for the benchmark (BHMK) vs. optimized (TUNED) ExaSP2 for Soft Matter simulated on Intel's Cascade Lake. Showing run-time of individual subroutines.} \label{fig:ExaSP2SoftMattCascadeLake} \end{figure} \begin{figure} \includegraphics[width=\textwidth]{figures/skylake-platinum-semicond.png} \caption{Performance in run-time for the benchmark (BHMK) vs. optimized (TUNED) ExaSP2 for Semi Conductor simulated on Intel's Skylake Platinum. Showing run-time of individual subroutines.} \label{fig:ExaSP2SemiCondSkylakePlatinum} \end{figure} \begin{figure} \includegraphics[width=\textwidth]{figures/skylake-platinum-softmatt.png} \caption{Performance in run-time for the benchmark (BHMK) vs. optimized (TUNED) ExaSP2 for Soft Matter simulated on Intel's Skylake Platinum. Showing run-time of individual subroutines.} \label{fig:ExaSP2SoftMattSkylakePlatinum} \end{figure} \section{Conclusions} \label{section:conclusion} We evaluated the viability of several optimization strategies namely 1.) Strength Reduction 2.) Memory Alignment 3.) NUMA aware allocations and all incorporation with the appropriate thread affinity and binding. Initially, we tested the viability of these performance tuning techniques in micro-kernels by comparing the run-time before and after optimization for several target architectures. For SR optimizations, the optimized micro-kernel showed approximately 2X across multiple thread sizes and varying architectures. For NUMA aware data initialization that ensures data locality, the performance of the optimized micro-kernel is at best 3X for high thread counts and 2X on average on all architectures. Memory alignment optimizations, the optimized micro-kernel is at best 11X for high thread counts and 5X on average across all architectures. The optimizations where used in conjunction with an appropriate thread binding and affinity settings such that, two well known issues that degrade performance when using multi-core computers are avoided. We followed this up by generating chemically relevant system matrices representing Metals, Semi Conductors and Soft Matter evaluate the performance of BML ELLPACK matrix-matrix multiply algorithm for each system. The matrix-matrix multiplications with metals showed a 15\% to 30\% improvement on average in the optimized version of the BML library for larger matrix sizes on every architecture. Semi conductors, showed an excellent improvement in the optimized code for all matrix sizes experimented with. On average, the 32k matrices were improved by over 100 folds. Soft matter systems showed similar improvements to that semi conductors where on average, the 32k matrices are improved by over 50 folds across all architectures. Finally, we evaluated the performance of these optimizations using a QMD proxy application, where the ELLPACK matrix format and corresponding algorithms were used to represent both Soft Matter and Semiconductors. Both systems on Intel Cascade Lake and Skylake Platinum showed an improvement in run-time by over four folds (4x). Other relevant subroutines within ExaSP2 showed improvements varying from four (4x) to twelve (12x) folds. \normalfont \clearpage \section{Introduction} \input{introduction} \input{methodology} \input{results} \input{summary} \section*{Acknowledgments} We would like to acknowledge the assistance of volunteers in putting together this example manuscript and supplement. This work was performed as part of the Co-design Center for Particle Applications, supported by the Exascale Computing Project (17-SC-20-SC), a collaborative effort of the U.S. DOE Office of Science and the NNSA. This work was performed under the U.S. Government contract 89233218CNA000001 for Los Alamos National Laboratory (LANL), U.S. Government Contract DE-AC52-07NA27344 for Lawrence Livermore National Laboratory (LLNL), U.S. Government Contract DE-AC05-00OR22725 for Oak Ridge National Laboratory (ORNL) \bibliographystyle{unsrt}
\section{Introduction} Quantum photonics is the art of using low-light optical signals to exchange and process information in the quantum regime~\cite{flamini_photonic_2018, slussarenko_photonic_2019}. Today, photonic systems represent one of the most promising platforms to implement quantum technology, with already several well-established applications ranging from quantum cryptography~\cite{pirandola_advances_2020, xu_secure_2020} and communications~\cite{gisin_quantum_2007}, to sensing and metrology~\cite{giovannetti_quantum-enhanced_2004,giovannetti_quantum_2006,giovannetti_advances_2011}, lithography \cite{boto_quantum_2000} and imaging~\cite{shih_quantum_2007}. In the most general setting, one considers the preparation, transmission, and detection of optical signals. Here, the photonic channel of interest accepts an $N$-mode input state and returns an $M$-mode output state, which is then measured by a series of photon-counting devices. More formally, let $q(\vec{m}|\vec{n})$ be the probability of obtaining $\vec{m}=(m_1,m_2,\ldots,m_M)$ photons across the $M$ output modes given $\vec{n}=(n_1,n_2,\ldots,n_N)$ photons are injected into the channel (see Figure~\ref{fig:mimo}). Here, we note $q(\vec{m}|\vec{n})$ can be characterised independently of the channel's dynamics. That is, the knowledge of the channel is not needed to estimate $q({\vec{m}|\vec{n}})$, i.e., we can treat the channel as a black box with $N$ inputs and $M$ outputs and sample accordingly. To keep the characterisation as general as possible, we also allow cases in which the channel is not photon-number preserving. This can happen when the channel experiences loss and/or suffers from background noise. Correspondingly, if the channel is known to be photon-number preserving, then we have $\sum_{i=1}^Nn_i = \sum_{j=1}^Mm_j$. \begin{figure}[t!] \includegraphics[width=\columnwidth]{mimo.pdf} \caption{Typical scheme for estimating the input-output photon-number distribution $q(\vec{m}|\vec{n})$ of a photonic channel. Each of the $N$ input modes of the photonic channel is connected to a light source that supplies the input photons and each of the $M$ output modes is connected to a detector that gives an outcome related to the number of photons leaving the photonic channel. Note that the sources and detectors considered here may include some form of active modulation devices, such as intensity modulators. } \label{fig:mimo} \end{figure} In practice, the input-output photon-number distribution is central to a multitude of information processing tasks. A good example is boson-sampling---a type of non-universal quantum computation~\cite{aaronson_computational_2011,brod_photonic_2019}. Here, a linear optical interferometer with $N$ inputs and $N$ outputs is considered, where the input is injected with a fixed number of single photons and the output measured with photon-counting devices. In Ref.~\cite{aaronson_computational_2011}, it was shown that $q(\vec{m}|\vec{n})$ evaluates directly the permanents of sub-matrices of the interferometer's matrix. On the other hand, solving such matrix permanents with a classical computer is known to be computationally hard. Another example is quantum key distribution (QKD), particularly those using discrete variable encoding~\cite{bennett_quantum_2014,scarani_security_2009}. For such a communication system (connected by a quantum channel with one input and one output), the estimation of single-photon statistics is essential for protocol security. Take for instance $q(1|1)$, which quantifies how often the untrusted channel behaves as a true single-photon channel. Having this information strengthens the QKD security analysis by allowing one to assume that (1) the adversary forwards exactly one photon to the receiver and (2) the trusted detector noise and untrusted channel noise are separated. The former is especially powerful as it enables the security analysis of practical QKD under the assumption of a qubit channel (it also applies generally to any qudit channel of interest and hence to high-dimensional QKD as well~\cite{cerf_security_2002,islam_securing_2018,islam_scalable_2019}). As a final example, we consider time-correlated single-photon counting (TCSPC) \cite{becker_overview_2005, oconnor_basic_1984}, an optical waveform measurement technique that is widely used in fundamental physics research (e.g., ranging \cite{ren_laser_2011, mccarthy_kilometer-range_2013}, imaging \cite{pawlikowska_single-photon_2017, tobin_three-dimensional_2019}, light source characterisation, and life sciences experiments (e.g., fluorescence-lifetime imaging microscopy \cite{yguerabide_nanosecond_1972} ). In this setting, the input and output optical modes of the channel are temporal modes corresponding to different time intervals. Here, we have $\sum_{i=1}^Nn_i =1 $ and $\sum_{j=1}^Mm_j \leq 1$ since only one photon is deployed in a single trial. In recent years, to improve the efficiency and speed of optical waveform measurement, the idea of using photon-number resolving measurements has been proposed as well \cite{li_time-correlated_2016, dai_realization_2020}. The input-output photon-number distribution can be easily estimated if one injects fixed photon-number states $\ket{n_1}\ket{n_2}\ldots\ket{n_N}$ into the channel and measure the output using photon-counting devices (which counts the number of photons in each output mode). However, this would require deterministic photon-number sources and photon-number resolving detectors (PNRDs), which at the moment are still in development~\cite{flamini_photonic_2018,slussarenko_photonic_2019}. The more realistic options are probabilistic photon-number sources (e.g., coherent lasers) and non-photon-number resolving detectors (e.g., threshold detectors and homodyne detectors); these optical devices are not only highly reliable and cost-effective but also widely available. To this end, it is natural to ask if one can use these standard optical devices to estimate the input-output photon-number distribution of an unknown photonic channel. It is worthwhile to mention that the problem we are interested in can be seen as a special case of \emph{coherent-state quantum process tomography} (csQPT), which uses coherent states (probe states) and homodyne measurement to reconstruct the process matrix of an unknown optical channel~\cite{lobino_complete_2008, rahimi-keshari_quantum_2011, anis_maximum-likelihood_2012, fedorov_tomography_2015}. Indeed, by looking at only the diagonal components of the process matrix, one can recover the photon-number distribution of the unknown channel. Importantly, since we are only interested in the photon-number distribution, the implementation can be significantly simplified, i.e., the probe states and local oscillators can come from independent laser sources, as we will show later. Note that in the case of csQPT, the relative phase between the probe states and the local oscillator has to be calibrated (needed to fully recover the underlying process matrix), which may be an issue in long-distance quantum communication protocols such as QKD~\cite{qi_generating_2015,soh_self-referenced_2015}. The problem of estimating the photon-number distribution of an unknown optical channel is not new and has been studied before in the field of QKD using threshold detectors. On the input side, \emph{decoy-state method} has been proposed, which uses phase-randomised light pulses with different intensities to estimate single-photon statistics~\cite{hwang_quantum_2003,lo_decoy_2005,wang_beating_2005}. The method essentially entails solving a system of linear equations constrained by the different expected detection rates of the protocol. As such, there are two approaches towards solving the problem, namely one can do it analytically via Gaussian elimination~\cite{ma_practical_2005,tsurumaru_exact_2008} or numerically with linear programming~\cite{ma_statistical_2012,curty_finite-key_2014}. The same principle can also be applied to threshold detectors to estimate the output photon-number distribution of the channel~\cite{moroder_detector_2009}. In this approach, called \emph{detector-decoy method}, one randomly varies the detection efficiency with a variable optical attenuator or intensity modulator to generate a system of linear equations; likewise, these are constrained by the different detection rates effected by the variation of detection efficiency. Given that both decoy-state and detector-decoy methods are based on the same concept, it is thus natural to consider the combination of these two approaches. This direction was recently pursued by the authors of Ref.~\cite{navarrete_characterizing_2018}, who used the direct combination of decoy-state and detector-decoy methods to characterise multi-photon quantum interference patterns. Alternatively, the authors of Ref.~\cite{zhang_generalized_2020} used a source modulation along with PNRDs to characterise multi-photon quantum interference. Here, based on the above ideas, we provide a systematic approach to analyse optical communication systems using a linear estimation of the photon-number statistics, extending the decoy-state, detector-decoy and homodyne based linear estimation methods. Our theoretical contributions are three-fold: (1) the extension of Ref.~\cite{navarrete_characterizing_2018} to homodyne detectors, (2) the security analysis of practical QKD systems based on \emph{calibrated} single-photon detectors, and (3) an experimental proposal to implement TCSPC technology using homodyne detectors instead of single-photon detectors. Concerning the latter, there are two practical advantages in using homodyne detectors: (1) these detectors are typically much more cost-effective than single-photon detectors and (2) no active intensity modulation is required to achieve the same effect as detector-decoy. More generally, our extended approach with homodyne detectors provides a simpler and more cost-effective implementation path for applications that requires only the knowledge of $q(\vec{m}|\vec{n})$ instead of single-shot information (see the examples above). We also present two different methods to estimate the desired input-output photon-number probabilities: one based on Gaussian elimination and the other based on linear programming. Additionally, we highlight that our work is focused on providing interval estimates on the photon-number statistics instead of point estimation. Indeed, our approach is essentially motivated by how parameters are estimated in QKD: there, it is imperative to provide reliable upper and lower bounds on parameters such as bit error rates and detection rates, which characterise the amount of key information leaked to the unknown channel. Therefore, the methods that we describe later include a guarantee on the statistical distance to the true value, unlike other estimation techniques such as maximum-likelihood~\cite{banaszek_maximum-likelihood_1998} and least square estimation~\cite{tan_inverse_1997}. The paper is organised as follows. In Section~\ref{sec:models}, we introduce a general channel model and the optical device models used in the estimation. Then in Section~\ref{sec:methods}, we present two methods for bounding the desired photon-number probabilities. Finally, in Section~\ref{sec:applications} we show how our method can be used to analyse the security of practical QKD with calibrated detectors and TCSPC using homodyne detectors. \section{Channel Modelling} \label{sec:models} In the following, we keep our analysis to a single-mode photonic channel (i.e. a channel with one input mode and one output mode); the generalisation to multi-mode channels is straightforward. The starting point of our approach is the measurement function, $\{f(x,y)\}_{x,y}$, which characterises the observed statistics depending on two designated control parameters $x$ and $y$ owned respectively by Alice (transmitter side) and Bob (receiver side). Here, the parameters are quantities used to test the unknown photonic channel. In the case of active schemes, they are random optical modulations operated by the users. In the case of passive schemes (e.g. passive decoy states \cite{mauerer_quantum_2007, curty_non-poissonian_2009, xu_improvement_2009, curty_passive_2010, zhang_simple_2018} or homodyne detection as presented later in this paper), they are random variables whose outcomes are correlated to the behaviour of the unknown channel. In the most general setting, the measurement function is modelled by \begin{equation}\label{eq:meas_dist} f(x,y)=\sum_{n,m= 0}^{\infty}\underbrace{p_n(x)}_{\rm{transmitter}}\underbrace{q(m|n)}_{\rm{channel}} \underbrace{r_m(y)}_{\rm{receiver}}, \end{equation} where $p_n(x)$ is the input photon-number distribution (representing correlations between a $n$-photon state transmission event and Alice's parameter $x$), $q(m|n)$ is the probability of the channel emitting $m$ photons given it has received $n$ photons, and $r_m(y)$ is the measurement response representing the correlation between a $m$-photon reception event and Bob's parameter $y$. As mentioned above, our goal is to estimate certain elements of the unknown channel's input-output photon-number distribution, $q(m|n)$. To that end, we suppose the input photon-number distribution $p_n(x)$, the measurement response $r_m(y)$, and the measurement function $f(x,y)$ are fully characterised for any $x$ and $y$. That is, we assume the user has complete knowledge of the underlying optical devices and has made enough measurements to accurately infer $f(x,y)$. Similar to standard decoy-state method implementations, we use a phase-randomised coherent-wave laser to generate photon-number states at the channel's input. In this case, the light field entering the channel is described by a Poisson distribution of photon-number states \begin{equation} \rho_{\mu}=\sum_{n\geq 0} \frac{\mu^n e^{-\mu}}{n!}\proj{n}, \end{equation} where $\mu$ is the mean photon number of the field. The random input $x$ is achieved by modulating the mean photon number with an intensity modulator. As such, the probability model of the source is fully characterised by $x$ and given by \begin{equation} \label{eq:laser} p_n(x)= \frac{x^n}{n!}e^{-x}. \end{equation} For the measurement model, we can use either a threshold detector or a homodyne detector. In the former case, the detector only fires if some photons are detected. As such, there are only two possible outcomes, detection and no detection. Here, we consider only the no detection outcome since the detection outcome is simply the complement event. Following Ref.~\cite{moroder_detector_2009}, the response of a practical threshold detector can be modelled using \begin{equation} \label{eq:threshold} r_m(y=\nu)=(1-p_{\rm{dc}})(1-\nu\etadet)^m, \end{equation} where $p_{\rm{dc}}$ is the probability of dark count, $\etadet$ is the single-photon efficiency of the detector, and $\nu$ is the transmission efficiency of the intensity modulator (placed in front of the detector) controlled by input $y$. We note that this model is general and applies to most of today's standard single-photon detection techniques, e.g., single-photon avalanche diodes (SPADs) and superconducting nano-wire single-photon detectors (SNSPDs); see Ref.~\cite{eisaman_invited_2011} for an overview of single-photon technology. This model is simple and might be inaccurate under specific operating conditions like fast repetition rate under which other effects like after-pulses might appear. However it is easy to replace the simple model used in Eq.~\eqref{eq:threshold} by a more refined model like the one suggested in \cite{fan-yuan_afterpulse_2018} to account for such effects. For simplicity in this paper, we stick to the simple model to avoid unnecessary complication in the understanding of the underlying method. In the case of homodyne detection, it does not count the number of photons in the incoming light field but rather gives an outcome whose probability density function is correlated to the number of photons~\cite{shapiro_quantum_1985}. This relation becomes more apparent when the local oscillator is phase-randomised and the response of the detector when given $m$ photons is given by~\cite{tan_inverse_1997, banaszek_maximum-likelihood_1998}: \begin{equation} \label{eq:homodyne} r_m(y) =\sum^m_{k=0} {m \choose k} \frac{\etadet^k \big(1-\etadet\big)^{m-k}}{\sqrt{\pi}2^k k!}H^2_k(y)e^{-y^2}, \end{equation} where $y$ is a real number and $\{H_k(y)\}_k$ are Hermite polynomials \cite{szego_laguerre_1939, thangavelu_hermite_1993}. To estimate the desired photon-number distribution, several statistical methods can be employed, e.g., those based on linear estimation \cite{munroe_photon-number_1995, leonhardt_sampling_1996}, least square estimation \cite{tan_inverse_1997}, and maximum-likelihood \cite{banaszek_maximum-likelihood_1998}. Here, two observations are in order. Firstly, unlike threshold detectors, one can obtain any number of discrete outcomes by binning $y$ (in practice, an Analog-to-Digital Converter (ADC) is used). Secondly, notice that no additional intensity modulation is required here. This is because the response density function of a homodyne detector is sensitive to the range of $y$ and hence one can optimise the binning function (i.e., the ADC) to assign different weights to different input photon-number states. Essentially, this is the same as the detector-decoy method, which assigns different detection probabilities to different photon-number states via the variation of the detection efficiency. Again here, the model we use in Eq.~\eqref{eq:homodyne} is relatively simple and could be refined to include additional imperfection of realistic detectors like electronic noise \cite{appel_electronic_2007}. \section{Methods} \label{sec:methods} In most quantum information processing tasks, one is only interested in elements of $q(\vec{m}|\vec{n})$ that are small in the input photon number and output photon number. Additionally, the possible values for the controlled parameters $x$ and $y$ are limited to fixed sets $x \in \mathcal{X}:= \{x_0,x_1,\ldots,x_{n_0}\}$ and $y \in \mathcal{Y}:= \{y_0,y_1,\ldots,y_{m_0}\}$. We consider a practically-relevant finite subset of $q(m|n)$ by focusing on $n \in \mathcal{N}_0:= \set{0,1, \dots ,n_0}$ and $m \in \mathcal{M}_0:= \set{0,1, \dots ,m_0}$. Our objective is to derive upper and lower bounds on a specific element or a linear combination of different elements from the set $\{q(m|n)\}_{n\in\mathcal{N}_0,m\in\mathcal{M}_0}$. As mentioned, this problem is essentially a linear optimisation problem with constraints given by positivity, normalisation, and the measurement distribution. More specifically, for positivity one has $q(m|n)\geq 0$ for any $n$ and $m$, for sub-normalisation $\sum_{m=0}^{m_0}q(m|n)\leq 1$ for any $n$, and for measurement distribution \begin{equation} f(x,y)\geq \sum_{n=0}^{n_0}\sum_{m=0}^{m_0}p_n(x)q(m|n) r_m(y), \end{equation} for any $x$ and $y$. In addition, one could also exploit the knowledge of characterised functions $p_n(x)$ and $r_m(y)$ to construct linear constraints like \begin{equation} 0\leq f(x,y)-\sum_{n=0}^{n_0}\sum_{m=0}^{m_0}p_n(x)q(m|n) r_m(y) \leq h(x,y),\end{equation} where $h(x,y)$ is some positive function depending on the optical devices used in the application. We will provide some examples later in Section \ref{sec:applications} and more technical details in Appendix \ref{app:bound_derivation}. In the following, we present two methods to estimate the desired input-output photon-number statistics. \newline \noindent\emph{Linear programming method}: Let $q(m^*|n^*)$ be the quantity of interest to which an upper bound is desired, then the linear programming (LP) problem is \begin{equation} \begin{split} \rm{Maximise:}\quad &q(m^*|n^*)\\ \text{subject to:}\quad & 0\leq q(m|n)\leq 1,\, \forall~ n\leq n_{c},\,m\leq m_{c}\\ &\sum_{m=0}^{m_{c}}q(m|n)\leq 1,\,\forall~n\leq n_{c}\\ &\sum_{n=0}^{n_c}\sum_{m=0}^{m_c}p_n(x)q(m|n)r_m(y) \\ & \leq f(x,y),\,\forall~x,y\\ & \sum_{n=0}^{n_c}\sum_{m=0}^{m_c}p_n(x)q(m|n)r_m(y)\\& \geq f(x,y)-h(x,y),\,\forall~x,y. \end{split} \end{equation} Evidently, the idea behind LP is to use the various constraints on $q(m|n)$ or some linear combination of them to provide bounds for the possible values of $q(m|n)$. Also, since the optimisation is numerical, it is useful to first narrow down to a set of $m$ and $n$ of interest, which can be done via the truncation of both $m$ and $n$ up till some suitable choice of $m_{c}\geq m_0$ and $n_{c} \geq n_0$. Notably, LP is performed by first defining a feasible region where the set of input-output distribution $\{q(m|n)\}_{m\leq m_c,n\leq n_c}$ satisfies the constraints. One can then maximise (resp. minimise) the desired probability $q(m^*|n^*)$ over the feasible region to obtain the upper (resp. lower) bound on $q(m^*|n^*)$. \newline \noindent\emph{Analytical method}: The basic idea of the second method is to leverage the complete knowledge of the characterised devices to estimate $q(m^*|n^*)$ without using any cutoff condition $n\leq n_c$ or $m\leq m_c$. To that end, we consider a linear combination of the measurement function (see Eq.~\eqref{eq:meas_dist}) over a finite set of evaluation points in $\mathcal{X}$ and $\mathcal{Y}$. This gives us a real-valued quantity $\Lambda$ which is defined as \begin{multline}\label{eq:Lambda} \Lambda := \sum_{i=0}^{n_0}\sum_{j=0}^{m_0} \alpha_i \beta_j f(x_i, y_j) \\ = \sum_{n,m\geq 0} q(m|n) \sum_{i=0}^{n_0} \alpha_i p_n(x_i) \sum_{j=0}^{m_0} \beta_j r_m(y_j), \end{multline} where coefficients $\{\alpha_i\}_{i=0}^{n_0}$ and $\{\beta_j\}_{j=0}^{m_0}$ are real numbers. Also, we write \begin{equation} u_n := \sum_{i=0}^{n_0} \alpha_i p_n(x_i),\quad v_m := \sum_{j=0}^{m_0} \beta_j r_m(y_j), \end{equation} to capture the summation over all the considered evaluation points. Here, we want to get $\Lambda$ as close as possible to $q(m^*|n^*)$. To do that, we set $u_n = \delta_{n,n^*}$ and $v_m = \delta_{m,m^*}$ for all values of $n \in \mathcal{N}_0$ and $m \in \mathcal{M}_0$, where $\delta_{a,b}$ is the Kronecker delta function, and solve for $\alpha_i$ and $\beta_j$. In essence, this step requires solving two systems of linear equations, namely one for the source device, \begin{equation} \label{eq:solve_alphas} \underbrace{\begin{bmatrix} p_0(x_0) & p_0(x_1) & \hdots & p_0(x_{n_0}) \\ p_1(x_0) & p_1(x_1) & \hdots & p_1(x_{n_0}) \\ \vdots & \vdots & \ddots & \vdots \\ p_{n_0}(x_0) & p_{n_0}(x_1) & \hdots & p_{n_0}(x_{n_0}) \end{bmatrix}}_{\rm{Input~photon-number~distribution}} \begin{bmatrix} \alpha_0 \\ \alpha_1 \\ \vdots \\ \alpha_{n_0} \end{bmatrix} = \begin{bmatrix} \delta_{0,n^*} \\ \delta_{1,n^*} \\ \vdots \\ \delta_{n_0,n^*} \end{bmatrix}, \end{equation} and one for the measurement device, \begin{equation}\label{eq:solve_betas} \underbrace{\begin{bmatrix} r_0(y_0) & \hdots & r_0(y_{m_0}) \\ r_1(y_0) & \hdots & r_1(y_{m_0}) \\ \vdots & \ddots & \vdots \\ r_{m_0}(y_0) & \hdots & r_{m_0}(y_{m_0}) \end{bmatrix}}_{\rm{Detection~response~function}} \begin{bmatrix} \beta_0 \\ \beta_1 \\ \vdots \\ \beta_{m_0} \end{bmatrix} = \begin{bmatrix} \delta_{0,m^*} \\ \delta_{1,m^*} \\ \vdots \\ \delta_{m_0,m^*} \end{bmatrix}. \end{equation} Notice that this step does not require the knowledge of $f(x_i,y_j)$ and hence can be seen as part of the calibration process prior to characterising the channel. Solving Eq.~\eqref{eq:solve_alphas} and Eq.~\eqref{eq:solve_betas} hence gives \begin{multline}\label{eq:residual} \Lambda = q(m^*|n^*)\\ + \sum\limits_{n\geq n_0+1} q(m^*|n)u_n + \sum\limits_{m\geq m_0+1} q(m|n^*)v_m \\ + \sum\limits_{n\geq n_0+1}\sum\limits_{m\geq m_0+1} q(m|n) u_n v_m. \end{multline} As one can see, $\Lambda$ is now expressed in terms of the desired quantity, $q(m^*|n^*)$, and some other irrelevant terms that emanate from higher photon number contributions, i.e. those from $n \geq n_0+1$ and $m \geq m_0+1$. In Appendix \ref{app:bound_derivation}, we show that these terms can be rigorously bounded by using known information of the optical devices. This in turn provides upper and lower bounds on $q(m^*|n^*)$. More concretely, the idea is to establish bounds on $u_n$ and $v_m$ using the characterised input photon-number distribution and detection response function. Therefore, these bounds are specific to the types of light sources and detectors used in the setup; in Appendix \ref{app:bound_derivation}, we provide standard bounds for common optical devices such as phase-randomised lasers, threshold detectors and homodyne detectors with phase randomised local oscillators. We also note that these bounds can be made arbitrarily tight by selecting large enough $n_0$ and $m_0$ values. Indeed, a key condition is to ensure that the derived bounds on the extra terms in Eq.~\eqref{eq:residual} are small when compared to $q(m^*|n^*)$; and this can be achieved by using bigger values of $n_0$ and $m_0$. This linear method is conceptually similar to early papers in homodyne tomography using \emph{pattern functions} to recompute photon-number statistics~\cite{munroe_photon-number_1995, leonhardt_sampling_1996}. They considered the use of pattern functions $M_n(x)$ such that: \begin{equation} \label{eq:pattern-fctn} p_n = \int_{-\infty}^{+\infty} M_n(x)f(x) dx. \end{equation} Indeed, there is an obvious similarity with our method when using only one input mode: \begin{equation} \label{eq:pattern-fctn-discretised} \Lambda = \sum_{i=0}^{n_0} \alpha_i f(x_i), \end{equation} and $\Lambda$ is a good approximation of $p_n$ up to some deviation we can bound. Our computation in Eq.~\eqref{eq:pattern-fctn-discretised} can be seen as a discretized version of Eq.~\eqref{eq:pattern-fctn}. The main benefit is that it can be generalised easily beyond homodyne tomography, for instance using threshold detectors or other light sources, and as such may provide a unified understanding of photon-number probability estimation. \section{Applications} \label{sec:applications} We present here two applications to illustrate the utility of our framework. In the first application, we consider the security of practical prepare-and-measure QKD with realistic photon sources and single photon detectors. More specifically, we show how to rigorously bound the single-photon channel security of the protocol. In the second application, we show how to use our framework to enable TCSPC with homodyne detection instead of single photon detection. \subsection{Prepare-and-measure QKD \\ with single-photon channel security} As a first application of our method, we analyse the asymptotic security analysis of discrete-variable QKD protocols based on practical optical devices such as lasers and threshold detectors. Here, we consider the celebrated Bennett-Brassard 1984 (BB84) protocol \cite{bennett_quantum_2014} and the six-state protocol \cite{brus_optimal_1998,bechmann-pasquinucci_incoherent_1999}. These two protocols are formulated as \textit{qubit} protocols, i.e. the preparation, evolution and measurement can be described in a Hilbert state of dimension 2 \cite{scarani_security_2009}. In practice, however, most QKD systems use weak coherent laser sources and threshold detectors~\cite{scarani_security_2009} to implement qubit states and measurements. This is because, as mentioned above, deterministic single-photon sources and PNRDs are not yet available and weak coherent laser sources and threshold detectors are the closest one can get to achieving qubit states and measurements in practice (at least with regards to cost and practicality). However, one critical drawback is that there are some fundamental differences between the qubit models (assumed in the protocol) and these optical devices. Some of these differences are irreconcilable and hence cannot be applied to qubit protocols, while some may lead to implementation loopholes such as photon-number splitting attacks~\cite{huttner_quantum_1995,lutkenhaus_quantum_2002}. Fortunately, for most qubit protocols (including BB84), the gap between theory and practice can be mitigated using innovative techniques such as the decoy-state method~\cite{hwang_quantum_2003, lo_decoy_2005, wang_beating_2005} and squashing \cite{gottesman_security_2004, beaudry_squashing_2008,tsurumaru_squash_2010, fung_universal_2011}. In the case of the former, assuming that the prepared optical signals are diagonal in the photon-number basis, Eve's attacks can be categorised according to the emitted photon numbers. This allows us to focus on the single-photon component of emitted optical signal and hence view the states prepared by Alice as qubits. On the other hand, squashing models provide an elegant method to map the actual full (infinite dimensional) mode measurement onto a finite dimensional Hilbert space followed by the ideal measurement. In the case of the BB84 protocol, a squashing model exists and hence one could assume qubit models for Bob's measurements in practice. Therefore, using the decoy-state method together with a squashing model, one can derive statistical bounds on the single-photon error rates of the BB84 protocol and hence compute its secret key rate. However, this approach is quite restrictive and does not apply readily to other qubit protocols. For instance, it has been shown that squashing does not immediately apply to the six-state protocol~\cite{beaudry_squashing_2008,tsurumaru_security_2008}; on the other hand, it has been shown that by relaxing certain statistical constraints, it is possible to define squashing maps for a wide range of finite-dimensional protocols \cite{fung_universal_2011}. By contrast, our method allows us to analyse any qubit (more generally, any higher dimension) protocol~\cite{cerf_security_2002,islam_securing_2018,islam_scalable_2019} without using a squashing model. Assuming that Alice and Bob prepares and receives a single photon defined across two orthogonal optical modes, the states and measurements can be described by qubit states and qubit measurements, respectively. Our method allows us to bound the probability of Bob receiving a single photon (just before the measurement) when Alice prepares and sends a single photon as well as the corresponding error rate in each basis. Roughly speaking, our method provides three practical advantages over existing methods. Firstly, since we consider only secret key contributions from events in which Alice prepares a single photon and Bob receives a single photon, we can directly use any security proof technique for qubit models without applying any squashing model. As such, our method can be applied to most practical QKD systems under the condition that these systems randomly vary their detection efficiency as specified by the detector-decoy method. Secondly, since squashing models typically require mapping double-detection events to random outcomes~\cite{beaudry_squashing_2008,tsurumaru_security_2008}, applying a squashing model would likely introduce some additional errors from the detector background noise. On top of that, squashing also does not differentiate between clicks due to true single photon detections and empty detections, which may also introduce additional errors. Hence, our method, which can rigorously bound the true channel error rates, could give an enhanced bound on the secret key rate especially in the high loss regime where the dark count rate is not negligible. Finally, as mentioned, our method allows us to analyse the security of the protocol based on single-photon channel security. To appreciate this feature better, we comparatively note that when using the decoy state method combined with a squashing model, one actually evaluates the security of the channel together with the detector noise, which is normally trusted. In this case, the single-photon error rates includes the trusted detector noise. By contrast, our method allows the rigorous separation of channel noise and detector noise and thus provides a concise method to derive lower bounds on the secret key rate in the calibrated detector setting; in fact, the security of QKD with calibrated devices is known to be an open problem~\cite{scarani_security_2009} . We now demonstrate how our method can be applied to the security analyses of practical QKD systems. We emphasise that our method can be used for most discrete-variable protocols, but as concrete examples, we only apply our method to BB84 and six-state protocol. To that end, we introduce some notations that we use in this subsection. We denote the basis choice of Alice and Bob by $x$ and $y$ respectively. $x$ and $y$ are randomly chosen from the set $\mathcal{X}$ and $\mathcal{Y}$ respectively where $\mathcal{X} = \mathcal{Y} = \{ X, Z\}$ for BB84 and $\mathcal{X} = \mathcal{Y} = \{ X, Y, Z\}$ for the six-state protocol. The symbol value encoded by Alice is denoted by $a \in \mathcal{A}$ and Bob's detection pattern is denoted by $b \in \mathcal{B}$. For both the BB84 and six-state protocol, $a \in \{0,1\}$ and $b = b_0 b_1$ is a two-bit string where $b_i$ indicates whether the detector in mode $i$ clicks (we have $b_i = 0$ when the detector in mode $i$ does not click and $b_i = 1$ when the detector clicks). Based on $b$, Bob would then map the observed click pattern into the decoded symbol or he could choose to discard inconclusive events (such as no-click or double-click events). Finally, we denote Alice's intensity setting by $\mu$ and Bob's detection efficiency by $\eta$ (composed of $\eta_0$ for detector $0$ and $\eta_1$ for detector $1$) which are chosen randomly in each round. We will now focus our attention on the case where $\abs{\mathcal{A}} = 2$, i.e., the protocol uses binary symbols. The generalisation to a higher dimensional protocol is straightforward. In a typical discrete-variable protocol, Alice would randomly choose a basis $x$ and bit value $a$. She would then choose an intensity setting $\mu$ and then prepare a phase-randomised coherent state in the corresponding mode. For phase-randomised coherent source, the emitted photon number $n$ would follow a Poisson distribution with mean $\mu$. Similarly, Bob randomly chooses a basis choice $y$ as well as detection efficiency setting $\eta$ and he obtains the outcome $b$. In the parameter estimation step, Alice and Bob can estimate the following conditional probabilities (for all possible combination of parameters): \begin{equation} f^{\{xyab\}} (\mu, \eta) = \Pr(b | x,y,a, \mu, \eta). \end{equation} This function can be expanded as \begin{multline} \label{eq:f_qkd} f^{\{xyab\}} (\mu, \eta) \\= \sum\limits_{n\geq 0} p_n(\mu) \underbrace{\sum_{k,l\geq 0}q^{\{xya\}}(kl |n) r_k^{\{b_0\}}(\eta_0) r_l^{\{b_1\}}(\eta_1)}_{Y_n^{\{xyab\}}}, \end{multline} where $p_n(\mu)$ is the probability of the source emitting $n$ photons (defined in Eq.~\eqref{eq:laser}) while $q^{\{xya\}}(kl |n)$ is the probability of $k$ photons arriving in mode 0 and $l$ photons arriving in mode 1 given that the source emitted $n$ photons, Alice chooses the basis $x$ and bit value $a$ and Bob chooses measurement basis $y$. $r_k^{\{b_0\}}(\eta_0)$ denotes the probability of the detector in mode 0 clicking ($b_0=1$) or not ($b_0=0$), given that $k$ photons arrived in that mode and $r_l^{\{b_1\}}(\eta_1)$ is defined similarly. Note that the probability of a threshold detector not clicking is given in Eq.~\eqref{eq:threshold}. As such, Eq.~\eqref{eq:f_qkd} represents the conditional probability as a product of different system elements (transmitter, channel and receiver) in the form given in Eq.~\eqref{eq:meas_dist}. The parameters $x$, $y$, $a$ and $b$ are considered as fixed parameters when estimating the input-output photon-number distribution. Here, we remark that these parameters serve only as a means for Alice and Bob to organise their measurement data, i.e. they categorise the input-output photon-number distributions according to $x$, $y$, $a$ and $b$. Of note, the input-output photon-number distributions have to be independent of these parameters: this is needed to ensure that the single-photon channel behaviour is \emph{basis-independent}. In other words, Eve's attacks on the quantum channel have to be independent of Alice's and Bob's basis choices~\cite{gottesman_security_2004}. In addition to this, we also need that the input-output photon-number distributions are independent of $\mu$ and $\eta$. In practice, these conditions can be reasonably enforced by using phase-randomised coherent lasers and photon-counting detectors, which is the case in our consideration. Notice that the $n$-photon yield, which is denoted by $Y_n^{\{xyab\}}$ here, is the usual quantity of interest in decoy-state QKD \cite{lo_decoy_2005}. More precisely, in Ref.~\cite{lo_decoy_2005}, the authors considered events in which Alice and Bob choose the same basis, i.e. $x=y$, and the cases in which Bob observes at least one click. They also average the yield over Alice's bit value $a$. Hence, the $n$-photon yield is the probability of observing a click given that Alice's laser emits $n$ photons. Clearly this would depend on both the channel and the trusted detectors which are located in Bob's lab. In contrast, our method bounds the probability of $k$ and $l$ photons arriving at Bob's measurement device given that $n$ photons are prepared by Alice. This would depend only on the behaviour of the channel and not on the detectors. \begin{figure}[t!] \includegraphics[width=\columnwidth]{qkdKr.pdf} \caption{We simulate the achievable secure key rate with two avalanche photo-diode detectors, each one featuring a dark count rate of $10^{-6}$ and a fixed channel error rate of $5\%$ in all bases (depolarising channel). The secure key rate in the source and detector modulation case is $K \geq p_0(\mu)q_{00|0}\big(1- r_0^{(0)}(\eta_0)r_0^{(0)}(\eta_1)\big) + p_1(\mu)p^{x=y=0}_\text{det} H(A|E) - Q(\mu, \eta)h_2\big(E(\mu,\eta) \big)$ where $H(A|E)$ is the conditional entropy on Alice's key bit given Eve's side information for a qubit protocol. For BB84, we have $H(A|E)\geq 1-h_2(e_X)$, for six states we have $H(A|E) \geq 1 - \Big( H(\lambda) - h_2(e_Z) \Big)$. To recompute the single photon statistics, we use three intensity levels: $10^{-3}, 10^{-2}, 0.5$ and four efficiency levels per detector: $0.94, 0.96, 0.98, 1$. See more details in Appendix~\ref{app:qkd}.} \label{fig:qkd_plot-1} \end{figure} \begin{figure}[t!] \includegraphics[width=\columnwidth]{qkdError.pdf} \caption{We compare the exact channel error rate value used for the simulation ($5\%$ here) to the upper bound provided by our proposed analytical method and the one proposed in Ref.~\cite{ma_practical_2005}. The definition in Ref.~\cite{ma_practical_2005} is including the noise from the detector dark counts while our is considering only the noise on the channel. As a result, the definition of Ref.~\cite{ma_practical_2005} is increasing while ours is staying close to the exact value in the high loss regime, hence a slight improvement in distance for the key rate. Note that this improvement is only affecting privacy amplification, since the noise due to dark counts still has to be corrected in the error correction step.} \label{fig:qkd_plot-2} \end{figure} To analyse the security of the BB84 and six-state protocol, the quantity of interest is $q^{\{xya\}}(kl | n)$ when $n=1$ and $k+l = 1$, i.e. the probability of the channel outputting a single photon given that a single photon enters the channel. In this case, the conventional security proofs \cite{shor_simple_2000,renner_information-theoretic_2005} that rely on the qubit models can be directly applied without the need for squashing model \cite{gottesman_security_2004, beaudry_squashing_2008, fung_universal_2011}. For all values of $x, y, a$, it is possible to use either method of Section \ref{sec:methods} to deduce $\{q^{\{xya\}}(10 | 1),q^{\{xya\}}(01 | 1)\}$ once $f^{\{xyab\}} (\mu, \eta)$ is obtained from the parameter estimation step of the protocol. The single-photon error rates are just functions of $\{q^{\{xya\}}(10 | 1),q^{\{xya\}}(01 | 1)\}$; for example, the single-photon error rate given that Alice and Bob have chosen the same basis (i.e. $x = y$) is given by \begin{multline} e_{x=y} \\= \frac{\sum\limits_{a} \Pr(a) q^{\{xya\}}(a,a \oplus 1|1) \left( 1 - r_{a}^{\{0\}} (\eta_0) r_{a\oplus 1}^{\{0\}} (\eta_1) \right)}{p_\text{det}^{x=y}} \end{multline} where the qubit detection probability is \begin{multline} p^{x=y}_\text{det} \\= \sum\limits_{a}\sum\limits_{k+l=1} \Pr(a) q^{\{xya\}}(k,l |1) \left(1 - r_k^{\{0\}}(\eta_0)r_l^{\{0\}}(\eta_1) \right) \end{multline} Once the single-photon error rates are determined, the secret key rate can be easily computed. Here, we present the bound on the secret key rate while we defer the detailed security analysis of the six-state protocol to Appendix \ref{app:qkd}. In the asymptotic limit and under the assumption of collective attacks, the secret key rate $K$ of BB84 and six-state protocols is given by \begin{multline}\label{eq:keyrate} K \geq p_0(\mu)q(00|0)\big(1- r_0^{\{0\}}(\eta_0)r_0^{\{0\}}(\eta_1)\big) \\ + p_1(\mu) p^{x=y=Z}_\text{det} H(A|E) \\ - Q(\mu, \eta)h_2\left(E(\mu,\eta) \right), \end{multline} where $H(A|E)$ is single-photon conditional entropy given Eve's quantum side information; $h_2(\cdot)$ denotes the binary entropy function. $Q(\mu, \eta)$ and $E(\mu,\eta)$ is the observed gain and quantum bit error rate when Alice and Bob choose intensity $\mu$ and detection efficiency $\eta$ respectively. Hence, the first term is the contribution due to the events in which Alice prepares vacuum state. Since no quantum information is leaked whenever Alice prepares the vacuum state, all the detected events due to the transmission of vacuum states are secure. The second term is the single-photon contribution and the third term is the leakage due to error correction assuming that the error-correcting code saturates the Shannon limit. Using $\{e_X, e_Y, e_Z\}$ as short-hand for the single-photon error rate in the respective basis, the single-photon conditional entropy $H(A|E)$ for the BB84 protocol and the six-state protocol is given by \begin{equation} H(A|E) = \begin{cases} 1 - h_2(e_X) & \text{(BB84)}\\ 1 + h_2(e_Z) - H(\lambda) & \text{(six-state)} \end{cases} \end{equation} Here, $\lambda = (\lambda_0, \lambda_1, \lambda_2, \lambda_3)$ is a real vector containing the unique solution to the following simultaneous equations \begin{equation} \begin{matrix} \lambda_0 &+& \lambda_1 &&&& &=& 1-e_Z\\ \lambda_0 &&&+&\lambda_2&& &=& 1-e_X\\ \lambda_0 &&&&&+&\lambda_3&=& 1-e_Y\\ \lambda_0 &+& \lambda_1 &+& \lambda_2 &+& \lambda_3 &=& 1\\ \end{matrix} \end{equation} and $H(\lambda)$ is the corresponding Shannon entropy. Therefore, by substituting the appropriate $H(A|E)$ to Eq.\eqref{eq:keyrate}, we obtain the bound on the secret key rate of the corresponding protocol. We present the simulated secret key rates in Fig.~\ref{fig:qkd_plot-1} assuming standard SPADs parameters. Here, we compare against the asymptotic secret rate based on the standard decoy-state method~\cite{ma_practical_2005}. As mentioned above, the key difference is that our method directly evaluates the single-photon channel security whereas the standard decoy-state method would include the detectors' background noise (dark counts). Indeed, in Fig.~\ref{fig:qkd_plot-2}, we see that the single-photon error rate of our method does not include the detectors' dark counts in the channel error rate and hence our proposed upper bound on the error rate remains close to the exact value while that based on Ref.~\cite{ma_practical_2005} is dominated by the dark count noise in the high loss regime. \subsection{Time-Correlated Single Photon Counting with Homodyne detection} Here we propose TCSPC with homodyne detection instead of single photon detection. There are significant practical benefits in doing so; largely one could reduce the implementation cost and footprint of TCSPC through integrated photonics platforms. The basic idea of TCSPC is to measure the single photon emission time profile in the nanosecond time scale, e.g. fluorescence decays of excited samples \cite{yguerabide_nanosecond_1972}. The current method achieves this via the small time resolution (hundreds of picoseconds) of Single Photon Detectors (SPDs; e.g. photo-multiplier tubes, micro-channel plates, SPADs) to measure the time difference between a reference ``start'' signal and a ``stop'' signal triggered by a single photon emission event \cite{becker_overview_2005, oconnor_basic_1984}. As such, by using a pulsed laser the intensity profile can be sampled repeatedly and a histogram of photon arrivals per time bin over the intended time domain can be constructed; assuming the probability of multi-photon emission is negligible. This concept is depicted in Fig.~\ref{fig:tcspc-1}. \begin{figure} \includegraphics[width=6cm]{tcspc-1.pdf} \caption{The original TCSPC concept is based on the recording of single-photon detection events and construction of the corresponding histogram as shown above. As a result, there is an implicit post-selection of the conclusive outcomes. That is, the experiment is repeated until the bin with the maximum number of events reaches a certain level. The histogram is then normalised to derive the probability of having a detection event in a particular bin $t \in \mathcal{T}$ given that there was a conclusive outcome $C$, i.e. $\Pr(t | C)$. Nevertheless, due to the dead time effect, the recorded probability is not exactly the one aforementioned, but rather the probability of observing a detection in a bin and not recording any detection before. When the counting rate is low, the two probabilities are close though \cite{yguerabide_nanosecond_1972}. } \label{fig:tcspc-1} \end{figure} However, SPDs typically suffer from finite recovery time (or dead-time); consequently, the detector becomes inactive for a period of time after a first detection event (hundreds of nanoseconds to dozens of microseconds \cite{hadfield_single-photon_2009, eisaman_invited_2011}). As such, any optical signal arriving during this time window will not be detected and this problem tends to bias the measurement results towards earlier detection events. This is a well known issue called \emph{pulse pile-up}~\cite{phillips_time_1985}. In practice, to mitigate this problem, a popular approach is to keep the multi-photon emissions low and the counting rate below 2\%--5\% or lower~\cite{phillips_time_1985}, e.g. by restricting the excitation power. In this case, nothing is detected most of the time and once in a while a unique photon is detected and recorded. This common approach of limiting the excitation power solves the multi-photon emission issue but leads to a longer acquisition time. Yet, TCSPC is not making full use of the single-shot information of a photon being detected or not at a particular time window; it extracts only the average count rate for each time window. This suggests that other forms of detection technology could be used instead, for instance, homodyne detection. Indeed, this possibility has already been discussed in Ref.~\cite{arecchi_photocount_1966}: the authors therein described a linear method to compute the moments of an unknown probability distribution using the moments of the outcome function obtained experimentally. Our proposal with homodyne detection essentially follows this idea: that we can recover the photon-number statistics with phase-randomised homodyne detection. To help fix ideas, in the following we first briefly describe an ideal version based on PNRDs. We then provide a proof of concept simulation of the homodyne TCSPC technique. \subsubsection{TCSPC with perfect photon-number-resolving detection} \label{sssec:virtual_TCSPC} It is useful to first consider an intermediate ideal TCSPC protocol to illustrate the main ideas of our homodyne-based protocol. Here, we assume a perfect PNRD is used to measure the photons arrival time. By perfect, we mean that the detector has zero dead-time, perfect detection efficiency, and able to tell how many photons are detected in a given time window. Mathematically, the outcome of the protocol is described by a sequence of time-ordered random variables, $Y^{\{t\}} \in \mathbb{N}$, where each random variable counts the number of photons in the time bin $t \in T$ as shown in Fig.~\ref{fig:tcspc-2}. \begin{figure}[t] \includegraphics[width=7cm]{tcspc-2.pdf} \caption{We consider here an ideal version of TCSPC where perfect PNRDs are used to record the exact number of incoming photons in each time bin. We label $Y^{\{t\}} \in \mathbb{N}$ the corresponding random variable for each time bin. After enough events have been recorded, it is possible to estimate the photon number probability distribution at each time bin. By keeping only the single photon events, it is easy to recover the same TCSPC information as in Fig.~\ref{fig:tcspc-1}. } \label{fig:tcspc-2} \end{figure} Evidently, this ideal TCSPC protocol can recover the original TCSPC protocol's information by keeping only the events in which $Y^{\{t\}} \geq 1$. We also highlight that there will be the same number of events recorded (regardless of the value of $Y^{\{t\}}$) in each time bin. As a result, the probability of recording an event in a certain time window is $\Pr(t)=1/\abs{\mathcal{T}}$. In the limit of many repetitions, the data from $Y^{\{t\}}$ allows computation the probability of detection of $n$ photons in the time bin $t$: \begin{equation} \label{eq:qn_t} q_n^{\{t\}} = \Pr(Y^{\{t\}}=n) \end{equation} We label $C$ a conclusive event ; it is the set of photon number values leading to a conclusive outcome, here all values $n \geq 1$. We further denote the probability of a conclusive event within a time window: \begin{equation} q^{\{t\}} = \Pr(C|t) = \sum\limits_{n\in C}q_n^{\{t\}} \end{equation} From this information only, it is possible to recompute the same probability as in the original version of TCSPC using the uniformity of $T$ and Bayes' rule: \begin{equation} \label{eq:bayes} \Pr(t | C) = \frac{\Pr(C|t)\Pr(t)}{\sum\limits_{t'}\Pr(C|t')\Pr(t')} = \frac{q^{\{t\}}}{\sum\limits_{t'}q^{\{t'\}}} \end{equation} \subsubsection{Homodyne TCSPC} \label{sssec:homodyne_TCSPC} We now replace the perfect PNRD in the ideal version described above by a homodyne detector that sequentially measures all the time bins one after the other, up to the time resolution and speed of the ADC. In this case, the homodyne detector gives a continuous outcome which is also binned depending on the ADC resolution. We label $\mathcal{X}$ the set of bins. Now the sequence of random variables $Y^{\{t\}} \in \mathbb{N}$ is replaced by $X^{\{t\}} \in \mathcal{X}$ as drawn in Fig.~\ref{fig:tcspc-3}. \begin{figure}[t] \includegraphics[width=7cm]{tcspc-3.pdf} \caption{We consider here a practical implementation of TCSPC using a binned homodyne detector. We label $X^{\{t\}} \in \mathcal{X}$ the corresponding random variable for each time bin. After enough events have been recorded, it is possible to estimate the measurement PDF at each time bin. Then from this information, we show that it is possible to recompute the same photon number distribution as in Fig.~\ref{fig:tcspc-2}. } \label{fig:tcspc-3} \end{figure} In the limit of many repetitions and small bins in $\mathcal{X}$, we can recompute the probability density function (PDF) of every time bin which is assumed to have the following structure: \begin{equation} \label{eq:pdf_homodyne} f^{\{t\}}(x) = \sum\limits_{n\geq 0} q_n^{\{t\}} A_n(x) \end{equation} with $A_n(x)$ representing the homodyne measurement response as we define in Section \ref{sec:models} Eq.~\eqref{eq:homodyne}. It is also possible to consider a binned version for $f$ by using the binned version of $A_n(x)$ accordingly. Due to the structure of the detector, $f^{\{t\}}(x)$ is even i.e. $f^{\{t\}}(-x)=f^{\{t\}}(x)$, hence we can simply consider only the positive region, i.e. $x\geq 0$. The $q_n^{\{t\}}$ in Eq~\eqref{eq:pdf_homodyne} are defined in Eq~\eqref{eq:qn_t} and represent the contribution to the outcome due to $n$ photons on the detector. From the value of $f^{\{t\}}(x)$ at each $x \in \mathcal{X}$, the direct application of Section \ref{sec:methods} allows us to recompute a reasonably good estimation of the weights $q_n^{\{t\}}$ in front of the $A_n(x)$ in Eq~\eqref{eq:pdf_homodyne} for the low photon number events. Then recomputing the probability distribution as in the original TCSPC can be done with Eq~\eqref{eq:bayes}. We consider a simple physical experimental model to highlight the feasibility of our homodyne TCSPC. Here, we consider the intensity profile of a fluorescence decay after a delta excitation happening at $t_0 = \SI{50}{\ns}$. Following Ref. \cite{mandel_fluctuations_1959} and assuming an exponential decay for the intensity profile, the photon number distribution is \begin{equation} q_n^{\{t\}} = \frac{\exp{\big(-E(t)\big)}E(t)^n}{n!}, \end{equation} where $E(t)$ is the energy arriving on the detector for $t\geq t_0$ \begin{multline} E(t)= \\ \int_t^{t+T} \alpha P(u) du = \alpha\exp{\Big(-\frac{t-t_0}{\tau}\Big)}\Big(1-\exp{\big(-\frac{T}{\tau}\big)\Big)} \end{multline} and $T=\SI{5}{\ns}$ is the time bin duration, $\tau=\SI{100}{\ns}$ is the decay time, $\alpha=0.9$ is a coefficient including the excitation power and the detector sensitivity. Then, the measurement PDF is computed according to Eq.~\eqref{eq:pdf_homodyne} and a direct application of Section \ref{sec:methods} allows us to compute upper and lower bounds on the single and two photon emission probabilities. Here, we use $16$ bins evenly spaced over the range $[0, 5]$ and apply the analytical method presented in Section \ref{sec:methods} to obtain the results shown in Fig.~\ref{fig:tcspc-plot}. The bounds on the single photon emission probability are very close to the exact value for any time considered in our simulation while the bounds for the two photon emission probability are less tight due to its lower value that cannot be estimated well via our method. This is due to the finite value of the extra terms in Eq.~\eqref{eq:residual} as discussed in Section \ref{sec:methods}. One way to tighten this bound would be to consider more bins for the PDF. \begin{figure*} \includegraphics[width=2\columnwidth]{tcspc-plot.pdf} \caption{Simulation of an exponential decay intensity profile that can be reconstructed using homodyne detection only. The upper (dashed line) and lower (dotted line) bound on the probability of one photon emission are very close to the exact value (solid line) using our method while the bounds on the probability of two photon emission are looser due to the inability of the method to recover very low values. This simulation is using $16$ bins evenly spaced in the range $[0, 5]$ for the real outcome given by the homodyne detector. } \label{fig:tcspc-plot} \end{figure*} \section{Conclusion} In this paper, we show the possibility of using realistic light sources and detectors to recompute relevant information about the input-output photon number distribution of any unknown channel. We describ a simple linear framework to model characterised sources, detectors and any multi-mode unknown channel. Then, we present two computational methods to derive upper and lower bounds on the input-output photon number distribution. Such information can be used for various applications in quantum optics and quantum information processing. To that end, we highlight two applications: the single-photon channel security of practical QKD and TCSPC with homodyne detection. For example, the application to QKD shows that this framework is a bridge between practical implementations and theoretical qubit security proofs. Here, it is useful to mention that even though we present only one class of qubit protocols and an associated security proof, other finite-dimensional QKD protocols can also be proven secure in the same fashion, such as the Reference Frame Independent \cite{laing_reference-frame-independent_2010}, Loss-Tolerant \cite{tamaki_loss-tolerant_2014} and Tomography-based \cite{watanabe_tomography_2008, zhan_tomography-based_2020} protocols. We can also highlight that the single photon detectors could possibly be replaced by homodyne detectors in certain schemes \cite{qi_bennett-brassard_2021}. The TCSPC example also suggests that this technology could possibly be deployed with homodyne detection for more cost-effective implementations. Therefore, many applications relying on TCSPC as a module could potentially be upgraded to use a homodyne TCSPC instead. For instance, we can think of applications based on time-of-flight measurement \cite{massa_time--flight_1998} such as ranging \cite{ren_laser_2011, mccarthy_kilometer-range_2013} and low light imaging \cite{pawlikowska_single-photon_2017, tobin_three-dimensional_2019}. \section*{Acknowledgements} We acknowledge funding support from the National Research Foundation of Singapore (NRF) Fellowship Grant (No. NRFF11-2019-0001) and NRF Quantum Engineering Programme 1.0 Grant (No. QEP-P2) and the Centre for Quantum Technologies. \medskip
\section{Introduction} In this paper we study a family of random walks defined on the finite ordinals using their order reversing involutions: starting at $x \in \{0,1,\ldots,n-1\}$, an element $y \le x$ is chosen according to a prescribed probability distribution, and the walk then steps to $n-1-y$. Under very mild assumptions we show that these walks are irreducible; if irreducible, they are recurrent and ergodic with a unique invariant distribution. We then consider a distinguished subfamily of walks whose transition matrices have the global anti-diagonal eigenvalue property studied in earlier work by Ochiai, Sasada, Shirai and Tsuboi \cite{OchiaiEtAl}. We find their invariant distributions, eigenvectors and eigenvalues and show that this subfamily is characterised by their reversibility. We also give a new proof of one of the main results of \cite{OchiaiEtAl} which characterises the generic (in the sense of algebraic geometry) matrices having the global anti-diagonal eigenvalue property, and prove a related characterisation that avoids the genericity hypothesis. As a corollary of our probabilistic results we obtain the invariant distributions and rate of convergence of the random walk on the set of subsets of $\{1,\ldots, m\}$ in which steps are defined by moving to a subset and then to a superset. In the second part we consider the analogous involutive walks on the real interval $[0,1]$ and use techniques from the theory of self-adjoint compact operators on Hilbert spaces to prove analogues of the main results in the discrete case. We also prove further results on a trigonometrically-weighted random walk that do not appear to have discrete analogues and consider the interplay between the discrete and continuous results. \subsubsection*{Setup} Let $[y,x]$ denote the interval $\{y,y+1,\ldots, x\} \subseteq \mathbb{N}_0$ and let $[x]$ denote $\{0,1,\ldots, x\}$. Let $\star : \{0,1,\ldots,n-1\} \rightarrow \{0,1,\ldots,n-1\}$ be the order anti-involution defined by $x^\star = n-1-x$; the $n$ will always be clear from context. It is very convenient to specify the probabilities of steps using the following definition. \begin{definition}\label{defn:weight} A \emph{weight} with domain $\mathbb{N}_0$ is a function $\gamma$ on the set of intervals of~$\mathbb{N}_0$, taking values in the non-negative real numbers, such that $\gamma_\varnothing = 0$ and $\sum_{y \in [x]} \gamma_{[y,x]} > 0$ for all $x \in \mathbb{N}_0$. We say that a weight $\gamma$ is \begin{itemize} \item \emph{strictly positive} if $\gamma_{[y,x]} > 0$ for all $x$, $y \in n$ with $y \le x$; \item \emph{atomic} if $\gamma_{[y,x]} = \gamma_{[y,y]}$ for all $x$, $y \in n$ with $y \le x$; \emph{and} \item \emph{$\star$-symmetric} if $\gamma_{[y,x]} = \gamma_{[x^\star,y^\star]}$ for all $x$, $y \in n$. \end{itemize} We write $\gamma_y$ for~$\gamma_{[y,y]}$ and $N(\gamma)$ for the strictly positive real-valued function on $\mathbb{N}_0$ defined by $N(\gamma)_x = \sum_{y \in [x]} \gamma_{[y,x]}$. \end{definition} For brevity, when referring to states in an involutive walk, we shall use the ordinal notation in which $n$ is equal to the subset $\{0,1,\ldots,n-1\}$ of~$\mathbb{N}_0$. Thus $x \in \{0,1,\ldots, n-1\}$ is written as $x \in n$. We define a \emph{weight with domain $n$} by replacing the ordinal $\mathbb{N}_0$ with $n$ in Definition~\ref{defn:weight}. \begin{definition}\label{defn:involutiveWalk} Let $\gamma$ be a weight with domain containing $n$. The \emph{$\gamma$-weighted involutive walk} on $\n$ is the Markov chain with steps defined as follows: if the current state is $x \in \{0,1,\ldots, n-1\}$ then choose~$y$ from $[x]$ with probability proportional to $\gamma_{[y,x]}$, and step to~$y^\star$. \end{definition} Writing $P(\gamma)$ for the transition matrix of the $\gamma$-weighted involutive walk on $n$, Definition~\ref{defn:involutiveWalk} asserts that \begin{equation}\label{eq:Pgamma} P(\gamma)_{xz} = \frac{\gamma_{[z^\star,x]}}{N(\gamma)_x}. \end{equation} for all $x$, $z \in n$. (Note that we number rows and columns of matrices from~$0$.) \subsubsection*{General involutive walks} Our first main result gives two broadly applicable sufficient conditions for a weighted involutive walk to be ergodic. \begin{samepage} \begin{theorem}\label{thm:ergodic} Let $\gamma$ be a weight with domain containing $n$. If \emph{either} \begin{thmlist} \item $\gamma_{[0,x]} > 0$ and $\gamma_{[x,n-1]} > 0$ for all $x \in n$; \emph{or} \item $\gamma_{[x,x]} > 0$ for all $x \in n$ and $\gamma_{[x-1,x]} > 0$ for all non-zero $x \in n$ \end{thmlist} then the $\gamma$-weighted involutive walk on $n$ is irreducible, recurrent and ergodic with a unique invariant distribution. \end{theorem} \end{samepage} We are particularly concerned with reversible involutive walks. \begin{theorem}\label{thm:factorization} Let $\gamma$ be a weight satisfying either condition in Theorem~\ref{thm:ergodic}. The $\gamma$-weighted involutive walk on~$\n$ is reversible if and only if $\gamma$ factorizes as a product $\alpha\beta$ where $\alpha$ is an atomic weight and $\beta$ is a $\star$-symmetric weight. Moreover, in this case the unique invariant distribution is proportional to $\alpha_{x^\star}N(\alpha \beta)_x$. \end{theorem} \subsubsection*{Binomial weights} An important family of strictly positive weights that factorize as in Theorem~\ref{thm:factorization} is defined for $a$, $b \in \mathbb{R}^{> -1}$ by \begin{equation}\label{eq:gamma} \gammac{a}{b}_{[y,x]} = \binom{y+a}{y} \binom{b+x-y}{x-y}. \end{equation} (We define binomial coefficients by $\binom{r}{d} = r(r-1) \ldots (r-d+1)/d!$ for all $r \in \mathbb{R}$ and $d \in \mathbb{N}_0$.) In particular, $\gamma^{(0,0)}$ is the constant weight, and $\gamma^{(1,0)}$ and $\gamma^{(0,1)}$ are the weights specifying that $y \in [x]$ is chosen with probability proportional to $\bigl| [y] \bigr| = y+1$ and $\bigl|[y,x]\bigr| = x-y+1$, respectively. A natural generalization leads to two more families of weights. Observe that $\smash{\gammac{a}{b}_{[y,x]}}$ is asymptotic to $a^y b^{x-y}/y!(x-y)!$ as $a$, $b \rightarrow \infty$. Setting $b=ac$ and scaling by $a^x$ we obtain $c^{x-y}/y!(x-y)!$. We therefore define $\gammai{c}$ for $c \in \mathbb{R}^{>0}$ by \begin{equation}\label{eq:gammaInfinity} \gammai{c}_{[y,x]} = \binom{x}{y}c^{x-y}.\end{equation} As a further extension, we use that \smash{$\binom{y-a'}{y} = (-1)^y \binom{a'-1}{y}$} and $\binom{x-y-b'}{x-y} = (-1)^{x-y} \binom{b'-1}{x-y}$ to extend the weights \smash{$\gamma^{(a,b)}$} to $a$, $b \in \mathbb{R}^{< -1}$, by defining \begin{equation}\label{eq:delta} \deltac{a'}{b'}_{[y,x]} = \binom{a'-1}{y}\binom{b'-1}{x-y}\end{equation} for $a',b' > 1$. If $b' \not\in \mathbb{N}_0$ then $\deltac{a'}{b'}$ is a strictly positive factorizable weight with domain $\min(\lceil a' \rceil, \lceil b' \rceil)$. If $b' \in \mathbb{N}_0$ then $\deltac{a'}{b'}$ is a non-negative factorizable weight with domain $\lceil a' \rceil$, satisfying hypothesis (ii) in Theorem~\ref{thm:ergodic}. (The domains are chosen to be as large as possible for these positivity properties: see Lemma~\ref{lemma:deltaDomainSimplified}.) In either case, \smash{$\deltac{a'}{b'}_{[y,x]}$} is equal to \smash{$(-1)^x \gammac{-a}{-b}_{[y,x]}$}, when $\gamma^{(-a',-b')}$ is defined as a function on intervals in the obvious way. To orient the reader we show the transition matrices $P(\gamma^{(0,0)})$, $P(\gamma^{(1,0)})$, $P(\gamma^{(0,1)})$, $P(\gamma^{(\sfrac{1}{2})})$, $P(\gamma^{(2)})$ and $P(\delta^{(4,2)})$ below for $n=4$. To emphasise their characteristic \emph{anti-triangular} structure, we use dots to denote entries that are zero because the relevant interval is empty. This convention is in force throughout. \[ \hspace*{-1.0in}\scalebox{0.9}{$\displaystyle \begin{matrix} 0 \\ 1 \\ 2 \\ 3 \end{matrix} \ \ \left( \begin{matrix} \cdot & \cdot & \cdot & 1 \\ \cdot & \cdot & \mfrac{1}{2} & \mfrac{1}{2} \\ \cdot & \mfrac{1}{3} & \mfrac{1}{3} & \mfrac{1}{3} \\ \mfrac{1}{4} & \mfrac{1}{4} & \mfrac{1}{4} & \mfrac{1}{4} \end{matrix} \right) \quad \left( \begin{matrix} \cdot & \cdot & \cdot & 1 \\ \cdot & \cdot & \mfrac{2}{3} & \mfrac{1}{3} \\ \cdot & \mfrac{1}{2} & \mfrac{1}{3} & \mfrac{1}{6} \\ \mfrac{2}{5} & \mfrac{3}{10} & \mfrac{1}{5} & \mfrac{1}{10} \end{matrix} \right) \quad \left( \begin{matrix} \cdot & \cdot & \cdot & 1 \\ \cdot & \cdot & \mfrac{1}{3} & \mfrac{2}{3} \\ \cdot & \mfrac{1}{6} & \mfrac{1}{3} & \mfrac{1}{2} \\ \mfrac{1}{10} & \mfrac{1}{5} & \mfrac{3}{10} & \mfrac{2}{5} \end{matrix} \right) \quad \left( \begin{matrix} \cdot & \cdot & \cdot &1 \\ \cdot & \cdot & \mfrac{2}{3} & \mfrac{1}{3} \\ \cdot & \mfrac{4}{9} & \mfrac{4}{9} & \mfrac{1}{9} \\ \mfrac{8}{27} & \mfrac{4}{9} & \mfrac{2}{9} & \mfrac{1}{27} \end{matrix} \right) \quad \left( \begin{matrix} \cdot & \cdot & \cdot &1 \\ \cdot & \cdot & \mfrac{1}{3} & \mfrac{2}{3} \\ \cdot & \mfrac{1}{9} & \mfrac{4}{9} & \mfrac{4}{9} \\ \mfrac{1}{27} & \mfrac{2}{9} & \mfrac{4}{9} & \mfrac{8}{27} \end{matrix} \right) \quad \left( \begin{matrix} \cdot & \cdot & \cdot & 1 \\ \cdot & \cdot & \mfrac{3}{4} & \mfrac{1}{4} \\ \cdot & \mfrac{1}{2} & \mfrac{1}{2} & 0 \\ \mfrac{1}{4} & \mfrac{3}{4} & 0 & 0 \end{matrix} \right).$} \] The symmetry under swapping $a$ and $b$ seen by comparing $P(\gamma^{(1,0)})$, $P(\gamma^{(0,1)})$ becomes a symmetry under swapping $c$ and $1/c$, seen by comparing $P(\gamma^{(\sfrac{1}{2})})$ and $P(\gamma^{(2)})$. Generally, if $m \in \mathbb{N}$ and $m < n$ then $P(\delta^{(a',m)})$ has precisely~$m$ non-zero anti-diagonal bands. Remarkably, each matrix $P$ above has eigenvalues $(-1)^d P_{dd^\star}$ for $d \in \{0,1,2,3\}$. Up to signs, these are the entries on its anti-diagonal. This is generalized in the final claim in the theorem below. \begin{theorem}\label{thm:spectrum} The $\gammac{a}{b}$-, $\deltac{a'}{b'}$- and $\gammai{c}$-weighted involutive walks on any~$n$ in their domain are irreducible, recurrent, reversible and ergodic. In each case the unique invariant distribution is $\pi$ where~$\pi_x$ is proportional to $\binom{n-1-x+a}{n-1-x}\binom{x+a+b+1}{x}$ for $\gammac{a}{b}$, to $\binom{n-1}{x}\bigl( \frac{c+1}{c}\bigr)^x$ for~$\gammai{c}$, and to $\binom{a'-1}{n-1-x} \binom{(a'-1)+(b'-1)}{x}$ for $\deltac{a'}{b'}$. The eigenvalues of $P(\gammac{a}{b})$ are \begin{equation} \label{eq:evaluesIntroduction} (-1)^d \binom{a+d}{d}/\binom{a+b+d+1}{d}, \end{equation} the eigenvalues of $P(\gammai{c})$ are $(-1)^d/c^d$, for $d \in \ne$ and the eigenvalues of $P(\deltac{a'}{b'})$ are $(-1)^d \binom{a'-1}{d} / \binom{(a'-1)+(b'-1)}{d}$. In each case, up to the signs $(-1)^d$, these are the anti-diagonal entries of the transition matrix. \end{theorem} If $a$, $b \in \mathbb{N}_0$ then a more convenient form for the absolute values of the eigenvalues of $P(\gammac{a}{b})$ is $\binom{a+b+1}{a}/\binom{a+b+d+1}{b+1}$, in which $d$ appears only once. We show after~\eqref{eq:chainEigenvalues} that, as this form suggests, these eigenvalues are strictly decreasing in absolute value. Hence the second largest eigenvalue in absolute value is $-(a+1)/(a+b+2)$. This controls the rate of convergence of the $\gammac{a}{b}$-weighted involutive walk. More precisely, by Corollary 12.7 in~\cite{LevinPeres}, \[ \lim_{t \rightarrow \infty}\, \Bigl|\Bigl| \frac{P(\gamma^{(a,b)})^t_{xy}}{\pi_y} - 1 \Bigr|\Bigr|^{1/t} = \frac{a+1}{a+b+1} \] for any $x \in n$, with similar results for $\gammai{c}$ and $\deltac{a'}{b'}$. \subsubsection*{The anti-diagonal eigenvalue property} To motivate our second result and explain the second part of the title, we need some further notation. If an involutive walk steps from $x$ to $y^\star$, then we say that it makes a \emph{down-step} from $x$ to $y$. Given a weight $\gamma$, we define the \emph{down-step} matrix $H(\gamma)$ by $H(\gamma)_{xy} = \gamma_{[y,x]}/N(\gamma)_x$. Note that $H(\gamma)$ is lower-triangular and $P(\gamma)_{xz} = H(\gamma)_{xz^\star}$. Hence if $J(n)$ is the $n \times n$ matrix defined, using Iverson bracket notation, by $J(n)_{xy} = [x=y^\star]$, having ones on its anti-diagonal and zeros elsewhere, then $P(\gamma) = H(\gamma) J(n)$. Theorem~\ref{thm:spectrum} asserts that the eigenvalues of $P(\gamma)$ are, up to signs, the eigenvalues of $H(\gamma)$, for each weight~$\gamma$. More generally, the authors of \cite{OchiaiEtAl} say in their Definition~2.3 that a lower-triangular $n \times n$ matrix~$L$ has the \emph{anti-diagonal eigenvalue property} if $L$ is diagonalizable and the eigenvalues of $LJ(n)$ are precisely $(-1)^d L_{dd}$ for $d \in \n$. By Theorem~\ref{thm:spectrum}, the down-step matrices $H(\gammac{a}{b})$, $H(\deltac{a'}{b'})$ and $H(\gammai{c})$ all have this property. The authors of~\cite{OchiaiEtAl} conclude after (2.8) that a complete classification of such matrices is infeasible. They therefore introduce the \emph{global anti-diagonal eigenvalue property}, namely that for all $m \le n$, the $m \times m$ top-left submatrix of~$H$ has the anti-diagonal property. Since the weights $\gammac{a}{b}$, $\gammai{c}$ and $\deltac{a'}{b'}$ are defined without reference to the size of the matrix, the down-step matrices $H(\gammac{a}{b})$, $H(\gammai{c})$ and $H(\deltac{a'}{b'})$ all have this stronger property. One of the main results of~\cite{OchiaiEtAl} is Theorem~2.17, that a lower-triangular matrix $L$ with eigenvalues $\lambda_0, \lambda_1, \ldots, \lambda_{n-1}$ read from top to bottom, \emph{such that $(\lambda_0,\lambda_1,\ldots,\lambda_{n-1})$ is not in an exceptional set of measure zero in $\mathbb{R}^n$} has the global anti-diagonal eigenvalue property if and only if $L$ is equal to the matrix $H^\lambda$ defined by \begin{equation}\label{eq:HL} H^\lambda= B(n)\mathrm{Diag}(\lambda_0,\ldots,\lambda_{n-1})B(n)^{-1} \end{equation} where $B(n)$ is the $n \times n$ Pascal's Triangle matrix defined by $B_{xy} = \binom{x}{y}$. We say that $H^\lambda$ is a \emph{binomial transform}. The proof of Theorem~\ref{thm:spectrum} shows that $H(\gammac{a}{b})$, $H(\deltac{a'}{b'})$, $H(\gammai{c})$ are all binomial transforms and hence have the global anti-diagonal property. Since~\cite{OchiaiEtAl} appears to be unpublished, in Theorem~\ref{thm:OchiaiEtAl} we give a new proof of Theorem~2.17 from~\cite{OchiaiEtAl} using some basic algebraic geometry to characterize the exceptional set as the vanishing set of a polynomial. Example~\ref{ex:GADEPcx} extends the examples in~\cite{OchiaiEtAl} by exhibiting a family of stochastic matrices that have the global anti-diagonal eigenvalue property, but not the generic global anti-diagonal eigenvalue property; thus the genericity assumption is essential. As an alternative, we say that an $n \times n$ lower-triangular matrix $L$ with diagonal entries $\lambda_0, \lambda_1, \ldots, \lambda_{n-1}$ has \emph{global anti-diagonal eigenbasis action} if there is a basis of eigenvectors of $L$ such that $LJ(n)$ has an upper-triangular matrix in this basis with diagonal entries $\lambda_0, -\lambda_1, \ldots, (-1)^{n-1}\lambda_{n-1}$, and the same holds for all the top-left submatrices of $L$. Theorem~\ref{thm:GB} characterises matrices with global anti-diagonal eigenbasis action as precisely the binomial transforms, that is,~those of the form~$H^\lambda$. In particular, $H(\gammac{a}{b})$, $H(\deltac{a'}{b'})$, $H(\gammai{c})$ all have global anti-diagonal eigenbasis action. \subsubsection*{Stochastic matrices with global anti-diagonal eigenbasis action} Motivated by this observation, in \S\ref{sec:stochastic} we characterize all stochastic matrices that are binomial transforms. Define $P^\lambda = H^\lambda J(n)$. \newcounter{bTc} \setcounter{bTc}{\value{theorem}} \newcommand{\corollaryBinomialTransform}{Let $\lambda_0, \ldots, \lambda_{n-1} \in \mathbb{R}$. The matrix $P^\lambda$ is the transition matrix of an involutive walk if and only if $\lambda_0 = 1$ and \[ \sum_{e=0}^{z} (-1)^e \binom{z}{e} \lambda_{z^\star+e} \ge 0 \] for all $z \in n$. Moreover if strict inequality holds for all $z \in n$ then $1 > \lambda_1 > \ldots > \lambda_{n-1}$, and $P^\lambda_{xz} > 0$ if and only if $x+z \ge n-1$.} \begin{corollary}\label{cor:binomialTransformIsInvolutiveWalk}\label{cor:binomialTransform} \corollaryBinomialTransform \end{corollary} We extend this result in Corollary~\ref{cor:PLergodic} by characterising when the involutive walk defined by $P^\lambda$ is irreducible, recurrent and ergodic. It is important to note that \S 2.2 of \cite{OchiaiEtAl} considers the related problem of when a half-infinite lower-triangular matrix all of whose upper-left submatrices are of the form~\eqref{eq:HL} is stochastic. The main result is Theorem 2.34 which characterises such matrices as those whose diagonal entries $\lambda_0, \lambda_1, \ldots $ are \emph{completely monotonic}: that is \[ \sum_{e=0}^k (-1)^e \binom{k}{e} \lambda_{m+e} \ge 0 \] for all $m$, $k \in \mathbb{N}_0$. The authors comment at the start of \S 2.2 that `similar results hold in the finite case'. This is true, but as is clear from Corollary~\ref{cor:binomialTransformIsInvolutiveWalk}, only a one-parameter family of inequalities is required. Moreover, the inequalities in Corollary~\ref{cor:binomialTransformIsInvolutiveWalk} are specific to each~$n$: they may all hold for $\lambda_0, \ldots, \lambda_{n-1}$ and then fail for $\lambda_0, \ldots, \lambda_{n-1}, \lambda_n$. For instance, this is the case if $\lambda_n$ is large. Thus it is not possible to obtain our results directly from \cite{OchiaiEtAl}; instead one must adapt the proofs, which require the use of the quite deep Hausdorf Moment Theorem. Another sign that the problems are somewhat different is that there is no `limiting case' of the involutive walk, because the ordinal $\mathbb{N}$ has no anti-involution. The main result in \S\ref{sec:reversibility} further extends Corollary~\ref{cor:binomialTransformIsInvolutiveWalk}. It is not considered in~\cite{OchiaiEtAl}. We require the following definition. \begin{definition}\label{defn:globallyReversible} Let $P$ be the transition matrix of an involutive walk. We say that $P$ is \emph{globally reversible} if all the top-right submatrices of $P$ define reversible involutive walks. \end{definition} Again, since the weights $\gammac{a}{b}$, $\gammai{c}$ and $\deltac{a'}{b'}$ are defined without reference to the size of the matrix, the transition matrices $P(\gammac{a}{b})$, $P(\deltac{a'}{b'})$ and $P(\gammai{c})$ are all globally reversible. Remarkably, this property characterizes them. \newcommand{\reversibleImpliesGamma}{Let $n \ge 3$ and suppose that $P^\lambda$ is the transition matrix of an involutive walk in which $0$ is accessible from every state. Then $P^\lambda$ is globally reversible if and only if $P^\lambda = P(\gammac{a}{b})$ for unique $a, b \in \mathbb{R}^{> -1}$, or $P^\lambda = P(\gammai{c})$ for a unique $c \in \mathbb{R}^{>0}$, or $P^\lambda = P(\deltac{a'}{b'})$ for unique~$a'$, $b' \in \mathbb{R}^{>n-1}$ with either $b' \in \mathbb{R}^{>n-1}$ or $b' \in \mathbb{N}$ and $b' \ge 2$. } \begin{theorem}\label{thm:reversibleImpliesGamma} \reversibleImpliesGamma \end{theorem} In fact we prove a somewhat sharper result, stated in Proposition~\ref{prop:reversibleImpliesGamma}, which implies, for instance, that if $n=10$ and \smash{$P = P^{(1,\sfrac{2}{3},\nu,\ldots,\lambda_9)}$} then $P^\lambda$ is globally reversible if and only if the third largest eigenvalue $\nu$ is either in the interval $(\mfrac{1}{3},\mfrac{10}{23})$, or is one of the four exceptional values $\mfrac{10}{23}$, $\mfrac{13}{30}$, $\mfrac{22}{51}$ and~$\mfrac{3}{7}$, corresponding to the weights $\deltac{17}{9}$, $\deltac{15}{8}$, $\deltac{13}{7}$ and $\deltac{11}{6}$, respectively. See Example~\ref{ex:reversibleSpectrum} for full details. We mention that while it is easy to find non-stochastic matrices of the form $P^\lambda$ that satisfy the detailed balanced equations with respect to a $1$-eigenvector, the only stochastic examples known to the authors have the stronger global reversibility property. We therefore make the following conjecture which we offer as an open problem. \begin{conjecture}\label{conj:reversible} An $n \times n$ stochastic matrix of the form $P^\lambda$ is reversible if and only if $P^\lambda$ is one of the matrices in Theorem~\ref{thm:reversibleImpliesGamma}, or $P^\lambda = J(n)$. \end{conjecture} This conjecture has been verified by computer algebra for $n\le 8$. \subsubsection*{Continuous walks} The continuous analogue of the discrete involutive walk is defined on the interval $[0,1]$. Starting at a state $x \in [0,1]$, an element $y \in [0,x]$ is chosen according to a probability distribution specified by a real weight (as defined in Definition~\ref{defn:realWeight}); the walk then steps to $1-y$. In \S\ref{sec:Hilbert} and~\S\ref{sec:intervalWalk} we prove analogues of all the results in \S\ref{sec:factorization} and~\S\ref{sec:gamma} in the continuous setting. We mention here that, by Theorem~\ref{thm:ctsLP}, the analogue of the $\gammac{a}{b}$-weighted involutive walk has discrete spectrum $(-1)^d \binom{a+d}{d}/\binom{a+b+d+1}{d}$ for $d \in \mathbb{N}_0$; suitably shifted Jacobi functions form the corresponding complete orthonormal basis of eigenfunctions for the analogue of left multiplication by the transition matrix. Thus the right-eigenvectors for the eigenvalues identified in Theorem~\ref{thm:spectrum} are the discrete analogue of the Jacobi functions. We believe they are of considerable combinatorial interest. We identify some of their properties in~\S\ref{subsec:eigenvectors} and compare then with the Jacobi functions in the final subsection~\S\ref{subsec:discreteContinuous}. We also use the extended example in \S\ref{subsec:trigonometricExample} to show that one plausible generalization of the anti-diagonal eigenvalue property to the continuous case is false: the continuous case therefore has a richer theory which again deserves further study. \subsubsection*{Involutive walks on subsets} Since $P(\gamma)^2 = H(\gamma) \bigl( J(n)H(\gamma)J(n) \bigr)$, taking two steps at a time in a discrete involutive walk gives the Markov chain in which each step is a down-step followed by an up-step. An immediate corollary of Theorem~\ref{thm:spectrum} is that, when weighted by $\gammac{a}{b}$ (or one of its generalizations) this down-up walk on $n$ is also irreducible, reversible, ergodic~and recurrent. Moreover its eigenvalues are the squares of the eigenvalues in Theorem~\ref{thm:spectrum}. A similar result holds on~$[0,1]$ and for the up-down walk. Thus despite its more intricate definition, the involutive walk is the more fundamental of the two random processes. This is seen in the corollary~below. \begin{corollary}\label{cor:subsets} Fix $m \in \mathbb{N}$ and let $0 < p < 1$. Let $\mathcal{P}$ be the set of subsets of $\{1,\ldots, m\}$. \begin{thmlist} \item The random walk on $\mathcal{P}$ in which, starting from $X \in \mathcal{P}$, a subset $Y \subseteq X$ is chosen by putting each $x \in X$ in $Y$ independently with probability~$p$,~and the walk then steps to $\{1,\ldots, m\} \backslash Y$, is irreducible, reversible, recurrent and ergodic with unique invariant distribution $\pi$ where $\pi_X = p^{m-|X|}/(1+p)^m$ for each $X \in \mathcal{P}$. Its eigenvalues are $(-p)^e$ for $0 \le e \le m$, with multiplicities~$\binom{m}{e}$. \item Taking two steps at a time in the walk in (i) gives the walk on $\mathcal{P}$ in which each step is a down-step followed by an up-step. This walk has the same invariant distribution, and its eigenvalues are $p^{2e}$ for $0 \le e \le m$, again with multiplicities $\binom{m}{e}$. \end{thmlist} \end{corollary} \subsubsection*{A connection with representation theory} The transition matrix $P(\gamma^{(0,0)})$ shown earlier when $n=4$ appears in \cite[Example~7.5]{McDowellTensorProducts} in the context of a random walk on the indecomposable non-projective representations of $\mathrm{SL}_2(\mathbb{F}_p)$ in characteristic~$p$, as one of two blocks (after rearranging rows and columns) of the matrix shown in Figure~5 of~\cite{McDowellTensorProducts}, taking the parameter $n$ to be $(p-1)/2$. \subsubsection*{Outline} In \S\ref{sec:anti-diagonal} we give a self-contained proof of the characterisation~\eqref{eq:HL} of matrices with the generic global anti-diagonal property first stated and proved in~\cite{OchiaiEtAl}. We then prove our sharper characterisation using the new idea of a global anti-diagonal eigenbasis introduced in Definition~\ref{defn:GB}. Readers interested mainly in the applications to probability need only read as far as Proposition~\ref{prop:practical}. In \S\ref{sec:factorization} we prove Theorems~\ref{thm:ergodic} and~\ref{thm:factorization}. In \S\ref{sec:gammaInfinite} we use Proposition~\ref{prop:practical} to prove Theorem~\ref{thm:spectrum} for the weights~$\gammai{c}$. In~\S\ref{sec:gamma} we extend the method of \S\ref{sec:gammaInfinite} to prove Theorem~\ref{thm:spectrum} for the weights $\gammac{a}{b}$ and~$\deltac{a'}{b'}$, and give further results on the left- and right-eigenvectors of the transition matrix $P(\gammac{a}{b})$. We end this section with the proof of Corollary~\ref{cor:subsets}. In~\S\ref{sec:stochastic} we prove Corollary~\ref{cor:binomialTransformIsInvolutiveWalk} and in \S\ref{sec:reversibility} we prove Theorem~\ref{thm:reversibleImpliesGamma}. In \S\ref{sec:Hilbert} we give a general setting using Hilbert spaces for involutive walks on the interval $[0,1]$ and in \S\ref{sec:intervalWalk} we prove analogues of the main results for the $\gammac{a}{b}$-weighted discrete walks, ending by comparing the spectral behaviour in the discrete and continuous cases. \section{The global anti-diagonal eigenvalue property}\label{sec:anti-diagonal} In this section we prove Theorem~\ref{thm:GB} characterizing the binomial transforms $H^\lambda$ in~\eqref{eq:HL} in terms of Definition~\ref{defn:GB}. We also give a self-contained proof of the connection between the binomial transform of a matrix and the global anti-diagonal eigenvalue property first proved in \cite{OchiaiEtAl} and prove some simpler results sufficient for the applications to probability below. \subsection{Preliminaries} Recall that $B(n)$ is the $n \times n$ Pascal's Triangle matrix defined by $B(n)_{xy} = \binom{x}{y}$ and that $J(n)$ is the $n \times n$ matrix defined in Iverson bracket notation by $J(n)_{xy} = [x = y^\star]$. For $e \in \{0,1,\ldots, n\}$, let $V_e$ be the $e$-dimensional subspace of $\mathbb{R}^n$ of all row vectors $\bigl( f(0), \ldots, f(n-1) \bigr)$ where~$f$ is a polynomial of degree strictly less than $e$. Let \begin{equation}\label{eq:v} v(d) = \Bigl( \binom{0}{d}, \binom{1}{d}, \ldots, \binom{n-1}{d} \Bigr)^t. \end{equation} Thus $B(n)$ has columns $v(0), \ldots, v(n-1)$. \begin{lemma}{\ }\label{lemma:binomialNew} \begin{thmlist} \item $B(n)^{-1}_{zw} = (-1)^{z+w} \binom{z}{w}$; \item $V_e = \langle v(0), \ldots, v(e-1) \rangle$ for each $e \in \{0,\ldots, n\}$; \item $J(n)v(d) \in (-1)^d v(d) + \langle v(0), \ldots, v(d-1) \rangle$ for each $d \in \ne$; \item $\bigl( B(n)^{-1}J(n)B(n) \bigr)_{xy} = (-1)^x \binom{x^\star}{y^\star}$. \end{thmlist} \end{lemma} \begin{proof} For (i) we calculate \begin{align*} \sum_{w=0}^{n-1} \binom{x}{w}(-1)^{x+w}B(n)_{wy} &= (-1)^x \sum_{w=0}^{n-1} (-1)^{w} \binom{x}{w} \binom{w}{y} \\ &= (-1)^x \binom{x}{y} \sum_{w=0}^{n-1} (-1)^w \binom{x-y}{w-y} \\ &= [x=y] \end{align*} where in the final step we use the corollary of the Binomial Theorem that $\sum_{z=0}^m (-1)^z \binom{m}{z} = [m=0]$. Since the binomial coefficient $\binom{X}{d}$ is a polynomial with leading term $X^d/ d!$, we have (ii). For (iii) we note that $J(n)v(d)$ has as its entries $\binom{n-1-X}{d}$ evaluated at $0$, \ldots, $n-1$. Since this binomial coefficient is a polynomial of degree $d$ with leading term $(-1)^d X^d/d!$, (iii) follows from~(ii). Finally for (iv) we apply (i), the identity $\binom{a}{b} = \binom{-b-1}{a-b}(-1)^{a-b}$, Vandermonde's convolution, and finally $\binom{b-a-1}{b}(-1)^b$ to get \begin{align*} \bigl( B(n)^{-1}J(n)B(n) \bigr)_{xy} &= \sum_z (-1)^{x+z} \binom{x}{z} \binom{n-1-z}{y} \\ &= \sum_z (-1)^{n-1+x+y} \binom{x}{z} \binom{-y-1}{n-1-z-y} \\ &= (-1)^{n-1+x+y} \binom{x-y-1}{n-1-y} \\ &= (-1)^x \binom{n-1-x}{n-1-y} \end{align*} \vspace*{-3pt} \noindent as required. \end{proof} \enlargethispage{6pt} \subsection{A sufficient condition for the global anti-diagonal eigenvalue property} We use the following lemma and proposition in~\S\ref{sec:gammaInfinite} and~\S\ref{sec:gamma} to show that the down-step matrices of the involutive walks for the binomial weights $\gammac{a}{b}$, $\gammai{c}$ and $\deltac{a'}{b'}$ are binomial transforms, and so have the global anti-diagonal eigenvalue property. \begin{lemma}\label{lemma:practical} Let $L$ be a real lower-triangular matrix with diagonal entries $\lambda_0, \ldots, \lambda_{n-1}$ read from top to bottom. The following are equivalent \begin{thmlist} \item $L$ is equal to the binomial transform $H^\lambda$; \item $L = B(n)\mathrm{Diag}(\lambda_0,\ldots,\lambda_{n-1})B(n)^{-1}$; \item $L v(d) = \lambda_d v(d)$ for each $d \in \ne$. \item $L_{xy} = \binom{x}{y}\sum_{e=0}^{x-y} (-1)^e \binom{x-y}{e} \lambda_{y+e}$ for $0 \le y \le x < n$. \end{thmlist} \end{lemma} \begin{proof} Conditions (i) and (ii) are immediately equivalent by the definition of $H^\lambda$. Since $B(n)$ has columns $v(0), v(1), \ldots, v(n-1)$, (iii) holds if and only if $L B(n) = B(n)\mathrm{Diag}(\lambda_0,\ldots,\lambda_{n-1})$, hence if and only if (ii) holds. Finally, by Lemma~\ref{lemma:binomialNew}(i), the entry $H^\lambda_{xy}$ is \begin{align*} \sum_{w=0}^{n-1} \binom{x}{w} \lambda_w (-1)^{w+y} \binom{w}{y} &= \sum_{w=y}^{n-1} \binom{x}{y} (-1)^{w+y} \binom{x-y}{w-y} \lambda_w \\ &= \binom{x}{y} \sum_{e=0}^{x-y} (-1)^e \binom{x-y}{e} \lambda_{y+e} \end{align*} as required for (iv). \end{proof} \begin{proposition}\label{prop:practical} Suppose that any of the equivalent conditions in Lemma~\ref{lemma:practical} holds for the $n \times n$ lower-triangular matrix $L$. Then \begin{thmlist} \item $L J(n)v(d) \in (-1)^{d}\lambda_d v(d) + V_{d-1}$; \item $L J(n)$ preserves each subspace $V_d$ and acts as $(-1)^d \lambda_d$ on $V_{d+1}/V_d$; \item The matrix representing $L J(n)$ in the basis $v(0), v(1), \ldots, v(n-1)$ is upper-triangular with diagonal entries $\lambda_0, -\lambda_1, \ldots, (-1)^{n-1}\lambda_{n-1}$ read from top to bottom. \item $L$ has the global anti-diagonal eigenvalue property. \end{thmlist} \end{proposition} \begin{proof} By Lemma~\ref{lemma:practical}(iii), $L v(d) = \lambda_d v(d)$. By Lemma~\ref{lemma:binomialNew}(ii) and (iii), $v(d) \in V_{d+1}$ and $J(n)v(d) = (-1)^d v(d) + w$ where $w \in V_{d}$. Hence $L Jv(d) \in (-1)^d \lambda_d v(d) + V_{d}$, as required for (i). Since $v(d) + V_{d}$ spans the quotient space $V_{d+1}/V_{d}$,~(ii) follows at once; (iii) simply restates (ii) in matrix language. From~(iii) we see that $L J(n)$ has eigenvalues $\lambda_0$, $-\lambda_1$, \ldots, $(-1)^{n-1}\lambda_{n-1}$ read from top-to-bottom. Hence $L$ has the anti-diagonal eigenvalue property. By applying the canonical projection $\mathbb{R}^n \rightarrow \mathbb{R}^m$ to each subspace $V_d$, we see that all these results hold for each $m \times m$ top-left submatrix of $L$. Hence $L$ has the global anti-diagonal eigenvalue property. \end{proof} \subsection{A generic characterisation of the global anti-diagonal eigenvalue property} We now give a self-contained proof of Theorem~2.17 in \cite{OchiaiEtAl}. The matrix $C$ in our proof plays a similar role to the matrix in Lemma~2.13 in \cite{OchiaiEtAl}, but is more easily visualised. Stated so as to make clear that the exceptional set is an algebraic variety, Theorem~2.17 is as follows. \begin{theorem}[Ochiai, Sasada, Shirai and Tsuboi]\label{thm:OchiaiEtAl} There is a homogeneous polynomial $f(x_0,\ldots,x_{n-2})$ of degree $(n-1)(n-2)/2$ such that, provided $f(\lambda_0,\ldots,\lambda_{n-2}) \not=0$, a lower-triangular matrix $L$ with eigenvalues $\lambda_0, \ldots, \lambda_{n-2}, \lambda_{n-1}$ read from top to bottom has the global anti-diagonal eigenvalue property if and only if $L = H^\lambda$. \end{theorem} \begin{proof} The `if' direction holds by Proposition~\ref{prop:practical}(iv). Suppose that $L$ is a real lower-triangular $n \times n$ matrix with eigenvalues $\lambda_0$, $\ldots$, $\lambda_{n-1}$ having the global anti-diagonal eigenvalue property. Working by induction on $n$ we may assume that the matrix obtained from $L$ by deleting its bottom row and rightmost column is $H^{(\lambda_0,\ldots,\lambda_{n-2})}$. Since $H^{(\lambda_0,\ldots,\lambda_{n-2})}$ is obtained by the same deletions from $H^{(\lambda_0,\ldots,\lambda_{n-2},\lambda_{n-1})}$, we may write $L = H^\lambda + E$ where the $n \times n$ matrix $E$ is zero except in its bottom row. Let the bottom row of $E$ be $\epsilon_0, \ldots, \epsilon_{n-1}$ read left to right. It suffices to show that $\epsilon_z = 0$ for each~$z$. By the assumption that $L$ has eigenvalues $\lambda_0, \ldots, \lambda_{n-1}$ we have $\tr L = \lambda_0 + \lambda_1 + \cdots + \lambda_{n-1}$. Since $\tr L = \tr (H^\lambda + E) = \lambda_0 + \lambda_1 + \cdots + \lambda_{n-1} + \epsilon_{n-1}$, it follows that $\epsilon_{n-1} = 0$. Similarly, since the matrices $LJ(n)$ and $H^\lambda J(n)$ have eigenvalues $\lambda_0, -\lambda_1, \ldots, (-1)^{n-1}\lambda_{n-1}$, we have $\tr LJ(n) = \tr H^\lambda J(n)$; now since $LJ(n) = H^\lambda J(n) + EJ(n)$ and $EJ(n)$ has bottom row entries $\epsilon_{n-1}, \ldots, \epsilon_0$, it follows that $\epsilon_0 = 0$. Let $M = LJ(n) - XI$, where $X$ is an indeterminate. Since $L$ has the anti-diagonal eigenvalue property, $\det(LJ-XI) = \det(H^\lambda J(n) - XI)$. By the multilinearity of the determinant, \[ \det(LJ(n)-XI) - \det(H^\lambda J(n) - XI) = \det N \] where~$N$ is the matrix obtained from $LJ(n) - XI$ by subtracting the bottom row of $H^\lambda J(n)$; this leaves the bottom row of $E$. For instance if $n=5$ then~$N$ is as shown below. \[ \scalebox{0.9}{$\left( \begin{matrix} -X & \cdot &\cdot &\cdot & \lambda_0 \\ \cdot & -X & \cdot & \lambda_1 & \lambda_0-\lambda_1 \\ \cdot & \cdot & \lambda_2-X & 2(\lambda_1-\lambda_2) & \lambda_0-2\lambda_1 + \lambda_2 \\ \cdot & \lambda_3 & 3(\lambda_2-\lambda_3) & 3(\lambda_0-2\lambda_1 + \lambda_2) - X & \lambda_0-3\lambda_1 + 3\lambda_2 - \lambda_3 \\ 0 & \epsilon_3 & \epsilon_2 & \epsilon_1 & 0 \end{matrix} \right)$} \] (The entries in $N$ can be computed using Lemma~\ref{lemma:practical}(iv), or more conveniently for hand calculations, by Lemma~\ref{lemma:binomialTransformRecurrence} below.) For each $d \in \{0,1,\ldots, n-1\}$, the coefficient of $X^d$ in $\det N$ is a linear combination $f_1 \epsilon_1 + \cdots + f_{n-2} \epsilon_{n-2}$ where each $f_y$ is a homogeneous polynomial in $\lambda_0, \ldots, \lambda_{n-2}$ of degree $n-1-d$. Since the coefficients of $X^0$ and $X^{n-1}$ are zero, we need only consider $d \in \{1,\ldots, n-2\}$. Let $C$ be the $(n-2) \times (n-2)$ matrix \emph{with rows and columns labelled by $\{1,\ldots, n-2\}$} such that $C_{dy}$ is the coefficient of $\epsilon_y X^{d}$ in $\det N$. There is a non-zero solution $(\epsilon_1, \ldots, \epsilon_{n-2})$ to $\det N = 0$ if and only if $\det C = 0$. We can therefore take the required multivariable polynomial $f$ to be $\det C$, \emph{provided} $\det C$ is not the zero polynomial in the eigenvalues $\lambda_0, \ldots, \lambda_{n-1}$. This is surprisingly non-trivial to prove. It suffices to show that $\det C$ is non-zero for one specialization of the eigenvalues. We take \hbox{$\lambda_x = x$} for each~$x$. (The choice for $\lambda_{n-1}$ is irrelevant.) After this specialization, the matrices $N$ and $C$ are shown left and right below when $n=7$. \[ \scalebox{0.8}{$\left( \begin{matrix} -X & \cdot & \cdot& \cdot & \cdot & \cdot & 0 \\ \cdot & -X & \cdot & \cdot & \cdot & 1 & -1 \\ \cdot & \cdot & -X & \cdot & 2 & -2 & 0 \\ \cdot & \cdot & \cdot & 3-X & -3 & 0 & 0 \\ \cdot & \cdot & 4 & -4 & -X & 0 & 0 \\ \cdot & 5 & -5 & 0 & 0 & -X & 0 \\ 0 & \epsilon_5 & \epsilon_4 & \epsilon_3 & \epsilon_2 & \epsilon_1 & -X \end{matrix} \right)\quad \raisebox{-12pt}{$\begin{blockarray}{cccccc} \begin{block}{c(ccccc)} X & -120 & -120 & -120 & -120 & -120 \\ X^2 & 100 & 40 & 0 & -30 & -54 \\ X^3 & 15 & 0 & 0 & 10 & 30 \\ X^4 & -5 & 0 & 0 & 0 & 3 \\ X^5 & 0 & 0 & 0 & 0 & -1 \\[-3pt] \end{block} & \epsilon_1 & \epsilon_2 & \epsilon_3 & \epsilon_4 & \epsilon_5 \end{blockarray}$}$} \] Observe that, after a column permutation $C$ is upper-triangular, with non-zero diagonal entries, and so has non-zero determinant. In general, to obtain a non-zero contribution to the coefficient of $\epsilon_y$ by expanding $\det N$ we must take $\epsilon_y$ from the bottom row, $-X$ from the top row, and $-1$ from row~$1$. Thus $C_{dy}$ is the coefficient of $\epsilon_ y X^{d-1}$ in the minor obtained by deleting the first two rows and the first and last columns from~$N$. We may rearrange the rows and the rows and columns of this minor matrix so that (using the original numbering of $\{0,\ldots, n-1\}$ for both), the rows come in order $n-2, 2, n-3, 3, \ldots, \lfloor \mfrac{n}{2} \rfloor, n-1$ and the columns in order $1, n-2, 2, n-3, \ldots, \lfloor \mfrac{n}{2} \rfloor$. This gives an $(n-2) \times (n-2)$ matrix $N'$ that is upper-triangular and tridiagonal, except in its bottom row which has entries $\epsilon_{n-2}, \epsilon_1, \epsilon_{n-3}, \epsilon_2, \ldots, \epsilon_{\lfloor \sfrac{n-1}{2} \rfloor}$. (To see this, note that the columns with highest entry in the same row are now adjacent, as are the rows with left-most entry in the same column.) By this choice of order, the entries of~$N$ involving $X$ appear on the super-diagonal of $N'$. More precisely, labelling rows and columns from $0$ as usual, if $x < n-4$ is even then \begin{align*} N'_{xy} &= \begin{cases} n-2 -\mfrac{x}{2} & \text{if $y=x$} \\ -X & \text{if $y=x+1$} \\ -(n-2 - \mfrac{x}{2}) & \text{if $y=x+2$} \end{cases} \intertext{and if $x < n-4$ is odd then} N'_{xy} &= \begin{cases} -(1 + \mfrac{x+1}{2}) & \text{if $y = x$} \\ -X & \text{if $y=x+1$} \\ 1+\mfrac{x+1}{2} & \text{if $y = x+2$} \end{cases} \end{align*} and all other entries of $N'$ in these rows are $0$. Row $n-4$ of $N'$, just above the bottom row, ends with the two non-zero entries $\pm \lfloor \mfrac{n}{2} \rfloor$, $-X \mp \lfloor \mfrac{n}{2} \rfloor$, the signs depending on the parity of $n$. For example, if $n=7$ then $N'$ is as shown below. \[ \scalebox{0.9}{$\left( \begin{matrix} 5 & -X & -5 & 0 & 0 \\ 0 & -2 & -X & 2 & 0 \\ 0 & 0 & 4 & -X & -4 \\ 0 & 0 & 0 & -3 & 3-X \\ \epsilon_5 & \epsilon_1 & \epsilon_4 & \epsilon_2 & \epsilon_3 \end{matrix} \right)$} \] The minor matrix obtained by deleting the bottom row and final column from $N'$ is upper-triangular; its determinant is the coefficient of $\epsilon_{\lfloor \sfrac{n-1}{2} \rfloor}$ and has degree $0$ in $X$. Generally, if $\epsilon_y$ comes $r$-th from the end in the order $\epsilon_{n-2}$, $\epsilon_1$, $\epsilon_{n-3}$, $\epsilon_2$, \ldots, $\epsilon_{\lfloor \sfrac{n-1}{2} \rfloor}$, then the corresponding minor matrix of $N'$ has an $(r-1) \times (r-1)$ bottom right matrix with determinant of degree~\hbox{$r-1$} in $X$ and the minor is the product of this by a non-zero constant. Therefore the polynomial coefficients of $\epsilon_{n-2}$, $\epsilon_1$, $\epsilon_{n-3}$, $\epsilon_2$, \ldots, $\epsilon_{\lfloor \sfrac{n-1}{2} \rfloor}$ are of degrees $n-3$, $n-4$, \ldots, $1$, $0$, respectively. It follows that the matrix $C$ can be rearranged (by the reverse of this ordering of the $\epsilon_y$) so that it is upper-triangular with non-zero diagonal entries. Hence $\det C \not= 0$. \end{proof} The following example extends those in~\cite{OchiaiEtAl} to show that the exceptional set in Theorem~\ref{thm:OchiaiEtAl} is necessary even if we add the condition that the lower-triangular matrix has distinct eigenvalues, or is stochastic. \begin{example}\label{ex:GADEPcx} It is a routine calculation to show that the lower-triangular matrices $L$ and $H$ left and middle below both have the anti-diagonal eigenvalue property; an explicit basis of right-eigenvectors of $HJ(5)$ is given in the far right matrix. By Lemma~\ref{lemma:practical}(iv), the $3 \times 3$ top-left submatrix of $L$ is $H^{(1,\sfrac{2}{3}, \sfrac{1}{4})}$, and similarly, the $4 \times 4$ top-left submatrix of $H$ is $H^{(1,\sfrac{1}{2},\sfrac{1}{2}-\tau,\sfrac{1}{2}-\tau)}$. Therefore $L$ and $H$ have the global anti-diagonal eigenvalue property. \[ \hspace*{-48pt}\scalebox{0.8}{$ \left( \begin{matrix} 1 & \cdot & \cdot & \cdot \\ \frac{1}{3} & \frac{2}{3} & \cdot & \cdot \\[2pt] -\frac{1}{12} & \frac{5}{6} & \frac{1}{4} & \cdot \\[2pt] -\frac{9}{20} & \frac{11}{10} + \mfrac{4}{5}\tau & \frac{3}{20} + \mfrac{1}{5}\tau & \frac{1}{5} \end{matrix} \right) \quad \left( \begin{matrix} 1 & \cdot & \cdot & \cdot & \cdot \\ \mfrac{1}{2} & \mfrac{1}{2} & \cdot & \cdot & \cdot \\ \mfrac{1}{2} - \tau & 2 \tau & \mfrac{1}{2}-\tau & \cdot & \cdot \\ \mfrac{1}{2}- 2\tau & 3\tau & 0 & \mfrac{1}{2}-\tau & \cdot \\ \mfrac{1}{2}-4\tau & 5\tau & 0 & \tau & \mfrac{1}{2}-2\tau \end{matrix} \right)\quad \left(\begin{matrix} 1 & -2 & 0 & -4 & -4 \tau (10 \tau -3) \\ 1 & -\frac{5}{4} & 0 & -4 & -28 \tau ^2+11 \tau -1 \\ 1 & -\frac{1}{2} & 1 & -2 \tau -1 & (4 \tau -1) \left(4 \tau ^2-6 \tau +1\right) \\ 1 & \frac{1}{4} & 0 & 2-4 \tau & (4 \tau -1) \left(8 \tau ^2-5 \tau +1\right) \\ 1 & 1 & 0 & 2-4 \tau & 2 \tau (4 \tau -1) (10 \tau -3) \end{matrix}\right)$} \] Again by Lemma~\ref{lemma:practical}(iv), if $\tau \not=0$ then the bottom row of $L$ does not agree with $H^{(1,\sfrac{2}{3}, \sfrac{1}{4},\sfrac{1}{5})}$, and similarly the bottom row of $H$ does not agree with $H^{(1,\sfrac{1}{2},\sfrac{1}{2}-\tau,\sfrac{1}{2}-\tau,\sfrac{1}{2}-2\tau)}$. Therefore these matrices have the global anti-diagonal eigenvalue property but are not of the form $H^\lambda$. \end{example} The authors know of no example satisfying both conditions simultaneously. An explicit calculation of the determinant $\det C$ in the previous proof can be used to prove the conjecture below for $n \le 4$. \begin{conjecture}\label{conj:GADEP} A stochastic matrix with distinct eigenvalues has the strong anti-diagonal eigenvalue property if and only if it is of the form $H^\lambda$. \end{conjecture} We offer this as an open problem, related to Conjecture~\ref{conj:reversible}. \subsection{Anti-diagonal conjugators and a characterisation of the matrices $H^\lambda$} Let $L$ be a diagonalizable lower-triangular matrix having diagonal entries $\lambda_0$, \ldots, $\lambda_{n-1}$. There is a basis $u(0), \ldots, u(n-1)$ of eigenvectors of $L$ such that the matrix $Q$ with columns $u(0), \ldots, u(n-1)$ is lower-triangular. The matrix representing $LJ(n)$ in this basis is \[ Q^{-1}LJ(n)Q = (Q^{-1}LQ)(Q^{-1}J(n)Q) = \mathrm{Diag}(\lambda_0, \ldots, \lambda_{n-1}) Q^{-1}J(n)Q. \] Thus if $Q^{-1}J(n)Q$ is upper-triangular with alternating sign entries, then~$L$ has the anti-diagonal eigenvalue property. Motivated by this observation we make the following definition, working over an arbitrary infinite field $\mathbb{F}$. \begin{definition}\label{defn:GB} A lower-triangular $n \times n$ matrix $Q$ with entries in $\mathbb{F}$ is an \emph{anti-diagonal conjugator} if $Q^{-1}J(n)Q$ is upper-triangular with diagonal entries $(Q^{-1}J(n)Q)_{xx} = (-1)^x$ and a \emph{global anti-diagonal conjugator} if the same holds for all the top-left $m \times m$ submatrices of $Q$, replacing $J(n)$ with $J(m)$. A lower-triangular matrix $L$ has \emph{global anti-triangular eigenbasis action} if it has the columns of a global anti-diagonal conjugator as its eigenvectors. \end{definition} By Lemma~\ref{lemma:practical}(iv), $B(n)^{-1}J(n)B(n)$ is upper-triangular for each $n$. Therefore $B(n)$ is a global anti-diagonal conjugator, and the binomial transform $H^\lambda = B(n)\mathrm{Diag}(\lambda_0,\ldots, \lambda_{n-1})B(n)^{-1}$ has a global anti-diagonal eigenbasis. By the following proposition, up to column scaling of $B(n)$, this is the only family of examples. The final remark in \S\ref{subsec:discreteContinuous} gives an an intuitive interpretation of this proposition. \begin{proposition}\label{prop:ADC} A lower-unitriangular $n \times n$ matrix $Q$ is a global anti-diagonal conjugator if and only if $Q = B(n)$. \end{proposition} \begin{proof} We work by induction on $n$. The result is obvious if $n=1$. For the inductive step, we suppose that $Q$ is an $(n+1) \times (n+1)$ global anti-diagonal conjugator. The $n \times n$ top-left submatrix of $Q$ is a global anti-diagonal conjugator, and so by induction, it is $B(n)$. Let $Q_{nd} = \alpha_d$ for $d \le n$. Let $u(d) \in \mathbb{F}^{n+1}$ be column $d$ of $Q$ of length $n+1$ and let $v(d) \in \mathbb{F}^n$ be column $d$ of $B(n)$ of length $n$ (as usual). Thus if $d \in \{0,\ldots,n-1\}$ then $u(d)_y = v(d)_y$ if $y < n$ and $u(d)_n = \alpha_d$. By the hypothesis that $J(n+1)Q = QU$ where $U$ is upper-triangular with the specified diagonal entries, we have \begin{equation}\label{eq:ADCeq} J(n+1)u(d) \in (-1)^d u(d) + \bigl\langle u(0), \ldots, u(d-1) \bigr\rangle. \end{equation} We shall deduce from~\eqref{eq:ADCeq} that $\alpha_d = \binom{n}{d}$. Since $J(n+1)u(0) = u(0)$ we have $\alpha_0 = u(0)_n = u(0)_0 = 1$. Moreover, $\alpha_n = Q_{nn} = 1$ since $Q_{nn}$ is uni-triangular. Let $1 \le d < n$ and let $\mu_0, \ldots, \mu_{d-1}$ be the unique scalars given by~\eqref{eq:ADCeq} such that \begin{equation}\label{eq:ADCeq2} J(n+1)u(d) = (-1)^d u(d) + \sum_{x=0}^{d-1} \mu_x u(x). \end{equation} Projecting down to $\mathbb{F}^n$ by taking the entries in positions $0$, $1$, \ldots, $n-1$ on either side we may replace $u(x)$ with $v(x)$ for each $x \le d$ to get \begin{equation}\label{eq:ADCeq3} \bigl( \alpha_d, \binom{n-1}{d}, \ldots, \binom{1}{d} \bigr)^t = (-1)^d v(d) + \sum_{x=0}^{d-1} \mu_x v(x). \end{equation} By Lemma~\ref{lemma:binomialNew}(iv), the matrix representing $J(n)$ in the basis $v(0), \ldots v(n-1)$ is upper-triangular with entries $(-1)^x \binom{n-1-x}{n-1-y}$. Hence \begin{equation}\label{eq:ADCeq4} J(n)v(d) = (-1)^d v(d) + \sum_{x=0}^{d-1} (-1)^x \binom{n-1-x}{n-1-d} v(x). \end{equation} This is a somewhat similar relation to~\eqref{eq:ADCeq3}. Indeed $J(n)v(d)_x = \binom{n-1-x}{d}$, and adding $\binom{n-1-x}{d-1}$ gives $\binom{n-x}{d}$, agreeing with the left-hand side of~\eqref{eq:ADCeq3} for $x \ge 1$. Observe that $\binom{n-1-x}{d-1} = \bigl( J(n)v(d-1)\bigr)_x$ and, by replacing $d$ with $d-1$ in the previous displayed equation, \begin{equation}\label{eq:ADCeq4b} J(n)v(d-1) = (-1)^{d-1} v(d-1) + \sum_{x=0}^{d-2} (-1)^x \binom{n-1-x}{n-d} v(x). \end{equation} Adding~\eqref{eq:ADCeq4} and~\eqref{eq:ADCeq4b} and using that $\binom{n-1-x}{d} + \binom{n-1-x}{d-1} = \binom{n-x}{d}$ on the left-hand side and $\binom{n-1-x}{n-1-d} + \binom{n-1-x}{n-d} = \binom{n-x}{n-d}$ on the right-hand side gives \begin{align} \nonumber \Bigl( \binom{n}{d}, \binom{n-1}{d}, \ldots, \binom{1}{d} \Bigr)^\t &= J(n)v(d) + J(n)v(d-1) \\&= (-1)^d v(d) + \sum_{x=0}^{d-1} (-1)^x \binom{n-x}{n-d} v(x) \label{eq:ADCeq5}. \end{align} Taking the difference of~\eqref{eq:ADCeq3} and~\eqref{eq:ADCeq5} we get \[ \Bigl( \alpha_d - \binom{n}{d}, 0, \ldots, 0 \Bigr)^\t = \sum_{x=0}^{d-1} \bigl( \mu_x - (-1)^x \binom{n-x}{n-d} \bigr) v(x). \] The function $f$ defined by $f(0) = 1$ and $f(x) = 0$ for $x \in \{1,\ldots, n-1\}$ has $n-1$ zeros and is therefore a polynomial of degree $n-1$. Thus, if non-zero, the left-hand side is in $V_{n}$ but not in $V_e$ for any $e < n$. On the other hand, the right-hand side is clearly in $V_{d}$. Since $d < n$, we conclude that $\alpha_d = \binom{n}{d}$, as required. \end{proof} \begin{theorem}\label{thm:GB} Let $L$ be a lower-triangular $n \times n$ matrix with entries in~$\mathbb{F}$ having diagonal entries $\lambda_0$, $\ldots$, $\lambda_{n-1}$ read from top-bottom. Then $L$ has global anti-diagonal eigenbasis action if and only if $H$ is equal to the binomial transform $H^{(\lambda_0, \ldots, \lambda_{n-1})}$. \end{theorem} \begin{proof} This is immediate from Definition~\ref{defn:GB} and Proposition~\ref{prop:ADC} \end{proof} \section{Factorizable weights and proofs of Theorems~\ref{thm:ergodic} and~\ref{thm:factorization}} \label{sec:factorization} The second hypothesis in Theorem~\ref{thm:ergodic}, that $\gamma_{[x,x]} > 0$ for all $x \in n$ and $\gamma_{[x-1,x]} > 0$ for all non-zero $x \in n$, implies that the steps $x \mapsto x^\star$ and $x \mapsto (x-1)^\star$ have positive probability in the $\gamma$-weighted involutive walk for all relevant $x$. For later use in \S\ref{sec:reversibility}, we take a weaker hypothesis below. \begin{lemma}\label{lemma:longWalk} In an involutive walk on $n$, if $x^\star$ is accessible from $x$ for all $x \in n$ and $(x-1)^\star$ is accessible from $x$ for all non-zero $x \in n$ then the walk is irreducible. \end{lemma} \begin{proof} The hypothesis implies that, if the involutive walk is allowed to take multiple steps, then each transition in \[ 0 \rightsquigarrow n-1 \rightsquigarrow 1 \rightsquigarrow n-2 \rightsquigarrow 2 \rightsquigarrow \cdots \rightsquigarrow n-2 \rightsquigarrow 1 \rightsquigarrow n-1 \rightsquigarrow 0 \] has non-zero probability. Therefore all states communicate. \end{proof} We are now ready to prove Theorem~\ref{thm:ergodic}. \begin{proof}[Proof of Theorem~\ref{thm:ergodic}] If (i) holds then, by~\eqref{eq:Pgamma}, the steps $x \mapsto 0^\star = n-1$ and $n-1 \mapsto x^\star$ have non-zero probability for all $x \in n$. Hence the involutive walk is irreducible. Moreover, since $n-1 \mapsto 0^\star = n-1$ is a possible step, it follows from a standard criterion that the involutive walk is aperiodic. If (ii) holds then, again by~\eqref{eq:Pgamma}, the steps $x \mapsto x^\star$ and $x \mapsto (x-1)^\star$ have non-zero probabilities and so, by Lemma~\ref{lemma:longWalk}, the involutive walk is again irreducible. Moreover, if $n=2m$ then $m \mapsto (m-1)^\star = m$ is a possible step and if $n=2m+1$ then $m \mapsto m^\star = m$ is a possible step. Hence the involutive walk is aperiodic. Thus in either case there is a unique invariant distribution to which the involutive walk converges by the ergodic theorem. \end{proof} We now turn to reversibility. The detailed balance equations for an invariant probability distribution $\pi$ on $\n$ are $\pi_x P(\gamma)_{xz} = \pi_z P(\gamma)_{zx}$. Equivalently, \begin{equation} \label{eq:db} \pi_x \frac{\gamma_{[z^\star,x]}}{\norm{\gamma}_x} = \pi_z \frac{\gamma_{[x^\star,z]}}{\norm{\gamma}_z} \end{equation} for $x$, $z \in n$. Since $\gamma_\varnothing = 0$ and $[z^\star,x]$ is non-empty if and only if $[x^\star,z]$ is non-empty, we may assume that $z^\star \le x$ in this equation. \begin{samepage} \begin{lemma}{\ }\label{lemma:invariant} \begin{thmlist} \item If $\alpha$ is an atomic weight then the $\alpha$-weighted involutive walk is reversible with invariant distribution $\pi(\alpha)$ such that $\pi(\alpha)_x \propto \alpha_{x^\star} \norm{\alpha}_x$. \item If $\beta$ is a $\star$-symmetric weight then the $\beta$-weighted involutive walk is reversible with an invariant distribution $\pi(\beta)$ such that $\pi(\beta)_x \propto \norm{\beta}_x$. \end{thmlist} \end{lemma} \end{samepage} \begin{proof} When $\alpha$ is atomic the equations~\eqref{eq:db} simplify to $\pi_x \alpha_{z^\star} /N(\alpha)_x = \pi_z \alpha_{x^\star} / N(\alpha)_z$ for $x$, $z \in n$ such that $z^\star \le x$. Clearly one solution has each $\pi_x$ proportional to $\alpha_{x^\star} N(\alpha)_x$. If $\beta$ is $\star$-symmetric then, by definition, $\beta_{[z^\star,x]} = \beta_{[x^\star,z]}$, and so one solution to~\eqref{eq:db} has each $\pi_x$ proportional to~$N(\beta)_x$. \end{proof} Since atomic weights are strictly positive, both invariant distributions are strictly positive. Reversibility is preserved by products of weights. \begin{lemma}\label{lemma:pointwiseProductReversible} Let $\alpha$ and $\beta$ be weights. If the $\alpha$-weighted and $\beta$-weighted involutive walks on $n$ are reversible with respect to invariant distributions proportional to $\theta$ and $\phi$, respectively, then the $\alpha\beta$-weighted involutive walk on $n$ is reversible with respect to an invariant distribution proportional to $\theta_x \phi_x N(\alpha\beta)_x /N(\alpha)_xN(\beta)_x$. \end{lemma} \begin{proof} Multiplying the two cases of~\eqref{eq:db} for $\alpha$ and $\beta$ we obtain \[ \theta_x \phi_x \frac{\alpha_{[z^\star,x]}\beta_{[z^\star,x]}}{\norm{\alpha}_x \norm{\beta}_x} = \theta_z \phi_z \frac{\alpha_{[x^\star,z]}\beta_{[x^\star,z]}}{\norm{\alpha}_z \norm{\beta}_z} \] for all $x$, $z \in n$. Therefore $\pi_x = \theta_x \phi_x \norm{\alpha\beta}_x / \norm{\alpha}_x\norm{\beta}_x$ solves~\eqref{eq:db} for the weight $\alpha\beta$. \end{proof} We are now ready to prove Theorem~\ref{thm:factorization}. \begin{proof}[Proof of Theorem~\ref{thm:factorization}] Suppose that $\gamma = \alpha\beta$ factorizes as in the theorem. By Lemma~\ref{lemma:invariant}, the $\alpha$- and $\beta$-weighted involutive walks are reversible with respect to invariant distributions proportional to $\alpha_{x^\star} N(\alpha)_x$ and $N(\beta)_x$, respectively. Therefore, by Lemma~\ref{lemma:pointwiseProductReversible}, the $\gamma$-weighted involutive walk is reversible with respect to an invariant distribution proportional to \[ \alpha_{x^\star} N(\alpha)_x N(\beta)_x \times \frac{N(\alpha\beta)_x}{N(\alpha)_xN(\beta)_x} = \alpha_{x^\star} N(\alpha\beta)_x. \] By Theorem~\ref{thm:ergodic}, this invariant distribution is unique. Suppose conversely that the $\gamma$-weighted involutive walk is reversible with respect to an invariant distribution $\pi$. By the hypothesis of Theorem~\ref{thm:factorization} and Theorem~\ref{thm:ergodic}, the chain is irreducible and ergodic, and so this invariant distribution is strictly positive. We must define an atomic weight $\alpha$ so that $\beta$, defined by $\beta = \gamma/\alpha$, is $\star$-symmetric. Taking $y = z^\star$ in~\eqref{eq:db} and rearranging we obtain \begin{equation}\label{eq:db2} \frac{N(\gamma)_{y^\star}}{\pi_{y^\star}} \gamma_{[y,x]}= \frac{N(\gamma)_{x^\star}}{\pi_{x^\star}} \gamma_{[x^\star,y^\star]} \end{equation} for all $x$, $y \in \n$. Noting that the fractions on each side depend only on $y^\star$ and only on $x^\star$, respectively, we are led to define an atomic weight $\alpha$ by $\alpha_{[y,x]} = \frac{\pi_{y^\star}}{N(\gamma)_{y^\star}}$. Now by~\eqref{eq:db2}, \[ \beta_{[y,x]} = \frac{\gamma_{[y,x]}}{\alpha_y} = \frac{N(\gamma)_{y^\star}}{\pi_{y^\star}}\gamma_{[y,x]} = \frac{N(\gamma)_{x^\star}}{\pi_{x^\star}} \gamma_{[x^\star,y^\star]} = \frac{\gamma_{[x^\star,y^\star]}}{\alpha_{y^\star}} = \beta_{[x^\star,y^\star]} \] so $\beta$ is $\star$-symmetric, as required. \end{proof} \section{The $\protect\gammai{c}$-weighted involutive walk}\label{sec:gammaInfinityWalk} \label{sec:gammaInfinite} Let $c \in \mathbb{R}^{>0}$. Recall that $\gammai{c}$ is the weight defined by $\gammai{c}_{[y,x]} = \binom{x}{y}c^{x-y}$ for $y \le x$. Since $N(\gammai{c})_x = (c+1)^x$ we have \begin{equation}\label{eq:Hgammai} H(\gammai{c})_{xy} = \binom{x}{y}\frac{c^{x-y}}{(c+1)^x}.\end{equation} In particular, $H(\gamma^{(1)})$ is the Pascal's Triangle matrix with rows scaled so that it is stochastic. Observe that the eigenvalues of $H(\gammai{c})$, and so the anti-diagonal entries of $P(\gammai{c})$, are $1/(c+1)^d$ for $d \in \ne$. \subsection{Stochastic properties of $P(\protect\gammai{c})$}\label{subsec:gammaInfiniteFactorization} Since $\gammai{c}$ is strictly positive, Theorem~\ref{thm:ergodic} implies that the $\gammai{c}$-weighted involutive walk is irreducible, recurrent and ergodic with a unique invariant distribution. To find the invariant distribution we first show that $\gammai{c}$ is factorizable. (This is motivated by the interpretation of $\gammai{c}$ as a limiting case of the clearly factorizable weights $\gammac{a}{ac}$.) From the required form $\binom{x}{y}c^{x-y} = \alpha_y \beta_{[y,x]}$, where $\beta$ is $\star$-symmetric, we must define $\alpha_y$ so that $\alpha_yx!c^{x-y} / y!(x-y)! $ is invariant under $(x,y) \mapsto (y^\star,x^\star)$. This already holds for $c^{x-y}$ and $(x-y)!$, and similarly to the proof of Theorem~\ref{thm:factorization}, we may cancel $y!$ and introduce the necessary factor of $y^\star!$ by taking $\alpha_y$ proportional to $1/y!(n-1-y)!$. We therefore define $\alpha_y = \binom{n-1}{y}$ as a weight with domain~$n$, and find that \begin{equation}\label{eq:betai} \beta_{[y,x]} = \frac{\binom{x}{y}c^{x-y}}{\binom{n-1}{y}} = \frac{x!y^\star!}{(x-y)!(n-1)!}c^{x-y} \end{equation} is indeed $\star$-symmetric. Theorem~\ref{thm:factorization} now implies that the $\gammai{c}$-weighted involutive walk on $n$ is reversible with unique invariant distribution proportional to $\alpha_{x^\star}N(\gammai{c})_x$; that is \[ \pi_x \propto \binom{n-1}{x} \Bigl( \frac{c+1}{c} \Bigr)^x .\] Explicitly, $\displaystyle \pi_x = \binom{n-1}{x} \frac{(c+1)^x c^{n-1-x}}{(2c+1)^{n-1}}$. \subsection{Spectrum of $\protect\gammai{c}$} We now prove that the eigenvalues of $P(\gammai{c})$ are $(-1)^d/c^d$ for $d \in \ne$ using the condition in Lemma~\ref{lemma:practical}(iii) for $H(\gammai{c})$ to be a binomial transform. Recall from~\eqref{eq:v} that $v(d) \in \mathbb{R}^n$ is the column vector with entries \hbox{$v(d)_x = \binom{x}{d}$}. \begin{lemma}Let $c \in \mathbb{R}^{>0}$. Then \label{lemma:gammaInfiniteEigenvectors} \[ H(\gammai{c}) v(d) = v(d)/(c+1)^d. \] \end{lemma} \begin{proof} Since $H(\gammai{c})_{xy} = \binom{x}{y} \frac{c^{x-y}}{(c+1)^x}$ we have \[ \begin{split} \bigl(H(\gammai{c})v(d)\bigr)_x &= \sum_{y=0}^{n-1} \binom{x}{y}\frac{c^{x-y}}{(c+1)^x} \binom{y}{d} = \binom{x}{d} \frac{c^{x-d}}{(c+1)^x} \sum_{y=0}^{n-1} \binom{x-d}{y-d} \frac{1}{c^{y-d}} \\ &\qquad = \binom{x}{d} \frac{c^{x-d}}{(c+1)^x} \Bigl( 1+\frac{1}{c}\Bigr)^{x-d} = \binom{x}{d}\frac{1}{(c+1)^d} = \frac{v(d)_x}{(c+1)^d} \end{split} \] as required. \end{proof} Hence $H(\gammai{c})$ is the binomial transform $H^{\lambda^{(c)}}$, where $\lambda^{(c)}_d = 1/(c+1)^d$ for each $d \in \ne$, and, by Proposition~\ref{prop:practical}(iii), $P(\gammai{c})$ has eigenvalues $(-1)^d/(c+1)^d$ for $d \in \ne$, as required. This completes the proof of Theorem~\ref{thm:spectrum} for $\gammai{c}$. \section{The $\protect\gammac{a}{b}$-weighted and $\protect\deltac{a'}{b'}$-weighted involutive walks}\label{sec:gamma} We now adopt a similar strategy to the previous section to prove Theorem~\ref{thm:spectrum} for the $\gammac{a}{b}$ and $\deltac{a'}{b'}$ involutive walks. It is convenient in this section to extend this definition of $\gammac{a}{b}$ to define $\gammac{a}{b}_{[y,x]} = \binom{a+y}{y} \binom{b+x-y}{x-y}$ for all $a$, $b \in \mathbb{R}$ and all $x$, $y \in \mathbb{N}$ with $y \le x$. \subsection{Preliminaries on multisubsets}\label{subsec:multisubsets} A combinatorial interpretation of $\gammac{a}{b}$ is helpful and motivates many steps below. Recall that $\binom{m+c-1}{c}$, or equally $(-1)^c \binom{-m}{c}$, is the number of $c$-multisubsets of a set of size $m$, or equivalently, the number of chains $0 \le y_1 \le \ldots \le y_c \le m-1$ in the ordinal $m$. Thus when $a, b \in \mathbb{N}_0$, \[ \scalebox{0.925}{$\displaystyle \gammac{a}{b}_{[y,x]} = \bigl| \bigl\{ (y_1,\ldots, y_a, w_1, \ldots, w_b) : 0 \le y_1\le \ldots \le y_a \le y \le w_1 \le \ldots \le w_b \le x \bigr\} \bigr|$.} \] We write $\smbinom{m}{c}$ for $\binom{m+c-1}{c}$. Note that $\smbinom{m}{c} = \binom{m+c-1}{c} = \binom{m+c-1}{m-1} = \smbinom{c+1}{m-1}$, and so, unlike the normal binomial coefficient, $\smbinom{m}{c}$ is, separately, a polynomial function of both $m$ and $c$. We use this fact repeatedly below to deduce results on $\gammac{a}{b}$ for general $a$, $b \in \mathbb{R}$ from the special cases when $a$, $b \in \mathbb{N}_0$. \begin{lemma}\label{lemma:mbinom} Let $m$, $n \in \mathbb{N}$. \begin{thmlist} \item If $c \in \mathbb{N}_0$ then $\sum_{y=0}^x \smbinom{y+1}{c} = \smbinom{x+1}{c+1}$. \item If $c$, $d \in \mathbb{N}_0$ then $\sum_{x=0}^{n-1} \smbinom{n-x}{c}\smbinom{x+1}{d} = \smbinom{n}{c+d+1}$. \item If $c$, $d \in \mathbb{N}_0$ then $\sum_{y=0}^x \smbinom{x-y+1}{c}\binom{y}{d} = \binom{x+c+1}{c+d+1}$. \item If $c \in \mathbb{N}_0$ then $\sum_{y=0}^x \smbinom{x-y+1}{c} (-1)^y \binom{m}{y} = (-1)^x \binom{m-c-1}{x}$. \end{thmlist} \end{lemma} \begin{proof} For (i) we count $(c+1)$-multisubsets of $\{0,\ldots, x\}$: the $(c+1)$-multisubsets having $y$ as their greatest element are in bijection with the $c$-multisubsets of $\{0,\ldots, y\}$; these are counted by $\smbinom{y+1}{c}$. For (ii), use $\smbinom{n-x}{c} = \smbinom{c+1}{n-x-1}$ to rewrite the left-hand side as $\sum_{x=0}^{n-1} \smbinom{c+1}{n-x-1}\smbinom{d+1}{x}$. This counts the $(n-1)$-multisubsets of the disjoint union of sets of size $c+1$ and $d+1$, and so is $\smbinom{c+d+2}{n-1} = \smbinom{n}{c+d+1}$. For (iii), the non-zero summands occur for $y\ge d$. We rewrite $\binom{y}{d}$ as $\smbinom{y-d+1}{d}$ and apply (ii) to the right-hand side~of \[ \sum_{y=d}^x \mbinom{x-y+1}{c} \mbinom{y-d+1}{d} = \sum_{z=0}^{x-d} \mbinom{x-d+1-z}{c} \mbinom{z+1}{d} \] to get $\smbinom{x-d+1}{c+d+1}$, which is $\binom{x+c+1}{c+d+1}$, as required. Finally for (iv), we use $\smbinom{x-y+1}{c} = \binom{x-y+c}{c} = (-1)^{x-y}\binom{-c-1}{x-y}$ to rewrite the right-hand side as \smash{$(-1)^x \sum_{y=0}^x \binom{-c-1}{x-y} \binom{m}{y}$}; by Vandermonde's convolution this is \smash{$(-1)^x \binom{m-c-1}{x}$}, as required. \end{proof} \subsection{Stochastic properties of $P(\protect\gammac{a}{b})$ and $P(\protect\deltac{a'}{b'})$}\label{subsec:gammaMatrices} The function $\gammac{a}{b}$ factorizes as the product $\alpha^{(a)}\beta^{(b)}$ where $\alpha^{(a)}$ is defined by \smash{$\alpha^{(a)}_y = \binom{y+a}{y}$} and $\beta^{(b)}$ is defined by \smash{$\beta^{(b)}_{[y,x]} = \binom{x-y+b}{x-y}$}. When $a$, $b \in \mathbb{R}^{> -1}$, $\alpha^{(a)}$ is a strictly positive atomic weight and $\beta^{(b)}$ is a strictly positive $\star$-symmetric weight. The weight $\deltac{a'}{b'} = \binom{a'-1}{y}\binom{b'-1}{x-y}$ defined for $a', b' > 1$ has a similar factorization. If $b' \not\in \mathbb{N}$ then the domain of $\deltac{a'}{b'}$ is $\min(\lceil a' \rceil, \lceil b' \rceil)$ and $\deltac{a'}{b'}$ is strictly positive. Otherwise $\deltac{a'}{b'}$ has the potentially larger domain $\lceil a' \rceil$ and \smash{$\deltac{a'}{b'}_{[y,x]} > 0$} if and only if $y-x < b'$. Since $b' \ge 2$, the hypothesis of Theorem~\ref{thm:ergodic} holds. Therefore in all cases the involutive walk is irreducible, recurrent and ergodic with a unique invariant distribution. To find the invariant invariant distributions we use Theorem~\ref{thm:factorization}. The following lemma is required. \begin{lemma}\label{lemma:chainWeightsTotal} Let $x$, $y \in \n$ with $y \le x$. For $a$, $b \in \mathbb{R}$ we have \begin{thmlist} \item $\alphac{a}_{[y,x]} = \smbinom{y+1}{a}$ and $\norm{\alphac{a}}_x = \smbinom{x+1}{a+1}$; \item $\betac{b}_{[y,x]} = \smbinom{x-y+1}{b}$ and $\norm{\betac{b}}_x = \smbinom{x+1}{b+1}$; \item $\gammac{a}{b}_{[y,x]} = \smbinom{y+1}{a} \smbinom{x-y+1}{b}$ and $\norm{\gammac{a}{b}}_x = \smbinom{x+1}{a+b+1}$. \end{thmlist} \end{lemma} \begin{proof} The first parts of (i), (ii) and (iii) are immediate from the definitions. Since $N(\alpha^{(a)})_x$, $N(\beta^{(b)})_x$ and $N(\gammac{a}{b}_x$ are polynomials in $a$ and $b$, it suffices to prove the remaining results when $a$ and $b$ are integral. In this case the normalization factors $N(\alpha^{(a)})_x$ and $N(\beta^{(b)})_x$ follow immediately from Lemma~\ref{lemma:mbinom}(i). For $\gammac{a}{b}$ we have \[ N(\gammac{a}{b})_x = \sum_{y=0}^x \gammac{a}{b}_{[y,x]} = \sum_{y = 0}^x \mbinom{y+1}{a}\mbinom{x-y+1}{b} = \mbinom{x+1}{a+b+1} \] by Lemma~\ref{lemma:mbinom}(ii). \end{proof} Thus $N(\gammac{a}{b})_x = \binom{x+a+b+1}{x}$ and so $N(\gammac{a}{b})_x > 0$ for $x \in n$ if and only if $a+b+2$, \ldots, $a+b+n \not=0$, or equivalently, \begin{equation}\label{eq:HgammaCondition} a+b \not\in \{-2,\ldots, -n\}. \end{equation} We saw after~\eqref{eq:delta} in the introduction that \smash{$\deltac{a'}{b'}_{[y,x]} = (-1)^x \gammac{-a'}{-b'}_{[y,x]}$} for $a'$, $b' \in \mathbb{R}^{> 1}$. Hence $N(\deltac{a'}{b'})_x = (-1)^xN(\gammac{-a}{-b})$. Using that $\smbinom{m}{c} = \smbinom{c+1}{m-1}$, it follows from Lemma~\ref{lemma:chainWeightsTotal}(iii) that \begin{equation}\label{eq:normDelta} N(\deltac{a'}{b'})_x = \binom{(a'-1)+(b'-1)}{x}. \end{equation} Hence as expected from~\eqref{eq:HgammaCondition}, $N(\deltac{a'}{b'})_x > 0$ whenever $x \in n$ and $n$ is in the domain of $\deltac{a'}{b'}$. By Theorem~\ref{thm:factorization}, if $a$, $b \in \mathbb{R}^{>-1}$, the unique invariant distribution for the $\gammac{a}{b}$-weighted involutive walk on $n$ is proportional to $\alphac{a}_{n-1-x} N(\gammac{a}{b})_x$. Therefore, by Lemma~\ref{lemma:chainWeightsTotal}, it is $\pi$ where \begin{equation}\label{eq:gammaInvariant} \pi_x \propto \mbinom{n-x}{a} \mbinom{x+1}{a+b+1}. \end{equation} The normalization factor for $\pi$ is $\smbinom{n}{2a+b+2}$ by Lemma~\ref{lemma:mbinom}(ii). Similarly for $\deltac{a'}{b'}$, by~\eqref{eq:normDelta}, the unique invariant distribution on $n$, for $n$ in the domain of $\deltac{a'}{b'}$ is $\phi$, where \begin{equation}\label{eq:deltaInvariant} \phi_x \propto \binom{a'-1}{x} \binom{(a'-1)+(b'-1)}{x}. \end{equation} Rewriting the first binomial coefficient as \smash{$\binom{a'-1}{a'-1-x}$} and applying Vandermonde's convolution, we see that the normalization factor for $\phi$ is \smash{$\binom{2a'+b'-3}{n-1}$}. (This may also be obtained by substituting $-a'$ for $a$ and $-b'$ for $b$ in the normalization factor for $\pi$.) \subsection{Spectrum of $P(\protect\gammac{a}{b})$ and $P(\protect\deltac{a'}{b'})$}\label{sec:gammaSpectrum} To complete the proof of Theorem~\ref{thm:spectrum}, we must show that the eigenvalues of these transition matrices are as claimed. Again we deal with the two families in a uniform way using that \begin{equation}\label{eq:HgammaDelta} H(\gammac{-a'}{-b'}) = H(\deltac{a'}{b'}).\end{equation} Whenever~\eqref{eq:HgammaCondition} holds, the eigenvalues of $H(\gammac{a}{b})$ are its diagonal entries $\gammac{a}{b}_{[x,x}]/N(\gammac{a}{b})_x$. By Lemma~\ref{lemma:chainWeightsTotal}(iii), these are $\lambda_0^{(a,b)}, \ldots, \lambda_{n-1}^{(a,b)}$ where \begin{equation}\label{eq:chainEigenvalues} \lambdac{a}{b}{d} = \mbinom{d+1}{a} / \mbinom{d+1}{a+b+1}. \end{equation} The following lemma, analogous to Lemma~\ref{lemma:gammaInfiniteEigenvectors}, reveals the eigenvectors and, as in \S\ref{sec:gammaInfinite}, verifies the condition in Lemma~\ref{lemma:practical}(iii) for $H(\gammac{a}{b})$ to be a binomial transform. Recall from~\eqref{eq:v} that $v(d) \in \mathbb{R}^n$ is the column vector with entries \hbox{$v(d)_x = \binom{x}{d}$}. \begin{lemma}\label{lemma:Htransform} Let $a$, $b \in \mathbb{R}$ and let $n \in \mathbb{N}$ be such that $a+b \not\in \{-2,\ldots, -n\}$. Then \[ H(\gammac{a}{b}) v(d) = \frac{\smbinom{d+1}{a}}{\smbinom{d+1}{a+b+1}} v(d). \] \end{lemma} \begin{proof} We have \begin{equation}\label{eq:Ha} \bigl( H(\gammac{a}{b}) v(d) \bigr)_x =\sum_{y=0}^x \mbinom{y+1}{a}\!\mbinom{x-y+1}{b}\!\binom{y}{d} / \!\mbinom{x+1}{a+b+1}\!. \end{equation} When $a$, $b \in \mathbb{N}_0$, by $\binom{y+a}{a}\binom{y}{d} = \binom{a+d}{a}\binom{y+a}{a+d}$ and an instance of Lemma~\ref{lemma:mbinom}(iii), the numerator on the right-hand side is \begin{align*} \sum_{y=0}^x \binom{y+a}{a}\binom{y}{d} \mbinom{x-y+1}{b} &= \binom{a+d}{a} \sum_{y=0}^x \binom{y+a}{a+d}\mbinom{x-y+1}{b} \\ & = \binom{a+d}{a} \binom{x+a+b+1}{a+b+d+1}. \end{align*} We now use $\binom{x+a+b+1}{a+b+d+1} / \smbinom{x+1}{a+b+1} = \binom{x+a+b+1}{a+b+d+1} / \binom{x+a+b+1}{a+b+1} = \binom{x}{d} / \binom{a+b+d+1}{a+b+1}$ to find that the right-hand side of~\eqref{eq:Ha} is \begin{align*} \binom{a+d}{a} \binom{x}{d} / \binom{a+b+d+1}{a+b+1} &= \binom{x}{d} \mbinom{d+1}{a} / \mbinom{d+1}{a+b+1} \\ &= v(d)_x \mbinom{d+1}{a} / \mbinom{d+1}{a+b+1}. \end{align*} This proves the equality claimed in the lemma when $a$, $b \in \mathbb{N}_0$, and since, by multiplying through by the non-zero quantities $N(\gammac{a}{b})_x$ and $\smbinom{d+1}{a+b+1}$ each side becomes polynomial in $a$ and $b$, it holds for all claimed~$a$ and $b$. \end{proof} Hence $H(\gammac{a}{b})$ is the binomial transform $H^{\lambda^{(a,b)}}$ where $\lambda^{(a,b)}_d$ is as defined in~\eqref{eq:chainEigenvalues}. By Proposition~\ref{prop:practical}(iii), $P(\gammac{a}{b})$ and $P(\deltac{a'}{b'})$ have the required eigenvalues. This completes the proof of Theorem~\ref{thm:spectrum} for $\gammac{a}{b}$ and $\deltac{a'}{b'}$. \subsubsection*{Second largest eigenvalue} Since \[ \frac{\lambdac{a}{b}{d}}{\lambdac{a}{b}{d+1}} = \frac{\binom{d+a-1}{d-1} / \binom{d+a+b}{d-1}}{\binom{d+a}{d} / \binom{d+a+b+1}{d}} = \frac{d}{d+a} \frac{d+a+b+1}{d} = \frac{a+b+1+d}{a+d} \] the sequence of eigenvalues of $P(\gammac{a}{b})$ is decreasing in absolute value. The same holds for $P(\deltac{a'}{b'})$ rewriting the right-hand side as $(a'+b'-d-1)/(a'-d)$. The ratio above also implies that $\lambdac{a}{b}{d} \rightarrow 0$ as $d \rightarrow \infty$. The rate of convergence of the involutive walk is controlled by the second largest eigenvalue (in absolute value) of $P(\gammac{a}{b})$, namely $\lambdac{a}{b}{1} = (a+1)/(a+b+2)$; for $P(\deltac{a}{b})$, the rewriting $(a'-1)/\bigl((a'-1)+(b'-1)\bigr)$ is most convenient. \subsection{Eigenvectors of $P(\protect\gammac{a}{b})$}\label{subsec:eigenvectors} We now explore the spectral behaviour of $P(\gammac{a}{b})$ when $a$, $b \in \mathbb{R}^{> -1}$ in more detail. By a basic result on reversible transition matrices, the right-eigenvectors of the $n \times n$ matrix $P(\gammac{a}{b})$ are orthogonal with respect to the inner product on $\mathbb{R}^n$ defined by \[ \bigl\langle v, w \bigr\rangle = \sum_{x=0}^{n-1} \pi_x v_x w_x \] where $\pi_x = \smbinom{n-x}{a} \smbinom{x+1}{a+b+1} / \smbinom{n}{2a+b+2}$ is the invariant distribution in~\eqref{eq:gammaInvariant}. For $0 \le d < n$, let $\rP{d} \in \mathbb{R}^n$ be the right-eigenvector of $P(\gammac{a}{b})$ with eigenvalue $(-1)^d\lambdac{a}{b}{d}$, normalized with respect to $\langle \ , \ \rangle$. By Proposition~\ref{prop:practical}(iii), $\rP{d} \in \langle v(0), \ldots, v(d) \rangle$ for $0 \le d < n$. Therefore $\rP{0}, \ldots, \rP{n-1}$ are the Gram--Schmidt orthonormalizations of $v(0)$, \ldots, $v(n-1)$, with respect to $\langle \ , \ \rangle$. Since the eigenvalues $(-1)^d\lambdac{a}{b}{d}$ of $P(\gammac{a}{b})$ are distinct, we also have \[ \rP{e} \in \bigl\langle \prod_{d=0}^{e-1} \bigl( P(\gammac{a}{b}) - (-1)^d\lambdac{a}{b}{d} \bigr) v(e) \bigr\rangle \] for $0 \le e < n$. Using either of these observations the right-eigenvectors can be computed for any particular $n$. In particular, a routine calculation shows that $\rP{1}_x \propto (a+b+2)(n-1) -(2a+b+3)x$. The left-eigenvectors can be obtained using the following lemma; we include a proof for completeness and to motivate Definition~\ref{defn:H} below. \begin{lemma}\label{lemma:leftRight} Let $P$ be the transition matrix of a finite reversible Markov chain with strictly positive invariant distribution proportional to $\pi$. Let $v \in \mathbb{R}^n$ and let $u \in \mathbb{R}^n$ be defined by $u_x = \pi_x v_x$. Then $v$ is a right-eigenvector for $P$ with eigenvalue $\lambda$ if and only if $u$ is a left-eigenvector for $P$ with eigenvalue $\lambda$. \end{lemma} \begin{proof} We have \[ (u P)_y = \sum_{x} u_x P_{xy} = \sum_{x} v_x \pi_x P_{xy} = \sum_{x} v_x\pi_y P_{yx} = \pi_y \sum_{x} v_x P_{yx} \] where the penultimate equality uses the detailed balance equation $\pi_x P_{xy} = \pi_y P_{yx}$. Now $v$ is a right-eigenvector for $P$ with eigenvalue $\lambda$ if and only if the right-hand side is $\lambda \pi_y v_y$ for each $y$. Since $u_y = \pi_y v_y$ and $\pi_y > 0$, this holds if and only if $u$ is a left-eigenvector for $P$ with eigenvalue $\lambda$. \end{proof} Remarkably, the left-eigenspace of $P(\gammac{a}{b})$ for the final eigenvalue, namely $\lambdac{a}{b}{n-1} = (-1)^{n-1} \smbinom{n}{a} / \smbinom{n}{a+b+1}$ does not depend on either $a$ or $b$; up to signs, it is a row of Pascal's Triangle. \begin{proposition}\label{prop:finalLeftEigenvector} Let $u_x = (-1)^x \binom{n-1}{x}$. Then for all $a$, $b \in \mathbb{R}^{> -1}$ we have $u P(\gammac{a}{b}) = (-1)^{n-1} \smbinom{n}{a} / \smbinom{n}{a+b+1} u$. \end{proposition} \begin{proof} By Lemma~\ref{lemma:chainWeightsTotal}(iv), $P(\gammac{a}{b} )_{xy^\star} = H(\gammac{a}{b})_{xy}$. Hence $\bigl(uP(\gammac{a}{b})\bigr)_{y^\star} = (-1)^{n-1}\smbinom{n}{a} / \smbinom{n}{a+b+1} u_{y^\star}$ if and only if \begin{equation}\label{eq:finalLeftEigenvectorCalculation} \sum_{x=y}^{n-1} \frac{ \smbinom{y+1}{a}\smbinom{x-y+1}{b}}{\smbinom{x+1}{a+b+1}} (-1)^x \binom{n-1}{x} = \frac{\smbinom{n}{a}}{\smbinom{n}{a+b+1}} (-1)^{y^\star} \binom{n-1}{y^\star}.\end{equation} Observe that when $a$, $b \in \mathbb{N}$, we have $\binom{n-1}{x} / \smbinom{x+1}{a+b+1} = \binom{n-1}{x} / \binom{x+a+b+1}{a+b+1} = \binom{n+a+b}{x+a+b+1} / \binom{n+a+b}{a+b+1} = \binom{n+a+b}{n-1-x} / \smbinom{n}{a+b+1}$. Clearing denominators this becomes a polynomial identity, so it holds for all $a$, $b \in \mathbb{R}^{> -1}$. Setting $w = n-1-y$, we use this to rewrite the left-hand side as \[ \frac{\smbinom{y+1}{a}}{\smbinom{n}{a+b+1}} \sum_{w=0}^{n-1-y} \mbinom{n-w-y}{b} \binom{n+a+b}{w} (-1)^{n-1-w}. \] By an instance of Lemma~\ref{lemma:mbinom}(iv), this is $\smbinom{y+1}{a} (-1)^{n-1-y} \binom{n+a-1}{n-1-y}/ \smbinom{n}{a+b+1}$. Now observe that \[ \mbinom{y+1}{a} \binom{n+a-1}{n-1-y} = \binom{y+a}{a} \binom{n-1+a}{y+a} = \mbinom{n}{a} \binom{n-1}{y} \] which since $\binom{n-1}{y} = \binom{n-1}{y^\star}$ gives the relevant factors in the right-hand side of~\eqref{eq:finalLeftEigenvectorCalculation}. \end{proof} The corollary for the right-eigenvectors of $P(\gammac{a}{b})$ is worth noting. \begin{corollary} Let $a$, $b \in \mathbb{R}^{> -1}$. Then \[ \rP{n-1}_x \propto (-1)^x \binom{n-1}{x} \bigl/ \mbinom{n-x}{a} \mbinom{x+1}{a+b+1}. \] \end{corollary} \begin{proof} This is immediate from Lemma~\ref{lemma:leftRight} and the invariant distribution in~\eqref{eq:gammaInvariant}. \end{proof} In particular, if $a=0$ then from \[ \binom{n+b}{x+b+1} \mbinom{x+1}{b+1} = \binom{n+b}{x+b+1} \binom{x+b+1}{b+1} = \binom{n+b}{b+1} \binom{n-1}{y} \] we see that \smash{$\rP{n-1}_x \propto (-1)^x \binom{n+b}{x+b+1}$}. A slightly more lengthy argument shows that if $a=1$ then \smash{$\rP{n-1}_x \propto (-1)^{x}\binom{n+b+2}{x+b+2}$}. However there do not appear to be such `division-free' formulae for higher $a$, or general $a \in \mathbb{R}^{> -1}$. We return to these eigenvectors in \S\ref{subsec:discreteContinuous}. \subsection{The involutive walk on subsets and proof of Corollary~\ref{cor:subsets}} Let $0 < p < 1$. The $\gammac{-(1-p)}{-p}$-weighted involutive walk on $\{0,1\}$ has transition matrix \[ Q = \left( \begin{matrix} \cdot & 1 \\ p & 1-p \end{matrix} \right). \] By special cases of Theorem~\ref{thm:factorization} and Theorem~\ref{thm:spectrum} the invariant distribution is $\left( \mfrac{p}{1+p}, \mfrac{1}{1+p} \right)$ and the eigenvalues are $1$ and $-p$. Observe that $Q$ is the transition matrix of the random walk in Corollary~\ref{cor:subsets} when $m=1$; the empty set corresponds to $0 \in \{0,1\}$ and $\{1\}$ to $1 \in \{0,1\}$. Generally, if $P$ is the matrix of an involutive walk on $n$ and $P'$ is the matrix of an involutive walk on $n'$ then, indexing the entries of $P \otimes P'$ by the ordinal product $n \times n'$, we have $(P \otimes P')_{(x,x'),(z,z')} = P_{(x,z)}P_{(x',z')}$, and so $P \otimes P'$ is the transition matrix of the random walk on $n \times n'$ in which, starting from $(x, x')$, we choose $(y,y')$ with $y \in [x]$, $y' \in [x']$ with probability $P_{(x,y^\star)}P_{(x',{y'}^\star)}$ and then step to $(y^\star, {y'}^\star)$. It is easily seen that if the random walks on $n$ and on $n'$ are irreducible, reversible, recurrent and ergodic then so is the random walk on $n \times n'$. In particular, the involutive walk on subsets of $\{1,\ldots, m\}$ in Corollary~\ref{cor:subsets} has all these properties. Its transition matrix $Q^{\otimes m}$ and so its unique invariant distribution $\pi$ is \smash{$\left( \mfrac{p}{1+p}, \mfrac{1}{1+p} \right)^{\raisebox{-4pt}{$\scriptstyle \otimes m$}}$}; by the identification at the end of the previous paragraph we have $\pi_X = \bigl( \mfrac{p}{1+p} \bigr)^{m-|X|} \bigl( \mfrac{1}{1+p} \bigr)^{|X|}$ for each $X \subseteq \{1,\ldots, m\}$. Therefore $\pi_X = p^{m-|X|}/(1+p)^m$ as claimed. It is easily seen, either directly or by Proposition~\ref{prop:finalLeftEigenvector}, that the left-eigenvector of~$Q$ with eigenvalue $-p$ is $(1,-1)$. Therefore the $(-p)^e$-eigenspace is spanned by all $m$-fold tensor products of $(p,1)$ and $(1,-1)$ and has dimension $\binom{m}{e}$. This completes the proof of Corollary~\ref{cor:subsets}. \section{When is a binomial transform stochastic?} \label{sec:stochastic} Given a sequence $\lambda_0$, \ldots, $\lambda_{n-1}$ of real numbers, recall from~\eqref{eq:HL} that $\DS^\lambda$ denotes the binomial transform $B(n)\mathrm{Diag}(\lambda_0,\ldots,\lambda_{n-1})B(n)^{-1}$. By Theorem~\ref{thm:GB}, an $n \times n$ matrix has global anti-diagonal eigenbasis action if and only if it is equal to some $\DS^\lambda$, and, by Theorem~\ref{thm:OchiaiEtAl}, this property also characterises generic matrices with the global anti-diagonal eigenvalue property. We have defined $P^\lambda = \DS^\lambda J(n)$ to be the anti-triangular matrix obtained from~$H^\lambda$. In this section we determine when $P^\lambda$ is stochastic, and, supposing that $P^\lambda$ is stochastic, when the involutive walk it defines is ergodic. The introduction discusses the connection with the results on half-infinite matrices in \cite{OchiaiEtAl}. Our approach, using the following two lemmas, is more elementary. \begin{lemma}\label{lemma:binomialTransformRecurrence} Let $\lambda_0, \ldots, \lambda_{n-1} \in \mathbb{R}$ and let $x, y \in \n$ with $x < n-1$. If $x \ge y$ then \[ \DS^\lambda_{x+1,y}\binom{x+1}{y}^{-1}\!\! = \DS^\lambda_{xy}\binom{x}{y}^{-1}\!\! - \DS^\lambda_{x+1,y+1}\binom{x+1}{y+1}^{-1}\!\!.\] \end{lemma} \begin{proof} Let $k = x-y \in \mathbb{N}_0$. By Lemma~\ref{lemma:practical}(iv), the coefficient of $\lambda_{y+e}$ in $\DS^\lambda_{xy}\binom{x}{y}^{-1}$, $\DS^\lambda_{x+1,y+1}\binom{x+1}{k}^{-1}$ and $\DS^\lambda_{x+1,y}\binom{x+1}{y}^{-1}$ is $(-1)^e \binom{k}{e}$, $(-1)^{e-1} \binom{k}{e-1}$ and $(-1)^e \binom{k+1}{e}$ respectively, for $e \in \{1,\ldots,n-1-y\}$; for $e=0$ the coefficient is $1$, $0$ and $1$, respectively. The lemma therefore follows from the basic identity $\binom{k}{e} + \binom{k}{e-1} = \binom{k+1}{e}$ for $e\in\{1,\ldots, k\}$. \end{proof} \begin{lemma}\label{lemma:nonNegative} Let $\lambda_0, \ldots, \lambda_{n-1} \in \mathbb{R}$. Then \begin{thmlist} \item $\DS^\lambda$ is non-negative if and only if its bottom row is non-negative; \item if $\DS^\lambda$ is non-negative and $\DS^\lambda_{xy} = 0$ then $\DS^\lambda_{x'y'} = 0$ for all $x'$, $y' \in n$ with $x'-x \ge y'-y$. \item $\DS^\lambda_{x+1,x} = \binom{x+1}{x}(\lambda_x - \lambda_{x+1})$ for all $x \in \{0,1,\ldots, n-2\}$; \item if $\DS^\lambda$ is non-negative and $\lambda_t = \lambda_{t+1}$ then $\lambda_t = \ldots = \lambda_{n-1}$. \end{thmlist} \end{lemma} \begin{proof} As a technical tool, we define $F^\lambda$ to be the lower-triangular $n \times n$ matrix with entries $F^\lambda_{xy} = \DS^\lambda_{xy}\binom{x}{y}^{-1}$ for $x \ge y$ and $F^\lambda_{xy} = 0$ for $x < y$. By Lemma~\ref{lemma:binomialTransformRecurrence}, the entries of $F$ satisfy the recurrence \[ F^\lambda_{x+1,y} = F^\lambda_{xy} - F^\lambda_{x+1,y+1}. \] Hence if $F^\lambda_{xy} < 0$ then either $F^\lambda_{x+1,y} < 0$ or $F^\lambda_{x+1,y+1} < 0$. Thus a negative entry in row $x$ of $F^\lambda$ implies a negative entry in row $x+1$ of $F^\lambda$. It follows that~$F^\lambda$ is non-negative if and only if its bottom row is non-negative, and the same holds for $\DS^\lambda$. This proves~(i). Suppose that $\DS^\lambda$ is non-negative and that $\DS^\lambda_{xy} = 0$. Then $F^\lambda_{xy} = 0$ and by the recurrence relation, $F^\lambda_{x+1,y} = F^\lambda_{x+1,y+1} = 0$. It follows that $H^\lambda_{x'y'} = 0$ for all $x' \ge x$ and $y' \ge y$ with $x' - x \ge y' - y$, proving (ii). Part (iii) also follows from the recurrence, using that $F^\lambda_{xx} = \lambda_x$. If $\lambda_t = \lambda_{t+1}$ then, by (iii),~$F^\lambda_{t+1,t} = 0$, and so by (ii), $F^\lambda_{x+1,x} = 0$ for all $x \ge t$. Hence, by another use of (iii), $\lambda_x = \lambda_{x+1}$ for all $x \ge t$, as required. \end{proof} \setcounter{theorem}{5} \setcounter{section}{1} \begin{corollary}\corollaryBinomialTransform \end{corollary} \setcounter{theorem}{2} \setcounter{section}{6} \begin{proof} By Lemma~\ref{lemma:practical}(iv), $H^\lambda_{n-1,y} = \sum_{e=0}^{y} (-1)^e \binom{n-1-y}{e} \lambda_{z^\star + e}$. Since this is the entry in column $y^\star$ of the bottom row of $P^\lambda$, it follows from Lemma~\ref{lemma:nonNegative}(i) that $P^\lambda$ is non-negative if and only if $\sum_{e=0}^{z^\star} (-1)^e \binom{z}{e} \lambda_{z^\star + e} \ge 0$ for all \hbox{$z \in n$}. Moreover, by Lemma~\ref{lemma:nonNegative}(iv), if strict inequality holds for all $z \in n$ then $\lambda_0 > \lambda_1 > \ldots > \lambda_{n-1}$ and, by Lemma~\ref{lemma:nonNegative}(ii), $P^\lambda$ has strictly positive entries in all positions below its anti-diagonal. Recall that $v(0) \in \mathbb{R}^n$ is the all-ones vector. By Lemma~\ref{lemma:practical}(ii), $\DS^\lambda v(0) = \lambda_0 v(0)$. Therefore~$\DS^\lambda$, and hence $P^\lambda$, has all row sums equal to $1$ if and only if $\lambda_0 = 1$. \end{proof} Either by taking a linear combination of the inequalities in this corollary, or more directly from Lemma~\ref{lemma:nonNegative}(iii), it follows that if $P^\lambda$ is a transition matrix then $\lambda_0 \ge \lambda_1 \ge \ldots \ge \lambda_{n-1}$, and so the below-diagonal entries of $\binom{x+1}{x}(\lambda_x-\lambda_{x+1})$ are non-negative. Similarly, from the entries below these, we get the convexity property $(\lambda_{x-1} + \lambda_{x+1})/2 \ge \lambda_{x}$ for all $x \in n$ such that $1 \le x < n-1$. As mentioned in the introduction, the full condition in Corollary~\ref{cor:binomialTransformIsInvolutiveWalk} implies that the eigenvalues are completely monotonic. This is of course the case for the eigenvalues $\lambdac{a}{b}{d}$ of the matrices $P(\gammac{a}{b})$, $P(\gammai{c})$ and $P(\deltac{a'}{b'})$. Since these transition matrices are of irreducible ergodic walks, it is natural to ask, more generally, when is the involutive walk defined by~$P^\lambda$ irreducible and ergodic? This has a neat answer, although the proof, using the following proposition, is unavoidably somewhat technical. \begin{proposition}\label{prop:PLergodic} Suppose that $P^\lambda$ is the transition matrix of an involutive walk in which $0$ is accessible from all states. Let $s \in \mathbb{N}$ be maximal such that $\lambda_{n-s} = \ldots = \lambda_{n-1}$. Then $s \le n/2$ and $1 > \lambda_1 > \ldots > \lambda_{n-s-1} > \lambda_{n-s} = \ldots = \lambda_{n-1} > 0$ and the walk is irreducible, recurrent and ergodic with a unique strictly positive invariant distribution. \end{proposition} \begin{proof} By Corollary~\ref{cor:binomialTransform}, $\lambda_0 = 1$. Since $0$ can be reached in one step only from $n-1$, and $P^\lambda_{n-1,0} = \DS^\lambda_{n-1,n-1} = \lambda_{n-1}$, we have $\lambda_{n-1} > 0$. Hence, by Lemma~\ref{lemma:nonNegative}(iii) and (iv), $\lambda_0 > \lambda_1 > \ldots > \lambda_{n-s-1} > \lambda_{n-s} = \ldots = \lambda_{n-1} > 0$. By Lemma~\ref{lemma:nonNegative}(iii), $\DS^\lambda_{n-s+1,n-s} = \binom{n-s+1}{n-s} (\lambda_{n-s} - \lambda_{n-s+1}) = 0$. Hence, by Lemma~\ref{lemma:nonNegative}(ii), $\DS^\lambda_{xy} = 0$ for all $x \ge n-s+1$, $y \ge n-s$ with $x - (n-s+1) \ge y - (n-s)$. Thus if $y > n-1-s$ then column $y$ of $\DS^\lambda$ is zero except for its diagonal entry $\lambda_y$. Since $s^\star = n-1-s$, it follows that if $y > s^\star$ then column $y$ of~$\DS^\lambda$ has a unique non-zero entry of $\lambda_{y}$ in row~$y$. Suppose, for a contradiction, that $s > n/2$. If $n$ is even, with $n=2m$ then $s^\star < m-1$, and the unique non-zero entries of $H^\lambda$ in columns $m-1$ and $m$ are on the diagonal. Thus from $m-1$ the involutive walk must step to $(m-1)^\star = m$, and from $m$ it must step to $m^\star = m-1$, contradicting that~$0$ is accessible from any state. Similarly, if $n$ is odd, with $n=2m+1$ then $s^\star < m$ and from $m$ the involutive walk must step to $m^\star = m$. Therefore~$s \le n/2$. Again by Lemma~\ref{lemma:nonNegative}(iii), $\DS^\lambda_{s^\star+1,s^\star} = \DS^\lambda_{n-s,n-s-1} = (n-s)(\lambda_{n-s-1} -\lambda_{n-s}) > 0$. By Lemma~\ref{lemma:binomialTransformRecurrence}, \[ H^\lambda_{x,s^\star} \binom{x}{s^\star}^{-1}\!\!\! = H^\lambda_{x-1,s^\star} \binom{x-1}{s^\star}^{-1} \!\!\! - H^\lambda_{x,s^\star+1} \binom{x}{s^\star +1}^{-1}\!\! = H^\lambda_{x-1,s^\star} \binom{x-1}{s^\star}^{-1}\!\! \] for $x > s^\star$. It follows inductively that all the entries on or below the diagonal in column $s^\star$ of $H^\lambda$ are non-zero. To summarise so far, we have shown that the down-steps $x \mapsto x$ for $x \in n$, $x \mapsto x-1$ for $x \in \{1,\ldots, s^\star+1\}$ and $n-1 \mapsto s^\star$ have non-zero probability. Moreover, since $s^\star + 1 - s = (n-1-s) + 1 - s = n - 2s \ge 0$, we have $s \le s^\star + 1$. It is now routine to check that there is a cycle in the involutive walk \[ n-1 \mapsto s \;\raisebox{0.5pt}{\mylongmapsto{\quad}} s^\star+1 \mapsto s-1 \;\raisebox{0.5pt}{\mylongmapsto{\quad}} s^\star + 2 \mapsto \ldots \;\raisebox{0.5pt}{\mylongmapsto{\quad}} n-2 \mapsto 1 \;\raisebox{0.5pt}{\mylongmapsto{\quad}} n-1 \] where bold arrows indicate the steps whose down-step is $x \mapsto x-1$. Observe that $t-1$ appears two steps before $t$ for each $t \in \{s^\star +2, \ldots, n-1\}$. Therefore $t-1$ is accessible from $t$ for each such $t$. Since the step $x \mapsto x^\star$ has non-zero probability for all $x$, it follows that $(t-1)^\star$ is accessible from $t$ for each $t \in \{s^\star +2, \ldots, n-1\}$. Since the step $x \mapsto (x-1)^\star$ has positive probability for each $x \in \{1,\ldots,s^\star + 1\}$ the hypothesis of Lemma~\ref{lemma:longWalk} holds. Therefore the involutive walk is irreducible. Moreover, as in the proof of Theorem~\ref{thm:ergodic}, the step $m \mapsto m$ where $m = \lfloor n/2 \rfloor$ has non-zero probability. Hence the chain is aperiodic and ergodic with a unique strictly positive invariant distribution. \end{proof} \begin{corollary}\label{cor:PLergodic} Suppose that $P^\lambda$ is the transition matrix of an involutive walk. Then $0$ is accessible from all states if and only if the walk is irreducible, recurrent and ergodic with a unique strictly positive invariant distribution. \end{corollary} \begin{proof} The `only if' direction is proved by Proposition~\ref{prop:PLergodic}. Conversely, if the walk is irreducible then $0$ is accessible. \end{proof} \section{Binomial transforms and reversibility} \label{sec:reversibility} Recall that $P^\lambda = H^\lambda J(n)$ where $H^\lambda$ is the binomial transform defined in~\eqref{eq:HL}. By Theorem~\ref{thm:spectrum} and the remark following~\eqref{eq:HL}, the $\gammac{a}{b}$-, $\deltac{a'}{b'}$- and $\gammai{c}$-weighted involutive walks on $n$ are reversible for any $n$ in their domain and their transition matrices are of the form $P^\lambda$. This proves the `if' direction of Theorem~\ref{thm:reversibleImpliesGamma}. The converse is the surprising part and is proved in this section. Our starting hypothesis is that $n \ge 3$ and $P^\lambda$ is a globally reversible (see Definition~\ref{defn:globallyReversible}) $n \times n$ transition matrix of an involutive walk in which $0$ is accessible from every state. The corresponding down-step matrix $\DS^\lambda$ is a binomial transform, as in~\eqref{eq:HL}, with eigenvalues $\lambda_0, \ldots, \lambda_{n-1}$. By Corollary~\ref{cor:binomialTransform}, $\lambda_0 = 1$. Throughout, we let $\mu = \lambda_1$ and $\nu = \lambda_2$. If $\mu = 1$ then by Lemma~\ref{lemma:nonNegative}(iii), $\DS^\lambda_{10} = 0$, and so by Lemma~\ref{lemma:nonNegative}(iii) and (iv) it follows that $P^\lambda = J(n)$. This contradicts the assumption that $0$ is accessible from every state. Hence \[ \tag{$\dagger$} 1 > \mu \ge \nu \ge \lambda_3 \ge \ldots \ge \lambda_{n-1} \ge 0. \] Since the down-step matrices $H(\gammac{a}{b})$, $H(\deltac{a'}{b'})$ and $H(\gammai{c})$ are binomial transforms, We have the following key principle: if $\gamma$ is the relevant weight $\gammac{a}{b}$, $\gammai{c}$ or $\deltac{a'}{b'}$ and $\lambda_d(\gamma) = H(\gamma)_{dd}$ for $d \in \{0,\ldots,n-1\}$ then \[ P^\lambda = P(\gamma) \iff \text{\parbox{3in}{\raggedright for all $d \in \ne$, the eigenvalue $\lambda_d$ of $H^\lambda$ is equal to the eigenvalue $\lambda_d(\gamma)$ of $H(\gamma)$.}} \tag{$\star$} \] It is therefore important that the eigenvalues $\mu$ and $\nu$ determine the parameters $a$ and $b$. By~\eqref{eq:evaluesIntroduction},~($\star$)~requires \begin{equation}\label{eq:munu} \frac{a+1}{a+b+2} = \mu, \quad \frac{(a+1)(a+2)}{(a+b+2)(a+b+3)} = \nu. \end{equation} Provided $\nu \not= \mu^2$, these equations have the unique solution specified by the functions \begin{equation}\label{eq:abEqns} a(\mu, \nu) = \frac{\mu(\mu-\nu)}{\nu-\mu^2} - 1, \quad b(\mu, \nu) = \frac{(1-\mu)(\mu-\nu)}{\nu-\mu^2} - 1. \end{equation} This gives some motivation for the overall strategy of the proof, which is by induction on $n$, using the global reversibility hypothesis to show that the three greatest eigenvalues $1, \mu, \nu$ of $H^\lambda$ determine all $n$ eigenvalues $\lambda_0, \ldots, \lambda_{n-1}$, and hence that the right-hand side in~($\star$)\ holds. We structure the argument as follows: \S\ref{subsec:rKolmogorov} gives a version of Kolmogorov's Criterion adapted to involutive walks; \S\ref{subsec:rbase} proves Theorem~\ref{thm:reversibleImpliesGamma} when $n=3$, and motivates \S\ref{subsec:rinductive} where we formulate the stronger Proposition~\ref{prop:reversibleImpliesGamma}; finally in \S\ref{subsec:rproof} we prove this proposition by induction on $n$, using Kolmogorov's Criterion on a particular $4$-cycle, dealing with the case $\nu = 2\mu-1$, when this cycle has zero probability, separately. \subsection{Kolmogorov's Criterion}\label{subsec:rKolmogorov} One form of Kolmogorov's Criterion (see for instance \cite[\S 1.5]{KellyReversibilityStochasticNetworks}) is that a random walk with a strictly positive invariant distribution is reversible if and only if the product of transition probabilities around any cycle does not depend on the direction of travel. The special case for involutive walks is stated in (ii) below. \begin{lemma}\label{lemma:reversibilityCriteria} Let $P$ be the transition matrix of an involutive walk with strictly positive invariant distribution. \begin{thmlist} \item If the walk is reversible then for all $x$, $z \in n$, we have $P_{xz} > 0$ if and only if $P_{zx} > 0$. \item The walk is reversible if and only~if \[ P_{x_0x_1}P_{x_1x_2}\ldots P_{x_{\ell-1}x_0} = P_{x_0x_{\ell-1}} \ldots P_{x_2x_1} P_{x_1x_0} \] for all distinct $x_0, x_1, \ldots, x_{\ell-1} \in n$ with $\ell \ge 3$, such that $x_i + x_{i+1} \ge n-1$ for all $i \in \{0,1,\ldots, \ell-2\}$, and $x_{\ell-1} + x_0 \ge n-1$. \end{thmlist} \end{lemma} \begin{proof} From the detailed balance equations $\pi_x P_{xz} = \pi_z P_{zx}$ we get $P_{xz} > 0$ if and only if $P_{zx} > 0$, proving (i). Since $P_{xz} = 0$ unless $x + z \ge n-1$, it suffices to verify Kolmogorov's Criterion for cycles of the form $x_0 \mapsto x_1 \mapsto x_2 \mapsto \ldots \mapsto x_{\ell-1} \mapsto x_0$ where $x_i + x_{i+1} \ge n-1$ for all~$i \in \{0,1,\ldots, \ell-2\}$ and $x_{\ell-1} + x_0 \ge n-1$. This is trivial for $2$-cycles, so we may suppose that $\ell \ge 3$, giving~(ii). \end{proof} \subsection{Base case: $n=3$}\label{subsec:rbase} If $\nu > \mu^2$ then defining $a$ and $b$ by~\eqref{eq:abEqns} we have $a$, $b \in \mathbb{R}^{> -1}$ and the eigenvalues of $\DS^\lambda$ and $H(\gammac{a}{b})$ agree, so by~($\star$), $\DS^\lambda = H(\gammac{a}{b})$. If $\nu = \mu^2$ then $\mu < 1$ by ($\dagger$), and so by~($\star$), $H^\lambda = H(\gammai{c})$ where $1/(c+1) = \mu$, or equivalently, $c = \frac{1-\mu}{\mu}$. In the remaining case $\nu < \mu^2$ and again defining $a$ and $b$ by~\eqref{eq:abEqns} we have $a$, $b < -1$. By either Lemma~\ref{lemma:practical}(iv) or Lemma~\ref{lemma:binomialTransformRecurrence}, \[ H^\lambda = \left(\begin{matrix} 1 & \cdot & \cdot \\ 1-\mu & \mu & \cdot \\ 1-2\mu + \nu & 2(\mu-\nu) & \nu \end{matrix} \right) \] and so $\nu \ge 2\mu-1$. Moreover, since $0$ is accessible from all states, $\nu > 0$. Setting $\nu =2\mu-1+\tau(1-\mu)$ we have $\mu-\nu = (1-\mu)(1-\tau)$ and $\mu-\nu^2 = (1-\mu)(1-\mu - \tau)$, hence $(1-\mu)(\mu-\nu)/(\nu-\mu^2) = -(1-\mu)(1-\tau)/(1-\mu-\tau)$ where $1-\mu-\tau > 0$ and \[ -b\bigl( \mu,2\mu-1+\tau(1-\mu)\bigr) = 2 + \frac{\mu \tau}{1-\mu - \tau}, \] for $0 \le \tau < 1-\mu$. Similar calculations show that \[ -a\bigl( \mu, 2\mu-1+\tau(1-\mu) \bigr) = \frac{1 - \tau- \mu\tau}{1 - \tau - \mu}.\] Comparing the numerator and denominator immediately above we see that $-a\bigl( \mu, 2\mu-1+\tau(1-\mu) \bigr)$ is an increasing function of $\tau$ with minimum $\mfrac{1}{1-\mu}$ when $\tau = 0$. Since $\nu > 0$ we have $\mu > \mfrac{1}{2}$ and so $a' > 2$. Moreover, when $\tau = 0$, we have $b' = 2$ as in the final case of Theorem~\ref{thm:reversibleImpliesGamma}. Otherwise $\tau > 0$ and $b' > 2$, again as required. This completes the proof of the `only if' direction when $n=3$. \subsection{Inductive claim}\label{subsec:rinductive} To enable an inductive proof, we must prove a stronger version of Theorem~\ref{thm:reversibleImpliesGamma} that takes into account that the exceptional case $\nu = 2\mu-1$ and $a'=\mfrac{1}{1-\mu}$ is the first in an infinite family. To motivate the statement of Proposition~\ref{prop:reversibleImpliesGamma}, observe that if $m \in \mathbb{N}$ then \smash{$\deltac{a'}{m}_{[y,x]} = \binom{a'-1}{y}\binom{m-1}{x-y}$} vanishes if and only if $x-y \ge m$. Thus \emph{provided $n \ge m$}, the transition matrix $P(\deltac{a'}{m})$ has exactly $m$ non-zero anti-diagonal bands. This was seen, when $m=2$, in one of the examples before Theorem~\ref{thm:spectrum}, and also in the base case just proved, for which $-b(\mu, \nu) = b(\mu, 2\mu-1) = 2$ and $\mu > \mfrac{1}{2}$. Therefore we may assume $\mu > 1/2$ when finding these exceptional cases. Let $b'_\mu(\nu) = -b(\mu, \nu)$ and note that \[ \frac{\mathrm{d}b'_\mu(\nu)}{\mathrm{d}\nu} = \frac{\mu(1-\mu)^2}{(\mu^2-\nu)^2}.\] Thus $b'_\mu$ is increasing on the interval $[0,\mu^2)$, with $b'_\mu(0)= \mfrac{1}{\mu}$ and $b'_\mu(\nu) \rightarrow \infty$ as $\nu \rightarrow \mu^2$. Since $\mu > \mfrac{1}{2}$, for each $m \in \mathbb{N}$ with $m \ge 2$ there exists a unique~$\nu$ such that $b'_\mu(\nu) = m$. We denote this value by $\nu_m(\mu)$. Let $a'_m(\nu) = -a(\mu, \nu_m(\mu))$. By inverting $b'_\mu$ and then substituting one gets the explicit formulae \begin{equation}\label{eq:mMu} \nu_m(\mu) = \frac{\mu(m\mu-1)}{m-2+\mu}, \quad a'_m(\mu) = \frac{(m-2)\mu +1}{1-\mu}.\end{equation} \noindent In particular, $\nu_2(\mu) = 2\mu-1$ and $a'_2(\mu) = \mfrac{1}{1-\mu}$, as seen in the case $n=3$. Since $b'_\mu$ is an increasing function, so is the sequence $\nu_m(\mu)$. Moreover, since $b'_\mu(\nu) \rightarrow \infty$ as $\nu \rightarrow \mu^2$, the sequence $\nu_m(\mu)$ converges to $\mu^2$ as $m \rightarrow \infty$. This can be seen in the graph in Figure~1 showing $a(\mfrac{2}{3},\nu)$ and $b(\mfrac{2}{3}, \nu)$ and the exceptional values $\nu_m(\mfrac{2}{3})$ for $m \in \{2,3,4,5,6\}$. \begin{figure} \begin{center}\setlength{\unitlength}{1cm} \begin{picture}(5,5.5) \put(-1,0) {\includegraphics[width=3.5in]{Figure1abFunctions.pdf}} \put(5.6,5) {$\scriptstyle a(\mfrac{2}{3}, \nu)$} \put(4.1,5) {$\scriptstyle b(\mfrac{2}{3}, \nu)$} \put(-1.2,3.7) {$\scriptstyle 0$} \put(-1.35,3.1) {$\scriptstyle -1$} \put(-1.35,2.525) {$\scriptstyle -2$} \put(-1.35,1.95) {$\scriptstyle -3$} \put(-1.35,1.375) {$\scriptstyle -4$} \put(-1.35,0.8) {$\scriptstyle -5$} \put(-1.35,0.225) {$\scriptstyle -6$} \put(3.35,3.4) {$\sfrac{1}{3}$} \put(4.17,3.4) {$\sfrac{2}{5}$} \put(4.35,3.4) {$\sfrac{5}{12}$} \put(4.45,4.05) {$\sfrac{1\hskip-0.5pt4}{3\hskip-0.5pt3}$} \put(4.7,3.4) {$\sfrac{3}{7}$} \end{picture} \end{center} \caption{The functions $a(\mfrac{2}{3},\nu)$ and $b(\mfrac{2}{3}, \nu)$ for $0 \le \nu \le 2/3$ and the exceptional values $\nu_m(\mfrac{2}{3})$ for $m \in \{2,3,4,5,6\}$, namely $\mfrac{1}{3}, \mfrac{2}{5}, \mfrac{4}{12}, \mfrac{14}{33}, \mfrac{3}{7}$. Each has a vertical asymptote at $(\mfrac{2}{3})^2$.} \end{figure} Instead fixing $m$, the relevant values of~$n$ are given the lemma below, which shows that the chosen domains of $\deltac{a'}{b'}$ for $b' \not\in \mathbb{N}$ and $\deltac{a'}{b'}$ for $b' \in \mathbb{N}$ specified after~\eqref{eq:delta} are as large as possible. \begin{samepage} \begin{lemma}\label{lemma:deltaDomainSimplified} Let $a'$, $b' \in \mathbb{R}^{>1}$. \begin{thmlist} \item If $b' \not\in \mathbb{N}$ then the function $\deltac{a'}{m}$ on intervals of $n$ is a weight such that $0$ is accessible from every state in the $\deltac{a'}{b'}$-weighted involutive walk if and only if $n \le \min( \lceil a' \rceil, \lceil b' \rceil)$ and no larger domain is possible. \item Suppose that $b' = m \in \mathbb{N}$. The function $\deltac{a'}{m}$ on intervals of $n$ is a weight such that $0$ is accessible from every state in the $\deltac{a'}{m}$-weighted involutive walk if and only if $n \le \lceil a' \rceil$. Moreover, $m \ge \lfloor \mfrac{1-\mu}{\mu} (n-2) \rfloor + 2$, where $\mu$ is the usual eigenvalue. \end{thmlist} \end{lemma} \end{samepage} \begin{proof} By~\eqref{eq:delta}, $\deltac{a'}{m}_{[y,x]} = \binom{a'-1}{y}\binom{b'-1}{x-y}$. Thus if $n > \lceil a' \rceil$ then $\deltac{a'}{b'}_{[n-1, n-1]}$ is either negative, contrary to the definition of weight, or zero, implying that $(n-1)^\star = 0$ is inaccessible from $n-1$, and so inaccessible from any state. Similarly, if $b' \not\in \mathbb{N}$ then taking $n > \lceil b' \rceil$ we find that $\deltac{a'}{b'}_{[0,n-1]}$ is negative. Thus the largest possible domain is $\min(\lceil a' \rceil, \lceil b'\rceil)$, as claimed. When $b' \in \mathbb{N}$, as in (ii), there is no constraint from $\binom{b'-1}{x-y}$, and so the largest domain is instead~$\lceil a' \rceil$. To complete the proof, we use the equation for $a'_m(\mu)$ in~\eqref{eq:mMu} to get $n \le \lceil \frac{(m-2)\mu +1}{1-\mu} \rceil$. Hence \smash{$n < \frac{(m-2)\mu+1}{1-\mu} + 1$}, and so $(1-\mu)n < (m-2)\mu + 2 - \mu$ which rearranges to \smash{$m > \mfrac{1-\mu}{\mu}n - \mfrac{2}{\mu} + 3 = \mfrac{1-\mu}{\mu} (n-2) +1$}, or equivalently, $m \ge \lfloor \frac{1-\mu}{\mu}(n-2) \rfloor + 2$. \end{proof} We can now state our precise result, knowing that all the transition matrices specified are well-defined and give involutive walks in which $0$ is accessible from every state; the condition $\mu > \mfrac{1}{2}$ in (iv) was seen when $n=3$ in the proof of the base case. \begin{proposition}\label{prop:reversibleImpliesGamma} Let $P^\lambda$ be the transition matrix of a reversible Markov chain on $n$ where $n\ge 3$ in which $0$ is accessible from every state. Then $\lambda_0= 1$. Let $\mu = \lambda_1$, $\nu = \lambda_2$. One of the following cases applies. \begin{thmlist} \item If $\nu > \mu^2$ then $\mu > \nu$ and the unique $a$, $b \in \mathbb{R}^{> -1}$ such that $P^\lambda = P(\gammac{a}{b})$ are $a(\mu, \nu)$ and $b(\mu, \nu)$. \item If $\nu = \mu^2$ then $\mu < 1$ and $P^\lambda= P(\gammai{c})$ where $c = (1-\mu)/\mu$. \item If $\nu_{n-1}(\mu) < \nu < \mu^2$ then the unique $a'$, $b' \in \mathbb{R}^{>1}$ such that $P^\lambda = P(\deltac{a'}{b'})$ are $-a(\mu, \nu)$ and $-b(\mu, \nu)$ and $n \le \min(\lceil a' \rceil, \lceil b' \rceil)$. \item Otherwise, $\mu > \mfrac{1}{2}$, $\nu = \nu_m(\mu)$ for a unique $m \in n$ such that $m \ge \lfloor \mfrac{1-\mu}{\mu} (n-2) \rfloor + 2$ and the unique $a' \in \mathbb{R}^{> 1}$ such that $P^\lambda = P(\deltac{a'}{m})$ is $a'_m(\nu)$. Moreover $n \le \lceil a'_m(\nu) \rceil$ and $P(\deltac{a'}{m})$ has exactly $m$ anti-diagonal bands where $m < n$. \end{thmlist} \end{proposition} The example below shows the interesting behaviour in (iii) and~(iv). \begin{example}\label{ex:reversibleSpectrum} Take $n=10$. As in Figure~1, we take $\mu = \mfrac{2}{3}$. A special feature of this case is that $a'_m(\mu) = 2m-1$ is integral. By (iii) and~(iv) in Proposition~\ref{prop:reversibleImpliesGamma}, either $\nu > \nu_9(\mfrac{2}{3}) = \mfrac{10}{23}$, or $\nu$, $a'$, $b'$ are in the table below. \medskip \begin{center} \begin{tabular}{cccccc} \toprule $\nu$ & $\mfrac{10}{23}$ & $\mfrac{13}{30}$ & $\mfrac{22}{51}$ & $\mfrac{3}{7}$ \\ $a' = a'(\mfrac{2}{3}, \nu)$ & 17 & 15 & 13 & 11 \\ $b' = m $ & 9 & 8 & 7 & 6 \\ \bottomrule \end{tabular} \end{center} \smallskip \noindent By (iv), or equivalently Lemma~\ref{lemma:deltaDomainSimplified}, we require $m \ge \lfloor \frac{1-\mu}{\mu} (n-2) \rfloor + 2 = \mfrac{n}{2} + 1 = 6$, and so the table stops with $m=6$. The next entry, were it permitted, would be $\nu = \mfrac{14}{45}$, $a'=9$, $b'=5$, but $9 \not> 10-1$, and correspondingly $10$ is not in the domain of the weight $\deltac{9}{5}$. Thus when $n=10$, the reversible random walks with second largest eigenvalue~$\mfrac{2}{3}$ classified in Proposition~\ref{prop:reversibleImpliesGamma} split into a continuously varying family when $\mfrac{4}{9} < \nu < \mfrac{2}{3}$, a one-off case when $\nu = \mfrac{4}{9}$, a continuously varying family when $\mfrac{10}{23} < \nu < \mfrac{4}{9}$, and final special cases for $\nu = \mfrac{10}{23}, \mfrac{13}{30}, \mfrac{22}{51}, \mfrac{3}{7}$, in which the transition matrix has respectively $9$, $8$, $7$ and~$6$ non-zero anti-diagonal bands. To illustrative the inductive step in the proof of Proposition~\ref{prop:reversibleImpliesGamma} suppose we increase $n$ to~$11$. Then we require either $\nu > \nu_{10}(\mfrac{2}{3}) = \mfrac{17}{39}$ or $\nu = \mfrac{17}{39}$, $a' = 19$, $m = 10$, losing the cases where $\mfrac{10}{23} < \nu < \mfrac{17}{39}$ for $n=10$. \end{example} \enlargethispage{6pt} \subsection{Proof of Proposition~\ref{prop:reversibleImpliesGamma}}\label{subsec:rproof} \subsubsection*{Case $\nu = 2\mu-1$} In this case $P^\lambda$ has just two non-zero anti-diagonals. We exploit this in the proof. \begin{lemma}\label{lemma:nuLeast} Let $n \ge 3$. If $\nu = 2\mu-1$ then $\DS^\lambda= H(\deltac{\sfrac{1}{1-\mu}}{2})$ and \emph{(iv)} in Proposition~\ref{prop:reversibleImpliesGamma} holds with $m=2$. \end{lemma} \begin{proof} It follows either directly from~\eqref{eq:delta} or using~Lemma~\ref{lemma:binomialTransformRecurrence}, that the matrix $H(\deltac{\sfrac{1}{1-\mu}}{2})$ has entries \begin{equation}\label{eq:DSdelta2} H(\deltac{\sfrac{1}{1-\mu}}{2})_{xy} = \begin{cases} x\mu - (x-1) & \text{if $x=y$} \\ x(1-\mu) & \text{if $x= y+1$} \\ 0 & \text{otherwise.} \end{cases} \end{equation} When $n=3$, this has the same eigenvalues, namely $1$, $\mu$, $2\mu -1$ as $\DS^\lambda$, and so the matrices are equal by~($\star$), and by the base case, $\mu > \mfrac{1}{2}$. Suppose inductively that~($\star$)\ holds for $n-1$. Thus the $n \times n$ matrix $P^\lambda$ has top-right $(n-1) \times (n-1)$ submatrix \smash{$P(\deltac{\sfrac{1}{1-\mu}}{2})$}. In particular, $\lambda_x = x\mu - (x-1)$ for $x \in n-1$ and, by~\eqref{eq:DSdelta2}, we have $\DS^\lambda_{n-3,0} = H(\deltac{\sfrac{1}{1-\mu}}{2})_{n-3,0} = 0$. Hence $P^\lambda_{n-3,n-1} = 0$ and using the reversibility hypothesis, it follows from Lemma~\ref{lemma:reversibilityCriteria}(i) that $P^\lambda_{n-1,n-3} = 0$. But by Lemma~\ref{lemma:practical}(iv), \[ P^\lambda_{n-1,n-3} = \binom{n-1}{n-3} (\lambda_{n-3} - 2\lambda_{n-2} + \lambda_{n-1}).\] Therefore \[ \bigl( (n-3)\mu - (n-4) \bigr) - 2\bigl( (n-2)\mu - (n-3) \bigr) + \lambda_{n-1} = 0 \] which simplifies to $-(n-1)\mu + (n-2) + \lambda_{n-1} = 0$. Hence $\lambda_{n-1} = (n-1)\mu - (n-2)$ which is \smash{$\lambdac{\sfrac{1}{1-\delta}}{2}{n-1}$} by~\eqref{eq:DSdelta2}. Therefore by~($\star$), \smash{$P^\lambda = P(\deltac{\sfrac{1}{1-\mu}}{2})$}. Thus $a' = \mfrac{1}{1-\mu} = a'_2(\nu)$. Moreover, by Lemma~\ref{lemma:deltaDomainSimplified}, $2 > \lfloor \mfrac{1-\mu}{\mu} (n-2) \rfloor + 2$. Hence $\mfrac{1-\mu}{\mu}(n-2) < 1$ which implies $n-1 < \mfrac{1}{1-\mu}$, hence $n \le \lceil a'_2(\nu) \rceil$, giving the final requirement for (iv). \end{proof} \subsubsection*{Inductive step} Finally we are ready to prove Proposition~\ref{prop:reversibleImpliesGamma}. Suppose that $n \ge 4$. By induction and the global reversibility hypothesis, there is a weight $\gamma$ of the required binomial type such that $\DS^\lambda$ agrees with $H(\gamma)$ except perhaps in its bottom row. Moreover, the parameters for $\gamma$ (namely~$a$ and~$b$ when $\gamma=\gammac{a}{b}$, $c$ when $\gamma = \gammai{c}$ and $a'$, $b'$ when $\gamma = \deltac{a'}{b'}$) are unique. Restricting further to the top-right $3 \times 3$ submatrix, the base case implies that $\mu > \nu \ge 2\mu - 1$. If $\nu = 2\mu - 1$ then we are done by Lemma~\ref{lemma:nuLeast}. Therefore we may assume that $1 > \mu > \nu > 2\mu - 1$. Consider the $4$-cycle \[ n-1 \mapsto 1 \mapsto n-2 \mapsto 2 \mapsto n-1. \] (If $n=4$ then instead take the $3$-cycle $3\mapsto 1 \mapsto 2 \mapsto 3$ obtained by deleting the repeated vertex $2$.) By the version of Kolmogorov's Criterion in Lemma~\ref{lemma:reversibilityCriteria}(ii), and the hypothesis that $P^\lambda$ is reversible, we have \begin{equation} \label{eq:cycle1} P^\lambda_{n-1,1}P^\lambda_{1,n-2}P^\lambda_{n-2,2}P^\lambda_{2,n-1} = P^\lambda_{n-1,2}P^\lambda_{2,n-2}P^\lambda_{n-2,1}P^\lambda_{1,n-1}. \end{equation} (This holds when $n=4$ since we have simply introduced an extra term of $P^\lambda_{2,2}$.) By the inductive assumption $P^\lambda_{xz} = P(\gamma)_{xz}$ for all $x \in n-1$. Moreover by Theorem~\ref{thm:spectrum} each $\gamma$-weighted involutive walk is reversible, and so~\eqref{eq:cycle1} holds when every $P^\lambda_{xz}$ is replaced with $P(\gamma)_{xz}$. That is, \begin{equation} \label{eq:cycle1a} \begin{split} P(\gamma)_{n-1,1}P(\gamma)_{1,n-2}&P(\gamma)_{n-2,2}P(\gamma)_{2,n-1} \\ &= P(\gamma)_{n-1,2}P(\gamma)_{2,n-2}P(\gamma)_{n-2,1}P(\gamma)_{1,n-1}. \end{split} \end{equation} Let $q$ be the common value in~\eqref{eq:cycle1a}. Note that $q \not= 0$, since $\mu > 2\nu-1$ and so $\gamma$ is not the exceptional weight $\deltac{\sfrac{1}{1-\mu}}{2}$, the matrix $P(\gamma)$ has at least $3$ non-zero anti-diagonals and all terms in the product are non-zero. Thus \begin{align*} P^\lambda_{1,n-2}P^\lambda_{n-2,2}P^\lambda_{2,n-1} &= P(\gamma)_{1,n-2}P(\gamma)_{n-2,2}P(\gamma)_{2,n-1} = q/P(\gamma)_{n-1,1} \\ P^\lambda_{2,n-2}P^\lambda_{n-2,1}P^\lambda_{1,n-1} &= P(\gamma)_{2,n-2}P(\gamma)_{n-2,1}P(\gamma)_{1,n-1} = q/P(\gamma)_{n-1,2}. \end{align*} By Lemma~\ref{lemma:practical}(iv), we have $P^\lambda_{n-1,1} = \binom{n-1}{1}(\lambda_{n-2}-\lambda_{n-1})$ and $P^\lambda_{n-1,2} = \binom{n-1}{2}(\lambda_{n-3}-2\lambda_{n-2} + \lambda_{n-1})$. Again the analogous equation holds for $P(\gamma)$. Moreover, by the induction hypothesis and~($\star$), $\lambda_x = \DS^\lambda_{xx} = H(\gamma)_{xx} = \lambda_x(\gamma)$ for $x \in n-1$. Therefore we obtain another pair of equations \begin{align*} P^\lambda_{n-1,1} &= P(\gamma)_{n-1,1} - \binom{n-1}{1}\bigl( \lambda_{n-1} - \lambda_{n-1}(\gamma) \bigr) \\ P^\lambda_{n-1,2} &= P(\gamma)_{n-1,2} + \binom{n-1}{2}\bigl( \lambda_{n-1} - \lambda_{n-1}(\gamma) \bigr). \end{align*} Writing $\Delta$ for $\lambda_{n-1} - \lambda_{n-1}(\gamma)$ and making the substitutions in~\eqref{eq:cycle1} indicated by the four displayed equations above we obtain \[ \bigl( P(\gamma)_{n-1,1} - (n-1) \Delta \bigr) \frac{q}{P(\gamma)_{n-1,1}} = \bigl( P(\gamma)_{n-1,2} + \binom{n-1}{2}\Delta \bigr) \frac{q}{P(\gamma)_{n-1,2}}. \] Using that $P(\gamma)_{n-1,z} = \gamma_{[z^\star,n-1]}/N(\gamma)_{n-1}$ and cancelling all common terms, including $N(\gamma)_{n-1}$, we obtain \[ -(n-1) \frac{\Delta}{\gamma_{[n-2,n-1]}} = \binom{n-1}{2} \frac{\Delta}{\gamma_{[n-3,n-1]}} \] or equivalently \begin{equation}\label{eq:cycle2} \bigl( (n-1) \gamma_{[n-3,n-1]} + \binom{n-1}{2} \gamma_{[n-2,n-1]} \bigr) \Delta = 0. \end{equation} If $\gamma$ is the weight $\gammai{c}$ then $\gammai{c}_{[y,n-1]} = \binom{n-1}{y} c^{n-1-y}$ and so~\eqref{eq:cycle2} becomes \smash{$(n-1)\binom{n-1}{2}c \bigl(c-1) \Delta = 0$}. Since $c > 1$, we have $\Delta = 0$. Hence $\lambda_{n-1} = \lambda(\gammai{c})_{n-1}$ and by~($\star$)\ we get (ii) in Proposition~\ref{prop:reversibleImpliesGamma}. If $\gamma$ is the weight $\gammac{a}{b}$ then $\gammac{a}{b}_{[y,n-1]} = \binom{a+y}{y} \binom{b+n-1-y}{n-1-y}$ and so~\eqref{eq:cycle2} becomes \[ \Bigl( (n-1) \binom{a+n-3}{n-3}\binom{b+2}{2} + \binom{n-1}{2} \binom{a+n-2}{n-2}\binom{b+1}{1} \Bigr) \Delta = 0. \] Using $\binom{m+1}{c+1} = \binom{m}{c} \frac{m+1}{c+1}$ this simplifies to \[ \mfrac{1}{2} \bigl( (n-1) \binom{a+n-3}{n-3} \binom{b+1}{1} \Bigl( \frac{b+2}{2} + \frac{n-2}{2} \frac{a+n-2}{n-2}\Bigr) \Delta = 0,\] and hence to $(a+b+n) \Delta = 0$. Since $a$, $b \in \mathbb{R}^{> -1}$ and $n \ge 4$, again we get $\Delta = 0$, and by~($\star$)\ we get~(i). Finally suppose that $\gamma$ is the weight $\deltac{a'}{b'}$ and so $\gamma_{[y,n-1]} = \binom{a'-1}{y}\binom{b'-1}{n-1-y}$. Substituting in~\eqref{eq:cycle2} we get \[ \Bigl( (n-1) \binom{a'-1}{n-3}\binom{b'-1}{2} + \binom{n-1}{2} \binom{a'-1}{n-2}\binom{b'-1}{1} \Bigr)\Delta =0 \] which simplifies by $\binom{m}{c+1} = \binom{m}{c} \mfrac{m-c}{c+1}$ to \[ (n-1) \binom{a'-1}{n-3} \binom{b'-1}{1} \Bigl( \frac{b'-2}{2} + \frac{n-2}{2} \frac{a'-n+2}{n-2} \Bigr) \Delta = 0 \] and hence to $(a'+b'-n)\Delta = 0$. In either inductive case we have $a' \ge n-1$ and $b' \ge 2$, hence $a'+b' - n > 0$ and so $\Delta = 0$. By~($\star$)\ we get $P^\lambda = P(\deltac{a'}{b'})$. Since $0$ is accessible from every state, Lemma~\ref{lemma:deltaDomainSimplified} implies that $n \le \lceil a' \rceil$. If the inductive case is~(iv) then~(iv) still holds: $\mu > \mfrac{1}{2}$, $\nu = \nu_m(\mu)$ and $a' = a'_m(\mu)$ are inductive assumptions, and $m \ge \lfloor \mfrac{1-\mu}{\mu} (n-2) \rfloor + 2$ and $n \le \lceil a'_m(\nu) \rceil$ follow from Lemma~\ref{lemma:deltaDomainSimplified}. Finally suppose the inductive case is~(iii), so $\nu_{n-2}(\mu) < \nu < \mu^2$. If we have the stronger inequality $\nu_{n-1}(\mu) < \nu$ then~(iii) still holds. In the remaining case (iii) holds with $\nu_{n-2}(\mu) < \nu \le \nu_{n-1}(\mu)$. Since $b'_\mu$ is an increasing function of $\nu$, we have $n-2 < b' \le n-1$. If $n-2 < b' < n-1$ then \smash{$\deltac{a'}{b'}_{[0,n-1]} = \binom{b'-1}{n-1} < 0$} contradicts that $P(\deltac{a'}{b'})$ is equal to the stochastic matrix $P^\lambda$. Therefore $b' = n-1$, $\nu = \nu_{n-1}(\mu)$ and $a' = a'_{n-1}(\mu)$. (This is the case where $P(\deltac{a'_{n-1}(\mu)}{n-1})$ has $n-1$ non-zero anti-diagonal bands and a zero in its bottom right corner.) By Lemma~\ref{lemma:deltaDomainSimplified}, $n-1 > \mfrac{1-\mu}{\mu}n + 2 - \mfrac{1}{\mu}$. If $\mu \le \mfrac{1}{2}$ then the right-hand side is at least $n$, a contradiction. Therefore $\mu > \mfrac{1}{2}$ and we have shown that (iv) holds. This completes the proof. \section{The involutive walk on $[0,1]$}\label{sec:Hilbert} We now turn to involutive walks defined on the real interval $[0,1] = \{x \in \mathbb{R} : 0 \le x \le 1\}$ with its usual order and anti-involution $x^\star = 1 -x$. From now on $[y,x]$ denotes a subinterval of $[0,1]$. \begin{definition}\label{defn:realWeight} A \emph{real weight} is a function $\gamma$ on the set of non-empty intervals of $[0,1]$ taking values in $\mathbb{R}^{\ge0}$ such that, for each $x \in [0,1]$, the function $y \mapsto \gamma_{[y,x]}$ is continuous and non-zero almost everywhere in $[0,x]$, and $\int_0^x \gamma_{[y,x]} \,\mathrm{d}y < \infty$. \end{definition} Thus a real weight defines a probability distribution on each interval $[0,x]$ having probability density function $\gamma_{[y,x]}/N(\gamma)_x$ where $N(\gamma)_x = \int_0^x \gamma_{[y,x]} \, \mathrm{d} y$. The positivity assumption in the definition makes these weights the analogue of the strictly positive discrete weights in Definition~\ref{defn:weight}. We define \emph{atomic} and \emph{$\star$-symmetric} for real weights as in this definition. The $\gamma$-weighted involutive walk on $[0,1]$ is defined as in Definition~\ref{defn:involutiveWalk}, replacing $\{0,1,\ldots,n-1\}$ with $[0,1]$. \subsection{Invariant distributions} \begin{proposition}\label{prop:invariantFactorReal} Let $\alpha$ be an atomic real weight and let $\beta$ be a $\star$-symmetric real weight. Suppose that $\int_0^1 \alpha_{1-x} N(\alpha \beta)_x\,\mathrm{d}x < \infty$. Then the $\alpha\beta$-weighted involutive walk on $n$ is reversible with respect to an invariant distribution proportional to $\alpha_{1-x} N(\alpha \beta)_x$. \end{proposition} \begin{proof} It is routine to solve the detailed balance equation using essentially the same arguments used to prove Lemma~\ref{lemma:invariant} and Lemma~\ref{lemma:pointwiseProductReversible}. \end{proof} The integrability assumption in the lemma is essential. \begin{example}\label{ex:realWeight} Let $a \in \mathbb{R}$ with $a > 0$. Let $\alpha_{[y,x]} = 1/y^a(1-y)^{a+1}$ and let $\beta_{[y,x]} = y^a (1-x)^a$ for $0 < y \le x$. Observe that $\alpha$ and $\beta$ are real weights and that $\alpha$ is atomic and $\beta$ is $\star$-symmetric. Let $\gamma = \alpha\beta$, so $\gamma_{[y,x]} = (1-x)^a/(1-y)^{a+1}$. We have \[ N(\gamma)_x = \int_0^x \frac{(1-x)^a}{(1-y)^{a+1}} \, \mathrm{d} y = \frac{1}{a} \bigl( 1- (1-x)^{a} \bigr)\] hence $\gamma$ is a real weight. However \[ \alpha_{1-x}N(\gamma)_{x} = \frac{1}{a x^{a+1}}\Bigl(\frac{1}{(1-x)^a} -1 \Bigr) \] is not integrable on any interval containing $1$, and not integrable on any interval containing $0$ whenever $a \ge 1$. \end{example} For the remainder of this section, let $\theta : [0,1] \rightarrow \mathbb{R}^{\ge 0}$ be the function proportional to the invariant distribution defined by $\theta_x = \alpha_{1-x} N(\alpha)_x$. Note that, by Definition~\ref{defn:realWeight}, $\theta_x$ is non-zero almost everywhere. Given Example~\ref{ex:realWeight}, we also assume that $\sqrt{\theta_x}$ is in the Hilbert space $\L^2[0,1]$ of square-integrable functions on $[0,1]$. \subsection{Hilbert spaces}\label{subsec:Hilbert} In this section we describe a setting in which the analogues of left- and right-multiplication by the transition matrix for a discrete involutive walk are compact linear operators on Hilbert space. Our~\S\ref{subsec:eigenvectors} and \cite{BoydDiaconisParriloXiao} suggest the correct inner-product spaces in which to work. Let $\alpha$ be an atomic real weight and let $\beta$ be a $\star$-symmetric real weight. Define $K:[0,1]^2 \rightarrow \mathbb{R}$ by \begin{equation}\label{eq:K} K(x,z) = [x+z\ge 1]\frac{\sqrt{\alpha_{1-z}}\sqrt{\alpha_{1-x}} \beta_{[1-z,x]}}{\sqrt{N(\alpha\beta)_{z}} \sqrt{N(\alpha\beta)_x}} \end{equation} where $[x+z \ge 1]$ is an Iverson bracket. When $K(x,z) \in \L^2\bigl( [0,1]^2 \bigr)$, the integral operator $M : \L^2([0,1]) \rightarrow \L^2([0,1])$ defined by $(Mf)(x) = \int_0^1 K(x,z) f(z) \, \mathrm{d} z$ is compact. (See for instance \cite[Theorem~8.8]{YoungHilbert}.) Since $K(x,z) = K(z,x)$ for all $x$, $z \in [0,1]$, $M$ is also self-adjoint. \begin{definition}\label{defn:H} Let $\H_L = \{f(x) / \sqrt{\theta_x} : f \in \L^2([0,1])\}$ with inner product $\langle \ , \ \rangle_{\H_L}$ defined by $\langle f, g \rangle = \int_0^1 \theta_x f(x)g(x) \, \mathrm{d} x$. Let $\H_R = \{f(x) \sqrt{\theta_x} : f \in \L^2([0,1])\}$ with inner product $\langle \ , \ \rangle_{\H_R}$ defined by $\langle f, g \rangle = \int_0^1 f(x)g(x)/\theta_x \, \mathrm{d} x$. \end{definition} The maps sending $f \in \L^2([0,1])$ to $f/\sqrt{\theta_x} \in \H_L$ and $f\sqrt{\theta_x} \in \H_R$ are isometric isomorphisms from $\L^2([0,1])$ to $\H_L$ and $\H_R$, respectively. (The first map is well-defined because the zeros of $\theta_x$ form a null-set.) Therefore $\H_L$ and $\H_R$ are Hilbert spaces. Moreover the constant function is in $\H_L$ and, by our integrability assumption, $\theta_x$ is in $\H_R$. The analogues of left- and right-multiplication by the transition matrix are the integral operators $L_P : \H_L \rightarrow \H_L$ and $R_P : \H_R \rightarrow \H_R$ defined by $(L_Pg)(x) = M(g(z) \sqrt{\theta_z})/\sqrt{\theta_x}$ for $g \in \H_L$ and $R_P(g)(z) = M(g(x) / \sqrt{\theta_x}) \sqrt{\theta_z}$ for $g \in \H_R$. (Note we deliberately use different variables: for left-multiplication we integrate over the final state~$z$; for right-multiplication we integrate over the initial state~$x$.) Equivalently, \begin{align} (L_Pg)(x) &= \int_{1-x}^1 \frac{\alpha_{1-z} \beta_{[1-z,x]}}{N(\alpha\beta)_x} g(z)\, \mathrm{d} z \label{eq:LP} \\ (R_Pg)(z) &= \int_{1-z}^1 \frac{\alpha_{1-z} \beta_{[1-z,x]}}{N(\alpha\beta)_x}g(x) \, \mathrm{d} x. \label{eq:RP} \end{align} Since $L_P$ and $R_P$ are conjugate by isometric isomorphisms to the self-adjoint compact operator $M$, they are also self-adjoint and compact, and have the same eigenvalues. We can now give a convenient sufficient condition for the real involutive walk to converge. The proof uses the generalization of the Perron--Frobenius Theorem to operators on Banach spaces. Let $\pi_x = C \theta_x$ be the invariant probability distribution given by Proposition~\ref{prop:invariantFactorReal}. \begin{proposition}\label{prop:ergodicReal} The invariant distribution $\pi_x$ is unique and the $\alpha\beta$-weighted involutive walk started at any probability distribution $\theta \in \H_R$ converges to $\pi_x \in \H_R$. \end{proposition} \begin{proof} The condition in Definition~\ref{defn:realWeight} that $\gamma_{[y,x]} > 0$ for almost all $y \in [0,x]$ implies that if $C$ is the cone in $\mathcal{H}_R$ of non-negative functions then $R_P : C \backslash \{0\} \rightarrow C^\circ$, where $C^\circ$ is the interior of $C$. Hence, by the Krein--Rutman Theorem (see \cite[Theorem 6.3]{KreinRutman}), $1$ is the unique largest eigenvalue (in modulus) of $R_P$, and $\pi_x$ is the unique $1$-eigenfunction. Since $R_P$ is compact and self-adjoint, there is a complete orthonormal basis of $\H_R$ of eigenfunctions; expanding $\theta$ in this basis and then applying $R_P^t$ shows that $R_P^t \theta$ converges, in $\H_R$, to the invariant distribution $\pi$, as $t \rightarrow \infty$. \end{proof} \subsection{Trigonometric example}\label{subsec:trigonometricExample} As an illustrative example, to which we return in the final subsection, we take $\alpha_x = \sin \pi x$ for $x \in [0,1]$ and $\beta_{[y,x]} = 1$ for each non-empty interval $[y,x]$. Note that $\alpha$ and $\beta$ are real weights, $\alpha$ is atomic and $\beta$ is symmetric. We have $N(\alpha)_x = \int_0^x \sin \pi y \,\mathrm{d} y = \mfrac{1}{\pi}(1-\cos \pi x)$. The hypothesis for Proposition~\ref{prop:invariantFactorReal}, that $\sqrt{\theta_x} \in \L^2[(0,1)]$ holds. This proposition implies that the $\alpha$-weighted involutive walk is reversible with invariant distribution proportional to $\theta_x$ where $\theta_x = \alpha_{1-x}N(\alpha)_x = \mfrac{1}{\pi} (\sin \pi x) (1-\cos\pi x) = \mfrac{1}{\pi} \sin \pi x - \mfrac{1}{2\pi} \sin 2\pi x$. Integrating over $[0,1]$, the first summand gives $\frac{2}{\pi^2}$ and the second $0$, hence $\pi_x = \mfrac{\pi}{2} (\sin \pi x)(1-\cos \pi x)$ is an invariant distribution. The kernel $K$ in~\eqref{eq:K} satisfies \[ K(x,z)^2 = [x+z \ge 1] \frac{\sin \pi z \sin \pi x}{(1-\cos \pi x) (1-\cos \pi z)}. \] Using $\sin \alpha / (1-\cos \alpha) = \cot \mfrac{\alpha}{2}$, this simplifies to $K(x,z)^2 = [x+z \ge 1] \cot \mfrac{\pi}{2} z \cot \mfrac{\pi}{2} x$. We have \[ \int_{(x,z) \in [0,1]^2 \atop x + z \ge 1 } \cot \mfrac{\pi}{2} z \cot \mfrac{\pi}{2} x \, \mathrm{d}z \,\mathrm{d}x = \int_0^1 \!\!\int_0^1 x\tan \mfrac{\pi}{2}xu \cot \mfrac{\pi}{2} x \, \mathrm{d}u \, \mathrm{d}x \] by the substitution $1-z = xu$. Since $x \tan \mfrac{\pi}{2} xu \cot \mfrac{\pi}{2} x \le x \tan \mfrac{\pi}{2} x \cot \mfrac{\pi}{2} x = x$, the integrand is bounded. (In fact it is even continuous, except at $(1,1)$.) Therefore $K \in \L^2\bigl( [0,1]^2 \bigr)$ and the general theory in the previous subsection applies. In particular, we may apply Proposition~\ref{prop:ergodicReal} to conclude that $\pi_x$ is the unique invariant distribution for the $\alpha$-weighted involutive walk on $[0,1]$, and that the process converges, in the Hilbert space sense, to the invariant distribution $\pi_x$. We now find the spectra of $L_P$ and $R_P$. In~\S\ref{sec:gammaInfinityWalk} and \S\ref{sec:gamma} we used right-eigenvectors, corresponding to left-multiplication by the transition matrix, and again here it is most convenient to work with $L_P : \H_L \rightarrow \H_L$, defined as in~\eqref{eq:LP} by \[ (L_Pg)(x) = \pi \int_{1-x}^1 \frac{\sin \pi z }{1-\cos \pi x} g(z) \, \mathrm{d} z,\] where $\H_L = \{f(x)/\sqrt{\theta_x} : f \in \L^2([0,1])\}$. For $n \in \mathbb{N}_0$, let $V_n$ be the $n$-dimensional subspace of~$\H_L$ spanned by $1, \cos \pi x$, $\cos 2\pi x$, $\ldots$, $\cos \pi(n-1)x$ and let $V_\infty = \bigcup_{n=0}^\infty V_n$. The image of multiplication by $\sqrt{\pi_x}$ on $\L^2([0,1])$ is dense in $\L^2([0,1])$. (For example, it contains any step function supported on a closed subinterval of $(0,1)$.) Since $\sqrt{2}, \sqrt{2}\cos \pi x, \sqrt{2}\cos 2\pi x, \ldots $ is an orthonormal Hilbert space basis of $\L^2([0,1])$, the set $\sqrt{\pi_x}, \sqrt{\pi_x} \cos \pi x$, $\sqrt{\pi_x} \cos 2\pi x$, $\ldots $ is dense in $\L^2([0,1])$. Hence, dividing by $\sqrt{\pi_x}$, we see that $V_\infty$ is dense in $\H_L$. \begin{lemma}\label{lemma:cosAlt} For any $d \in \mathbb{N}_0$ we have \[ L_P (\cos^d \hskip-0.5pt\pi x) \in \frac{(-1)^d}{d+1} \cos^d \hskip-0.5pt\pi x + V_d. \] \end{lemma} \begin{proof} We have \begin{align*} L_P (\cos^d \hskip-0.5pt \pi x) &= \frac{\pi}{1-\cos \pi x} \int_{1-x}^1 \sin \pi z \cos^d \hskip-0.5pt \pi z \, \mathrm{d} z \\ &= \frac{\pi}{1-\cos \pi x} \frac{-1}{\pi (d+1)} (\cos^{d+1}\hskip-0.5pt \pi z) \Bigr|_{1-x}^1 \\ &= \frac{-1}{d+1} \frac{(-1)^{d+1}- \cos^{d+1} \pi (1-x)}{1- \cos \pi x} \\ &= \frac{(-1)^d}{d+1} \frac{1- \cos^{d+1} \pi x}{1- \cos \pi x} \\ &= (-1)^d \frac{1 + \cos \pi x + \cdots + \cos^d \hskip-0.5pt\pi x}{d+1} \end{align*} as required. \end{proof} Since $\langle 1, \cos \pi x, \ldots, \cos^d \pi x \rangle = \langle 1, \cos \pi x, \ldots, \cos d \pi x \rangle$ for each $d$, it follows that $L_P$ has eigenvalues $(-1)^{d}/(d+1)$ for $d \in \mathbb{N}_0$. Moreover, since $V_\infty$ is dense in $\mathcal{H}_L$, the eigenfunctions form a complete orthonormal basis for~$\mathcal{H}_L$. The convergence of the involutive walk is determined by the second largest eigenvalue (in modulus), namely $-1/2$. \begin{remark} We remark that a similar method to Lemma~\ref{lemma:cosAlt} gives part of the spectrum of $L_P$ whenever $\alpha_{1-x} = \alpha_x$ for all $x \in [0,1]$ and so $\alpha_{1-z} N(\alpha)^d_z$ is the derivative of $\mfrac{1}{d+1} N(\alpha)^{d+1}_z$. But one cannot expect in general that the eigenfunctions obtained in this way will be complete for the Hilbert space~$\H_L$. \end{remark} \section{The polynomially-weighted involutive walk on the interval}\label{sec:intervalWalk} Fix, throughout this section, $a$, $b \in \mathbb{N}_0$. Observe that the weight $\gammac{a}{b} = \binom{y+a}{y} \binom{b+x-y}{x-y}$ defined in~\eqref{eq:gamma} is asymptotically proportional to $y^a (x-y)^b$ when $y$ and $x-y$ are both large. Let $\kappac{a}{b}$ be the real weight defined by \smash{$\kappac{a}{b}_{[y,x]} = y^a (x-y)^b$}. In this section we use the theory from \S\ref{sec:Hilbert} to show that the $\kappac{a}{b}$-weighted involutive walk, is, in a precise sense, the continuous limit of the $\gammac{a}{b}$-involutive walk. In particular, it has a discrete spectrum and its eigenvalues are given by letting~$n$ tend to infinity in Theorem~\ref{thm:spectrum}. We end with some final remarks comparing the discrete and continuous cases. \subsection{Polynomial weights} We begin with the analogues of Lemmas~\ref{lemma:mbinom} and~\ref{lemma:chainWeightsTotal}. Let $P(\kappac{a}{b})_{xz}$ be the probability density of a step from $x$ to $z$. Part (i) below is a standard result related to the beta function which we prove to make the paper more self-contained. \begin{lemma}\label{lemma:ctsBasic} We have \begin{thmlist} \item $\int_0^1 w^a (1-w)^b \d w = (a+b+1)^{-1} \binom{a+b}{a}^{-1}$; \item $N(\kappac{a}{b})_x = x^{a+b+1}(a+b+1)^{-1} \binom{a+b}{b}^{-1}$; \item $\displaystyle P(\kappac{a}{b})_{xz} = [x+z \ge 1](a+b+1)\binom{a+b}{b} \frac{(1-z)^a(x+z-1)^b}{x^{a+b+1}}$ where $[x+z \ge 1]$ is an Iverson bracket. \end{thmlist} \end{lemma} \begin{proof} By integrating $(w + (1-w)t)^c = \sum_{b=0}^c \binom{c}{b} w^{c-b} (1-w)^b t^b$ over $w$ we get \[ \frac{1-t^{c+1}}{(c+1)(1-t)} = \sum_{b=0}^c \binom{c}{b}t^b \int_0^1 w^{c-b} (1-w)^b \d y. \] Since the left-hand side is $\frac{1}{c+1}(1+t + \cdots + t^c)$, (i) follows by setting $c=a+b$ and comparing coefficients of $t^b$. Part (ii) follows from (i) using the change of variables $xw = y$ to write $\int_0^x y^a (x-y)^b \d y = x^{a+b}\! \int_0^1 w^a (1-w)^b x \d w$. Now, starting at~$x \in [0,1]$, we may step to $z \in [0,1]$ if and only if $1-z \le x$; hence \smash{$P(\kappac{a}{b})_{xz} = [1-z \le x] \kappac{a}{b}_{[1-z,x]}/N(\kappac{a}{b})_x$}. Part (iii) now follows from the definition of $\kappac{a}{b}_{[1-z,x]}$ and (ii). \end{proof} Set $\pi_x = C (1-x)^a x^{a+b+1}$ where $C = (2a+b+2)\binom{2a+b+1}{a}$ is the normalization factor given by Lemma~\ref{lemma:ctsBasic}(i). \begin{lemma}\label{lemma:ctsInvar} The $\kappac{a}{b}$-interval involutive walk has unique invariant probability density function $\pi_x$ and is reversible. \end{lemma} \begin{proof} This is immediate from Proposition~\ref{prop:invariantFactorReal}. \end{proof} \subsection{Spectrum} We now find the spectrum of the $\kappac{a}{b}$-weighted involutive walks. The Hilbert space $\H_L$ defined in~\S\ref{subsec:Hilbert} is as follows. \begin{definition} Let $\H_L = \{f(x) / \sqrt{\pi_x} : f \in \L^2([0,1]) \}$, with inner product $\langle \ , \ \rangle_{\H_L}$ defined by $\langle f, g \rangle = \int_0^1 (1-x)^a x^{a+b+1} f(x) g(x) \d x$. \end{definition} For $e \in \mathbb{N}$, let $V_e$ be the subspace of $\H_L$ of polynomials of degree strictly less than~$e$, and let $V_{\infty} = \bigcup_{e \in \mathbb{N}} V_e$. Thus each $V_e$ is a closed linear subspace of $\H_L$ of dimension~$e$ and by a similar argument to~\S\ref{subsec:trigonometricExample}, $V_\infty$ is a dense subspace of $\H_L$. By~\eqref{eq:LP}, the analogue of left-multiplication by the transition matrix~is $L_P : \H_L \rightarrow H_L$, defined by \begin{equation} \label{eq:LPp} (L_Pf)(x) = (a+b+1)\binom{a+b}{a} \int_{1-x}^1 \frac{(1-z)^a (x+z-1)^b}{x^{a+b+1}} f(z) \d z. \end{equation} We also need the analogous operator for left-multiplication by the transition matrix for down-steps, \begin{equation} \label{eq:LHp} (L_Hf)(x) = (a+b+1)\binom{a+b}{a} \int_{0}^x \frac{y^a (x-y)^b}{x^{a+b+1}} f(y) \d y. \end{equation} Changing variables from $y$ to $1-z$ in the definition of $L_Hf$ shows that $L_P = L_H J$, where $J : \H_L \rightarrow \H_L$ is the self-adjoint involution defined by $(Jf)(x) = f(1-x)$, analogous to the matrices $J(n)$ used earlier. Since $J$ and $L_P$ preserve $\mathcal{H}_L$, the same holds for $L_H$. Recall from Theorem~\ref{thm:spectrum} that the eigenvalues of the discrete $\gammac{a}{b}$-weighted involutive walk on $\{0,\ldots, n-1\}$ are $(-1)^d\lambdac{a}{b}{d}$ for $0 \le d < n$, where $\lambdac{a}{b}{d} = \binom{a+d}{d}/ \binom{a+b+d+1}{d}$. \begin{lemma}\label{lemma:ctsHtransform} Let $d \in \mathbb{N}_0$. We have $L_H(x^d) = \lambdac{a}{b}{d} x^d$. \end{lemma} \begin{proof} By the substitution $y = xw$ in~\eqref{eq:LHp} and Lemma~\ref{lemma:ctsBasic}(i) we get \begin{align*} L_H(x^d) &= (a+b+1)\binom{a+b}{a} \int_0^x \frac{y^a (x-y)^b}{x^{a+b+1}} y^d \, \mathrm{d} y \\ &= (a+b+1) \binom{a+b}{a} x^d \int_0^1 w^{a+d}(1-w)^b \, \mathrm{d} w \\ &= \frac{(a+b+1)\binom{a+b}{a} }{(a+b+d+1)\binom{a+b+d}{a+d} } x^d .\end{align*} Now use $\binom{a+b+d}{a+d} / \binom{a+b}{a} = \binom{a+b+d}{d} / \binom{a+d}{a}$ to see that the eigenvalue is as claimed. \end{proof} We now show that the analogue of Proposition~\ref{prop:practical}(i) holds. \begin{lemma}\label{lemma:ctsPtransform} Let $d \in \mathbb{N}$. Then \[ L_P (x^d) \in (-1)^d\lambdac{a}{b}{d}x^d + V_d. \] \end{lemma} \begin{proof} Since $L_P = L_H J$ and $(L_H J)(x^d) = L_H((1-x)^d) \in (-1)^d x^d + \H_d$, this is immediate from Lemma~\ref{lemma:ctsHtransform}. \end{proof} We can now give a complete description of the spectrum and eigenfunctions for $L_P$. Let $g_0(x), g_1(x), g_2(x), \ldots $ be the functions obtained by Gram--Schmidt orthonormalization applied to $1$, $x$, $x^2, \ldots $, regarded as elements of the Hilbert space $\H_L$. \begin{theorem}\label{thm:ctsLP} The operator $L_P : \H_L \rightarrow \H_L$ is compact and self-adjoint. It has eigenvalues $(-1)^d\lambdac{a}{b}{d}$ for $d \in \mathbb{N}_0$. The normalized eigenfunction for $(-1)^d\lambdac{a}{b}{d}$ is $g_d$. The eigenfunctions $g_0, g_1, \ldots $ are an orthonormal Hilbert space basis for~$\H$ and $L_P(f) = \sum_{d=0}^\infty (-1)^d\lambdac{a}{b}{d} \langle g_d, f \rangle g_d $ for each $f \in \H$. \end{theorem} \begin{proof} Let $f$, $g \in \H_L$. Let $D = (a+b+1)\binom{a+b}{a}$. Since \begin{align*} \langle f , L_P g \rangle_H &= D\int_0^1 (1-x)^a x^{a+b+1} f(x) \int_{1-x}^1 \frac{(1-z)^a (x+z-1)^{a+b+1}}{x^{a+b+1}} g(z) \d z \\ &= D \int\!\!\! \int_{(x,z) \in [0,1]^2 \atop x+z \ge 1} (1-x)^a (1-z)^a (x+z-1)^{a+b+1} f(x)g(z) \d x \d z \end{align*} is symmetric with respect to swapping $f$ and $g$ and $x$ and $z$, we have $\langle f, L_P g \rangle_{\H_L} = \langle L_P f, g\rangle_{\H_L}$. By induction on $d$, it follows from Lemma~\ref{lemma:ctsPtransform} that for each $d \in \mathbb{N}_0$, there is a unique polynomial $g \in V_\infty$ of degree $d$ such that $\langle g, g\rangle_{\H_L} = 1$ and $L_P g = (-1)^d\lambdac{a}{b}{d} g$. Since the eigenfunctions for distinct eigenvalues of $L_P$ are orthogonal, we have $g = g_d$. Since the $g_d$ form a Hilbert space basis for ${\H_L}$, we have the claimed spectral decomposition of~$L_P$. It is clear that~\eqref{eq:chainEigenvalues} that $\lambdac{a}{b}{d} \rightarrow 0$ as $d \rightarrow \infty$. Therefore $L_P$ is compact. \end{proof} Dually, we defined in~\S\ref{subsec:Hilbert} the Hilbert space $\H_R = \{f(x)\sqrt{\pi_x} : f \in \L^2([0,1]) \}$, with inner product $\langle f, g\rangle_{\H_R} = \int_0^1 \frac{f(x)g(x)}{(1-x)^ax^{a+b+1}} \d x$. The map $S$ which sends $f \in \H_L$ to $(1-x)^a x^{a+b+1} f(x) \in {\H_R}$ is an isometric isomorphism from $\H_L$ to ${\H_R}$. Let $R_P : {\H_R} \rightarrow {\H_R}$ be the linear operator corresponding to right-multiplication by the transition matrix of the interval involutive walk, defined by \[ (R_P f)(x) = (a+b+1)\binom{a+b}{a}\int_{1-x}^1 \frac{(1-x)^a (x+z-1)^b}{z^{a+b+1}} f(z) \d z. \] Recall that $\pi_x = C (1-x)^a x^{a+b+1}$. Set $g_d'(x) = (1-x)^a x^{a+b+1}g_d$ for $d \in \mathbb{N}_0$. \begin{theorem}\label{thm:ctsRP} The operator $R_P : {\H_R} \rightarrow {\H_R}$ is compact and self-adjoint. It has eigenvalues $(-1)^d\lambdac{a}{b}{d}$ for $d \in \mathbb{N}_0$. The normalized eigenfunction for $(-1)^d\lambdac{a}{b}{d}$ is $g_d'$. The eigenfunctions $g'_0, g'_1, \ldots $ are an orthonormal Hilbert space basis for~$\mathcal{H}_R$ and $R_P(f) = \sum_{d=0}^\infty (-1)^d\lambdac{a}{b}{d} \langle g'_d, f \rangle g'_d $ for each $f \in {\H_R}$. \end{theorem} \begin{proof} The operators $R_P$ and $L_P$ are conjugate by $S$, in that $R_P S = SL_P$. The result is now immediate from Theorem~\ref{thm:ctsLP}. \end{proof} Hence, started at any probability distribution in ${\H_R}$, the $\kappa^{(a,b)}$-weighted involutive walk converges, in the Hilbert space sense, to $\pi_x$. As in the discrete case, the rate of convergence controlled by the second largest eigenvalue in absolute value, namely $(a+1)/(a+b+2)$. \begin{remark} As one might expect from the discrete case, all the results of this section extend to $a$, $b \in \mathbb{R}^{>-1}$, interpreting the factor $(a+b+1)^{-1}\binom{a+b}{b}^{-1}$ in the norm $N(\kappac{a}{b})$ as the value $\mathrm{B}(a+1,b+1)$ of the Beta integral. For instance, if $a=b=-\mfrac{1}{2}$ then $N(\kappac{-\sfrac{1}{2}}{-\sfrac{1}{2}})_x = \int_0^x \frac{\mathrm{d}y}{\sqrt{y(1-y)}} = \pi = \mathrm{B}(\mfrac{1}{2}, \mfrac{1}{2}).$ \end{remark} \subsection{Comparing the discrete and continuous} \label{subsec:discreteContinuous} \subsubsection*{Jacobi polynomials} For $f, g \in \H_L$ we have \begin{align*} \langle f, g \rangle_{\H_L} &= \int_{0}^1 (1-x)^a x^{a+b+1} f(x) g(x) \d x \\ &= 2^{-(2a+b+1)} \int_{-1}^1 (1-y)^a (1+y)^{a+b+1} f\bigl( \frac{1+y}{2} \bigr) g\bigl( \frac{1+y}{2}\bigr) \d y. \end{align*} It follows that the polynomials $g_d ( \frac{1+y}{2} )$ defined on $[-1,1]$ are orthonormal with respect to the inner product adapted from $\mathcal{H}_L$, namely $\langle F, G \rangle = \int_{-1}^1 (1-y)^a (1+y)^{a+b+1} F(y)G(y) \d y$. The families of orthogonal polynomials for weight functions of the form $(1-y)^A (1+y)^B$ are known as the \emph{Jacobi polynomials}. Thus $g_d( \frac{1+y}{2})$, is up to a scalar, the Jacobi polynomial $J^{(a,a+b+1)}(y)$ of degree $d$ with parameters~$a$ and $a+b+1$. For comparison, in the discrete setting of \S\ref{subsec:eigenvectors}, for each fixed $n$ we described the right-eigenvectors $\rP{0}, \ldots, \rP{n-1}$ of the $n \times n$ matrix $P(\gammac{a}{b})$ as the Gram--Schmidt orthonormalization of the basis $v(0), \ldots, v(n-1)$ of $\mathbb{R}^n$ of columns of Pascal's Triangle, with respect to the inner product $\langle v, w \rangle = \sum_{x=0}^{n-1} \pi_x v_x w_x$, where $\pi_x$ is proportional to $\smbinom{n-x}{a}\smbinom{x+1}{a+b+1}$. Observe that the scaling factor $\pi_x$ for $v_x w_x$ is asymptotically proportional to $(n-x)^a x^{a+b+1}$ when $x$ and $n-x$ are both large. Thus, rescaling to the interval $[0,1]$ by setting $y = x/n$ and letting $n \rightarrow \infty$ we obtain $(1-y)^a (1+y)^{a+b+1}$, the same weight function as for the Jacobi polynomials. The eigenvectors~$\rP{d}$ are therefore the discrete analogues of the Jacobi polynomials. In particular, if $\widehat{w}^{(n)}$ is the eigenvector $w(d) \in \mathbb{R}^n$ of $P(\gammac{a}{b})$, scaled to have maximum entry (in absolute value) $1$, and $\widehat{J}^{(a,a+b+1)}$ is the Jacobi polynomial $J_d^{(a,a+b+1)}$ with the same scaling imposed, then $\widehat{w}^{(n)}_{nx} \rightarrow \widehat{J}^{(a,a+b+1)}_d(2x-1)$ as $n \rightarrow \infty$ for each $x \in [0,1]$. In practice, the convergence is fast: see Figure~2 for an example. The results of \S\ref{subsec:eigenvectors} suggest these discrete analogues deserve further combinatorial study. \begin{figure} \begin{center}\setlength{\unitlength}{1cm} \hspace*{-0.2in}\begin{picture}(5,5.5) \put(-1,0) {\includegraphics[width=3.5in]{Figure2Jacobi.pdf}} \put(-1.55,0.15) {$\scriptstyle -0.4$} \put(-1.55,1.45) {$\scriptstyle -0.2$} \put(-1.07,2.8) {$\scriptstyle 0$} \put(-1.3,4.1) {$\scriptstyle 0.2$} \put(-1.3,5.4) {$\scriptstyle 0.4$} \put(1.1,2.575) {$\scriptstyle 0.25$} \put(3.35,2.575) {$\scriptstyle 0.5$} \put(5.4,2.575) {$\scriptstyle 0.75$} \put(7.8,2.575) {$\scriptstyle 1$} \end{picture} \end{center} \caption{The right-eigenvector $\rP{d}$ for $P(\gamma^{(a,b)})$ is the discrete analogue of the Jacobi polynomial with parameters $a$ and $a+b+1$. The graph above shows the case $a=0$, $b=0$, rescaling to $[0,1]^2$, taking $n=10$ (grey dots) and $n=40$ (black dots) in the discrete case.} \end{figure} \subsubsection*{Anti-diagonal conjugators and anti-diagonal eigenbasis action} We saw in \S\ref{sec:gammaSpectrum} that the column~$v(d)$ of the binomial matrix $B(n)$ is a right-eigenvector of the $n \times n$ down-step matrix $H(\gammac{a}{b})$ for the $\gammac{a}{b}$-weighted involutive walk, and, in this basis, the transition matrix $P(\gammac{a}{b})$ is upper-triangular with diagonal entries $(-1)^d \lambdac{a}{b}{d}$. Theorem~\ref{thm:GB} shows that in this discrete case this behaviour (in the strong, global form) characterises the binomial transforms~$\DS^\lambda$. Stated in a way we hope is intuitive, Proposition~\ref{prop:ADC} says that the reason for this characterisation is that the unique basis of $\mathbb{R}^\infty$ projecting to bases of $\mathbb{R}^n$ in which the operators $J(n)$ for $n \in \mathbb{N}$ are all upper-triangular with alternating sign entries is the columns of the infinitely extended Pascal's triangle; in turn this holds because $J$ induces an induces a degree preserving action on polynomials, as in Lemma~\ref{lemma:binomialNew}(iii). The trigonometric example in~\S\ref{subsec:trigonometricExample} and Theorem~\ref{thm:ctsLP} show that this result has no immediate continuous analogue. Indeed, the operator $L_H : \H_L \rightarrow \H_L$ corresponding to left-multiplication by the down-step matrix in the trigonometric example in~\S\ref{subsec:trigonometricExample} is \[ L_H(g) = \pi \int_0^x \frac{\sin \pi z}{1-\cos \pi x} g(z) \, \mathrm{d}z. \] As seen after Lemma~\ref{lemma:cosAlt}, the operator $L_P$ is represented by an (infinite) upper-triangular matrix in its action on these trigonometric eigenfunctions, with diagonal entries $(-1)^d/(d+1)$. By Lemma~\ref{lemma:ctsHtransform} and Theorem~\ref{thm:ctsLP} the analogous result holds replacing $\cos d\pi x$ with the monomials $x^d$ for the right-multiplication operator for the $\kappac{a}{b}$-weighted involutive walk. (The Jacobi function $g_d(2x-1)$ defined on $[0,1]$ has degree $d$, so is a linear combination of $1,x, \ldots, x^d$.) Therefore both settings have the continuous analogue of the global anti-diagonal eigenvalue property, but the eigenfunctions are very different. \def$'${$'$} \def\Dbar{\leavevmode\lower.6ex\hbox to 0pt{\hskip-.23ex \accent"16\hss}D} \def$'${$'$} \providecommand{\bysame}{\leavevmode\hbox to3em{\hrulefill}\thinspace} \renewcommand{\MR}[1]{\relax } \providecommand{\MRhref}[2]{% \href{http://www.ams.org/mathscinet-getitem?mr=#1}{#2} } \providecommand{\href}[2]{#2}
\section{Introduction} \IEEEPARstart{T}{he} Internet of Things (IoT) has become an important networking paradigm which enables massive connections among ubiquitous physical objects. To address the spectrum scarcity caused by large-scale IoT device access and low spectrum efficiency of static spectrum allocation, a promising solution is to apply the cognitive radio (CR) technology to the IoT, which is well-known as CR-IoT \cite{CRIoT2017Survey}. The CR technology enables the IoT device without dedicated spectrum to work as a secondary user (SU) and accesses the licensed channel of the nearby legitimate IoT device, i.e. the primary users (PU), without causing performance degradation to primary service. There are mainly three CR spectrum sharing strategies, including underlay, overlay, and interweave schemes. Due to the ease of implementation, the interweave scheme is more preferred and extensively adopted in the CR-IoT system, where the SU first monitors the status of the licensed channel and accesses the channel only when it is not occupied by the PU. \par Massive emerging IoT services could be promoted by applying the CR technology, such as smart cities, pollution control, wildfire monitoring and smart agriculture, etc. In these scenes, the wireless connected, battery-operated IoT devices are deployed to monitor certain time-critical physical processes, while there are two common concerns in the design of such systems. One is the battery lifetime, since replacing batteries usually incurs high cost, while the CR functionalities, e.g., channel sensing and switching, are energy consuming. Thus, the CR scheme should be carefully designed to maximize the energy efficiency. The second one is the information freshness, since outdated state information loses value and may even cause severe accidents. The freshness of information can be evaluated by a new concept, i.e. age of information (AoI), which is defined as the time elapsed since the most recent received update was generated at the source~\cite{2012AoI}. \par The AoI has been investigated as an important performance metric in the cognitive radio networks (CRNs) \cite{2019EHCR,2020CRCollision,CRAoI2017,2019IoTJUorO}. The authors in \cite{2019EHCR} investigate the optimal sensing and update scheme of an energy harvesting CR-based sensor for AoI minimization, taking into consideration the partially observability of the state of the PU. Instead of considering slotted transmission and strict slot synchronization between the PU and the SU, the work in \cite{2020CRCollision} focuses on the unsynchronized case and formulates the scheduling policy design problem of the SU for the average AoI minimization as a Markov decision process (MDP) with a collision constraint. The authors in \cite{CRAoI2017} consider an interweave-based cognitive wireless sensor network, and propose a joint framing and scheduling policy optimizing the energy efficiency under strict expected AoI constraints. In \cite{2019IoTJUorO}, the underlay scheme and the overlay scheme are compared with each other with respect to the average peak AoI of both the PU and the SU under standard ARQ. \par However, the above existing studies haven't investigated the impact of heterogeneous traffic patterns of IoT devices on the energy efficiency and on the AoI performance in the CR-IoT system. The primary IoT device (PD) and the secondary IoT device (SD) may have distinct traffics, e.g. the packet generation rate and data size. The energy efficiency and the AoI of the SD may be quite different under different PD traffic patterns, since in the interweave mode, the SD can only transmit when the PD is idle, and the secondary transmission may be frequently interrupted by the arrival of primary traffic. Hence, in this work we are motivated to focus on the effect of heterogeneous traffic on the energy efficiency and AoI of the SD in the CR-IoT system. The main contributions of this article are summarized as follows: \begin{itemize} \item With the consideration of the randomness of spectrum access in the considered CR-IoT system, we derive the closed-form expressions of the energy efficiency and average AoI of the SD. In particular, we show that the average AoI tends to infinity under two extreme cases, which implies the AoI performance is closely related to the specific traffic patterns. \item We explore how the energy efficiency and the average AoI evolves with the transmit power, and prove the convexity of the average AoI as well as the convexity and monotonicity of the energy consumption w.r.t the required transmission time. With the above properties, we propose an optimal transmit power optimization algorithm for the SD to maximize its energy efficiency while maintaining the average AoI under the predefined threshold. \end{itemize} \par The remainder of this paper is organized as follows. We introduce the system model in Section II and derive the closed-form expression of the energy efficiency and average AoI in Section III. An energy-efficient, AoI aware power optimization scheme is proposed in Section IV. In Section V, numerical results are reported with discussions. \section{System Model} We consider a CR-IoT system, where the SD with no dedicated spectrum performs a certain remote monitoring task and opportunistically accesses the licensed channel legitimate to the PD to update the monitored status information to a secondary access point (SAP). From the SD's point of view, the availability of a licensed channel can be modelled as two states, i.e. IDLE and BUSY, which correspond to the two cases where the PD is or isn't utilizing the channel, respectively. We assume that the state transition of the channel follows a two-state continuous-time Markov Chain (CTMC), which is a reasonable and widely-adopted assumption \cite{CTMC2018,CTMC2020}. Let $u$ and $v$ be the transition rates from IDLE to BUSY and from BUSY to IDLE, which jointly represent the traffic pattern of the PD. Then, the continuous IDLE and BUSY periods denoted by $T^I$ and $T^B$ are independent and exponentially distributed random variables with mean value $1/u$ and $1/v$, respectively. \par The SD monitors a physical process which randomly generates status updates of size $D$ bits according to a Poisson process of rate $\lambda$, and thus the traffic pattern of the SD is modeled by the packet size and generation rate. The terms status update and packet are used interchangeably throughout this paper. We assume that the SD can simultaneously handle or hold only one packet, and thus the packets that arrive during transmission will be discarded. Besides, for information freshness, newly-generated packets will take the place of the old one when the SD is waiting for transmission opportunities. We assume the SD transmits at the Shannon capacity $C=B\log_2{\left(1+\frac{P^T}{{N_0}B}\right)}$, where $P^T$ is the transmission power and $N_0$ is the equivalent noise power per unit bandwidth at the receiver in consideration of the channel effect\footnote{For analysis simplicity, the equivalent noise power only accounts for the path loss, which can be seen as a fixed value. However, the analysis in this paper, more specifically, the derivation of energy efficiency and expected AoI in Section III, can be easily extended to the block fading case.}. During transmission, if the PD reclaims the channel, the SD has to quit the current transmission, hand over the channel to the PD and wait for the next IDLE period to restart the transmission. \subsection{Age of Information} Denote the generation time of the $i$-th packet by $g_i$. Note that not every generated packet will be finally received at the SAP, since packets generated during the transmission will be discarded, and packets to be transmitted will be replaced by the newly-generated ones. Thus we denote by $g_i^\prime$ and $d_i$ the generation time and the departure time of the $i$-th successfully transmitted packet. At time instant $t$, we define the index of the most recently received packet at the SAP as $N_t=\max{\{i\mid d_i \leq t\}}$. Then, the instantaneous AoI at $t$ is defined as follows \cite{2012AoI}. \vspace{-.2cm} \begin{definition} \ \label{def:AoI} $\!\!\!$An~instantaneous~AoI~at~time~point~$t$~is~defined~as \vspace{-.35cm} \begin{equation}\vspace{-.2cm} \label{AoIdef} \Delta (t) = t - g_{N_t}. \end{equation} \end{definition} A sample path of AoI is illustrated in Fig. \ref{AoISamplePath}. To calculate the average AoI, we define the interval between the $i$-th and $(i-1)$-th departures as \vspace{-.2cm} \begin{equation}\vspace{-.1cm} \label{Ydef} Y_i = d_i - d_{i-1}, \end{equation} and define the service time of the $i$-th successful received packet as \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{Sdef} S_i = d_i - g_i^\prime. \end{equation} $Y_i$ in (\ref{Ydef}) can be divided into two intervals: $W_i$ and $K_i$. $W_i$ is defined as the time elapsed since the last departure $d_{i-1}$ until a new packet is generated, which can be expressed as \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{Wdef} W_i = \min{\{g_i \left.\right| g_i\geq d_{i-1} \}} - d_{i-1}, \end{equation} The other interval $K_i$ is defined as the time elapsed since the first packet generation after the last departure until the next successful reception $d_i$, which can be expressed as \vspace{-.1cm} \begin{equation} \vspace{-.1cm} \label{Kdef} K_i = d_i - \min{\{g_i \left.\right| g_i\geq d_{i-1}\}}. \end{equation} Following the above definitions, the average AoI can be calculated based on the polygon area $Q_i$ depicted in Fig.\ref{AoISamplePath}: \vspace{-.1cm} \begin{equation}\vspace{-.2cm} \label{AoIArea} \bar{\Delta} =\lim_{t \to \infty}{\frac{N_t}{t} \frac{1}{N_t} \sum_{i=1}^{N_t}{Q_i}} =\frac{\mathbb{E} [Q_i]}{\mathbb{E} [Y_i]}, \end{equation} where \vspace{-.2cm} \begin{equation} \label{QArea} Q_i = \frac{(S_{i-1}+Y_i)^2}{2} - \frac{S_{i-1}^2}{2} = \frac{Y_i^2}{2} + S_{i-1}Y_i. \end{equation} Then, we have the following lemma representing the relationship between the service time and the inter-departure time. \vspace{-.1cm} \begin{lemma} \label{lemma_S&Y} $S_{i-1}$ is independent of $Y_i$. \end{lemma} \begin{IEEEproof} Since $Y_i=W_i+K_i$, $\mathbb{E}\left[ S_{i-1} Y_i \right]=\mathbb{E}\left[S_{i-1}\right]\mathbb{E}\left[Y_i\right]$ holds if $S_{i-1}$ is independent of both $W_i$ and $K_i$. The packet generation process, which follows an Poisson process, is independent of the state transition of the channel as well as the packet transmission. $W_i$ is the waiting time from the $i-1$-th departure to the generation of the first packet after $d_{i-1}$, and thus follows an exponential distribution and has the memoryless property. Therefore, $W_i$ is independent of the events happened before $d_i$ and thus $W_i$ is independent of $S_{i-1}$. $K_i$ is the time elapsed from the generation of a first packet after $d_{i-1}$ to the next departure $d_i$, and thus it depends on the channel state transition process and the packet generation process. Note that the former has the Markovian property and the latter has the memoryless property, so $K_i$ is also independent of the events happened before the packet generation. Therefore, $K_i$ is independent of $S_{i-1}$, and thus Lemma~\ref{lemma_S&Y} is proved. \end{IEEEproof} According to Lemma~\ref{lemma_S&Y}, the expression of the average AoI can be simplified as \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{AoISimplified} \bar{\Delta} \!=\!\mathbb{E}[S_{i-1}] \!+\! \frac{\mathbb{E}[Y_i^2]}{2\mathbb{E}[Y_i]} \!=\!\mathbb{E}[S_{i-1}] \!+\! \frac{\!\mathbb{E}[W_i^2]\!+\!2\mathbb{E}[W_i K_i]\!+\!\mathbb{E}[K_i^2]\!}{2(\mathbb{E}[W_i]\!+\!\mathbb{E}[K_i])}. \end{equation} \par Note that the sequences $\{W_1,W_2,\cdots\}$, $\{K_1,K_2,\cdots\}$, $\{Y_1,Y_2,\cdots\}$ and $\{S_1,S_2,\cdots\}$ form i.i.d processes, which allows us to drop the subscript index of $W_i$, $K_i$, $Y_i$ and $S_{i-1}$ in (\ref{AoISimplified}). As a result, the average AoI can be further~reformulated~as \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{AoIDefFinal} \bar{\Delta} = \mathbb{E}[S] + \frac{\mathbb{E}[Y^2]}{2\mathbb{E}[Y]} = \mathbb{E}[S] + \frac{\mathbb{E}[W^2]+2\mathbb{E}[WK]+\mathbb{E}[K^2]}{2(\mathbb{E}[W]+\mathbb{E}[K])}, \end{equation} where $W$ represents the waiting time from a successful reception to the generation of a new status update, $K$ represents the time elapsed from the first packet generation after a successful reception to the next successful reception, and $S$ represents the service time of a successfully transmitted packet. \begin{figure}[!t] \centering \includegraphics[width=2.7 in, trim= 0 35 0 20]{AoI} \captionsetup{font={small}} \caption{A sample path of AoI and the corresponding intervals.} \label{AoISamplePath} \vspace{-.53cm} \end{figure} \subsection{Energy Efficiency} Energy efficiency in this work is defined as the average number of successfully transmitted bits per unit energy consumption. We assume that the power consumption of the SD consists of three parts \cite{2016CRPowerConsumption}: the packet transmit power $P^T$, the static circuit power $P^C$ and the spectrum sensing power $P^S$. We denote by $E^T$, $E^S$ and $E^C$ the average energy consumption of packet transmission, spectrum sensing and static circuit operation between two consecutive departures, respectively. Besides, we define the corresponding average power consumption time as $T^T$, $T^S$ and $T^C$. Based on the above definitions, the energy efficiency can be expressed as \begin{equation} \label{EEdef} {EE} = \frac{D}{E^T+E^S+E^C} = \frac{D}{P^T T^T + P^S T^S + P^C T^C}. \end{equation} \par So far, we have introduced the general models of AoI and the energy efficiency. In the following section, we derive the explicit expressions of them. \section{Correlation Analysis between energy efficiency and average AoI} As for the energy efficiency, the static circuit power consumption lasts for the whole interval between two departures, so $T^C=\mathbb{E}[Y]$. After a successful reception, the SD starts to sense the allocated channel when a new packet is generated, and keeps monitoring the channel state until a packet is successfully received, i.e. $T^S=\mathbb{E}[K]$. In this way, the SD can release the channel immediately on arrival of the PD's traffic and access the channel when the next transmission opportunity comes. As a result, to evaluate the energy efficiency, we need to derive $\mathbb{E}[Y]$, $\mathbb{E}[K]$ and $T^T$. As for evaluating the average AoI, according to \eqref{AoIDefFinal}, the main difficulty is to derive the terms $\mathbb{E}[S]$, $\mathbb{E}[Y]$ and $\mathbb{E}[Y^2]$. Hence, in the following we first derive the expressions of $\mathbb{E}[Y]$, $\mathbb{E}[Y^2]$ and $T^T$ in Section III-A as well as $\mathbb{E}[S]$ in Section III-B. \subsection{Characterization on $\mathbb{E}[Y]$, $\mathbb{E}[Y^2]$ and $T^T$} The packet generation process follows a Poisson process of rate $\lambda$, which is a memoryless process. Thus, the elapsed time for generating a packet from a certain instant follows an exponential distribution of parameter $\lambda$. Then $W$, which is the time elapsed from the last departure to the generation of a new packet, also follows the exponential distribution of parameter $\lambda$. So the probability density function (PDF) denoted by $f_W(t)$ is $f_W(t) = \lambda e^{-\lambda t}$, and we have $\mathbb{E}[W]=1/{\lambda}$, $\mathbb{E}[W^2]=2/{{\lambda}^2}$. \par To derive the first and second moment of $K$, note that $K$ evolves differently for different channel states at the initial moment. Specifically, if the channel is in IDLE state when a new packet is generated, the SD can immediately start the transmission. On the other hand, if the channel is in BUSY state, the SD has to wait until the PD finishes its transmission. We denote by $I_K$ and $B_K$ the events that the channel is in IDLE or BUSY state at the initial moment of $K$, respectively. Then the expectation of $K$ can be expressed as \begin{equation} \label{conditionalK} \mathbb{E}[K] = \mathrm{Pr}\{I_K\} \mathbb{E}[K | {I_K}] + \mathrm{Pr}\{B_K\} \mathbb{E}[K | {B_K}], \end{equation} and the corresponding expectation of $K^2$ is given by \begin{equation} \label{conditionalK2} \mathbb{E}[K^2] = \mathrm{Pr}\{ I_K \} \mathbb{E} [{K^2}| {I_K} ] + \mathrm{Pr}\{ B_K \} \mathbb{E} [{K^2}| {B_K} ]. \end{equation} \par The two probability terms in (\ref{conditionalK}) and (\ref{conditionalK2}) can be calculated from the transition probabilities of the channel CTMC. The channel must be in the IDLE state at the last departure, so the probability of $I_K$ and $B_K$ equals the probability that the CTMC transfers from IDLE to IDLE and BUSY after a period of $W$, respectively. Denote by $P_{II}(t)$ and $P_{IB}(t)$ the transition probability from IDLE to IDLE and from IDLE to BUSY after time $t$, which are given by \cite{medhi2002stochastic} \begin{equation} \label{P_II} P_{II}(t) = \frac{v}{u+v}+\frac{u}{u+v} e^{-(u+v)t}, \end{equation} \begin{equation} \label{P_IB} P_{IB}(t) = \frac{u}{u+v}-\frac{u}{u+v} e^{-(u+v)t}. \end{equation} \par According to the transition probabilities and the PDF of $W$, $\mathrm{Pr}\{I_K\}$ and $\mathrm{Pr}\{B_K\}$ can be obtained as follows: \begin{equation} \label{conditionalK_I} \mathrm{Pr} \left\{ I_K \right\} = \int_0^{+\infty} P_{II}(t) \lambda e^{-\lambda t} dt = \frac{v+\lambda}{u+v+\lambda}, \end{equation} \begin{equation} \label{conditionalK_B} \mathrm{Pr} \left\{ B_K \right\} = \int_0^{+\infty} P_{IB}(t) \lambda e^{-\lambda t} dt = \frac{u}{u+v+\lambda}. \end{equation} \par Since the IDLE period $T^I$ and the BUSY period $T^B$ are both exponential random variables, they also have memoryless property. Inspired by \cite{gu2019timely,2019IoTJUorO}, the two conditional expectation terms $\mathbb{E}[K|{I_K}]$ and $\mathbb{E}[K|{B_K}]$ in (\ref{conditionalK}) can be evaluated in a recursive manner. Denote by $t^P$ the time required for the SD to transmit an entire packet at the Shannon rate, which is calculated as $t^P=D/C$. As for $\mathbb{E}[K|{I_K}]$, the channel is IDLE at the beginning of $K$, and thus the SD can transmit the generated packet immediately. There are two cases. The first one is that $t^P$ is shorter than the IDLE period $T^I$. In this case the SD finishes its transmission without being interrupted by the PD traffic. The second one is that the channel state transfers from IDLE to BUSY during the SD transmission. In this case, the SD has to quit its current transmission and wait until the channel turns to IDLE again. With the memoryless property of $T^B$, the time elapsed from the instant that channel state transfers to BUSY to the next departure is equal to that the channel is occupied at the beginning of $K$. With the analysis above, $\mathbb{E}[K|{I_K}]$ can be evaluated as follows \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{K_I_recursive} \mathbb{E}[K|{I_K}] = t^P \int_{t^P}^{+\infty}{ue^{-ut}dt}+ \int_0^{t^P}\left({t+\mathbb{E}[K|{B_K}]}\right) {ue^{-ut}dt}. \end{equation} The first term on the right side of (\ref{K_I_recursive}) corresponds the first case, where $\mathbb{E}[K|{I_K}]$ equals the required transmission time for one packet. The second term represents that $\mathbb{E}[K|{I_K}]$ is composed of the already transmitted time before interruption and the expected elapsed time before the next departure when the channel happens to be BUSY at the packet generation moment. In the same way, $\mathbb{E}[K|{B_K}]$ can be expressed as \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{K_B_recursive} \mathbb{E}[K|{B_K}] = \int_0^{t^P}\left({t+\mathbb{E}[K|{I_K}]}\right) {ve^{-vt}dt}. \end{equation} which is composed of the waiting time before the next transmission opportunity and the expected time before a successful reception when the channel is IDLE at the initial moment of $K$. By jointly considering (\ref{K_I_recursive}) and (\ref{K_B_recursive}), we can obtain the expressions of $\mathbb{E}[K\left|{I_K}\right.]$ and $\mathbb{E}[K\left|{B_K}\right.]$. Substitute the results along with (\ref{conditionalK_I}) and (\ref{conditionalK_B}) to (\ref{conditionalK}), and $\mathbb{E}[K]$ is expressed as \vspace{-.1cm} \begin{equation} \vspace{-.1cm} \label{K_final} \mathbb{E}[K] = h e^{ut^P} + \frac{u}{v(u+v+\lambda)} - h, \end{equation} where $h = 1/u + 1/v$, and $\mathbb{E}[Y]$ can be finally obtained as \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{Y_final} \mathbb{E}[Y] = \frac{1}{\lambda} + h e^{ut^P} + \frac{u}{v(u+v+\lambda)} - h. \end{equation} \par Since all interruptions happen with identical probability, which only depends on the required packet transmission time of the SD and the channel CTMC, the number of transmission interruptions follows the Geometric distribution of probability $p^I = \mathrm{Pr} \left\{T^I<t^P\right\}= 1 - e^{-ut^P}$. We define $t^I$ as the expected time spent for transmission before interruption, given by \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{TimeBeforeInterruption} t^I = \frac{\int_0^{t^P}{tue^{-ut}}}{p^I} = \frac{1}{u} - \frac{e^{-ut^P}}{1-e^{-ut^P}} t^P. \end{equation} So the expected transmission time spent between two departures can be evaluated as the sum of the interrupted transmissions and one successful transmission, given by. \begin{equation} \label{TT} T^T = \sum_{n=0}^{+\infty}{{p^I}^n\left(1-p^I\right)} n t^I + t^P = \frac{e^{ut^P}-1}{u}. \end{equation} \par Next we turn to the two conditional expectations of $K^2$. Denote by $f_{K|I_K}(t)$ and $f_{K|B_K}(t)$ the PDF of $K$ conditioned on $I_K$ and $B_K$, respectively. Similar to the analysis on $\mathbb{E}[K|{I_K}]$, $\mathbb{E}[{K^2} | {I_K}]$ can be derived based on (\ref{K_I_recursive}) as follows:\vspace{-.1cm} \begin{align} \label{K2_I_recursive} \mathbb{E}\left[K^2\left|{I_K}\right.\right] = {} & \underbrace{{t^P}^2 \int_{t^P}^{+\infty}{ue^{-ut}dt}}_{S_1} \notag \\ {} & + \underbrace{{\int_0^{t^P}{\int_0^{+\infty}{(t+s)^2 {f_{K|I_K}(s)} u e^{-ut} ds dt}}}}_{S_2}. \end{align} The terms $S_1$ and $S_2$ correspond to the first and second terms on the right side of (\ref{K_I_recursive}), respectively. $S_2$ can be further transformed into \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{S2} S_2 = \int_0^{t^P} { \left( { t^2 + 2t \mathbb{E} [{K}| {B_K}] + \mathbb{E} [{K^2}| {B_K}] } \right) ue^{-ut}dt }. \end{equation} Similarly, based on (\ref{K_B_recursive}). the expectation of $K^2$ conditioned on $B_K$ can be expressed as \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{K2_B_recursive} \mathbb{E}[K^2|{B_K}] = \int_0^{t^P} { \left( { t^2 + 2t \mathbb{E} [{K}| {I_K}] + \mathbb{E} [{K^2}| {I_K}] } \right) ve^{-vt}dt }. \end{equation} With the derived results of $\mathbb{E}[K|{I_K}]$ and $\mathbb{E}[K|{B_K}]$, $\mathbb{E}[K^2|{I_K}]$ and $\mathbb{E}[K^2|{B_K}]$ can be solved from (\ref{K2_I_recursive}), (\ref{S2}) and (\ref{K2_B_recursive}). We omit the two expressions here and directly give the result of $\mathbb{E}[K]$ as follows \vspace{-.1cm} \begin{align} \label{K2_final} \mathbb{E}[K^2] = {} & \frac{2}{uv} - \frac{2}{v(u+v+\lambda)} + 2h^2 e^{2ut^P} \notag \\ {} & + 2\left[ h \left( \frac{u}{v(u+v+\lambda)} - h - t^P \right) - \frac{1}{uv} \right]e^{ut^P}. \end{align} \par Now we derive the expression of $\mathbb{E}[WK]$. We can find that $W$ and $K$ are independent of each other when conditioned on $I_K$ and $B_K$. Then, we have \begin{align} \label{WK} \mathbb{E}[WK] = {} & \mathbb{E}[ WK | I_K ] \mathrm{Pr} \{I_K\} + \mathbb{E}[ WK | B_K ] \mathrm{Pr} \{B_K\} \notag \\ = {} & \mathbb{E}[ W | I_K ] \mathbb{E}[ K | I_K ] \mathrm{Pr} \{I_K\} + \mathbb{E}[ W | B_K ] \mathbb{E}[ K | B_K ] \mathrm{Pr} \{B_K\} \end{align} For the term $\mathbb{E}[ WK | I_K ]$, denote by $f_{W|I_K}(t)$ the PDF of $W$ conditioned on event $I_K$, then it can be calculated as \begin{align} \label{W_I_K} \mathbb{E}[ W | I_K ] = {} & \int_0^{+\infty}{f_{W | I_K }(t)tdt} = \int_0^{+\infty} { \frac{P_{II}(t)f_W(t)}{\mathrm{Pr}\{ I_K \}}tdt} \notag \\ = {}& \left( \frac{1}{u\lambda} + \frac{\lambda}{v(u+v+\lambda)^2} \right) \left( e^{ut^P} - 1 \right). \end{align} Similarly, $\mathbb{E}[ W | B_K ]$ is given by \begin{equation} \label{W_B_K} \mathbb{E}[ W | B_K ] = \left( \frac{1}{v\lambda} - \frac{\lambda}{v(u+v+\lambda)^2} \right) \left( e^{ut^P} - \frac{v}{u+v} \right). \end{equation} By substituting (\ref{conditionalK_I}), (\ref{conditionalK_B}), (\ref{W_I_K}) and (\ref{W_B_K}) into (\ref{WK}), $\mathbb{E}[WK]$ is finally given as follows \begin{equation} \label{WK_final} \mathbb{E}[WK] = \frac{1}{\lambda}\left[ he^{ut^P} + \frac{u}{v(u+v+\lambda)} - h \right] + \frac{u}{v(u+v+\lambda)^2}. \end{equation} Finally, the expression of $\mathbb{E}[ Y^2 ]$ can be obtained as \begin{equation} \label{Y2_final} \mathbb{E}[ Y^2 ] = 2\left\{h^2e^{2ut^P} + \left[ h\left( g - t^P \right) - \frac{1}{uv} \right]e^{ut^P} + \frac{g}{\lambda} + q \right\} \end{equation} where $g = \frac{1}{\lambda} + \frac{u}{v(u+v+\lambda)} - h$ and $q = \frac{1}{uv} - \frac{v+\lambda}{v(u+v+\lambda)^2}$, and the $\mathbb{E}[Y^2]/2\mathbb{E}[Y]$ term in (\ref{AoIDefFinal}) can be expressed as \begin{equation} \label{Y2_2Y_final} \frac{\mathbb{E}[ Y^2 ]}{2\mathbb{E}[Y]} = \frac{h^2 e^{2ut^P} + \left[ h(g-t^P) - \frac{1}{uv} \right]e^{ut^P} + \frac{g}{\lambda} + q} {he^{ut^P} + g}. \end{equation} \subsection{Characterization on $\mathbb{E}[S]$} Similar to $K$, to derive $\mathbb{E}[S]$, we also need to distinguish different channel states at the initial moment. Define $I_S$ and $B_S$ as the event that the channel is IDLE and BUSY at the initial moment of $S$. Then the expectation of $S$ follows \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{S} \mathbb{E}[S] = \mathbb{E}[ S | I_S ] \mathrm{Pr} \{ I_S \} + \mathbb{E}[ S | B_S ] \mathrm{Pr}\{ B_S \}. \end{equation} Both $I_S$ and $B_S$ imply the event denoted by $\Phi_S$ that packet is finally successfully received at the destination without being replaced by a new one. In this sense, we let $I_G$ and $B_G$ represent the events that the channel is IDLE and BUSY when a packet is generated, and then $I_S$ and $B_S$ represent the events $I_G$ and $B_G$ conditioned on $\Phi_S$, respectively. Therefore, the probability of event $I_S$ and $B_S$ can be calculated as \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{Pr_I_S} \mathrm{Pr} \{ I_S \} = \frac{\mathrm{Pr}\{ I_G \} \mathrm{Pr} \{ \Phi_S | I_G \}} {\mathrm{Pr}\{ I_G \} \mathrm{Pr} \{ \Phi_S | I_G \} + \mathrm{Pr}\{ B_G \} \mathrm{Pr} \{ \Phi_S | B_G \}}, \end{equation} \vspace{-.01cm} \begin{equation}\vspace{-.05cm} \label{Pr_B_S} \mathrm{Pr} \{ B_S \} = \frac{\mathrm{Pr}\{ B_G \} \mathrm{Pr} \{ \Phi_S | B_G \}} {\mathrm{Pr}\{ I_G \} \mathrm{Pr}\{ \Phi_S | I_G \} + \mathrm{Pr}\{ B_G \} \mathrm{Pr} \{ \Phi_S | B_G \}}. \end{equation} $\mathrm{Pr} \{ \Phi_S | I_G \}$ and $\mathrm{Pr} \{ \Phi_S | B_G \}$ can be derived in a similar recursive manner as in (\ref{K_I_recursive}) and (\ref{K_B_recursive}) \vspace{-.1cm} \begin{align} \vspace{-.1cm} \mathrm{Pr}\{ \Phi_S | I_G \} &\!= \! \int_{t^P}^{+\infty}\!\!{ue^{-ut}dt} \!+\! \mathrm{Pr}\{ \Phi_S | B_G \} \int_0^{t^P}{ue^{-ut}dt}, \label{Phi_S_I_G_recursive} \\ \mathrm{Pr} \{ \Phi_S | B_G \} &\!=\! \mathrm{Pr} \{ \Phi_S | I_G \} \int_0^{+\infty}{\int_s^{+\infty}{\lambda e^{-\lambda t}dtv e^{-vs}ds}}. \label{Phi_S_B_G_recursive} \end{align} Similar to (\ref{K_I_recursive}), the first term on the right side of (\ref{Phi_S_I_G_recursive}) corresponds to the successful packet reception on the first transmission attempt, and the second term corresponds to the case that the SD transmission is interrupted by the PD. In contrast, (\ref{Phi_S_B_G_recursive}) is different from (\ref{K_B_recursive}) in that $\mathrm{Pr}\{ \Phi_S | I_G \}$ should satisfy the condition that the packet isn't replaced by a newly-generated one during the BUSY period. By jointly considering (\ref{Phi_S_I_G_recursive}) and (\ref{Phi_S_B_G_recursive}), the $\mathrm{Pr} \{ \Phi_S | I_G \}$ and $\mathrm{Pr}\{ \Phi_S | B_G \}$ can be solved. \par Since the generation process of packets and the state transition process of a channel are independent of each other, the probability of $I_G$ or $B_G$ is just the steady state probability of the IDLE or BUSY state, i.e. $\mathrm{Pr} \{ I_G \} = v/(u+v)$, $\mathrm{Pr} \{ B_G \} = u/(u+v)$. Consequently, $\mathrm{Pr} \{ I_S \}$ and $\mathrm{Pr} \{ B_S \}$ can be calculated by substituting the derived results to~\eqref{Pr_I_S} and~\eqref{Pr_B_S}. \par Compared to $\mathbb{E}[ S | I_G ]$ and $\mathbb{E}[ S | B_G]$, $\mathbb{E}[ S| I_S ]$ and $\mathbb{E}[ S| B_S ]$ are further conditioned on the event that the packet is finally successfully received at the SAP without being dropped. As a result, the two terms should further divide the conditional probabilities $\mathrm{Pr}\{ \Phi_S| I_G \}$ and $\mathrm{Pr}\{ \Phi_S | B_G \}$ on the basis of $\mathbb{E}[ S| I_G]$ and $\mathbb{E}[ S | B_G ]$, respectively. Based on (\ref{Phi_S_I_G_recursive}) and (\ref{Phi_S_B_G_recursive}), the expectation of $S$ conditioned on $I_G$ and $B_G$ are given as \vspace{-.2cm} \begin{align} \label{S_I_G_recursive} \mathbb{E}[ S | I_S ] = {}& \frac{1}{\mathrm{Pr}\{ \Phi_S | I_G \}} \int_{t^P}^{+\infty}{t^P ue^{-ut} dt} \notag \\ {}& + \frac{\mathrm{Pr} \{ \Phi_S | B_G \}}{\mathrm{Pr}\{ \Phi_S | I_G \}} \int_0^{t^P}{\left( t + \mathbb{E}[ S | B_S ] \right) ue^{-ut}dt} \end{align} \begin{align} \label{S_B_G_recursive} \!\!& \!\!\mathbb{E} \left[ S \left| B_S \right. \right] =\notag \\ \!\!&\!\! \frac{\mathrm{Pr} \left\{ \Phi_S \left| I_G \right. \right\}}{\mathrm{Pr} \{ \Phi_S | B_G \}} \int_0^{+\infty}\!\!\!\!{\left( s + \mathbb{E} \left[ S \left| I_S \right. \right] \right) \int_s^{+\infty}\!\!\!\!{\lambda e^{-\lambda t}dtve^{-vs}ds}}, \end{align} and the two terms can be solve jointly. Finally, $\mathbb{E}[S]$ can be expressed as follows: \begin{equation} \label{S_final} \mathbb{E}[S] = \frac{\left( l + \lambda t^P \right)e^{ut^P} - l + \frac{u}{u+v+\lambda}} {\lambda e^{ut^P} + v}. \end{equation} where $l \!=\! v/u \!+\! (u\!+\!v)/(u\!+\!v\!+\!\lambda)$. The average AoI can now be characterized by substituting (\ref{Y2_2Y_final}) and (\ref{S_final}) into (\ref{AoIDefFinal}), given by \begin{align} \label{AoI_final} \bar{\Delta} = {} & \frac{h^2 e^{2ut^P} + \left[ h(g-t^P) - \frac{1}{uv} \right]e^{ut^P} + \frac{g}{\lambda} + q} {he^{ut^P} + g} \notag \\ {} & + \frac{\left( l + \lambda t^P \right)e^{ut^P} - l + \frac{u}{u+v+\lambda}} {\lambda e^{ut^P} + v}, \end{align} and the energy efficiency can also be derived by substituting (\ref{K_final}), (\ref{Y_final}) and (\ref{TT}) into (\ref{EEdef}), given by \begin{equation} \label{EE_final} \!EE \!= \!\frac{D} {\!\frac{P^T}{u}\!\left(\!e^{ut^P}\!\!-\!1\right)\! \!+\! \frac{P^C}{\lambda}\!+\! (P^S\!+\!P^C)\left(h e^{ut^P} \!+\! \frac{u}{v(u\!+\!v\!+\!\lambda)} \!-\! h\right)\!}. \end{equation} We further analyse the property of the derived average AoI and obtain the following lemma: \begin{lemma} \label{lemma_u} For any finite ratio of average IDLE period and average BUSY period denoted by $k = v/u$, the average AoI tends to positive infinity when $u$ tends to $0$ or positive infinity. \end{lemma} \begin{IEEEproof} See Appendix-B. \end{IEEEproof} According to Lemma~\ref{lemma_u}, for a fixed and moderate $k$, a very large $u$ corresponds to the case that both the continuous IDLE and BUSY period are statistically very short so that the transmission of the SD will be frequently interrupted by the PD. On the other hand, $u$ with an extremely small value corresponds to the case that both the continuous IDLE and BUSY period last very long in a statistical sense, and thus there will be a long time that the SD can obtain no transmission opportunity to update the status information of the monitored physical process. As a result, both cases will lead to a very high average AoI. We can also know from Lemma~\ref{lemma_u} that a large ratio $k$ doesn't guarantee a low average AoI, which seems counter-intuitive since a large $k$ usually means more transmission opportunities. \section{Transmit Power Optimization} In this section, the SD has to carefully decide its transmit power since a higher transmit power means a higher rate and lower AoI, however, this may cause lower energy efficiency. Since the status information will lose its value if it is outdated, the SD has a predefined AoI threshold denoted by $\Delta^{\mathrm{max}}$. Our objective is to maximize the energy efficiency of the SD subject to the average AoI constraint. The transmit power optimization problem is given by \begin{subequations} \label{P1} \begin{alignat}{2} \mathbf{P1:}\max_{P^T}\quad & {EE( P^T )}&\quad & \tag{43}\\ \text{s.t.}\quad & 0\leq P^T \leq P^{\mathrm{max}}, \label{P1:C1}\\ &\bar{\Delta} ( P_n^T ) \leq {\Delta}^{\mathrm{max}}. \label{P1:C2} \end{alignat} \end{subequations} where $P^{\mathrm{max}}$ is the maximum transmit power. Constraint (\ref{P1:C1}) is the power budget for the SD. Constraint (\ref{P1:C2}) is used to guarantee that the average AoI of the SD should not exceed its AoI threshold. Due to the complexity of the energy efficiency and the average AoI derived in (\ref{EE_final}) and (\ref{AoI_final}), it is hard to directly analyse the convexity and monotonicity of the two terms w.r.t the transmit power $P^T$. Note that there is a one-to-one correspondence between the required transmission time of one packet $t^P$ and the transmit power $P^T$. More specifically, $t^P$ monotonously decreases with the increasing of $P^T$. As a result, we can change the optimization variable from $P^T$ to $t^P$ equivalently. Besides, according to the definition of the energy efficiency in (\ref{EEdef}), it is inversely proportional to the sum of three part of expected energy consumption between two consecutive successful receptions. Therefore, the optimization objective can be substituted by the sum of energy consumptions of transmi(ssion, spectrum sensing and static circuit, without changing the solution of the problem. With the above mentioned manipulations, we can obtain an equivalent problem to P1 given by \vspace{-.1cm} \begin{subequations} \label{P2} \begin{alignat}{2} \mathbf{P2:}\min_{t^P}\quad & {E^{\mathrm{sum}}( t^P )\triangleq E^T( t^P )+ E^S( t^P ) + E^C( t^P ) }&\quad & \tag{44}\\ \text{s.t.}\quad & t^P \geq t^{\mathrm{min}}, \label{P2:C1}\\ &\bar{\Delta} ( t^P ) \leq {\Delta}^{\mathrm{max}}. \label{P2:C2} \end{alignat} \end{subequations} \vspace{-.1cm} where \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{min_t_P} t^{\mathrm{min}} = \frac{D} {B \log_2{\left( 1 + \frac{P^{\mathrm{max}}}{{N_0} B}\right)} } \end{equation} is the required packet transmission time at the maximum transmit power. To solve P2, we first analyse the monotonicity and the convexity of $E^{\mathrm{sum}}( t^P )$ and $\bar{\Delta} ( t^P )$ and obtain the following two lemmas. \begin{lemma} \label{lemma_E_sum} $E^{\mathrm{sum}}(t^P)$ is convex in $t^P \in (0,\sqrt{\frac{D\ln2}{B u}})$ and strictly monotonously increases for $t^P \in [\sqrt{\frac{D\ln2}{B u}},+\infty)$. Besides, $E^{\mathrm{sum}}(t^P)$ is a quasi-convex function and first decreases and then increases in interval $(0,+\infty)$. \end{lemma} \begin{IEEEproof} See Appendix-C. \end{IEEEproof} \begin{lemma} \label{lemma_AoI} $\bar{\Delta} ( t^P )$ is a strictly monotonously increasing function in interval $(0,+\infty)$. \end{lemma} \begin{IEEEproof} See Appendix-D. \end{IEEEproof} With the convexity and monotonicity in Lemma~\ref{lemma_E_sum} and Lemma~\ref{lemma_AoI}, P2 and its equivalent problem P1 can be solved using binary search and gradient decent method, which is elaborated in Algorithm~1. \begin{algorithm}[!t] \captionsetup{font={small}} \caption{TPOA: Transmit Power Optimization Algorithm} \label{alg:TPOA} \renewcommand{\algorithmicrequire}{\textbf{Input:}} \renewcommand{\algorithmicensure}{\textbf{Output:}} \begin{small} \begin{algorithmic}[1] \linespread{1}\selectfont \Require $\lambda,D,{N_0},{\Delta}^{\mathrm{max}},P^{\mathrm{max}},u,v,B$ \Ensure solution to P2 \State Calculate $t^{\mathrm{min}}$ and $\bar{\Delta}(t^{\mathrm{min}})$ from (\ref{min_t_P}) and (\ref{AoI_final}). \If {$\bar{\Delta}(t^{\mathrm{min}}) > {\Delta}^{\mathrm{max}}$} \parState {P2 has no feasible solution. The SD isn't able to meet its information freshness requirement.} \Else \State Select some large $t^{\prime}$ that satisfies $\bar{\Delta}(t^{\prime})>{\Delta}^{\mathrm{max}}$. \parState {Do binary search in interval $[t^{\mathrm{min}},t^{\prime}]$ until find a $t^{\mathrm{max}}$ that satisfies $\bar{\Delta}(t^{\mathrm{max}}) = \Delta^{\mathrm{max}}.$} \State Calculate $\Omega = (0,\sqrt{\frac{D\ln2}{B u}})\cap[t^{\mathrm{min}},t^{\mathrm{max}}]$. \If ${\Omega = \emptyset}$ \State ${t^P}^{\ast} = \sqrt{\frac{D\ln2}{B u}}$. \Else \State Obtain ${t^P}^{\ast}$ in $\Phi$ using gradient decent method. \EndIf \State Calculate ${P^T}^{\ast}=P^T({t^P}^{\ast})$, $EE^{\ast}=EE({P_n^T}^{\ast})$. \EndIf \end{algorithmic} \end{small} \end{algorithm} \section{Numerical Simulations} In this section, we present the numerical results of the energy efficiency and AoI performance of the considered CR-IoT system. In the simulations, we set the bandwidth of the licensed channel to be $B=180$ kHz, which equals the bandwidth of a sub-channel in NB-IoT, and set the spectrum sensing power, the static circuit power and the maximum transmit power to be $P^S = 1\times10^{-3}$ W, $P^C = 1\times10^{-4}$ W and $P^{\mathrm{max}}=0.1$ W, respectively. The equivalent noise power per unit bandwidth at the SAP in the simulation is set to be ${N_0}=N_0^R/\eta$, where $N_0^R$ is the noise power per unit bandwidth at the receiver of SAP and $\eta$ is the path loss of SD. We set $N_0^R=-110$ dBm and adopt $\eta = L^{-\theta}$ for the simulation of path loss with path loss factor $\theta=3$ and the distance between the SD and the SAP denoted by $L$. \par We first analyse the energy efficiency and AoI performance under different traffic patterns in Fig. $2$. To characterize different PD traffic patterns, we fix the IDLE/BUSY ratio while varying the parameter $u$. It can be seen that the results derived in (\ref{EE_final}) and (\ref{AoI_final}) coincide well with the Monte Carlo simulation results, which verifies the characterization on the energy efficiency and the average AoI. Besides, as shown in Fig. \ref{fig_ee_u}, the energy efficiency under both the two traffic patterns first increases then decreases with the increasing $u$, which means there exists a best $u$ to achieve the highest energy efficiency. Similarly, in Fig. \ref{fig_aoi_u}, the average AoI first decreases then increases and tends to positive infinity on both sides, which verifies Lemma~\ref{lemma_u}. More importantly, the $u$ that maximizes the energy efficiency or minimize the average AoI for the two SD traffic patterns are different, which implies that the SDs with different traffic have different preferences toward different PD traffic patterns. Moreover, comparing the two subfigures, for a single SD, the best $u$ w.r.t the two performance indcators are also different, which indicates that the SD have different preferences towards the PD traffic pattern for the two performance demands. \begin{figure}[t] \captionsetup{font={small}} \centering \subfloat[Energy efficiency.]{ \label{fig_ee_u} \includegraphics[width=0.75\linewidth, trim = 30 5 20 30]{fig2_ee_u_2SD.eps} } \hfill \subfloat[Average AoI.]{ \label{fig_aoi_u} \includegraphics[width=0.75\linewidth, trim = 30 5 20 20]{fig2_aoi_u_2SD.eps} } \caption{{Energy efficiency and AoI performance versus CTMC parameter $u$ where $L=250$. The two SD traffic patterns are $D_1 = 400, \lambda_1 = 10$ and $D_2=100,\lambda_2=100$.}} \vspace{-.53cm} \end{figure} Next, we present the energy efficiency and AoI performance of a SD under different transmit power in Fig. \ref{fig_ee_transmitpower} and \ref{fig_aoi_transmitpower}. The solid and dashed lines in the two figures correspond to two PD traffic patterns, i.e. different CTMC parameters $u$ and $v$, under the same IDLE/BUSY ratio $k=v/u$ . The black line in Fig. \ref{fig_aoi_transmitpower} represents the sum of the average packet generation interval and the required transmission time for a single packet, which is a lower bound of the average AoI. It can be observed that with the increasing transmit power, the energy efficiency of the SD first increases and then decreases, while the average AoI keeps decreasing, which verifies Lemma~\ref{lemma_E_sum} and Lemma~\ref{lemma_AoI}. We can also find that although the energy efficiency under PD traffic pattern~$1$ is lower than $2$, the lowest reachable average AoI under pattern~$1$ is lower than that under pattern~$2$. As a result, when the average AoI constraint is strict, e.g. 2 times of the lower bound, pattern~$2$ isn't able to satisfy the information freshness requirement of the SD while pattern~$1$ is, so the SD would prefer pattern~$1$ with a lower energy efficiency. This implies that the transmit power control introduces a trade-off between the energy efficiency and the average AoI. \section{Conclusion} In this paper, we have investigated the impact of heterogeneous traffic pattern on the energy efficiency and average AoI of the SD in a CR-IoT system. The closed-form expressions of the energy efficiency and the average AoI have been derived. We have designed for the SD an optimal transmit power optimization algorithm aiming at maximizing the energy efficiency while satisfying the average AoI constraint. The solution is facilitated by exploring the convexity and monotonicity of the objective and constraint functions. The numerical results have confirmed our analytical model. In addition, we showed that the SD has different preferences toward different PD traffic patterns, and there is a tradeoff between the energy efficiency and the average AoI. \begin{figure}[t] \captionsetup{font={small}} \centering \subfloat[Energy efficiency.]{ \includegraphics[width=0.75\linewidth, trim = 30 5 20 30]{fig1_ee_transmitpower.eps} \label{fig_ee_transmitpower}} \hfil \subfloat[Average AoI.]{ \includegraphics[width=0.75\linewidth, trim = 30 5 20 20]{fig2_aoi_transmitpower.eps} \label{fig_aoi_transmitpower}} \caption{{Energy efficiency and AoI performance versus transmit power where $L=300$, $D = 400$ and $\lambda = 200$.}} \vspace{-.53cm} \end{figure} \section*{Appendix} \subsection{Proof of Lemma 2} When $u$ tends to zero, for a finite $k=v/u$, substitute $k$ for $v$ in (\ref{Y2_2Y_final}) and (\ref{S_final}), and utilize the Taylor expansion of term $\mathrm{exp}({ut^P})$ and $\mathrm{exp}({2ut^P})$, the limit of term $\mathbb{E}[Y^2]/2\mathbb{E}[Y]$ and $\mathbb{E}[S]$ can be expressed as\vspace{-.1cm} \begin{align} \lim_{u\rightarrow 0}{\frac{\mathbb{E}[Y^2]}{2\mathbb{E}[Y]}} &= \lim_{u\rightarrow 0}{\frac{\frac{1}{k^2}\left(t^P+\frac{1}{\lambda}\right) \frac{1}{u} + o\left(\frac{1}{u}\right)}{\left(1+\frac{1}{k}\right)\left( t^P + \frac{1}{\lambda} \right) + o(1)}} = +\infty, \\ \lim_{u\rightarrow 0}{\mathbb{E}[S]} &= \lim_{u\rightarrow 0}{\frac{\lambda t^P + o(1)}{\lambda + o(1)}} = t^P. \end{align} Therefore, the limit of average AoI at $u \rightarrow 0$ is given by \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \lim_{u\rightarrow 0}{\bar{\Delta}} = \lim_{u\rightarrow 0}{\left(\frac{\mathbb{E}[Y^2]}{2\mathbb{E}[Y]} + \mathbb{E}[S] \right)} = +\infty. \end{equation} \par When $u$ tends to positive infinity, as for $\mathbb{E}[Y^2]/2\mathbb{E}[Y]$, the $\mathrm{exp}({2ut^P})$ term in the numerator and the $\mathrm{exp}({ut^P})$ term in the denominator play a dominant role, and we can obtain that\vspace{-.1cm} \begin{equation}\vspace{-.1cm} \lim_{u\rightarrow +\infty}{\frac{\mathbb{E}[Y^2]}{2\mathbb{E}[Y]}} = \lim_{u\rightarrow +\infty}{\frac{{\left(1+\frac{1}{k}\right)}^2 \frac{1}{u^2} e^{2ut^P}}{\left(1+\frac{1}{k}\right) \frac{1}{u} e^{ut^P}}} = +\infty. \end{equation} Similarly, the $\mathrm{exp}({ut^P})$ terms play a dominant role in both the numerator and denominator of the term $\mathbb{E}[S]$ when $u$ tends to positive infinity, and the limit is given by\vspace{-.1cm} \begin{equation}\vspace{-.1cm} \lim_{u\rightarrow +\infty}{\mathbb{E}[S]} = \lim_{u\rightarrow +\infty}{\frac{\left(k+\frac{u+ku}{u+ku+\lambda}+\lambda t^P\right)e^{ut^P}}{\lambda e^{ut^P}}} = \frac{1+k+t^P}{\lambda}. \end{equation} Finally we can get\vspace{-.1cm} \begin{equation}\vspace{-.1cm} \lim_{u\rightarrow +\infty}{\bar{\Delta}} = \lim_{u\rightarrow +\infty}{\left(\frac{\mathbb{E}[Y^2]}{2\mathbb{E}[Y]} + \mathbb{E}[S] \right)} = +\infty, \end{equation} and Lemma~\ref{lemma_u} is proved. \subsection{Proof of Lemma 3} According to (\ref{K_final}) and (\ref{Y_final}), we have \vspace{-.1cm} \begin{align} E^{S}( t^P ) & = P^S \left( he^{ut^P} + \frac{u}{v(u+v+\lambda)} - h \right), \label{ES} \\ E^{C}( t^P ) & = P^C \left( he^{ut^P} + \frac{1}{\lambda} + \frac{u}{v(u+v+\lambda)} - h \right). \label{EC} \end{align} From (\ref{ES}) and (\ref{EC}), we know that both $E^{S}( t^P )$ and $E^{C}( t^P )$ are convex and strictly monotonously increasing w.r.t $t^P$ in interval $(0,+\infty)$. As for the convexity and monotonicity of $E^{S}( t^P )$, its expression can be obtained from (\ref{EEdef}) and (\ref{TT}), which is given by\vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{ET} E^{T}( t^P ) = N_0 B \left[ \mathrm{exp}\left( \frac{D \ln{2}}{Bt^P} \right) -1 \right] \left[ \mathrm{exp}\left( ut^P \right) -1 \right]. \end{equation} According to the structure of $E^{S}( t^P )$ in (\ref{ET}), consider a function of this kind\vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{f(x)} f(x)= \left( e^{ax} -1 \right) \left( e^{\frac{b}{x}} -1 \right), a>0,b>0,x\in(0,+\infty). \end{equation} Take the first derivative of $f(x)$ and we can get\vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{f'(x)} f^{\prime}(x) = e^{ax+ \frac{b}{x}}\left( a - \frac{b}{x^2} -ae^{-\frac{b}{x}} + \frac{b}{x^2} e^{-ax} \right). \end{equation} Let $s(x) = a - \frac{b}{x^2} -ae^{-\frac{b}{x}} + \frac{b}{x^2} e^{-ax}$, we can easily find that $s(\sqrt{\frac{b}{a}})=0$ and $f^{\prime}(\sqrt{\frac{b}{a}})=0$. When $x>\sqrt{\frac{b}{a}}$, we can obtain that the derivative of $s(x)$ \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{s'(x)} s^{\prime}(x) = \frac{2b}{x^2} \left( 1 - e^{-ax} \right) + \frac{ab}{x^2} \left( e^{-\frac{b}{x}} - e^{-ax} \right) >0. \end{equation} Therefore, $f^{\prime}(x)>0$ when $x>\sqrt{\frac{b}{a}}$, which means $f(x)$ is strictly monotonously increasing in interval $[\sqrt{\frac{b}{a}},+\infty)$. When $x\in(0,\sqrt{\frac{b}{a}})$, take the second-order derivative of $f(x)$ $\!\!\!\!\begin{array}{ll} \!\!\!\!f^{\prime\prime}(x) \!\! &\!\!\!\!=\! {\left( a \!-\! \frac{b}{x^2} \right)}^2 e^{ax+\frac{b}{x}} \!+\! \frac{2b}{x^3} e^{ax+\frac{b}{x}} - a^2e^{ax} \!-\! \frac{2b}{x^3} e^{\frac{b}{x}} - \frac{b^2}{x^4} e^{\frac{b}{x}} \notag \\ & \!\!\!\!=\! \left( e^{ax} \!\!-\!1 \!\right) e^{\frac{b}{x}} {\left( a \!-\! \frac{b}{x^2}\! \right)}^{\!2} \!\!+\! a^2\left( e^{\frac{b}{x}} \!-\! e^{ax} \! \right) \!+\! \frac{2be^{\frac{b}{x}}}{x^3} \!\left( e^{ax} \!\!-\! ax \!-\! 1 \right) \notag \\ &\!\!\!\!>\! 0. \end{array}$ Therefore, $f(x)$ is convex in interval $(0,{\textstyle {\sqrt{\frac{b}{a}}}})$. Let $a=u$ and $b=\frac{D\ln2}{Bu}$, we find that $E^T(t^P)$ is convex in $t^P \in (0,\sqrt{\frac{D\ln2}{Bu}})$ and strictly monotonously in $t^P \in[ \sqrt{\frac{D\ln2}{Bu}}, +\infty)$. Along with the convexity and monotonicity of $E^{S}( t^P )$ and $E^{C}( t^P )$, we come to the conclusion that $E^{\mathrm{sum}}( t^P )$ is a convex function in $(0,\sqrt{\frac{D\ln2}{Bu}})$ and strictly monotonously increases in interval $[ \sqrt{\frac{D\ln2}{Bu}}, +\infty)$ and Lemma~\ref{lemma_E_sum} is proved. \subsection{Proof of Lemma 4} To analyse the monotonicity of $\mathbb{E}[S]$, we take the derivative of it in (\ref{S_final}) w.r.t $t^P$ and obtain that \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{dE[S]} \frac{\mathrm{d}\mathbb{E}[S]}{\mathrm{d}t^P} = \frac {e^{ut^P} \left[ {\lambda}^2 e^{ut^P} + v(\lambda + \lambda u t^P + v + 1 + \frac{u(u+\lambda+1)}{u+v+\lambda} ) \right]} {( \lambda e^{ut^P} + v )^2} > 0 \end{equation} Similarly, we take the derivative of $\mathbb{E}[Y^2]/2\mathbb{E}[Y]$ as follows, \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{dEY22EY} \frac{\mathrm{d}}{\mathrm{d}t^P} \frac{\mathbb{E}[Y^2]}{2\mathbb{E}[Y]} = \frac{e^{ut^P}r(t^P)}{{\left( he^{ut^P} + g\right)}^2}, \end{equation} where \vspace{-.1cm} \begin{align} \label{r(t)} r(t^P) =& uh^2e^{2ut^P} + (2ug-1)h^2e^{ut^P} - uhgt^P \notag \\ &+ uhg^2 - hg(1+\frac{u}{v}) - \frac{h+g}{v} + \frac{u(v+\lambda)h}{v(u+v+\lambda)^2}. \end{align} We can easily find that \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{r(0)} r(0) = \frac{u(u+v)^2(2v+\lambda)}{\lambda v^2 (u+v+\lambda)^2} > 0. \end{equation} We further take the derivative of $r(t^P)$ and obtain that \vspace{-.1cm} \begin{equation}\vspace{-.1cm} \label{dr(t)} \frac{\mathrm{d}r(t^P)}{\mathrm{d}t^P} = uh\left(he^{ut^P}+g\right) \left[ 2\left(1+\frac{u}{v}\right)e^{ut^P} - 1\right] > 0. \end{equation} As a result, $r(t)>0$ for $t^P\in(0,+\infty)$ and thus $\mathbb{E}[Y^2]/2\mathbb{E}[Y]$ strictly monotonously increases $(0,+\infty)$. Lemma~\ref{lemma_AoI} is proved. \small \bibliographystyle{IEEEtran}
\section{0pt}{2pt plus 1pt minus 0pt}{0pt plus 1pt minus 0pt} \newtheorem{lemma}{Lemma} \newtheorem{prop}{Proposition} \newtheorem{theorem}{Theorem} \newtheorem{cor}{Corollary} \newtheorem{rem}{Remark} \newtheorem{ex}{Example} \tikzstyle{startstop} = [rectangle, rounded corners, minimum width=4cm, minimum height=1cm,text centered, draw=black, fill=red!20] \tikzstyle{io_impression} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=6cm, minimum height=1cm, text centered, text width=4cm, draw=black, fill=magenta!20] \tikzstyle{io_attribution} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=2cm, minimum height=1cm, text centered, text width=2cm, draw=black, fill=green!20] \tikzstyle{process} = [rectangle, minimum width=6cm, minimum height=1cm, text centered, text width=4cm, draw=black, fill=orange!10] \tikzstyle{process_organic} = [rectangle, minimum width=4cm, minimum height=1cm, text centered, text width=4cm, draw=black, fill=blue!10] \tikzstyle{decision} = [diamond, minimum width=2cm, minimum height=1cm, text centered, text width=2cm, draw=black, fill=green!10] \tikzstyle{arrow} = [thick,->,>=stealth] \tikzstyle{arrowdots} = [dotted,->,>=stealth] \title{Show me the Money: Measuring Marketing Performance in Free-to-Play Games using Apple's App Tracking Transparency Framework} \author{Frederick Ayala-G\'omez\thanks{BANDAI NAMCO Mobile, <EMAIL>; Torre Mapfre, Barcelona, Spain (Work was done at Rovio)(\textbf{Corresponding author})}, Ismo Horppu\thanks{Zynga, <EMAIL>; Aleksanterinkatu 9 A, Helsinki, Finland (Work was done while at Rovio)}, \\ Erlin Gülbenko\u{g}lu\thanks{Rovio Entertainment, \{\textit{name}\}.\{\textit{surname}\}@rovio.com; Keilaranta 7, Espoo, Finland}, Vesa Siivola$^{3}$, and Bal{\'a}zs Pej{\'o}\thanks{CrySyS Lab, <EMAIL>; Magyar tudósok körútja 2, Budapest, Hungary}} \date{} \begin{document} \maketitle \begin{abstract} Mobile app developers use paid advertising campaigns to acquire new users. Marketing managers decide where to spend and how much to spend based on the campaigns' performance. Apple's new privacy mechanisms have a profound impact on how performance marketing is measured. Starting iOS 14.5, all apps must get system permission for tracking explicitly via the new App Tracking Transparency Framework, which shows the users a pop-up asking if they give the app permission to track. If a user does not allow tracking, the required identifier to deterministically find the online advertising campaign that brought the user to install the app is not shared. The lack of an identifier for attribution affects how the campaigns' performance is measured, as the users who do not allow tracking are not mapped one-to-one to a campaign. Instead of relying on individual identifiers, Apple proposed a new performance mechanism called conversion value, which is an integer set by the apps for each user, and the developers can get the number of installs per conversion value for each campaign. However, interpreting how conversion values are used to measure the campaigns performance is not obvious because it requires a method to translate the conversion values to revenue. This paper investigates the task of attributing revenue to advertising campaigns using the reported conversion values per campaign. Our contributions are to formalize the problem, find the theoretically optimal revenue attribution function for any conversion value schema, and show empirical results on past data of a free-to-play mobile game using different conversion value schemas. \end{abstract} \textbf{Keywords}: conversion value, revenue attribution, mobile advertising optimization, performance marketing, privacy \section{Introduction} Mobile applications grow their player base profitably by acquiring players using paid advertising. The objective is to spend less than the revenue generated from the players to use the user acquisition budget in the best possible way. Online advertising overcomes some of the problems highlighted by the famous quote from John Wanamaker: {\it ``Half the money I spend on advertising is wasted; the trouble is, I don’t know which half''}. The quote refers to traditional advertisement channels such as newspapers, billboards, television, radio, leaflets, or any printed media, where the advertiser does not know which users engaged with an ad. With the widespread usage of the internet and mobile devices, a new type of advertising media was born -- the so-called online media, where the marketing managers can measure the performance of the ad campaigns. Online advertising includes, e.g., social networks, search engines, and ad networks, which benefit from knowing how users engage with the ads. Besides the ability to track users who engaged with an ad, the internet and smart devices disrupted how companies advertise their products and services by allowing targeting of ads~\cite{blattberg1991interactive,shankar2009mobile,shankar2016mobile,winer2009new}. Marketers look for online advertising channels that deliver the best return on investment (ROI). Measuring ROI requires calculating the revenue that the ads campaign brought compared to the money spent. For example, if a company invests \$100~USD in advertising an application and the users acquired through it bring \$200~USD in revenue the campaign is profitable with an ROI of 200\%. Of course, the calculation of the return on investment requires attributing the user's revenue to the specific campaigns that brought them to the app. This task is known as attribution, and there are different approaches to it~\cite{hughes2014multiple}. The most common attribution model in online advertising is last-click attribution, which gives all the credit to the last ad that the user engaged with~\cite{dalessandro2012causally}. In the search for higher ROI, online advertising companies started building user profiles. Advertisers benefit from user profiles because they help them find more suitable ads, which increases the chances of converting from impression to action (e.g., click, purchase, install, subscribe). For example, search engines show ads based on user-specific queries, social networks promote products based on user interests, and mobile apps show an advertisement based on the user's collected data. User profiles enable new forms of advertising optimizations where companies may target users with specific criteria. On the other hand, the more collected information there is in the user profiles, the more users become attentive to what the companies know about them. Several surveys show that people are concerned about the control that companies have over their data, and they disagree with the data collection and sharing practices of online services~\cite{eurobarometer_eprivacy,us_ntia}. Governments have taken action to rule how companies use personal data, which led to significant legislative changes. Two recent and notable examples are the European General Data Protection Regulation~\cite{regulation2016regulation}, and the California Consumer Privacy Act of 2018~\cite{ccpa}. As a consequence, technological giants such as Google and Microsoft started to utilize privacy-preserving techniques~\cite{erlingsson2014rappor,ding2017collecting}. Apple has previously introduced various privacy features~\cite{apple2017dp}, and recently they introduced their new version of the ad network API (SKAdNetwork 2.0) with support for a new framework called App Tracking Transparency (ATT). Starting iOS 14.5, app developers cannot share any tracking identifier to advertising networks unless users allow it. The App Tracking Transparency framework allows showing a pop-up dialog asking the user if they want to allow the application to track or not. This privacy innovation has a profound impact on how ad campaigns' performance is measured. Without explicit consent from the user, it will not be possible to do last-click attribution. Inevitably, the effectiveness of mobile advertising is affected, as the lack of the identifier affects how performance is measured and what types of ad personalization are available. Figure~\ref{fig:attribution_before} presents how attribution works when IDFA is available, and Figure~\ref{fig:attribution_after} presents what happens if a user does not allow tracking via the App Tracking Transparency framework, i.e., what happens when users allow tracking and when they do not. The application developers have a 24 hour timer to report a new conversion value for the user. When a new conversion value is set, the 24 hour timer is reset, allowing observing the player for another 24 hours. Increasing the observation period gives more time to observe the player's actions, making conversion value schemas that rely on purchases feasible, as we will show later. Let us introduce a hypothetical example. Suppose that an application developer promotes their app by showing a video and that a user gets interested in the ad, clicks on it, and installs the app. The first time when the user opens the app, they can either allow tracking or not. \begin{ex} If the user allows tracking, an identifier is shared to attribute the install to the clicked ad; and if they spend money on the application, the app developers can attribute the revenue to the ad campaign. \end{ex} \begin{ex} If the user does not allow tracking, the required identifier for attribution is not shared, but instead the advertising networks receive a postback with the campaign ID and a conversion value when it meets certain conditions. \end{ex} \begin{figure*}[t!] \centering \resizebox{.61\textwidth}{!}{ \begin{tikzpicture}[node distance=5cm, inner sep=7, outer sep=2] \huge \node (io_imp) [io_impression] {App A showing an ad promoting app B}; \node (pro_click) [process, below of=io_imp, yshift=-0.5cm] {The user clicks on the ad, visits the App Store, and installs app B}; \node (pro_clickatt) [process, right of=pro_click, xshift=2cm] {IDFA recorded by MMP}; \node (pro_openapp) [process, below of=pro_click, yshift=-0.5cm] {User opens app B for the first time}; \node (pro_openappatt) [process, right of=pro_openapp, xshift=2cm] {App sends IDFA to MMP}; \node (pro_organic) [process_organic, below of=pro_openapp] {User finds app B organically and installs it}; \node (pro_match) [process, right of=pro_openappatt, xshift=2cm] {MMP performs IDFA matching}; \node (dec_match) [decision, below of=pro_match, yshift=-0.5cm] {Known IDFA?}; \node (proatt_paid) [io_attribution, below of=dec_match, yshift=-0.5cm] {Attribute to paid campaign}; \node (proatt_organic) [io_attribution, right of=dec_match, xshift=2cm] {Attribute to organic}; \draw [arrow] (io_imp) -- (pro_click); \draw [arrow] (pro_click) -- (pro_clickatt); \draw [arrowdots] (pro_click) -- node[anchor=east] {} (pro_openapp); \draw [arrow] (pro_openapp) -- (pro_openappatt); \draw [arrowdots] (pro_organic.north) -- (pro_openapp.south); \draw [arrow] (pro_clickatt) -| (pro_match); \draw [arrow] (pro_openappatt) -- (pro_match); \draw [arrow] (pro_match) -- (dec_match); \draw [arrow] (dec_match.south) -- (proatt_paid.north); \draw [arrow] (dec_match) -- (proatt_organic); \end{tikzpicture} } \caption{How last-click attribution works when IDFA is available. The mobile measurement partner (MMP) uses the Identifier for Advertisers (IDFA) to identify the users that engaged with the mobile advertising campaign, and to separate those that installed the app organically (e.g., searching on the AppStore). This process will remain the same for the users that allow apps A and B to track them. } \label{fig:attribution_before} \end{figure*} \begin{figure*}[b!] \centering \resizebox{.61\textwidth}{!}{ \begin{tikzpicture}[node distance=5cm, inner sep=7, outer sep=2] \huge \node (io_imp) [io_impression] {App A showing an ad promoting app B via campaign 1}; \node (pro_click) [process, below of=io_imp, yshift=-1cm] {The user clicks on the ad, visits the App Store, and installs app B}; \node (pro_openapp) [process, below of=pro_click, yshift=-0.5cm] {User opens app B for the first time}; \node (pro_organic) [process_organic, below of=pro_openapp, yshift=-0.5cm] {User finds app B organically and installs it}; \node (pro_openappatt1) [process, right of=pro_openapp, xshift=2cm] {App registers for AdNetwork Attribution}; \node (pro_openappatt2) [process, left of=pro_openappatt1, xshift=12cm] {Update conversion value $v_i$}; \node (dec_match) [decision, below of=pro_openappatt2, yshift=-0.5cm] {24 hours \\ passed?}; \node (proatt) [io_attribution, below of=dec_match, yshift=-0.5cm] {Conversion value postback}; \draw [arrow] (io_imp) -- (pro_click); \draw [arrowdots] (pro_click) -- node[anchor=east] {} (pro_openapp); \draw [arrowdots] (pro_organic) -- node[anchor=east] {} (pro_openapp); \draw [arrow] (pro_openapp) -- (pro_openappatt1); \draw [arrow] (pro_openappatt1) -- (pro_openappatt2); \draw [arrow] (pro_openappatt2) -- (dec_match); \draw [arrow] (dec_match.east) -| (20, -11.5) node[anchor=west, xshift=0.0cm, yshift=-2cm] {higher $v_i$} -- (pro_openappatt2.east); \draw [arrow] (dec_match) -- node[anchor=east, xshift=11cm] {Yes, wait randomly up to 24 hours} (proatt); \end{tikzpicture} } \caption{Attribution when a user does not allow tracking via the App Tracking Transparency framwork. If the user does not allow tracking, then the attribution is done via conversion value. The conversion value postback contains various attributes about the network and campaign, but it does not have an ID for mapping the user and the advertising campaign that brought them. Application developers can track the conversion value for each user but not their origin.} \label{fig:attribution_after} \end{figure*} At a glance, the conversion values are a privacy-preserving mechanism proposed by Apple to measure an advertising campaign's performance without disclosing the user's origin. In its core, conversion value separates the users into buckets. The application developers are free to determine the bucket for each user based on the available information about them, e.g., they could use revenue, in-app events, retention, device type, and so on. On the other hand, application developers do not know what campaign brought the user or if the user came organically, so this information cannot be incorporated into the conversion value. Instead, Apple reports the count of users with the same conversion values per campaign via postbacks. Essentially --- based on the currently available information --- the conversion values provide an ad-hoc privacy protection in the``hide-in-the-crowd' sense; such as $k$-anonymity~\cite{sweeney2002k}, $l$-diversity~\cite{machanavajjhala2007diversity}, $t$-closeness~\cite{li2007t} (instead of differential privacy~\cite{desfontaines2020sok} which has a formal privacy guarantee). Apple released iOS 14.5 in April 2021, and its impact is already showing on advertising networks. In the 2021 Q3 Snapchat earnings call, their CEO Evan Spiegel explained that one of the reasons why they missed their revenue guidance was the following: ``Our advertising business was disrupted by changes to iOS ad tracking that were broadly rolled out by Apple in June and July. While we anticipated some degree of business disruption, the new Apple provided measurement solution did not scale as we had expected, making it more difficult for our advertising partners to measure and manage their ad campaigns for iOS ''\cite{snap_incq3}. Snapchat stock plummeted more than 25\% after missing the earnings guidance. Facebook comments on the impact of iOS during their 2021 Q3 earnings call: ``Overall, if it wasn’t for Apple’s iOS14 changes, we would have seen positive quarter-over-quarter revenue growth. And while we and our advertisers will continue to feel the effect of these changes in future quarters, we will continue working hard to mitigate them.''\cite{facebook_incq3}. Twitter mentioned that ``It's still too early for Twitter to assess the long-term impact of Apple's privacy-related iOS changes, but the Q3 revenue impact was lower than expected, and we've incorporated an ongoing modest impact into our Q4 guidance''\cite{twitter_incq3}. Finally, Alphabet commented that the impact of the iOS changes was ``a modest impact on YouTube revenues'' \cite{google_incq3}. There is no doubt that marketing teams need a way to measure the performance of marketing campaigns under the new privacy-preserving mechanisms that Apple enforced starting iOS 14.5. \paragraph{Contribution. } This paper investigates various conversion value schemas in combination with revenue attribution functions. Our contributions shed light on using the conversion values for attributing the revenue to the advertising campaigns. More specifically, our contributions are the following: {\it i)} formalizing the problem of revenue attribution based on conversion values, {\it ii)} finding the revenue attribution function which minimizes the attribution error for any conversion value schema, {\it iii)} showing the revenue attribution quality of different conversion value schemas via back-testing on historical data. \paragraph{Organization. } In Section~\ref{sec:pre_rw} we provide the preliminaries for the conversion value schema \& revenue attribution and briefly review the relevant related work. In Section~\ref{sec:mod} we present the models used for attributing the revenue to campaigns, provide a corresponding privacy analysis, and find theoretically the optimal revenue attribution function. In Section~\ref{sec:exp} we show our experimental results and in Section~\ref{sec:conclusions} we conclude the paper. \section{Background \& Related Work}\label{sec:pre_rw} This section introduces the concepts and methods used in the rest of the paper, such as conversion value, Identifier for Advertisers (IDFA), last-click attribution, and user origin. Moreover, we survey the related literature concerning both privacy and revenue attribution using conversion values. For a general view on the challenges of privacy-centric digital advertising refer to G. Johnson et. al. \cite{johnson2021privacy}. \subsection{Revenue Attribution} Knowing the advertising campaign that brought a player to the game helps assign the revenue generated from the player to the campaign, which is needed to measure ROI. App developers promote their apps in various ad networks. Hence, a user might see ads for the same app in more than one network. This leads to the question {\it what was the ad that caused the install?} There are several approaches to answering this question~\cite{li2016attribution}. For instance a top-down based approach is marketing mix modeling~\cite{chen2017_marketingmix}. Other approaches are click-based methods such as first-click attribution~\cite{li2016attribution}, equal attribution~\cite{kannan2016path}, and last-click attribution~\cite{li2016attribution}. There is an orthogonal research direction on how to improve click-based attribution methods. In this paper, we focus on the last-click attribution since it is the most commonly used method in online advertising~\cite{dalessandro2012causally}. Recent research suggests that in the mobile gaming industry only 9.5\% of the observed installs had impressions from more than one channel during a seven-day attribution window~\cite{syrjanen2019multi}. In last-click attribution, we attribute the install to the last ad the user engaged with before/ installation. Handling the last-click attribution is a complex problem, and often app developers delegate the task to attribution partners responsible for determining the last ad a user clicked. \paragraph{User Origin. } The origin of a user can be organic, paid advertisement, and cross-promotion. The organic users have found the app in the App Store without previously engaging with an ad, for example, by searching for the app or scrolling through a list of popular apps, non-sponsored recommendations (e.g., App Store Best of 2021), and non-sponsored keywords. Paid advertising includes, for example, social networks, search engines, or in-app ads. Cross-promotion happens when users install the game by engaging with an ad from the same developer shown in their apps. The ability to separate a user's origin allows companies to use the revenue from paid origin users to measure the ROI. The separation of these origins allows modeling the app's virality (i.e., organic users invited by users from the paid origin) to include a share of the organics' revenue into the ROI calculation. This paper focuses on understanding how conversion values help attribute users' revenue from the paid and organic origin. \paragraph{Identifier for Advertisers. } An identifier is required to know if a user came from a paid origin or organically. In the Apple ecosystem, the identifier is called Identifier for Advertisers (IDFA), and its purpose is to allow tracking without disclosing the user's identity. Starting iOS 14.5, users can set their preference for app tracking globally or per app. The users may disable allowing apps to request to track system-wide, which means that the pop-up to give tracking consent is not shown. If users allow apps to request to track, they can individually allow an application to know their IDFA. The IDFA will serve its purpose only for the apps that the user gives system consent. For last-click attribution to work, the user must give tracking consent in the app where the ad is shown and in the app that is being promoted. \paragraph{Conversion Value. } The conversion values are based on Apple's developer documentation of the \texttt{SKAdNetwork 2.0}~\cite{apple_doc_skadnetwork} and \texttt{update}-\texttt{ConversionValue}~\cite{apple_doc_cv}. The conversion value is an integer $v\in [0, 63]$ that developers can set. The conversion value is assigned for the first time when a user opens the app (i.e., not when the user installs the app). Developers can increment the value within 24 hours of the last update. If there has been no update within 24 hours, the advertiser receives a postback of the install after a random time between 0 to 24 hours. Even though theoretically this would allow for a two-month time window to update the conversion value, receiving the ad campaign's conversion value after two months is not very useful to guide advertising spend. Practically, a period of up to seven days seems to be a maximum delay that makes sense, with many ad networks recommending much shorter windows (e.g., a 24 hour period)~\cite{conf_adj, conf_sing}. The conversion value ranges from 0 to 63, and it is often modeled using a binary representation of six bits, where each bit may represent an action of the users as a logical condition (e.g., user passed tutorial, reached a certain level). \begin{ex} A conversion value schema can use different bits for different things. An example of such schema would be using 2 bits to capture the days since the first opening (i.e., \texttt{00} initially, then \texttt{01}, \texttt{10}, \texttt{11} respectively after 1, 2, and 3 days) and 4 bits for in-app events, such as unlocking various app features and/or making purchases. \end{ex} \paragraph{Revenue Attribution using Conversion Values. } The task of attributing revenue using conversion values is very recent. To the best of our knowledge, our work is the first that formally investigates the task. However, related work can be found on the Web. An overview of the changes in \texttt{SKAdNetwork 2.0} is presented in~\cite{skadnetwork_101,apple_killed_idfa}. Closer to our work is~\cite{algolift_prob_rev}, where the authors present two approaches that rely on the user's conversion value empirical conditional probability of belonging to a campaign. The first approach is `winner takes all', which assigned the user (and its revenue) to the campaign with the highest empirical conditional probability. The second approach is `probabilistic attribution', which multiplies the user's revenue by the empirical conditional probability of coming from each campaign given the conversion value, and sums it at the campaign level. We use an equivalent approach in Equation~\ref{eq:sol}, but instead of attributing revenue using the user-campaign probabilities, we use the expected revenue per conversion value multiplied by the count of conversion values per campaign and show that this method is optimal. \subsection{Related Privacy Literature} Many privacy preserving techniques were introduced in the last quarter century. One of the most famous is $k$-anonimity~\cite{sweeney2002k} which requires that any user contained in the dataset cannot be distinguished from at least $k-1$ other users. This was later improved by $l$-diversity~\cite{machanavajjhala2007diversity}, $t$-closeness~\cite{li2007t}, and $n$-confusion~\cite{stokes2012n}. The main drawback of the methods described above is that they define anonymity as a property of the dataset. Another wide-spread privacy mechanism is Differential Privacy~\cite{dwork2006differential} where anonymity is defined as a property of the process, making it resilient to any privacy attack based on background knowledge. It was adapted to numerous scenarios, each requiring its own fine-tuning of the definition~\cite{desfontaines2020sok}. These approaches are widely utilized in the industry as well as by organizations like Google~\cite{erlingsson2014rappor}, Microsoft~\cite{ding2017collecting}, LinkedIn~\cite{kenthapadi2018pripearl}, Uber~\cite{chorus2018johnson}, and Apple~\cite{apple2017dp}. We are not aware of any official well-detailed documentation concerning Apple's conversion value, only press releases, and blog posts~\cite{skadnetwork_101,apple_killed_idfa,algolift_prob_rev}. Apple is not willing to reveal details about the mechanisms governing the conversion values. When Apple announced using differential privacy, they did it without telling crucial elements~\cite{tang2017privacy}. Although this can also be seen as additional level of protection, it is well-known and widely believed that security and privacy by obscurity is never a good idea. The reason originates from cryptography, where it is always assumed that the enemy knows the system being used~\cite{shannon1949communication}. \section{Formalizing \& Analyzing Conversion Values}\label{sec:mod} This section illustrates the problem, formalizes it, and analyzes it. Our goal is to capture the scenario with all its details via a flexible mathematical model (e.g., it is adaptable for future changes concerning the conversion value schema), as it is not certain how the conversion value schema is enforced. Yet, based on our empirical observations (concerning the conversion value schema) and despite the intricate nature of the problem, our analysis lands itself on a simple solution concerning the optimal revenue attribution function, which minimizes the difference between attributing revenue using conversion values and last-click attribution with IDFA. The variables used in the paper are introduced individually in this section as well as summarized in Table~\ref{tab:params}. \begin{table*}[t!] \begin{tabular}{p{.05\linewidth}|p{.8\linewidth}} Sym. & Meaning \\ \midrule $i$ & User ID, in-between $1$ and $|U^d|$. \\ $d_i$ & User's registration date: the first time a user opens the app. \\ $t$ & Number of days for the revenue to be accumulated (e.g., 3, 7, 14, 30, 90, etc.). \\ $d$ & The date when the conversion values are reported (sufficiently later than any $d_i$). \\ $\alpha_i$ & User combined network and campaign ID: $\alpha=100\cdot n + c$. Note that $0\le c\le99$. \\ $\beta$ & The upper limit on $\alpha$ (i.e., $100\cdot n + c<\beta$). $\alpha=\beta$ corresponds to the organic users. \\ $r_i^t$ & Accumulated revenue of the corresponding user $i$ for the first $t$ days after $d_i$. \\ $\mathcal{U}_i$ & User features dataset (i.e., remaining information about the user). \\ $u_i^d$ & $=(d_i, r_i^t, \alpha_i, \mathcal{U}_i)$, user data at $d$ where campaign IDs are known. \\ $v_i^d$ & Conversion value of user $i$ at $d$. Without subscript we mark the different conversion values. \\ $\tilde{u}_i^d$ & $=(d_i, r_i^t, v_i^d, \mathcal{U}_i)$, user data when only conversion values are available instead of $\alpha_i$. \\ $f(\cdot)$ & Conversion value schema or conversion value model (e.g., $f(u_i^d\setminus\{\alpha_i\})=v_i^d$). \\ $x_{v,\alpha}^d$ & $\in X^d$, the count of users in $v$ bucket at $d$ corresponding to $\alpha$. \\ $y_\alpha^t$ & Accumulated last-click attribution revenue for $\alpha$ based on the first $t$ days of the users. \\ $\tilde{U}_v^d$ & Set of all users (i.e., independently of $d_i$) with conversion value $v^d$, i.e., $\forall\tilde{u}_i\in\tilde{U}_v^d:v_i=v$. \\ $\bar{r}_v^t$ & The average first $t$ days revenue of users in $\tilde{U}_{v}^d$ at $d$, i.e., $\bar{r}_v^t=\frac{\sum_{\tilde{U}_v^d}r_i^t}{|\tilde{U}_v^d|}$. \\ $pr_p(\cdot)$ & Privacy preserving method with privacy threshold $p$. \\ $\hat{x}_{v, \alpha}^d$ & $\in \hat{X}^d=pr_p(X^d)$, the conversion value counts after applying the privacy protection. \\ $g_\alpha(\cdot)$ & Function to attribute the revenue of $\alpha$ at $d$. Input: $(\tilde{U}_v^d, \hat{x}_{v,\alpha})$. \\ \end{tabular} \caption{Summary of the variables used in the paper. } \label{tab:params} \end{table*} \subsection{Problem Illustration} Initially, the app developers could distinguish between paid and organic users. Thanks to IDFA and attribution methods like last-click attribution they could map the users to their origin, network, and advertising campaign. A common practice for measuring the ROI is to group users in cohorts based on their registration date, origin, network, campaign, and country. At the cohort level, one can aggregate the cost of acquiring the users and the revenue generated by them, which helps monitor ROI. For simplicity, we note user IDs as $i\in\{1,2,\dots\}$ and the registration date of a user $i$ as $d_i$. We are interested in $r_i^t$ which is the accumulated revenue of user $i$ from their registration $d$ until time $t$, so we must restrict ourselves to users with $d_i\le d-t$. This is necessary; otherwise, the revenue attribution would become a prediction problem because we would not know $r_i^t$.% \footnote{This is an important and exciting research question by itself and studied extensively~\cite{schmittlein1987counting,fader2005counting}. On the other hand, the problem studied in this paper (i.e., revenue attribution based on conversion values) attributes actual data from the user rather than forecasted data.} The users satisfying this condition are captured as $u_i^d\in U_t^d$. For convenience, we define the combination of network ID $n\in\mathbb{N}$ and ad campaign ID $c\in[0,99]$ to be $\alpha=100\cdot n+c$ because Apple restricts the amount of campaigns per network to 100. We denote with $\beta$ the total number of different network and campaign combinations, hence $0\le\alpha<\beta$. Note that the organic users correspond neither to any networks nor campaigns, hence, we capture them by setting their combined network and campaign ID to $\beta$. Table~\ref{tab:original} presents the initial dataset when IDFA is available. User-wise data is shown in Table~\ref{tab:userwise_PRE}, and Table~\ref{tab:campaignwise_PRE} shows the cumulative revenue $y_\alpha^t$ of the first $t$ days for each ad network \& campaign, which simplifies calculating the ROI. Formally, this represents the data corresponding to $u_i^d$ as a tuple $\{d_i, r_i^t, \alpha_i, \mathcal{U}_i\}$. The tuple includes the registration date, the first $t$ day revenue generated by the user, the user's origin, and --- for the sake of completeness --- it also contains $\mathcal{U}_i$ which captures any other related information about user $i$ such as event-level data within the app. \begin{table}[t!] \begin{subtable}{\linewidth}\centering \begin{tabular}{c|c|cc|c} \toprule User ID $i$ & Revenue $r^t$ & Net. ID $n$ & Cam. ID $c$ & $\alpha_i$ \\ \midrule $1$ & $0$ USD & $4$ & $05$ & $405$ \\ $2$ & $2.99$ USD & $-$ & $-$ & $\beta$ \\ $3$ & $0$ USD & $3$ & $89$ & $389$ \\ $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ \\ $|U|$ & $4.99$ USD & $1$ & $71$ & $171$ \\ \bottomrule \end{tabular} \caption{Available user-wise data.}\label{tab:userwise_PRE} \end{subtable}% \begin{subtable}{\linewidth}\centering \begin{tabular}{c|cc|c} \toprule $\alpha$ & Net. ID $n$ & Cam. ID $c$ & Revenue $y^t$ \\ \midrule $000$ & $0$ & $00$ & $245$ USD \\ $001$ & $0$ & $01$ & $92$ USD \\ $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ \\ $099$ & $0$ & $99$ & $811$ USD \\ \midrule $100$ & $1$ & $00$ & $373$ USD \\ $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ \\ $199$ & $1$ & $99$ & $373$ USD \\ \midrule $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ \\ \midrule $\beta$ & $-$ & $-$ & $1639$ USD \\ \bottomrule \end{tabular} \caption{Available campaign-wise data.}\label{tab:campaignwise_PRE} \end{subtable}% \caption{Illustration of the user data which are available to add developers before Apple's App Tracking Transparency came out.} \label{tab:original} \end{table} \begin{table}[t!] \begin{subtable}{\linewidth}\centering \begin{tabular}{c|cccc} \toprule User ID $i$ & $1$ & $2$ & $\cdots$ & $|U|$ \\ \midrule $r_i^t$ & $0$ USD & $2.99$ USD & $\cdots$ & $4.99$ USD \\ $v_i$ & 0 & 6 & $\cdots$ & 63 \\ \bottomrule \end{tabular} \caption{Available user-wise data.}\label{tab:userwise_POST} \end{subtable}% \begin{subtable}{\linewidth}\centering \begin{tabular}{c|cccc|ccc|c} \toprule $\alpha$ $\rightarrow$ & $000$ & $001$ & $\cdots$ & $099$ & $100$ & $\cdots$ & $199$ & $\cdots$ \\ \midrule $v=0$ & $19$ & $420$ & $\cdots$ & $88$ & $0$ & $\cdots$ & $36$ & $\cdots$ \\ $v=1$ & $355$ & $107$ & $\cdots$ & $31$ & $279$ & $\cdots$ & $151$ & $\cdots$ \\ $v=2$ & $329$ & $22$ & $\cdots$ & $34$ & $528$ & $\cdots$ & $2$ & $\cdots$ \\ $\vdots$ & $\vdots$ & $\vdots$ & $\ddots$ & $\vdots$ & $\vdots$ & $\ddots$ & $\vdots$ & $\vdots$ \\ $v=63$ & $138$ & $346$ & $\cdots$ & $54$ & $7$ & $\cdots$ & $189$ & $\cdots$ \\ \bottomrule \end{tabular} \caption{Available campaign-wise data.}\label{tab:campaignwise_POST} \end{subtable}% \caption{Illustration of the user data which are available to add developers after App Tracking Transparency came out. } \label{tab:new} \end{table} With the enforcement of App Tracking Transparency, the data presented in Table~\ref{tab:original} will not be available for the vast majority of the users, as explicit tracking system consent must be given. Instead, the application developers have two tables available. The first contains the conversion values $v_i$ and the revenues $r_i^t$ for all the app users, as presented in Table~\ref{tab:userwise_POST}. The second contains the aggregate count of conversion values $X^d$ at time $d$, as shown in Table \ref{tab:campaignwise_POST}.% \footnote{App developers do not receive the conversion values for $\beta$ (i.e., organic users) but can estimate them by subtracting the number of reported conversion values to the number of installs.} Formally, when IDFA is not available, the user's tuple $u_i^d$ contains the same data, but instead of $\alpha_i$ the user $i$'s conversion value $v_i$ will be included. We encapsulate this with $\tilde{u}_i^d=\{d_i, r_i, v_i, \mathcal{U}_i\}$. The conversion value itself is computed from available user data via a conversion value schema $f$, i.e., $f(u_i^d\setminus\{\alpha_i\})=v_i$.\footnote{Note that our mathematical model slightly simplify the scenario visualized in Figure \ref{fig:attribution_after}, as we do neither consider the 24h delay from last conversion value update nor the additional 0-24h random delays, i.e., the conversion value count $X^d$ includes all users with $d_i\le d-t$. In contrast, our empirical analysis in Section \ref{sec:exp} does consider these, and follows further empirical observations obtained by interacting with the SKAdNetwork: any user belonging to $X^d$ are disregarded for any future $X^{d^\prime}$ where $d<d^\prime$.} To ease the presentation of this paper we define three additional variables: $\tilde{U}_v^d$ is the set of users with the same conversion value on day $d$, $\bar{r}_v^t$ is the average revenue from users in $\tilde{U}_v^d$ within the first $t$ days, and $g$ is the function to attribute the revenues based on the conversion value counts (i.e., $g$ approximates $y_\alpha^t$). In the rest of the paper, we slightly abuse the notations by leaving out superscript $dwhen it $ does not play a significant role. \subsection{Privacy Protection} The count of conversion values provides privacy protection in the form of `hide-in-the-crowd', as the campaign information does not contain user identifiers. Individual users could still be connected with specific networks and campaigns if the size of a conversion value buckets are low. For instance if only user $i$ has a specific conversion value then Table \ref{tab:new} would indeed reveal user $i$'s origin $\alpha_i$. To overcome this problem, Apple proposed the privacy threshold $p$, a predefined (and currently unknown) value that provides further protection.% \footnote{ Apple's SKAdNetwork documentation~\cite{apple_doc_skadnetwork} mentions that \emph{``The postback may include a conversion value and the source app’s ID if Apple determines that providing the values meets Apple’s privacy threshold''}.} On the other hand the documentation does not mention on which level the $p$ is enforced, e.g., only conversion value level (i.e., $|\tilde{U}_v^d|\ge p$), conversion value and campaign level (i.e., $x_{v,\alpha}^d\ge p$), country level, etc.). In practice, Apple will not report the count of users in the conversion values where there are less than $p$ users, and instead, those counts will be reported as \texttt{null}. Moreover, the users with such a conversion value are not discarded. Instead, the set of conversion values is extended with \texttt{null}, i.e., $v\in\{\texttt{null}, 0, 1, \dots, 63\}$ which aggregates all the users from below the threshold conversion values. \begin{align} \label{eq:privacy} pr_p(X)=\hat{X}= \begin{cases} \hat{x}_{v,\alpha}= \begin{cases} x_{v,\alpha} & \text{if } \sum_U\mathbbm{1}(v_i=v) \ge p \\ \texttt{null} & \text{otherwise} \end{cases} \\ \hat{x}_{\texttt{null},\alpha}=\sum_v\mathbbm{1}(\hat{x}_{v,\alpha}=\texttt{null})\cdot x_{v,\alpha} \end{cases} \end{align} Formally, our interpretation of the privacy mechanism (based on what we experience by interacting with the corresponding ecosystem post App Tracking Transparency) is defined in Equation \ref{eq:privacy}, where $\mathbbm{1}$ is the indicator function. This mechanism is similar to $k$-anonymity~\cite{sweeney2002k}, which requires all users to be indistinguishable from at least $k-1$ other users. On the other hand, it does not satisfy that because the condition is not enforced on $\hat{x}_{\texttt{null},\alpha}$. \begin{ex} For instance, if there is a single user (e.g., $i$) with a particular conversion value (e.g., $v_i$), for all $\alpha$ the values $\hat{x}_{v_i,\alpha}$ are set to \texttt{null}. Moreover, if we assume that the size of all other conversion values are above $p$, then $\hat{x}_{\texttt{null},\alpha}=0$ for all $\alpha$ except for $\alpha_i$ in which case it is 1. Consequently, user $i$ is not similar to $p-1$ other users as they can be singled out. \end{ex} \subsection{Revenue Attribution Functions} \label{sec:th} The revenue attribution function $g$ plays a central role in our research, as we want to approximate the actual campaign-wise revenues $y_\alpha^t$ via the conversion values. This attribution error minimization problem is shown in Equation~\ref{eq:problem}. Although $f$ is not explicit in the formula to be minimized, it defines $\tilde{U}_{v}^d$ as it contains users with $f(u_i^d\setminus \{\alpha_i\})=v_i^d$. \begin{equation} \label{eq:problem} \min_f\left[\sum_\alpha\left(\sum_vg\left( \tilde{U}_v^d,\hat{x}_{v,\alpha}^d\right)-y_\alpha^t\right)^2\right] \end{equation} First, instead of focusing on $f$, we show the optimal $g$ when there is no privacy threshold for conversion values (i.e., when $p<2$). When $p=0$ it is meaningless, and when $p=1$ it only changes the 0 values to \texttt{null}, making no real difference between $X$ and $\hat{X}$. \begin{theorem} \label{th:revenue} Only based on $\tilde{U}$ (i.e., without any prior background knowledge about the distribution of users corresponding to any $\alpha$) and if $p<2$ (i.e., we assume $\hat{x}_{v,\alpha}^d=x_{v,\alpha}^d$ so there is no additional privacy protection) then independently of $f$, the attribution function defined in Equation~\ref{eq:sol} minimizes Equation~\ref{eq:problem}. \begin{equation} \label{eq:sol} g_{\alpha}\left(\tilde{U}_v^d, x_{v,\alpha}^d\right)=x_{v,\alpha}^d\cdot\bar{r}_v^t \end{equation} \end{theorem} \begin{proof} See in the Appendix. \hfill\qedhere \end{proof} Now we relax our initial condition about $p$ and focus on the case when the privacy threshold is applied (i.e., when $p\ge2$). The exact privacy preserving mechanism used by Apple is unknown, therefore we are using Equation \ref{eq:privacy} based on empirical available post-back data. The revenue attribution function defined in Equation \ref{eq:sol} does not consider the \texttt{null} bucket. To account for the \texttt{null} bucket, we propose two attribution functions in the form of Equation \ref{eq:rev_all}, where $\fbox{$\phantom{12}$}$ should be filled accordingly. \begin{equation} \label{eq:rev_all} g_{\alpha}\left(\tilde{U}_v^d, x_{v,\alpha}\right)= \begin{cases} \bar{r}_v^t\cdot\hat{x}_{v,\alpha} & \text{if } \hat{x}_{v,\alpha}\not=\texttt{null} \\ \bar{r}_v^t\cdot\fbox{$\phantom{12}$}\cdot\sum_U\mathbbm{1}(v_i=v) & \text{otherwise} \end{cases} \end{equation} \paragraph{Uniform Revenue Attribution (\textbf{U}). } Distributing the revenue uniformly across all possible networks and campaigns, i.e., $\frac1\beta$ should fill $\fbox{$\phantom{12}$}$ in Equation \ref{eq:rev_all}. This function is used as a pessimistic baseline because it does not use any information from $\hat{X}^d$. \paragraph{Null-based Revenue Attribution (\textbf{N}). } Distributing the revenue based on the empirical distribution defined by the \texttt{null} bucket, i.e., $\frac{\hat{x}_{\texttt{null},\alpha}} {\sum_\alpha\hat{x}_{\texttt{null},\alpha}}$ should fill $\fbox{$\phantom{12}$}$ in Equation \ref{eq:rev_all}. This function is based on the `sum' of the distribution corresponding to conversion values below the threshold $p$. Although we have no prior background information about the user distributions within the conversion values, we can still utilize \texttt{null} bucket for those below $p$. \begin{theorem} \label{th:revenueP} Only based on $\tilde{U}$ (e.g., without any prior background knowledge about the distribution of users corresponding to any $\alpha$) for any $f$, the attribution function defined in Equation~\ref{eq:rev_all} minimizes Equation~\ref{eq:problem} where $\fbox{$\phantom{12}$}$ is a convex combination of \textbf{U} and \textbf{N}. \end{theorem} \begin{proof} See in the Appendix. \hfill\qedhere \end{proof} \section{Experiments}\label{sec:exp} This section introduces several conversion value schemas and shows the corresponding empirical results combined with the introduced revenue attribution functions. \paragraph{Setup. } We experiment using data from a globally launched free-to-play mobile game developed by one of the biggest mobile game developer's. To generate the ground truth dataset, we used six months of historical data from cohorts with revenue matured up to 90 days (i.e., players that have played at least 90 days). The dataset includes more than 500K paid players which constitutes a significant share of players in the time window. The users correspond to 213 campaigns scattered across 7 networks, hence $\beta=214$ (i.e., 213 plus organic). Using historical data allows us to compare the attributed revenue with the actual data from last-click attribution. We calculate the conversion value for each user in the dataset according to the schema we want to evaluate. Because neither the exact privacy threshold nor the level (e.g., globally, country-wise, etc.) is known as of now, we use Equation~\ref{eq:privacy} with different values of $p$ and with country-level privacy protection. We build the matrix $\hat{X}^d$ eight times separately: six for countries with the largest user bases and two for the rest grouped randomly. Instead of using the registration date of the players, we use weekly cohorts, meaning that the matrix $X^d$ contains the sum of counts of daily conversion values per week starting from Monday. We calculate the error per week and then aggregate the error from different weeks using a weighted average where the weight is the week's revenue. The experiments were implemented in Python and ran in a single machine with 64 vCPU and 512 GB of RAM. \subsection{Conversion value schemas}\label{sec:cv_scheme} In Section \ref{sec:th} we described the revenue attribution function $g$ and showed theoretically which is the optimal. Concerning conversion value schema $f$ we do not pursue this direction. Rather, we assign meaning to each of the six bits of the conversion values by defining three types of bits: {\it T} bits used for time (i.e., day), {\it V} bits used for revenue, and {\it C} bits used for a logical condition (e.g., data captured within $\mathcal{U}$: device is tablet or smartphone, user passed tutorial, user reached a certain level, etc.). Using these bits we specify various conversion value schemas. It is worth mentioning that schemas using data beyond the registration day (i.e., day 0) are challenging in practice because they depend on the user coming back to play within 24 hours and to update the conversion value while the player is using the application. Although this was not utilized in our theoretical results concerning the revenue attribution function $g$, the experiments about the conversion value schema $f$ take into account the fact that the user needs to be active in a 24 hour time window since the last update and the new conversion value must be higher than previous one. Next we define five conversion value schemas. \paragraph{Day 0 event-based (\textbf{EV}). } Using data from $\mathcal{U}_i$, we encode six actions taken by the user during their first day of using the app (i.e., {\it CCCCCC}), each taken action corresponding to one bit (e.g., finishing the tutorial is bit $0$, reaching certain level is $1$, etc.). Figure \ref{fig:ev_schema} shows an example of the frequency distribution of conversion values obtained using an \textbf{EV} schema\footnote{Some networks have a limitation of using just the first 24 hours of data to fix the conversion value for certain types of campaign optimizations (e.g., Facebook~\cite{link2}). For those networks, the only realistic schema would be the \textbf{EV}.}. \paragraph{Rolling Revenue \& Rolling Purchase Count (\textbf{RR} \& \textbf{RI}). } Both rolling schemas are utilizing some bits {\it T} for keeping track of the days that have passed from the first opening. The remaining bits are defined by the purchases: \textbf{RR} uses bits {\it V} for bucketing the actual revenue while \textbf{RI} uses bits {\it C} for bucketing the purchase counts of the user during the observation period, i.e., the first accumulates the total value of purchases while the latter counts how many purchases happened. Users without revenue are assigned to the zero bucket, and those with revenue are distributed uniformly based on their revenue. For example, \textbf{D7 RR} is defined as {\it TTTVVV}, where {\it T} bits capture day 0-7 and {\it V} bits are based on the current user's revenue. In order to not disclose business confidential information, plots on revenue schemas could not be provided. \paragraph{Uniform distribution (\textbf{UD}). } Distributing users in conversion values at random. This schema is used as a pessimistic baseline because it does not use any information of the user. \paragraph{Perfect life time value (\textbf{PV}).} Using six {\it V} bits to bucket users based on the future cumulative revenue of the user. This is a hypothetical schema as it uses data which is not available in practice~\cite{malthouse2005can}. For example, \textbf{D30 PV} is defined as {\it VVVVVV}, where bits are based on the user's cumulative revenue until day 30. The schema serves as an optimistic baseline because it places users in a manner that their revenue is close to the conversion value's expected revenue. \begin{figure}[t!] \centering \includegraphics[width=0.67\textwidth]{EV_Schema.png} \caption{Histogram of conversion values using day 0 event-based (\textbf{EV}) schema when $p=0$. The plot is normalized so that the sum of bars is 1.} \label{fig:ev_schema} \end{figure} \subsection{Results} \begin{table*}[t] \begin{subtable}{\linewidth}\centering \begin{tabular}{c|c|cc|cc|cc} \toprule & $p=0$ & \multicolumn{2}{c|}{$p=2$} & \multicolumn{2}{c|}{$p=10$} & \multicolumn{2}{c}{$p=100$} \\ \midrule \backslashbox{$f$}{$g$} & Eq. \ref{eq:sol} & \textbf{U} & \textbf{N} & \textbf{U} & \textbf{N} & \textbf{U} & \textbf{N} \\ \midrule \textbf{D30 PV} & \boxed{0} & \boxed{0} & 1 & \boxed{0} & -2 & \boxed{0} & 28 \\ \midrule \textbf{EV} & -42 & -25 & -25 & -2 & -8 & 15 & 17 \\ \textbf{D1 RR} & -32 & -19 & -19 & -5 & -5 & 18 & 24 \\ \textbf{D1 RI} & -34 & -20 & -20 & 0 & -3 & 17 & 26 \\ \textbf{D3 RR} & -21 & -9 & -8 & -15 & -10 & 11 & 35 \\ \textbf{D3 RI} & -25 & -12 & -11 & -7 & -17 & 6 & 33 \\ \textbf{D7 RR} & -17 & -4 & -4 & -14 & -6 & -7 & 25 \\ \textbf{D7 RI} & -21 & -8 & -7 & -7 & -6 & -6 & 32 \\ \midrule \textbf{UD} & -62 & -43 & -43 & -15 & -15 & 10 & 10 \\ \bottomrule \end{tabular} \caption{Attribution benchmark for cumulative \emph{campaign revenue}.} \label{tab:schemes_at_g_campaign} \end{subtable} \begin{subtable}{\linewidth}\centering \begin{tabular}{c|c|cc|cc|cc} \toprule & $p=0$ & \multicolumn{2}{c|}{$p=2$} & \multicolumn{2}{c|}{$p=10$} & \multicolumn{2}{c}{$p=100$} \\ \midrule \backslashbox{$f$}{$g$} & Eq. \ref{eq:sol} & \textbf{U} & \textbf{N} & \textbf{U} & \textbf{N} & \textbf{U} & \textbf{N} \\ \midrule \textbf{D30 PV} & \boxed{0} & \boxed{0} & 2 & \boxed{0} & 7 & \boxed{0} & 46 \\ \midrule \textbf{EV} & -32 & -15 & -15 & 7 & 7 & 23 & 34 \\ \textbf{D1 RR} & -24 & -11 & -10 & 2 & 5 & 28 & 40 \\ \textbf{D1 RI} & -26 & -12 & -11 & 8 & 14 & 26 & 43 \\ \textbf{D3 RR} & -15 & -2 & -1 & -11 & -1 & 15 & 50 \\ \textbf{D3 RI} & -17 & -5 & -4 & -2 & 2 & 9 & 51 \\ \textbf{D7 RR} & -11 & 1 & 2 & -13 & 1 & -6 & 44 \\ \textbf{D7 RI} & -13 & 0 & 1 & -5 & 6 & -6 & 50 \\ \midrule \textbf{UD} & -50 & -31 & -31 & -3 & -3 & 11 & 11 \\ \bottomrule \end{tabular} \caption{Attribution benchmark for cumulative \emph{network revenue}.} \label{tab:schemes_at_g_network} \end{subtable} \caption{Attribution benchmark for 30 days of cumulative revenue. The error metric is normalized with \textbf{D30 PV} combined with \textbf{U} (also noted with a box). A negative value means worse than baseline and a positive value means better than baseline. } \label{tab:schemes_at_g} \end{table*} We want to know how the introduced conversion value schemas presented in Section~\ref{sec:cv_scheme} perform in revenue attribution. We experimented by backtesting on past data, hence the ground truth is available via the data reported by our Mobile Measurement Partner. This allows us to measure the revenue attribution error of various conversion value schemas. Our results are presented in Table \ref{tab:schemes_at_g} where the prefix in the first column shows the number of bits used for time, e.g., D1 corresponds to 1 bit (one day). As described in Section~\ref{sec:exp}, the revenue attribution was calculated on a weekly basis, so the results are compared using the average error for all the weeks. From Theorem \ref{th:revenueP} we know that the optimal revenue attribution function is a convex combination of uniform \textbf{U} and \texttt{null}-based empirical \textbf{N}. Because the exact combination is unknown, we consider both separately. Table~\ref{tab:schemes_at_g} shows the errors for attributing the cumulative revenue for 30 days. It shows that the best conversion value schemas use the observed users' revenues. The attribution errors are normalized with the hypothetical best case \textbf{D30 PV} with \textbf{U} for every privacy parameter separately (also marked with a box). For example, in Table~\ref{tab:schemes_at_g_campaign}, when $p=2$, the conversion value schema \textbf{D7 RR} combined with \textbf{N} is $4\%$ worse than the error of \textbf{D30 PV} with \textbf{U}. As $p$ increases, the \textbf{EV} and \textbf{UD} schemas' performance gets closer to the rest of the schemas because a high privacy threshold applied to the revenue-based schema sets most of the spending user's conversion value to $null$. As expected, the baseline schema \textbf{D30 PV} error is smaller than all other when there is no privacy threshold and \textbf{UD} performs the worst. Looking at the results for \textbf{RR} and \textbf{RI} with low privacy threshold (i.e., $p\le2$) in Table~\ref{tab:schemes_at_g} we see that using a more extended period than the first 24 hours of gameplay reduces the attribution error. Intuitively, it takes some time for players to try the game, and they will start buying once they consider that it is worth it -- which rarely happens in the first day of gameplay. \textbf{RR} and \textbf{RI} work well if there are enough players spending during the observed period, because it helps separating non-spenders from spenders, and then placing spenders in buckets based on their spending. However, higher privacy thresholds affect the quality of this schema because observing the players for a few days cannot correctly separate players into different conversion values. Most players will have a conversion value of zero, and those that do not will likely fall below the privacy threshold. The results suggest that schemas that separate spenders and non-spenders and group users based on their spending are the most helpful for revenue attribution. That is why {\it rolling} schemas that include bits for carrying the count of days perform much better than the \textbf{EV} or \textbf{UD} schema. \begin{figure}[t!] \centering \includegraphics[width=0.67\textwidth]{error_over_time.png} \caption{The attribution error grows as revenue matures.} \label{fig:att_error} \end{figure} Figure \ref{fig:att_error} visualizes the change in attribution error according to the revenue window. Windows of 7 to 14 days, 14 to 30 days, 30 to 60 days and 60 to 90 days are presented. As we attribute cumulative revenue in more extended time, user behavior has more chances to diverge. Using just the first days of data to group users does not mean that the users will have the same journey in the app. Some users will keep playing without buying, and most players who buy will only do it once. The users with a higher number of purchases will spend at a different pace, and their spending will vary from hundreds to thousands of dollars. Finally, bucketing spenders based on early signals to group them based on long revenue windows of time is very challenging. \section{Conclusion} \label{sec:conclusions} This paper focuses on using conversion values to attribute revenue to advertising campaigns. The conversion value schema is a novel privacy-preserving method for optimizing ad campaigns introduced by Apple in \texttt{SKAdNetwork 2.0} as part of the App Tracking Transparency framework, which was enforced in iOS 14.5 and later. Instead of allowing advertisers to use IDFA by default, the user must give permission explicitly, impacting how the mobile measurement partner attributes revenue to advertising campaigns. To the best of our knowledge, our work is the first to rigorously formalize and investigate the conversion values for revenue attribution. We find the optimal revenue attribution function, and through various experiments we shed light on how different conversion value schemas perform in revenue attribution. Based on empirical evaluation on real-world data we postulate that the best conversion value schema is the one that relies on revenue and is able to separate spenders and non-spenders. \paragraph{Limitations. } Our work barely scratches the surface of Apple's conversion value schema, and we hope that it motivates the industry and academia to formally investigate the best ways to use conversion values. We focused on using conversion values for attributing revenue in free-to-play games where more than 95\% of the users do not spend money. It is likely that the conversion value schemas in other kinds of applications (e.g., subscription, ads driven) and tasks (e.g., ads campaign optimization, real-time bidding) perform differently. The major limitation of our work is that the rules of the privacy threshold are not clear. If we would know the definition of the privacy threshold in detail we could simulate the conversion values better. \paragraph{Future Work. } We foresee many directions in which this line of research can continue. For instance: \begin{itemize} \item The Effects of Opt-ins: It is reasonable to assume that some users give permission to track in both the app that shows the ad as well as the app that gets installed~\cite{link1,krafft2017permission}. In that case, the exact network and campaign information is available. Hence, it might be possible to either estimate campaign revenue solely based on these users, or use the data from these users to improve the estimation that includes the opt-out users. \item Diagnosing revenue attribution: Another promising research area is investigating how to measure the revenue attribution quality without knowing the ground truth. \item Optimal campaign structure: Since the conversion values can be reported as \texttt{null} when the number of installs for a campaign has not reached the privacy threshold, it would be interesting to study what is the optimal number of campaigns to run to make the user acquisition operations as efficient as possible. \end{itemize} \bibliographystyle{plain}
\section{Introduction} \subparagraph{Problem Description.} We consider the $\mc$ and $\uc$ problems in the data stream model. The input to both problems are $m$ subsets of a universe of size $n$ and a value $k\in [m]$. In $\mc$, the problem is to find a collection of at most $k$ sets such that the number of elements covered by at least one set is maximized. In $\uc$, the problem is to find a collection of at most $k$ sets such that the number of elements covered by exactly one set is maximized. In the data stream model, we assume $k$ is provided but that the sets are revealed online and our goal is to design single-pass algorithms that use space that is sub-linear in the input size. $\mc$ is a classic \texttt{NP-Hard} problem that has a wide range of applications including facility and sensor allocation \cite{KrauseG07}, information retrieval \cite{Anagnostopoulos15}, influence maximization in marketing strategy design \cite{KempeKT15}, and the blog monitoring problem \cite{SahaG09}. It is well-known that the greedy algorithm, which greedily picks the set that covers the most number of uncovered elements, is a $e/(e-1)$ approximation and that unless $\texttt{P}=\texttt{NP}$, this approximation factor is the best possible in polynomial time \cite{Feige98}. $\uc$ was first studied in the offline setting by Demaine {et al.~} \cite{DemaineFHS08}. A motivating application for this problem was in the design of wireless networks where we want to place base stations that cover mobile clients. Each station could cover multiple clients but unless a client is covered by a unique station the client would experience too much interference. Demaine {et al.~} \cite{DemaineFHS08} gave a polynomial time $O(\log k)$ approximation. Furthermore, they showed that $\uc$ is hard to approximate within a factor $O(\log^{\sigma} n)$ for some constant $\sigma$ under reasonable complexity assumptions. Erlebach and van Leeuwen \cite{ErlebachL08} and Ito {et al.~} \cite{Ito14} considered a geometric variant of the problem and Misra et al.~\cite{MisraMRSS13} considered the parameterized complexity of the problem. This problem is also closely related to Minimum Membership Set Cover where one has to cover every element and minimizes the maximum overlap on any element \cite{KuhnRWWZ05,DomGNW06}. In the streaming set model, $\mc$ and the related $\setcover$ problem\footnote{That is, find the minimum number of sets that cover the entire universe.} have both received a significant amount of attention \cite{IndykMRUVY17,SahaG09,Har-PeledIMV16,ChakrabartiW16,EmekR16,AssadiKL16,MV18,IndykV19}. The most relevant result is a single-pass $2+\epsilon$ approximation using $\tilde{O}(k \epsilon^{-3} )$ space \cite{MV18,BadanidiyuruMKK14} although better approximation is possible in a similar amount of space if multiple passes are permitted \cite{MV18} or if the stream is randomly ordered \cite{NTMZ18,ASS2020}. In this paper, we almost exclusively consider single-pass algorithms where the sets arrive in an arbitrary order. The unique coverage problem has not been studied in the data stream model although it, and $\mc$, are closely related to various graph problems that have been studied. \subparagraph{Relationship to Graph Streaming.} There are two main variants of the graph stream model. In the \emph{arbitrary order model}, the stream consists of the edges of the graph in arbitrary order. In the \emph{adjacency list model}, all edges that include the same node are grouped together. Both models generalize naturally to hypergraphs where each edge could consists of more than two nodes. The arbitary order model has been more heavily studied than the adjacency list model but there has still been a significant amount of work in the latter model \cite{McGregorVV16, McGregorV16, BravermanOV13, KonradMM12, Har-PeledIMV16,Assadi17,AssadiKL16,KallaugherMPV19,McGregorV20}. For further details, see a recent survey on work on the graph stream model \cite{McGregor14}. To explore the relationship between $\mc$ and $\uc$ and various graph stream problems, it makes sense to introduce to additional parameters beyond $m$ (the number of sets) and $n$ (the size of the universe). Specifically, throughout the paper we let $d$ denote the maximum cardinality of a set in the input and let $r$ denote the maximum multiplicity of an element in the universe where the \emph{multiplicity} is the number of sets an element appears.\footnote{Note that $d$ and $r$ are dual parameters in the sense that if the input is $\{S_1, \ldots, S_m\}$ and we define $T_i=\{j:i\in S_j\}$ then $d=\max_j |S_j|$ and $r=\max_i |T_i|$.} Then an input to $\mc$ and $\uc$ can define a (hyper)graph in one of the following two natural ways: \begin{enumerate} \item {\em First Interpretation:} A sequence of (hyper-)edges on a graph with $n$ nodes of maximum degree $r$ (where the degree of a node $v$ corresponds to how many hyperedges include that node) and $m$ hyperedges where each hyperedge has size at most $d$. In the case where every set has size $d=2$, the hypergraph is an \emph{ordinary graph}, i.e., a graph where every edge just has two endpoints. With this interpretation, the graph is being presented in the arbitrary order model. \item {\em Second Interpretation:} A sequence of adjacency lists (where the adjacency list for a given node includes all the hyperedges that include that node) on a graph with $m$ nodes of maximum degree $d$ and $n$ hyperedges of maximum size $r$. In this interpretation, if every element appears in exactly $r=2$ sets, then this corresponds to an ordinary graph where each element corresponds to an edge and each set corresponds to a node. With this interpretation, the graph is being presented in the adjacency list model. \end{enumerate} Under the first interpretation, the $\mc$ problem and the $\uc$ problem when all sets have size exactly $2$ naturally generalize the problem of finding a maximum matching in an ordinary graph in the sense that if there exists a matching with at least $k$ edges, the optimum solution to either $\mc$ and $\uc$ will be a matching. There is a large body of work on graph matchings in the data stream model \cite{AhnG13,EpsteinLMS09,mcgregor2005b,zelke,CrouchS14,CrouchMS13,mcgregor2005,KapralovKS14,Kapralov13,GoelKK12,KonradMM12,KonradR13,BuryS15a,Konrad15,GuruswamiO13} including work specifically on solving the problem exactly if the matching size is bounded \cite{ChitnisCHM15,ChitnisCEHMMV16}. More precisely, $\mc$ corresponds to the partial vertex cover problem \cite{Manurangsi19}: what is the maximum number of edges that can be covered by selecting $k$ nodes. For larger sets, the $\mc$ and $\uc$ are at least as hard as finding partial vertex covers and matching in hypergraphs. Under the second interpretation, when all elements have multiplicity 2, then the problem $\uc$ corresponds to finding the capacitated maximum cut, i.e., a set of at most $k$ vertices such that the number of edges with exactly one endpoint in this set is maximized. In the offline setting, Ageev and Sviridenko \cite{AgeevS04} and Gaur {et al.~} \cite{GaurKK11} presented a 2 approximation for this problem using linear programming and local search respectively. The (uncapacitated) maximum cut problem was been studied in the data stream model by Kapralov et al.~\cite{KapralovKS15,KapralovKSV17,KapralovK2018}; a 2-approximation is trivial in logarithmic space\footnote{It suffices to count the number of edges $M$ since there is always a cut whose size is at least $M/2$.} but improving on this requires space that is polynomial in the size of the graph. The capacitated problem is a special case of the problem of maximizing a non-monotone sub-modular function subject to a cardinality constraint. This general problem has been considered in the data stream model \cite{BadanidiyuruMKK14, ChekuriGQ15,ChakrabartiK15,HuangKY17} but in that line of work it is assumed that there is oracle access to the function being optimized, e.g., given any set of nodes, the oracle will return the number of edges cut. Alaluf et al.~\cite{AEFNS20} presented a $2+\epsilon$ approximation in this setting, assuming exponential post-processing time. In contrast, our algorithm does not assume an oracle while obtaining a $1+\epsilon$ approximation (and also works for the more general problem $\uc$). \subsection{Our Results} Our main results are the following single-pass streaming algorithms\footnote{Throughout we use $\tilde{O}$ to denote that logarithmic factors of $m$ and $n$ are being omitted.}: \begin{description} \item[(A) Bounded Set Cardinality.] If all sets have size at most $d$, there exists a $\tilde{O}(d^{d+1}k^d)$ space data stream algorithm that solves $\uc$ and $\mc$ exactly. We show that this is nearly optimal in the sense that any exact algorithm requires $\Omega(k^d)$ space for constant $d$. \item[(B) {Bounded Multiplicity.}] If every element appears in at most $r$ sets, we present the following algorithms: \begin{itemize} \item (B1) $\uc$: There exists a $1+\epsilon$ approximation using $\tilde{O}(\epsilon^{-4}k^3 r)$ space. \item (B2) $\mc$: There exists a $1+\epsilon$ approximation algorithm using $\tilde{O}(\epsilon^{-3}k^2 r)$ space. \end{itemize} \end{description} In contrast to the above results, when $d$ and $r$ are arbitrary, any constant pass $1+\epsilon$ approximation algorithm for either problem requires $\Omega(\epsilon^{-2}m)$ space \cite{Assadi17}.\footnote{The lower bound result by Assadi \cite{Assadi17} was for the case of $\mc$ but we will explain that it also applies in the case of $\uc$.} We also generalize of lower bound for $\mc$ \cite{MV18} to $\uc$ to show that any constant-pass algorithm with an approximation better than $e^{1-1/k}$ requires $\Omega(m/k^2)$ space. We also present a single-pass algorithm with an $O(\log \min(k,r))$ approximation for $\uc$ using $\tilde{O}(k^2)$ space, i.e., the space is independent of $r$ and $d$ but the approximation factor depends on $r$. This algorithm is a simple combination of a $\mc$ algorithm due to McGregor and Vu~\cite{MV18} and an algorithm for $\uc$ in the offline setting due to Demaine et al.~\cite{DemaineFHS08}. Finally, our $\mc$ result (B2) algorithm also yields a new multi-pass result for a parameterized version of the streaming $\setcover$ problem. We will also show that results (A) and (B2) can also be made to handle stream deletions. The generalization for result (A) that we present requires space that scales with $k^{2d}$ rather than $k^d$. However, in subsequent work we have shown that space the scales with $k^d$ is also sufficient in the insert/delete setting. \subsection{Technical Summary and Comparisons} \subparagraph{Technical Summary.} Our results are essentially streamable kernelization results, i.e., the algorithm ``prunes'' the input (in the case of $\uc$ and $\mc$ this corresponds to ignoring some of the input sets) to produce a ``kernel'' in such a way that a) solving the problem optimally on the kernel yields a solution that is as good (or almost as good) as the optimal solution on the original input and b) the kernel can be constructed in the data stream model and is sufficiently smaller than the original input such that it is possible to find an optimal solution for the kernel in significantly less time than it would take to solve on the original input. In the field of fixed parameter tractability, the main requirement is that the kernel can be produced in polynomial time. In the growing body of work on streaming kernelization \cite{ChitnisCEHMMV16,ChitnisCEHM15,ChitnisC19} the main requirement is that the kernel can be constructed using small space in the data stream model. Our results fits in with this line of work and the analysis requires numerous combinatorial insights into the structure of the optimum solution for $\uc$ and $\mc$. Our technical contributions can be outlined as follows. \begin{itemize} \item Result (A) relies on a key combinatorial lemma. This lemma provides a rule to discard sets such that there is an optimum solution that does not contain any of the discarded sets. Furthermore, the number of stored sets can be bounded in terms of $k$ and $d$. \item Result (B1) uses the observation that each set of any optimal solution intersects some maximal collection of disjoint sets. The main technical step is to demonstrate that storing a small number of intersecting sets, in terms of $k$ and $r$, suffices to preserve the optimal solution. \item Result (B2) is based on a very simple idea of first collecting the largest $O(rk/\epsilon)$ sets and then solving the problem optimally on these sets. This can be done in a space efficient manner using existing sketch for $F_0$ estimation in the case of $\mc$. While the approach is simple, showing that it yields the required approximations requires some work that builds on a recent result by Manurangsi \cite{Manurangsi19}. We also extend the algorithm to the model where sets can be inserted and deleted. \end{itemize} \subparagraph*{Comparison to Related Work.} In the context of streaming algorithms, for the $\mc$ problem, McGregor and Vu \cite{MV17} showed that any approximation better than $e/(e-1)$ requires $\Omega(m/k^2)$ space. For the more general problem of streaming submodular maximization subject to a cardinality constraint, Feldman et al. \cite{FeldmanNSZ20} very recently showed a stronger lower bound that any approximation better than 2 requires $\Omega(m)$ space. Our results provide a route to circumvent these bounds via parameterization on $k,r,$ and $d$. Result (B2) also leads to a parameterized algorithm for streaming $\setcover$. This new algorithm uses $\tilde{O}(rk^2 n^{\delta} + n)$ space which improves upon the algorithm by Har-Peled et al.~\cite{Har-PeledIMV16} that uses $\tilde{O}(mn^{\delta} + n)$ space, where $k$ is an upper bound for the size of the minimum set cover, in the case $rk^2 \ll m$. Both algorithms use $O(1/\delta)$ passes and yield an $O(1/\delta)$ approximation. In the context of offline parameterized algorithms, Bonnet et al. \cite{BonnetPS16} showed that $\mc$ is fixed-parameter tractable in terms of $k$ and $d$. However, their branching-search algorithm cannot be implemented in the streaming setting. Misra et al. \cite{MisraMRSS13} showed that the maximum unique coverage problem in which the aim is to maximize the number of uniquely covered elements $u$ (without any restriction on the number of sets) admits a kernel of size $4^u$. On the other hand, they showed that the budgeted version of this problem (where each element has a profit and each set has a cost and the goal is maximize the profit subject to a budget constraint) is $W[1]$-hard when parameterized by the budget\footnote{In the $\uc$ problem that we consider, all costs and profits are one and the budget is $k$.}. In this context, our result shows that a parameterization on both the maximum set size $d$ and the budget $k$ is possible (at least when all costs and profits are unit). \section{Preliminaries} \label{sec:prelim} \subsection{Notation and Parameters} Throughout the paper, $m$ will denote the number of sets, $n$ will denote the size of the universe, and $k$ will denote the maximum number of sets that can be used in the solution. Given input sets $S_1, S_2, \ldots, S_m\subseteq [n]$, let \[d=\max_i |S_i|\] be the maximum set size and let \[r=\max_j |\{i:j\in S_i\}|\] be the maximum number of sets that contain the same element. Suppose $C$ is a collection of sets. We let $F(C)$ (and $G(C)$) be the set of elements covered (and uniquely covered) by an optimal solution in $C$. Furthermore, let $f(C) = |F(C)|$ and $g(C)=|G(C)|$. In other words, $f(C)$ is the maximum number of elements that can be covered by $k$ sets. Similarly, $g(C)$ is the maximum number of elements that can be uniquely covered by $k$ sets. Furthermore, let $\psi(C)$ and $\tilde{\psi}(C)$ be the set of elements covered and uniquely covered respectively by the sets in $C$. To ease the notation, if $C$ is a collection of set and $S$ is a set, we often use $C-S$ to denote $C \setminus \{S\}$ and $C+S$ to denote $C \cup \{S\}$. We use $M$ to denote the collection of all sets in the stream. Therefore, the optimal value to $\mc$ and $\uc$ are $f(M)$ and $g(M)$ respectively. Throughout this paper, we say an algorithm is correct with high probability if the probability of failure is inversely polynomial in $m$. \subsection{Sketches and Subsampling}\label{sec:sketch} \subparagraph{Coverage Sketch.} Given a vector $x\in {\mathbb R}^n$, $F_0(x)$ is defined as the number of elements of $x$ which are non-zero. If given a subset $S\subset \{1, \ldots, n\}$, we define $x_S\in \{0,1\}^n$ to be the characteristic vector of $S$ (i.e., $x_i=1$ iff $i\in S$) then given sets $S_1, S_2, \ldots$ note that $F_0(x_{S_1} + x_{S_2}+\ldots )$ is exactly the number of elements covered by $S_1\cup S_2\cup \ldots $. We will use the following result for estimating $F_0$. \begin{theorem}[$F_0$ Sketch \cite{CormodeDIM03, BJKST02}]\label{thm:F0-approximation} Given a set $S\subseteq [n]$, there exists an $\tilde{O}(\epsilon^{-2}\log \delta^{-1})$-space algorithm that constructs a data structure $\mathcal{M}(S)$ (called an \emph{$F_0$ sketch} of $S$). The sketch has the property that the number of distinct elements in a collection of sets $S_1, S_2, \ldots, S_t$ can be approximated up to a $1 + \epsilon$ factor with probability at least $1-\delta$ provided the collection of $F_0$ sketches $\mathcal{M}(S_1), \mathcal{M}(S_2), \ldots, \mathcal{M}(S_t)$. \end{theorem} Note that if we set $\delta\ll 1/(\poly(m) \cdot \binom{t}{k})$ in the above result we can try each collection of $k$ sets amongst $S_1, S_2, \ldots, S_t$ and get a $1+\epsilon$ approximation for the coverage of each collection with high probability. \label{sec:subsample} \subparagraph{Unique Coverage Sketch.} For unique coverage, our sketch of a set corresponds to subsampling the universe via some hash function $h:[n]\rightarrow \{0,1\}$ where $h$ is chosen randomly such that for each $i$, $\prob{h(i)=1}=p$ for some appropriate value $p$. Specifically, rather processing an input set $S$, we process $S'=\{i\in S: h(i)=1\}$. Note that $|S'|$ has size $p|S|$ in expectation. This approach was use by McGregor and Vu \cite{MV18} in the context of $\mc$ and it extends easily to $\uc$; see Section \ref{appendix:subsampling}. The consequence is that if there is a streaming algorithm that finds a $t$ approximation, we can turn that algorithm into a $t(1+\epsilon)$ approximation algorithm in which we can assume that $\opt = O(\epsilon^{-2} k \log m)$ with high probability by running the algorithm on a subsampled sets rather than the original sets. Note that this also allows us to assume input sets have size $O(\epsilon^{-2} k \log m)$ since $|S'|\leq \opt$. Hence each ``sketches'' set can be stored using $B=O(\epsilon^{-2} k \log m\log n)$ bits. \subparagraph{An Algorithm with $\tilde{O}(\epsilon^{-2} mk)$ Memory.} We will use the above sketches in a more interesting context later in the paper, but note that they immediately imply a trivial algorithmic result. Consider the naive algorithm that stores every set and finds the best solution; note that this requires exponential time. We note that since we can assume $\opt = O(\epsilon^{-2} k \log m)$, each set has size at most $O(\epsilon^{-2} k \log m)$. Hence, we need $\tilde{O}(\epsilon^{-2} m k)$ memory to store all the sets. This approach was noted in \cite{MV18} in the context of $\mc$ but also apples to $\uc$. We will later show that for a $1+\epsilon$ approximation, the above trivial algorithm is optimal up to polylogarithmic factors for constant $k$. \section{An Exact Algorithm}\label{subsec:exact_alg} \subparagraph{Algorithm.} Our algorithm, though perhaps non-intuitive, is simple to state: \begin{enumerate} \item Initialize $X$ to be an empty collection of sets. Let $b=d(k-1)$. \item Let $X_a$ be the sub-collection of $X$ that contains sets of size $a$. \item For each set $S$ in the stream: Suppose $|S|=a$. Add $S$ to $X$ if there does not exist $T \subseteq S$ that occurs as a subset of $(b+1)^{d-|T|}$ sets of $X_a$. \item Post-processing: Return the best solution $C$ in $X$. \end{enumerate} \subparagraph{Analysis.} Our algorithm relies on the following combinatorial lemma. \begin{lemma}\label{lem:supsub} Let $W=\{S_1, S_2, \ldots \}$ be a collection of distinct sets where each $S_i\subseteq [n]$ and $|S_i|=a$. Suppose for all $T \subseteq \psi(W)$ with $|T|\leq a$ there exist at most \[\ell_{|T|}:=(b+1)^{a-|T|}\] sets in $W$ that contain $T$. Furthermore, suppose there exists a set $T^*$ such that this inequality is tight. Then, for all $B\subseteq \psi(W)$ disjoint from $T^*$ with $|B|\leq b$ there exists a set $Y \in W$ such that $T^*\subseteq Y$ and $|Y\cap B|=0.$ \end{lemma} \begin{proof} If $|T^*|=a$ then $T^*\in W$, then we can simply set $Y = T^*$. Henceforth, assume $|T^*|<a$. Consider the $\ell_{|T^*|}$ sets in $W$ that are supersets of $T^*$. Call this collection $W'$. For any $x \in B$, there are at most $\ell_{|T^*|+1}$ sets that include $T^* \cup \{x\}$. Since there are $b$ choices for $x$, at most \[ b\ell_{|T^*|+1}=b (b+1)^{a-|T^*|-1}<(b+1)^{a-|T^*|}= \ell_{|T^*|} \] sets in $W'$ contain an element in $B$. Hence, at least one set $Y$ in $W'$ does not contain any element in $B$. \end{proof} We show that the algorithm indeed obtains an exact kernel for the problems. Recall that $M$ is the collection of all sets in the stream, i.e., the optimal solution has size $f(M)$. \begin{theorem} \label{thm:exact} The output of the algorithm is optimal. In particular, $f(C) = f(M)$ and $g(C) = g(M)$. \end{theorem} \begin{proof} Recall that $X$ is the collection of all stored sets. We define \begin{align*} C_i & = M \setminus \{\text{the first $i$ sets in the stream that are not stored in $X$}\}. \end{align*} Clearly, $f(C_0)=f(M)$. Now, suppose there exists $i \geq 1$ such that $f(C_{i}) < f(M)$. Let $i$ be the smallest such index. Let $\O$ be an optimal solution of $C_{i-1}$ (note that $\O$ is also an overall optimal solution based on the minimal assumption on $i$). Let $S$ be the $i$th set that was not stored in $X$. If $S \notin \O$ then we have a contradiction since $f(C_i) = f(C_{i-1})=f(M)$. Thus, assume $S \in \O$. Suppose $|S|=a$. \begin{claim}\label{claim:exact} There exists $Y$ in $X_a$ such that $f(\O-S+Y) \geq f(\O)$. \end{claim} \begin{proof} Note that $S$ was not stored because there existed $T^* \subseteq S $ such that $T^*$ was a subset of $(b+1)^{d-|T^*|}$ sets in $X_a$. Consider the set $B= \psi(\O) \setminus S$. Clearly, $B \cap T^* =\emptyset$ and $|B| \leq d(k-1)$. By Lemma \ref{lem:supsub}, there is a set $Y$ in $X_a$ such that $Y \cap B = \emptyset$. Let $Y'=Y\setminus S$ and $S'=S\setminus Y.$ Note that $|Y'|=|S'|$ since $|Y|=|S|$. Define indicator variables $\alpha_z=1$ iff $z\in \psi(\O -S+Y)$ and $\beta_z=1$ iff $z\in \psi(\O)$. Note that \begin{align*} \left (z\in Y\cap S \mbox{ or } z\not \in Y\cup S\right ) \implies \left (\alpha_z=\beta_z \right ), \\ \left (z\in Y' \right )\implies \left (\alpha_z=1 \right ), \\ \left (z\in Y' \right ) \implies \left ( \beta_z=0 \right ), \end{align*} where the last equation uses the fact that $Y'$ is disjoint from $\psi(\O)$. Then \begin{align*} |\psi( \O -S+Y)| = & \sum_{z\in Y'}\alpha_z +\sum_{z\in Y\cap S}\alpha_z+\sum_{z\in S'}\alpha_z+\sum_{z\not \in Y\cup S}\alpha_z\\ \geq & \left (|Y'|+\sum_{z\in Y'} \beta_z\right ) +\sum_{z\in Y\cap S}\beta_z+\left (-|S'|+\sum_{z\in S'}\beta_z \right )+\sum_{z\not \in Y\cup S}\beta_z\\ = & \sum_{z\in Y'}\beta_z +\sum_{z\in Y\cap S}\beta_z+\sum_{z\in S'}\beta_z+\sum_{z\not \in Y\cup S}\beta_z= |\psi( \O)| ~.\qedhere \end{align*} \end{proof} Thus, $f(C_i) \geq f(\O)=f(M)$ which is a contradiction. Hence, there is no such $i$ and the claim follows. The proof for unique coverage is almost identical: for the analogous claim we define indicator variables $\tilde{\alpha}_z=1$ iff $z\in \tilde{\psi}(\O -S+Y)$ and $\tilde{\beta}_z=1$ iff $z\in \tilde{\psi}(\O)$. The proof goes through with $\alpha$ and $\beta$ replaced by $\tilde{\alpha}$ and $\tilde{\beta}$ since it is still the case that \begin{align*} \left (z\in Y\cap S \mbox{ or } z\not \in Y\cup S\right ) \implies \left (\tilde{\alpha}_z=\tilde{\beta}_z \right ),\\ \left (z\in Y' \right )\implies \left (\tilde{\alpha}_z=1 \right ),\\ \left (z\in Y' \right ) \implies \left ( \tilde{\beta}_z=0 \right ), \end{align*} where now the last two equations use the fact that $Y'$ is disjoint from $\psi(\O)$. \end{proof} \begin{lemma} The space used by the algorithm is $\tilde{O}(d^{d+1}k^{d})$. \end{lemma} \begin{proof} Recall that one of the requirements for a set $S$ to be added to $X$ is that the number of sets in $X_{|S|}$ that are supersets of any subset of $S$ of size $t$ is at most $(b+1)^{d-t}$. This includes the empty subset and since every set in $X_{|S|}$ is a superset of the empty set, we deduce that $|X_{|S|}|\leq (b+1)^{d} = O((dk)^d)$. Since each set needs $\tilde{O}(d)$ bits to store, and $|X|=\sum_{a=1}^d |X_a| \leq O(d^{d}k^d)$, the total space is $\tilde{O}(d^{d+1} k^d)$. \end{proof} We summarize the above as a theorem. \begin{theorem}\label{theorem:exact} There exist deterministic single-pass algorithms using $\tilde{O}(k^d d^{d+1} )$ space that yields an exact solution to $\mc$ and $\uc$. \end{theorem} \subparagraph{Handling Insertion-Deletion Streams.} We outline another exact algorithm that works for insertion-deletion streams, however with a worse space bound $\tilde{O}((kd)^{2d})$, in Section \ref{sec:deletion-streams-exact}. \begin{theorem}\label{theorem:deletion-exact} There exist randomized single-pass algorithms using $\tilde{O}(d^{2d}k^d)$ space and allowing deletions that w.h.p.~yield an exact solution to $\mc$ and $\uc$. \end{theorem} \footnote{This improves upon our earlier result in the ICDT version of the paper that uses $\tilde{O}((dk)^{2d})$ space.} \section{Approximation Algorithms} In this section, we present a variety of different approximation algorithms where the space used by the algorithm is independent of $d$ but, in some cases, may depend on $r$. The first algorithm uses $\tilde{O}(\epsilon^{-4}k^3 r)$ memory and obtains a $1+\epsilon$ approximation to both problems. The second algorithm uses $\tilde{O}(\epsilon^{-3}k^2 r)$ memory and obtains a $1+\epsilon$ approximation to \mc and a $2+\epsilon$ approximation to \uc; it can also be extended to streams with deletions. \subsection{A $1+\epsilon$ Approximation} Given a collection of sets $C=\{S_1, S_2, \ldots, S_m\}$, we say a sub-collection $C'\subset C$ is a \emph{matching} if the sets in $C'$ are mutually disjoint. $C'$ is a maximal matching if there does not exist $S\in C\setminus C'$ such that $S$ is disjoint from all sets in $C'$. \begin{lemma}\label{lem:matching} For any input $C$, let $O\subset C$ be an optimal solution for either the $\mc$ or $\uc$ problem. Let $M_i$ be a maximal matching amongst the input set of size $i$. Then every set of size $i$ in $O$ intersects with some set in $M_i$. \end{lemma} \begin{proof} Let $S\in O$ have size $i$. If it was disjoint from all sets in $M_i$ then it could be added to $M_i$ and the resulting collection would still be a matching. This violates the assumption that $M_i$ is maximal. \end{proof} The next lemma extends the above result to show that we can potentially remove many sets from each $M_i$ and still argue that there is an optimal solution for the original instance amongst the sets that intersect a set in some $M_i$. \begin{lemma}\label{lem:matching2} Consider an input of sets of size at most $d$. For $i\in [d]$, let $M_i$ be a maximal matching amongst the input set of size $i$ and let $M_i'$ be an arbitrary subset of $M_i$ of size $\min(k+dk,|M_i|)$. Let $D_i$ be the collection of all sets that intersect a set in $M_i'$. Then $\bigcup_i (D_i\cup M_i')$ contains an optimal solution to both the $\uc$ and $\mc$ problem. \end{lemma} \begin{proof} If $|M_i|=|M'_i|$ for all $1\leq i\leq d$ then the result follows from Lemma \ref{lem:matching}. If not, let $j=\max \{i\in [d]: |M_i|>|M'_i|\}$. Let $\O$ be an optimal solution and let $\O_i$ be all the sets in $\O$ of size $i$. We know that every set in $\O_d\cup \O_{d-1} \cup \ldots \cup \O_{j+1}$ is in \[\bigcup_{i\geq j+1} (D_i\cup M_i')=\bigcup_{i\geq j+1} (D_i\cup M_i) \ .\] Hence, the number of elements (uniquely) covered by $\O$ is at most the number of elements (uniquely) covered by $\O_d\cup \O_{d-1} \cup \ldots \cup \O_{j+1}$ plus $kj$ since every set in $\O_j\cup \ldots \cup \O_1$ (uniquely) covers at most $j$ additional elements. But we can (uniquely) cover at least the number of elements (uniquely) covered by $\O_d\cup \O_{d-1} \cup \ldots \cup \O_{j+1}$ plus $kj$. This is because $M_j$ contains $k+dk$ disjoint sets of size $j$ and at least $k+dk-kd=k$ of these are disjoint from all sets in $\O_d\cup \O_{d-1} \cup \ldots \cup \O_{j+1}$. Hence, there is a solution amongst $\bigcup_{i\geq j} (D_i\cup M_i')$ that is at least as good as $\O$ and hence is also optimal. \end{proof} The above lemma suggests an exact algorithm that stores the sets in $\bigcup_i (D_i\cup M_i')$ and find the optimum solution among these sets. In particular, we construct matchings of each size greedily up to the appropriate size and store all intersecting sets. Note that since each element belongs to at most $r$ sets, the total space is $\tilde{O}(d^2 k r)$. Applying the sub-sampling framework, we have $d \leq \opt = O(k/\epsilon^2 \log m)$ and the approximation factor becomes $1+\epsilon$. \begin{theorem} There exists a randomized one-pass algorithm using $\tilde{O}(\epsilon^{-4}k^3 r)$ space that finds a $1+\epsilon$ approximation to $\uc$ and $\mc$. \end{theorem} \subsection{A More Efficient $1+\epsilon$ Approximation for Maximum Coverage } \label{sec:manu} In this section, we generalize the approach of Manurangsi \cite{Manurangsi19} and combine that with the $F_0$-sketching technique to obtain a $1+\epsilon$ approximation using $\tilde{O}(\epsilon^{-3} k^2r )$ space for maximum coverage. This saves a factor $k/\epsilon$ and the generalized analysis might be of independent interest. Let $\opt = \psi(\O)$ denote the optimal coverage of the input stream. Manurangsi \cite{Manurangsi19} showed that for the maximum $k$-vertex cover problem, the $\Theta(k/\epsilon)$ vertices with highest degrees form a $1+\epsilon$ approximation kernel for the maximum $k$ vertex coverage problem. That is, there exist $k$ vertices among those that cover $(1-\epsilon)\opt$ edges. We now consider a set system in which an element belongs to at most $r$ sets (this can also be viewed as a hypergraph where each set corresponds to a vertex and each element corresponds to a hyperedge; we then want to find $k$ vertices that touch as many hyperedges as possible). We begin with the following lemma that generalizes the aforementioned result in \cite{Manurangsi19}. We may assume that $m > rk/\epsilon $ since otherwise, we can store all the sets. \begin{lemma} Suppose $m > \roundup{rk/\epsilon}$. Let $K$ be the collection of $\roundup{rk/\epsilon}$ sets with largest sizes (tie-broken arbitrarily). There exist $k$ sets in $K$ that cover $(1-\epsilon)\opt$ elements. \end{lemma} \begin{proof} Let $\O$ denote the collection of $k$ sets in some optimal solution. Let $\O^{in} = \O \cap K$ and $\O^{out} = \O \setminus K$. We consider a random subset $Z \subset K$ of size $|\O^{out}|$. We will show that the sets in $Z \cup \O^{in}$ cover $(1-\epsilon)\opt$ elements in expectation; this implies the claim. Let $[\mathcal{E}]$ denote the indicator variable for event $\mathcal{E}$. We rewrite \begin{align*} |\psi(Z \cup \O^{in})| = |\psi(\O^{in})| + |\psi(Z)| - |\psi(\O^{in})\cap \psi(Z)|~. \end{align*} Furthermore, the probability that we pick a set $S$ in $K$ to add to $Z$ is \[ p := \frac{|\O^{out}|}{|K|} \leq \frac{k}{kr/\epsilon } = \frac{\epsilon}{r}~. \] Next, we upper bound $\expec{|\psi(\O^{in}) \cap \psi(Z)|}$. We have \begin{align*} \expec{|\psi(\O^{in}) \cap \psi(Z)|} & \leq \sum_{u \in \psi(\O^{in})} \sum_{S \in K: u \in S} \prob{S \in Z} \leq \sum_{u \in \psi(\O^{in})}r p \leq |\psi(\O^{in})| \cdot \epsilon ~. \end{align*} We lower bound $ \expec{|\psi(Z)|}$ as follows. \begin{align} \expec{|\psi(Z)|} \geq~ &\expec{ \sum_{S \in K} \left( |S| [S \in Z] - \sum_{S' \in K \setminus \{S\}}|S \cap S'| [S \in Z \land S' \in Z] \right)} \nonumber \\ \geq~& \sum_{S \in K} \left( |S| p - \sum_{S' \in K \setminus \{S\}}|S \cap S'| p^2 \right) \nonumber\\ \geq~ &\sum_{S \in K} \left( |S| p - (r-1)|S| p^2 \right) \geq p(1-pr)\sum_{S \in K} |S| \geq p(1-\epsilon)\sum_{S \in K} |S| \label{eq:der}~. \end{align} In the above derivation, the second inequality follows from the observation that \[\prob{S \in Z \land S' \in Z} \leq p^2~.\] The third inequality is because $\sum_{S' \in K \setminus \{S\}}|S \cap S'| \leq (r-1) |S|$ since each element belongs to at most $r$ sets. For all $S \in K$, we must have \[ |S| \geq \frac{\sum_{Y \in \O^{out}}|Y|}{|\O^{out}|} \geq \frac{|\psi(\O^{out})|}{|\O^{out}|} ~. \] Thus, \begin{align*} \expec{|\psi(Z)|} \geq p \left(1- \epsilon \right) |K|\frac{|\psi(\O^{out})|}{|\O^{out}|} &= p \left(1- \epsilon \right) \frac{|\psi(\O^{out})|}{p} = (1-{\epsilon}) |\psi(\O^{out})|~. \end{align*} Putting it together, \begin{align*} \expec{|\psi(Z \cup \O^{in})|} & \geq |\psi(\O^{in})| + (1-\epsilon) |\psi(\O^{out})| - |\psi(\O^{in})| \cdot \epsilon \geq (1-\epsilon)\opt~. \qedhere \end{align*} \end{proof} With the above lemma in mind, the following algorithm's correctness is immediate. \begin{enumerate} \item Store $F_0$-sketches of the $\roundup{kr/\epsilon}$ largest sets, where the failure probability of the sketches is set to $\frac{1}{ \poly(n) {m \choose k}}$. \item At the end of the stream, return the $k$ sets with the largest coverage based on the estimates given by the $F_0$-sketches. \end{enumerate} We restate our result as a theorem. \begin{theorem}\label{thm:alg6} There exists a randomized one-pass, $\tilde{O}(k^2 r/\epsilon^3 )$-space, algorithm that with high probability finds a $1+\epsilon$ approximation to $\mc$. \end{theorem} \subparagraph{Obtaining a $2+\epsilon$ approximation to \uc.} We note that finding the best solution to \uc in $K$ will yield a $2+\epsilon$ approximation. This is a worse approximation than that of the previous subsection. However, we save a factor of $k/\epsilon$ in memory. Furthermore, this approach also allows us to handle streams with deletions. To see that we get a $2+\epsilon$ approximation to \uc. Note that $g(Z \cup \O^{in}) \geq \frac{1}{2} \left( g(\O^{in}) + g(Z) \right)$. Furthermore, a similar derivation shows $\expec{|\tilde{\psi}(Z)|} \geq (1-\epsilon) |\tilde{\psi} (\O^{out})|$. Specifically, in the derivation in Eq.~\ref{eq:der}, we can simply replace $\psi$ with $\tilde{\psi}$. This gives us $g(K) \geq (1/2-\epsilon) g(\O)$. \subparagraph{Extension to Insert/Delete Streams.} The result can be extended to the case where sets are inserted and deleted. For the full details, see Section \ref{sec:deletion-streams-2}. \subsection{An $O(\log \min(k,r))$ Approximation for Unique Coverage} We now present an algorithm whose space does not depend on $r$ but the result comes at the cost of increasing the approximation factor to $O(\log(\min(k,r)))$. It also has the feature that the running time is polynomial in $k$ in addition to being polynomial in $m$ and $n$. The basic idea is as follows: We consider an existing algorithm that first finds a 2.01 approximation $C$ to $\mc$. It then finds the best solution of $\uc$ among the sets in $C$. \begin{theorem}\label{thm:alg4} There exists a randomized one-pass, $\tilde{O}(k^2)$-space, algorithm that with high probability finds a $O(\log \min(k,r))$ approximation to $\uc$. \end{theorem} \begin{proof} From previous work \cite{MV18, BadanidiyuruMKK14}, we can find a $2.01$ approximation $C$ to $\mc$ using $\tilde{O}(k)$ memory. Note that their algorithm maintains a collection $C$ of $k$ sets during the stream. Demaine {et al.~} \cite{DemaineFHS08} proved that that if $Q$ is the best solution to $\uc$ among the sets in $C$, then $Q$ is an $O(\log \min(k,r)) $ approximation to $\uc$. In fact, they presented a polynomial time algorithm to find $Q$ from $C$ such that the number of uniquely covered elements is at least \[ \Omega(1/\log k) \cdot \size{\psi(C)} \geq \Omega(1/\log k) \cdot 1/2.01 \cdot f(M) \geq \Omega(1/\log k) \cdot g(M) ~. \] Note that storing each set in $C$ requires $\tilde{O}(d)$ memory. Hence, the total memory is $\tilde{O}(kd)$. Applying the sub-sampling framework, we obtain an $\tilde{O}(k^2)$ memory algorithm. \end{proof} \subsection{Application to Parameterized Set Cover} \label{sec:setcover} We parameterize the set cover problem as follows. Given a set system, either A) output a set cover of size $\alpha k$ if $\opt \leq k$ where $\alpha$ the approximation factor or B) correctly declare that a set cover of size $k$ does not exist. \begin{theorem} For $0 < \delta <1$, there exists a randomized,~ $O(1/\delta)$-pass, $\tilde{O}(rk^2 n^{\delta} + n)$-space, algorithm that with high probability finds a $O(1/\delta)$ approximation to the parameterized \setcover problem. \end{theorem} \begin{proof} In each pass, we run the algorithm in Theorem \ref{thm:alg6} with parameters $k$ and $\epsilon = 1/n^{\delta/3}$ on the remaining uncovered elements. The space use is $\tilde{O}(rk^2 n^{\delta} + n)$. Here, we need additional $\tilde{O}(n)$ space to keep track of the remaining uncovered elements. Note that if $\opt \leq k$, after each pass, the number of uncovered elements is reduced by a factor $1/n^{\delta/3}$. This is because if $n'$ is the number of uncovered elements at the beginning of a pass, then after that pass, we cover all but at most $ n'/n^{\delta/3}$ of those elements. After $i$ passes, the number of remaining uncovered elements is $O(n^{1-i\delta/3})$; we therefore use at most $O(1/\delta)$ passes until we are done. At the end, we have a set cover of size $O(k/\delta)$. If after $\omega(1/\delta)$ passes, there are still remaining uncovered elements, we declare that such a solution does not exist. \end{proof} Our algorithm improves upon the algorithm by Har-Peled et al.~\cite{Har-PeledIMV16} that uses $\tilde{O}(mn^{\delta} + n)$ space for when $rk^2 \ll m$. Both algorithms yield an $O(1/\delta)$ approximation and use $O(1/\delta)$ passes. \section{Lower Bounds} \subsection{Lower Bounds for Exact Solutions} As observed earlier, any exact algorithm for either the $\mc$ or $\uc$ problem on an input where all sets have size $d$ will return a matching of size $k$ if one exists. However, by a lower bound due to Chitnis et al.~\cite{ChitnisCEHMMV16} we know that determining if there exists a matching of size $k$ in a single pass requires $\Omega(k^d)$ space. This immediately implies the following theorem. \begin{theorem} Any single-pass algorithm that solves $\mc$ or $\uc$ exactly with probability at least $9/10$ requires $\Omega(k^d)$ space. \end{theorem} \subsection{Lower bound for a $e^{1-1/k}$ approximation} The strategy is similar to previous work on $\mc$ \cite{MV17,MV18}. However, we need to argue that the relevant probabilistic construction works for all collections of fewer than $k$ sets since the unique coverage function is not monotone. We make a reduction from the communication problem $k$-player set disjointness, denoted by $\Disj(m,k)$. In this problem, there are $k$ players where the $i$th player has a set $S_{i} \subseteq [m]$. It is promised that exactly one of the following two cases happens a) NO instance: All the sets are pairwise disjoint and b) YES instance: There is a unique element $v \in [m]$ such that $v \in S_i$ for all $i \in [k]$ and all other elements belong to at most one set. The (randomized) communication complexity (in the one-way model or the blackboard model), for some large enough constant success probability, of the above problem is $\Omega(m/k)$ even if the players may use public randomness \cite{ChakrabartiKS03}. We can assume that $|S_1 \cup S_2 \cup \ldots \cup S_k| \geq m/4$ via a padding argument. \begin{theorem}\label{thm:lower-bound-1} Any constant-pass randomized algorithm with an approximation better than $e^{1-1/k}$ to $\uc$ requires $\Omega(m/k^2)$ space. \end{theorem} \begin{proof} For each $i \in [m]$, let $\mathcal{P}_i$ be a random partition of $[n]$ into $k$ sets $V^i_1,\ldots,V^i_k$ such that an element in the universe $U = [n]$ belongs to exactly one of these sets uniformly at random. In particular, for all $i \in [m]$ and $v \in U$, \[ \prob{v \in V^i_j \land (\forall j' \neq j, v \notin V^i_{j'} )} = 1/k~. \] The partitions are chosen independently using public randomness before receiving the input. For each player $j$, if $i \in S_j$, then they put $V^i_j$ in the stream. Note that the stream consists of $\Theta(m)$ sets. If the input is a NO instance, then for each $i \in [m]$, there is at most one set $V^i_j$ in the stream. Therefore, for each element $v \in [n]$ and any collection of $\ell \leq k$ sets $V^{i_1}_{j_1},\ldots, V^{i_\ell}_{j_\ell}$ in the stream, \begin{align*} \prob{v \text{ is uniquely covered by } V^{i_1}_{j_1}, \ldots,V^{i_\ell}_{j_\ell}} & = \ell/k \cdot (1-1/k)^{\ell-1} \leq \ell/k \cdot e^{-(\ell-1)/k}~. \end{align*} Therefore, in expectation, $\mu_\ell := \expec{g(\{ V^{i_1}_{j_1}, \ldots,V^{i_\ell}_{j_\ell}\})} \leq \ell/k \cdot e^{-(\ell-1)/k} n$. By an application of Hoeffding's inequality, \begin{align*} \prob{ g ( \{ V^{i_1}_{j_1} \cup \ldots \cup V^{i_\ell}_{j_\ell} \}) > \mu_\ell + \epsilon e^{-(k-1)/k} \cdot n } & \leq \exp{ -2 \epsilon^2 e^{-2(\ell-1)/k}n} \\ & \leq \exp{-\Omega(\epsilon^2 n)} \leq \frac{1}{m^{10k}} ~. \end{align*} The last inequality follows by letting $n = \Omega(\epsilon^{-2} k \log m)$. The following claim shows that for large $k$, in expectation, picking $k$ sets is optimal in terms of unique coverage. \begin{lemma} The function $g(\ell) = \ell/k \cdot e^{-(\ell-1)/k} n $ is increasing in the interval $ (-\infty,k]$ and decreasing in the interval $[k,+\infty)$. \end{lemma} \begin{proof} We take the partial derivative of $g$ with respect to $\ell$ \[ \frac{\partial g }{\partial \ell } = \frac{e^{(1-\ell)/k} (k-\ell)}{ k^2} \cdot n \] and observe that it is non-negative if and only if $\ell \leq k$. \end{proof} By appealing to the union bound over all ${m \choose 1}+\ldots+{m \choose {k-1}}+{m \choose k} \leq O(m^{k+1})$ possible collections $\ell \leq k$ sets, we deduce that with high probability, for all collections of $\ell \leq k$ sets $S_1,\ldots,S_\ell$, \begin{align*} g(\{ S_1,\ldots,S_\ell \}) \leq \mu_\ell + \epsilon e^{-(k-1)/k} \cdot n & \leq \ell/k \cdot e^{-(\ell-1)/k} n + \epsilon e^{-(k-1)/k} \cdot n \\ & \leq (1+\epsilon) e^{-1+1/k} n~. \end{align*} If the input is a YES instance, then clearly, the maximum $k$-unique coverage is $n$. This is because there exists $i$ such that $i \in S_1 \cap \ldots \cap S_k$ and therefore $V^i_1,\ldots,V^i_k$ are in the stream and these sets uniquely cover all elements. Therefore, any constant pass algorithm that returns better than a $e^{1-1/k}/(1+\epsilon)$ approximation to $\uc$ for some large enough constant success probability implies a protocol to solve $\Disj(m,k)$. Thus, $\Omega(m/k^2)$ space is required. \end{proof} \subsection{Lower bound for $1+\epsilon$ approximation} Assadi \cite{Assadi17} presents a $\Omega(m/\epsilon^2)$ lower bound for the space required to compute a $1+\epsilon$ approximation for $\mc$ when $k = 2$, even when the stream is in a random order and the algorithm is permitted constant passes. This is proved via a reduction to multiple instances of the Gap-Hamming Distance problem on a hard input distribution, where an input with high maximum coverage corresponds to a YES answer for some Gap-Hamming Distance instance, and a low maximum coverage corresponds to a NO answer for all GHD instances. This hard distribution has the additional property that high maximum coverage inputs also have high maximum unique coverage, and low maximum coverage inputs have low maximum unique coverage. Therefore, the following corollary holds: \begin{corollary} Any constant-pass randomized algorithm with an approximation factor $1+\epsilon$ for $\uc$ requires $\Omega(m/\epsilon^2)$ space. \end{corollary} \section{Handling Insert-Delete Streams}\label{sec:deletion-streams} \subsection{Proof of Theorem \ref{theorem:deletion-exact}} \label{sec:deletion-streams-exact} Consider coloring the elements of a universe with a $2$-wise hash-function such that each element is equally likely to get one of $c=10d^2 k$ colors. We say a set has color $P$ if the colors of its elements are all different and form the set $P$. Then, via $\ell_0$ sampling \cite{JowhariST11}, use $\tilde{O}(c^d)$ space to sample a set (if one exists) that is colored $P$ (i.e., for each color in $P$ there is exactly one element in the sampled set with this color) for each subset $P\subseteq \{1,2,\ldots,c\}$ of size at most $d$. \begin{definition} Let $C$ be a collection of at most $k$ sets where each set have size at most $d$. Say a set $S$ in $C$ is \emph{good} with respect to $C$ if the elements of $S$ receive different colors and they are all different from the colors received by elements in $(\cup_{S' \in C} S')\setminus S$. \end{definition} For any good set $S$ in the collection, let $r(S)$ be the set found by the sampling algorithm that is colored the same as set $S$. We call $r(S)$ the \emph{replacement} for $S$. \begin{lemma}\label{lem:rep} Removing sets $S_1, S_2,\ldots, S_g$ that are good with respect to (w.r.t.) $C$ from $C$ and replacing them by $r(S_1), r(S_2),\ldots, r(S_g)$ yields a new collection that (uniquely) covers at least the same number of elements as $C$. \end{lemma} \begin{proof} Let $R_0$ be the set of colors used to color elements in $\cup_{i=1}^g S_i$ and let $R_1$ be the set of colors used to color elements in $(\cup_{S' \in C} S')\setminus \left( \cup_{i=1}^g S_i\right )$. Because $S_1, S_2,\ldots, S_g$ are good sets, $|R_0|=|\cup_{i=1}^g S_i|$ and $R_0\cap R_1=\emptyset$. After replacing $S_1, S_2,\ldots, S_g$ by $r(S_1), r(S_2),\ldots$, the multiplicity of an element with a color in $ R_1$ is unchanged. For any color in $R_0$, let $e$ be the element in $\cup_{i=1}^g S_i$ with this color. There will be at least one element with the same color as $e$ after the collection is transformed. It follows that the coverage of the collection does not decrease: the removal of $S_1, S_2,\ldots, S_g$ reduces the coverage by at most $|\cup_{i=1}^g S_i|$ but adding $r(S_1), r(S_2),\ldots$ increases the coverage by at least $|R_0|$. To argue that the unique coverage of the collection does not decrease, note that if $e$ had multiplicity 1 then the element with the same color as $e$ after the transformation also has multiplicity 1. \end{proof} \begin{lemma}\label{lem:prob} For any $C'\subseteq C$, $\Pr[\mbox{number of good sets in $C'$ is $\geq 4|C'|/5$}] \geq 1/2$. \end{lemma} \begin{proof} First note that, a set is not good if one of its element shares a color with an element in that set or in another set in the collection. By the union bound, \[\Pr[\mbox{set is not good}] \leq d(dk)/c=1/10 \ . \] Hence, for any subset $C'$ of $C$, $\expec{\mbox{number of bad sets in $C'$}} \leq |C'|/10$ and the lemma follows via Markov inequality. \end{proof} \begin{theorem}After repeating the random coloring and sampling $O(\log k)$ times, we have a collection of sets that includes the collection of size at most $k$ that (uniquely) covers the maximum number of elements. \end{theorem} \begin{proof} For the sake of analysis, let $C_0$ be a collection of at most $k$ sets with optimum (unique) coverage. Let $C'=C_0$. \begin{enumerate} \item Randomly color elements. Let $C_1$ be the collection formed from $C_0$ by replacing all sets in $C_0$ that are good sets wrt $C_0$ by their replacements. Remove all good sets (w.r.t. $C_0)$ from $C'$. \item Randomly color elements. Let $C_2$ be the collection formed from $C_1$ by replacing all sets in $C'$ that are good sets wrt $C_1$ by their replacements. Remove all good sets (w.r.t. $C_1)$ from $C'$. \item \ldots continue in this way for $O(\log k)$ steps. \end{enumerate} In each step, the size of $|C'|$ decreases by a constant factor with constant probability by appealing to Lemma \ref{lem:prob}. Hence after $O(\log k)$ steps $|C'|=0$. Note that the (unique) coverage of $C_{O(\log k)}$ is at least the (unique) coverage of $C_0$ by Lemma \ref{lem:rep}. \end{proof} Noting that the $O(\log k)$ colorings/sampling can be performed in parallel, we have a single-pass algorithm. \subsection{Handling deletions for the algorithm in Theorem \ref{thm:alg6}} \label{sec:deletion-streams-2} We now explain how the approach using in Theorem \ref{thm:alg6} can be extended to the case where sets may be inserted and deleted. In this setting, it is not immediately obvious how to select the largest $\roundup{r k/\epsilon}$ sets; the approach used when sets are only inserted does not extend. Note that in this model we can set $m$ to be the maximum number of sets that have been inserted and not deleted at any prefix of the stream rather than the total number of sets inserted/deleted. However, we can extend the result as follows. Suppose the sketch of a set for approximating maximum (unique) coverage requires $B$ bits; recall from Section \ref{sec:sketch} that $B=k\epsilon^{-2}\polylog(n,m)$ suffices. We can encode such a sketch of a set $S$ as an integer $i(S)\in [2^B]$. Suppose we know that exactly $\roundup{r k/\epsilon}$ sets have size at least some threshold $t$. We will remove this assumption shortly. Consider the vector $x\in [N]$ where $N=2^B$ that is initially 0 and then is updated by a stream of set insertions/deletions as follows: \begin{enumerate} \item When $S$ is inserted, if $|S|\geq t$, then $x_{i(S)}\leftarrow x_{i(S)}+1$. \item When $S$ is deleted, if $|S|\geq t$, then $x_{i(S)}\leftarrow x_{i(S)}-1$. \end{enumerate} At the end of this process $x\in \{0,1, \ldots, ,m\}^{2^B}$, $\ell_1(x)=\roundup{r k/\epsilon}$, and reconstruct the sketches of largest $\eta k$ sets given $x$. Unfortunately, storing $x$ explicitly in small space is not possible since, while we are promised that at the end of the stream $\ell_1(x)=\roundup{r k/\epsilon}$, during the stream it could be that $x$ is an arbitrary binary string with $m$ one's and this requires $\Omega(m)$ memory to store. To get around this, it is sufficient to maintain a linear sketch of $x$ itself that support sparse recovery. For our purposes, the CountMin Sketch \cite{CormodeM05} is sufficient although other approaches are possible. The CountMin Sketch allows $x$ to be reconstructed with probability $1-\delta$ using a sketch of size \[O(\log N+\roundup{r k/\epsilon} \log(\roundup{r k/\epsilon} /\delta)\log m)=O(\roundup{r k/\epsilon} \epsilon^{-2}\polylog(n,m) ) \ .\] To remove the assumption that we do not know $t$ in advance, we consider values: \[t_0, t_1, \ldots , t_{\lceil \log_{ 1+\epsilon} m\rceil } \mbox{ where } t_i=(1+\epsilon)^i \ .\] We define vector $x^0, x^1, \ldots \in \{0,1, \ldots, ,m\}^{2^B}$ where $x^i$ is only updated when a set of size $\leq t_i$ but $>t_{i-1}$ is inserted/deleted. Then there exists $i$ such that $\leq \roundup{r k/\epsilon}$ sets have size $\leq t_{i-1}$ and the sketches of these sets can be reconstructed from $x^0, \ldots, x^{t_{i-1}}$. To ensure we have $\roundup{r k/\epsilon}$ sets, we may need some additional sketches corresponding to sets of size $>t_{i-1}$ and $\leq t_i$ but unfortunately there could be $m$ such sets and we are only guaranteed recovery of $x^{t_i}$ when it is sparse. However, if this is indeed the case we can still recover enough entries of $x^{t_1}$ by first subsampling the entries at the appropriate rate (we can guess sampling rate $1, 1/2, 1/2^2, \ldots 1/m$) in the standard way. Note that we can keep track of $\ell_1(x^i)$ exactly for each $i$ using $O(\log m)$ space. \section{The Subsampling Framework} \label{appendix:subsampling} Assuming we have $v$ such that $\opt/2 \leq v \leq \opt$. Let $h:[n] \rightarrow \{0,1\}$ be a hash function that is $\Omega(\epsilon^{-2} k \log m)$-wise independent. We run our algorithm on the subsampled universe $U' = \{ u \in U: h(u)=1\}$. Furthermore, let \[ \prob{h(u)=1} = p = \frac{c k \log m}{\epsilon^{2} v} \] where $c$ is some sufficiently large constant. Let $S' = S \cap U'$ and let $\opt'$ be the optimal unique coverage value in the subsampled set system. The following result is from McGregor and Vu \cite{MV18}. We note that the proof is the same except that the indicator variables now correspond to the events that an element being uniquely covered (instead of being covered). \begin{lemma} \label{lem:sampling} With probability at least $1-1/\poly(m)$, we have that \[ p \opt (1+\epsilon) \geq \opt' \geq p \opt (1-\epsilon) \] Furthermore, if $S_1,\ldots,S_k$ satisfies $g(\{ S'_1,\ldots,S'_k \}) \geq p\opt (1-\epsilon)/t $ then \[ g(\{S_1,\ldots,S_k\}) \geq \opt (1/t -2 \epsilon) ~. \] \end{lemma} We could guess $v =1,2,4,\ldots,n$. One of the guesses must be between $\opt/2$ and $\opt$ which means $\opt' = O(\epsilon^{-2}k \log m)$. Furthermore, if we find a $1/t$ approximation on the subsampled universe, then that corresponds to a $1/t-2\epsilon$ approximation in the original universe. We note that as long as $v \leq \opt$ and $h$ is $\Omega(\epsilon^{-2}k \log m)$-wise independent, we have (see \cite{SchmidtSS95}, Theorem 5): \begin{align*} & \prob{g(\{S_1',\ldots,S_\ell'\} ) = p \cdot g(\{S_1,\ldots,S_\ell \} ) \pm \epsilon p \opt } \\ & \geq 1 - \exp{-\Omega( k \log m)} \geq 1-1/m^{\Omega(k)}~. \end{align*} This gives us Lemma \ref{lem:sampling} even for when $v < \opt/2$. However, if $v \leq \opt/2$, then $\opt'$ may be larger than $O(\epsilon^{-2} k \log m)$, and we may use too much memory. To this end, we simply terminate those instantiations. Among the instantiations that are not terminated, we return the solution given by the smallest guess.
\section{Introduction and motivation}\label{sec:introduction}} \input{sect_1_introduction} \section{Background: Issue trackers} \label{section:background} \input{sect_2_background} \section{Research approach: Design Science} \label{section:researchMethod} \input{sect_3_researchMethod} \section{RQ1: Drawbacks in issue management} \label{section:currentDrawbacks} \input{sect_4_currentDrawbacks} \section{RQ2: Objectives and Features for the enrichment of issue management} \label{section:drawbacksManagement} \input{sect_5_drawbacksManagement} \section{RQ3: Artifact implementation} \label{section:implementation} \input{sect_6_implementation} \section{Evaluation} \label{section:quality} \input{sect_7_quality} \section{Discussion} \label{section:discussion} \input{sect_8_discussion} \section{Conclusions and Future Work} \label{section:conclusions} \input{sect_A_conclusions} \section*{Acknowledgments} The work presented in this paper has been conducted within the scope of the Horizon 2020 project OpenReq, which is supported by the European Union under Grant Nr. 732463. We are grateful for the provision of the Finnish computing infrastructure to carry out the tests (persistent identifier urn:nbn:fi:research-infras-2016072533). This paper has been funded by the Spanish Ministerio de Ciencia e Innovación under project / funding scheme PID2020-117191RB-I00 / AEI/10.13039/501100011033. \vskip 4\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Mikko Raatikainen} received his PhD in computer science and engineering from Aalto University. He is a researcher of the empirical software engineering research group in University of Helsinki. His research interests include empirical research in software engineering and business. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Quim Motger} is a PhD student at Universitat Politècnica de Catalunya (UPC). He is a member of the UPC research group on software and service engineering. His research focuses on natural language processing, machine/deep learning software systems, and web-based software architecture environments. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Clara Marie Lüders} is a PhD student at University of Hamburg (UHH). She is a member of the UHH research group on applied software technology. Her research focuses on machine/deep learning, natural language processing, Issue Tracking Systems, and graph theory. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Xavier Franch} received his PhD from Universitat Politècnica de Catalunya (UPC). He is a full professor in UPC where he leads the research group on software and service engineering. His research focuses on requirements engineering and empirical software engineering. He is associate editor in IST, REJ, and Computing, and J1 chair at JSS. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Lalli Myllyaho} is a PhD student at University of Helsinki (UH). With a background in mathematics and teaching, he is a member of the empirical software engineering group at UH. His current interests include the reliability and operations of machine learning systems. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Elina Kettunen} received her PhD in plant biology and her Master's degree in computer science from University of Helsinki. Her research interests include empirical software engineering and paleobotany. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Jordi Marco} received his Ph.D. from Universitat Politècnica de Catalunya (UPC). He is an Associate Professor in Computer Science at the UPC and a member of the software and service engineering group (GESSI). His research interests include natural language processing, machine learning, service-oriented computing, quality of service, and conceptual modeling. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Juha Tiihonen} received his PhD in computer science and engineering from Aalto University. His research interests include configuration systems and processes for physical, service, and software products. This work was performed at University of Helsinki. He is currently the lead developer of sales configuration systems at Variantum~oy. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Mikko Halonen} is a B.Sc (Automation Eng. Tech.) from the Technical College of Oulu. He currently works as a quality manager in The Qt Company. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Tomi Männistö} received his PhD from Helsinki University of Technology, currently Aalto University. He is a full professor of the empirical software engineering research group in University of Helsinki. His research interests include software architectures, variability modelling and management, configuration knowledge, and requirements engineering. \end{IEEEbiographynophoto} \end{document} \subsection{Research process} We apply the Peffers \textit{et al.}~\cite{Peffers2007} incremental and iterative process to Design Science, as illustrated in Figure~\ref{fig:researmethod}. The phases are linked to the research questions and evaluation, as shown at the bottom of Figure~\ref{fig:researmethod}. As a part of process iterations illustrated on the top of Figure~\ref{fig:researmethod}, we frequently discussed the research with TQC's stakeholders and incorporated their feedback. Specifically, we had an approximately bi-weekly online status meeting in which one of TQC's managers participated. The research questions (listed in Table~\ref{tab:rqs}) are: \textbf{Problem identification (RQ1).} We had conducted an exploratory, multiple case study to understand companies' pain points, needs, and challenges for a platform to support large-scale requirements engineering~\cite{Fucci2018} as part of the collaborative OpenReq research and innovation project\footnote{www.openreq.eu}. TQC was one of the five organizations in the study. Data were collected using semi-structured, half-day interviews with one product manager and two senior R\&D managers selected by a TQC representative due to their active involvement in maintaining and improving Jira and the RE process within TQC. The participants worked in the Qt R\&D sites in Germany, where the interviews were conducted in English. Interviews were audio-recorded and later transcribed. The data were analyzed using open and axial coding on the Atlas.ti\footnote{www.atlasti.com} tool. One researcher held the primary responsibility, and other researchers supported and reviewed them. The main problems found were: information overload, limited tool support, handling of dependencies between requirements, and stakeholder identification for issue assignment. The research method and results details are available at~\cite{Fucci2018}. \begin{table}[t] \centering \caption{Research questions of the study} \label{tab:rqs} \begin{tabularx}{\columnwidth}{@{}lX@{}} \toprule ID & Text \\ \midrule RQ1 & What drawbacks do stakeholders suffer with current issue trackers? \\[1ex] RQ2 & What features can be added to issue trackers to address these drawbacks? \\[1ex] RQ3 & How can these features be integrated in an issue tracker so that it has value for use? \\[1ex] \bottomrule \end{tabularx} \end{table} RQ1 of this paper refines the problems mentioned above in~\cite{Fucci2018} to better understand these problems rather than explore the broader problem space. First, however, we excluded the problem of stakeholder identification because open source communities are generally sensitive to the disclosure of personal information. Then, the remaining three problems were analyzed in greater depth to gain a more holistic and detailed understanding and provide concrete examples. This analysis paralleled the process of the following RQs. We had access to the earlier interview data, met several times with two additional managers at TQC and another manager even more frequently who provided us with feedback and contextual information, and analyzed publicly available TQC Jira issues by ourselves and based on example issues mentioned by TQC's employees. This analysis of issues also triangulated and validated our understanding. The existing triaging process, the ongoing requirement engineering process improvements, and a TQC manager's emphasis on challenges with dependencies, as detailed in Section~\ref{sec:ReseachContextTQC} below, made us focus on the functionality of Jira rather than process improvement. A respondent even pointed out challenges in Jira: "\textit{So I realize we’re sitting on huge knowledge bases, which is Jira, with lots and lots and lots of details, but often it feels like we are working on a haystack. So it’s just so overwhelming, that it’s hard sometimes to really, you know, find out what is important and what not. And having some help there would be great}" (sic) later continuing "\textit{as I said, Jira is just a big haystack, and having some analytics to understand,... okay, the pain point}" (sic). The resulting drawbacks are summarized and provided with the same or similar challenging examples pointed out by TQC's employees in Section~\ref{section:currentDrawbacks}. \textbf{Define solution objectives and design (RQ2).} The solution objectives synthesize functionality to mitigate the drawbacks. The design principles of solution techniques realize the objectives and integrate with issue trackers as the tool and the existing issues of the issue trackers as the data. As a central design principle, the solution should not change but instead support and complement current ways of working to lower the adoption barrier. While understanding the context and drawbacks (RQ1), we also synthesized the objectives of the solution. We held frequent meetings with the TQC managers to combine the problem domain understanding of TQC and our solution proposal knowledge. We then defined the solution techniques, including how different techniques were considered and even tested as prototype implementations. Some techniques were abandoned, e.g., because of challenges in practical scalability or required data quality. Overall, the process was iterative and selective, resulting in objectives and solution techniques in Section~\ref{section:drawbacksManagement}. \textbf{Implementation of the solution and demonstration of its operations (RQ3).} The incremental development of the artifact to realize the solution was done iteratively with a feedback loop from TQC, which helped ensure that the artifact was meeting general quality objectives, which we structured following the ISO/IEC 25010 product quality model~\cite{ISO25010}. The implementation consists of a Jira plugin as a user interface and the solution techniques as independent microservices. These challenges shaped the final artifact design, as detailed in Section~\ref{section:implementation}. \textbf{Evaluation.} \label{sec:ResearMehod-Evaluation} The final evaluation is divided into \emph{verification} and \emph{validation}~\cite{ISO25010}. Verification evaluated the results against the stated objectives, and it was carried out by executing system tests that explored the functionality and observed and measured the product quality characteristics. Validation techniques assess the results with their intended users through interviews. The technical details and results of the evaluation are provided in Section~\ref{section:quality}. \subsection{Research context: TQC and issue management} \label{sec:ReseachContextTQC} TQC, as the company is now known, was established in the 1990s, later acquired by Nokia Plc and Digia Plc, and now operates as an independent publicly listed company. TQC is growing fast with around 300 employees and major R\&D sites in Finland, Germany, and Norway. TQC is a global software product and service company applying typical modern software engineering tools and methods, such as agile practices. TQC governs the Qt project (hereafter \emph{Qt}), which is developing a software development kit\footnote{www.qt.io} consisting of the Qt software framework itself and its supporting tools. These tools include the integrated development environment~(IDE) called Creator and the 3D Studio (3DS) and extensions to the Qt software framework, such as the Automotive suite. Qt specifically targets the development of cross-platform mobile applications, graphical user interfaces, and embedded applications. Qt is estimated to be used by one million developers and most of today's embedded and touch screen systems rely on Qt. Qt is available under open source and commercial licenses. Jira is the only system for product management and requirements engineering. The oldest issue in Jira dates back to the 23rd of September 2003, i.e., almost two decades old. Each Jira issue has an ID consisting of a preceding project acronym and a running number (e.g., `QBS-991'\footnote{https://bugreports.qt.io/browse/QBS-991}), a title (`Qt Android support') and description, as well as several properties, such as the type (in QBS-991, a bug), release (referred to as \textit{Fix Version/s}), priority, status (identifies where an issue is in its lifecycle, such as `Open', `Closed'), resolution (gives additional details for status, such as an issue is closed because it is a `Duplicate'), and automatic meta-data, such as the creation date. There are various releases, such as major and minor releases and bug fixes, and the release numbering typically follows up to three-part (x.y.z). Priority ranges from 0 (`P0 blocker') to 5 (`P5 not important'). In addition, an issue includes comments. In TQC's Jira, issues may report `bugs', `epics', `user stories', `suggestions', and `tasks'. While bugs are the prevalent issues, TQC aims to organize development by applying an issue hierarchy like in agile methods: large functionalities or features are defined as `epics' that are refined as User Stories and further as `tasks'. TQC underwent ongoing requirement engineering process improvement that aimed to enforce this hierarchy further. In addition to the parent-child relationships induced by this issue hierarchy, issues can have dependencies referred to as \textit{Issue Links} in Jira. These links can only be set by employees of TQC or authorized open source developers. Other TQC Jira users, even the creators of issues, cannot set any links. TQC's Jira supports the following links: `duplicates', `requires', `relates', `replaces', `results', and `tests'. All these links are bidirectional (e.g., `is related to' and `relates to'), but it is not uncommon for users to declare a wrong direction, especially in the case of a duplicate, as the resolution already shows duplication. There are also several exceptions or misuses for these types. Sometimes issues are used only to gather other issues, such as one major epic depending on other epics, as epics cannot form a parent-child hierarchy (e.g., QTBUG-62425\footnote{https://bugreports.qt.io/browse/QTBUG-62425}). Some issues group other issues in the description or comments field (e.g., QTCOMPONENTS-200\footnote{https://bugreports.qt.io/browse/QTCOMPONENTS-200}), and not all of them are linked in the appropriate fields. Although Jira handles parent-child relationships and links differently, we simply use \textit{dependency} to denote both. TQC's Jira is divided into projects. Examples include: `QTBUG', which contains issues related to the Qt Framework, and `QTCREATORBUG', which contains issues related to Creator. The large projects are further divided into components, such as a Bluetooth component in `QTBUG'. Each component has a responsible maintainer from TQC's R\&D department or the open source community. TQC's product management has more general responsibility for the projects. The projects and components have dependencies, including cross-project dependencies, like the Automotive suite built on top of Qt Framework. \begin{table} \caption{The number of issues and dependencies in the three largest and other projects in total on the 29th November 2019.} \label{tab:JiraData} \begin{tabularx}{\columnwidth}{X >{\raggedleft\arraybackslash}p{1.71cm} >{\raggedleft\arraybackslash}p{1.71cm} >{\raggedleft\arraybackslash}p{1.71cm} } & \textbf{Issues} & \textbf{Internal \newline dependencies} & \textbf{Cross-project \newline dependencies*} \\ \toprule & & & \\[-.3cm] Qt Framework & 78,676 & 15,739 & 1,811 \\ Creator & 21,926 & 3,126 & 1,132 \\ 3D Studio & 3,877 & 2,023 & 133 \\ Other projects & 15,441 & 3,517 & 1,307 \\ \bottomrule \end{tabularx} * A dependency between two projects is counted in both projects. \end{table} Anyone can register and report issues to TQC's Jira and view the full details of issues, follow issues, and add comments. Qt operates in a meritocratic manner, in which developers get promoted as Jira users when they contribute to Qt and receive recommendations from other developers. Only those who have received elevated rights can edit issues. This preserves quality and integrity. All new issues go through a triaging process\footnote{https://wiki.qt.io/Triaging\_Bugs} to ensure issue quality. Triaging includes checking the quality of the issue in terms of relevance and understandability, specifying which component the issue concerns, assigning the responsible maintainer, and setting the priority. Typically, issues are triaged within a few days at most. The triaging responsibility is rotated within TQC, but the maintainers or others with proper elevated rights can also triage and manage issues before TQC's responsible employees react. To monitor overall progress, TQC uses dashboards for each release with swim lanes for status categories `not started', `in progress', `blocked', and `done'. A dashboard is a feature in Jira to automatically filter, organize, and visualize a set of Jira issues based on their property values, such as the above release and status. TQC's Jira is an independent deployment in a virtual machine in the Amazon cloud services. In addition, TQC has a snapshot of this virtual machine as a test environment, which we use in our research. The snapshot was taken on the 29th November 2019. In this snapshot, TQC's Jira is divided into~20 public, separate projects. We used this same data snapshot for all tests to make the results comparable. Table~\ref{tab:JiraData} shows the number of issues and dependencies in Qt Framework, Creator, and 3D Studio, the three largest projects, and the remaining 17 other projects combined. Out of a total of 119,920 issues, 26,746~(22\%) issues were modified within the last year before the test snapshot (29.11.2018-29.11.2019), and~25,938~(22\%) were open, i.e., not resolved, at the end of the period. Modifications include any changes, such as editing text, changing properties, or adding comments. In addition, TQC has about ten private projects in Jira for specific customers and product management, which contain a few thousand additional issues. For confidentiality reasons, these projects are not included in the data-set of this paper. \subsection{Objectives} \label{sec:objectives} Based on the drawbacks enumerated in the previous section, we present the synthesized solution objectives, which aim to alleviate the drawbacks and improve dependency management in issue trackers. \begin{itemize} \item \textit{\textbf{Objective 1.}} Users gain a better understanding of the existing issue dependency network of the issues (\textit{Drawback 1}). \item \textit{\textbf{Objective 2.}} Users can search for missing dependencies and unidentified duplicate issues (\textit{Drawback 2}, \textit{Drawback 3}). \item \textit{\textbf{Objective 3.}} Users can check the correct release assignments and priorities of the issue dependency network of issues and receive suggestions for resolving inconsistencies (\textit{Drawback 4}). \end{itemize} These objectives share four common, additional characteristics. First, the objectives integrate into the current ways of working with issue trackers, being usable whenever needed without disturbing existing processes. Second, the objectives are about improving issue trackers so that their realization becomes integrated into the functionalities and especially data of issue trackers. Third, the objectives address the context of the existing issues that the user is working on. Fourth, the objectives should be realizable through scalable solutions, capable of working efficiently even with large projects. Consequently, the objectives primarily address tool improvement rather than process improvements or changes. \subsection{Dependency management baseline techniques} \label{sec:drawbacksManagement-background} The fundamental principle of our solution is that the roles of dependencies in issue trackers can be first-class entities rather than only properties of issues. We approached this by handling issues and dependencies as two distinct entity types in a graph-like structure: issues are nodes, and dependencies are typed (i.e., labeled) and directed edges between the nodes. This approach gives issues a context beyond their explicit properties, revealing implicit constraints, e.g., the mutual aggregation of two issues through a dependency between them. Moreover, dependencies can then have properties of their own, like issues have, such as a status and creation date. We define what we call an \emph{issue graph} as follows. We denote the set of all issues as $R$ and the set of all dependencies between issues of $R$ as $D$, i.e., ${D \subseteq R \times R}$, where $D$ is anti-reflexive, i.e., ${\forall r_i \in R : (r_i,r_i) \notin D}$; and all edges are bidirected, i.e. ${\forall r_i, r_j \in R : (r_i,r_j) \in D} \iff (r_j,r_i) \in D$. That is, for every edge that belongs to the graph, there is also a corresponding inverse edge where the semantics of the edge depends on the direction. For a particular issue $r_0 \in R$, the issue graph is a symmetric connected graph ${G_0 = (R_0, D_0)}$, where $R_0 \subseteq R$ and $D_0 \subseteq D$, so that all issues of $R_0$ are reachable from $r_0$, i.e., for all issues $r_i \in R_0$ there is a path from $r_0$ to $r_i$ and $D_0$ includes all dependencies between the issues in $R_0$ and only those. This definition of an issue graph is issue-centered and does not necessarily include all issues ($R_0 \subsetneq R$) because there is normally no path between all issues. However, the union of all $G_0$, denoted by $G = \bigcup G_0$, contains all issues ($R$) and dependencies ($D$). Equivalently, every $G_0$ is a component of $G$. A special case of $G_0$ is an \textit{orphan issue} $r_0$ with no dependencies, and thus for which $R_0 = {r_0}$ and $D_0 = \emptyset$. Given an issue $r_0$, we define $G^p_0$, called a \textit{$p$-depth issue graph}, as an induced subgraph of $G_0$ that includes all issues up to $p$ edges apart from $r_0$ and all dependencies between the included issues. That is, an issue is taken to the point of focus, and we follow all dependencies of that issue to neighboring issues and beyond, breadth-first up to the desired depth. The rationale and benefit of a $p$-depth issue graph are that different sizes of \textit{contexts of analysis} can be constructed automatically without user involvement to provide a given issue with the issues and dependencies in specific proximity. For an issue~$r_i$, we can apply a number of functions, such as $r_i.property(priority)$, to obtain its priority and $r_i.property(release)$ to get its scheduled release. Similarly, $d_i.property(status)$ will yield the status-property of a dependency~$d_i$, with possible values `proposed', `accepted' or `rejected' and $d_i.property(score)$ will give a score value (0..1) representing the confidence level of correctness or validity of the dependency. These definitions provide the baseline for formulating the dependency management techniques required by users of issue trackers, addressing the objectives presented in Section~\ref{sec:objectives}. An issue graph ($G_0$) -- or the issue graph corresponding to the entire issue dependency network ($G$) -- can be generated automatically with the information stored in issue trackers; therefore, any operation defined over an issue graph or any transformation to any other formalism (e.g., constraint satisfaction problem (CSP)) can be computed from issue trackers, as we have effectively done. An issue graph does not necessarily need to affect issue trackers; instead, the graph can form a parallel, complementary structure. In particular, an issue graph ($G_0$) makes efficient issue management easier. Specifically, visualizations of dependency networks (\textit{Objective1}) can be generated directly for the user interface as described in Section~\ref{section:implementation}, and advanced dependency management techniques can be designed as described below. \subsection{Dependency Management Techniques} \label{sec:drawbacksManagement-techniques} This subsection describes four concrete techniques of our solution, relying on the baseline techniques built on the concept of an issue graph. These techniques have been designed with the objectives in Section~\ref{sec:objectives} in mind. In particular, the techniques need to work in an industrial context, as exemplified in this paper by the TQC context, such as providing near real-time response times even when managing large sets of issues, which may sometimes prevent the adoption of more sophisticated approaches. \textbf{Automated detection of potential missing dependencies.} As issue tracker users may neglect to report a significant number of dependencies, users would benefit from automatic dependency detection (\textit{Objective2}). Automation mitigates the burden of searching for the dependent issues, making it less critical for users to be familiar with all other existing issues. It is possible to automatically detect missing dependencies using various techniques, including deep learning~\cite{Guo2017}, active learning, and ontology-based approaches~\cite{Deshpande2020}. In order to select an adequate dependency detection technique, we built on two fundamental observations. First, we prototyped a few complex techniques and observed that they did not meet the stringent time requirements and lacked proper training data. Second, TQC’s Jira users noted that dependencies are often mentioned as a reference to another issue in the title, description, and comments of an issue (Section~\ref{section:currentDrawbacks}, see Example~\ref{ex:reference}). Therefore, we adopted a \textit{reference detection} technique for natural language text (see Algorithm~\ref{algorithm:cross-det}) to uncover dependencies declared in the issue tracker in any of these text fields. In other words, our solution does not aim to identify unknown dependencies. The reference detection technique analyzes this textually added content by searching for sub-strings consisting of a project acronym, a dash, and an integer (e.g., ''QBS-991'', see Section~\ref{sec:ReseachContextTQC}) representing an issue ID (line~4 of Algorithm~\ref{algorithm:cross-det}), and creates proposals for new dependencies whenever other issues are mentioned (lines~5--7). The reference detection technique marks the dependencies found as `proposed' (line~6) without type because only references to other issues are detected. A user should check, i.e., accept or reject these results, add the correct dependency type, and edit the textual content of the issue in case the proposed dependency is incorrect. \begin{algorithm}[t] \caption{ReferenceDetection($R$, $projectID$)} \textit{R}: Set of issues of an issue graph \\ \textit{projectID}: Set of project IDs (e.g., "QTWB", "QTBUG") \begin{algorithmic}[1] \STATE \textit{$D_{p}$} = []: set of proposed dependencies \FORALL{$r_i$ in $R$} \FORALL{$p_i$ in $projectID$} \STATE $toID[]$ = $r_i$.findStrings($p_i$+``-''+[0-9]\{1,5\}) \FORALL{$to_i$ in $toID$} \STATE $D_{p}$.add($r_i$, $to_i$, 'dependency', `proposed') \ENDFOR \ENDFOR \ENDFOR \RETURN $D_{p}$ \end{algorithmic} \label{algorithm:cross-det} \end{algorithm} \textbf{Automated detection of potential duplicated issues.} The need for, the solution to, and the benefits of automatic duplication detection are much like the above because, as already noted in Section~\ref{section:currentDrawbacks}, duplicates result in a particular type of dependency in Jira (\textit{Objective2}). State-of-the-practice approaches use bag-of-words of natural language representations to measure the similarity between these representations using vector-space models~\cite{Shahmirzadi2019TextSI}. Among these approaches, \textit{Term Frequency - Inverse Document Frequency} (TF-IDF) is the theoretical baseline for detecting duplicated entities or issues~\cite{Sun2011,Motger2020}. More recent deep contextualized models, such as Google's BERT~\cite{Devlin2019} or ELMo~\cite{Peters2018}, are more suitable for complex information retrieval scenarios, but as in dependency detection, they introduce a challenge in terms of efficiency, complexity, and training data required~\cite{Wang2019}. These challenges make it difficult to use them in the context of large issue dependency networks, as TQC exemplifies. Our solution (see Algorithm~\ref{algorithm:sim-det}) is an application and extension of the TF-IDF model based on three additional steps to improve the accuracy and performance of the similarity evaluation. After initially running the title and description of each issue through a lexical analysis pipeline (Lines 1--4 of Algorithm~\ref{algorithm:sim-det}), we built a TF-IDF model from the resulting bag-of-words representations (Line 5). Then, we apply the cosine similarity for the resulting TF-IDF model to compare each pair of issues. Alternative measures (e.g., Jaccard similarity) were evaluated through a preliminary literature review of the similarity evaluation field~\cite{Furnari2018}, which conveyed that TF-IDF and cosine similarity were suitable candidates for industrial scalability and generalization beyond the TQC case study. Each resulting score is then compared to a context-based minimum threshold value to decide whether a pair is a potential duplicate, in which case a new `duplicate' dependency proposal is constructed (Lines 6--11). This context-based similarity threshold score must be set through a preliminary cross-validation analysis on a subset of labeled issues to predict duplicated issues accurately (see Section \ref{sec:DependencyManagementVerification}). After the similarity evaluation, we represent the duplicated issues as sets of complete graphs, where issues have an existing or proposed `duplicate' dependency to other issues. We treat these sets of graphs as \textit{clusters} --- the process proposes sets of duplicated issues by simply including the issues belonging to the same cluster (Lines 12-13). During this process, we apply transitivity through existing duplicate dependencies to all issues belonging to the same cluster, resulting in new duplicated proposals. Hence, instead of reporting all the existing and proposed `duplicate' dependencies among them, we only report the duplicated dependency with the greatest similarity score for all other issues in the cluster. Given a sub-graph of $m$ duplicated issues, the clusters can be reported using $(m - 1)$ dependencies instead of representing all ($m*(m - 1)/2$) dependency objects, improving performance efficiency in data processing and transactions. The extension of the similarity algorithm through a clustering representation, the need for which was identified during construction, improves the current state-of-the-art approaches by significantly reducing the amount of noisy data and simplifying the formalization of duplicated issues, similarly to up-to-date alternative solutions in the field \cite{Rocha2021}. Furthermore, stakeholders do not want all duplicate links explicitly in their issue trackers. A detection model might recommend all possible duplicate links, which the stakeholders do not want. \begin{algorithm}[t] \caption{DuplicateDetection($G$, $thr$)} \textit{G = (R, D)}: Issue graph \\ \textit{thr:} Similarity threshold score \begin{algorithmic}[1] \STATE \textit{bow} = [] : Bag of words \STATE \textit{clusters} = [] : Set of sub-graphs of duplicated issues \FORALL{$r_i$ in R} \STATE \textit{bow}.add.text\_preprocess(\textit{$r_i$}) \ENDFOR \STATE \textit{tfidf\_model} = build\_model(\textit{bow}) \FORALL{$r_i$, $r_j$ $\in$ R where \textit{i $\neq$ j} and ${d_{ij} = (r_i, r_j)} \notin D$} \STATE \textit{score} = cosine\_sim(\textit{$r_i$, $r_j$, tfidf\_model}) \IF{\textit{score} $\geq$ \textit{thr}} \STATE $D$.add($r_i$, $to_i$, 'duplicates', `proposed', \textit{score}) \ENDIF \ENDFOR \STATE \textit{clusters} = compute\_clusters(\textit{R}, \textit{$D$}) \RETURN clusters \end{algorithmic} \label{algorithm:sim-det} \end{algorithm} \begin{algorithm}[t] \caption{Proposals($r_0$, $D_0$, $D_0'$, $depth$, $orphan$, $property$)} \textit{$r_0$}: Issue of interest \\ \textit{$D_0 = [(r_0,r_{p1}),...]$}: Dependencies for $r_0$ in TQC's Jira \\ \textit{$D_0' = [(r_0,r'_{p1}),...]$}: Dependencies for $r_0$ stored as rejected \\ \textit{depth = [p, $f_{depth}$]}: Minimum depth and its factor \\ \textit{orphan = $f_{orphan}$}: Orphan factor (default value = 1) \\ \textit{property = [[$p_0, v_0, f_0$],...]}: Properties, values and factors\\ \textit{$D_p$= []}: Set of proposed dependencies for $r_0$ \begin{algorithmic}[1] \STATE $ D_p.combine(references(r_0)+duplicates(r_0)) $ \FORALL{$d_p$ in $D_p[]$} \IF {($d_p$ member\_of $D_0$) \textbf{OR} ($d_p$ member\_of $D'_0$)} \STATE $D_p.delete(d_p) $ \ELSE \IF {$r_0$.distance($d_p.r_p$) $> p$} \STATE $d_p.score.multiply(f_{depth}) $ \ENDIF \IF {$d_p.r_p.orphan()$} \STATE $d_p.score.multiply(f_{orphan}) $ \ENDIF \FORALL{($p_i, v_i, f_i$) in $property(p,v,f)$} \IF {$r_p.property(p_i)$ == $v_i$} \STATE $d_p.score.multiply(f_i) $ \ENDIF \ENDFOR \ENDIF \ENDFOR \RETURN sort\_by\_score\_descending($D_p$) \end{algorithmic} \label{algorithm:optimize} \end{algorithm} \textbf{Contextualization of dependency proposals for an issue.} The contextualization technique consists of finding the most likely correct and useful dependency proposals, filtering out redundant proposals, and emphasizing proposals that would be difficult to find otherwise or have features that the user wishes to find (improvement to \textit{Objective2}). Contextualization emphasizes likely results with desired features, thus improving the results of the detection algorithms by combining results and using knowledge of the domain instead of tweaking the detection algorithm itself. The proposed dependencies should likely be correct and hold additional value compared to the previous state of things. For example, a user might be more interested in similar issues reported around the same time since the issues can concern the same bug that developers have encountered in different situations. Also, an erroneous proposal is not useful either, and having too many of them erodes the users' trust in the tools; therefore, already rejected proposals can be saved and filtered out from the results. Thus, contextualization is necessary for the solution to be more useful in practice. The technique is presented in Algorithm~\ref{algorithm:optimize} and described in more detail below. First, our solution aggregates the scores of Algorithm~\ref{algorithm:cross-det} and Algorithm~\ref{algorithm:sim-det} for a given issue $r_0$ (Line~1 in Algorithm~\ref{algorithm:optimize}). This kind of aggregation of results of different algorithms -- or ``voting'' -- is a useful tool for improving the accuracy of results and masking errors made by one of the algorithms, especially when the components base their results on different metrics \cite{myllyaho2021misbehaviour}. For example, in our case, a direct reference detected by Algorithm 1 to $r_0$ together with a high similarity score detected by Algorithm 2 implies that someone has noticed the similarity and mentioned it in the comments. On the contrary, if $r_0$ is referenced, but the similarity score is low, the comment is more likely to be about something other than perceived similarity. The aggregation used here is simply the sum of the cosine similarity ($0..1$, see Algorithm~\ref{algorithm:sim-det}) for duplicate detection and a default value ($1$) for reference detection. An additional benefit is that no dependency is proposed twice: once by Algorithm~\ref{algorithm:cross-det} and again by Algorithm~\ref{algorithm:sim-det}. Next, the solution examines all proposals obtained (loop comprising Lines 2--18). Lines 3--4 filter out redundant proposals. The detection techniques can result in proposals of dependencies for $r_0$ that already exist in TQC's Jira or have already been rejected by users. These proposals are considered redundant as the dependencies have been considered before and do not provide additional value for the user. For simplicity, we filter out the rejected proposals. For the remaining proposals, our solution applies two specific contextualizations (modifications of output checker in \cite{myllyaho2021misbehaviour}) developed based on the feedback of TQC's Jira users: \textit{an issue graph-based contextualization} and \textit{a property-based contextualization}. The former emphasizes the dependencies not already in proximity in the issue graph. The latter allows the users to find the kind of dependencies they believe to be most valuable to them at a given point in time. Both rely on user-defined \emph{factors} to multiply the score of the proposals meeting the user's criteria. Thus, proposals are not filtered out, but the more relevant proposals in the user's context are emphasized. More specifically, in issue graph-based contextualization, the scores of those dependencies from $r_0$ to issues in different issue graphs or the same issue graph with a greater distance than the given minimum depth~$p$, are increased (Lines 6--8). Also, the scores of dependencies from $r_0$ to orphans are increased as a special case (Lines 9--11). This is for two reasons. First, proximity often suggests a correct similarity with no practical relevance. For example, proposing a dependency between two children of an epic issue is likely correct but adds little value as their similarity is given because of their close relation to each other through parent-child dependencies. Second, duplicate issues within proximity are relatively easy to stumble upon when browsing through the issue graph, whereas duplicate issues further down the issue graph, issues in a completely different graph, and orphan issues are more challenging to find. Thus, proposed dependencies to issues further away from $r_0$ are considered more valuable in practice. Meanwhile, property-based contextualization increases the score when the properties of an issue in a proposed dependency have the same values as specified by the user. This could mean, for example, environment, project, or creation time (Lines 12--16). For example, if a user wishes to find duplicates from the Qt Framework project, the scores of those proposals that have the issues in this project are increased. Applying a factor smaller than one decreases the score, resulting in a negation, such as emphasizing dependencies to other projects. The user is considered an expert of the product they are developing -- property-based contextualization allows them to use their experience and expertise and use the tool more flexibly. \begin{algorithm}[t] \caption{CheckConsistencyAndDiagnose($r_0, G_0$)} \textit{$G_0 = (R_0,D_0)$ }: Issue graph for $r_0$ \\ \textit{$D_i$} : Inconsistent dependencies\\ \textit{$diag_d$} : Dependency diagnosis\\ \textit{$diag_i$} : Issue diagnosis \begin{algorithmic}[1] \STATE mergeDuplicates($G_0$) \FORALL{$d$ in $D_0$} \IF {inconsistent($d$)} \STATE $D_i$.add($d$) \ENDIF \ENDFOR \IF {$D_i=\emptyset$} \STATE return(`Consistent') \ELSE \STATE $diag_d$ = FastDiag($r_0, D_0$, sortByPriority($R_0-r_0$)) \STATE $diag_i$ = FastDiag($r_0$, sortByPriority($R_0-r_0), D_0$) \STATE return(`Inconsistent', $D_i, diag_d, diag_i$) \ENDIF \end{algorithmic} \label{algorithm:cc-diag} \end{algorithm} \textbf{Automated consistency check and diagnosis of inconsistencies.} Dependencies between issues need to be considered when analyzing the correctness of release assignments or priorities in issue graphs. The existing release planning models (cf. \cite{Svahnberg2010, Ameller2016}) are techniques for the task of finding an optimal release assignment from existing requirements by assigning requirements to releases. However, the other approach to release planning \add{\cite{GRuhe2005}} adopted here and at TQC is that the release assignments are manual, and the resulting release assignments are then checked for consistency (\textit{Objective3}). That is, when an issue graph is represented in a machine-understandable manner, a consistency check is an elementary operation that can be automated. In addition, a \emph{diagnosis} can identify minimal conflict sets that lead to consistency. The original diagnosis algorithm HSDAG (Hitting Set Directed Acyclic Graph)~\cite{Reiter1987} uses breadth-first search to find all minimal sets of constraints that could be deleted to restore consistency. Several improved diagnosis algorithms have been developed~\cite{felfernig2014conflict}. However, clearly defined dependency types (e.g.,~\cite{Carlshamre2001,Dahlstedt2005,Felfernig2018}) form the basis for any automation, and semantics can have a few alternative interpretations based on context. For example, the `requires' dependency can be interpreted so that the required issue must be in an earlier release or can be in the same release. \begin{figure*}[t] \centering \includegraphics[width=0.95\textwidth]{Figures/OpenReqArchitecture.PNG} \caption{The software architecture of the artifact. } \label{fig:architecture} \end{figure*} In our solution for consistency check and diagnosis, we utilize `requires' and `parent-child' dependencies, which have well-defined semantics that take priorities and release assignments into account; the details in the TQC context are described in Drawback~4 in Section~\ref{section:currentDrawbacks}. In addition, our solution merges issues with the `duplicate' dependency between them, and the resulting merged issue inherits all dependencies from the merged issues; this is the first step (Line 1 of Algorithm~\ref{algorithm:cc-diag}). The consistency check is a procedural method that evaluates, for each dependency, whether the conditions of the dependency are satisfied and reports the violated dependencies (Lines 2--6). If the dependency contains inconsistent dependencies, diagnosis can be invoked. We adopted FastDiag (see details in ~\cite{Felfernig2012A}), an efficient divide-and-conquer algorithm used to determine preferred diagnoses of constraint sets. Diagnosis applies a CSP representation of an issue graph where dependencies, priorities, and releases become the constraints of CSP. Constraints are assumed to be in a lexical order according to their priorities: a higher priority constraint is retained if possible, even if all lower priority constraints would have to be removed. \emph{The issue diagnosis} (Line 10) identifies a set of issues that need to be assigned to a different release or re-prioritized or removed to restore the consistency of the network. For this diagnosis, each issue is considered a constraint that can be relaxed or 'diagnosed away'. \emph{The dependency diagnosis} (Line 11) determines a set of dependencies whose removal from the issue graph restores consistency. The idea of diagnosis is that a user is then presented with two alternative solutions that lead to a consistent release assignment. Rather than automated change, the user must decide whether to act upon either diagnosis or find alternative actions to resolve the inconsistency. \subsection{Artifact design objectives} \label{sec:artifactobjectives} We articulate the design objectives using the eight ISO25010 quality model characteristics\cite{ISO25010}. \begin{itemize} \item \emph{Functional suitability}. The artifact needs to implement the techniques described in the previous section. \item \emph{Performance efficiency}. The artifact needs to handle a large number of issues efficiently, and the efficiency of Jira may not be unacceptably damaged. As an illustration, TQC's Jira users estimated this goal as ``responses, even to the largest requests, within a few seconds''. \item \emph{Compatibility}. The artifact itself needs to be compatible (co-exist and interoperate) with Jira's functionality and data without the need to develop additional software for interchanging data or accessing functions. \item \emph{Usability}. The usage of the artifact needs to integrate smoothly with Jira and the present way of working. \item \emph{Reliability}. Integrating the artifact and its data should not interfere with Jira's current issue management. This was clearly stated by TQC's Jira users, who had avoiding any risk concerning their current Jira management as their top priority. \item \emph{Security}. The solution must not compromise private data and must adhere to the company access policies. \item \emph{Maintainability}. The architecture needs to support easy evolution and extension as Jira evolves, and allow for easy integration of new techniques. \item \emph{Portability}. The solution should not be strongly tied to any particular technology other than Jira or impose unnecessary additional installation decisions. \end{itemize} \subsection{Artifact design} \label{sec:artifact-design} We implemented the artifact as a Jira plugin and service-based system consisting of independent microservices (${\rightarrow}$maintainability, compatibility), which in practice operate in a choreographic manner following a layered architectural style. The services collaborate through JSON-based messages following an earlier defined generic ontology~\cite{Quer2018} that adheres to REST principles (${\rightarrow}$portability). There are three classes of microservices and the plugin as summarized below and in the architecture diagram in Figure~\ref{fig:architecture}. {\bf 1. Integration microservices.} First, one microservice (\emph{Milla}) integrates with Jira, fetches issue data, and constructs dependencies as separate, first-class entities. We realized the integration using Jira's existing OAuth-based REST API (${\rightarrow}$portability, security). A full projection of TQC's Jira issues is made, and relevant information is cached to provide more efficient access to issue data (${\rightarrow}$efficiency). The resulting issue and dependency data from Jira are cached in a local database embedded into an auxiliary integration microservice (\emph{Mallikas}). Frequent updates fetch new and changed issues from TQC's Jira (${\rightarrow}$compatibility). {\bf 2. Detector microservices.} After completing the data projection, the integration service (\emph{Milla}) sends the resulting issues and dependencies -- or their changes when updating -- to the detector microservices for processing (${\rightarrow}$efficiency). The reference detector (\emph{Nikke}) searches for missing dependencies (i.e., implementing Algorithm~\ref{algorithm:cross-det} presented in Section~\ref{section:drawbacksManagement}) and the similarity detector (\emph{ORSI}) searches for duplicated issues (implementing Algorithm~\ref{algorithm:sim-det}). The reference detector \emph{(Nikke)} returns proposed dependencies (`proposals' in Figure~\ref{fig:architecture}), which are then stored in the same local database (\textit{Mallikas}) as the existing dependencies, applying the `proposed' value for the status-property. However, the similarity detector (\emph{ORSI}) requires persistence on the service side to optimize the similarity due to clustering and vector-based algorithms. Therefore, the proposals are stored internally in the cluster (${\rightarrow}$efficiency). {\bf 3. Model microservices.} The integration service (\emph{Milla}) also sends the issue graph~($G$) to the model microservices (\emph{Mulperi} and \emph{KeljuCaas}). These microservices translate the issue graph into a more general knowledge representation and store the data as a map datatype with issues as keys and a list of said issues' neighbors along with the corresponding dependency types. The way in which the issue graphs are stored allows easy extraction of various $p$-depth issue graphs ($G^p_0$) by following the dependencies recursively to the required depth (${\rightarrow}$efficiency). \begin{table*}[t] \centering \caption{A summary of evaluation, metrics, and used data-sets.} \label{tab:func-eval-metrics} \begin{tabularx}{\textwidth}{p{2.3cm} p{4cm} X p{2.6cm}} \toprule \textbf{Technique} & \textbf{Metric Id} & \textbf{Description} & \textbf{Data-sets} \\ \midrule \multirow{2}{2.3cm}{Issue graph handling} & \#dependencies & Number of dependencies in each issue & Qt Repository \\ & \#p-depth-graphs & Number of $p$-depth issue graphs\\ & \#issues-in-p-graphs & Number of issues in $p$-depth issue graphs\\ \midrule \multirow{2}{2.3cm}{Dependency \newline detection} & \#issues & Number of issues for which a dependency is proposed & \multirow{2}{2.6cm}{Qt Repository and \newline Duplicate set \#1 and \newline Duplicate set \#2} \\ & \#proposals & Number of dependency proposals & \\ & \#depth-3-distance & Number of issues with more than 3 edges apart& . \\ \cline{2-4} & accuracy, precision, recall, \newline F-measure & Quality classification metrics based on a cross-validation analysis of detectors dependency predictions & Cross-validation set \\ \midrule \multirow{2}{2.3cm}{Consistency check and diagnosis} & \#requires-inconsistent & Number of inconsistent \emph{requires} dependencies & Qt Repository \\ & \#parent-child-inconsistent & Number of inconsistent \emph{parent-child} dependencies & \\ & \#p-depth-consistency & Number of consistent $p$-depth issue graphs & \\ & \#issue-diagnosis-count & Number of issues diagnosed to be removed \\ & \#dependency-diagnosis-count & Number of dependencies diagnosed to be removed\\ & issue-diagnosis-success & Success of issue diagnosis \\ & dependency-diagnosis-success & Success of dependency diagnosis \\ \bottomrule \end{tabularx} \end{table*} {\bf 4. User interface plugin.} Users interact through a dedicated Jira plugin (\textit{Fisutankki}) installed in TQC's Jira. The plugin technology integrates the user interface into Jira and Jira's security mechanisms (${\rightarrow}$usability, compatibility). This allows public access, where authenticated users adhere to Jira's security schema (${\rightarrow}$security). On the users' side, \emph{Issue Link Map}~\cite{Lueders2019} (Figure~\ref{fig:screenshot}) is embedded in the Jira plugin (\textit{Fisutankki}), which creates a browser-based user interface (${\rightarrow}$usability, compatibility). A central part of the user interface is a 2D representation of a $p$-depth issue graph ($G^p_0$). The issue ($r_0$) in focus is in the center, and the other issues are automatically positioned around it circularly, depending on their depth. The user can select the desired depth, up to depth five, from the top-left, rearrange the issues, zoom in and out, etc. The colors indicate the status of the issues. A set of filters, such as type or status, can be applied to the visualization. On the right, various tabs represent the other techniques. The first tab shows the basic information for the selected issue as in Jira because the 2D diagram cannot convey all the details of an issue. The second tab shows dependency proposals, which are then also shown in the 2D diagram as dashed lines. The third tab shows the results of the consistency check. The user interface design was periodically shown and discussed with two TQC product managers and optimized according to their feedback. The user interface primarily tackles \textit{Drawback1}, as users can view connected issues in total, and offers an easy way to see and accept dependencies. The user interface accesses the functionality provided by other services through REST calls, which we refer to as \emph{queries} in Figure~\ref{fig:architecture}. Each query goes through the plugin (\textit{Fisutankki}) that applies Jira's security policies. Then the integration microservice (\emph{Milla}) orchestrates all queries to other microservices (${\rightarrow}$maintainability). The elementary functionality to initiate the user interface is to query an issue graph to depth five ($G^5_0$) from the model microservices, which the user interface visualizes to the desired depth. The integration microservice (\textit{Milla}) processes a user's query for a dependency proposal implementing Algorithm \ref{algorithm:optimize}. First, it combines reference proposals (in \textit{Mallikas}), similarity proposals (in \textit{ORSI}) and removes rejected proposals (stored in \textit{Mallikas}). Second, it calls the model services for the desired p-depth issue graph ($G^p_0$) to apply the issue graph-based contextualization. Third, it queries the cached data (in \textit{Mallikas}) for the property-based contextualization. A user can accept a proposed dependency that requires them to specify its type, or reject or disregard the proposal. Provided that the authorized user has sufficient privileges, the plugin (\textit{Fisutankki}) writes accepted decisions to Jira as new dependencies, while the local database (\emph{Mallikas}) stores rejection decisions. The integration service (\textit{Milla}) forwards a user's query for consistency check and diagnosis to the model services that first construct an issue graph ($G^p_0$) internally and prepare data for inference, such as translating the version numbers to integers (in \textit{Mulperi}). Then the consistency check is carried out, and, in case of inconsistency, the issue graph is read to constraint programming objects, and the Choco solver~\cite{choco} (in \textit{KeljuCaaS}) is used to infer diagnosis (Algorithm~\ref{algorithm:cross-det}). The microservices are deployed to the same server as TQC's Jira, which relies on the server's security mechanisms (`server boundary' in Figure~\ref{fig:architecture}). Although the microservices use secure communication, the data is not transferred to other servers remaining behind the server's firewall -- only the plugin's (\textit{Fisutankki}) REST endpoint is publicly accessible (${\rightarrow}$security). \subsection{Evaluation of baseline techniques} \label{sec:analysisOfBackgroudFeratures} \textbf{Evaluation design} The evaluation goal of the baseline techniques was to verify the functionality (Section~\ref{sec:drawbacksManagement-background}) and better understand the characteristics of TQC's Jira data with respect to existing dependencies. We first carried out the evaluation as an exploratory analysis as a set of batch process measures. We enumerated different projects, and then we calculated in total and in different projects the number of different types of issues, the number of different types of dependencies and whether the dependencies were inter-project and cross-project dependencies, and the number and types of dependencies from each issue. Finally, we enumerated all possible $p$-depth issue graphs, for which we calculated the total number of issues and the number of issues at each level. In addition to these batch process measures, we manually inspected selected issues, such as the ones with the highest number of dependencies. Below, we report the evaluation results of metrics related to the topology and size of the generated $p$-depth issue graphs, as shown by the first block in Table~\ref{tab:func-eval-metrics}. \textbf{Data-sets.} \textit{QT}: Qt Repository, all issues, and their dependencies. \textbf{Evaluation results.} In total, 31,182 issues~(26\%) have at least one dependency declared by TQC's Jira users by Issue Links in Jira (\textit{\#dependencies} in Table~\ref{tab:func-eval-metrics}), meaning that~88,738 issues~(74\%) are orphans before any automated dependency detection. Out of the issues that have dependencies,~75\% have only one dependency. The average is 1.7, and the median is 1. As noted in Section~\ref{sec:ReseachContextTQC}, issues are sometimes used for grouping, resulting in and explaining that the maximum number of dependencies is~139, and~24 issues have at least~50 dependencies. Generating all different p-depth issue graphs for all issues (i.e. $\forall r_i \in R$ we generated a $G^p_i$ $\forall p \in [1,n]$ so that $G^n_i$ = $G_i$) resulted in~320,159 issue graphs (\textit{\#$p$-depth-graphs}). By analyzing the number of issues in various $p$-depth issue graphs (\textit{\#issues-in-$p$-graphs}), we observed that the largest issue graph consists of~8,952 issues, and the maximum depth in its topology is~42. This issue graph is exceptionally large, with many subgraphs, as the next largest maximal issue graph consists of~162 issues with a maximum depth of~16. Finally, we inspected the number of issues in all different $p$-depth issue graphs (\#issues-in-p-graphs) and observed high variance and exponential growth in the number of issues at low depths. For instance, 5-depth graphs have a minimum of 5, an average of 210.5, and a maximum of 1778 issues. \textbf{Summary.} This exploratory analysis of the issue dependency network ($G$) reveals that there are many dependencies but also many disjoint issue graphs ($G_0$), including orphans. The number of issues in $p$-depth issue graphs can often be quite large and grow rapidly and exponentially as a consequence of average dependency count but also the grouping issues in the topology. In practice, issue graphs up to depth five are still meaningful for a user, but typically, issue graphs at greater depths contain too many issues and dependencies. \subsection{Evaluation of dependency management techniques} \label{sec:DependencyManagementVerification} \textbf{Evaluation design.} The goal of dependency management evaluation was to assess the validity and coverage of the detectors. We applied reference detection (Nikke) and duplicate detection (ORSI) to each issue of data-sets \textit{QT}, \textit{D1}, and \textit{D2} introduced below. We also differentiated the union and intersection of the results to analyze dependencies that both detectors or only one detector proposed, respectively. Statistical quality analysis with data-set \textit{CV} provides cross-validation with \textit{k=10}. The metrics are in the second block in Table~\ref{tab:func-eval-metrics}. \textbf{Data-sets.} The analysis was carried out for each issue in the following data-sets. \begin{itemize} \item \textit{QT}: Qt Repository, all issues, and their dependencies. \item \textit{DS1}: Duplicate set \#1, a sub-set of \textit{QT} consisting of all 5,839 issues marked as duplicates without `duplicate' dependency (See Drawback 3 in Section~\ref{section:currentDrawbacks}). As these issues were duplicates, we assumed a duplicating issue in \textit{QT}. \item \textit{DS2}: Duplicate set \#2, a sub-set of \textit{DS1} consisting of all 914 issues resolved as duplicates but without any dependencies. \item \textit{CV}: Cross-validation set, a sub-set of 2,936 pairs of issues without existing dependencies in \textit{QT} structured as follows. One group consisted of 1,437 pairs of issues reported by TQC domain experts as duplicates in TQC's Jira, meaning that one issue of each pair was marked as a duplicate, and each pair had a `duplicate' dependency between them. We labeled this first subset of \textit{CV} as \textit{duplicates}. To generate a balanced data-set, we used another group of 1,499 pairs of randomly selected closed issues with no duplicate resolution reported in TQC's Jira that we labeled as the \textit{not-duplicates} sub-set of \textit{CV}. \end{itemize} \textbf{Evaluation results} The results of the quantitative analysis for the three first data-sets are shown in Table~\ref{tab:dep-det-results}. An analysis of distribution reveals that the duplicate detection typically proposes several dependencies to all issues. In contrast, in the reference detection, most issues have only one proposal, and a few issues have several proposals as a list or table (cf. Section~\ref{sec:ReseachContextTQC}). In the case of issue graph-based contextualization, only 2\% of the proposals were three edges apart or closer (\textit{\#depth-3-distance}) in Qt Repository, and all resulted from duplicate detection (\emph{ORSI}). Table~\ref{tab:dep-det-results-crossvalidation} shows the results of the cross-validation analysis for detector services using the \textit{CV} data-set. We compare both detectors, although reference detection is not designed only for duplicate detection, and therefore the results must be interpreted with this in mind. The low recall is expected for reference detection \textit{(Nikke)}, but high precision is not expected. In order to verify the results, we decided to analyze handpicked sample issues in which reference detection found a dependency by reading through the text and comments of the issues. The analysis verified the results, and we discontinued verification after about 30 checks, which were all correct. The verification also revealed that it is customary to add a comment to an issue about duplication, as most had a comment about duplication, and the rest noted duplication in the description field, which explains the high precision. For duplicate detection (\textit{ORSI}), the optimal similarity threshold value (see Algorithm~\ref{algorithm:cross-det}) was reached through a set of experiments by fine-tuning the similarity threshold with $\pm$0.1 deviations until it reached the global maximum for F-measure. Compared with the data in Table \ref{tab:dep-det-results}, our solution tries to reduce false positive instances as much as possible, given the large number of issues and, as a consequence, the large number of dependency proposals. This idea is reinforced if compared with reference detection results, where perfect precision is achieved. \begin{table}[t] \caption{The results of dependency detection in terms of \textit{\#issues} and \textit{\#proposals} as defined in Table~\ref{tab:func-eval-metrics}} \centering \label{tab:dep-det-results} \begin{tabularx}{\columnwidth} {p{2cm} p{2.45cm} >{\raggedleft\arraybackslash}p{0.7cm} >{\raggedleft\arraybackslash}p{0.5cm} >{\raggedleft\arraybackslash}X} \toprule \textbf{Data-set} & \textbf{Detector} & \textbf{\textit{\#issues}} &\textbf{(\%)}& \textbf{\textit{\#proposals}} \\ \midrule Qt Repository & Reference detection & 24,097 &(20\%) & 31,646 \\ (\textit{Qt} data-set) & Duplicate detection & 45,570 &(38\%) & 578,739 \\ & Union & 60,250 &(50\%) & 610,348 \\ & Intersection & 1,727 & (1\%)& 1,801 \\ \midrule Duplicate set \#1 & Reference detection & 3,275 &(56\%) &3,935 \\ (\textit{DS1} data-set) & Duplicate detection & 2,479 &(45\%) & 33,153 \\ & Union & 4,457 &(76\%) & 37,208 \\ & Intersection & 377 &(6\%) & 388 \\ \midrule Duplicate set \#2 & Reference detection & 182 &(20\%) & 208 \\ (\textit{DS2} data-set) & Duplicate detection & 423 &(46\%) & 5,526 \\ & Union & 526 &(58\%) & 5,742 \\ & Intersection & 15 & (2\%) & 16 \\\bottomrule \end{tabularx} \end{table} \begin{table}[t] \caption{Cross validation results of detectors for the \textit{CV} data-set.} \centering \label{tab:dep-det-results-crossvalidation} \begin{tabularx}{\columnwidth}{p{1.5cm} L L } \toprule \textbf{Measure} & \textbf{Reference detection} & \textbf{Duplicate detection\ } \\ \hline Accuracy &77.15\% & 91.66\%\\ Recall &53.31\% & 86.15\%\\ Precision &100.00\% & 96.42\%\\ F-measure &69.54\% & 91.00\%\\ \bottomrule \end{tabularx} \end{table} \textbf{Summary.} The quantitative analysis shows that the detectors have the potential to expand the issue dependency network by proposing a significant number of dependencies. The number of issues for which reference detection makes proposals is relatively large, but the number of dependencies for one issue is small -- typically one and even on average 1.4 proposals for issues for which a proposal is made. In contrast, duplicate detection finds proposals for many issues and results in many proposals per issue, especially considering that the proposals are about duplicates: 38\% of issues cannot be duplicates but the results include false positives. Likewise, the number of issues in Qt Repository (119,920), compared to the number of proposed dependencies (578,739), indicates false positives. Only a small number of false positives can be explained by closely connected issues, such as between the children of an epic based on issue graph-based contextualization. However, as the underlying principles of detectors are different, the number of proposals is not surprising. The small intersection of proposals for Qt repository shows that the detectors complement each other, while the larger intersection for duplicate sets indicates that detectors can also support each other. The precision and the small number of proposals of reference detection justify its default score of 1.0, while duplicate detection itself provides a score. Contextualization relying on the score-based approach seems appropriate to combine, prioritize, and filter relevant proposals for users. \subsection{Evaluation of consistency check and diagnosis} \label{sec:ConsistencyManagementVerification} \begin{table*}[t] \caption{A summary of consistency check and diagnosis results until depth of 10 ($G^1_i$...$G^{10}_i$).} \label{tab:cc_and_diag_results} \centering \def1.2{1.2} \begin{tabularx}{\textwidth}{p{5cm} L L L L L L L L L L} \toprule &\multicolumn{10}{c}{\textbf{Depth}}\\ \textbf{Measure} & \textbf{1} & \textbf{2} & \textbf{3} & \textbf{4} & \textbf{5} & \textbf{6} & \textbf{7} & \textbf{8} & \textbf{9} & \textbf{10} \\ \hline \#requires-inconsistent average & 0.7 & 3.7 & 5.1 & 8.7 & 14.9 & 24.4 & 36.1 & 45.6 & 55.2 & 67.9 \\ \#parent-child-inconsistent average & 0.8 & 4.1 & 4.4 & 6.4 & 12.1 & 20.7 & 32.4 & 36.8 & 34.6 & 36.9 \\ \#p-depth-consistency (\%) & 93\% & 72\% & 49\% & 30\% & 20\% & 13\% & 7\% & 4\% & 3\% & 2\% \\ \#issue-diagnosis-count average & 1.1 & 1.7 & 3.0 & 4.6 & 7.2 & 7.3 & 8.6 & 9.2 & 9.5 & 10.2 \\ issue-diagnosis-success\textsuperscript{1} (\%) & 100\% & 100\% & 100\% & 99\% & 91\% & 69\% & 54\% & 39\% & 28\% & 21\% \\ \#dependency-diagnosis-count average & 1.5 & 7.8 & 9.4 & 14.9 & 25.6 & 33.7 & 38.8 & 48.0 & 51.2 & 57.5 \\ dependency-diagnosis-success\textsuperscript{1} (\%) & 100\% & 100\% & 100\% & 100\% & 98\% & 80\% & 67\% & 55\% & 41\% & 32\% \\ \bottomrule \hline \end{tabularx} \textsuperscript{1} Success is measured by not exceeding the time limit (5 seconds) since all other diagnoses found a solution. \end{table*} \textbf{Evaluation design.} The goal of the evaluation was to analyze the consistency in TQC's Jira as well as to verify the technical feasibility of consistency check and diagnoses. We analyzed the consistency of all `requires' and `parent-child' dependencies individually, i.e., taking into account only the dependency and the issues on both ends without any other dependencies of the issues and the consistency and diagnosis of all $p$-depth issue graphs ($G^p_0$). The metrics are outlined in the third block of Table~\ref{tab:func-eval-metrics}. Since we noticed that different Jira projects do not have comparable and machine-understandable version numbering, we disregarded all cross-project dependencies from the analysis. As diagnoses are computationally heavy operations, we set the time limit to five seconds for each $p$-depth issue graph and did not carry out the diagnoses to any greater depth. A five-second limit was considered reasonable from the user's perspective. This limitation was also necessary as the tests already took over a week, and a larger limit or removing a limit would have required a significantly longer time or design change with little practical value. \textbf{Data-sets.} The analysis was carried out for the following data-sets. \begin{itemize} \item \textit{QT}: Qt Repository, all issues, and their dependencies \item \textit{Deps}: Dependency set, a sub-set of \textit{Qt} consisting of 3,989 `requires' and 8,222 `parent-child' inter-project dependencies and the issues in both ends of each dependency. \end{itemize} \textbf{Evaluation results} The consistency check for each dependency individually for the \textit{Deps} data-set found inconsistency in 780/3,989 (20\%) of `requires' dependencies (\textit{\#requires-inconsistent}) and 884/8,222 (11\%) of `parent-child' dependencies (\textit{\#parent-child-inconsistent}). The results of consistency check and diagnoses for all 320,159 $p$-depth issue graphs in the \textit{QT} data-set are summarized in Table~\ref{tab:cc_and_diag_results} by depth to a depth of 10 ($G^1_i$...$G^{10}_i$), to draw an overview on the evolution of inconsistencies with issue graph depth. For issue graph sizes, the first unsuccessful and the last successful execution of issue diagnosis were carried out for the issue graphs of sizes 371 and 701 issues, respectively. The respective numbers for the dependency diagnosis were 580 and~1362. \textbf{Summary.} In the case of consistency check, we observe that a significant amount (11-20\%) of all dependencies are inconsistent. However, some inconsistencies result from new issues that have not yet been assigned to a release. Inconsistency becomes prevalent for issue graphs at any greater depth, as shown by the decreasing \emph{\#$p$-depth-consistency}, presented as a percentage in Table~\ref{tab:cc_and_diag_results} (the 3rd row). Moreover, the number of detected inconsistencies increases significantly with greater depths of issue graphs. There are already dozens of inconsistencies at relatively small depths, as shown by the two first rows of Table~\ref{tab:cc_and_diag_results}. Consequently, from the practical perspective, complete consistency remains an elusive target, and the analysis context of the consistency check is practically relevant for a user until depth five. Regarding the diagnosis, the diagnoses start to fail from depth 4, i.e., take more than five seconds, and the success rate falls quite rapidly at any greater depth (\textit{issue-diagnosis-success (\%)} and \textit{dependency-diagnosis-success (\%)} in Table~\ref{tab:cc_and_diag_results}). At small depths, when all diagnoses are successful, we see that the diagnosis of dependencies essentially proposes to remove all inconsistent dependencies (\textit{\#dependency-diagnosis-count = \#requires-inconsistent + \#parent-child-inconsistent}) while the diagnosis of issues requires changes to the priority or release of a significantly smaller number of issues (\textit{\#issue-diagnosis-count}). The relatively small increase in these numbers as depth increases means that only the smallest issue graphs are diagnosed successfully -- there is a significant variance in the issue graph sizes at greater depths, as covered above. A qualitative analysis of diagnosis results revealed that lexical order does not always work properly when dependencies are not clearly prioritized, and issues appear in a few priority classes. Consequently, the evaluation shows that the implemented diagnoses are functionally feasible but, for a user, computationally meaningful until issue graphs containing less than 1000 issues and algorithms should provide alternative diagnoses. \subsection{Performance evaluation} \label{sec:performanceEvaluation} \textbf{Evaluation design.} The goal of performance evaluation was to assess the efficiency of all functionality with respect to required computing time and, in particular, give fast enough responses to users (cf. Section~\ref{sec:artifactobjectives}). We divided the performance evaluation into (\emph{i}) batch tasks covering initial processing and updates, and (\emph{ii}) queries, which are scenarios for a user. In order to individually evaluate batch tasks, we divided the performance evaluation into a data projection from Jira, which also covers processing dependencies, and processing in both detectors. We report the average times of five tests to eliminate random errors. For the evaluation of the queries, we applied the various usage scenarios to microservices as orchestrated end-to-end systems, measuring the time from sending a user's query request to a response. This corresponds with the time for submitting a query to and getting a response from the integration service (\emph{Milla} in Figure~\ref{fig:architecture}). Since we focus on the microservices, we omitted user interface rendering and Jira plugin functionality. We analyzed execution times in the data-sets for dependency query for all issues, and issue graph initialization, consistency check, and diagnosis for all $p$-depth issue graphs. \textbf{Evaluation data-sets.} We applied various data-sets for evaluation, as detailed below. \begin{itemize} \item \textit{Qt Repository}. All issues and their dependencies. \item \textit{Large issue graphs}. A sub-set of \textit{Qt Repository} containing all $p$-depth issue graphs for any $p$ with at least 8,000 issues, which integrate 82,640 different issue graphs. We use this data-set for the worst-case scenario. \item \textit{Sizeable issue graphs}. A sub-set of \textit{Qt Repository} containing all $p$-depth issue graphs for any $p$ with 500-1,000 issues, which integrates 14,783 different issue graphs. We use this data-set to represent a possible large case scenario that a user might be interested in, being similar with the largest 5-depth issue graphs. \item \textit{Update data-set}. The small project (QTWB) as a sub-set of \textit{Qt Repository} consisting of 27 issues and 9 dependencies to simulate an update. This data was first manually removed from \textit{Qt Repository} and our system. \end{itemize} \textbf{Evaluation results.} The results of the performance evaluation are summarized in Table~\ref{tab:PerformanceResults} as average execution times. Data transfer between servers took the majority of the time in the data projection, but even when all software is deployed to the same server, we found that data projection takes several minutes because of the large amount of data and Jira's inefficient REST interface, which requires fetching issues as sets of individual issues. The $p$-depth issue graph queries are fast, and depend on the size of the issue graph because many issue properties are returned, making the return data large. The execution times of dependency queries have a small variance and do not depend on data size: the minimum time was 1.3 seconds and 62 queries took over 2.5 seconds, out of which 25 queries returned fewer than 10 proposals. The time required for the consistency check appears to increase practically linearly with respect to the number of issues. The data has minor variation as 0.15\% of queries take 10-17 seconds. We do not present average times for diagnoses because diagnoses for large graphs were not calculated; diagnosis under a five-second limit has been discussed in the previous subsection. \textbf{Summary.} The evaluation results show that the initial operations take hours, but they are performed as a batch process upon system initialization. Updates are then relatively fast, up to tens of seconds. Queries other than diagnosis are within reasonable limits for a user as they take less than five seconds on average, even for the largest issue graphs. However, the tests with \emph{Sizeable issue graphs} show that operations are fast and even diagnoses are then feasible as discussed above. Although we did not measure the time required for authorization and visualization in the Jira plugin, we have not experienced any significant delays. \begin{table}[t] \caption{Performance analysis results.} \label{tab:PerformanceResults} \centering \begin{tabularx}{\columnwidth}{p{2.3cm} p{4.2cm} L } \textbf{Task \textit{(Data-set)}}& \textbf{Technique} & \textbf{Time} \\ \toprule \multirow{2}{3cm}{Data processing \newline \textit{(Qt Repository)}} &Data projection (\emph{Milla})& 40 m\\ &Reference processing (\emph{Nikke})& 31 m \\ &Similarity processing (\emph{ORSI})&4 h 34 m\\ \midrule \multirow{2}{3cm}{Update processing \textit{(Update data-set)}} &Data update projection (\emph{Milla})& 4.4 s\\ &Reference processing (\emph{Nikke})& 1.4 s\\ &Similarity processing (\emph{ORSI})& 28.6 s \\ \midrule \multirow{2}{3cm}{Queries \newline \textit{(Qt Repository})} &$p$-depth issue graph query & 0.3 s\\ &Dependency query & 1.7 s\\ &Consistency check query & 1.9 s \\ &Diagnosis & --- \\ \hline \multirow{2}{3cm}{Queries \newline \textit{(Large issue graphs)}} &$p$-depth issue graph query &0.7 s\\ &Consistency check query & 4.7 s \\ \hline \multirow{2}{3cm}{Queries \newline \textit{(Sizeable issue graphs)}} &$p$-depth issue graph query & 0.01 s\\ &Consistency check query & 0.2 s \\ \bottomrule \end{tabularx} \end{table} \subsection{Validation interview study} \label{sec:validation} \textbf{Validation study design} The goal of validation was to assess whether the user considered the techniques valuable. That is, in addition to the iterative approach of constant feedback from TQC, we carried out the final validation of the artifact by interviewing five of TQC's Jira users, who were all active Jira users who tested and used our solution but had not yet been involved in the design and implementation process: two release managers, one software architect, one product manager, and one developer. We interviewed each respondent individually, following a semi-structured approach. Three researchers carried out the interviews in Finnish, following predefined roles: one researcher acted as the leading interviewer, and others took notes and asked clarification questions. We carried out one interview first and four interviews on another day. The main interviewer was the same in all interviews, while the other two interviewers changed. Each interview took about 1.5 hours. We instructed each respondent to use the system beforehand, allowing one week for this. During the interviews, the respondents were asked to use a shared meeting room monitor to demonstrate and explain the tasks while interviewers voice-recorded and took notes of the process. The structure of the interviews consisted of an introduction, the concept and visualization of issue dependencies, consistency check and diagnosis, dependency proposals, and data updates. We had prepared and printed a set of slides (available in GitHub\footnote{The interview questions: \href{https://github.com/ESE-UH}{https://github.com/ESE-UH})} explicating the themes and the questions in the themes, but only some example screenshots and diagrams were shown to the respondents on paper when needed to explain something. The slides contained the questions to which the interviewers sought answers rather than questions for respondents, adhering to the principles of a case study protocol~\cite{Yin2018}. We preferred that the respondents use the user interface while the slides were a backup. The order of themes differed as the interviews aimed at informal and open dialogue, but we followed the slides to keep track that all themes were covered. We listened to the recordings later and transcribed the key parts of the answers. For the transcribed answers, we carried out a narrative synthesis~\cite{cruzes2015case}, meaning that we used "words and text to condense and explain the findings of the synthesis". In practice, we collected and organized responses as qualitative descriptions of the interview themes. We applied critical judgment in qualitatively selecting and synthesizing responses, such as how relevant a theme was for the respondent in their daily work, and how familiar a respondent was with the theme. We used the Microsoft OneNote notes-taking tool in the analysis as all data was text, the amount of data was moderate, and OneNote allows a free organization of themes and text in a two-dimensional space. The results are summarized as follows. \textbf{Results.} The users appreciated very different functionalities, although they understood that the other functionalities could be important for other roles or tasks. For example, two users considered finding duplicates the key functionality while the others did not consider duplicate detection relevant to their daily work. The duplicate detection was also considered important for large projects and less so in small projects. The existing dependencies and larger issue graphs are especially important and challenging for the R\&D team lead and product managers who value visualization. A user summarized vividly: "\textit{Using Jira is like looking through a keyhole}". Although our solution relies on data projection from Jira that can be out of sync when issues are updated, the users commented that even day-old information is usable, although a practical update interval should be from a few minutes up to an hour, especially during the busy days before a release. \textit{Issue graphs.} The respondents liked the $p$-depth issue graph and its visualizations as a means of capturing information at a glance. The users considered depths 2--4 most relevant -- a 5-depth issue graph already showed them too much information. One user discussed representing the parent-child hierarchy better while acknowledging that it is difficult to visualize without ending up with a very wide view and being a very implementation-specific challenge. Likewise, another user mentioned a release as another relevant viewpoint. The users also commented on the user interface. A recurring comment concerned adding more information, such as tooltips or additional information, by hovering the mouse cursor. \emph{Dependency detection.} Finding duplicated issues was considered the most practical technique although other types of missing dependencies were also acknowledged. The users felt that detection could take place in different phases and tasks, mentioning creating, triaging, resolving, and managing issues, and making releases. The time around releases is especially critical for finding duplicates, although the earlier the duplicates are found the better, especially if the reported issue turns out to be a blocker. Nobody considered false positive or incorrect proposals to be a problem because a proposal needs to be checked manually anyway, and proposals can always be disregarded -- false negatives or undetected proposals were considered much more inconvenient. In particular, one user noted that duplicate detection could also be used to find similar older issues in order to find out how they were resolved or who resolved them so that users could be asked for help or even to resolve similar open issues. Our solution to store rejected dependency proposals and not show them again to any user was considered possible, although a more delicate approach could be applied. That is, a rejection decision is context- and sometimes user-specific, and it should be possible to revise the decisions. In particular, if an issue is changed, the rejection decision should be re-evaluated. Additional desired functionality was that the detectors should detect if issues have changed and the existing dependency between them has become obsolete. In contrast, predicting the type of dependency was not considered important or even feasible. \emph{Consistency check.} The users considered consistency checking to be relevant, especially in larger projects where the complexity and sizes of issue dependency networks have grown. Such a large project at TQC contains several parallel versions and multiple R\&D teams. In small projects, the users did not consider consistency checks necessary because the users can manage consistency manually. One user reported that, on the one hand, the consistency check would be more valuable if the processes inside TQC were more rigorous and issues contained fewer inconsistencies. On the other hand, he reckoned that the consistency check has the potential to improve the processes if inconsistencies or incorrect information can be made more visible. This could also make it possible to more reliably check cross-project dependencies. A challenge for consistency check was said to be the time-boxed releases where the release is often set to the issues only after the resolving solution is ready -- if at all. Thus, for detected inconsistencies in issues, the corresponding resolving solutions need to be checked and might exist, meaning that a cause of the inconsistency is sometimes in the correspondence between Jira issues and their resolving solution. The limitation of the consistency check to the `parent-child', `requires', and `duplicate' dependencies was extensive enough. All respondents commented that only a general `relates' dependency would also be useful, but nothing additional was needed. Finally, other checks, such as identification of cyclic dependencies, could be interesting but not yet clearly needed in practice. \subsection{Discussion on RQ1: issue trackers main drawbacks} \emph{RQ1. What drawbacks do stakeholders suffer with current issue trackers?} When focusing on the constructs and the quality of the underlying issue dependency network, large, collaborative, long-lived projects bring forward the limitations of the issue trackers with respect to the data model (Drawback1), missing explicit dependencies (Drawback2\&3), and inconsistencies (Drawback4). This results in an incomplete broad view, critical for complex tasks like product management. The number of issues, potential dependencies, and stakeholders involved, all of them in constant change, raise the complexity. However, and as a consequence of this complexity, as our experiences from constructing and evaluating a solution to alleviate the drawbacks have taught us, capturing all dependencies and having complete consistency are elusive targets and even based on subjective and contextual judgment --- issues are not a static specification but a constantly evolving network of \emph{things to be done}. Thus, the drawbacks need to be mitigated rather than resolved. Therefore, it is vital to provide users with useful information and practical support features when using issue trackers, rather than aiming at fully automatic decision making. It is noteworthy that drawbacks are not necessarily TQC- or even Jira-specific but can be generalized to using other issue trackers, especially to those popular issue trackers with similar advanced features or other systems of similar use, appearing especially in the aforementioned large-project contexts. \subsection{Discussion on RQ2: issue management features} \label{sec:rq2-discuss} \emph{RQ2. What features can be added to issue trackers to address these drawbacks?} \\ Our solution proposal of issue graphs forms a parallel, automatically constructed view of the data available in issue trackers, enabling more efficient dependency management and visualization (Objective1). Beyond the lifecycle of a single issue, we proposed to treat dependencies as first-class entities with their properties, which are usable, e.g., in dependency detection. We used issue ($r_0$) centered, bottom-up $p$-depth issue graphs ($G^p_0$) as the principal contextual structure for analysis, visualization, and users. The evaluation in the context of TQC's Jira showed the technical feasibility of issue graphs but also indicated that issue graphs up to depth five appear meaningful for users. However, future work can allow other partial issue graphs and better emphasize existing hierarchies between issues. Interestingly, the issue tracker users did not consider the simple dependency typology of detectors a limitation but instead considered the existing typology too complex, opting for a typology of `duplicate', `parent-child', `requires', and possibly generic `relates' dependencies. Regarding the extension techniques, the detection techniques (Objective2) aim to assist users with simple but effective algorithms that operate with large data-sets. The evaluation showed that algorithms effectively propose dependencies and complement each other. Therefore, a quintessential system-view is needed for the techniques and algorithms by contextualization that combines proposals, considers them in the context of existing issue graphs and issue properties, and manages rejected dependencies. This system view is based on the premise that a combination of many simple tools, such as voting and contextual adaptivity, is comparable to a more advanced single algorithm, especially for domain experts. While this relatively simple but holistic solution appeared valuable, bringing forward many practical consequences, the solution can be further improved by more refined rejection handling and adding other --- more advanced --- detection techniques and algorithms, which can require a different aggregation approach. Another desired improvement is the explainability of detection techniques, pointing out why a proposal was made. While these findings are largely applicable to any issue tracker, the reference detection technique, as an example, relies on users' comments and quite Jira-specific textual IDs for which another complementary replacement technique may have to be constructed or adapted for other contexts. Regarding the consistency check and diagnoses (Objective3), evaluation of the techniques indicated that, rather than achieving complete consistency, these techniques' practical value is to make inconsistencies in an issue graph visible for the context a user is working on. This improves the transparency and control of the development process and can even induce process improvements. To this end, our consistency check and diagnoses techniques did not focus on fully-automated decision making but on providing users with assistance during the consistency check process within a specified ($G^{p=5}_0$) context of analysis rather than a complete analysis of all inconsistencies, which might not be relevant or even practical information. The evaluation in the context of TQC's Jira also showed that the number of inconsistencies increases inconveniently rapidly for a user when the context of analysis grows. We argue that similar phenomena appear in other issue trackers of large projects due to the inherent characteristics of dependent and evolving issue tracker data. Among the main future challenges are more suitable and efficient algorithms for diagnosis and a study of other analyses, such as redundant dependencies, including their practical value. Thecess of applying the techniques beyond TQC relies somewhat on the characteristics of the project and Jira usage: the development and projects at TQC are relatively mature and Jira-centered, and the triage process assures a certain level of quality. As a result, TQC has a large amount of data in Jira, and Jira is actively used, including comments to reveal dependencies. TQC is also a medium-sized organization with hundreds of active Jira users, although there are open source and user communities that are less active. In other contexts, the techniques can be less successful, such as in the early phases of projects when there are fewer explicit requirements, the amount of requirements is small, the development practices are immature or not centered around Jira, or there is only a small group of stakeholders. Even at TQC, the stakeholders perceived the techniques differently, depending on their working context, such as being less valuable in small projects. Although techniques are scalable to large organizations of active users, the practical problems and value of solutions need to be assessed. However, an issue tracker is still mostly the repository of issues, the tool for issue workflow, and the tool for views to issues. That is, the issue trackers do not have much intelligence in their functionalities, and intelligent techniques can have some, although sometimes minor, benefits in any context. \subsection{Discussion on RQ3: Artifact implementation} \emph{RQ3. How can these features be integrated in an issue tracker in a way that it has value for use?} \\ The Jira plugin and microservice-based architecture we depicted in RQ3 address practical implementation of the techniques and use concerns. This plugin technology facilitates compatibility, security, and usability in the context of TQC's Jira. However, TQC's Jira is standard deployment and, apart from the integration microservice (Milla), other microservices are independent of Jira, providing good maintainability, portability, and compatibility. The system should be deployable beyond TQC's Jira to other Jira installations and with minor modifications even to other issue trackers and systems, such as requirements management, backlog, or roadmapping systems. We have already prototyped the same microservices in a research prototype. Likewise, we have prototyped two other, more advanced detectors within the system, which turned out to be too unreliable. On the one hand, a solely plugin-based design could be done for a smaller data-set, but the design would have been very Jira-specific, resulting in an inefficient and more complex design. On the other hand, we had the microservices operational without plugin technology, but the microservices then could not handle the private issues, write decisions to Jira, or integrate the user interface with Jira. Such an independent tool from Jira was considered to have little practical value for TQC. The data projection was another key design decision that allowed us to separate batch processes and user queries. This was needed for the microservice-based solution and beneficial for efficiency, while the disadvantages were within users' acceptance limits. Besides the above improvements to the solution, certain design improvements could be considered. Our primary focus was not on graphical design and usability, which can be improved. Additionally, the system's usability could be improved by integrating it into existing dashboards rather than operating as a separate plugin. \subsection{Comparison to related work} \textbf{Feature extension of traditional issue trackers in open source context.} Several studies have focused on analyzing the main challenges raised by traditional issue trackers in open source environments. Bertram et al.~\cite{Bertram2010} reported a list of seven design consideration features for issue trackers based on a qualitative study of their main drawbacks, including (i) providing customizable features for the visualization of issues data and their relations, and (ii) the simplification of tagging and reporting complex issue properties such as `requires' or `duplicates' relations, opening the door to automated features for the autonomous detection of these properties. Baysal et al.~\cite{Baysal2014} ran a qualitative analysis through 20 personal interviews with Bugzilla community stakeholders. The interviews identified that developers faced difficulties managing large issue repositories due to the constant flow of data (e.g., new issues, comments, reported dependencies) and the lack of support for filtering, visualizing, and managing changes in the issue dependency network. Heck and Zaidman~\cite{Heck2013} studied a set of 20 open source GitHub projects, from which they highlighted the management of duplicated issues and the visualization of the issues and issue dependencies as two of the most critical challenges for software developers. However, these contributions are limited to providing general highlights to key challenges and features for issue management tasks rather than designing and depicting concrete, detailed processes or theoretical models for the practical application of these features. \textbf{Modeling and visualization of the issue dependency network.} Both Baysal et al. and the Heck and Zayman studies mentioned above highlight visualization of the issue dependency network beyond the single-issue perspective. The latter narrowly depicts a modeling and visualization proposal based on the Bug Report Network (BRN) proposed by Sandusky et al.~\cite{Sandusky2004}, where an issue dependency network is represented as a tree of issues linked by their relations (including dependencies and duplicate relationships). The \textit{swarmOS Analyzer}\footnote{https://marketplace.atlassian.com/apps/1217806/} Jira plugin delivers a practical solution for representing the issue dependency network as an issue graph. Despite its filtering and classification features, it lacks advanced visualization tools to enable large projects to simplify and adapt the context of visualization to a specific issue or sub-set of issues. \textbf{Dependency detection and duplicate detection in issue management.} Although the state-of-the-art addresses the requirements for traceability and dependency management, very few focus on the issue tracker domain. Borg et al.~\cite{Borg2014} conducted a systematic mapping of information retrieval techniques for traceability and artifact dependencies in software projects. Among 79 related publications, most were limited to a proof-of-concept solution with a reduced sample validation with partial quality metrics like precision or recall in a validation scenario of no more than 500 artifacts. Despite the supporting tools like Jira plugins for the visualization of issue dependency trees, like SwarmOS Analyzer or Vivid Trace\footnote{https://marketplace.atlassian.com/apps/1212548/}, there are no popular plugins or tools for the autonomous detection of dependencies or cross-references among issues in an issue repository. On the other hand, managing and detecting duplicated issues is a well-known problem considered critical by several studies when managing issues with issue trackers~\cite{Alipour2013,Kshirsagar2015,deshmukh2017}. Ellmann~\cite{Ellmann2018} defines a theoretical background for the potential of state-of-the-art natural language and machine learning techniques to extend issue trackers with automated duplicate detection. However, no artifact nor practical implementation is reported. The \textit{Find Duplicates}\footnote{https://marketplace.atlassian.com/apps/1212706/} Jira plugin uses similar techniques to those reported by Ellmann to extend search features from Jira by reporting potential duplicates at report time or running queries to find related issues. Nevertheless, these tools do not provide details about the scalability of these solutions for large data-sets, as the emphasis is on proof-of-concept evaluation. Instead, they offer centralized server-side extensions for Jira environments with few details from a software architecture point of view, making them less suitable for large data-sets. \textbf{Consistency check and repair of releases.} As reported in Section~\ref{sec:drawbacksManagement-techniques}, literature on release planning for issue management is especially focused on autonomous release plan generation rather than consistency checking and repair of releases~\cite{Svahnberg2010,Ameller2016}. Consequently, it is difficult to find related work focused on analyzing and diagnosing releases in the issue tracker domain. If we focus on tool support examples, in addition to the visualization of issue dependencies, the~\textit{Vivid Trace} Jira plugin uses this feature to provide deep dependency analysis capabilities focused on visual representation, monitoring of chains of events, and the detection of potential blockers or conflicts among the dependencies. \section{Threats to validity} \label{sec:Validity} We analyze the threats to validity according to the four categories proposed by~\cite{shadish2002experimental} in experimental research. \emph{Construct validity} refers to proper conceptualization or theoretical generalizations. This study focused on tool (Jira) improvement rather than process improvements. Our conceptualization is based on a few stakeholders, and, as noted in the validation interviews, their needs differ. One threat is whether we conceptualized the problem correctly, and another is whether we focused on a relevant problem of the case company. However, the respondents were highly experienced, there were several of them, the researcher had a prolonged engagement with the problems as the process lasted a reasonably long time, and the problems the experts raised were also evident in the data. Furthermore, the results cause no harm either as they aim to help and do not disturb existing ways of working. In our solution development, we relied on handpicked examples. In order to alleviate potential threats with the selection of the examples, we established good communication with TQC’s stakeholders. In eliciting the drawbacks in RQ1, we used carefully designed and piloted interviews. This helped us assess which issues would be suitable examples for our research. However, the evaluation iterated through all public data, except for cross-validation, thus not limiting ourselves to the hand-chosen examples. \emph{Internal validity} refers to inferences about whether the presumed treatment and the presumed outcome reflect a causal relationship between them. Our solution aims to address drawbacks acknowledged beforehand by the stakeholders. Thus, the knowledge claim concerns whether the suggested solution, i.e., techniques implemented and integrated into Jira, helps address the drawbacks. The solutions were validated with TQC’s Jira users to check that they were applicable to tackle the drawbacks. However, a limitation is that the Jira users testing our system used real data but did not test it extensively in their daily work. \emph{External validity} concerns whether our knowledge claims could be generalized beyond the TQC environment. We consider TQC a good case for research due to its large, standard Jira and typical software engineering and open source practices. Thus, there is a high probability that the solutions could be applicable in other environments. However, TQC’s Jira is a mature and complex environment, and the drawbacks and our solutions reflect this. Although our solutions may technically work in less complex environments, it is not certain that they would be equally valuable. In terms of the mutability of the artifact, we intentionally constructed the solution to be flexibly adaptable to new algorithms and microservices. Interviews with a few selected users do not fully compare to full-scale use in practice. This is notable as the generalizability of the artifact is, in addition to its applicability to the drawbacks themselves, also dependent on whether the users accept the solution. This is difficult to assess with only a few respondents and might come down to, for example, whether or not the users are satisfied with the artifact and its microservices in the long run, and not just initially. \section{Introduction and motivation}\label{sec:introduction}} \input{sect_1_introduction} \section{Background: Issue trackers} \label{section:background} \input{sect_2_background} \section{Research approach: Design Science} \label{section:researchMethod} \input{sect_3_researchMethod} \section{RQ1: Drawbacks in issue management} \label{section:currentDrawbacks} \input{sect_4_currentDrawbacks} \section{RQ2: Objectives and Features for the enrichment of issue management} \label{section:drawbacksManagement} \input{sect_5_drawbacksManagement} \section{RQ3: Artifact implementation} \label{section:implementation} \input{sect_6_implementation} \section{Evaluation} \label{section:quality} \input{sect_7_quality} \section{Discussion} \label{section:discussion} \input{sect_8_discussion} \section{Conclusions and Future Work} \label{section:conclusions} \input{sect_A_conclusions} \section*{Acknowledgments} The work presented in this paper has been conducted within the scope of the Horizon 2020 project OpenReq, which is supported by the European Union under Grant Nr. 732463. We are grateful for the provision of the Finnish computing infrastructure to carry out the tests (persistent identifier urn:nbn:fi:research-infras-2016072533). This paper has been funded by the Spanish Ministerio de Ciencia e Innovación under project / funding scheme PID2020-117191RB-I00 / AEI/10.13039/501100011033. \vskip 4\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Mikko Raatikainen} received his PhD in computer science and engineering from Aalto University. He is a researcher of the empirical software engineering research group in University of Helsinki. His research interests include empirical research in software engineering and business. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Quim Motger} is a PhD student at Universitat Politècnica de Catalunya (UPC). He is a member of the UPC research group on software and service engineering. His research focuses on natural language processing, machine/deep learning software systems, and web-based software architecture environments. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Clara Marie Lüders} is a PhD student at University of Hamburg (UHH). She is a member of the UHH research group on applied software technology. Her research focuses on machine/deep learning, natural language processing, Issue Tracking Systems, and graph theory. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Xavier Franch} received his PhD from Universitat Politècnica de Catalunya (UPC). He is a full professor in UPC where he leads the research group on software and service engineering. His research focuses on requirements engineering and empirical software engineering. He is associate editor in IST, REJ, and Computing, and J1 chair at JSS. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Lalli Myllyaho} is a PhD student at University of Helsinki (UH). With a background in mathematics and teaching, he is a member of the empirical software engineering group at UH. His current interests include the reliability and operations of machine learning systems. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Elina Kettunen} received her PhD in plant biology and her Master's degree in computer science from University of Helsinki. Her research interests include empirical software engineering and paleobotany. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Jordi Marco} received his Ph.D. from Universitat Politècnica de Catalunya (UPC). He is an Associate Professor in Computer Science at the UPC and a member of the software and service engineering group (GESSI). His research interests include natural language processing, machine learning, service-oriented computing, quality of service, and conceptual modeling. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Juha Tiihonen} received his PhD in computer science and engineering from Aalto University. His research interests include configuration systems and processes for physical, service, and software products. This work was performed at University of Helsinki. He is currently the lead developer of sales configuration systems at Variantum~oy. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Mikko Halonen} is a B.Sc (Automation Eng. Tech.) from the Technical College of Oulu. He currently works as a quality manager in The Qt Company. \end{IEEEbiographynophoto} \vskip -2\baselineskip plus -1fil \begin{IEEEbiographynophoto}{Tomi Männistö} received his PhD from Helsinki University of Technology, currently Aalto University. He is a full professor of the empirical software engineering research group in University of Helsinki. His research interests include software architectures, variability modelling and management, configuration knowledge, and requirements engineering. \end{IEEEbiographynophoto} \end{document} \subsection{Research process} We apply the Peffers \textit{et al.}~\cite{Peffers2007} incremental and iterative process to Design Science, as illustrated in Figure~\ref{fig:researmethod}. The phases are linked to the research questions and evaluation, as shown at the bottom of Figure~\ref{fig:researmethod}. As a part of process iterations illustrated on the top of Figure~\ref{fig:researmethod}, we frequently discussed the research with TQC's stakeholders and incorporated their feedback. Specifically, we had an approximately bi-weekly online status meeting in which one of TQC's managers participated. The research questions (listed in Table~\ref{tab:rqs}) are: \textbf{Problem identification (RQ1).} We had conducted an exploratory, multiple case study to understand companies' pain points, needs, and challenges for a platform to support large-scale requirements engineering~\cite{Fucci2018} as part of the collaborative OpenReq research and innovation project\footnote{www.openreq.eu}. TQC was one of the five organizations in the study. Data were collected using semi-structured, half-day interviews with one product manager and two senior R\&D managers selected by a TQC representative due to their active involvement in maintaining and improving Jira and the RE process within TQC. The participants worked in the Qt R\&D sites in Germany, where the interviews were conducted in English. Interviews were audio-recorded and later transcribed. The data were analyzed using open and axial coding on the Atlas.ti\footnote{www.atlasti.com} tool. One researcher held the primary responsibility, and other researchers supported and reviewed them. The main problems found were: information overload, limited tool support, handling of dependencies between requirements, and stakeholder identification for issue assignment. The research method and results details are available at~\cite{Fucci2018}. \begin{table}[t] \centering \caption{Research questions of the study} \label{tab:rqs} \begin{tabularx}{\columnwidth}{@{}lX@{}} \toprule ID & Text \\ \midrule RQ1 & What drawbacks do stakeholders suffer with current issue trackers? \\[1ex] RQ2 & What features can be added to issue trackers to address these drawbacks? \\[1ex] RQ3 & How can these features be integrated in an issue tracker so that it has value for use? \\[1ex] \bottomrule \end{tabularx} \end{table} RQ1 of this paper refines the problems mentioned above in~\cite{Fucci2018} to better understand these problems rather than explore the broader problem space. First, however, we excluded the problem of stakeholder identification because open source communities are generally sensitive to the disclosure of personal information. Then, the remaining three problems were analyzed in greater depth to gain a more holistic and detailed understanding and provide concrete examples. This analysis paralleled the process of the following RQs. We had access to the earlier interview data, met several times with two additional managers at TQC and another manager even more frequently who provided us with feedback and contextual information, and analyzed publicly available TQC Jira issues by ourselves and based on example issues mentioned by TQC's employees. This analysis of issues also triangulated and validated our understanding. The existing triaging process, the ongoing requirement engineering process improvements, and a TQC manager's emphasis on challenges with dependencies, as detailed in Section~\ref{sec:ReseachContextTQC} below, made us focus on the functionality of Jira rather than process improvement. A respondent even pointed out challenges in Jira: "\textit{So I realize we’re sitting on huge knowledge bases, which is Jira, with lots and lots and lots of details, but often it feels like we are working on a haystack. So it’s just so overwhelming, that it’s hard sometimes to really, you know, find out what is important and what not. And having some help there would be great}" (sic) later continuing "\textit{as I said, Jira is just a big haystack, and having some analytics to understand,... okay, the pain point}" (sic). The resulting drawbacks are summarized and provided with the same or similar challenging examples pointed out by TQC's employees in Section~\ref{section:currentDrawbacks}. \textbf{Define solution objectives and design (RQ2).} The solution objectives synthesize functionality to mitigate the drawbacks. The design principles of solution techniques realize the objectives and integrate with issue trackers as the tool and the existing issues of the issue trackers as the data. As a central design principle, the solution should not change but instead support and complement current ways of working to lower the adoption barrier. While understanding the context and drawbacks (RQ1), we also synthesized the objectives of the solution. We held frequent meetings with the TQC managers to combine the problem domain understanding of TQC and our solution proposal knowledge. We then defined the solution techniques, including how different techniques were considered and even tested as prototype implementations. Some techniques were abandoned, e.g., because of challenges in practical scalability or required data quality. Overall, the process was iterative and selective, resulting in objectives and solution techniques in Section~\ref{section:drawbacksManagement}. \textbf{Implementation of the solution and demonstration of its operations (RQ3).} The incremental development of the artifact to realize the solution was done iteratively with a feedback loop from TQC, which helped ensure that the artifact was meeting general quality objectives, which we structured following the ISO/IEC 25010 product quality model~\cite{ISO25010}. The implementation consists of a Jira plugin as a user interface and the solution techniques as independent microservices. These challenges shaped the final artifact design, as detailed in Section~\ref{section:implementation}. \textbf{Evaluation.} \label{sec:ResearMehod-Evaluation} The final evaluation is divided into \emph{verification} and \emph{validation}~\cite{ISO25010}. Verification evaluated the results against the stated objectives, and it was carried out by executing system tests that explored the functionality and observed and measured the product quality characteristics. Validation techniques assess the results with their intended users through interviews. The technical details and results of the evaluation are provided in Section~\ref{section:quality}. \subsection{Research context: TQC and issue management} \label{sec:ReseachContextTQC} TQC, as the company is now known, was established in the 1990s, later acquired by Nokia Plc and Digia Plc, and now operates as an independent publicly listed company. TQC is growing fast with around 300 employees and major R\&D sites in Finland, Germany, and Norway. TQC is a global software product and service company applying typical modern software engineering tools and methods, such as agile practices. TQC governs the Qt project (hereafter \emph{Qt}), which is developing a software development kit\footnote{www.qt.io} consisting of the Qt software framework itself and its supporting tools. These tools include the integrated development environment~(IDE) called Creator and the 3D Studio (3DS) and extensions to the Qt software framework, such as the Automotive suite. Qt specifically targets the development of cross-platform mobile applications, graphical user interfaces, and embedded applications. Qt is estimated to be used by one million developers and most of today's embedded and touch screen systems rely on Qt. Qt is available under open source and commercial licenses. Jira is the only system for product management and requirements engineering. The oldest issue in Jira dates back to the 23rd of September 2003, i.e., almost two decades old. Each Jira issue has an ID consisting of a preceding project acronym and a running number (e.g., `QBS-991'\footnote{https://bugreports.qt.io/browse/QBS-991}), a title (`Qt Android support') and description, as well as several properties, such as the type (in QBS-991, a bug), release (referred to as \textit{Fix Version/s}), priority, status (identifies where an issue is in its lifecycle, such as `Open', `Closed'), resolution (gives additional details for status, such as an issue is closed because it is a `Duplicate'), and automatic meta-data, such as the creation date. There are various releases, such as major and minor releases and bug fixes, and the release numbering typically follows up to three-part (x.y.z). Priority ranges from 0 (`P0 blocker') to 5 (`P5 not important'). In addition, an issue includes comments. In TQC's Jira, issues may report `bugs', `epics', `user stories', `suggestions', and `tasks'. While bugs are the prevalent issues, TQC aims to organize development by applying an issue hierarchy like in agile methods: large functionalities or features are defined as `epics' that are refined as User Stories and further as `tasks'. TQC underwent ongoing requirement engineering process improvement that aimed to enforce this hierarchy further. In addition to the parent-child relationships induced by this issue hierarchy, issues can have dependencies referred to as \textit{Issue Links} in Jira. These links can only be set by employees of TQC or authorized open source developers. Other TQC Jira users, even the creators of issues, cannot set any links. TQC's Jira supports the following links: `duplicates', `requires', `relates', `replaces', `results', and `tests'. All these links are bidirectional (e.g., `is related to' and `relates to'), but it is not uncommon for users to declare a wrong direction, especially in the case of a duplicate, as the resolution already shows duplication. There are also several exceptions or misuses for these types. Sometimes issues are used only to gather other issues, such as one major epic depending on other epics, as epics cannot form a parent-child hierarchy (e.g., QTBUG-62425\footnote{https://bugreports.qt.io/browse/QTBUG-62425}). Some issues group other issues in the description or comments field (e.g., QTCOMPONENTS-200\footnote{https://bugreports.qt.io/browse/QTCOMPONENTS-200}), and not all of them are linked in the appropriate fields. Although Jira handles parent-child relationships and links differently, we simply use \textit{dependency} to denote both. TQC's Jira is divided into projects. Examples include: `QTBUG', which contains issues related to the Qt Framework, and `QTCREATORBUG', which contains issues related to Creator. The large projects are further divided into components, such as a Bluetooth component in `QTBUG'. Each component has a responsible maintainer from TQC's R\&D department or the open source community. TQC's product management has more general responsibility for the projects. The projects and components have dependencies, including cross-project dependencies, like the Automotive suite built on top of Qt Framework. \begin{table} \caption{The number of issues and dependencies in the three largest and other projects in total on the 29th November 2019.} \label{tab:JiraData} \begin{tabularx}{\columnwidth}{X >{\raggedleft\arraybackslash}p{1.71cm} >{\raggedleft\arraybackslash}p{1.71cm} >{\raggedleft\arraybackslash}p{1.71cm} } & \textbf{Issues} & \textbf{Internal \newline dependencies} & \textbf{Cross-project \newline dependencies*} \\ \toprule & & & \\[-.3cm] Qt Framework & 78,676 & 15,739 & 1,811 \\ Creator & 21,926 & 3,126 & 1,132 \\ 3D Studio & 3,877 & 2,023 & 133 \\ Other projects & 15,441 & 3,517 & 1,307 \\ \bottomrule \end{tabularx} * A dependency between two projects is counted in both projects. \end{table} Anyone can register and report issues to TQC's Jira and view the full details of issues, follow issues, and add comments. Qt operates in a meritocratic manner, in which developers get promoted as Jira users when they contribute to Qt and receive recommendations from other developers. Only those who have received elevated rights can edit issues. This preserves quality and integrity. All new issues go through a triaging process\footnote{https://wiki.qt.io/Triaging\_Bugs} to ensure issue quality. Triaging includes checking the quality of the issue in terms of relevance and understandability, specifying which component the issue concerns, assigning the responsible maintainer, and setting the priority. Typically, issues are triaged within a few days at most. The triaging responsibility is rotated within TQC, but the maintainers or others with proper elevated rights can also triage and manage issues before TQC's responsible employees react. To monitor overall progress, TQC uses dashboards for each release with swim lanes for status categories `not started', `in progress', `blocked', and `done'. A dashboard is a feature in Jira to automatically filter, organize, and visualize a set of Jira issues based on their property values, such as the above release and status. TQC's Jira is an independent deployment in a virtual machine in the Amazon cloud services. In addition, TQC has a snapshot of this virtual machine as a test environment, which we use in our research. The snapshot was taken on the 29th November 2019. In this snapshot, TQC's Jira is divided into~20 public, separate projects. We used this same data snapshot for all tests to make the results comparable. Table~\ref{tab:JiraData} shows the number of issues and dependencies in Qt Framework, Creator, and 3D Studio, the three largest projects, and the remaining 17 other projects combined. Out of a total of 119,920 issues, 26,746~(22\%) issues were modified within the last year before the test snapshot (29.11.2018-29.11.2019), and~25,938~(22\%) were open, i.e., not resolved, at the end of the period. Modifications include any changes, such as editing text, changing properties, or adding comments. In addition, TQC has about ten private projects in Jira for specific customers and product management, which contain a few thousand additional issues. For confidentiality reasons, these projects are not included in the data-set of this paper. \subsection{Objectives} \label{sec:objectives} Based on the drawbacks enumerated in the previous section, we present the synthesized solution objectives, which aim to alleviate the drawbacks and improve dependency management in issue trackers. \begin{itemize} \item \textit{\textbf{Objective 1.}} Users gain a better understanding of the existing issue dependency network of the issues (\textit{Drawback 1}). \item \textit{\textbf{Objective 2.}} Users can search for missing dependencies and unidentified duplicate issues (\textit{Drawback 2}, \textit{Drawback 3}). \item \textit{\textbf{Objective 3.}} Users can check the correct release assignments and priorities of the issue dependency network of issues and receive suggestions for resolving inconsistencies (\textit{Drawback 4}). \end{itemize} These objectives share four common, additional characteristics. First, the objectives integrate into the current ways of working with issue trackers, being usable whenever needed without disturbing existing processes. Second, the objectives are about improving issue trackers so that their realization becomes integrated into the functionalities and especially data of issue trackers. Third, the objectives address the context of the existing issues that the user is working on. Fourth, the objectives should be realizable through scalable solutions, capable of working efficiently even with large projects. Consequently, the objectives primarily address tool improvement rather than process improvements or changes. \subsection{Dependency management baseline techniques} \label{sec:drawbacksManagement-background} The fundamental principle of our solution is that the roles of dependencies in issue trackers can be first-class entities rather than only properties of issues. We approached this by handling issues and dependencies as two distinct entity types in a graph-like structure: issues are nodes, and dependencies are typed (i.e., labeled) and directed edges between the nodes. This approach gives issues a context beyond their explicit properties, revealing implicit constraints, e.g., the mutual aggregation of two issues through a dependency between them. Moreover, dependencies can then have properties of their own, like issues have, such as a status and creation date. We define what we call an \emph{issue graph} as follows. We denote the set of all issues as $R$ and the set of all dependencies between issues of $R$ as $D$, i.e., ${D \subseteq R \times R}$, where $D$ is anti-reflexive, i.e., ${\forall r_i \in R : (r_i,r_i) \notin D}$; and all edges are bidirected, i.e. ${\forall r_i, r_j \in R : (r_i,r_j) \in D} \iff (r_j,r_i) \in D$. That is, for every edge that belongs to the graph, there is also a corresponding inverse edge where the semantics of the edge depends on the direction. For a particular issue $r_0 \in R$, the issue graph is a symmetric connected graph ${G_0 = (R_0, D_0)}$, where $R_0 \subseteq R$ and $D_0 \subseteq D$, so that all issues of $R_0$ are reachable from $r_0$, i.e., for all issues $r_i \in R_0$ there is a path from $r_0$ to $r_i$ and $D_0$ includes all dependencies between the issues in $R_0$ and only those. This definition of an issue graph is issue-centered and does not necessarily include all issues ($R_0 \subsetneq R$) because there is normally no path between all issues. However, the union of all $G_0$, denoted by $G = \bigcup G_0$, contains all issues ($R$) and dependencies ($D$). Equivalently, every $G_0$ is a component of $G$. A special case of $G_0$ is an \textit{orphan issue} $r_0$ with no dependencies, and thus for which $R_0 = {r_0}$ and $D_0 = \emptyset$. Given an issue $r_0$, we define $G^p_0$, called a \textit{$p$-depth issue graph}, as an induced subgraph of $G_0$ that includes all issues up to $p$ edges apart from $r_0$ and all dependencies between the included issues. That is, an issue is taken to the point of focus, and we follow all dependencies of that issue to neighboring issues and beyond, breadth-first up to the desired depth. The rationale and benefit of a $p$-depth issue graph are that different sizes of \textit{contexts of analysis} can be constructed automatically without user involvement to provide a given issue with the issues and dependencies in specific proximity. For an issue~$r_i$, we can apply a number of functions, such as $r_i.property(priority)$, to obtain its priority and $r_i.property(release)$ to get its scheduled release. Similarly, $d_i.property(status)$ will yield the status-property of a dependency~$d_i$, with possible values `proposed', `accepted' or `rejected' and $d_i.property(score)$ will give a score value (0..1) representing the confidence level of correctness or validity of the dependency. These definitions provide the baseline for formulating the dependency management techniques required by users of issue trackers, addressing the objectives presented in Section~\ref{sec:objectives}. An issue graph ($G_0$) -- or the issue graph corresponding to the entire issue dependency network ($G$) -- can be generated automatically with the information stored in issue trackers; therefore, any operation defined over an issue graph or any transformation to any other formalism (e.g., constraint satisfaction problem (CSP)) can be computed from issue trackers, as we have effectively done. An issue graph does not necessarily need to affect issue trackers; instead, the graph can form a parallel, complementary structure. In particular, an issue graph ($G_0$) makes efficient issue management easier. Specifically, visualizations of dependency networks (\textit{Objective1}) can be generated directly for the user interface as described in Section~\ref{section:implementation}, and advanced dependency management techniques can be designed as described below. \subsection{Dependency Management Techniques} \label{sec:drawbacksManagement-techniques} This subsection describes four concrete techniques of our solution, relying on the baseline techniques built on the concept of an issue graph. These techniques have been designed with the objectives in Section~\ref{sec:objectives} in mind. In particular, the techniques need to work in an industrial context, as exemplified in this paper by the TQC context, such as providing near real-time response times even when managing large sets of issues, which may sometimes prevent the adoption of more sophisticated approaches. \textbf{Automated detection of potential missing dependencies.} As issue tracker users may neglect to report a significant number of dependencies, users would benefit from automatic dependency detection (\textit{Objective2}). Automation mitigates the burden of searching for the dependent issues, making it less critical for users to be familiar with all other existing issues. It is possible to automatically detect missing dependencies using various techniques, including deep learning~\cite{Guo2017}, active learning, and ontology-based approaches~\cite{Deshpande2020}. In order to select an adequate dependency detection technique, we built on two fundamental observations. First, we prototyped a few complex techniques and observed that they did not meet the stringent time requirements and lacked proper training data. Second, TQC’s Jira users noted that dependencies are often mentioned as a reference to another issue in the title, description, and comments of an issue (Section~\ref{section:currentDrawbacks}, see Example~\ref{ex:reference}). Therefore, we adopted a \textit{reference detection} technique for natural language text (see Algorithm~\ref{algorithm:cross-det}) to uncover dependencies declared in the issue tracker in any of these text fields. In other words, our solution does not aim to identify unknown dependencies. The reference detection technique analyzes this textually added content by searching for sub-strings consisting of a project acronym, a dash, and an integer (e.g., ''QBS-991'', see Section~\ref{sec:ReseachContextTQC}) representing an issue ID (line~4 of Algorithm~\ref{algorithm:cross-det}), and creates proposals for new dependencies whenever other issues are mentioned (lines~5--7). The reference detection technique marks the dependencies found as `proposed' (line~6) without type because only references to other issues are detected. A user should check, i.e., accept or reject these results, add the correct dependency type, and edit the textual content of the issue in case the proposed dependency is incorrect. \begin{algorithm}[t] \caption{ReferenceDetection($R$, $projectID$)} \textit{R}: Set of issues of an issue graph \\ \textit{projectID}: Set of project IDs (e.g., "QTWB", "QTBUG") \begin{algorithmic}[1] \STATE \textit{$D_{p}$} = []: set of proposed dependencies \FORALL{$r_i$ in $R$} \FORALL{$p_i$ in $projectID$} \STATE $toID[]$ = $r_i$.findStrings($p_i$+``-''+[0-9]\{1,5\}) \FORALL{$to_i$ in $toID$} \STATE $D_{p}$.add($r_i$, $to_i$, 'dependency', `proposed') \ENDFOR \ENDFOR \ENDFOR \RETURN $D_{p}$ \end{algorithmic} \label{algorithm:cross-det} \end{algorithm} \textbf{Automated detection of potential duplicated issues.} The need for, the solution to, and the benefits of automatic duplication detection are much like the above because, as already noted in Section~\ref{section:currentDrawbacks}, duplicates result in a particular type of dependency in Jira (\textit{Objective2}). State-of-the-practice approaches use bag-of-words of natural language representations to measure the similarity between these representations using vector-space models~\cite{Shahmirzadi2019TextSI}. Among these approaches, \textit{Term Frequency - Inverse Document Frequency} (TF-IDF) is the theoretical baseline for detecting duplicated entities or issues~\cite{Sun2011,Motger2020}. More recent deep contextualized models, such as Google's BERT~\cite{Devlin2019} or ELMo~\cite{Peters2018}, are more suitable for complex information retrieval scenarios, but as in dependency detection, they introduce a challenge in terms of efficiency, complexity, and training data required~\cite{Wang2019}. These challenges make it difficult to use them in the context of large issue dependency networks, as TQC exemplifies. Our solution (see Algorithm~\ref{algorithm:sim-det}) is an application and extension of the TF-IDF model based on three additional steps to improve the accuracy and performance of the similarity evaluation. After initially running the title and description of each issue through a lexical analysis pipeline (Lines 1--4 of Algorithm~\ref{algorithm:sim-det}), we built a TF-IDF model from the resulting bag-of-words representations (Line 5). Then, we apply the cosine similarity for the resulting TF-IDF model to compare each pair of issues. Alternative measures (e.g., Jaccard similarity) were evaluated through a preliminary literature review of the similarity evaluation field~\cite{Furnari2018}, which conveyed that TF-IDF and cosine similarity were suitable candidates for industrial scalability and generalization beyond the TQC case study. Each resulting score is then compared to a context-based minimum threshold value to decide whether a pair is a potential duplicate, in which case a new `duplicate' dependency proposal is constructed (Lines 6--11). This context-based similarity threshold score must be set through a preliminary cross-validation analysis on a subset of labeled issues to predict duplicated issues accurately (see Section \ref{sec:DependencyManagementVerification}). After the similarity evaluation, we represent the duplicated issues as sets of complete graphs, where issues have an existing or proposed `duplicate' dependency to other issues. We treat these sets of graphs as \textit{clusters} --- the process proposes sets of duplicated issues by simply including the issues belonging to the same cluster (Lines 12-13). During this process, we apply transitivity through existing duplicate dependencies to all issues belonging to the same cluster, resulting in new duplicated proposals. Hence, instead of reporting all the existing and proposed `duplicate' dependencies among them, we only report the duplicated dependency with the greatest similarity score for all other issues in the cluster. Given a sub-graph of $m$ duplicated issues, the clusters can be reported using $(m - 1)$ dependencies instead of representing all ($m*(m - 1)/2$) dependency objects, improving performance efficiency in data processing and transactions. The extension of the similarity algorithm through a clustering representation, the need for which was identified during construction, improves the current state-of-the-art approaches by significantly reducing the amount of noisy data and simplifying the formalization of duplicated issues, similarly to up-to-date alternative solutions in the field \cite{Rocha2021}. Furthermore, stakeholders do not want all duplicate links explicitly in their issue trackers. A detection model might recommend all possible duplicate links, which the stakeholders do not want. \begin{algorithm}[t] \caption{DuplicateDetection($G$, $thr$)} \textit{G = (R, D)}: Issue graph \\ \textit{thr:} Similarity threshold score \begin{algorithmic}[1] \STATE \textit{bow} = [] : Bag of words \STATE \textit{clusters} = [] : Set of sub-graphs of duplicated issues \FORALL{$r_i$ in R} \STATE \textit{bow}.add.text\_preprocess(\textit{$r_i$}) \ENDFOR \STATE \textit{tfidf\_model} = build\_model(\textit{bow}) \FORALL{$r_i$, $r_j$ $\in$ R where \textit{i $\neq$ j} and ${d_{ij} = (r_i, r_j)} \notin D$} \STATE \textit{score} = cosine\_sim(\textit{$r_i$, $r_j$, tfidf\_model}) \IF{\textit{score} $\geq$ \textit{thr}} \STATE $D$.add($r_i$, $to_i$, 'duplicates', `proposed', \textit{score}) \ENDIF \ENDFOR \STATE \textit{clusters} = compute\_clusters(\textit{R}, \textit{$D$}) \RETURN clusters \end{algorithmic} \label{algorithm:sim-det} \end{algorithm} \begin{algorithm}[t] \caption{Proposals($r_0$, $D_0$, $D_0'$, $depth$, $orphan$, $property$)} \textit{$r_0$}: Issue of interest \\ \textit{$D_0 = [(r_0,r_{p1}),...]$}: Dependencies for $r_0$ in TQC's Jira \\ \textit{$D_0' = [(r_0,r'_{p1}),...]$}: Dependencies for $r_0$ stored as rejected \\ \textit{depth = [p, $f_{depth}$]}: Minimum depth and its factor \\ \textit{orphan = $f_{orphan}$}: Orphan factor (default value = 1) \\ \textit{property = [[$p_0, v_0, f_0$],...]}: Properties, values and factors\\ \textit{$D_p$= []}: Set of proposed dependencies for $r_0$ \begin{algorithmic}[1] \STATE $ D_p.combine(references(r_0)+duplicates(r_0)) $ \FORALL{$d_p$ in $D_p[]$} \IF {($d_p$ member\_of $D_0$) \textbf{OR} ($d_p$ member\_of $D'_0$)} \STATE $D_p.delete(d_p) $ \ELSE \IF {$r_0$.distance($d_p.r_p$) $> p$} \STATE $d_p.score.multiply(f_{depth}) $ \ENDIF \IF {$d_p.r_p.orphan()$} \STATE $d_p.score.multiply(f_{orphan}) $ \ENDIF \FORALL{($p_i, v_i, f_i$) in $property(p,v,f)$} \IF {$r_p.property(p_i)$ == $v_i$} \STATE $d_p.score.multiply(f_i) $ \ENDIF \ENDFOR \ENDIF \ENDFOR \RETURN sort\_by\_score\_descending($D_p$) \end{algorithmic} \label{algorithm:optimize} \end{algorithm} \textbf{Contextualization of dependency proposals for an issue.} The contextualization technique consists of finding the most likely correct and useful dependency proposals, filtering out redundant proposals, and emphasizing proposals that would be difficult to find otherwise or have features that the user wishes to find (improvement to \textit{Objective2}). Contextualization emphasizes likely results with desired features, thus improving the results of the detection algorithms by combining results and using knowledge of the domain instead of tweaking the detection algorithm itself. The proposed dependencies should likely be correct and hold additional value compared to the previous state of things. For example, a user might be more interested in similar issues reported around the same time since the issues can concern the same bug that developers have encountered in different situations. Also, an erroneous proposal is not useful either, and having too many of them erodes the users' trust in the tools; therefore, already rejected proposals can be saved and filtered out from the results. Thus, contextualization is necessary for the solution to be more useful in practice. The technique is presented in Algorithm~\ref{algorithm:optimize} and described in more detail below. First, our solution aggregates the scores of Algorithm~\ref{algorithm:cross-det} and Algorithm~\ref{algorithm:sim-det} for a given issue $r_0$ (Line~1 in Algorithm~\ref{algorithm:optimize}). This kind of aggregation of results of different algorithms -- or ``voting'' -- is a useful tool for improving the accuracy of results and masking errors made by one of the algorithms, especially when the components base their results on different metrics \cite{myllyaho2021misbehaviour}. For example, in our case, a direct reference detected by Algorithm 1 to $r_0$ together with a high similarity score detected by Algorithm 2 implies that someone has noticed the similarity and mentioned it in the comments. On the contrary, if $r_0$ is referenced, but the similarity score is low, the comment is more likely to be about something other than perceived similarity. The aggregation used here is simply the sum of the cosine similarity ($0..1$, see Algorithm~\ref{algorithm:sim-det}) for duplicate detection and a default value ($1$) for reference detection. An additional benefit is that no dependency is proposed twice: once by Algorithm~\ref{algorithm:cross-det} and again by Algorithm~\ref{algorithm:sim-det}. Next, the solution examines all proposals obtained (loop comprising Lines 2--18). Lines 3--4 filter out redundant proposals. The detection techniques can result in proposals of dependencies for $r_0$ that already exist in TQC's Jira or have already been rejected by users. These proposals are considered redundant as the dependencies have been considered before and do not provide additional value for the user. For simplicity, we filter out the rejected proposals. For the remaining proposals, our solution applies two specific contextualizations (modifications of output checker in \cite{myllyaho2021misbehaviour}) developed based on the feedback of TQC's Jira users: \textit{an issue graph-based contextualization} and \textit{a property-based contextualization}. The former emphasizes the dependencies not already in proximity in the issue graph. The latter allows the users to find the kind of dependencies they believe to be most valuable to them at a given point in time. Both rely on user-defined \emph{factors} to multiply the score of the proposals meeting the user's criteria. Thus, proposals are not filtered out, but the more relevant proposals in the user's context are emphasized. More specifically, in issue graph-based contextualization, the scores of those dependencies from $r_0$ to issues in different issue graphs or the same issue graph with a greater distance than the given minimum depth~$p$, are increased (Lines 6--8). Also, the scores of dependencies from $r_0$ to orphans are increased as a special case (Lines 9--11). This is for two reasons. First, proximity often suggests a correct similarity with no practical relevance. For example, proposing a dependency between two children of an epic issue is likely correct but adds little value as their similarity is given because of their close relation to each other through parent-child dependencies. Second, duplicate issues within proximity are relatively easy to stumble upon when browsing through the issue graph, whereas duplicate issues further down the issue graph, issues in a completely different graph, and orphan issues are more challenging to find. Thus, proposed dependencies to issues further away from $r_0$ are considered more valuable in practice. Meanwhile, property-based contextualization increases the score when the properties of an issue in a proposed dependency have the same values as specified by the user. This could mean, for example, environment, project, or creation time (Lines 12--16). For example, if a user wishes to find duplicates from the Qt Framework project, the scores of those proposals that have the issues in this project are increased. Applying a factor smaller than one decreases the score, resulting in a negation, such as emphasizing dependencies to other projects. The user is considered an expert of the product they are developing -- property-based contextualization allows them to use their experience and expertise and use the tool more flexibly. \begin{algorithm}[t] \caption{CheckConsistencyAndDiagnose($r_0, G_0$)} \textit{$G_0 = (R_0,D_0)$ }: Issue graph for $r_0$ \\ \textit{$D_i$} : Inconsistent dependencies\\ \textit{$diag_d$} : Dependency diagnosis\\ \textit{$diag_i$} : Issue diagnosis \begin{algorithmic}[1] \STATE mergeDuplicates($G_0$) \FORALL{$d$ in $D_0$} \IF {inconsistent($d$)} \STATE $D_i$.add($d$) \ENDIF \ENDFOR \IF {$D_i=\emptyset$} \STATE return(`Consistent') \ELSE \STATE $diag_d$ = FastDiag($r_0, D_0$, sortByPriority($R_0-r_0$)) \STATE $diag_i$ = FastDiag($r_0$, sortByPriority($R_0-r_0), D_0$) \STATE return(`Inconsistent', $D_i, diag_d, diag_i$) \ENDIF \end{algorithmic} \label{algorithm:cc-diag} \end{algorithm} \textbf{Automated consistency check and diagnosis of inconsistencies.} Dependencies between issues need to be considered when analyzing the correctness of release assignments or priorities in issue graphs. The existing release planning models (cf. \cite{Svahnberg2010, Ameller2016}) are techniques for the task of finding an optimal release assignment from existing requirements by assigning requirements to releases. However, the other approach to release planning \add{\cite{GRuhe2005}} adopted here and at TQC is that the release assignments are manual, and the resulting release assignments are then checked for consistency (\textit{Objective3}). That is, when an issue graph is represented in a machine-understandable manner, a consistency check is an elementary operation that can be automated. In addition, a \emph{diagnosis} can identify minimal conflict sets that lead to consistency. The original diagnosis algorithm HSDAG (Hitting Set Directed Acyclic Graph)~\cite{Reiter1987} uses breadth-first search to find all minimal sets of constraints that could be deleted to restore consistency. Several improved diagnosis algorithms have been developed~\cite{felfernig2014conflict}. However, clearly defined dependency types (e.g.,~\cite{Carlshamre2001,Dahlstedt2005,Felfernig2018}) form the basis for any automation, and semantics can have a few alternative interpretations based on context. For example, the `requires' dependency can be interpreted so that the required issue must be in an earlier release or can be in the same release. \begin{figure*}[t] \centering \includegraphics[width=0.95\textwidth]{Figures/OpenReqArchitecture.PNG} \caption{The software architecture of the artifact. } \label{fig:architecture} \end{figure*} In our solution for consistency check and diagnosis, we utilize `requires' and `parent-child' dependencies, which have well-defined semantics that take priorities and release assignments into account; the details in the TQC context are described in Drawback~4 in Section~\ref{section:currentDrawbacks}. In addition, our solution merges issues with the `duplicate' dependency between them, and the resulting merged issue inherits all dependencies from the merged issues; this is the first step (Line 1 of Algorithm~\ref{algorithm:cc-diag}). The consistency check is a procedural method that evaluates, for each dependency, whether the conditions of the dependency are satisfied and reports the violated dependencies (Lines 2--6). If the dependency contains inconsistent dependencies, diagnosis can be invoked. We adopted FastDiag (see details in ~\cite{Felfernig2012A}), an efficient divide-and-conquer algorithm used to determine preferred diagnoses of constraint sets. Diagnosis applies a CSP representation of an issue graph where dependencies, priorities, and releases become the constraints of CSP. Constraints are assumed to be in a lexical order according to their priorities: a higher priority constraint is retained if possible, even if all lower priority constraints would have to be removed. \emph{The issue diagnosis} (Line 10) identifies a set of issues that need to be assigned to a different release or re-prioritized or removed to restore the consistency of the network. For this diagnosis, each issue is considered a constraint that can be relaxed or 'diagnosed away'. \emph{The dependency diagnosis} (Line 11) determines a set of dependencies whose removal from the issue graph restores consistency. The idea of diagnosis is that a user is then presented with two alternative solutions that lead to a consistent release assignment. Rather than automated change, the user must decide whether to act upon either diagnosis or find alternative actions to resolve the inconsistency. \subsection{Artifact design objectives} \label{sec:artifactobjectives} We articulate the design objectives using the eight ISO25010 quality model characteristics\cite{ISO25010}. \begin{itemize} \item \emph{Functional suitability}. The artifact needs to implement the techniques described in the previous section. \item \emph{Performance efficiency}. The artifact needs to handle a large number of issues efficiently, and the efficiency of Jira may not be unacceptably damaged. As an illustration, TQC's Jira users estimated this goal as ``responses, even to the largest requests, within a few seconds''. \item \emph{Compatibility}. The artifact itself needs to be compatible (co-exist and interoperate) with Jira's functionality and data without the need to develop additional software for interchanging data or accessing functions. \item \emph{Usability}. The usage of the artifact needs to integrate smoothly with Jira and the present way of working. \item \emph{Reliability}. Integrating the artifact and its data should not interfere with Jira's current issue management. This was clearly stated by TQC's Jira users, who had avoiding any risk concerning their current Jira management as their top priority. \item \emph{Security}. The solution must not compromise private data and must adhere to the company access policies. \item \emph{Maintainability}. The architecture needs to support easy evolution and extension as Jira evolves, and allow for easy integration of new techniques. \item \emph{Portability}. The solution should not be strongly tied to any particular technology other than Jira or impose unnecessary additional installation decisions. \end{itemize} \subsection{Artifact design} \label{sec:artifact-design} We implemented the artifact as a Jira plugin and service-based system consisting of independent microservices (${\rightarrow}$maintainability, compatibility), which in practice operate in a choreographic manner following a layered architectural style. The services collaborate through JSON-based messages following an earlier defined generic ontology~\cite{Quer2018} that adheres to REST principles (${\rightarrow}$portability). There are three classes of microservices and the plugin as summarized below and in the architecture diagram in Figure~\ref{fig:architecture}. {\bf 1. Integration microservices.} First, one microservice (\emph{Milla}) integrates with Jira, fetches issue data, and constructs dependencies as separate, first-class entities. We realized the integration using Jira's existing OAuth-based REST API (${\rightarrow}$portability, security). A full projection of TQC's Jira issues is made, and relevant information is cached to provide more efficient access to issue data (${\rightarrow}$efficiency). The resulting issue and dependency data from Jira are cached in a local database embedded into an auxiliary integration microservice (\emph{Mallikas}). Frequent updates fetch new and changed issues from TQC's Jira (${\rightarrow}$compatibility). {\bf 2. Detector microservices.} After completing the data projection, the integration service (\emph{Milla}) sends the resulting issues and dependencies -- or their changes when updating -- to the detector microservices for processing (${\rightarrow}$efficiency). The reference detector (\emph{Nikke}) searches for missing dependencies (i.e., implementing Algorithm~\ref{algorithm:cross-det} presented in Section~\ref{section:drawbacksManagement}) and the similarity detector (\emph{ORSI}) searches for duplicated issues (implementing Algorithm~\ref{algorithm:sim-det}). The reference detector \emph{(Nikke)} returns proposed dependencies (`proposals' in Figure~\ref{fig:architecture}), which are then stored in the same local database (\textit{Mallikas}) as the existing dependencies, applying the `proposed' value for the status-property. However, the similarity detector (\emph{ORSI}) requires persistence on the service side to optimize the similarity due to clustering and vector-based algorithms. Therefore, the proposals are stored internally in the cluster (${\rightarrow}$efficiency). {\bf 3. Model microservices.} The integration service (\emph{Milla}) also sends the issue graph~($G$) to the model microservices (\emph{Mulperi} and \emph{KeljuCaas}). These microservices translate the issue graph into a more general knowledge representation and store the data as a map datatype with issues as keys and a list of said issues' neighbors along with the corresponding dependency types. The way in which the issue graphs are stored allows easy extraction of various $p$-depth issue graphs ($G^p_0$) by following the dependencies recursively to the required depth (${\rightarrow}$efficiency). \begin{table*}[t] \centering \caption{A summary of evaluation, metrics, and used data-sets.} \label{tab:func-eval-metrics} \begin{tabularx}{\textwidth}{p{2.3cm} p{4cm} X p{2.6cm}} \toprule \textbf{Technique} & \textbf{Metric Id} & \textbf{Description} & \textbf{Data-sets} \\ \midrule \multirow{2}{2.3cm}{Issue graph handling} & \#dependencies & Number of dependencies in each issue & Qt Repository \\ & \#p-depth-graphs & Number of $p$-depth issue graphs\\ & \#issues-in-p-graphs & Number of issues in $p$-depth issue graphs\\ \midrule \multirow{2}{2.3cm}{Dependency \newline detection} & \#issues & Number of issues for which a dependency is proposed & \multirow{2}{2.6cm}{Qt Repository and \newline Duplicate set \#1 and \newline Duplicate set \#2} \\ & \#proposals & Number of dependency proposals & \\ & \#depth-3-distance & Number of issues with more than 3 edges apart& . \\ \cline{2-4} & accuracy, precision, recall, \newline F-measure & Quality classification metrics based on a cross-validation analysis of detectors dependency predictions & Cross-validation set \\ \midrule \multirow{2}{2.3cm}{Consistency check and diagnosis} & \#requires-inconsistent & Number of inconsistent \emph{requires} dependencies & Qt Repository \\ & \#parent-child-inconsistent & Number of inconsistent \emph{parent-child} dependencies & \\ & \#p-depth-consistency & Number of consistent $p$-depth issue graphs & \\ & \#issue-diagnosis-count & Number of issues diagnosed to be removed \\ & \#dependency-diagnosis-count & Number of dependencies diagnosed to be removed\\ & issue-diagnosis-success & Success of issue diagnosis \\ & dependency-diagnosis-success & Success of dependency diagnosis \\ \bottomrule \end{tabularx} \end{table*} {\bf 4. User interface plugin.} Users interact through a dedicated Jira plugin (\textit{Fisutankki}) installed in TQC's Jira. The plugin technology integrates the user interface into Jira and Jira's security mechanisms (${\rightarrow}$usability, compatibility). This allows public access, where authenticated users adhere to Jira's security schema (${\rightarrow}$security). On the users' side, \emph{Issue Link Map}~\cite{Lueders2019} (Figure~\ref{fig:screenshot}) is embedded in the Jira plugin (\textit{Fisutankki}), which creates a browser-based user interface (${\rightarrow}$usability, compatibility). A central part of the user interface is a 2D representation of a $p$-depth issue graph ($G^p_0$). The issue ($r_0$) in focus is in the center, and the other issues are automatically positioned around it circularly, depending on their depth. The user can select the desired depth, up to depth five, from the top-left, rearrange the issues, zoom in and out, etc. The colors indicate the status of the issues. A set of filters, such as type or status, can be applied to the visualization. On the right, various tabs represent the other techniques. The first tab shows the basic information for the selected issue as in Jira because the 2D diagram cannot convey all the details of an issue. The second tab shows dependency proposals, which are then also shown in the 2D diagram as dashed lines. The third tab shows the results of the consistency check. The user interface design was periodically shown and discussed with two TQC product managers and optimized according to their feedback. The user interface primarily tackles \textit{Drawback1}, as users can view connected issues in total, and offers an easy way to see and accept dependencies. The user interface accesses the functionality provided by other services through REST calls, which we refer to as \emph{queries} in Figure~\ref{fig:architecture}. Each query goes through the plugin (\textit{Fisutankki}) that applies Jira's security policies. Then the integration microservice (\emph{Milla}) orchestrates all queries to other microservices (${\rightarrow}$maintainability). The elementary functionality to initiate the user interface is to query an issue graph to depth five ($G^5_0$) from the model microservices, which the user interface visualizes to the desired depth. The integration microservice (\textit{Milla}) processes a user's query for a dependency proposal implementing Algorithm \ref{algorithm:optimize}. First, it combines reference proposals (in \textit{Mallikas}), similarity proposals (in \textit{ORSI}) and removes rejected proposals (stored in \textit{Mallikas}). Second, it calls the model services for the desired p-depth issue graph ($G^p_0$) to apply the issue graph-based contextualization. Third, it queries the cached data (in \textit{Mallikas}) for the property-based contextualization. A user can accept a proposed dependency that requires them to specify its type, or reject or disregard the proposal. Provided that the authorized user has sufficient privileges, the plugin (\textit{Fisutankki}) writes accepted decisions to Jira as new dependencies, while the local database (\emph{Mallikas}) stores rejection decisions. The integration service (\textit{Milla}) forwards a user's query for consistency check and diagnosis to the model services that first construct an issue graph ($G^p_0$) internally and prepare data for inference, such as translating the version numbers to integers (in \textit{Mulperi}). Then the consistency check is carried out, and, in case of inconsistency, the issue graph is read to constraint programming objects, and the Choco solver~\cite{choco} (in \textit{KeljuCaaS}) is used to infer diagnosis (Algorithm~\ref{algorithm:cross-det}). The microservices are deployed to the same server as TQC's Jira, which relies on the server's security mechanisms (`server boundary' in Figure~\ref{fig:architecture}). Although the microservices use secure communication, the data is not transferred to other servers remaining behind the server's firewall -- only the plugin's (\textit{Fisutankki}) REST endpoint is publicly accessible (${\rightarrow}$security). \subsection{Evaluation of baseline techniques} \label{sec:analysisOfBackgroudFeratures} \textbf{Evaluation design} The evaluation goal of the baseline techniques was to verify the functionality (Section~\ref{sec:drawbacksManagement-background}) and better understand the characteristics of TQC's Jira data with respect to existing dependencies. We first carried out the evaluation as an exploratory analysis as a set of batch process measures. We enumerated different projects, and then we calculated in total and in different projects the number of different types of issues, the number of different types of dependencies and whether the dependencies were inter-project and cross-project dependencies, and the number and types of dependencies from each issue. Finally, we enumerated all possible $p$-depth issue graphs, for which we calculated the total number of issues and the number of issues at each level. In addition to these batch process measures, we manually inspected selected issues, such as the ones with the highest number of dependencies. Below, we report the evaluation results of metrics related to the topology and size of the generated $p$-depth issue graphs, as shown by the first block in Table~\ref{tab:func-eval-metrics}. \textbf{Data-sets.} \textit{QT}: Qt Repository, all issues, and their dependencies. \textbf{Evaluation results.} In total, 31,182 issues~(26\%) have at least one dependency declared by TQC's Jira users by Issue Links in Jira (\textit{\#dependencies} in Table~\ref{tab:func-eval-metrics}), meaning that~88,738 issues~(74\%) are orphans before any automated dependency detection. Out of the issues that have dependencies,~75\% have only one dependency. The average is 1.7, and the median is 1. As noted in Section~\ref{sec:ReseachContextTQC}, issues are sometimes used for grouping, resulting in and explaining that the maximum number of dependencies is~139, and~24 issues have at least~50 dependencies. Generating all different p-depth issue graphs for all issues (i.e. $\forall r_i \in R$ we generated a $G^p_i$ $\forall p \in [1,n]$ so that $G^n_i$ = $G_i$) resulted in~320,159 issue graphs (\textit{\#$p$-depth-graphs}). By analyzing the number of issues in various $p$-depth issue graphs (\textit{\#issues-in-$p$-graphs}), we observed that the largest issue graph consists of~8,952 issues, and the maximum depth in its topology is~42. This issue graph is exceptionally large, with many subgraphs, as the next largest maximal issue graph consists of~162 issues with a maximum depth of~16. Finally, we inspected the number of issues in all different $p$-depth issue graphs (\#issues-in-p-graphs) and observed high variance and exponential growth in the number of issues at low depths. For instance, 5-depth graphs have a minimum of 5, an average of 210.5, and a maximum of 1778 issues. \textbf{Summary.} This exploratory analysis of the issue dependency network ($G$) reveals that there are many dependencies but also many disjoint issue graphs ($G_0$), including orphans. The number of issues in $p$-depth issue graphs can often be quite large and grow rapidly and exponentially as a consequence of average dependency count but also the grouping issues in the topology. In practice, issue graphs up to depth five are still meaningful for a user, but typically, issue graphs at greater depths contain too many issues and dependencies. \subsection{Evaluation of dependency management techniques} \label{sec:DependencyManagementVerification} \textbf{Evaluation design.} The goal of dependency management evaluation was to assess the validity and coverage of the detectors. We applied reference detection (Nikke) and duplicate detection (ORSI) to each issue of data-sets \textit{QT}, \textit{D1}, and \textit{D2} introduced below. We also differentiated the union and intersection of the results to analyze dependencies that both detectors or only one detector proposed, respectively. Statistical quality analysis with data-set \textit{CV} provides cross-validation with \textit{k=10}. The metrics are in the second block in Table~\ref{tab:func-eval-metrics}. \textbf{Data-sets.} The analysis was carried out for each issue in the following data-sets. \begin{itemize} \item \textit{QT}: Qt Repository, all issues, and their dependencies. \item \textit{DS1}: Duplicate set \#1, a sub-set of \textit{QT} consisting of all 5,839 issues marked as duplicates without `duplicate' dependency (See Drawback 3 in Section~\ref{section:currentDrawbacks}). As these issues were duplicates, we assumed a duplicating issue in \textit{QT}. \item \textit{DS2}: Duplicate set \#2, a sub-set of \textit{DS1} consisting of all 914 issues resolved as duplicates but without any dependencies. \item \textit{CV}: Cross-validation set, a sub-set of 2,936 pairs of issues without existing dependencies in \textit{QT} structured as follows. One group consisted of 1,437 pairs of issues reported by TQC domain experts as duplicates in TQC's Jira, meaning that one issue of each pair was marked as a duplicate, and each pair had a `duplicate' dependency between them. We labeled this first subset of \textit{CV} as \textit{duplicates}. To generate a balanced data-set, we used another group of 1,499 pairs of randomly selected closed issues with no duplicate resolution reported in TQC's Jira that we labeled as the \textit{not-duplicates} sub-set of \textit{CV}. \end{itemize} \textbf{Evaluation results} The results of the quantitative analysis for the three first data-sets are shown in Table~\ref{tab:dep-det-results}. An analysis of distribution reveals that the duplicate detection typically proposes several dependencies to all issues. In contrast, in the reference detection, most issues have only one proposal, and a few issues have several proposals as a list or table (cf. Section~\ref{sec:ReseachContextTQC}). In the case of issue graph-based contextualization, only 2\% of the proposals were three edges apart or closer (\textit{\#depth-3-distance}) in Qt Repository, and all resulted from duplicate detection (\emph{ORSI}). Table~\ref{tab:dep-det-results-crossvalidation} shows the results of the cross-validation analysis for detector services using the \textit{CV} data-set. We compare both detectors, although reference detection is not designed only for duplicate detection, and therefore the results must be interpreted with this in mind. The low recall is expected for reference detection \textit{(Nikke)}, but high precision is not expected. In order to verify the results, we decided to analyze handpicked sample issues in which reference detection found a dependency by reading through the text and comments of the issues. The analysis verified the results, and we discontinued verification after about 30 checks, which were all correct. The verification also revealed that it is customary to add a comment to an issue about duplication, as most had a comment about duplication, and the rest noted duplication in the description field, which explains the high precision. For duplicate detection (\textit{ORSI}), the optimal similarity threshold value (see Algorithm~\ref{algorithm:cross-det}) was reached through a set of experiments by fine-tuning the similarity threshold with $\pm$0.1 deviations until it reached the global maximum for F-measure. Compared with the data in Table \ref{tab:dep-det-results}, our solution tries to reduce false positive instances as much as possible, given the large number of issues and, as a consequence, the large number of dependency proposals. This idea is reinforced if compared with reference detection results, where perfect precision is achieved. \begin{table}[t] \caption{The results of dependency detection in terms of \textit{\#issues} and \textit{\#proposals} as defined in Table~\ref{tab:func-eval-metrics}} \centering \label{tab:dep-det-results} \begin{tabularx}{\columnwidth} {p{2cm} p{2.45cm} >{\raggedleft\arraybackslash}p{0.7cm} >{\raggedleft\arraybackslash}p{0.5cm} >{\raggedleft\arraybackslash}X} \toprule \textbf{Data-set} & \textbf{Detector} & \textbf{\textit{\#issues}} &\textbf{(\%)}& \textbf{\textit{\#proposals}} \\ \midrule Qt Repository & Reference detection & 24,097 &(20\%) & 31,646 \\ (\textit{Qt} data-set) & Duplicate detection & 45,570 &(38\%) & 578,739 \\ & Union & 60,250 &(50\%) & 610,348 \\ & Intersection & 1,727 & (1\%)& 1,801 \\ \midrule Duplicate set \#1 & Reference detection & 3,275 &(56\%) &3,935 \\ (\textit{DS1} data-set) & Duplicate detection & 2,479 &(45\%) & 33,153 \\ & Union & 4,457 &(76\%) & 37,208 \\ & Intersection & 377 &(6\%) & 388 \\ \midrule Duplicate set \#2 & Reference detection & 182 &(20\%) & 208 \\ (\textit{DS2} data-set) & Duplicate detection & 423 &(46\%) & 5,526 \\ & Union & 526 &(58\%) & 5,742 \\ & Intersection & 15 & (2\%) & 16 \\\bottomrule \end{tabularx} \end{table} \begin{table}[t] \caption{Cross validation results of detectors for the \textit{CV} data-set.} \centering \label{tab:dep-det-results-crossvalidation} \begin{tabularx}{\columnwidth}{p{1.5cm} L L } \toprule \textbf{Measure} & \textbf{Reference detection} & \textbf{Duplicate detection\ } \\ \hline Accuracy &77.15\% & 91.66\%\\ Recall &53.31\% & 86.15\%\\ Precision &100.00\% & 96.42\%\\ F-measure &69.54\% & 91.00\%\\ \bottomrule \end{tabularx} \end{table} \textbf{Summary.} The quantitative analysis shows that the detectors have the potential to expand the issue dependency network by proposing a significant number of dependencies. The number of issues for which reference detection makes proposals is relatively large, but the number of dependencies for one issue is small -- typically one and even on average 1.4 proposals for issues for which a proposal is made. In contrast, duplicate detection finds proposals for many issues and results in many proposals per issue, especially considering that the proposals are about duplicates: 38\% of issues cannot be duplicates but the results include false positives. Likewise, the number of issues in Qt Repository (119,920), compared to the number of proposed dependencies (578,739), indicates false positives. Only a small number of false positives can be explained by closely connected issues, such as between the children of an epic based on issue graph-based contextualization. However, as the underlying principles of detectors are different, the number of proposals is not surprising. The small intersection of proposals for Qt repository shows that the detectors complement each other, while the larger intersection for duplicate sets indicates that detectors can also support each other. The precision and the small number of proposals of reference detection justify its default score of 1.0, while duplicate detection itself provides a score. Contextualization relying on the score-based approach seems appropriate to combine, prioritize, and filter relevant proposals for users. \subsection{Evaluation of consistency check and diagnosis} \label{sec:ConsistencyManagementVerification} \begin{table*}[t] \caption{A summary of consistency check and diagnosis results until depth of 10 ($G^1_i$...$G^{10}_i$).} \label{tab:cc_and_diag_results} \centering \def1.2{1.2} \begin{tabularx}{\textwidth}{p{5cm} L L L L L L L L L L} \toprule &\multicolumn{10}{c}{\textbf{Depth}}\\ \textbf{Measure} & \textbf{1} & \textbf{2} & \textbf{3} & \textbf{4} & \textbf{5} & \textbf{6} & \textbf{7} & \textbf{8} & \textbf{9} & \textbf{10} \\ \hline \#requires-inconsistent average & 0.7 & 3.7 & 5.1 & 8.7 & 14.9 & 24.4 & 36.1 & 45.6 & 55.2 & 67.9 \\ \#parent-child-inconsistent average & 0.8 & 4.1 & 4.4 & 6.4 & 12.1 & 20.7 & 32.4 & 36.8 & 34.6 & 36.9 \\ \#p-depth-consistency (\%) & 93\% & 72\% & 49\% & 30\% & 20\% & 13\% & 7\% & 4\% & 3\% & 2\% \\ \#issue-diagnosis-count average & 1.1 & 1.7 & 3.0 & 4.6 & 7.2 & 7.3 & 8.6 & 9.2 & 9.5 & 10.2 \\ issue-diagnosis-success\textsuperscript{1} (\%) & 100\% & 100\% & 100\% & 99\% & 91\% & 69\% & 54\% & 39\% & 28\% & 21\% \\ \#dependency-diagnosis-count average & 1.5 & 7.8 & 9.4 & 14.9 & 25.6 & 33.7 & 38.8 & 48.0 & 51.2 & 57.5 \\ dependency-diagnosis-success\textsuperscript{1} (\%) & 100\% & 100\% & 100\% & 100\% & 98\% & 80\% & 67\% & 55\% & 41\% & 32\% \\ \bottomrule \hline \end{tabularx} \textsuperscript{1} Success is measured by not exceeding the time limit (5 seconds) since all other diagnoses found a solution. \end{table*} \textbf{Evaluation design.} The goal of the evaluation was to analyze the consistency in TQC's Jira as well as to verify the technical feasibility of consistency check and diagnoses. We analyzed the consistency of all `requires' and `parent-child' dependencies individually, i.e., taking into account only the dependency and the issues on both ends without any other dependencies of the issues and the consistency and diagnosis of all $p$-depth issue graphs ($G^p_0$). The metrics are outlined in the third block of Table~\ref{tab:func-eval-metrics}. Since we noticed that different Jira projects do not have comparable and machine-understandable version numbering, we disregarded all cross-project dependencies from the analysis. As diagnoses are computationally heavy operations, we set the time limit to five seconds for each $p$-depth issue graph and did not carry out the diagnoses to any greater depth. A five-second limit was considered reasonable from the user's perspective. This limitation was also necessary as the tests already took over a week, and a larger limit or removing a limit would have required a significantly longer time or design change with little practical value. \textbf{Data-sets.} The analysis was carried out for the following data-sets. \begin{itemize} \item \textit{QT}: Qt Repository, all issues, and their dependencies \item \textit{Deps}: Dependency set, a sub-set of \textit{Qt} consisting of 3,989 `requires' and 8,222 `parent-child' inter-project dependencies and the issues in both ends of each dependency. \end{itemize} \textbf{Evaluation results} The consistency check for each dependency individually for the \textit{Deps} data-set found inconsistency in 780/3,989 (20\%) of `requires' dependencies (\textit{\#requires-inconsistent}) and 884/8,222 (11\%) of `parent-child' dependencies (\textit{\#parent-child-inconsistent}). The results of consistency check and diagnoses for all 320,159 $p$-depth issue graphs in the \textit{QT} data-set are summarized in Table~\ref{tab:cc_and_diag_results} by depth to a depth of 10 ($G^1_i$...$G^{10}_i$), to draw an overview on the evolution of inconsistencies with issue graph depth. For issue graph sizes, the first unsuccessful and the last successful execution of issue diagnosis were carried out for the issue graphs of sizes 371 and 701 issues, respectively. The respective numbers for the dependency diagnosis were 580 and~1362. \textbf{Summary.} In the case of consistency check, we observe that a significant amount (11-20\%) of all dependencies are inconsistent. However, some inconsistencies result from new issues that have not yet been assigned to a release. Inconsistency becomes prevalent for issue graphs at any greater depth, as shown by the decreasing \emph{\#$p$-depth-consistency}, presented as a percentage in Table~\ref{tab:cc_and_diag_results} (the 3rd row). Moreover, the number of detected inconsistencies increases significantly with greater depths of issue graphs. There are already dozens of inconsistencies at relatively small depths, as shown by the two first rows of Table~\ref{tab:cc_and_diag_results}. Consequently, from the practical perspective, complete consistency remains an elusive target, and the analysis context of the consistency check is practically relevant for a user until depth five. Regarding the diagnosis, the diagnoses start to fail from depth 4, i.e., take more than five seconds, and the success rate falls quite rapidly at any greater depth (\textit{issue-diagnosis-success (\%)} and \textit{dependency-diagnosis-success (\%)} in Table~\ref{tab:cc_and_diag_results}). At small depths, when all diagnoses are successful, we see that the diagnosis of dependencies essentially proposes to remove all inconsistent dependencies (\textit{\#dependency-diagnosis-count = \#requires-inconsistent + \#parent-child-inconsistent}) while the diagnosis of issues requires changes to the priority or release of a significantly smaller number of issues (\textit{\#issue-diagnosis-count}). The relatively small increase in these numbers as depth increases means that only the smallest issue graphs are diagnosed successfully -- there is a significant variance in the issue graph sizes at greater depths, as covered above. A qualitative analysis of diagnosis results revealed that lexical order does not always work properly when dependencies are not clearly prioritized, and issues appear in a few priority classes. Consequently, the evaluation shows that the implemented diagnoses are functionally feasible but, for a user, computationally meaningful until issue graphs containing less than 1000 issues and algorithms should provide alternative diagnoses. \subsection{Performance evaluation} \label{sec:performanceEvaluation} \textbf{Evaluation design.} The goal of performance evaluation was to assess the efficiency of all functionality with respect to required computing time and, in particular, give fast enough responses to users (cf. Section~\ref{sec:artifactobjectives}). We divided the performance evaluation into (\emph{i}) batch tasks covering initial processing and updates, and (\emph{ii}) queries, which are scenarios for a user. In order to individually evaluate batch tasks, we divided the performance evaluation into a data projection from Jira, which also covers processing dependencies, and processing in both detectors. We report the average times of five tests to eliminate random errors. For the evaluation of the queries, we applied the various usage scenarios to microservices as orchestrated end-to-end systems, measuring the time from sending a user's query request to a response. This corresponds with the time for submitting a query to and getting a response from the integration service (\emph{Milla} in Figure~\ref{fig:architecture}). Since we focus on the microservices, we omitted user interface rendering and Jira plugin functionality. We analyzed execution times in the data-sets for dependency query for all issues, and issue graph initialization, consistency check, and diagnosis for all $p$-depth issue graphs. \textbf{Evaluation data-sets.} We applied various data-sets for evaluation, as detailed below. \begin{itemize} \item \textit{Qt Repository}. All issues and their dependencies. \item \textit{Large issue graphs}. A sub-set of \textit{Qt Repository} containing all $p$-depth issue graphs for any $p$ with at least 8,000 issues, which integrate 82,640 different issue graphs. We use this data-set for the worst-case scenario. \item \textit{Sizeable issue graphs}. A sub-set of \textit{Qt Repository} containing all $p$-depth issue graphs for any $p$ with 500-1,000 issues, which integrates 14,783 different issue graphs. We use this data-set to represent a possible large case scenario that a user might be interested in, being similar with the largest 5-depth issue graphs. \item \textit{Update data-set}. The small project (QTWB) as a sub-set of \textit{Qt Repository} consisting of 27 issues and 9 dependencies to simulate an update. This data was first manually removed from \textit{Qt Repository} and our system. \end{itemize} \textbf{Evaluation results.} The results of the performance evaluation are summarized in Table~\ref{tab:PerformanceResults} as average execution times. Data transfer between servers took the majority of the time in the data projection, but even when all software is deployed to the same server, we found that data projection takes several minutes because of the large amount of data and Jira's inefficient REST interface, which requires fetching issues as sets of individual issues. The $p$-depth issue graph queries are fast, and depend on the size of the issue graph because many issue properties are returned, making the return data large. The execution times of dependency queries have a small variance and do not depend on data size: the minimum time was 1.3 seconds and 62 queries took over 2.5 seconds, out of which 25 queries returned fewer than 10 proposals. The time required for the consistency check appears to increase practically linearly with respect to the number of issues. The data has minor variation as 0.15\% of queries take 10-17 seconds. We do not present average times for diagnoses because diagnoses for large graphs were not calculated; diagnosis under a five-second limit has been discussed in the previous subsection. \textbf{Summary.} The evaluation results show that the initial operations take hours, but they are performed as a batch process upon system initialization. Updates are then relatively fast, up to tens of seconds. Queries other than diagnosis are within reasonable limits for a user as they take less than five seconds on average, even for the largest issue graphs. However, the tests with \emph{Sizeable issue graphs} show that operations are fast and even diagnoses are then feasible as discussed above. Although we did not measure the time required for authorization and visualization in the Jira plugin, we have not experienced any significant delays. \begin{table}[t] \caption{Performance analysis results.} \label{tab:PerformanceResults} \centering \begin{tabularx}{\columnwidth}{p{2.3cm} p{4.2cm} L } \textbf{Task \textit{(Data-set)}}& \textbf{Technique} & \textbf{Time} \\ \toprule \multirow{2}{3cm}{Data processing \newline \textit{(Qt Repository)}} &Data projection (\emph{Milla})& 40 m\\ &Reference processing (\emph{Nikke})& 31 m \\ &Similarity processing (\emph{ORSI})&4 h 34 m\\ \midrule \multirow{2}{3cm}{Update processing \textit{(Update data-set)}} &Data update projection (\emph{Milla})& 4.4 s\\ &Reference processing (\emph{Nikke})& 1.4 s\\ &Similarity processing (\emph{ORSI})& 28.6 s \\ \midrule \multirow{2}{3cm}{Queries \newline \textit{(Qt Repository})} &$p$-depth issue graph query & 0.3 s\\ &Dependency query & 1.7 s\\ &Consistency check query & 1.9 s \\ &Diagnosis & --- \\ \hline \multirow{2}{3cm}{Queries \newline \textit{(Large issue graphs)}} &$p$-depth issue graph query &0.7 s\\ &Consistency check query & 4.7 s \\ \hline \multirow{2}{3cm}{Queries \newline \textit{(Sizeable issue graphs)}} &$p$-depth issue graph query & 0.01 s\\ &Consistency check query & 0.2 s \\ \bottomrule \end{tabularx} \end{table} \subsection{Validation interview study} \label{sec:validation} \textbf{Validation study design} The goal of validation was to assess whether the user considered the techniques valuable. That is, in addition to the iterative approach of constant feedback from TQC, we carried out the final validation of the artifact by interviewing five of TQC's Jira users, who were all active Jira users who tested and used our solution but had not yet been involved in the design and implementation process: two release managers, one software architect, one product manager, and one developer. We interviewed each respondent individually, following a semi-structured approach. Three researchers carried out the interviews in Finnish, following predefined roles: one researcher acted as the leading interviewer, and others took notes and asked clarification questions. We carried out one interview first and four interviews on another day. The main interviewer was the same in all interviews, while the other two interviewers changed. Each interview took about 1.5 hours. We instructed each respondent to use the system beforehand, allowing one week for this. During the interviews, the respondents were asked to use a shared meeting room monitor to demonstrate and explain the tasks while interviewers voice-recorded and took notes of the process. The structure of the interviews consisted of an introduction, the concept and visualization of issue dependencies, consistency check and diagnosis, dependency proposals, and data updates. We had prepared and printed a set of slides (available in GitHub\footnote{The interview questions: \href{https://github.com/ESE-UH}{https://github.com/ESE-UH})} explicating the themes and the questions in the themes, but only some example screenshots and diagrams were shown to the respondents on paper when needed to explain something. The slides contained the questions to which the interviewers sought answers rather than questions for respondents, adhering to the principles of a case study protocol~\cite{Yin2018}. We preferred that the respondents use the user interface while the slides were a backup. The order of themes differed as the interviews aimed at informal and open dialogue, but we followed the slides to keep track that all themes were covered. We listened to the recordings later and transcribed the key parts of the answers. For the transcribed answers, we carried out a narrative synthesis~\cite{cruzes2015case}, meaning that we used "words and text to condense and explain the findings of the synthesis". In practice, we collected and organized responses as qualitative descriptions of the interview themes. We applied critical judgment in qualitatively selecting and synthesizing responses, such as how relevant a theme was for the respondent in their daily work, and how familiar a respondent was with the theme. We used the Microsoft OneNote notes-taking tool in the analysis as all data was text, the amount of data was moderate, and OneNote allows a free organization of themes and text in a two-dimensional space. The results are summarized as follows. \textbf{Results.} The users appreciated very different functionalities, although they understood that the other functionalities could be important for other roles or tasks. For example, two users considered finding duplicates the key functionality while the others did not consider duplicate detection relevant to their daily work. The duplicate detection was also considered important for large projects and less so in small projects. The existing dependencies and larger issue graphs are especially important and challenging for the R\&D team lead and product managers who value visualization. A user summarized vividly: "\textit{Using Jira is like looking through a keyhole}". Although our solution relies on data projection from Jira that can be out of sync when issues are updated, the users commented that even day-old information is usable, although a practical update interval should be from a few minutes up to an hour, especially during the busy days before a release. \textit{Issue graphs.} The respondents liked the $p$-depth issue graph and its visualizations as a means of capturing information at a glance. The users considered depths 2--4 most relevant -- a 5-depth issue graph already showed them too much information. One user discussed representing the parent-child hierarchy better while acknowledging that it is difficult to visualize without ending up with a very wide view and being a very implementation-specific challenge. Likewise, another user mentioned a release as another relevant viewpoint. The users also commented on the user interface. A recurring comment concerned adding more information, such as tooltips or additional information, by hovering the mouse cursor. \emph{Dependency detection.} Finding duplicated issues was considered the most practical technique although other types of missing dependencies were also acknowledged. The users felt that detection could take place in different phases and tasks, mentioning creating, triaging, resolving, and managing issues, and making releases. The time around releases is especially critical for finding duplicates, although the earlier the duplicates are found the better, especially if the reported issue turns out to be a blocker. Nobody considered false positive or incorrect proposals to be a problem because a proposal needs to be checked manually anyway, and proposals can always be disregarded -- false negatives or undetected proposals were considered much more inconvenient. In particular, one user noted that duplicate detection could also be used to find similar older issues in order to find out how they were resolved or who resolved them so that users could be asked for help or even to resolve similar open issues. Our solution to store rejected dependency proposals and not show them again to any user was considered possible, although a more delicate approach could be applied. That is, a rejection decision is context- and sometimes user-specific, and it should be possible to revise the decisions. In particular, if an issue is changed, the rejection decision should be re-evaluated. Additional desired functionality was that the detectors should detect if issues have changed and the existing dependency between them has become obsolete. In contrast, predicting the type of dependency was not considered important or even feasible. \emph{Consistency check.} The users considered consistency checking to be relevant, especially in larger projects where the complexity and sizes of issue dependency networks have grown. Such a large project at TQC contains several parallel versions and multiple R\&D teams. In small projects, the users did not consider consistency checks necessary because the users can manage consistency manually. One user reported that, on the one hand, the consistency check would be more valuable if the processes inside TQC were more rigorous and issues contained fewer inconsistencies. On the other hand, he reckoned that the consistency check has the potential to improve the processes if inconsistencies or incorrect information can be made more visible. This could also make it possible to more reliably check cross-project dependencies. A challenge for consistency check was said to be the time-boxed releases where the release is often set to the issues only after the resolving solution is ready -- if at all. Thus, for detected inconsistencies in issues, the corresponding resolving solutions need to be checked and might exist, meaning that a cause of the inconsistency is sometimes in the correspondence between Jira issues and their resolving solution. The limitation of the consistency check to the `parent-child', `requires', and `duplicate' dependencies was extensive enough. All respondents commented that only a general `relates' dependency would also be useful, but nothing additional was needed. Finally, other checks, such as identification of cyclic dependencies, could be interesting but not yet clearly needed in practice. \subsection{Discussion on RQ1: issue trackers main drawbacks} \emph{RQ1. What drawbacks do stakeholders suffer with current issue trackers?} When focusing on the constructs and the quality of the underlying issue dependency network, large, collaborative, long-lived projects bring forward the limitations of the issue trackers with respect to the data model (Drawback1), missing explicit dependencies (Drawback2\&3), and inconsistencies (Drawback4). This results in an incomplete broad view, critical for complex tasks like product management. The number of issues, potential dependencies, and stakeholders involved, all of them in constant change, raise the complexity. However, and as a consequence of this complexity, as our experiences from constructing and evaluating a solution to alleviate the drawbacks have taught us, capturing all dependencies and having complete consistency are elusive targets and even based on subjective and contextual judgment --- issues are not a static specification but a constantly evolving network of \emph{things to be done}. Thus, the drawbacks need to be mitigated rather than resolved. Therefore, it is vital to provide users with useful information and practical support features when using issue trackers, rather than aiming at fully automatic decision making. It is noteworthy that drawbacks are not necessarily TQC- or even Jira-specific but can be generalized to using other issue trackers, especially to those popular issue trackers with similar advanced features or other systems of similar use, appearing especially in the aforementioned large-project contexts. \subsection{Discussion on RQ2: issue management features} \label{sec:rq2-discuss} \emph{RQ2. What features can be added to issue trackers to address these drawbacks?} \\ Our solution proposal of issue graphs forms a parallel, automatically constructed view of the data available in issue trackers, enabling more efficient dependency management and visualization (Objective1). Beyond the lifecycle of a single issue, we proposed to treat dependencies as first-class entities with their properties, which are usable, e.g., in dependency detection. We used issue ($r_0$) centered, bottom-up $p$-depth issue graphs ($G^p_0$) as the principal contextual structure for analysis, visualization, and users. The evaluation in the context of TQC's Jira showed the technical feasibility of issue graphs but also indicated that issue graphs up to depth five appear meaningful for users. However, future work can allow other partial issue graphs and better emphasize existing hierarchies between issues. Interestingly, the issue tracker users did not consider the simple dependency typology of detectors a limitation but instead considered the existing typology too complex, opting for a typology of `duplicate', `parent-child', `requires', and possibly generic `relates' dependencies. Regarding the extension techniques, the detection techniques (Objective2) aim to assist users with simple but effective algorithms that operate with large data-sets. The evaluation showed that algorithms effectively propose dependencies and complement each other. Therefore, a quintessential system-view is needed for the techniques and algorithms by contextualization that combines proposals, considers them in the context of existing issue graphs and issue properties, and manages rejected dependencies. This system view is based on the premise that a combination of many simple tools, such as voting and contextual adaptivity, is comparable to a more advanced single algorithm, especially for domain experts. While this relatively simple but holistic solution appeared valuable, bringing forward many practical consequences, the solution can be further improved by more refined rejection handling and adding other --- more advanced --- detection techniques and algorithms, which can require a different aggregation approach. Another desired improvement is the explainability of detection techniques, pointing out why a proposal was made. While these findings are largely applicable to any issue tracker, the reference detection technique, as an example, relies on users' comments and quite Jira-specific textual IDs for which another complementary replacement technique may have to be constructed or adapted for other contexts. Regarding the consistency check and diagnoses (Objective3), evaluation of the techniques indicated that, rather than achieving complete consistency, these techniques' practical value is to make inconsistencies in an issue graph visible for the context a user is working on. This improves the transparency and control of the development process and can even induce process improvements. To this end, our consistency check and diagnoses techniques did not focus on fully-automated decision making but on providing users with assistance during the consistency check process within a specified ($G^{p=5}_0$) context of analysis rather than a complete analysis of all inconsistencies, which might not be relevant or even practical information. The evaluation in the context of TQC's Jira also showed that the number of inconsistencies increases inconveniently rapidly for a user when the context of analysis grows. We argue that similar phenomena appear in other issue trackers of large projects due to the inherent characteristics of dependent and evolving issue tracker data. Among the main future challenges are more suitable and efficient algorithms for diagnosis and a study of other analyses, such as redundant dependencies, including their practical value. Thecess of applying the techniques beyond TQC relies somewhat on the characteristics of the project and Jira usage: the development and projects at TQC are relatively mature and Jira-centered, and the triage process assures a certain level of quality. As a result, TQC has a large amount of data in Jira, and Jira is actively used, including comments to reveal dependencies. TQC is also a medium-sized organization with hundreds of active Jira users, although there are open source and user communities that are less active. In other contexts, the techniques can be less successful, such as in the early phases of projects when there are fewer explicit requirements, the amount of requirements is small, the development practices are immature or not centered around Jira, or there is only a small group of stakeholders. Even at TQC, the stakeholders perceived the techniques differently, depending on their working context, such as being less valuable in small projects. Although techniques are scalable to large organizations of active users, the practical problems and value of solutions need to be assessed. However, an issue tracker is still mostly the repository of issues, the tool for issue workflow, and the tool for views to issues. That is, the issue trackers do not have much intelligence in their functionalities, and intelligent techniques can have some, although sometimes minor, benefits in any context. \subsection{Discussion on RQ3: Artifact implementation} \emph{RQ3. How can these features be integrated in an issue tracker in a way that it has value for use?} \\ The Jira plugin and microservice-based architecture we depicted in RQ3 address practical implementation of the techniques and use concerns. This plugin technology facilitates compatibility, security, and usability in the context of TQC's Jira. However, TQC's Jira is standard deployment and, apart from the integration microservice (Milla), other microservices are independent of Jira, providing good maintainability, portability, and compatibility. The system should be deployable beyond TQC's Jira to other Jira installations and with minor modifications even to other issue trackers and systems, such as requirements management, backlog, or roadmapping systems. We have already prototyped the same microservices in a research prototype. Likewise, we have prototyped two other, more advanced detectors within the system, which turned out to be too unreliable. On the one hand, a solely plugin-based design could be done for a smaller data-set, but the design would have been very Jira-specific, resulting in an inefficient and more complex design. On the other hand, we had the microservices operational without plugin technology, but the microservices then could not handle the private issues, write decisions to Jira, or integrate the user interface with Jira. Such an independent tool from Jira was considered to have little practical value for TQC. The data projection was another key design decision that allowed us to separate batch processes and user queries. This was needed for the microservice-based solution and beneficial for efficiency, while the disadvantages were within users' acceptance limits. Besides the above improvements to the solution, certain design improvements could be considered. Our primary focus was not on graphical design and usability, which can be improved. Additionally, the system's usability could be improved by integrating it into existing dashboards rather than operating as a separate plugin. \subsection{Comparison to related work} \textbf{Feature extension of traditional issue trackers in open source context.} Several studies have focused on analyzing the main challenges raised by traditional issue trackers in open source environments. Bertram et al.~\cite{Bertram2010} reported a list of seven design consideration features for issue trackers based on a qualitative study of their main drawbacks, including (i) providing customizable features for the visualization of issues data and their relations, and (ii) the simplification of tagging and reporting complex issue properties such as `requires' or `duplicates' relations, opening the door to automated features for the autonomous detection of these properties. Baysal et al.~\cite{Baysal2014} ran a qualitative analysis through 20 personal interviews with Bugzilla community stakeholders. The interviews identified that developers faced difficulties managing large issue repositories due to the constant flow of data (e.g., new issues, comments, reported dependencies) and the lack of support for filtering, visualizing, and managing changes in the issue dependency network. Heck and Zaidman~\cite{Heck2013} studied a set of 20 open source GitHub projects, from which they highlighted the management of duplicated issues and the visualization of the issues and issue dependencies as two of the most critical challenges for software developers. However, these contributions are limited to providing general highlights to key challenges and features for issue management tasks rather than designing and depicting concrete, detailed processes or theoretical models for the practical application of these features. \textbf{Modeling and visualization of the issue dependency network.} Both Baysal et al. and the Heck and Zayman studies mentioned above highlight visualization of the issue dependency network beyond the single-issue perspective. The latter narrowly depicts a modeling and visualization proposal based on the Bug Report Network (BRN) proposed by Sandusky et al.~\cite{Sandusky2004}, where an issue dependency network is represented as a tree of issues linked by their relations (including dependencies and duplicate relationships). The \textit{swarmOS Analyzer}\footnote{https://marketplace.atlassian.com/apps/1217806/} Jira plugin delivers a practical solution for representing the issue dependency network as an issue graph. Despite its filtering and classification features, it lacks advanced visualization tools to enable large projects to simplify and adapt the context of visualization to a specific issue or sub-set of issues. \textbf{Dependency detection and duplicate detection in issue management.} Although the state-of-the-art addresses the requirements for traceability and dependency management, very few focus on the issue tracker domain. Borg et al.~\cite{Borg2014} conducted a systematic mapping of information retrieval techniques for traceability and artifact dependencies in software projects. Among 79 related publications, most were limited to a proof-of-concept solution with a reduced sample validation with partial quality metrics like precision or recall in a validation scenario of no more than 500 artifacts. Despite the supporting tools like Jira plugins for the visualization of issue dependency trees, like SwarmOS Analyzer or Vivid Trace\footnote{https://marketplace.atlassian.com/apps/1212548/}, there are no popular plugins or tools for the autonomous detection of dependencies or cross-references among issues in an issue repository. On the other hand, managing and detecting duplicated issues is a well-known problem considered critical by several studies when managing issues with issue trackers~\cite{Alipour2013,Kshirsagar2015,deshmukh2017}. Ellmann~\cite{Ellmann2018} defines a theoretical background for the potential of state-of-the-art natural language and machine learning techniques to extend issue trackers with automated duplicate detection. However, no artifact nor practical implementation is reported. The \textit{Find Duplicates}\footnote{https://marketplace.atlassian.com/apps/1212706/} Jira plugin uses similar techniques to those reported by Ellmann to extend search features from Jira by reporting potential duplicates at report time or running queries to find related issues. Nevertheless, these tools do not provide details about the scalability of these solutions for large data-sets, as the emphasis is on proof-of-concept evaluation. Instead, they offer centralized server-side extensions for Jira environments with few details from a software architecture point of view, making them less suitable for large data-sets. \textbf{Consistency check and repair of releases.} As reported in Section~\ref{sec:drawbacksManagement-techniques}, literature on release planning for issue management is especially focused on autonomous release plan generation rather than consistency checking and repair of releases~\cite{Svahnberg2010,Ameller2016}. Consequently, it is difficult to find related work focused on analyzing and diagnosing releases in the issue tracker domain. If we focus on tool support examples, in addition to the visualization of issue dependencies, the~\textit{Vivid Trace} Jira plugin uses this feature to provide deep dependency analysis capabilities focused on visual representation, monitoring of chains of events, and the detection of potential blockers or conflicts among the dependencies. \section{Threats to validity} \label{sec:Validity} We analyze the threats to validity according to the four categories proposed by~\cite{shadish2002experimental} in experimental research. \emph{Construct validity} refers to proper conceptualization or theoretical generalizations. This study focused on tool (Jira) improvement rather than process improvements. Our conceptualization is based on a few stakeholders, and, as noted in the validation interviews, their needs differ. One threat is whether we conceptualized the problem correctly, and another is whether we focused on a relevant problem of the case company. However, the respondents were highly experienced, there were several of them, the researcher had a prolonged engagement with the problems as the process lasted a reasonably long time, and the problems the experts raised were also evident in the data. Furthermore, the results cause no harm either as they aim to help and do not disturb existing ways of working. In our solution development, we relied on handpicked examples. In order to alleviate potential threats with the selection of the examples, we established good communication with TQC’s stakeholders. In eliciting the drawbacks in RQ1, we used carefully designed and piloted interviews. This helped us assess which issues would be suitable examples for our research. However, the evaluation iterated through all public data, except for cross-validation, thus not limiting ourselves to the hand-chosen examples. \emph{Internal validity} refers to inferences about whether the presumed treatment and the presumed outcome reflect a causal relationship between them. Our solution aims to address drawbacks acknowledged beforehand by the stakeholders. Thus, the knowledge claim concerns whether the suggested solution, i.e., techniques implemented and integrated into Jira, helps address the drawbacks. The solutions were validated with TQC’s Jira users to check that they were applicable to tackle the drawbacks. However, a limitation is that the Jira users testing our system used real data but did not test it extensively in their daily work. \emph{External validity} concerns whether our knowledge claims could be generalized beyond the TQC environment. We consider TQC a good case for research due to its large, standard Jira and typical software engineering and open source practices. Thus, there is a high probability that the solutions could be applicable in other environments. However, TQC’s Jira is a mature and complex environment, and the drawbacks and our solutions reflect this. Although our solutions may technically work in less complex environments, it is not certain that they would be equally valuable. In terms of the mutability of the artifact, we intentionally constructed the solution to be flexibly adaptable to new algorithms and microservices. Interviews with a few selected users do not fully compare to full-scale use in practice. This is notable as the generalizability of the artifact is, in addition to its applicability to the drawbacks themselves, also dependent on whether the users accept the solution. This is difficult to assess with only a few respondents and might come down to, for example, whether or not the users are satisfied with the artifact and its microservices in the long run, and not just initially.
\section{Introduction} \lettrine{T}{he} backbone of smart healthcare is the \ac{IoMT}, which is an amalgamation of medical devices and applications that connect through the internet to healthcare \ac{IT}~\cite{Dimitrov2016} to overcome the shortcomings of traditional healthcare. The \ac{IoMT} has the potential to give rise to many medical applications, including mobile epileptic seizure prediction, which is the primary focus of this paper. \ac{IoMT} edge devices can be used to perform computations locally, reducing latency and alleviating privacy concerns when sensitive medical data is processed. Moreover, they can be used to realize closed-loop systems, which are highly desirable for patient monitoring and treatments~\cite{azghadi2020hardware}. In Fig.~\ref{fig:block_diagram}, we depict three different application scenarios of our proposed seizure prediction system. To enable such a smart \ac{DL}-based system to operate in real-time at the power-constrained edge, \ac{RRAM}-based in-memory \ac{DL} computing architectures~\cite{rahimi2020complementary} could be used~\cite{azghadi2020hardware}. In this paper, we investigate the feasibility of using \acp{MDLS} to perform real-time epileptic seizure prediction at the edge to enable a mobile solution. Our specific contributions are as follows: \begin{figure}[!t] \centering \includegraphics[width=0.425\textwidth]{scenario} \caption{ Application scenarios of the proposed system, which is able to facilitate a variety of treatment types. } \label{fig:block_diagram} \end{figure} \begin{figure*}[!t] \centering \includegraphics[width=1\textwidth]{block_d} \caption{ A simplified block diagram (a--e) of the proposed system and (f) a depiction of the methodology used to generate synthetic preictal samples. Raw \ac{EEG} signals (a) are measured using several electrodes, which are (b) sampled using \acp{ADC}. \ac{CMOS} circuits~\cite{Tsai2012,Lin2020} are used to filter and generate (c) spectrograms for each window, $t$, using the discrete \ac{STFT}. A (d) \ac{MDLS} is used to perform in-memory computation to predict the state of future samples that are to occur in the \ac{SOP} (preictal or interictal) during the \ac{SPH}. During training, (f) synthetic preictal samples are generated to balance the number of preictal and interictal samples. Extra preictal samples are generated by sliding a 30 second window along the time axis at every step, $S$, over preictal signals~\cite{Truong2018}. } \label{fig:approach} \end{figure*} \begin{enumerate} \item We are the first to investigate an in-memory \ac{DL} approach to epileptic seizure prediction; \item We explore a variety of weight-representation schemes while accounting for some device nonidealities, and compare the performance of our approach to other \ac{DL} approaches; \item We determine the power and area requirements for the optimal configuration, and investigate its feasibility for eventual hardware realization. \end{enumerate} \section{Related Work} To the best of our knowledge, all existing hardware implementations tasked for epileptic seizure detection and prediction have been realized using \ac{FPGA}, \ac{CMOS} and \ac{VLSI} technologies. Most existing hardware implementations detect epileptic seizures using traditional \ac{ML} algorithms such as \ac{LLS}~\cite{6107718}, \acp{SVM}~\cite{8467308}, and \ac{kNN}~\cite{6996043}. We refer the reader to~\cite{Alotaiby2014} for a comprehensive survey of epileptic seizure detection and prediction systems. While \acp{ANN} have previously been used for epileptic seizure detection~\cite{5639541} and prediction~\cite{Daoud2020} on \ac{FPGA}, no previous work has investigated the use of memristors for the detection or prediction of epileptic seizures using \ac{DL}, which could drastically improve the performance on the \ac{IoMT} edge. \section{Preliminaries} \subsection{Seizure Forecasting Systems} There is emerging evidence~\cite{Smith2005} that the temporal dynamics of brain activity of people with epilepsy can be classified into 4 states: interictal (between seizures, or baseline), preictal (prior to seizure), ictal (seizure), and post-ictal (after seizures). Seizure forecasting or predictive systems aim to classify the preictal brain state. \subsection{Memristive DL Systems} Memristive devices can be arranged within crossbar architectures to perform \acp{VMM} in-memory, in $\mathcal{O}(1)$~\cite{Hu2018}, which are used extensively in forward and backward propagations within \acp{CNN} to compute the output of fully connected and unrolled convolutional layers. Scaled weight matrices can either be represented using two crossbars per layer, $g_{\text{pos}}$ and $g_{\text{neg}}$, to represent positive and negative weights, respectively, or using a singular crossbar per layer with current mirrors, so that the effective conductance of each device is offset by a fixed value, $g_m$, that can be determined using (\ref{eq:g_m})~\cite{Lammie2020MemTorchAO} \begin{equation}\label{eq:g_m} g_m = -2 / (\bar{R_{\textnormal{ON}}} + \bar{R_{\textnormal{OFF}}}), \end{equation} \noindent where crossbar column currents can be multiplied by a layer-specific scaling parameter, $K$, to determine layer outputs. When a single device is used to represent each parameter, constant currents to mirror can easily be realized using a diode-connected NMOSFET by adjusting the NMOSFET channel width so that it has a passive conductance $g_m$. Given scalability issues, large crossbars can be split into smaller ones, referred to as either modular crossbar arrays, or crossbar tiles~\cite{Mountain2018} to compute the output of linear and convolutional layers with a large number of weights. \section{Proposed System} A simplified block diagram of the proposed system is provided in Fig.~\ref{fig:approach}. We confine the scope of this paper solely to the memristive DL system component depicted in Fig.~\ref{fig:approach}(d), and only consider instances where learning is performed offline. \subsection{Network Architecture} The network architecture used is summarized in Table \ref{network_architecture}, where $n$ is the number of electrodes that are used to sample \ac{EEG} signals, $t$ is the window size in seconds, and $p$ can be determined using (\ref{eq:p}) \begin{equation}\label{eq:p} p = tf_s/k_s = 2t, \end{equation} \noindent where $k_s$ denotes the number of overlapped samples, which for all cases in this paper is fixed to 128, i.e., half the sampling frequency, $f_s$. Batch normalization and the ReLU activation function is applied to the output of all convolutional layers and the first fully connected layer. The output of the last fully connected layer is fed through a Softmax activation function. In contrast to other architectures used in related works~\cite{Truong2018,Kiral-Kornek2018,8239676}, our architecture uses only linear, 2d-convolutional, max pooling, and batch normalization layers. \begin{table}[!b] \centering \caption{Network architecture employed. For each convolutional and pooling layer, $f$ is the number of filters, $k$ determines the filter size, and $s$ denotes the stride length. For each fully connected layer $N$ denotes the number of output neurons.} \begin{tabu} to 0.5\textwidth {p{0.3\textwidth}X[r]} \toprule \multicolumn{2}{c}{\textbf{Input ($n \times p \times 114$)}} \\ \midrule \textbf{Layer} & \textbf{Output Shape} \\ \midrule Convolutional, $f = 16, k=(5, 5), s=(2, 2)$ & $(16 \times [p-3]/2 \times 55)$ \\ Max Pooling, $k=(2, 2)$ & $(16 \times [p-3]/4 \times 27)$ \\ Convolutional, $f = 32, k=(3, 3), s=(1, 1)$ & $(32 \times [p-11]/4 \times 25)$ \\ Max Pooling, $k=(2, 2)$ & $(32 \times [p-11]/8 \times 12)$ \\ Convolutional, $f = 64, k=(3, 3), s=(1, 1)$ & $(64 \times [p-27]/8 \times 10)$ \\ Max Pooling, $k=(2, 2)$ & $(64 \times [p-27]/16 \times 5)$ \\ Fully Connected, $N = 256$ & $(256)$ \\ Fully Connected, $N = 2$ & $(2)$ \\ \bottomrule \end{tabu}\label{network_architecture} \end{table} \begin{table*}[!t] \centering \captionsetup{justification=centering} \caption{Patient information and performance metrics across all folds for our trained conventional \acp{CNN} and their equivalent \acp{MDLS} adopting a double-column parameter-representation scheme.} \begin{tabu} to \textwidth {XXp{0.15\textwidth}XX[c]X[c]X[c]X[c]} \toprule Patient & Seizures & Interictal Duration (h) & S & Accuracy (\%) & Sensitivity (\%) & AUROC & FPR (/h) \\ \midrule 1 & 7 & 17.0 & 7.122 & 94.36$\pm$0.99 & 79.72$\pm$0.01 & 0.97$\pm$0.01 & 01.4$\pm$0.2 \\ 2 & 3 & 22.9 & 1.684 & 94.36$\pm$1.40 & 94.31$\pm$0.01 & 0.97$\pm$0.01 & 01.6$\pm$0.4 \\ 5 & 5 & 13.0 & 5.060 & 74.16$\pm$1.82 & 80.42$\pm$0.01 & 0.85$\pm$0.01 & 08.0$\pm$0.5 \\ 19 & 3 & 24.9 & 1.687 & 96.33$\pm$0.66 & 54.72$\pm$0.00 & 0.50$\pm$0.00 & 20.6$\pm$0.0 \\ 23 & 5 & 3.0 & 7.244 & 94.43$\pm$3.08 & 79.51$\pm$0.02 & 0.96$\pm$0.02 & 07.8$\pm$4.4 \\ \bottomrule \end{tabu}\label{table:performance} \end{table*} \begin{figure*}[!t] \centering \includegraphics[width=1\textwidth]{results} \caption{The average sensitivity and \ac{FPR} across all 5 folds for simulated double column \ac{MDLS} configurations.} \label{fig:results} \end{figure*} \subsection{Training and Validation Datasets} For training and validation of our \ac{MDLS}, we used the \ac{CHB}-\ac{MIT}~\cite{shoeb2010application} dataset, which consists of \ac{EEG} recordings from 22 pediatric subjects with intractable seizures. For our preliminary study reported in this paper, 5 random patients were chosen. We leave evaluation using all subjects from the \ac{CHB}-\ac{MIT} and other datasets, such as the \ac{ASSPC}, to more exhaustive future works. \subsection{Preprocessing Steps} Within the \ac{CHB}-\ac{MIT} dataset, there are instances where multiple seizures occur in close proximity to each other. For seizure prediction, we are interested in predicting leading seizures. Consequently, seizures that occur $\leq T$ minutes after a previous seizure are not considered, where $T$ denotes the \ac{SOP}. All time-series \ac{EEG} signals are translated into time-frequency signals using \acp{STFT} with a window length of $t$ seconds (Fig.~\ref{fig:approach}(e-f)). Similarly to~\cite{Truong2018}, power line noise was removed by excluding components in the frequency ranges of 57–63 Hz and 117–123 Hz. The DC component (at 0 Hz) and components of frequencies above 114 Hz were also removed. \subsection{Training and Validation Methodologies} On account of the large class imbalance between preictal and interictal samples, we use an overlapped sampling technique, which was originally proposed in~\cite{Truong2018}, to train the adopted network architecture. This is depicted in Fig.~\ref{fig:approach}(f). Extra preictal samples are generated by sliding a $t$ second window along the time axis at every step, $S$, over preictal samples, which is chosen so that there are a similar number of samples per class (preictal or interictal). The \ac{NLL} function was used in conjunction with the DiffGrad optimization algorithm, which has been shown to outperform other optimizers~\cite{8939562}, to train the networks with an initial learning rate of $1e^{-4}$ and batch size of $256$ for 50 epochs, when performance stagnated. For a correct prediction, a seizure onset must be after the \ac{SPH} and within the \ac{SOP}, as depicted in Fig.~\ref{fig:approach}. The metrics used to test the proposed approach are the accuracy, sensitivity, \ac{AUROC}, and the \ac{FPR}, as shown in Table \ref{table:performance}. For each subject, performance is reported using $k=5$ stratified K-fold cross validation, where synthetic samples are discarded during evaluation. All implementations adopted the following parameters: $T=30$ minutes, $t=30$ seconds, and a \ac{SPH} of 35 minutes. \section{Performance Evaluation} The MemTorch~\cite{Lammie2020MemTorchAO} simulation framework was used to simulate \ac{RRAM} devices during inference using the VTEAM~\cite{7110565} model. Performance metrics for our trained conventional and equivalent \ac{MDLS} are reported in Table \ref{table:performance}. When predicting \ac{EEG} seizures, it is common to have isolated false positives during interictal periods~\cite{Truong2018}. In recent works, discrete-time Kalman filters and least-$k$-prediction post-processing techniques have been adopted, however, they introduce a significant hardware overhead. In Fig.~\ref{fig:results}, we report the sensitivity and \ac{FPR} for all simulated configurations adopting a double column weight-representation scheme, as the performance of all configurations adopting a single column weight-representation scheme is insignificant. Consequently, we determine the optimal configuration to be a network adopting a double column weight-representation scheme. We attribute the high \ac{FPR} for all trained networks and simulated configurations to the omission of any data post-processing, which is out of the scope of this paper. For all devices, $\bar{R_{\text{ON}}} = 100\Omega$ and $\bar{R}_{\text{OFF}} = 2,500\Omega$~\cite{Yalon2012}. Two non-ideal device characteristics were modelled: device-to-device variability, and a finite number of discrete conductance states. Device-device variability was introduced stochastically by sampling $R_{\text{ON}}$ and $R_{\text{OFF}}$ for each device from a normal distribution with $\bar{R_{\text{ON}}} = 100\Omega$ and $\sigma$, and $\bar{R_{\text{OFF}}} = 2,500$ and $2\sigma$, as $\bar{R_{\text{OFF}}} \gg \bar{R_{\text{ON}}}$~\cite{Lammie2020MemTorchAO}, for $\sigma$ = 0--500. As it has been demonstrated that the spacing between states is not critical~\cite{Mehonic2019}, we simulated devices with between 2–-10 uniformly distributed conductance states. From Fig.~\ref{fig:results}, it can be observed that for patients 1, 2, 5, and 23, the sensitivity and \ac{FPR} decreased when the number of conductance states decreased and device-device variability increased. Interestingly, while the number of finite conductance states did not have a large influence on the reported sensitivity and \ac{FPR} for these patients, device-device variability did. The sensitivity has a relatively sudden transition period at $\sigma > 300$, when the distributions of $R_\text{\text{ON}}$ and $R_\text{\text{OFF}}$ overlapped, causing the sensitivity to abruptly decrease. Conversely, the \ac{FPR} was much more sensitive to device-device variability. It is noted that, for patient 19, we report an average accuracy of 96.33\% and sensitivity of 54.72\%. While this result cannot be clearly explained, it is not uncommon in literature, and other \ac{DL} works~\cite{Truong2018,8239676} using the same dataset also report a high accuracy and low sensitivity, near $50\%$ for the same patient. \begin{table}[!b] \centering \caption{Power, area, and latency requirements of the optimal configuration using 128$\times$128 crossbar tiles for TDM and parallelized implementations (Imp.).} \begin{tabu} to 0.4\textwidth {XXXXX} \toprule \textbf{Imp.} & \multicolumn{1}{r}{\textbf{Power (W)}} & \multicolumn{1}{r}{\textbf{Area (mm$^2$)}} & \multicolumn{1}{r}{\textbf{Latency (ms)}} & \multicolumn{1}{r}{\textbf{Energy (mJ)}} \\ \midrule TDM & 0.0133 & 0.1269 & 1.408 & 0.0187\\ Parallelized & 1.7 & 8.5089 & 0.011 & 0.0187\\ \bottomrule \end{tabu}\label{table:power_area} \end{table} \subsection{Comparison to Other \ac{DL} Models} Since previous related works~\cite{Truong2018,8239676} do not use a consistent testing methodology, we can only roughly compare our results to them using the sensitivity and \ac{FPR} metrics from patients 1, 2, 5, 19, and 23 from Table \ref{table:performance}. Ref.~\cite{Truong2018} and~\cite{8239676} report total sensitivities of $81.2\%$ and $87.8\%$, and \acp{FPR} of 0.16/hr and 0.14/hr, respectively. In~\cite{8239676} clinical considerations were discarded and a zero \ac{SPH} was used. Consequently, the reported performance is likely inflated. Nevertheless, as we did not perform any data post-processing, compared to both works, all of our networks have significantly larger \acp{FPR}. In Table \ref{table:performance}, we report an average sensitivity of $77.74\%$, which is lower than that reported in~\cite{Truong2018} and~\cite{8239676}. Our result is still significant, because we use 2d-convolutional layers, max pooling, and fully-connected layers, and perform minimal data processing, while~\cite{Truong2018} used 3d-convolutional layers and~\cite{8239676} performed hyper-parameter optimization to obtain the lowest average validation loss over a 10 fold cross-validation. \subsection{Power, Area, and Delay Analysis} To determine the power and area requirements as well as the latency, which dictates the inference time of the optimal configuration, we map each layer of our deep network to modular 128$\times$128 crossbar tiles with no shared weights between layers using parameters for 65nm technology from~\cite{Wang2019}. The area and power of each \ac{ADC} (8-bit) is, therefore, calculated to be 3$\times$10$^{-3}$mm$^2$ and 2$\times$10$^{-4}$W, and the area of each RRAM cell is estimated to be 1.69$\times$10$^{-7}$mm$^2$. During inference, we assume constant operation at $V=0.3$V per active cell, the largest voltage used to encode inputs, and an average cell resistance of $(\bar{R}_{\text{OFF}} + \bar{R}_{\text{ON}}) / 2$. All \acp{ADC} are assumed to operate at 5 MHz, and the number of tiles used for each network is assumed to be the exact number required to balance the latency among layers. \ac{RRAM} read latency is considered negligible compared to \ac{ADC} readout. Table~\ref{table:power_area} shows the power, area, latency, and energy of our optimal configuration for configurations where samples are continuously fed to the network from a \ac{FIFO} buffer. We compare requirements for implementations for which each tile contains one \ac{ADC}, and \ac{TDM} is used to read out column currents (denoted \textit{\ac{TDM}}), and for which each tile contains one \ac{ADC} per column to read out column currents in parallel (denoted \textit{Parallelized}). Given the large window length used, further duplication of crossbar tiles to improve throughput was deemed unnecessary. \section{Conclusion} We investigated the potential of memristors to contribute to the design of a \ac{DL}-based seizure prediction device. Our findings demonstrate that \ac{MDLS} holds great promise for developing a compact epileptic seizure prediction architecture capable of low-power and real-time mobile operation. Our optimal configuration exhibits comparable performance to existing \ac{DL} works in the literature while consuming significantly less power than current \acp{mGPU} and edge processors~\cite{azghadi2020hardware}. In future, the longevity and reliability of such a system should be properly investigated. \bibliographystyle{IEEEtran}
\section{Introduction} While modern Deep Learning classifiers can achieve exceptional accuracy in many domains, deploying such models in an open-world setting is not trivial. This requires algorithms to detect anomalous test samples that do not belong to the data distribution on which the model was trained on. In fact, it has been previously observed that neural network classifiers can provide predictions with high confidence on adversarial examples~\cite{goodfellow2015}, on distributions far from the training distribution \cite{hendrycks2017} and even on Gaussian noise \cite{hendrycks2017}. In contrast, for safety-critical applications, one would like their machine learning systems to flag potentially anomalous test samples so that erroneous predictions are prevented and human intervention can take place for further assessment. For the out-of-distribution (OOD) detection task, we aim to build a binary classifier that, given a test sample $x$, decides whether $x$ belongs to the training distribution or not. Formally, consider a training dataset $\mathcal{D}^{\text{train}}_{\text{in}}$ drawn i.i.d. from a data distribution $P$, called the in-distribution. Let $Q$ be an unknown distribution, called the out-distribution, from which anomalous examples are drawn. The out-of-distribution detection task then involves computing an anomaly score $s(x) \in \mathbb{R}$, where $x \in \mathbb{R}^D$ is a test sample. The convention we use throughout the text is that the higher the anomaly score, the more likely it is that $x$ is sampled from $Q$. Note that the OOD detection differs from the related problem of anomaly detection because the latter assumes that the outliers are present in the training set. On the contrary, the dataset is assumed to be not contaminated in the former case. % Several approaches to anomaly detection exist, such as in the domain of clustering and robust statistics (for a comprehensive review, see \cite{rousseeuw2011}, \cite{hodge2004}). In anomaly detection, the models are built to detect and penalize the outliers present in the training data. For instance, this was studied in the context of robust Restricted Kernel Machines (RKMs) \cite{robustrkm}. However, in such models an important hyperparameter to consider before training is the contamination rate, i.e., the percentage of anomalies in the training data. In this paper, we investigate OOD detection with an energy function based on the Stiefel-Restricted Kernel Machine (St-RKM) framework \cite{strkm}. In this energy-based framework, the model parameters are learned in an unsupervised manner via manifold optimization where the interconnection matrix lies on the Stiefel manifold. We propose multiple energy function definitions based on the St-RKM objective, provide insights into their mathematical meaning, and discuss their practical implications for the OOD detection performance. We show the effectiveness of the proposed method in computer vision tasks and for time series data. While the state of the art in energy-based OOD detection, proposed by Liu et al. \cite{liu2020a}, relies on a neural classifier trained in a supervised manner on $\mathcal{D}^{\text{train}}_{\text{in}}$, the training phase of our method is unsupervised. Further, in \cite{liu2020a} a fine-tuning step employing an auxiliary dataset sampled from $Q$ is needed to achieve significantly improved OOD detection performance. On the contrary, the training phase of our method is agnostic to the OOD detection task, and therefore only needs in-distribution samples. This is particularly significant when anomalous examples are available in limited quantity or are expensive to collect. In other words, the proposed model is insensitive to the imbalance of normal/abnormal samples in the dataset. \begin{figure*}[t] \centering \resizebox{0.8\textwidth}{!}{% \begin{tikzpicture} \node[block, label=below:2. Energy Scores Computation] (1) {$E_{\text{energy}}(x) = \| (\mathbb{I} - \bm{U}\bm{U}^\top) \bm{\phi}_{\bm{\theta}}(\bm{x})\|_2^2 + \lambda L_{\bm{\xi},U}(\bm{x},\bm{\phi}_{\bm{\theta}}(\bm{x})) $}; \node [draw, cylinder, shape border rotate=90, aspect=0.45, % minimum height=40, minimum width=40, left=of 1, xshift=-5cm, yshift=-1.5cm] (cyc) {$D_{in}^{train}$}; \node[right=of cyc] (x) {$\mathcal{X}$}; \node (b1) [opacity=1, box, text width=0.35cm, text height=2cm, right=of x, label=below:$\mathcal{F}$] {}; \node (b2) [opacity=1, box, text width=0.35cm, text height=2cm, right=of b1, label=below:$\mathcal{H}$] {}; \node (v1)[neuron, right=of x, yshift=0.8cm, xshift=2pt] {}; \node (v2)[neuron, below of = v1, yshift=6pt] {}; \node (v3)[neuron, below of = v2, yshift=6pt] {}; \node (v4)[neuron, right=of b1, yshift=0.8cm, xshift=2pt] {}; \node (v5)[neuron, below of = v4, yshift=6pt] {}; \node (v6)[neuron, below of = v5, yshift=6pt] {}; \draw[ >=stealth,->] (cyc) -- (x) node [midway,above] {}; \draw[ >=stealth,->] (x) -- (b1.120) node [midway,above] {$\phi^{\top}$}; \draw[ >=stealth,<-] (x) -- (b1.240) node [midway,below] {$\psi^{\top}$}; \draw[ >=stealth,->] (b1.60) -- (b2.120) node [midway,above] {$U^{\top}$}; \draw[ >=stealth,<-] (b1.300) -- (b2.240) node [midway,below] {$U$}; \draw[block] ($(cyc.south west) - (12pt,40pt)$) rectangle ($(b2.north east) + (8pt,22pt)$) node [midway, below, yshift=-1.8cm] {1. St-RKM Model Training} ; \draw[ >=stealth,->, thick, xshift=1.2cm] (-6,0) -- (-5.3,0); % \node[below left=of 1, yshift=-0.5cm, xshift=2cm] (xs) {$x_{i}$}; \node[below=of xs, yshift=1.1cm, xshift=0.5cm] (xsi) {$i\in\{0, \cdots , 3\}$}; \draw[ >=stealth,->] (-2.8,-2.1) -- (-2.0,-2.1); \draw[ >=stealth,->] (1.0,-2.1) -- (1.4,-2.1); \node[xshift=4cm] (n1) {}; \node[xshift=4cm, yshift=-2.1cm] (n2) {}; \draw[>=stealth,->, thick]([xshift=-0.05cm,yshift=0cm]n1.east) to[out=0, in=0, looseness=1.1] ([xshift=-0.2cm,yshift=0cm]n2.east); \begin{axis}[ at={($(xs)+(2.1cm,0cm)$)}, anchor=west, scale=0.3] \addplot [dashed,color=blue] plot coordinates { (0,0.5) (0.5,0.5) (3,0.5) }; \node[] at (axis cs: 2.5,.3) {$\gamma$}; \node[] at (axis cs: 0.8, 1.3) {$E(x)$}; \addplot[smooth,color=black, mark=*] plot coordinates { (0,0) (1,1) (2,0.3) (2.5,1.5) }; \end{axis} \node[block, thin, right=of xs, xshift=3.5cm,text width=1.8cm, align=center] (ood) {Flag $x_1$, $x_3$ as OOD points}; \draw[block] ($(xs.south west) - (12pt,30pt)$) rectangle ($(ood.north east) + (6pt,12pt)$) node [midway, below, yshift=-1.1cm] (3) {3. Input-level validation in Deployment}; \end{tikzpicture} }% \caption{Schematic figure illustrating the pipeline of training and detection of Out-of-Distribution (OOD) points. First, the model is trained on the in-distribution dataset with the full energy (objective) function, where $\mathcal{F}$ is the feature space and $\mathcal{H}$ is the latent subspace. Then, the threshold $\gamma$ is selected such that, with the chosen energy metric, the scores of 95\% of training points are below the threshold value. Lastly, in the evaluation phase, a test sample $x_i$ is passed through the model and its energy score is calculated with the desired metric. If the score is below/above the threshold, the test point is flagged as in/out-of-distribution sample.} \label{fig:schematic} \end{figure*} \textbf{Contributions.} The main contributions are as follows: \begin{itemize} \item We propose an energy-based OOD detection method leveraging the St-RKM framework where the training procedure is agnostic to the OOD task. Contrary to the previous approaches using a pre-trained neural network, here the training is unsupervised. \item We propose multiple energy function definitions for OOD detection based on the St-RKM objective, discussing their properties and scenarios in which they may perform best in practice. \item We empirically evaluate our method on multiple performance metrics, including the false-positive rate at 95\% true positive rate (FPR95), area under the receiver operating characteristic curve (ROC), and area under the precision-recall curve (PR), showing that it improves over generative models and state-of-the-art energy-based OOD detection methods using a pre-trained neural network classifier. We also provide further discussion on the multiple energy function definitions by analyzing their resulting energy distributions. \end{itemize} \section{Related Work} Though many classical statistical models such as kernel density estimators, mixture models, and Principal Component Analysis (PCA) \cite{pca} have been studied extensively in the past for OOD detection (for a review, see \cite{pimentel2014}), this section reviews closely related approaches based on neural networks. \subsection{OOD detection using pre-trained neural networks} In the context of neural network classifiers, Hendrycks et al. \cite{hendrycks2017} show that the prediction probability of out-of-distribution samples is usually lower than the prediction probability of in-distribution samples. Building upon this observation, \cite{hendrycks2017} proposes an algorithm based on the maximum predicted probability from the softmax distribution given by the output layer of a neural network. Formally, consider a pre-trained neural network classifier $f(x): \mathbb{R}^D \to \mathbb{R}^K$ that maps an input $x$ to $K$ real-valued outputs, also known as logits. The score function proposed by \cite{hendrycks2017} is: \begin{equation} \label{eq:hendrycks2017} s(x) = - \max_j \frac{e^{{f_j(x)}}}{\sum_{i=1}^K e^{f_i(x)}}, \end{equation} where $f_j(x)$ is the $j^{\text{th}}$ component of $f$. By further developing this approach, Liang et al. \cite{liang2018} introduce small perturbations to the test input $x$ and \eqref{eq:hendrycks2017} is augmented by temperature scaling, The score proposed by \cite{liang2018} is then: % \begin{equation} \label{eq:liang2018} s(x) = - \max_j \frac{e^{f_j(\tilde{x})/T}}{\sum_{i=1}^K e^{f_i(\tilde{x})/T}}, \end{equation} where $\tilde{x}$ is the preprocessed input according to Eq. (2) in \cite{liang2018} and $T \in \mathbb{R}_{>0}$ is a temperature scaling parameter. These two additions are shown to increase the gap in scores between OOD and in-distribution samples. Later, Lee et al. \cite{lee2018} propose a Mahalanobis distance-based anomaly score. First, they define $K$ class-conditional Gaussian distributions as $P(f(x)|y=k) = \mathcal{N}(f(x)|\mu_k,\Sigma)$ for all $k=1,2,\dots,K$, whose parameters are estimated from $\mathcal{D}^{\text{train}}_{\text{in}}$. The score function is then defined using the Mahalanobis distance between the closest class-conditional Gaussian distribution and the test sample $x$ and is given by \begin{equation} \label{eq:lee2018} s(x) = \min_k (f(\tilde{x})-\mu_k)^T \Sigma^{-1} (f(\tilde{x})-\mu_k), \end{equation} where $\tilde{x}$ is the preprocessed input according to Eq. (4) in \cite{lee2018}. Contrary to the methods reviewed in this subsection, our proposed method is not based on a pre-trained neural network classifier. In fact, our method is based on an encoder-decoder architecture and is completely unsupervised; furthermore, its training phase is not specific to the OOD detection task. \begin{figure*} \centering \def0.8\linewidth{0.8\linewidth} \input{drawing_ood_cifar.pdf_tex} \caption{Illustration of the effect of the St-RKM objective function when $\mathcal{D}^{\text{train}}_{\text{in}}$ = Fashion-MNIST and $\mathcal{D}^{\text{test}}_{\text{out}}$ = \{CIFAR-10, MNIST\}. For datasets whose distribution is closer to Fashion-MNIST, the AutoEncoder error is smaller (norm of the dashed line). Hence, the KPCA reconstruction error (norm of the solid line in latent space) becomes a more relevant metric for detecting OOD samples. For datasets whose distribution is dissimilar such as CIFAR-10, both the errors are significant and, hence, the $E_{\text{FullEnergy}}$ becomes more relevant to flag OOD samples.} \label{fig:ood_cifar} \end{figure*} \subsection{OOD detection with fine-tuning} Differently from the methods above, approaches requiring additional training on top of the pre-trained neural network $f$ have been proposed. In these methods, the neural network's weights are updated such that the discriminative power of its outputs is boosted with respect to out-of-distribution detection. In the follow-up paper, Hendrycks et al. \cite{hendrycks2019} propose a method called ``Outlier Exposure" (OE), which fine-tunes the pre-trained classifier $f$ using an auxiliary dataset $\mathcal{D}^{\text{OE}}_{\text{out}}$ drawn from $Q$. In this way, the score function remains \eqref{eq:hendrycks2017}, but the neural network's weights are first optimized by minimizing \begin{equation} \label{eq:hendrycks2019} \mathbb{E}_{(x,y)\sim\mathcal{D}^{\text{train}}_{\text{in}}} \left[ \mathcal{L}(f(x),y) + \lambda \mathbb{E}_{x'\sim\mathcal{D}^{\text{OE}}_{\text{out}}} \left[ \mathcal{L}_{\text{OE}}(f(x'), f(x), y) \right] \right], \end{equation} where $x'$ is a sample from the auxiliary OOD dataset, while $x$ is a sample from $\mathcal{D}^{\text{train}}_{\text{in}}$. $\mathcal{L}_{OE}$ is a design choice depending on the kind of task. For instance, \cite{hendrycks2019} proposes to use the cross-entropy loss when $\mathcal{L}$ is based on the maximum predicted probability from the softmax distribution. The training phase of the proposed method is agnostic to the OOD detection task and does not require an ad-hoc fine-tuning step. \subsection{OOD detection using deep generative models} Deep generative models approximate the true training data distribution $P$ with a density $p(x;\theta)$, where $\theta$ denotes the parameters of the employed deep neural networks. In this framework, test points that lie in the low-density regions can be labeled as out-of-distribution. To compare deep generative models with classical methods, {\v S}kv{\'a}ra et al. \cite{skvara2018} conducted experiments in OOD detection with the variational autoencoder (VAE) \cite{vae} and the generative adversarial network (GAN) \cite{gan} in several domains, concluding that deep generative models can outperform conventional methods if their hyperparameters are well tuned. For VAEs, they use the reconstruction error as the score function. For GANs, they propose the following score: \begin{equation} \label{eq:gan} s(x) = - (1-\lambda) \log (d_\theta(x)) + \lambda \|x-g_\phi(z)\|_2, \end{equation} where $d_\theta$ is the discriminator, $g_\phi$ is the generator, $\lambda$ is a scaling parameter and $z \sim p(z)$, where $p(z)$ is the normal distribution. In the experimental evaluation of \cite{skvara2018}, $\lambda = 0$ led to the best AUROC performance; hence we use this choice in Section \ref{exp}. More recently, Nalisnick et al. \cite{nalisnick2019} show that the likelihood from deep generative models such as VAEs cannot effectively separate in and out-of-distribution samples, as the latter can be assigned higher likelihood than the former. However, this result is based on the likelihood computed from deep generative models, and it is possible that the performance of these models can be improved using different score functions. Our method, based on the St-RKM \cite{strkm}, is also a generative model; however, instead of the likelihood, we take the energy function derived from RKMs as the score. \subsection{OOD detection using energy-based models} Energy-based models \cite{lecun2006} employ an energy function $E(\cdot): \mathbb{R}^D \to \mathbb{R}$ that associates a scalar value to an input $x$ such that more likely inputs are associated with lower energies. The energy can therefore be used as a score function: inputs with lower energy scores are labeled as in-distribution and inputs with higher energy scores are labeled as out-of-distribution. In this context, Grathwohl et al. \cite{grathwohl2020} observe that, given a neural network classifier $f$ with parameters $\theta$, the density $p(x;\theta)$ can be written using the logits of $f$ by marginalizing over the $K$ classes: \begin{equation} p(x;\theta) = \sum_{i=1}^K \frac{e^{f_i(x)}}{Z(\theta)}, \end{equation} where $Z(\theta)$ is an unknown partition function. The energy score of a test point $x$ can be then defined as: \begin{equation} \label{eq:grathwohl2020} E(x) = - \log{\sum_{i=1}^K e^{f_i(x)}}. \end{equation} Building upon this approach, the recently proposed method by Liu et al. \cite{liu2020a} augments \eqref{eq:grathwohl2020} by temperature scaling: \begin{equation} \label{eq:liu2020a} E(x) = - T \log{\sum_{i=1}^K e^{f_i(x)/T}}, \end{equation} where $T \in \mathbb{R}_{>0}$ is a temperature scaling parameter. \cite{liu2020a} also proposes to fine-tune pre-trained neural network classifiers to enlarge the energy gap between in and out-of-distribution samples. The neural network's weights are updated by minimizing \begin{equation} \mathbb{E}_{x\sim \mathcal{D}_{\text{in}}^{\text{train}}} \left[- \log \max_j \frac{ e^{{f_j(x)}}}{\sum_{i=1}^K e^{f_i(x)}}, \right] + \lambda \mathcal{L}_\text{energy}, \end{equation} where $ \mathcal{L}_\text{energy} = \mathbb{E}_{x\sim \mathcal{D}_{\text{in}}^{\text{train}}} \left[ \ell_{m_{\text{in}}}(E(x))^2 \right] + \mathbb{E}_{x\sim \mathcal{D}_{\text{out}}^{\text{train}}} \left[ \ell_{m_{\text{out}}}(-E(x))^2 \right]$, $\mathcal{D}_{\text{out}}^{\text{train}}$ is an auxiliary dataset drawn from $Q$, and $\ell_m(x) = \max (x-m, 0)$ is the hinge loss with hyperparameter $m$. Note that, while the fine-tuning improves OOD performance, it worsens the classification accuracy. On common benchmarks, this work is currently considered the state of the art in energy-based OOD detection. Similar to \cite{grathwohl2020} and \cite{liu2020a}, our proposed approach is energy-based. However, we employ a different definition of $E(x)$ that is not based on the output layer of a neural network. Instead, it is the St-RKM's \cite{strkm} objective function that stems from the RKM energy \cite{drkm} and includes a reconstruction loss term. This is described further in the following section. \section{Proposed Model} \label{met} In this section, we discuss the proposed energy-based method for out-of-distribution detection building upon the latent variable model St-RKM \cite{strkm}. Consider the objective function of the St-RKM: \begin{equation} \label{eq:strkm} J(x) = \Vert \phi_{\theta}(x) - \bm{U}\bm{h}\Vert_{2}^{2} + \lambda \loss{\xi}{}{}{\theta},% \end{equation} with feature map $\phi_\theta(x) \in \mathbb{R}^l$, latent variable $h \in \mathbb{R}^m$ with $m \leq l$, real-valued parameter vectors $\bm{\theta}$ and $\bm{\xi}$, regularization parameter $\lambda>0$ and the interconnection matrix $U = [\bm{u}_1, \dots , \bm{u}_m]$ belonging to the Stiefel manifold $\St(\ell,m)$, that is, the set of $\ell\times m$ matrices with orthonormal columns ($\ell\geq m$). The feature map is assumed to be centered, i.e., $\mathbb{E}_{\bm{x}\sim p(\bm{x})} [\bm{\phi}_{\bm{\theta}}(\bm{x})] = \bm{0}$. Note that the St-RKM objective consists of the RKM energy \cite{drkm} with additional regularization terms and a reconstruction loss term $L_{\bm{\xi},U}$ (e.g., the AutoEncoder (AE) loss). First, we train the St-RKM on the given training set $\mathcal{D}^{\text{train}}_{\text{in}}$ in an unsupervised manner. Following \cite{strkm}, this is done by optimizing the sum of the objective \eqref{eq:strkm} over $\mathcal{D}^{\text{train}}_{\text{in}}$: \begin{equation} \label{eq:optproblem} \min_{\substack{ U\in \St(\ell,m)\\\bm{\theta}, \bm{\xi}}}\min_{\bm{h}_i\in \mathbb{R}^m} \sum_{i=1}^N J(x_i), \end{equation} where $N = \vert \mathcal{D}^{\text{train}}_{\text{in}} \vert$. By minimizing first over $\bm{h}_i$ in \eqref{eq:optproblem}, we find the score vector $\bm{h}_i^\star = U^\top \bm{\phi}_{\bm{\theta}}(\bm{x}_i)$ with respect to the columns of $U$, the orthonormal set $\{\bm{u}_1, \dots, \bm{u}_m\}$. After substitution, the optimization problem becomes \begin{align} \min_{\substack{ U\in \St(\ell,m)\\\bm{\theta}, \bm{\xi}}}\frac{1}{N}\sum_{i=1}^{N} \underbrace{ \| (\mathbb{I} - \bm{U}\bm{U}^\top) \phi_{\theta}(x) \|_2^2 }_{ \text{KPCA reconstruction}} + \lambda \underbrace{ L_{\bm{\xi},U}(\bm{x}_i,\bm{\phi}_{\bm{\theta}}(\bm{x}_i)) }_{\text{AutoEncoder loss}},\label{eq:ReducedObjective} \end{align} where we use mean-squared error as the autoencoder loss function $L_{\bm{\xi},U}(\bm{x},\bm{\phi}_{\bm{\theta}}(\bm{x})) = \left\|\bm{x} - \bm{\psi}_{\bm{\xi}}\big(\mathbb{P}_U\bm{\phi}_{\bm{\theta}}(\bm{x}) \big)\right\|_2^2$. Here the feature-map $\bm{\phi}_{\bm{\theta}}(\cdot)$ is the encoder map from the input space to the latent space and $\bm{\psi}_{\bm{\xi}}(\cdot)$ represents a decoder map. As discussed in \cite{strkm}, a PCA interpretation can be given to the first term of \eqref{eq:ReducedObjective}. By introducing the covariance matrix $ C_{\bm{\theta}} = \frac{1}{n}\sum_{i=1}^n \bm{\phi}_{\bm{\theta}}(\bm{x}_i)\bm{\phi}_{\bm{\theta}}^\top(\bm{x}_i)$, the first term in~\eqref{eq:ReducedObjective} can be written as $\Tr\left( C_{\bm{\theta}} - \mathbb{P}_U C_{\bm{\theta}} \mathbb{P}_U\right) $, which corresponds to the reconstruction error of Kernel PCA for the kernel $k_{\bm{\theta}}(\bm{x},\bm{y}) = \bm{\phi}^\top_{\bm{\theta}}(\bm{x}) \bm{\phi}_{\bm{\theta}}(\bm{y}) $. If $\mathbb{P}_U= UU^\top$ is the projector on the $m$ principal components, then $U^\top C_{\bm{\theta}} U = \diag(\bm{\lambda})$, where $\bm{\lambda}$ is a vector containing the principal values. After having trained the St-RKM model, the energy function for out-of-distribution detection is defined as the objective \eqref{eq:strkm} with the learned interconnection matrix $U^\star$, feature map parameter $\bm{\theta^\star}$ and pre-image map parameter $\bm{\xi^\star}$: \begin{align} \label{eq:energy} E_{\text{FullEnergy}}(x) =& {\h{}{} - \corr{\theta^\star}{}{\star}{} + \phimap{\theta^\star}{}} + \lambda \loss{\xi^\star}{\star}{}{\theta^\star}, \end{align} where $\bm{h} = {U^\star}^\top \bm{\phi}_{\bm{\theta^\star}}(\bm{x})$. In the following discussion, we refer to this energy score as $E_{\text{FullEnergy}}$. It is expected that for \emph{similar} in/out-distributions, the Autoencoder loss term takes similar values for samples from each case, thus making it harder to distinguish between in- and out-of-distribution samples with the Autoencoder reconstruction error. In such instances, looking at the KPCA reconstruction term alone might be more useful. This is illustrated in Fig. \ref{fig:ood_cifar}. In other words, this suggests that the $E_{\text{FullEnergy}}$ score should perform better on OOD datasets whose distribution is further away from the training distribution, while the KPCA reconstruction term could result in better performance on OOD datasets whose distribution is closer to $P$. This motivates investigating the individual components of \eqref{eq:energy} by treating them as standalone energy metrics. % Hence, we define the following additional energy function for OOD detection: \begin{equation} \label{eq:noloss} E_{\text{kPCAError}}(x) = \h{}{} - \corr{\theta^\star}{}{\star}{} + \phimap{\theta^\star}{}. \end{equation} In other words, the $E_{\text{kPCAError}}$ energy definition is the energy \eqref{eq:energy} without the Autoencoder loss term. Intuitively, \eqref{eq:noloss} can be seen as the norm of the reconstruction error vector between the latent space points and the projected points onto the subspace (see first term in \eqref{eq:ReducedObjective}). % \begin{table*}[t] \caption{Comparison of OOD detection performance. Lower scores ({\small $\downarrow$}) are better for FPR95 and higher scores ({\small $\uparrow$}) are better for AUROC and AUPR. [S] Supervised / [U] Unsupervised. Experiments are repeated 10 times. PCA detection has no randomness involved.\vspace{2.1mm}} \centering \begin{tabular}{ll llllll} \multicolumn{8}{c}{$\mathcal{D}^{\text{train}}_{\text{in}}$: Fashion-MNIST [Mean (Std) over 10 iterations, values in \%]} \vspace{1mm} \\ \toprule \multicolumn{1}{c}{\multirow{2}{*}{$\mathcal{D}^{\text{test}}_{\text{out}}$}} & \multirow{2}{*}{Metric} & \multicolumn{2}{c}{$\St$-RKM variants [U]} & \multirow{2}{*}{Liu2020 [S]} & \multicolumn{1}{c}{\multirow{2}{*}{PCA [U]}} & \multicolumn{1}{c}{\multirow{2}{*}{VAE [U]}} & \multicolumn{1}{c}{\multirow{2}{*}{GAN [U]}}\\ \cmidrule{3-4} & & \multicolumn{1}{c}{$E_{\text{FullEnergy}}$} & \multicolumn{1}{c}{$E_{\text{kPCAError}}$} & && \\ \midrule \multirow{3}{*}{MNIST} & FPR95\small{($\downarrow$)}& 75.73 (2.7) & \textbf{0.38} (0.2) & 75.97 (11.1) & 99.99 & 2.67 (1.0) & 97.31 (4.5) \\ & AUROC\small{($\uparrow$)}& 69.44 (1.5) & \textbf{99.70} (0.1) & 78.05 (4.9) & 73.17 & 99.36 (0.1) & 49.32 (17.7) \\ & AUPR\small{($\uparrow$)} &66.26 (3.0) & \textbf{99.75} (0.1) & 80.36 (4.0) & 83.73 & 99.44 (0.1) & 60.75 (15.5)\\ \midrule \multirow{3}{*}{dSprites} & FPR95\small{($\downarrow$)}& 99.21 (0.8) & \textbf{2.71} (2.7) & 96.23 (3.6) & 99.79 & 69.43 (2.3) & 73.54 (34.8) \\ & AUROC\small{($\uparrow$)}& 11.61 (3.1) & \textbf{99.17} (0.4) & 63.68 (7.5) & 82.81 & 85.77 (0.8) & 58.04 (31.9) \\ & AUPR\small{($\uparrow$)}& 0.71 (0.02) & \textbf{92.82} (2.9) & 20.82 (8.2) & 70.89 & 36.87 (6.1) & 22.76 (29.4)\\ \midrule \multirow{3}{*}{SVHN} & FPR95\small{($\downarrow$)} & \textbf{1.34} (0.2) & 28.64 (10.1) & 29.14 (8.9) & 75.31 & 27.42 (6.1) & 82.55 (7.2) \\ & AUROC\small{($\uparrow$)} & \textbf{99.59} (0.04) & 95.61 (1.3) & 94.04 (2.0) & 51.36 & 94.56 (1.3) & 59.99 (5.0) \\ & AUPR\small{($\uparrow$)}& \textbf{99.23} (0.1) & 93.00 (1.8) & 88.52 (3.3) & 25.57 & 89.76 (2.4) & 42.15 (10.7) \\ \midrule \multirow{3}{*}{CIFAR-10} & FPR95\small{($\downarrow$)} & \textbf{0.34} (0.01) & 13.40 (5.7) & 46.97 (10.4) & 65.76 & 6.50 (2.8) & 81.09 (7.9) \\ & AUROC\small{($\uparrow$)}& \textbf{99.76} (0.003) & 97.70 (0.8) & 90.60 (2.5) & 67.86 & 98.63 (0.4) & 69.32 (6.4) \\ & AUPR\small{($\uparrow$)} & \textbf{99.83} (0.003) & 98.08 (0.6) & 91.77 (2.0) & 60.69 & 98.83 (0.3) & 73.30 (3.9) \\\bottomrule \end{tabular} \label{tab:res1} \end{table*} \section{Experimental Evaluation} \label{exp} In this section, we discuss the experiments on standard computer vision datasets and on a time series problem for anomalous heartbeat detection. \textbf{Training details.} We train all models for 1600 epochs with mini-batch size of 256. For Liu et al. \cite{liu2020a}, VAE and GAN methods, training is performed using Adam \cite{KingmaAdam} with a learning rate of $2 \times 10^{-4}$. For St-RKM, an alternating minimization training scheme is used: the weights of the encoder $\bm{\phi}_{\bm{\theta}}(\cdot)$ and of the decoder $\bm{\psi}_{\bm{\xi}}(\cdot)$ are jointly optimized with the Adam optimizer \cite{KingmaAdam} with learning rate $2 \times 10^{-4}$, and the interconnection matrix $U$ is optimized with the Cayley Adam optimizer \cite{Li2020Efficient} with learning rate $1 \times 10^{-4}$. For the full training algorithm, see Algorithm 1 in \cite{strkm}. A PCA baseline is also considered; in this case, scores are computed by the reconstruction error by removing the components whose contribution to total variation is less than 2\%. The subspace dimension is set to 10 for all datasets. The source code and additional architectural details are available at \url{https://github.com/taralloc/st-rkm-ood}. % \textbf{Performance metrics.} We evaluate the false positive rate (FPR95) at 95\% true positive rate, area under the receiver operating characteristic curve (AUROC) and under the precision-recall curve (AUPR). Note that the threshold $\gamma$ is not needed for evaluating AUROC and AUPR scores. We also evaluate the Overlapping Coefficient to quantify the dissimilarity between the $\mathcal{D}^{\text{train}}_{\text{in}}$ and $\mathcal{D}^{\text{test}}_{\text{out}}$ energy distributions. For two real probability density functions $f_A (x)$ and $f_B (x)$, the overlapping coefficient \cite{inman1989,pastore2019} $\eta \colon \mathbb{R}^n \times \mathbb{R}^n \rightarrow [0, 1]$ is defined as: \begin{equation} \eta(A, B) = \int_{\mathbb{R}^n} \min [f_{A}(x), f_{B}(x) ] dx . \label{eq:overlap_coefficient} \end{equation} $\eta (A, B) = 0$ indicates that the support of $f_A (x)$ and $f_B (x)$ does not have any common points, i.e., the distributions do not overlap. Ideally, this should be the case for $\mathcal{D}^{\text{train}}_{\text{in}}$ and $\mathcal{D}^{\text{test}}_{\text{out}}$ energy distributions. \subsection{Computer Vision} First, we describe our experimental setup in Section \ref{exp:cv:setup}. In Section \ref{exp:cv:exp}, we show that the proposed method improves over the state of the art in energy-based OOD detection using a pre-trained neural classifier on the considered benchmarks. We also show the distribution of the energy scores on multiple OOD datasets. \subsubsection{Experimental Setup} \label{exp:cv:setup} For this set of experiments, we create a Convolutional Network architecture for the St-RKM's encoder $\bm{\phi}_{\bm{\theta}}(\cdot)$ and a transposed Convolutional architecture for the St-RKM's decoder $\bm{\psi}_{\bm{\xi}}(\cdot)$. \begin{itemize} \item \emph{In-distribution and out-of-distribution datasets}. We use Fashion-MNIST from \cite{fashionmnist} as $\mathcal{D}^{\text{train}}_{\text{in}}$. For testing, we use four different datasets: MNIST \cite{mnist}, dSprites \cite{betavae}, SVHN \cite{svhn} and CIFAR-10 \cite{cifar10}. SVHN, dSprites and CIFAR-10 are resized to $28\times 28 \times 1 $ input dimensions. \item \emph{Hyperparameters.} Following a sensitivity analysis, in \eqref{eq:energy} we fix $\lambda = 100$. The St-RKM, VAE and GAN models employ the same encoder-decoder architecture; for GAN, the encoder is used in the discriminator, while the generator uses the decoder. The encoder $\bm{\phi}_{\bm{\theta}}$ consists of three convolutional (\textit{Conv}) layers with doubling channel size followed by two fully connected (\textit{FC}) layers, and the decoder $\bm{\psi}_{\bm{\xi}}$ consists of two \textit{FC} layers followed by three transposed convolutional (\textit{ConvTr}) layers with halving channel size. All convolutions have stride 2 and padding 1, except for the last \textit{Conv} layer of $\bm{\phi}_{\bm{\theta}}$ and for the first \textit{ConvTr} layer of $\bm{\psi}_{\bm{\xi}}$ that have stride 1 and no padding. The activation function is Parametric-RELU ($\alpha = 0.2$), except for the output layer of $\bm{\psi}_{\bm{\xi}}$ that has Sigmoid activation function. For \cite{liu2020a}, we train a convolutional neural network classifier whose architecture is set to be identical to the architecture of the St-RKM's encoder. \end{itemize} \subsubsection{Experimental Results} \label{exp:cv:exp} \begin{figure*}[t!] \centering \includegraphics[width=.8\textwidth]{plot1_20210127-1235.pdf} \caption{Visualizing the distribution of the energy scores of various models. In energy-based models, low energies are associated with more likely input samples, hence it corresponds to in-distribution samples. In line with the properties of each energy definition discussed in Section \ref{met}, note that, for MNIST and dSprites, the in- and out-distributions overlap for the $E_{\text{FullEnergy}}$ definition, but they are separated for the $E_{\text{kPCAError}}$ definition, suggesting that in those datasets the autoencoder loss term has a dominant weight in the energy function of the $E_{\text{FullEnergy}}$ definition. In general, the distributions of the best-performing methods based on the St-RKM's energy look smoother and more separated than the distribution of the method proposed in \cite{liu2020a}.} \label{fig:plot1} \end{figure*} \begin{table*}[] \centering \caption{Overlapping Coefficient quantifying the overlap of $\mathcal{D}^{\text{train}}_{\text{in}}$ and $\mathcal{D}^{\text{test}}_{\text{out}}$ energy distribution as shown in Fig. \ref{fig:plot1}. The standard deviation over 10 iterations is given in parenthesis. Smaller is better.} \label{tab:overlap_coefficient} \begin{tabular}{lllllll} \toprule \multirow{2}{*}{$\mathcal{D}^{\text{test}}_{\text{out}}$} & \multicolumn{2}{c}{$\St$-RKM variants} & \multirow{2}{*}{Liu2020} & \multirow{2}{*}{PCA} & \multirow{2}{*}{VAE} & \multirow{2}{*}{GAN}\\ \cmidrule{2-3} & $E_{\text{FullEnergy}}$ & $E_{\text{kPCAError}}$ & && \\ \midrule MNIST & 0.58 (0.02) & \textbf{0.03} (0.003) & 0.41 (0.1) & 0.24 & 0.04 (0.005) & 0.43 (0.1) \\ dSprites & 0.24 (0.05) & \textbf{0.04} (0.01) & 0.49 (0.1) & 0.19 & 0.28 (0.01) & 0.31 (0.2) \\ SVHN & \textbf{0.03} (0.003) & 0.12 (0.02) & 0.17 (0.04) & 0.52 & 0.14 (0.02) & 0.60 (0.1) \\ CIFAR-10 & \textbf{0.01} (0.001) & 0.09 (0.01) & 0.22 (0.04) & 0.51 & 0.06 (0.01) & 0.51 (0.1) \\ \bottomrule \end{tabular} \end{table*} \begin{figure}[t!] \centering \includegraphics[width=0.5\textwidth]{plot1_20210127-1329.pdf} \caption{Distribution of the energy scores when the in/out-distributions are from the same dataset. Here, the $\mathcal{D}^{\text{train}}_{\text{in}}$ is the training set of Fashion-MNIST ($N_{\text{train}} = 60000$) and $\mathcal{D}^{\text{test}}_{\text{out}}$ is the test set ($N_{\text{test}} = 10000$) of the same dataset.} \label{fig:sanitycheck} \end{figure} \textbf{Can the model detect samples from the same distribution?} First, we investigate the extreme case where the in-distribution $P$ is the same as the out-distribution $Q$. We consider the training and test sets of Fashion-MNIST: the training set is used as $\mathcal{D}^{\text{train}}_{\text{in}}$ to train the OOD detectors, and the test set is taken as $\mathcal{D}^{\text{test}}_{\text{out}}$ to evaluate OOD performance. A significant overlap, as can be seen in Fig. \ref{fig:sanitycheck}, suggests that the model performs as expected and overall captures the true positives. Some samples that are flagged as OOD are shown in Fig. \ref{fig:outliers}. Interestingly, most of such instances are even difficult for a human to classify. \begin{figure}[t!] \centering \setlength{\tabcolsep}{0.3pt} \begin{tabular}{cccccccccc} \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out02-00_fashion-mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out04-05_fashion-mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out07-05_fashion-mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out16-05_fashion-mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out25-06_fashion-mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out27-00_fashion-mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out32-00_fashion-mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out39-05_fashion-mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out47-05_fashion-mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out37-00_fashion-mnist} \end{minipage}{} \\[3mm] \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out01-02_mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out02-02_mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out05-02_mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out11-05_mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out14-06_mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out20-05_mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out21-07_mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out23-08_mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out26-02_mnist} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out32-00_mnist} \end{minipage}{} \\[3mm] \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out00-00_cifar10} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out09-07_cifar10} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out13-03_cifar10} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out14-03_cifar10} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out15-06_cifar10} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out30-01_cifar10} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out38-03_cifar10} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out43-03_cifar10} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out45-00_cifar10} \end{minipage}{} & \begin{minipage}{.047\textwidth} \includegraphics[width=\textwidth]{out37-04_cifar10} \end{minipage}{} \\ \end{tabular} \caption{Samples from the test set of Fashion-MNIST (first row), MNIST (second row), and CIFAR-10 (third row) that are flagged as OOD by our method, illustrating that these samples often show unusual features.} \label{fig:outliers} \end{figure} \textbf{How does the proposed method perform compared to its competitors?} Table \ref{tab:res1} shows the performance attained by various energy function definitions and \cite{liu2020a}'s energy function without fine-tuning, evaluated for each out-of-distribution dataset. In these benchmarks, our proposed method outperforms the current state-of-the-art energy-based out-of-distribution detection method on all considered OOD datasets. For instance, on MNIST our proposed $E_{\text{kPCAError}}$ score achieves 0.38\% FPR compared to 75.97\% FPR achieved by \cite{liu2020a}. On CIFAR-10, our proposed $E_{\text{FullEnergy}}$ energy definition achieves 0.34\% FPR compared to 46.97\% FPR achieved by \cite{liu2020a}. \textbf{Which component of the Energy function is more useful?} Table \ref{tab:res1} further gives an insight regarding the merit of various components of the energy function as discussed in Section \ref{met}. It shows that, on the one hand, the $E_{\text{FullEnergy}}$ score performs better on OOD datasets whose distribution is further away from the training distribution $P$; this is the case for SVHN and CIFAR-10. On the other hand, the $E_{\text{kPCAError}}$ score performs best on OOD datasets whose distribution is closer to $P$; this is the case for MNIST and dSprites. Note that the $E_{\text{FullEnergy}}$ performs poorly in the latter case also, as can be seen from Fig. \ref{fig:plot1}. Fig. \ref{fig:plot1} shows a kernel density plot with Gaussian kernel over the energy distributions for each method (row) and $\mathcal{D}^{\text{test}}_{\text{out}}$ (column). First, the energy scores are mean centered, scaled to unit variance, and finally shifted by adding the negative minimum energy score. The subplots of the $E_{\text{FullEnergy}}$ definition for MNIST and dSprites show significant overlap, and thus the energy gap between in-distribution samples and OOD samples is small. It can be understood as follows. Note that the AE loss of \eqref{eq:energy} dominates over the kernel PCA reconstruction in $E_{\text{FullEnergy}}$ due to the significantly large number of neural network parameters compared to that in $U$. Further, the AE loss of samples from $P$ is similar to that of samples from $Q$ since the network's parameters would be similar if trained on similar distributions. In such instances, looking at the $E_{\text{FullEnergy}}$ naively obfuscates the distinction between in/out-of-distribution samples. However, $E_{\text{kPCAError}}$ highlights the projection error between similar datasets and therefore results in better OOD detection performance. \textbf{How well does the Energy function separates the in/out distributions?} Table \ref{tab:overlap_coefficient} shows the overlapping coefficient for the considered datasets and OOD detectors, further confirming that the proposed energy functions based on the St-RKM's energy can lead to better performance than both generative-based and discriminative-based methods. The St-RKM variants give the lowest overlap, meaning that they induce energy distributions effectively separating $\mathcal{D}^{\text{train}}_{\text{in}}$ samples from $\mathcal{D}^{\text{test}}_{\text{out}}$ samples. This performance increase is especially noteworthy given that our method does not use any label information in any way, contrary to \cite{liu2020a}, whose energy function \eqref{eq:liu2020a} is defined based on a classifier trained in the supervised learning setting. At the same time, the fine-tuning procedure with auxiliary OOD training data proposed in \cite{liu2020a} could boost the performance of their method; however, in many applications, access to OOD samples during training is limited. In contrast, the training procedure of our method does not require additional fine-tuning with OOD training data. \subsection{Time Series Data} We now turn to OOD detection in time series data from the healthcare sector. This is an increasingly important area where unsupervised OOD detection algorithms can be extremely useful, as obtaining and labeling medical data is usually expensive. The proposed method can be applied to time series data by selecting an appropriate encoder-decoder architecture for the St-RKM. On the contrary, the method proposed in \cite{liu2020a} is not directly applicable to time series data because its score function is defined on the output layer of a neural network classifier. \subsubsection{Experimental Setup} \label{exp:time:setup} For this set of experiments, the encoder-decoder architecture of St-RKM, VAE, and GAN models is parametrized by a Variational Recurrent AutoEncoder (VRAE) \cite{fabius2015}. \begin{itemize} \item \emph{In-distribution and out-of-distribution datasets.} We use the publicly available ECG5000 dataset \cite{ecg5000}, which consists of $N=5000$ electrocardiogram (ECG) univariate time series. Each sequence has 140 timesteps and corresponds to a single heartbeat. The dataset contains 5 classes: one class is seen as \textit{normal}, while the others represent anomalous heartbeats. The dataset is first divided into a training set of $N_{\text{train}}=4500$ sequences and a test set of $N_{\text{test}}=500$ sequences. The sequences of the \textit{normal} class contained in the training set are taken as $\mathcal{D}^{\text{train}}_{\text{in}}$, and the sequences of the anomalous heartbeats in the test set are taken as $\mathcal{D}^{\text{test}}_{\text{out}}$. \item \emph{Hyperparameters.} In all models, following the architecture proposed in \cite{fabius2015}, the encoder uses an LSTM with two layers, and the decoder uses an LSTM with two layers followed by a fully connected layer. All LSTM layers have input size 1 and hidden size 10. \end{itemize} \subsubsection{Experimental Results} \begin{table}[t] \renewcommand{\arraystretch}{1.06} \caption{Comparison of OOD detection performance in time series data of electrocardiogram (ECG) sequences. All values are in percentages. \label{tab:res2}} \centering \begin{tabular}{l cccc} \toprule \multirow{2}{*}{Metric} & \multicolumn{2}{c}{$\St$-RKM variants} & \multirow{2}{*}{VRAE} & \multirow{2}{*}{GAN}\\ \cmidrule{2-3} & $E_{\text{FullEnergy}}$ & $E_{\text{kPCAError}}$ & & \\ \midrule FPR95\small{($\downarrow$)}& \textbf{6.18} (0.2) & 98.45 (1.7) & \textbf{6.27} (0.3) & 87.45 (19.1) \\ AUROC\small{($\uparrow$)}& \textbf{94.02} (0.1) & 50.39 (1.8)& 93.89 (0.2) & 37.08 (29.9)\\ AUPR\small{($\uparrow$)} & \textbf{95.62} (0.2) & 85.67 (0.2)& \textbf{95.71} (0.2) & 78.94 (9.6)\\ \bottomrule \end{tabular} \end{table} \textbf{Is the proposed method able to detect anomalous heartbeats?} Table \ref{tab:res2} shows the performance attained by various proposed energy function definitions, by VAE with VRAE architecture, and by GAN. When computing the scores, all anomalous classes are seen as one out-of-distribution class. The $E_{\text{FullEnergy}}$ score is the highest-performing energy function among the St-RKM variants. It outperforms GAN models on all metrics, providing more reliable performance as well. A possible explanation for the poor performance of GAN models is that the discriminator is trained to differentiate between real heartbeat sequences and sequences generated by the generator, rather than to distinguish between real and anomalous heartbeats. Hence, GANs model only $P$ implicitly. Compared to VAE, the $E_{\text{FullEnergy}}$ score has similar performance with slightly better average FPR and AUROC. Overall, our proposed method can distinguish anomalous heartbeats with an average FPR of 6.18\% and an average AUROC of 94.02\%. \section{Conclusion} In this work, we proposed an energy-based method for the out-of-distribution detection task based on the St-RKM model. Further, we proposed multiple energy functions, examined their properties, and discussed practical scenarios where each proposed definition may perform best. In contrast to the state of the art in energy-based OOD detection which exploits a pre-trained classifier, our method does not require labels as it is trained in an unsupervised manner. Moreover, the training phase of our method does not require anomalous data, contrary to previous methods that use a fine-tuning step with an auxiliary dataset of OOD samples. We evaluated our method on several out-of-distribution datasets and showed that it improves on the baseline (state of the art in energy-based OOD detection) of \cite{liu2020a}. We showed that the proposed $E_{\text{kPCAError}}$ definition is more suitable when the out-distribution is similar to the training distribution, while the proposed $E_{\text{FullEnergy}}$ definition performs best when the out-distribution is further away from the training distribution. Future work includes investigating the proposed method against adversarial attacks. \section*{Acknowledgment} {\footnotesize EU: The research leading to these results has received funding from the European Research Council under the European Union’s Horizon 2020 research and innovation program/ERC Advanced Grant E-DUALITY (787960). This paper reflects only the authors’ views and the Union is not liable for any use that may be made of the contained information. Research Council KUL: Optimization frameworks for deep kernel machines C14/18/068. Flemish Government: FWO: projects: GOA4917N (Deep Restricted Kernel Machines: Methods and Foundations), Ph.D./Postdoc grant Impulsfonds AI: VR 2019 2203 DOC.0318/1QUATER Kenniscentrum Data en Maatschappij. Ford KU Leuven Research Alliance Project KUL0076 (Stability analysis and performance improvement of deep reinforcement learning algorithms). EU H2020 ICT-48 Network TAILOR (Foundations of Trustworthy AI - Integrating Reasoning, Learning and Optimization). This work was supported by the Research Foundation Flanders (FWO) research projects G086518N, G086318N, and G0A0920N; Fonds de la Recherche Scientifique — FNRS and the Fonds Wetenschappelijk Onderzoek — Vlaanderen under EOS project no 30468160 (SeLMA). Johan Suykens and Panagiotis Patrinos are affiliated to Leuven.AI - KU Leuven institute for AI, B-3000, Leuven, Belgium. The computational infrastructure and services used in this work were provided by the VSC (Flemish Supercomputer Center), funded by the Research Foundation - Flanders (FWO) and the Flemish Government. } \bibliographystyle{IEEEtran}
\section*{Introduction} Differential equations underpin essentially all of science, engineering, and finance. They describe how the behavior of dynamical systems unfolds over time. Most differential equations cannot be solved symbolically, i.e., a closed form solution does not exist. Almost all systems that are of interest for studying practical applications must therefore be approximated numerically. Studying these systems centers on devising the appropriate numerical approximation scheme balancing the benefit of being able to obtain a solution with the deviation from a "true" answer that the approximation introduces. With the recently surging popularity of deep learning and neural networks (NNs), new interest has arisen in solving differential equations with NNs. In the 1990s, Lagaris et al. proposed and implemented as proof-of-principle NN-based solutions to some illustrative ordinary and partial differential equations \cite{Lagaris_1998}. Dockhorn \cite{dockhorn2019discussion} applied the approach to solving the Poisson and Navier-Stokes Equations. Liu et al. \cite{liu2019neural} applied a NN approach to solving the Laplace Equation. In quantum mechanics, Sehanobish et al. \cite{sehanobish2021learning} used NNs to compute solutions for the potential energy function from Schrodinger's Equation. In classical mechanics, Mattheakis et al. \cite{mattheakis2020hamiltonian} solved Hamilton's Equations for positions and momenta, besting the fidelity of numerical solution phase space diagrams for both periodic and chaotic dynamical systems. Chemical kinetics describes the rate of chemical conversions. It is an integral component in systems biology, in which large biochemical systems are studied quantitatively in order to understand biological behavior and disease processes, also forming an important tool in pharmacology. This is a rich field with meaningful applications in basic science and health care. As such, we seek to apply NNs to solve the differential equations that describe chemical kinetics. We endeavor specifically to do so for a particularly well known chemical kinetics system, a model for the interplay of human immunodeficiency virus (HIV) and immune system CD4+T cells, which the virus invades and attacks. This is the mechanism by which HIV degrades the human immune system. Particularly before the widespread use of highly active anti-retroviral therapy (HAART), this rendered victims susceptible to opportunistic infections that would normally be asymptomatic in the presence of a healthy immune system. \pagebreak \section*{Methods} \subsection*{Model and parameters} The HIV kinetic model seeks to quantify the relative amounts / concentrations of the uninfected but susceptible T cells (not all T cells are susceptible to infection), infected T cells, and HIV virus particles over time. These are denoted by $T(t)$, $I(t)$, and $V(t)$, respectively. The system of ordinary first order differential equations connecting these variables can be formulated as \cite{atangana2014computational,perelson1999mathematical}: \begin{equation} \label{eq:diff_eqn} \begin{aligned} & \frac{dT}{dt} = p - \alpha T + rT\left( 1 - \frac{T + I}{T_{max}} \right) - kVT\\ & \frac{dI}{dt} = kVT - \beta I \\ & \frac{dV}{dt} = N\beta I - \gamma V \end{aligned} \end{equation} \noindent subject to the initial conditions: \begin{equation} T(0) = T_0,\qquad I(0) = I_0,\qquad V(0) = V_0 \end{equation} Regarding the parameters in Equation \ref{eq:diff_eqn}: \begin{itemize} \item $p$ is the rate of T cell production in the bone marrow and thymus \item $\alpha$ is the natural turnover rate of uninfected T cells \item $r$ is the rate of T cell mitosis, or division \item $T_{max}$ is the maximum concentration of T cells in the bloodstream \item $k$ is the rate constant for infection by the HIV virus \item $N$ is the number of infectious free viral particles (virions) produced per infected T cell \cite{perelson1993dynamics} \item $\beta$ is the natural turnover rate of infected T cells \item $\gamma$ is the natural turnover rate of virus particles \end{itemize} We seek to solve Equation \ref{eq:diff_eqn} using the experimentally known quantities \cite{atangana2014computational,ongun2011laplace,atangana2013solving,yuzbacsi2012numerical}: \begin{equation} \begin{aligned} & T_0 = 0.1,\quad I_0 = 0.0,\quad V_0 = 0.1,\quad p = 0.1,\\ & \alpha = 0.02,\quad \beta=0.3,\quad \gamma = 2.4,\quad r = 3.0,\\ & k = 0.0027,\quad T_{max} = 1500,\quad N = 10 \end{aligned} \end{equation} We solve via NN loss minimization. In order to do this, we first subtract off the right hand sides of Equation \ref{eq:diff_eqn}: \begin{equation} \label{eq:diff_eqn_set_eq_to_zero} \begin{aligned} & \frac{dT}{dt} - \left( p - \alpha T + rT\left( 1 - \frac{T + I}{T_{max}} \right) - kVT \right) = 0 \\ & \frac{dI}{dt} - ( kVT - \beta I ) = 0 \\ & \frac{dV}{dt} - ( N\beta I - \gamma V ) = 0 \end{aligned} \end{equation} \subsection*{Addressing scale imbalance} As seen in Figure \ref{fig:function_plots} as well as earlier numerical results (Tables \ref{tab:T} \textendash \ref{tab:I}), in general, $T(t) \gg V(t) \gg I(t)$. More specifically, $T(t)$ values are on the order of $10^{-1}$\textendash $10^0$, whereas $V(t)$ takes values on the order of $10^{-1}$ \textendash $10^{-2}$, with $I(t)$ much lower at around $10^{-5}$ \textendash $10^{-6}$. In general, the order of magnitude of a function being approximated by a NN is reflected in the network's loss. Hence, a loss value that is significant enough to update weights for the NN approximating $I(t)$ would have a negligible effect upon that for $V(t)$, and the latter would fail to train / update, producing the vanish gradient problem. On the other hand, a loss significant enough to update $V(t)$ would have an outsized effect on the weights for $I(t)$, engendering the exploding gradient problem. In order to ameliorate this problem, we multiply the $\frac{dI}{dt}$ and $\frac{dV}{dt}$ by scaling factors in order to bring all quantities toward the same order of magnitude. Based on some trial and error, as well as the relative typical size scale of the values as mentioned above, the modified set of differential equations that we solve with the NN from Figure \ref{fig:CNN_architecture} is given by: \begin{equation} \label{eq:diff_eqns_scaled} \begin{aligned} & \frac{dT}{dt} - \left( p - \alpha T + rT\left( 1 - \frac{T + I}{T_{max}} \right) - kVT \right) = 0 \\ & 10,000 \times \left( \frac{dI}{dt} - ( kVT - \beta I ) \right) = 0 \\ & 10 \times \left( \frac{dV}{dt} - ( N\beta I - \gamma V ) \right) = 0 \end{aligned} \end{equation} Two major drawbacks to this approach are: \begin{enumerate} \item It requires a process of trial and error that can not be automated. Furthermore, this would soon become unfeasible for even slightly larger systems of differential equations. \item Equation \ref{eq:diff_eqn} represents a \textit{coupled} system of differential equations. For example, knowledge of any of $I(t)$ and $V(t)$ is required to calculate $T(t)$. This interdependence means that we can not change (via multiplication) any lines of Equation \ref{eq:diff_eqn} without altering all of the functional values. Hence, although it works in this example, the approach of Equation \ref{eq:diff_eqns_scaled} is not in general a reliable one for bringing functions to the same general order of magnitude. \end{enumerate} \subsection*{Neural network} Having made the above adjustments, our loss will be the right hand side of Equation \ref{eq:diff_eqns_scaled}. We can enforce the equality to arbitrary accuracy by minimizing the loss to within a particular threshold. For the time derivative terms, we substitute the finite difference numerical approximations: \begin{equation} \label{eq:finite_diff} \begin{aligned} \frac{dT}{dt} \approx \frac{T(t_i + \Delta t) - T(t_i)}{\Delta t} \\ \frac{dI}{dt} \approx \frac{I(t_i + \Delta t) - I(t_i)}{\Delta t} \\ \frac{dV}{dt} \approx \frac{V(t_i + \Delta t) - V(t_i)}{\Delta t}, \end{aligned} \end{equation} \begin{figure}[h!] \centering \includegraphics[width=12cm,height=12cm]{network.png} \caption{ Deep neural network architecture. } \label{fig:CNN_architecture} \end{figure} where $t_i$ is the time value with which we estimate the slope and $\Delta t$ is a small time increment. We note that Equation \ref{eq:finite_diff} becomes strict equalities as $\Delta t \rightarrow 0$. Hence, the smaller the value we choose for $\Delta t$, the better the approximation. The one input into our neural network is time $t$. The domain on which the function is defined is given by the span of $t$ values on which the network is trained. The architecture of the relatively simple NN we employ here is shown in Figure \ref{fig:CNN_architecture}. The input $t$ is passed separately through a parallel set of network branches. We use the three parallel branches / multi-input structure because we are approximating three different functions. for the $T(t)$ branch, this consists of two fully connected layers of 32 nodes, each with sine activation. The sine function normalizes to between -1 and 1, ensuring that network weights do not explode or vanish. It is used for the $T(t)$ branch because $T(t)$ is on a higher scale of magnitude compared to $I(t)$ and $V(t)$. Since $I(t)$ and $V(t)$ take much lower values, their NN branches use ReLu activation. ReLu could, given sizable input values, produce large values in the intermediate layers or loss. However, this is not of concern given typically low values of $I(t)$ and $V(t)$. As they tend to be of lower magnitude, $I(t)$ and $V(t)$ require more approximation power, and thus have an additional fully connected layer of 16 nodes before producing the single node outputs (representing the scaler function values $I(t)$ and $V(t)$.) Hence, the three branches together produce a 3-node output. Each of the output nodes, $T(t)$, $I(t)$, and $V(t)$ are compared to the numerical values of Equation \ref{eq:diff_eqns_scaled} using the approximations from Equation \ref{eq:finite_diff}. We use mean absolute error for our loss function. We employ the following parameters / hyperparameters in training our NN: \begin{itemize} \item Adam optimizer \item Learning rate: $1 \times 10^{-3}$ \item Training time: 3,000 epochs \item Training set size: 256 time values \item Testing set size: 128 time values \end{itemize} The input time values $t_s$ that the network samples span from $t_{\text{min}}=0$ to $t_{\text{max}}=1$. Outside of interval $\left[ 0, 1 \right]$, the NN will not learn how to fit the functions. We were able to sample within this interval with distinct training and validation sets as follows: \begin{itemize} \item Training set: selecting $t$ values from a uniform random distribution. \item Testing set: selecting $t$ values from a uniformly spaced distribution; all $t$s generated in the same epoch will form a grid where each $t$ is equally spaced. \end{itemize} All calculations were executed in Google Colab Pro, which runs in the Python language. We made use of the Pytorch module for NN design and training, also using the neurodiffeq library, which is specifically designed for solving differential equations with NNs. \section*{Results} The loss during training is shown in Figure \ref{fig:loss}. Effective training is manifested by monotonically decreasing loss of both the training and validation sets. \begin{figure}[h!] \centering \includegraphics[width=12cm,height=12cm]{NN_diff_eqn_loss_crop.png} \caption{ Loss of the neural network as a function of training time (epochs). } \label{fig:loss} \end{figure} The computed values for $T(t)$, $I(t)$, and $V(t)$ are shown in Figure \ref{fig:function_plots}. The expected trend of $T(t)$ increasing over time and being of a higher order of magnitude compared to $I(t)$ and $V(t)$ is apparent. The overall trend matches well with previously published results \cite{atangana2013solving}. \begin{figure}[h!] \centering \advance\leftskip-3cm \includegraphics[width=18cm,height=17cm]{result.png} \caption{Plots of the solved concentrations over time.} \label{fig:function_plots} \end{figure} By identifying the interpolated values of $T(t)$ at particular time values, we can compare with numerical approximation methods previously used to approximate the solution to Equation \ref{eq:diff_eqn}. The NN values are tabulated in the second-to-left-most column in Table \ref{tab:T}. They are juxtaposed with the corresponding values from various leading numerical approximation methods, and we can see that the values are very close. It should be noted that, despite the apparent increase in T cells implied by Figure \ref{fig:function_plots}, this represents a sub-population of T cells on a relatively short time scale. This is in fact bounded by overall T cell depletion at a longer time scale due to viral destruction \cite{perelson1993dynamics}, as would be expected, and noting in fact that one definition of AIDS is total CD4 count below 200 $\frac{\text{cells}}{mm^3}$. \section*{Conclusions} If we were to use the numerical approximations as gold standards, the above would be a demonstration of high accuracy. We know from prior work that NN-based integration is in fact more accurate than numerical approximate solutions and is often indistinguishable from the results of analytical integration in cases where a closed form solution is possible \cite{mattheakis2020hamiltonian}. An important limitation of the current approach is the aforementioned issue of scale imbalance. Although we achieved good results for this system with a trial and error approach that involved multiplying two of the equations by scaling factors, this is not guaranteed to work on other systems. In fact, the lack of a systematic method to achieve scale balance would be expected to hinder integration for larger, more complex systems that would be of interest in, for instance, systems biology. Future work will focus on new techniques to overcome this challenge. \begin{table}[h!] \centering \advance\leftskip-2cm \begin{tabular}{llllllll} \hline \\ $t$ & \begin{tabular}[c]{@{}l@{}}Proposed\\ Method\end{tabular} & HDM\cite{atangana2014computational} & LADM-Padé\cite{ongun2011laplace} & Runge-Kutta & MVIM\cite{atangana2013solving} & VIM\cite{atangana2013solving} & BCM\cite{yuzbacsi2012numerical} \\ \\ \hline \\ 0 & 0.1 & 0.1 & 0.1 & 0.1 & 0.1 & 0.1 & 0.1 \\ \\ 0.2 & 0.20305557 & 0.20880727 & 0.20880727 & 0.20880808 & 0.20880808 & 0.20880732 & 0.20386165 \\ \\ 0.4 & 0.39913343 & 0.40610526 & 0.40610526 & 0.40624053 & 0.40624079 & 0.40613465 & 0.38033093 \\ \\ 0.6 & 0.75553419 & 0.76114677 & 0.76114677 & 0.76442388 & 0.76442872 & 0.76245303 & 0.69546237 \\ \\ 0.8 & 1.39635758 & 1.37731985 & 1.37731985 & 1.41404683 & 1.41409417 & 1.39788058 & 1.27596244 \\ \\ 1 & 2.56711673 & 2.32916976 & 2.32916976 & 2.59159480 & 0.20880808 & 2.50674666 & 2.38322774 \\ \\ \hline \end{tabular} \caption{Numerical comparison of $T(t)$} \label{tab:T} \end{table} \begin{table}[h!] \centering \advance\leftskip-2cm \begin{tabular}{llllllll} \hline \\ $t$ & \begin{tabular}[c]{@{}l@{}}Proposed\\ Method\end{tabular} & HDM\cite{atangana2014computational} & LADM-Padé\cite{ongun2011laplace} & Runge-Kutta & MVIM\cite{atangana2013solving} & VIM\cite{atangana2013solving} & BCM\cite{yuzbacsi2012numerical} \\ \\ \hline \\ 0 & 0.1 & 0.1 & 0.1 & 0.1 & 0.1 & 0.1 & 0.1 \\ \\ 0.2 & 0.06334023 & 0.06187996 & 0.06187996 & 0.06187984 & 0.06187990 & 0.06187995 & 0.06187991 \\ \\ 0.4 & 0.03875031 & 0.03831324 & 0.03831324 & 0.03829488 & 0.03829595 & 0.03830820 & 0.03829493 \\ \\ 0.6 & 0.02408340 & 0.02439174 & 0.02439174 & 0.02370455 & 0.02371029 & 0.02392029 & 0.02370431 \\ \\ 0.8 & 0.01513445 & 0.00996721 & 0.00996721 & 0.01468036 & 0.01470041 & 0.01621704 & 0.01467956 \\ \\ 1 & 0.00962319 & 0.00330507 & 0.00330507 & 0.00910084 & 0.00915723 & 0.01608418 & 0.02370431 \\ \\ \hline \end{tabular} \caption{Numerical comparison of $V(t)$} \label{tab:V} \end{table} \begin{table}[h!] \centering \advance\leftskip-3.3cm \begin{tabular}{llllllll} \hline \\ $t$ & \begin{tabular}[c]{@{}l@{}}Proposed\\ Method\end{tabular} & HDM\cite{atangana2014computational} & LADM-Padé\cite{ongun2011laplace} & Runge-Kutta & MVIM\cite{atangana2013solving} & VIM\cite{atangana2013solving} & BCM\cite{yuzbacsi2012numerical} \\ \\ \hline \\ 0 & 0 & 0 & 0 & 0 & 0.1 · 10\textsuperscript{-13} & 0 & 0 \\ \\ 0.2 & 8.18247 · 10\textsuperscript{-6} & 6.03270 · 10\textsuperscript{-6} & 6.03270 · 10\textsuperscript{-6} & 6.03270 · 10\textsuperscript{-6} & 6.03270 · 10\textsuperscript{-6} & 6.03263 · 10\textsuperscript{-6} & 6.24787 · 10\textsuperscript{-6} \\ \\ 0.4 & 1.52065 · 10\textsuperscript{-5} & 1.31591 · 10\textsuperscript{-5} & 1.31591 · 10\textsuperscript{-5} & 1.31583 · 10\textsuperscript{-5} & 1.31583 · 10\textsuperscript{-5} & 1.31487 · 10\textsuperscript{-5} & 1.29355 · 10\textsuperscript{-5} \\ \\ 0.6 & 2.34348 · 10\textsuperscript{-5} & 2.12683 · 10\textsuperscript{-5} & 2.12683 · 10\textsuperscript{-5} & 2.12237 · 10\textsuperscript{-5} & 2.12233 · 10\textsuperscript{-5} & 2.10141 · 10\textsuperscript{-5} & 2.03526 · 10\textsuperscript{-5} \\ \\ 0.8 & 3.09622 · 10\textsuperscript{-5} & 3.00691 · 10\textsuperscript{-5} & 3.00691 · 10\textsuperscript{-5} & 3.01774 · 10\textsuperscript{-5} & 3.01745 · 10\textsuperscript{-5} & 2.79513 · 10\textsuperscript{-5} & 2.83730 · 10\textsuperscript{-5} \\ \\ 1 & 3.85396 · 10\textsuperscript{-5} & 3.98736 · 10\textsuperscript{-5} & 3.98736 · 10\textsuperscript{-5} & 4.00378 · 10\textsuperscript{-5} & 4.00254 · 10\textsuperscript{-5} & 2.43156 · 10\textsuperscript{-5} & 3.69084 · 10\textsuperscript{-5} \\ \\ \hline \end{tabular} \caption{Numerical comparison of $I(t)$} \label{tab:I} \end{table} \pagebreak \printbibliography \end{document}
\section{Introduction} Let $X$ be a toric variety, constructed as a GIT quotient of a vector space $V$ by a torus $T$. There is a well-established theory \cite{Kaw, Seg, BFK, HL} that tells us how to produce semi-orthogonal decompositions of the derived category $D^b(X)$. We do it by considering other birational models of $X$, \emph{i.e.} crossing walls in the GIT problem $T\actson V$. If we cross to a quotient $X'$, and $K_{X'}$ is `more negative' than $K_X$, then $D^b(X)$ decomposes as \beq{eq.SOD}D^b(X) = \SOD{D^b(X'), \;D^b(Z),\; ..., \;D^b(Z)}\end{equation} where $Z$ is another toric variety of smaller dimension. We do this repeatedly until we arrive at a `minimal' chamber. Since the extra pieces are always equivalent to the derived category of a toric variety they themselves can be decomposed by the same procedure, and we get a recursive algorithm which terminates after a finite number of steps. If $X$ is projective then the result of this algorithm is a full exceptional collection for $X$, \emph{i.e.} every piece of the final decomposition is equivalent to $D^b(\C)$. But for quasi-projective varieties there will usually be many different categories occuring, each one with some multiplicity. Moreover the decomposition is not unique; at each step of the algorithm one may have a choice about which wall to cross through and these choices result in different decompositions. The main technical result of this paper is the following Jordan-H\"older type theorem: \begin{keythm}[Theorem \ref{thm.JH}] Let $X$ be a toric variety. If we decompose $D^b(X)$ using the wall-crossing algorithm then the subcategories occuring in the final decomposition, and their multiplicities, are independent of all choices. \end{keythm} This result is not particularly hard to prove and neither is it an abstract result; we prove it by analysing the algorithm. But it is notable that the Jordan-H\"older property does not hold for semi-orthogonal decompositions in general \cite{BBS, Kuz}. \vspace{5pt} Our real motivation for proving the theorem above was to be able to understand a conjecture appearing in a physics paper by Aspinwall--Plesser--Wang \cite{APW}. Part of what they state is already understood in the mathematical literature but there remains a significant unsolved problem which we are able to formulate precisely using our theorem (Conjecture \ref{conj.mainconj}). This generalizes a conjecture made by Halpern-Leistner--Shipman \cite{HLSh}. We will use the remainder of this introduction to explain the motivation and context for this conjecture \subsection{Spherical functors from wall-crossing}\label{sec.sphericalintro} Our conjecture concerns the special case when the torus action $T\actson V$ is through the subgroup $SL(V)$. In this case all the GIT quotients $X$ will be Calabi-Yau, meaning $K_X\cong \mathcal{O}_X$, and not projective. In this situation the wall-crossing theory does not provide any decompositions of $D^b(X)$, instead it proves that all the GIT quotients are derived equivalent since the decomposition \eqref{eq.SOD} just becomes $D^b(X)=D^b(X')$. However the category $D^b(Z)$ still has an important role. The derived equivalence between $X$ and $X'$ is not unique, the theory gives us multiple equivalences for every wall-crossing, and by composing them we get autoequivalences of $D^b(X)$. From work of Halpern-Leistner--Shipman \cite{HLSh} it is known that each of these autoequivalences can be described as a twist $T_F$ around a spherical functor $$F: D^b(Z) \to D^b(X)$$ where $Z$ is the same toric variety that appears in \eqref{eq.SOD}. By combining these, and the Picard groups of each GIT quotient, we can get many autoequivalences of $D^b(X)$. So the interesting problem becomes to understand this large group of autoequivalences. \subsection{FI parameter spaces}\label{sec.FIPSintro} Now we explain some heuristics from physics and mirror symmetry. In string theory the data of $T$ acting on $V$ determines an abelian gauged linear sigma model, a widely studied class of $N=(2,2)$ superconformal field theories. In this theory there are certain important parameters called complexified Fayet-Iliopoulos parameters, they take values in a complex manifold which we call the FI Parameter Space (FIPS). They are related to stability conditions in the GIT problem and in certain limiting regions of the FIPS the theory reduces to a sigma model whose target is one of the quotients $X$. In physical terminology $X$ is a \emph{phase} of the model. In this region we can identify the FI parameters with the complexified K\"ahler moduli of $X$ so the FIPS is closely related to the \emph{extended} or \emph{stringy} K\"ahler moduli space of $X$.\footnote{The FIPS is not quite the same as the SKMS, the latter should be intrinsic to $X$ whereas the former depends on its presentation as $V/\!/T$. Also note that the SKMS is expected to be a complex submanifold of the space of Bridgeland stability conditions; on the mirror side this is the difference between small and big quantum cohomology. The FIPS is easier to compute than either the SKMS or the space of stability conditions.} Under mirror symmetry the FI parameters become complex parameters, so the FIPS is the base of the mirror family. Since toric mirror symmetry has a mathematically precise formulation this gives us a rigorous definition of the FIPS: it's the complement of the GKZ discriminant locus $\nabla$ inside the dual torus $T^\vee$ (Section \ref{sec.discriminants}). It is helpful to think of $T^\vee$ as an open subset of the secondary toric variety $\mathfrak{F}$ and to take the closure $\overline{\nabla}\subset \mathfrak{F}$, because then the phases correspond to the toric fixed points in $\mathfrak{F}$. From this point-of-view the FIPS is obtained by deleting $\overline{\nabla}$ and the toric boundary from $\mathfrak{F}$. The mirror family is a locally-trivial family of symplectic manifolds over the FIPS with fibre $\check{X}$. The monodromy of this family gives an action of $\pi_1(FIPS)$ on $\check{X}$ as symplectomorphisms, and hence as autoequivalences of the Fukaya category $\mathrm{Fuk}(\check{X})$. On the mirror side this predicts an action: $$\pi_1(FIPS) \actson D^b(X)$$ This is the `B-brane monodromy'. Examples and physical calculations suggest that this is essentially the group of autoequivalences that arise via wall-crossing as described in Section \ref{sec.sphericalintro}. This prediction appears in many places in the maths and physics literature (\emph{e.g.} \cite{HHP, HW, HLSam, HLSh}) and has been verified for some examples \cite{DS, Kite}. It seems to be a difficult problem to verify it in general, mainly because it is hard to understand $\pi_1(FIPS)$. \subsection{The rank 1 case}\label{sec.rank1} The case where $T=\C^*$ is quite well-known and easy to understand directly. In this case there are two possible phases which we denote by $X_\pm$. If we split $V$ by weights as $V_+\oplus V_0\oplus V_-$ then it's easy to see that $X_\pm$ is a vector bundle over $\P V_\pm \times V_0$, where $\P V_\pm$ is a weighted projective space. In this rank 1 case the discriminant locus is always a single point $\delta$ so the FIPS is $\C^*\setminus \delta$ (see Example \ref{eg.rank1discriminant}). Or we can say that the secondary toric variety $\mathfrak{F}$ is a $\P^1$ and that the FIPS is obtained from it by deleting the two toric fixed points and one more non-fixed point. The phase $X_+$ corresponds to the region near one of the toric fixed points, and the loop around that fixed point simply acts as $\otimes \mathcal{O}(1)$ on $D^b(X_+)$. More interesting is the loop around the non-fixed point $\delta$ - often called the \emph{conifold point} - which corresponds to wall-crossing to $X_-$ and back again. If there are no zero weights then the resulting autoequivalence is the twist $T_S$ around a spherical object $$S = \mathcal{O}_{P V_+}$$ given by the sky-scraper sheaf along the zero section in $X_+$. If there are zero weights we upgrade this to a twist around the spherical functor $$F: D^b(V_0) \to D^b(X_+)$$ given by pulling-up to $ \P V_+\times V_0$ and then pushing-forward along the inclusion into $X_+$. In the notation of Section \ref{sec.sphericalintro} the variety $Z$ is $V_0$. \begin{rem}\label{rem.orbifoldpi1}If there is only one positive weight then $X_+$ is an affine orbifold and $\mathrm{Pic}(X_+)$ is a finite cyclic group $\Z/k$. In this case it's sensible to allow that toric fixed point as part of the FIPS. The reason is that $\mathfrak{F}$ is (if we're careful) an orbifold $\P^1$ and this fixed point has isotropy group $\Z/k$, so we get an action of the orbifold fundamental group. This subtlety is interesting in the rank 1 case since it is occurs in the well-known `Calabi-Yau/Landau-Ginsburg correspondence'. In higher rank it happens very rarely and is of no significance for this paper. For us the FIPS will contain none of the toric boundary and hence we can ignore any orbifold structure on $\mathfrak{F}$. \end{rem} \subsection{Components of the discriminant}\label{sec.componentsintro} Suppose we have a higher rank torus $T\cong (\C^*)^r$. The discrimant locus $\nabla$ is now some hypersurface in $(\C^*)^r$ and it is usually the union of several irreducible components: $$\nabla = \nabla_0\cup... \cup \nabla_k$$ Aspinwall--Plesser--Wang \cite{APW} observed that there is a correspondence between these components $\nabla_i$ and certain toric varieties $Z_i$, built from subsets of the original toric data. They conjecture that for each phase $X$ there should be a spherical functor \beq{eq.Fi}F_i: D^b(Z_i) \to D^b(X)\end{equation} and that $T_{F_i}$ corresponds to the monodromy around the component $\nabla_i$. There is some deliberate ambiguity here; there is no canonical loop around $\nabla_i$ (even up to homotopy), so the functors $F_i$ are at best defined up to composition by autoequivalences. \subsection{Factorizations and multiplicities}\label{sec.multsintro} To understand this conjecture of \cite{APW} more clearly we pick two adjacent chambers of the secondary fan, separated by a wall $W$. This is the situation we discussed in Section \ref{sec.sphericalintro}. The two chambers give two phases $X_\pm$ which are derived equivalent, and we get an autoequivalence of $D^b(X_+)$ which is the twist around a spherical functor \beq{eq.FW}F: D^b(Z) \to D^b(X_+)\end{equation} for some smaller toric variety $Z$. In the secondary toric variety $\mathfrak{F}$ our wall $W$ corresponds to a rational curve $C_W$ connecting the toric fixed points corresponding to our two phases. It turns out that the discriminant locus $\overline{\nabla}$ always intersects $C_W$ in a single point $\delta$ (Corollary \ref{cor.onepointinCW}). This is the same picture that we saw in Section \ref{sec.rank1}, and the reason for this is that by focusing on a single wall-crossing we are essentially reducing to a rank 1 GIT problem. There is a the 1-parameter subgroup $\lambda_W\subset T$ normal to the wall and it is only stability with respect to $\lambda_W$ that is changing. So, just as in the rank 1 case, a loop in $C_W$ that goes around the point $\delta$ should correspond to the autoequivalence $T_F$. However, $C_W$ is not part of the FIPS since it lies in the toric boundary of $\mathfrak{F}$. To get an actual element of $\pi_1(FIPS)$ we have to perturb $C_W$ (or an open subset of it) off the toric boundary, and take a loop in the perturbed curve. When we do this peturbation the point $\delta$ may split into several points because $\overline{\nabla}$ typically meets $C_W$ with some multiplicity. This means that our element of $\pi_1(FIPS)$ is naturally a composite of several loops, one around each of our new missing points. In fact each component $\overline{\nabla}_i$ might meet $C_W$ with multiplicity, and we can group the new missing points according to these components (see Figure \ref{fig.FIPS}). \begin{figure}[!tbp] \centering \begin{minipage}[b]{0.5\textwidth} \includegraphics[width=\textwidth]{FIPS1.jpg} \end{minipage} \hfill \begin{minipage}[b]{0.35\textwidth} \includegraphics[width=\textwidth]{FIPS2.jpg} \end{minipage} \caption{(L) A real picture of $C_W$ as the straight line connecting the two points marked by $X_\pm$. (R) A complex picture of a 2-sphere near to the rational curve $C_W$, where the point $\delta$ has split into three. A loop from $X_+$ to $X_-$ and back again will factor into two loops around $\Delta_0$ and one loop around $\Delta_1$.} \label{fig.FIPS} \end{figure} So the loop around $\delta$ naturally factors into several loops around the different components of $\nabla$, with each component possibly appearing multiple times. This suggests that we should look for a corresponding factorization of the autoequivalence $T_F$. \vspace{5pt} This factorization does indeed exist. The toric variety $Z$ is not usually a Calabi-Yau, which means that $D^b(Z)$ (unlike $D^b(X)$) can be decomposed using the wall-crossing algorithm. Moreover, the subcategories that appear in this decomposition are always equivalent to $D^b(Z_i)$ where $Z_i$ is one of the varieties considered by Aspinwall--Plesser--Wang (Section \ref{sec.componentsintro}). So we get a semi-orthogonal decomposition \beq{eq.SODW}D^b(Z) = \SOD{ D^b(Z_0), \; D^b(Z_0), \; ..., \; D^b(Z_k), \; D^b(Z_k) } \end{equation} where each $D^b(Z_i)$ occurs some number of times (possibly zero). The order of the factors here depends on the choices made in the algorithm, but by our Theorem \ref{thm.JH} the multiplicities do not. Halpern-Leistner--Shipman \cite{HLSh} observed that this decomposition gives us a factorization of the autoequivalence $T_F$. If we restrict the spherical functor $F$ \eqref{eq.FW} to each piece of $D^b(Z)$ then we again get a spherical functor, and $T_F$ is the composition of all the corresponding twists. This provides the spherical functors $F_i$ required by Aspinwall--Plesser--Wang and matches with our discussion of loops in the FIPS. However, for this story to make sense there is one essential numerical condition: \begin{keyconj}[Conjecture \ref{conj.mainconj}]\label{conj.key} The multiplicity of $D^b(Z_i)$ in the decomposition \eqref{eq.SODW} agrees with the intersection multiplicity of $\overline{\nabla}_i$ with $C_W$. \end{keyconj} We finish by proving our conjecture in some special cases, the strongest of which is: \begin{keythm}[Theorem \ref{thm.rank2}] If the torus $T$ has rank 2 then Conjecture \ref{conj.key} holds. \end{keythm} \begin{rem} A significant part of this story was already understood by Halpern-Leistner--Shipman. They only consider the case when $Z$ is projective, meaning that the decomposition of $D^b(Z)$ is actually a full exceptional collection, and they conjecture that the number of exceptional objects agrees with the intersection multiplicity of $\overline{\nabla}$ with $C_W$ \cite[Remark 4.7]{HLSh}. Our conjecture is a synthesis of theirs with the work of \cite{APW}. \end{rem} \subsection{Acknowledgements} E.S. would like to thank Paul Aspinwall and Lars Louder for helpful conversations. \vspace{5pt} This project has received funding from the European Research Council (ERC) under the European Union Horizon 2020 research and innovation programme (grant agreement No.725010). A.K. was supported by the EPSRC [EP/L015234/1] via the LSGNT Centre for Doctoral Training. \section{Toric background} \subsection{Notation and assumptions} We are interested in toric varieties constructed as GIT quotients of a vector space $V$ by a torus $T$. We specify the data of the torus action as a complex of lattices \beq{eq.LtoN} 0 \To L \stackrel{Q^\vee}{\To} \Z^n \stackrel{A}{\To} N \To 0 \end{equation} or its dual: \beq{eq.LtoNdual} 0 \To M \stackrel{A^\vee}{\To } \Z^n \stackrel{Q}{\To} L^\vee \To 0 \end{equation} Here: \begin{itemize} \item $L$ is the lattice of 1-parameter subgroups of the torus $T$, so $T=L_{\C^*}$. \item $\Z^n$ is the lattice of Laurent monomials on $V$, \emph{i.e.}~$V=\mathrm{Spec}[\N^n]$ for the submonoid $\N^n\subset \Z^n$ \item $Q$ is the \emph{weight map}. The images $q_i= Q(e_i)$ of the standard basis vectors are the \emph{weights} of the action. \item $N$ is the cokernel of $Q^\vee$ modulo torsion. \item $M$ is the kernel of $Q$ and the dual of $N$. \item $A$ is the \emph{ray map}. The images $a_i=A(e_i)$ are the \emph{rays}. \end{itemize} By definition $A$ is surjective and $A^\vee$ is injective. We will always assume that $Q^\vee$ is injective, so $Q$ is surjective modulo torsion - this is the assumption that generic points of our GIT quotient stacks do not have infinite isotropy groups. It follows that \eqref{eq.LtoN} and \eqref{eq.LtoNdual} are exact apart from a possible torsion group $L^\vee/\Im Q \cong \Ker A / \Im Q^\vee$. \vspace{5pt} A \emph{stability condition} is an element of $L^\vee_\R$. A choice of stability condition $\theta$ defines a semi-stable locus in $V$ and hence a GIT quotient, which for us means the quotient stack: $$ X_\theta = [ V^{ss}_{\theta} \, / \, T ] $$ We'll generally only be interested in quotients with respect to generic $\theta$, in which case $X_\theta$ is at worst a DM stack. We'll also refer to these generic GIT quotients as the \emph{phases} of the GIT problem. Each phase is a toric orbifold and has a corresponding fan in $N$. The rays of this fan are always (some subset of) the $a_i$'s, hence the name. The higher dimensional cones change depending on the phase. \begin{rem}\label{rem.Qnotsurj} If the weight map $Q$ has some finite cokernel then the representation $T\to GL(V)$ has a finite kernel, so the GIT quotients $X_\theta$ have finite isotropy groups at all points. We need to allow this possibility, since even if it doesn't apply to our initial toric variety $X$ it can happen for the smaller-dimensional varieties $Z$ that appear in wall-crossing. Note that in this situation $A$ does not determine $Q$. There is a theory of \emph{stacky fans} but which solves this issue but we won't need it because for us $Q$ is the fundamental piece of data. \end{rem} The space of stability conditions has a wall-and-chamber structure whose chambers correspond to phases. If we consider all (non-empty) GIT quotients we get a fan in $L^\vee$ called the \emph{secondary fan} - the top-dimensional cones correspond to non-empty phases and the lower-dimensional cones correspond to non-generic GIT quotients. The rays of the secondary fan include those generated by the weights $q_i$, but in general there more rays than this. Corresponding to the secondary fan is a toric variety, the \emph{secondary toric variety} $\mathfrak{F}$. \subsection{The Calabi-Yau case}\label{sec.CYcase} An important special case is when the torus $T$ acts through $SL(V)$, which implies that each phase is Calabi-Yau. In terms of the toric data, the Calabi-Yau case is when the sum of the weights $q_i$ is zero. Equivalently, the rays $a_i$ are all contained in (and hence affinely span) an affine hyperplane of height 1. In this case is helpful to consider the polytope $$\Pi \subset N_\R $$ given by the convex hull of the rays. Each phase corresponds to a fan in $N$, which when intersected with the affine hyperplane determines a decomposition of $\Pi$. These decompositions are exactly the \emph{coherent triangulations}, \emph{i.e.}~triangulations induced by a piece-wise linear function. \subsection{Higgs and Coloumb GIT problems}\label{sec.higgsandcol} From our original GIT problem $T\actson V$ we will often extract a smaller GIT problem involving some subset of the toric data, either by picking a subset of the weights, or a subset of the rays. The two main ways this will happen are: \begin{enumerate} \item Suppose $W\subset L^\vee_\R$ is a wall in the secondary fan, normal to some 1-parameter subgroup $\lambda \in L$. Then we can consider the subset of weights which are orthogonal to $\lambda$, \emph{i.e.} which lie in the subspace $\langle W\rangle$. \item In the Calabi-Yau case we can choose a face $\Gamma\subset \Pi$ of the toric polytope, and consider the set of rays lying in this face. \end{enumerate} Formally, suppose we pick a subset $\mathcal{S}\subset \{1, ..., n\}$. We can view $\mathcal{S}$ as a subset of the standard basis vectors $\{e_1, .., e_n\}$ in $\Z^n$ so there is a corresponding set of rays $A(\mathcal{S}) \subset N$. We set $N_\mathcal{S}\subset N$ to be the sublattice spanned by $A(\mathcal{S})$, write $A_\mathcal{S}: \Z^\mathcal{S} \to N_\mathcal{S}$ for the restriction of $A$, and set $L_\mathcal{S}= \Ker A_\mathcal{S}$. Then we get a GIT problem: $$ L_\mathcal{S} \stackrel{Q_\mathcal{S}^\vee}{\To} \Z^\mathcal{S} \stackrel{A_\mathcal{S}}{\To} N_\mathcal{S} $$ We'll refer to this as the \emph{Coloumb GIT problem} associated to the subset $\mathcal{S}$. \vspace{5pt} Alternatively we pick a subset $\mathcal T \subset \{1, ..., n\}$ and consider the corresponding set of weights $Q(\mathcal T) \subset L^\vee$. We define $L^\vee_\mathcal T$ as the primitive sublattice generated by these weights $$L_\mathcal T^\vee = L^\vee \cap \langle Q(\mathcal T)\rangle_\R \;\subset L^\vee_\R $$ and we get a GIT problem: $$ M_\mathcal T \stackrel{A_\mathcal T^\vee}{\To} \Z^\mathcal T \stackrel{Q_\mathcal T}{\To} L_\mathcal T^\vee $$ We'll call this the \emph{Higgs GIT problem} associated to $\mathcal T$. Note that $Q_\mathcal{S}$ is by definition surjective but $Q_\mathcal T$ might not be (\emph{c.f.}~Remark \ref{rem.Qnotsurj}). \vspace{5pt} Our `Higgs' and `Coloumb' terminology is based on the `Higgs GLSM' and `Coloumb GLSM' from \cite{APW}, which are related to the Higgs and Coloumb branches of the vacuum moduli space at singular values of the FI parameters. \begin{rem}\label{rem.CCY} If our original GIT problem is Calabi-Yau then the Coloumb GIT problem is also Calabi-Yau for any subset $\mathcal{S}$. But the Higgs GIT problems may not be. \end{rem} \section{Semi-orthogonal decompositions for toric varieties}\label{sec.SODs} \subsection{Crossing a single wall}\label{sec.singlewall} Fix a toric GIT problem $T \actson V$. Let $C_+$ and $C_-$ be two adjacent chambers of the secondary fan separated by a wall $W$, and labelled such that $C_+$ lies on the same side of $W$ as the character $\det(V)$. Let $\lambda_W\in L$ be the primitive 1-parameter subgroup normal to this wall, oriented such that $$ \kappa = (\det V)(\lambda_W) \geq 0 $$ \emph{i.e.}~$C_+$ lies on the $\lambda_W>0$ side. Write $X_\pm$ for the phases corresponding to these two chambers. For this wall we have a Higgs GIT problem as described in Section \ref{sec.higgsandcol}. Let $\mathcal T$ be the indexing set for the weights orthogonal to $\lambda_W$, so $Q(\mathcal T)$ are all the weights lying in the subspace $\langle W \rangle$. The vector space corresponding to $\Z^\mathcal T$ is the fixed subspace $V^{\lambda_W} \subset V$. Also $Q(\mathcal T)$ necessarily span $\langle W \rangle$, so $L_\mathcal T^\vee$ is exactly the orthogonal to $\lambda_W$, \emph{i.e.} it's the character lattice of $T/\lambda_W$. Hence this Higgs GIT problem is just describing the action of $T/\lambda_W$ on $V^{\lambda_W}$. The secondary fan for this Higgs GIT problem lives in the vector space $\langle W \rangle$ and the cone $W$ lies in some chamber of it. We write $Z$ for the corresponding phase. \begin{thm}\cite[Theorem 5.2.1]{BFK}\label{thm.toricSOD} We have a semi-orthogonal decomposition $$D^b(X_+) = \SOD{ D^b(X_-), \; D^b(Z), \;...,\; D^b(Z) } $$ where $\kappa$ copies of $D^b(Z)$ occur. \end{thm} \begin{rem} This theorem is an application of the general theory of `windows' relating GIT and derived categories \cite{BFK, HL, Seg}, which applies to a general GIT quotient of a variety by a reductive group. However, in the current state-of-the-art you cannot use this theory to compare two \emph{different} GIT quotients unless you assume that the wall-crossing is of a particularly simple form. Which these ones are. \end{rem} \begin{rem} If $\det(V)$ lies on the wall then $\kappa=0$ and the theorem states that $D^b(X_+)$ and $D^b(X_-)$ are equivalent. This is a toric flop. \end{rem} \begin{eg}\label{eg.Pn} If we consider the standard action of $\C^*$ on $\C^{n+1}$ then $X_-=\varnothing$ and we get $$D^b(\P^n) = \SOD{D^b(pt), \; ..., \; D^b(pt)} $$ which recovers Beilinson's result that $\P^n$ has full exceptional collection of length ${n+1}$. \end{eg} \begin{rem}\label{rem.Orlov} If $X_+$ happens to be a blow-up of $X_-$ then Theorem \ref{thm.toricSOD} recovers Orlov's blow-up formula for this toric situation. It's possible to formulate the theorem more generally in such a way that it directly generalizes Orlov's result. \end{rem} \subsection{The algorithm} Theorem \ref{thm.toricSOD} immediately suggests the following recursive algorithm for decomposing the derived category of a phase $X$: \begin{enumerate} \item Starting at the chamber for $X$ we cross through a sequence of walls, always moving away from $\det(V)$. At each wall we refine our decomposition. \item We stop when we reach a \emph{minimal phase} where no further such wall-crossings are possible. \item Every factor occuring in this decomposition is the derived category of a phase of a smaller GIT problem, so we can apply this algorithm to each factor. \end{enumerate} Note that a phase is minimal if $-(\det V)$ lies in the closure of that chamber, or equivalently if the canonical bundle of that phase is nef. \begin{rem} If $X$ is projective then you can use this algorithm to recover Kawamata's result \cite{Kaw} that a projective toric variety has a full exceptional collection \cite[Thm 5.2.3]{BFK}. This is because the minimal phase will be empty (as in Example \ref{eg.Pn}), and moreover the minimal phase is empty in every Higgs GIT problem that occurs in the algorithm. \end{rem} In this paper we are more interested in quasi-projective examples. \begin{eg}\label{eg.algorithm} Take $V=\C^6$ and quotient by $(\C^*)^2$ using the following matrix of weights: $$\begin{pmatrix} 1 & 1 & -1 & 0 & 0 & 0 \\ 0 & 0 & 1 &1 & 1 & -1 \end{pmatrix} $$ Observe that $\det(V) = (1,2)^\top$. This GIT problem has four phases and the secondary fan is drawn in Figure \ref{fig.phases}. The phases are: \begin{enumerate} \item[(1)] $X_1=\A^4$. This is the unique minimal phase. \item[(2)] $X_2=\mathcal{O}(-1)_{\P^3}$, the total space of the tautological line bundle on $\P^3$. \item[(3)] $X_3=\mathcal{O}(-1)_{\P^1}\times \A^2$. \item[(4)] $X_4 = \mathcal{O}(-1)_P$, the total space of the relative $\mathcal{O}(-1)$ line bundle over the projective bundle $P=\P(\mathcal{O}^{\oplus 2}\oplus \mathcal{O}(-1)) \to \P^1$. \end{enumerate} \begin{figure}[!tbp] \begin{tikzpicture}[scale =1.4] \draw[thick] (0,0) --(2,0); \draw[thick] (0,-1)--(0, 1.3); \draw[thick] (0,0)--(-1.5,1.3); \node at (-.6,-.2) {$(1)$}; \node at (-.9,-.7) {$\A^4$}; \node at (-.3,.8) {$(2)$}; \node at (-.7,1.4) {$\mathcal{O}(-1)_{\P^3}$}; \node at (.5,-.4) {$(3)$}; \node at (1.2,-.9) {$\mathcal{O}(-1)_{\P^1}\times \A^2$}; \node at (.5,.5) {$(4)$}; \node[right] at (.8,1) {$\mathcal{O}(-1)_{P}$}; \end{tikzpicture} \caption{}\label{fig.phases} \end{figure} Firstly we decompose $D^b(X_2)$ by crossing the wall into chamber (1). The 1-parameter subgroup for this wall is $(1,1)$ so $\kappa=3$. The Higgs GIT is $\C^*\actson \C$ with weight 1, and $Z$ is the non-empty phase $Z=pt$. Hence Theorem \ref{thm.toricSOD} in this case says $$D^b(X_2) = \SOD{D^b(X_1),\; D^b(pt),\; D^b(pt),\; D^b(pt) } $$ which is an instance of Orlov's blow-up formula (see Remark \ref{rem.Orlov}). To make the rest of this example more readable we'll write this SOD and all following ones in the compressed form: $$D^b(X_2) = \SOD{X_1,\; pt,\; pt,\; pt } $$ For this phase no futher refinements are possible, and the algorithm is finished. \vspace{5pt} Next we apply the algorithm to phase 4. Let us choose to cross to phase (2) and then to phase (1). The wall-crossing between (2) and (4) is again a blow-up, it blows up the codimension 2 subvariety $\mathcal{O}(-1)_{\P^1}$. So crossing both walls gives: $$D^b(X_4) = \SOD{ X_2, \; \mathcal{O}(-1)_{\P^1}} = \SOD{ X_1, \; pt, \; pt, \; pt,\; \mathcal{O}(-1)_{\P^1}} $$ We are not yet finished, because we can still apply the algorithm to the factor $D^b(\mathcal{O}(-1)_{\P^1})$. But this variety is just the blow-up of $\A^2$ at the origin, so the next refinement is: \beq{eq.SOD1}D^b(X_4) = \SOD{ X_1, \; pt, \; pt, \; pt,\; \A^2, \; pt} \end{equation} No further refinements are possible. \vspace{5pt} What happens if we make a different choice? We could instead have crossed to phase (3) before crossing to phase (1). The crossing $(1)\leadsto (3)$ blows up a plane, and the crossing $(3)\leadsto(4)$ blows up a $\P^1$, so crossing these walls gives the decomposition: $$D^b(X_4) = \SOD{ X_3, \; \P^1, \; \P^1 } = \SOD{ X_1, \; \A^2, \; \P^1, \; \P^1 } $$ The factor $D^b(\P^1)$ can be split into two exceptional objects (as in Example \ref{eg.Pn}) so the final step is: \beq{eq.SOD2}D^b(X_4) = \SOD{ X_1, \; \A^2, \; pt, \; pt, \; pt, \; pt} \end{equation} Note that in this example the quotienting torus is $(\C^*)^2$, and for each phase we needed to apply the recursive algorithm (at most) two times. For rank $r$ it would need $r$ applications. \end{eg} \vspace{5pt} In the preceding example we noticed that when decomposing $D^b(X_4)$ we had two choices, since there were two possible paths from chamber (4) to chamber (1).\footnote{By `path' we really mean a sequence of adjacent chambers.} In the second step of the algorithm there was no such choice, since the Higgs GIT problems were all rank 1 and had only two chambers. In a higher rank example there will be many more choices because we need to choose a path at every step except the last one. However, examining the decompositions \eqref{eq.SOD1} and \eqref{eq.SOD2} that resulted from our two paths we can see evidence of our J\"ordan-Holder property - the decompositions are different, but the multiplicities of the `irreducible factors' agree. To state this precisely we need to think about what these `irreducible factors' really are. \subsection{Relevant subspaces}\label{sec.relevantsubspaces} Recall that our initial GIT problem is given by a weight matrix $Q: \Z^n \to L^\vee$ specifying a torus action $T\actson V$. At any step in the algorithm the Higgs GIT problem arises as the fixed subspace $V^{T'}$ for some sub-torus $T'\subset T$, with a corresponding sublattice $L'\subset L$. The weights $q_1,..., q_h$ of this Higgs GIT problem are those weights which are orthogonal to $L'$, and they always span the subspace $(L')^\perp_\R \subset L^\vee_{\R}$. The `irreducible factors' of our decompositions are the derived categories of the minimal phases of each such Higgs GIT problem. However, some of these minimal phases will be empty. Since the stability condition that produces the minimal phase is $$-\det(V^{T'}) = -\sum_{i=1}^h q_i\quad \in (L')^\perp $$ we get a non-empty minimal phase iff the vector $-\sum q_i$ lies in the cone spanned by $q_1,..., q_h$. \begin{defnlem}\label{defn.relevant} Let $H\subset L^\vee_{\R}$ be a subspace, let $q_1,..., q_h$ be the weights lying in $H$, and let $\sigma_H\subset H$ be the cone spanned by these weights. We call $H$ \emph{relevant} if one of the following two equivalent conditions hold: \begin{enumerate} \item[(i)] $\sigma_H$ is the whole of $H$. \item[(ii)] $H$ is is spanned by $q_1,..., q_h$ and also $-\sum q_i \in \sigma_H $. \end{enumerate} \end{defnlem} \begin{proof} Obviously (i) implies (ii). Conversely (ii) implies that $-q_i\in \sigma_H$ for all $i$, so if the $q_i$'s span $H$ then any vector in $H$ can be written as a positive linear combination of them. \end{proof} Clearly there can only be finitely-many relevant subspaces. We allow $H=0$ (which is always relevant) and $H=L^\vee_{\R}$ (which might not be). A 1-dimensional relevant subspace is a line which has weights on both its rays. The relevant subspaces index the `irreducible factors' in our semi-orthogonal decompositions. Each one defines a Higgs GIT problem with a non-empty minimal phase $Z_H$, and the corresponding factor is $D^b(Z_H)$. \begin{eg} In Example \ref{eg.algorithm} there are three relevant subspaces: the whole of $\R^2$, the vertical axis, and the origin. They contribute the factors $D^b(\A^4)$, $D^b(\A^2)$ and $D^b(pt)$ respectively. \end{eg} \begin{thm}\label{thm.JH} Let $X$ be a phase of a toric GIT problem and let $H$ be a relevant subspace. The multiplicity of $D^b(Z_H)$ in the semi-orthogonal decomposition of $D^b(X)$ is independent of all choices of paths. \end{thm} Presumably the different decompositions resulting from different choices of paths are always related by mutations, but we haven't checked this. \begin{rem}\label{rem.mult} The actual value of the multiplicity of $D^b(Z_H)$ in $D^b(X)$ is determined algorithmically from the toric data. It would be interesting - and probably helpful for Conjecture \ref{conj.mainconj} - to find something like a closed-form expression for it. We don't know how to do this, except in the case when $H$ has codimension 1 when it follows easily from the discussion in Section \ref{sec.singlewall}. Let $\lambda_H$ be a primitive 1-parameter subgroup normal to $H$, oriented so that it pairs positively with the chamber for $X$, and set $\kappa = (\det V)(\lambda_H)$. Then the multiplicity of $D^b(Z_H)$ in $D^b(X)$ is $$\max\{ \kappa, 0 \}$$ since the algorithm only tells us to cross $H$ if $\kappa>0$. \end{rem} \subsection{Proof of the main theorem} We'll prove Theorem \ref{thm.JH} using the recursive structure of the algorithm to reduce to the rank 2 case, \emph{i.e.} when the GIT problem consists of $(\C^*)^2\actson V= \C^n$. In the rank 1 case the theorem is vacuous since there are no choices. \begin{lem} \label{lem.rank2}Theorem \ref{thm.JH} holds in the rank 2 case. \end{lem} \begin{proof} If $\det(V)$ is the trivial character then all phases are derived equivalent and the theorem is vacuously true, so we can assume $\det(V)\neq 0$. For simplicity we assume that neither $\det(V)$ nor $-\det(V)$ lie on a wall, so there is a unique minimal phase and a unique `maximal' phase $X_{max}$, whose chamber contains $\det(V)$. In fact there could be up to two minimal or maximal phases, but crossing the walls between them is a derived equivalence and we can ignore it. If we start at any non-maximal phase then there are no choices to be made in the algorithm, but if we start at $X_{max}$ then we have exactly two choices of paths to reach $X_{min}$. So the only thing to check is that these two choices produce the same multiplicities. There are three classes of relevant subspace: \begin{enumerate}[leftmargin=18pt, itemsep=5pt] \item $H=\C^2$. This is relevant iff $X_{min}$ is non-empty, in which case $D^b(X_{min})$ occurs in $D^b(X_{max})$ with multiplicity one for either choice of path. \item $H$ a line, both rays of which are walls. The Higgs GIT for $H$ has two non-empty phases, let $Z_H$ be a minimal one and $Z_H'$ be the other one. By assumption $\det(V)$ doesn't lie on $H$, so if $\lambda_H$ is a primitive normal 1-parameter subgroup to $H$ then $\kappa= |\lambda_H(\det V)|$ is strictly positive. The minimal and maximal chambers lie on opposite sides of $H$ so either choice of path crosses it; one choice contributes $\kappa$ copies of $D^b(Z_H)$ and the other contributes $\kappa$ copies of $D^b(Z_H')$. But the decomposition of $D^b(Z_H')$ includes exactly one copy of $D^b(Z_H)$ so either way the multiplicity of $D^b(Z_H)$ in $D^b(X_{max})$ is $\kappa$. \item $H=\{0\}$. This contributes the factor $D^b(V^T)$, the subspace of $V$ fixed by the whole torus. Consider a line $l \subset L_\R^\vee$ containing at least one weight, let $q_l$ be the sum of the weights on this line, and let $\mu_l = |q_l|$ be the lattice length of $q_l$. There are two possibilities: \begin{enumerate} \item There are weights on both rays of $l$. Then $l$ is a relevant subspace as in case (2), both rays are walls and the Higgs GIT has a non-empty minimal phase $Z_l$. The derived category of the other phase $Z_l'$ decomposes into one copy of $D^b(Z_l)$ and $\mu_l$ copies of $D^b(V^T)$. \item There are only weights on one ray so only that ray is a wall. The Higgs GIT has an empty phase and the other phase decomposes into $\mu_l$ copies of $D^b(V^T)$. \end{enumerate} In either case only one of our two paths will pick up any factors of $D^b(V^T)$ from this line $l$; it's the path that crosses $l$ on the same side as $q_l$, and the number of such factors it picks up is $$ \mu_l \kappa_l = \mu_l |\lambda_l(\det(V))| $$ where $\lambda_l$ is a primitive 1-parameter subgroup normal to $l$. So we may as well assume that each such line contains only a single weight $q_i=q_l$, and hence only that ray of the line is a wall. Now fix an orientation on our lattice $L^\vee$. Since the lattice is rank 2 this is the same as a unit symplectic form $\omega$. This means that for the wall through $q_i$ we can produce a primitive normal subgroup by setting $\lambda = \omega(\hat{q_i}, -)$ where $\hat{q_i}$ is a primitive vector in the direction of $q_i$. With this choice one of our paths always crosses walls in the direction of increasing $\lambda$ and the other path always crosses walls in the direction of decreasing $\lambda$. So if the first path crosses the rays through $q_1, ..., q_s$ and the second path crosses the rays through $q_{s+1}, ..., q_n$ then the equality we want to show is: $$\sum_{i=1}^s \mu_i \lambda_i(\det(V)) = - \sum_{i=s+1}^n \mu_i \lambda_i(\det(V)) $$ But this is true since $$ \sum_{i=1}^n \mu_i\lambda_i = \sum_{i=1}^n \omega( q_i, - ) = \omega(\det(V), -) $$ and $\omega(\det(V), \det(V))=0$. \end{enumerate} \end{proof} Now suppose have have a higher rank problem, and we choose a phase $X$ corresponding to a chamber $C_X$. To run the algorithm we first pick a path from $C_X$ to the chamber for a minimal phase, $C_{min}$, always moving away from $\det(V)$. It doesn't matter which minimal phase we pick since moving between them is a derived equivalence. But there might be many possible paths from $C_X$ to $C_{min}$. To visualize this clearly pass from the secondary fan to the dual `secondary polytope' in $L_\R$. This has a vertex for each chamber, an edge for each wall, and higher-dimensional faces for fans of higher codimension. The element $\det(V)\in L^\vee$ defines a linear function on the polytope and induces a direction on (most of) the edges, since we never allow this function to increase when we traverse an edge. Choose a path, \emph{i.e.} a directed sequence of edges, between the vertices $c_X$ and $c_{min}$ corresponding to the chambers $C_X$ and $C_{min}$. Now pick a polygon $P$ (a two-dimensional face) in the secondary polytope which meets our path; let's say the path meets $P$ at some vertex $c_1$, traverses some edges of the polgon, then leaves it again at $c_2$. If the remaining edges in $P$ also happen to form a directed path then we can produce a new path from $c_X$ to $c_{min}$ by choosing to go the other way around $P$. This is possible iff $c_1$ maximizes $\det(V)$ among vertices of $P$ and $c_2$ minimizes $\det(V)$. Let's call this kind of operation on paths a \emph{simple modification}. \begin{lem}\label{lem.moves} Any two paths from $c_X$ to $c_{min}$ are connected by a sequence of simple modifications. \end{lem} \begin{proof} The secondary polytope is a cell decomposition of an $(r-1)$-sphere, and the subset where $\det(V)\leq \det(V)(c_X)$ is a decomposition of a disc. Any two paths in this disc from $c_X$ to $c_{min}$ are homotopic, and given such a homotopy we can move it orthogonally to $\det(V)$ until it lies in the 2-skeleton of the polytope. We then have a collection of polygons whose boundary is the union of our two paths, with $\det(V)\leq \det(V)(c_X)$ everywhere. We just need to show that we can perform a simple modification to one of our paths at one of these polygons; then the result follows by induction. Choose one of our paths. Let $P_1$ and $P_2$ be the first two polygons this path meets and let $c_1$ be the vertex where the path switches between them. By considering the edge between $P_1$ and $P_2$, and remembering that $\det(V)$ is a linear function on these affine polygons, we can see that either $c_1$ minimizes $\det(V)$ in $P_1$, or else it maximizes $\det(V)$ in $P_2$. In the first case we can modify the path at $P_1$. In the second case we move to the next pair of polygons along the path and repeat the argument. Note that $c_{min}$ certainly minimizes $\det(V)$ in the final polygon so the algorithm terminates there if not before. \end{proof} \begin{proof}[Proof of Theorem \ref{thm.JH}] Pick two paths from the chamber for $X$ to the chamber for a minimal phase, always moving away from $\det(V)$. By Lemma \ref{lem.moves} it's enough to deal with the case when our two paths are related by a simple modification; this means they agree except at a single codimension-two cone $\Lambda$ in the secondary fan where they travel opposite ways around. For every Higgs GIT problem that our paths encounter we also need to make choices, but those GIT problems have lower rank so by induction we can assume that those choices do not matter. Let $U\subset V$ be the semi-stable locus for a character lying on our codimension-two cone. Then we have a GIT problem $T\actson U$ whose phases are exactly those phases of $T\actson V$ whose chambers are adjacent to the cone. This new GIT problem is `non-linear' in that $U$ is not a vector space, and there is an important sense in which it is rank two. If we let $L'\subset L$ be the rank 2 sublattice normal to our codimension-two cone, and $T'\subset T$ be the corresponding subtorus, then only subgroups lying in $T'$ can have fixed points in $U$. It follows that the GIT fan for $T\actson U$ is just the GIT fan for $T'\actson U$, pulled-back via the projection $L^\vee_\R \to (L')^\vee_\R$. So in the region where our two paths differ we can think of them as paths in the GIT fan for $T'\actson U$. And since they are different they both must start in a maximal chamber and end in a minimal chamber. Now consider the linear GIT problem $T'\actson V$. The GIT fan for $T'\actson U$ is a coarsening of the one for $T'\actson V$; every wall of the former is a wall of the latter, but not necessarily vice-versa since a subgroup $\lambda\subset T'$ could have fixed points in $V$ but none in $U$. However, from the point-of-view of our algorithm there is no harm in regarding every wall for $T'\actson V$ as corresponding to a wall for $T\actson U$ - it just happens that some of them will be `fake walls' where the semi-stable locus does not change. In the semi-orthogonal decomposition crossing a fake wall adds some number of copies of the zero category $D^b(U^\lambda /\!/ T) = D^b(\varnothing)$. Note that if both rays of a line are a wall for $T'\actson V$ then either both give genuine walls for $T\actson U$ or both are fake. Also if there are any fake walls then $U^{T'}$ is empty, which means that the codimension-two cone itself also contributes the zero category. If we include these zero categories then we have a bijection between the factors in the decomposition algorithms for $T'\actson V$ and for $T\actson U$, and their multiplicities agree since these depend only on the restriction of the character $\det(V)$ to the subtorus $T'$. Hence the result follows from Lemma \ref{lem.rank2}. \end{proof} \section{FI parameter spaces and discriminants} In this section we consider a \emph{Calabi-Yau} GIT problem $T\actson V$ where $T$ acts through the subgroup $SL(V)$. This has a different flavour to the previous section, since all phases are Calabi-Yau and every wall-crossing is a derived equivalence, so no semi-orthogonal decompositions occur. Instead (as discussed in the introduction) we focus on autoequivalences of the phases and relate these to the fundamental group of the FI parameter space. \subsection{Spherical functors}\label{sec.spherical} Let $T\actson V$ be a Calabi-Yau toric GIT problem. Let $X_+$ and $X_-$ be two phases coming from two adjacent chambers $C_+$ and $C_-$, separated by a wall $W$. Let $Z$ be the phase of the associated Higgs GIT problem for a character lying on $W$. Since $\det(V)=0$, Theorem \ref{thm.toricSOD} tells us that $D^b(X_+)$ and $D^b(X_-)$ are equivalent. However, what the theory actually gives us is a countable set of equivalences $$\Phi_i : D^b(X_+) \isoto D^b(X_-)$$ indexed by the integers. They are related by the Picard groups of $X_+$ and $X_-$. \begin{thm}\cite[Prop. 3.4]{HLSh} There is a spherical functor $$F: D^b(Z) \to D^b(X_+)$$ such that $\Phi_{1}^{-1}\Phi_0$ is the twist around $F$. \end{thm} Recall that the \emph{twist} around $F$ is the endofunctor of $D^b(X_+)$ defined by the cone on the counit $$T_F = [FR \to \id] $$ where $R$ is the right adjoint to $F$, and that the key property of a \emph{spherical} functor is that $T_F$ is an autoequivalence. See \cite{AL} for more detail on spherical functors. Note that this cone of functors makes sense since we can interpret it as a cone of Fourier-Mukai kernels (or insert the prefix `dg' where needed). \vspace{5pt} The variety $Z$ is toric - it's a phase of the Higgs GIT problem - but it will not usually be Calabi-Yau. So using the algorithm of Section \ref{sec.SODs} we can produce a semi-orthogonal decomposition: \beq{eq.ZSOD}D^b(Z) = \SOD{ \mathcal{C}_1,..., \mathcal{C}_r} \end{equation} Halpern-Leistner and Shipman observed that this implies: \begin{enumerate}\item The restriction of $F$ to each piece gives a spherical functor $F_i: \mathcal{C}_i \to D^b(X_+)$. \item The twist $T_F$ factors as: \beq{eq.twistfactors}T_F = T_{F_1}\circ... \circ T_{F_r} \end{equation} \end{enumerate} The formal result is \cite[Theorem 4.14]{HLSh} and it applies in this situation since the cotwist around $F$ is (up to a shift) the Serre functor on $D^b(Z)$. \vspace{5pt} The factors in the semi-orthogonal decomposition \eqref{eq.ZSOD} are indexed by the relevant subspaces in the Higgs GIT problem for $W$, but these are simply the relevant subspaces $H\subset L^\vee_\R$ which are contained in the hyperplane $\langle W \rangle$. \subsection{Discriminants}\label{sec.discriminants} We now recall some of the theory of discriminant loci developed by Gelfand--Kapranov--Zelevinsky \cite{GKZ}. Recall that our GIT problem is specified by a sequence of lattices, exact modulo torsion, or its dual: $$L \stackrel{Q^\vee}{\To} \Z^n \stackrel{A}{\To} N$$ $$M \stackrel{A^\vee}{\To} \Z^n \stackrel{Q}{\To} L^\vee$$ From this point on we need to make two mild additional assumptions: \begin{enumerate}\item We assume that the rays $A(e_i)$ are all distinct. We need this because for \cite{GKZ} $A$ is a subset of $N$. This excludes 1-parameter subgroups acting with weights $(0,...,0, 1,-1,0,...,0)$ but these are very uninteresting from a wall-crossing perspective. \item We assume the weights $Q(e_i)$ are all non-zero. This is just for simplicity. A zero weight just contributes a factor of $\A^1$ to each phase. \end{enumerate} Tensoring our lattices by $\C^*$ gives two exact sequences of tori: $$L_{\C^*} \stackrel{Q^\vee_\times}{\To}(\C^*)^n \stackrel{A_\times}{\To} N_{\C^*}$$ $$M_{\C^*} \stackrel{A^\vee_\times}{\To} (\C^*)^n\stackrel{Q_\times}{\To} L^\vee_{\C^*}$$ The map $A^\vee_\times$ provides us with $n$ characters of the torus $M_{\C^*}$. If we pick a vector of coefficients $a\in \C^n$ we can take a linear combination of these characters, this gives us a Laurent monomial: \al{W_a : M_{\C^*} &\to \C \\ x&\mapsto \langle a, A^\vee_\times(x) \rangle} In explicit coordinates this means $$W_a =\sum_{i=1}^n a_i \prod_{t=1}^m X_t^{A_{it}} $$ where $X_1,..., X_m$ are coordinates on $M_{\C^*}$. This is the \emph{Hori-Vafa mirror} to our toric GIT problem (or abelian GLSM); it's a family of Landau-Ginzburg models parametrized by $a$. Since our GIT problem is Calabi-Yau we can choose co-ordinates such that the first column of $A$ is entirely 1's, hence $$W_a = X_1 \widetilde{W}_a $$ where $X_1$ doesn't appear in $\widetilde{W}_a$. For a generic $a$ the zero locus $W_a$ will be a smooth hypersurface in $M_{\C^*}$. Consider the subset of non-generic $a$, \emph{i.e.} $$ D_A = \left\{ a\in \C^n, \; \exists x\in M_{\C^*} \mbox{ such that } W_a(x)=0\mbox{ and } dW_a(x)=0 \right\}$$ This, or perhaps its closure, is the \emph{discriminant locus} of the family $W_a$. This definition is the correct one for general $A$; since we're in the Calabi-Yau case the first condition is redundant as $\partial_{X_1}W_a=0$ implies $W_a=0$. The closure of $D_A$ is an affine variety, which is always irreducible and usually a hypersurface \cite[Ch.~9]{GKZ}. To understand why this is true observe that $D_A$ is a cone so there is an associated projective variety in $\P^{n-1}$. It's not hard to compute that its projective dual is the closure of the image of $M_{\C^*}$ in $\P^{n-1}$, which is evidently irreducible. But the projective dual to an irreducible variety is always irreducible, and usually a hypersurface \cite[Ch.~1]{GKZ}. If $D_A$ is a hypersurface then we denote its defining polynomial by $\Delta_A$. As well as being a cone $D_A$ is invariant under rescaling the $X_i$ variables, \emph{i.e.} it is invariant under the action of the torus $M_{\C*}$ on $\C^n$. We can replace $D_A$ with the open subset $D_A\cap (\C^*)^n$ - if $D_A$ is a hypersurface this loses no information - and then the quotient by $M_{\C^*}$ is a subvariety: $$\nabla_A \subset L^\vee_{\C*}$$ $D_A$ is a hypersurface iff $\nabla_A$ is, and in this case $\Delta_A$ is really a function on $L^\vee_{\C^*}$. \subsubsection{Horn uniformization}\label{sec.Horn} In the Calabi-Yau case there is a useful dominant rational map $$\P L_\C \dashrightarrow \nabla_A$$ called Horn uniformization, given by: $$[\lambda] \mapsto Q_\times \circ Q^\vee(\lambda) $$ In explicit co-ordinates this says: $$\lambda_1\!:\! ... \!:\! \lambda_r \; \mapsto \; \left( \prod_{i=1}^n \Big( \sum_{k=1}^r Q_{ik}\lambda_k\Big)^{Q_{i1}}\!\!, \; \; ...\; \; , \; \; \prod_{i=1}^n \Big( \sum_{k=1}^r Q_{ik}\lambda_k\Big)^{Q_{ir}} \right) $$ \begin{eg}\label{eg.rank1discriminant} Suppose $L=\Z$ has rank one, and write $(q_1, ..., q_n)$ for the vector of weights. Then by the above $\nabla_A$ consists of the single point $$ q_1^{q_1}... q_n^{q_n} \in \C^*$$ (recall we are assuming that no weights are zero). In particular $\nabla_A$ is a hypersurface and non-empty. \end{eg} Let's explain why this works. We have: $$\partial_{X_s} W_a =\frac{1}{X_s}\sum_{i=1}^n a_i A_{is}\prod_{t=1}^m X_t^{A_{it}} $$ Invariantly, for a fixed $x\in M_{\C^*}$ this says that $dW_a(x)$ is the linear map $$ dW_a(x) : M_\C \To \C $$ given by composing: $$M_\C \stackrel{x^{-1}}{\To} M_\C \stackrel{A^\vee}{\To} \C^n \stackrel{A^\vee_\times(x)}{\To} \C^n \stackrel{a}{\To}\C$$ Here the first map is the action of the element $x^{-1}\in M_{\C^*}$ on $M_\C$, and similarly for the third map. So $dW_a$ has a critical point at $x$ iff $a\circ A^\vee_\times(x)$ annihilates $M_\C$, \emph{i.e.} iff $$a\circ A^\vee_\times(x) = Q^\vee (\lambda)$$ for some $\lambda \in L_\C$. So the image of the map \al{ M_{\C^*} \times L_\C &\To \C^n\\ (x, \lambda) & \mapsto a= \big(A^\vee_\times(x)\big)^{-1}Q^\vee(\lambda) } is the subset where $W_a$ has a critical point, and in the Calabi-Yau case this is exactly $D_A$. Next we compose this with the quotient map $Q_\times: D_A \dashrightarrow \nabla_A$ and observe that $$Q_\times(a) = \big(Q_\times A^\vee_\times(x)\big)^{-1} Q_\times Q^\vee(\lambda) = Q_\times Q^\vee(\lambda)$$ is independent of $x$, since $Q_\times A^\vee_\times(x) =1$. Hence $Q_\times \circ Q^\vee$ is a dominant rational map from $L_\C$ to $\nabla_A$. Finally, the Calabi-Yau condition implies that this map descends to $\P L_\C$. \vspace{5pt} If $\nabla_A$ is a hypersurface it has the same dimension as $\P L_\C$, and in this case Horn uniformization is a birational equivalence \cite[Ch.~9, Thm 3.3]{GKZ}. The inverse is the logarithmic Gauss map. \subsubsection{Components of the discriminant} Recall that the convex hull of the rays $A(e_i)$ is a polytope $\Pi \subset N_\R$, which lies in an affine hyperplane of height 1. Choose a face $\Gamma$ of $\Pi$. Associated to this face there is a Coulomb GIT problem, as described in Section \ref{sec.higgsandcol}. We consider all the rays that lie in this face, and (abusing notation) write $\Gamma\subset\{1,..., n\}$ for the subset that indexes these rays. Then the Coulomb GIT problem is specified by an exact sequence of lattices \beq{eq.LGamma}L_\Gamma \stackrel{Q^\vee}{\To} \Z^\Gamma \stackrel{A_\Gamma}{\To} N_\Gamma\end{equation} where $N_\Gamma$ is the sublattice spanned by the face. We can define a discriminant locus associated to this face in the same way as we did for the whole polytope. For any vector of coefficients $a' \in \C^\Gamma$ there is a Laurent monomial $W'_{a'}$ on the torus $M^\Gamma_{\C^*}$, where $M^\Gamma$ is the dual lattice to $N_\Gamma$. To obtain $W'_{a'}$ from $W_a$ you just delete all the terms that don't correspond to rays on $\Gamma$, then since only some variables remain this function descends from $M_{\C^*}$ to the quotient $M^\Gamma_{\C^*}$. Proceeding as before, we obtain a discriminant subset $D_\Gamma\subset \C^\Gamma$, a subvariety $$ \nabla'_\Gamma \subset (L^\vee_\Gamma)_{\C^*} $$ and its preimage: $$ \nabla_\Gamma \subset (L^\vee)_{\C^*} $$ \begin{rem}\label{rem.notaface} What we've just done works for any subset of the rays, not just the subsets corresponding to faces of $\Pi$. But the faces are the most important. Also note that the Coulomb GIT problems are all Calabi-Yau (Remark \ref{rem.CCY}) so we still have Horn uniformization. \end{rem} Roughly, we are interested in the union of these subvarieties over all faces of $\Pi$. However, some faces don't contribute anything. For example if $\Gamma$ is a simplex then $L_\Gamma=0$ so $\nabla_\Gamma$ must be empty; indeed it's easy to see that $D_\Gamma$ is just the origin in this case. More generally suppose $\Gamma$ contains a ray $A(e_i)$ which is linearly independent of the other rays in $\Gamma$. Then $D_\Gamma$ will be contained in the hyperplane $a'_i=0$ and hence $\nabla_\Gamma$ is empty. If we want to access $D_\Gamma$ then we should try deleting this ray $A(e_i)$; this will give us a subface $\Sigma \subset \Gamma$ with one less ray but with $L_\Sigma = L_\Gamma$. Then $D_\Sigma= D_\Gamma$ under the inclusion $\C^\Sigma \into \C^\Gamma$, but $\nabla'_\Sigma$ might be a non-empty subvariety of the torus $(L^\vee_\Sigma)_{\C^*} = (L^\vee_{\Gamma})_{\C^*}$. This observation leads to us to the following: \begin{defn} \label{def.minimal} A subset $\mathcal{S}\subset\{1,..., n\}$ is \emph{minimal} if, for all $i\in \mathcal{S}$, the ray $A(e_i)$ is linearly dependent on the remaining rays $\{A(e_j), j \in \mathcal{S} \setminus i\}$. A face $\Gamma\subset \Pi$ is \emph{minimal} if the set of all rays lying in $\Gamma$ is indexed by a minimal subset. \end{defn} So a face $\Gamma$ is minimal iff we can remove any ray from $\Gamma$ without making the linear span smaller. Then we define: \begin{defn} The \emph{discriminant locus} $\nabla\subset (L^\vee)_{\C^*}$ is the union of the subvarieties $\nabla_\Gamma$, for each minimal face $\Gamma\subset \Pi$ such that $\nabla_\Gamma$ is a hypersurface. \end{defn} The whole polytope $\Pi$ is minimal since we're assuming that there are no zero weights. If $\nabla_\Pi=\nabla_A$ is a hypersurface then we call it the \emph{principal component} of $\nabla$. \begin{rem} This definition comes from \cite{GKZ}. It is not entirely clear to us why one disregards the subvarieties $\nabla_\Gamma$ which are not hypersurfaces. In the examples we've calculated it makes no difference, \emph{i.e.} each discriminant subvariety of higher codimension is contained in one which is a hypersurface. But we don't know if this is always true. \end{rem} If $\nabla_\Gamma$ is a hypersurface we write $\Delta_\Gamma$ for its defining polynomial, then the product of these cuts out the hypersurface $\nabla$. Gelfand--Kapranov--Zelevinzky modify this by introducing some multiplicities $\mu_\Gamma$ and then taking the product $$E_A = \prod_\Gamma (\Delta_\Gamma)^{\mu_\Gamma}$$ which they call the \emph{principal $A$-determinant} \cite[Ch.~10, 1.B]{GKZ}. The $\mu_\Gamma$'s are not relevant for us but there are two important theorems that they prove that are stated in terms of $E_A$. \begin{thm}\cite[Ch.~10, Thm 1.4]{GKZ}\label{thm.Newtonpolytope} The Newton polytope of $E_A$ is dual to the secondary fan. \end{thm} In fact they give a more precise definition of the \emph{secondary polytope} $\check{\Pi}$ - which is in particular dual to the secondary fan - and their theorem is that the Newton polytope of $E_A$ is $\check{\Pi}$. There is a potential sign confusion here: the theorem is that the cones of the secondary fan are the same as the cones spanned by the inward normal vectors at each vertex of $\check{\Pi}$. Recall that the secondary fan is the fan of the secondary toric variety $\mathfrak{F}$. This is a compactification of $L^\vee_{\C^*}$ so we can consider the closure: $$\overline{\nabla} \subset \mathfrak{F} $$ The theorem above suggests that this is a natural choice of compactification for $\nabla$. In particular it implies: \begin{cor}\label{cor.missesfp} $\overline{\nabla}$ avoids all the toric fixed points in $\mathfrak{F}$.\end{cor} \begin{proof} A fixed point is the origin in one of the toric charts. Each chart corresponds to a vertex of the Newton polytope of $E_A$, and when we write $E_A$ in that chart we get a non-zero constant term. \end{proof} \vspace{5pt} Recall also that phases of our GIT problem correspond to coherent triangulations of the polytope $\Pi$, meaning triangulations induced by a piece-wise linear function \cite{GKZ}. More generally a non-generic stability condition induces a \emph{coherent subdivision} of $\Pi$ where not all the pieces are simplices. Such a stability condition corresponds to a face of the secondary polytope $\check{\Pi}$ whose vertices are the phases refining this subdivision to a triangulation. Suppose we fix a coherent subdivision of $\Pi$, corresponding to a face $\check{\Gamma}\subset \check{\Pi}$. Now choose one of the pieces of the subdivision, it is some polytope $\Sigma_i \subset \Pi$. As usual we abuse notation and also write $\Sigma_i\subset\{1,..., n\}$ for the indexing set of the rays appearing in this polytope. Associated to this subset $\Sigma_i$ we have a Coloumb GIT problem and a corresponding discriminant locus $\nabla_{\Sigma_i}\subset L^\vee_{\C^*}$ (see Remark \ref{rem.notaface}). If $\Sigma_i$ is a simplex this discriminant locus is empty, so it's only worth considering the non-simplicial pieces of our subdivision. Going further we can consider the principal determinant $E_{\Sigma_i}$, which we may view as a function on $L^\vee_{\C^*}$ by pulling-back under the projection $L^\vee\to L_{\Sigma_i}^\vee$. The zero locus of $E_{\Sigma_i}$ consists of the discriminant locus associated to $\Sigma_i$ as well as the discriminant loci coming from all the faces of $\Sigma_i$. On the other hand, Theorem \ref{thm.Newtonpolytope} tells us that the face $\check{\Gamma}$ corresponds to some subset of the monomials appearing in $E_A$. Let us write $(E_A)_{\check{\Gamma}}$ for the sum of this set of monomials. \begin{thm}\cite[Ch.~10, Thm 1.12]{GKZ}\label{thm.EAmultiplies} For some positive integer multiplicities $\mu_i$ and some non-zero constant $\nu$ we have $$(E_A)_{\check{\Gamma}} = \nu \prod_{i} \left(E_{\Sigma_i}\right)^{\mu_i}$$ where the product runs over the non-simplicial pieces of the subdivision. \end{thm} In fact we only care about one special case of this theorem: the case when $\check{\Gamma}$ is an edge of $\check{\Pi}$. Such an edge connects two phases, and corresponds to a wall $W$ in the secondary fan. In the secondary toric variety $\mathfrak{F}$ the phases correspond to toric fixed points, and the wall $W$ (or edge $\check{\Gamma}$) corresponds to a toric rational curve $$C_W \subset \mathfrak{F}$$ connecting the two fixed points. We discussed this in Section \ref{sec.multsintro}. \begin{cor}\label{cor.onepointinCW} The discriminant locus $\overline{\nabla}$ intersects $C_W$ in exactly one point. \end{cor} \begin{proof} The intersection of $\overline{\nabla}$ with $C_W$ is the zero locus of the restriction $E_A|_{C_W}$ and this restriction is the sum $(E_A)_{\check{\Gamma}}$ of the monomials appearing in the edge $\check{\Gamma}$. This edge corresponds to a coherent subdivision of $\Pi$ which has exactly one non-simplicial piece $\Sigma$, having two possible triangulations. By Theorem \ref{thm.EAmultiplies} the zero locus of $(E_A)_{\check{\Gamma}}$ agrees with the zero locus of $E_{\Sigma}$. But the zero locus of $E_\Sigma$ is the discriminant locus for Coloumb GIT problem associated to $\Sigma$. This GIT problem has $\rank L_\Sigma = 1$ so by Example \ref{eg.rank1discriminant} its discriminant locus is a single point. \end{proof} In Lemma \ref{lem.intersection} below we will refine this result by identifying which components of $\overline{\nabla}$ can intersect with $C_W$. \subsection{Faces and subspaces} In Section \ref{sec.relevantsubspaces} we discussed \emph{relevant subspaces} in $L^\vee_\R$, these index the factors appearing in our SODs. In this section we show that relevant subspaces biject with minimal faces of the polytope $\Pi$; this is an elementary observation but crucial for formulating our conjecture. \vspace{5pt} \begin{comment} Let $H\subset L^\vee_\R$ be a subspace and let $q_1,.., q_h\in H$ be the weights lying in $H$. Recall that $H$ is relevant if the cone spanned by these $q_i$'s is the whole of $H$. \begin{lem}\label{lem.relevant} $H$ is relevant iff $H$ is spanned by $\{q_i\}$ and there exist positive integers $k_1,..., k_h$ with: $$k_1q_1 + ... + k_h q_h = 0 $$ \end{lem} \begin{proof} If $H$ is relevant then the vector $-\sum q_i$ is a non-negative linear combination of the $q_i$'s, hence the required strictly positive relation holds. Conversely if the $q_i$'s span $H$ and there is such a relation then any vector in $H$ can be written as a non-negative linear combination of the $q_i$'s. \end{proof} \end{comment} \begin{comment} MUCH OF THE FOLLOWING NOW IN BACKGROUND Now consider a subset $S\subset \{1,..., n\}$ and its complement $S^c$. We will view both $S$ and $S^c$ as subsets of the standard basis vectors in $S^n$. We can also consider the corresponding sets of rays $A(S), A(S^c)\subset N$, or the sets of weights $Q(S), Q(S^c) \subset L^\vee$. For example we could pick a face $\Gamma\subset \Pi$ and choose $S$ such that $A(S) $ is the set of rays in $\Gamma$ - in this case we'll abuse notation and just write $S=\Gamma$. The relations between the rays $A(S)$ form a lattice $$L_S = L \cap \Z^S$$ which is the kernel of the map $A: \Z^S \to N $ (as in \eqref{eq.LGamma}). We also consider the subspace $$H_S = \big\langle Q(S^c) \big\rangle \subset L^\vee_\R $$ spanned by the complementary set of weights. By elementary linear algebra these two things are related by a short exact sequence, the right-hand side of the diagram: \begin{center} \begin{tikzcd} & \R^{S^c} \arrow[r]\arrow{d} & H_S \arrow{d}\\ N^\vee_\R \arrow[r, "A^\vee"] & \R^n \arrow[r, "Q"] \arrow[d] & L^\vee_\R \arrow[d] \\ & \R^S \arrow[r] & (L_S^\vee)_\R \end{tikzcd} \end{center} The three horizontal arrows in the two squares above are all surjections. \end{comment} Consider a subset $\mathcal{S}\subset \{1,..., n\}$ and its complement $\mathcal{S}^c$. Let's consider the Coloumb GIT problem associated to $\mathcal{S}$ and the Higgs GIT problem associated to $\mathcal{S}^c$ (Section \ref{sec.higgsandcol}). These are related by the following diagram: \beq{eq.higgscoloumb} \begin{tikzcd} M_{\mathcal{S}^c} \arrow[r, "A_{\mathcal{S}^c}^\vee"] \arrow[d] & \Z^{\mathcal{S}^c} \arrow[r, "Q_{\mathcal{S}^c}"]\arrow[d] & L_{\mathcal{S}^c}^\vee \arrow[d]\\ M \arrow[r, "A^\vee"]\arrow[d] & \Z^n \arrow[r, "Q"] \arrow[d] & L^\vee \arrow[d] \\ M_\mathcal{S} \arrow[r, "A_\mathcal{S}^\vee"] & \Z^\mathcal{S} \arrow[r, "Q_\mathcal{S}"] & L_\mathcal{S}^\vee \end{tikzcd} \end{equation} The middle column is obviously exact, the other columns are exact modulo torsion. Let us also write $$H_{\mathcal{S}^c} \;\subset L^\vee_\R $$ for the subspace spanned by $L_{\mathcal{S}^c}^\vee$. As a special case we could consider a face of the polytope $\Pi$ and let $\Gamma$ be the indexing set for the rays on that face. Then we get an associated subspace $H_{\Gamma^c}\subset L^\vee_\R$. \begin{prop}\label{prop.minimaltorelevant} The map $\Gamma \mapsto H_{\Gamma^c}$ is a bijection between the minimal faces of $\Pi$ and the relevant subspaces of $L^\vee_\R$. \end{prop} \begin{proof} Recall from Definition \ref{def.minimal} that a subset $\mathcal{S}\subset\{1,..., n\}$ is called minimal if the set of rays $A(\mathcal{S})\subset N$ has the property that every ray in $A(\mathcal{S})$ is linearly dependent on the remaining rays in $A(\mathcal{S})$. This is the statement that no basis vectors map to zero under the map $\Z^\mathcal{S} \to L_\mathcal{S}^\vee$, or equivalently that the only weights lying in $H_{\mathcal{S}^c}$ are $Q(\mathcal{S}^c)$. Conversely, pick a subspace $H\subset L^\vee_\R$ which is spanned by the weights it contains, and let $\mathcal{S}$ be the set of weights which do not lie in $H$. Then $H=H_{\mathcal{S}^c}$ and $\mathcal{S}$ is minimal. Hence the assignment $\mathcal{S}\mapsto H_{\mathcal{S}^c}$ is a bijection between the minimal subsets of $\{1,..., n\}$ and the subspaces of $L^\vee_\R$ which are spanned by the weights they contain. It follows immediately from part (ii) of Definition/Lemma \ref{defn.relevant} that the subspace $H_{\mathcal{S}^c}$ is relevant iff there is a vector $k\in\Z^{\mathcal{S}^c}$ with strictly positive entries which maps to zero under $Q$. Such a vector is exactly an element $k\in N^\vee$ such that $k(A(e_i))=0$ if $i\in \mathcal{S}$ and $k(A(e_i))>0$ if $i\in \mathcal{S}^c$. Since the polytope $\Pi$ lives in an affine hyperplane of height 1, the existence of such a $k$ is the statement that $\mathcal{S}$ is all the rays on a face of $\Pi$. \end{proof} The zero subspace $H={0}$ is always relevant, and since we assume there are no zero weights it corresponds to the whole polytope $\Pi$. The empty set is a face of $\Pi$ (in the sense of the above proof), it corresponds to the subspace $H=L^\vee_\R$ which is therefore relevant. \subsection{The conjecture} Let $W$ be a wall separating two chambers in the secondary fan. Recall that we have the following two objects associated to $W$: \begin{enumerate} \item A toric variety $Z_W$. The wall $W$ has an associated Higgs GIT problem, and $Z_W$ is the phase of this problem coming from a character on the relative interior of $W$. \item A toric rational curve $C_W$ in the secondary stack. $W$ is a codimension 1 cone in the secondary fan and $C_W$ is the associated curve. \end{enumerate} We can decompose $D^b(Z_W)$ using the algorithm of Section \ref{sec.SODs}, and the factors that appear are indexed by the relevant subspaces $H\subset L^\vee_\R$ contained in the hyperplane $\langle W \rangle$. Each such subspace defines a Higgs GIT problem with a non-empty minimal phase $Z_H$, and by Theorem \ref{thm.JH} the multiplicity of $D^b(Z_H)$ in $D^b(Z_W)$ is well-defined. \vspace{5pt} Relevant subspaces correspond (by Proposition \ref{prop.minimaltorelevant}) to minimal faces $\Gamma$ of the polytope $\Pi$, and these in turn index the components of the discriminant locus. As discussed in Section \ref{sec.multsintro} we are interested in the intersection of $\overline{\nabla}_\Gamma$ with the curve $C_W$. \begin{lem}\label{lem.intersection} Let $\Gamma$ be a minimal face. If $H_{\Gamma^c}$ is not contained in $W$ then $\overline{\nabla}_\Gamma$ doesn't meet the curve $C_W$. \end{lem} \begin{proof} Consider the projection map $$\pi: L^\vee \to L_\Gamma^\vee$$ or its real version $L^\vee_\R \to (L_\Gamma^\vee)_\R$, whose kernel is $H_{\Gamma^c}$. This map takes a stability condition for the original GIT problem and restricts it to give one for the Coloumb GIT problem associated to $\Gamma$. If we take a chamber of stability conditions and restrict them then they will all lie in a single chamber for the Coloumb GIT problem (if two stability conditions induce the same triangulation of $\Pi$ then they evidently induce the same triangulation of the face $\Gamma$). This says that $\pi$ is a map of fans, between the secondary fan for the original problem and the secondary fan for the Coloumb problem, hence it induces a toric morphism $$\pi: \mathfrak{F} \to \mathfrak{F}_\Gamma$$ between the two secondary toric varieties. Recall that $\nabla_\Gamma$ is defined as the preimage of the discriminant locus $\nabla'_\Gamma \subset (L_\Gamma)^\vee_{\C^*}$ under the projection $\pi: (L^\vee)_{\C^*} \to (L_\Gamma)^\vee_{\C^*}$. Since $\pi$ extends to the toric boundary we can also say that $\overline{\nabla}_\Gamma \subset \mathfrak{F} $ is contained in the preimage of $\overline{\nabla'}_{\Gamma} \subset \mathfrak{F}_\Gamma $. The wall $W$ is a codimension 1 cone in $L^\vee$. If it doesn't contain $H_{\Gamma^c}$ then $\pi(W)$ is a top-dimensional cone in $L_\Gamma^\vee$ so $\pi(C_W)$ is one of the toric fixed points in $\mathfrak{F}_\Gamma$. Corollary \ref{cor.missesfp} says that $\overline{\nabla'}_{\Gamma}$ avoids all the toric fixed points hence $\overline{\nabla}_\Gamma$ misses $C_W$. \end{proof} \begin{conj}\label{conj.mainconj} Let $W\subset L^\vee_\R$ be a wall, let $\Gamma\subset \Pi$ be a minimal face and let $H=H_{\Gamma^c}$ the corresponding relevant subspace. Assume that $H\subseteq \langle W \rangle$. Write \begin{enumerate}\setlength{\itemsep}{5pt} \item[] $n_{\Gamma, W}$ for the multiplicity of $D^b(Z_H)$ in $D^b(Z_W)$, and \item[] $m_{\Gamma, W}$ for the intersection multiplicity of $\overline{\nabla}_\Gamma$ with $C_W$. \end{enumerate} Then $n_{\Gamma, W} = m_{\Gamma, W}$. \end{conj} \begin{rem} We could allow the case when $H$ doesn't lie in $\langle W \rangle$: then $D^b(Z_H)$ is not a factor in $D^b(Z_W)$ so we should set $n_{\Gamma, W}=0$, and by Lemma \ref{lem.intersection} $m_{\Gamma, W}=0$ also. \end{rem} We will now prove various special cases of this conjecture. The most straight-forward case is when $\rk L_\Gamma =1$ so $H$ is a hyperplane, hence $H=\langle W \rangle$. \begin{prop}\label{prop.H=W} If $\rk L_\Gamma =1$ then $n_{\Gamma, W} = m_{\Gamma, W} = 1$. \end{prop} \begin{proof} In this case $Z_H$ is the minimal phase for the Higgs GIT problem that produces $Z_W$, so $n_{\Gamma, W}=1$. As in Lemma \ref{lem.intersection} we consider the map $\pi: \mathfrak{F} \to \mathfrak{F}_\Gamma$. This map induces an isomorphism from $C_W$ to $\mathfrak{F}_\Gamma$. The discriminant locus $\nabla'_\Gamma\subset \mathfrak{F}_{\Gamma}$ is a single non-fixed point (Example \ref{eg.rank1discriminant}) and $\overline{\nabla}_\Gamma$ is its pre-image, as a divisor on $\mathfrak{F}$. So intersecting this divisor with $C_W$ gives $m_{\Gamma, W}=1$. \end{proof} \begin{rem} This proposition includes the case when $L$ itself has rank 1 and hence $H=W$ is the origin. This is a vacuous case of our conjecture: $C_W$ is the whole of $\mathfrak{F}$, there is only the principal component of $\overline{\nabla}$ which is a single point, $Z_W$ is a point, and the decomposition of $D^b(Z_W)$ is trivial. \end{rem} We can get a less trivial special case by increasing the rank by one. \begin{prop} \label{prop.rank2} If $\rank L_\Gamma =2$ then $n_{\Gamma, W} = m_{\Gamma, W}$. \end{prop} \begin{proof} In this case $H$ is a hyperplane in $\langle W \rangle$. Since the projection $\pi: L^\vee \to L^\vee_\Gamma$ is a map of fans $\pi(W)$ must be a ray, so $W$ must lie completely on one side of $H$. Pick a primitive one-parameter subgroup $\lambda$ normal to $W$, then the GIT problem producing $Z_W$ consists of the vector space $V^{\lambda}$ - these are weights that lie in $\langle W \rangle$ - acted on by the torus $T/\lambda$. Then $H$ is normal to some primitive one-parameter subgroup $\mu \in L/\langle\lambda\rangle$ and we orient $\mu$ so that it pairs positively with $W$. Recall that $Z_W$ is defined to be the phase associated to a generic character in $W$, so such a character pairs positively with $\mu$. For the decomposition of $D^b(Z_W)$ the important quantity is $$\kappa \;=\; (\det V^\lambda)(\mu) \;=\; \sum_{\mathrm{weights}\, q_i \in \langle W \rangle } q_i(\tilde{\mu}) $$ for any $\tilde{\mu}\in L$ lifting $\mu$, and $$n_{\Gamma, W} = \max\{ \kappa, 0\}$$ (see Remark \ref{rem.mult}). Now we compute the intersection multiplicity $m_{\Gamma, W}$. To start with, let's assume that $\Gamma=\Pi$ so $L$ itself has rank 2 and $H$ is the origin. Then we wish to compute the intersection multiplicity of the principal component $\overline{\nabla}_A$ with the boundary curve $C_W$. To do this we use the Horn uniformization map $$\P(L_\Gamma)_\C \dashrightarrow \overline{\nabla}_A $$ from Section \ref{sec.Horn}, which in this case is actually a morphism since $\P(L_\C) \cong \P^1$. In explicit co-ordinates, as a rational map to $(\C^*)^2$, this is given by: $$\lambda_1: \lambda_2 \;\mapsto \; \left( \prod_{i=1}^n \Big( Q_{i1}\lambda_1 + Q_{i2}\lambda_2\Big)^{Q_{i1}}\!\!, \; \; \prod_{i=1}^n \Big( Q_{i1}\lambda_1 + Q_{i2}\lambda_2\Big)^{Q_{i2}} \right) $$ Without loss of generality we may assume that $W$ is the ray through $(1,0)$. This ray in the secondary stack corresponds to a partial compactification of the torus $(\C^*)^2$, the subset: $$\C \times \C^* \subset \mathfrak{F}$$ The subset where the first co-ordinate is zero is $C_W$ with its fixed points deleted. Since $\overline{\nabla}_A$ avoids the fixed points the only way that $\lambda_1\!:\!\lambda_2$ can map to $C_W$ is if there exists an $i$ such that $Q_{i1}\lambda_1 + Q_{i1} \lambda_2 = 0$ and $Q_{i2}=0$, hence $\lambda_1\!:\!\lambda_2=0\!:\!1$. Then the intersection multiplicity is given by $$\sum_{i|\, Q_{i2}=0} Q_{i1}$$ if this sum is strictly positive, and zero otherwise. But these rows of $Q$ are precisely the weights $q_i$ that lie on $\langle W \rangle$, and we may set $\tilde{\mu}=(1,0)^\top$, so this sum is $\kappa$ and hence $m_{\Gamma, W}=n_{\Gamma, W}$ in this case. To finish we must compute $m_{\Gamma, W}$ for $\rank L_{\Gamma}=2$ but $\Gamma \varsubsetneq \Pi$. Once again we use the projection $\pi: \mathfrak{F} \to \mathfrak{F}_{\Gamma}$. It maps $W$ to a wall $W'$ for the rank 2 GIT problem, and hence it maps $C_W$ isomorphically (at least away from its fixed points) onto the boundary curve $C_{W'} \subset \mathfrak{F}_{\Gamma}$. Since $\overline{\nabla}_\Gamma$ is the preimage of $\overline{\nabla'}_{\Gamma}\subset \mathfrak{F}_{\Gamma}$ it is enough to compute the intersection multiplicity of $\overline{\nabla}_{\Gamma}$ with $C_{W'}$ inside the two-dimensional space $\mathfrak{F}_{\Gamma}$. But this was the calculation we just performed, and the result is still $\max\{\kappa, 0\}$ since $q_i\in \langle W\rangle$ iff $\pi(q_i)\in \langle W' \rangle$. \end{proof} \begin{rem}The above result and its proof are quite close to \cite[Prop. 4.4.]{HLSh}.\end{rem} \begin{thm}\label{thm.rank2} If $\rank L =2$ then Conjecture \ref{conj.mainconj} holds. \end{thm} \begin{proof} The wall $W$ is a ray and there are only two possibilities for $H$: either $H=\langle W \rangle$ (if this is a relevant subspace) or $H={0}$. The first case is covered by Proposition \ref{prop.H=W} and the second by Proposition \ref{prop.rank2}. \end{proof} The main obstacle to extending our proofs to higher rank is the fact that Horn uniformization may no longer be a morphism so it becomes harder to compute the intersection multiplicity $m_{\Gamma, W}$. However in special cases it is still possible to verify the conjecture - see \cite[Sect.~10.2]{Kite} for some more examples. \bibliographystyle{halphanum}
\section{Proposed Approach} \label{sec:approach} \vspace{-0.4cm} Face detection is the process of identifying image areas containing faces. Face recognition refers to matching the detected face to the reference. Thus face detection is the initial stage of recognition. The first limitation for a good face detection is the range of detection. The size of the faces in images restrict the detections and faces seen from far are not detectable. To check the performance of face detection at different distances, we performed an empirical study similar to~\cite{hsu2015face} and obtained similar results. Specifically, in Figure~\ref{fig:prob} we plot the probability of obtaining a detection with respect to the distance maintaining a constant height of eye level. It can be observed that the performance degrades quickly after about \SI{3}{\metre}. In order to navigate the UAV into the zone of face detections we employ person following approach described in the preceding sections. \vspace{-0.6cm} \begin{figure} \centering \includegraphics[width=0.7\textwidth]{figures/depth_range_prob.jpg} \caption{ Probability histogram for person detections at various distances from \SI{1}{\metre} to \SI{6}{\metre}}. \label{fig:prob} \end{figure} \vspace{-0.7cm} The second limitation for obtaining a good face image is posed by the quality of the detected face. According to a study~\cite{nuero}, the recommendation for face recognition in images are 32 pixels minimal distance between the eyes and 64 pixels for a better accuracy. These distances are determined by the quality of images as well as the distance at which they were captured. Although there have been efforts to increase the quality of sensors on UAVs, streaming with limited bandwidth introduces compression artifacts. The individual video frames and images are also affected by the velocity and movement of the sensor due to motion artifacts. Face detection algorithms perform reliably until a critical value of compression below which they degrade significantly~\cite{Korshunov:2011:VQF:2000486.2000488}. Further changes in illumination and pose variations make the process more challenging. In this paper we aim to minimize the pose variations seen by the UAV. Through continuous assessment of facial pose, we adjust the flight path to obtain an optimized view of face for a given image quality once it is above the face detection threshold. The overview of our algorithm is described in Figure~\ref{fig:flowchart}. The communication from the UAV is established using ROS (Robot Operating System). The detector nodes subscribe to the high resolution onboard video feed. The frequencies of all the components of the architecture is listed in~\ref{table}. The pedestrian detector is concatenated with the tracker to increase the frequency of person detections. The bounding box obtained from the person detection is used to approximate the distance of the camera from the person. The PD controller issues the control signals based on the estimated distance to drive the UAV into the zone of face detections. For every detection obtained by the face detector node, an assessment on the face quality in terms of pose is performed and a frontalisation error is calculated. The error is used to navigate the UAV to th region of optimized face detections. \vspace{-0.7cm} \subsection{System Design} \begin{enumerate} \vspace{-0.4cm} \item Parrot Bebop : Out of the several commercially available UAVs, Bebop Parrot is relatively safe to operate around humans. It has a dual core processor with quad-core GPU, 8GB flash memory, and GPS. Connectivity is via Wi-Fi, and max operating distance is 1 mile. Therefore, it is mainly designed for outdoor flight. The on-board camera has 14 mega-pixels with a fish-eye lens. The on-board image resolution is $1920\times 1080$ (1080P). The streamed video has a resolution of $640\times 368$. Since the image quality is a critical factor, we resort to onboard images that have lower frequency but higher resolution. Although the high definition onboard images lowers the frame rate, the detection rate doesn't scale down. With greater resolution the chances of obtaining a detection on every frame increases. Bebop is a hobby grade UAV and is not very bulky. It also comes with safety bumpers making it suitable for indoor flight. \item Data collection: We performed data collection in two stages. For the first stage, we collected data for drawing the correlation between the bounding box height obtained from person detection to the distance of person from the camera. The ground truth for the distance was obtained using April tag~\cite{olson2011tags} attached to the person. The UAV was manually moved around the person at different distances and the corresponding detections were recorded. In the second set of experiments, the same procedure was repeated but now the UAV was moved in concentric circles with varying radius. For different orientations of the camera from the frontal face and at different radii, the average frontalization error was obtained. Further, in order to compare our results with recognition accuracy, we used the probabilistic study on face recognition using Kinect 2.0 RGBD camera. The orientation of camera ranging from $-90$$^{\circ}$ to $+90$$^{\circ}$ from the frontal face and radius up to \SI{5}{\metre} was covered. The performance accuracy of face recognition using Fischer faces \cite{Belhumeur:1997:EVF:261506.261512} was evaluated for the various poses. \end{enumerate} \vspace{-0.7cm} \begin{figure} \centering \subfloat[Overview of the active face alignment system. The video feed and the odometry readings are the sensor readings obtained from Bebop. The input to the UAV are the control commands generated by a PD controller.]{ \includegraphics[width=0.7\textwidth]{figures/overview_new.png}\label{fig:flowchart}}% \qquad \newline \subfloat[Table listing the frequencies of various nodes during the flight ]{% \begin{tabular}{| p{0.2\textwidth} p{0.2\textwidth} p{0.3\textwidth} p{0.2\textwidth} p{0.2\textwidth} |} \hline \\ Onboard Images & Odometry & Pedestrian Detector & Tracker & Face detector \\ \hline \\ \SI{1.75}{\hertz} & \SI{5}{\hertz} & \SI{0.9}{\hertz} & \SI{1.4}{\hertz} &\SI{1.4}{\hertz}\\ \hline \end{tabular} \label{table} } \caption{System Overview} \label{fig:overview} \end{figure} \vspace{-0.4 cm} \subsection{Person Detection and Tracking } \label{hum det} \vspace{-0.4cm} Person detection and tracking using vision based cues has received some research attention in the past. With the focus on making identification more reliable, in this work we mainly design a simple approach using off-the-shelf, open-source detectors. The pre-trained pedestrian detector in OpenCV~\cite{pedestrian} is used detect people even in cluttered environment. The HoG features trained on linear SVM detects people in a video stream with very few false positives. However, the detector has relatively lower frequency compared to the incoming video stream as listed in {Table~\ref{table}}. Therefore, in order to bridge the gap between two detectors, we use object tracking. Many state-of-the-art trackers have been proposed previously~\cite{babenko2009visual,felzenszwalb2010object,kalal2012tracking,ma2015hierarchical}. However, for deformable objects, e.g. humans, it is still a challenging problem. In this work, we employ~\cite{nebehay2015clustering} for tracking people. CMT is a key-points based deformable part model. A set of keypoints are initially selected from the object to be tracked. At every time instant, the keypoints from the previous frames are matched and the consensus of the points are used select object being tracked. CMT is initialized with bounding box from the detector as shown in Figure~\ref{fig:flowchart} . After every detection, CMT is updated with the bounding box. This cascade of the detector and tracker works efficiently with very few false detections. In order to translate the position of person in image frame to the UAV frame, we make use of the dimensions of the bounding box. The center of the bounding box is aligned with the center of the image thus keeping the person in line of sight. Further, to estimate the depth of the camera from the person, we make use of the height of the bounding box. In Figure~\ref{fig:depthheight}, we plot the correlation of depth with the height of the detected bounding box using the ground truth from the AprilTags. The correspondences of the box height with the depth is approximated to be linear. At any instant of time, the estimation of depth is used to obtain the heading. Thus the UAV can be lead into the zone of face detections. \vspace{-0.7cm} \begin{figure} \centering \includegraphics[width=0.7\textwidth,height=0.3\textheight]{figures/correlation_highdef.jpg} \caption{ Height of bounding box obtained from the pedestrian detection observed at various distances of person from the camera mounted on UAV. The correlation of the bounding box height and the distance is approximated to be linear ignoring the outliers. } \label{fig:depthheight} \end{figure} \vspace{-0.3cm} \subsection{ Active Face Quality Assessment } \label{visibility} \vspace{-0.4cm} The general automated face recognition pipeline involves face detection, face alignment, feature extraction and feature matching~\cite{facerecognition}. In a realistic scenario, the chances of detected faces to be frontal are slim. Therefore, the pose variant faces are synthesized to give a frontal view of the face. Tal Hassner et.al.~\cite{DBLP:journals/corr/HassnerHPE14} propose a face frontalization technique that uses a fixed reference 3D model. The open source face detector from the DLIB library~\cite{dlib09} is used for cropping faces from the background. As we focus on images captured from relatively low altitudes, we can safely claim that the HoG-based features can distinguish human faces through contrast. The frontalization is carried out by first detecting certain facial features and projecting the corresponding pixel intensities from 2D space to fixed reference 3D model of face. In order to account for the occlusions and pose variations, the authors use visibility scores originally used by 3D reconstruction methods~\cite{791235},~\cite{ZPQS05}. The visibility score for each pixel in the projected 3D surface $q$ is then estimated to be: \begin{equation} v(q)=1-exp(-N_q) \label{visibility} \end{equation} Here $N_q$ is the number of times a query pixel $q$ is accessed while forming correspondence of the 2D query image pixel with the reference 3D surface. As the face turns away from the camera increasing the angle, fewer pixels in the query image are mapped to the 3D pixels, hence reducing the visibility of the region facing away. \begin{figure} \centering \includegraphics[width=0.8\textwidth]{figures/heatmap.png} \vspace{-0.2cm} \caption{Heat map showing the visibility at each pixel in different orientations of face.} \label{fig:heatmap} \end{figure} Figure~\ref{fig:heatmap}. displays the visibility on surface of faces in three different poses captured during flight. The face detection algorithms renders a tight bounding box around all the pixels that constitute face. Since the frontalization is preceded by the person following controller, we make sure that the center of the detected face is aligned to the center of the UAV frame though visual servoing. The gradient of visibility gives a crude estimate regarding the part of the face facing the camera. We define a frontalization error as the difference between the average visibility scores of right half pixels and average visibility scores of left half pixels of face. Thus the frontalisation error is : \begin{equation} Frontalisation~error = \frac{\sum_{q=R_q}^{} v_q}{R_q} -\frac{\sum_{q=L_q}^{} v_q}{Lq} \end{equation} Here $R_q$ are the right pixels and $L_q$ are the left pixels. \vspace{-0.7cm} \subsection{Face Verification} \vspace{-0.4cm} In order to analyze the effectiveness of the proposed approach in the face recognition pipeline, we perform face verification along the flight path. The faces captured throughout the flight path must show an increasing similarity to the frontal face. Facial biometrics are highly expressive and diverse. Convolutional neural networks show capacity to deliver an intricate representation of images. The deep cascade of layers give a high level representation of faces. This representation of faces can be used for a one-to-one comparison of face against a registered face. In this paper, we used the Deep CNN architecture VGG-16 proposed by~\cite{DBLP:journals/corr/HassnerHPE14} to extract the features from the detected face. The architecture as depicted in Figure~\ref{fig:vgg} consists of series of convolutional layers and max-pooling layers followed by the fully connected layer and soft-max layer. The convolutional layer extracts features using a sliding window convolving over patches of the image. The intermediate pooling layers are used to sub sample the features. The last three fully connected layers are similar to the general neural network architecture. The network is pre-trained on ImageNet dataset~\cite{imagenet_cvpr09} consisting of 15 million images of various objects. The features from the third fully connected layer is used for representing face. In biometrics, a similarity measure between the registered image and the query image is used for verification. Higher similarity of the query face indicates more confidence of the person being verified. The cosine similarity for any two vectors A and B is calculated as follows: \begin{equation} CS(A,B)=\frac{A.B}{||A|| ||B||} \label{cosine similarity} \end{equation} The face verification scheme based on cosine similarity is represented in Figure~\ref{fig:face_ver}. Face recognition is simply face verification over all the registered users. However in our experiments, we perform face verification for a single user as the multi-user verification requires a large database of registered users. \vspace{-0.7 cm} \begin{figure} \centering \includegraphics[width=0.8\textwidth]{figures/Face_Verification.jpg} \caption{A generic CNN based verification system consists of face detection,face alignment, feature extraction followed by similarity matching} \label{fig:face_ver} \end{figure} \vspace{-1cm} \begin{figure} \centering \includegraphics[width=0.7\textwidth]{figures/vgg16.png} \caption{The figure describes the VGG-16 architecture, a network used to extract features for faces from a high dimensional representation of images.} \label{fig:vgg} \end{figure} \vspace{-1cm} \subsection{Vision Based Controllers} \label{controller} \vspace{-0.4cm} An overview of the system is shown in Figure\ref{fig:controller}. The control architecture consists of two distinct parts that both take visual cues from the on-board camera to produce motion commands. When no faces are detected, the first controller looks for people in the image and approaches them. Once the UAS is close enough to reliably detect a face, a fontalization controller takes over. \begin{figure} \centering \subfloat[The architecture for the proposed person following controller ]{ \includegraphics[width=0.8\textwidth]{figures/controller1.png}\label{fig:controller1}}% \qquad \newline \subfloat[The controller architecture for the frontalisation error based visual servoing. The cascade of controllers is represented by a high frequency inner odometry loop and a low frequency outer observation loop.]{ \includegraphics[width=0.8\textwidth]{figures/controller2.jpg}\label{fig:controller2} \caption{The overview of the vision based controllers} \label{fig:controller} \end{figure} \vspace{-0.7cm} \subsubsection{Person Following Controller} \vspace{-0.3cm} Our person following module navigates the UAV into the region with higher probability of face detection. The first person detection seen by the UAV initiates the take-off. After the initialization, the aim is to head towards the person keeping the person in the center of the frame. The upper segment of the controller illustrates the person following controller. From the bounding box detected, two features are calculated, the height of the bounding box and the center of the bounding box. The height is used for estimating the depth as explained in Section~\ref{hum det}. The UAV moves progressively towards the person with a continuous estimation of depth. As UAV flies directly at the person, we always maintain a minimum distance of \SI{1.5}{\metre} for safety. Further, to center the UAV with respect to the person, we align the center of the detection with the center of the image in the pixel space by issuing the yaw commands. Person following thus reduces the distance of the camera from the person increasing the chances of face detections. In the next section, we define the controller design for active face frontalization. \vspace{-0.7cm} \subsubsection{Visual Servoing on Frontalization Error} \vspace{-0.3cm} Owing to the small range of operation for the active face frontalization, the inputs for the face frontalization unit are a set of waypoints through the course of flight path. The system with a cascade of controllers is illustrated in the Figure~\ref{fig:controller2}. From the detected face, the frontalization error is calculated as explained in Section~\ref{visibility}. A setpoint or the target point for the UAV is set based on the fronatlization error. Based on the current odometry of the UAV and the desired setpoint, the PD controller issues velocities about the longitudinal and lateral axis of the UAV. However, the frequency of the odometry is much higher than the face detections. Therefore, in the inner loop, with every estimate of current odometry and the desired setpoint, the PD controller issues a new velocity command. However the setpoint is updated as and when a face is detected in the outer loop. The outer loop also sets the yaw for the UAV creating a circling movement around the face. The yaw is issued based on the difference between the center of the face and the center of the image. This way the UAV is oriented towards the detected face. \vspace{-0.5cm} \section{Section Heading} \end{document} \section{Conclusion} \vspace{-0.2cm} The contribution of this paper is twofold. Firstly, we provide an autonomous biometric information gathering system based on UAVs. Although literature suggest research aiming to incorporate face technology with UAVs. We make the first attempt of actively assessing biometric data on UAVs as it is gather and to improve the quality of the gathered information. We make use of soft biometric cues to implement autonomy of motion useful to a particular class of applications like UAV surveillance and photography. Secondly, we introduce frontalization error derived from the existing methods that can be used online for adjusting flight paths to improve the image quality to aid verification. Through experimentation we show that the proposed approach leads to a better quality of faces images for recognition. We present a inexpensive consumer system that is modular and can be adapted to any ROS enabled UAV platform. The software components are also off-the-shelf and could likely be adapted improve the overall system performance. \vspace{-0.3cm} \begin{acknowledgement} This material is based upon work supported by the National Science Foundation under Grant IIP \#1266183. We are grateful to the CSE Department of University at Buffalo for supporting Nagashri N L and Yifang Liu. \end{acknowledgement} \vspace{-0.8cm} \part{Part Title} \noindent Use the template \emph{part.tex} together with the Springer document class SVMono (monograph-type books) or SVMult (edited books) to style your part title page and, if desired, a short introductory text (maximum one page) on its verso page in the Springer layout. \end{partbacktext} \section{Section Heading} \label{sec:1} Use the template \emph{chapter.tex} together with the Springer document class SVMono (monograph-type books) or SVMult (edited books) to style the various elements of your chapter content in the Springer layout. Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references and citations. And please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. \section{Section Heading} \label{sec:2} Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references and citations. Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. Use the standard \verb|equation| environment to typeset your equations, e.g. \begin{equation} a \times b = c\;, \end{equation} however, for multiline equations we recommend to use the \verb|eqnarray| environment\footnote{In physics texts please activate the class option \texttt{vecphys} to depict your vectors in \textbf{\itshape boldface-italic} type - as is customary for a wide range of physical subjects}. \begin{eqnarray} a \times b = c \nonumber\\ \vec{a} \cdot \vec{b}=\vec{c} \label{eq:01} \end{eqnarray} \subsection{Subsection Heading} \label{subsec:2} Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references\index{cross-references} and citations\index{citations} as has already been described in Sect.~\ref{sec:2}. \begin{quotation} Please do not use quotation marks when quoting texts! Simply use the \verb|quotation| environment -- it will automatically render Springer's preferred layout. \end{quotation} \subsubsection{Subsubsection Heading} Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references and citations as has already been described in Sect.~\ref{subsec:2}, see also Fig.~\ref{fig:1}\footnote{If you copy text passages, figures, or tables from other works, you must obtain \textit{permission} from the copyright holder (usually the original publisher). Please enclose the signed permission with the manucript. The sources\index{permission to print} must be acknowledged either in the captions, as footnotes or in a separate section of the book.} Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. \begin{figure}[b] \sidecaption \includegraphics[scale=.65]{figure} \caption{If the width of the figure is less than 7.8 cm use the \texttt{sidecapion} command to flush the caption on the left side of the page. If the figure is positioned at the top of the page, align the sidecaption with the top of the figure -- to achieve this you simply need to use the optional argument \texttt{[t]} with the \texttt{sidecaption} command} \label{fig:1} \end{figure} \paragraph{Paragraph Heading} % Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references and citations as has already been described in Sect.~\ref{sec:2}. Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. For typesetting numbered lists we recommend to use the \verb|enumerate| environment -- it will automatically render Springer's preferred layout. \begin{enumerate} \item{Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development.} \begin{enumerate} \item{Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development.} \item{Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development.} \end{enumerate} \item{Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development.} \end{enumerate} \subparagraph{Subparagraph Heading} In order to avoid simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Use the \LaTeX\ automatism for all your cross-references and citations as has already been described in Sect.~\ref{sec:2}, see also Fig.~\ref{fig:2}. For unnumbered list we recommend to use the \verb|itemize| environment -- it will automatically render Springer's preferred layout. \begin{itemize} \item{Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development, cf. Table~\ref{tab:1}.} \begin{itemize} \item{Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development.} \item{Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development.} \end{itemize} \item{Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development.} \end{itemize} \begin{figure}[t] \sidecaption[t] \includegraphics[scale=.65]{figure} \caption{If the width of the figure is less than 7.8 cm use the \texttt{sidecapion} command to flush the caption on the left side of the page. If the figure is positioned at the top of the page, align the sidecaption with the top of the figure -- to achieve this you simply need to use the optional argument \texttt{[t]} with the \texttt{sidecaption} command} \label{fig:2} \end{figure} \runinhead{Run-in Heading Boldface Version} Use the \LaTeX\ automatism for all your cross-references and citations as has already been described in Sect.~\ref{sec:2}. \subruninhead{Run-in Heading Italic Version} Use the \LaTeX\ automatism for all your cross-refer\-ences and citations as has already been described in Sect.~\ref{sec:2}\index{paragraph}. \begin{table} \caption{Please write your table caption here} \label{tab:1} \begin{tabular}{p{2cm}p{2.4cm}p{2cm}p{4.9cm}} \hline\noalign{\smallskip} Classes & Subclass & Length & Action Mechanism \\ \noalign{\smallskip}\svhline\noalign{\smallskip} Translation & mRNA$^a$ & 22 (19--25) & Translation repression, mRNA cleavage\\ Translation & mRNA cleavage & 21 & mRNA cleavage\\ Translation & mRNA & 21--22 & mRNA cleavage\\ Translation & mRNA & 24--26 & Histone and DNA Modification\\ \noalign{\smallskip}\hline\noalign{\smallskip} \end{tabular} $^a$ Table foot note (with superscript) \end{table} \section{Section Heading} \label{sec:3} Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references and citations as has already been described in Sect.~\ref{sec:2}. Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. If you want to list definitions or the like we recommend to use the Springer-enhanced \verb|description| environment -- it will automatically render Springer's preferred layout. \begin{description}[Type 1] \item[Type 1]{That addresses central themes pertainng to migration, health, and disease. In Sect.~\ref{sec:1}, Wilson discusses the role of human migration in infectious disease distributions and patterns.} \item[Type 2]{That addresses central themes pertainng to migration, health, and disease. In Sect.~\ref{subsec:2}, Wilson discusses the role of human migration in infectious disease distributions and patterns.} \end{description} \subsection{Subsection Heading} % In order to avoid simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Use the \LaTeX\ automatism for all your cross-references and citations citations as has already been described in Sect.~\ref{sec:2}. Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. \begin{svgraybox} If you want to emphasize complete paragraphs of texts we recommend to use the newly defined Springer class option \verb|graybox| and the newly defined environment \verb|svgraybox|. This will produce a 15 percent screened box 'behind' your text. If you want to emphasize complete paragraphs of texts we recommend to use the newly defined Springer class option and environment \verb|svgraybox|. This will produce a 15 percent screened box 'behind' your text. \end{svgraybox} \subsubsection{Subsubsection Heading} Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references and citations as has already been described in Sect.~\ref{sec:2}. Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. \begin{theorem} Theorem text goes here. \end{theorem} \begin{definition} Definition text goes here. \end{definition} \begin{proof} Proof text goes here. \qed \end{proof} \paragraph{Paragraph Heading} % Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references and citations as has already been described in Sect.~\ref{sec:2}. Note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. \begin{theorem} Theorem text goes here. \end{theorem} \begin{definition} Definition text goes here. \end{definition} \begin{proof} \smartqed Proof text goes here. \qed \end{proof} \begin{acknowledgement} If you want to include acknowledgments of assistance and the like at the end of an individual chapter please use the \verb|acknowledgement| environment -- it will automatically render Springer's preferred layout. \end{acknowledgement} \section*{Appendix} \addcontentsline{toc}{section}{Appendix} When placed at the end of a chapter or contribution (as opposed to at the end of the book), the numbering of tables, figures, and equations in the appendix section continues on from that in the main text. Hence please \textit{do not} use the \verb|appendix| command when writing an appendix at the end of your chapter or contribution. If there is only one the appendix is designated ``Appendix'', or ``Appendix 1'', or ``Appendix 2'', etc. if there is more than one. \begin{equation} a \times b = c \end{equation} \input{referenc} \chapter{Chapter Heading} \label{introA} Use the template \emph{appendix.tex} together with the Springer document class SVMono (monograph-type books) or SVMult (edited books) to style appendix of your book in the Springer layout. \section{Section Heading} \label{sec:A1} Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references and citations. \subsection{Subsection Heading} \label{sec:A2} Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references and citations as has already been described in Sect.~\ref{sec:A1}. For multiline equations we recommend to use the \verb|eqnarray| environment. \begin{eqnarray} \vec{a}\times\vec{b}=\vec{c} \nonumber\\ \vec{a}\times\vec{b}=\vec{c} \label{eq:A01} \end{eqnarray} \subsubsection{Subsubsection Heading} Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references and citations as has already been described in Sect.~\ref{sec:A2}. Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. \begin{figure}[t] \sidecaption[t] \includegraphics[scale=.65]{figure} \caption{Please write your figure caption here} \label{fig:A1} \end{figure} \begin{table} \caption{Please write your table caption here} \label{tab:A1} \begin{tabular}{p{2cm}p{2.4cm}p{2cm}p{4.9cm}} \hline\noalign{\smallskip} Classes & Subclass & Length & Action Mechanism \\ \noalign{\smallskip}\hline\noalign{\smallskip} Translation & mRNA$^a$ & 22 (19--25) & Translation repression, mRNA cleavage\\ Translation & mRNA cleavage & 21 & mRNA cleavage\\ Translation & mRNA & 21--22 & mRNA cleavage\\ Translation & mRNA & 24--26 & Histone and DNA Modification\\ \noalign{\smallskip}\hline\noalign{\smallskip} \end{tabular} $^a$ Table foot note (with superscript) \end{table} \section{Results} \vspace{-0.3cm} \label{sec:eval} In order to asses frontalization error as a quantitative measure of the face detection, we perform several experiments. Firstly, we fly the UAV at different angles and distances from the person. For each of the sampled points, frontalization accuracy is calculated as: $$Frontalization~accuracy = 1-Frontalisation~error$$ In Figure~\ref{fig:visib_plot} (a) and (b) frontalization accuracy as a function of distance and orientation from the face is plot. Since the frontalisation process begins after aligning the facial bounding box to the center of the UAV frame, experiments of frontalisation error with respect to the altitude of UAV is not relevant here. During the process of frontalisation, the altitude of UAV with respect to face bounding box is maintained constant. \begin{figure}[!h] \begin{minipage}[b]{.4\linewidth} \centering \centerline{\includegraphics[width=4cm, height=3cm]{figures/radius.jpg}} \vspace{-0.2cm} \centerline{(a)}\medskip \end{minipage} \hspace{0.5cm} \begin{minipage}[b]{0.4\linewidth} \centering \centerline{\includegraphics[width=4cm, height=3cm]{figures/angle.jpg}} \vspace{-0.2cm} \centerline{(b)}\medskip \end{minipage} \vfill \begin{minipage}[b]{0.4\linewidth} \centering \centerline{\includegraphics[width=4cm, height=3cm]{figures/radius_static.jpg}} \vspace{-0.2cm} \centerline{(c)}\medskip \end{minipage} \hspace{0.5cm} \begin{minipage}[b]{0.4\linewidth} \centering \centerline{\includegraphics[width=4cm, height=3cm]{figures/angle_static.png}} \vspace{-0.2cm} \centerline{(d)}\medskip \end{minipage} \caption{(a) Frontalization accuracy vs radius for on board camera, (b) Frontalization accuracy vs orientation for onboard camera, (c) Average Recognition confidence vs radius from Kinect and (d) Average Recognition confidence vs orientation from Kinect} \label{fig:visib_plot} \end{figure} A visual representation of the velocity vectors is shown Figure \label{fig:vel}. At every location on the field of experiment we represent the strength and direction of the velocity using arrows. all the vectors point towards the human positioned at [0,0.5]. The velocities are calculated with respect to the relative position of UAV with the person detection bounding box as described in Section \ref{hum det} We compare our results with the empirical data obtained by performing a similar analysis on Kinect camera for face recognition. Figure~\ref{fig:visib_plot} (c) and (d) is a plot of recognition accuracy with respect to orientation and distance observed from the Kinect camera. Figure~\ref{fig:visib_plot} establishes a close correspondence of frontalization error with the face recognition confidence. The accuracy is high when the camera is oriented at $0$ $^{\circ}$ from the face and subsides down at higher angles leading to a more severe pose of face. A similar result was observed for the radius. As explained in Section \ref{controller}, we use a PD controller to navigate the UAV to the center. \begin{figure}[h!] \centering \includegraphics[width=0.5\textwidth]{figures/vel_final.jpg} \captionsetup{justification=centering} \caption{The plot visualizes the velocity commands that are calculated at each location with respect to the detected faces.} \label{fig:vel} \end{figure} In Figure~\ref{fig:vel}, the control signals generated using the frontalization error at any given point in the space is shown. The arrows converge towards the \textit{dead zone}, where the frontalization error is zero or the view of face is fully frontal. \begin{figure}[h!] \centering \includegraphics[width=0.4\textwidth]{figures/trajectory.png} \captionsetup{justification=centering} \caption{UAV trajectory for a single run. The color map indicate the time lapse. The person is standing at the origin looking straight } \label{path} \end{figure} \begin{figure} \centering \subfloat[Frontalization error during the flight path. The error saturates at zero when a frontal view is obtained ]{ \includegraphics[width=0.4\textwidth]{figures/frontalisation_error.jpg}\label{fig:vis_traj}}% \qquad \subfloat[Similarity measure for the face detected along the proposed flight path.]{ \includegraphics[width=0.4\textwidth]{figures/face_scores2.jpg}\label{fig:face_score} \caption{The trajectories of frontalisation error and cosine similarity as a function of time steps} \label{fig:trajectories} \end{figure} \vspace{-0.5cm} We test the interface described in Section~\ref{controller} in an indoor setting. A typical path traversed during active face frontalization is shown in the Figure~\ref{path}. The position of the person and the orientation is marked by the red circle and the arrow respectively. The yaw of the UAV at every instant is represented along the path. By taking off at different angles away from the face, we track the frontalization error along the trajectory. As shown in Figure~\ref{fig:vis_traj}, the error starts off at a high value, with positive error indicating the right side of face and negative error indicating the left part. The error gradually converges to zero. Any drift is efficiently sustained. In the final stage of evaluation, to justify our claim that active frontalization boosts the performance of face recognition, cosine similarity scores for the faces detected along flight path and the registered face for different runs is calculated. In Figure~\ref{fig:face_score}, it can be observed that the similarity scores for the images along the trajectory increases along the flight path. The higher similarity yields better face recognition. \vspace{-0.7cm} \section{Introduction} \label{sec:intro} Surveillance in remote areas is difficult due to the difficulty and cost of building and operating dense camera networks over large areas. Instead, Unmanned Aerial Vehicles (UAVs) can be used as mobile sensors to increase coverage~\cite{hsu2015face}, to identify, and to follow individuals. Biometrics, i.e. consisting biological signals, of a person have proven to be an efficient means of automated identification~\cite{Jain:2000:BI:328236.328110}. Visual biometrics such as faces, fingerprints, and iris patters, are highly discriminative. However such modalities show great appearance variations in nature. For example,the pixel level comparison of facial images from the same person can look rather different while the biometric signal should be constant. An adaptive biometric system could reduce the efforts for capturing and encoding all such variations. UAVs being highly mobile can be controlled to obtain high quality biometric data. Typically, pilots in ground stations control UAVs remotely to acquire high quality data. However, this requires extensive human effort and places constraints on scaling up such approaches, which conflicts with the goal of covering large areas. Automation of the tracking and UAV networking could potentially change this~\cite{autodrone}. In the past, military has employed "Drone stares" in war zones and border areas to monitor any malicious activities~\cite{doi:10.1177/1362480610396650}. Beyond surveillance, UAVs have also been used for search and rescue operations~\cite{searchnrescue}~\cite{geo}. Autonomous UAVs that track humans have to detect and identify individuals efficiently. Among various biometrics, face is one of the primary modalities for human identification. However, the video quality of aerial imagery poses severe limitations to perform facial recognition. For example~\cite{doi:10.1177/1362480610396650} lists instances of "collateral damage" caused due to the ambiguity in identifying the person of interest from the aerial imagery. In the biometrics community facial analysis based on facial images from print media, on-line photo postings, or other data sources which were captured incidentally are called a unconstrained faces. Such data show huge appearance variability due to change in pose, lighting, and occlusions. Such inconsistencies degrade the quality of automatic face detection and analysis. Although humans can efficiently recognize such pose variant faces, for a computer to train and learn on such noisy representation requires massive data and a considerable amount time. A common approach of face recognition pipelines is to synthesize a frontal view of the face using 3D reconstruction methods from a non-frontal image. However since UAVs can be used as active sensors in biometrics to obtain a optimized view of face, we propose {\em active face frontalization}, in which real frontalized data is gather rather than synthesized from non-frontal views. Besides getting better recognition, frontal images of faces are more aesthetic and can be used in the UAVs photography technology popular these days. We define {\em active frontalisation} based on the existing frontalisation methods. The contributions of this paper are: Firstly, we derive a frontalization error on the pose variant face based on existing virtual fontalization techniques. We show that this metric can be efficiently used to adjust the flight path to obtain an improved view of face. Secondly, we evaluate face recognition performance of the resulting views using a similarity measure on the features obtained from a deep convolutional neural network (CNN) as commonly done in state-of-the-art biometric identification. We present an implementation of this approach using inexpensive off-the-shelf components. The resulting system focuses on frontalization and is currently limited by several practical limitations related to safety and sensor quality. Autonomous UAVs creates safety hazards. Therefore, we chose a relatively safe UAV over more sophisticated but dangerous ones. Further the lack of high quality cameras and sensors in an off-the-shelf UAV needs to be overcome by using robust algorithms. More generally, the images from UAVs are not optimal for biometric analysis. The faces seen by the UAVs have two crucial issues: long range and lateral poses. Generally the perspective of UAVs capture faces at a distance and are not detectable. In the following section~\ref{hum det} we describe a simple person following algorithm to direct the UAVs into the range of face detection. Section \ref{visibility} elaborates the method used for assessment of the face quality with regard to the pose. In Section \ref{controller}, we give an overview of the controller. \section{Related Work} \label{sec:relwork} \vspace{-0.4cm} Human detection from aerial imagery was performed using thermal signatures in early days~\cite{doi}~\cite{4526559}. However due to popularity of computer vision based techniques, visual feedback from the sensors were used to track and follow humans efficiently. Pestana~\cite{pestana2014computer} investigated whether visual based object tracking and following is reliable using a cheap GPS-denied UAVs while assuring safety. This work demonstrated that current tracking algorithms, such as OpenTLD~\cite{kalal2012tracking}, are reliable to work on UAVs platform, and the proposed architecture has been able to follow unmarked targets of different sizes and from a wide range of distances even when occlusions happened. Although researchers achieved good performance for tracking and following humans, identification was still a challenging task. Unfortunately neither thermal images nor detectors were sufficient for identification of people. Therefore researchers started analyzing the feasibility of using face recognition on UAVs. Unlike static cameras or high resolution cameras, UAVs have disturbance, resolution limitation and complex flying environments (different illumination and weather, indoor and outdoor), current state-of-the-art face recognition methods may have limits and issues while they are applied on UAVs, therefore, we need to know how well face recognition perform on UAVs given different altitude, distance and angle. HSU and CHEN~\cite{hsu2015face} investigated the capability of two face recognition services ($Face^{++}$ ~\cite{facelink} and ReKognition~\cite{Orbeus}) in face detection and face recognition with different altitudes, distances, and angles of depression. The results showed that the present face recognition technologies are able to perform adequately on UAVs. Another study was made on analyzing the face quality on various platforms~\cite{Korshunov:2011:VQF:2000486.2000488}. They based their study on three commercially available face analysis algorithms 1) ViolaJones [Viola and Jones 2001] and Rowley [Rowley et al. 1998] face detection algorithms; 2) QDA-based face recognition algorithm [Lu et al. 2003]; and 3) CAMSHIFT [Bradski 1998] face tracking algorithm. It was inferred that the accuracy of these algorithms change significantly after a critical video quality. Davis et al.~\cite{6556371} present a modular and adaptive algorithms for facial recognition on commercial off the shelf UAVs . They use human visual based approach with LBP features to train classifiers for facial recognition systems. However such systems are not immune to the large pose variations of faces as seen by the UAVs. \vspace{-0.7cm} \subsection{Commercially available drones that can track and follow} \vspace{-0.4cm} Currently, commercial following drones, such as Airdog~\cite{airdog}, Bebop \cite{bebop}, Hexo+~\cite{hexo} are popular. Airdog uses a wearable device called AirLeash to track and follow people. AirLeash can track movement and send control commands to AirDog. Bebop has "Follow me" feature by using visual recognition technology and GPS tracking system on the smart phone. Same as Bebop drone, Hexo also uses smart phone to control and make it track and follow people. For all these tracking drones, the users have to wear a tracking device to ensure that drones follow them, they are incapable autonomously capturing face images with good quality. \vspace{-0.8cm} \section{Section Heading} \label{sec:1} Use the template \emph{chapter.tex} together with the Springer document class SVMono (monograph-type books) or SVMult (edited books) to style the various elements of your chapter content in the Springer layout. Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references and citations. And please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. \section{Section Heading} \label{sec:2} Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references and citations. Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. Use the standard \verb|equation| environment to typeset your equations, e.g. \begin{equation} a \times b = c\;, \end{equation} however, for multiline equations we recommend to use the \verb|eqnarray| environment\footnote{In physics texts please activate the class option \texttt{vecphys} to depict your vectors in \textbf{\itshape boldface-italic} type - as is customary for a wide range of physical subjects}. \begin{eqnarray} a \times b = c \nonumber\\ \vec{a} \cdot \vec{b}=\vec{c} \label{eq:01} \end{eqnarray} \subsection{Subsection Heading} \label{subsec:2} Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references\index{cross-references} and citations\index{citations} as has already been described in Sect.~\ref{sec:2}. \begin{quotation} Please do not use quotation marks when quoting texts! Simply use the \verb|quotation| environment -- it will automatically render Springer's preferred layout. \end{quotation} \subsubsection{Subsubsection Heading} Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references and citations as has already been described in Sect.~\ref{subsec:2}, see also Fig.~\ref{fig:1}\footnote{If you copy text passages, figures, or tables from other works, you must obtain \textit{permission} from the copyright holder (usually the original publisher). Please enclose the signed permission with the manucript. The sources\index{permission to print} must be acknowledged either in the captions, as footnotes or in a separate section of the book.} Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. \begin{figure}[b] \sidecaption \includegraphics[scale=.65]{figure} \caption{If the width of the figure is less than 7.8 cm use the \texttt{sidecapion} command to flush the caption on the left side of the page. If the figure is positioned at the top of the page, align the sidecaption with the top of the figure -- to achieve this you simply need to use the optional argument \texttt{[t]} with the \texttt{sidecaption} command} \label{fig:1} \end{figure} \paragraph{Paragraph Heading} % Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references and citations as has already been described in Sect.~\ref{sec:2}. Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. For typesetting numbered lists we recommend to use the \verb|enumerate| environment -- it will automatically render Springer's preferred layout. \begin{enumerate} \item{Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development.} \begin{enumerate} \item{Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development.} \item{Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development.} \end{enumerate} \item{Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development.} \end{enumerate} \subparagraph{Subparagraph Heading} In order to avoid simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Use the \LaTeX\ automatism for all your cross-references and citations as has already been described in Sect.~\ref{sec:2}, see also Fig.~\ref{fig:2}. For unnumbered list we recommend to use the \verb|itemize| environment -- it will automatically render Springer's preferred layout. \begin{itemize} \item{Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development, cf. Table~\ref{tab:1}.} \begin{itemize} \item{Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development.} \item{Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development.} \end{itemize} \item{Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development.} \end{itemize} \begin{figure}[t] \sidecaption[t] \includegraphics[scale=.65]{figure} \caption{If the width of the figure is less than 7.8 cm use the \texttt{sidecapion} command to flush the caption on the left side of the page. If the figure is positioned at the top of the page, align the sidecaption with the top of the figure -- to achieve this you simply need to use the optional argument \texttt{[t]} with the \texttt{sidecaption} command} \label{fig:2} \end{figure} \runinhead{Run-in Heading Boldface Version} Use the \LaTeX\ automatism for all your cross-references and citations as has already been described in Sect.~\ref{sec:2}. \subruninhead{Run-in Heading Italic Version} Use the \LaTeX\ automatism for all your cross-refer\-ences and citations as has already been described in Sect.~\ref{sec:2}\index{paragraph}. \begin{table} \caption{Please write your table caption here} \label{tab:1} \begin{tabular}{p{2cm}p{2.4cm}p{2cm}p{4.9cm}} \hline\noalign{\smallskip} Classes & Subclass & Length & Action Mechanism \\ \noalign{\smallskip}\svhline\noalign{\smallskip} Translation & mRNA$^a$ & 22 (19--25) & Translation repression, mRNA cleavage\\ Translation & mRNA cleavage & 21 & mRNA cleavage\\ Translation & mRNA & 21--22 & mRNA cleavage\\ Translation & mRNA & 24--26 & Histone and DNA Modification\\ \noalign{\smallskip}\hline\noalign{\smallskip} \end{tabular} $^a$ Table foot note (with superscript) \end{table} \section{Section Heading} \label{sec:3} Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references and citations as has already been described in Sect.~\ref{sec:2}. Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. If you want to list definitions or the like we recommend to use the Springer-enhanced \verb|description| environment -- it will automatically render Springer's preferred layout. \begin{description}[Type 1] \item[Type 1]{That addresses central themes pertainng to migration, health, and disease. In Sect.~\ref{sec:1}, Wilson discusses the role of human migration in infectious disease distributions and patterns.} \item[Type 2]{That addresses central themes pertainng to migration, health, and disease. In Sect.~\ref{subsec:2}, Wilson discusses the role of human migration in infectious disease distributions and patterns.} \end{description} \subsection{Subsection Heading} % In order to avoid simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Use the \LaTeX\ automatism for all your cross-references and citations citations as has already been described in Sect.~\ref{sec:2}. Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. \begin{svgraybox} If you want to emphasize complete paragraphs of texts we recommend to use the newly defined Springer class option \verb|graybox| and the newly defined environment \verb|svgraybox|. This will produce a 15 percent screened box 'behind' your text. If you want to emphasize complete paragraphs of texts we recommend to use the newly defined Springer class option and environment \verb|svgraybox|. This will produce a 15 percent screened box 'behind' your text. \end{svgraybox} \subsubsection{Subsubsection Heading} Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references and citations as has already been described in Sect.~\ref{sec:2}. Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. \begin{theorem} Theorem text goes here. \end{theorem} \begin{definition} Definition text goes here. \end{definition} \begin{proof} Proof text goes here. \qed \end{proof} \paragraph{Paragraph Heading} % Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the \LaTeX\ automatism for all your cross-references and citations as has already been described in Sect.~\ref{sec:2}. Note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. \begin{theorem} Theorem text goes here. \end{theorem} \begin{definition} Definition text goes here. \end{definition} \begin{proof} \smartqed Proof text goes here. \qed \end{proof} \begin{acknowledgement} If you want to include acknowledgments of assistance and the like at the end of an individual chapter please use the \verb|acknowledgement| environment -- it will automatically render Springer's preferred layout. \end{acknowledgement} \section*{Appendix} \addcontentsline{toc}{section}{Appendix} When placed at the end of a chapter or contribution (as opposed to at the end of the book), the numbering of tables, figures, and equations in the appendix section continues on from that in the main text. Hence please \textit{do not} use the \verb|appendix| command when writing an appendix at the end of your chapter or contribution. If there is only one the appendix is designated ``Appendix'', or ``Appendix 1'', or ``Appendix 2'', etc. if there is more than one. \begin{equation} a \times b = c \end{equation} \input{referenc} \end{document}
\section*{Introduction} According to the National Cancer Institute, distress is an emotional, social, spiritual, or physical pain or suffering that may cause a person to feel sad, afraid, depressed, anxious, or lonely. Distress is highly prevalent in cancer patients regardless of disease-stage or modality.~\cite{albrecht2012management} In the case of cancer patients, untreated distress has been shown to lead to greater pain, reduced physical function, increased medical costs, and longer stays in the hospital. The National Comprehensive Cancer Network (NCCN) designed % the \textit{NCCN Distress Thermometer and Problem List} (DT) % to be used as a screening tool for recognizing distress in cancer patients% ; and has since been shown to accurately indicate distress.~\cite{zebrack2017practice} % The DT was designed to improve patient care, which in turn would improve a patient's quality of life. Furthermore, studies have shown that routine distress screening is able to improve health outcomes including % morbidity and mortality.~\cite{basch2017overall} % A greater issue emerges when considering rural communities in the United States that are often medically underserved and % medically disadvantaged, such as Appalachian Kentucky.~\cite{hesse2020barn} Rural communities also % commonly have higher rates of chronic disease, reduced access to providers, % and continue to experience a decline in rural hospitals.~\cite{saslow_2019,national2017health} % The aforementioned disparities raise the urgency % for rural communities to adopt the use of health information technologies (HIT). % However, rural communities face geographical and financial challenges that result in limited or nonexistent access to broadband connectivity. % This ``digital divide" limits the ability for rural communities to benefit from HIT.~\cite{max2020augmenting,hesse2020barn} In addition, rural communities also have lower levels of overall technology adoption.~\cite{hesse2020barn, mccomsey2020experiencing} % \textbf{In this paper, we discuss how knowledge gained from patient-centered design led to the underpinnings of developing a rural remote patient monitoring app that provides delightful and insightful experiences to users.} \section*{Methodology} In order to better understand how distress manifests for cancer patients with ties to rural Kentucky, four participatory design workshops were held between February and October of % 2019 % to gather input from local stakeholders.~\cite{hesse2020barn} % These co-design workshops gave community participants a way to directly contribute to the brainstorming, design, and low-fidelity prototyping of distress monitoring tools that would positively impact the cancer experience. % We were able to bring together various stakeholders from the % Appalachian Kentucky and Lexington communities which included medical professionals, social workers, technologists, students, current and previous cancer patients, and researchers. % Knowledge was gained regarding what stakeholders would like to see in HIT and distress screening tools. Understanding was also gained on the underlying holistic needs of Appalachian cancer patients; an example being that patients may feel embarrassed to discuss their distress symptoms out loud, which relates to the culture of self-sufficiency that is prevalent in Appalachian culture.~\cite{mccomsey2020experiencing} % Following the workshops, participants were invited to provide feedback on the DT and the digital translation of the DT utilizing the System Usability Scale (SUS). % Community members at the Markey Cancer Center and attendees of the Markey Cancer Center Affiliate Network (MCCAN) 2019 Cancer Care Conference were also invited to score the distress screening tools. % % % % The sample of people who scored the paper DT was $n=44$, with 8 identifying as patients, 10 as caregivers, 11 as providers, and 15 as other. % The sample of people who scored the digital DT was $n=34$, with 7 identifying as patients, 10 as caregivers, 8 as providers, and 9 as other. All users reported that they preferred the digitized distress screening tools over paper tools; supporting our decision to convert cancer patient distress screening to a digital format for target users. \section*{Assuage - An App for Rural Health Care} Assuage is a HIPAA compliant mobile iOS % application by researchers at the University of Kentucky (UK). \footnote{Network Reconnaissance Lab, University of Kentucky - https://www.cs.uky.edu/~baker/research/} An aim of Assuage is to enhance the process of distress monitoring in rural cancer patients with more frequent screening. Cancer patients at UK's Markey Cancer Center complete the DT approximately every six weeks. By reducing the time between screenings, providers and researchers can better understand a patient's overall distress, causes of distress, and track symptoms between visits. Assuage also seeks to facilitate patient provider communication. In the context of Assuage, all DT components are referred to as ``surveys''. Assuage offers % the ability to choose from four different user interfaces (UIs) in order to complete the % routine distress assessment. The decision to offer multiple UIs was made with knowledge that Appalachians have not heavily adopted HIT, but are also not completely removed from modern everyday technologies, like cellphones. This takes a different approach than related work that seeks to overcome challenges with rural cancer patients and information access,~\cite{jacobs2018mypath} or daily life management following cancer diagnosis.~\cite{khurram2020patient} In order to ensure usability and routine completion of the distress assessment, % multiple UIs are offered to gain understanding of patient preferences. While Assuage is still % undergoing final iterations before the initial pilot, several of the current features include: % \\ {\textbf{Health App Integration.}} Assuage leverages Apple's HealthKit, CareKit, and ResearchKit\footnote{Apple, ResearchKit and CareKit - https://www.researchandcare.org} to provide an engaging experience for both Patients and Doctors. Assuage is also able to collect information from any Bluetooth based sensor. The first time a user logs in to Assuage, they are prompted with the option to allow Assuage to gain access to data from the Health app. Following this step, users are launched into the Assuage app. Note that this will happen on the first installation and sign in of the Assuage app. Afterwards, users can % manually change their preferences through their iPhone's general settings. \\ \textbf{Multiple UIs.} In order to solicit feedback on UI preferences, Assuage offers patient users the ability to choose from four different UIs in order to complete their routine distress assessment. The UIs differ by the way the surveys are displayed and navigated. (1) The \textit{NCCN Advanced} UI implements a modularized view of the DT components. Users can select \textit{cards} corresponding to surveys; allowing for the most fluid navigation % between sections. (2) The \textit{NCCN Standard} UI guides patients sequentially through the surveys. Navigation is limited to \textit{next} and \textit{back} buttons. (3) The \textit{NCCN Checklist} UI presents patients with the option to navigate sequentially through the surveys, similar to the previous UI, or by selecting buttons with the associated survey labels. The latter allows for customized and more direct navigation of surveys. The label/button associated with the current survey will be highlighted. % (4) The \textit{NCCN Paper} % UI offers the smoothest transition for patients who prefer the standard paper DT. Patients take a photo of their manually completed paper DT using their device; and upload it in Assuage. % % % % % % % % \\ \textbf{Wireless.} % Assuage will be functional in a fully connected and intermittently connected network; addressing the barrier of limited broadband connectivity in Appalachian Kentucky by using device-to-device (D2D) communication % that utilizes the mobility of rural residents to maximize data delivery.~\cite{max2020augmenting} Note that Assuage is not intended for use in medical related emergencies requiring immediate attention, but for patient monitoring, feedback, and updates. \section*{Future Work} While the primary goal of Assuage is to improve routine distress screening for rural cancer patients, we hope that with continued use rural patients will more readily adopt the use of other HIT. Future iterations of Assuage will be designed to have interfaces for non-patient users; the first priority being a care provider/doctor interface. A feasibility study of Assuage with Appalachian patients is also necessary before moving forward with feature refinement. We hope to leverage this desire for self-sufficiency coupled with the desire for improved health outcomes % to incentivize the sustained use of Assuage. % \bibliographystyle{unsrt} \setlength\itemsep{-0.1em}
\section{Signal and radioactivity background} \label{sec:bkg-sources} \subsection{Anti-neutrino signal and selection cuts} \label{sec:nu-cuts} JUNO detects electron anti-neutrinos via the IBD reaction, $\overline{\nu}_{e}+p\rightarrow e^{+}+n$. Here the positron quickly deposits its kinetic energy and annihilates into two 511\,keV $\gamma$-rays, producing the prompt signal. The neutron, instead, scatters in the detector for tens of centimeters in the LS until it is thermalized and then captured by a free proton, with the subsequent release of a 2.2\,MeV $\gamma$-ray, which constitutes the delayed signal (mean capture time $\sim$200\,$\mu$s). The energy deposited by the positron is related to the one carried by the anti-neutrino with a shift down of about 0.8\,MeV. Reactor anti-neutrino energies typically extend up to about 10\,MeV: thus, taking into account the IBD threshold energy of 1.8\,MeV, the deposited energy spectrum for reactor anti-neutrino analysis is spread between about 1 and 9\,MeV. The IBD reaction shows a peculiar correlation in energy, time and space between the prompt and delayed signals. Therefore, the picking of anti-neutrino events is performed by applying, among others, a basic set of preliminary selection criteria (default cuts)~\cite{yellow}: \begin{itemize} \item prompt signal energy: 0.7 MeV < $E_ p$ < 12 MeV; \item delayed signal energy: 1.9 MeV < $E_d$ < 2.5 MeV; \item time difference between prompt and delayed signal: $\Delta T_{p-d}$ < 1.0 ms; \item distance between prompt and delayed signal: $D_{p-d}$ < 1.5 m. \end{itemize} On the other hand, the accidental background from natural radioactivity (see Section~\ref{sec:natural-sources}) satisfies the above selection criteria in the same energy range, and cannot be discriminated by means of further software-based cuts. The expected accidental coincidence rate $R_{acc}$ caused by natural radioactivity contaminants can be calculated as \begin{equation} \label{sec5:eq1} R_{acc}=R_p\cdot R_d\cdot\Delta T_{p-d}\cdot\epsilon \end{equation} where $R_p$ and $R_d$ represent the prompt-like and delayed-like signal rates. $\epsilon$ is an efficiency parameter that allows a further event selection by requiring a specific distance D$_{p-d}$\ between the position of occurrence of the prompt and delayed events within the detector. $\epsilon$ can be derived only by means of Monte Carlo simulations. We optimize $R_{acc}$ with the help of a toy Monte Carlo, and tune both the time and vertex correlation cuts between prompt and delayed signals according to the ratio of signal to background (as discussed later in Section~\ref{sec:bkg-impact}). Therefore, despite the clear correlations in energy, time and position between the prompt and delayed signals, it is mandatory to maintain the natural radioactivity background at extremely low levels. This can be achieved by a strict reduction strategy during the detector design and construction. The measurement of solar neutrinos, on the other hand, fully rely on the detection of their elastic scattering off electrons in the detector medium. Here only a fraction of the neutrino energy is transferred to the electron and the resulting electron recoil spectra are continuous even for incident mono-energetic neutrinos. The lack of a coincidence signature, in this case, poses even more stringent demands on the background level in the energy region below about 20\,MeV and was already studied in Ref.~\cite{JUNO-solar}. \subsection{Natural radioactivity} \label{sec:natural-sources} Natural radioactivity comes from all materials and can only be reduced by strict requirements on the material screening and environmental control. The water shielding around the central detector is effective not only for the fast neutrons generated by muons, but also for the radioactivity from the rock of the JUNO site. With a deposited energy up to 5~MeV which overlaps with the IBD energy spectrum, the radioactivity of the materials is one of the main sources of accidental background. The main contaminants are the following: \begin{itemize} \item natural long-lived radionuclides $^{238}$U and $^{232}$Th (with their decay chains supposed to be at secular equilibrium) and $^{40}$K; \item natural medium-lived radionuclides $^{226}$Ra, $^{210}$Pb/$^{210}$Bi, $^{210}$Po when secular equilibrium is broken in the $^{238}$U\ chain; \item natural gaseous radionuclide $^{222}$Rn; \item anthropogenic radionuclide $^{60}$Co. \end{itemize} All of these contaminants can be present in the various materials of the JUNO detector and may contribute to the singles rate measured in the CD due to the energy deposition following their radioactive decays. It can correspond either to the prompt or the delayed event of the IBD reaction depending on their energy and relative time. The expected IBD rate in the JUNO CD induced by reactor neutrinos is about 60 counts per day~(cpd), while the singles rate from natural radioactivity should be controlled to less than 10 counts per second, leading to $\sim$1~cpd accidental coincidence (see Section~\ref{sec:bkg-impact}) with default anti-neutrino selection cuts, similar to $^{8}$He/$^9$Li and geoneutrinos background sources. However, for solar neutrino detection whose signal is a single event, this limit will be several orders of magnitude lower and achieved by applying more stringent fiducial volume (FV) and timing cuts to remove natural radioactivity and cosmogenic backgrounds, as described in a dedicated paper \cite{JUNO-solar}. We should point out that $^{14}$C and $^{85}$Kr are not considered here due to their decay energy (Q$_{\beta}$=156~keV and Q$_{\beta}$=687~keV, respectively) below the default energy cut for IBD reactions (0.7~MeV -- introduced in Section~\ref{sec:nu-cuts}). On the other hand, they are a very important background for low energy solar neutrino studies in JUNO. The radioactivity from external materials can also be effectively removed by software-based FV and energy threshold cuts, which can be both optimized based on the Monte Carlo simulation (see Section \ref{sec:methodology} and \ref{sec:mc-results}). Besides that, it is important to distinguish the {\it internal background}, coming from the LS itself and the {\it external background}, coming from the other parts of the JUNO detector. Indeed, for the internal background, all the radionuclides especially from the U/Th chains will contribute to the deposited energy whatever the nature of the emitted particles ($\alpha$, $\beta$, and $\gamma$) because the energy is directly released in the sensitive volume. Assuming secular equilibrium, each of the radionuclides will contribute equally to the singles rate (without energy cut considerations). In this case, a FV cut would be useless for removing the background events, since they are uniformly distributed in the LS. On the contrary, only a part of the radionuclides will contribute to the external background considering the very short ranges of the $\alpha$ and $\beta$ particles in solid materials, which will exclude pure $\alpha$ and $\beta$ emitters. Only high energy $\gamma$s will be able to reach the LS and deposit energy, mainly coming from $^{214}$Bi (1.76 and 2.20~MeV in $^{238}$U chain), $^{208}$Tl (2.61~MeV in $^{232}$Th chain), $^{40}$K (1.46~MeV) and $^{60}$Co (1.17 and 1.33~MeV). Radon coming from $^{238}$U chain is also a problematic gaseous radionuclide contributing to both internal and external backgrounds. Before insertion in the JUNO vessel, the LS may be contaminated during its lifetime (production, transportation, and storage) with the radon in the air or emanated from the surrounding materials. As a result, an additional contribution from the long-lived isotopes $^{210}$Pb and its sub-chain $^{210}$Bi/$^{210}$Po has to be considered for the internal background. As a progenitor of the $^{214}$Bi radionuclide, it may also contribute to the external background if present in the inner water pool. Finally, ($\alpha$,n) reactions can occur in the LS or in the surrounding materials due to the U/Th impurities: anyway the impact in singles rate is expected to be much smaller than the ones just described due to a relative low cross section. In the remaining of the paper we will focus on the strategies to reduce the impact of natural radioactivity on JUNO not to impair the sensitivity for the neutrino mass ordering determination. \section{Introduction} \label{sec:intro} The Jiangmen Underground Neutrino Observatory (JUNO)~\cite{yellow,ppnp} is a multipurpose experiment primarily designed to determine the neutrino mass ordering and precisely measure the neutrino oscillation parameters by detecting reactor anti-neutrinos. It is being built in the south of China at about 53\,km distance from the Yangjiang and Taishan nuclear power plants, to allow the contemporary study of the solar and atmospheric neutrino oscillation sectors. The large detector volume --- 20,000 tons of liquid scintillator (LS) --- and the unprecedented energy resolution of 3\% at 1\,MeV~\cite{juno-calibration}, make JUNO the largest LS-based, underground, neutrino observatory, capable of addressing many important topics in astro-particle physics. The extensive physics program of JUNO comprises supernova neutrinos, atmospheric neutrinos, solar neutrinos, and geoneutrinos, as well as new physics searches. A comprehensive discussion can be found in Refs.~\cite{yellow,ppnp}. The main detection channel for reactor anti-neutrinos in JUNO is the inverse beta decay (IBD) reaction on free protons (see Section\,\ref{sec:bkg-sources}). Because of its very low cross-section, only about 60 anti-neutrinos per day will be detected by JUNO, for a total available thermal power of 26.6\,GW$_{\textrm{th}}$. Therefore, strict control of radioactive background is mandatory. The JUNO detector is located in an underground laboratory with 700 m overburden, i.e. 1800~m.w.e. At this depth, the muon flux at JUNO site is of about 0.004 Hz/m$^{2}$ with a mean energy of 207 GeV~\cite{ppnp}. Hence a water Cherenkov detector is placed around the LS in order to detect and reject the muons. The rate of muons passing through the ultrapure water is of 10 Hz, while the rate of muons passing through the LS is of 3.6 Hz. Fast neutrons produced by muons passing through the rock and the detector materials may reach the LS and mimic an IBD event: the efficient muon tagging by the veto system of JUNO will enable removing most of these events leading to a low impact on the background budget of the fast neutrons. Muons and muon showers interact with $^{12}$C in the LS producing Z$\leq$6 isotopes by hadronic or electromagnetic processes: the produced $\beta$–n decaying nuclides can also mimic an IBD signal. The resulted $^9$Li/$^8$He are the most dangerous correlated background nuclides. In this respect, there are various physics-driven models for veto strategies to reduce the impact of the cosmogenic background in the different JUNO physics channels. Geoneutrinos, produced by $^{232}$Th and $^{238}$U radioactive decay chains inside the Earth, are both a background for reactor anti-neutrinos due to the same interaction channel (IBD) and one of the JUNO physics cases. All these background sources (cosmogenics and geoneutrinos), which are related to experimental site location, are discussed elsewhere~\cite{yellow,ppnp}. Natural radioactivity exists in all materials and represents a dominant source of background, which must be reduced with huge efforts on material selection and environmental control. To reach JUNO sensitivity requirement for the neutrino mass ordering determination, it is essential to maintain the background count rate --- the so-called \emph{singles} rate --- due to the natural radioactivity below 10\,Hz~\cite{yellow}. In this paper, we will discuss the natural radioactivity background reduction strategy pursued by JUNO to achieve this goal. The JUNO detector is described in Section~\ref{sec:setup}. Section~\ref{sec:bkg-sources} details the natural radioactivity background sources and the anti-neutrino detection channel. The methodology for background reduction --- material screening and Monte Carlo simulations --- is presented in Section~\ref{sec:methodology}. Finally, the results are discussed in Section~\ref{sec:mc-results}. \section*{Acknowledgements} We are grateful for the ongoing cooperation from the China General Nuclear Power Group. This work was supported by the Chinese Academy of Sciences, the National Key R\&D Program of China, the CAS Center for Excellence in Particle Physics, Wuyi University, and the Tsung-Dao Lee Institute of Shanghai Jiao Tong University in China, the Institut National de Physique Nucl\'eaire et de Physique de Particules (IN2P3) in France, the Istituto Nazionale di Fisica Nucleare (INFN) in Italy, the Italian-Chinese collaborative research program MAECI-NSFC, the Fond de la Recherche Scientifique (F.R.S-FNRS) and FWO under the ``Excellence of Science – EOS” in Belgium, the Conselho Nacional de Desenvolvimento Cient\'ifico e Tecnol\`ogico in Brazil, the Agencia Nacional de Investigacion y Desarrollo in Chile, the Charles University Research Centre and the Ministry of Education, Youth, and Sports in Czech Republic, the Deutsche Forschungsgemeinschaft (DFG), the Helmholtz Association, and the Cluster of Excellence PRISMA+ in Germany, the Joint Institute of Nuclear Research (JINR) and Lomonosov Moscow State University in Russia, the joint Russian Science Foundation (RSF) and National Natural Science Foundation of China (NSFC) research program, the MOST and MOE in Taiwan, the Chulalongkorn University and Suranaree University of Technology in Thailand, and the University of California at Irvine in USA. \section{The JUNO detector} \label{sec:setup} \begin{figure}[tbp] \centering \includegraphics[width=1.0\textwidth]{figure/JUNO_Detector-scheme.pdf} \hfill \caption{\label{fig:juno-schematic} Schematic drawing of the JUNO detector showing the main components of the experimental \cite{ppnp}.} \end{figure} The highly demanding performance requested to JUNO in terms of high statistical precision, excellent energy resolution ($\sim$3\%/$\sqrt{(E(\rm{MeV})}$), and low background have driven the dimensions and design of the experimental setup. It consists of a Central Detector (CD) and a water Cherenkov detector (WCD) laid in a water pool, and a muon tracker placed on top of the pool (indicated as Top Tracker, TT), as shown in Figure\,\ref{fig:juno-schematic}. In the CD, the huge LS mass -- 20\,kt -- is contained inside a spherical acrylic vessel with inner diameter of 35.40\,m and thickness of 12\,cm, for a total mass of about 580\,t of acrylic. The LS target has a room temperature density of 0.86\,g/mL and consists of Linear Alkyl Benzene (LAB) solvent, mixed with 2.5\,g/L of PPO (2,5-dyphenyloxazole) as fluor and 3\,mg/L bis-MSB (1,4-bis(2-methylstyryl) benzene) as a wavelength shifter~\cite{juno-scint}. The vessel is supported by a spherical stainless steel (SS) structure with inner diameter of 40.1\,m, sitting on 30 pairs of SS legs safely rooted to the concrete floor of the water pool. The anchoring of the acrylic vessel to the SS truss is ensured by 590 stainless steel rods (SS bars), which end at the vessel side with hinged connections within acrylic nodes to ensure the required stress relief. The scintillation light produced by energy depositions in the LS volume is read by 17,612 20-inch photomultiplier tubes (LPMTs, for large PMTs) and 25,600 3-inch photomultiplier tubes (SPMTs, for small PMTs), which are installed on the inner side of the SS truss. The LPMTs are produced by two different companies: there are 5,000 20-inch dynode photomultipliers from Hamamatsu Photonics\,\cite{hamamatsu}, and 12,612 20-inch microchannel plate photomultipliers by Northern Night Vision Technology (NNVT) \cite{nnvt}. All LPMTs feature a special protection in case of implosion: $\sim$10\,mm thick acrylic semisphere on the top, supported by a $\sim$2\,mm thick stainless steel semisphere on the bottom (left of Figure\,\ref{fig:pmt-truss}). The SPMTs are produced by HZC Photonics\,\cite{hzc}. The PMTs' electronics is composed of two parts: the ``wet'' electronics is located few meters from the PMTs inside custom made stainless steel under water boxes (UWBs), while the ``dry'' electronics is placed in a dedicated room above the pool. Each UWB contains the customized high voltage (HV) module, front-end board and readout card for 3 LPMTs or 128 SPMTs. The HV divider circuit to provide the working voltage to the PMTs is placed at the back of each phototube inside a customized experimental volume with a waterproof potting. The cables connecting the PMTs to the UWBs and the UWBs to the ``dry'' electronics are kept inside waterproof SS bellows. \begin{figure}[tbp] \centering \includegraphics[height=7cm]{figure/PMT-scheme.jpg} \hfill \includegraphics[height=7cm]{figure/Vessel_to_Truss.png} \caption{\label{fig:pmt-truss} Left: Schematics of an instrumented NNVT photomultiplier. Right: The acrylic vessel (yellow-green) anchored to the SS truss (light-gray) where the PMTs are installed and immersed in water (teal). The water pool (dark-gray -- not drawn to scale) has a minimum thickness of 3.9~m from the acrylic vessel in order to provide a sufficient shielding against the radioactivity of the rock. The inner part (2.3~m thick) is designed in order to shield the LS from the radioactivity of the PMTs. } \end{figure} The energy calibration is obtained by a redundant system of multiple sources (both radioactive and laser-based ones) and multidimensional scan systems, some of which will be inserted inside the vessel through an acrylic chimney. Calibration sources of different types and energies can be moved inside the LS volume or pulled inside a guide tube which surrounds the outside of the acrylic vessel and runs in a longitudinal loop. Details of the calibration systems and strategy are reported in Ref.~\cite{juno-calibration}. For the purpose of this paper, the calibration components that will be permanently mounted in the CD are the SS cables (with teflon anchors) used to insert the sources, the Teflon guide tube (with SS cables and sensors), and the ultrasonic sensor system receivers (which include Teflon, nickel, epoxy, piezoceramics, and copper) used to reconstruct the exact source positions within the detector. The entire CD is submerged in a cylindrical water pool with a diameter of 43.5\,m and a height of 44.0\,m, providing sufficient water thickness in all directions (at least 3.9 m) to shield the detector from the radioactivity of the surrounding rock \cite{Li_2016}. The inner part of the water pool, with 2.3\,m of water buffer, shields the LS from the radioactivity of the PMTs (right of Figure\,\ref{fig:pmt-truss}) with a 1.4\,m distance between acrylic vessel and the front face of the PMT glass bulb. To prevent $^{222}$Rn (called also radon or Rn hereafter) diffusion from the external rocks from dissolving into the water, 5\,mm thick high-density polyethylene (HDPE) panels (liner) are sealing the pool walls and are sustained by a concrete barrier with a minimum thickness of 70\,cm placed in front of the cavity rock. The water pool is equipped with about 2,400 LPMTs from NNVT to act as a WCD to veto cosmic muons. The CD and the WCD are optically separated with Tyvek. The WCD LPMTs are installed on the outside of the SS truss. Tyvek reflective foils provide a coating for the pool walls and the SS structure to increase the light collection efficiency. Finally, on the top of the water pool, a TT is installed to precisely measure the muon directions and support the veto strategies. It is composed by scintillating strips decommissioned from the Target Tracker of the OPERA experiment\,\cite{OPERA}, as described in Ref.\,\cite{JUNO-CDR}. \subsection{Accidental coincidences from natural radioactivity} \label{sec:bkg-impact} \begin{figure}[h] \centering \includegraphics[width=.7\textwidth]{figure/accSupFactor.pdf} \hfill \caption{\label{sec5:accSupFactor} The integral distribution of the suppression factor (1/$\epsilon$) as a function of the distance D$_{p-d}$\ for a time coincidence window $\Delta T_{p-d}$~=~1\,ms between the prompt and the delayed signals with energy in the ranges $E_p$ = [0.7, 12]~MeV and $E_d$ = [1.9, 2.5]~MeV, respectively. The default D$_{p-d}$\ range (i.e. D$_{p-d}$~=~[0, 1.5]~m) is shown as the dashed line. } \end{figure} As anticipated in Section~\ref{sec:nu-cuts}, we optimize the expected accidental coincidence rate $R_{acc}$ (see Equation~\ref{sec5:eq1}) with the help of a toy Monte Carlo and using the default selection cuts, as described in the following. One pair of events (prompt and delayed) in the chosen energy intervals ($E_p$ = [0.7, 12] MeV and $E_d$ = [1.9, 2.5] MeV) are randomly sampled 10$^9$ times from the distribution of Figure~\ref{sec5:singlesR3E}. At each selected energy, the associated frequency (rate) will depend on the position (radius) within the detector. The geometrical distance between each pair of prompt and delayed events can be calculated by converting the spherical coordinates to polar coordinates. By choosing a time coincidence window between the prompt and delayed signals ($\Delta T_{p-d}$~<~1\,ms), related to the neutron lifetime in the IBD reaction, the $R_p\cdot R_d\cdot\Delta T_{p-d}$ distribution as a function of the distance D$_{p-d}$\ can be calculated. Therefore, the selection of a specific D$_{p-d}$\ range of distances between the prompt and the delayed events allows a further reduction of the accidental rate by the associated suppression factor (1/$\epsilon$), plotted in Figure\,\ref{sec5:accSupFactor}. The suppression factor decreases sharply at large D$_{p-d}$\ distances, and this parameter can be tuned together with the time coincidence window $\Delta T_{p-d}$\ to optimize the IBD selection criteria according to the actual experimental conditions. Table~\ref{tab:opt} shows an example of possible tuning of the resulting accidental rate $R_{acc}$ by different choices of the FV cut and of the threshold energy $E_{th}$, with $\Delta T_{p-d}$\ window and D$_{p-d}$\ range fixed at 1\,ms and 1.5\,m, respectively. The final goal is to achieve the most favorable IBD signal to background ratio for the neutrino mass ordering analysis. \begin{figure}[h] \centering \includegraphics[width=.7\textwidth]{figure/accR3.pdf} \hfill \caption{\label{sec5:accR3} The differential (integral) distribution of the accidental rate as a function of radius with the default selection cuts of Section\,\ref{sec:nu-cuts} is shown as the red (blue) histogram. The default FV radius cut is shown as the dashed line. } \end{figure} The accidental rate $R_{acc}$ as a function of the volume (bottom X-axis) or radius (top X-axis) with default selection cuts and with the impurity inputs of Table~\ref{tab:impurities} is shown as the red histogram in Figure~\ref{sec5:accR3}, with the dominating contribution coming from the external contaminations. The integral rate of the red histogram (i.e. total $R_{acc}$ within the chosen FV) is shown as the blue histogram in Figure~\ref{sec5:accR3}. \begin{table}[tbp] \centering \begin{tabular}{|c|ccccc|} \hline \multirow{2}{*}{R$_{acc}$ [cpd]} & \multicolumn{5}{c|}{Fiducial volume radius [m]} \\ \cline{2-6} & 17.0 & 17.1 & 17.2 & 17.3 & 17.4 \\ \hline $E_{th}$ = 0.7 MeV & 0.20 & 0.41 & 0.89 & 2.0 & 4.9 \\ $E_{th}$ = 0.8 MeV & 0.19 & 0.38 & 0.83 & 1.9 & 4.6 \\ $E_{th}$ = 0.9 MeV & 0.17 & 0.35 & 0.78 & 1.8 & 4.3 \\ \hline \end{tabular} \caption{ Evolution of the accidental rate $R_{acc}$ with FV and energy threshold cuts. An accidental background rate of 0.89 cpd is expected with default cut values $E_{th}$~=~0.7\,MeV and FV with $r_{LS}$\,=\,17.2\,m, and with $\Delta T_{p-d}$\ coincindence window and D$_{p-d}$\ upper distance fixed at 1\,ms and 1.5\,m, respectively. \label{tab:opt}} \end{table} The expected accidental background rate due to natural radioactivity is expected to be about 0.9~cpd with default cuts. As Table~\ref{tab:opt} shows, this rate is very sensitive to the selection of the FV radius with more than a factor 2 of increase or decrease when varying the FV cut by 0.1~m around 17.2~m. From Figure~\ref{sec5:accR3}, the accidental background is definitely negligible for $r <$ 16 m. Finally, with conservative assumptions, the accidental background rate from natural radioactivity is expected to be lower than the two other main backgrounds, i.e. the cosmogenic background ($\sim$1.6~cpd) and the geoneutrino background ($\sim$1.1~cpd), even without the muon veto \cite{ppnp}. \subsection{Target impurity concentrations in the JUNO detector and environment} \label{sec:impurities-intro} Table\,\ref{tab:impurities} reports the assumed upper limits for the concentration of the natural contaminants in the materials used for the JUNO detector. They should be regarded as the target values that the JUNO collaboration has set for the expected activities due to the radioactive impurities in the detector components: some of those values are based on preliminary measurements of the final products (acrylic, SS structure, PMT glass, components of calibration system), others are derived from the literature or from the experience of similar experiments. The motivations for those choices are given in Section~\ref{sec:impurities}. Special attention must be devoted to the measures implemented to keep the probability of environmental contamination as low as possible, in particular during the detector installation which represents a delicate phase where the risk of nullifying all previous efforts is particularly high. This is discussed in Section~\ref{sec:environment}. \subsubsection{Radioactivity inputs for the detector components} \label{sec:impurities} The LS is the key component of the JUNO detector. The residual contaminations of Table\,\ref{tab:impurities} in the case of IBD analysis are assumed based on the experience of the Borexino\,\cite{Borexino} and KamLAND\,\cite{KamLAND} experiments. JUNO LS will undergo a sophisticated purification procedure that foresees four steps: Al$_2$O$_3$ filtration column (to improve optical properties), distillation (to remove heavy metals and improve the transparency), water extraction (to remove radioisotopes from U/Th chains and $^{40}$K), and steam stripping (to remove gaseous impurities, such as Kr and Rn). Preliminary tests performed with prototype plants indicated that those assumptions for $^{238}$U\ and $^{232}$Th\ (LS-reactor inputs of Table\,\ref{tab:impurities}) are within reach, so they are taken as the reference radiopurity requirements for the neutrino mass ordering physics channel. The OSIRIS (Online Scintillator Internal Radioactivity Investigation System) quality-check detector\,\cite{osiris}, which will be placed just before the LS injection point into the acrylic vessel, is designed to assure the fulfilment of the 10$^{-15}$\,g/g requirements for $^{238}$U\ and $^{232}$Th\ via a real-time measurement before filling the detector. The huge dimensions of JUNO required careful planning of the LS purification plants to correctly size them according to the unprecedented LS volume that will be processed. Additional key points of the plant design are severe $^{222}$Rn\ tightness requirements for all pipes (see Section\,\ref{sec:environment}), strict demands on the quality of the water ($^{232}$Th\ and $^{238}$U\ $\leq 10^{-16}$\,g/g, $^{222}$Rn\ $\leq 10$\,mBq/m$^3$) provided to all purification stages by the ultra pure water system that will be installed in the laboratory, and heavy prerequisites for the quality of the pure N$_2$ ($^{222}$Rn\ $\sim 10~\mu$Bq/m$^3$) that will be supplied by the nitrogen system to the purification plants and the LS containers, including the water pool. Moreover, strict cleaning requirements are foreseen for all mechanical components of the purification plants as well as severe dust control during the production and the installation. A constant check of the achievements during the installation phase will be pursued by means of the OSIRIS detector and of \emph{ad hoc} laboratory tests exploiting NAA coupled to coincident $\beta-\gamma$ measurements. All these precautions will hopefully grant the LS-solar contamination assumptions of Table\,\ref{tab:impurities}. Once again, all these requirements represent challenges that were never faced before the JUNO experiment, since the unprecedented LS mass prevents from reiterating the purification steps after the detector filling. The aims in terms of radiopurity of the acrylic vessel are very similar to those achieved by the SNO solar neutrino experiment~\cite{SNO}. The chosen production company proved to have the expertise and the proper facilities to sustain the production and assembly of the huge acrylic panels needed to build the JUNO sphere: a dedicated Class 10,000 clean room was set up at the company site, the mold is cleaned with deionized water, all pipes and containers are carefully washed, and $^{222}$Rn\ concentration is constantly monitored in all work areas. After the final grinding and polishing processes, a thin protection film made of polyethylene (PE) will be placed on each acrylic panel as UV protection and to prevent $^{222}$Rn\ diffusion and dust deposition on the surfaces: the film will be removed as last step during the vessel installation at the experimental site (see Section\,\ref{sec:environment}). All production stages are performed under the strict supervision of the JUNO collaboration, to guarantee high quality optical properties and negligible radioactive contamination during all phases of the sphere construction. Preliminary measurements of the bulk radioactivity of the produced acrylic panels show that the limits reported in Table\,\ref{tab:impurities} are safely within reach. A severe control of the mass production is being pursued by means of NAA and ICP-MS. The residual contaminants on the acrylic surfaces is being monitored by LA-ICPMS. Gamma spectroscopy on random samples will also be performed profiting of the most sensitive HPGe detectors to confirm that no contamination out of secular equilibrium, in particular for the $^{238}$U\ chain, occurred during the panel production. The structure that sustains the acrylic vessel is entirely made of SS. More than 1\,kton of low radioactivity SS -- grade 304L -- is produced by smelting of the molten iron in a clean furnace; no scrap steel is used. Also in this case, the whole production process is performed under the supervision of the JUNO collaboration. From the background point of view, the most critical components of this structure are the SS bars used to anchor the acrylic vessel to the truss itself. In fact, those rods will be embedded in the vessel through the acrylic node (see Figures~\ref{fig:sfig21} and \ref{fig:sfig3}), therefore they will be placed very close to the detector volume. For this reason, the requirements for the radiopurity of the SS bars in Table\,\ref{tab:impurities} are about one order of magnitude more severe than the ones for the SS truss. Preliminary gamma spectroscopy measurements confirmed the good quality of the purchased SS. Radioactivity checks will be performed during the production process to confirm the compliance with the upper limits of Table\,\ref{tab:impurities}. The other critical component for the JUNO background budget is the PMT glass. Table\,\ref{tab:impurities} details the agreed maximum impurity concentrations reported in the contracts signed with the PMT vendors. A huge R\&D effort was put by the NNVT company, in close cooperation with the JUNO collaboration, into controlling all glass production steps to reach the subscribed limits~\cite{sec5:MCP}. Gamma spectroscopy measurements on few glass bulb specimens were also performed with different HPGe detectors to verify compliance of both Hamamatsu LPMT glass and HZC Photonics SPMT glass \cite{cao2021mass} with the impurity concentration requirements during the mass production. Concerning the $^{222}$Rn in water, the requirement of 10 mBq/m$^3$ in Table 1 is based on the experience from SuperKamiokande and SNO experiments \cite{Nakano_2020,Blevis_2004}. This is quite challenging because of the radioactivity of the rock at the JUNO site (10 ppm for $^{238}$U/$^{226}$Ra) and the high radon level expected in the environment. A prototype of the water purification system demonstrated the ability to decrease the Rn in water below 10 mBq/m$^3$ by using degassers and a microbubble generator. During the data taking, the ultrapure water will continuously circulate at a flow of 100 tons/h from the purification system to the top and bottom inlets of the inner water pool towards the outer water pool. This strategy will prevent a possible loading of Rn in water when circulating near the pool edges, where the Rn activity is expected to be higher than at the center. To prevent the Rn diffusion from the rock and the concrete to the pool, a HDPE liner will be installed on the walls of the water pool. Preliminary measurements of its transparency performed in laboratory have demonstrated a sufficient Rn suppression factor by more than 4 orders of magnitude using HDPE samples with 5 mm thickness. In addition, the combination of a N$_2$ blanket (purified at 1 mBq/m$^3$ Rn level) in overpressure and a thick Tyvek cover on top of the pool will isolate the water from the air of the underground laboratory. The radon in the inner water pool may also come from the Rn emanation of the detector components in contact with the inner water pool, especially the PMT glass, the dominant material considering its radioactivity: several specimens from the three types of bare PMTs (NNVT, Hamamatsu, and HZC) were screened by means of the Rn emanation facility described in Section \ref{sec:material-selection} and have shown a negligible contribution compared to the 10 mBq/m$^3$ target activity. Some efforts have still to be done on $^{226}$Ra removal in water with resins. All these strategies and R\&D efforts are converging in order to fulfill the Rn requirement of Table~\ref{tab:impurities}, but cannot guarantee it regarding possible unexpected variation of the Rn level during JUNO data taking. Anyway, there are some margins and an increase of the Rn activity, for example, by a factor of 5 in the inner water pool would imply an increase of the count rate in the FV within 0.3 Hz, i.e. well below other contributions. \subsubsection{Environmental contamination control} \label{sec:environment} Even though the selected materials for the detector are compliant with the JUNO requirements, they can be contaminated afterwards by the environment during production, transportation, installation, as well as during data taking. As a result, special protections and surface cleaning are essential for all the critical materials after their final installation in the detector and before filling the detector with ultra pure water and LS. Special attention must be devoted to the surface cleanliness of the tanks or the equipment that will be directly in contact with the LS during the purification steps. The baseline limit for the residual dust on the surface is 0.1 mg/m$^2$ assuming that the radioactivity in the dust is similar to the one of the rock (see Table\,\ref{tab:impurities}): in this way the resulting contamination should not exceed the 10$^{-16}$ g/g level in 20 kt of LS. The cleanliness of the environment during installation and vessel filling is also very important, since the acrylic will be exposed to the air for a limited time after the thin PE film removal and subsequent final cleaning, and before the filling with the LS. Our baseline for the cleanliness of the air inside the acrylic sphere should reach a level better than Class 10000. The radon concentration in the air of the underground laboratory can reach more than 100~Bq/m$^3$ with a risk of $^{222}$Rn\ to be dissolved in the LS, leading to the long-lived $^{210}$Pb radionuclide. It is thus very important to have stringent leakage requirements. The leakage test is planned by means of vacuum force technology. Assuming the pressure differential to be 1~bar and the radon concentration in underground air equal to 100~Bq/m$^3$, the leakage for the single component should reach $\sim$4$\times$10$^{-6}$ mbar$\cdot$L/s with vacuum-air test. The amount of dust and rock that may remain in the water pool should be minimized by a strict quality control of the surfaces before filling the detector with ultrapure water. Details concerning the procedures of cleanliness and leakage control are still under finalization and will be presented in forthcoming JUNO technical papers. \section{Results of the Monte Carlo simulations} \label{sec:mc-results} In this last part of the paper we discuss the outcomes of the background Monte Carlo simulations performed with the SNiPER software after enabling the full reproduction of the event formation, i.e. taking into account all physical and geometrical effects that come into play following the energy deposition in the LS. Therefore, in this section all results include the energy resolution, the optical propagation, the charge conversion, and the non-uniformity response of the detector (these effects were deeply described in previous works\,\cite{juno-calibration,DayaBay-scint}). The assumed impurities for the main components of the JUNO detector, which are the inputs to compute the expected background impact, are first analysed in Section~\ref{sec:impurities-intro}. The simulation outcomes are then reported in Section~\ref{sec:bkg-rates} in the chosen energy interval between 0.7\,MeV and 12\,MeV. Finally, the different possible scenarios resulting from the accidental coincidences that could resemble an IBD event are discussed in Section~\ref{sec:bkg-impact}. \input{MCresults/impurity-choice} \input{MCresults/bkg-rates} \input{MCresults/bkg-impact} \subsection{Expected background count rates in JUNO} \label{sec:bkg-rates} Full event simulation is performed with the SNiPER framework, including the energy resolution, the optical propagation, the charge conversion, and the non-uniformity of the detector response. The radioactivity coming from the main materials are simulated with the same statistics presented in Section~\ref{sec:mc-simulations}, and the total number of photoelectrons (PEs) collected by both LPMTs and SPMTs is evaluated for each event. After the energy conversion, the obtained spectra of the reconstructed energy $E_{rec}$ are analysed to derive all needed information. The conversion from the total number of PEs to the energy unit (MeV) is carried out by simulating the uniformly distributed 1 MeV gammas depositing energy in the whole LS volume. The energy non-linearity of the detector response is out of the scope of this paper (see Ref.~\cite{juno-calibration} for details) and thus a single energy value is sufficient to derive the reconstructed energy. The resulting total number of PEs as a function of volume is shown in Figure~\ref{fig:lightyield}, with $\sim$1400 PEs expected at the center of the detector. The sharp decrease of the number of PEs at large radii is due to the energy leakage near the edge (Compton scattering) and total reflection of the optical photons at the interface between the acrylic and water, which will lead to larger statistical fluctuations on the reconstructed energy. Combining this effect with the energy resolution, this explains why the reconstructed energy from natural radioactivity can be spread up to 6 MeV (see later Figure~\ref{sec5:singlesR3E}). \begin{figure}[h] \centering \includegraphics[width=0.7\textwidth]{figure/LightYield.pdf} \hfill \caption{\label{fig:lightyield} Uniformly distributed 1 MeV gammas are simulated in the LS, and the total number of PEs from both LPMTs and SPMTs as a function of volume is shown in this figure.} \end{figure} The impurity of each material is taken from Table\,\ref{tab:impurities} and the final SNiPER simulation results, including all above mentioned effects, as a function of energy threshold $E_{th}$\ and FV radius are shown in Figure~\ref{spectra}. The total count rate expected for JUNO above $E_{th}$~=~0.7~MeV is about 60~Hz as shown in Figure~\ref{fig:rate-threshold}. About 70\% of the alpha events in the LS are removed after applying the $E_{th}$\ cut due to their lower quenched energy. Additional alpha event identification and rejection are foreseen with an efficiency larger than 99\% \cite{Keeffe2011} during data taking by using well-known pulse shape discrimination techniques. The total singles rate with energy larger than 0.7 MeV as a function of FV cut is illustrated in Figure~\ref{fig:rate-fv}, where a sharp decrease of the rate from the edge of the LS to the center is clearly visible. Thus, the external background can be effectively removed with a suitable FV cut, as anticipated by Figure~\ref{fig:acrylic-FV-plot}. \begin{figure}[tbp] \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\textwidth]{figure/Plot-rate-threshold_3.1.png} \caption[]{\label{fig:rate-threshold} } \end{subfigure} \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\textwidth]{figure/Plot-rate-FV_3.1.png} \caption[]{\label{fig:rate-fv}} \end{subfigure} \caption[]{Full background simulation results with SNiPER including all materials composing the detector with the contaminations listed in Table\,\ref{tab:impurities}. (a) Singles event rate as a function of energy threshold in DV. About 60~Hz total singles rate is achieved with 0.7 MeV energy threshold (shown as dotted line). (b) Singles event rate with energy larger than 0.7 MeV as a function of the FV cut. The singles rate can be reduced down to 7 Hz within a radius of 17.2 m (shown as dotted line).} \label{spectra} \end{figure} \begin{table}[tbp] \centering \begin{tabular}{|c|c|c|c|c|c|c|c|c|} \hline \multirow{2}{*}{Material} & \multirow{2}{*}{Mass} & \multicolumn{5}{c|}{Target impurity concentration} & \multicolumn{2}{c|}{Singles} \\ \cline{3-9} & & $^{238}$U & $^{232}$Th & $^{40}$K & $^{210}$Pb & $^{60}$Co & DV & FV \\ & [t] & [ppb] & [ppb] & [ppb] & [ppb] & [mBq/kg] & [Hz] & [Hz] \\ \hline \hline LS-reactor & 20000 & 10$^{-6}$ & 10$^{-6}$ & 10$^{-7}$ & 10$^{-13}$ & & 2.5 & 2.2 \\ \hline Acrylic & 610 & 10$^{-3}$ & 10$^{-3}$ & 10$^{-3}$ & & & 8.4 & 0.4 \\ \hline \multirow{2}{*}{SS structure} & 1000 & 1 & 3 & 0.2 & & 20 & \multirow{2}{*}{15.9} & \multirow{2}{*}{1.1} \\ & 65 & 0.2 & 0.6 & 0.02 && 1.5 && \\ \hline \multirow{3}{*}{PMT glass} & 33.5 & 400 & 400 & 40 && & \multirow{3}{*}{26.2} & \multirow{3}{*}{2.8} \\ & 100.5 & 200 & 120 & 4 && &&\\ & 2.6 & 400 & 400 & 200 && &&\\ \hline \multirow{2}{*}{PMT readout} & 125 &68 & 194 & 5 &&16& \multirow{2}{*}{3.4} & \multirow{2}{*}{0.4} \\ & 16.3 & 93 & 243 & 12 &&14&& \\ \hline Other && &&&& & 2.5 & 0.3 \\ \hline \hline \multicolumn{7}{|c|}{Sum} & 59 & 7.2 \\ \hline \end{tabular} \caption{Final background budget for the main materials used in the JUNO detector with reconstructed energy $E_{rec}$ larger than 0.7 MeV. The expected count rates are given both in the full DV ($r_{LS}$\,=\,17.7\,m) and in the default FV ($r_{LS}$\,=\,17.2\,m). The ``Other'' components include all materials that have relatively smaller contribution to the background (compare with Table\,\ref{tab:singles-noFV}), such as the calibration parts, the LPMT cover, the rock, and the radon in water. These results include energy resolution, optical propagation, charge reconstruction, and non-uniformity corrections. \label{tab:bkgBudget}} \end{table} Table\,\ref{tab:bkgBudget} summarizes the contaminations and count rates of each material. The mass and the putative contaminations for each material are copied here from Table\,\ref{tab:impurities} for convenience. Count rates are reported in the case of both DV ($r_{LS}$\,=\,17.7\,m) and the default FV cut ($r_{LS}$\,=\,17.2\,m). Compared with Table~\ref{tab:singles-noFV}, the final count rates in DV are larger after applying the energy resolution, especially the worse energy resolution at the edge. Based on the results of Table\,\ref{tab:singles-noFV}, we list in Table\,\ref{tab:bkgBudget} only those items giving the dominant contributions (above 0.3 Hz in the FV), while materials with small contributions are grouped together in ``Other''. In the last row of the table, the expected sum count rates from all material contaminants are shown: the main contributions are due to the glass of the PMTs, the SS structure, and the LS itself. It has to be stressed once more that the impurity concentrations of the various detector components of Table\,\ref{tab:impurities} are presumed on the basis of preliminary screening measurements or of literature values, and should be updated once the final numbers will be available. In any case, the JUNO requirement for a background count rate lower than 10\,Hz for the IBD analysis channel seems within reach. The informations contained in Figure~\ref{spectra} can be combined in a single plot, which better shows the correlations among the different parameters. The two dimension distribution of singles rate as a function of volume (bottom X-axis) or radius (top X-axis) and reconstructed energy E$_{rec}$ (Y-axis) is shown in Figure~\ref{sec5:singlesR3E}. The contribution of the LS is clearly identified by its uniform distribution in the volume up to $\sim$1 MeV. Most of the events come from the external background (i.e. from the materials outside the LS) and can be effectively removed by the FV cut at r$_{LS}$=17.2 m illustrated by the dashed line. \begin{figure}[h] \centering \includegraphics[width=0.9\textwidth]{figure/singlesR3E.pdf} \hfill \caption{\label{sec5:singlesR3E} The singles event rate as a function of volume (bottom X-axis) or radius (top X-axis) and reconstructed energy E$_{rec}$ (Y-axis). The default FV radius cut is shown as the dashed line.} \end{figure} \subsubsection{SNIPER simulation framework} \section{SNiPER simulation framework} \label{sec:sniper} \begin{figure}[tbp] \begin{subfigure}{.6\textwidth} \centering \includegraphics[width=.8\linewidth]{figure/SNiPER_truss.png} \caption{} \label{fig:sfig11} \end{subfigure}% \begin{subfigure}{.4\textwidth} \centering \includegraphics[width=.8\linewidth]{figure/SNiPER_node.png} \caption{} \label{fig:sfig21} \end{subfigure}% \\ \begin{subfigure}{.4\textwidth} \centering \includegraphics[width=.8\linewidth]{figure/SNiPER_chimney.png} \caption{} \label{fig:sfig31} \end{subfigure} \begin{subfigure}{.6\textwidth} \centering \includegraphics[width=.8\linewidth]{figure/SNiPER_pmt.png} \caption{} \label{fig:sfig41} \end{subfigure} \caption{Details of the JUNO experimental setup as reconstructed by the SNiPER simulation code: a) SS truss supporting the PMTs and the acrylic sphere; b) Acrylic sphere containing the LS with bars on the outside for the connection to the steel truss; c) Chimney between the central detector and the calibration house on the top; d) Large and Small PMT systems.} \label{fig:juno-by-sniper} \end{figure} The JUNO offline software is developed using the SNiPER (Software for Non-collider Physics ExpeRiments) tool~\cite{sec4:sniper1,sec4:sniper2}. The simulation framework is in charge of managing event data, detector geometries and materials \cite{kli_2018,szhang_2021}, physics processes, simulation truth information, etc. It glues physics generator, detector simulation and electronics simulation modules together to achieve a full simulation chain. For the Geant4-based detector simulation, the detector geometry includes all main materials, such as LS, acrylic sphere, SS structure, PMTs, water pool, and rock, and the visualization geometries \cite{You_2018,Zhu_2019} are shown in Figure~\ref{fig:juno-by-sniper}. The physics generators generate kinematic information of primary particles, which are saved into GenEvent objects. In the next step, the detector simulation algorithm accesses these GenEvent objects and starts tracking. Hits, which contain charge and time information, are generated in sensitive detectors and saved in SimEvent objects. The main parameters for PMT response are set to test data, which makes the results close to the real data in future. After that, the electronics simulation algorithm reads these SimEvent objects and performs the digitization, which generates ElecEvent objects containing waveforms information. These waveforms are processed by PMT calibration algorithm and CalibEvent objects are saved. The event reconstruction algorithm \cite{lizy_2021,qianz_2021,huang_2021} performs the event reconstruction by reading CalibEvent objects and stores RecEvent objects. At last, physicists can perform any physics analysis from RecEvent objects. In this paper, only optical simulation is done considering the quenching effect, absorption, re-emission etc. Most of the optical parameters are got from Daya Bay, and scaled to JUNO expected number. In the case of radioactive decay chain simulations (e.g. $^{238}$U, $^{232}$Th), each daughter nucleus is simulated separately without secondary decay. At the end, all events are added together in a single spectrum assuming the chain is in secular equilibrium. \subsubsection{CENBG simulation code} \section{G4-LA simulation code} \label{sec:cenbg} The G4-LA simulation code is based on GEANT4 toolkit using the G4RadioactiveDecay class in order to generate the decays of all the radionuclides of interest. The relevant contaminants (mostly U and Th chains and $^{40}$K) are generated uniformly in the bulk materials. The subsequent particles are tracked and the deposited energy as well as the coordinates of the mean deposited energy in the LS are recorded, allowing energy and FV cuts. The quenching effect for alpha and electrons particles has been taken into account as described in the paper. The detector geometry is simplified and includes the most critical materials of JUNO (LS, acrylic vessel and inner water pool). This allows a precise crosscheck of the energy spectra and the derived singles rate for LS and acrylic vessel in order to validate the Monte Carlo electromagnetic simulation of SNiPER. \subsubsection{ARBY simulation code} \section{ARBY simulation code} \label{sec:arby} \begin{figure}[tbp] \begin{subfigure}{.7\textwidth} \centering \includegraphics[width=.8\linewidth]{figure/Arby_JunoMC1.png} \caption{} \label{fig:sfig1} \end{subfigure}% \begin{subfigure}{.3\textwidth} \centering \includegraphics[width=.8\linewidth]{figure/Arby_Nodi2.jpg} \caption{} \label{fig:sfig2} \end{subfigure}% \\ \begin{subfigure}{.3\textwidth} \centering \includegraphics[width=.8\linewidth]{figure/Arby_Nodo_completo.png} \caption{} \label{fig:sfig3} \end{subfigure} \begin{subfigure}{.35\textwidth} \centering \includegraphics[width=.8\linewidth]{figure/Arby_PMT2.png} \caption{} \label{fig:sfig4} \end{subfigure} \begin{subfigure}{.3\textwidth} \centering \includegraphics[width=.75\linewidth]{figure/Arby_PMT-section.png} \caption{} \label{fig:sfig5} \end{subfigure} \caption{Details of the JUNO experimental setup as reconstructed by the ARBY simulation code: a) SS truss supporting the PMTs and the acrylic sphere; b) Acrylic sphere containing the LS with bars on the outside for the connection to the steel truss; c) Acrylic node and supporting SS bar; d) Large and Small PMT systems; e) Sections of the LPMTs showing potting elements.} \label{fig:juno-by-arby} \end{figure} ARBY is a general purpose Monte Carlo simulation code — written by O.\,Cremonesi at INFN~Milano-Bicocca — designed for low energy particle physics applications. It is based on GEANT4 toolkit \cite{Geant4} and its main peculiarities are its high flexibility and ease of use. In ARBY, in fact, the geometrical description of the particular application to be simulated by the user (with very simple and intuitive commands) is completely separated from the physics implementation and code evolution, which are maintained by the developers. ARBY covers a wide variety of GEANT4 physics processes, includes the propagation of photons, alpha and beta particles, muons, neutrons and protons as well as nuclear recoils from decaying nuclides, and allows the generation of radioactive decay chains. For the latter, ARBY uses the G4RadioactiveDecay class of GEANT4, which offers the possibility of simulating the full disintegration of a nuclide through different processes profiting from an extensive data base (ENSDF \cite{ensdf}) to obtain all relevant information about the decay. When a daughter nucleus is itself unstable, like in the natural decay chains of $^{238}$U\ and $^{232}$Th, ARBY allows to keep track of the single steps in the chain — i.e. of each individual decay — while scoring the event information. In this way the peculiarities of subsequent decays, like time correlations, do not get lost and allow to reconstruct particular effects which can manifest experimentally. Moreover, atomic effects (like X-ray production) and nuclear recoils accompanying each decay are also considered by ARBY, and included in the stored data. Other information like the position of the event in the detector volume or the particle quenching in organic scintillators can be also saved for each event. The user needs just to describe the detector arrangement by means of a configuration file, where details concerning the materials in use as well as the position of the radioactive sources — i.e. the contaminant concentration of the different materials — are declared. The ARBY software, and its subversions, are being used since many years by the INFN~Milano-Bicocca group for different applications, like the efficiency evaluation in gamma spectroscopy with HPGE diodes, or the investigation of the residual contamination sources and the development of accurate background models in rare event experimental searches with bolometers (see e.g. \cite{cuore0-model,cuore-budget}). In the case of JUNO, a configuration file was built to reconstruct with ARBY the main detector components: the LS, the acrylic sphere, the SS truss, the large and small PMT systems together with their readout electronics, the calibration equipment, the water pool, and the veto system. The different contamination sources were then systematically positioned in each of these materials and the resulting experimental spectrum evaluated with ARBY. Some details of the reconstructed geometries are shown in Figure\,\ref{fig:juno-by-arby}. \subsection{Monte Carlo simulations} \label{sec:mc-simulations} A whole detector simulation is realized to evaluate the radioactivity contributions in terms of singles rate from the main detector materials listed in Section~\ref{sec:setup}. The geometry of the experimental setup is reconstructed by the simulation code with highest possible detail. Each component is uniformly contaminated with the various sources described in Section~\ref{sec:bkg-sources} and its impact on the background count rate is then computed. The outcome of these simulations is an invaluable guidance during both the experimental design and the material selection processes, to choose the best solutions that reduce the impact of the dangerous background. In the end, the results will be useful for the evaluation of the overall radioactivity background budget as well as for the optimization of both the FV and the energy threshold cuts for the data analysis, depending on the physics channels under study. The official JUNO offline software is based on the SNiPER framework (described in Appendix\,\ref{sec:sniper}) and was developed according to the demanding requirements of the experiment profiting from the modularity and the flexibility offered by the SNiPER environment~\cite{sec4:sniper1,sec4:sniper2}. It comprises the physics generator, the detector simulation, and the electronics simulation as separated modules, which are integrated to return a complete reproduction of the real events. In the lack of an experimental benchmark while the experiment is under construction, two additional software codes, ARBY (described in Appendix\,\ref{sec:arby}) and G4-LA (described in Appendix\,\ref{sec:cenbg}), based on completely different logical architectures, were used for the simulation of the JUNO background, in order to have a validation of the background estimation outcomes. \subsection{Material assay and measuring techniques} \label{sec:material-selection} \begin{table}[tbp] \centering \begin{tabular}{|l|c|c|c|c|c|c|c|} \hline \multirow{3}{*}{Material} & \multirow{3}{*}{Mass} & \multirow{3}{*}{Radius} & \multicolumn{5}{c|}{Target impurity concentration} \\ \cline{4-8} & & & $^{238}$U & $^{232}$Th & $^{40}$K & $^{210}$Pb/$^{222}$Rn & $^{60}$Co \\ & [t] & [m] & [ppb] & [ppb] & [ppb] & [ppb]/[mBq/m$^3$] & [mBq/kg] \\ \hline \hline Liquid Scintillator &&&&&&&\\ LS-reactor & \multirow{2}{*}{20000} & \multirow{2}{*}{0--17.7} & 10$^{-6}$ & 10$^{-6}$ & 10$^{-7}$ & 10$^{-13}$ ppb & \\ LS-solar &&& 10$^{-8}$ & 10$^{-8}$ & 10$^{-9}$ & 10$^{-15}$ ppb & \\ \hline Acrylic vessel & 580 & 17.7--17.8 & 0.001 & 0.001 & 0.001 & & \\ Acrylic nodes & 28.5 & 17.8-17.9 & 0.001 & 0.001 & 0.001 & & \\ \hline Calibration parts & 0.04 & & 1.5 & 4.5 & 0.02 &&\\ \hline SS structure &&&&&&&\\ -- truss & 1000 & 20.0-20.5 & 1 & 3 & 0.2 &&20 \\ -- bars & 65 & 17.9-20.0 & 0.2 & 0.6 & 0.02 && 1.5 \\ \hline LPMT glass &&&&&&&\\ -- NNVT & 84.5 & 19.2-19.8 & 200 & 120 & 4 && \\ -- Hamamatsu & 33.5 & 19.2-19.8 &400 &400 &40 & &\\ -- Veto (NNVT) & 16.0 & 20.2-20.8 & 200 & 120 & 4 && \\ \hline LPMT cover &&&&&&&\\ -- acrylic & 110 & 19.2-19.4 & 0.003 & 0.01 & 0.01 && \\ -- SS & 150 & 19.4-19.8 & 0.4 & 2.5 & 0.12 & &\\ \hline LPMT readout &&&&&&&\\ -- divider & 0.6 & 19.8-19.9 &3000 & 5000 & 100 &&\\ -- potting & 24.5 & 19.7-19.9 & 70 & 50 & 4 &&\\ -- UWB & 100 & 20.1-20.4 & 50 & 200 & 5 && 20\\ \hline SPMT glass & 2.6 & 19.3-19.4 &400 &400 &200 & &\\ \hline SPMT readout &&&&&&&\\ -- divider & 0.15 & 19.4 &3000 & 10000 & 200 &&\\ -- potting & 5.1 & 19.4-19.5 & 100 & 50 & 20 &&\\ -- UWB & 11 & 20.1-20.4 & 50 & 200 & 5 && 20\\ \hline Water & 35000 & 17.8--21.8 & &&&10 mBq/m$^3$& \\ \hline Rock & && 10000 & 30000 & 5000 && \\ \hline \end{tabular} \caption{\label{tab:impurities} Target values for the impurity concentrations in the different detector materials of the JUNO detector. For each detector component, the mass and its geometrical position, i.e. the radius quoted from the center of the LS volume, are reported. LS-reactor refers to the target impurity values required for mass hierarchy determination, whereas LS-solar refers to the target impurity values for solar neutrinos studies.} \end{table} A crucial prerequisite for the components of the setup of ultra-low background experiments is the radiopurity level. All materials must be selected according to their intrinsic low concentration of natural radioactive species, and any processing or handling must be carefully worked out in order not to accidentally contaminate the bulk or surface of the final product. This is achieved by setting up a radioactive screening program that includes different techniques to be exploited at the various stages of the component production according to the type of contaminant and to the required sensitivity to reach the JUNO physics goals. Table\,\ref{tab:impurities} reports the minimal requirements for the radiopurity of the materials to be employed in the JUNO experimental setup. It is worth noting that the radiopurity requirements are less and less stringent for detector components with low mass and far from the vessel (from acrylic to SS truss), compared to the LS itself. A discussion on how these choices were finally made is postponed to Section\,\ref{sec:impurities}. The assumed values are expressed in Bq/kg or in mass concentration units~\footnote{For convenience, the conversions between the two units used in this paper are reported: 1\,mBq of $^{232}$Th\ activity per kg of material is equal to $2.5 \times 10^{-10}$\,g/g (or 0.25\,ppb) of $^{232}$Th\ mass concentration in that material. Similarly, 1\,mBq/kg of $^{238}$U\ means $8.1 \times 10^{-11}$\,g/g (or 81\,ppt) of $^{238}$U, and 1\,mBq/kg of $^{40}$K\ means $3.8 \times 10^{-12}$\,g/g (or 3.8\,ppt) of $^{40}$K, corresponding to $3.2 \times 10^{-8}$\,g/g of natural K.} (g/g, i.e. grams of contaminant per gram of material, and its sub-multiples ppm\,$=10^{-6}$\,g/g, ppb\,$=10^{-9}$\,g/g, and ppt\,$=10^{-12}$\,g/g). In the following we briefly describe the main measuring techniques available within the JUNO collaboration which were used to select the materials for the construction of the experiment according to the requirements of Table\,\ref{tab:impurities}. For some of them, e.g. the U/Th content in the LS, dedicated experimental facilities are being used to screen the samples at the desired sensitivity that are not described here. A comprehensive discussion of the different assays and measurement results, in fact, goes beyond the scope of the present paper. Few details can be found in Section\,\ref{sec:impurities}, where references to specific publications are given. \paragraph{Low background spectroscopy} Low background gamma spectroscopy with High Purity Germanium detectors (HPGe) is a common technique for screening materials needed to build detectors for rare event studies. It allows a multi-radionuclide analysis of a sample in one measurement, giving access to its bulk activity for natural radioactivity (U and Th chains and $^{40}$K), and for cosmogenic or man-made gamma emitters ($^{60}$Co, $^{137}$Cs, etc) in the energy range from 0 to 3\,MeV. The main advantage of this technique consists in measuring independently the activities of several radionuclides in the U/Th chains in order to check whether secular equilibrium is achieved. It is of great importance e.g. for the Uranium chain since gamma spectroscopy is able to quantify $^{226}$Ra and $^{210}$Pb activities. Low background gamma spectroscopy with HPGe has typical sensitivities in the 10 ppt -- 10 ppb range or more (100 $\mu$Bq/kg -- 100 mBq/kg). Ultra-low background facilities in underground laboratories may reach the ppt scale ($\sim 10$\,$\mu$Bq/kg) with few tens of kg of sample. Despite a moderate sensitivity compared to the other techniques described below (NAA and ICP-MS), it is the only technique able to measure short and medium-lived radioisotopes. The gamma spectrometers used for material screening in JUNO are HPGe detectors protected by passive and active shieldings and spread in several underground laboratories around the world (China JinPing underground Laboratory in China, Laboratoire Souterrain de Modane in France, Laboratori Nazionali del Gran Sasso in Italy\footnote{Courtesy of Dr.\,Matthias Laubenstein.}) or sea level laboratories (IHEP in China, Milano-Bicocca in Italy, CENBG Bordeaux in France). They were used extensively to select a lot of components (such as SS from truss, bars and nodes, glass from LPMTs and SPMTs, electronics and calibration parts, etc.) or to investigate for the secular equilibrium break in some of them (acrylic, PPO, etc.). \paragraph{Neutron Activation Analysis (NAA)} NAA is a very sensitive method for qualitative and quantitative determination of trace elements based on the measurement of characteristic radiation from radionuclides formed by neutron irradiation of the material. The principle is very simple: following neutron capture by the nuclide under investigation, a product radioactive nuclide is formed which is usually $\beta$-unstable and decays to excited states of the corresponding daughter nucleus, thus emitting characteristics $\gamma$-rays that can be measured by a HPGe spectrometer. NAA can achieve substantially greater sensitivity than direct $\gamma$-ray counting: it can be applied to quantify the concentration of natural contaminants ($^{238}$U, $^{232}$Th, and $^{40}$K) in detector materials that show no long-lived neutron activation products emitting $\gamma$ lines which could interfere with the measurement. The Milano-Bicocca group is being pursuing NAA on many materials since several years, using the TRIGA Mark II research reactor of University of Pavia (Italy) as the neutron source and the various HPGe detectors at the Radioactivity Laboratory of Milano-Bicocca University. Typical sensitivities are at ppt and sub-ppt levels \cite{NAA-talk}. For JUNO, NAA was used for the screening and quality control of acrylic, LAB, Teflon, and PPO. \paragraph{Inductively coupled plasma mass spectrometry (ICP-MS)} ICP-MS is widely used for screening materials of low background detectors due to its high sensitivity to trace $^{238}$U and $^{232}$Th. The ICP-MS located at IHEP in China is built in a Class 1000 clean room, and all other chemical operations are done in a Class 100 clean room. The count rate for ppt level of $^{238}$U/$^{232}$Th can reach $\sim$1000 counts per second (cps), and the detection limit can reach 0.01 ppt for pure water. For acrylic screening, a vaporization setup for acrylic pre-treatment is built in a Class 100 environment. With mature procedures for contamination control, the acrylic samples can be easily measured by ICP-MS to sub-ppt level in two days~\cite{sec4:ICP-MS_acrylic}. Besides that, this technique will play an important role on the quality control of the cleaning procedures and the purified water. Laser Ablation ICP-MS is a complementary technique to ICP-MS to measure U/Th contaminations. The chemical preparation of the sample is replaced by a UV femtosecond laser used in an ablation mode. This promising technique has preliminarly achieved a surface or bulk sensitivity better than 10$^{-12}$ g/g level for U/Th in few minutes with only few tens of $\mu$g sample \cite{LA-ICPMS} and is also well-suited to screen the surface treatment of the acrylic panels and other critical materials for JUNO. \paragraph{Low background radon facilities} There are multiple sources of radon that may contaminate the water or the nitrogen in JUNO: the contamination of the water or the nitrogen itself, the radon diffusion through barriers, the radon emanation from materials immersed in the inner part of the water pool close to the acrylic sphere, etc. Thus, several facilities have been developed to reduce as much as possible the radon activity in the water pool or in the nitrogen gas. The radon measurement system developed at IHEP, which consists of an atomizer, a de-humidification system and an electrostatic radon detector, can be used to quantify the radon concentration in the water and gas~\cite{IHEPradon1,IHEPradon2}. The atomizer is a water vapor balancing device which could transfer the dissolved radon gas from water into air during the water flowing. The electrostatic radon detector determines the radon concentration by detecting the alphas from the $^{222}$Rn\ daughters ($^{218}$Po\ and $^{214}$Po) with a Si-PIN photo-diode. The sensitivity of the radon detector is $\sim$\,5~mBq/m$^3$ for a one day measurement. The system will be used to measure and monitor the radon concentration in the ultra-pure water of the water Cherenkov detector as well as in the sealed nitrogen gas used on top of the JUNO pool. A system to measure the radon activity of high purity nitrogen needed by JUNO was also developed~\cite{IHEPradon3}. The measurement setup contains two parts, a radon detection chamber (a 0.28~m$^{3}$ stainless steel tank) and a radon enrichment system (with activated carbon as adsorbent). The background of radon detection chamber is $\sim$\,2~mBq/m$^{3}$ and the enrichment efficiency of the system was calculated to be about 50\% under 25~slpm flow rate. A radon activity at the level of 10~$\mu$Bq/m$^{3}$ could be measured by this system in the high purity nitrogen. Low background radon emanation technique is complementary to the low background gamma spectroscopy technique and allows the measurement of the rate of radon atoms emanating from the surface of a given material depending on the activity of $^{226}$Ra, its long-lived progenitor. The emanation chamber used at CENBG laboratory in France is a vast stainless steel tank (0.7 m$^3$) allowing to fit in large material surfaces or a large number of samples. It is coupled to a low background electrostatic radon detector equipped with a Si-PIN diode \cite{Radon-detector} to perform the alpha spectroscopy of the $^{222}$Rn daughters. The typical sensitivity of the setup for 1 m$^2$ sample is few hundreds of atoms emanating per second and per square meter and the ultimate sensitivity can reach $\sim$ 10 $^{222}$Rn\ atoms/s/m$^2$ for a 30 m$^2$ sample \cite{Radon-emanation}. It is sensitive enough to screen large volume/surface materials that will be immersed in or around the JUNO water pool, such as rocks, 20-inch and 3-inch PMTs, HDPE liner, etc., in order to investigate the fulfillment of the $^{222}$Rn\ activity requirement in water (see Table~\ref{tab:impurities}). A stainless steel bi-chamber was developed at CPPM laboratory in France to measure the radon transparency of the liner. The two identical chambers have a volume of $\sim$1.8~L. The sample to be measured is placed between the two chambers and the sealing is ensured by two flat Silicone gaskets. The upper chamber contains a $^{222}$Rn\ source with a concentration of $\sim$\,740~kBq/m$^3$. The second chamber in which the radon passing through the sample is measured was initially filled with nitrogen. It is equipped with two valves and a second circulation pump, to homogenize the gas and fill a commercial 120 cm$^3$ Lucas cell used as a radon detector with a background of 15 Bq/m$^3$. The $^{222}$Rn\ transparency down to 2$\cdot$10$^{-5}$ can be measured by this setup for a material such as the HDPE liner. \section{Methodology for background control} \label{sec:methodology} A proper design of the experimental setup is of paramount importance for the containment of the radioactivity background. The final arrangement of the detector is a delicate balance between the engineering plan and the need for the lowest possible count rate due to the spurious events. The trade-off is usually achieved by a careful selection of the materials to be used for the construction of the apparatus, according not only to their mechanical characteristics but also to their intrinsic radiopurity. By means of \emph{ad hoc} Monte Carlo simulation of the expected radioactivity background, the best geometrical layout is thus evolved as the result of the radioactivity screening of the various materials and their positioning within the experimental setup. One important point to be underlined for low background experiments is that very often the sensitivity needed to validate raw materials is at the cutting-edge of available screening techniques: this difficulty implies that the approval of certain materials or of particular production and cleaning protocols requires by itself to conceive non trivial dedicated test facilities. JUNO surely benefits from the experience of past and running neutrino and dark matter experiments using the same type of detector, to select the proper materials and related cleaning procedures to achieve its goals: the challenge comes from the pushing of ultra--low background techniques to the largest experimental scale. In the next sections we will illustrate the experimental techniques used for the material screening and the simulation codes developed for the evaluation of the JUNO background. \input{Methodology/material-selection} \input{Methodology/mc-simulations} \input{Methodology/mc-validation} \subsection{Validation of the Monte Carlo outputs} \label{sec:mc-validation} To validate the results of the JUNO background simulations, both energy spectra and overall count rates induced by natural radioactivity contaminants (Section\,\ref{sec:natural-sources}), as obtained by the three codes, were compared. For the validation process, the simulated geometry included just the acrylic vessel and the LS inside it: despite the chosen experimental configuration was quite simple, these studies involved all relevant physics phenomena and allowed to highlight unexpected bugs either in the physical implementation or in the logic of the simulations. For a meaningful comparison, a common set of basic physical hypotheses was adopted for the three codes: i) the chosen GEANT4 version was 10.04.p2~\cite{Geant4-web} with the \textit{Livermore} low energy electromagnetic physics list; ii) all codes finally used the Geant4 particle source primary generator for the properties related to each radioactive decay, i.e. daughter nucleus, mean life, decay modes, branching ratios, and emission spectra; iii) from the experience of the Daya Bay experiment~\cite{DayaBay-scint}, which used a scintillation detector very similar to the JUNO one, the secondary particle production thresholds in Geant4 were set at 0.1\,mm for electrons and at 1\,mm for gammas; iv) in the propagation of protons, alpha particles and nuclear recoils, the Geant4 \textit{StepFunction} (the computation of the mean energy loss per propagation step) was set at default values; v) finally, the scintillation non-linearity was described by means of the generalized Birks semi-empirical formula. Here, the energy converted to scintillation photons, $E_{scint}$, is related to the stopping power $dE/dx$ of a charged particle of kinetic energy $E$ via: \begin{equation} E_{scint}=S\int_{0}^{E} {\frac{dE}{1+kB(\frac{dE}{dx})+C(\frac{dE}{dx})^2}} \label{eq:birks-formula} \end{equation} \noindent with $kB$ and $C$ being the Birks coefficients. The parameter $S$ is a normalization factor which gives the scintillation efficiency. \begin{table}[tbp] \centering \begin{tabular}{|l|c|c|} \hline & $kB/\rho \times 10^{3}$ & $C/\rho^2 \times 10^{6}$\\ Particle type & [g/cm$^2$/MeV] & [(g/cm$^2$/MeV)$^2]$ \\ \hline \hline Electrons, Positrons & 6.5 & 1.5 \\ Alphas, Nuclear recoils & 3.705 & 1.5 \\ Protons & 6.5 & 1.5 \\ \hline \end{tabular} \caption{\label{tab:birks-coeff} Values of the Birks' coefficients of Equation\,\ref{eq:birks-formula} divided by the LS density $\rho$ ($\rho = 0.86$\,g/cm$^3$) used to compute the ionization quenching in JUNO simulations.} \end{table} In the Birks model, only a fraction of the energy deposited in the LS by the ionizing particle is actually transferred to the fluorescent molecule (2.5\,g/L of PPO for JUNO~\cite{juno-scint}) and ready to be converted in scintillation light, a fact that is usually referred to as \textit{ionization quenching} of the light yield. Table\,\ref{tab:birks-coeff} reports the Birks' coefficients used for the present JUNO simulations, inherited from Daya Bay experience~\cite{DayaBay-scint}. For the purpose of the validation of the background simulations, only the energy deposited and stored in the LS -- $E_{scint}$ in Equation\,\ref{eq:birks-formula} -- was considered, i.e. nor optical propagation nor light readout were involved at this step with SNiPER. The Monte Carlo outputs of the three simulation codes were thus converted into deposited energy spectra in the range between 0 and 12\,MeV with 10\,keV binning and without energy threshold applied. Nor detector time resolution nor energy resolution were included. The whole LS volume --- i.e. scintillator radius $r_{LS}$\ equal to the acrylic sphere inner radius, $r_{LS}$\,=\,17.7\,m, hereafter indicated also as DV (detector volume) --- was initially considered as the detecting medium (no fiducial volume cut applied) in order to count all energy depositions happening at any place within the vessel. The first set of simulations were devoted to the LS contaminants: in this case, the complete natural decay chains of $^{232}$Th\ and $^{238}$U\ and the sub-chain starting with $^{210}$Pb\ (following the secular equilibrium break caused by $^{222}$Rn\ in the $^{238}$U\ chain), as well as the natural contaminant $^{40}$K, were considered separately. For each radioisotope or decay chain progenitor, a total of $10^6$ nuclei were uniformly distributed inside the whole scintillator volume and the energy depositions following each decay sequence recorded for the comparative analysis. The resulting summed energy spectra from the four contaminants obtained by each of the three software codes are superimposed in Figure\,\ref{fig:LS-acrylic-spectra} (top spectrum) in the energy region up to 5\,MeV, where the majority of the events are distributed. The alpha peak broadening visible in the spectra is due to the fluctuations of the energy deposited (and consequently quenched) at each step along the particle track. As one can see, the features of the spectra are finally in very good agreement. The residual differences are attributed to the implementation of the quenching calculation, but they are not relevant for the discussion of the background impact in JUNO. The position of all quenched $\alpha$ peaks is consistent within 25\,keV among the three codes: this spread has to be compared with the peak broadening due to step energy deposition fluctuations, of the order of $6-15$\,keV depending on the energy. We have also to note that the energy resolution of the detector (not included at this stage in the simulations) ranges from about 20 to 30\,keV in the quenched $\alpha$ peak energy interval. Figure\,\ref{fig:alphaQuenching-plot} shows the quenched alpha energy as a function of the true energy for the main alpha peaks of both $^{238}$U\ and $^{232}$Th\ chains, as resulting from the SNiPER simulation. The quenching factor, i.e. the ratio between true and quenched energy, is ranging from 12 to 7 for true alpha energies going from 4 to 9 MeV. Most of the alpha events will be removed by the default 0.7 MeV energy threshold cut (see later) illustrated by the dashed line. On Figure\,\ref{fig:LS-acrylic-spectra} (top spectrum), the end-point around 4.8 MeV is induced by the decay of the $^{208}$Tl (Q$_\beta$=5.0 MeV). The energy difference is due to the quenching of the electrons produced in LS after multiple Compton scattering of the gammas from $^{208}$Pb de-excitation. \begin{figure}[tbp] \centering \includegraphics[width=1.0\textwidth]{figure/LAB-Acr_spectra-All_2.png} \caption{\label{fig:LS-acrylic-spectra} Superposition of the sum spectra obtained by considering all energy depositions in DV following $^{238}$U, $^{232}$Th, $^{40}$K, and $^{210}$Pb\ decays uniformly distributed within the LS (top) and the acrylic vessel (bottom), as simulated by each of the three Monte Carlo codes. For any radioactive species, $10^6$ ($10^7$) decays were considered, respectively. In the top plot, the black and red histograms are overlapping, while the blue one is slightly shifted at higher energy only for the quenched alpha peaks (see discussion in the text).} \end{figure} \begin{figure}[tbp] \centering \includegraphics[width=.6\textwidth]{figure/alphaQuenching.png} \caption{\label{fig:alphaQuenching-plot} The quenched alpha energy resulting from the SNiPER simulation as a function of the true energy for the main alpha peaks of both $^{238}$U\ and $^{232}$Th\ chains is shown as black points. The default 0.7 MeV energy threshold used for IBD event selection is shown with a dashed line.} \end{figure} For what concerns the acrylic vessel, the same $^{232}$Th, $^{238}$U, or $^{40}$K\ contaminants were uniformly distributed within its bulk volume. A total of $10^7$ decays for each of the radionuclides were simulated by the three codes and the following energy depositions in DV recorded for the comparative analysis. The obtained results are summarized in Figure\,\ref{fig:LS-acrylic-spectra} (bottom spectrum). Also in this case the agreement among the three software is extremely good. It has to be noted that the acrylic vessel simulation results in Figure\,\ref{fig:LS-acrylic-spectra} include also the contributions of the acrylic nodes and the acrylic chimney. To convert the number of events collected by the detector into expected count rates, one has to make hypotheses on the concentration of the residual impurities in the material of interest. In the case of the components of the JUNO detector, these inputs are the target values reported in Table\,\ref{tab:impurities} and discussed later in Section\,\ref{sec:impurities}. The count rates generated in DV by the decays of the LS contaminants (LS-reactor inputs in Table\,\ref{tab:impurities}) uniformly distributed within the liquid scintillator, are shown in Figure\,\ref{fig:lab-Eth-plot} as a function of the energy threshold $E_{th}$\ applied to the spectrum of each simulated contaminant. As one can see, the resulting rates decrease abruptly as the chosen threshold goes beyond the energy of the quenched alpha peaks, especially those belonging to the $^{238}$U/$^{210}$Pb\ chains. For IBD analysis, a good compromise is an energy threshold of 0.7\,MeV, well below the prompt energy of the positron (E$_{e^+} \geq 1$\,MeV) and high enough to reduce the accidental rate to an acceptable value that does not impair the mass ordering sensitivity. This choice of the energy threshold for the neutrino mass ordering analysis is the default value assumed by JUNO at this stage, as anticipated for the $E_p$ energy selection criteria in Section~\ref{sec:nu-cuts}, and will be supposed in all later discussions in this paper. \begin{figure}[tbp] \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\textwidth]{figure/LAB_Plot_5.png} \caption[]{\label{fig:lab-Eth-plot} } \end{subfigure} \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\textwidth]{figure/Acrylic_Plot_5.png} \caption[]{\label{fig:acrylic-FV-plot}} \end{subfigure} \caption[]{(a) Expected count rates in DV due to the residual contaminations of the LS (LS-reactor impurity inputs in Table\,\ref{tab:impurities}) as a function of the energy threshold $E_{th}$\ applied to the simulated spectra. Solid lines connect the points to guide the eye. $E_{th}$\,=\,0.7 MeV is the threshold energy value chosen for the neutrino mass ordering analysis by JUNO (shown by the dashed line). (b) Expected background count rates for $E_{th}$\,=\,0.7\,MeV due to uniform $^{40}$K, $^{232}$Th, and $^{238}$U\ contaminations in the bulk of the acrylic sphere as a function of different radius quotes $r_{LS}$\ chosen to define the experimental FV. Solid lines connect the points to guide the eye. Currently, the default JUNO FV for anti-neutrino analysis is spherical, with radius $r_{LS}$\,=\,17.2\,m (shown by the dashed line).} \label{spectra} \end{figure} The count rates induced in DV by the LS-reactor and the acrylic vessel impurities (from Table\,\ref{tab:impurities}) were calculated for the three codes above the default energy threshold for comparison. The results are reported in Table~\ref{tab:singles-noFV}, separately for each nuclide. The relative uncertainty on the global rates among the three codes is smaller than 2.5\%, both for the LS and the acrylic simulations. \subsection{Comparative impact of material contaminations} The next step after the validation process was to evaluate the impact on the background rate of the residual impurities contained in all other materials of the JUNO detector with SNiPER and ARBY tools. Also in this case, the contaminants were uniformly distributed within the material of interest and the Monte Carlo codes were set to simulate the decay processes up to the energy depositions in the LS volume. The results are reported in Table\,\ref{tab:singles-noFV} as count rates in the energy region between 0.7\,MeV and 12\,MeV in DV, and are listed separately for the considered contaminant. The achieved agreement between the two simulation codes is within 7\% on all the considered components of the JUNO setup, and the achieved statistical uncertainty is less than 1\%. The impurity inputs used to derive the contributed rates are the target values of Table\,\ref{tab:impurities}. Apart from LS and acrylic, the number of simulated decays for each radionuclide was 10$^8$ for all materials: the only exception was the rock of the underground laboratory, for which $2\times 10^{10}$ decays were considered for each of the contaminants. In this case, a hollow cylinder of internal radius equal to 21.75\,m and total height of 43.5\,m (i.e. the pool dimensions) was uniformly contaminated with $^{238}$U, $^{232}$Th, or $^{40}$K\ inside a thickness of 20\,cm (higher thickness values would make the simulations extremely inefficient due to self-absorption). The chosen material for the cylinder was SiO$_2$ with a density close to 2.6\,g/cm$^3$, the average density of the rock at the experimental site. Despite the long simulation times, no events were detected for $^{238}$U\ and $^{40}$K\ in the scintillator volume, so only upper limits at 90\% C.L. are listed in Table\,\ref{tab:singles-noFV} for the background induced by those contaminants in the laboratory rock. Given the geometrical characteristics and presumed contaminations of the rock simulation, these results can be considered as proxies for other materials at similar distances from the detector center, like the liner covering the rock walls placed in front of the concrete barrier or the veto detector placed on top of the pool. \begin{table}[tbp] \centering \begin{tabular}{|l|c|c|c|c|c|} \hline \multirow{2}{*}{Material} & \multicolumn{5}{c|}{Count rates in DV (deposited energy) -- $E_{th}$\ = 0.7\,MeV } \\ \cline{2-6} & {$^{238}$U} [Hz] & {$^{232}$Th} [Hz] & {$^{40}$K} [Hz] & {$^{210}$Pb} [Hz] & {$^{60}$Co} [Hz]\\ \cline{2-6} \hline \hline LS-reactor & 0.70 & 0.37 & 0.23 & 0.69 & \\ \hline Acrylic & 1.74 & 0.74 & 4.65 & & \\ \hline Calibration parts \hspace{5mm} & 0.5 &0.6 &0.2 &&\\ \hline SS structure &&&&&\\ -- truss & 0.02 & 0.08 & 0.002 & & 0.01 \\ -- bars & 3.6 & 4.8 & 1.0 & &4.3 \\ \hline LPMT glass &&&&&\\ -- NNVT & 6.04 & 4.03 & 0.17 & & \\ -- Hamamatsu &4.79 & 5.33 & 0.69 && \\ -- Veto (NNVT) &0.17 & 0.14 &0.003 &&\\ \hline LPMT cover &&&&&\\ -- acrylic & 0.0001 & 0.0004 & 0.0006 &&\\ -- SS & 0.01 & 0.08 & 0.004 &&\\ \hline LPMT readout &&&&&\\ -- divider & 0.10 & 0.23 & 0.004 &&\\ -- potting & 0.11 & 0.11 & 0.007 &&\\ -- UWB & 0.21 & 1.2 & 0.02 & &0.003\\ \hline SPMT glass & 0.24 & 0.30 & 0.21 &&\\ \hline SPMT readout &&&&&\\ -- divider & 0.08 & 0.37 & 0.009 &&\\ -- potting & 0.09 & 0.06 & 0.03 &&\\ -- UWB & 0.03 & 0.16 & 0.002 & &$4\times 10^{-4}$\\ \hline Water ($^{222}$Rn) &0.77$^{\dagger}$ & &&&\\ \hline Rock & <\,0.01$^{\ddagger}$ &0.05& <\,0.09$^{\ddagger}$ &&\\ \hline \end{tabular} \caption{\label{tab:singles-noFV} Background count rates in detector volume (DV) in the energy range between 0.7\,MeV and 12\,MeV induced by the various detector components with the contaminant concentrations of Table\,\ref{tab:impurities}. The results are given for each contaminant separately, for a complete picture. Only the deposited energy is considered in these results, i.e. no optical propagation nor detector energy resolution were applied. \\ $^{\dagger}$This simulation refers to a uniform contamination of 10\,mBq/m$^3$ of $^{222}$Rn.\\ $^{\ddagger}$Upper limits at 90\%\,C.L. } \end{table} Concerning $^{222}$Rn\ distributed in the water of the pool, the simulation was performed considering only the inner water pool with a water shell of 2.3\,m thickness placed at a radius of 17.8\,m from the detector center: this choice allows to attain reasonable computation times and is justified by the fact that this layer is the closest to the CD. The “node and bar” simulation was performed considering just the stainless steel components incorporated in the nodes at the acrylic vessel side and the stainless steel bars connecting the truss and the acrylic sphere, since the acrylic material making the nodes is much cleaner than the stainless steel and its contribution is already included in the results of the vessel. The outcomes are reported under the SS bars entry in Table~\ref{tab:singles-noFV}. For the calibration system, all components that are permanently mounted on the CD (described in Section~\ref{sec:setup}) were simulated separately and the results added together in Table\,\ref{tab:singles-noFV}; the contribution from the calibration sources (permanently stored in the calibration house on top of the detector) is found to be negligible. For the LPMTs, the contributions of the radioactivity of the glass and of the protection cover are reported as independent entries. Moreover, given the different impurity concentration inputs for Hamamatsu and NNVT PMTs or the different positions within the setup of the PMTs (e.g. veto PMTs with respect to ``signal'' PMTs), the glass contributions for the different LPMTs are listed separately. Finally, the signal readout simulations for both the LPMT and the SPMT systems were done separately for the components sitting on the back of the photomultipliers (divider and potting) and for the electronics boards placed in the under water boxes (UWBs) \cite{ppnp}. Despite the assumed impurity level in the various components reported in Table\,\ref{tab:impurities} are among the smallest achievable by available techniques, the overall expected background count rate in Table\,\ref{tab:singles-noFV} is quite significant. The only means to reduce it is to shield the external sources by applying a software-based FV cut. Figure\,\ref{fig:acrylic-FV-plot} shows how effective is the rate reduction with increasing thickness of the external ``dead layer'' in the LS volume in the case of the background induced by the acrylic sphere contaminants (the closest to the detector FV). At this stage, the ``dead layer'' thickness chosen for IBD analysis by the JUNO collaboration is 50\,cm, which reduces the count rate by about one order of magnitude. Therefore, in the remaining of the paper a spherical FV with radius $r_{LS}$\,=\,17.2\,m will be considered as the default value. \section{Conclusion} \label{sec:conclusions} JUNO is a 20~kt LS detector whose primary goal is to determine the neutrino mass ordering by detecting reactor anti-neutrino from two nuclear power plants. With only 60~IBD events per day in the 0-10 MeV energy range, the control of the background sources is crucial. Apart from cosmogenic and geoneutrinos sources, the natural radioactivity of the materials is one of the key background with a deposited energy in the detector up to 5~MeV, overlapping with the anti-neutrino signal. This paper summarized the JUNO strategy in order to contain the count rate due to natural radioactivity at a level of 10~Hz in order to minimize its impact on neutrino mass ordering determination. Besides the optimization of the JUNO design, Monte Carlo simulations and material screening are being conducted to achieve the best radiopurity of the detector. Monte Carlo simulations were performed using three different codes (SNiPER, ARBY and G4-LA) in order to cross-check the results of the JUNO offline software, SNiPER, regarding the deposited energy and the induced singles rate in the full volume. An agreement within 2.5\% for the count rate was achieved for LS and acrylic vessel simulations, validating the physics inputs of SNiPER. After including the energy resolution, the optical propagation, the charge conversion, and the non-uniformity response of the detector in the full SNiPER simulation (benefiting from the Daya Bay experience), the count rate for each component (LS, acrylic vessel, SS structure, PMT glass and readout, radon in water, calibration system, rock, etc.) was derived assuming default cuts (0.7~MeV energy threshold and 17.2~m FV radius) and JUNO target radiopurity requirements. These impurity concentration requirements, usually at the cutting-edge of available techniques, are based both on the experience of the previous experiments (especially for LS and radon in water), and on screening measurements performed on pre-production or production samples (acrylic, SS structure, PMT systems, calibration parts) using several existing or developed on purpose screening facilities within the JUNO collaboration. The results of the full simulation showed that the total expected count rate in JUNO is $\sim$7~Hz, i.e. compliant with the 10~Hz target for the IBD analysis channel, with three main contributions from LS, SS structure, and PMT glass. Of course, the singles rate will be updated once the final numbers will be available. Based on a toy Monte Carlo using the count rate from natural radioactivity as well as time coincidence window of 1~ms and distance cut of 1.5~m for two singles events, an accidental background rate of $\sim$0.9~cpd was derived. It demonstrates that this background rate is much lower than the IBD signal ($\sim$60~cpd) but also lower than the two other main background sources, i.e. cosmogenics ($\sim$1.6~cpd) and geoneutrinos ($\sim$1.1~cpd). There is room for improvement during the running phase of JUNO where the default cuts, including energy threshold, fiducial volume radius, time coincidence and distance cut, will be tuned according to the actual background count rate to optimize the signal over background ratio, in order to increase the exposure to the best of our ability for neutrino mass ordering determination. The stricter requirements on the radiopurity of the LS (LS-solar) will make it possible to study solar neutrinos with the JUNO experiment, with the external background made totally negligible by the application of more stringent fiducial volume cuts \cite{JUNO-solar}.
\section*{Introduction} Let $A$ be a ring, $P$ be a progenerator (that is, a finitely generated projective generator) of Mod-$A$, and $\{ e_1, \cdots, e_s \}$ be a set of central complete orthogonal idempotents of $A$. For any integers $s > 0$ and $n_1 > \cdots > n_s$, it is clear that $T:=\bigoplus\limits_{i=1}^{s}Pe_i[-n_i]$ is a tilting complex over $A$ and $\End_{\D^\mathrm{b}(A)}(T)$ is Morita equivalent to $A$. If $A$ is commutative, then any tilting complex over $A$ has the above form \cite[Theorem 2.6]{Ye99} or \cite[Theorem 2.11]{RouZi03}. Recall that a ring $A$ is called an {\it Azumaya algebra}, if $A$ is separable over its center $Z(A)$, i.e., $A$ is a projective $ (A\otimes_{Z(A)}A^{op})$-module. Any two Azumaya algebras which are derived equivalent are Morita equivalent \cite{A17}. If $A$ is an Azumaya algebra, then there exists a bijection between the ideals of $A$ and those of $Z(A)$ via $I \mapsto I \cap Z(A)$ \cite[Corollary II 3.7]{MI}. In this case, the prime spectrum of $A$ is canonically homeomorphic to the prime spectrum of $Z(A)$. In this note, we prove a more general result. \begin{thm}\label{tilting complex for finite over center case} Let $A$ be a ring, $R$ be a central subalgebra of $A$. Suppose that $A$ is finitely presented as $R$-module, and $\Spec(A) \to \Spec(R), \; \mathfrak{P} \mapsto \mathfrak{P} \cap R$ is a homeomorphism. Then for any tilting complex $T$ over $A$, there exists a progenerator $P$ of $A$ and a set of complete orthogonal idempotents $e_1, \cdots, e_s$ in $R$ such that in the derived category $\mathcal{D}(A)$ $$T \cong \bigoplus\limits_{i=1}^{s}Pe_i[-n_i]$$ for some integers $s>0$ and $n_1 > n_2 > \cdots > n_s$. \end{thm} \begin{cor}\label{derived equiv is Morita equiv for finite over center case} Let $B := \End_{\D^\mathrm{b}(A)}(T)$. Then $B \cong \End_{A}(P)$, i.e., $B$ is Morita equivalent to $A$. \end{cor} Theorem \ref{tilting complex for finite over center case} and Corollary \ref{derived equiv is Morita equiv for finite over center case} apply to some class of Sklyanin algebras, see Corollary \ref{derived-equiv-Skl-alg}. The derived Picard group of $A$ is described in Proposition \ref{D-Pic-group}, which generalizes a result of Negron \cite{Negron17} about Azumaya algebras. \section{Preliminaries} Let $A$ be a ring, $\D^\mathrm{b}(A)$ be the bounded derived category of the (right) $A$-module category. Let $T$ be a complex of $A$-modules, $\add(T)$ be the full subcategory of $\D^\mathrm{b}(A)$ consisting of objects that are direct summands of finite direct sums of copies of $T$, and $\End_{\D^\mathrm{b}(A)}(T)$ be the endomorphism ring of $T$. A complex is called {\it perfect}, if it is quasi-isomorphic to a bounded complex of finitely generated projective $A$-modules. $\mathcal{K}^{\mathrm{b}}(\text{proj-}A)$ is the full subcategory of $\D^{\mathrm{b}}(A)$ consisting of perfect complexes. We first recall the definition of tilting complexes \cite{Rickard89}, which generalizes the notion of progenerators. For the theory of tilting complexes we refer the reader to \cite{Ye20}. In the following, $A$ and $B$ are associative ring. \begin{defn} A complex $T \in \mathcal{K}^{\mathrm{b}}(\text{proj-}A)$ is called a {\it tilting complex} over $A$ if \begin{enumerate} \item $\add(T)$ generates $\mathcal{K}^{\mathrm{b}}(\text{proj-}A)$ as a triangulated category, and \item $\Hom_{\D^\mathrm{b}(A)}(T, T[n]) = 0$ for each $n \neq 0$. \end{enumerate} \end{defn} The following Morita theorem for derived categories, is due to Rickard. \begin{thm}\cite[Theorem 6.4]{Rickard89}\label{derived-equivalence} The following are equivalent. \begin{enumerate} \item $\mathcal{D}^{\mathrm{b}}(A)$ and $\mathcal{D}^{\mathrm{b}}(B)$ are equivalent as triangulated categories. \item There is a tilting complex $T$ over $A$ such that $\End_{\D^\mathrm{b}(A)}(T) \cong B$. \end{enumerate} \end{thm} If $A$ and $B$ satisfy the equivalent conditions in Theorem \ref{derived-equivalence}, then $A$ is said to be {\it derived equivalent} to $B$. The following theorem is also due to Rickard \cite[Theorem 1.6]{Ye99}, where $A$ and $B$ are two flat $k$-algebras over a commutative ring $k$. \begin{thm}(Rickard)\label{two-side-tilting-complex} Let $T$ be a complex in $\D^\mathrm{b}(A \otimes_k B^{\mathrm{op}})$. The following are equivalent: (1) There exists a complex $T^{\vee} \in \D^\mathrm{b}(B \otimes_k A^{\mathrm{op}})$ and isomorphisms $$T \Lt_{A} T^{\vee} \cong B \text{ in } \D^\mathrm{b}(B^e)\, \text{ and }\, T^{\vee} \Lt_{B} T \cong A \text{ in } \D^\mathrm{b}(A^e)$$ where $B^e =B \otimes_k B^{\mathrm{op}}$ and $A^e =A \otimes_k A^{\mathrm{op}}$. (2) $T$ is a tilting complex over $A$, and the canonical morphism $B \to \Hom_{\D^\mathrm{b}(A)}(T,T)$ is an isomorphism in $\D^\mathrm{b}(B^e)$. In this case, $T$ is called a {\it two-sided tilting complex} over $A$-$B$ relative to $k$. \end{thm} We record some results about tilting complexes here for the convenience. \begin{lem}\cite[Theorem 2.1]{Rickard91}\label{flat tensor products} Let $A$ be an $R$-algebra and $S$ be a flat $R$-algebra where $R$ is a commutative ring. If $T$ is a tilting complex over $A$, then $T \otimes_R S$ is a tilting complex over $A \otimes_R S$. \end{lem} The following lemma follows directly from Lemma \ref{flat tensor products}. \begin{lem}\cite[Proposition 2.6]{RouZi03}\label{decomposition of tilting complex by central idempotent} Let $T$ be a tilting complex over $A$. If $0 \neq e \in A$ is a central idempotent, then $Te$ is a tilting complex over $Ae$. \end{lem} The following lemma is easy to verify. \begin{lem}\label{til-comp-lem} Let $T$ be a tilting complex over $A$. The following conditions are equivalent. (1) $T \cong \bigoplus\limits_{i=1}^{s}P_i[-n_i]$ in $\D^\mathrm{b}(A)$, for some $A$-module $P_i$ such that $\bigoplus\limits_{i=1}^{s} P_i$ is a progenerator of $A$. (2) $T$ is homotopy equivalent to $\bigoplus\limits_{i=1}^{s}P_i[-n_i]$ for some $A$-module $P_i$. \end{lem} By using a similar proof of \cite[Theorem 2.3]{Ye99} for two-sided tilting complexes (see also \cite{Ye10} or \cite{Ye20}), the following result for tilting complexes holds. \begin{lem}\label{equivalent condition for tilting complex being a progenerator} Let $T$ be a tilting complex over $A$, and $T^{\vee}:= \Hom_A(T, A)$. Let $n = \max\{ i \mid \mathrm{H}^i(T) \neq 0 \}$ and $ m = \max\{ i \mid \mathrm{H}^i(T^{\vee}) \neq 0 \}$. If $\mathrm{H}^n(T) \otimes_A \mathrm{H}^m(T^{\vee}) \neq 0$, then $m=-n$ and $T \cong P[m]$ in $\D^\mathrm{b}(A)$ for some progenerator $P$ of $A$. \end{lem} \begin{proof} Without loss of generality, we assume that $$T:= \cdots \longrightarrow 0 \longrightarrow T^{-m} \longrightarrow \cdots \longrightarrow T^n \longrightarrow 0 \longrightarrow \cdots.$$ Since $T$ is a perfect complex of $A$-modules, $$\RHom_A(T,T) \cong T \Lt_{A} T^{\vee}.$$ Consider the bounded spectral sequence of the double complex $T \otimes_A T^{\vee}$ (see \cite[Lemma 14.5.1]{Ye20}). Then $$\mathrm{H}^n(T) \otimes_A \mathrm{H}^{m}(T^{\vee}) \cong \mathrm{H}^{n+m}(T \Lt_{A} T^{\vee}) \cong \mathrm{H}^{n+m}(\RHom_A(T,T)).$$ Since $T$ is a tilting complex, $\Hom_{\D^\mathrm{b}(A)}(T,T[i]) = 0$ for all $i \neq 0$. It follows that $n+m = 0$. So $T \cong T^n[-n]$. By Lemma \ref{til-comp-lem}, the conclusion holds. \end{proof} A ring $A$ is called {\it local} if $A/J_A$ is a simple Artinian ring, where $J_A$ is the Jacobson radical of $A$. If both $M_A$ and ${}_AN$ are nonzero module over a local ring $A$, then $M \otimes_A N \neq 0$ by \cite[Lemma 14.5.6]{Ye20}. \begin{prop}\cite[Theorem 2.11]{RouZi03}\label{derived equiv is Morita equiv for local rings} Let $A$ be a local ring, $T$ be a tilting complex over $A$. Then, $T \cong P[-n]$ in $\D^\mathrm{b}(A)$, for some progenerator $P$ of $A$ and $n \in \mathbb{Z}$. \end{prop} \begin{proof} It follows from Lemma \ref{equivalent condition for tilting complex being a progenerator}. \end{proof} Let $\Spec A$ (resp., $\Max A$) denote the prime (resp., maximal) spectrum of a ring $A$. Let $R$ be a central subalgebra of $A$. Since the center of any prime ring is a domain, the quotient ring $R/(\mathfrak{P} \cap R)$ is a domain for any $\mathfrak{P} \in \Spec(A)$. Then there is a well defined map $\pi: \Spec A \to \Spec R, \; \mathfrak{P} \mapsto \mathfrak{P} \cap R$. The following facts about the map $\pi$ are well known, see \cite{Bla73} for instance. For the convenience of readers, we give their proofs here. \begin{lem}\label{Phi-lem} Let $A$ be a ring, $R$ be a central subring of $A$. Suppose that $A$ is finitely generated as $R$-module. \begin{enumerate} \item For any primitive ideal $\mathfrak{P}$ of $A$, $\pi(\mathfrak{P})$ is a maximal ideal of $R$. In particular, $$\pi(\Max A) \subseteq \Max R.$$ \item If $\mathfrak{P} \in \Spec(A)$ and $\pi(\mathfrak{P})$ is a maximal ideal of $R$, then $\mathfrak{P}$ is a maximal ideal of $A$. \item For any multiplicatively closed subset $\mathcal{S}$ of $R$, the prime ideals of $\mathcal{S}^{-1}A$ are in one-to-one correspondence ($\mathcal{S}^{-1} \mathfrak{P} \leftrightarrow \mathfrak{P}$) with the prime ideals of $A$ which do not meet $\mathcal{S}$. \item $\pi: \Spec A \to \Spec R$ is surjective. \item The Jacobson radical $J_R$ of $R$ is equal to $J_A \cap R$. \item Let $\p$ be a prime ideal of $R$. Then $A_{\p}$ is a local ring if and only if there exists only one prime ideal $\mathfrak{P}$ of $A$ such that $\pi(\mathfrak{P}) = \p$. \item If $R$ is a Jacobson ring (that is, $\forall$ $\p \in \Spec R$, $J_{R/\p} = 0$), then so is $A$. \item If $\pi$ is injective, then $\pi(\mathcal{V}(I)) = \mathcal{V}(I \cap R)$. In this case, $\pi$ is a homeomorphism. \end{enumerate} \end{lem} \begin{proof} (1) Without loss of generality, we assume that $A$ is a primitive ring. Let $V$ be a faithful simple $A$-module. For any $0 \neq x \in R$, since $Vx$ is also a non-zero $A$-module, $Vx = V$. Because $V$ is a finitely generated faithful $R$-module, $x$ is invertible in $R$. It follows that $R$ is a field. (2) Since the prime ring $A/\mathfrak{P}$ is finite-dimensional over the field $R/(\mathfrak{P}\cap R)$, the quotient ring $A/\mathfrak{P}$ is a simple ring, that is, $\mathfrak{P}$ is a maximal ideal of $A$. (3) The proof is similar to the commutative case. (4) Suppose $\p \in \Spec R$. It follows from (3) that there exists a prime ideal $\mathfrak{P}$ of $A$ such that $\mathfrak{P}A_{\p}$ is a maximal ideal of $A_{\p}$. By (1), $\mathfrak{P}A_{\p} \cap R_{\p}$ is a maximal ideal of $R_{\p}$. Hence $\p R_{\p} \subseteq \mathfrak{P}A_{\p}$. It follows that $\mathfrak{P} \cap R = \p$ (5) By (1), $J_R \subseteq J_A \cap R$. On the other hand, by (4) and (2), $J_A \cap R \subseteq J_R$. (6) It follows from (3) and (4) that $\Max A_{\p} = \{ \mathfrak{P}A_{\p} \mid \mathfrak{P} \cap R = \p, \, \mathfrak{P} \in \Spec A \}$. Then the conclusion in (6) follows. (7) Without loss of generality, we may assume that $A$ is a prime ring. Set $\mathcal{S} = R\setminus \{0\}$. Then $\mathcal{S}^{-1}A$ is also a prime ring which is finite-dimensional over the field $\mathcal{S}^{-1}R$. Hence $\mathcal{S}^{-1}A$ is an Artinian simple ring. It follows from that $R$ is a Jacobson ring and (5) that $J_A \cap R = J_R = 0$. Hence $\mathcal{S}^{-1}J_{A} \neq \mathcal{S}^{-1}A$, and so $\mathcal{S}^{-1}J_{A} = 0$. Hence $J_A = 0$, as every element in $\mathcal{S}$ is regular in the prime ring $A$. Therefore $A$ is a Jacobson ring. (8) Suppose $I$ is an ideal of $A$. Obviously, $\pi(\mathcal{V}(I)) \subseteq \mathcal{V}(I \cap R)$. On the other hand, let $\p \in \mathcal{V}(I \cap R) := \{ \p \in \Spec R \mid I \cap R \subseteq \p \}$. It follows from the assumption that $\pi$ is injective and (6) that $A_{\p}$ is a local ring. Hence there exists a prime ideal $\mathfrak{P}$ of $A$ such that $\mathfrak{P}A_{\p}$ is the only maximal ideal of $A_{\p}$ and $\p = \mathfrak{P} \cap R$. Since $I \cap (R \setminus \p) = \emptyset$, $IA_{\p} \subseteq \mathfrak{P} A_{\p}$ and $I \subseteq \mathfrak{P}$. Then $\p = \pi(\mathfrak{P}) \in \pi(\mathcal{V}(I))$. Hence $\pi(\mathcal{V}(I)) \supseteq \mathcal{V}(I \cap R)$. So $\pi$ is a closed map. Since $\pi$ is bijective, it is a homeomorphism. \end{proof} By Lemma \ref{Phi-lem}, we have the following two results, which describe the condition when $\pi$ is a homeomorphism. \begin{lem}\label{spec-homeo} $\pi$ is a homeomorphism if and only if $A_{\p}$ is a local ring for any $\p \in \Spec R$. \end{lem} \begin{prop}\label{Max-Prime} Suppose that $R$ is a Jacobson ring. If the restriction map $\pi|_{\Max A}$ is injective, then $\pi$ is a homeomorphism. \end{prop \begin{proof If $\pi$ is not injective, then there exist two different prime ideals $\mathfrak{P}$ and $\mathfrak{P}'$ of $A$ such that $\mathfrak{P} \cap R = \mathfrak{P}' \cap R$. By Lemma \ref{Phi-lem} (7), $A$ is a Jacobson ring. Hence, there exists a maximal ideal $\mathfrak{M}$ of $A$ such that $\mathfrak{P} \subseteq \mathfrak{M}$ and $\mathfrak{P}' \nsubseteq \mathfrak{M}$, or the other way round. Without loss of generality, assume $\mathfrak{P} \subseteq \mathfrak{M}$ and $\mathfrak{P}' \nsubseteq \mathfrak{M}$. Then $\pi(\mathfrak{M}) = \mathfrak{M} \cap R \supseteq \mathfrak{P} \cap R = \mathfrak{P}' \cap R$. By applying Lemma \ref{Phi-lem} (2) and (4) to the ring $A/{\mathfrak{P}'}$ with the central subalgebra $R/{\mathfrak{P}' \cap R}$, it implies that there exists a maximal ideal $\mathfrak{M}'$ of $A$, such that $\mathfrak{P}' \subseteq \mathfrak{M}'$ and $\mathfrak{M}' \cap R = \mathfrak{M} \cap R$. This contradicts to the hypothesis that $\pi|_{\Max(A)}$ is injective. So $\pi$ is a homeomorphism. \end{proof} \section{Some Derived equivalences imply Morita equivalences} If $A$ is a local ring such that $A/{J_A}$ is not a skew-field and $A$ is a domain, then $A$ is not semiperfect. The localizations of the Sklyanin algebra considered in Lemma \ref{S-domain} at maximal ideals of its center are such kind of examples. The following results are needed in the proof of Theorem \ref{tilting complex for finite over center case}. \begin{lem}\label{lemma1} Let $A$ be a local ring. Then there exists an idempotent element $e$ in $A$, such that any finitely generated projective right $A$-module is a direct sum of finitely many copies of $eA$. \end{lem} \begin{proof} For any finitely generated projective $A$-modules $P$, $Q$, and a surjective $A$-module morphism $f: P/PJ_A \twoheadrightarrow Q/QJ_A$, there exists a surjective $A$-module morphism $\widetilde{f}$ so that the following diagram commutative. $$\xymatrix{ P \ar@{-->>}[d]^{\widetilde{f}} \ar@{->>}[r] & P/PJ_A \ar@{->>}[d]^{f}\\ Q \ar@{->>}[r] & Q/QJ_A }$$ It follows that $Q$ is a direct summand of $P$. There exists a finitely generated projective $A$-module $Q\neq 0$ such that the length of $Q/QJ_A$ is smallest possible. By the above fact and division algorithm, any finitely generated projective $A$-module is a direct sum of finite copies of $Q$. In particular, $Q$ is a direct summand of the $A$-module $A$. Hence, there exists an idempotent element $e$ in $A$ such that $Q \cong eA$ as $A$-modules. \end{proof} \begin{prop}\label{a open set of fp mod in spec} Let $A$ be a ring with a central subalgebra of $R$ such that $A$ is finitely presented as $R$-module. Suppose that $A_{\p}$ is a local ring for all $\p \in \Spec R$. If $M$ is a finitely presented $A$-module, then $$U:= \{ \p \in \Spec R \mid M_{\p} \text{ is projective over } A_{\p} \}$$ is an open subset in $\Spec R$ \end{prop} \begin{proof} Suppose $\p \in U$. Then $M_{\p}$ is a finitely generated projective $A_{\p}$-module. Since $A_{\p}$ is a local ring, by Lemma \ref{lemma1}, there exist $x \in A$ and $s \in R\setminus\p$, such that $$xs^{-1} \in A_{\p} \text{ is an idempotent element and } M_{\p} \cong (xs^{-1}A_{\p})^{\oplus l}$$ for some $l \in \mathbb{N}$. Hence there exists $t \in R \setminus \p$ such that $(x^2-xs)st = 0$, and $xs^{-1}$ is an idempotent element in $A_{st} = A[(st)^{-1}]$. So $xs^{-1}A_{st}$ is a projective $A_{st}$-module. There is an $A_{st}$-module morphism $g: (xs^{-1}A_{st})^{\oplus l} \to M_{st}$ such that $g_{\p}: (xs^{-1}A_{\p})^{\oplus l} \to M_{\p}$ is the prescribed isomorphism. Since $M_A$ and $A_R$ are finitely presented modules, $M$ is a finitely presented $R$-module. So $M_{st}$ is a finitely presented $R_{st}$-module. By \cite[Proposition II.5.1.2]{Bourbaki}, there exists $u \in R \setminus \p$ such that $gu^{-1}: (xs^{-1}A_{stu})^{\oplus l} \to M_{stu}$ is an isomorphism. It follows that $M_{stu}$ is a projective $A_{stu}$-module. Hence $X_{stu} := \{\mathfrak{q} \in \Spec R \mid stu \notin \mathfrak{q} \}$ is contained in $U$. Obviously, $\p \in X_{stu}$. So $U$ is an open subset of $\Spec R$. \end{proof} Now we are ready to prove Theorem \ref{tilting complex for finite over center case}. The following proof is nothing but an adaption of the arguments of Yekutieli \cite[Theorem 1.9]{Ye10} and Negron \cite[Proposition 3.3]{Negron17} to this situation. \begin{proof}[Proof of Theorem \ref{tilting complex for finite over center case}] By assumption, $\Spec A \to \Spec R, \; \mathfrak{P} \mapsto \mathfrak{P} \cap R$ is a homeomorphism. It follows from Lemma \ref{spec-homeo} that $A_{\p}$ is a local ring for any prime ideal $\p$ of $R$. There exist integers $s>0$ and $n_1 > n_2 > \cdots > n_s$ such that $\mathrm{H}^{i}(T) = 0$ for all $i \neq n_1, \cdots, n_s$, as the tilting complex $T$ is bounded. Obviously, $\mathrm{H}^{n_1}(T)$ is a finitely generated $R$-module. In fact, it is a finitely presented $R$-module by assumption. Hence the support set $$\Supp(\mathrm{H}^{n_1}(T)) = \mathcal{V}(\Ann_R(\mathrm{H}^{n_1}(T)))$$ is closed in $\Spec R$. By Lemma \ref{flat tensor products}, $T_{\p} := T \otimes_R R_{\p}$ is a tilting complex over $A_{\p}$. If $\mathrm{H}^{n_1}(T)_{\p} \cong \mathrm{H}^{n_1}(T_{\p})$ is non-zero, then $\mathrm{H}^{n_1}(T)_{\p}$ is $A_{\p}$-projective by Proposition \ref{derived equiv is Morita equiv for local rings}. Hence $$\Supp(\mathrm{H}^{n_1}(T)) = \{ \p \in \Spec R \mid \mathrm{H}^{n_1}(T)_{\p} \cong \mathrm{H}^{n_1}(T_{\p}) \text{ is a non-zero projective } A_{\p}\text{-module} \}.$$ Since $\mathrm{H}^{n_1}(T)$ is a finitely presented $A$-module, $\mathrm{H}^{n_1}(T)$ is a projective $A$-module, and $\Supp(\mathrm{H}^{n_1}(T))$ is an open set by Proposition \ref{a open set of fp mod in spec}. By \cite[page 406, Theorem 7.3]{Ja}, there exists an idempotent $e_1 \in R$ such that $\Supp(\mathrm{H}^{n_1}(T)) = X_{e_1}:= \{\mathfrak{q} \in \Spec R \mid e_1 \notin \mathfrak{q} \}$. It follows that $(\mathrm{H}^{n_1}(T)/\mathrm{H}^{n_1}(T)e_1)_{\p} = 0$ for all $\p \in \Spec R$. Hence $\mathrm{H}^{n_1}(T)(1-e_1) = 0$. Then $$\mathrm{H}^{j}(T(1-e_1)) = \begin{cases} 0, & j \neq n_2,\cdots,n_s \\ \mathrm{H}^{n_i}(T)(1-e_1), & j = n_2,\cdots,n_s \end{cases}.$$ By Lemma \ref{decomposition of tilting complex by central idempotent}, $T(1-e_1)$ is a tilting complex over $A(1-e_1)$ and $Te_1$ is a tilting complex over $Ae_1$. It follows from Proposition \ref{derived equiv is Morita equiv for local rings} that $Te_1$ is homotopy equivalent to $\mathrm{H}^{n_1}(T)[-n_1]$. By induction on $s$, there is a complete set of orthogonal idempotents $e_1, \cdots, e_s$ in $R$ such that $Te_i$ is homotopy equivalent to $\mathrm{H}^{n_i}(T)[-n_i]$ for each $i$. Then $T = \bigoplus\limits_{i=1}^{s} Te_i = \bigoplus\limits_{i=1}^{s} \mathrm{H}^{n_i}(T)[-n_i]$. It follows from Lemma \ref{til-comp-lem} that $P:= \bigoplus\limits_{i=1}^{s} \mathrm{H}^{n_i}(T)$ is a progenerator of $A$ and $T \cong \bigoplus\limits_{i=1}^{s}Pe_i[-n_i]$ in $\D^\mathrm{b}(A)$. \end{proof} \begin{cor} If $\Spec R$ is connected, then $T \cong P[-n]$ in $\D^\mathrm{b}(A)$. \end{cor} \begin{cor}\cite{Negron17}\label{tilting complex over Azumaya algebra} Let $A$ be an Azumaya algebra. Then any tilting complex over $A$ has the form $P[n]$, where $P$ is a progenerator of $A$. If there exists a ring $B$ which is derived equivalent to $A$, then $B$ is Morita equivalent to $A$. In particular, $B$ is also an Azumaya algebra. \end{cor} In the following we provide some non-Azumaya algebras which satisfy the conditions in Theorem \ref{tilting complex for finite over center case}. \begin{defn}\cite{ATV90} Let $k$ be an algebraically closed field of characteristic $0$. The {\it three-dimensional Sklyanin algebras} $S = S(a, b, c)$ are $k$-algebras generated by three noncommutating variables $x,y,z$ of degree $1$, subject to relations $$axy+byx+cz^2 = ayz+bzy+cx^2 = azx+bxz+cy^2,$$ for $[a:b:c] \in \mathbb{P}^2$ such that $(3abc)^3 \neq (a^3+b^3+c^3)^3$. The point scheme of the three-dimensional Sklyanin algebras $S$ is given by the elliptic curve $$E:= \mathcal{V}( abc(X^3+Y^3+Z^3) - (a^3+b^3+c^3)XYZ ) \subset \mathbb{P}^2.$$ Let us choose the point $[1:-1:0]$ on $E$ as origin, and the automorphism $\sigma$ denotes the translation by the point $[a:b:c]$ in the group law on the elliptic curve $E$ with $$\sigma[x:y:z] = [acy^2-b^2xz:bcx^2-a^2yz:abz^2-c^2xy].$$ \end{defn} \begin{lem} \label{S-domain}\cite{ATV90, ATV91} (1) $S$ is a Noetherian domain. (2) $S$ is a finite module over its center if and only if the automorphism $\sigma$ has finite order. \end{lem} Recently, Walton, Wang and Yakimov (\cite{WWY19}) endowed the three-dimensional Sklyanin algebra $S$, which is a finite module over its center $Z$, with a Poisson $Z$-order structure (in the sense of Brown-Gordon \cite{BrownGordon03}). By using the Poisson geometry of $S$, they analyzed all the irreducible representations of $S$. In particular, they proved the following result. \begin{thm}\cite[Theorem 1.3.(4)]{WWY19}\label{spec-Skl-alg} If the order of $\sigma$ is finite and coprime with $3$, then $S/{\m S}$ is a local ring for any $\m \in \Max Z$. \end{thm} Here is a corollary following Theorem \ref{spec-Skl-alg} and Theorem \ref{tilting complex for finite over center case}. \begin{cor}\label{derived-equiv-Skl-alg} If the order of $\sigma$ is finite and coprime with $3$, then every tilting complex over $S$ has the form $P[n]$, where $P$ is a progenerator of $S$ and $n \in \mathbb{Z}$. Furthermore, any ring which is derived equivalent to $S$, is Morita equivalent to $S$. \end{cor} \begin{proof} It follows from the Artin-Tate lemma that $Z$ is a finitely generated commutative $k$-algebra and so it is a Jacobson ring. Obviously, $S$ is a finitely presented $Z$-module. By Theorem \ref{spec-Skl-alg}, the restriction map $\pi|_{\Max(S)}$ is injective. It follows from Proposition \ref{Max-Prime} that $\pi: \Spec S \to \Spec Z$ is a homeomorphism. Then, the conclusions follow from Theorem \ref{tilting complex for finite over center case} and Corollary \ref{derived equiv is Morita equiv for finite over center case}. \end{proof} \section{Derived Picard groups} Let $A$ be a projective $k$-algebra over a commutative ring $k$. The derived Picard group $\DPic(A)$ of an algebra $A$ was introduced by Yekutieli \cite{Ye99} and Rouquier-Zimmermann \cite{RouZi03} independently. In fact, $A$ can be assume to be flat over $k$, see the paragraph after Definition 1.1 in \cite{Ye10}. \begin{defn}\label{defn of DPic} The {\it derived Picard group} of $A$ relative to $k$ is $$\DPic_k(A):= \frac{\{ \text{two-sided tilting complexes over } A \text{-} A \text{ relative to } k \}}{\text{ isomorphisms }},$$ where the isomorphism is in $\D^\mathrm{b}(A\otimes_kA^{\mathrm{op}})$. The class of a tilting complex $T$ in $\DPic_k(A)$ is denoted by $[T]$. The group multiplication is induced by $- \Lt_A -$, and $[A]$ is the unit element. \end{defn} Let $T$ be a two-sided tilting complex over $A$-$A$ relative to $k$. For any $z \in Z(A)$, there is an endomorphism of $T$ induced by the multiplication by $z$ on each component of $T$ (see \cite[Proposition 9.2]{Rickard89} or \cite[Propsition 6.3.2]{KonZimm98}). This defines a $k$-algebra automorphism of $Z(A)$, which is denoted by $f_T$. The assignment $\Phi: \DPic_k(A) \to \Aut_k(Z(A)), [T] \mapsto f_T$ is a group morphism, see the paragraph in front of Definition 7 in \cite{Zim96} or \cite[Lemma 5.1]{Negron17}. Let us first recall some definitions in \cite[Section 3.1]{Negron17}. Suppose $n \in \Gamma(\Spec Z(A), \underline{\mathbb{Z}})$, which consists of continuous functions from $\Spec Z(A)$ to the discrete space $\Z$. For any $i \in \mathbb{Z}$, $n^{-1}(i)$ is both an open and closed subset of $\Spec Z(A)$. Since $\Spec Z(A)$ is quasi-compact, there exists a set of complete orthogonal idempotents $e_{n_1}, \cdots, e_{n_s}$ of $Z(A)$ such that $$n^{-1}(i) = \begin{cases} X_{e_i}, & i = n_j, \, j = 1, \cdots, s \\ \emptyset, & i \neq n_1, \cdots, n_s. \end{cases}$$ Set $e_i = 0$ for any $i \neq n_1, \cdots, n_s$, and $X_{e_i} = \emptyset$. For any complex $T$ of $Z(A)$-modules, the shift $\Sigma^n T$ is defined by $$\bigoplus_{i \in \Z, \, n^{-1}(i) = X_{e_i}} Te_{i} [-i].$$ Let $\Pic_{Z(A)}(A)$ be the Picard group of $A$ over $Z(A)$. Clearly $\Gamma(\Spec Z(A), \underline{\mathbb{Z}}) \times \Pic_{Z(A)}(A)$ can be viewed as a subgroup of $\DPic_{Z(A)}(A)$ via $(n, [P]) \mapsto [\Sigma^n P]$. The following result is proved in \cite{Negron17} under the assumption that $A$ is an Azumaya algebra. \begin{prop}\label{D-Pic-group} Let $A$ be an $k$-algebra which is a finitely generated projective module over its center $Z(A)$. Suppose that $\Spec A$ is canonically homeomorphic to $\Spec Z(A)$. Then (1) there is an exact sequence of groups \begin{equation}\label{ex-seq-DPic} 1 \longrightarrow \DPic_{Z(A)}(A) \longrightarrow \DPic_{k}(A) \stackrel{\Phi}{\longrightarrow} \Aut_k(Z(A)). \end{equation} (2) $\DPic_{Z(A)}(A) = \Gamma(\Spec Z(A), \underline{\mathbb{Z}}) \times \Pic_{Z(A)}(A)$. \end{prop} \begin{proof} It is obvious that $\Ker \Phi = \DPic_{Z(A)}(A)$. Hence \eqref{ex-seq-DPic} is a exact sequence of groups. Next we prove $\DPic_{Z(A)}(A) = \Gamma(\Spec Z(A), \underline{\mathbb{Z}}) \times \Pic_{Z(A)}(A)$. Let $T$ be a two-sided tilting complex over $A$ relative to $k$. By Theorem \ref{tilting complex for finite over center case}, there exists a global section $n \in \Gamma(\Spec Z(A), \underline{\mathbb{Z}})$ and an $A$-progenerator $P$, such that $T \cong \Sigma^nP$ in $\D^\mathrm{b}(A)$. It follows from the fact that $$A \cong \End_{\D^\mathrm{b}(A)}(T) \cong \End_{\D^\mathrm{b}(A)}(\Sigma^nP) = \End_{\D^\mathrm{b}(A)}(P) = \End_A(P)$$ that $P$ is an invertible $A$-$A$-bimodule with central $Z(A)$-action. By \cite[Proposition 2.3]{RouZi03}, there exists an automorphism $\sigma \in \Aut_k(A)$ such that $T \cong {^{\sigma} (\Sigma^nP)}$ in $\D^\mathrm{b}(A^e)$. If $\Phi([T]) = \id_{Z(A)}$, then $\sigma \in \Aut_{Z(A)}(A)$. Hence $T \cong \Sigma^n({^{\sigma}P})$ in $\D^\mathrm{b}(A^e)$. It follows that $\DPic_{Z(A)}(A) = \Gamma(\Spec Z(A), \underline{\mathbb{Z}}) \times \Pic_{Z(A)}(A)$. \end{proof} Given any algebra automorphism $\sigma$ of $Z(A)$, there is a $k$-algebra $B$ with $Z(B)=Z(A)$ and a $k$-algebra isomorphism $\widetilde{\sigma}: A \to B$, such that $\sigma=\widetilde{\sigma}|_{Z(A)}$. This determines uniquely an isomorphism class of $B$ as $Z(A)$-algebra (see \cite[page 9]{F} for the definition). Then it induces an $\Aut_k(Z(A))$-action on the $Z(A)$-algebras which are isomorphic to $A$ as $k$-algebras. The image of $\Phi$ is just the stabilizer $\Aut_k(Z(A))_{[A]}$ of the derived equivalent class (relative to $Z(A)$) of $A$. \begin{rk} Suppose that $A$ is an Azumaya algebra. (1) For any $k$-algebra $B$, $B$ is derived equivalent to $A$ if and only if $B$ is Morita equivalent to $A$. So $\Aut_k(Z(A))_{[A]}$ is also the stabilizer of the Brauer class of $A$ just as in \cite{Negron17}. (2) Notice that $\DPic_{Z(A)}(A) \cong \DPic_{Z(A)}(Z(A)) \cong \Gamma(\Spec Z(A), \underline{\mathbb{Z}}) \times \Pic_{Z(A)}(A)$ is an abelian group. Hence $\DPic_{k}(A)$ is a group extension of $\Aut_k(Z(A))_{[A]}$ by $\DPic_{Z(A)}(A)$ \cite[Theorem 1.1]{Negron17}. If $A$ is not an Azumaya algebra, $\DPic_{Z(A)}(A)$ may not be abelian. \end{rk} \section*{Acknowledgements} The authors are very grateful to the referee for the valuable comments and suggestions. This research is partially supported by the Natural Science Foundation of China (Grant No. 11771085) and the National Key Research and Development Program of China (Grant No. 2020YFA0713200). The authors are also very grateful to Qixiao Ma for useful discussions \thebibliography{plain} \bibitem{A17} B. Antieau, Twisted derived equivalence for affine schemes, Brauer groups and obstruction problems, Progr. Math., vol. 320, Birkh$\ddot{a}$user, Springer, Cham, 2017, pp. 7--12. \bibitem{ATV90} M. Artin, J. Tate and M. Van den Bergh, Some algebras associated to automorphisms of elliptic curves, The Grothendieck Festschrift, vol. I, Progress in Mathematics 86 (eds P. Cartier, L. Illusie, N. M. Katz, G. Laumon, Y. I. Manin and K. A. Ribet; Birkh\"{a}user, Boston, MA, 1990) 33--85. \bibitem{ATV91} M. Artin, J. Tate, and M. Van den Bergh, Modules over regular algebras of dimension 3, Invent. Math. 106 (1991), no. 2, 335--388. \bibitem{Bla73} W. D. Blair, Right Noetherian rings integral over their centers, J. Algebra 27 (1973), 187--198. \bibitem{Bourbaki} N. Bourbaki, Commutative Algebra, Elements of Mathematics, Springer, 1989, English translation ed., Chapters 1--7. \bibitem{BrownGordon03} K. Brown, I. Gordon, Poisson orders, symplectic reflection algebras and representation theory, J. Reine Angew. Math. 559 (2003), 193--216. \bibitem{F} A. Fr\"{o}hlich, The Picard group of noncommutative rings, in particular of orders. Trans. Amer. Math. Soc. 180 (1973), 1--45. \bibitem{Ja} N. Jacobson, Basic Algebra II, W. H. Freeman and Company, San Francisco, 1989. \bibitem{KonZimm98} S. K\"{o}nig, A. Zimmermann, Derived Equivalences for Group Rings, Lect. Notes Math., vol. 1685, 1998. \bibitem{MI} F. D. Meyer and E. Ingraham, Separable Algebras over Commutative Rings, 1971 edition, Springer, 1971. \bibitem{Negron17} C. Negron, The derived Picard group of an affine Azumaya algebra. Sel. Math. (N.S.) 23(2) (2017), 1449--1468. \bibitem{Rickard89} J. Rickard, Morita theory for derived categories, J. Lond. Math. Soc. 39 (1989), 436--456. \bibitem{Rickard91} J. Rickard, Derived equivalences as derived functors, J. Lond. Math. Soc. 43 (1991), 37--48. \bibitem{RouZi03} R. Rouquier, A. Zimmermann, Picard groups for derived module categories, Proc. Lond. Math. Soc. 87 (2003), 197--225. \bibitem{WWY19} C. Walton, X.-T. Wang, M. Yakimov, Poisson geometry of PI three-dimensional Sklyanin algebras, Proc. Lond. Math. Soc. (3) 118 (2019), no. 6, 1471--1500. \bibitem{Ye99} A. Yekutieli, Dualizing complexes, Morita equivalence and the derived Picard group of a ring, J. London Math. Soc. (2) 60 (3) (1999), 723--746. \bibitem{Ye10} A. Yekutieli, Derived equivalences between associative deformations, J. Pure Appl. Algebra 214 (2010), 1469--1476. \bibitem{Ye20} A. Yekutieli, Derived categories, Cambridge Studies in Advanced Mathematics, 183. Cambridge University Press, Cambridge, 2020. xi+607 pp. \bibitem{Zim96} A. Zimmermann, Derived Equivalences of Orders, in Proceedings of the ICRA VII, Mexico, eds: Bautista, Martinez, de la Pena. Can. Math. Soc. Conference Proceedings 18, (1996), 721--749. \end{document}
\section{Introduction} In this study, we propose a case-based similar image retrieval (SIR) method for histopathological whole slide images (WSIs) in digital pathology of malignant lymphoma. Malignant lymphoma is a group of blood malignancies with more than 70 subtypes~\cite{BB24571652}. Because each subtype has a different treatment strategy and prognosis, it is crucially important to identify the correct subtype through pathological diagnosis. Digital pathology based on WSIs is increasingly becoming popular, where a WSI contains an extremely large (e.g., $100,000 \times 100,000$ pixels) digital image of an entire specimen invasively extracted from a patient~\cite{el2019automated,miyoshi2020deep}. Given the WSI of a new malignant lymphoma patient, the goal of this SIR task is to retrieve ``similar'' WSIs from the database of past malignant lymphoma cases, where we need to find an appropriate ``similarity'' metric that is useful for pathological diagnosis of malignant lymphoma. In practice, hematopathologists perform diagnosis of malignant lymphoma in the following two stages. In the first stage, hematoxylin and eosin (H\&E)-stained tissue slides are analyzed to narrow down the list of potential subtypes and determine a combination of immunohistochemical (IHC) stains. In the second stage, the subtype is identified by analyzing the expression patterns of tissue slides stained with several IHC antibodies selected in the first stage. For inexperienced pathologists, narrowing down the subtypes and determining IHC staining patterns (combinations of IHC stains) in the first stage is a challenging and time-consuming task. Given an H\&E stained tissue specimen as an input query, the proposed case-based SIR method can retrieve similar cases from a database of past cases along with their IHC staining patterns and subtypes which were diagnosed by experienced hematopathologists. Such retrieved similar cases and their IHC patterns and subtypes will help to support the decision-making of pathologists in the first stage. The proposed case-based SIR method is constructed by learning an appropriate similarity or distance metric that has the following two properties: The first property is that the similarity between a query case and a retrieved case is determined based on the tumor regions in the two WSIs. Because the WSI of a malignant lymphoma specimen contains both normal and tumor cells, the similarity should be determined based only on information in the tumor region. However, it is difficult to know the region of a WSI that contains tumor cells, and the proposed method has to be trained using WSIs that have no annotations for the tumor region\footnote{ It is an extremely time-consuming task for pathologists to manually annotate the tumor regions in a large WSI, and it is almost impossible to conduct such annotations for hundreds of WSIs. }. To overcome this difficulty, we effectively incorporate attention-based multiple-instance learning (MIL)~\cite{ilse2018attention,hashimoto2020multi} into case-based SIR tasks. Because malignant lymphoma subtypes are characterized by information in the tumor region only, our basic idea is that the attention region extracted through attention-based MIL for subtype classification can be regarded as the tumor region. The second property is that the similarity is defined in such a way that cases with similar IHC staining patterns can be selectively retrieved. Several conventional SIR methods for digital pathology~\cite{wang2014learning,gordo2016deep,peng2019multi,hegde2019similar,shi2018pairwise,yang2020deep} employed distance metric learning (DML), which is based on the relevance of subtype labels where feature learning is performed such that the distance between two feature vectors from the same-labeled images is shorter. As malignant lymphoma cases are highly heterogeneous, different combinations of IHC stains are used even among cases with the same subtype labels. Owing to such heterogeneity of IHC staining patterns, the coincidence of subtype would not be a suitable distance metric. In this study, we address this problem by using the similarity of IHC staining patterns as the similarity between cases. We regard the similarity as the continuous relevance index between two cases, which enables us to learn a metric that properly incorporates the similarity of IHC staining patterns through contrastive DML~\cite{chopra2005learning}. Figure~\ref{fig:output} shows an example of the output of our case-based SIR method. Because a WSI contains the entire specimen including normal regions, it is important to find cases in which there exist similar tumor regions, rather than finding cases in which the entire WSI is similar. Therefore, as shown in Fig.~\ref{fig:output}, the proposed case-based SIR method not only provides similar past cases but also presents the tumor regions that are used to determine the similarity between a query and a retrieved similar case. It helps pathologists to understand how the retrieved similar cases were selected, IHC staining patterns used by the experienced pathologists, and subtypes finally identified for the retrieved similar cases. In this study, to verify the effectiveness of the proposed method, we applied it to 249 malignant lymphoma cases, each of which consisted of a WSI of a specimen, selected IHC staining patterns, and the final subtype diagnosed by experienced hematopathologists. In addition to the quantitative evaluation based on the similarity of IHC staining patterns, subjective evaluations by 12 pathologists were conducted to confirm that the retrieved similar cases based on the obtained similarity metric are helpful for malignant lymphoma pathology. \begin{figure*}[t] \begin{center} \includegraphics[width=0.85\linewidth]{output.pdf} \end{center} \caption{ Example of the output of the proposed case-based SIR method. When a user inputs a query case, the proposed method retrieves multiple similar past cases in the database. The proposed method provides not only similar WSIs but also attention weight heatmaps and representative image patches that contribute to the determination of retrieved similar cases. The five image patches for a query case are high-attention (HA) patches in which attention weights are relatively high in the entire tissue, whereas the corresponding similar image patches for retrieved similar cases are the most similar image patches to each of the HA image patches. The color frames in the image patches correspond to the small squares with same colors in the thumbnail of the WSI, indicating that each image patch was extracted from the corresponding region. The main challenge addressed in this study is determining the attention weights and similarity between image patches for the pathological diagnosis of malignant lymphoma. } \label{fig:output} \end{figure*} \section{Preliminaries} In this section, we first present the related works and our contributions. Thereafter, we formulate the problem setup and evaluation measures of the case-based SIR method. We also briefly describe the basic ideas of attention-based MIL and contrastive DML and explain the use of these techniques for developing the case-based SIR method. \subsection{Related works and our contributions} \paragraph{Related works} In digital pathology, the availability of digital histopathological images has enabled numerous applications including image classification~\cite{mousavi2015automated,hou2016patch,campanella2019clinical}, detection~\cite{cirecsan2013mitosis,cruz2014automatic,bejnordi2017diagnostic}, and segmentation~\cite{xu2015deep,gao2016multi,tokunaga2019adaptive,tanizaki2020computing}. Similar image retrieval is an important task in digital pathology~\cite{zheng2003design,caicedo2011content}, and recent advances in deep learning techniques have accelerated the development of SIR methods~\cite{jimenez2017deep,komura2018luigi,schaer2019deep,peng2019multi,hegde2019similar,kalra2020yottixel}. SIR methods in digital pathology are mainly categorized into two approaches: \emph{content-based SIR} and \emph{case-based SIR}. In digital pathology, because a WSI is extremely large, analyses are usually performed on the basis of small image patches extracted from a WSI. In content-based SIR, an image patch is given as a query, and similar image patches are retrieved as the results. Examples of content-based SIR studies for digital pathology include \cite{zheng2019encoding} (lung cancer), \cite{zheng2018histopathological} (breast cancer), and \cite{peng2019multi} (colorectal cancer). In contrast, case-based SIR methods must first select ``informative'' patches, and thereafter aggregate the similarities defined in multiple informative patches to form the overall WSI similarity. In the context of digital pathology, relatively few studies on case-based SIRs have been conducted. In \cite{jimenez2017deep}, an indicator known as the blue ratio, which is higher in regions with more cells, was used as the criterion for selecting informative patches. In \cite{kalra2020yottixel}, clustering was first applied to patches, and a representative patch from each cluster was considered as an informative patch. Although these approaches use simple methods for selecting informative patches, we employ attention-based MIL such that informative patches can be selected from the tumor region. For pathological image classification based on WSIs that contain normal and tumor cells, MIL has been demonstrated to be effective~\cite{mercan2017multi,ilse2018attention,das2018multiple,couture2018multiple,wang2019rmdl,campanella2019clinical,sudharshan2019multiple,hashimoto2020multi}. Attention-based MIL~\cite{hashimoto2020multi} is particularly useful because it can quantify the relative importance of each image patch in the WSI as attention weight. In pathological image classification, this implies that patches with high attention can be regarded as tumor regions because the information that determines subtype classification would exist in tumor regions. In this study, we incorporate attention-based MIL into case-based SIR tasks that enable the learning of distance measures based only on the information in the tumor region. In SIR, DML has been effectively used to obtain an appropriate distance metric~\cite{wang2014learning,gordo2016deep,peng2019multi,hegde2019similar,shi2018pairwise,yang2020deep}. DML methods can be roughly categorized into parametric distance measure- and feature learning-based approaches. The former approach includes Mahalanobis DML~\cite{weinberger2009distance,shen2010scalable,chang2012boosting} and multiple kernel learning~\cite{sonnenburg2006large,rakotomamonjy2007more,gonen2008localized,gonen2011multiple}. When the SIR method is implemented with a deep neural network (DNN) model, a feature learning-based approach is often adopted. For instance, given a class label for each image, feature learning is performed based on a loss function such that images with the same label are closer together, whereas images with different labels are farther apart~\cite{shi2018pairwise,hegde2019similar,peng2019multi}. By selecting images based on the distance in the learned feature space, the distance metric in the SIR method can properly consider the class labels. The proposed SIR method is designed to selectively retrieve similar cases with similar IHC staining patterns. As mentioned, we regard the similarity of IHC staining patterns to the continuous similarity between the two cases. Metric learning algorithms that use a continuous label or multi-label have been proposed~\cite{jin2009learning,gouk2016learning}. We also define the continuous relevance index between two cases using IHC staining patterns and perform metric learning that utilizes pathological images. \paragraph{Our contributions} In this study, we propose a case-based SIR method that supports malignant lymphoma pathology diagnosis by introducing a DNN model that effectively incorporates MIL and DML. To the best of our knowledge, there is no method that combines these techniques with the case-based SIR method. Overall, the main advantages of the proposed method and our contributions in this study are summarized as follows: \begin{itemize} \item By incorporating attention-based MIL into cased-based SIR tasks, the proposed method can retrieve similar cases based on a similarity measure that depends only on patches in the tumor region. \item By defining the similarity of two H\&E stained images using IHC staining patterns in contrastive DML, the proposed method can retrieve similar cases that would have similar IHC staining patterns. \item We applied the proposed method to 249 cases of malignant lymphoma and demonstrated its effectiveness through quantitative evaluation and subjective evaluation by 12 pathologists. \end{itemize} \subsection{Problem setup} In this study, we denote the set of natural numbers up to $c$ as $[c] := \{1, \ldots, c\}$. Let $N$ be the number of past malignant lymphoma cases (patients), $K$ be the number of subtypes, and $L$ be the number of the kinds of IHC stains. The entire database of the past cases is represented as $\cT = \{(\mathbb{X}_n, \mathbb{Y}_n,\mathbb{S}_n)\}_{n \in [N]}$, where $\mathbb{X}_n$ is a WSI, $\mathbb{Y}_n$ is a $K$-dimensional one-hot vector for the subtype, and $\mathbb{S}_n$ is an $L$-dimensional binary vector for IHC staining patterns. Here, the position of 1 in the one-hot vector $\mathbb{Y}_n$ indicates the subtype, whereas the values 1 and 0 in the binary vector $\mathbb{S}_n$ indicate whether or not the corresponding IHC stain was used for the pathological diagnosis. We develop a case-based SIR method using a database of past cases $\cT$, as shown in Fig.~\ref{fig:SIR}. As discussed in \S1, the proposed method is designed to selectively retrieve similar cases that would have similar IHC staining patterns using features in the tumor region only. Consider a situation in which a WSI $\mathbb{X}_m$ of a new query case $m$ is input to the method, and we want to compute the distance between the query case $m$ and one of the past cases $n \in [N]$. Let $\cI_n$ and $\cI_m$ be the sets of all image patches taken from ${\mathbb X}_n$ and ${\mathbb X}_m$, respectively, where $Q$ image patches are randomly sampled from the entire WSI\footnote{ We set $Q = 5000$ for the training phase and 1000 for the test phase in the demonstration study in \S4. }. Furthermore, let $\cI_n^{\rm (HA)} \subset \cI_n$ and $\cI_m^{\rm (HA)} \subset \cI_m$ be the sets of image patches taken from the (estimated) tumor region in ${\mathbb X}_n$ and ${\mathbb X}_m$, respectively, where ``HA'' denotes ``High-Attention'' and we refer to those patches as \emph{HA patches}. We denote the image patches from cases $n$ and $m$ as $\bm x_{n, i}, i \in \cI_n,$ and $\bm x_{m, j}, j \in \cI_m$, respectively. Furthermore, let us denote the feature vectors (which will be learned through DNN representation learning whose details will be explained in \S3) corresponding to image patches $\bm x_{n, i}$ and $\bm x_{m, j}$ as $\bm z_{n, i}$ and $\bm z_{m, j}$, respectively. The desirable distance metric for the proposed case-based SIR method between query case $m$ and past case $n$ is defined as \begin{align} \label{eq:prob} D(n, m) = \sum_{j \in \cI_m^{\rm (HA)}} \min_{i \in \cI_n^{\rm (HA)}} \|\bm z_{n, i} - \bm z_{m, j}\|_2. \end{align} Given a query WSI $\mathbb{X}_m$, the proposed case-based SIR method retrieves a (or a few) similar case $n$ such that the distance $D(n, m)$ is less than those of the remaining cases \footnote{The pairs of five image patches in Fig.~\ref{fig:output} are the top-5 HA image patches of the query case and the corresponding similar image patches of the retrieved similar cases. We display these pairs of image patches to explain the similarity between the query and retrieved similar cases. }. There are two challenges for learning the desirable distance metric \eq{eq:prob}. The first challenge is that the sets of patches in the tumor region $\cI_n^{\rm (HA)}$ and $\cI_m^{\rm (HA)}$ are unknown. As mentioned in \S1, to overcome this challenge, we employ attention-based MIL, the details of which will be described later. The second challenge is learning the features $\bm z_{n, i}$ and $\bm z_{m, j}$ as a DNN representation such that the distances in \eq{eq:prob} tend to be small when the IHC staining patterns ${\mathbb S}_n$ and ${\mathbb S}_m$ are similar. As mentioned in \S1, to overcome this challenge, we employ contrastive DML, the details of which will be described later. In \S3, we propose a DNN model and its learning algorithm by effectively combining attention-based MIL and contrastive DML for IHC staining patterns. \subsection{Evaluation measure} In the context of DML for classification problems, a common evaluation measure is simply the classification error (the subtype classification error in our problem setup). However, because H\&E stained tissues are highly heterogeneous even among cases with the same subtype labels, retrieving cases with the same subtypes is not sufficient. As a quantitative performance measure of the proposed case-based SIR method, we thus employ the Jaccard index for IHC staining patterns. Given a query case $m$ and a retrieved case $n$, the Jaccard index of their IHC staining patterns ${\mathbb S}_m$ and ${\mathbb S}_n$ is defined as follows: \begin{align} \label{eq:jaccard} r(n, m) := \frac{|{\mathbb S}_n \cap {\mathbb S}_m|}{|{\mathbb S}_n \cup {\mathbb S}_m|}. \end{align} We verified that the similarity of IHC staining patterns in the form of \eq{eq:jaccard} is more meaningful measure than subtype classification error for case-based SIR in practical malignant lymphoma pathology by conducting subjective evaluation experiments by 12 pathologists. In the subjective evaluation experiments, given a query case, we present a pair of retrieved similar cases, one of which is selected based on a distance measure trained to comply with the IHC staining patterns, whereas the other is selected using a distance measure trained to minimize subtype classification error, and pathologists answer which of the two cases are more similar to the query case. The details of the subjective evaluations are presented in \S4. \subsection{Attention-based MIL} Here, we describe the basic idea of attention-based MIL~\cite{ilse2018attention}, which is used as a component of the proposed DNN model in the next section, and its use in the proposed case-based SIR method. In attention-based MIL, we define a \emph{bag} as a set of image patches randomly sampled from a WSI. The basic idea of attention-based MIL is to assign \emph{an attention weight} to each image patch, which indicates the relative importance of each image patch within the bag. Let $\cB_n$ be the set of bags in the case $n \in [N]$ and $\cJ_{n,b}$ be the set of image patches in the bag $b$ of case $n$. Furthermore, we denote $a_{n,b,i}$ as the attention weight of the image patch $i \in \cJ_{n,b}$. The attention weight $a_{n,b,i}$ takes a value in $[0, 1]$, and it is normalized such that the sum of the attention weights in each bag is one, that is, $\sum_{i \in \cJ_{n, b}} a_{n, b, i} = 1$. In attention-based MIL, a classifier (for malignant lymphoma subtype classification) is trained with the importance weighting of each image patch by the attention weight, whereas the attention weights are also adaptively updated during the training process. Because malignant lymphoma subtypes are characterized by information in the tumor region only, image patches that have high attention weights are considered to be taken from the tumor region. In this study, we assume that at least $M$ image patches in each bag are sampled from the tumor region; thus, the collection of the top-$M$ image patches in all the bags $b \in \cB_n$ are considered as the set of high-attention image patches $\cI_n^{\rm (HA)}$\footnote{ We set $M = 10\%$ of all the image patches in a bag in the demonstration study in \S4. }. \subsection{Contrastive DML} Here, we describe the basic idea of contrastive DML~\cite{chopra2005learning}, which is used as a component of the proposed DNN model in the next section, and its use in the proposed case-based SIR method. The goal of conventional feature learning-based DML is to learn a function that maps an image patch $\bm x_{n, i}$ to a feature vector $\bm z_{n, i}$ for $n \in [n], i \in \cI_n$ such that the Euclidean distance between the features $\bm z_{n, i}$ and $\bm z_{m, j}$ is small if the cases $n$ and $m$ belong to the same class, that is, ${\mathbb Y}_n = {\mathbb Y}_m$. As discussed, because we intend to retrieve similar cases that would have similar IHC staining patterns rather than just belonging to the same subtype, we need to incorporate the similarity of IHC staining patterns into the distance metric. Let $d(\bm x_{n, i}, \bm x_{m, j}) := \|\bm z_{n, i} - \bm z_{m, j}\|_2$, and consider the problem of learning the distance function $d(\cdot, \cdot)$ to minimize the following loss function: \begin{align} \nonumber \sum_{(n, m) \in [N]^2 } & \sum_{(i, j) \in \cI_n^{\rm (HA)} \times \cI_m^{\rm (HA)}} \big\{ r(n, m) d(\bm x_{n, i}, \bm x_{m, j})^2 \\ \label{eq:contrastive_loss} & + (1 - r(n, m)) {\rm max}\left(G - d(\bm x_{n, i}, \bm x_{m, j}), 0\right)^2 \big\}, \end{align} where $G$ is a hyperparameter that defines a margin between dissimilar image patches\footnote{ We set $G = 1.0$ in the demonstration study in \S4. } (see \eq{eq:concrete_distance_function} in \S3.1 for the concrete formulation of the distance function $d(\cdot, \cdot)$). In \eq{eq:contrastive_loss}, $r(n, m)$ is known as the \emph{relevance index} in the context of contrastive DML, and we employ the Jaccard index in \eq{eq:jaccard} as the relevance index for our task. The first term in \eq{eq:contrastive_loss} works such that image features of two inputs with similar labels are closer together, whereas the second term works such that image features of two inputs with different labels are farther apart based on the margin $G$. By learning a feature extraction function that minimizes the loss in \eq{eq:contrastive_loss}, we can obtain a distance function $d(\cdot, \cdot)$ that incorporates the similarity of the IHC staining patterns. \begin{figure*}[t] \begin{center} \includegraphics[width=0.95\linewidth]{SIR.pdf} \end{center} \caption{ Overview of the training and test phases of the proposed case-based SIR model. In the training phase, only HA image patches are sampled from the entire image patches of past cases, and the image features $\{\bm z_{n, i}\}_{i\in \cI_n^{\rm (HA)}}$ for HA patches $\{\cI_n^{\rm (HA)}\}_{n \in [N]}$ are saved in the search database. In the test (similar case retrieval) phase, given a new query WSI $\mathbb X_m$, HA image patches $\cI_m^{\rm (HA)}$ are sampled similarly and their features $\{\bm z_{m, j}\}_{j\in \cI_m^{\rm (HA)}}$ are calculated. By computing the case distance $D(n,m)$ between the query case $m$ and all the past cases $n \in [N]$, the case $n$ that has the minimum (resp., the 2nd, 3rd, $\ldots$ minimum) distance from a query case $m$ is retrieved as the most similar (resp., the 2nd, 3rd, $\ldots$ most similar) case. } \label{fig:SIR} \end{figure*} \section{Proposed case-based SIR method} We propose a DNN model and its learning algorithm that provides the desirable distance metric in \eq{eq:prob} for our case-based SIR task by effectively combining attention-based MIL and contrastive DML. The problem of learning the desirable distance metric in \eq{eq:prob} is decomposed into two sub-problems as follows: The first sub-problem is to learn a function for extracting a set of image patches $\cI_n^{\rm (HA)}$ from the estimated tumor region. The second sub-problem is to learn a function that maps an image patch $\bm x_{n, i}$ into a feature vector $\bm z_{n, i}$ for $n \in [N]$, $i \in \cI_n^{\rm (HA)}$, the latter of which is used to measure the distance in \eq{eq:prob}. Each of these two functions is obtained as a part of the entire DNN model. \subsection{DNN model} Figure~\ref{fig:model} illustrates the entire DNN model that consists of four components: $f_{\rm enc}$, $f_{\rm att}$, $f_{\rm clf}$, and $f_{\rm met}$, each of which is parametrized by a set of learnable parameters $\theta_{\rm enc}$, $\theta_{\rm att}$, $\theta_{\rm clf}$, and $\theta_{\rm met}$, respectively. Each component is described as follows: \begin{itemize} \item {\bf Feature extractor} $f_{\rm enc}$: % The first component $f_{\rm enc}$ is known as the \emph{feature extractor}, which is introduced such that the two aforementioned sub-problems have common shared features. % The feature extractor is a mapping as follows: \begin{align} f_{\rm enc}: \bm x_{n, i} \mapsto \bm h_{n, i}, i \in \cI_n, n \in [N], \end{align} where $\bm h_{n, i}$ denotes a feature vector of the image patch $\bm x_{n, i}$, which is implicitly defined by learning the representation in the DNN model. \item {\bf Attention network} $f_{\rm att}$: % The second component $f_{\rm att}$ is used to compute the attention weights $a_{n, b, i}$, $n \in [N], b \in \cB_n, i \in \cJ_{n, b} \subset \cI_n$, and it is formally expressed as follows: \begin{align} f_{\rm att}: \{\bm h_{n, i}\}_{i \in \cJ_{n, b}} \mapsto \{a_{n, b, i}\}_{i \in \cJ_{n, b}}, n \in [N], b \in \cB_n. \end{align} % Particularly, the attention weight is computed as follows: \begin{align} \label{eq:attention_weight} a_{n, b, i} = \frac{ \exp \left( \bm{w}^\top {\rm tanh}(\bm{V} \bm{h}_{n, i}) \right) }{ \sum_{j \in \cJ_{n, b}} \exp \left( \bm{w}^\top {\rm tanh}(\bm{V} \bm{h}_{n, j}) \right) }, i \in \cJ_{n, b}, \end{align} where $\bm V$ denotes a matrix of parameters, and $\bm w$ denotes a vector of parameters with appropriate dimensions, that is, $\theta_{\rm att} := (\bm{V}, \bm{w})$. \item {\bf Classifier network} $f_{\rm clf}$: % The third component $f_{\rm clf}$ is used to classify the malignant lymphoma subtype based on the MIL framework (see \S2.4). % In MIL, a bag (a set of image patches randomly sampled from a WSI) $\cJ_{n, b}$, $b \in \cB_n, n \in [N]$, is classified into one of the $K$ subtypes. % The input of $f_{\rm clf}$ is the weighted feature vector with attention weights as follows: \begin{align} \bm u_{n,b} := \sum_{i \in \cJ_{n, b}} a_{n,b,i} \bm h_{n,i}, n \in [N], b \in \cB_n. \end{align} % Given an input $\bm u_{n,b}$, the subtype classifier outputs the $K$-dimensional class probability vector $P(\hat{\bm Y}_{n,b})$. % Note that constructing a subtype classifier is not the main purpose of this study. % By training the subtype classifier in the MIL framework, the attention network $f_{\rm att}$ is trained such that image patches taken from the tumor region have large attention weights. \item {\bf Metric network} $f_{\rm met}$: % The fourth component $f_{\rm met}$ is used to transform the feature vector $\bm h_{n, i}$, $n \in [N]$, $i \in \cI_n^{\rm (HA)}$, obtained by the feature extractor $f_{\rm enc}$ into another feature vector $\bm z_{n, i}$, which is used for the desirable distance metric in \eq{eq:prob} through contrastive DML (see \S2.5). % The metric network $f_{\rm met}$ is trained such that the contrastive loss in \eq{eq:contrastive_loss} is minimized, where the distance function $d(\bm x_{n, i}, \bm x_{m, j})$ is implemented with $f_{\rm enc}$ and $f_{\rm met}$ as follows: \begin{align} \nonumber d(\bm x_{n, i}, \bm x_{m, j}) & := \| \bm z_{n, i} - \bm z_{m, j} \|_2 \\ \label{eq:concrete_distance_function} & = \| f_{\rm met}(f_{\rm enc}(\bm x_{n, i})) - f_{\rm met}(f_{\rm enc}(\bm x_{m, j})) \|_2. \end{align} % Note that when $f_{\rm met}$ is trained, only parts of the image patches $\{\cI_n^{\rm (HA)}\}_{n \in [N]} \subset \{\cI_n\}_{n \in [N]}$ are used. % As described in \S2.4, $\cI_n^{\rm (HA)}$ is the set of image patches whose attention weights are within the top $M$ in each bag $b \in \cB_n$. \end{itemize} \subsection{Training DNN model} The parameters of the four components $\theta_{\rm enc}$, $\theta_{\rm att}$, $\theta_{\rm clf}$, and $\theta_{\rm met}$, respectively, for $f_{\rm enc}$, $f_{\rm att}$, $f_{\rm clf}$, and $f_{\rm met}$ are optimized by the alternate algorithm following two minimization problems: \begin{align} \left( \hat{\theta}_{\rm enc}, \hat{\theta}_{\rm att}, \hat{\theta}_{\rm clf} \right) \leftarrow \mathop{\rm argmin}\limits_{ \theta_{\rm enc}, \theta_{\rm att}, \theta_{\rm clf} } \sum_{n \in [N]} \sum_{b \in \cB_n} \cL_{\rm c}(\mathbb{Y}_n, P(\hat{\bm Y}_{n, b})), \\ \left( \hat{\theta}_{\rm enc}, \hat{\theta}_{\rm met} \right) \leftarrow \mathop{\rm argmin}\limits_{ \theta_{\rm enc}, \theta_{\rm met} } \sum_{(n, m) \in [N]^2} \sum_{(i, j) \in \cI_n^{\rm (HA)} \times \cI_m^{\rm (HA)}} \mathcal{L}_{\rm d}(\bm{z}_{n, i},\bm{z}_{m, j}), \end{align} where the loss function $\cL_{\rm c}$ is the standard cross-entropy loss defined as follows: \begin{align} \cL_{\rm c}(\mathbb{Y}_n, P(\hat{\bm Y}_{n, b})) := - \sum_{k \in [K]} \mathbb{Y}_{n, k} \log P(\hat{\bm Y}_{n, b})_k, \end{align} whereas the loss function $\cL_{\rm d}$ is the contrastive loss function (see \eq{eq:contrastive_loss}), defined as follows: \begin{align} \nonumber \cL_d(\bm z_{n, i}, \bm z_{n, j}) & := r(n, m) \|\bm z_{n, i} - \bm z_{m, j}\|_2^2 \\ & + (1 - r(n, m)) {\rm max}\left(G - \|\bm z_{n, i} - \bm z_{m, j}\|_2, 0\right)^2. \end{align} In our implementation, four components are implemented as follows: We employ ResNet50~\cite{he2016deep} as the feature extractor $f_{\rm enc}$, and it is initialized with the extractor pre-trained with the ImageNet database~\cite{deng2009imagenet}. The attention network $f_{\rm att}$ is implemented as a softmax operator in \eq{eq:attention_weight}. The classifier network $f_{\rm clf}$ is implemented using a simple multi-layer perception for multiclass classification. The metric network $f_{\rm met}$ is implemented using a simple multi-layer perception for feature transformation. \subsection{Case-based SIR based on the trained DNN model} For the construction of the search database in the case-based SIR task, $Q$ image patches are randomly sampled from each WSI in the training dataset, and the attention weights of these image patches are calculated by the trained feature extractor $f_{\rm enc}$ and the trained attention network $f_{\rm att}$. Thereafter, from these image patches, $M$ image patches that have higher attention weights than other image patches are selected as the HA patches $\{\bm x_{n, i}\}_{i \in \cI_n^{\rm (HA)}}$, and their feature vectors $\{\bm z_{n, i}\}_{n \in [N], i \in \cI_n^{\rm (HA)}}$ are saved on the database as references. In the testing (retrieval) phase, when a new query case $m$ is input to the SIR model, $M$ of HA image patches are sampled from $Q$ image patches $\{\bm x_{m, j}\}_{j \in \cI_m}$, and the feature vectors for HA image patches $\{\bm z_{m, j}\}_{j \in \cI_m^{\rm (HA)}}$ are computed using the aforementioned procedure. For each $n \in [N]$, the distance $D(n, m)$ in \eq{eq:prob} is calculated, and the most similar case (or multiple cases with the highest similarity) are retrieved. Along with the selection of the most similar case(s), a set of similar image patch pairs is also provided as additional information (see \S2.2 and Fig.~\ref{fig:output}). \paragraph{Multi-scale input} Because pathologists observe the H\&E stained tissue slides under a microscope at different magnifications, it is preferred that the retrieval results are also based on similarity using multi-scale information. In the training phase using multi-scale inputs, different DNN models are independently trained with image patches of the corresponding magnifications. In the testing (retrieval) phase using two magnifications (e.g., 40x and 5x), the distance between image patches of high and low magnifications is calculated similar to \eq{eq:concrete_distance_function} as follows: \begin{align} d^{({\rm H,L})}(\bm{x}^{({\rm H})}_{n,i},\bm{x}^{({\rm H})}_{m,j}, \bm{x}^{({\rm L})}_{n,i},\bm{x}^{({\rm L})}_{m,j} ) := ||\bm{z}^{({\rm H})}_{n,i}-\bm{z}^{({\rm H})}_{m,j}||_2 + ||\bm{z}^{({\rm L})}_{n,i}-\bm{z}^{({\rm L})}_{m,j}||_2. \end{align} The embedded image features $\bm{z}_{n,i}^{({\rm H})}$ and $\bm{z}_{n,i}^{({\rm L})}$ are calculated from the image patches $\bm{x}_{n,i}^{({\rm H})}$ and $\bm{x}_{n,i}^{({\rm L})}$ for high and low magnifications, respectively. Note that image patches $\bm{x}_{n,i}^{({\rm H})}$ and $\bm{x}_{n,i}^{({\rm L})}$ are extracted from the regions of the same central field of view in the WSI. High-attention patches for multi-scale input are selected using the average attention weights for multiple magnifications $a^{({\rm H,L})}_{n,i}=(a^{({\rm H)}}_{n,i}+a^{({\rm L})}_{n,i})/2$. Similar cases are obtained by comparing the case distances using multi-scale patch distances $d^{({\rm H,L})}(\bm{x}^{({\rm H})}_{n,i},\bm{x}^{({\rm H})}_{m,j}, \bm{x}^{({\rm L})}_{n,i},\bm{x}^{({\rm L})}_{m,j} )$ between the HA image patches that are selected based on multi-scale attention weights $a^{({\rm H,L})}_{n,i}$. If we employ three or more magnifications as the multi-scale input, the same number of DNN models are trained according to the increase in the number of input magnifications. \begin{figure*}[t] \begin{center} \includegraphics[width=0.85\textwidth]{./model.pdf} \end{center} \caption{Schematic illustration of the DNN model for the proposed method. The DNN model effectively combines attention-based MIL classification to identify tumor-specific image patches as HA patches and contrastive DML to learn the appropriate distance metric by incorporating the similarity of IHC staining patterns. % The proposed DNN model consists of four components, $f_{\rm enc}$, $f_{\rm att}$, $f_{\rm clf}$, and $f_{\rm met}$, each of which is parameterized by a set of learnable parameters $\theta_{\rm enc}$, $\theta_{\rm att}$, $\theta_{\rm clf}$, and $\theta_{\rm met}$, respectively. % The parameters for attention-based MIL and contrastive DML are alternately updated. % } \label{fig:model} \end{figure*} \section{Experiments} To demonstrate the effectiveness of the proposed method, we applied it to 249 malignant lymphoma cases, each of which contains a WSI of a specimen, selected IHC stains, and the final subtype diagnosed by experienced hematopathologists. In addition to the quantitative evaluation based on the similarity of IHC staining patterns, subjective evaluations by 12 pathologists were conducted to confirm that the retrieved similar cases based on the obtained similarity metric are useful in the pathological diagnosis of malignant lymphoma. \subsection{Experimental setup} \paragraph{Malignant lymphoma dataset} The malignant lymphoma dataset contains $N = 249$ clinical cases with three subtypes: 76 diffuse large B-cell lymphoma, 90 follicular lymphoma, and 83 reactive lymphoid hyperplasia. All cases were diagnosed at Kurume University in 2018, and the subtype labels for each case were identified by confirming the expression patterns of IHC stained tissue slides. The samples used in this study were approved by the Ethics Review Committee of Kurume University and RIKEN in accordance with the recommendations of the Declaration of Helsinki. For each case, we can refer to diagnostic information containing patient metadata, subtype, IHC staining pattern, and other findings. In total, $L = 26$ types of IHC antibodies were used in this study. All glass slides were digitized using a WSI scanner Aperio GT 450 (Leica Biosystems, Germany) at 40x the original magnification (0.26 um/pixel). The 249 cases were split into five groups while maintaining the ratio of subtypes, and 5-fold cross-validation was performed. In each fold of cross-validation, 25\% of the training cases were used as validation cases, which were used for selecting hyperparameters. Using a WSI software OpenSlide~\cite{goode2013openslide}, the sets of image patches $\{\cI_n\}_{n \in [N]}$ were extracted from the tissue regions that were determined using Otsu method~\cite{otsu1979threshold} through saturation of HSV color space. \paragraph{Implementation details} The feature extractor $f_{\rm enc}$ was initialized by the ResNet50 pre-trained with the ImageNet database, and the dimension size of the feature vector $\bm h_{n,i}, n \in [N], i \in \cI_n$ was set to 2048 after global average pooling layer. For attention-based MIL, 5000 image patches with $224 \times 224$ pixels were extracted from each WSI and 50 bags, each of which contained 100 image patches, were used\footnote{If a WSI was excessively small to extract 5000 non-overlapping image patches, only a small number of available image patches were used.}. After one-epoch training of attention-based MIL, that is, all bags were used for training once, the training of contrastive DML was conducted by using HA patches whose attention weights were ranked at the top $M = 10\%$ of all image patches in each bag, that is, $50 \times 100 \times 0.1 = 500$ HA patches. In contrastive DML, 100 HA patches were randomly selected from the 500 HA patches for each case, and $N_{\rm tr} \times 100 / 2$ HA patch pairs were constructed such that each selected HA patch was used only for one of the pairs, where $N_{\rm tr}$ denotes the number of training cases. The training of contrastive DML was conducted for 10 epochs. This process was repeated 10 times in overall training, that is, attention-based MIL was trained for 10 epochs, whereas contrastive DML was trained for 100 epochs. The parameters of the network were optimized using stochastic gradient descent (SGD) momentum~\cite{qian1999momentum}, where the learning rate, momentum, and weight decay were set to 1.25$\times 10^{-4}$, 0.9, and $10^{-4}$, respectively. In the case-based SIR task after training, 1000 image patches were randomly extracted from each WSI, and 100 HA image patches with attention weights within the top 10\% in each case were used to compute the case distance $D(n,m)$. Similar cases were retrieved based on the case distance, and the method provided retrieval results in descending (resp. ascending) order of similarity (resp. distance). In our experiment, we considered 40x image input, 5x image input, and multi-scale input of 40x and 5x as the magnification of the input image patches (see Fig.~\ref{fig:output}). \paragraph{Baseline methods} We compared the following five methods: \begin{itemize} \item {\bf pre-trained ResNet50 + all patches}, \item {\bf subtype-based metric + all patches}, \item {\bf staining-based metric + all patches}, \item {\bf subtype-based metric + HA patches}, and \item {\bf staining-based metric + HA patches (proposed method)}. \end{itemize} Here, ``all patches'' represents that attention-based MIL was not employed and image patches were randomly selected, whereas ``HA patches'' represents that attention-based MIL was used for selecting HA image patches. In ``all patches'' setting, 1000 image patches were first randomly extracted from each WSI, and the training of contrastive DML was conducted for 100 epochs in which 100 image patches were randomly extracted from the 1000 image patches. Furthermore, ``subtype-based metric'' indicates that the relevance index $r(m, n)$ in \eq{eq:contrastive_loss} for contrastive DML was defined as 1 if the subtypes of the two cases are the same and 0 otherwise, whereas ``staining-based metric'' indicates that the Jaccard index of IHC staining patterns in \eq{eq:jaccard} was used as the relevance index. The first method ``pre-trained ResNet50 + all patches'' is a simple baseline in which neither attention-based MIL nor contrastive DML was used, and the distance between two cases was simply measured by the distances between two feature vectors obtained by a pre-trained ResNet50 with the ImageNet database without any fine tuning. By comparing the proposed method with the first four baseline methods, we demonstrate the effect of selecting HA image patches through attention-based MIL and the effect of considering the similarity of IHC staining patterns through contrastive DML. \subsection{Results} One of the main contributions of this study is the utilization of IHC staining patterns to provide a useful similarity measure for heterogeneous malignant lymphoma cases. The performance of the proposed and baseline methods was evaluated not only through a quantitative evaluation but also through a subjective evaluation by 12 pathologists. First, in the quantitative evaluation, the similarity of IHC staining patterns between a test query case and a retrieved similar case were compared among the methods. In the subjective evaluation, we examined whether IHC staining similarity is a more appropriate measure than subtype similarity for the pathological diagnosis of malignant lymphoma. \paragraph{Quantitative evaluation} We evaluated the case-based SIR performance based on the similarity of the IHC staining patterns between an input query case and a retrieved similar case in the form of IHC staining accuracy defined by the Jaccard index in \eq{eq:jaccard}. Table~\ref{tab:accs} summarizes the results with three types of magnifications: 40x, 5x, and multi-scale of 40x \& 5x. In the table, the average IHC staining accuracies of top-5 retrieved similar cases are listed. The results demonstrate that the proposed method has the highest IHC staining accuracy among all the methods for all three types of magnifications. The differences in the IHC staining accuracies between the proposed and four baseline methods are statistically significant at a significance level of 0.05, except for the 40x image input. \begin{table*}[!t] \caption{Comparison of IHC staining accuracy between query cases and retrieved similar cases through 5-fold cross-validation with three types of magnifications. % Each result shows the mean and standard error of the average accuracies of the top-5 retrieved similar cases for each query case. % The proposed method achieved the best IHC staining accuracy in all types of magnifications. % The differences between the proposed method and all the baseline methods are statistically significant at the 0.05 level in 5x and multiscales of 40x \& 5x. } \begin{center} \begin{tabular}{lccc} \hline \multirow{2}{*}{Methods} & \multicolumn{3}{c}{Magnifications}\\ & 40x & 5x & 40x \& 5x \\ \hline \hline \multicolumn{1}{l}{Pre-trained ResNet50 + all patches} & 0.602$\pm$0.001 & 0.601$\pm$0.001 & 0.609$\pm$0.010 \\ \multicolumn{1}{l}{Subtype-based metric + all patches} & 0.618$\pm$0.010 & 0.641$\pm$0.011 & 0.645$\pm$0.011 \\ \multicolumn{1}{l}{Staining-based metric + all patches} & 0.642$\pm$0.011 & 0.650$\pm$0.011 & 0.660$\pm$0.012 \\ \multicolumn{1}{l}{Subtype-based metric + HA patches} & 0.633$\pm$0.010 & 0.643$\pm$0.011 & 0.653$\pm$0.010 \\ \multicolumn{1}{l}{Staining-based metric + HA patches (proposed)} & \underline{\bf{0.647$\pm$0.011}} & \underline{\bf{0.669$\pm$0.011}} & \underline{\bf{0.676$\pm$0.011}} \\ \hline \end{tabular} \end{center} \label{tab:accs} \end{table*} We also compared the similarity of malignant lymphoma subtypes between an input query case and a retrieved similar case in the form of subtype accuracy, which takes 1 if the two subtypes are the same and 0 otherwise. Table~\ref{tab:accl} summarizes the subtype accuracy results in the same format as Table~\ref{tab:accs}. Although the criterion employed in the proposed method is not directly related to the subtype accuracy measure, the proposed method achieved the best performance among the five methods in two of the three magnification settings. In the magnification setting of 40x, ``subtype-based metric + HA patches'' achieved the best performance. This is reasonable because the subtype-based metric is directly tailored to subtype accuracy. In terms of the reason why the proposed method with ``staining-based metric'' was better or comparative to the method with ``subtype-based metric,'' we conjecture that a good representation for IHC staining patterns is also a good representation for the subtype because the difference in IHC staining patterns reflects the heterogeneity of malignant lymphoma subtypes. \begin{table*}[!t] \caption{ Comparison of subtype accuracy between query cases and retrieved similar cases through 5-fold cross-validation with three types of magnifications. % Each result shows the mean and standard error of the average accuracies of the top-5 retrieved similar cases for each query case. % The proposed method achieved the best subtype accuracy in two out of three magnifications and it was comparable in the remaining magnification. % Note that the subtype accuracy is directly tailored to subtype-based metric. % We conjecture that the proposed method with a staining-based metric had good performance in terms of not only IHC staining accuracy but also subtype accuracy because a good representation of IHC staining patterns is also a good representation of subtypes. } \begin{center} \begin{tabular}{lccc} \hline \multirow{2}{*}{Methods} & \multicolumn{3}{c}{Magnifications}\\ & 40x & 5x & 40x \& 5x \\ \hline \hline \multicolumn{1}{l}{Pre-trained ResNet50 + all patches} & 0.633$\pm$0.018 & 0.625$\pm$0.017 & 0.654$\pm$0.017 \\ \multicolumn{1}{l}{Subtype-based metric + all patches} & 0.673$\pm$0.019 & 0.714$\pm$0.020 & 0.736$\pm$0.020 \\ \multicolumn{1}{l}{Staining-based metric + all patches} & 0.578$\pm$0.021 & 0.600$\pm$0.020 & 0.565$\pm$0.022 \\ \multicolumn{1}{l}{Subtype-based metric + HA patches} & \underline{\bf{0.720$\pm$0.020}} & 0.737$\pm$0.021 & 0.774$\pm$0.020 \\ \multicolumn{1}{l}{Staining-based metric + HA patches (proposed)} & 0.712$\pm$0.021 & \underline{\bf{0.770$\pm$0.020}} & \underline{\bf{0.783$\pm$0.019}} \\ \hline \end{tabular} \end{center} \label{tab:accl} \end{table*} \paragraph{Subjective evaluation} The goal of the subjective evaluation is to confirm whether IHC staining similarity is a more appropriate measure than subtype similarity for the pathological diagnosis of malignant lymphoma. To this end, we only compared the proposed method ``{\bf staining-based metric + HA patches}'' with one of the baseline methods ``{\bf subtype-based metric + HA patches}'' in the subjective evaluations. The task of each participant (pathologist) was to evaluate which of the two retrieval results (obtained using the proposed and baseline methods, respectively) was more similar to an input query. An example of the subjective evaluation task is shown in Fig.~\ref{fig:sbj}. For an input query case, the image patches of 40x and 5x magnifications with the top-5 attention weights were shown. For a retrieved similar case, the image patches that had the minimum distance from each query image patch obtained using each method were shown. For instance, ``Similar patch \#1'' was the most similar image patch corresponding to ``Patch \#1'' in the query case. All 249 cases were used as an input query once, that is, for each input query, the task was to find similar cases from the training (+validation) set for the cross-validation round when the input query was in the test set. The result for each query was evaluated by a 4-grade score; a participant is asked to select one option among the following options: ``the result 1 is similar to a query,'' ``the result 1 is weakly similar to a query,'' ``the result 2 is weakly similar to a query'' or ``the result 2 is similar to a query,'' where either result 1 or result 2 corresponds to either the proposed method or the baseline method, which is determined at random. The order of query cases was also shuffled randomly for each participant. In total, 12 pathologists composed of three experienced hematopathologists, four standard pathologists, and five pathological trainees participated in the subjective evaluation. Figure~\ref{fig:pie} shows the results of each of the 12 participants in pie charts. For all 12 participants, the proportion of responses in which the proposed method was more similar (thick blue) or weakly similar (thin blue) to the query case than the baseline method was significantly higher than the opposite responses (thick and thin orange colors). This result indicates that all 12 pathologists determined that IHC staining similarity was more appropriate than subtype similarity as a similarity measure for the pathological diagnosis of malignant lymphoma. To aggregate the evaluation results, evaluation score was counted as 1 if the result of the proposed method was evaluated as ``similar'' or ``weakly similar,'' and 0 otherwise. We further compared ``confident responses'' by removing ``weakly similar'' responses. Table~\ref{tab:sbj} lists the average evaluation scores of each of the 12 participants. The results demonstrate that the proposed method could retrieve more similar cases in which pathologists felt they were more similar to query cases. The superiority of the proposed method is more evident when we consider only the confident responses. We note that there is a possibility that both the proposed and baseline methods retrieve the same case but different image patches. Particularly, different cases were retrieved in the two methods for 204 cases over 249 cases, whereas the same case was retrieved (but with different image patches) for the remaining 45 cases. Table~\ref{tab:dif} lists the average scores for the former and latter cases. In all the presented results, the difference between the proposed and baseline methods is statistically significant with $p < 0.05$ based on a randomized test\footnote{ To quantify the statistical significance of the results in the subjective evaluation, we performed a Monte Carlo statistical test with the null hypothesis that the proposed and baseline methods are same. Particularly, we generated 1,000,000 randomized results based on the null hypothesis. A $p$-value for each participant is listed in Table~\ref{tab:sbj}. Consequently, most of the 1,000,000 results are less than the actual scores listed in Table~\ref{tab:sbj}, and all the scores listed in Table~\ref{tab:sbj} are statistically significantly larger than 0.5, with $p < 0.05$. }. \begin{table}[!t] \caption{ Mean binary scores of all participants through subjective evaluation experiment. The ``Score'' indicates the results for all cases, whereas the ``Confident Score'' indicates the results answered with confidence, i.e., by excluding ``weakly similar'' responses. % Each evaluation score was counted as 1 if the result of the proposed method was evaluated as ``similar'' or ``weakly similar,'' and 0 otherwise. % The bracketed numbers indicate the number of ``confident responses'' by removing ``weakly similar'' responses. The $p$-value for each result was computed by the Monte Carlo statistical test with the null hypothesis that the proposed and baseline methods are same, indicating that all the scores are highly statistically significant. } \begin{center} \begin{tabular}{ccccc} \hline Participants & Score & \multicolumn{2}{c}{Confident Score} & $p$-value \\ \hline \hline \multicolumn{1}{c}{1} & 0.715 & ~~~0.724 & (232)~~~ & $<10^{-6}$\\ \multicolumn{1}{c}{2} & 0.727 & ~~~0.783 & (120)~~~ & $<10^{-6}$\\ \multicolumn{1}{c}{3} & 0.723 & ~~~0.811 & (53)~~~ & $<10^{-6}$\\ \multicolumn{1}{c}{4} & 0.683 & ~~~0.750 & (64)~~~ & $<10^{-6}$\\ \multicolumn{1}{c}{5} & 0.671 & ~~~0.663 & (240)~~~ & $<10^{-6}$\\ \multicolumn{1}{c}{6} & 0.683 & ~~~0.683 & (249)~~~ & $<10^{-6}$\\ \multicolumn{1}{c}{7} & 0.614 & ~~~0.623 & (138)~~~ & $1.9\times 10^{-4} $\\ \multicolumn{1}{c}{8} & 0.627 & ~~~0.688 & (96)~~~ & $4.2\times 10^{-5} $\\ \multicolumn{1}{c}{9} & 0.723 & ~~~0.815 & (145)~~~ & $<10^{-6}$\\ \multicolumn{1}{c}{10} & 0.667 & ~~~0.864 & (22)~~~ & $<10^{-6}$\\ \multicolumn{1}{c}{11} & 0.606 & ~~~0.663 & (92)~~~ & $4.8\times 10^{-4} $\\ \multicolumn{1}{c}{12} & 0.651 & ~~~0.698 & (129)~~~ & $10^{-6}$\\ \hline \multicolumn{1}{c}{Mean$\pm$S.E.} & 0.674$\pm$0.012 & \multicolumn{2}{c}{0.730$\pm$0.021} & \\ \hline \end{tabular} \end{center} \label{tab:sbj} \end{table} \begin{table}[!t] \caption{Mean binary scores for 204 cases for which two methods retrieved different cases to the query case, and that for the remaining 45 cases in which two methods retrieved same cases but different patches to the query case. % In both cases, the proposed method was evaluated as more suitable. } \begin{center} \begin{tabular}{lc} \hline Retrieval results & Mean$\pm$S.E. \\ \hline \hline Different cases & 0.688$\pm$0.013 \\ Same cases & 0.611$\pm$0.019 \\ \hline \end{tabular} \end{center} \label{tab:dif} \end{table} These results on subjective evaluation demonstrate that IHC staining similarity is more appropriate than subtype similarity for the pathological diagnosis of malignant lymphoma. Even when the two methods select the same cases, the image patches selected as the basis for the decision using the proposed method are more suitable than those selected using the baseline method. \paragraph{Visualization of attention regions} In case-based SIR, it is desirable to be able to explain the selection of retrieval results as similar cases. To realize such explainable retrieval results, our proposed method provides the attention weights that indicate the regions that were focused as HA image patches in computing case distance $D(n,m)$. The color plots of all WSIs in Fig.~\ref{fig:output} show the attention weights. When we compute the attention weights for visualization purposes, attention weights $a_{n,i}$ or $a_{n,i}^{\rm (H,L)}$ for all image patches $i \in \cI_n$ were computed and normalized to the range $[0, 1]$ for each case $n \in [N]$. The red region in the heat map indicates HA image patches that were used to calculate the similarity between two cases, whereas the blue region in the heat map indicates image patches whose attention weights are low. In Fig~\ref{fig:output}, similar cases were retrieved with a multi-scale input of 40x \& 5x, and multi-scale attention weights $a_{n,i}^{\rm (H,L)}$ are visualized as a heat map. We observe that the selected patches are visually similar; in particular, they are quite similar in both low and high magnifications by considering the multi-scale input. \subsection{Examples} In the previously described experiments, we confirmed that the proposed method performed better than the baseline methods. We investigate the results of the proposed method that were evaluated as more similar, and the difference of the results of the proposed method and those of the baseline method. Figure~\ref{fig:bar} shows a histogram of the number of cases for which how many of the 12 participants responded that the proposed method is better than the baseline method in the subjective evaluation in \S4.2. The horizontal axis represents the number of participants who voted for the proposed method as the more similar result, e.g., ``12'' shows the number of cases in which all participants voted for the proposed method as ``similar'' or ``weakly similar.'' In these aggregated results, 175-case results of the proposed method were evaluated as more suitable than the baseline method by the majority of the participants. In total, in 36 cases, the proposed method was evaluated as more similar by all 12 participants, whereas there were only two cases in which the baseline method was evaluated as more similar by all 12 participants. Figure~\ref{fig:res} shows examples of retrieval results where \emph{all participants} evaluated the proposed method as more similar than the baseline method. In addition to the same image patches as shown in the subjective evaluation, the thumbnails of the retrieved similar cases are also shown to make it easy to confirm whether the two retrieval cases are the same. In the examples, the lower images show that both the proposed and baseline methods showed the same similar case (but different image patches). Even if both methods retrieved the same similar case, the proposed method could obtain more similar image patches and obtain a better evaluation by all 12 pathologists. \begin{figure*}[t] \begin{center} \fbox{ \includegraphics[width=0.85\linewidth]{sbj.pdf} } \end{center} \caption{ Example of the subjective evaluation tasks. The participants were asked to evaluate the result that was more similar to a query case by a 4-grade score. Five image patches of 40x and 5x magnifications that had top-5 attention weights were shown for an input query case, whereas the image patches that had the minimum distance from each query image patch obtained using the two methods are shown. Either ``Retrieved result 1'' or ``Retrieved result 2'' corresponds to either the proposed method or the baseline method, which is determined at random. } \label{fig:sbj} \end{figure*} \begin{figure*}[t] \begin{center} \includegraphics[width=0.9\linewidth]{pie.pdf} \end{center} \caption{ Pie charts for the proportions of the four answers by 12 participants. Each chart corresponds to a different participant, where ``++'' and ``+'' in legends mean ``similar to a query'' and ``weakly similar to a query,'' respectively. It can be confirmed that thick blue and thin blue area are clearly more than a half in all participants, which indicates that the results retrieved using the proposed method were more likely to be evaluated as ``more similar.'' } \label{fig:pie} \end{figure*} \begin{figure}[t] \begin{center} \includegraphics[width=0.5\linewidth]{coincidence.pdf} \end{center} \caption{ Histogram of the number of cases for which the number of the 12 participants responded that the proposed method is better than the baseline method. In total, in 36 cases, the proposed method was evaluated as more similar by all 12 participants, whereas there were only two cases in which the baseline method was evaluated as more similar by all 12 participants. } \label{fig:bar} \end{figure} \begin{figure*}[t] \begin{center} \begin{tabular}{cc} \begin{minipage}[b]{0.45\hsize} \centering \fbox{ \includegraphics[width=\hsize]{res1.pdf} } \end{minipage} &~~ \begin{minipage}[b]{0.45\hsize} \centering \fbox{ \includegraphics[width=\hsize]{res2.pdf} } \end{minipage} \end{tabular} \\ \vspace{2mm} \begin{tabular}{cc} \begin{minipage}[b]{0.45\hsize} \centering \fbox{ \includegraphics[width=\hsize]{res3.pdf} } \end{minipage} &~~ \begin{minipage}[b]{0.45\hsize} \centering \fbox{ \includegraphics[width=\hsize]{res4.pdf} } \end{minipage} \end{tabular} \end{center} \caption{ Examples of retrieval results that all 12 participants evaluated the proposed method as more similar than the baseline method. % In addition to the image patches that were shown in the subjective evaluation, the thumbnails of similar cases are also shown. % As shown in the two bottom examples, even when both methods retrieved the same case, the image patches selected using the proposed SIR method were evaluated as more relevant to the HA patches in the query case. } \label{fig:res} \end{figure*} \section{Conclusion} We proposed a case-based SIR method for unannotated large histopathological images of malignant lymphoma. The proposed method with attention-based MIL can automatically extract informative image patches from unannotated WSIs, and it enables a user to input a WSI as a query without the selection of an image patch. Moreover, we employed the similarity of IHC staining patterns as the similarity measure in contrastive DML, where the embedded features of the images that have similar IHC staining patterns are much closer. In the quantitative evaluation of 249 malignant lymphoma patients, we compared the proposed method with several baseline methods, and our proposed method exhibited the highest accuracy in both IHC staining patterns and subtypes between query and similar cases. Furthermore, we conducted a subjective evaluation experiment to verify our proposed similarity measure using IHC staining patterns and confirmed that our method could retrieve similar cases in which pathologists felt more similar in the observation of the H\&E stained tissue slide than the baseline method. The proposed case-based SIR method is useful in malignant lymphoma pathology because it provides not only WSIs but also image patches and visualized attention weights that indicate the similarity of the image patches between a query case and a retrieved similar case and the regions of the entire WSI that were focused in the retrieval phase. \clearpage {\small \bibliographystyle{ieee}
\section{Introduction } It was realized long time ago that classical mechanics can be stated in the same mathematical formalism of quantum mechanics, i.e., as a theory of operators acting on a Hilbert space \cite{KvN1,KvN2}. This operational formalism is known as the Koopman-von Neumann (KvN) theory. Inspired by the KvN theory (though with a more general scope), a procedure to obtain classical dynamics as a unitary irreducible representation of the Galilei group was given in Ref \cite{KvN3}. An interesting aspect of this classical unitary representation is that the central charge of the Galilei algebra vanishes. This is, contrary to the quantum case, the classical unitary representation of the Galilei group considered in \cite{KvN3} was not projective. However, while the KvN rule makes unavoidable the vanishing of the central charge, classical dynamics does not demand it, a possibility that was overlooked. Here we consider a variation of the KvN theory recently named as the Koopman-von Hove theory (KvH) \cite{tronci1,tronci2}. Although equally valid at the classical level, the KvH theory puts more emphasis on the phase of the classical Koopman wavefunctions. We will show that the KvH leads to a projective representation of the Galilei group where the mass plays the role of the central charge of the theory, just as in quantum mechanics. This is, the KvH representation of the Galilei group is up to a phase. Besides the purely classical results, the KvN and KvH formalism are of interest to contrast/compare quantum and classical mechanics and the study of quantization/dequantization rules \cite{Q1,Q2,Q3,Q4,Q5}. The KvN and KvH theories are also of interest for the formulation of some quantum-classical hybrid theories \cite{tronci1,tronci2,sudarshan0,sudarshan1,sudarshan2,sudarshan3,barcelo,hybrid,hybrid2,hybrid3-1}. In this last regard, the knowledge of the non-relativistic space-time symmetries of the KvN theory was used to study the viability of quantum-classical hybrids of the Sudarshan type \cite{hybrid3}. It was shown there that in Sudarshan hybrids, translational invariance does not equate to the conservation of the total linear momentum. It was concluded that Sudarshan hybrids were at odds with momentum conservation. Unfortunately, we will see that this conclusion was hastily made. We will show that the hybrid systems recently considered by Bondar, Gay-Balmaz, and Tronci \cite{tronci1} can be Galilei covariant and conserve the total momentum. This work is organized as follows: in section 2 we review the KvN and KvH Hilbert space formulations of classical mechanics. We will focus on the construction of Hermitian operators from phase space functions. In section 3 the elements of the Galilei algebra will be related to Hermitian operators constructed from the KvN and KvH. It is shown there that the KvH theory leads to a projective representation of the Galilei group. In section 4 we analyze the Galilean covariance and momentum conservation of quantum-classical hybrid systems of the Sudarshan type obtained from the KvH formalism. We will see that the KvH theory leads naturally to a hybrid interaction term that conserves the total momentum and is not at odds with Galilean covariance. \section{The KvN and KvH mechanics} It is possible to associate a Hilbert $\mathcal{H}_{cl}$ space to a given a phase space $\varGamma$ . The procedure is as follows: let $d\omega$ be the usual symplectic measure of $\varGamma$, the vectors of $\mathcal{H}_{cl}$ are then given by square integrable functions \begin{equation} \int_{\varGamma}\left|\psi\right|^{2}d\omega<\infty. \end{equation} The inner product on $\mathcal{H}_{cl}$ can be defined as \begin{equation} \left\langle \psi_{1}\right.\left|\psi_{2}\right\rangle =\int_{\varGamma}\psi_{1}^{*}\psi_{2}d\omega.\label{inner} \end{equation} From now on, we will specialize for the case of a single particle moving in $R^{3}$, such that $d\omega=d\mathbf{q}d\mathbf{p}$ in Cartesian coordinates. There are infinite ways to use phase space functions to define linear operators acting on $\mathcal{H}_{cl}$ . The easiest method to define a Hermitian operator from a space space function is by multiplication as follows: \begin{equation} \hat{f}(\mathbf{q},\mathbf{p})\psi(\mathbf{q},\mathbf{p})=f(\mathbf{q},\mathbf{p})\psi(\mathbf{q},\mathbf{p}). \end{equation} The most important operators defined this way are the position and momentum operators \begin{align} \hat{\mathbf{q}}f(\mathbf{q},\mathbf{p}) & =\mathbf{q}f(\mathbf{q},\mathbf{p}),\nonumber \\ \hat{\mathbf{p}}f(\mathbf{q},\mathbf{p}) & =\mathbf{p}f(\mathbf{q},\mathbf{p}). \end{align} Let us note that these so-defined position and momentum operators commute with each other $\left[q_{i},p_{j}\right]=0$; they do not have any uncertainty principle associated to them. Thus, they can be simultaneously measured, as they should in any classical theory. We also point out that $\hat{\mathbf{q}}$ and $\hat{\mathbf{p}}$ form a complete set of commuting observables since we are dealing with a single structureless particle. There are other ways to define Hermitian operators from phase space functions. A rather natural way comes from using the Poisson bracket as follows: \begin{equation} \hat{F}=-i\left\{ \cdot,f(\mathbf{q},\mathbf{p})\right\} .\label{kvNBracket} \end{equation} We will call the procedure given by Eq.(\ref{kvNBracket}) as the KvN rule. Using the the KvN rule on $(\mathbf{q},\mathbf{p})$ we get \begin{align} \widehat{\lambda}{}_{\mathbf{q}} & =-i\left\{ \,,\mathbf{p}\right\} =-i\nabla_{\mathbf{q}},\nonumber \\ \widehat{\lambda}_{\mathbf{p}} & =i\left\{ \,,\mathbf{q}\right\} =-i\nabla_{\mathbf{p}}. \end{align} From their definition, we can write the following set of commutation relations \begin{eqnarray} \left[\widehat{q}_{i},\widehat{q}_{_{j}}\right] & = & \left[\widehat{q}_{i},\widehat{p}_{j}\right]=\left[\widehat{p}_{i},\widehat{p}_{j}\right]=0,\nonumber \\ \left[\widehat{q}_{i},\widehat{\lambda}_{p_{i}}\right] & = & \left[\widehat{p}_{i},\widehat{\lambda}{}_{q_{j}}\right]=\left[\widehat{\lambda}{}_{q_{j}},\widehat{\lambda}_{p_{i}}\right]=0,\nonumber \\ \left[\widehat{q}_{i},\widehat{\lambda}{}_{q_{j}}\right] & = & \left[\widehat{p}_{i},\widehat{\lambda}_{p_{j}}\right]=i\delta_{ij}.\label{Xlambda-1} \end{eqnarray} The set $(\hat{\mathbf{q}},\hat{\mathbf{p}},\widehat{\lambda}{}_{\mathbf{q}},\widehat{\lambda}_{\mathbf{p}})$ is irreducible on $\mathcal{H}_{cl}$ in view of commutation relations (\ref{Xlambda-1}) and Schur lemma. Acting on the Hamiltonian function $H=\frac{\mathbf{p}^{2}}{2m}+V(\mathbf{q})$, the KvN rule gives the following operator \begin{equation} \widehat{L}=-i\left\{ ,H\right\} =\frac{1}{m}\hat{\mathbf{p}}\cdot\hat{\lambda}_{\mathbf{q}}-\nabla_{\mathbf{q}}V(\mathbf{q})\cdot\hat{\lambda}_{\mathbf{p}}.\label{Liouvillian} \end{equation} The operator $\widehat{L}$ is known as the Liouvillian, and it is of central importance since it govern time evolution. Consider the Liouville equation of classical statistical mechanics \begin{equation} \frac{\partial\rho}{\partial t}=-\left\{ \rho,H\right\} =-i\widehat{L}\rho.\label{L-1} \end{equation} Due to the linearity in $\hat{\lambda}_{\mathbf{q}}$ and $\hat{\lambda}_{\mathbf{p}}$ of (\ref{L-1}), the square integrable function defined by \footnote{A constant in needed here to make the exponent dimensionless. This constant is usually chosen to be $\hbar^{-1}$. In this work we set $\hbar$=1.} $\psi=\sqrt{\rho}e^{iS}$ also obeys the Liouville equation \begin{equation} \frac{\partial\psi}{\partial t}=-i\widehat{L}\psi.\label{sch} \end{equation} The equation (\ref{sch}) has the form of a Schr\"odinger equation, where $\widehat{L}$ takes the role of the ``Hamiltonian'' operator of the theory. Hence, classical statistical mechanics is equivalent to solving the Schr\"odinger-like equation (\ref{sch}). Particle mechanics and Hamilton equations are formally recovered with the use Klimontovich delta distributions, i.e., $\rho=\delta(\mathbf{p}(t),\mathbf{q}(t))$. Another viable formula for assigning Hermitian operators to phase space functions is \begin{equation} \hat{F}^{\star}=-i\left\{ \cdot,f\right\} +f-\mathbf{p}\cdot\frac{\partial f}{\partial\mathbf{p}}.\label{KvHrule} \end{equation} After the convention used in \cite{tronci1,tronci2}, we call the association (\ref{KvHrule}) as the KvH rule\footnote{There is a gauge freedom in the assignation of the Hermitian operator given by the KvH rule, see Ref \cite{tronci1}, but we will stick with the equation (\ref{KvHrule}) for the rest of this work. }. Applying the KvH rule on the Hamiltonian we get \begin{equation} \widehat{L}^{\star}=-i\left\{ \cdot,H\right\} +H-\mathbf{p}\cdot\frac{\partial H}{\partial\mathbf{p}}=\widehat{L}-\mathscr{L},\label{KvHL} \end{equation} where $\widehat{L}$ is the operator given by (\ref{Liouvillian}), and $\mathscr{L}=\mathbf{p}\cdot\frac{\partial H}{\partial\mathbf{p}}-H$ is the Lagrangian associated to $H$. Acting on $\psi=\sqrt{\rho}e^{iS}$, the Schrodinger-like equation generated by $\widehat{L}^{\star}$ \begin{equation} \frac{\partial\psi}{\partial t}=-i\widehat{L}^{\star}\psi,\label{sch-1} \end{equation} splits into \begin{align} \frac{\partial\rho}{\partial t}+\left\{ \rho,H\right\} & =0,\nonumber \\ \frac{\partial S}{\partial t}+\left\{ S,H\right\} & =\mathscr{L}. \end{align} So, the KvH dynamics is equivalent to the classical Liouville equation, but, contrary to the KvN case, the KvH equation also contain information about the classical phase. It is worth mentioning an important third possibility to associate Hermitian operators to face space functions, although we will not use it in this work. Instead of the Poisson bracket, the star product of Wigner phase space representation of quantum mechanics can be used \cite{star}. The use of the star product leads to quantum representation of the Galilei group. \section{The KvN and KvH Representations of the Galilei group} In Hamiltonian mechanics, the space-time transformations associated with the Galilei group are realized via canonical transformations. The generator functions associated with these canonical transformations are the linear momentum $\mathbf{p},$ the angular momentum $\mathbf{j}=\mathbf{r}\times\mathbf{p}$, the dynamic mass moment $\mathbf{g}=m\mathbf{q}-t\mathbf{p}$ and the Hamiltonian of the free particle $H_{free}=\frac{\mathbf{p}^{2}}{2m}$. They realize the Lie algebra of the Galilei group via the Poisson bracket. This is known as a canonical representation of a Lie group \cite{canonical,canonical2}. The canonical representation of the Galilei group can be reinterpreted as a unitary representation in the context of the KvN theory as follows: first, the operator $\widehat{\lambda}{}_{\mathbf{q}}$ is the generator of translation. Its action on an element of $\mathcal{H}(\Gamma)$ is given by \begin{equation} \exp\left[-i\mathbf{a}\cdot\widehat{\lambda}{}_{\mathbf{q}}\right]\psi(\mathbf{q},\mathbf{p})=\psi(\mathbf{q}-\mathbf{a},\mathbf{p}).\label{translation} \end{equation} On the other hand, while $\hat{\lambda}_{\mathbf{p}}$ translate the momentum coordinates, $\exp\left[-i\mathbf{b}\cdot\widehat{\lambda}{}_{\mathbf{p}}\right]\psi(\mathbf{q},\mathbf{p})=\psi(\mathbf{q},\mathbf{p}-\mathbf{b})$, $\hat{\lambda}_{\mathbf{p}}$ is not an element of the Galilei algebra. The other generators of the Galilei algebra can be obtained with the KvN rule as \begin{align} \mathcal{\hat{J}}_{i} & =-i\left\{ ,j_{i}\right\} =\varepsilon_{ijk}\left(\hat{q}_{j}\hat{\lambda}_{q_{k}}+\hat{p}_{j}\hat{\lambda}_{p_{k}}\right),\nonumber \\ \hat{\mathcal{G}} & =-i\left\{ ,\mathbf{g}\right\} =-t\hat{\lambda}_{\mathbf{q}}-m\hat{\lambda}_{\mathbf{p}},\nonumber \\ \hat{L} & =-i\left\{ ,H_{free}\right\} =\frac{1}{m}\hat{\mathbf{p}}\cdot\hat{\lambda}_{\mathbf{q}}.\label{cla rep} \end{align} In the KvN theory $\mathcal{\hat{J}}$ is the generator of rotations, $\hat{\mathcal{G}}$ is the generator of Galilean boosts, and $\hat{L}$ is the time translation operator for the case of a free particle. The above operators obey the commutation relations of the Galilei algebra. \begin{align} \left[\widehat{\lambda}_{q_{i}},\widehat{\lambda}_{q_{j}}\right] & =\left[\widehat{\mathcal{G}}_{i},\widehat{\mathcal{G}}_{j}\right]=\left[\widehat{\mathcal{J}}_{i},\widehat{L}\right]=\left[\widehat{\lambda}_{q_{i}},\widehat{L}\right]=0;\nonumber \\ \left[\widehat{\mathcal{J}}_{i},\widehat{\mathcal{J}}_{j}\right] & =i\varepsilon_{ijk}\widehat{\mathcal{J}}_{k};\;\left[\widehat{\mathcal{J}}_{i},\widehat{\lambda}_{q_{k}}\right]=i\varepsilon_{ijk}\widehat{\lambda}_{q_{k}};\nonumber \\ \left[\widehat{\mathcal{J}}_{i},\widehat{\mathcal{G}}_{j}\right] & =i\varepsilon_{ijk}\widehat{\mathcal{G}}_{k};\:\left[\widehat{\mathcal{G}}_{i},\widehat{L}\right]=i\widehat{\lambda}_{q_{i}},\label{galileialgebra} \end{align} and \begin{equation} \left[\widehat{\mathcal{G}}_{j},\widehat{\lambda}_{q_{i}}\right]=0.\label{nocentralcharge} \end{equation} Equations (\ref{galileialgebra}) and (\ref{nocentralcharge}) are a realization of the Galilei algebra in the very particular case of a vanishing central charge, as evidenced by the vanishing right-hand-side of (\ref{nocentralcharge}). Since the set $\left\{ \widehat{\mathbf{q}},\widehat{\mathbf{p}},\widehat{\lambda}{}_{\mathbf{q}},\widehat{\lambda}_{\mathbf{p}}\right\} $ is irreducible in $\mathcal{H}(\Gamma)$, and taking into account the vanishing of the central charge, the above constitutes a unitary irreducible faithful representation of the Galilei group. The remaining space-time transformations of the Galilei group are realized as unitary transformation given by \begin{align} \exp\left[-i\theta\hat{\mathbf{n}}\cdot\widehat{\mathbf{\mathcal{J}}}\right]\psi(\mathbf{q},\mathbf{p}) & =\psi(\mathbf{q}-\theta\hat{\mathbf{n}}\times\mathbf{q},\mathbf{p}-\theta\hat{\mathbf{n}}\times\mathbf{p}),\nonumber \\ \exp\left[i\mathbf{v}\cdot\hat{\mathcal{G}}\right]\psi(\mathbf{q},\mathbf{p}) & =\psi(\mathbf{q}-\mathbf{v}t,\mathbf{p}-m\mathbf{v}),\nonumber \\ \exp\left[-it\hat{L}\right]\psi(\mathbf{q},\mathbf{p}) & =\psi(\mathbf{q}-\frac{t}{m}\mathbf{p},\mathbf{p}).\label{spacetime} \end{align} We now proceed to investigate the effect of the KvH rules on the representation theory of the Galilei group. The KvH Liouvillian in the free particle case is given by \begin{equation} \hat{L}^{\star}=-i\left\{ ,H_{free}\right\} -H_{free}=\frac{\mathbf{\widehat{p}}}{m}\cdot\hat{\lambda}_{\mathbf{q}}-\frac{\widehat{\mathbf{p}}^{2}}{2m}.\label{L*} \end{equation} The boost operator is \begin{equation} \widehat{\mathcal{G}}_{j}^{\star}=-i\left\{ ,\mathbf{g}\right\} +\mathbf{g}-\mathbf{p}\cdot\frac{\partial\mathbf{g}}{\partial\mathbf{p}}=-t\hat{\lambda}_{\mathbf{q}}-m\hat{\lambda}_{\mathbf{p}}+m\mathbf{q}.\label{G*} \end{equation} All the other generators are unaltered compared to the KvN case. It can be checked that the replacement $\hat{L}\rightarrow\hat{L}^{\star}$ and $\hat{\mathcal{G}}\rightarrow\hat{\mathcal{G}}^{\star}$ gives a realization of the Galilei algebra. However, contrary to the KvN case, now the central charge of the algebra does not vanish. Instead, we have the commutation relation \[ \left[\widehat{\mathcal{G}}_{j}^{\star},\widehat{\lambda}_{q_{i}}\right]=im\delta_{ij}. \] We can see that the mass is the central charge in the KvH theory, just as in quantum mechanics. Hence, the unitary representation of the Galilei group given by the KvH theory is projective. In the KvH theory, the unitary transformation associated to space translation and rotations are the same as in Eqs.(\ref{translation}) and (\ref{spacetime}). Galilean boosts and time translation are modified to include a phase factor as follows \begin{align} \exp\left[i\mathbf{v}\cdot\hat{\mathcal{G}^{\star}}\right]\psi(\mathbf{q},\mathbf{p}) & =e^{i(mq-\frac{mt}{2})}\psi(\mathbf{q}-\mathbf{v}t,\mathbf{p}-m\mathbf{v}),\nonumber \\ \exp\left[-it\hat{L}^{\star}\right]\psi(\mathbf{q},\mathbf{p}) & =e^{-i\frac{\mathbf{p}^{2}}{2m}t}\psi(\mathbf{q}-\frac{t}{m}\mathbf{p},\mathbf{p}). \end{align} Finally, we mention that while $\hat{\lambda}_{\mathbf{q}}$ is the same in both theories, $\widehat{\lambda}{}_{\mathbf{p}}$ is not. In the KvH theory we have $\widehat{\lambda}{}_{\mathbf{p}}^{\star}=\widehat{\lambda}{}_{\mathbf{p}}+\mathbf{q}$ and $[\hat{\lambda}_{\mathbf{q}}^{\star},\widehat{\lambda}{}_{\mathbf{p}}^{\star}]=-i$. \subsection{Covariance of composite systems.} Let us now consider the case of two interacting particles. We can to construct a representation of the Galilei group on the space $\mathcal{H}_{T}=\mathcal{H}_{cl}^{(1)}\mathrm{\otimes}\mathcal{H}_{cl}^{(2)}$ starting from the representation of the individual sectors. Except for the Liouvillian, the generators of the algebra acting on $\mathcal{H}_{T}$ are given by the sum of the individual generators; for example, the total translation operator is given by $\hat{\lambda}_{\mathbf{q}\,total}=\hat{\lambda}_{\mathbf{q}_{1}}+\hat{\lambda}_{\mathbf{q}_{2}}$. All the commutation relations of the Gailiei algebra not involving the Liouvillian are satisfied identically. On the other hand, the total Liouvillian is allowed to have an extra term representing the interaction between the particles. The allowed interaction term can then be deduced from considerations of Galilean covariance. Using the KvH rule on the Hamiltonian \[ H=\frac{\mathbf{p}_{1}^{2}}{2m_{1}}+\frac{\mathbf{p}_{2}^{2}}{2m_{2}}+V(\mathbf{q}_{1},\mathbf{q}_{2}) \] gives the Liouvillian \begin{align} \hat{L}^{\star} & =\frac{1}{m_{1}}\hat{\mathbf{p}}_{1}\cdot\hat{\lambda}_{\mathbf{q}_{1}}+\frac{1}{m_{2}}\hat{\mathbf{p}}_{2}\cdot\hat{\lambda}_{\mathbf{q}_{2}}\nonumber \\ & -\nabla_{\mathbf{q}_{1}}V\cdot\hat{\lambda}_{\mathbf{p}_{1}}-\nabla_{\mathbf{q}_{2}}V\cdot\hat{\lambda}_{\mathbf{p}_{2}}\nonumber \\ & -\frac{\hat{\mathbf{p}}_{1}^{2}}{2m_{1}}-\frac{\hat{\mathbf{p}}_{2}^{2}}{2m_{2}}+V.\label{2L} \end{align} Translational invariance dictates that \begin{equation} \left[\hat{\lambda}_{\mathbf{q}\,total},\hat{L}^{\star}\right]=0.\label{total translation} \end{equation} The necessary and sufficient condition for Eq (\ref{total translation}) to be true is that the potential energy depend only on the relative position $V=V(\mathbf{\hat{q}}_{1}-\hat{\mathbf{q}}_{2})$. The above also takes care of the commutation relation with the Galilean boost \begin{equation} \left[\hat{\mathcal{G}}_{total}^{\star},\hat{L}^{\star}\right]=\hat{\lambda}_{\mathbf{q}_{1}}+\hat{\lambda}_{\mathbf{q}_{2}}. \end{equation} Finally, if $V$ is a scalar then \begin{equation} \left[\widehat{\mathcal{J}}_{total},\widehat{L}\right]=0. \end{equation} Notice that the condition of translational invariance is not the same as conservation of the total momentum $\hat{\mathbf{p}}_{total}=\hat{\mathbf{p}}_{1}+\hat{\mathbf{p}}_{2}$. However, it is true that $V=V(\mathbf{\hat{q}}_{1}-\hat{\mathbf{q}}_{2})$ leads to \begin{equation} \left[\hat{\mathbf{p}}_{total},\hat{L}^{\star}\right]=0.\label{total translation-1} \end{equation} \section{Quantum-classical hybrids} It is possible to obtain the two-body Schr�dinger equation from the Liouvillian (\ref{2L}). Following Klein \cite{Q4}, the procedure consist of two steps: (1) impose the condition $\partial_{p}\psi=0$ for every momentum coordinate, (2) make the replacement the replacement $p\rightarrow-i\partial_{q}$, this correspond to the usual canonical quantization rule. For the Liouvillian (\ref{2L}), the result is \begin{equation} i\frac{\partial\psi}{\partial t}=-\frac{1}{2m_{1}}\nabla_{\mathbf{q}1}^{2}\psi-\frac{1}{2m_{2}}\nabla_{\mathbf{q}2}^{2}\psi+V\psi. \end{equation} Instead of doing a full quantization of (\ref{2L}), we can obtain a hybrid theory by applying Klein's method to only one particle. This will result in a special case of an hybrid theory of the Sudarshan type \cite{tronci1,tronci2,sudarshan0}. To distinguish the classical degrees of freedom from the quantum ones, we keep the $(\mathbf{q},\mathbf{p})$ notation for the classical particle and use $\mathbf{x}$ and $\mathbf{k}$ for the quantum coordinate and momentum, respectively. The quantum position and momentum operators obeys the usual Heisenberg commutation relations $\left[\hat{x}_{i},\hat{k}_{j}\right]=i\delta_{ij}$. The hybrid Hilbert space is of the form $\mathcal{H}_{T}=\mathcal{H}_{\mathrm{Q}}\mathrm{\otimes}\mathcal{H}_{cl}$, where the vectors of the quantum sector $\mathcal{H}_{\mathrm{Q}}$ are given by normalizable linear combinations of the kets $\left|\mathbf{x}\right\rangle $. In the quantum sector, and for a single spinless particle, the elements of the Galilei algebra in terms $\mathbf{x}$ of $\mathbf{k}$ are: $\mathbf{k}$ itself, the angular momentum $\hat{\mathbf{j}}=\hat{\mathbf{x}}\times\hat{\mathbf{k}}$, the dynamic mass moment $\hat{\mathbf{g}}=m\hat{\mathbf{x}}-t\hat{\mathbf{k}}$, and the Hamiltonian $\hat{H}_{\mathrm{Q}}=\frac{\hat{\mathbf{k}}^{2}}{2m}$, where $m$ is the central charge of the algebra \cite{qgalilei ,qgalilei2,qgalilei3,qgalilei4}. In the quantum case, $\mathbf{k}$ has the dual role of being the momentum operator and the generator of spatial translations. Performing the partial quantization of (\ref{2L}) results in the hybrid total time-translation operator \begin{align} \hat{L}_{h} & =\frac{1}{m_{1}}\hat{\mathbf{p}}\cdot\hat{\lambda}_{\mathbf{q}}-\frac{\hat{\mathbf{p}}^{2}}{2m_{1}}+\frac{1}{2m_{2}}\hat{\mathbf{k}}^{2}\nonumber \\ & -\nabla_{\mathbf{q}}V\cdot\hat{\lambda}_{\mathbf{p}}+V.\label{2L-2} \end{align} As in section 3.1, the commutation relations of the Galilei algebra of the composite systems not involving the time translation operator are all satisfied identically, and the ones that do involve $\hat{L}_{h}$ give conditions for the allowed interaction terms. We emphasize here that in general Sudarshan hybrids, the conditions for Galilean covariance does not imply the conservation of quantities like the linear or the angular momentum. For example, an interaction term can be translational invariant without conserving the total linear momentum \cite{hybrid3}. However, we will focus our attention on the particular interaction term given in (\ref{2L-2}). A translational invariant potential $V=V(\hat{\mathbf{q}}-\hat{\mathbf{x}})$ guarantees the translational invariance of the hybrid Liouvillian (\ref{2L-2}) \begin{equation} \left[\hat{\lambda}_{\mathbf{q}_{1}}+\hat{\mathbf{k}},\hat{L}_{h}\right]=0, \end{equation} and the conservation of the total momentum \begin{equation} \left[\hat{\mathbf{p}}+\hat{\mathbf{k}},\hat{L}_{h}\right]=0. \end{equation} Rotational invariance of is obtained if $V$ is a scalar. With $\hat{\mathcal{G}}_{hybrid}=m_{2}\hat{\mathbf{x}}-t\hat{\mathbf{k}}-t\hat{\lambda}_{\mathbf{q}}-m_{1}\hat{\lambda}_{\mathbf{p}}+m_{1}\mathbf{q}$, it is immediate to check that the central charge of the algebra is the total mass \begin{equation} \left[\hat{\mathcal{G}}_{hybrid},\hat{\lambda}_{\mathbf{q}_{1}}+\hat{\mathbf{k}}\right]=m_{1}+m_{2}. \end{equation} Hence, the hybrid representation of the Galilei group is projective. It is worth emphasizing that it is the combination $-\nabla_{\mathbf{q}}V\cdot\hat{\lambda}_{\mathbf{p}}+V$ in (\ref{2L-2}) that allows translational invariance and the conservation of the linear momentum at the same time. Neither $V$ nor $-\nabla_{\mathbf{q}}V\cdot\hat{\lambda}_{\mathbf{p}}$ do the trick on their own. \section{Conclusions} In quantum mechanics, the central charge of the Galilei algebra is the mass, and it plays the role of a superselection operator. In the quantum case, representations with a vanishing central charge are unphysical. We have shown that in the KvH representation of the Galilei group the mass is the central charge. It is interesting that classical mechanics allows, but does not require, projective unitary representations of the Galilei group. At the classical level, whether the central charge vanishes or not has no effect since the KvN and the KvH formalism are equally valid. For hybrid systems, the KvH rule and the Klein quantization method lead to the specific interaction term $-\nabla_{\mathbf{q}}V\cdot\hat{\lambda}_{\mathbf{p}}+V$ that guarantees Galilean covariance and conservation of the total momentum.
\section{Introduction} Let $(M,g)$ be a smooth Riemannian $n$-manifold, and let $\Omega $ be an open bounded subset of $M$. The first Dirichlet eigenvalue, or principal frequency, of $\Omega$ is defined by \begin{equation}\label{eqn: lambda 1a} \lambda_1(\Omega) = \inf \left\{ \frac{\int_\Omega |{\nabla} u|^2 }{\int_\Omega u^2} \ :\ u \in C^{\infty}_0(\Omega) \right\}. \end{equation} Here and in the sequel, $|{\nabla} u|^2 = \langle \nabla_g u, \nabla_g u\rangle_g$ and integration is with respect to the volume measure induced by the metric $g$. The infimum in \eqref{eqn: lambda 1a} is achieved, and a minimizer $u_\Omega$ satisfies the equation \begin{equation}\label{eqn: eval eqn 1} \begin{cases} -\Delta u_\Omega =\lambda_1(\Omega)\, u_\Omega & \text{ in } \Omega\\ u_\Omega =0 & \text{ on } {\partial} \Omega, \end{cases} \end{equation} where $\Delta =\Delta_g$ is the Laplacian with respect to $g$. Such a function $u_\Omega$ is called a first Dirichlet eigenfunction of $\Omega$ and $\lambda_1(\Omega)$ is the smallest number for which a nontrivial solution to this eigenvalue problem exists. If $\Omega$ is connected, then the first Dirichlet eigenfunction is unique up to constant multiples. In Euclidean space, balls have the smallest principal frequency among subsets $\Omega \subset {\mathbb{R}}^n$ of a given volume. This fact, first established by Faber \cite{Faber23} and Krahn \cite{Krahn25} in the 1920s, readily follows from the Polya-Szeg\"{o} principle \cite{PSBook}, which relies only on the on the coarea formula and the isoperimetry of balls. On all simply connected space forms (Euclidean space, hyperbolic space and the round sphere), geodesic balls are isoperimetric sets for every volume. Consequently, on simply connected space forms, the Polya-Szeg\"{o} principle holds and geodesic balls minimize the principal frequency among sets of a given volume. The resulting inequality is known as the {\it Faber-Krahn inequality}: letting $B $ denote a geodesic ball and $|\cdot |$ denote the volume measure induced by the metric on either Euclidean space, hyperbolic space, or the round sphere, we have \[ \lambda_1(\Omega) \geq \lambda_1(B) \qquad \text{ whenever } |\Omega| = |B|. \] It is known, moreover, that equality is achieved if and only if $\Omega$ is a geodesic ball, up to a set of capacity zero. On the round sphere, the Faber-Krahn inequality was first established by Sperner in \cite{s73} and is often called Sperner's inequality. We refer the reader to \cite{Baernstein, AshBen07, ChavelBook} for a discussion of spectral inequalities and symmetrization techniques in these settings. \\ Our first main theorem is a sharp quantitative stability result for the Faber-Krahn inequality on simply connected space forms. Broadly speaking, a quantitative stability result in this context states that \begin{equation}\label{eqn: stability general form} \lambda_1(\Omega) -\lambda_1(B) \geq c \text{ dist}(\Omega, B)^\alpha \end{equation} for some $\alpha >0$, where $B$ is a geodesic ball with $|\Omega| = |B|$ and $\text{dist}(\Omega, B)$ is a suitable notion of distance between $\Omega$ and the nearest ball $B$. In the statement below, we let $u_\Omega$ denote any first eigenfunction of $\Omega$, i.e. solution of \eqref{eqn: eval eqn 1}, that is normalized so that $u_\Omega \geq 0$ and $\int u_\Omega^2 = 1$, and extended by $0$ to be defined on the entire space. We let $A\Delta B= (A\setminus B) \cup (B\setminus A)$ denote the symmetric difference between sets. \begin{theorem}[Sharp quantitative stability for Faber-Krahn inequalities]\label{thm: quantitative FK general}\label{thm: quantitative sperner} Fix $n\geq 2$ and let $(M^n,g)$ denote the round sphere, Euclidean space, or hyperbolic space. For any $v>0$ (with $v<|S^n|$ in the case of the round sphere), there exists a constant $c=c(n,v)$ such that the following holds. For any open bounded set $\Omega\subset M$ with $|\Omega|=v,$ we have \begin{equation}\label{eqn: stability statement} \lambda_1(\Omega) - \lambda_1(B) \geq c \inf_{x \in M}\left( \left| \Omega \Delta B(x)\right|^2 + \int_{M} \left| u_\Omega - u_{B(x)}\right|^2 \right)\,. \end{equation} Here $B(x)$ is a geodesic ball centered at $x$ with radius uniquely chosen so that $|B(x)| =v$, and $B$ denotes such a ball centered at any point. \end{theorem} \begin{remark}[Optimality of the quadratic power] {\rm Considering ellipsoidal perturbations of a geodesic ball (in normal coordinates in the case of the sphere or hyperbolic space) shows that the quadratic power $\alpha =2$ is optimal for both of the terms on the right-hand side of \eqref{eqn: stability statement}, in the sense that the result is false if $2$ is replaced by any $\alpha <2.$ } \end{remark} On Euclidean space, quantitative stability for the Faber-Krahn inequality was first considered by Hansen and Nadirashvili \cite{HansenNadir94} and Melas \cite{Melas}. Both of these papers restrict their attention to convex sets or simply connected planar sets, and consider ``$L^\infty$'' (Hausdorff) type set distances $\text{dist}(\Omega,B)$. Among general open bounded sets, simple examples show that even qualitative stability fails with respect to such a distance. For this reason, the {\it asymmetry}, $\text{dist}(\Omega, B) =\inf_{x \in {\mathbb{R}}^n} |\Omega \Delta B(x)|$, is a more natural notion of set distance to consider, and quantitative stability with respect to the asymmetry was conjectured in \cite{BhatWeit} and \cite{Nadir97}. Non-sharp versions of this conjecture (i.e. with $\alpha >2$ in \eqref{eqn: stability general form}) were established in following years in \cite{Bhat01} and \cite{FMP09}. All of these results are based on applying quantitative forms of the isoperimetric inequality to level sets of eigenfunctions. The first sharp quantitative Faber-Krahn inequality on Euclidean space was established by Brasco, De Philippis, and Velichkov \cite{BDV15}, stating \begin{equation}\label{eqn: BDV} \lambda_1(\Omega) - \lambda_1(B) \geq c \inf_{x \in {\mathbb{R}}^n} |\Omega \Delta B(x)|^2 \end{equation} for all open bounded sets $\Omega$, where $|B(x)| = |\Omega|$. Their proof was based on a selection principle approach introduced by Cicalese-Leonardi \cite{CiLe12} (see also \cite{AFM13}) using the regularity theory for Alt-Caffarelli type functionals. The selection principle is also the basis of the proof of Theorem~\ref{thm: quantitative FK general}, and we discuss these proofs further in Section~\ref{ss: proof talk} below. Following the work of \cite{BDV15}, similar methods were used to establish sharp quantitative stability for the $p$-Laplacian \cite{FuscoZhang} as well as for the capacity \cite{DPMMCapacity} and $p$-capacity \cite{Mukoseeva+2021} inequalities. We refer the reader to \cite{BrascoDePSurvey} for an overview on spectral inequalities in quantitative form. A shortfall of the asymmetry as a measure of the distance between sets is that it only detects modifications up to sets of measure zero, while the eigenvalue sees modifications of a set up to sets of zero capacity. For instance, if we let $\Omega = B(0,1) \setminus\{x_1 =0\}$ be a slit domain in ${\mathbb{R}}^2$, then the left-hand side of \eqref{eqn: BDV} is strictly positive while the right-hand side is zero. In contrast, the right-hand side of \eqref{eqn: stability statement} is strictly positive in this example (and more generally, whenever the left-hand side is), and in this way, Theorem~\ref{thm: quantitative FK general} nontrivially strengthens the result of \cite{BDV15} even in Euclidean space. This issue is discussed in the survey paper \cite{BrascoDePSurvey}, and in particular Theorem~\ref{thm: quantitative FK general} resolves \cite[Open Problem 3]{BrascoDePSurvey}. On the sphere and hyperbolic space, significantly less progress has been made toward quantitative Faber-Krahn inequalities. These spaces lack the scaling invariance of Euclidean space, and certain computations that can be carried out explicitly on Euclidean space cannot be done in these spaces. In fact, the explicit forms of the first eigenvalue and eigenfunction of geodesic balls are not known in closed form! \'{A}vila established analogues of Melas' aforementioned results for convex subsets of $S^2$ and $H^2$ in \cite{Avila02}, following quantitative estimates for other spectral inequalities in \cite{Xu95}. Qualitative stability results for the Faber-Krahn inequality and other spectral inequalities on space forms is established in \cite{ABC09}. To our knowledge, Theorem~\ref{thm: quantitative FK general} is the first (sharp or nonsharp) quantitative stability result for Faber-Krahn inequalities on the round sphere and hyperbolic space that is valid for all open bounded sets $\Omega$.\\ \medskip It has been understood in recent years that eigenvalue optimization problems are closely linked to the study of free boundary problems. When optimizing functionals involving (linear combinations of) higher eigenvalues, or of the first eigenvalue with respect to additional constraints, one can no longer expect to explicitly characterize minimizers. Instead, one hopes to show that a minimizer exists in a weak class of sets, and then show that the boundary of a minimizer is regular at most points. The paper \cite{BL09} considered the minimization of $\lambda_1(\Omega)$ among subsets $\Omega$ of some fixed bounded open container. Here the authors established regularity properties of minimizing sets by using the regularity theory of Alt and Caffarelli \cite{AC81} for the one-phase free boundary problem. More recently, minimization problems for functionals that are linear combinations of Dirichlet eigenvalues have been recast as vectorial free boundary problems in \cite{KL1, KL2, MTV17, CSY}, and regularity of minimizers has been studied through this lens of free boundary regularity. In these examples, regularity theory for free boundary problems is used as a tool in the study of eigenvalue optimization problems. In the next main result of this paper, the stream of tools will go in the opposite direction: we apply the quantitative Faber-Krahn inequality of Theorem~\ref{thm: quantitative FK general} on the sphere in order to establish new quantitative estimates for the Alt-Caffarelli-Friedman monotonicity formula, a powerful tool in the study of various types of free boundary problems. Fix $n\geq 2 $ and let $B_r = B(0,r)\subset {\mathbb{R}}^n$ denote the ball of radius $r$ centered at the origin in Euclidean space. Let $u_1,u_2\in H^1(B_2)$ be two nonnegative continuous functions satisfying \begin{equation}\label{eqn: harmonic functions} \begin{cases} \Delta u_i \geq 0& \ \ \text{ in } \ \ \{u_i>0\}=:\Omega_i\\ u_1\cdot u_2 = 0 & \ \ \text{ in } B_2 \end{cases} \end{equation} and assume that $0\in {\partial} \Omega_i.$ The Alt-Caffarelli-Friedman monotonicity formula (hereafter denoted ACF formula) $J:(0,1) \to {\mathbb{R}}$ is defined by \begin{equation}\label{eqn: ACF 2d} J(r) = J[u_1, u_2](r) = \frac{1}{r^4} \int_{ B_r} |{\nabla} u_1|^2 \int_{ B_r} |{\nabla} u_2|^2\, \end{equation} when $n= 2$ and \begin{equation}\label{eqn: ACF higher d} J(r) = J[u_1, u_2](r) =\frac{1}{r^4} \int_{ B_r} \frac{|{\nabla} u_1|^2}{|x|^{n-2}} \int_{ B_r} \frac{|{\nabla} u_2|^2}{|x|^{n-2}} \end{equation} for $n\geq 3$. Heuristically thinking, one can view $J(r)$ as the product of the average Dirichlet energies of $u_1, u_2$ on $B_r$. This quantity has the important property of being nondecreasing for $r \in (0,1)$. Note that this in particular guarantees the existence of the limit \[ J(0^+) := \lim_{r\to 0} J(r). \] Furthermore, if $J(0^+)$ is strictly positive, then $J(r)$ is constant with respect to $r$ if and only if \[ u_1 = \beta_1 (x\cdot \nu)^+ ,\qquad \qquad u_2 = \beta_2(x \cdot \nu)^-, \] for some $\nu \in S^{n-1}$ and $\beta_1, \beta_2> 0$. Here $f^+$ and $f^-$ respectively denote the positive and negative parts of a function $f$. In other words, the ACF monotonicity formula is constant and positive if and only if $u_1, u_2$ are linear functions defined on complementary half spaces $\Omega_1$ and $\Omega_2. $ Since its introduction in \cite{acf84}, the ACF monotonicity formula has proven useful in both free boundary problems and harmonic analysis. One application of the ACF monotonicity formula is the following. Suppose that a pair of functions $u_1, u_2$ satisfying \eqref{eqn: harmonic functions} have $J(0^+)>0$, and consider any sequence $r_{k} \to 0$. There exists a subsequence (which we do not relabel), constants $\beta_1, \beta_2>0$ and a direction $\nu \in S^{n-1}$ such that \[ \frac{u_1(r_{k} x)}{r_{k}} \to \beta_1(x \cdot \nu)^+ , \qquad \qquad \frac{u_2(r_{k} x)}{r_{k}} \to \beta_2(x \cdot \nu)^-. \] However, it is important to note that these blowup limits depend on the sequence $r_{k}$ and {\it does not} imply that $u_1$ and $u_2$ or their interfaces $\Omega_1, \Omega_2$ have unique tangents at the origin. In fact, this need not be the case! In \cite{ak20} the first two authors gave an example of two harmonic functions defined on complementary subsets of $B_2$, which have a slowly spiraling interface, where different sequences $r_k \to 0$ result in different $\nu$ in the limit. Toward understanding conditions that {\it do} guarantee the existence of unique tangents for functions $u_1$ and $u_2$ as in \eqref{eqn: harmonic functions}, we establish the following quantitative estimates for the Alt-Caffarelli-Friedman monotonicity formula. Roughly speaking, this theorem says that if $J(1) -J(0^+)$ is small, then $u_1$ and $u_2$ are quantitatively close to linear functions $\beta_i (x\cdot\nu)^{\pm}$. Note that if $J(0^+)$ is strictly positive, then up to rescaling we may assume that $J(0^+)=1$. \begin{theorem}[Sharp quantitative stability for the ACF monotonicity formula] \label{t:stability} Fix $n\geq 2$ and let $\rho \in [0,1/2]$. There exists a constant $C=C(n)>0$ such that the following holds. Suppose that $u_1,u_2$ satisfy \eqref{eqn: harmonic functions}. Then there exist constants $\beta_1, \beta_2>0$ and $\nu \in S^{n-1}$ such that \[ \int_{B_1 \setminus B_{\rho}} \left(u_1 -\beta_1 (x\cdot \nu)^+ \right)^2 + \left(u_2 -\beta_2 (x\cdot \nu)^-\right)^2 \leq C\log\left(\frac{J(1)}{J(\rho)}\right) \sum_{i=1}^2 \| u_i \|_{W^{1,2}(B_1)}^2. \] Furthermore, there exists a constant $\epsilon_0=\epsilon_0(n)>0$ such that if $\log(J(1)/J(0^+))< \epsilon_0$, then $\beta_i$ and $\nu$ may be chosen independently of $\rho \in [0,1/2]$. \end{theorem} This theorem is sharp, in the sense that the dependence on $\log \frac{J(1)}{J(\rho)}$ on the right cannot be improved; this can be seen from the examples constructed in \cite[Section 2]{ak20}. A direct consequence of Theorem~\ref{t:stability} is the following corollary, which gives a criterion for naturally scaled blow-ups of the functions $u_i$ at $0$ to be unique. We believe this criterion is essentially sharp, for the same reasons that Theorem \ref{t:stability} is sharp. This resolves a question raised in \cite{ak20}. \begin{corollary}[Uniqueness of blowups]\label{c:uniqueblowup} Fix $n\geq 2$. Suppose that $u_1,u_2$ satisfy \eqref{eqn: harmonic functions}, assume $J(0^+) = 1$, and let $\omega(r) = J(r) - 1$. Assume in addition that \[ \int_0^1 \frac{\sqrt{\omega(r)}}{r} dr < \infty. \] Then there exists a number $\beta_1 > 0$ and a vector $\nu \in S^{n-1}$ such that \[ \lim_{r \searrow 0} \frac{1}{r^{n + 2}} \int_{B_{r}} |u_1 - \beta_1 (\nu \cdot x)_+|^2 = 0. \] \end{corollary} \subsection{Proofs of the main theorems}\label{ss: proof talk} Let us now discuss some aspects of the proofs of our main theorems. We begin by discussing Theorem~\ref{t:stability}, and particularly its connection to Theorem~\ref{thm: quantitative FK general} in the case of the round sphere. The proof of Theorem \ref{t:stability} is accomplished by quantifying the following estimates when $J(1)-J(\rho)$ is small: \begin{enumerate} \item For a large set of $r \in [\rho,1]$ and for $i =1,2$, the restriction of $u_i$ to ${\partial} B_r$ is close in an $L^2$ sense to the first Dirichlet eigenfunction of the spherical Laplacian on the set $\{u_i>0\}\cap \partial B_r$ . \\ \item For $i=1,2,$ the function $u_i$ is close in an $L^2$ sense to a one-homogeneous function in $B_1\setminus B_{\rho}$. \\ \item For a large set of $r \in [\rho,1]$ and for $i=1,2$, the first Dirichlet eigenvalue of the spherical Laplacian on the set $\{u_i>0\}\cap \partial B_r$ is close to the first eigenvalue of a hemisphere in ${\partial} B_r$. \end{enumerate} The one-homogeneous extension of the first eigenfunction of a hemisphere in ${\partial} B_1$ is a truncated linear function $(x \cdot \nu)^+$ for some $\nu \in S^{n-1}$. Theorem~\ref{t:stability} is established by combining the estimates above to show that for $i=1,2$, the function $u_i$ is close to a constant multiple $\beta_i>0$ of this linear function, for suitably chosen $\nu$. In the case when $n=2$, the proof of Theorem~\ref{t:stability} is significantly simpler than in higher dimensions, fundamentally because the geometry of $S^1(r) = {\partial} B_r$ is sufficiently simple that much of the analysis can be done in an explicit manner. In dimension $2$, the estimate (3) for the the first eigenvalue of $\{u_i>0\}\cap \partial B_r$ immediately determines the length of the longest connected curve of $\{u_i>0\}\cap \partial B_r$ as well as the explicit first eigenfunction on $\{u_i>0\}\cap \partial B_r$. When $n>2$, on the other hand, the estimate (3) contains less immediate information. Knowing the first eigenvalue on $\{u_i>0\}\cap \partial B_r$ does not determine the shape of $\{u_i>0\}\cap B_r$ nor the eigenfunction on $\{u_i>0\}\cap B_r$. It is here that we make crucial use of the sharp quantitive version of Sperner's inequality established in Theorem~\ref{thm: quantitative FK general}. Theorem~\ref{thm: quantitative FK general} applied to $S^{n-1} ={\partial} B_1$, in conjunction with the estimate (3) allows us to deduce that the restriction of $u_i$ to ${\partial} B_1$ is quantitatively close to the first eigenfunction of a spherical cap of the same volume. We emphasize that for this application, it is essential that we have established the improved form of stability that includes eigenfunction control in Theorem~\ref{thm: quantitative FK general}. \medskip Let us now make some further remarks about Theorem~\ref{thm: quantitative FK general} and its proof. We begin with some comments about the statement and optimality of the theorem. \begin{remark}[Dependence of constants on the volume] {\rm In Theorem~\ref{thm: quantitative FK general}, the constant $c$ in the quantitative estimates depend on the volume. On Euclidean space, the scaling invariance can be used to state the Faber-Krahn inequality without a volume constraint as $ \lambda_1(\Omega) |\Omega|^{2/n} \geq \lambda_1(B) |B|^{2/n} $ where $B=B_1$, and similarly \eqref{eqn: stability statement} can be restated in scale-invariant form as \[ \lambda_1(\Omega) |\Omega|^{2/n} - \lambda_1(B) |B|^{2/n} \geq c \left( \inf_{x \in {\mathbb{R}}^{n}}\frac{| \Omega \Delta B(x,r)|^2}{|\Omega|^2} + \inf_{x \in {\mathbb{R}}^n} \int_{{\mathbb{R}}^n} | u_\Omega - u_{B(x,r)}|^2 \right)\, \] where $c$ is a constant depending on dimension only and $r$ is chosen so that $|\Omega| = |B_r|$. On the sphere and hyperbolic space, the constant can clearly be taken to be uniform for any compact subset of volumes. We make no attempt to track the dependence of the constant $c=c(n,v)$ in \eqref{eqn: stability statement} as $v\to 0$ or as $v \to |S^n|$ (in the case of the sphere) or $v\to \infty$ (in the case of hyperbolic space), though as $v\to 0$ one expects that the constants can be made uniform after the suitable rescaling. } \end{remark} \begin{remark}[Optimality of the $L^2$ norm] {\rm It is natural to wonder if the $L^2$ distance between eigenfunctions in \eqref{eqn: stability statement} can be strengthened to the $H^1$ distance. This is false, at least with the quadratic power. Indeed, let $B$ be a ball of maximal overlap with $\Omega$ and suppose by way of contradiction that there exists $c>0$ such that $\lambda_1(\Omega)-\lambda_1(B) \geq c \int |{\nabla} u_\Omega - {\nabla} u_B|^2 $. On $B\setminus \Omega$, we have ${\nabla} u_\Omega = 0$ and $|{\nabla} u_B |\approx 1.$ So, \[ \int |{\nabla} u_\Omega - {\nabla} u_B|^2 \geq \int_{B\setminus \Omega} |{\nabla} u_B|^2 \geq c\, |B\setminus \Omega | = \frac{c}{2}\, |B\Delta \Omega|. \] This would imply that the eigenvalue deficit $\lambda_1(\Omega) -\lambda_1(B)$ controls the asymmetry {\it linearly}, which as we have already discussed is false. It is not hard to show that {\it qualitative} stability holds for the $H^1$ norm and we do not know if quantitative stability may hold with a different modulus of continuity, e.g. for some $\alpha>2$ in \eqref{eqn: stability general form}. } \end{remark} \begin{remark}[Quotient spaces] {\rm Naturally, the Polya-Szeg\"{o} principle and thus the Faber-Krahn inequality hold on quotients of Euclidean space, hyperbolic space, and the round sphere when the volume of $\Omega$ is small. Theorem~\ref{thm: quantitative FK general} also generalizes to quotient spaces for the volume $v$ beneath a suitable threshold. } \end{remark} The proof of Theorem~\ref{thm: quantitative sperner}, like the proof of the quantitative Faber-Krahn inequality of \cite{BDV15}, is based on a {\it selection principle} argument. This global-to-local reduction tool, introduced by Cicalese and Leonardi in \cite{CiLe12} in the context of the isoperimetric inequality, is perhaps the most robust method to prove quantitative geometric inequalities and allows one to trade the task of proving stability in the entire class of objects for the task of proving stability among minimizers of some penalized functional, which typically enjoy strong regularity properties. Let us sketch the basic scheme of the selection principle argument. Suppose by way of contradiction that the desired stability result \eqref{eqn: stability statement} fails, and so there exist a sequence of open bounded sets $\Omega_j$ of a fixed volume $v$ with $\lambda_1(\Omega_j) \to \lambda_1(B)$ and yet \begin{equation}\label{eqn: contra general} \lambda_1(\Omega_j) - \lambda_1(B)\leq \frac{\text{dist}(\Omega_j, B)^2}{j}, \end{equation} where we let $\text{dist}(\Omega,B)$ denote the distance on the right-hand side of \eqref{eqn: stability statement}. Now, consider a functional of the form \begin{equation}\label{eqn: functional} \mathcal{F}_j(\Omega) = \lambda_1(\Omega) +\tau \sqrt{c_j^2 + (c_j - \text{dist}(\Omega, B)^2)^2}, \end{equation} where $c_j =\text{dist}(\Omega_j, B)^2$ which is designed so that a minimizer $\Omega_j'$ of $\mathcal{F}_j$ among sets of a fixed volume satisfies the same contradiction assumption \eqref{eqn: contra general}. Theorem~\ref{thm: quantitative FK general} will then follow once we establish the following two main ingredients for a selection principle: \begin{enumerate} \item (Regularity) Minimizers $\Omega_j'$ of the penalized functionals $\mathcal{F}_j$ satisfy good $\varepsilon$-regularity properties. Combined with the (easily shown) fact that the $\Omega_j'$ converge to a ball $B$ in a weak sense, this will guarantee that for $j$ sufficiently large, the boundary of $\Omega_j'$ is a small $C^{2,\alpha}$ perturbation of the boundary of $B$.\\ \item (Local stability) The quantitative stability estimate \eqref{eqn: stability statement} holds for sets that whose boundaries are small $C^{2,\alpha}$ perturbations of the boundary of $B$. This step is based on {\it linear stability,} i.e. strict positivity of the second variation of $\lambda_1(B)$ in non-translational directions. \end{enumerate} In the context of Theorem~\ref{thm: quantitative sperner}, significant challenges arise in both of these two steps. Let us describe these challenges, and the new strategies introduced to deal with them. {\it Step (1):} For an energy like \eqref{eqn: functional} in which $\lambda_1(\Omega)$ (or the closely related torsional rigidity below) is the dominant term, the functional $\mathcal{F}_j$ can be realized as a perturbation of the Alt-Caffarelli functional \cite{AC81}. However, in contrast to \cite{BDV15}, the presence of $L^2$ eigenvalue penalization in the distance makes this perturbation a critical one and leads to significant issues for regularity. Step (1) is carried out in our companion paper \cite{AKN1}, where we consider a selection principle associated to the geometric inequality \[ \lambda_1(\Omega) + \frak{T} {\text{tor}}(\Omega) \geq \lambda_1(B) + \frak{T} {\text{tor}} (B) \] for a small number $\frak{T}>0$. Here ${\text{tor}}(\Omega)$ is the (negative of the physical quantity) {\it torsional rigidity} of an open set $\Omega \subset {\mathbb{R}}^n$, defined and discussed further in Section~\ref{sec: SP}. In Section~\ref{sec: SP}, we will see how to connect this selection principle with the one we need to prove Theorem~\ref{thm: quantitative FK general}, using the so-called Kohler-Jobin inequality. {\it Step (2):} In nearly all selection principle arguments, including the quantitative Faber-Krahn inequality of \cite{BDV15} in Euclidean space, Step (1) can be carried out using an {\it explicit} analysis of the second variation. On the round sphere and hyperbolic space, these computations can no longer be carried out explicitly. To overcome this challenge, we introduce a new technique, based on the maximum principle, to perform an {\it implicit spectral analysis}. We exploit the symmetry of the minimizers, which are balls, (thus indirectly using their explicit form), and use an ODE maximum principle argument to establish the desired spectral gap. To our knowledge, this is the first time this method has been used in a quantitative stability estimate or in a spectral analysis otherwise. \\ \medskip The remainder of the paper is organized in the following way. In Section~\ref{sec: qacf} we prove the quantitative estimates for the Alt-Caffarelli-Friedman monotonicity formula of Theorem~\ref{t:stability}. We present the proof in the cases $n=2 $ and $n\geq 3$ separately because the two-dimensional case is simpler and provides a basic outline of the proof for higher dimensions. Corollary~\ref{c:uniqueblowup} is also proven in this section. In Section~\ref{sec: sperner}, we prove Theorem~\ref{thm: quantitative FK general}. In the interest of clarity, we present the proof in the specific case of the round sphere, which is also the essential case in our application to Theorem~\ref{t:stability}. The proof carries over almost verbatim to Euclidean space and hyperbolic space, and we therefore only remark on the necessary modifications to the proof in these cases. As we have mentioned, the regularity estimates of Step (1), as well as the details of the selection prinicple, are shown in our companion paper \cite{AKN1}. Section~\ref{sec: sperner} is thus largely dedicated to proving Step (2) in Section~\ref{sec: NSS}, with the regularity results of \cite{AKN1} recalled and the conclusion of Theorem~\ref{thm: quantitative FK general} drawn in Section~\ref{sec: SP}. \subsection{Acknowledgements} MA was partially supported by Simons Collaboration Grant ID 637757. During the course of this work, RN was partially supported by the National Science Foundation under Grant No. DMS-1901427, as well as Grant No. DMS-1502632 ``RTG: Analysis on manifolds'' at Northwestern University and Grant No. DMS-1638352 at the Institute for Advanced Study. This project originated from discussions at the 2018 PCMI Summer Session on Harmonic Analysis. \section{Quantitative Stability for the Alt-Caffarelli-Friedman Monotonicity Formula}\label{sec: qacf} This section is dedicated to the proof of Theorem~\ref{t:stability} and Corollary~\ref{c:uniqueblowup}. The cases $n=2$ and $n\geq 3$ are carried out separately in Sections~\ref{sec: 2d qacf} and \ref{sec: nd qacf} respectively. Corollary~\ref{c:uniqueblowup} is shown in Section~\ref{ssec: blowups}. \subsection{The two dimensional case}\label{sec: 2d qacf} Throughout the section, we let $n=2$ and let $u_1,u_2:B_1 \to {\mathbb{R}}$ be two nonnegative functions satisfying \eqref{eqn: harmonic functions}. Let $J=J[u_1, u_2]:(0,1)\to {\mathbb{R}}_+$ be the two dimensional Alt-Caffarelli-Friedman monotonicity formula defined in \eqref{eqn: ACF 2d}. To begin, we prove the monotonicity of the functional $J(r)$ following \cite{acf84, CaffSalsa}, along the way introducing some notation and outlining the main ideas of the proof of Theorem~\ref{t:stability} when $n=2$. We directly compute \begin{equation}\label{eqn: derivative1 2d} \log(J(r))' = \frac{\int_{{\partial} B_r} |{\nabla} u_1|^2}{\int_{B_r} |{\nabla} u_1|^2} +\frac{\int_{{\partial} B_r} |{\nabla} u_2|^2}{\int_{B_r} |{\nabla} u_2|^2} -\frac{4}{r}. \end{equation} For each fixed $r \in (0,1]$ and for $i=1,2$, we denote by $\{\lambda_{k,r}^i\}$ and $\{Y_{k,r}^i\}$ the Dirichlet eigenvalues and eigenfunctions of the Laplacian $-{\partial}_{\tau \tau}$ on the set $\Omega_r^i= \{u_i>0\} \cap {\partial} B_r$, with the eigenfunctions normalized so that $\|Y_{k,r}^i\|_{L^2(\Omega^i_r)}=1$. Here and in the sequel, we let ${\partial}_\tau$ denote the tangential derivative on ${\partial} B_r,$ so that in polar coordinates $(r, \theta)$ for ${\mathbb{R}}^2$, we have ${\partial}_\tau = \frac{1}{r} {\partial}_{\theta}$. The positivity set $\Omega_r^i$ comprises a union of circular arcs in ${\partial} B_r$, and so the the first eigenvalue and eigenfunction of this set are the (explicit) first eigenvalue and eigenfunction of the longest circular arc. More specifically, define $\theta_i(r) \in [0, 2\pi]$ so that the length of the longest circular arc in $\Omega_r^i$ is $r \theta_i(r)$. The first eigenvalue and eigenfunction of $\Omega_r^i$ are given by (up to the obvious rotation) \begin{equation}\label{eqn: 2d first eval} \lambda_{1,r}^i = \frac{\pi^2}{r^2 \theta_i(r)^2}, \qquad\qquad Y_{1,r}^i = \sqrt{\frac{2}{r \theta_i(r)}}\, \sin\Big(r \sqrt{\lambda_ {1,r}^i}\theta \Big)^+ . \end{equation} Here we have written the eigenfunction in polar coordinates $(r, \theta)$ for ${\mathbb{R}}^2$. It is worth noting that for a semicircle in ${\partial} B_r,$ the first eigenfunction is $\lambda = 1/r^2$ and the first eigenfunction is $Y= \sqrt{2/\pi r} \sin( \theta)^+,$ whose one-homogeneous extension is a linear function restricted to a half plane. Observe that $\theta_1(r) + \theta_2(r) \leq 2\pi$ because the supports of $u_1$ and $u_2$ are disjoint. Now, we note that for $i=1,2$, \[ \begin{aligned} \int_{\partial B_r} |\nabla u_i|^2 &= \int_{\partial B_r} (\partial_{\tau} u_i)^2 + (\partial_r u_i^2) \\ &= \left( \int_{\partial B_r} (\partial_{\tau} u_i)^2 - \lambda_{1,r}^i u_i^2\right) +\left(\int_{\partial B_r} \lambda_{1,r}^i u_i^2 - 2\sqrt{\lambda_{1,r}^i} u_i \partial_r u_i \right) + \left( \int_{\partial B_r} 2\sqrt{\lambda_{1,r}^i} u_i \partial_r u_i\right) . \end{aligned} \] Using now the subharmonicity and nonnegativity of $u_i$ we have \[ \int_{B_r} |\nabla u_i|^2 \leq \int_{\partial B_r} u_i {\partial}_r u_i, \] so that dividing by $\int_{\partial B_r} |\nabla u_i|^2$, summing in $i$, and subtracting $4/r$ we obtain from \eqref{eqn: derivative1 2d} and \eqref{eqn: 2d first eval} that \begin{equation}\label{eqn: logJprime and deltas} \log(J(r))' \geq \delta_A(r) + \delta_B(r) +\delta_C(r)\,, \end{equation} where we define \begin{align*} \delta_A(r) &= \sum_{i=1}^2 \ \frac{1}{\int_{B_r}| {\nabla} u_i|^2}\left( \int_{{\partial} B_r} ({\partial}_\tau u_i)^2 -\lambda_{1,r}^i\int_{{\partial} B_r} u_i^2\right)\,, \\ \delta_B(r) & =\sum_{i=1}^2 \ \frac{1}{\int_{B_r}| {\nabla} u_i|^2} \left(\lambda_{1,r}^i\int_{{\partial} B_r} u_i^2 + \int_{{\partial} B_r}({\partial}_r u_i)^2 -2\sqrt{\lambda_{1,r}^i} \int_{{\partial} B_r} u_i {\partial}_r u_i\right)\,, \\ \delta_C(r) & = \frac{2}{r} \left( \frac{\pi}{\theta_1(r)} + \frac{\pi}{\theta_2(r)}-2\right)\,. \end{align*} The ACF functional $J(r)$ is shown to be monotone in \cite{acf84, CaffSalsa} by showing that each of $\delta_A(r), \delta_B(r)$, and $\delta_C(r)$ is nonnegative; this is in particular a consequence of Lemma~\ref{l:3estimate} below. The quantitative monotonicity formula of Theorem~\ref{t:stability} will be established by quantifying the loss in each inequality $\delta_{(\cdot)}(r) \geq 0$ and integrating with respect to $r$. Let us informally discuss the information contained in each $\delta_{(\cdot)}(r)$. The quantity $\delta_A(r)$ is nonnegative by the Poincar\'e inequality on $\Omega_r^i$, and equals zero for a given $r \in (0,1]$ if and only if $u_i$ restricted to ${\partial} B_r$ is equal to the first eigenfunction $Y_{1,r}^i$ of $\Omega_r^i$. By quantifying the positivity of $\delta_A(r)$ in \eqref{eqn: deltaA est} in Lemma~\ref{l:3estimate} below, we see that $\delta_A(r)$ quantitatively controls the distance of $u_i$ to the eigenfunction on this set. The term in parentheses in the definition of $\delta_B(r)$ can be realized as a square as in \eqref{eqn: deltaB est} in Lemma~\ref{l:3estimate} below. This immediately shows that $\delta_B(r)$ is nonnegative for all $r \in (0,1)$. Furthermore, it provides quantitative control on how closely the restriction of $u_i$ to ${\partial} B_r$ behaves like a homogeneous function with homogeneity $\sqrt{\lambda_{1,r}^i}/r$. The quantity $\delta_C(r)$ can be bounded below by square functions; see \eqref{eqn: deltaC est} in Lemma~\ref{l:3estimate} below, which in particular shows that $\delta_C(r)\geq 0$. The estimate \eqref{eqn: deltaC est} shows that the longest circular arc in $\Omega_r^i$ (and thus $\Omega_r^i$ itself) is quantitatively close to a semicircle in ${\partial} B_r$, and the corresponding first eigenvalue $\lambda_{1,r}^i$ is quantitatively close to the first eigenvalue $1/r^2$ of a semicircle in ${\partial} B_r$. The proof of Theorem~\ref{t:stability} roughly goes as follows. By integrating $\delta_B(r)$ and $\delta_C(r)$ from $\rho$ to $1$, we show in Lemma~\ref{l:onehomogen} that each $u_i$ is quantitatively close to the one-homogeneous function defined by $r u_i(1,\theta)$ in polar coordinates. Then, in Proposition~\ref{l:approximate2}, we apply the estimate \eqref{eqn: deltaA est} for $\delta_A(1)$ to deduce that $ u_i(1,\theta)$ is almost equal to a multiple of first eigenfunction $Y_{1,1}^i$ of $\Omega_1^i$, and applying the estimate \eqref{eqn: deltaC est} once again, we see that $Y_{1,1}^i$ is quantitatively close to the first eigenfunction of the semicircle. Finally, Theorem~\ref{t:stability} follows from Proposition~\ref{l:approximate2} once we guarantee that the semicircles corresponding to $u_1$ and $u_2$ do not have too much overlap. \\ The following lemma provides basic quantitative lower bounds for each of $\delta_A(r), \delta_B(r)$, and $\delta_C(r)$ discussed above. Since each of the right-hand sides of \eqref{eqn: deltaA est}-\eqref{eqn: deltaC est} are nonnegative, Lemmma~\ref{l:3estimate} and \eqref{eqn: logJprime and deltas} in particular imply the monotonicity of $J(r)$. \begin{lemma} \label{l:3estimate} For each $r \in (0,1]$ and $i=1,2$, let $Y_{i,r}^1$ be the eigenfunction defined in \eqref{eqn: 2d first eval} and let $\beta_{1,r}^i = \int_{{\partial} B_r} u_i Y_{1,r}^i$. We have \begin{align} \label{eqn: deltaA est} \delta_A(r) & \geq \sum_{i=1}^2 \ \frac{(\lambda_{2,r}^i -\lambda_{1,r}^i ) }{\int_{B_r}| {\nabla} u_i|^2} \int_{{\partial} B_r} \left(u_i-\beta_{1,r}^iY_{1,r}^i\right)^2,\\ \label{eqn: deltaB est} \delta_B(r) &= \sum_{i=1}^2 \ \frac{1}{\int_{B_r}| {\nabla} u_i|^2} \int_{{\partial} B_r} \left( \sqrt{\lambda_{1,r}^i} u_i - {\partial}_r u_i\right)^2, \\ \label{eqn: deltaC est} \delta_C(r) &\geq \sum_{i=1}^2\frac{2}{r} \frac{(\pi - \theta_i(r))^2}{\theta_i(r)(2\pi - \theta_i(r))}\geq \sum_{i=1}^2\frac{1}{\sqrt{\lambda_{1,r}^i}} \left( \sqrt{\lambda_{1,r}^i} - \frac{1}{r}\right)^2. \end{align} \end{lemma} \begin{proof} We fix $r \in (0,1]$, and for notational simplicity omit the subscripts $r$ in the remainder of the proof. We first prove \eqref{eqn: deltaA est}. For $i=1,2$, let $\beta_k^i = \int_{{\partial} B_r} u_i Y_k^i$, so, expanding the term in parentheses of $\delta_A(r)$ in this basis, we have \begin{align*} \int_{{\partial} B_r} ({\partial}_\tau u_i)^2-\lambda_1^i \int_{{\partial} B_r} u_i^2 = \sum_{k=1}^\infty &\lambda_k^i (\beta_k^i)^2- \lambda_1^i \sum_{k=1}^\infty (\beta_k^i)^2 \\ &\geq (\lambda_2^i -\lambda_1^i )\sum_{k=2}^\infty (\beta_k^i)^2 = (\lambda_2^i -\lambda_1^i ) \int_{{\partial} B_r} (u_i-\beta_1^iY_1^i)^2. \end{align*} Dividing this expression by $\int_{B_r} |{\nabla} u_i|^2 $ and summing from $i=1$ to $2$ gives \eqref{eqn: deltaA est}. Next, \eqref{eqn: deltaB est} is immediate by writing the integrand as a square. Finally, to prove \eqref{eqn: deltaC est}, recall that $\theta_2(r) \leq 2\pi - \theta_1(r) $, and so \begin{align*} \delta_C(r) & \geq \frac{2}{r} \left( \frac{\pi}{\theta_1(r)} +\frac{ \pi}{2\pi - \theta_1(r)} - 2\right)\\ & = \frac{2}{r}\left(\frac{2\pi^2}{\theta_1(r)(2\pi - \theta_1(r))}- 2\right)= \frac{4}{r} \frac{(\pi - \theta_1(r))^2}{\theta_1(r)(2\pi - \theta_1(r))}. \end{align*} The analogous expression holds with $\theta_2$ in place of $\theta_2$. Summing these expressions and dividing by $2$ gives the first estimate in \eqref{eqn: deltaC est}. For the second, use \eqref{eqn: 2d first eval} to see \[ \frac{4}{r} \frac{(\pi - \theta_1(r))^2}{\theta_1(r)(2\pi - \theta_1(r))} = \frac{1}{\sqrt{\lambda_1^1}}\frac{4\pi}{(2\pi - \theta_1(r) ) }\left( \sqrt{\lambda_1^1} - \frac{1}{r}\right)^2 \geq \frac{2}{\sqrt{\lambda_1^1}} \left( \sqrt{\lambda_1^1} - \frac{1}{r}\right)^2. \] Again, the same expression holds with $\theta_2$ in place of $\theta_2$. Summing these expressions and dividing by $2$ gives the second estimate in \eqref{eqn: deltaC est}. This concludes the proof of the lemma. \end{proof} The following lemma makes use of the estimates for $\delta_B(r)$ and $\delta_C(r)$ in Lemma~\ref{l:3estimate} and shows that $u_1$ and $u_2$ are quantitatively close to being $1$-homogeneous. \begin{lemma} \label{l:onehomogen} Let $u_1,u_2$ be as above. Then for a universal constant $C>0$ and any $\rho \in (0,1)$, \[ \int_{B_1 \setminus B_{\rho}} [ru_i(1,\theta)-u_i(r,\theta)]^2 \leq C\log\left(\frac{J(1)}{J(\rho)}\right) \|u_i \|_{W^{1,2}(B_1)}^2 . \] \end{lemma} \begin{proof}Fix $i \in \{1,2\}$. For notational simplicity, we omit the sub and superscripts $i$ in this proof. We first note that \[ \begin{aligned} \int_{B_1 \setminus B_{\rho}} [ru(1,\theta) - u(r,\theta)]^2 &\leq 2\int_{B_1 \setminus B_{\rho}} [ru(1,\theta) - A(r)u(1,\theta)]^2 + 2\int_{B_1 \setminus B_{\rho}} [A(r)u(1,\theta) - u(r,\theta)]^2 \\ &= (I) + (II), \end{aligned} \] where we define $A(r):=e^{-\int_r^1 \sqrt{\lambda(t)} dt}$ and $\lambda(t) = \lambda_{1,t}$. We bound $(II)$ in the following manner. Using that \[ u(1,\theta)A(r)-u(r,\theta)=\int_r^1 [u_r(s,\theta) - \sqrt{\lambda(s)}u(s,\theta)]e^{-\int_r^s \sqrt{\lambda(t)}dt} \ ds \] as well as that $|e^{-\int_r^s \sqrt{\lambda(t)} dt }|\leq 1$ we have \begin{equation} \label{e:sq1} |u(1,\theta)A(r)-u(r,\theta)|^2 \leq \int_r^{1} |u_r(s,\theta)- \sqrt{\lambda(s)} u(s,\theta)|^2 \ ds. \end{equation} Now to continue with $(II)$ we have \[ \begin{aligned} \int_{B_1 \setminus B_{\rho}} [u(r,\theta) - A(r)u(1,\theta)]^2&= \int_{\rho}^1 \int_{\partial B_1} r [u(r,\theta) - A(r)u(1,\theta)]^2 d\theta \ dr\\ & \leq \int_{\rho}^1 \int_{\partial B_1} r \int_r^{1} |u_r(s,\theta)- \sqrt{\lambda(s)} u(s,\theta)|^2 \ ds \ d \theta \ dr\\ & \leq \int_{\rho}^1 \int_{\partial B_1} \int_r^{1} s |u_r(s,\theta)- \sqrt{\lambda(s)} u(s,\theta)|^2 \ ds \ d \theta \ dr\\ & \leq \int_{\rho}^1 \int_{\partial B_1} \int_{\rho}^{1} s |u_r(s,\theta)- \sqrt{\lambda(s)} u(s,\theta)|^2 \ ds \ d \theta \ dr\\ & \leq \int_{\rho}^1 \int_{\rho}^1 \delta_{B}(s) \left(\int_{B_s} |\nabla u|^2\right) \ ds \ dr\\ & \leq \left(\int_{\rho}^1 \delta_{B}(s) \ ds \right) \int_{B_1} |\nabla u|^2. \end{aligned} \] In order to bound $(I)$ we first note that if $\sqrt{\lambda(s)} \geq 2/s$, then from \eqref{eqn: deltaC est} we have that $\sqrt{\lambda(s)} \leq 4 \delta_C(s)$, so that $\max\{\sqrt{\lambda(s)}, 2/s\} \leq 4\delta_C(s)+ 2/s$. Now using that $e^{-x}$ is $1$-Lipschitz for $x \geq 0$ we have \[ \begin{aligned} |A(r)-r| &= \left|e^{-\int_r^1 \sqrt{\lambda(s)} \ ds} - e^{-\int_r^1 1/s \ ds}\right| \\ &\leq \left|\int_r^1 \sqrt{\lambda(s)} - 1/s \ ds \right| \\ &\leq \left(\int_r^1 \frac{(\sqrt{\lambda(s)} - 1/s)^2}{\sqrt{\lambda(s)}} \ ds \right)^{1/2} \left( \int_r^1 \sqrt{\lambda(s)} \ ds\right)^{1/2} \\ &\leq \left(\int_r^1 \delta_C(s)\ ds \right)^{1/2} \left( \int_r^1 \max\{\sqrt{\lambda(s)},2/s \}\ ds\right)^{1/2} \\ &\leq \left(\int_r^1 \delta_C(s)\ ds \right)^{1/2} \left( \int_r^1 4\delta_C(s) + 2/s \ ds\right)^{1/2} \\ &\leq \left(\int_r^1 \delta_C(s)\ ds \right)^{1/2} \left( 4- 2\ln r \right)^{1/2}, \end{aligned} \] so that \begin{equation} \label{e:sq2} |A(r)-r|^2 \leq \left(\int_r^1 \delta_C(s) \right)(4- 2 \ln r). \end{equation} To continue with $(I)$, we use the trace inequality on $B_1$ and the fact that $r\mapsto r(4-2\ln r)$ is bounded for $r \in (0,1]$ to find \[ \begin{aligned} \int_{B_1 \setminus B_{\rho}} [ru(1,\theta) - A(r)u(1,\theta)]^2 &= \left(\int_{\partial B_1} u^2(1,\theta) \ d\theta \right)\int_{\rho}^1 r [r-A(r)]^2 \ dr \\ &\leq C \| u \|_{W^{1,2}(B_1)}^2 \int_{\rho}^1 r \left(\int_r^1 \delta_C(s) \ ds \right)(4- 2 \ln r) \ dr \\ &\leq C \| u \|_{W^{1,2}(B_1)}^2 \int_{\rho}^1 \left(\int_{\rho}^1 \delta_C(s) \ ds \right) \ dr \\ &\leq C \| u \|_{W^{1,2}(B_1)}^2 \int_{\rho}^1 \delta_C(s) \ ds. \\ \end{aligned} \] Recalling \eqref{eqn: logJprime and deltas} concludes the proof. \end{proof} This next lemma is a straightforward computation for sine functions that will be used in the proofs of Proposition~\ref{l:approximate2} and Theorem~\ref{t:stability}. \begin{lemma} \label{l:shift} There exists a universal constant $C>0$ such that for any $\hat{\theta} \in [0,2\pi)$ and any $\lambda>0$ with $|1-\sqrt{\lambda}|\leq 1/2$, \begin{align} \label{eqn: sin int 1} \int_{S^1} [\sin(\theta + \hat{\theta} )^+ - \sin(\theta)^+]^2 &\leq C\hat{\theta}^2\\ \label{eqn: sin int 2} \int_{S^1} [\sin(\sqrt{\lambda} \theta)^+ - \sin(\theta)^+]^2 & \leq C(1-\sqrt{\lambda})^2. \end{align} \end{lemma} \begin{proof} To estimate \eqref{eqn: sin int 1}, from the bound $|\sin'(\theta)|\leq 1$, one has $(\sin(\theta+\hat{\theta})-\sin(\theta))^2 \leq C \theta^2$. If $\sin(\theta + \hat{\theta})>0$ and $\sin(\theta)\leq 0$, then $(\sin(\theta+\hat{\theta}))^2 \leq \hat{\theta}^2$. This is sufficient to conclude \eqref{eqn: sin int 1}. To estimate \eqref{eqn: sin int 2} we break up the integral over $S^1$ into the regions $(0,\pi)\cup(\pi,\bar \theta)$ where we let $\bar \theta = \pi /\sqrt{\lambda}$. If $\sqrt{\lambda}>1$, then it suffices to only consider the interval $(0,\pi)$. We first have \[ \begin{aligned} \int_0^\pi [\sin(\sqrt{\lambda} \theta)^+ - \sin(\theta)^+ ]^2 &\leq \int_0^\pi [\sin(\sqrt{\lambda} \theta) - \sin(\theta) ]^2 \\ &= \pi - \frac{\sin((\sqrt{\lambda}-1)\pi)}{\sqrt{\lambda}-1} - \frac{\sin(2\sqrt{\lambda}\pi)}{4\sqrt{\lambda}} + \frac{\sin((\sqrt{\lambda}+1)\pi)}{\sqrt{\lambda}+1} \end{aligned} \] which is a smooth function in $\sqrt{\lambda}$ and has a minimum of zero at $\sqrt{\lambda}=1$, so there exists a universal constant $C$ such that \[ \int_0^\pi [\sin(\sqrt{\lambda} \theta)^+ - \sin(\theta)^+ ]^2 \leq C (1-\sqrt{\lambda})^2 \] provided that $|\sqrt{\lambda}-1|\leq 1/2$. Furthermore, using a change of variables and a Taylor expansion of $\sin^2(\cdot)$ at $\theta=0$, we have \[ \int_\pi^{\bar \theta} [\sin(\sqrt{\lambda} \theta)^+ - \sin(\theta)^+ ]^2=\int_\pi^{\bar \theta} \sin^2(\sqrt{\lambda} \theta) = \int_0^{\bar \theta-\pi} \sin^2 (\sqrt{\lambda} \theta) \leq C (1-\sqrt{\lambda})^3 \] for a universal constant $C$ when $|\sqrt{\lambda} -1|\leq 1/2$. We conclude \eqref{eqn: sin int 2}. \end{proof} The next proposition contains the core of the proof of Theorem~\ref{t:stability} and shows that $u_1$ and $u_2$ are each well-approximated by a linear function in a quantitative sense. From Lemma~\ref{l:onehomogen}, we know that $u_1$ and $u_2$ are each well-approximated by one-homogeneous functions. In this proposition, we show that these one-homogeneous functions can be well-approximated by linear functions. \begin{proposition}\label{l:approximate2} Assume $\log(J(1)/J(\rho))\leq 1$ with $\rho \in [0,1/2]$. For $i=1,2,$ let $\hat{\beta}_i = \beta_{1,1}^i = \int_{{\partial} B_1} u_i Y_{1,1}^i$ and let $\beta_i = \sqrt{2}\hat{\beta}_i/\sqrt{\pi}$. There exists $\theta_i \in [0,2\pi]$ such that if we let $v_i$ be the linear function defined in polar coordinates by $v_i=r\sin(\theta+\theta_i)$, then \[ \int_{B_1\setminus B_\rho} [u_i-\beta_i v_i^+]^2 \leq C\log\left(\frac{J(1)}{J(\rho)}\right) \| u_i \|_{W^{1,2}(B_1)}^2. \] \end{proposition} \begin{proof} Let \[ \varepsilon =\log\left(\frac{J(1)}{J(\rho)}\right) = \int_\rho^1 \log(J(r))'\,dr\,. \] Since the integrand is nonnegative, it follows from Chebyshev's inequality that $\log(J(r))' \leq 10\varepsilon$ outside a set of measure $\varepsilon/10$. In particular, $\log(J(r))' \leq 10 \varepsilon$ for some $r \in (1- \varepsilon/5, 1]$. So, by scaling we may assume that \begin{equation}\label{eqn: scaling j'(1)} \log(J(1))'\leq \epsilon. \end{equation} Fix $i \in \{1,2\}$. For the remainder of the proof, we omit subscripts $i$ for notational simplicity. After a rotation, we assume that the longest arc on which $u\cap {\partial} B_1$ is positive is $(0,\theta(1))$. After this rotation, we let $v = r\sin(\theta)$. Applying the estimate \eqref{eqn: deltaC est} for $\delta_C(r)$ with $r=1$, we deduce that there exist universal constants $c$ and $C$ such that \begin{equation}\label{eqn: useful} |\pi - \theta(1)| \leq C\sqrt{\epsilon}, \quad |\sqrt{\lambda} - 1| \leq C\sqrt{\epsilon}, \quad \lambda_2 - \lambda\geq c. \end{equation} Here and in the remainder of the proof, we let $\lambda = \lambda_{1,1},$ i.e. $\lambda$ is the first Dirichlet eigenvalue of $\Omega_1$. Likewise, $\lambda_2$ denotes the second Dirichlet eigenvalue of $\Omega_1$. We now apply the triangle inequality to split the integral on the left-hand side into three pieces as follows: \begin{equation}\label{eqn: starting point} \begin{split} \int_{B_1\setminus B_\rho} (u - \beta v^+)^2 & \leq 4\int_{B_1\setminus B_\rho} (u - ru(1,\theta))^2 \\ & +4 \int_{B_1\setminus B_\rho} (r u(1,\theta) -r\hat{\beta} Y_{1,1})^2 \\ & +4\int_{B_1\setminus B_\rho} (\hat{\beta} r Y_{1,1}- \beta r\sin(\theta)^+)^2 \,. \end{split} \end{equation} We apply Lemma~\ref{l:onehomogen} to the first term on the right-hand side of \eqref{eqn: starting point} to find that for a universal constant $C$, we have \begin{equation} \label{eqn: application of one hom lemma} 4\int_{B_1\setminus B_\rho} (u - ru(1,\theta))^2 \leq C \varepsilon \| u\|_{W^{1,2}(B_1)}^2\,. \end{equation} Next, we use the estimate \eqref{eqn: deltaA est} for $\delta_A(r)$ with $r =1$ to bound the second term on the right-hand side of \eqref{eqn: starting point}. Indeed, by \eqref{eqn: deltaA est} and the the uniform eigenvalue gap \eqref{eqn: useful}, we see that \begin{equation}\begin{split} \label{eqn: second term} 4 \int_{B_1\setminus B_\rho} (r u(1,\theta) - \hat{\beta} rY_{1,1})^2 & \leq C \int_{{\partial} B_1} (u(1,\theta) - \hat{\beta} Y_{1,1})^2\\ & \leq C \log(J(1))' \|\nabla u \|_{L^2(B_1)}^2\leq C\varepsilon \| \nabla u \|_{L^2(B_1)}^2\, \end{split} \end{equation} for a universal constant $C$. In the final inequality we have made use of \eqref{eqn: scaling j'(1)}. Finally, the third term in \eqref{eqn: starting point} can be estimated using the eigenvalue estimate in \eqref{eqn: useful} and the estimate \eqref{eqn: sin int 2} from Lemma~\ref{l:shift}. Indeed, noting that $\hat{\beta} \leq \| u\|_{L^2(\partial B_1)} \leq C\| u\|_{W^{1,2}(B_1)}$, we conclude that \begin{equation}\label{eqn: sin bound} \begin{split} 4\int_{B_1\setminus B_\rho} (\hat{\beta} r Y_{1,1} -& \beta r\sin(\theta)^+)^2 \leq \hat{\beta}^2 \int_{{\partial} B_1}\left[ Y_{1,1} - \sqrt{\frac{2}{\pi}} \sin(\theta)^+\right]^2 \\ & \leq C\hat{\beta}^2\int_{{\partial} B_1}\left[ \sqrt{\frac{2}{\theta(1)}} \sin(\sqrt{\lambda} \theta)^+ - \sqrt{\frac{2}{\pi}}\sin(\theta)^+\right]^2\\ & \leq C\hat{\beta}^2\int_{{\partial} B_1}\left[ \sin(\sqrt{\lambda} \theta)^+ -\sin(\theta)^+\right]^2 + C\hat{\beta}^2 \left(\frac{1}{\sqrt{\theta(1)}} - \frac{1}{\sqrt{\pi}} \right)^2 \int_{{\partial} B_1}\left[ \sin(\sqrt{\lambda} \theta)^+\right]^2 \\ & \leq C\hat{\beta}^2 (1-\sqrt{\lambda})^2+ C\hat{\beta}^2 (\pi -\theta(1))^2 \leq C \varepsilon \| u \|_{W^{1,2}( B_1)}^2. \end{split} \end{equation} By combining \eqref{eqn: starting point}, \eqref{eqn: application of one hom lemma}, \eqref{eqn: second term} and \eqref{eqn: sin bound}, we conclude the proof of the proposition. \end{proof} We are now ready to prove Theorem~\ref{t:stability} in the case $n=2$. \begin{proof}[Proof of Theorem~\ref{t:stability} for $n=2$] If $\log(J(1)/J(\rho))\geq 1$, then we may choose $\beta_i=\| u \|_{L^2(B_1)}$ and $\nu = e_1$, and the result immediately follows for large enough $C$ depending only on $n$. If $\log(J(1)/J(\rho))<1$, then we may choose for $i=1,2$, the constants $\beta_1^i$ and $\theta_i$ be as in Proposition~\ref{l:approximate2}. In order to conclude Theorem~\ref{t:stability}, the only issue is that the functions $\sin(\theta + \theta_1)^+$ and $\sin(\theta+ \theta_2)^+$ may not have disjoint support. However, from \eqref{eqn: useful} we point out that the overlap may not exceed $C\sqrt{\epsilon}$. Therefore, by Lemma \ref{l:shift}, we may rotate both functions to have disjoint support and thus obtain the result. \end{proof} \medskip \subsection{The $n$-dimensional case}\label{sec: nd qacf} We now move to the proof of Theorem~\ref{t:stability} in higher dimensions. Throughout this section, let $n\geq 3$, let $u_1,u_2$ be as in \eqref{eqn: harmonic functions} and let $J=J[u_1, u_2] : (0,1] \to {\mathbb{R}}$ be the $n$-dimensional Alt-Caffarelli-Friedman monotonicity formula defined in \eqref{eqn: ACF higher d}. The proof of Theorem~\ref{t:stability} follows the same basic scheme as the proof in the two dimensional setting, wherein we estimate the positivity of $\log(J(r))'$ on each sphere ${\partial} B_r$. Whereas in the two dimensional case the positivity sets ${\partial} B_r \cap\{u_i>0\}$ were unions of circular arcs, in higher dimensions the geometry of the positivity sets may be more complicated. In particular, we can no longer hope to write the first eigenfunction and eigenvalue in an explicit way. The key tool to overcome this difficulty is Theorem~\ref{thm: quantitative sperner}. In this section only, we will use the notation ${\mathcal{B}}$ to denote an $(n-1)$-dimensional spherical cap (i.e. geodesic ball in $S^{n-1}$), so as not to be confused with the notation $B$ used for a ball in $n$-dimensional Euclidean space. To begin the $n$-dimensional setting, let us recall the proof from \cite{acf84, CaffSalsa} that the ACF formula \eqref{eqn: ACF higher d} is monotone. We directly compute \begin{equation}\label{eqn: derivative1} \log(J(r))' = \frac{r^{2-n}\int_{{\partial} B_r} |{\nabla} u_1|^2}{\int_{B_r} \frac{|{\nabla} u_1|^2}{|x|^{n-2}}} +\frac{r^{2-n}\int_{{\partial} B_r} |{\nabla} u_2|^2}{\int_{B_r} \frac{|{\nabla} u_2|^2}{|x|^{n-2}}} -\frac{4}{r}. \end{equation} For each $r \in (0,1)$ and $i=1,2$, set $\Omega_i^r = \{ u_i>0 \} \cap {\partial} B_r$ . Let $\lambda_{1,r}^i$ and $\tilde{u}_{i,r}$ respectively denote the first Dirichlet eigenvalue and eigenfunction $-\Delta_\tau$ on $\Omega_i^r$, where $\tilde{u}_{i,r}$ is normalized so that $\| \tilde{u}_{i,r}\|_{L^2(\Omega_i^r)}=1$. Here $\Delta_\tau$ denotes the Laplacian of ${\partial} B_r$. For $n>2$, we may no longer write $\lambda_{1,r}^i$ explicitly as we did in \eqref{eqn: 2d first eval} in the two dimensional case. For a hemisphere in ${\partial} B_r$, the first eigenvalue is $\lambda_1=(n-1)/r^2$ with corresponding eigenfunction given by the restriction a linear function on ${\mathbb{R}}^n$ to this set. (By symmmetry, one can see that the first eigenfunction of a hemisphere is the restriction of the first spherical harmonic that vanishes on the boundary of the hemisphere, which up to a rotation is the second spherical harmonic.) An important quantity in this setting is the characteristic constant $\alpha=\alpha_i(r) \in (0, \infty)$ of $\Omega_i^r$ defined by \begin{equation}\label{eqn: characteristic constant} \alpha_i(r)^2 + (n-2)\alpha_i(r) - r^2\lambda_{1,r}^i=0, \end{equation} see \cite{friedland1976eigenvalue}. The characteristic constant is defined in such a way so that the $\alpha =\alpha_i(r)$ homogeneous extension $w(x) =r^\alpha \tilde{u}_{i,r}$ of $\tilde{u}_{i,r}$ is harmonic in the cone generated by $\Omega_i^r.$ Like the first Dirichlet eigenvalue, the characteristic constant is monotone decreasing under set inclusion, and among sets of a fixed volume is minimized by a spherical cap. A hemisphere in ${\partial} B_r$ has characteristic constant $\alpha =1$. Since $u_i$ is subharmonic and $u_i(0)=0$ we have \cite{CaffSalsa} that \begin{equation} \label{e:cs} \int_{B_r} \frac{|{\nabla} u_i|^2}{|x|^{n-2}} \leq r^{2-n}\int_{\partial B_r} u_i (u_i)_r + \frac{n-2}{2}\frac{u_i^2}{r}. \end{equation} From \eqref{eqn: characteristic constant}, we see that we can express $\lambda_{1,r}^i$ as $\lambda_{1,r}^i = r^{-2}\alpha_i(r)^2 +(n-2)r^{-2} \alpha_i(r)$. With this in mind, we now write $|{\nabla} u_i|^2$ in the following way for any point, where for a point $x \in {\partial} B_r$, we let ${\nabla}_\tau$ denote the projection of the gradient onto the tangent space of ${\partial} B_r$ at $x$. \[ \begin{aligned} |{\nabla} u_i|^2 =|{\nabla}_\tau u_i|^2 + (\partial_r u_i)^2 &= |\partial_\tau u_i|^2 - \lambda_1^i u_i^2 + \lambda_1^i u_i^2 + (\partial_r u_i)^2 \\ &= |\partial_\tau u_i|^2 - \lambda_1^i u^2 + \frac{\alpha_i^2}{r^2} u_i^2 + 2\frac{\alpha_i}{r} \frac{n-2}{2r} u_i^2 + (\partial_r u_i)^2 \\ &= |\partial_\tau u_i|^2 - \lambda_1^i u^2 \\ &\quad + \frac{\alpha_i^2}{r^2} u_i^2 - 2\frac{\alpha_i u_i}{r} \partial_r u_i + (\partial_r u_i)^2 \\ &\quad +2\frac{\alpha_i}{r} u_i \partial_r u_i +2 \frac{\alpha_i}{r^2} \frac{n-2}{2} u_i^2. \\ \end{aligned} \] Using this expression in the numerator of \eqref{eqn: derivative1}, as well as the fact that $|x|^{n-2} \leq r^{n-2}$ on $B_r$ and \eqref{e:cs}, we see that $\log(J(r))' \geq \delta_A(r) + \delta_B(r)+ \delta_C(r)$ where \begin{align*} \delta_A(r) &= \sum_{i=1}^2 \ \frac{1}{\int_{B_r}| {\nabla} u_i|^2}\left( \int_{{\partial} B_r} ({\partial}_\tau u_i)^2 -\lambda_1^i\int_{{\partial} B_r} u_i^2\right) \\ \delta_B(r) & =\sum_{i=1}^2 \ \frac{1}{\int_{B_r}| {\nabla} u_i|^2} \left( \int_{{\partial} B_r} \frac{\alpha_i(r)^2}{r^2}u_i^2 + ({\partial}_r u_i)^2 -2\frac{\alpha_i(r)}{r} u_i {\partial}_r u_i\right) \\ \delta_C(r) & = \frac{2}{r}\left(\alpha_1(r) + \alpha_2(r)-2 \right)\,. \end{align*} In \cite{acf84, CaffSalsa}, the ACF functional $J(r)$ is shown to be monotone by showing that each of $\delta_A(r), \delta_B(r)$, and $\delta_C(r)$ is nonnegative, which we will see is a consequence of Lemma~\ref{l:33estimate} below. As in the two dimensional case, the quantitative monotonicity formula of Theorem~\ref{t:stability} will be established by quantifying the loss in each inequality $\delta_{(\cdot)}(r) \geq 0$ and integrating with respect to $r$. Let us discuss the information captured by each $\delta_{(\cdot)}(r)$. The quantity $\delta_A(r)$ is the direct analogue of $\delta_A(r)$ in the two dimensional setting. It is nonnegative by the Poincar\'e inequality on $\Omega_i^r$, and equals zero for a given $r \in (0,1]$ if and only if $u_i$ restricted to ${\partial} B_r$ is a multiple of the first eigenfunction $\tilde{u}_{i,r}$ of $\Omega_i^r$. As in the case $n=2$, $\delta_A(r)$ quantitatively controls the distance of $u_i$ to the eigenfunction on this set; see \eqref{eqn: deltaA est n} in Lemma~\ref{l:33estimate} below. The term in parentheses in the definition of $\delta_B(r)$ can be realized as a square as in \eqref{eqn: delta b est n dim} in Lemma~\ref{l:33estimate} below, and so $\delta_B(r)$ is nonnegative for all $r \in (0,1)$. It quantitatively controls how closely the restriction of $u_i$ to ${\partial} B_r$ behaves like a homogeneous function with homogeneity $\alpha_i(r)$. The nonnegativity of $\delta_C(r)$ comes from the Friedland-Hayman inequality \cite{friedland1976eigenvalue}. In \eqref{eqn: deltaC esta} of Lemma~\ref{l:33estimate} below, we show that $\delta_C(r)$ provides quantitative control over now close the characteristic constant $\alpha_i(r)$ of $\Omega_i^r$ is to the characteristic constant $\alpha=1$ of a hemisphere in ${\partial} B_r$. Let us outline the ingredients of the proof of Theorem~\ref{t:stability} that make up the rest of this section. By integrating $\delta_B(r)$ and $\delta_C(r)$ from $\rho$ to $1$, we show in Lemma~\ref{l:onehomogen n} that each $u_i$ is quantitatively close to the one-homogeneous function defined by $r u_i(1,\theta)$ in polar coordinates $(r ,\theta ) \in {\mathbb{R}}_+ \times S^{n-1}$ for ${\mathbb{R}}^n$. Lemmas~\ref{l:fh} and Lemma~\ref{l:eigengap} provide quantitative and qualitative information about the proximity of $\Omega_i^1$ to a spherical cap when $\delta_C(1)$ is assumed to be small. Lemma~\ref{lem: caps} compares the eigenfunctions of spherical caps of different radii. In Proposition~\ref{l:approx}, we apply the estimate \eqref{eqn: deltaA est n} for $\delta_A(1)$ to deduce that $ u_i(1,\theta)$ is almost equal to a multiple of first eigenfunction $\tilde{u}_{1,1}^i$ of $\Omega_i^1$, and applying Lemma~\ref{lem: caps} and Theorem~\ref{thm: quantitative sperner}, we see that $\tilde{u}_{1,1}^i$ is quantitatively close to the first eigenfunction of a hemisphere. Finally, Theorem~\ref{t:stability} follows from Proposition~\ref{l:approx} once we guarantee that the hemispheres corresponding to $u_1$ and $u_2$ do not have too much overlap. \\ \smallskip The following lemma is the higher dimensional analogue of Lemma~\ref{l:3estimate} and contains the quantitative lower bounds for each of $\delta_A(r), \delta_B(r)$, and $\delta_C(r)$ discussed above. Since each of the right-hand sides of \eqref{eqn: deltaA est n}-\eqref{eqn: deltaC esta} are nonnegative, Lemmma~\ref{l:33estimate} in particular implies the monotonicity of $J(r)$. % \begin{lemma} \label{l:33estimate} For each $r\in (0,1]$ and $i=1,2$, let $\tilde{u}_{i,r}$ be the eigenfunction of $\Omega_i^r$ as above and let $\beta_{1,r}^i = \int_{{\partial} B_r } u_i \tilde{u}_{i,r}$. We have \begin{align} \label{eqn: deltaA est n} \delta_A(r) & \geq \sum_{i=1}^2 \ \frac{(\lambda_{2,r}^i -\lambda_{1,r}^i ) }{\int_{B_r}| {\nabla} u_i|^2} \int_{{\partial} B_r} \left(u_i-\beta_{1,r}^i \tilde{u}_{i,r} \right)^2\\ \label{eqn: delta b est n dim} \delta_B(r) & = \sum_{i=1}^2 \ \frac{1}{\int_{B_r}| {\nabla} u_i|^2} \int_{{\partial} B_r} \left( \frac{\alpha_i(r)}{r} u_i - {\partial}_r u_i\right)^2 \\ \label{eqn: deltaC esta} \delta_C(r) &\geq \sum_{i=1}^2 c(n)\frac{|\alpha_i(r) -1|^2}{r \max\{\alpha_i(r),2\}}, \end{align} with $c(n)$ a dimensional constant. \end{lemma} \begin{proof} The proof of \eqref{eqn: deltaA est n} is exactly the same as that of \eqref{eqn: deltaA est} of Lemma~\ref{l:3estimate}, and as in \eqref{eqn: deltaB est}, we recognize the integrand in $\delta_B(r)$ above as a square to see \eqref{eqn: delta b est n dim}. Observe that the inequality in \eqref{eqn: deltaC esta} is straightforward when $\delta_C(r)$ is large. Therefore, it suffices to consider the case when $\delta_C(r)$ is small. It also suffices to consider the case when $\Omega_1^r$ and $\Omega_2^r$ are both spherical caps. Indeed, let $\bar\alpha_1$ and $\bar \alpha_2$ denote the characteristic constants of disjoint spherical caps of the same volume as $\Omega_1^r$ and $\Omega_2^r$ respectively. Then by Sperner's inequality (recall \eqref{eqn: characteristic constant}), the corresponding $\delta_C(r)$ can only decrease for by replacing $\Omega_1^r$ and $\Omega_2^r$ by spherical caps, and also using the Friedland-Hayman inequality, we see \begin{equation}\label{eqn: linear est} \delta_C(r) =\frac{1}{r} \left( |\alpha_1-\bar \alpha_1| + |\alpha_2 - \bar \alpha_2| + \bar \alpha_1 + \bar \alpha_2 -2\right) \geq \frac{1}{r}\left( |\alpha_1-\bar \alpha_1| + |\alpha_2 - \bar \alpha_2|\right). \end{equation} That is, the deficit $\delta_C(r)$ controls $ |\alpha_1-\bar \alpha_1|$ {\it linearly}. Moreover, because the characteristic constant is monotone with respect to set inclusion, we may assume without loss of generality that we have two complementary caps. So, define the function $\hat{\alpha}:(0, 1)\to {\mathbb{R}}$ by letting $\hat{\alpha}(t)$ be the characteristic constant of the spherical cap of radius $r = 2\pi t$. Let $\hat{\delta}(h)= \hat{\alpha}(1/2 +h) + \hat{\alpha}(1/2 -h) -2$, so that by the Friedland-Hayman inequality we have $\hat{\delta}(h) \geq 0$. We claim that $\hat{\delta}(h)\geq c h^2$ for a universal constant $c$. It is known \cite{CaffSalsa, KochNYMJ} that $\hat{\alpha}$ is convex with $\hat{\alpha}''(1/2) = 2c>0$, where $c$ is a universal constant, and therefore there exists $h_0$ such that $\hat{\alpha}''(1/2 +h )\geq c$ for all $h$ with $|h|\leq h_0.$ For the moment, we assume that $|h|\leq h_0$. So, a Taylor expansion shows that \begin{align*} \hat{\alpha}(1/2+ h) &\geq \hat{\alpha}(1/2) + \hat{\alpha}'(1/2) h + \frac{c}{2}h^2 \end{align*} for any $h$ with $|h|\leq h_0$. Replacing $h$ by $-h$ and summing the corresponding terms, we conclude that $\hat{\delta}(h)\geq c h^2$ for all $|h|\leq h_0$. By the convexity of $\alpha$, it follows that $\hat{\delta}(h_1)\geq \hat{\delta}(h_0)$ for any $h_1 \geq h_0$. Therefore, by assuming that $\delta_C$ is small enough, we also have necessarily that $|h|< |h_0|$. Finally, since $\hat{\alpha} $ is a locally Lipschitz function, we have $|\alpha_i(r) -1| \leq h$, and arrive at \eqref{eqn: deltaC esta}. This concludes the proof. \end{proof} The following lemma is the higher dimensional analogue of Lemma~\ref{l:onehomogen}. Using the estimates for $\delta_B(r)$ and $\delta_C(r)$ in Lemma~\ref{l:33estimate}, this lemma shows that $u_1$ and $u_2$ are quantitatively close to being $1$-homogeneous. \begin{lemma} \label{l:onehomogen n} Let $u_1,u_2$ be as above. Then \[ \int_{B_1 \setminus B_{\rho}} [ru_i(1,\theta)-u_i(r,\theta)]^2 \leq C\log\left(\frac{J(1)}{J(\rho)}\right) \| u \|_{W^{1,2}(B_1)}^2. \] \end{lemma} \begin{proof}Fix $i \in \{1,2\}$. For notational simplicity, we omit the sub and superscripts $i$ in this proof. The proof follows the proof of Lemma \ref{l:onehomogen} using Lemma \ref{l:33estimate} but with $A(r)$ now defined as $ A(r):=e^{-\int_r^1 \frac{\alpha(t)}{t} \ dt}.$ \end{proof} In Lemma~\ref{l:33estimate}, we established a quantitative lower bound for $\delta_C(r)$ in term of the characteristic constants of the regions $\Omega^r_1$ and $\Omega_2^r$. In the following lemma, we prove some further quantitative estimates for $\delta_C(1)$ under the assumption that $\delta_C(1)$ is bounded above by one, which will be applied in the proof of Proposition~\ref{l:approximate2}. Recall that we let ${\mathcal{B}}$ denote an $(n-1)$-dimensional spherical cap. \begin{lemma} \label{l:fh} Assume that $\delta_C(1) \leq 1$ and fix $i=1,2$. Let $\bar {\mathcal{B}}_i \subset {\partial} B_1$ be a spherical cap such that $|\bar {\mathcal{B}}_i | = |\Omega_i^1|$, and let $\bar \lambda^i$ denote the first eigenvalue of $\bar {\mathcal{B}}_i$. There exists a constant $C(n)$ such that \begin{align}\label{eqn: char const quant} \delta_C(1) &\geq C\left( \left|\lambda^i_{1,1} - \bar \lambda^{i}\right| +\left| \bar \lambda^i - (n-1)\right|^2\right)\,. \end{align} \end{lemma} \begin{proof} We fix $i$ and suppress the dependence on $i$ and $r=1$ in the remainder of the proof. Let $\bar \alpha$ denote the characteristic constant of $\bar {\mathcal{B}}$. Note that if $\delta_C(1) \leq 1$ then by definition, $\alpha, \bar \alpha \leq 3$. We already showed in \eqref{eqn: linear est} in the proof of Lemma~\ref{l:33estimate} that $|\alpha - \bar \alpha|$ is linearly controlled by $\delta_C(1)$. This combined with \eqref{eqn: characteristic constant} shows the first estimate in \eqref{eqn: char const quant}: \begin{equation}\label{eqn: linear est eval} |\lambda - \bar \lambda| \leq (n-2) |\alpha-\bar \alpha| + |\alpha^2 -\bar \alpha^2| \leq C |\alpha-\bar \alpha| \leq C\delta_C(1). \end{equation} Similarly, it follows from the proof of Lemma~\ref{l:33estimate} that $|\bar\alpha-1|$ is quadradically controlled by $\delta_C(1)$, and using \eqref{eqn: characteristic constant} in the same way, we conclude the second estimate in \eqref{eqn: char const quant} holds. \end{proof} The next lemma shows that for $\delta_C(1)$ sufficiently small, the sets $\Omega_1^1$ and $\Omega_2^1$ enjoy a uniform spectral gap. \begin{lemma} \label{l:eigengap} Fix $\eta>0$. There exists $\varepsilon_0 = \varepsilon_0(\eta, n)$ such that if $\delta_C(1) \leq \varepsilon_0$, then $\lambda_2(\Omega_i^1) - \lambda_1(\Omega_i^1) \geq \eta$ for $i=1,2$. \end{lemma} \begin{proof} We argue by contradiction. Suppose we may find a sequence of functions $(u_{1,k}, u_{2,k})$ satisfying \eqref{eqn: harmonic functions} such that $\delta_{C,k}(1) \to 0$ and $\Omega_k :=\{ u_{1,k}>0\} \cap {\partial} B_1$ has $|\lambda_2(\Omega_k) - \lambda_1(\Omega_k)|\to 0$. By Lemma~\ref{l:fh}, we see that $|\lambda_1(\Omega_k) - (n-1)|\to 0$ and $|\lambda_1({\mathcal{B}}_k)- (n-1)|\to 0$, where ${\mathcal{B}}_k$ is a spherical cap with $|{\mathcal{B}}_k|=|\Omega_k|$. The first fact shows that $|\lambda_1(\Omega_k) -(n-1)|\to 0$, and the second ensures that $|\Omega_k| \to |{\mathcal{B}}_+|$, where ${\mathcal{B}}_+ \subset S^{n-1} $ denotes a hemisphere. Now, for each $k,$ let $\tilde{u}_{k,1}$ and $\tilde{u}_{k,2}$ respectively denote first and second eigenfunctions of $\Omega_k$, normalized to have $L^2$ norm equal to one and extended by zero to be defined on the entire sphere. So, there exist $\tilde{u}_{\infty, 1}, \tilde{u}_{\infty, 2} \in W^{1,2}(S^{n-1})$ such that after passing to a subsequence, \begin{align*} \tilde{u}_{k, 1} \to \tilde{u}_{\infty, 1} & \quad \text{ weakly in }W^{1,2}(S^{n-1}), \quad \text{strongly in }L^2(S^{n-1}), \quad \text{pointwise a.e.}, \\ \tilde{u}_{k, 2} \to \tilde{u}_{\infty, 2}& \quad \text{ weakly in }W^{1,2}(S^{n-1}), \quad \text{strongly in }L^2(S^{n-1}), \quad \text{pointwise a.e.}, \end{align*} and $ \int \tilde{u}_{\infty , 1} \cdot \tilde{u}_{\infty ,2 } = 0$. Let $\Omega = \{ \tilde{u}_{1, \infty} >0\}$. By lower semicontinuity of the norm, $\lambda_1(\Omega)\leq n-1$. By Fatou's lemma, $|\Omega| \leq \liminf |\{ \tilde{u}_{k,1} >0\}| = \lim |\Omega_k| =|{\mathcal{B}}_+|$. From Sperner's inequality and the monotonicity of $\lambda_1$ with respect to set inclusion, we see that up to a translation, $\Omega = {\mathcal{B}}_+$ and $\tilde{u}_{\infty ,1}$ is the first eigenfunction of ${\mathcal{B}}_+$. Now, let $\Omega_2 = \{ \tilde{u}_{2, \infty} >0\}$. The same argument and the uniqueness of the first eigenfunction show that $\tilde{u}_{\infty, 1} = \tilde{u}_{\infty, 2}$, contradicting their orthogonality. This completes the proof. \end{proof} \begin{lemma}\label{lem: caps} Fix a compact interval $[r_1,r_2] \subset (0,\pi)$, let $r_1 \leq r,\bar r \leq r_2$, and let ${\mathcal{B}},\bar {\mathcal{B}}\subset {\partial} B_1$ denote spherical caps of radius $r, \bar r$ centered at the north pole. Let $\lambda$ and $\bar \lambda$ denote the first eigenvalue of ${\mathcal{B}}$ and $\bar {\mathcal{B}}$ respectively, and let $v$ and $\bar v$ denote the corresponding first eigenfunctions extended by zero to be defined on the whole sphere and normalized so that $\| v\|_{L^2(S^{n-1})} = \| \bar v\|_{L^2(S^{n-1})} =1 $. There exist constants $C= C(r_1,r_2)$ and $\bar{c} = \bar{c}(r, \bar r)$ such that \[ \int_{S^{n-1}} |\bar{c}v- \bar v|^2 \leq C(\lambda - \bar \lambda)^2. \] \end{lemma} \begin{proof} The functions $v$ and $\bar v$ are radially symmetric, and so with a slight abuse of notation we let $v$, $\bar v$ denote the radial part of the functions. These functions can be extended to $(r, \pi)$, $(\bar{r}, \pi)$ to satisfy \begin{align*} v''(\phi) +(n-2)\frac{\cos\phi}{\sin \phi} v'(\phi)& = - \lambda v(\phi) \text{ for }\phi \in (0, \pi),\\ \bar v''(\phi) +(n-2)\frac{\cos\phi}{\sin \phi} \bar v'(\phi)& = - \bar \lambda \bar v(\phi) \text{ for }\phi \in (0, \pi),\\ \end{align*} with $v(r) = \bar v(\bar r) = 0$, $v'(0) = \bar v'(0) = 0$ and $v,\overline{v} \geq 0$ on $(0,r)$ and $(0,\overline{r})$ respectively. Setting $f_\lambda(t) =\bar c \,v(\cos^{-1}(t))$, where $\bar c $ is a constant to be chosen later in the proof, we see that $f_\lambda$ satisfies \[ (1-t^2)f_\lambda''(t)-(n-1)tf_\lambda'(t)+\lambda f_\lambda(t)=0, \] and likewise for $f_{\bar{\lambda}}(t) = \bar v (\cos^{-1}(t))$. The solutions to the above equation are Legendre functions and are well known. Expanding $\displaystyle v=\sum_{k=0}^{\infty} a_k(\lambda) (1-t)^k$ as a series solution about $t=1$ we obtain the recursion formula \begin{equation}\label{recursion} a_{k+1}(\lambda)= a_k(\lambda)\frac{k^2+(n-2)k-\lambda}{(k+1)(2k+n-1)}. \end{equation} The series converges absolutely on the interval $(-1,3)$. We normalize by choosing the zero order coefficient $\bar a_0$ for $ f_{\bar\lambda}$ to satisfy the constraint $\|\bar v\|_{L^2(S^{n-1})}=1$ and by choosing the zero order coefficient $a_0$ of $f_\lambda$ so that $a_0 = \bar a_0$, in this way determining the constant $\bar c$ in the statement of the lemma. Then \begin{equation}\label{eqn: ak} a_{k+1}(\lambda) = \prod_{j=0}^k \frac{j^2 + (n-2)j - \lambda}{(j+1)(2j+n-1)}. \end{equation} Taking the derivative of $\log a_{k+1}$ with respect to $\lambda$ we obtain \[ |a_{k+1}'(\lambda)| = |a_{k+1}(\lambda)| \sum_{j=0}^k \frac{1}{(j+1)(2j+n-1)} \leq M |a_{k+1}(\lambda)|. \] Furthermore, from \eqref{recursion}, we see that for any compact interval $I \in (0 ,\infty)$, there is a constant $C=C(I)$ such that $ |a_{k+1}(\lambda)| \leq C/2^k$ for all $\lambda \in I$. Therefore, $|a_{k+1}(\lambda) - a_{k+1}(\overline{\lambda})| \leq C |\lambda - \overline{\lambda}|/2^k$ for any $\lambda, \bar\lambda \in I$. Then summing over $k$ we obtain for any $t \in [0,t_0]$ with $t_0 < \pi$ that \[ |f_{\lambda}(t) - f_{\overline\lambda}(t)| \leq |\lambda - \overline{\lambda}| \sum_{k=0}^{\infty}\frac{C}{2^k} < C |\lambda - \overline{\lambda}|. \] The conclusion then follows after changing variables back to $\phi$ and integrating over ${\partial} B_1$. \end{proof} The next proposition is the higher dimensional analogue of Proposition~\ref{l:approximate2}. It shows that each of the $u_i$, $i=1,2$, is well approximated in $L^2$ by a linear function. \begin{proposition} \label{l:approx} There exist $\varepsilon_0 = \varepsilon_0 (n)$ and $C=C(n)$ such that the following holds. Assume $\log\left(\frac{J(1)}{J(\rho)}\right)\leq \varepsilon_0$ and $0 \leq \rho \leq 1/2$. Let $v$ be the first eigenfunction of the spherical cap of radius $\pi/2$ in ${\partial} B_1$, extended by $0$ to be defined on ${\partial} B_1$. For $i=1,2$ there exist $\beta_i = \beta_i(u_i)$ such that, up to a rotation, we have \[ \int_{B_1 \setminus B_{\rho}} \left(r\beta_i v - u_i \right)^2 \leq C \log\left(\frac{J(1)}{J(\rho)}\right) \| u_i \|_{W^{1,2}(B_1)}^2. \] \end{proposition} \begin{proof} Let $\varepsilon =\log(J(1)/J(\rho))$. Since $\varepsilon = \int_\rho^1 \log(J(r))'\,dr$ and the integrand is positive, it follows that $\log(J(r))' \leq 10\varepsilon$ outside a set of measure $\varepsilon/10$. In particular, $\log(J(r))' \leq 10 \varepsilon$ for some $r \in (1- \varepsilon/5, 1]$. By scaling we assume that $\log(J(r))'\leq \varepsilon$ at $r=1$. Fix $i \in \{1,2\}$. For the remainder of the proof, we omit subscripts $i$ for notational simplicity. Let $\Omega = {\partial} B_1 \cap \{u>0\}$ and let $\tilde{u}$ denote the first eigenfunction of $\Omega$, normalized so that $\| \tilde{u}\|_{L^2(\Omega)}=1$ and extended by zero to be defined everywhere on ${\partial} B_1.$ Let $\bar {\mathcal{B}} \subset {\partial} B_1$ denote a spherical cap centered at the north pole such that $|\bar {\mathcal{B}}| = |\Omega|$, and let $\bar v$ denote its first eigenfunction with the normalization $\| \bar v\|_{L^2(\bar {\mathcal{B}})} =1$ and extended by zero to be defined on the whole ${\partial} B_1.$ Up to a rotation, we may assume that the infimum over $x\in S^{n-1}$ in \eqref{eqn: stability statement} of Theorem~\ref{thm: quantitative sperner} is achieved at the north pole. Lemmas~\ref{l:fh} and \ref{l:eigengap} guarantee that for dimensional constants $c$ and $C$, \begin{equation}\label{eqn: useful n} \left|\lambda_1 - \lambda(\bar{\mathcal{B}})\right| \leq C\varepsilon, \qquad \left|\lambda_1(\bar {\mathcal{B}}) - (n-1)\right| \leq C\sqrt{\varepsilon}, \qquad \lambda_2 - \lambda_1\geq c, \end{equation} Let $\hat{\beta} = \beta_1 = \int_{{\partial} B_1} u \tilde{u}$ be as in \eqref{eqn: deltaA est n}, and let $\bar c$ be as in Lemma~\ref{lem: caps} applied to $r = \pi/2$ and the radius $\bar r $ of $\bar {\mathcal{B}}$. Let $\beta = \bar c \hat{\beta}$. We use the triangle inequality to see that \begin{equation}\label{eqn: starting point n} \begin{split} \int_{B_1\setminus B_\rho} (u - \beta r v)^2 & \leq 4\int_{B_1\setminus B_\rho} (u - ru(1,\theta))^2 +4\int_{B_1\setminus B_\rho} (ru(1,\theta) - \hat{\beta} r\tilde{u})^2\\ & + 4\hat{\beta}^2\int_{B_1\setminus B_\rho} (r\tilde{u} - r\bar v)^2 + 4 \hat{\beta}^2\int_{B_1\setminus B_\rho} ( r\bar v- r\bar{c} v)^2. \end{split} \end{equation} We can estimate the first two terms on the right-hand side of \eqref{eqn: starting point n} precisely the way we estimated their two-dimensional analogues in the proof of Proposition~\ref{l:approximate2}. Indeed, by Lemma~\ref{l:onehomogen n}, for the first term we have \begin{equation}\label{e1} 4\int_{B_1\setminus B_\rho} (u - ru(1,\theta))^2 \leq C \varepsilon \| u\|_{W^{1,2}(B_1)}^2. \end{equation} For the second term on the right-hand side of \eqref{eqn: starting point n}, we use the estimate \eqref{eqn: deltaA est n} for $\delta_A(1)\leq \varepsilon$ and the uniform eigenvalue gap of \eqref{eqn: useful n} to see that for a dimensional constant $C$ we have \begin{equation}\label{e2} 4\int_{B_1\setminus B_\rho} (ru(1,\theta) - \hat{\beta} r\tilde{u})^2 \leq C \int_{{\partial} B_1} (u(1,\theta) - \hat{\beta} \tilde{u})^2 \leq C\varepsilon\| u \|_{W^{1,2}(B_1)}^2 \,. \end{equation} To estimate the third term on the right-hand side of \eqref{eqn: starting point n}, we call upon the quantitative form of Sperner's inequality established in Theorem~\ref{thm: quantitative sperner}: \begin{equation}\label{e3} \begin{split} 4\int_{B_1\setminus B_\rho} r^2 (\tilde{u} - \bar v)^2 & \leq C \hat{\beta}^2 \int_{{\partial} B_1} (\tilde{u} - \bar v)^2\leq C\hat{\beta}^2 \left(\lambda_1 -\lambda_1(\bar {\mathcal{B}})\right) \leq C\varepsilon\| u\|_{W^{1,2}(B_1)}^2 , \end{split} \end{equation} where in the final inequality we recall \eqref{eqn: useful n} and that $\hat{\beta} \leq \| u\|_{L^2({\partial} B_1)} \leq C\| u\|_{W^{1,2}(B_1)}$. Finally, we estimate the fourth term in \eqref{eqn: starting point n}. Applying Lemma~\ref{lem: caps} with $r=\pi /2$ and $\bar r$ the radius of $\bar{\mathcal{B}}$ followed by \eqref{eqn: useful n}, we see that \begin{equation}\label{e4} \begin{split} 4\hat{\beta}^2 \int_{B_1\setminus B_\rho} ( r\bar v- r\bar v)^2 \leq C \hat{\beta}^2\int_{{\partial} B_1} (\bar v - c v)^2 &\leq C\hat{\beta}^2\left(\lambda_1(\bar {\mathcal{B}}) - (n-1)\right)^2\leq C\varepsilon\|u\|_{W^{1,2}(B_1)}^2. \end{split} \end{equation} Combining \eqref{e1}--\eqref{e4}, we conclude the proof of the proposition. \end{proof} We now prove Theorem~\ref{t:stability} in the case $n\geq 3$. \begin{proof}[Proof of Theorem~\ref{t:stability} for $n\geq 3$] Let $\epsilon_0$ be as in Proposition \ref{l:approx}. If $\log(J(1) / J(\rho)> \epsilon_0$, then we simply choose $\beta_i=\|u_i \|_{L^2(B_1)}$ and $\nu=e_1$, and the result follows trivially for large enough $C$. Let now $\varepsilon = \log(J(1) / J(\rho)$ and assume $\epsilon \leq \epsilon_0$. As in the proof of the two-dimensional case, Theorem~\ref{t:stability} almost follows from Proposition~\ref{l:approx}, but it remains to show that the truncated linear functions obtained for each of $u_1,u_2$ in Proposition~\ref{l:approx} can be taken to have disjoint supports. We also repeat the following notation from Proposition~\ref{l:approx}, now emphasizing the dependence on $i=1,2$: let $\Omega_i = \{ u_i> 0\} \cap {\partial} B_1,$ let $\bar {\mathcal{B}}_i \subset {\partial} B_1$ be the spherical cap of the same volume as $\Omega^i$ with center achieving the infimum over $x \in S^{n-1}$ in \eqref{eqn: stability statement} of Theorem~\ref{thm: quantitative sperner}, and ${\mathcal{B}}_i$ the hemisphere with the same center. We first show that \begin{equation}\label{eqn: sm diff} | {\mathcal{B}}_1 \Delta {\mathcal{B}}_2| \leq C\varepsilon^{1/2}. \end{equation} Indeed, we repeatedly apply the triangle inequality to find \[ | {\mathcal{B}}_1 \Delta {\mathcal{B}}_2| \leq \left(\left|{\mathcal{B}}_1 \Delta \bar {\mathcal{B}}_1\right| + \left|{\mathcal{B}}_2 \Delta \bar {\mathcal{B}}_2\right|\right) + \left( \left|\bar {\mathcal{B}}_1 \Delta \Omega_1\right| + \left|\bar {\mathcal{B}}_2 \Delta \Omega_2\right| \right) + \left| \Omega_1 \Delta \Omega_2\right|. \] Since the supports of $u_1$ and $u_2$ are disjoint, $| \Omega_1 \Delta \Omega_2| =0$. Next, we can apply Theorem~\ref{thm: quantitative sperner} to $\Omega_1$ and $\Omega_2$ and use \eqref{eqn: useful n} to see that \[ \left|\bar{{\mathcal{B}}}_1 \Delta \Omega_1\right| + \left|\bar {{\mathcal{B}}}_2 \Delta \Omega_2\right| \leq C \left( \lambda_1\left(\Omega_1 \right) - \lambda_1(\bar {\mathcal{B}}_2) \right)^{1/2} + \left(\lambda_1(\Omega_2) - \lambda_1 (\bar {\mathcal{B}}_2)\right)^{1/2} \leq C\varepsilon^{1/2}. \] Next, using \eqref{eqn: useful n}, we see that \[ \left|{\mathcal{B}}_1 \Delta \bar {\mathcal{B}}_1\right| + \left|{\mathcal{B}}_2 \Delta \bar {\mathcal{B}}_2\right| \leq C\left( \left| r_1 -\frac{\pi}{2}\right| - \left|r_2 - \frac{\pi}{2}\right|\right) \leq C\left(\left| \lambda_1(\bar {\mathcal{B}}_1) - (n-1) \right| + \left|\lambda_1(\bar{{\mathcal{B}}}_2) - (n-1)\right| \right)\leq C\varepsilon^{1/2}. \] Together these estimates prove the claim \eqref{eqn: sm diff}. Without loss of generality we may assume that ${\mathcal{B}}_2$ is centered at the south pole. Let $x_0$ be the center of ${\mathcal{B}}_1$; from \eqref{eqn: sm diff} it follows that $d(x_0, o)\leq C\varepsilon^{1/2}$ where $o$ is the north pole and $d(\cdot , \cdot)$ denotes the distance on the sphere. Let $w_1$ be the truncated linear function corresponding to $u_1$ provided by Proposition~\ref{l:approx} (so $w$ is defined in polar coordinates by $w(r,\theta) = \beta r v(\theta)$) and let $\tilde{w}_1$ be its rotation so that $\{ \tilde{w}_1>0\}\cap {\partial} B_1$ is the hemisphere centered at the north pole. Since $|w_1| \leq C\| u_1\|_{W^{1,2}(B_1)}$, we see that \begin{align*} \int_{B_1\setminus B\rho} | \tilde{w}_1 - u_1|^2 & \leq C \varepsilon \| u\|_{W^{1,2}(B_1)}^ 2 + \int_{B_1\setminus B\rho}| \tilde{w}_1 - w_1|^2 \\ &\leq C \varepsilon \| u\|_{W^{1,2}(B_1)}^ 2 + C \| u\|_{W^{1,2}(B_1)}^ 2 d(x_0, o)^2 \leq C \| u\|_{W^{1,2}(B_1)}^ 2\varepsilon . \end{align*} So, choosing $\tilde{w}_1$ and the truncated linear function $w_2$ corresponding to $u_2$ provided by Proposition~\ref{l:approx} completes the proof of the theorem. \end{proof} \subsection{Uniqueness of blow-ups when the ACF formula decays fast}\label{ssec: blowups} Here we sketch the proof of Corollary \ref{c:uniqueblowup}. The argument gives a precise modulus for the convergence of the blow-ups as well. \begin{proof}[Proof of Corollary \ref{c:uniqueblowup}.] We omit the subscripts $1, 2$ in $u_1, u_2$ below to simplify notation; any statement involving $u$ or $\beta$ is valid for both $u = u_1$ and $u = u_2$, up to replacing $(\nu \cdot x)^+$ by $(\nu \cdot x)^-$ if $i = 2$. For $k=0,1, 2,\dots,$ consider the rescalings $u^k(x) = \frac{u(2^{-k} x)}{2^{-k}}$. Recall that $\omega(r) = J(r) - J(0^+)$. We will show, by induction on $k$, that there are numbers $\beta^k>0$ and unit vectors $\nu_k\in S^{n-1}$ such that \begin{equation}\label{e:inductiveh} \int_{B_1 \setminus B} \left|u^k - \beta^k (\nu_k \cdot x)^+\right|^2 \leq C_1\, \omega(2^{-k}) \end{equation} and \begin{equation}\label{e:inductiveh2} \left|\beta^k - \beta^{k-1}\right|^2 + \left|\nu_k - \nu_{k-1}\right|^2 \leq C_2\, \omega(2^{-k-1}), \end{equation} where the constants $C_1$ and $C_2$ depend on $n$ and $\|u_i\|_{W^{1, 2}(B_1)}$ but are independent of $k$. For each $k$, the vector $\nu_k$ for $i=1$ will equal to $-\nu_k$ for $i=2$. For $k = 0$ this follows from a single application of Theorem \ref{t:stability}. Assume \eqref{e:inductiveh} and \eqref{e:inductiveh2} hold for all $j \leq k - 1$. Then we may apply Theorem \ref{t:stability} (with $\rho = 0$) to $u^k$, as $J[u_1^k, u_2^k]( r) = J[u_1,u_2]( 2^{-k}r) < 1 + \varepsilon$ by assumption: \[ \int_{B_1} |u^k - \beta^k (\nu_k \cdot x)^+|^2 \leq C \omega(2^{-k}) \sum_{i = 1}^2 \|u^k_i\|^2_{W^{1, 2}(B_1)}. \] The main point now is to estimate $\|u^k\|_{W^{1, 2}(B_1)}$ in a manner independent of $k$, and then show that $\beta^k$ is close to $\beta^{k-1}$ (and similarly for $\nu_k$). We apply the Caccioppoli inequality to $u^k$ to give \[ \|u^k\|_{W^{1, 2}(B_1)} \leq C \|u^k\|_{L^2(B_2)}, \] recalling they are subharmonic. From \eqref{e:inductiveh} with $k-1$, we have that \begin{align*} \|u^k\|_{L^2(B_2)} &= 2^{n/2+1} \|u^{k-1}\|_{L^2(B_1)} \\ &\leq 2^{n/2+1} \|u^{k-1} - \beta^{k-1} (\nu_{k-1} \cdot x)^+ \|_{L^2(B_1)} + C \beta_i^{k-1}\\ &\leq C\left[\sqrt{C_1 \omega(2^{-k-1})} + \beta^{k-1}\right]\\ &\leq C\left[\sqrt{C_1 \varepsilon} + \beta^{k-1}\right]. \end{align*} Now applying \eqref{e:inductiveh2} for every $j \leq k-1$, we have \begin{align*} \beta^{k-1} &\leq \beta^0 + \sum_{j = 1}^{k - 1}\big|\beta^{j} - \beta^{j-1}\big|\\ &\leq C\|u\|_{W^{1, 2}(B_1)} + \sqrt{C_2} \sum_{j = 1}^{k - 1} \sqrt{\omega(2^{-j-1})}\leq C\Big(1 + \int_0^{2^{-k-1}} \frac{\sqrt{\omega(r)}}{r}\Big) \leq C. \end{align*} Choosing $C_1$ large enough and then $\varepsilon$ small in terms of $C_1$ gives \[ \|u^k\|^2_{W^{1, 2}(B_1)} \leq C[C_1 \varepsilon + 1] \leq \frac{C_1}{2}. \] This implies \eqref{e:inductiveh} for $k$. To control $\beta^k$, we change variables: \[ \int_{B_{1/2}} \left|u^{k-1} - \beta^k (\nu_k \cdot x)^+\right|^2 = 2^{- n-2} \int_{B_1} \left|u^k - \beta^k (\nu_k \cdot x)^+\right|^2 \leq C \omega(2^{-k}). \] Then \[ \int_{B_{1/2}} \left|\beta^k (\nu_k \cdot x)^+ - \beta^{k-1} (\nu_{k-1} \cdot x)^+\right|^2 \leq C \omega(2^{-k-1}) \] by combining with \eqref{e:inductiveh} with $k-1$. Direct evaluation leads to \[ |\beta^k - \beta^{k-1}|^2 + |\nu_k - \nu_{k-1}|^2 \leq C_2 \omega(2^{-k-1}), \] and so \eqref{e:inductiveh2} holds for $k$. We are now in a position to conclude. From \eqref{e:inductiveh2} the numbers $\beta^k$ and vectors $\nu^k$ have \[ \sum_{k=0}^\infty |\beta^k - \beta^{k-1}| + |\nu_k - \nu_{k-1}| \leq C (\varepsilon + \int_0^1 \frac{\sqrt{\omega(r)}}{r}dr) < \infty, \] so the sequences converge to some $\beta_i, v$. Set \[ \tilde{\omega}(r) = \omega(r) + \int_0^{2 r} \frac{\sqrt{\omega(r)}}{r}dr, \] which a nondecreasing function tending to $0$ at $0$. Then from \eqref{e:inductiveh}, \[ \int_{B_1} |u^k - \beta (v \cdot x)^+|^2 \leq C \tilde{\omega}(2^{-k}), \] and so changing variables, \[ 2^{(n + 2)k} \int_{B_{2^{-k}}} |u - \beta (\nu \cdot x)^+|^2 \leq C \tilde{\omega}(2^{-k}). \] This may be rewritten to give \[ \frac{1}{r^{n+2}} \int_{B_{r}} |u - \beta (v \cdot x)^+|^2 \leq C\tilde{\omega}(2 r) \rightarrow 0, \] concluding the proof. \end{proof} \section{Quantitative stability for the Faber-Krahn inequality}\label{sec: sperner} We now turn toward the proof of the quantitative Faber-Krahn inequality, Theorem~\ref{thm: quantitative sperner}. As we discussed in the introduction, the proof is essentially identical in the cases of the round sphere, Euclidean space, and hyperbolic space. To keep the notation from becoming unreasonably heavy, we will therefore present the proof in case of the round sphere, and include remarks throughout the proof guiding the reader through any modifications needed to generalize the proof to Euclidean or hyperbolic spaces. All three simply connected space forms share the property that balls centered at {\it any } point minimize the first eigenvalue. It it clear, then, that any stability statement must involve the distance to a nearby ball to $\Omega$. In \eqref{eqn: stability statement}, we chose to ``mod out'' by this symmetry by taking the infimum over all $x$ in the space of the distance to balls $B(x)$ centered at $x$. It turns out to be more convenient to prove the slightly stronger statement given below as Theorem~\ref{thm: quantitative sperner restated}, in which we get rid of the translational invariance by choosing a particular ``set center'' of a given set $\Omega$, defined in the following way. Consider the standard embedding of the round sphere $S^{n}(1) \subset {\mathbb{R}}^{n+1}$ and let $y_\Omega = \fint_{\Omega} y \,d{\rm{vol}}_g(y) \in {\mathbb{R}}^{n+1}$. Provided $y_\Omega\neq 0$, we define the {\it set center} $x_\Omega$ of $\Omega$ by \[ x_\Omega = \frac{y_\Omega}{|y_\Omega|} \] It is worth noting that there are other possible ways that one may define a notion of ``barycenter'' of a set $\Omega \subset S^{n}$. Another possible notion is given in \cite{BDF17}. \\ Throughout this section, given a set $\Omega \subset S^{n}$, we let $u_\Omega$ denote its first eigenfunction extended by $0$ to be defined on all of $S^{n}$ and normalized so that $\| u_\Omega\|_{L^2(\Omega)}=1$. \begin{theorem}\label{thm: quantitative sperner restated} Fix $n\geq 1$ and $v \in (0, |S^{n}|)$. There exists a constant $c=c(n,v)$ such that the following holds. Let $\Omega\subset S^{n}$ with $|\Omega|=v$ be a set for which $x_\Omega\in S^{n}$ is defined. Letting $B$ denote the spherical cap centered at $x_\Omega$ with $|B|=v$, we have \begin{equation}\label{eqn: stability statement sec 3} \lambda_1(\Omega) - \lambda_1(B) \geq c \left( |\Omega \DeltaB|^2 + \int_{S^{n}} |u_\Omega - u_B|^2 \right) \,. \end{equation} \end{theorem} \smallskip \begin{remark}[Sets with no barycenter]{\rm The statement of Theorem~\ref{thm: quantitative sperner restated} may look restrictive compared to Theorem~\ref{thm: quantitative sperner}. However, if $\Omega$ is a set for which the barycenter is not defined, then necessarily $\lambda_1(\Omega) - \lambda_1(B ) \geq c$, and so \eqref{eqn: stability statement} holds trivially in this case. In particular, Theorem~\ref{thm: quantitative sperner restated} implies Theorem~\ref{thm: quantitative FK general} in the case of the round sphere. } \end{remark} \begin{remark}[Set centers on Euclidean space and hyperbolic space] \rm{ On Euclidean space, an open set $\Omega \subset {\mathbb{R}}^n$ has a uniquely defined barycenter $x_\Omega = \fint_\Omega x \,dx$. For an open set $\Omega \subset H^n$ in hyperbolic space, the set center $x_\Omega = \text{argmin}_{x_0 \in H^n} \int_{\Omega} d(x, x_0)^2 \, d{\rm{vol}}(x) $ is well defined. The analogues of Theorem~\ref{thm: quantitative sperner restated} hold in each of these two spaces with $x_\Omega$ defined in this way; the proof will be identical up to the obvious modifications. Once more, the analogues of Theorem~\ref{thm: quantitative sperner restated} for Euclidean and hyperbolic space imply Theorem~\ref{thm: quantitative FK general} on these space forms. } \end{remark} We will work in spherical coordinates $(\theta, \phi) \in S^{n-1} \times (0, \pi)$ on $S^{n}$, in which the round metric takes the form $g_{S^n} = d\phi^2 + \sin^{2}(\phi)d\theta^2$, where $d\theta^2$ is used to denote the round metric on $S^{n-1}$. A point $(\theta, \phi) \in S^{n}$ has geodesic distance $\phi$ to the north pole $o \in S^{n}$. The Laplacian of a function $f$ in spherical coordinates $(\theta,\phi)$ is given by \begin{equation}\label{eqn: laplace in spherical} \Delta_{S^{n}} f(\theta,\phi) = (\sin \phi)^{1-n} \frac{\partial }{\partial \phi} \left((\sin \phi)^{n-1} \frac{\partial f}{\partial \phi}\right) + (\sin \phi)^{-2} \Delta_{S^{n-1}} f. \end{equation} \begin{remark}[Coordinates on hyperbolic space and Euclidean space]{\rm On hyperbolic space, we similarly use polar coordinates $(\theta ,\phi)$, so that the metric is expressed in these coordinates by $g_{hyp} =d\phi^2 + \sinh^{2}(\phi) d\theta^2$, where once more we let $d\theta^2$ denote the round metric on $S^{n-1}$. A point $(\theta ,\phi ) \in H^n$ has geodesic distance $\phi$ from the distinguished point from which the polar coordinates are centered. The Laplacian of a function $f: H^n\to {\mathbb{R}}$ in these coordinates is given by \[ \Delta_{H^n} f(\theta, \phi) = (\sinh \phi)^{1-n} \frac{\partial }{\partial \phi} \left((\sinh \phi)^{n-1} \frac{\partial f}{\partial \phi}\right) + (\sinh \phi)^{-2} \Delta_{S^{n-1}} f. \] On Euclidean space we use standard polar coordinates $(\theta ,\phi)$, where $\phi$ is the distance to the origin and the Laplacian of a function $f: {\mathbb{R}}^n \to {\mathbb{R}}$ is given by . \[ \Delta_{{\mathbb{R}}^n} f(\theta, \phi) = \phi^{1-n} \frac{\partial }{\partial \phi} \left(\phi^{n-1} \frac{\partial f}{\partial \phi}\right) + \phi^{-2} \Delta_{S^{n-1}} f. \] }\end{remark} Throughout this section, we will use the shorthand $B_\rho = B(o,\rho)$ to denote the spherical cap of radius $\rho$ centered at the north pole. We will frequently make the identification of the boundary of a geodesic ball, ${\partial} B(o,\rho)$, with the sphere $S^{n-1}$, noting that the induced metric on ${\partial} B(o,\rho)$ is $\sin^2(\rho) d\theta^2$, where $d\theta^2$ is the round metric on $S^{n-1}$. We proceed in two steps: in Section~\ref{sec: NSS}, we establish Theorem~\ref{thm: quantitative sperner restated} for sets that are small perturbations of a spherical cap, and in Section~\ref{sec: SP}, we call upon results from our companion paper \cite{AKN1} to conclude Theorem~\ref{thm: quantitative sperner restated} in the general case. \medskip \subsection{Stability for nearly spherical sets}\label{sec: NSS} The main goal of this section is to establish Theorem~\ref{prop: quantitative for nearly spherical sets} below, which is Theorem~\ref{thm: quantitative sperner restated} restricted to a class of sets in $S^{n}$ that are small $C^{2,\alpha}$ perturbations of spherical caps. The class of {\it nearly spherical sets} given in the following definition will be our main objects of interest in this section. \begin{definition} Given $\rho \in (0,\pi)$ and $\xi\in C^{2,\alpha}({\partial} B_\rho)$ with $\| \xi\|_{C^{2,\alpha}({\partial} B_\rho)} \leq \varepsilon,$ we define the following: \begin{enumerate} \item A set $\Omega\subset S^{n}$ is parametrized by $\xi$ over $B_\rho$ if in spherical coordinates ${\partial} \Omega$ takes the form \begin{align*} \label{eq: def: NSS} {\partial} \Omega &= \{ (\theta, (1 + \xi(\theta))\rho) : (\theta,\rho) \in {\partial} B_\rho\}. \end{align*} \item A set $\Omega \subset S^{n}$ is a nearly spherical set if $\Omega$ is parametrized by $\xi$ over $B_\rho$ such that $|\Omega| = |B_\rho|$ and the barycenter $x_\Omega$ of $\Omega$ is the north pole $o$. \end{enumerate} \end{definition} Note that the barycenter of a set parametrized over $B_\rho$ is always defined provided that $\varepsilon$ is taken to be sufficiently small depending on $n$ and $\rho$. The following theorem establishes quantitative stability for Sperner's inequality among nearly spherical sets. \begin{theorem}[Quantitative stability for nearly spherical sets]\label{prop: quantitative for nearly spherical sets} Fix $n\geq 2$ and $\gamma\in (0,\pi/2)$. There exist postitive constants $c$ and $\varepsilon$ depending only on $n$ and $\gamma$ such that the following holds. Let $|\rho -\pi/2|<\gamma$ and let $\Omega$ be a nearly spherical set parametrized by $\xi$ over $B_\rho$ with $\|\xi\|_{C^{2,\alpha}({\partial} B_\rho)} \leq \varepsilon$. Then \begin{equation}\label{eqn: stability statement sec 3 repeat} \lambda_1(\Omega) - \lambda_1(B_\rho) \geq c \left( |\Omega\Delta B_\rho|^2 + \int_{S^{n}} |u_\Omega - u_{B_{\rho}}|^2 \right)\,. \end{equation} \end{theorem} The basic idea of the proof of Theorem~\ref{prop: quantitative for nearly spherical sets} is the following. In Section~\ref{ssec: 2nd var}, we show that the deficit $\lambda_1(\Omega) - \lambda_1(B_\rho)$ of a nearly spherical set is equivalent to the second variation of $\lambda_1(B_\rho)$, up to an error that can be made arbitrarily small by taking $\|\xi\|_{C^{2,\alpha}({\partial} B_\rho)}$ to be small; see Theorem~\ref{lem: second var and deficit}. Section~\ref{ssec: gap} contains the core of proof of Theorem~\ref{prop: quantitative for nearly spherical sets}: in Theorem~\ref{t:gap} we establish a gap in the spectrum for the second variation operator. As we discuss in the introduction, this spectral analysis is carried out through an implicit argument based on the maximum principle. Theorem~\ref{t:gap} is then applied in Theorem~\ref{th: deficit controls H1/2} to show that the deficit $\lambda_1(\Omega) - \lambda_1(B_\rho)$ of a nearly spherical set controls the $H^{1/2}$ norm of the parametrizing function $\xi$. Finally, in Proposition~\ref{prop: control efunc} below of Section~\ref{ssec: h12 and distance}, we show that the right-hand side of \eqref{eqn: stability statement} is controlled linearly by $ \| \xi\|_{H^{1/2}({\partial} B)}^2$. Recall that the $H^{1/2}$ seminorm of a function $\xi:{\partial} B_\rho \to {\mathbb{R}}$ is defined by $ \| \xi \|_{\dot{H}^{1/2}({\partial} B_\rho)}^2 = \int_{B_\rho} |{\nabla} h_\xi|^2, $ where $h_\xi$ is the harmonic extension of $\xi$, i.e. the unique solution to \begin{equation}\label{eqn: harmonic extension} \begin{cases} \Delta h_\xi = 0 & \text{ in }B_\rho\\ h_\xi = \xi & \text{ on } {\partial} B_\rho. \end{cases} \end{equation} The $H^{1/2}$ norm of a function $\xi:{\partial} B_\rho \to {\mathbb{R}}$ is defined by $\| \xi\|_{H^{1/2}({\partial} B_\rho)}^2 = \| \xi\|_{L^2({\partial} B_\rho)}^2 + \| \xi \|_{\dot H^{1/2}({\partial} B_\rho)}^2$. Among functions $\xi \in H^{1/2}({\partial} B_{\rho})$ with $\int_{{\partial} B_\rho}\xi = 0$, the $H^{1/2}$ norm and seminorm are equivalent.\\ \medskip \subsubsection{The deficit and the second variation}\label{ssec: 2nd var} The first eigenfunction $u_{B_\rho}$ of a spherical cap $B_\rho$ is radially symmetric and decreasing. We let $u_\rho(\phi) = u_{B_\rho}(\theta,\phi)$ and note that $|{\nabla} u_{B_\rho}(\theta,\phi)|= -u_\rho'(\phi)= |u_\rho'(\phi)|.$ In the sequel, we will use the shorthand $|u_\rho'|$ to refer to number $|u_\rho'(\rho)|>0$ and will let $\lambda_\rho = \lambda_1(B_\rho)$. Given a function $\xi \in H^{1/2}({\partial} B_{\rho})$ with $\int_{{\partial} B_{\rho}} \xi =0$, let $w_\xi:B_\rho \to {\mathbb{R}}$ be the solution to \begin{equation}\label{eqn: eigenvalue pb extension} \begin{cases} -\Delta w_\xi = \lambda_{\rho} w_\xi & \text{ in } B_{\rho}\\ \ \ \ \ \ w_\xi = |u_\rho'| \xi & \text{ on } {\partial} B_{\rho}\\ \int_{B_\rho} w_\xi u_{B_\rho}= 0. \end{cases} \end{equation} Such a solution exists and is unique by the Fredholm Alternative and is continuous by \cite{GT}. For such a function $\xi$, the second variation $\delta^2 \lambda_1(B_\rho)[\xi, \xi ]$ of $\lambda_1$ at $B_\rho$ in the direction $[\xi, \xi]$ is given by \begin{equation}\label{eqn: second variation} \delta^2 \lambda_1(B_\rho)[\xi, \xi ] = 2 \int_{B_\rho} \left(|{\nabla} w_\xi|^2 - \lambda_{\rho} w_\xi^2\right) \, dx + \mathcal{H}_{B_\rho} |u_\rho'|^2\int_{{\partial} B_\rho} \xi^2 \, d\sigma. \end{equation} Here $\mathcal{H}_{B_\rho} $ is the scalar mean curvature of ${\partial} B_{\rho}$ with the sign convention that $\mathcal{H}_{B_\rho} >0$ for $\rho < \pi/2$ and $\mathcal{H}_{B_\rho} <0 $ for $\rho \in (\pi/2, \pi).$ On Euclidean space and hyperbolic space, the second variation takes the analogous form. Let $L_\rho:H^{1/2}({\partial} B_\rho)\cap \{ \int_{{\partial} B_\rho} \xi = 0\} \to L^2({\partial} B_\rho)$ denote the Dirichlet-to-Neumann map corresponding to the problem \eqref{eqn: eigenvalue pb extension} translated by the zero order term $\frac{1}{2}\mathcal{H}_{B_\rho} |u_\rho'|^2$. More specifically, given $\xi \in H^{1/2}({\partial} B_\rho)$ with $\int_{{\partial} B_\rho} \xi =0$, define \begin{equation}\label{eqn: def DtoN} L_{\rho}\xi = {\partial}_\nu w_\xi + \frac{1}{2}\mathcal{H}_{B_\rho} |u_\rho'|^2 \xi, \end{equation} where $w_\xi$ is the unique solution to \eqref{eqn: eigenvalue pb extension} and $\nu$ is the outer unit normal to $B_\rho$. In this way, we can express the second variation on the ball as \[ \delta^2 \lambda_1(B_\rho)[\xi, \xi ] = 2 \int_{{\partial} B_\rho} \xi L_{\rho}\xi . \] The following theorem shows that the deficit in Sperner's inequality for a nearly spherical set is equal to the second variation, up to an error depending on $\|\xi\|_{C^{2,\alpha}({\partial} B_\rho)}$. \begin{theorem}\label{lem: second var and deficit} Fix $\gamma\in(0,\pi/2)$. There is a modulus of continuity $\omega$ depending only on $n$ and $\gamma$ such that the following holds. Fix $\rho$ with $|\pi/2-\rho|<\gamma$ and let $\Omega \subset S^{n}$ be a set parametrized by $\xi$ over $B_\rho$ with $|\Omega| =|B_\rho|.$ Setting $\hat{\xi} = \xi - \int_{{\partial} B_\rho} \xi,$ we have \begin{equation} \lambda_1(\Omega) - \lambda_1(B_\rho) = \frac{1}{2}\delta^2\lambda_1(B_\rho)\big[\hat{\xi},\hat{\xi}\big] +\omega\left(\|\hat{\xi}\|_{C^{2,\alpha}({\partial} B_\rho)}\right) \| \hat{\xi} \|_{H^{1/2}({\partial} B_\rho)}^2. \end{equation} \end{theorem} Theorem~\ref{lem: second var and deficit} was established in the Euclidean setting in \cite[Theorem 1]{d02} (see also \cite[Theorem 1.4]{dl19} for the $C^{2,\alpha}$ norm replaced by the $W^{2,p}$ norm for $p>n$). Adapting the proof to the spherical and hyperbolic settings requires only technical modifications, which we omit. \begin{remark}\label{rmk: volume constraint} {\rm For a function $\xi \in H^{1/2}({\partial} B_\rho)$ with nonzero mean, the Fredholm Alternative implies that no solution exists to the problem \eqref{eqn: eigenvalue pb extension} (even without the orthogonality constraint $\int_{B_\rho} w_\xi u_{B_\rho} =0$), and for this reason the second variation is only defined for mean zero functions. However, for a nearly spherical set $\Omega$, a Taylor expansion of the volume constraint shows that \[ 0 = |\Omega| - |B_\rho| = \int_{{\partial} B_{\rho}} \xi + o(\|\xi\|_{L^2({\partial} B_{\rho})}); \] see, for instance, \cite{BDF17}. This implies that $\| \xi -\hat{\xi}\|_{L^2({\partial} B_\rho)} = o(\|\xi\|_{L^2({\partial} B_\rho)})$. In particular, $\| \xi\|_{H^{1/2}({\partial} B_\rho)} = \| \hat{\xi}\|_{H^{1/2}({\partial} B_\rho)} + o(\|\xi\|_{L^2({\partial} B_\rho)})$ and \[ \frac{1}{2}\|\xi\|_{C^{2,\alpha}({\partial} B_\rho)} \leq \|\hat{\xi}\|_{C^{2,\alpha}({\partial} B_\rho)} \leq 2\|\xi\|_{C^{2,\alpha}({\partial} B_\rho)}. \] Therefore, the conclusion of Theorem~\ref{lem: second var and deficit} above may be equivalently written as \begin{equation} \lambda_1(\Omega) - \lambda_1(B_\rho) = \frac{1}{2}\delta^2\lambda_1(B_\rho)\big[\hat{\xi},\hat{\xi}\big] +\omega\left(\|\xi\|_{C^{2,\alpha}({\partial} B_\rho)}\right) \| \xi \|_{H^{1/2}({\partial} B_\rho)}^2. \end{equation} } \end{remark} \medskip \subsubsection{The spectral gap}\label{ssec: gap} We study the spectrum of the shifted Dirichlet-to-Neumann operator $L_{\rho}$ introduced in \eqref{eqn: def DtoN} and establish a spectral gap in Theorem~\ref{t:gap} below. In contrast to the Euclidean case, the spectrum cannot be computed explicitly and therefore the spectral analysis replies on implicit methods based on the maximum principle. We let $\{Y_i\}_{i=0}^\infty$ be the orthonormal basis for $L^2({\partial} B_\rho) $ of spherical harmonics, i.e. solutions to the eigenvalue equation $\Delta_{S^{n-1}} Y_i= -\mu_i Y_i$, or equivalently $ \Delta_{{\partial} B_\rho} Y_i = -\sin^{-2}(\rho)\mu_i Y_i$, on ${\partial} B_\rho$ with each $Y_i$ normalized so that $\int_{{\partial} B_\rho} Y_i^2 =1.$ The eigenfunctions are ordered such that $\mu_i \leq \mu_{i+1}$ for all $i$. Recall that \begin{equation}\label{eqn: laplace eigenvalues} \begin{split} \mu_0 &= 0\\ \mu_1 & =\dots = \mu_{n} = (n-1)\\ \mu_{n+1} &= 2n. \end{split} \end{equation} The unique spherical harmonic corresponding to $\mu_0=0$ is constant, and thus for each $i\geq 1$ we have \begin{equation} \label{e:fredholm} \int_{{\partial} B_\rho} Y_i =0. \end{equation} We let $w_i$ denote the solution of \eqref{eqn: eigenvalue pb extension} with $\xi = Y_i$. That is, $w_i\in H^1(B_\rho)\cap C(B_{\rho})$ is the unique solution to \begin{equation}\label{eqn: eigenvalue pb extension Yi} \begin{cases} -\Delta w_i = \lambda_{B_\rho} w_i & \text{ in } B_{\rho}\\ \ \ \ \ w_i = |u_\rho'|Y_i & \text{ on } {\partial} B_{\rho}\\ \int_{B_\rho} w_i u_{B_\rho} = 0. \end{cases} \end{equation} The following lemma shows that the solutions $w_i$ take a particular form that will be crucial to our spectral analysis. \begin{lemma}\label{lem: efns} For each $i\geq 1$, the unique solution $w_i$ of \eqref{eqn: eigenvalue pb extension Yi} takes the form \begin{equation} \label{eqn: wi form} w_i(\phi, \theta)=Y_i(\theta)g_i(\phi) \end{equation} in spherical coordinates, and $g_i$ satisfies the following three properties: \[ \begin{aligned} &(1) \quad g_i(0)=0 \\ &(2) \quad g_i(\rho) =|u_\rho'|\\ &(3) \quad g_i(\phi)>0 \text{ for } 0<\phi <\rho. \end{aligned} \] \end{lemma} \begin{proof} Fix $i \geq 1$ and the corresponding spherical harmonic $Y_i$ and solution $w_i$ of \eqref{eqn: eigenvalue pb extension Yi}. We omit the subscript $i$ in the remainder of this proof for notational simplicity. Let us make the ansatz that $w$ takes the form \eqref{eqn: wi form} in spherical coordinates. Then $w(\theta, \rho) =Y(\theta) g(\rho)$ on ${\partial} B_\rho$, so $w$ satisfies the boundary condition in \eqref{eqn: eigenvalue pb extension Yi} provided $g(\rho)=|u_\rho'|.$ Furthermore, thanks to the orthogonality \eqref{e:fredholm}, we have \begin{align*} \int_{B_\rho } w\, u_{B_{\rho}} & = \int_0^{\rho} \left( \int_{S^{n-1}} Y(\theta)\,d\mathcal{H}^{n-1}(\theta)\right) u_\rho(\phi) g(\phi)\, \sin(\phi)^{n-1} \, d\phi =0, \end{align*} so $w$ satisfies the orthogonality condition in \eqref{eqn: eigenvalue pb extension Yi}. Finally, from the expression \eqref{eqn: laplace in spherical} for the Laplacian of a function $f$ in spherical coordinates $(\theta,\phi)$, we see that $g(\phi)$ satisfies the ordinary differential equation \begin{equation} \label{e:legendre} \frac{d^2 g}{d \phi^2} + (n-1) \frac{\cos \phi}{\sin \phi} \frac{d g}{d \phi} + \left(\lambda_{\rho} - \frac{\mu}{\sin^2 \phi} \right)g =0. \end{equation} Under the change of variable $t=\cos \phi$, the solution $g$ is a solution to the associated Legendre equation, which are well-known special functions. Thus, up to choosing a constant multiple of $g$ so that the boundary condition is satisfied, this function is the unique $H^1(B_\rho)$ solution of \eqref{eqn: eigenvalue pb extension}. Next we verify properties (1)--(3). Property (2) holds by our choice of constant multiple of $g$. As a solution of \eqref{eqn: eigenvalue pb extension Yi}, $w$ is nonconstant and continuous, so it follows that $g(0)=0$ and thus $(1)$ holds. Finally, to show (3), we suppose by way of contradiction that $g(\rho_1)=0$ for some $0<\rho_1<\rho$. Then we see that $w\in H^1_0(B_{\rho_1})$ solves \[ \frac{\int_{B_{\rho_1}} |\nabla w|^2}{ \int_{B_{\rho_1}} w^2} = \lambda_{\rho}. \] Thus, $\lambda_{\rho_1} \leq \lambda_{\rho}$; however, since $B_{\rho_1} \subset B_{\rho}$ we have that $\lambda_{\rho} < \lambda_{\rho_1}$. This gives a contradiction and we see that $g$ is nonvanishing in $(0,\rho)$. Together with (2) this proves (3). \end{proof} Using Lemma~\ref{lem: efns}, we show in the following corollary that the spherical harmonics for $i\geq 1$ are eigenfunctions of the Dirichlet-to-Neumann operator \eqref{eqn: def DtoN}. \begin{corollary}\label{cor: eigenfunctions} Each spherical harmonic $Y_i$ for $i\geq 1$ is an eigenfunction of the Dirichlet-to-Neumann operator $L_{\rho}$ defined in \eqref{eqn: def DtoN} with eigenvalue $\eta_i$ given by \begin{equation} \label{eqn: eta def} \eta_i = g_i'(\rho)+\frac{1}{2}\mathcal{H}_{B_\rho} |u_\rho'|^2, \end{equation} where $g_i$ is the function given in Lemma~\ref{lem: efns}. If $\mu_i = \mu_{i+1}$, then $\eta_i = \eta_{i+1}$. Furthermore, $\eta_i \geq0 $ for all $ i \in \mathbb{N}$ and $\eta_i =0$ for $i=1,\dots , n$. \end{corollary} \begin{proof} Making use of Lemma~\ref{lem: efns}, we compute that $L_{\rho}Y_i = g_i'(\rho) Y_i + \frac{1}{2}\mathcal{H}_{B_\rho} |u_\rho'|^2Y_i $ where $g_i$ is the solution to \eqref{e:legendre} found in Lemma~\ref{lem: efns}. In particular, $Y_i$ is an eigenfunction of $L_{\rho}$ with eigenvalue $\eta_i$ as in \eqref{eqn: eta def}. If $\mu_i = \mu_{i+1}$, then we see from \eqref{e:legendre} that $g_i = g_{i+1}$ and thus $\eta_i = \eta_{i+1}$ by \eqref{eqn: eta def}. The next two claims follow from geometric considerations. Suppose by way of contradiction that $\eta_i<0$ for some $i\geq 1$. For $t>0$ and small, let $\Omega_t $ be the set parametrized by $\xi_t$ over $B_\rho$ where $\xi_t = tY_i + s(t) Y_0$ and $s(t)$ is the function defined such that $|\Omega_t|= |B_\rho|$. By Sperner's inequality and Theorem~\ref{lem: second var and deficit}, \begin{align*} 0 \leq \lambda_1(\Omega_t) - \lambda_1(B_\rho) &= t^2 \eta_i + t^3\omega\left (\| Y_i\|_{C^{2,\alpha}({\partial} B_\rho)}\right)\|Y_i\|_{H^{1/2}({\partial} B_\rho)}^2 \leq \frac{t^2}{2}\eta_i <0, \end{align*} where the penultimate inequality holds for $t$ sufficiently small depending on $Y_i$. We reach a contradiction and conclude that $\eta_i \geq 0$ for all $i\geq 1$. We sketch the proof that $\eta_i = 0$ for $i=1,\dots, n$. Note that $\eta_1=\dots \eta_{n-1}$ by \eqref{eqn: laplace eigenvalues} so it suffices to show that $\eta_1=0$. Let $e_1 \dots, e_{n+1} $ be an orthonormal basis for ${\mathbb{R}}^{n+1}$. Consider the standard embedding of $S^{n}$ in ${\mathbb{R}}^{n+1}$ such that the north pole is $e_{n+1}$. The spherical harmonic $Y= Y_1$ is the restriction to ${\partial} B_\rho$ of the linear function $x \cdot e_1$ on ${\mathbb{R}}^{n+1}$. For $t \in (-\varepsilon ,\varepsilon)$, let $x_t = {\rm exp}(te_1)$ and let $\Omega_t = B(x_t, \rho)$. For $t$ sufficiently small, there is a smooth and uniquely defined one-parameter family of functions $\xi_t$ such that \[ {\partial} \Omega_t = \{ (\theta, (1+ \xi_t(\theta))\rho ) \ : \ (\theta , \rho) \in {\partial} B_\rho\} \] in spherical coordinates. Moreover, for $t$ sufficiently small, $\xi_t $ takes the form $ \xi_t = \sum_{i=0}^\infty a_i(t) Y_i $ with \[ a_1(t) =t/\rho, \qquad \text{ and } \qquad \frac{d}{dt}\big|_{t=0} a_i(t) = \lim_{t\to 0} a_i(t) /t= 0 \text{ for } i \neq 1. \] Because $\lambda_1(\Omega_t) =\lambda_1(B_\rho)$ for all $t$, we have, in particular, \begin{equation}\label{eqn: 2nd der} \frac{d^2}{dt^2} \lambda_1 (\Omega_t) =0 \end{equation} for all $t$ sufficiently small. The expression for second variation at $\Omega_t$ changes smoothly with respect to $t$. So, dividing \eqref{eqn: 2nd der} by $t^2$ and letting $t \to 0$, we use the expression \eqref{eqn: second variation} to arrive at \[ 0 = \lim_{t \to 0}\ \frac{1}{t^2} \left(\frac{d^2}{dt^2} \lambda_1(\Omega_t)\right) = \lim_{t \to 0} \ \sum_{i=1}^\infty \eta_i \left(\frac{a_i(t)}{t}\right)^2 = \eta_1. \] This concludes the proof of the corollary. \end{proof} Corollary~\ref{cor: eigenfunctions} shows that $Y_1,\dots, Y_{n}\in \ker L_\rho.$ The following theorem is the key point in our spectral analysis: we establish a spectral gap to show that the kernel of $L_\rho$ consists {\it only} of the span of $\{Y_i\}_{i=1}^{n}$. \begin{theorem}[Spectral gap] \label{t:gap} Fix $n\geq 2$ and $\rho \in (0,\pi)$. Let $\{\eta_i\}_{i=1}^\infty$ be the eigenvalues of $L_\rho$ given in \eqref{eqn: eta def}. Then $\eta_{n+1}>\eta_{n}=0$ and so \[ \eta_i \geq \eta_{n+1} >0 \qquad \text{ for all }i \geq n+1. \] Furthermore, given any $\gamma \in (0,\pi/2)$, there exists $\bar \eta$ depending only on $n$ and $\gamma$ such that $\eta_{n+1} \geq \bar \eta $ for $|\rho-\pi/2|\leq \gamma$. \end{theorem} \begin{proof}[Proof of Theorem~\ref{t:gap}] As noted in Corollary~\ref{cor: eigenfunctions}, if $\mu_i=\mu_{i+1}$, then $\eta_i = \eta_{i+1}$. Let $w_i = Y_i(\theta) g_i(\phi)$ be the solution to \eqref{eqn: eigenvalue pb extension}. We consider $h=g_{n} - g_{n+1}$. From properties (1) and (2) in Lemma~\ref{lem: efns}, we have that $h(\rho)=h(0)=0$. Furthermore, from \eqref{e:legendre} and property (3) of Lemma~\ref{lem: efns}, we see that $h$ is a strict supersolution to the equation that $g_{n}$ satisfies. That is, \begin{equation} \label{e:supersolt} \frac{d^2 h}{d \phi^2} + (n-1) \frac{\cos \phi}{\sin \phi} \frac{d h}{d \phi} + \left(\lambda_{\rho} - \frac{\mu_{n}}{\sin^2 \phi} \right)h = \frac{\mu_{n} - \mu_{n+1}}{\sin^2 \phi} g_{n-1}(\phi) < 0. \end{equation} We will show that $h>0$ for $\phi \in (0,\rho)$ and $h'(\rho)>0$. Notice that in the case of the hemisphere $\rho=\pi/2$, we have $\lambda_{\rho}=n$ and $\mu_{n+1}=2n$ (recall \eqref{eqn: laplace eigenvalues}), hence the zero-order term $(\lambda_{\pi/2} - \mu_{n+1} \sin^{-2}(\phi))\leq 0$ for all $\phi$. Moreover, there exists $\epsilon$ depending on dimension $n$, such that for $\rho \in (\pi/2-\epsilon, \pi)$, the zero-order term $(\lambda_{\rho} - \mu_{n+1} \sin^{-2}(\phi))\leq 0$ for all $\phi.$ From $\eqref{e:supersolt}$ we have $h_{\rho}$ is a strict supersolution, and from the comparison principle we conclude that $h>0$, and so $g_{n}< g_{n+1}$ on $(0,\rho)$. Furthermore, from the Hopf principle we conclude that $h'(\rho)<0$. We will now show the same two properties for any $\rho \in (0,\pi)$. If $h_{\rho}$ is the function associated with $\rho$, then define the set \[ A:= \{\rho \in (0,\pi) \mid h_{\rho}>0 \text{ in } (0,\rho)\}. \] We will show $A$ is both relatively open and closed in $(0,\pi)$. We have shown already that $A \supset (\pi/2-\epsilon, \pi)$, and therefore $A$ is nonempty. Since $h_{\rho}$ is the difference of two Legendre functions defined on the whole interval $(0,\pi)$, then $h_{\rho}$ varies continuously with $\rho$ in $C^2$ on $[0,\phi_0]$ for any $\phi_0 < \pi$. Suppose $\rho_k \in A$ and $\rho_k \to \rho \in (0,\pi)$. Then by uniform convergence $h_{\rho}\geq 0$. If $h_{\rho}(\phi)=0$, then $\phi$ is a local minimum, and so $h_{\rho}'(\phi)=0$ and $h_{\rho}''(\phi)\geq0$. But from \eqref{e:supersolt} we have $h_{\rho}''(\phi)<0$, which is a contradiction. Therefore, $h_{\rho}(\phi)>0$, and so $h_{\rho} \in A$. This proves that $A$ is closed. To show $A$ is also open, we will use the fact (shown below) that if $h_{\rho} \geq 0$, then $h'(\rho)<0$. Suppose by way of contradiction that $\rho \in A$ and there exists a sequence $\rho_k \to \rho$ and $\phi_k\in (0,\rho_k)$ such that $h_{\rho_k}(\phi_k)\leq 0$. Since $h_{\rho_k}$ converges uniformly to $h_{\rho}$, it follows that for a subsequence, either $\phi_k \to \rho$ or $\phi_k \to 0$. If $\phi_k \to \rho$, then from the uniform convergence, there also exists a second sequence $\phi_{1,k} \to \rho$, such that $h_{\rho_k}(\phi_{1,k})=0$. From the mean value theorem, there exists a third sequence $\phi_{2,k} \to \rho$, such that $h'_{\rho_k}(\phi_{2,k})=0$. From the $C^1$ convergence up to the boundary point $\rho$, we would then have that $h'_{\rho}(\rho)=0$ which is a contradiction. If instead $\phi_k \to 0$, then from the uniform convergence, there exists a second sequence of local minima $\phi_{1,k} \to 0$. But for $\phi$ close to zero, the zero-order term $(\lambda_{\rho_k} - \mu_{n+1}\sin^{-2}(\phi))\leq 0$, so from the comparison principle, we have a contradiction. We thus conclude that $A=(0,\pi)$. We now show the claim that $h'(\rho)<0$. This claim is not only necessary for the proof above, but we will also use it to show the eigenvalue gap. We only need to consider the situation when $(\lambda_{\rho} - \mu_{n+1}\sin^{-2}(\rho))>0$ and necessarily $\rho \in (0,\pi/2 - \epsilon)$. Under appropriate conditions one may still apply the Hopf principle; however, in our one-dimensional case, we give the following simpler argument. Since $h\geq 0$ and the zero-order term is positive in $(\rho - \delta, \rho)$ we have that \begin{equation}\label{eqn: new eqn} h'' + (n-1) \cot \phi h' = \zeta(\phi)\leq 0 \quad \text{ for } \phi \in (\rho - \delta, \rho). \end{equation} Assume by way of contradiction that $h'(\rho)= 0$. Then applying the explicit representation formula for first order linear equations to \eqref{eqn: new eqn} together with the initial condition $h'(\rho)=0$, we have that \[ h'(\phi)= \frac{1}{p(\phi)} \int_{\rho}^\phi p(s) \zeta(s) \ ds \geq 0 \quad (\text{since } \zeta \leq 0 \text{ and } \phi < \rho), \] and where $p(s)>0$ is the integrating factor given by \[ p(s) = \text{Exp}\left\{\int_{\rho}^{s} (n-1) \cot t \ dt \right\}. \] Then $h' \geq 0$ in $(\rho - \delta, \rho)$. Since $h\geq 0$, we must then have that $h'\equiv 0$, so that $h \equiv 0$ on $(\rho - \delta, \rho)$. But this is a contradiction since as already noted $h$ is a strict supersolution to the equation that $g_{n+1}$ satisfies. We must then conclude that $h'(\rho)<0$. Consequently, we have $g_{n+1}'(\rho)> g_{n}'(\rho)$ and thus $\eta_{n+1} >\eta_{n}$. In particular, $\eta_i \geq \eta_{n+1} >0$ for all $i\geq n+1$. Finally, from \eqref{e:legendre}, we see that $\eta_{n+1}$ depends continuously on $\rho$, and so $\eta_{n+1}=\eta_{n+1}(\rho) \geq \bar \eta$ for $\rho$ in any compact subset $ [\pi/2-\gamma, \pi/2+\gamma]$ of $(0,\pi)$. \end{proof} \smallskip Theorem~\ref{t:gap} will allow us to easily show that the second variation controls the $L^2$ norm squared of any function $\xi \in H^{1/2}({\partial} B_\rho)$ that is orthogonal to $Y_0, \dots , Y_{n-1}$; see the proof of Corollary~\ref{cor: second var controls h1/2} below. In order to improve this $L^2$ control to $H^{1/2}$ control, we need the following lemma. \begin{lemma}\label{lem: l2 bound} Fix $n\geq 2$ and $\gamma\in (0,\pi/2)$. There exists a constant $C$ depending only on $n$ and $\gamma$ such that the following holds. Let $|\pi/2-\rho|\leq\gamma$ and let $\xi \in H^{1/2}({\partial} B_{\rho})$ with $\int_{{\partial} B_\rho} \xi =0$. For the solution $w_\xi$ of \eqref{eqn: eigenvalue pb extension}, we have $\|w_\xi\|_{L^2(B_{\rho})} \leq \| \xi\|_{L^2({\partial} B_\rho)}.$ \end{lemma} \begin{proof} Let $w=w_\xi$ for notational simplicity. Let ${\varphi}$ be the unique solution to the following auxiliary problem: \[ \begin{cases} (-\Delta - \lambda_\rho) {\varphi} = w & \qquad \text{ on } B_\rho\\ {\varphi} =0 & \qquad \text{ on } {\partial} {B_\rho}\\ \int_{B_\rho} {\varphi} u_{B_\rho} = 0. \end{cases} \] Such a solution exists and is unique by the Fredholm alternative. We multiply the equation by $w$ and integrate by parts twice to find \begin{align*} \int_{B_\rho} w^2 &= \int_{B_\rho} w (-\Delta - \lambda_\rho) {\varphi} = - \int_{{\partial} B_\rho} {\partial}_\nu {\varphi} w +\int_{{\partial} B_\rho} {\partial}_\nu w {\varphi}+ \int_{B_\rho} {\varphi} (-\Delta - \lambda_\rho)w = -\int_{{\partial} B_\rho} {\partial}_\nu {\varphi} w. \end{align*} Then by H\"{o}lder's inequality and the trace embedding (see \cite[Theorem 5.22]{Adams}) respectively, we see that \[ \int_{B_\rho} w^2 \leq \| {\partial}_\nu{\varphi}\|_{L^2({\partial} B_\rho)}|u'_\rho|\| \xi\|_{L^2({\partial} B_\rho)} \leq C \| {\nabla} {\varphi}\|_{H^{1}(B_\rho)}|u'_\rho|\| \xi\|_{L^2({\partial} B_\rho)} \leq C\| {\varphi}\|_{H^2(B_\rho)}|u'_\rho|\| \xi\|_{L^2({\partial} B_\rho)}, \] where the constant $C>0$ depends on $n$ and $\rho$, but is uniformly bounded above for $|\pi/2-\rho|\leq \gamma.$ By standard elliptic estimates (see \cite[Theorem 9.13]{GT}), we have $\| {\varphi}\|_{H^2(B_\rho)} \leq C\|w\|_{L^2(B_\rho)}$, where again $C>0$ is uniformly bounded above depending on $n$ and $\gamma$. Since additionally $|u'_\rho|$ is bounded by a constant $C=C(n,\gamma)$, we find that \[ \int_{B\rho} w^2 \leq C\|w\|_{L^2(B_\rho)} \| \xi\|_{L^2({\partial} B_\rho)}. \] Dividing through by $\|w\|_{L^2(B_\rho)}$ establishes the claim. \end{proof} From Theorem~\ref{t:gap} and Lemma~\ref{lem: l2 bound}, we can conclude that the second variation controls $\|\xi\|_{H^{1/2}({\partial} B)}^2$ for any function $\xi \in H^{1/2}({\partial} B_\rho)$ that is orthogonal to $Y_0, \dots , Y_{n-1}$: \begin{corollary}\label{cor: second var controls h1/2} Fix $n\geq 2$ and $\gamma \in (0,\pi/2)$. There is a positive constant $\hat{\eta}$ depending only on $n$ and $\gamma$ such that the following holds. Let $\rho \in (0,\pi)$ satisfy $|\pi/2-\rho| \leq\gamma.$ For any $\xi \in H^{1/2}({\partial} B_\rho)$ with $\int_{{\partial} B_\rho} \xi Y_i = 0$ for $i=0,\dots, n,$ we have \begin{equation}\label{eqn: second var and h1/2} \delta^2\lambda_1(B_\rho)[\xi,\xi]\geq \hat{\eta} \|\xi\|_{H^{1/2}({\partial} B_\rho)}^2. \end{equation} \end{corollary} \begin{proof} We express $\xi = \sum_{i={n+1}}^\infty a_i Y_i$ in the basis of spherical harmonics. By the linearity of $L_\rho$, we see that $ L_{\rho} \xi = \sum_{i={n+1}}^\infty \eta_i a_iY_i. $ Thus, Theorem~\ref{t:gap} shows that \begin{equation}\label{eqn: 2nd var in basis} \frac{1}{2}\delta^2 \lambda_1(B_\rho)[\xi, \xi ] = \sum_{i={n+1}}^\infty \eta_i a_i^2 \geq \eta_n \sum_{i={n+1}}^\infty a_i^2 = \bar{\eta} \|\xi\|_{L^2({\partial} B_{\rho})}^2, \end{equation} where $\bar \eta$ depends only on $n$ and $\gamma$. In order to improve this estimate to replace $\|\xi\|_{L^2({\partial} B_\rho)}$ with $\| \xi\|_{H^{1/2}({\partial} B_\rho)}$, let $h_\xi$ denote the harmonic extension of $|u_\rho'| \xi$ as defined in \eqref{eqn: harmonic extension} and note that \[ |u_\rho'|^2 \| \xi \|_{\dot{H}^{1/2}(B_\rho)}^2 = \int_{B_\rho} | {\nabla} h_\xi|^2 \leq \int_{B_\rho} |{\nabla} w_\xi|^2 . \] Therefore, using the expression \eqref{eqn: second variation} for the second variation and then applying Lemma~\ref{lem: l2 bound} to $w_\xi$, we have \begin{align*} 2|u_\rho'|^2 \| \xi \|_{\dot{H}^{1/2}(B_\rho)}^2 & \leq 2\int_{B_\rho} |{\nabla} w_\xi|^2 \\ &\leq \delta^2\lambda_1(B_\rho)[\xi,\xi] + |\mathcal{H}_{B_\rho}||u_\rho'|^2 \int_{{\partial} B_\rho} \xi^2+2\lambda_\rho\int_{B_\rho} w_\xi^2\\ & \leq \delta^2\lambda_1(B_\rho)[\xi,\xi] + C\int_{{\partial} B_\rho} \xi^2, \end{align*} where $C= C(n,\gamma)$. Noting that $|u_\rho'|>0$ depends continuously on $\rho$ and thus $| u_\rho'| \geq c({n,\gamma})>0$, we apply the estimate \eqref{eqn: 2nd var in basis} to the second term on the right-hand side to conclude the proof. \end{proof} Finally, we can combine Corollary~\ref{cor: second var controls h1/2} with Theorem~\ref{lem: second var and deficit} to obtain the following theorem. \begin{theorem}\label{th: deficit controls H1/2} Fix $n\geq 2$ and $\gamma \in (0,\pi/2)$. There are positive constants $\varepsilon$ and $\hat{\eta}$ depending only on $n$ and $\gamma$ such that the following holds. Let $|\pi/2-\rho| \leq \gamma$ and let $\Omega$ be a nearly spherical set parametrized by $\xi$ over $B_\rho$ with $\|\xi\|_{C^{2,\alpha}({\partial} B_\rho)}\leq \varepsilon.$ Then \[ \lambda_1(\Omega)-\lambda_1(B_\rho) \geq \hat{\eta} \| \xi\|_{H^{1/2}({\partial} B_{\rho})}^2. \] \end{theorem} \begin{proof} We express $\xi$ in the basis of spherical harmonics as $\xi = \sum_{i=0}^\infty a_i Y_i$ where $a_i = \int_{{\partial} B_\rho} Y_i \xi.$ The volume constraint and the set center constraint respectively imply that \begin{align}\label{e: constraints linearized} a_0^2 = o\left( \|\xi\|_{L^2({\partial} B_\rho)}^2\right), \qquad a_1^2, \dots a_{n}^2 = o\left( \|\xi\|_{L^2({\partial} B_\rho)}^2\right) \end{align} with the $o(\cdot)$ term depending on $n$ and $\gamma$. Indeed, as we noted in Remark~\ref{rmk: volume constraint}, the first fact is a standard computation that can be found in \cite[Theorem 3.1]{BDF17}. To see the second, consider the standard embedding of $S^{n} \subset {\mathbb{R}}^{n+1}$ with the north pole $o =e_{n+1}$, and fix a basis vector $e_i$ for $i=1,\dots, n$. In spherical coordinates we may write $e_i = (1,\bar \theta, \pi /2) $ for some $\bar \theta \in S^{n-1}$. So, from the barycenter constraint $x_\Omega = e_{n+1}$, we have \begin{align*} 0=e_i \cdot \int_\Omega x \, d{\rm{vol}}& = \int_{S^{n-1}} \int_0^{(1 + \xi(\theta)\rho)} \left( (\theta \cdot \bar \theta) \sin \phi\right) \sin^{n-1}\phi \,d\phi \, d\theta\\ & = \int_{S^{n-1}} (\theta \cdot \bar \theta) \int_0^{(1 + \xi(\theta)\rho)}\sin^{n}\phi \,d\phi \, d\theta\\ & = \int_{S^{n-1}} (\theta \cdot \bar \theta)\, F\left((1+\xi(\theta))\rho\right) \, d\theta, \end{align*} where $F(t) = \int_0^t \sin(s)^{n}\,ds$ is a smooth hypergeometric function and $\theta \cdot \bar \theta $ indicates the inner product with respect to the standard metric on $S^{n-1}$. A Taylor expansion of $F$ and H\"{o}lder's inequality thus show that \begin{align*} 0 &=\int_{S^{n-1}} (\theta \cdot \bar \theta)\Big( F(\rho) + C_\rho \xi(\theta ) + o\left(\| \xi\|_{L^2({\partial} B_\rho)}\right)\Big) \, d\theta \\ & = C_\rho \int_{S^{n-1}} (\theta \cdot \bar \theta)\xi(\theta ) \, d\theta + o\left(\| \xi\|_{L^2({\partial} B_\rho)}\right). \end{align*} So, we see that for $i-1,\dots, n$, we have $a_i = \int_{S^{n-1}}(\theta \cdot \bar \theta)\xi(\theta )) = o(\|\xi \|_{L^2(S^{n-1})})$ and conclude \eqref{e: constraints linearized}. Define the functions \[ \hat{\xi} = \xi -a_0Y_0, \qquad \bar \xi = \hat{\xi} -\sum_{i=1}^{n}a_iY_i\,. \] As a consequence of \eqref{e: constraints linearized}, we see that \begin{align*} \| \xi \|_{H^{1/2}({\partial} (B_\rho))} &= \| \hat{\xi} \|_{H^{1/2}({\partial} B_\rho)} + o\left(\| \xi \|_{L^2({\partial} B_\rho)}^2\right) \\ &= |\bar{ \xi} \|_{H^{1/2}({\partial} B_\rho)} +o\left(\| \xi \|_{L^2({\partial} B_\rho)}^2\right)\,. \end{align*} By Theorem~\ref{lem: second var and deficit} and applying Corollary~\ref{cor: second var controls h1/2} to $\bar{\xi}$, we have \begin{align*} \lambda_1(\Omega) - \lambda_1(B_\rho) & \geq \frac{1}{2}\delta^2\lambda(B_\rho)[\hat{\xi},\hat{\xi}] +o\left( \| \xi \|_{H^{1/2}({\partial} B_\rho)}^2\right)\\ & = \frac{1}{2}\delta^2\lambda(B_\rho)[\bar{\xi},\bar{\xi}] + o\left( \| \xi \|_{H^{1/2}({\partial} B_\rho)}^2\right)\\ & = \frac{\hat \eta}{2} \| \bar \xi\|_{H^{1/2}({\partial} B_\rho)}^2 +o\left( \| \xi \|_{H^{1/2}({\partial} B_\rho)}\right)\\ &= \frac{\hat \eta}{2} \| \xi\|_{H^{1/2}({\partial} B_\rho)}^2 +o\left( \| \xi \|_{H^{1/2}({\partial} B_\rho)}\right). \end{align*} Choosing $\varepsilon$ sufficiently small depending on $\bar \eta$ (and thus on $\gamma$ and $n$), we may absorb the second term on the right-hand side to conclude. \end{proof} \bigskip \subsubsection{The $H^{1/2}$ norm controls the distance }\label{ssec: h12 and distance} Thanks to Theorem~\ref{th: deficit controls H1/2}, we will conclude the proof of Proposition~\ref{prop: quantitative for nearly spherical sets} as soon as we can show that the terms $|\Omega \Delta B_\rho|$ and $\int_{S^{n}}| u_\Omega - u_{B_\rho}|$ are controlled linearly by $\|\xi\|_{H^{1/2}(B)}.$ This is the content of the following proposition. In the case of Euclidean space and hyperbolic space, the proof of this proposition will be identical up to replacing the coarea factor $\sin^{n-1} \phi$ with $\phi^{n-1}$ and $\sinh^{n-1}\phi$ respectively in various integrals throughout the proof. \begin{proposition}\label{prop: control efunc} Fix $n\geq 2$ and $\gamma \in (0,\pi/2)$. There are positive constants $\varepsilon$ and $C$ depending on $n$ and $\gamma$ such that the following holds. Let $|\pi/2-\rho| <\gamma.$ Let $\Omega \subset S^{n}$ be a nearly spherical set parameterized by $\xi$ with $\|\xi\|_{C^{2,\alpha}({\partial} B_\rho)} \leq \varepsilon$ and $\lambda_1(\Omega)-\lambda_1(B_\rho) \leq \varepsilon\lambda_1(B_\rho).$ Then \begin{align}\label{eqn: h1/2 controls asymmetry} |\Omega \Delta B_\rho|^2 +\int_{S^{n}}| u_\Omega - u_{B_\rho}|^2 & \leq C\|\xi\|^2_{H^{1/2}({\partial} B_\rho)}. \end{align} \end{proposition} \begin{proof The fact that $|\Omega\Delta B_\rho| \leq C \|\xi\|_{L^2({\partial} B)} \leq C\|\xi\|_{H^{1/2}({\partial} B_\rho)}$ is a standard computation; see \cite[Proof of Theorem 4.3]{CiLe12} or \cite[Lemma 4.2]{BDV15}. Establishing $\int_{S^{n}}| u_\Omega - u_{B_\rho}|^2 \leq C\| \xi\|^2_{H^{1/2}({\partial} B_\rho)}$ is more involved and will be carried out in several steps. {\it Step 1.} First, we define a diffeomorphism between $B_\rho$ and $\Omega$ and express the equation solved by $u_\Omega$ pulled back by this diffeomorphism. To this end, let $h : B_\rho \to {\mathbb{R}}$ be the harmonic extension of $\xi$ in $B_\rho$ defined in \eqref{eqn: harmonic extension}. Let $\Psi: B_\rho\to S^{n}$ be the smooth map defined by \begin{equation} \Psi(x) = (1 + h(x)){\rm exp}_o(x), \end{equation} where ${\rm exp}_o(x)$ is the exponential map at $o$. In normal coordinates $\{x^\alpha\}$, the differential $d\Psi$ has coefficients \begin{equation}\label{eqn: coord expression} \frac{{\partial} \Psi^\alpha}{{\partial} x^i} = (1+h(x)) \delta_i^\alpha +\frac{{\partial}}{{\partial} x^i} h(x) x^\alpha. \end{equation} Since $h$ is harmonic and $|{\nabla} h|^2$ is subharmonic, the maximum principle ensures that $ |h(x)|, |{\nabla} h(x)| \leq \| \xi\|_{C^{1}({\partial} B_\rho)} \leq C\| \xi \|_{C^{2,\alpha}({\partial} B_\rho)} \leq C\varepsilon $ for all $x \in B_\rho$, where $C=C(n,p)$. The metric coefficients $g_{ij}$ are uniformly bounded uniformly bounded above, so $|\frac{{\partial} }{{\partial} x^i} h(x) |\le C\varepsilon$ as well. We thus see that \begin{equation}\label{eqn: estimates on dPsi} \left|\frac{{\partial} \Psi^\alpha}{{\partial} x^i} - \delta^\alpha_i \right| \leq C\varepsilon, \end{equation} where $C$ is a constant depending only on $n$ and $\alpha$. In particular, the differential $d\Psi$ is non-vanishing on $B_\rho$, so $\Psi$ is injective and hence a diffeomorphism onto its image. Since $\Psi$ maps ${\partial} B_\rho$ to ${\partial} \Omega,$ it follows that $\Omega$ is the image of $B_\rho$ under $\Psi$ and so $\Psi$ defines a smooth diffeomorphism from $B_\rho$ to $\Omega.$ We let $\Phi: \Omega \to B_\rho$ denote the inverse of $\Psi.$ \\ Recall that $u_\Omega$ denotes the first Dirichlet eigenfunction of $\Omega$, normalized so that $\int u_\Omega^2 \,dx =1$ and extended by $0$ to be defined on all of $S^{n}$. We define $\hat u_\Omega:B_\rho\to {\mathbb{R}}$ to be the pullback $\hat u_\Omega(x) = u_\Omega(\Psi(x))$ of $u_\Omega$ by $\Psi.$ Then $\hat u_\Omega$ satisfies the equation \begin{equation} \begin{cases} -\mathcal{L}\hat u_\Omega = m\lambda_\Omega \hat u_\Omega & \text{ in } B_\rho\\ \hat u_\Omega = 0& \text{ on }{\partial} B_\rho. \end{cases} \end{equation} Here and in the remainder of the proof we use the short-hand $\lambda_\Omega = \lambda_1(\Omega)$, and $\mathcal{L}$ is the a linear divergence form operator given by \begin{equation}\label{eqn: pullback operator} \mathcal{L} f = \,\text{div} (A{\nabla} f), \end{equation} where $A = m\mathcal{A}$ for $\mathcal{A}(x) = d\Phi(\Psi(x)) (d\Phi(\Psi(x))^*$ and $m = 1/\sqrt{\det \mathcal{A}}$. From the definition of $\mathcal{L}$ and the coordinate expression \eqref{eqn: coord expression}, we see that the coefficients satisfy the pointwise estimates \begin{equation}\label{eqn: L2 bound for coefficients euc} |A-\text{Id}| \leq C(h + |{\nabla} h|), \qquad |m-1| \leq C(h + |{\nabla} h|) \end{equation} for all $x$ in $B_\rho$, where $C$ is a dimensional constant. Furthermore, we have \begin{equation}\label{eqn: holder coefficients a} \|A-\text{Id}\|_{C^{0,\alpha}(B_\rho)} \leq C\|h\|_{C^{1,\alpha}(B_\rho)}, \qquad \|m-1\|_{C^{0,\alpha}(B_\rho)} \leq C\|h\|_{C^{1,\alpha}(B_\rho)}. \end{equation} In particular, by \eqref{eqn: estimates on dPsi} and by \cite[Corollary 8.35]{GT}, we have \begin{equation}\label{eqn: C1alpha u} \| u_\Omega\|_{C^{1,\alpha}(\bar\Omega)}\leq C, \qquad \|\hat u_\Omega\|_{C^{1,\alpha}(\bar B_\rho)}\leq C. \end{equation} Additionally, we have \begin{equation}\label{eqn: L2 bound for coefficients} \| A-\text{Id}\|_{L^2(B_\rho)}\leq C\|h\|_{W^{1,2}(B_\rho)}\leq C\| \xi\|_{H^{1/2}(B_\rho)} . \end{equation} \\ \medskip {\it Step 2:} We now prove the following integral estimate for $u_\Omega - \hat u_\Omega$: \begin{align}\label{eqn: u vs pullback} \int_{S^{n}} |u_\Omega -\hat u_\Omega |^2 \,dx \leq C \ \| \xi\|_{H^{1/2}({\partial} B)}^2. \end{align} We argue in three separate regions: $B_\rho\cap \Omega$, $\Omega\setminus B_\rho$, and $B_\rho\setminus \Omega$. First, given any $x \in B_\rho\cap \Omega$, we have \begin{align*} |\hat u_{\Omega}(x) -u_\Omega(x)|& = |u_\Omega(\Psi(x)) - u_{\Omega}(x)| \leq \| u_\Omega\|_{C^1(\Omega)}d(x, \Psi (x)) \leq Ch(x). \end{align*} The final two inequalities follow from \eqref{eqn: C1alpha u} and the definition of $\Psi$ respectively. So, squaring and integrating this pointwise estimate and applying Lemma~\ref{lem: l2 bound} (or more specifically, the analogous statement with $\lambda_\rho$ replaced by $0$), we have \begin{align}\label{eqn: u vs pullback on intersection} \int_{B_\rho\cap \Omega} |u_\Omega -\hat u_\Omega |^2 \,dx \leq C \| \xi\|_{L^2({\partial} B_\rho)}^2. \end{align} Next, for any $x \in \Omega \setminus B_\rho$, note that $\hat{u}_\Omega= 0$ and so $|u_{\Omega}(x) - \hat{u}_\Omega(x)| = u_\Omega(x)$. Thanks to the estimate \eqref{eqn: C1alpha u} and the fact that $u_\Omega$ vanishes on ${\partial} \Omega,$ we see that $u_\Omega(x) \leq \frac{C}{\rho} d(x,{\partial} \Omega)$. Thus, in spherical coordinates $(\theta,\phi)$, we have $u_\Omega(\theta,\phi)\leq C(1+\xi(\theta)-\phi/\rho).$ Hence, using the coarea formula, we have \begin{align*} \int_{\Omega\setminus B_\rho} u_\Omega^2 \,dx & = \int_{\{\xi >0\}} \int_\rho^{(1+\xi)\rho} u(\theta, \phi)^2 \sin(\phi)^{n-1} \,d\phi \,d\theta \\ & \leq C\sin(\rho)^{n-1} \int_{\{\xi >0\}} \int_\rho^{(1+\xi)\rho}(1+\xi(\theta)-\phi/\rho)^2 \,d\phi \,d\theta\\ & = C\sin(\rho)^{n-1} \rho \int_{\{\xi >0\}} \xi^2 d\theta \leq C\rho \| \xi\|_{L^2({\partial} B_\rho)}^2. \end{align*} where the penultimate equality comes from the change of variable $1+\xi(\theta)-\phi/\rho=s$. The analogous argument on $B_\rho\setminus \Omega$ using $\hat{u}_{\Omega}$ in place of $u_\Omega$. Together, these estimates along with \eqref{eqn: u vs pullback on intersection} show \eqref{eqn: u vs pullback}. \\ \medskip {\it Step 3:} Finally, we show that \begin{equation}\label{eqn: hat u and uB} \int_{B_\rho} |\hat u_\Omega - u_{B_\rho}|^2 \,dx \leq C \| \xi\|_{H^{1/2}({\partial} B_\rho)}^2. \end{equation} Let us begin with the following simplification. Let $\alpha_\Omega = \int_{B_\rho} \hat{u}_\Omega u_{B_\rho}$. Then \[ \int_{B_\rho} |\hat u_\Omega - u_{B_\rho}|^2 \,dx \leq 4 \int_{B_\rho} |\hat u_\Omega - \alpha_\Omega u_{B_\rho}|^2 \,dx, \] since the left-hand side is equal to $2(1-\alpha_\Omega^2)$ while the right-hand side is equal to $1-\alpha_\Omega^2.$ It therefore suffices to show that \begin{equation}\label{eqn: intermediate claim} \int_{B_\rho} |\hat u_\Omega -\alpha_\Omega u_{B_\rho}|^2 \,dx \leq C \| \xi\|_{H^{1/2}({\partial} B_\rho)}^2. \end{equation} To this end, set $v = \hat u_\Omega - \alpha_\Omega u_B.$ The idea behind showing \eqref{eqn: intermediate claim} is that $v$ solves an equation with right-hand side controlled in terms of $\xi$. More specifically, we see that $v$ satisfies the equation \begin{align*} -\mathcal{L} v &= -\mathcal{L} \hat u_\Omega + \alpha_\Omega \mathcal{L}u_{B_\rho}\\ &= m\lambda_\Omega\hat u_\Omega -\alpha_\Omega \lambda_\rho u_{B_\rho} +\alpha_\Omega (\mathcal{L}-\Delta) u_{B_\rho}\\ & = \lambda_\Omega v +\alpha_\Omega(\lambda_\Omega - \lambda_{\rho}) u_{B_\rho} + \alpha_\Omega(\mathcal{L}-\Delta) u_{B_\rho} +(m-1)\lambda_\Omega\hat u_\Omega. \end{align*} We multiply this equation by $v$ and integrate over $B_\rho$. On one hand, note that \eqref{eqn: L2 bound for coefficients euc} ensures that $A \geq (1-C\varepsilon) \text{Id}$. So integrating by parts, we find that \begin{equation}\label{eqn: lower bound} - \int_{B_\rho} v\, \mathcal{L}v \geq (1-C\varepsilon) \int_{B_\rho}|{\nabla} v|^2. \end{equation} On the other hand, note that $\int_{B_\rho} v u_{B_\rho} = 0$ and $v$ vanishes on ${\partial} B_\rho$, and thus $v$ satisfies the improved Poincar\'{e} inequality \begin{equation}\label{eqn: orthogonal} \int_{B_\rho} |{\nabla} v|^2 \,dx \geq \lambda_2 \int_{B_\rho} v^2 \,dx \end{equation} where $\lambda_2 =\lambda_2(B_\rho)$ is the second Dirichlet eigenvalue of $B_\rho$. So, again using the orthogonality of $u_{B_\rho}$ and $v$, we find that \begin{equation}\label{eqn: upper bound} \begin{split} - \int_B v\, \mathcal{L}v & = \int_{B_\rho} v\{ \lambda_\Omega v +\alpha_\Omega(\lambda_\Omega - \lambda_{\rho}) u_{B_\rho} + \alpha_\Omega(\mathcal{L}-\Delta) u_{B_\rho}+(m-1)\lambda_\Omega\hat u_\Omega\}\\ & = \int_{B_\rho} \{\lambda_\Omega v^2 + \alpha_\Omega (\mathcal{L}-\Delta)u_{B_\rho} v+(m-1)\lambda_\Omega\hat u_\Omega v\}\, dx\\ &\leq \frac{\lambda_\Omega}{\lambda_2} \int_{B_\rho} |{\nabla} v|^2 + \alpha_\Omega \int_{B_\rho} (\mathcal{L}-\Delta)u_{B_\rho} v + \lambda_\Omega\int (m-1)\hat u_\Omega v. \end{split} \end{equation} Provided $\varepsilon $ is sufficiently small with respect to the spectral gap $\lambda_1/\lambda_2$, we may combine \eqref{eqn: lower bound} and \eqref{eqn: upper bound} and absorb the first term on the right-hand side of \eqref{eqn: upper bound} to find \begin{equation}\label{eqn: gradient bounds} c\int_{B_\rho}|{\nabla} v|^2 \leq \alpha_\Omega \int_{B_\rho} (\mathcal{L}-\Delta)u_{B_\rho} v + \lambda_\Omega\int_{B_\rho} (m-1)\hat u_\Omega v. \end{equation} Now, we bound the two terms on the right-hand side of \eqref{eqn: gradient bounds} separately. For the first term, we integrate by parts and then apply the Cauchy-Schwarz inequality and the bound \eqref{eqn: L2 bound for coefficients} on the coefficients to find \begin{align*} \alpha_\Omega \int_{B_\rho} (\mathcal{L}-\Delta)u_{B_\rho} v & = \alpha_\Omega \int_{B_\rho} \langle (A-\text{Id}){\nabla} u_{B_\rho}, {\nabla} v\rangle \\ & \leq \frac{\eta\, \alpha_\Omega}{2} \int_{B_\rho} |{\nabla} v|^2 + \frac{\alpha_\Omega}{2\eta}\|{\nabla} u_{B_\rho}\|_{L^\infty(B_\rho)} \int_{B_\rho} |A-\text{Id}|^2 \, dx \\ & \leq \frac{\eta\, \alpha_\Omega }{2} \int_{B_\rho} |{\nabla} v|^2 + \frac{\alpha_\Omega }{2\eta}\|{\nabla} u_{B_\rho}\|_{L^\infty(B_\rho)} \|\xi\|_{H^{1/2}({\partial} B_\rho)}^2. \end{align*} Here $\langle \cdot, \cdot \rangle $ denotes the inner product on $S^{n}$ with respect to the round metric. Provided that $\eta $ is chosen to be sufficiently small, we can absorb the first term to the left-hand side of \eqref{eqn: gradient bounds}. In a similar way, for the second term on the right-hand side of \eqref{eqn: gradient bounds}, we have \begin{align*} \lambda_\Omega\int_{B_\rho} (m-1)\hat u_\Omega v & \leq \frac{\lambda_\Omega}{\eta} \int_{B_\rho} |m-1|^2 + \lambda_\Omega\eta \| \hat{u}_\Omega\|_{L^\infty(B_\rho)}^2 \int_{B_\rho} v^2 \\ & \leq \frac{\lambda_\Omega}{\eta}\|\xi\|_{H^{1/2}({\partial} B_\rho)}^2 + \lambda_\Omega\eta C \int_{B_\rho} v^2\\ & \leq \frac{\lambda_\Omega}{\eta}\|\xi\|_{H^{1/2}({\partial} B_\rho)}^2 + \frac{(1+\varepsilon) \lambda_1}{\lambda_2} \eta C \int_{B_\rho} |{\nabla} v| ^2. \end{align*} Choosing $\eta$ to be sufficiently small, we then find that \begin{equation} \frac{1}{4} \int_{B_\rho}|{\nabla} v|^2 \leq \frac{\alpha_\Omega}{2\eta}\|{\nabla} u_{B_\rho}\|_{L^\infty(B_\rho)} \|\xi\|_{H^{1/2}({\partial} B_\rho)}^2. \end{equation} This, together with the Poincar\'{e} inequality on $B_\rho$, establishes \eqref{eqn: intermediate claim} and thus \eqref{eqn: hat u and uB}. We combine \eqref{eqn: hat u and uB} and \eqref{eqn: u vs pullback} to conclude the proof of the proposition. \end{proof} Finally we can prove Theorem~\ref{prop: quantitative for nearly spherical sets}. \begin{proof}[Proof of Theorem~\ref{prop: quantitative for nearly spherical sets}] Together Theorem~\ref{th: deficit controls H1/2} and Proposition~\ref{prop: control efunc} directly imply the theorem when $\lambda(\Omega ) - \lambda (B_\rho) \leq \varepsilon \lambda (B_\rho)$, while the result holds trivially when $\lambda(\Omega ) \geq (1+\varepsilon) \lambda (B_\rho)$ by choosing the constant $c$ to be sufficiently small. \end{proof} \bigskip \subsection{Torsional rigidity, the Kohler Jobin inequality, and Quantitative Stability for the Faber-Krahn inequality}\label{sec: SP} Thus far, we have proven Theorem~\ref{thm: quantitative sperner restated} in the special case of nearly spherical sets. The remainder of the proof of Theorem~\ref{thm: quantitative sperner restated} relies on a selection principle argument, as described in the introduction. The proof of the selection principle is carried out in our companion paper \cite{AKN1}. We restate the main result there, stated only in the generality needed here, in Theorem~\ref{cor1.2 from reg paper} below. For regularity reasons discussed in \cite{AKN1}, the functional involved in the selection principle involves an additional, possibly unexpected term: the torsional rigidity. Given an open set $\Omega \subset S^{n}$, the {\it torsional rigidity} of $\Omega$ is defined by \begin{equation}\label{eqn: torsion} {\text{tor}}(\Omega) = \inf \left\{ \int_\Omega \frac{1}{2} |{\nabla} u|^2 -\int_{\Omega}u : \ u \in W^{1,2}_0(\Omega)\right\} \,. \end{equation} Naturally, the same quantity can be defined for an open subset on any Riemannian manifold. We note that our sign convention for the torsional rigidity differs by a sign from the definition stated in other contexts such as \cite{KJ1, BrascoInvitation}. With our sign convention, $\rm{tor}(\Omega)\leq 0$. Note also that $\text{tor}(\Omega)$, like the first Dirichlet eigenvalue, is decreasing under set inclusion. The infimum in ${\text{tor}}(\Omega)$ is achieved by the unique solution to the equation \begin{equation} \begin{cases} -\Delta u = 1 & \text{ in } \Omega \\ u =0 & \text{ on } {\partial} \Omega. \end{cases} \end{equation} Applying the Polya-Szeg\"{o} inequality to any function in the minimization problem \eqref{eqn: torsion}, one sees that balls minimize the torsional rigidity among all quasi-open sets of a fixed volume: \begin{equation}\label{eqn: st v} {\text{tor}}(\Omega) \geq {\text{tor}}(B) \qquad \text{ if }\ {\rm{vol}}(\Omega) = {\rm{vol}}(B). \end{equation} Since the Polya-Szeg\"{o} principle holds on Euclidean space and hyperbolic space, balls also minimize the torsional rigidity among sets of a fixed volume in these spaces. Combined with the Faber-Krahn inequality, we see that balls uniquely minimize the functional $\lambda_1(\Omega) + \frak{T} \text{tor}(\Omega)$ for any $\frak{T}\geq 0$ among sets of a fixed volume. In our companion paper, we establish the following global-to-local stability theorem; see \cite[Corollary 1.2 and Remark 1.3]{AKN1}. \begin{theorem}[Selection Principle]\label{cor1.2 from reg paper} Let $M$ denote the round sphere, Euclidean space, or hyperbolic space. Fix $n\geq 2$ and an interval $[v_0, v_1] \in (0, |M|)$. There exist $\frak{T}_0>0$ and $\varepsilon>0$ depending on $n, v_0,$ and $v_1$ such that the following holds. Suppose there exists a constant $c>0$ such that for all $v \in [v_0, v_1]$, $\frak{T}< \frak{T}_0 $ and for every $\varepsilon$-nearly spherical set parametrized over $B$ where $|B|=v$, we have \begin{equation}\label{eqn: nss torsion} c\left( |\Omega \Delta B|^2 + \int_{M} |u_\Omega - u_B|^2 \right) \leq \lambda_1(\Omega) - \lambda_1(B) + \frak{T}(\rm{tor}(\Omega) - \rm{tor}(B))\,. \end{equation} Then for all open sets $\Omega$ with $|\Omega|= |B|$, \begin{equation}\label{eqn: final} c\inf_{x \in M}\left( |\Omega \Delta B(x)|^2 + \int_{M} |u_\Omega - u_B(x)|^2 \right) \leq \lambda_1(\Omega) - \lambda_1(B) + \frak{T}(\rm{tor}(\Omega) - \rm{tor}(B))\,, \end{equation} where $B(x)$ is a ball of the same radius as $B$. \end{theorem} Although the form of Theorem~\ref{cor1.2 from reg paper} does not appear to be immediately compatible with proving Theorem~\ref{thm: quantitative sperner restated}, an essential point is that the quantities \begin{equation}\label{2deltas} \delta(\Omega) = \lambda_1(\Omega) - \lambda_1(B), \qquad \hat{\delta}(\Omega) = \lambda_1(\Omega) - \lambda_1(B) + \frak{T}\,\left(\text{tor}(\Omega) - \text{tor}(B)\right) \end{equation} are equivalent. While it is immediate that $\delta(\Omega) \leq \hat{\delta}(\Omega)$, we must call upon a result of Kohler-Jobin, Theorem~\ref{thm: KJ inequality} below, to show that $ \hat{\delta}(\Omega) \leq C \delta(\Omega) $. Polya and Szeg\"{o} \cite{PSBook} conjectured that among sets $\Omega\subset \mathbb{R}^n$ of a fixed torsional rigidity ${\text{tor}}(\Omega)$, balls minimize the first Dirichlet eigenvalue $\lambda_1(\Omega).$ This conjecture was proven by Kohler-Jobin through the introduction of a new symmetrization technique in \cite{KJ1,KJ2} (see also \cite{KJ3}, as well as \cite{BrascoInvitation} for extensions to the $p$-Lapace energy). Fundamentally, the proof is underpinned only by the coarea formula and the isoperimetry of balls. Basic modifications of Kohler-Jobin's argument show that this fact, now known as the Kohler-Jobin inequality, holds on all simply connected space forms. \begin{theorem}[Kohler-Jobin inequality on simply connected space forms]\label{thm: KJ inequality} Let $M$ denote the round sphere, Euclidean space, or hyperbolic space. Fix an open set $\Omega \subset M$ and let $B^*_\Omega \subset M$ denote a geodesic ball with the unique radius such that ${\text{tor}}(\Omega) = {\text{tor}}(B^*_\Omega)$. Then \begin{equation}\label{eqn: KJ} \lambda_1(\Omega) \geq \lambda_1(B^*_{\Omega}). \end{equation} Equality is achieved in \eqref{eqn: KJ} if and only if $\Omega$ is a ball of this radius. \end{theorem} Theorem~\ref{thm: KJ inequality} allows us to deduce the following comparison between the Faber-Krahn deficit and the torsional rigidity deficit and in particular show that $\delta(\Omega)$ and $\hat{\delta}(\Omega)$ are comparable. \begin{corollary}\label{cor: KJ deficit} Let $M$ denote the round sphere, Euclidean space, or hyperbolic space and fix $0 < \bar v <\bar V < {\rm{vol}}(M)$. There exists a constant $C=C(\bar v, \bar V)>0$ so that for any $\Omega\subset M$ with ${\rm{vol}}(\Omega) =v_0 \in [\bar v, \bar V]$, \begin{equation}\label{eqn: deficit comparison} C\left( \lambda_1( \Omega) - \lambda_1(B)\right) \geq \rm{tor}(\Omega)-\rm{tor}(B) \end{equation} where $B$ is a geodesic ball with ${\rm{vol}}(B) = v_0.$ In particular, $\hat{\delta}(\Omega) \leq \tilde{C} \delta(\Omega)$, where $\tilde{C} = 1+ C\frak{T}.$ \end{corollary} \begin{remark} {\rm One may use the scaling invariance of Eulcidean space to more directly conclude Corollary~\ref{cor: KJ deficit} from the Kohler-Jobin inequality; see \cite[Proposition~2.1]{BDV15}. For the sake of a unified approach, we simply include Euclidean space in Corollary~\ref{cor: KJ deficit}. } \end{remark} \begin{proof}[Proof of Corollary~\ref{cor: KJ deficit}] As in Theorem~\ref{thm: KJ inequality}, let $B^*_\Omega$ denote a ball with the uniquely chosen radius such that ${\text{tor}}(\Omega) = {\text{tor}}(B^*_\Omega).$ Theorem~\ref{thm: KJ inequality} implies that \begin{align*}\label{eqn: basic app of KJ} \lambda_1(\Omega) - \lambda_1(B) = \left[ \lambda_1(B^*_\Omega) - \lambda_1(B)\right] + \left[ \lambda_1(\Omega) - \lambda_1(B^*_\Omega)\right]\geq \lambda_1(B^*_\Omega) - \lambda_1(B)\,, \end{align*} and so to establish \eqref{eqn: deficit comparison}, it suffices to prove that $C(\lambda_1(B^*_\Omega) - \lambda_1(B)) \geq {\text{tor}}(B^*_\Omega) - {\text{tor}}(B) $. Noting that the radius of $B^*_\Omega$ is smaller than that of $B$, the corollary will be proven once we establish the following claim. {\it Claim: } Fix $0<\bar r <\bar R$, with $\bar R<\pi$ if $M= S^n$, and for each $R \in (\bar r , \bar R)$, define the functions \begin{align*} f_R(r) &=\lambda_1(B_r) - \lambda_1(B_R)\,,\\ g_R(r) &= {\text{tor}}(B_r)-{\text{tor}}(B_R)\,. \end{align*} There is a constant $C = C(\bar r, \bar R)$ such that for all $r \in (0,R)$, \begin{equation}\label{eqn: f g} g_R(r) \leq C f_R(r)\,. \end{equation} We first establish \eqref{eqn: f g} with a constant depending on $R$. Notice that $\lim_{r\to 0} f_R(r) = +\infty$ and $g_R(0) = -{\text{tor}}(B_R)$. So, we may find $\varepsilon =\varepsilon(R)$ such that $g_R(r) \leq f_R(r) $ for all $r \in (0,\varepsilon]$. Next, observe that the functions $f_R$ and $g_R$ are strictly decreasing and differentiable. Define the constants \begin{align*} m& := \min \{ -f'_R(r) \, :\, r \in [\varepsilon, R]\}>0, \\ M &:= \max \{ -g'_R(r) \, :\, r \in [\varepsilon, R]\}<\infty\,. \end{align*} By the fundamental theorem of calculus and $f(R) = g(R) = 0$, we see that \begin{align*} f_R(r) & = \int_r^R -f_R'(r) \, dr \geq m(R-r),\\ g_R(r) & = \int_r^R -g'_R(r) \, dr \leq M(R-r), \end{align*} and so $g_R(r) \leq f_R(r)\times M/m$ for $r \in [\varepsilon,R]$. Letting $C = \max\{ M/m, 1\}>0$, we see that \eqref{eqn: f g} holds for $C = C(R)$. Finally, by compactness, it is clear that we may choose $C$ uniformly for all $R \in [r_0, R_0]$. This completes the proof of the corollary. \end{proof} Together Theorem~\ref{prop: quantitative for nearly spherical sets}, Theorem~\ref{cor1.2 from reg paper}, and Corollary~\ref{cor: KJ deficit} lead to the proof of Theorem~\ref{thm: quantitative sperner restated}: \begin{proof}[Proof of Theorem~\ref{thm: quantitative sperner restated}] Combining Theorem~\ref{prop: quantitative for nearly spherical sets}, we see that \eqref{eqn: nss torsion} holds for nearly spherical sets, and so by Theorem~\ref{cor1.2 from reg paper}, we see that \eqref{eqn: final} holds for all open sets $\Omega$ with $|\Omega| = |B|$. Corollary~\ref{cor: KJ deficit} applied to the right-hand side of \eqref{eqn: final} concludes the proof. \end{proof} \bibliographystyle{amsplain}
\section{Introduction} Meshless methods are becoming a strong alternative to mesh based methods, when numerical treatment of partial differential equations is required. A strong advantage of meshless methods is that they can operate on scattered nodes, contrary to mesh-based methods, that need a computationally expensive mesh to operate. Many different meshless methods have been proposed so far, e.g.\ meshless Element Free Galerkin~\cite{belytschko1994element}, the Local Petrov-Galerkin~\cite{atluri1998new}, h-p cloud method~\cite{duarte1996h} and others. In this paper we use a method that generalizes the traditional Finite Difference Method, called radial-basis-function-generated finite differences (RBF-FD). From a historical point of view, RBF-FD was first mentioned by Tolstykh~\cite{tolstykh2003using} in 2003 and has since been successfully used in a vast range of problems, e.g.\ convection-diffusion problems~\cite{chandhini2007local}, fluid flow problems~\cite{kosec2018local}, contact problems~\cite{slak2019adaptive}, scattering~\cite{slak2019high}, dynamic thermal rating of power lines~\cite{maksic2019cooling}, etc. The RBF-FD use RBFs to approximate the linear differential operators~\cite{bayona2010rbf}. Most of the RBFs, like Hardy's multiquadrics or Gaussians, include shape parameter~\cite{wendland2004scattered} that directly affects the stability of the approximation and accuracy of the solution~\cite{schaback1995error}. To avoid shape parameter problems altogether, Polyharmonic splines (PHS) have been proposed~\cite{bayona2017role}, however, PHS alone do not guarantee convergent behavior. Therefore, RBFs are augmented with monomials up to given order~\cite{bayona2017role}. The RBF part of the approximation takes care of the potential ill-conditioning~\cite{flyer2016role}, while the polynomial part not only ensures convergent behavior but also allows direct control over the convergence rate. It has already been proven that having the control over the convergence rate is beneficial, when a compromise between the accuracy of the solution and computational time is needed~\cite{janvcivc2021monomial}. However, in this paper, we exploit the ability to control the order of the approximation method to employ spatial variability of the approximating method order. Such solution procedure refinement is also known as $p$-refinement~\cite{barros2004error} and is a well known refinement procedure in the scope of finite element methods~\cite{babuska1992p}, where it also forms the basis of the highly successful $hp$-adaptive methods. In this paper, convergence rates and computational times of $p$-refined solutions are studied. It is shown that spatially variable order of the approximation method can notably reduce the computational time and improve the convergence rate at the same time. The rest of the paper is organized as follows: In section~\ref{sec:num} the main steps of solution procedure are described, in section~\ref{sec:num_example}, the numerical example used to test the numerical performance of $p$-refinement is presented, in section~\ref{sec:results}, results are presented and finally, in section~\ref{sec:conclusions} conclusions are given and future work is proposed. \section{Numerical approximation} \label{sec:num} The solution procedure can be roughly divided into three steps. Using a dedicated node positioning algorithm the domain is first discretized. Afterwards, the differential operators are approximated in each node, resulting in stencil weights. Finally, the system of PDEs is discretized and, therefore, transformed to a system of linear equations. The system is solved and its solution stands for a numerical solution $u_h$ of the considered system of PDEs. \subsection{Domain discretization} In the first applications of meshless methods, researchers used existing mesh generators and simply discarded the connectivity information to obtain the nodes~\cite{liu2003mesh}. However, such procedure is computationally wasteful and conceptually wrong. Additionally, it can also be problematic, since some authors reported that it failed to produce nodal distributions of sufficient quality~\cite{shankar2018robust}. Researchers therefore soon started proposing dedicated node positioning algorithms. In this paper, a dimension-independent node generation algorithm~\cite{slak2019generation} is used to populate the domain with scattered nodes. The algorithm ensures a quasi-uniform internodal distance $h$ as seen in figure~\ref{fig:domain_discretization}. \begin{figure} \centering \includegraphics[width=\linewidth]{figs/domain_discretization.pdf} \caption{An example of circular domain populated with scattered nodes. Circles represent the nodes in the interior of the domain while the crosses are on its boundary.} \label{fig:domain_discretization} \end{figure} \subsection{Approximation of partial differential operators} \label{sec:approx} The behavior of a numerical method for solving systems of PDEs is defined by the approximation of partial differential operators. In the scope of meshless methods, the approximation is done as follows: Consider an operator $\L$ at a point $\b{x} _c$. The approximation of $\L$ is sought using the ansatz \begin{equation} \label{eq:ansatz} (\L u)(\b{x} _c) \approx \sum_{i = 1}^n w_i u(\b{x} _i), \end{equation} where $w_i$ are the \emph{stencil weights}, $n$ is the \emph{stencil size} or \emph{support size}, and $u$ is the unknown function. To simplify the writing, the weights and function values are assembled into vectors $\b w_\L(\b{x} _c)$ and $\b u$ respectively. This notation allows us rewrite the operator approximation~\eqref{eq:ansatz} in the form of a dot product between the two vectors \begin{equation} \label{eq:ansatz_dot} (\L u)(\b{x} _c) \approx \b w_\L(\b{x} _c)^\mathsf{T} \b u. \end{equation} While the field values $\b u$ from equation~\eqref{eq:ansatz_dot} are considered as unknown, the weights $\b w_\L(\b{x}_c)$ need to be determined. To determine the weights, equality in equation~\eqref{eq:ansatz_dot} is enforced for a given set of basis functions. In this paper we use RBFs, denoted as $\phi _j$. The radially symmetric RBFS, centered at stencil nodes $\b{x} _i$, can be written in the form \begin{equation} \phi _j (\b{x}) = \phi(\left \| \b{x} - \b{x} _j \right \|), \end{equation} for a radial function $\phi$. Each RBF corresponds to one linear equation \begin{equation} \sum_{i = 1}^n \b w _i \phi _j(\b{x}_i) = (\L \phi _j)(\b{x} _c) \end{equation} with unknown weights $\b w_i$ and index $i$ running over all support nodes. Assembling these $n$ equations into matrix form, we obtain a system of linear equations \begin{equation} \label{eq:rbf-system} \begin{bmatrix} \phi(\|\b{x}_1 - \b{x}_1\|) & \cdots & \phi(\|\b{x}_n - \b{x}_1\|) \\ \vdots & \ddots & \vdots \\ \phi(\|\b{x}_1 - \b{x}_n\|) & \cdots & \phi(\|\b{x}_n - \b{x}_n\|) \end{bmatrix} \begin{bmatrix} w_1 \\ \vdots \\ w_n \end{bmatrix} = \begin{bmatrix} l_{\phi, 1} \\ \vdots \\ l_{\phi, n} \\ \end{bmatrix} \end{equation} for \begin{equation} l_{\phi, j} = (\L \phi(\|\b{x} - \b{x}_j\|))|_{\b{x} = \b{x}_c}. \end{equation} The system~\eqref{eq:rbf-system} is often compactly written as \begin{equation} \b A\b w = \b l_\phi, \end{equation} where $\b A$ is symmetric and for some basis functions positive definite~\cite{buhmann2003radial}. There are many different choices for RBFs. However, commonly used Hardy's multiquadrics or Gaussians both depend on the shape parameter that directly affects the stability and accuracy of the approximation~\cite{schaback1995error}. To avoid shape parameters entirely, Polyharmonic splines (PHS) are used, defined as \begin{equation} \phi(r) = \begin{cases} r^k, & k \text{ odd} \\ r^k\log r, & k \text{ even} \end{cases}, \end{equation} where $r$ denotes the Euclidean distance. Note that using the PHS alone does not guarantee the convergence of local approximations from equation~\eqref{eq:rbf-system}. Therefore, the approximation is additionally augmented with monomials to omit the problems~\cite{bayona2017role}, which is done as follows. Let $p_1, \dots, p_s$ be polynomials for which exactness of ansatz~\eqref{eq:ansatz_dot} is again enforced. Monomials are often chosen up to a certain order $m$, resulting in $s=\binom{m+d}{m}$ monomials for a $d$-dimensional space. The additional enforcement is introduced by extending the system~\eqref{eq:rbf-system} with the new conditions \begin{equation} \label{eq:rbf-system-aug} \begin{bmatrix} \b A & \b P \\ \b P^\mathsf{T} & \b 0 \end{bmatrix} \begin{bmatrix} \b w \\ \b \lambda \end{bmatrix} = \begin{bmatrix} \b \ell_{\phi} \\ \b \ell_{p} \end{bmatrix}. \end{equation} Here \begin{equation} \b P = \begin{bmatrix} p_1(\b x_1) & \cdots & p_s(\b x_1) \\ \vdots & \ddots & \vdots \\ p_1(\b x_n) & \cdots & p_s(\b x_n) \\ \end{bmatrix} \end{equation} is a $n \times s$ matrix of polynomials evaluated at stencil nodes and \begin{equation} \b \ell_p = \begin{bmatrix} (\L p_1)|_{\b x=\b x _c} \\ \vdots \\ (\L p_s)|_{\b x=\b x_ c} \\ \end{bmatrix} \end{equation} is the vector of values assembled by applying the considered operator $\L$ to the polynomials at $\b x_c$. Weights obtained by solving~\eqref{eq:rbf-system-aug} are taken as approximations of $\L$ at $\b x_ c$ while additional unknowns $\b \lambda$, the Lagrange multipliers, are discarded. The augmentation with monomials not only helps with convergence but also provides direct control over the convergence rate, since the local approximation of the linear operator has the same order as the basis used~\cite{bayona2017role}, while the RBF part handles the potential ill-conditioning in purely polynomial approximations~\cite{flyer2016role}. \subsection{PDE discretization} Consider the boundary value problem with dirichlet boundary condition \begin{align} \label{eq:bvp} \L u = f & \text{ in } \Omega, \\ u = g & \text{ on } \partial \Omega. \end{align} The domain $\Omega$ is discretized with $N$ scattered nodes $\b{x}_i$ with quasi-uniform internodal spacing $h$. Out of $N$ nodes, $N_i$ are in the interior and $N_d$ on the boundary $\partial \Omega$. The stencils $\mathcal N(\b x_i)$ for each node $\b x_i$ are then selected. Commonly a single stencil constitutes of $n$ closest points, including the node itself. Choosing the right stencil size $n$ is far for trivial, however it has been recommended by Bayona~\cite{bayona2017role} to take at least $n=2\binom{m+d}{d}$ nodes. In the next step, linear operator $\L$ is approximated at nodes $\b{x}_i$, using the procedure described in section~\ref{sec:approx}. For each interior node $\b{x}_i$, the equation $(\L u)(\b{x}_i) = f(\b{x}_i)$ is approximated by a linear equation \begin{equation} \label{eq:disc-eq} \b w_\L(\b{x}_i)^\mathsf{T} \b u = \b f, \end{equation} where vectors $\b f$ and $\b u$ represent values of function $f$ and unknowns $u$ in stencil nodes of $\b{x}_i$. Similarly, for each Dirichlet boundary node $\b{x}_i$, we obtain the equation \begin{equation} \label{eq:disc-dir} u_i = g(\b{x}_i). \end{equation} All $N_i + N_d$ equations are assembled into a linear sparse system, with approximately $Nn$ nonzero elements. The solution $u_h$ of the system is a desired numerical approximation of $u$. Note that using the spatially variable order of the approximation method can lead to a very different number of nonzero elements in the linear sparse system. \section{Numerical example} \label{sec:num_example} The behavior of the described solution procedure and its implementation is studied on a Poisson problem with Dirichlet boundary condition. We aim to demonstrate and analyze the $p$-refined solution procedure, where the order of the approximation method varies throughout the computational nodes in the domain. Governing equations are \begin{align} \nabla^2 u (\b{x}) & = f_{\text{lap}}(\b{x}) & \text{ in } \Omega, \\ u (\b{x}) & = f(\b{x}) & \text{ on } \partial \Omega \end{align} where the domain $\Omega$ is a $d = 2$ dimensional circle \begin{equation} \Omega = \left \{ \b{x} \in \mathbb{R}^2, \left \| \b{x} \right \| \leq \frac 3 2 \right \}. \end{equation} To fully exploit the advantages of $p$-refinement, the right hand side $f(\b{x})$ was chosen to have a relatively strong source within the domain at $\b{x}_s = \b{\frac12}$, i.e.\ \begin{equation} f(\b{x}) = \frac{1}{25 \left \| 4\b{x} - \b 2 \right \|^ 2 + 1}. \end{equation} The Laplacian from $f$ can also be computed as \begin{equation} f_{\text{lap}} (\b{x}) = 3200\frac{25 \left \| 4\b{x} - \b 2 \right \|^ 2}{f(\b{x})^3} - 800\frac{d}{f(\b{x})^2} . \end{equation} The domain was filled with $N$ scattered nodes ranging from $N=1093$ to $N=978013$. The problem was solved using RBF-FD with PHS augmented with monomials of order $m \in \left \{ 2, 4, 6 \right \}$. Stencils for each node were selected by taking $n$ closest nodes where $n$ was determined as recommended by Bayona~\cite{bayona2017role} \begin{equation} n = 2\binom{m + d}{d}. \end{equation} To demonstrate the effect of $p$-refinement any combination of approximation orders $m$ can be used. Naturally, to increase the overall convergence rate of the numerical solutions, the highest approximation order is used where the numerical solution is expected to have the biggest error, e.g.\ in the neighborhood of the strong source at $\b{x}_s$. We define two radii $r_6$ and $r_4$ around source center $\b{x}_s$. All computational nodes within the radius $r_6$, i.e.\ $\left \{ \b{x}_i,\left \| \b{x}_i - \b{x}_s \right \| \leq r_6 \right \}$, are assigned with approximation augmented with monomials of degree $m=6$, nodes within the annulus $\left \{ \b{x}_i,r_6 < \left \| \b{x}_i - \b{x}_s \right \| \leq r_4 \right \}$ are assigned approximation augmented with monomials of degree $m=4$, while the remaining nodes are assigned approximation augmented with monomials of degree $m=2$. So the order of the approximation method is spatially variable and can be compactly written as \begin{equation} m = \left\{\begin{matrix} 6, & \left \| x_i - x_s \right \| \leq r_6 \\ 4, & r_6<\left \| x_i - x_s \right \| \leq r_4 \\ 2, & \text{otherwise.} \end{matrix}\right. \end{equation} Additionally, three different combinations $c_i$ of radii $r_6$ and $r_4$ have been used in this paper \begin{align} c_1 & = \left \{r_6= 0, r_4 = \frac{1}{10}\right \}, \\ c_2 & = \left \{r_6= \frac{1}{10}, r_4 = \frac{1}{5}\right \} \text{ and} \\ c_3 & = \left \{r_6= \frac{1}{5}, r_4 = \frac{2}{5}\right \}. \end{align} All three cases of spatially variable order of the approximation method are also shown in figure~\ref{fig:radiuses}. \begin{figure} \centering \includegraphics[]{figs/radiuses.pdf} \caption{Three different stages of $p$-refinement used. Squares are used to mark the nodes where approximation is augmented with monomials of order $m=6$, circles for $m=4$ and crosses for $m=2$.} \label{fig:radiuses} \end{figure} \subsection{Error evaluation} Closed form solution $u$ allows us to compute the accuracy of numerical solution $u_h$. In this paper, the error is evaluated in computational nodes with the infinity norm \begin{equation} e_{\infty} = \frac{\|u_h - u\|_\infty}{\|u\|_\infty}, \quad \|u\|_\infty = \max_{i=1, \ldots, N} \end{equation} The infinity norm is chosen as it is the strictest, but the authors also observed the same behavior using 2-norm or 1-norm. \section{Results} \label{sec:results} We compare the convergence rates of unrefined and $p$-refined numerical solution $u_h$ to the problem from section~\ref{sec:num_example}. Finally, we also study the effect of $p$-refinement on computational times. \subsection{Convergence rates} Convergence rates were estimated by computing the slope of the appropriate data subset. Selected convergence rates are shown in figure~\ref{fig:conv}. We observe that the numerical solutions converge for all chosen augmentation orders $m \in \left \{ 2, 4, 6 \right \}$. The expected convergence rate of $O(h^m)$ is, however, not reached, but that is to be expected due to the strong source within the computational domain. The convergence curve of a $p$-refined solution for combination $c_2$ is also added to the figure~\ref{fig:conv}. It is clear that the refined solution convergences at a significantly better convergence rate compared to the convergence rate at $m=2$, regardless of the fact that the majority of the stencils were still computed using monomials of order $m=2$. This confirms our beliefs that the biggest contribution to the error comes from the strong source and that the error can be, to some extent, mitigated by locally using a higher order method, i.e.\ $p$-refinement. \begin{figure} \centering \includegraphics[width=\linewidth]{figs/convergence.pdf} \caption{Convergence rates for different augmentation orders $m$ with respect to the number of nodes $N$.} \label{fig:conv} \end{figure} The effect of $p$-refinement is furthermore studied in figure~\ref{fig:conv_ref}, where convergence rates of refined solutions for all combinations $\b c$ of radius values are shown. We observe how the number of nodes used for higher order approximation affects the convergence rates. The convergence rate for combination $c_3$ with the most higher order node stencils, is practically the same as the convergence rate of unrefined solution with the highest augmented monomial $m=6$, even though $m=6$ augmentation has only been applied to roughly 2 \% of all computational nodes and $m=4$ to roughly 5 \%. \begin{figure} \centering \includegraphics[width=\linewidth]{figs/refined_convergence.pdf} \caption{Refined convergence rates for different radius values combinations.} \label{fig:conv_ref} \end{figure} \subsection{Computation times} In this section an overview of the total computational times is provided. All computations were performed on a single core of a computer with \texttt{AMD EPYC 7702 64-Core} processor and 512GB of DDR4 memory. Code was compiled using \texttt{g++ (GCC) 9.3.0} for Linux with \texttt{-O3 -DNDEBUG} flags. The sparse system is solved using the Pardiso solver on a single thread. The total computational times are shown in figure~\ref{fig:times}, where the best run out of 5 is selected. The total computational times of unrefined solutions (dashed lines) increases with the monomial order $m$. This is expected, since the higher the order the larger the required stencil size and consequently longer computational times. The computational times for all refined solutions are similar to the unrefined solutions augmented with monomial order $m=2$, which is also expected since the majority ($\approx$ 93 \%) of the nodes are assigned with augmentation using monomials of degree $m=2$, however, results show that all refined solutions exhibit much better convergence rates (see figures~\ref{fig:conv} and~\ref{fig:conv_ref}). This ultimately means that employing the $p$-refinement enabled us to obtain significantly better convergence behavior with little to no additional costs to execution time. Furthermore, refined solution for $c_3$ combination with the largest radius values, measures the same convergence rate as unrefined with $m=6$ ($k = -3.97$ vs.\ $k = -3.98$ respectively), but the former solution was obtained approximately two times faster. \begin{figure} \centering \includegraphics[width=\linewidth]{figs/times.pdf} \caption{Total computational times with respect to the domain size $N$.} \label{fig:times} \end{figure} \section{Conclusions} \label{sec:conclusions} A $p$-refinement procedure the RBF-FD meshless method is presented, where the order of the local approximation is spatially variable. We employed RBF-FD using PHS augmented with monomials of different degrees to solve a Poisson problem with a strong source within the computational domain. It is shown that $p$-refinement can improve the convergence rates at a very small cost to execution time, and much faster, that using a method with a higher global order of convergence. However, observations show that the $p$-refinement has its limitations. In some cases, specially with local strong sources, the local description of the considered field is just not sufficient to provide good local approximations of linear differential operators. Therefore a plan is to combine the benefits of $p$-refinement with spatially variable nodal distributions, to provide better approximations around critical areas within the domain. This is also known as $hp$-refinement, and presents a major step towards $hp$-adaptivity. \bibliographystyle{IEEEtran}
\section{Introduction}\label{sec.introduction} In this paper, we consider the design, analysis, and implementation of a stochastic inexact sequential quadratic optimization (SISQO) algorithm for minimizing a stochastic objective function subject to deterministic equality constraints. Specifically, we consider problems that may be written in the form \bequation\label{prob.opt} \min_{x\in\R{n}}\ f(x)\ \st\ c(x) = 0,\ \text{with}\ f(x) = \E[F(x,\omega)], \eequation where $f : \R{n}\to\R{}$ and $c : \R{n} \to \R{m}$ are continuously differentiable, $\omega$~is a random variable with probability space $(\Omega,\Fcal,P)$, $F : \R{n}\times\Omega\to\R{}$, and $\E[\cdot]$ represents expectation taken with respect to the distribution of $\omega$. Problems of this type arise in numerous important application areas. A partial list is the following: (i) learning a deep convolutional neural network for image recognition that imposes properties (e.g., smoothness) of the systems of partial differential equations (PDEs) that the convolutional layers are meant to interpret \cite{RuthHabe20}; (ii) multiple deep learning problems including physics-constrained deep learning for high-dimensional surrogate modeling and uncertainty quantification without labeled data \cite{ZhuZabaKoutPerd19}, natural language processing with constraints on output labels \cite{NandPathAbhiSing19}, image classification, detection, and localization \cite{RaviDinhLokhSing19}, deep reinforcement learning \cite{AchiHeldTamaAbbe17}, deep network compression \cite{ChenTungVeduMori18}, and manifold regularized deep learning \cite{KumaSoumMhamHara18,TomaRose14}; (iii) accelerating the solution of PDE-constrained inverse problems by using a reduced-order model in place of a full-order model, coupled with techniques to learn the discrepancy between the reduced-order and full-order models \cite{SherRaguMoreAdamThan19}; (iv) multi-stage modeling \cite{ShapDentRusz14}; (v) portfolio selection \cite{ShapDentRusz14}; (vi) optimal power flow \cite{SummWarrMoraLyge15,VrakMathAnde14,WoodWollSheb13}; and (vii) statistical problems such as maximum likelihood estimation with constraints \cite{ChatChenMaasCarr16,Geye91}. (For an overview of the promises and limitations of imposing hard constraints during deep neural network training, see \cite{MarqSalzFua17}.) Popular algorithmic approaches for solving problems of the form~\eqref{prob.opt} when the objective function~$f$ is \emph{deterministic} include penalty methods~\cite{Cour43,Flet13} and sequential quadratic optimization (SQO) methods~\cite{Powe78a,Wils63}. Penalty methods (which include popular strategies such as the augmented Lagrangian method and its variants) handle the constraints indirectly by adding a measure of constraint violation to the objective function, perhaps aided by information related to Lagrange multiplier estimates. The resulting unconstrained optimization problem, which can be nonsmooth depending on the choice of the constraint violation measure, may be solved using a host of methods such as line search, trust region, cubic regularization, subgradient~\cite{Shor12}, or proximal methods~\cite{KaplTich98,Rock76} (with the appropriateness of the method depending on whether the constraint violation measure is smooth or nonsmooth). It is often the case that a sequence of such unconstrained problems needs to be solved to obtain appropriate Lagrange multiplier estimates and/or to identify an adequate weighting between the original objective $f$ and the measure of constraint violation so that the original constrained problem can be solved to reasonable accuracy. SQO methods, on the other hand, handle the constraints directly by employing local derivative-based approximations of the nonlinear constraints in explicit affine constraints in the subproblems employed to compute search directions. For example, so-called line search SQO methods are considered state-of-the-art for solving deterministic equality constrained optimization problems~\cite{Han77,HanMang79,Powe78b}. During each iteration of such a line search SQO method, a symmetric indefinite linear system of equations is solved, followed by a line search on an appropriate merit function to compute the next iterate. (Here, the linear system can be seen as being derived from applying Newton's method to the stationarity conditions for the nonlinear problem, and for this reason in the setting of equality constrained optimization, SQO methods are often referred to as Newton methods.) For large-scale problems, factorizing the matrix in this linear system may be prohibitively expensive, in which case it may be preferable instead to apply an iterative linear system solver, such as MINRES~\cite{PaigSaun75}, to the linear system. This, in turn, opens the door to employing inexact subproblem solutions that may offer a better balance between per-iteration and overall computational costs of the algorithm for solving the original nonlinear problem. Identifying appropriate inexactness conditions that ensure that each search direction is sufficiently accurate so that the SQO algorithm is well posed and converges to a solution (under reasonable assumptions) is a challenging task with few solutions~\cite{BiroGhat03,ByrdCurtNoce08,ByrdCurtNoce10,HeinRidz08b,HeinVice02}. The success of SQO methods in the deterministic setting motivates us to study their extensions to the \emph{stochastic} setting, which is a very challenging task. We are only aware of three papers, namely~\cite{BeraCurtONeiRobi21,BeraCurtRobiZhou21,NaAnitKola21}, that present algorithms for solving stochastic optimization problems with deterministic nonlinear equality constraints that offer convergence guarantees with respect to solving the constrained problem (rather than, say, merely a minimizer of a penalty function derived from the constrained problem). The algorithm in~\cite{NaAnitKola21} is a line search method that uses a differentiable exact augmented Lagrangian function as its merit function, whereas \cite{BeraCurtRobiZhou21} (resp.,~\cite{BeraCurtONeiRobi21}) is an SQO method that uses an $\ell_1$-norm (resp.,~$\ell_2$-norm) penalty function as its merit function. All of these methods must factorize a matrix during each iteration, which may not be tractable for large-scale problems. This motivates the work in this paper, which extends the methods in~\cite{BeraCurtONeiRobi21,BeraCurtRobiZhou21} to allow for inexact subproblem solutions, thereby making our approach applicable for solving problem~\eqref{prob.opt} in large-scale settings. \subsection{Contributions} The contributions of this paper pertain to a new algorithm for solving problem~\eqref{prob.opt}, which we now summarize. (i) We design a SISQO method for solving the stochastic optimization problem~\eqref{prob.opt} that is built upon a set of conditions that determine what constitutes an acceptable inexact subproblem solution along with an adaptive step size selection policy. The algorithm employs an $\ell_2$-norm merit function, the parameter of which is updated dynamically by a procedure that has been designed with considerable care, since it is this parameter that balances the emphasis between the objective function and the constraint violation in the optimization process. (ii) Under mild assumptions that include good behavior of the adaptive merit parameter (which can be justified as explained in the paper), we prove convergence in expectation of our algorithm. (iii) We present numerical results that compare our SISQO algorithm to a stochastic exact SQO algorithm. These experiments show that our SISQO algorithm benefits from our proposed inexactness strategy. \subsection{Notation} Let $\R{}$ denote the set of real numbers, $\R{}_{\geq p}$ (resp., $\R{}_{>p}$) denote the set of real numbers greater than or equal to (resp., strictly greater than) $p\in\R{}$, and $\N{} := \{0,1,2,\ldots\}$ denote the set of natural numbers. Let $\R{n}$ denote the set of $n$-dimensional real vectors, $\R{m\times n}$ denote the set of $m$-by-$n$-dimensional real matrices, and $\Smbb^n$ denote the set of $n$-by-$n$-dimensional symmetric real matrices. For any $p \in \N{} \setminus \{0\}$, let $[p] := \{1,\ldots,p\}$. The $\ell_2$-norm is written simply as $\|\cdot\|$. Our algorithm generates a sequence of iterates $\{x_k\}$ where $x_k\in\R{n}$ for all $k\in\N{}$. For all $k \in \N{}$, we append the subscript $k$ to other quantities defined in the $k$th iteration of the algorithm, and for brevity we define $\nabla f_k := \nabla f(x_k)$, $c_k := c(x_k)$, and $J_k = \nabla c(x_k)^T$. We refer to the range space of $J_k^T$ as $\Range(J_k^T)$ and refer to the null space of $J_k$ as $\Null(J_k)$, and recall that the Fundamental Theorem of Linear Algebra provides that these spaces are orthogonal and $\Range(J_k^T) + \Null(J_k) = \R{n}$. Finally, recall (see, e.g., \cite{NoceWrig06}) that a \emph{primal} point $x \in \R{n}$ and \emph{dual} point $y \in \R{m}$ constitute a first-order stationary point for problem~\eqref{prob.opt} if and only if \bequation\label{eq.stationary} c(x) = 0\ \ \text{and} \ \ \nabla f(x) + \nabla c(x)y = 0. \eequation These conditions are necessary for $x$ to be a local minimizer when the constraint functions satisfy a constraint qualification, as is assumed in the paper; see Assumption~\ref{ass.main}. \subsection{Organization} Our algorithm is presented in Section~\ref{sec.stochastic}. Our convergence analysis for the algorithm is presented in Section~\ref{sec.analysis}. The results of numerical experiments are presented in Section~\ref{sec.numerical} and concluding remarks are presented in Section~\ref{sec.conclusion}. \section{SISQO Algorithm}\label{sec.stochastic} Our proposed algorithm generates a sequence \bequationNN \{(x_k,y_k,v_k,u_k,d_k,\delta_k,\tau_k,\alpha_k)\} \subset \R{n}\times\R{m}\times\R{n}\times\R{n}\times\R{n}\times\R{m}\times\R{}_{>0}\times\R{}_{>0}, \eequationNN where, for all $k \in \N{}$, $(x_k,y_k)$ is a primal-dual iterate pair, $v_k$ is a \emph{normal} direction that aims to reduced infeasibility by reducing a local derivative-based model of the $\ell_2$-norm constraint violation measure, $u_k$ is a \emph{tangential} direction that aims to maintain the reduction in linearized infeasibility achieved by the normal direction while also aiming to reduce the objective function by reducing a stochastic-gradient-based quadratic approximation of the objective, $d_k := v_k + u_k$ is a full primal search direction, $\delta_k$ is a dual search direction, $\tau_k$ is a merit function parameter, and $\alpha_k$ is a step size that aims to produce $x_{k+1} \gets x_k + \alpha_k d_k$ yielding sufficient reduction in the $\ell_2$-norm merit function. (The algorithm also generates sequences of adaptive auxiliary parameters that are introduced throughout our algorithm description.) In the remainder of this section, we discuss each of these quantities in further detail toward our complete algorithm statement, which is provided as Algorithm~\ref{alg:stochastic_sqp_adaptive} on page~\pageref{alg:stochastic_sqp_adaptive}. For the remainder of the paper, we make the following assumption. \bassumption\label{ass.main} Let $\Xcal\subseteq\R{n}$ be an open convex set containing the iterate sequence $\{x_k\}$ generated by any run of our algorithm. The objective function $f:\R{n}\to\R{}$ is continuously differentiable and bounded below over $\Xcal$ and its gradient function $\nabla f:\R{n}\to\R{n}$ is Lipschitz continuous with constant $L \in \R{}_{>0}$ $($with respect to the $\ell_2$-norm$)$ and bounded over $\Xcal$. The constraint function $c:\R{n}\to\R{m}$ $($with $m\leq n$$)$ is continuously differentiable and bounded over $\Xcal$ and its Jacobian function $J:\R{n}\to\R{m\times n}$ is Lipschitz continuous with constant $\Gamma \in \R{}_{>0}$ $($with respect to the induced $\ell_2$-norm$)$ and bounded over $\Xcal$. In addition, for all $x \in \Xcal$, the Jacobian $J(x)$ has singular values that are bounded uniformly below by a positive real number. \eassumption Such an assumption is standard in the literature on deterministically constrained optimization. Observe that it does not include an assumption that $\Xcal$ is bounded. \subsection{Merit function}\label{sec.Merit} Motivated by the success of numerous line search SQO methods for solving deterministic equality constrained optimization problems, our algorithm employs an exact penalty function as a merit function; in particular, it employs the $\ell_2$-norm merit function $\phi:\R{n}\times\R{}_{>0}\to\R{}$ defined by \bequation\label{eq.merit} \phi(x,\tau) = \tau f(x) + \|c(x)\|, \eequation where $\tau$ is a positive \emph{merit parameter} that is updated adaptively by the algorithm. (The choice of the $\ell_2$-norm in $\phi$ is not essential for our method. Another norm could be used instead. The choice of the $\ell_2$-norm merely makes certain calculations simpler for our presentation and analysis.) A model $l:\R{n}\times\R{}_{>0}\times\R{n}\times\R{n}\to\R{}$ of the merit function based on $g \approx \nabla f(x)$ and $\nabla c(x)$ is given by \bequationNN l(x,\tau,g,d) = \tau(f(x) + g^Td) + \|c(x) + \nabla c(x)^Td\|, \eequationNN with which we define the model reduction function $\Delta l:\R{n}\times\R{}_{>0}\times\R{n}\times\R{n}\to\R{}$ by \bequation\label{eq.model_reduction} \baligned \Delta l(x,\tau,g,d) =&\ l(x,\tau,g,0) - l(x,\tau,g,d) \\ :=&\ -\tau g^Td + \|c(x)\| - \|c(x) + \nabla c(x)^Td\|. \ealigned \eequation The merit function, and in particular the model reduction function \eqref{eq.model_reduction}, play critical roles in our inexactness conditions for defining acceptable search directions and in our step size selection scheme, as can be seen in the following subsections. \subsection{Computing a search direction}\label{sec:direction} During the $k$th iteration, the algorithm computes a normal direction $v_k\in \Range(J_k^T)$ based on the subproblem \bequation\label{prob.normal} \min_{v\in\Range(J_k^T)}\ \tfrac{1}{2}\|c_k + J_kv\|^2. \eequation Instead of solving \eqref{prob.normal} exactly, the algorithm allows for an inexact solution to be employed by only requiring the computation of $v_k \in \Range(J_k^T)$ satisfying \bequation\label{eq.Cauchy_decrease} \|c_k\| - \|c_k + J_kv_k\| \geq \epsilon_c(\|c_k\| - \|c_k + \alpha_k^c J_k v_k^c\|) \eequation (commonly known as the Cauchy decrease condition), where $\epsilon_c\in (0,1]$ is a user-defined constant. In \eqref{eq.Cauchy_decrease}, $v_k^c := -J_k^Tc_k$ is the negative gradient direction for the objective of \eqref{prob.normal} at $v=0$ and $\alpha_k^c$ is the step size along $v_k^c$ that minimizes $\|c_k + \alpha J_k v_k^c\|$ over $\alpha \in \R{}$. If $\|c_k\| \neq 0$, then under Assumption~\ref{ass.main} it follows that $\|J_k^Tc_k\| \neq 0$, \bequation\label{eq.alphac} \alpha_k^c = \|J_k^Tc_k\|^2/ \|J_kJ_k^Tc_k\|^2 > 0,\ \ \|\alpha_k^c v_k^c\| \neq 0,\ \ \text{and}\ \ \|c_k\| - \|c_k + \alpha_k^c J_k v_k^c\| > 0; \eequation otherwise, if $\|c_k\| = 0$, then $\|J_k^Tc_k\| = 0$ and it follows that $v_k = 0$ is the unique solution to~\eqref{prob.normal}. Popular choices for computing a normal direction satisfying the aforementioned conditions include any of various Krylov subspace methods, such as the linear conjugate gradient (CG) method; see, e.g., \cite{NoceWrig06}. Before describing the algorithm's procedure for computing the tangential direction, let us first introduce assumptions that the algorithm makes related to the stochastic gradients $\{g_k\}$ and symmetric matrices $\{H_k\}$ that it employs. \bassumption\label{ass.g} There exists $M_g \in \R{}_{>0}$ such that, for all $k \in \N{}$, the stochastic gradient $g_k$ has the properties that $\E_k[g_k] = \nabla f_k$ and $\E_k[\|g_k - \nabla f_k\|^2] \leq M_g$, where $\E_k[\cdot]$ denotes expectation with respect to the distribution of $\omega$ $($recall~\eqref{prob.opt}$)$ conditioned on the event that $x_k$ is the primal iterate in iteration $k \in \N{}$. \eassumption Combining Assumption~\ref{ass.g} with Jensen's Inequality, it holds for all $k \in \N{}$ that \bequation\label{jensens-M} \E_k[\|\nabla f_k - g_k\|] \leq \sqrt{\E_k[\|\nabla f_k - g_k\|^2]} \leq \sqrt{M_g}. \eequation \bassumption\label{ass.H} For all $k \in \N{}$, the matrix $H_k \in \Smbb^n$ is chosen independently from $g_k$. In addition, there exist $M_H \in \R{}_{>0}$ and $\zeta \in\R{}_{>0}$ such that, for all $k \in \N{}$, it holds that $\|H_k\| \leq M_H$ and $u^TH_ku \geq \zeta\|u\|^2$ for all $u \in \Null(J_k)$. \eassumption For describing the tangential direction computation as it is performed in our algorithm, let us first describe what would be the computation of a tangential direction in a determinstic variant of our approach. In particular, given $(x_k,y_k)$, $\nabla f_k$, a normal direction $v_k\in \Range(J_k^T)$, and $H_k$ satisfying Assumption~\ref{ass.H}, consider the subproblem \bequation\label{prob.tangential_true} \min_{u\in\R{n}}\ (\nabla f_k + H_kv_k)^Tu + \tfrac{1}{2}u^TH_ku \ \ \text{s.t.}\ J_ku = 0, \eequation which has the unique solution $\uTrue_k \in \Null(J_k)$ that satisfies, for some $\delta^{\rm true}_k \in \R{m}$, \bequation\label{eq.linear_system_true} \bbmatrix H_k & J_k^T \\ J_k & 0 \ebmatrix \bbmatrix \uTrue_k \\ \delta^{\rm true}_k \ebmatrix = -\bbmatrix \nabla f_k + H_kv_k + J_k^Ty_k \\ 0 \ebmatrix. \eequation This allows us to define, for purposes of our analysis only, the \emph{true and exact} primal-dual search direction (conditioned on $x_k$ being the $k$th iterate) as $(d^{\rm true}_k,\delta^{\rm true}_k)$, where $d^{\rm true}_k := v_k + \uTrue_k$. Since our algorithm only has access to a stochastic gradient estimate in each iteration, the corresponding \emph{exact} (but not \emph{true}) primal-dual search direction is given by $(d_{k,*},\delta_{k,*})$, where $d_{k,*} := v_k + u_{k,*}$ with $(u_{k,*},\delta_{k,*})$ satisfying \bequation\label{eq.linear_system_exact} \bbmatrix H_k & J_k^T \\ J_k & 0 \ebmatrix \bbmatrix u_{k,*} \\ \delta_{k,*} \ebmatrix = -\bbmatrix g_k + H_kv_k + J_k^Ty_k \\ 0 \ebmatrix. \eequation Our algorithm, to avoid having to form or factor the matrix in \eqref{eq.linear_system_exact} in order to solve the system exactly, computes a tangential direction by computing $(u_k,\delta_k)$ through iterative linear algebra techniques applied to the symmetric indefinite system~\eqref{eq.linear_system_exact}. In particular, our algorithm computes $(u_k,\delta_k)$ such that the full primal search direction $d_k := v_k + u_k$, dual search direction $\delta_k$, and residual defined by \bequation\label{eq.linear_system} \bbmatrix \rho_k \\ r_k \ebmatrix := \bbmatrix H_k & J_k^T \\ J_k & 0 \ebmatrix \bbmatrix u_k \\ \delta_k \ebmatrix + \bbmatrix g_k + H_kv_k + J_k^Ty_k \\ 0 \ebmatrix \eequation satisfy at least one of a couple sets of conditions. In the remainder of this subsection, we describe the sets of conditions that the algorithm employs to determine what constitutes an acceptable search direction (and corresponding pair of residuals). In the deterministic setting, line search SQO methods commonly combine the search direction with an updating strategy for the merit parameter in a manner that ensures that the computed search direction is one of sufficient descent for the merit function. The required descent condition is guaranteed to be satisfied by choosing the merit parameter to be sufficiently small so that the reduction in a model of the merit function (recall \eqref{eq.model_reduction}) is sufficiently large; see, e.g., \cite[Lemma~3.1]{ByrdCurtNoce08}. Following such an approach, our algorithm requires that $(u_k,\delta_k)$ (yielding $d_k := v_k + u_k$) be computed and the merit parameter~$\tau$ be set such that the model reduction condition \bequation\label{eq.model_reduction_condition} \Delta l(x_k,\tau,g_k,v_k+u_k) \geq \sigma_u\tau\max\{u_k^TH_ku,\epsilon_u\|u_k\|^2\} + \sigma_c (\|c_k\| - \|c_k + J_kv_k\|) \eequation holds for some user-defined $\sigma_u\in (0,1)$, $\epsilon_u \in (0,\zeta)$, and $\sigma_c\in (0,1)$. (The particular value for the merit parameter $\tau$ for which the inequality \eqref{eq.model_reduction_condition} is required to hold depends on one of two different situations, as described below.) Condition \eqref{eq.model_reduction_condition} plays a central role in the conditions that we require $(u_k,\delta_k)$ to satisfy. We define these in the context of \emph{termination tests}, since they dictate conditions that, once satisfied, can cause termination of an iterative linear system solver applied to \eqref{eq.linear_system_exact}. (The tests are inspired by the \emph{sufficient merit approximation reduction termination tests} developed in \cite{ByrdCurtNoce08,ByrdCurtNoce10,CurtNoceWach09} for the deterministic setting.) Our first termination test states that an inexact solution of this linear system is acceptable if the model reduction condition~\eqref{eq.model_reduction_condition} is satisfied with the current merit parameter value (i.e., $\tau \equiv \tau_k \gets \tau_{k-1}$), the norms of the residual vectors satisfy certain upper bounds, and either the tangential direction is sufficiently small in norm compared to the normal direction or the tangential direction is one of sufficiently positive curvature for $H_k$ and yields a sufficiently small objective value for \eqref{prob.tangential_true} (with~$g_k$ in place of $\nabla f_k$). The test makes use of a sequence $\{\beta_k\}$ that will also play a critical role in our step size selection scheme that is described in the next subsection. \smallskip \begin{tcolorbox}[colback=white] \textbf{Termination Test 1.} Given $\kappa\in (0,1)$, $\beta_k \in (0,1]$, $\kappa_\rho \in \R{}_{>0}$, $\kappa_r \in \R{}_{>0}$, $\kappa_u \in \R{}_{> 0}$, $\epsilon_u \in (0,\zeta)$, $\kappa_v \in \R{}_{> 0}$, $\sigma_u \in (0,1)$, $\sigma_c \in (0,1)$, and $v_k\in\Range(J_k^T)$ computed to satisfy~\eqref{eq.Cauchy_decrease}, the pair $(u_k,\delta_k)$ satisfies Termination Test~1 if, with the pair $(\rho_k,r_k)$ defined in~\eqref{eq.linear_system}, it holds that \bequation\label{eq.dual_residual_condition} \|\rho_k\| \leq \kappa \min \left\{ \left\|\bbmatrix g_k + J_k^T(y_k+\delta_k) \\ c_k\ebmatrix \right\|, \left\|\bbmatrix g_{k-1} + J_{k-1}^Ty_k \\ c_{k-1}\ebmatrix \right\| \right\}; \eequation \bequation\label{eq.pd_residual_condition} \|\rho_k\| \leq \kappa_\rho\beta_k\ \ \text{and} \ \ \|r_k\| \leq \kappa_r \beta_k; \eequation \bequation\label{eq.tangential_component_condition_1} \|u_k\| \leq \kappa_u\|v_k\|\ \ \text{or} \ \ \left\{ \baligned u_k^TH_ku_k &\geq \epsilon_u\|u_k\|^2 \ \ \text{and} \\ (g_k + H_kv_k)^Tu_k + \tfrac{1}{2}u_k^TH_ku_k &\leq \kappa_v\|v_k\| \ealigned \right\}; \eequation and \eqref{eq.model_reduction_condition} is satisfied with $\tau \equiv \tau_{k-1}$. (In this case, the algorithm will set $\tau_k \gets \tau_{k-1}$ so that \eqref{eq.model_reduction_condition} holds with $\tau \equiv \tau_k$.) \end{tcolorbox} Termination Test~1 cannot be enforced in every iteration in a run of the algorithm, even in the deterministic setting, since there may exist points in the search space at which all of the conditions required in the test cannot be satisfied simultaneously, even if the linear system \eqref{eq.linear_system_exact} is solved to arbitrary accuracy. In short, the algorithm needs to allow for the computation of a search direction for which \eqref{eq.model_reduction_condition} can only be satisfied with a decrease of the merit parameter. That said, the algorithm needs to be careful in terms of the situations in which such a decrease is allowed to occur, or else the merit parameter sequence may behave in a manner that ruins a convergence guarantee for solving the original constrained optimization problem. For our algorithm, we employ the following termination test for this situation. \smallskip \begin{tcolorbox}[colback=white] \textbf{Termination Test 2.} Given $\kappa \in (0,1)$, $\beta_k \in (0,1]$, $\kappa_\rho \in \R{}_{>0}$, $\kappa_r \in \R{}_{>0}$, $\kappa_u \in \R{}_{>0}$, $\epsilon_u \in (0,\zeta)$, $\kappa_v \in \R{}_{>0}$, $\epsilon_r \in (\sigma_c,1)$, and $v_k\in\Range(J_k^T)$ computed to satisfy~\eqref{eq.Cauchy_decrease}, the pair $(u_k,\delta_k)$ satisfies Termination Test~2 if, with the pair $(\rho_k,r_k)$ defined in~\eqref{eq.linear_system}, the conditions \eqref{eq.dual_residual_condition}--\eqref{eq.tangential_component_condition_1} hold along with \begin{align}\label{eq:TT2} \|c_k\| - \|c_k + J_kv_k + r_k\| \geq \epsilon_r(\|c_k\| - \|c_k + J_kv_k\|) > 0. \end{align} (In this case, for user-defined $\epsilon_{\tau}\in (0,1)$, the algorithm will set \bequation\label{eq:tau_update} \tau_k \gets \bcases \tau_{k-1} \quad &\text{if }\tau_{k-1}\leq \tau^{\rm trial}_k \\ \min\{(1-\epsilon_{\tau})\tau_{k-1},\tau^{\rm trial}_k\}\quad &\text{otherwise,} \ecases \eequation where \bequation\label{tautrail-def} \tau^{\rm trial}_k \gets \bcases \infty &\text{if }g_k^Td_k + \max\{u_k^TH_ku_k,\epsilon_u\|u_k\|^2\} \leq 0 \\ \tfrac{(1-\tfrac{\sigma_c}{\epsilon_r})(\|c_k\| - \|c_k + J_kv_k + r_k\|)}{g_k^Td_k + \max\{u_k^TH_ku_k,\epsilon_u\|u_k\|^2\}} &\text{otherwise,} \ecases \eequation so~\eqref{eq.model_reduction_condition} is satisfied with $\tau \equiv \tau_k$. See Lemma~\ref{lm:model_reduction_true} for a proof.) \end{tcolorbox} In Lemma~\ref{lem.direction_well_posed}, we show under a loose assumption about the behavior of the iterative linear system solver and a practical assumption about the algorithm iterates that, for all $k \in \N{}$, the algorithm can compute a pair $(u_k,\delta_k)$ satisfying at least one of Termination Test 1 or 2. Therefore, the index of each iteration of our method is contained in one of two index sets, namely, \bequationNN \baligned \Kcal_1 &:= \{k\in\N{}: (u_k,\delta_k) \ \text{satisfies Termination Test 1} \} \ \ \text{or} \\ \Kcal_2 &:= \{k\in\N{}: (u_k,\delta_k) \ \text{satisfies Termination Test 2, but not Termination Test 1} \}. \ealigned \eequationNN \subsection{Computing a step size} Upon the computation of $d_k \gets v_k + u_k$, our algorithm computes a positive step size $\alpha_k$ to determine $x_{k+1}$. Given positive Lipschitz constants $L$ and~$\Gamma$ (recall Assumption~\ref{ass.main}), it follows for all $\alpha \in \R{}_{>0}$ that \bequation\label{lip-consts} \baligned f(x_k + \alpha d_k) &\leq f_k + \alpha \nabla f_k^Td_k + \tfrac{1}{2}L\alpha^2\|d_k\|^2 \\ \text{and}\ \ \|c(x_k + \alpha d_k)\| &\leq \|c_k + \alpha J_kd_k\| + \tfrac{1}{2}\Gamma\alpha^2\|d_k\|^2. \ealigned \eequation Combining these inequalities with the definitions \eqref{eq.merit} and \eqref{eq.model_reduction}, the triangle inequality, and the definition of $r_k$ in \eqref{eq.linear_system}, one finds that \bequation\label{eq.merit_reduction_bound} \baligned &\ \phi(x_k+\alpha d_k,\tau_k) - \phi(x_k,\tau_k) \\ =&\ \tau_k f(x_k+\alpha d_k) - \tau_k f_k + \|c(x_k + \alpha d_k)\| - \|c_k\| \\ \leq&\ \alpha \tau_k \nabla f_k^Td_k + \|c_k + \alpha J_kd_k\| - \|c_k\| + \tfrac{1}{2}(\tau_k L + \Gamma)\alpha^2\|d_k\|^2 \\ \leq&\ \alpha \tau_k \nabla f_k^Td_k + (|1-\alpha| - 1)\|c_k\| + \alpha\|c_k + J_kd_k\| + \tfrac{1}{2}(\tau_k L + \Gamma)\alpha^2\|d_k\|^2 \\ =&\ -\alpha\Delta l(x_k,\tau_k,\nabla f_k,d_k) + (|1-\alpha| - (1-\alpha))\|c_k\| + \tfrac{1}{2}(\tau_k L + \Gamma)\alpha^2\|d_k\|^2. \ealigned \eequation This derivation provides a convex piecewise-quadratic upper-bounding function for the change in the merit function corresponding to a step from $x_k$ to $x_k + \alpha d_k$. Given user-defined $\eta\in(0,1)$ and the aforementioned sequence $\{\beta_k\}\subset(0,1]$, our algorithm's step size selection scheme makes use of the quantity \bequation\label{eq:stochastic_alpha_suff} \alpha^{\rm suff}_k := \min \left\{\tfrac{2(1-\eta)\beta_k\Delta l(x_k,\tau_k,g_k,d_k)}{(\tau_k L+\Gamma)\|d_k\|^2}, 1 \right\}. \eequation The definition of $\alpha^{\rm suff}_k$ can be motivated as follows. Its value, when $\beta_k = 1$, is the largest value on $[0,1]$ such that for all $\alpha\in[0,\alpha^{\rm suff}_k]$ the right-hand-side of~\eqref{eq.merit_reduction_bound} (with $\nabla f_k$ replaced by $g_k$) is less than or equal to $-\eta\alpha\Delta l(x_k,\tau_k,g_k,d_k)$. Such an inequality is representative of one enforced in deterministic line search SQO methods. Otherwise, with $\beta_k \in (0,1]$ introduced and not necessarily equal to 1, the value of $\alpha^{\rm suff}_k$ can be diminished over the course of the optimization process, which allows for step size control as is required for convergence guarantees for certain stochastic-gradient-based methods; see, e.g., \cite{BottCurtNoce18}. The first term inside the min appearing in~\eqref{eq:stochastic_alpha_suff} is important for the convergence guarantees that we prove for our method, but it can behave erratically due to the algorithm's use of stochastic gradient estimates. To account for this stochasticity, given user-defined $\epsilon_{\xi}\in (0,1)$, our algorithm defines \bequation\label{eq:stochastic_ratio} \xi^{\rm trial}_k := \tfrac{\Delta l(x_k,\tau_k,g_k,d_k)}{\tau_k\|d_k\|^2}\ \ \text{and} \ \ \xi_k := \bcases \xi_{k-1}\qquad &\text{ if }\xi_{k-1}\leq \xi^{\rm trial}_k \!\!\\ \min\{(1-\epsilon_{\xi})\xi_{k-1},\xi^{\rm trial}_k\} &\text{ otherwise,} \ecases \eequation so that $\xi_k \leq \xi^{\rm trial}_k = \Delta l(x_k,\tau_k,g_k,d_k)/(\tau_k\|d_k\|^2)$ for all $k\in\N{}$. Combining this inequality with~\eqref{eq:stochastic_alpha_suff}, the monotonically nonincreasing behaviors of $\{\xi_k\}$ and $\{\tau_k\}$, and assuming that the sequence $\{\beta_k\}$ is chosen to satisfy \bequation\label{betak-requirement} 2(1-\eta)\beta_k\xi_{-1}\tau_{-1}/\Gamma \in (0,1]\ \ \text{for all} \ \ k\in\N{} \eequation where $\xi_{-1}$ and $\tau_{-1}$ initialize the sequences $\{\xi_k\}$ and $\{\tau_k\}$, one finds \bequation\label{eq:stochastic_alpha_suff.new} \alpha^{\rm min}_k := \tfrac{2(1-\eta)\beta_k\xi_k\tau_k}{(\tau_k L+\Gamma)} \leq \min \left\{\tfrac{2(1-\eta)\beta_k\Delta l(x_k,\tau_k,g_k,d_k)}{(\tau_k L+\Gamma)\|d_k\|^2}, 1 \right\} \equiv \alpha^{\rm suff}_k. \eequation The value $\alpha^{\rm min}_k$ serves as a minimum value (i.e., a lower bound) for our choice of step size. In our analysis, we will also show that even though $\xi_k$ is stochastic for each $k\in\N{}$, the sequence $\{\xi_k\}$ is bounded away from zero deterministically (see Lemma~\ref{lem:xi-bound}). Next, let us derive a maximum value (i.e., an upper bound) for our algorithm's choice of step size. Consider the strongly convex function $\varphi : \R{} \to \R{}$ defined by \bequation\label{eq:stochastic_U_def} \baligned \varphi(\alpha) := &(\eta - 1)\alpha\beta_k\Delta l(x_k,\tau_k,g_k,d_k) + \|c_k + \alpha J_kd_k\| - \|c_k\| \\ &+ \alpha(\|c_k\| - \|c_k + J_kd_k\|) + \tfrac{1}{2}(\tau_k L+\Gamma)\alpha^2\|d_k\|^2. \ealigned \eequation Notice that when $\beta_k = 1$, it holds that $\varphi(\alpha) \leq 0$ for all $\alpha \in \R{}_{\geq0}$ if and only if the quantity in the third row of~\eqref{eq.merit_reduction_bound} (with $\nabla f_k$ replaced by $g_k$) is less than or equal to $-\eta\alpha\Delta l(x_k,\tau_k,g_k,d_k)$. Thus, following a similar argument as above, one can be motivated as to the fact that our algorithm never allows a step size larger than \bequation\label{eq.alpha_phi} \alpha^{\varphi}_k := \max\{ \alpha \in \R{}_{\geq0} : \varphi(\alpha) \leq 0\}. \eequation Finally, again to mitigate adverse affects caused by the use of stochastic gradient estimates, our algorithm employs the maximum step size \bequation\label{def-alphamax} \alpha^{\rm max}_k := \min \{ \alpha^{\varphi}_k, \alpha^{\rm min}_k + \theta\beta_k^2\}, \eequation where $\theta\in\R{}_{\geq 0}$ is user-defined. Overall, our algorithm allows any step size with $\alpha_k \in [\alpha^{\rm min}_k,\alpha^{\rm max}_k]$. Lemma~\ref{lm:stepsize_well_defined} shows that this interval is nonempty. \subsection{Updating the primal-dual iterate} In the primal space, our algorithm employs the iterate update $x_{k+1} \gets x_k + \alpha_k d_k$. However, in the dual space, it allows additional flexibility; in particular, the algorithm allows any $y_{k+1}$ such that \bequation\label{eq:stochastic_dual_update} \|g_k + J_k^Ty_{k+1}\|\leq \|g_k + J_k^T(y_k + \delta_k)\|. \eequation Clearly, choosing $y_{k+1} \gets y_k + \delta_k$ is one particular option satisfying \eqref{eq:stochastic_dual_update}, although other choices such as least-squares multipliers could also be used. \balgorithm[ht] \caption{Stochastic Inexact Sequential Quadratic Optimization (SISQO)} \label{alg:stochastic_sqp_adaptive} \balgorithmic[1] \Require initial values $(x_0,y_0,\tau_{-1},\xi_{-1}) \in \R{n} \times \R{m} \times \R{}_{>0} \times \R{}_{>0}$; Lipschitz constants $(L,\Gamma) \in \R{}_{>0} \times \R{}_{>0}$ satisfying Assumption~\ref{ass.main}; $\epsilon_c\in (0,1]$; $\epsilon_u\in (0,\zeta)$; $\{\sigma_u, \sigma_c, \kappa, \epsilon_{\tau}, \epsilon_{\xi}, \eta\} \subset (0,1)$; $\{\kappa_\rho, \kappa_r, \kappa_u, \kappa_v, \theta\} \subset \R{}_{>0}$; $\epsilon_r \in (\sigma_c,1)$ \For{\textbf{all} $k \in \N{}$} \State choose $\beta_k \in (0,1]$ satisfying~\eqref{betak-requirement} and $H_k$ satisfying Assumption~\ref{ass.H} \State compute $v_k\in\Range(J_k^T)$ satisfying \eqref{eq.Cauchy_decrease} \State generate $g_k$ satisfying Assumption~\ref{ass.g} \State compute $(u_k,\delta_k)$ satisfying at least one of Termination Tests 1 or 2 \label{line:stochastic_iterative_solver} \If{Termination Test 1 is satisfied} \State set $\tau^{\rm trial}_k \gets \infty$ and $\tau_k \gets \tau_{k-1}$ \Comment{$k\in\Kcal_1$} \Else{ (Termination Test 2 is satisfied)} \State set $\tau^{\rm trial}_k$ and $\tau_k$ by \eqref{eq:tau_update}--\eqref{tautrail-def} \label{line:stochastic_termination_test_2} \Comment{$k\in\Kcal_2$} \EndIf \State set $d_k \gets v_k + u_k$ \State compute $\xi_k$ and $\xi^{\rm trial}_k$ by \eqref{eq:stochastic_ratio} \label{line:stochastic_update_xi} \State choose $\alpha_k\in [\alpha^{\rm min}_k,\alpha^{\rm max}_k]$ using the definitions in~\eqref{eq:stochastic_alpha_suff.new} and \eqref{def-alphamax} \label{line:stochastic_choose_stepsize} \State set $x_{k+1} \gets x_k + \alpha_k d_k$ and choose $y_{k+1}$ satisfying \eqref{eq:stochastic_dual_update} \EndFor \ealgorithmic \ealgorithm \section{Analysis}\label{sec.analysis} Our analysis is presented in three parts. In Section~\ref{sec.wp}, we show that Algorithm~\ref{alg:stochastic_sqp_adaptive} is well posed. Then, in Section~\ref{sec.general}, we prove general lemmas about the behavior of our algorithm. Finally, in Section~\ref{sec.convergence}, we prove convergence properties in expectation for the iterate sequence generated by the algorithm under an assumption about the behavior of the merit parameter sequence. The assumption employed can be justified using the same arguments as in \cite{BeraCurtRobiZhou21}, as explained in Section~\ref{sec.convergence}. \subsection{Well-posedness}\label{sec.wp} Our aim in this subsection is to prove that during each iteration of Algorithm~\ref{alg:stochastic_sqp_adaptive}, each step of the algorithm can be performed in a manner that terminates finitely. Along the way, we also establish useful properties of quantities computed by the algorithm. We make the following reasonable assumption concerning the behavior of the iterative linear system solver employed by the algorithm for the tangential direction and dual step computation. \bassumption\label{ass:sp-solver} For all $k\in\N{}$, the iterative linear system solver employed in line~\ref{line:stochastic_iterative_solver} generates a sequence $\{(u_{k,t},\delta_{k,t},\rho_{k,t},r_{k,t})\}_{t\in\N{}}$ satisfying \bequation\label{eq:stochastic_system_iterative} \bbmatrix \rho_{k,t} \\ r_{k,t} \ebmatrix = \bbmatrix H_k & J_k^T \\ J_k & 0 \ebmatrix \bbmatrix u_{k,t} \\ \delta_{k,t} \ebmatrix +\bbmatrix g_k + H_kv_k + J_k^T y_k \\ 0 \ebmatrix\ \ \text{for all}\ \ t \in \N{} \eequation such that $\lim_{t\to\infty} \| (u_{k,t},\delta_{k,t},\rho_{k,t},r_{k,t})- (u_{k,*},\delta_{k,*},0,0) \| = 0$, where $(u_{k,*},\delta_{k,*})$ is the unique solution to the linear system defined in~\eqref{eq.linear_system_exact}. \eassumption We also make the following assumption concerning the algorithm iterates and corresponding stochastic gradient estimates computed in each iteration. \bassumption\label{ass:nonzero} For all $k\in\N{}$, it holds that $c_k \neq 0$ or $g_k \notin \Range(J_k^T)$. \eassumption We justify Assumption~\ref{ass:nonzero} in the following manner. In the deterministic setting, the algorithm encounters a point $x_k$ such that $c_k = 0$ and $\nabla f_k \in \Range(J_k^T)$ if and only if there exists $y_k$ such that \eqref{eq.stationary} holds for $(x,y) \equiv (x_k,y_k)$, i.e., the point $(x_k,y_k)$ is first-order stationary for problem \eqref{prob.opt}. In such a scenario, it is reasonable to require that an exact solution of \eqref{eq.linear_system_exact} is computed, or at least a sufficiently accurate solution of the system is computed such that a practical termination condition for \eqref{eq.linear_system_exact} is triggered and the algorithm terminates. In the stochastic setting, the algorithm encounters $c_k = 0$ and $g_k \in \Range(J_k^T)$ if and only if $x_k$ is \emph{exactly} feasible and the stochastic gradient lies \emph{exactly} in the range space of~$J_k^T$. Since $g_k$ is a \emph{stochastic} gradient, we contend that it is unlikely that it will lie \emph{exactly} in $\Range(J_k^T)$ except in special circumstances. Thus, for simplicity in our analysis, we impose Assumption~\ref{ass:nonzero} throughout this section. (If Assumption~\ref{ass:nonzero} were not to hold, then one of the following could be employed in a practical implementation: (i) if a sufficiently accurate solution of \eqref{eq.linear_system_exact} does not satisfy either Termination Test 1 or 2, then a new stochastic gradient could be sampled, perhaps following a procedure to ensure that if multiple new stochastic gradients are computed, then each is computed with lower variance, or (ii) random (e.g., Gaussian) noise could be added to $g_k$ for all $k \in \N{}$ so that Assumption~\ref{ass:nonzero} holds with probability one in all iterations, in which case the convergence result that we prove will hold with probability one.) We can now show that the search direction computation is well posed. \blemma\label{lem.direction_well_posed} For all $k\in\N{}$, the iterative linear system solver computes $(u_k,\delta_k)$ satisfying at least one of Termination Test~1 or 2 in a finite number of iterations. \elemma \bproof We prove the result by considering two cases. \textbf{Case 1:} $\|c_k\| > 0$. For this case, we show that $(u_k,\delta_k) \equiv (u_{k,t},\delta_{k,t})$ satisfies Termination Test~2 for sufficiently large $t \in \N{}$. Let us first observe that it follows from Assumption~\ref{ass:sp-solver}, Assumption~\ref{ass:nonzero}, and the fact that $\beta_k \in (0,1]$ that both \eqref{eq.dual_residual_condition} and~\eqref{eq.pd_residual_condition} hold with $(\rho_k,r_k) \equiv (\rho_{k,t},r_{k,t})$ for all sufficiently large $t \in \N{}$. Let us now show that \eqref{eq.tangential_component_condition_1} holds for all sufficiently large $t \in \N{}$. Since $\|c_k\| > 0$, it follows under Assumption~\ref{ass.main} that $\|v_k\| > 0$. If $\|u_{k,*}\| = 0$, then Assumption~\ref{ass:sp-solver} implies $\{\|u_{k,t}\|\}\to\|u_{k,*}\| = 0$, in which case it follows from $\kappa_u \in \R{}_{>0}$ that the former condition in~\eqref{eq.tangential_component_condition_1} holds with $u_k \equiv u_{k,t}$ for all sufficiently large $t \in \N{}$. On the other hand, if $\|u_{k,*}\| > 0$, then \eqref{eq.linear_system_exact} and Assumption~\ref{ass.H} imply \bequation\label{star-eq} \baligned u_{k,*}^T(g_k+H_k v_k) + \tfrac{1}{2} u_{k,*}^T H_k u_{k,*} &< u_{k,*}^T(g_k+H_k v_k) + u_{k,*}^T H_k u_{k,*} \\ &= u_{k,*}^T(g_k+H_k v_k + H_k u_{k,*} + J_k^Ty_k) \\ &= -u_{k,*}^T J_k^T\delta_{k,*} = - (J_k u_{k,*})^T \delta_{k,*} = 0. \ealigned \eequation Combining this inequality with the facts that $\epsilon_u \in (0,\zeta)$, $\kappa_v \in \R{}_{>0}$, and $\|v_k\| > 0$, it follows under Assumptions~\ref{ass.H} and~\ref{ass:sp-solver} that the latter set of conditions in~\eqref{eq.tangential_component_condition_1} holds with $u_k \equiv u_{k,t}$ for all sufficiently large $t \in \N{}$. Finally, let us show that \eqref{eq:TT2} holds for all sufficiently large $t \in \N{}$, which combined with the previous conclusions shows that Termination Test~2 is satisfied by $(u_k,\delta_k) \equiv (u_{k,t},\delta_{k,t})$ for all sufficiently large $t \in \N{}$. By Assumption~\ref{ass:sp-solver}, \eqref{eq.Cauchy_decrease}, and the aforementioned fact that $\|v_k\| > 0$, it follows that \bequationNN \lim_{t\to\infty} (\|c_k\|-\|c_k + J_kv_k + r_{k,t}\|) = \|c_k\| - \|c_k + J_kv_k\| > 0, \eequationNN which shows that \eqref{eq:TT2} holds with $r_k \equiv r_{k,t}$ for all sufficiently large $t \in \N{}$, as desired. \textbf{Case 2:} $\|c_k\| = 0$. For this case, we show that $(u_k,\delta_k) \equiv (u_{k,t},\delta_{k,t})$ satisfies Termination Test~1 for all sufficiently large $t \in \N{}$. First, recall that $\|c_k\| = 0$ implies that $\|v_k\| = 0$. We also claim that $\|u_{k,*}\| > 0$. To prove this by contradiction, suppose that $\|u_{k,*}\| = 0$. Combining this with $v_k = 0$ and~\eqref{eq.linear_system_exact}, it follows that $g_k + J_k^T(y_k+\delta_{k,*}) = 0$, which with $c_k = 0$ violates Assumption~\ref{ass:nonzero}. Thus, $\|u_{k,*}\| > 0$. Next, notice that the argument used in the beginning of Case 1 still applies in this case, which allows us to conclude that both \eqref{eq.dual_residual_condition} and~\eqref{eq.pd_residual_condition} hold with $(\rho_k,r_k) = (\rho_{k,t},r_{k,t})$ for all sufficiently large $t \in \N{}$. Also, since $\|u_{k,*}\| > 0$, the first inequality in~\eqref{star-eq} holds as a strict inequality, i.e., $u_{k,*}^T(g_k+H_k v_k) + \tfrac{1}{2} u_{k,*}^T H_k u_{k,*} < 0$. Combining this inequality with Assumption~\ref{ass:sp-solver}, Assumption~\ref{ass.H}, and $\epsilon_u\in(0,\zeta)$ allows us to deduce that the second set of conditions in~\eqref{eq.tangential_component_condition_1} holds with $u_k \equiv u_{k,t}$ for all sufficiently large $t \in \N{}$. Next, from the fact that $\|v_k\|= 0$ and~\eqref{eq.linear_system_exact}, it follows that $J_kd_{k,*} = J_k(u_{k,*} + v_k) = 0$, which with Assumption~\ref{ass.H} and $\epsilon_u\in(0,\zeta)$ gives $u_{k,*}^T H_k u_{k,*} \geq \zeta \|u_{k,*}\|^2 > \epsilon_u\|u_{k,*}\|^2$, from which we deduce that $\max\{u_{k,*}^T H_k u_{k,*}, \epsilon_u\|u_{k,*}\|^2\} = u_{k,*}^T H_k u_{k,*} \geq \zeta \|u_{k,*}\|^2 > 0$. Combining this inequality with $\|c_k\| = 0$, $\|v_k\| = 0$, $J_kd_{k,*} = J_kv_k = 0$, \eqref{eq.linear_system_exact}, and Assumption~\ref{ass.H} shows that \bequationNN \baligned &\ \Delta l(x_k,\tau_{k-1},g_k,d_{k,*}) = -\tau_{k-1}g_k^Td_{k,*} + \|c_k\| - \|c_k+J_k d_{k,*}\| = -\tau_{k-1} g_k^T u_{k,*} \\ =&\ -\tau_{k-1}(-H_ku_{k,*} - H_kv_k - J_k^T(y_k + \delta_{k,*}))^Tu_{k,*} = \tau_{k-1}u_{k,*}^TH_ku_{k,*} \\ >&\ \sigma_u\tau_{k-1}\max\{u_{k,*}^T H_k u_{k,*}, \epsilon_u\|u_{k,*}\|^2\} + \sigma_c(\|c_k\| - \|c_k + J_kv_k\|) > 0, \ealigned \eequationNN meaning that the sufficient decrease condition~\eqref{eq.model_reduction_condition} holds with $\tau \equiv \tau_{k-1}$ for all sufficiently large $t \in \N{}$. In summary, we have shown that, for all sufficiently large $t \in \N{}$, the pair $(u_k,\delta_k) \equiv (u_{k,t},\delta_{k,t})$ will satisfy Termination Test~1, as desired. \eproof Next, we prove that every search direction is nonzero in norm. \blemma\label{lem:d-nonzero} For all $k\in\N{}$, it holds that $\|d_k\| > 0$. \elemma \bproof For a proof by contradiction, suppose that $\|d_k\| = 0$. From this fact, $d_k = v_k+u_k$, and~\eqref{eq.linear_system}, it follows that $\rho_k = g_k+J_k^T(y_k+\delta_k) + H_k(v_k+u_k) = g_k + J_k^T(y_k+\delta_k)$. If $\|c_k\| = 0$, then this value for $\rho_k$ shows that the inequality in~\eqref{eq.dual_residual_condition} cannot hold, meaning that $(u_k,\delta_k)$ cannot satisfy Termination Test 1 or 2, which contradicts Lemma~\ref{lem.direction_well_posed}. Hence, the only possibility is that $\|c_k\| > 0$, which we shall assume for the remainder of the proof. Notice from $\|d_k\| = 0$, $d_k = v_k+u_k$, and $r_k = J_ku_k$, it follows that $\|c_k\| - \|c_k+J_kv_k + r_k\| = \|c_k\| - \|c_k+J_kd_k\| = 0$, meaning that~\eqref{eq:TT2} is not satisfied; thus, $(u_k,\delta_k)$ does not satisfy Termination Test 2. Also, observe from $\|v_k\| > 0$ (which follows from $\|c_k\| > 0$ and Assumption~\ref{ass.main}), $\|d_k\| = 0$, and \eqref{eq.Cauchy_decrease} that $\Delta l(x_k,\tau_k,g_k,d_k) = 0 < \sigma_u\tau_{k-1}\max\{u_k^TH_ku_k,\epsilon_u\|u_k\|^2\} + \sigma_c (\|c_k\| - \|c_k + J_kv_k\|)$, meaning that~\eqref{eq.model_reduction_condition} is not satisfied with $\tau = \tau_{k-1}$; thus, $(u_k,\delta_k)$ does not satisfy Termination Test 1. Overall, we have reached a contradiction to Lemma~\ref{lem.direction_well_posed}, and since we have reached a contradiction in all cases, the original supposition that $\|d_k\| = 0$ cannot be true. \eproof We now show that our update strategy for the merit parameter sequence ensures that the model reduction condition \eqref{eq.model_reduction_condition} always holds for $\tau \equiv \tau_k$. We also show another important property of the sequence $\{\tau_k\}$. \blemma\label{lm:model_reduction_true} For all $k\in\N{}$, the inequality in \eqref{eq.model_reduction_condition} holds with $\tau \equiv \tau_k$. In addition, for all $k \in \N{}$ such that $\tau_{k+1} < \tau_k$, it holds that $\tau_{k+1} \leq (1-\epsilon_{\tau})\tau_k$. \elemma \bproof The desired conclusion follows for $k\in \Kcal_1$ due to the manner in which Termination Test~1 is defined and the fact that the algorithm sets $\tau_k \gets \tau_{k-1}$ for all $k \in \Kcal_1$. Hence, let us proceed under the assumption that $k\in\Kcal_2$. The inequality in \eqref{eq.model_reduction_condition} holds for $\tau \equiv \tau_k$ with $d_k = v_k+u_k$ if and only if \bequationNN \tau_k (g_k^Td_k + \sigma_u \max \{u_k^TH_ku_k,\epsilon_u\|u_k\|^2 \} ) \leq \|c_k\| - \|c_k + J_kd_k\| - \sigma_c(\|c_k\| - \|c_k + J_kv_k\|). \eequationNN We now proceed to show that this inequality holds by considering two cases. \textbf{Case 1:} $g_k^Td_k + \max\{u_k^TH_ku_k,\epsilon_u\|u_k\|^2\} \leq 0$. In this case, the algorithm sets $\tau_k \gets \tau_{k-1}$. Combining this with~\eqref{eq:TT2}, $J_ku_k = r_k$, and $\epsilon_r\in(\sigma_c,1)$ yields \bequationNN \baligned \tau_k (g_k^Td_k &+ \sigma_u \max\{u_k^TH_ku_k,\epsilon_u\|u_k\|^2 \} ) \leq \tau_k (g_k^Td_k + \max \{u_k^TH_ku_k,\epsilon_u\|u_k\|^2 \} ) \\ \leq 0 &\leq \|c_k\| - \|c_k + J_kd_k\| - \epsilon_r(\|c_k\| - \|c_k + J_kv_k\|) \\ &< \|c_k\| - \|c_k + J_kd_k\| - \sigma_c(\|c_k\| - \|c_k + J_kv_k\|), \ealigned \eequationNN which establishes the desired inequality. \textbf{Case 2:} $g_k^Td_k + \max\{u_k^TH_ku_k,\epsilon_u\|u_k\|^2\} > 0$. The update~\eqref{eq:tau_update} yields $\tau_k \leq \tau^{\rm trial}_k$, which combined with \eqref{eq:TT2}, \eqref{tautrail-def}, $J_ku_k = r_k$, and $\epsilon_r\in(\sigma_c,1)$ yields \bequationNN \baligned &\ \tau_k (g_k^Td_k + \sigma_u \max \{u_k^TH_ku_k,\epsilon_u\|u_k\|^2 \} ) \leq \tau_k (g_k^Td_k + \max \{u_k^TH_ku_k,\epsilon_u\|u_k\|^2 \} ) \\ \leq&\ (1-\tfrac{\sigma_c}{\epsilon_r})(\|c_k\| - \|c_k + J_kd_k\|) \leq \|c_k\| - \|c_k + J_kd_k\| - \sigma_c(\|c_k\| - \|c_k + J_kv_k\|), \ealigned \eequationNN as desired. Moreover, from \eqref{eq:tau_update}, we have $\tau_{k+1}\leq (1-\epsilon_{\tau})\tau_k$ whenever $\tau_{k+1} < \tau_k$. \eproof We conclude this subsection by showing that the interval defining our step size selection scheme, i.e., $[\alpha^{\rm min}_k,\alpha^{\rm max}_k]$, is positive and nonempty for all $k \in \N{}$. We also show a useful property of the computed step size that is needed in our analysis. \blemma\label{lm:stepsize_well_defined} For all $k\in\N{}$, it holds that $0 < \alpha^{\rm min}_k \leq \alpha^{\rm suff}_k \leq \alpha^{\varphi}_k$ and $0 < \alpha^{\rm min}_k \leq \alpha^{\rm max}_k$. In addition, for all $k \in \N{}$, it holds that $\varphi(\alpha_k) \leq 0$. \elemma \bproof It follows from \eqref{eq:stochastic_alpha_suff.new} and the fact that $\{\beta_k\}$, $\{\xi_k\}$, and $\{\tau_k\}$ are positive sequences that $\alpha^{\rm min}_k > 0$ for all $k \in \N{}$. Hence, considering \eqref{eq:stochastic_alpha_suff.new} and \eqref{def-alphamax}, to prove that $0 < \alpha^{\rm min}_k \leq \alpha^{\rm suff}_k \leq \alpha^{\varphi}_k$ and $0 < \alpha^{\rm min}_k \leq \alpha^{\rm max}_k$ for all $k \in \N{}$, it is sufficient to show that $\alpha^{\rm suff}_k \leq \alpha^{\varphi}_k$ for all $k \in \N{}$. Consider arbitrary $k \in \N{}$. Since $\alpha^{\varphi}_k \geq 0$ by construction and $\alpha^{\rm suff}_k \geq 0$ as a consequence of Lemmas~\ref{lem:d-nonzero} and \ref{lm:model_reduction_true}, the inequality holds trivially if $\alpha^{\rm suff}_k = 0$. Hence, we may proceed under the assumption that $\alpha^{\rm suff}_k > 0$. Moreover, one finds from the definition of $\alpha^{\varphi}_k$ in \eqref{eq.alpha_phi} that to establish $\alpha^{\rm suff}_k \leq \alpha^{\varphi}_k$ it is sufficient to show that $\varphi(\alpha^{\rm suff}_k) \leq 0$. We consider two cases based on the min in~\eqref{eq:stochastic_alpha_suff}. First, suppose that $\alpha^{\rm suff}_k = 1 \leq \tfrac{2(1-\eta)\beta_k\Delta l(x_k,\tau_k,g_k,d_k)}{(\tau_k L+\Gamma)\|d_k\|^2}$, which with \eqref{eq:stochastic_U_def} shows that \bequationNN \baligned \varphi(\alpha^{\rm suff}_k) &= (\eta-1)\beta_k\Delta l(x_k,\tau_k,g_k,d_k) + \tfrac{1}{2}(\tau_kL+\Gamma)\|d_k\|^2 \\ &\leq (\eta-1)\beta_k\Delta l(x_k,\tau_k,g_k,d_k) + (1-\eta)\beta_k\Delta l(x_k,\tau_k,g_k,d_k) = 0, \ealigned \eequationNN as desired. Second, suppose $\alpha^{\rm suff}_k = \tfrac{2(1-\eta)\beta_k\Delta l(x_k,\tau_k,g_k,d_k)}{(\tau_k L+\Gamma)\|d_k\|^2} < 1$. For this case, it follows from \eqref{eq:stochastic_U_def}, $\alpha^{\rm suff}_k \in (0,1]$, and the triangle inequality that \bequationNN \baligned \varphi(\alpha^{\rm suff}_k) &= (\eta-1)\alpha^{\rm suff}_k\beta_k\Delta l(x_k,\tau_k,g_k,d_k) + (1-\eta)\alpha^{\rm suff}_k\beta_k\Delta l(x_k,\tau_k,g_k,d_k) \\ &\phantom{=i} +\|c_k + \alpha^{\rm suff}_k J_kd_k\| - \alpha^{\rm suff}_k\|c_k + J_kd_k\| + (\alpha^{\rm suff}_k-1)\|c_k\| \\ &\leq \|(1-\alpha^{\rm suff}_k)c_k\| + (\alpha^{\rm suff}_k-1)\|c_k\| = 0. \ealigned \eequationNN Overall, $\alpha^{\rm suff}_k \leq \alpha^{\varphi}_k$ since, in both cases above, we proved that $\varphi(\alpha^{\rm suff}_k) \leq 0$. Finally, let us show that $\varphi(\alpha_k) \leq 0$ for all $k \in \N{}$. By \eqref{eq.model_reduction} and \eqref{eq:stochastic_U_def}, one finds (as previously mentioned) that $\varphi$ is strongly convex. In addition, one finds that $\varphi(0) = \varphi(\alpha^{\varphi}_k) = 0$, where $\alpha^{\varphi}_k \in \R{}_{>0}$ due to the first part of this lemma. Along with the fact that $0 < \alpha^{\rm min}_k \leq \alpha_k \leq \alpha^{\rm max}_k \leq \alpha^{\varphi}_k$, it follows that $\varphi(\alpha_k) \leq 0$, as desired. \eproof \subsection{General results}\label{sec.general} Our aim in this subsection is to prove general results about the behavior of quantities generated by Algorithm~\ref{alg:stochastic_sqp_adaptive}. For our purposes here, we make the following assumption about the dual and residual sequences. \bassumption\label{ass:bd-residual} The dual iterate sequence $\{y_k\}$ and residual sequence $\{(\rho_k,r_k)\}$ $($recall~\eqref{eq.linear_system}$)$ generated by Algorithm~\ref{alg:stochastic_sqp_adaptive} are bounded in norm. \eassumption We note that under Assumption~\ref{ass.main} and Assumption~\ref{ass.H}, this additional assumption is mild; it should hold as long as any reasonable iterative solver is applied to \eqref{eq.linear_system_exact} in each iteration of a run of the algorithm. The next lemma gives a lower bound on $\|c_k\| - \|c_k + J_kv_k\|$ relative to $\|c_k\|$. \blemma\label{lm:feasibility_decrease} There exists $\omega_1\in\R{}_{>0}$ such that, for all $k\in\N{}$, it holds that \bequationNN \|c_k\| - \|c_k + J_kv_k\| \geq \omega_1 \|c_k\|. \eequationNN \elemma \bproof This result follows as in \cite[Lemma~3.5]{CurtNoceWach09}, but with small straightforward modifications to account for the fact that, in our analysis here, the singular values of $\{J_k\}$ are bounded away from zero as a consequence of Assumption~\ref{ass.main}. \eproof The next lemma shows that $\|v_k\|$ is of the same order as $\|c_k\|$. \blemma\label{lm:vk_bounded} There exists $\{\omega_2,\omega_3\}\subset\R{}_{>0}$ such that, for all $k\in\N{}$, it holds that \bequation\label{eq:vk-bounded} \omega_2\|c_k\|\leq \|v_k\|\leq \omega_3\|c_k\|. \eequation \elemma \bproof Observe that Assumption~\ref{ass.main} ensures the existence of $\lambda_{\rm min}\in\R{}_{>0}$ such that $J_kJ_k^T \succeq \lambda_{\rm min} I$ for all $k\in\N{}$. We now prove each desired inequality. First, consider the former inequality in~\eqref{eq:vk-bounded}. Since this inequality holds trivially whenever $\|c_k\| = 0$, let us proceed under the assumption that $\|c_k\| > 0$. One finds \begin{align*} \|c_k\|^2 - \|c_k+\alpha_k^c J_k v_k^c\|^2 &= (\|c_k\| - \|c_k+\alpha_k^c J_k v_k^c\|)(\|c_k\| + \|c_k+\alpha_k^c J_k v_k^c\|) \\ &\leq 2\|c_k\|(\|c_k\| - \|c_k+\alpha_k^c J_k v_k^c\|). \end{align*} It follows from this inequality, the triangle inequality, and \eqref{eq.Cauchy_decrease} that \bequationNN \baligned &\ \ \ \ \|J_k\|\|v_k\| \geq \|J_kv_k\| \geq \|c_k\| - \|c_k + J_kv_k\| \geq \epsilon_c(\|c_k\| - \|c_k + \alpha_k^c J_k v_k^c\|) \\ &\geq \tfrac{\epsilon_c}{2\|c_k\|}(\|c_k\|^2 - \|c_k + \alpha_k^c J_k v_k^c\|^2) = \tfrac{\epsilon_c}{2\|c_k\|}(-2\alpha_k^c c_k^T J_k v_k^c - (\alpha_k^c)^2\|J_kv_k^c\|^2). \ealigned \eequationNN Substituting in for the value of $\alpha_k^c$ (recall \eqref{eq.alphac}), then substituting $v_k^c = -J_k^T c_k$ and simplifying shows that $\|J_k\|\|v_k\| \geq ( \tfrac{\epsilon_c}{2\|c_k\|}) \alpha_k^c\|J_k^Tc_k\|^2$. Again substituting the value of $\alpha_k^c$ and using the definition of $\lambda_{\rm min}$, it follows that \bequationNN \|J_k\|\|v_k\| \geq \tfrac{\epsilon_c \|J_k^Tc_k\|^4}{2\|c_k\|\|J_kJ_k^Tc_k\|^2} \geq \tfrac{\epsilon_c\lambda_{\rm min}^2\|c_k\|^4}{2\|c_k\|\|J_k^TJ_k\|^2\|c_k\|^2} = \tfrac{\epsilon_c\lambda_{\rm min}^2}{2\|J_k^TJ_k\|^2}\|c_k\|. \eequationNN It follows from this inequality and Assumption~\ref{ass.main} that there exists $\omega_2\in\R{}_{>0}$ such that the former inequality in~\eqref{eq:vk-bounded} holds, as desired. Let us now turn to the latter inequality in~\eqref{eq:vk-bounded}. It follows from the normal direction computation that $\|c_k\| \geq \|c_k+J_k v_k\|$, which by the triangle inequality implies that $\|J_kv_k\| \leq 2\|c_k\|$. Note that since $v_k\in\Range(J_k^T)$, one has $v_k = J_k^Tw_k$ where $w_k = (J_kJ_k^T)^{-1}J_kv_k$. Putting these facts together shows that \bequationNN \|v_k\| = \|J_k^T w_k\| = \|J_k^T(J_kJ_k^T)^{-1}J_kv_k\| \leq \|J_k^T\|\|(J_kJ_k^T)^{-1}\|\|J_kv_k\| \leq \tfrac{2\|J_k^T\|}{\lambda_{\rm min}}\|c_k\|, \eequationNN which combined with Assumption~\ref{ass.main} establishes the existence of a $\omega_3\in\R{}_{>0}$ such that the second inequality in~\eqref{eq:vk-bounded} holds, as desired. \eproof The next result gives a bound on the size of the search direction relative to the constraint violation and the size of the normal step. \blemma\label{lm:Thetak_lower_bound} There exists $\omega_4\in\R{}_{\geq 2}$ such that, for all $k\in\N{}$, it holds that \bequationNN \|d_k\|^2 \leq \omega_4(\|u_k\|^2 + \|c_k\|). \eequationNN \elemma \bproof Observe that $0 \leq (\|u_k\|-\|v_k\|)^2 = \|u_k\|^2 + \|v_k\|^2 - 2\|u_k\|\|v_k\|$. Using this fact, $d_k = v_k + u_k$, the triangle inequality, and Lemma~\ref{lm:vk_bounded}, it follows that \bequationNN \baligned \|d_k\|^2 &\leq (\|u_k\| + \|v_k\|)^2 = \|u_k\|^2 + \|v_k\|^2 + 2\|u_k\|\|v_k\| \\ &\leq 2(\|u_k\|^2 + \|v_k\|^2) \leq 2(\|u_k\|^2 + \omega_3^2\|c_k\|^2) \\ &\leq \max\{2,2\omega_3^2\|c_k\|\}(\|u_k\|^2 + \|c_k\|). \ealigned \eequationNN The existence of the required $\omega_4\in\R{}_{\geq 2}$ now follows from Assumption~\ref{ass.main} since $\max\{2,2\omega_3^2\|c_k\|\}$ is uniformly bounded for all $k\in\N{}$, which completes the proof. \eproof The next lemma shows that the model reduction $\Delta l(x_k,\tau_k,g_k,v_k+u_k)$ is bounded below by a similar quantity as the upper bound for $\|d_k\|^2$ in the previous lemma. \blemma\label{lm:Thetak_upper_bound} There exists $\kappa_l\in\R{}_{>0}$ such that for all $k\in\N{}$, it holds that \bequationNN \Delta l(x_k,\tau_k,g_k,v_k + u_k) \geq \kappa_l\tau_k(\|u_k\|^2 + \|c_k\|) \geq \tfrac{\kappa_l\tau_k}{\omega_4}\|d_k\|^2 > 0. \eequationNN \elemma \bproof Lemma~\ref{lm:model_reduction_true} shows that \eqref{eq.model_reduction_condition} holds with $\tau \equiv \tau_k$. Combining this fact with Lemma~\ref{lm:feasibility_decrease} and the monotonically nonincreasing behavior of $\{\tau_k\}$ shows that \bequationNN \baligned \Delta l(x_k,\tau_k,g_k,v_k + u_k) &\geq \sigma_u\tau_k\max\{u_k^TH_ku_k,\epsilon_u\|u_k\|^2\} + \sigma_c (\|c_k\| - \|c_k + J_kv_k\|) \\ &\geq \sigma_u\tau_k\epsilon_u\|u_k\|^2 + \sigma_c\omega_1\|c_k\| \geq \tau_k( \sigma_u\epsilon_u\|u_k\|^2 + \sigma_c\omega_1\|c_k\|/\tau_{-1}) \\ &\geq \min\{\sigma_u\epsilon_u,\tfrac{\sigma_c\omega_1}{\tau_{-1}}\} \tau_k ( \|u_k\|^2 + \|c_k\|), \ealigned \eequationNN which proves the existence of the claimed $\kappa_l \in\R{}_{>0}$ since $\sigma_u$, $\epsilon_u$, $\sigma_c$, $\omega_1$, and $\tau_{-1}$ are positive real numbers. The remaining inequalites follow from Lemmas~\ref{lm:Thetak_lower_bound} and \ref{lem:d-nonzero}. \eproof We next prove a deterministic uniform lower bound for the sequence $\{\xi_k\}$. \blemma\label{lem:xi-bound} There exists $\xi_{\min}\in\R{}_{>0}$ such that, in any run of the algorithm, there exists $k_\xi\in\N{}$ and $\xi_{k_\xi}\in[\xi_{\min},\infty)$ such that $\xi_k = \xi_{k_\xi}$ for all $k\geq k_\xi$. \elemma \bproof For all $k\in\N{}$, it follows from~\eqref{eq:stochastic_ratio} and Lemmas~\ref{lm:Thetak_lower_bound} and \ref{lm:Thetak_upper_bound} that \bequation\label{xitrial-bd} \xi^{\rm trial}_k = \tfrac{\Delta l(x_k,\tau_k,g_k,d_k)}{\tau_k\|d_k\|^2} \geq \tfrac{\kappa_l\tau_k(\|u_k\|^2 + \|c_k\|)}{\tau_k\omega_4(\|u_k\|^2 + \|c_k\|)} = \tfrac{\kappa_l}{\omega_4}. \eequation Now, consider any iteration such that $\xi_k < \xi_{k-1}$. For such iterations, it follows from~\eqref{eq:stochastic_ratio} and~\eqref{xitrial-bd} that $\xi_k \geq (1-\epsilon_\xi)\xi^{\rm trial}_k \geq (1-\epsilon_{\xi})\kappa_l/\omega_4$. Combining this fact with the initial choice of $\xi_{-1}$ shows that $\xi_k \geq \xi_{\min} := \min\{(1-\epsilon_{\xi})\kappa_l/\omega_4, \xi_{-1}\}$ for all $k\in\N{}$. Combining this result with the fact that anytime $\xi_k < \xi_{k-1}$ it must hold that $\xi_k \leq (1-\epsilon_\xi)\xi_{k-1}$ (it decreases by at least a factor of $1-\epsilon_\xi$), gives the desired result. \eproof The next lemma gives a bound on the change in the merit function each iteration. \blemma\label{lm:stochastic_merit_decrease_upper_bound} For all $k\in\N{}$, it holds that \bequationNN \baligned &\ \ \ \ \phi(x_k + \alpha_kd_k,\tau_k) - \phi(x_k,\tau_k) \\ &\leq -\alpha_k\Delta l(x_k,\tau_k,\nabla f_k,d^{\rm true}_k) + \alpha_k\tau_k\nabla f_k^T(d_k - d^{\rm true}_k) + (1-\eta)\alpha_k\beta_k\Delta l(x_k,\tau_k,g_k,d_k) \\ &\ \ \ + \alpha_k\|c_k + J_kd_k\| - \alpha_k\|c_k + J_kv_k\|. \ealigned \eequationNN \elemma \bproof By Lemma~\ref{lm:stepsize_well_defined}, one has that $\varphi(\alpha_k) \leq 0$. Hence, starting with the third row of~\eqref{eq.merit_reduction_bound}, adding and subtracting the terms $\alpha_k\tau_k\nabla f_k^Td^{\rm true}_k$, $\alpha_k \|c_k\|$, $\alpha_k \|c_k + J_kd^{\rm true}_k\|$, and $\alpha_k\beta_k\Delta l(x_k,\tau_k,g_k,d_k)$, using the definition of $\varphi(\cdot)$, and using the fact that $J_k d^{\rm true}_k = J_k (v_k + \uTrue_k) = J_k v_k$, one finds that \bequationNN \baligned &\ \phi(x + \alpha_kd_k, \tau_k) - \phi(x_k,\tau_k) \\ \leq&\ \alpha_k\tau_k\nabla f_k^Td_k + \|c_k+\alpha_k J_kd_k\| - \|c_k\| + \tfrac{1}{2}(\tau_kL+\Gamma)\alpha_k^2\|d_k\|^2 \\ =&\ -\alpha_k\Delta l(x_k,\tau_k,\nabla f_k,d^{\rm true}_k) + \alpha_k\tau_k\nabla f_k^T(d_k - d^{\rm true}_k) + (\alpha_k - 1)\|c_k\| \\ &\ + \|c_k+\alpha_kJ_kd_k\| - \alpha_k\|c_k + J_kd^{\rm true}_k\| + \tfrac{1}{2}(\tau_kL+\Gamma)\alpha_k^2\|d_k\|^2 \\ &\ - \alpha_k\beta_k\Delta l(x_k,\tau_k,g_k,d_k) + \alpha_k\beta_k\Delta l(x_k,\tau_k,g_k,d_k) \\ \leq&\ -\alpha_k\Delta l(x_k,\tau_k,\nabla f_k,d^{\rm true}_k) + \alpha_k\tau_k\nabla f_k^T(d_k - d^{\rm true}_k) + \alpha_k\|c_k + J_kd_k\| \\ &\ - \alpha_k\|c_k + J_kd^{\rm true}_k\| - \eta\alpha_k\beta_k\Delta l(x_k,\tau_k,g_k,d_k) + \alpha_k\beta_k\Delta l(x_k,\tau_k,g_k,d_k) \\ =&\ -\alpha_k\Delta l(x_k,\tau_k,\nabla f_k,d^{\rm true}_k) + \alpha_k\tau_k\nabla f_k^T(d_k - d^{\rm true}_k) + (1-\eta)\alpha_k\beta_k\Delta l(x_k,\tau_k,g_k,d_k) \\ &\ + \alpha_k\|c_k + J_kd_k\| - \alpha_k\|c_k + J_kv_k\|, \\ \ealigned \eequationNN which completes the proof. \eproof We now derive bounds on the expected difference between $u_k$ and $\uTrue_k$. To that end, let us define $Z_k\in\R{n\times (n-m)}$ as a matrix whose columns form an orthonormal basis for $\Null(J_k)$, which implies that $Z_k^T Z_k = I$ and $J_k Z_k = 0$. Under Assumption~\ref{ass.main}, let $u_{k,1}\in\R{m}$ and $u_{k,2}\in\R{n-m}$ be vectors forming the orthogonal decomposition of $u_k$ into $\Range(J_k^T)$ and $\Null(J_k)$ in the sense that $u_k = J_k^Tu_{k,1} + Z_ku_{k,2}$. It follows from~\eqref{eq.linear_system} that $u_{k,1} = (J_kJ_k^T)^{-1}r_k$ and $u_{k,2} = -(Z_k^TH_kZ_k)^{-1}Z_k^T(g_k + H_kv_k + H_kJ_k^T(J_kJ_k^T)^{-1}r_k - \rho_k)$, with which one can derive: \bequation\label{eq:u_solution} \baligned u_k &= J_k^T(J_kJ_k^T)^{-1}r_k - Z_k(Z_k^TH_kZ_k)^{-1}Z_k^T(g_k + H_kv_k + H_kJ_k^T(J_kJ_k^T)^{-1}r_k - \rho_k) \\ \uTrue_k &= -Z_k(Z_k^TH_kZ_k)^{-1}Z_k^T(\nabla f_k + H_kv_k). \ealigned \eequation The corresponding values for $\delta^{\rm true}_k$ and $\delta_k$ are found to be: \bequation\label{eq:delta_solution} \baligned \delta_k &= -(J_kJ_k^T)^{-1}J_k(g_k + H_kv_k + H_ku_k - \rho_k) - y_k \\ \delta^{\rm true}_k &= -(J_kJ_k^T)^{-1}J_k(\nabla f_k + H_kv_k + H_k\uTrue_k) - y_k. \ealigned \eequation In the proof of the lemma below, we use the fact that \bequation\label{Z-bound} \|I - Z_k(Z_k^TH_kZ_k)^{-1}Z_k^TH_k\| \leq 1, \eequation which can be seen as follows: The nonzero eigenvalues of a matrix product $AB$ are equal to the nonzero eigenvalues of $BA$ when the product is valid, from which it follows that the nonzero eigenvalues of $Z_k(Z_k^TH_kZ_k)^{-1}Z_k^TH_k$ are precisely the eigenvalues of $Z_k^TH_k Z_k(Z_k^TH_kZ_k)^{-1} = I$, which are all equal to one; hence, the bound in~\eqref{Z-bound} holds. \blemma\label{lem:u-diff} There exists $\omega_5 \in \R{}_{>0}$ such that, for all $k \in \N{}$, it holds that \bequationNN \|\E_k[u_k - \uTrue_k]\| \leq \omega_5\beta_k \ \ \text{and}\ \ \E_k[\|u_k - \uTrue_k\|] \leq \zeta^{-1}\sqrt{M_g} + \omega_5\beta_k \eequationNN \elemma \bproof It follows from~\eqref{eq:u_solution} that \bequationNN u_k - \uTrue_k = J_k^T(J_kJ_k^T)^{-1}r_k - Z_k(Z_k^TH_kZ_k)^{-1}Z_k^T(g_k - \nabla f_k + H_kJ_k^T(J_kJ_k^T)^{-1}r_k - \rho_k), \eequationNN which combined with Assumption~\ref{ass.g} shows that \bequationNN \baligned \E_k[u_k - \uTrue_k] = &(I - Z_k(Z_k^TH_kZ_k)^{-1} Z_k^TH_k ) J_k^T(J_kJ_k^T)^{-1} \E_k[r_k] \\ &+ Z_k(Z_k^TH_kZ_k)^{-1}Z_k^T\E_k[\rho_k]. \ealigned \eequationNN Combining this equation with the triangle inequality, Assumptions~\ref{ass.H} and~\ref{ass.main}, \eqref{eq.pd_residual_condition}, and~\eqref{Z-bound} ensures the existence of $\omega_5\in\R{}_{>0}$ such that, for all $k \in \N{}$, \bequationNN \baligned \|\E_k[ u_k - \uTrue_k ]\| &\leq \|J_k^T(J_kJ_k^T)^{-1}\|\|\E_k[r_k]\| + \zeta^{-1}\|\E_k[\rho_k]\| \\ &\leq \|J_k^T(J_kJ_k^T)^{-1}\|\kappa_r\beta_k + \zeta^{-1}\kappa_{\rho}\beta_k \leq \omega_5\beta_k, \ealigned \eequationNN is the first desired result. Next, to derive the desired bound on $\E_k[\|u_k - \uTrue_k\|]$, one can combine the expression above for $u_k - \uTrue_k$ with the triangle inequality to obtain \bequationNN \baligned \|u_k - \uTrue_k\| \leq&\ \|Z_k(Z_k^TH_kZ_k)^{-1}Z_k^T(g_k - \nabla f_k)\| + \|Z_k(Z_k^TH_kZ_k)^{-1}Z_k^T\rho_k\| \\ &+ \|(I - Z_k(Z_k^TH_kZ_k)^{-1}Z_k^TH_k)J_k^T(J_kJ_k^T)^{-1}r_k\|. \ealigned \eequationNN Taking conditional expectation and using Assumption~\ref{ass.g}, \eqref{jensens-M}, \eqref{Z-bound}, and~\eqref{eq.pd_residual_condition}, \bequationNN \baligned \E_k[\|u_k - \uTrue_k\|] &\leq \zeta^{-1}\sqrt{M_g} + \zeta^{-1}\E_k[\|\rho_k\|] + \|J_k^T(J_kJ_k^T)^{-1}\|\E_k[\|r_k\|] \\ &\leq \zeta^{-1}\sqrt{M_g} + \zeta^{-1}\kappa_{\rho}\beta_k + \|J_k^T(J_kJ_k^T)^{-1}\|\kappa_r\beta_k \leq \zeta^{-1}\sqrt{M_g} + \omega_5\beta_k, \ealigned \eequationNN where $\omega_5$ is the same value as used above, which completes the proof. \eproof We now bound the difference (in expectation) between $\nabla f_k^Td^{\rm true}_k$ and $g_k^Td_k$. \blemma\label{lem:gd_diff} There exist $(\omega_6,\omega_7) \in \R{}_{>0} \times \R{}_{>0}$ such that, for all $k\in\N{}$, \bequationNN |\E_k[\nabla f_k^Td^{\rm true}_k - g_k^Td_k]| \leq \omega_6\beta_k + \omega_7\beta_k\sqrt{M_g} + \zeta^{-1}M_g. \eequationNN \elemma \bproof It follows from the triangle inequality and linearity of $E_k$ that \bequationNN \baligned |\E_k[\nabla f_k^Td^{\rm true}_k - g_k^Td_k]| &= |\E_k[\nabla f_k^T(d^{\rm true}_k - d_k) + (\nabla f_k - g_k)^Td_k]| \\ &\leq |\nabla f_k^T\E_k[d^{\rm true}_k - d_k]| + |\E_k[(\nabla f_k - g_k)^Td_k]|. \ealigned \eequationNN For the first term on the right-hand side, it follows by the Cauchy-Schwarz inequality, $d^{\rm true}_k = v_k + \uTrue_k$, $d_k = v_k + u_k$, and Lemma~\ref{lem:u-diff} that there exists $\omega_6 \in\R{}_{>0}$ with \bequationNN \baligned |\nabla f_k^T\E_k[d^{\rm true}_k - d_k]| &\leq \|\nabla f_k\|\|\E_k[d^{\rm true}_k - d_k]\| \\ &= \|\nabla f_k\|\|\E_k[\uTrue_k - u_k]\| \leq \omega_6\beta_k. \ealigned \eequationNN For the second term on the right-hand side, first observe from Assumption~\ref{ass.g} that $\E_k[(\nabla f_k-g_k)^T v_k] = v_k^T \E_k[\nabla f_k-g_k] = 0$. Combining this fact with~\eqref{eq:u_solution}, the triangle inequality, the Cauchy-Schwarz inequality, Assumptions~\ref{ass.main}--\ref{ass.H}, \eqref{Z-bound}, and~\eqref{jensens-M} shows that there exist $(\bar\omega_7,\omega_7) \in \R{}_{>0} \times \R{}_{>0}$ such that \bequationNN \baligned &\ |\E_k[(\nabla f_k - g_k)^Td_k]| \\ =&\ |\E_k[(\nabla f_k - g_k)^T((I - Z_k(Z_k^TH_kZ_k)^{-1}Z_k^TH_k)J_k^T(J_kJ_k^T)^{-1}r_k \\ &\ -Z_k(Z_k^TH_kZ_k)^{-1}Z_k^T(g_k - \nabla f_k - \rho_k))]| \\ \leq&\ |\E_k[(\nabla f_k - g_k)^T(I - Z_k(Z_k^TH_kZ_k)^{-1}Z_k^TH_k)J_k^T(J_kJ_k^T)^{-1}r_k]| \\ &\ + |\E_k[(\nabla f_k - g_k)^TZ_k(Z_k^TH_kZ_k)^{-1}Z_k^T\rho_k]| \\ &\ + |\E_k[(\nabla f_k - g_k)^TZ_k(Z_k^TH_kZ_k)^{-1}Z_k^T(\nabla f_k - g_k)]| \\ \leq&\ \E_k[\|\nabla f_k - g_k\|\|(I - Z_k(Z_k^TH_kZ_k)^{-1}Z_k^TH_k)J_k^T(J_kJ_k^T)^{-1}\| \|r_k\|] \\ &\ + \E_k[\|\nabla f_k - g_k\| \|Z_k(Z_k^TH_kZ_k)^{-1}Z_k^T\| \|\rho_k\|] + \zeta^{-1}\E_k[\|\nabla f_k - g_k\|^2] \\ \leq&\ (\bar\omega_7\kappa_r\beta_k + \zeta^{-1}\kappa_{\rho}\beta_k)\E_k[\|\nabla f_k - g_k\|] + \zeta^{-1}M_g \\ \leq&\ (\bar\omega_7\kappa_r + \zeta^{-1}\kappa_{\rho})\beta_k\sqrt{M_g} + \zeta^{-1}M_g = \omega_7\beta_k\sqrt{M_g} + \zeta^{-1}M_g. \ealigned \eequationNN Combining the results above gives the desired result. \eproof We now proceed to bound (in expectation) the last two terms appearing in the right-hand side of the inequality proved in Lemma~\ref{lm:stochastic_merit_decrease_upper_bound}. \blemma\label{lem:Jd_Jv_diff} There exists $\omega_8 \in \R{}_{>0}$ such that, for all $k\in\N{}$, it holds that \bequationNN \E_k[\alpha_k(\|c_k + J_kd_k\| - \|c_k + J_kv_k\|)] \leq \omega_8\beta_k^2. \eequationNN \elemma \bproof From the triangle inequality, \eqref{eq.linear_system}, \eqref{eq.pd_residual_condition}, the fact that $\alpha_k \in [\alpha^{\rm min}_k,\alpha^{\rm max}_k]$, \eqref{def-alphamax}, \eqref{eq:stochastic_alpha_suff.new}, \eqref{betak-requirement}, and the monotonically nonincreasing behavior of $\{\tau_k\}$ and $\{\xi_k\}$, it follows that there exists $\omega_8 \in \R{}_{>0}$ such that \bequationNN \baligned &\ \E_k[\alpha_k(\|c_k + J_kd_k\| - \|c_k + J_kv_k\|)] \leq \E_k[\alpha_k\|J_ku_k\|] = \E_k[\alpha_k\|r_k\|] \\ \leq&\ \kappa_r\beta_k\E_k[\alpha^{\rm max}_k] \leq \kappa_r\beta_k\E_k[\alpha^{\rm min}_k + \theta\beta_k^2] = \kappa_r\beta_k \E_k[ (\tfrac{2(1-\eta)\beta_k\xi_k\tau_k}{\tau_kL+\Gamma} + \theta\beta_k^2)] \\ \leq&\ (\tfrac{2(1-\eta)\xi_{-1}\tau_{-1}}{\Gamma} + \theta\beta_k)\kappa_r\beta_k^2 \leq \omega_8\beta_k^2, \ealigned \eequationNN which gives the desired conclusion. \eproof \subsection{Convergence analysis}\label{sec.convergence} Our goal now is to prove a convergence result for our algorithm. In general, in a run of the algorithm, one of three possible events can occur. One possible event is that the merit parameter sequence eventually remains constant at a value that is \emph{sufficiently small}. This is the event that we consider in our analysis here, where the meaning of \emph{sufficiently small} is defined formally below. The other two possible events are that the merit parameter sequence vanishes or eventually remains constant at a value that is too large. As discussed in \cite[Section~3.2.2]{BeraCurtRobiZhou21}, the former of these two events does not occur if the differences between the stochastic gradient estimates and the true gradients of the objective remain uniformly bounded in norm, and the latter of these two events occurs with probability zero in a given run of the algorithm if one makes a reasonable assumption about the influence of the stochastic gradient estimates on the computed search directions; see also \cite[Section~4.3]{BeraCurtONeiRobi21} for additional discussion of the latter case in the context of an algorithm that employs a step decomposition approach, as does our algorithm. For our purposes here, we do not consider these latter two events since we contend that, for practical purposes, they can be ignored for the same reasons as are claimed in \cite{BeraCurtRobiZhou21}. To define our event of interest, consider for each $k\in\N{}$ the condition \bequation\label{check-truetrial} \nabla f_k^Td^{\rm true}_k + \max\{(\uTrue_k)^TH_k\uTrue_k,\epsilon_u \|\uTrue_k\|^2\} \leq 0 \eequation (similar to the one appearing in~\eqref{tautrail-def}). With this condition, let us define the following trial value of the merit parameter that would be computed in iteration $k \in \N{}$ (conditioned on $x_k$ being the $k$th iterate) if the algorithm were to employ $\nabla f_k$ in place of $g_k$ and compute an exact solution of the linear system \eqref{prob.tangential_true}: \bequationNN \tau^{\rm true,trial}_k \gets \bcases \infty & \text{if \eqref{check-truetrial} holds,} \\ \frac{(1-\tfrac{\sigma_c}{\epsilon_r})(\|c_k\|-\|c_k + J_kd^{\rm true}_k\|)}{\nabla f_k^Td^{\rm true}_k + \max\{(\uTrue_k)^TH_k\uTrue_k,\epsilon_u \|\uTrue_k\|^2\}} & \text{if \eqref{check-truetrial} does not hold.} \ecases \eequationNN (To be clear, the quantity $\tau^{\rm true,trial}_k$ never needs to be computed by our algorithm; it is only used in our analysis in this subsection.) Using this quantity, we define our event of interest, namely, $E_{\tau,{\rm low}}$, as the following. \begin{tcolorbox}[colback=white] \textbf{Event $E_{\tau,{\rm low}}$.} Event $E_{\tau,{\rm low}}$ occurs if and only if there exists an iteration number $k_{\tau,\xi} \in \N{}$ such that, with $\xi_{\min}$ given in Lemma~\ref{lem:xi-bound}, it holds that \bequation\label{eq:stochastic_good_case} \tau_k = \tau_{k_{\tau,\xi}} \leq \tau^{\rm true,trial}_k\ \ \text{and}\ \ \xi_k = \xi_{k_{\tau,\xi}} \geq \xi_{\min}\ \ \text{for all}\ \ k\geq k_{\tau,\xi}. \eequation \end{tcolorbox} For our analysis in this subsection, the following supersedes Assumption~\ref{ass.g}. \bassumption\label{ass.tau_low} There exists $M_g \in \R{}_{>0}$ such that, for all $k \in \N{}$, the stochastic gradient $g_k$ has the properties that $\E_{k,\tau,{\rm low}}[g_k] = \nabla f_k$ and $\E_{k,\tau,{\rm low}}[\|g_k - \nabla f_k\|_2^2] \leq M_g$, where $\E_{k,\tau,{\rm low}}[\cdot]$ denotes expectation with respect to the distribution of $\omega$ conditioned on the event that $E_{\tau,{\rm low}}$ occurs and $x_k$ is the primal iterate in iteration $k \in \N{}$. \eassumption Our results in this subsection focus on $k \in \N{}$ with $k \geq k_{\tau,\xi}+1$, at which point, in any run in which Event~$E_{\tau,{\rm low}}$ occurs, the merit parameter satisfies $\tau_k = \tau_{k_{\tau,\xi}}$ independently from the stochastic gradient $g_k$ that is generated. Our first result provides an upper bound (in expectation) for the second term appearing on the right-hand side of the inequality in Lemma~\ref{lm:stochastic_merit_decrease_upper_bound}. \blemma\label{lm:stochastic_gd_diff} Under Event~$E_{\tau,{\rm low}}$, there exists $\omega_9\in\R{}_{>0}$ such that \bequationNN \E_{k,\tau,{\rm low}}[\alpha_k\tau_k\nabla f_k^T(d_k - d^{\rm true}_k)] \leq \omega_9\beta_k^2\ \ \text{for all}\ \ k \geq k_{\tau,\xi} + 1. \eequationNN \elemma \bproof Under Assumption~\ref{ass.tau_low}, the logic as in the proof of Lemma~\ref{lem:u-diff} allows us to conclude that, under $E_{\tau,low}$, it holds for all $k \in \N{}$ that \bequation\label{new-E} \|\E_{k,\tau,{\rm low}}[u_k - \uTrue_k]\| \leq \omega_5\beta_k \ \ \text{and}\ \ \E_{k,\tau,{\rm low}}[\|u_k - \uTrue_k\|] \leq \zeta^{-1}\sqrt{M_g} + \omega_5\beta_k. \eequation Let $E_k$ be the event that $\nabla f_k^T(d_k - d^{\rm true}_k) \geq 0$ and let $E_k^c$ be its complementary event. Let $\Pmbb_{k,\tau,{\rm low}}[\cdot]$ denote probability conditioned on the occurrence of event $E_{\tau,{\rm low}}$ and $x_k$ being the $k$th primal iterate. It now follows from~\eqref{eq:stochastic_good_case}, the definition of $E_k$, the fact that $\alpha_k \in[\alpha^{\rm min}_k,\alpha^{\rm max}_k]$, and the Law of Total Expectation that for all $k \geq k_{\tau,\xi}+1$ \bequationNN \baligned &\ \E_{k,\tau,{\rm low}}[\alpha_k\tau_k\nabla f_k^T(d_k-d^{\rm true}_k)] \\ =&\ \E_{k,\tau,{\rm low}}[\alpha_k\tau_{k_{\tau,\xi}}\nabla f_k^T(d_k-d^{\rm true}_k) | E_k]\Pmbb_{k,\tau,{\rm low}}[E_k] \\ &\ + \E_{k,\tau,{\rm low}}[\alpha_k\tau_{k_{\tau,\xi}}\nabla f_k^T(d_k-d^{\rm true}_k) | E_k^c]\Pmbb_{k,\tau,{\rm low}}[E_k^c] \\ \leq&\ \E_{k,\tau,{\rm low}}[\alpha^{\rm max}_k\tau_{k_{\tau,\xi}}\nabla f_k^T(d_k-d^{\rm true}_k) | E_k]\Pmbb_{k,\tau,{\rm low}}[E_k] \\ &\ + \E_{k,\tau,{\rm low}}[\alpha^{\rm min}_k\tau_{k_{\tau,\xi}}\nabla f_k^T(d_k-d^{\rm true}_k) | E_k^c]\Pmbb_{k,\tau,{\rm low}}[E_k^c] \\ =&\ \E_{k,\tau,{\rm low}}[(\alpha^{\rm max}_k - \alpha^{\rm min}_k)\tau_{k_{\tau,\xi}}\nabla f_k^T(d_k-d^{\rm true}_k) | E_k]\Pmbb_{k,\tau,{\rm low}}[E_k] \\ &\ + \E_{k,\tau,{\rm low}}[\alpha^{\rm min}_k\tau_{k_{\tau,\xi}}\nabla f_k^T(d_k-d^{\rm true}_k)]. \ealigned \eequationNN Combining this with the fact that \eqref{def-alphamax} ensures $\alpha^{\rm max}_k-\alpha^{\rm min}_k \leq \theta \beta_k^2$, the Cauchy-Schwarz inequality, the fact that $\alpha^{\rm min}_k = 2(1-\eta)\beta_k\xi_{k_{\tau,\xi}}\tau_{k_{\tau,\xi}}/(\tau_{k_{\tau,\xi}}L+\Gamma)$ for all $k \geq k_{\tau,\xi} + 1$, and the Law of Total Expectation shows for all $k \geq k_{\tau,\xi}+1$ that \bequationNN \baligned \E_{k,\tau,{\rm low}}[\alpha_k\tau_k\nabla f_k^T(d_k-d^{\rm true}_k)] \leq&\ \theta\beta_k^2\tau_{k_{\tau,\xi}}\|\nabla f_k\| \E_{k,\tau,{\rm low}}[\|d_k-d^{\rm true}_k\| | E_k]\Pmbb_{k,\tau,{\rm low}}[E_k] \\ &\ + \tfrac{2(1-\eta)\beta_k\xi_{k_{\tau,\xi}}\tau_{k_{\tau,\xi}}}{\tau_{k_{\tau,\xi}}L+\Gamma} \tau_{k_{\tau,\xi}}\|\nabla f_k\| \| \E_{k,\tau,{\rm low}}[d_k - d^{\rm true}_k]\| \\ \leq&\ \theta\beta_k^2\tau_{k_{\tau,\xi}}\|\nabla f_k\| \E_{k,\tau,{\rm low}}[\|d_k-d^{\rm true}_k\|] \\ &\ + \tfrac{2(1-\eta)\beta_k\xi_{k_{\tau,\xi}}\tau_{k_{\tau,\xi}}}{\tau_{k_{\tau,\xi}}L+\Gamma} \tau_{k_{\tau,\xi}}\|\nabla f_k\| \| \E_{k,\tau,{\rm low}}[d_k - d^{\rm true}_k]\| \ealigned \eequationNN Combining this with~\eqref{new-E}, \eqref{betak-requirement}, $\|d_k - d^{\rm true}_k\| = \|v_k+u_k-(v_k+\uTrue_k)\| = \|u_k-\uTrue_k\|$, and Assumption~\ref{ass.main} shows there exists $\omega_9 \in \R{}_{>0}$ where, for all $k \geq k_{\tau,\xi}+1$, \bequationNN \baligned &\ \E_{k,\tau,{\rm low}}[\alpha_k\tau_k\nabla f_k^T(d_k-d^{\rm true}_k)] \\ \leq&\ \theta\beta_k^2\tau_{k_{\tau,\xi}}\|\nabla f_k\| (\zeta^{-1}\sqrt{M_g} + \omega_5\beta_k) + \tfrac{2(1-\eta)\beta_k\xi_{k_\xi}\tau_{k_{\tau,\xi}}}{\tau_{k_{\tau,\xi}}L+\Gamma} \tau_{k_{\tau,\xi}}\|\nabla f_k\| \omega_5\beta_k \leq \omega_9\beta_k^2, \ealigned \eequationNN which is the desired conclusion. \eproof We now use the model reduction based on the true step $d^{\rm true}_k$ to build an upper bound on the (expected) reduction in the model based on the step $d_k$. \blemma\label{lm:stochastic_Delta_q} Under Event~$E_{\tau,{\rm low}}$, it holds for all $k\geq k_{\tau,\xi} + 1$ that \bequationNN \baligned &\ \E_{k,\tau,{\rm low}}[\Delta l(x_k,\tau_k,g_k,d_k)] \\ \leq&\ \Delta l(x_k,\tau_{k_{\tau,\xi}},\nabla f_k,d^{\rm true}_k) + \kappa_r\beta_k + \tau_{k_{\tau,\xi}}(\omega_6\beta_k + \omega_7\beta_k\sqrt{M_g} + \zeta^{-1}M_g). \ealigned \eequationNN \elemma \bproof Under Assumption~\ref{ass.tau_low}, the logic as in the proof of Lemma~\ref{lem:gd_diff} allows us to conclude that, under $E_{\tau,{\rm low}}$, it holds for all $k \in \N{}$ that \bequationNN |\E_{k,\tau,{\rm low}}[\nabla f_k^Td^{\rm true}_k - g_k^Td_k]| \leq \omega_6\beta_k + \omega_7\beta_k\sqrt{M_g} + \zeta^{-1}M_g. \eequationNN It follows from this, \eqref{eq.model_reduction}, the fact that $d_k = v_k + u_k$, the triangle inequality, the fact that $c_k$, $J_k$, $v_k$, $\nabla f_k$, and $d^{\rm true}_k$ are all deterministic conditioned on $x_k$ as the $k$th primal iterate, \eqref{eq.linear_system_true}, and \eqref{eq.pd_residual_condition} that for all $k\geq k_{\tau,\xi} + 1$ \bequationNN \baligned &\ \E_{k,\tau,{\rm low}}[\Delta l(x_k,\tau_k,g_k,d_k)] = \E_{k,\tau,{\rm low}}[-\tau_{k_{\tau,\xi}}g_k^Td_k + \|c_k\| - \|c_k + J_kd_k\|] \\ \leq&\ \Delta l(x_k,\tau_{k_{\tau,\xi}},\nabla f_k,d^{\rm true}_k) + \kappa_r\beta_k + \tau_{k_{\tau,\xi}}(\omega_6\beta_k + \omega_7\beta_k\sqrt{M_g} + \zeta^{-1}M_g), \ealigned \eequationNN which is the desired result. \eproof For the final result of this section, we define \bequation\label{def:Etaulow} \E_{\tau,{\rm low}}[\cdot] = \E[\ \cdot \ | \ \text{Event $E_{\tau,{\rm low}}$ occurs and Assumption~\ref{ass.tau_low} holds}]. \eequation In the result, the quantity $\Delta l(x_k,\tau_k,\nabla f_k, d^{\rm true}_k)$ serves as a measure of stationarity with respect to \eqref{prob.opt}; after all, the proof for Lemma~\ref{lm:Thetak_upper_bound} shows, with $(\nabla f_k,\uTrue_k,d^{\rm true}_k)$ in place of $(g_k,u_k,d_k)$, that by Assumption~\ref{ass.tau_low} it follows for $k\geq k_{\tau,\xi}+1$ that \bequation\label{Deltal-true} \Delta l(x_k,\tau_{k_{\tau,\xi}},\nabla f_k,d^{\rm true}_k) \geq \kappa_l\tau_{k_{\tau,\xi}}(\|\uTrue_k\|^2 + \|c_k\|) \geq \tfrac{\kappa_l\tau_{k_{\tau,\xi}}}{\omega_4}\|d^{\rm true}_k\|^2 > 0. \eequation Thus, if there is an infinite $\Kcal \subseteq \N{}$ with $\lim_{k \in \Kcal, k \to \infty} \Delta l(x_k,\tau_{k_{\tau,\xi}},\nabla f_k,d^{\rm true}_k) = 0$, then it follows from~\eqref{Deltal-true} and~\eqref{lm:vk_bounded} that $\lim_{k\in\Kcal,k\to\infty} \|c_k\| = \lim_{k\in\Kcal,k\to\infty} \|\uTrue_k\| = \lim_{k\in\Kcal,k\to\infty} \|v_k\| = 0$, which combined with~\eqref{eq.linear_system_true} shows that any limit point of $\{(x_k,y_k+\delta^{\rm true}_k)\}$ is a first-order stationary point for~\eqref{prob.opt}. In our stochastic setting, we cannot guarantee that such a limit holds surely. Rather, in the following result, we prove for two different choices of $\{\beta_k\}$ that an expected average of this measure of stationarity exhibits desirable properties. These properties match those ensured by a stochastic gradient method in the unconstrained setting (where $\|\nabla f_k\|^2$ plays the role of the measure of stationarity for the minimization of $f$). \btheorem\label{thm:stochastic_good_case_final} Under Event~$E_{\tau,{\rm low}}$, let $k_{\tau,\xi}$ be defined as in~\eqref{eq:stochastic_good_case} and define $\Abar = \tfrac{2(1-\eta)\xi_{\min}\tau_{k_{\tau,\xi}}}{\tau_{k_{\tau,\xi}}L+\Gamma}$ and $\Mbar = (1-\eta)(\Abar+\theta)\big(\kappa_r + \tau_{k_{\tau,\xi}}(\omega_6 + \omega_7\sqrt{M_g} + \zeta^{-1}M_g)\big) + \omega_8 + \omega_9$, where $\xi_{\min}$ is defined in Lemma~\ref{lem:xi-bound}. Then, the following results hold: \bitemize \item[(i)] If $\beta_k = \beta \in (0,\Abar/((1-\eta)(\Abar + \theta)))$ for all $k\geq k_{\tau,\xi} + 1$, then \bequation\label{eq:main_thm_fixed_stepsize} \baligned &\ \E_{\tau,{\rm low}}\left[\frac{1}{K}\sum_{j=k_{\tau,\xi}+1}^{k_{\tau,\xi}+K} \Delta l(x_j,\tau_{k_{\tau,\xi}},\nabla f_j,d^{\rm true}_j)\right] \\ \leq&\ \tfrac{\beta\Mbar}{\Abar - (1-\eta)(\Abar + \theta)\beta} + \tfrac{\E_{\tau,{\rm low}}[\phi(x_{k_{\tau,\xi}+1},\tau_{k_{\tau,\xi}})] - \phi_{\min}}{K\beta(\Abar - (1-\eta)(\Abar + \theta)\beta)} \xrightarrow{K\to\infty} \tfrac{\beta\Mbar}{\Abar - (1-\eta)(\Abar + \theta)\beta} \ealigned \eequation where $\phi_{\min}\in\R{}$ is a lower bound of $\phi(\cdot,\tau_{k_{\tau,\xi}})$ over $\Xcal$ $($by Assumption~\ref{ass.main}$)$. \item[(ii)] If $\{\beta_k\}_{k\geq k_{\tau,\xi}+1}$ satisfies $\sum_{k=k_{\tau,\xi}+1}^\infty \beta_k = \infty$ and $\sum_{k=k_{\tau,\xi}+1}^\infty \beta_k^2 < \infty$, then \bequation\label{eq:main_thm_diminishing_stepsize} \lim_{K\to\infty} \E_{\tau,{\rm low}}\left[\tfrac{1}{\sum_{j=k_{\tau,\xi}+1}^{k_{\tau,\xi}+K}\beta_j} \sum_{j=k_{\tau,\xi}+1}^{k_{\tau,\xi}+K} \beta_j\Delta l(x_j,\tau_{k_{\tau,\xi}},\nabla f_j,d^{\rm true}_j)\right] = 0. \eequation \eitemize \etheorem \bproof By the definition of $\Abar$, the fact that $\{\beta_k\}\subset (0,1]$, and line~\ref{line:stochastic_choose_stepsize} of Algorithm~\ref{alg:stochastic_sqp_adaptive}, it follows that $\alpha_k \in [\Abar\beta_k,(\Abar + \theta)\beta_k]$ for all $k\geq k_{\tau,\xi} + 1$. It follows from this fact, $\Delta l(x_k,\tau_{k_{\tau,\xi}},\nabla f_k,d^{\rm true}_k) > 0$ (see~\eqref{Deltal-true}), Lemmas~\ref{lm:stochastic_merit_decrease_upper_bound}, \ref{lm:stochastic_gd_diff}, \ref{lm:Thetak_upper_bound}, \ref{lem:Jd_Jv_diff}, and \ref{lm:stochastic_Delta_q}, and the fact that $\{\beta_k\}\subset (0,1]$ that, for all $k\geq k_{\tau,\xi} + 1$, one finds \bequation\label{main:both} \baligned &\ \E_{k,\tau,{\rm low}}[\phi(x_k + \alpha_k d_k,\tau_{k_{\tau,\xi}})] - \phi(x_k,\tau_{k_{\tau,\xi}}) \\ \leq&\ \E_{k,\tau,{\rm low}}[ -\alpha_k\Delta l(x_k,\tau_{k_{\tau,\xi}},\nabla f_k,d^{\rm true}_k) + \alpha_k\tau_{k_{\tau,\xi}}\nabla f_k^T(d_k - d^{\rm true}_k) ] \\ &\ + (1-\eta)\E_{k,\tau,{\rm low}}[ \alpha_k\beta_k\Delta l(x_k,\tau_{k_{\tau,\xi}},g_k,d_k)] \\ &\ + \E_{k,\tau,{\rm low}}[\alpha_k(\|c_k + J_kd_k\| - \|c_k + J_kv_k\|)] \\ \leq&\ -\Abar\beta_k\Delta l(x_k,\tau_{k_{\tau,\xi}},\nabla f_k,d^{\rm true}_k) + (\omega_8 + \omega_9)\beta_k^2 \\ &\ + (1-\eta)(\Abar+\theta)\beta_k^2\E_{k,\tau,{\rm low}}[ \Delta l(x_k,\tau_{k_{\tau,\xi}},g_k,d_k)] \\ \leq&\ (- \Abar\beta_k + (1-\eta)(\Abar + \theta)\beta_k^2)\Delta l(x_k,\tau_{k_{\tau,\xi}},\nabla f_k,d^{\rm true}_k) + \beta_k^2\Mbar \\ =&\ -\beta_k\big(\Abar - (1-\eta)(\Abar + \theta)\beta_k\big)\Delta l(x_k,\tau_{k_{\tau,\xi}},\nabla f_k,d^{\rm true}_k) + \beta_k^2\Mbar. \ealigned \eequation Let us now consider the two cases in the theorem one at a time. \textbf{Case (i).} By the definition of $\beta$, it follows by taking total expectation of~\eqref{main:both} (namely, expectation defined in~\eqref{def:Etaulow}) that for each $k\geq k_{\tau,\xi} + 1$ one has \bequationNN \baligned &\ \E_{\tau,{\rm low}}[\phi(x_k + \alpha_k d_k,\tau_{k_{\tau,\xi}})] - \E_{\tau,{\rm low}}[\phi(x_k,\tau_{k_{\tau,\xi}})] \\ \leq &\ -\beta(\Abar - (1-\eta)(\Abar + \theta)\beta)\E_{\tau,{\rm low}}[\Delta l(x_k,\tau_{k_{\tau,\xi}},\nabla f_k,d^{\rm true}_k)] + \beta^2\Mbar. \ealigned \eequationNN Summing this inequality over $j\in\{k_{\tau,\xi}+1,\ldots,k_{\tau,\xi}+K\}$ shows that \bequationNN \baligned &\ \phi_{\min} - \E_{\tau,{\rm low}}[\phi(x_{k_{\tau,\xi}+1},\tau_{k_{\tau,\xi}})] \\ \leq&\ \E_{\tau,{\rm low}}[\phi(x_{k_{\tau,\xi}+K+1},\tau_{k_{\tau,\xi}})] - \E_{\tau,{\rm low}}[\phi(x_{k_{\tau,\xi}+1},\tau_{k_{\tau,\xi}})] \\ \leq&\ -\beta (\Abar - (1-\eta)(\Abar + \theta)\beta)\E_{\tau,{\rm low}} \left[ \sum_{j=k_{\tau,\xi}+1}^{k_{\tau,\xi}+K} \Delta l(x_j,\tau_{k_{\tau,\xi}},\nabla f_j,d^{\rm true}_j) \right] + K\beta^2\Mbar, \ealigned \eequationNN which after rearrangement shows that~\eqref{eq:main_thm_fixed_stepsize} holds, as desired. \textbf{Case (ii).} Given the definition of $\{\beta_k\}$, let us assume without loss of generality that $\beta_k \leq \Abar/\big(2(1-\eta)(\Abar + \theta)\big)$ for all $k\geq k_{\tau,\xi}+1$, which implies that $\Abar - (1-\eta)(\Abar+\theta)\beta_k \geq \tfrac{1}{2}\Abar$ for all $k \geq k_{\tau,\xi}+1$. Using this fact, taking total expectation of~\eqref{main:both} (namely, expectation defined in~\eqref{def:Etaulow}), and using~\eqref{Deltal-true} it holds that \bequationNN \baligned &\ \E_{\tau,{\rm low}}[\phi(x_k + \alpha_k d_k,\tau_{k_{\tau,\xi}})] - \E_{\tau,{\rm low}}[\phi(x_k,\tau_{k_{\tau,\xi}})] \\ \leq&\ -\tfrac{1}{2}\beta_k\Abar\E_{\tau,{\rm low}}[\Delta l(x_k,\tau_{k_{\tau,\xi}},\nabla f_k,d^{\rm true}_k)] + \beta_k^2\Mbar. \ealigned \eequationNN Summing this inequality over $j\in\{k_{\tau,\xi}+1,\ldots, k_{\tau,\xi}+K\}$ shows that \bequationNN \baligned &\ \phi_{\min} - \E_{\tau,{\rm low}}[\phi(x_{k_{\tau,\xi}+1},\tau_{k_{\tau,\xi}})] \\ \leq&\ \E_{\tau,{\rm low}}[\phi(x_{k_{\tau,\xi}+K+1},\tau_{k_{\tau,\xi}})] - \E_{\tau,{\rm low}}[\phi(x_{k_{\tau,\xi}+1},\tau_{k_{\tau,\xi}})] \\ \leq&\ -\tfrac{1}{2}\Abar\E_{\tau,{\rm low}} \left[\sum_{j=k_{\tau,\xi}+1}^{k_{\tau,\xi}+K} \beta_j\Delta l(x_j,\tau_{k_{\tau,\xi}},\nabla f_j,d^{\rm true}_j) \right] + \Mbar\sum_{j=k_{\tau\xi}+1}^{k_{\tau,\xi}+K}\beta_j^2, \ealigned \eequationNN which after rearrangement and taking limits proves that \eqref{eq:main_thm_diminishing_stepsize} holds. \eproof \section{Numerical Results}\label{sec.numerical} In this section, we demonstrate the performance of a Matlab implementation of Algorithm~\ref{alg:stochastic_sqp_adaptive} for solving (i) a subset of the CUTEst collection of test problems~\cite{GoulOrbaToin15} and (ii) two optimal control problems from~\cite{HintItoKuni03}. The goal of our testing is to demonstrate the computational benefits of using inexact subproblem solutions obtained based on our termination tests from Section~\ref{sec:direction}. \subsection{Iterative solvers}\label{sec:solvers} To obtain the normal direction $v_k$ as an inexact solution of~\eqref{prob.normal}, we applied the conjugate gradient (CG) method to $J_k^TJ_kv = -J_k^Tc_k$. Denoting the $t$th CG iterate as $v_{k,t}$, where $v_{k,0} = 0$, the method sets $v_k \gets v_{k,t}$, where~$t$ is the first CG iteration such that $\|J_k^TJ_kv_{k,t} + J_k^Tc_k\| \leq \max\{0.1\|J_k^Tc_k\|,10^{-10}\}$. The properties of the CG method as a Krylov subspace method ensure that $v_{k,t}\in\Range(J_k^T)$ for all $t\in\N{}$ (in exact arithmetic); hence, $v_k\in\Range(J_k^T)$. To obtain the tangential direction $u_k$ and associated dual search direction $\delta_k$, we applied the minimum residual (MINRES) method, namely, the implementation from~\cite{ChoiPaigSaun11,PaigSaun75}, to the linear system \bequation\label{eq:stochastic_system_numerics} \bbmatrix H_k & J_k^T \\ J_k & 0 \ebmatrix \bbmatrix u \\ \delta \ebmatrix = - \bbmatrix g_k + H_kv_k + J_k^Ty_k \\ 0 \ebmatrix. \eequation (We discuss our choice of $H_k$ along with each set of experiments.) Letting $(u_{k,t},\delta_{k,t})$ denote the $t$th MINRES iterate, where $(u_{k,0},\delta_{k,0}) = (0,0)$, the method sets $(u_k,\delta_k) \gets (u_{k,t},\delta_{k,t})$ where~$t$ is the first MINRES iteration such that, for some $\kappa\in(0,1)$, \bequation\label{eq:additional_condition} \left\|\bbmatrix \rho_{k,t} \\ r_{k,t} \ebmatrix \right\|_{\infty} \leq \max \left\{ \kappa \left\|\bbmatrix g_k + H_kv_k + J_k^Ty_k \\ 0 \ebmatrix \right\|_{\infty}, 10^{-12} \right\} \eequation and Termination Test 1 and/or 2 holds. (Recall the definition of $(\rho_{k,t},r_{k,t})$ in~\eqref{eq:stochastic_system_iterative}.) The choice of $\kappa\in(0,1)$ is discussed along with each set of experiments. \subsection{Choosing the step size} Algorithm~\ref{alg:stochastic_sqp_adaptive} (see line~\ref{line:stochastic_choose_stepsize}) stipulates that the step size $\alpha_k$ chosen for the $k$th iteration satisfies $\alpha_k\in[\alpha^{\rm min}_k,\alpha^{\rm max}_k]$. Keeping in mind that the inequalities $\alpha^{\rm min}_k \leq \alpha^{\rm suff}_k \leq 1$ and $\alpha^{\rm suff}_k \leq \alpha^{\varphi}_k$ (see Lemma~\ref{lm:stepsize_well_defined}) hold, we take advantage of this flexibility in choosing the step size by defining \bequationNN \alpha_k \gets \bcases \min\{\alpha^{\rm suff}_k,\alpha^{\rm min}_k+\theta\beta_k^2\} & \text{if $\alpha^{\rm suff}_k = 1$} \\ \alpha^{\rm min}_k+\theta\beta_k^2 & \text{if $\alpha^{\rm min}_k+\theta\beta_k^2 \leq \alpha^{\rm suff}_k < 1$} \\ (1.1)^{t_k}\alpha^{\rm suff}_k & \text{if $\alpha^{\rm suff}_k < \min\{\alpha^{\rm min}_k+\theta\beta_k^2, 1\}$,} \ecases \eequationNN where $t_k$ is the largest value of $t \in \N{}$ such that \bequationNN (1.1)^t\alpha^{\rm suff}_k \leq \min\{\alpha^{\varphi}_k,\alpha^{\rm min}_k+\theta\beta_k^2\} \equiv \alpha^{\rm max}_k \ \text{and} \ (1.1)^{t-1}\alpha^{\rm suff}_k < 1. \eequationNN When $\alpha^{\rm suff}_k < 1$, this strategy allows for the possibility that step sizes larger than $\min\{\alpha^{\rm suff}_k , \alpha^{\rm min}_k + \theta\beta_k^2\}$ be taken (namely, they can be as large as $\min\{\alpha^{\varphi}_k , \alpha^{\rm min}_k + \theta\beta_k^2\}$). This led to better performance while still having a rule that satisfies the requirements of our analysis. We do not explicitly compute $\alpha^{\varphi}_k$ in our code. Instead, we can verify directly whether $(1.1)^t\alpha^{\rm suff}_k \leq \alpha^{\varphi}_k$ (as needed above) since this is ensured by checking whether $\varphi((1.1)^t\alpha^{\rm suff}_k) \leq 0$, which is easily checked by the code. \subsection{Algorithm variants tested} To test the utility of using inexact subproblem solutions in Algorithm~\ref{alg:stochastic_sqp_adaptive}, we consider two algorithm variants that we refer to as {\tt SISQO}{} and {\tt SISQO\_exact}{}. The variant {\tt SISQO}{} is Algorithm~\ref{alg:stochastic_sqp_adaptive} with inexact solutions computed as described in Section~\ref{sec:solvers} with a relatively \emph{large} value for $\kappa$ in~\eqref{eq:additional_condition}. On the other hand, the variant {\tt SISQO\_exact}{} is identical to {\tt SISQO}{} with the exception that it uses a relatively \emph{small} value for $\kappa$ in~\eqref{eq:additional_condition}. We specify the values of $\kappa \in (0,1)$ used along with each of our tests in Sections~\ref{sec.CUTE} and \ref{sec.control}. Our reason for comparing these two variants is to focus attention on the numerical gains obtained as a result of using inexact subproblem solutions. For this reason, we allow both variants to use the same computation for the normal step, thus allowing any numerical gains to be directly attributed to the inexact tangential step computation. Although other variants could be tested (e.g., allowing the normal step computation to differ as well) we prefer the approach described above since it limits the variation attributable to the different calculations in the SISQO framework. \subsection{Metrics used for comparison}\label{sec:metrics} Our metrics of interest are feasibility and stationarity. Specifically, for any run of {\tt SISQO}{}, we terminate with $x_{{\tt SISQO}} \gets x_k$, where $k \in \N{}$ is the first iteration such that $\|c(x_k)\|_{\infty} \leq 10^{-6}$ and $\|\nabla f_k + J_k^T y_{k,{\rm ls}}\|_{\infty} \leq 10^{-2}$, where $y_{k,{\rm ls}}$ is the least-square multiplier at $x_k$. (The computations of $\nabla f_k$ and $y_{k,{\rm ls}}$ are not required by our algorithm in general; they were computed in our experiments merely for the purpose of being able to determine an accurate measure of stationarity at $x_k$.) This allows us to associate with each run of {\tt SISQO}{} the two measures \bequationNN \baligned \text{error}_\text{feasibility}({\tt SISQO}{}) &= \|c(x_{{\tt SISQO}})\|_{\infty} \ \ \text{and} \ \ \\ \text{error}_\text{stationarity}({\tt SISQO}{}) &= \|\nabla f(x_{{\tt SISQO}}) + J(x_{{\tt SISQO}})^T y_{{\tt SISQO}}\|_{\infty}, \ealigned \eequationNN where $y_{{\tt SISQO}}\in\R{m}$ is the least-square multiplier at $x_{{\tt SISQO}}$. We use the total number of MINRES iterations performed by {\tt SISQO}{} as a budget for the number of MINRES iterations performed by {\tt SISQO\_exact}{}; no other termination condition is used for {\tt SISQO\_exact}{}. Upon termination of {\tt SISQO\_exact}{}, we define $x_{{\tt SISQO\_exact}}$ in the following manner: If an iterate is computed with $\|c(x_k)\|_{\infty} \leq 10^{-6}$, then $x_{{\tt SISQO\_exact}}$ is chosen as the iterate with smallest stationarity measure among those satisfying this tolerance for the feasibility measure; otherwise, $x_{{\tt SISQO\_exact}}$ is chosen as the iterate with the smallest feasibility measure. In any case, once $x_{{\tt SISQO\_exact}}$ is determined, we proceed to compute the least-square multiplier $y_{{\tt SISQO\_exact}}$ at $x_{{\tt SISQO\_exact}}$, then define \bequationNN \baligned \text{error}_\text{feasibility}({\tt SISQO\_exact}{}) &= \|c(x_{{\tt SISQO\_exact}})\|_{\infty} \ \ \text{and} \ \ \\ \text{error}_{\text{stationarity}}({\tt SISQO\_exact}{}) &= \|\nabla f(x_{{\tt SISQO\_exact}}) + J(x_{{\tt SISQO\_exact}})^T y_{{\tt SISQO\_exact}}\|_{\infty}. \ealigned \eequationNN These are the metrics that we use in the next two subsections. \subsection{Results on the CUTEst problems}\label{sec.CUTE} In the CUTEst collection \cite{GoulOrbaToin15}, there are a total of 138 equality constrained problems with $m\leq n$. From these problems, we selected those such that (i) $(n+m)\in [500,10000]$, (ii) the objective function is not constant, (iii) the objective function remained above $-10^{50}$ over the sequences of iterates generated by runs of our algorithm, and (iv) the LICQ was satisfied at all iterates encountered in each run of our algorithm. This process of elimination resulted in the following $11$ test problems: \texttt{ELEC}, \texttt{LCH}, \texttt{LUKVLE1}, \texttt{LUKVLE3}, \texttt{LUKVLE4}, \texttt{LUKVLE6}, \texttt{LUKVLE7}, \texttt{LUKVLE9}, \texttt{LUKVLE10}, \texttt{LUKVLE13}, and \texttt{ORTHREGC}. The problems from the CUTEst collection are deterministic, and for the purpose of these experiments we exploited this fact to compute values as needed by our algorithm, including using function evaluations to estimate Lipschitz constants and using a (modified) Hessian of the Lagrangian in each search direction computation, as explained below. However, we introduced noise into the computation of the objective function gradients. In particular, we generated stochastic gradients as $g_k = \Ncal(\nabla f_k,\tfrac{\epsilon_N^2}{n}I)$, where for testing purposes we considered the three noise levels $\epsilon_N \in \{10^{-4},10^{-2},10^{-1}\}$. This particular choice for defining the stochastic gradients ensured that an appropriate value for $M_g$ as indicated in Assumption~\ref{ass.g} would be given by $M_g = \{10^{-8},10^{-4},10^{-2}\}$, corresponding to the values for $\epsilon_N$. In terms of algorithm parameters, we set $\kappa = 0.1$ for {\tt SISQO}{} and $\kappa = 10^{-7}$ for {\tt SISQO\_exact}{}. All of the remaining parameters were set identically for the two variants with the following values: $\tau_{-1} = \sigma_c = \eta = \kappa_v = \kappa_u = 0.1$, $\xi_{-1} = \epsilon_c = 1$, $\epsilon_{\tau} = \epsilon_{\xi} = 0.01$, $\kappa_{\rho} = \kappa_r = 100$, $\epsilon_r = 1-10^{-4}$, $\zeta = 10^{-8}$, $\epsilon_u = 5\times 10^{-9}$, $\sigma_u = 1-10^{-12}$, $\theta = 10^4$, and $\beta_k = 1$ for all $k\in\N{}$. During each iteration $k\in\N{}$, we randomly generated a sample point near $x_k$, then estimated $L_k$ and $\Gamma_k$ using finite differences of the objective gradients and constraint Jacobians between $x_k$ and the sampled point. These values were used in place of $L$ and $\Gamma$, respectively, in our step size selection. For this collection of problems, we employed an iterative Hessian modification strategy as proposed in~\cite{ByrdCurtNoce10,CurtNoceWach09}. Specifically, for all $k \in \N{}$, the matrix $H_k$ is initialized to the true Hessian of the Lagrangian, but may be set ultimately as \bequationNN H_k \gets \iota_k \nabla^2_{xx}\big(f(x)+c(x)^T y\big)|_{(x,y)=(x_k,y_k)} + (1 - \iota_k) I \eequationNN with $\iota_k = 10^{-j_k}$, where $j_k$ is the smallest element in $\{0,\dots,10\}$ such that a modification is not triggered. If a modification is triggered at $\iota_k = 10^{-10}$, then the algorithm sets $H_k \gets I$ to guarantee that no further modifications are required. For each test problem, we ran both {\tt SISQO}{} and {\tt SISQO\_exact}{} five times, and for each computed the resulting feasibility and stationarity errors as described in Section~\ref{sec:metrics}. The results are shown in the form of box plots in Figure~\ref{fig.perf_cutest}. \begin{figure}[ht] \centering \includegraphics[width=0.42\textwidth,clip=true,trim=20 5 90 50]{CUTEST_feasibility.png}\quad \includegraphics[width=0.42\textwidth,clip=true,trim=20 5 90 50]{CUTEST_stationarity.png} \caption{Box plots on CUTEst problems for feasibility (left) and stationarity (right).} \label{fig.perf_cutest} \end{figure} From Figure~\ref{fig.perf_cutest}, one finds that {\tt SISQO}{} performs better than {\tt SISQO\_exact}{} in terms of both feasibility and stationarity errors. Also, in general, {\tt SISQO}{} achieves smaller feasibility and stationarity errors for smaller noise levels, which may be expected due to the fact that these experiments are run with constant $\{\beta_k\}$. \subsection{Results on optimal control problems}\label{sec.control} In our second set of experiments, we considered two optimal control problems motivated by those in~\cite{HintItoKuni03}. In particular, we modified the problems to have equality constraints only and finite sum objective functions. Specifically, given a domain $\Xi\in\R{2}$, a constant $N\in\N{}_{>0}$, reference functions $\wbar_{ij}\in L^2(\Xi)$ and $\zbar_{ij}\in L^2(\Xi)$ for $(i,j)\in\{1,\ldots,N\}\times\{1,\ldots,N\}$, and a regularization parameter $\lambda\in\R{}_{>0}$, we first considered the problem \bequation\label{eq:OC_prob_1} \baligned \min_{w,z}\ & \frac{1}{N^2}\sum_{i=1}^N\sum_{j=1}^N (\tfrac{1}{2} \|w - \wbar_{ij}\|_{L^2(\Xi)}^2 + \tfrac{\lambda}{2} \|z - \zbar_{ij}\|_{L^2(\Xi)}^2) \\ \text{s.t. }& -\Delta w = z \ \text{in} \ \Xi, \ \text{and} \ w = 0 \ \text{on}\ \partial\Xi. \ealigned \eequation Second, with the same notation but $\zbar_{ij}\in L^2(\partial \Xi)$, we also considered \bequation\label{eq:OC_prob_2} \baligned \min_{w,z}\ & \frac{1}{N^2}\sum_{i=1}^N\sum_{j=1}^N (\tfrac{1}{2} \|w - \wbar_{ij}\|_{L^2(\Xi)}^2 + \tfrac{\lambda}{2} \|z - \zbar_{ij}\|_{L^2(\partial\Xi)}^2) \\ \text{s.t. }& -\Delta w + w = 0 \ \text{in} \ \Xi, \ \text{and} \ \tfrac{\partial w}{\partial p} = z \ \text{on} \ \partial\Xi, \ealigned \eequation where $p$ represents the unit outer normal to $\Xi$ along $\partial \Xi$. As reference functions for both problems, we chose for all $(i,j)\in\{1,\ldots,N\}\times\{1,\ldots,N\}$ the following: \bequation\label{eq:reference_functions} \zbar_{ij} = 0\ \text{and}\ \wbar_{ij}(x_1,x_2) = \sin((4 + \tfrac{\epsilon_N}{\epsilon_S} (i-\tfrac{N+1}{2})) x_1) + \cos((3 + \tfrac{\epsilon_N}{\epsilon_S} (j-\tfrac{N+1}{2})) x_2) \eequation for some $(\epsilon_S,\epsilon_N)\in\R{}_{>0}\times\R{}_{>0}$. We selected the following values for the above constants: $N=3$, $\lambda = 10^{-5}$, $\epsilon_S = \sqrt{15}$, and $\epsilon_N \in \{10^{-4},10^{-2},10^{-1}\}$. Since the objective functions of \eqref{eq:OC_prob_1} and \eqref{eq:OC_prob_2} are finite sums, to generate stochastic gradients as unbiased estimates of the true gradient, we first uniformly generated random $(i,j)\in \{1,\ldots,N\} \times \{1,\ldots,N\}$, then computed the gradient corresponding to the $(i,j)$th term in the objective function. We note that with the above choice of parameters, it follows that an appropriate value for $M_g$ in Assumption~\ref{ass.g} is given by $M_g \approx \{10^{-8},10^{-4},10^{-2}\}$ to correspond, respectively, to the above values for $\epsilon_N$. Since the optimal control problems have a quadratic objective function and linear constraints, we used the exact second derivative matrix $H_k = \diag(I,\lambda I)$ for all $k\in\N{}$. For this choice, the curvature condition on $H_k$ in Assumption~\ref{ass.H} is trivially satisfied. In terms of algorithm parameters, we set $\kappa = 10^{-4}$ for {\tt SISQO}{} and $\kappa = 10^{-7}$ for {\tt SISQO\_exact}{}. All of the remaining parameters were set identically for the two variants in the same manner as in the previous section with the following exceptions: $\tau_{-1} = 10^{-4}$, $\eta = 0.5$, and $L_k = 1$ and $\Gamma_k = 0$ for all $k\in\N{}$, which are valid choices since the objective functions are quadratic and the constraints are linear. For each of the two optimal control problems in \eqref{eq:OC_prob_1} and \eqref{eq:OC_prob_2}, we ran both {\tt SISQO}{} and {\tt SISQO\_exact}{} ten times, then computed their average feasibility and stationarity errors as described in Section~\ref{sec:metrics}. In Table~\ref{table:OC_prob_1} and Table~\ref{table:OC_prob_2}, we report these average values as well as the average number of iterations performed by Algorithm~\ref{alg:stochastic_sqp_adaptive} before termination (``iterations") and number of MINRES iterations (``MINRES iterations"), with the latter discussed in Section~\ref{sec:solvers}. The results are given in Table~\ref{table:OC_prob_1} and Table~\ref{table:OC_prob_2} for problem~\eqref{eq:OC_prob_1} and problem~\eqref{eq:OC_prob_2}, respectively. One can observe that despite performing more ``outer'' iterations on average, {\tt SISQO}{} outperforms {\tt SISQO\_exact}{} due to the fact that it requires fewer overall linear system solver iterations on average in order to attain better average feasibility and stationarity errors. \begin{table}[ht] \centering \small \begin{tabular}{ |l|c|c|c|c|c| } \hline strategy & $\epsilon_N$ & \begin{tabular}{c} feasibility \\[-0.2em] error \end{tabular} & \begin{tabular}{c} stationarity \\[-0.2em] error \end{tabular} & \begin{tabular}{c} MINRES \\[-0.2em] iterations \end{tabular} & iterations \\ \hline \hline {\tt SISQO}{} & $10^{-4}$ & $2.41\times 10^{-7}$ & $1.76\times 10^{-5}$ & 55117 & 8.9 \\ \hline {\tt SISQO\_exact}{} & $10^{-4}$ & $3.86\times 10^{-5}$ & $4.05\times 10^{-5}$ & 55117 & 6.9 \\ \hline\hline {\tt SISQO}{} & $10^{-2}$ & $4.14\times 10^{-7}$ & $2.09\times 10^{-3}$ & 60894 & 8.8 \\ \hline {\tt SISQO\_exact}{} & $10^{-2}$ & $3.46\times 10^{-5}$ & $1.95\times 10^{-3}$ & 60894 & 6.8 \\ \hline\hline {\tt SISQO}{} & $10^{-1}$ & $3.43\times 10^{-7}$ & $5.15\times 10^{-3}$ & 93634 & 12.3 \\ \hline {\tt SISQO\_exact}{} & $10^{-1}$ & $2.36\times 10^{-6}$ & $1.68\times10^{-2}$ & 93634 & 10 \\ \hline \end{tabular} \caption{Numerical results for problem~\eqref{eq:OC_prob_1} averaged over ten independent runs.} \label{table:OC_prob_1} \end{table} \begin{table}[ht] \centering \small \begin{tabular}{ |l|c|c|c|c|c| } \hline strategy & $\epsilon_N$ & \begin{tabular}{c} feasibility \\[-0.2em] error \end{tabular} & \begin{tabular}{c} stationarity \\[-0.2em] error \end{tabular} & \begin{tabular}{c} MINRES \\[-0.2em] iterations \end{tabular} & iterations \\ \hline \hline {\tt SISQO}{} & $10^{-4}$ & $3.29\times 10^{-7}$ & $2.35\times 10^{-5}$ & 91478 & 9.9 \\ \hline {\tt SISQO\_exact}{} & $10^{-4}$ & $5.44\times 10^{-4}$ & $5.46\times 10^{-4}$ & 91478 & 7.1 \\ \hline\hline {\tt SISQO}{} & $10^{-2}$ & $2.90\times 10^{-7}$ & $2.07\times 10^{-3}$ & 99921 & 10 \\ \hline {\tt SISQO\_exact}{} & $10^{-2}$ & $5.71\times 10^{-5}$ & $2.37\times 10^{-3}$ & 99921 & 7.6 \\ \hline\hline {\tt SISQO}{} & $10^{-1}$ & $1.68\times 10^{-7}$ & $3.88\times 10^{-4}$ & 158825 & 14.5 \\ \hline {\tt SISQO\_exact}{} & $10^{-1}$ & $1.31\times 10^{-5}$ & $2.58\times 10^{-2}$ & 158825 & 11.1 \\ \hline \end{tabular} \caption{Numerical results for problem \eqref{eq:OC_prob_2} averaged over ten independent runs.} \label{table:OC_prob_2} \end{table} \section{Conclusion}\label{sec.conclusion} We have proposed, analyzed, and tested an \emph{inexact} stochastic SQP algorithm for solving stochastic optimization problems involving deterministic, smooth, nonlinear equality constraints. We proved a convergence guarantee (in expectation) for our algorithm that is comparable to that proved for the \emph{exact} stochastic SQP method recently presented in \cite{BeraCurtRobiZhou21}, which in turn is comparable to that known for the stochastic gradient in unconstrained settings \cite{BottCurtNoce18}. Our Matlab implementation, {\tt SISQO}{}, illustrated the benefits of allowing inexact step computation for solving problems from the CUTEst collection~\cite{GoulOrbaToin15} as well as two optimal control problems.
\section{Introduction} The first part of this paper arose from attempts to produce a general means of extending triangle-free linear Ramsey graphs by including one or more additional colours, in a way that reliably produced superior lower bounds for the relevant Ramsey numbers and Schur numbers. At this point, we note the isomorphisms between the 'distance sets' defining colourings of linear Ramsey graphs, and the corresponding Schur partitions. In this endeavour, it was noted that few of the most significant lower bounds for 'small' Ramsey graphs had been produced by combining graphs or partitions, with the notable exception of that given by Chung \cite{Chung} demonstrating that $R_{4}(3) \ge 51$. However, Chung's construction does not depend on or preserve linearity in the colouring, so it is not useful in addressing the Schur numbers. Neither the pioneering construction of Schur \cite{Schur} , nor the stronger result of Abbott and Hanson (Corollary 2.1 in \cite{AbbH}) produce strong lower bounds on $S(k)$ for $5 \le k \le 7$, leaving such bounds to be set by computer search programs, a very important example being those mentioned in \cite{FrSw}. This paper describes a search strategy that was used to find an improved upper bound for $S(7)$, and shows one particularly symmetrical result. The partition can easily be verified as being sum-free, so no complex proof is needed. The search was effective in a limited time, only because the strategy was constrained to a certain very limited range of patterns. For the second result, a proof in terms of linear graphs is already given in \cite{FR-GLRGC}. The numerical result depends on the existence of a specific graph, for which the distance set (a Schur partion) is attached to this paper. The implications of the existence of this partition for Schur numbers are briefly mentioned here. Some notation is defined in Section 2. In Section 3, we describe the search strategy that resulted in the attached partition, and the motivation for it. In Section 4, we describe a key partition of order 376, and show how it leads to the formula $S(k+5) \ge 376.S(k)+160$. Section 5 contains some very brief remarks on further implications of these results. \section{Definitions and Notation} In this paper: A set of integers of the form $\{i \mid a \le i \le b\}$ for integers a, b, may be written as $[a, b]$. If a set of integers contains no three integers $a, b, c$, not necessarily distinct, such that $a + b = c$, then it is {\it sum-free}. If a set $S$ is partitioned into disjoint non-empty subsets $S_i$, for $1 \le i \le k$, and all the subsets in the partition are sum-free, that partition is a {\it Schur partition}. For integer $k > 0$, the {\it Schur number} $S(k)$ is the maximum value of $n$ such that a Schur partition of $[1, n]$ into $k$ subsets exists: its existence is established by Ramsey's Theorem. \section{A Simple Search Strategy} The highest existing lower bounds for $S(6)$ and $S(7)$ derive from work by Fredricksen and Sweet, whose search strategy is set out in \cite{FrSw}. It can be paraphrased briefly as a process allocating numbers to subsets in a candidate partition, each allocation having regard to the number of 'blockages' (in their terminology) already applying to that number as a result of previous allocations. Some optimisation was used to decide the order in which numbers were allocated, and many trials were carried out. Importantly for run-times, the authors used a constraint that the partition should be symmetrical (with special provision in the $S(6)$ case to allow the numbers 179 and 358 to be in different sets). There was a further more flexible constraint (again paraphrasing) that in constructing candidates for $S(k)$, one subset was restricted to contain only numbers above a certain minimum, and their complements. The chosen minimum was intended to be below, but close to, a known lower bound for $S(k-1)$. The partition in the file attached was produced by a more straightforward tree search, although the constraints in this case were much tighter. The attempt to produce a higher lower bound for $S(7)$ was initiated partly because the value of 1680 was seen to be very close to the maximum of 1664 obtainable from the new construction described in \cite{FR-GLRGC}. Since the value of 536 as a lower bound for $S(6)$ was well clear of the best attainable by compounding other graphs, $S(7)$ seemed a more natural target for improvement. It was also noted that the ratio of 1680/536 falls well short of the ratio of 536/160 - noting that 160 is reported to be the precise value of $S(5)$. The strategy was to first decide on the order of partitions to be tested (in this case 1696) and then to take examples of an almost-symmetrical partition of a base set (in this case, $[1, 536]$), into six colours, putting the next integer (537) in a new seventh subset. For each integer $x \le 537$ in the partition, its complement $(1697-x)$ was included in the same subset. It was then only necessary to carry out a plain tree-search for satisfactory partitions, starting from 538 and working upwards. It should be noted that the integers immediately above 537 are already heavily 'blocked' by previous entries in this structure. The fact that the starting partition of $[1, 536]$ is markedly non-critical appeared to help the search by limiting the number of blockages slightly. In this case, the resulting partition may be fully symmetrical, since 1697 is not divisible by 3, and the example provided in the attached ancillary file was chosen to be fully symmetrical. However, we note that a profusion of examples were found that were not symmetrical, and the attached partition is highly non-critical: which may be a sign that there are larger partitions to be found. \section{Three Particular Partitions} This section briefly describes the attributes of a sum-free partition of $[1, 376]$ into 6 subsets, which -- if converted into a linear Ramsey graph, and borrowing the terminology of \cite{FR-GLRGC} -- has a 'triangle-free template' and a parameter $\phi = 160$. Its profile is included in the ancillary file. The application of the Ramsey graph result to Schur partitions, mentioned in that paper, is a simple consequence of an effective equivalence between the so-called 'linear' graphs and Schur partitions -- the distance sets of the linear graph being isomorphic to the subsets comprising the Schur partition, and similarly sum-free. This partition has been verified as suitable for use in the construction described in \cite{FR-GLRGC}, which assures that the constructed partition remains sum-free. Used with the strong Schur partition of $[1, 4]$ into subsets $\{1, 4\} , \{2, 3\}$, it produces the partition of $[1, 1664]$ described above, and attached in the ancillary file. It does this by replacing the subset equivalent to the 'template colour' with multiple translations of that subset following the pattern of that second partition, as also described in \cite{FR-GLRGC}. In fact, this partition can be combined with any strong Schur partition in this way, and therefore by repeated application, its existence implies that $S(k+5) \ge 376.S(k)+160$ for all integer $k > 0$. By constructing an infinite series of such graphs, we can demonstrate that $$\lim_{\substack{r \rightarrow \infty}} R{_r}(3)^{1/r} \ge \sqrt[5]{376} = 3.273 \dots $$. This is a notable improvement over previous lower bounds, of which the previous highest value of $3.199 \dots$ is to be found in \cite{XXER}. A sum-free partition of $[1, 109]$ into 5 subsets with parameter $\phi = 39$, constructed similarly, is also included in the ancillary file, and by the same logic, its existence implies that $S(k+4) \ge 109.S(k)+39$ for all integer $k > 0$. A sum-free partition of $[1, 33]$ with similar properties in 4 colours, and with parameter $\phi = 6$, is included in the same ancillary file. Its existence similarly implies that $S(k+3) \ge 33.S(k)+6$ for all integer $k > 0$. Each of these partitions can of course be applied as described in \cite{Rowley3} to produce weak Schur partitions of unlimited size. \section{Some Remarks} As regards Section 3, it is interesting to note that many satisfactory partitions of order 1696 were found relatively quickly -- in fact, on the first day of test-running of the search programs. However, no larger partition into 7 colours has been found so far, despite further searches for sets of order close to 1696. It is interesting to note that, like 1680, the integer 1696 is divisible by 16; which perhaps may be a sign of some structure that has not been detected in either of the partitions. As regards Section 4, the main objective in the current paper is to make clearer the structure of certain graphs used to produce previous results, by providing a set of examples. Some of the partitions exhibited here are equivalent to the linear graph colourings underpinning the results in \cite{FR-GLRGC}, as well as some of the results mentioned in \cite{Rowley3}. It is hoped that the availability of these examples will be useful to other researchers in this area.
\section*{References}} \DeclareMathOperator{\sech}{sech} \begin{document} \title{Hopfield Neuronal Network of Fractional Order: A note on its numerical integration} \author{Marius-F. Danca{\footnote{Corresponding author}}\\ Romanian Institute of Science and Technology, \\ 400487 Cluj-Napoca, Romania\\ Email: [email protected]\\ } \maketitle \begin{abstract} In this paper, the commensurate fractional-order variant of an Hopfield neuronal network is analyzed. The system is integrated with the ABM method for fractional-order equations. Beside the standard stability analysis of equilibria, the divergence of fractional order is proposed to determine the instability of the equilibria. The bifurcation diagrams versus the fractional order, and versus one parameter, reveal a strange phenomenon suggesting that the bifurcation branches generated by initial conditions outside neighborhoods of unstable equilibria are spurious sets although they look similar with those generated by initial conditions close to the equilibria. These spurious sets look ``delayed'' in the considered bifurcation scenario. Once the integration step-size is reduced, the spurious branches maintain their shapes but tend to the branches obtained from initial condition within neighborhoods of equilibria. While the spurious branches move once the integration step size reduces, the branches generated by the initial conditions near the equilibria maintain their positions in the considered bifurcation space. This phenomenon does not depend on the integration-time interval, and repeats in the parameter bifurcation space. \end{abstract} \textbf{keyword }Hopfield neural network; Hidden chaotic attractor; Self-excited attractor; Numerical periodic trajectory; ABM method for fractional-order equations \vspace{3mm} \section{Introduction} Simplified artificial neural networks like the integer-order model considered in \cite{dancus1} and analyzed as a fractional-order model in this paper are inspired by biological neural networks and consists of interconnected groups of neurons. Chaotic behaviors in these systems are still not adequately addressed nor fully understood (see e.g. \cite{skarda}). The chaos presence in neuronal networks has been investigated in the last thirty years \cite{gid,nara2,cao,aih,free,guck}. Hopfield Neural Networks (HNNs), particular cases of neural networks, has been inspired from spin systems \cite{spin}. Although if chaos is not easy to identify in these systems, it has been found in many HNNs (see e.g. \cite{csf1,opp,yang,csf3,cpb6}). In the last thirty years, numerous results on fractional derivative operators suggested that the underlying time memory effect is a useful tool to describe the memory property of an information process. The applications of the Fractional Order (FO) calculus is as old as the Integer Order (IO) one, and was first widely present in mathematics. Because of the nonlocal characteristic of ``infinite memory'' effect, FO systems proved to describe more accurately the behavior of real dynamical systems, compared to the IO models. Definitions of FO derivative have been formulated by Liouville, Grunwald, Letnikov, and Riemann, in the late 19th century, while the first definition of a fractional difference operator was proposed in 1974 \cite{frac20}. For basic aspects of the theory of FO systems see the monographs of Podlubny \cite{frac10}, Kilbas et al. \cite{kil}. In this paper, the FO derivative in the sense of Caputo \cite{frac4} is considered especially because it allows the choice of initial conditions as that for the IO systems \[ D_*^qx=\frac{1}{\Gamma \left \lceil{q}\right \rceil-q }\int_0^t(t-\tau)^{\left \lceil{q}\right \rceil -q-1}D^{\left \lceil{q}\right \rceil }x(\tau)d\tau, \] where $D_*^q$ denotes the Caputo differential operator of order $q$ with starting point $0$, $D^{\left \lceil{q}\right \rceil}$ is the standard differential operator of integer order $\left \lceil{q}\right \rceil\in \mathbb{N}$. For $q\in(0,1)$, as considered in this paper, $D^{\left \lceil{q}\right \rceil}x=x\textprime$. Caputo's derivative models phenomena from the interactions within the past time history (equations having ``memory'') and also for problems with nonlocal properties. Because the Caputo derivative of a function requires the calculation of its derivative, it is defined only for differentiable functions. Therefore, hereafter it is assumed that all functions are at least differentiable. The FO HNN of commensurate order considered in this paper belongs to the class of systems modeled by the following autonomous Initial Value Problem \begin{equation}\label{eqx1} D_*^qx(t)=f(x(t)),~~~ x(0)=x_0, \end{equation} where $f:\mathbb{R}^n\rightarrow \mathbb{R}^n$ is a vector-valued function. The numerical method used in this paper to integrate the problem \eqref{eqx1} is one of the most performing and utilized numerical methods to integrate systems of FO, the predictor-corrector Adams-Bashforth-Moulton (ABM) method for FDEs \cite{frac3}, which is of a Predict, Evaluate, Correct, Evaluate (PECE) type. From the computational point of view, there exists the following classification of attractors \begin{definition}\cite{unu,doi,patru,trei,ixus2}\label{def} An attractor is called \emph{self-excited} if its basin of attraction intersects with any open neighborhood of an equilibrium; otherwise, it is called \emph{hidden}. \end{definition} Most important ingredients of hidden attractors are: multistability \cite{opt,ixus2}, systems without equilibria \cite{hid1}, systems with stable equilibria \cite{hid1,frac1}, line of equilibria \cite{hid2,hid3}. While the basin of attraction for a hidden attractor is not connected with any equilibrium and, therefore, for the numerical localization it is necessary to develop special analytical-numerical procedures \cite{ixus3,unu,trei}. Self-excited attractors can be visualized numerically by a standard computational procedure, in which a trajectory starting from a point in a neighborhood of an unstable equilibrium leads to the attractor. To check that a chaotic attractor of a system which has unstable equilibria is hidden, one verify if the trajectories starting in small neighborhoods of the unstable equilibria are not attracted by the attractor (see e.g. \cite{doi,trei}). In this paper, we consider the FO variant of the simplified $3$-neuron IO HNN presented in \cite{dancus1}. The FO variant presents some interesting characteristics unveiled by the used Adams-Bashforth-Moulton scheme for FO differential equations. The paper is structured as follows: Section 2 presents the FO variant of the HNN system and its numerical integration. Section 3 deals with the problem of coexistence of attractors, where the stability of the equilibria and the existence of hidden attractor are studied. In Section 4, a strange dependence on the integration step-size of some attractors is revealed and discussed. The last section of Conclusion closes the paper. \section{FO Hopfield neural network and its numerical integration} The FO $3$-neuron HNN considered in this paper is the Caputo FO variant of the simplest example of HNNs of IO analyzed in \cite{dancus1} \begin{equation}\label{eq} D_{*}^qx_i=-x_i+\sum_{j=1}^3w_{ij}f(x_j),\quad x_i(0)=x_{0i}\quad i=1,2,3, \end{equation} \noindent with the commensurate order $q\in(0,1)$, sigmoid like functions $f(x)=[\tanh(x_1),\tanh(x_2),\tan(x_3)]^t$, approximating the discontinuity at $x_i=0$, with the weight matrix \[W= \begin{bmatrix} w_{11}& w_{12}& w_{13}\\ w_{21}& w_{22}& w_{23}\\ w_{31}& w_{32}& w_{33} \end{bmatrix} = \begin{bmatrix} 1.995&-1.2&0\\ 2& 1.71&1.15\\ -4.75&0&1.1 \end{bmatrix}. \] Therefore, the system (\ref{eq}) reads \begin{equation}\label{eq2} \begin{aligned} D_*^q{x}_1=&-x_1+1.995~\tanh(x_1)-1.2~\tanh(x_2),\\ D_*^q{x}_2=&-x_2+2~\tanh(x_1)+1.71~\tanh(x_2)+1.15~\tanh(x_3),\\ D_*^q{x}_3=&-x_3-4.75~\tanh(x_1)+1.1~\tanh(x_3). \end{aligned} \end{equation} Chaos, stability analysis, digital implementation or synchronization of HNNs are studied in \cite{Hop_1,Hop_2,Hop_3,Hop_5,Hop_6,Hop_4}. It is easy to see that the HNN system (\ref{eq2}) is symmetrical with respect to the origin. The equilibria, collinear, are \[ X_0^*=(0,0,0),\quad X_{1}^*=(0.493,0.366,-3.267),\quad X_{2}^*=(-0.493,-0.366,3.267). \] Consider the general system \eqref{eqx1} with the discretization over the numerical time-integration interval $I=[0,T]$, $T>0$, on which the numerical solution is determined, with grid points of an equidistant partition of $I$, $t_i=hi$, $i=0,1,2,...,N$, where $h$ is a fixed step size, $h=T/N$. First, the method calculates the preliminary approximation $x_{i+1}^P$ for $x(t_{i+1})$ (\emph{predictor phase} determined by the fractional second-order Adams-Bashforth method), as follows \[ x_{i+1}^P=\sum_{j=0}^{\left \lceil{q}\right \rceil-1}\frac{t_{i+1}^j}{j!}x_0^{(i)}+\frac{1}{\Gamma(q)}\sum_{j=0}^ib_{j,i+1}f(x_j), \] where \[ b_{j,i+1}=\frac{h^q}{q}((i+1)^q-(i-j)^q). \] Next, the final approximation of $x(t_{i+1})$, $x_{i+1}$ (\emph{correction phase}, the FO variant of the one-step Adams-Moulton method) is \[ x_{i+1}=\sum_{j=0}^{\left \lceil{q}\right \rceil-1}\frac{t_{i+1}^j}{j!}x_0^{(i)}+\frac{h^q}{\Gamma{q+2}}\Biggl(\sum_{j=0}^ia_{j,i+1}f(x_j)+f(x_{i+1}^P)\Biggr) \] with \[ a_{j,i+1}=(i-j+2)^{q+1}+(i-j)^{q+1}-2(i-j+1)^{q+1}, \] for $j=1,2,...,i$. For $j=0$, \[ a_{0,i}=i^{q+1}-(i-q)(i+1)^q, \] and for $j=i+1$, \[ a_{i+1,i+1}=1. \] Because, $\lceil q\rceil-1=0$, for $q<1$, the first sum in both predictor and corrector phases becomes $x_0$. Because, at each step, the result is stored for future use in the next integration step, which is why the ABM method has the time history property. \begin{remark}\label{remix} The convergence of the method is of order $2$, $\underset{i=1,2,...,N}{\max}|x(t_i)-x_i|=O(h^2)$ \cite{exist}. This convergence is satisfactory from the point of view of the numerical stability. However, the scheme may have a very slow rate of convergence, which deteriorates if $q$ is close to $0$. A solution is to improve the accuracy by introducing supplementary corrector iterations. Improvements of the method can be found in e.g. \cite{exist,frac3} or \cite{frac5}; \end{remark} \section{Numerical periodic trajectories and attractors coexistence}\label{bifurca} One of the best numerical ways to identify the coexistence of attractors is showing the Bifurcation Diagram ($BD$). Due to the system symmetry, the coexistence of symmetric attractors is a feature of the system. Therefore, to simplify the bifurcation pictures of $BD$s, which are symmetric, only the positive local maximum of the state variable $x_1$ is plotted. Fig. \ref{fig1} a) presents the $BD$ vs $q$ for $h=0.01$, $T=1000$ and $q\in[0.94,1]$, while Fig. \ref{fig1} b) for $q\in[0.997,1]$. With these values, $N=T/h=1e5$, which is a relative large value. However, on the other side, for this system the transients for smaller value of $N$ could hide the real attractors (see, for the IO case, \cite{dancus1}). Two different branches, $\mathcal{B}_1$ (black color) and $\mathcal{B}_2$ (blue color), are obtained for all considered $BD$s (see Fig. \ref{fig1}). The sets $\mathcal{B}_i$, $i=1,2$, called ``bifurcative'' sets, indicate the coexistence of attractors. To obtain the $BD$s, the ABM method is applied with the Initial Conditions ($IC$s), $IC_1=X_1^*$, and a close point to $X_0^*$, $IC_2=(1e-3,1e-3,1e-3)$.\footnote{Due to the limited numerical precision, one of the two initial conditions can be chosen $X_1^*$ with three decimals, the second initial condition cannot be chosen as $X_0^*$, but only a close point, because $(0,0,0)$ is an exact solution of the equations which give equilibria.} The fact that the rich dynamics occur for higher values of $q$ (close to 1) is typical to continuous-time systems of FO or IO, contrarily to discrete FO systems where phenomena like bifurcation scenario as route to chaos appears for lower values of $q$ (see e.g. \cite{dancus2}). Cross-sections through $\mathcal{\mathcal{B}}_{1,2}$, on the $BD$, such as the vertical lines at $q=0.99925$ or $q=0.99975$ (Fig. \ref{fig1}), represent linear Poincar\'{e} sections which reveal the regular or chaotic behavior of the system for different values of $q$. Therefore, the sets $\mathcal{B}_{1,2}$ can be considered as sets of Poincar\'{e} sections. For example, if for some $q$ the cross-section contains two dense sets of points (chaotic bands), such as for $q=0.99925$, the system evolves chaotically, while if it contains two finite sets of discrete points (black and blue, for $q=0.99975$), and the system evolves along a ``stable cycle''. As known, most dynamics of IO nonlinear systems, refer to stable or unstable periodic solutions (such as limit cycles, chaos, which contains a set of infinitely many unstable periodic orbits mostly with very long periods, quasiperiodic solutions etc). On the other side, in the case of FO systems, the Caputo differential operator cannot transform non-constant periodic functions into periodic ones. Therefore, the following important result was established. \begin{theorem}\cite{neper1}\label{nu} FO systems modeled by the IVP \eqref{eqx1} cannot have any nonconstant periodic solution.\footnote{Under some circumstances, an FO solution may be asymptotically periodic (see e.g. \cite{neper2}). } \end{theorem} On the other side, many phenomena and real systems are not strictly periodic. Therefore the following definition helps overcome this impediment situation. \begin{definition} In the $n$-dimensional phase space $\mathbb{R}^n$, with $n\geq2$, a \emph{numerically periodic trajectory} ($NPT$) refers to as a closed trajectory in the numerical sense that the closing error $\epsilon$ is within a given bound of $1E -m$, with $m$ being a sufficiently large positive integer (see the sketch in Fig. \ref{fig2}). \end{definition} Similarly, since in the case of IO systems the set of unstable periodic trajectories is dense within a chaotic set, from the perspective of Definition \ref{nu}, the \emph{skeleton }of chaos in FO systems can be considered as made from unstable $NPT$s. \subsection{Stability of equilibria $X_{0,1,2}$} Consider $q=0.99975$. The cross-section (Fig. \ref{fig1}) indicates the coexistence of two period-$10$ $NPT$s, and the cross-section through both sets $\mathcal{B}_{1,2}$ contains 10 points (see the $2\times5$ filled circles in the BD in Fig. \ref{fig1}): $NPT_1$, corresponding to the $IC_1$, indicated by the black filled circles, and $NPT_2$, corresponding to $IC_2$, indicated by the blue filled circles (see also the phase plot in Figs. \ref{fig3} (b), where the transients are light colored, and the time series are shown in Fig. \ref{fig3} (d)). The cross-section through $q=0.99925$ (Fig. \ref{fig1}) reveals the coexistence of two chaotic attractors indicated in the cross-section by the black and blue chaotic bands $C_1$ and $C_2$, respectively. The chaotic attractor corresponding to $C_1$, is obtained with $IC_1$, while the attractor corresponding to $C_2$, with $IC_2$ (see the phase plot in Figs. \ref{fig4} (b), and the time series are shown in Fig. \ref{fig4} (d)). To verify if the system possesses hidden attractors, following Definition \ref{def}, one has to check first the stability of the equilibria. The Jacobian is\footnote{Because the reciprocal trigonometric functions as the hyperbolic \emph{sech} functions are obscure, Matlab gives an equivalent form for $J$ via \emph{$tanh$} functions.} \[J= \begin{bmatrix} 1.995\sech^2(x_1)-1&-1.2\sech^2(x_2)&0\\ 2\sech^2(x_1)& 1.71\sech^2(x_2)-1&1.15\sech^2(x_3)\\ -4.75\sech^2(x_1)&0&1.1\sech^2(x_3)-1 \end{bmatrix}, \] \noindent and its eigenvalues at $X_0^*$ are $\lambda_1=1.942$ and $\lambda_{2,3}=-0.066 \pm 1.879i$, while the eigenvalues at $X_{1,2}^*$ are $\lambda_1=-0.987$ and $\lambda_{2,3}=0.538 \pm 1.286i$. Denote the arguments in radians, $\alpha_{i}=\arg(\lambda_i)\in[-\pi,\pi)$ ($angle$ or $atan2$ functions in Matlab), which is the principal branch of the multivalued function Arg$(\lambda)$. \begin{theorem}Equilibrium $X_0^*$ is unstable for all $q\in(0,1)$. \begin{proof} The arguments of eigenvalues are $\alpha_1=0$, and $\alpha_{2,3}=1.6058$. Consider the quantity \cite{frac1} \begin{equation} \iota=q-2\frac{|\alpha_{min}|}{\pi}. \end{equation} Because $\alpha_{min}=0$, \[ \iota=q-2\frac{0}{\pi}=q>0, \] which, following the stability theorem for FO systems \cite{frac2,frac30}, implies the instability of the equilibrium $X_0^*$. \end{proof} \end{theorem} By symmetry, for the stability of $X_{1,2}^*$ it is sufficient to only analyze the stability of $X_1$ and, therefore, details are omitted. \begin{theorem} Equilibrium $X_{1}^*$ is unstable for $q<0.748$ and stable for $q\geq0.748$. \begin{proof} The arguments of eigenvalues are $\alpha_1=\pi$ and $\alpha_{2,3}=1.1745$ and $\alpha_{min}=1.1745$. Therefore \[ \iota=q-2\frac{1.1745}{\pi}=q-0.7477. \] Consequently, for $q<0.748$, $X_1^*$ is stable, while for $q\geq0.748$, $X_1^*$ is unstable. \end{proof} \end{theorem} Analyzing the type and sign of the real component of the three eigenvalues of $X_0^*$, $(+,-,-)$, one can deduce that $X_0^*$ is an attracting focus saddle of index 1 for all $q$ values. As shown by the zoomed rectangle in Fig. \ref{fig3} (b), depending on the attraction basins, trajectories will leave this equilibrium along the unstable manifold of dimension 1 generated by the real positive eigenvalue $\lambda_1$, via spiralling, due to the stable manifold of dimension 2 generated by the negative real part of $\lambda_{2,3}$ (see the zoomed squared around $X_0^*$, where 50 random trajectories are considered). For $q>0.748$, the case studied in this paper, because of the type and sign of the real components of eigenvalues, $(-,+,+)$, $X_{1,2}^*$ are repelling focus saddles of index 2. Trajectories near these equilibria are attracted along the stable manifold of dimension 1 generated by the real negative eigenvalue $\lambda_1$, and are then rejected via spiraling on the unstable manifold of dimension 2 (due to the positiveness of the real part of $\lambda_{2,3}$ (see the zoomed squared around $X_1^*$ in Fig. \ref{fig3} (f), where 50 random trajectories are considered). Another possible approach to analyzing the equilibria instability could be by analog with the significance of divergence of IO. Thus, motivated by the results on instability for IO systems presented in \cite{inst1,inst2}, which state that if $Div f(x)>0$ then the point $x$ is unstable, the instability of the equilibria of FO systems could be analyzed via the \emph{fractional divergence}, $Div^{q}$. Therefore, if $Div^{q}f(\bar{x})>0$, the point $\bar{x}$ is unstable. As known, the Caputo derivative is a linear operator, i.e. for $a,b\in \mathbb{R}$ and $f,g$, some functions such that both $D_*^q f(x)$ and $D_*^q g(x)$ exist \begin{equation}\label{unu} D_*^q(af(x)+bg(x))=aD_*^qf(x)+bD_*^qg(x), \end{equation} and \begin{equation}\label{doi} D_*^q x^n=\frac{\Gamma(n+1)}{\Gamma(n-q+1)}x^{n-q},~ ~\textnormal{for}~~ n\in \mathbb{Z}^+. \end{equation} Also \begin{equation}\label{trei} D_*^q const=0. \end{equation} Let $f=(f_1,f_2,f_3)^t$, $x\mapsto f(x)$, with $x=(x_1,x_2,x_3)\in \mathbb{R}^3$ be a vector valued function, and introduce $Div^q$ in the following form (see also \cite{inst3}) \begin{equation}\label{divgen} Div^{q} f=\nabla^{q} \cdot f=\bigg(\frac{\partial^q}{\partial x_1^q}\mathbin{\raisebox{0.5ex}{,}} \frac{\partial^q}{\partial x_2^q}\mathbin{\raisebox{0.5ex}{,}}\frac{\partial^q}{\partial x_3^q}\bigg)\cdot (f_1,f_2,f_3)=\frac{\partial^q f_1}{\partial x_1^q}+\frac{\partial^q f_2}{\partial x_2^q}+\frac{\partial^q f_3}{\partial x_3^q}, \end{equation} where, by $\frac{\partial^q }{\partial x^q}$, one understands Caputo's derivative with respect to the state variable $x$. Due to the relative simple form of the Caputo derivative of monomials (see \eqref{doi}), it is obvious that the great majority of nonlinear systems, which are modeled by polynomials, are candidates for this approach. Because the components of the right-hand function $f$ of the system \eqref{eq2} are $\tanh(x)$, not polynomials, one can approximate them locally with Taylor polynomials. Consider for simplicity the equilibrium $X_0^*$, for which Taylor approximation of order 5, becomes the following Maclaurin power series, approximated with an sufficiently small error, $O(x^7)$ \[ \tanh(x_i)\approx x_i-\frac{1}{3}x_i^3+\frac{2}{15}x_i^5,\quad i=1,2,3. \] Then, using the relations \eqref{unu} and \eqref{doi}, and because Caputo's derivative $\frac{\partial^q}{\partial x_i^q}x_j=0$ for $i\neq j$ (relation \eqref{trei}), one obtains the derivative of the first component $f_1$ as follows \begin{equation} \begin{aligned} &\frac{\partial^q}{\partial x_1^q}f_1(x)=-\frac{\partial^q}{\partial x_1^q}(x_1)+1.995\frac{\partial^q}{\partial x_1^q}(x_1)-1.995\times\frac{1}{3}\frac{\partial^q}{\partial x_1^q}(x_1^3)+1.995\times\frac{2}{15}\frac{\partial^q}{\partial x_1^q}(x_1^5)-\\ &1.2\underbrace {\frac{\partial^q}{\partial x_1^q}(x_2-\frac{1}{3}x_2^3+\frac{2}{15}x_2^5)}_{\mathlarger{=0}}=-\frac{\Gamma(2)}{\Gamma(2-q)}x_1^{1-q}+1.995\frac{\Gamma(2)}{\Gamma(2-q)}x_1^{1-q}-0.665\frac{\Gamma(4)}{\Gamma(4-q)}x_1^{3-q}+\\ &0.2660\frac{\Gamma(6)}{\Gamma(6-q)}x_1^{5-q}=0.995\frac{\Gamma(2)}{\Gamma(2-q)}x_1^{1-q}-0.665\frac{\Gamma(4)}{\Gamma(4-q)}x_1^{3-q}+0.2660\frac{\Gamma(6)}{\Gamma(6-q)}x_1^{5-q}. \end{aligned} \end{equation} Proceeding similarly, one can obtain the other derivatives, $\frac{\partial^q}{\partial x_i^q}f_i$, $i=2,3$. Finally, via the relation \eqref{divgen}, one obtains $Div^{q}f(x)$ with the graph presented in Fig. \ref{fig5} (blue color), from where one deduces that $Div^{q}f(x)$ at $X_0^*$ is positive for all $q\in(0,1)$ and, therefore, $X_0^*$ is unstable. Similarly, one can deduce the instability for $X_{1,2}^q$, but the computations to approximate $tanh$ within neighborhoods of $X_{1,2}^*$ is too complicated to present here. Note that, graphically \begin{equation}\label{div} \lim_{q\rightarrow 1}Div^q f(x)=Div f(x)=1.805,\quad \text{for}\quad x=(x_1,x_2,x_3)\in V_{X_0^*}, \end{equation} where $Div f$ is the divergence of the IO system (black color in Fig. \ref{fig5}), which has the form \[ Div f(x)=-3+1.995\sech^2(x_1)+1.71\sech^2(x_2)+1.1\sech^2(x_3). \] Due to the continuity of Caputo's derivative of the right-hand function $f$ of the system \eqref{eq2}, the relation \eqref{div} can also be proved analytically. \subsection{Hidden and spurious attractors} Next, the following result can be numerically verified \begin{proposition} The FO HNN system \eqref{eq2} admits no hidden attractors. \begin{proof} To verify if an attractor is hidden, usually one takes two-dimensional planar sections through each unstable equilibrium and verify if the trajectories starting within these neighborhoods reach, or not, the attractor. Consider, in this paper, a plane which contains all unstable equilibria $X_{0,1,2}^*$ so that all equilibria can be simultaneously studied. Because the points are collinear, beside the points $X_0^*$, $X_1^*$, consider another non-collinear point, e.g. $(0,1,0)$ on $x_2$ axis. The equation of this plane $P$ is $3.267x_1+0.493x_3=0$, along with a lattice of $300\times 300$ points (Fig.\ref{fig3} (a) and Fig. \ref{fig4} (a)). \begin{itemize} \item[i)] Consider the attractors $NPT$s for the case $q=0.99975$ (Fig. \ref{fig1}). The plane $P$ is scanned, point by point, to find the attraction basins of the two $NPT$s. To each point $(x_1,x_2,x_3)\in P$, considered as $IC$, verify where the underlying trajectories tend. Points $(x_1,x_2,x_3)$, which generate trajectories tending to $NPT_1$, are colored black, while the points generating trajectories tending to $NTP_2$ are colored blue. As can be seen in Fig. \ref{fig3} (a), because all points in neighborhoods of all unstable equilibria tend to one of $NPT_{1,2}$ ($X_0^*$ belongs to the separatrice of attractions basins of $NTP_{1,2}$), these attractors are self-excited (Fig. \ref{fig3} (b)). A three-dimensional supplementary numerical verification is presented in the zoomed rectangle in Fig. \ref{fig3} (c) where, within a spherical neighborhood of the equilibrium $X_0^*$, $V_{X_0^*}$, 50 random trajectories are considered. One can see that these trajectories tend to one of the $NPT$s (phase plot in Fig. \ref{fig3} (b) and time series in Fig. \ref{fig3} (d)). A similar three-dimensional approach about $X_1^*$ (Fig. \ref{fig3} (g)) shows that all 50 random trajectories within a small neighborhood of $X_1^*$ tend to $NTP_1$ (see phase plot in Fig. \ref{fig3} (e) and time series in Fig. \ref{fig3} (h), or Fig. \ref{fig3} (a). \item[ii)] Consider the attractors $Chaos_{1,2}$, for the case of $q=0.99925$, which correspond to the chaotic bands $C_{1,2}$, (Fig. \ref{fig1}). Similarly, like for $NPT$s, scanning the same plane through equilibria $X_{0,1,2}$ (Fig. \ref{fig4} (a)), trajectories tend either to $Chaos_1$ or to $Chaos_2$ (Fig. \ref{fig4} (b)), a fact also underlined by the three-dimensional approach presented in Fig. \ref{fig4} (c). Trajectories within the three-dimensional neoghborhood of $X_1^*$ tend to $Chaos_1$ (Figs. \ref{fig4} (e), (f)). Therefore the chaotic attractors $Chaos_{1,2}$ are self-excited. \end{itemize} Similarly, it can be shown that the attraction basins of other chaotic attractors and $NPT$s are connected with the unstable equilibria $X_{0,1,2}$ and, therefore, the attractors of this system are self-excited. \end{proof} \end{proposition} The Dahlquist equivalence Theorem provides a tool to check whether or not a numerical scheme is convergent. \begin{theorem}(Dahlquist Theorem). A multi-step method is convergent if and only if it is consistent and stable. \end{theorem} It is said that a multistep numerical method is \emph{consistent }if the underlying discretized equations, for $h\rightarrow 0$, approach the original differential equations. In other words, the consistency defines the relation between the exact solutions and the discrete equations. A method is \emph{stable} if, in the limit $h\rightarrow 0$, the method has no solutions that grow unbounded as $N=T/h\rightarrow \infty$. As known, the ABM method for FO is convergent (see Remark \ref{remix}). However, in this paper some intriguing phenomenon related to its convergency has been remarked. Fig. \ref{fig6} (left column) presents three $BD$s vs $q$, for three different values of $h$, each of which is obtained with $T=1000$, and four $IC$s: $IC_{1,2}$, which generate the bifurcative sets $\mathcal{B}_{1,2}$ (Fig. \ref{fig1}) and other two $IC$s considered outside the neighborhoods of equilibria. Consider first the $BD$ for $h=0.05$ (Fig. \ref{fig6} (a)). As can be seen, a false conclusion on the coexistence of attractors could be easily formulated: \emph{There are four different bifurcative sets}: \emph{the two basic sets, the black and blue, $\mathcal{B}_1$ and $\mathcal{B}_2$ and two new sets, colored red and green}. However, the bifurcative sets (red and green) are only apparently ``new'', which are spurious sets. Thus, once $h$ reduces, one can see that they tend to the bifurcative sets $\mathcal{B}_1$ and $\mathcal{B}_2$ respectively. Therefore by choosing for example $h=0.025$, the illustrative points $P_1$ on the ``red'' set and $P_2$ on $\mathcal{B}_1$, become closer (compare Fig. \ref{fig6} (a) and Fig. \ref{fig6} (b)), revealing the fact that the new bifurcative sets (red and green) tend to move to right in the bifurcation space with the reduction of $h$. For an even lower value of $h$, $h=0.01$ (Fig. \ref{fig6} (c)), $P_1$ becomes closer to $P_2$, which seems even to coincide with $P_2$ (regardless of inherent computationally errors). Therefore, with the reduction of $h$, the spurious ``red'' and ``green'' sets tend to the sets $\mathcal{B}_{1,2}$, respectively. Consequences of this effect is the wrong conclusion that for e.g. $q=0.99725$ due to the spurious chaotic bands (see thick dark green in Fig. \ref{fig6} a)), the system evolves chaotically, or the false conclusion that for this value, chaos and $NPT$s coexist. \begin{remark} \begin{itemize} \item[i)]The reason for this phenomenon is due to the numerical solutions of \eqref{eq2}; \item[ii)] The phenomenon does not depend on the length of the integration time-interval $I$; \item[iii)] Another interesting fact is that the basic bifurcative sets $\mathcal{B}_{1,2}$, generated from $IC$s belonging to small neighborhoods of unstable equilibria, do not visibly suffer from the numerical effect, but only the bifurcative sets obtained for $IC$s are outside small neighborhoods of equilibria; \item[iiiv)] The phenomenon repeats for spurious bifurcation sets for whatever supplementary $IC$s are outside neighborhoods from equilibria; \item[v)]A similar, even more strange, phenomenon appears on the $BD$ vs parameter $w_{11}\in[1.7,1.9]$ and $q=0.99925$ (the second column in Fig. \ref{fig6}). Considering the same $IC$s and $I$, if for $h=0.05$ the spurious bifurcative sets (``red'' and ``green'') reveal rich dynamics such as bifurcations and chaos (rectangular images in Fig. \ref{fig6} (d)), once $h$ is reduced ($h=0.025$), these dynamics vanish and, moreover, as for the $BD$s vs $q$, but less prominent, the spurious sets tend to the main sets (Fig. \ref{fig6} (e)); \item[vi)] On one side, reducing $h$ implies the vanish of spurious solutions but, on the other side, without some improvements of the ABM scheme (see Remark \ref{remix}), too severe reductions of $h$ (e.g. under $0.01$) imply an extremely long computing time and even possible increase of error \cite{kaik}. \end{itemize} \end{remark} This phenomenon, called here ``$h$-delayed'' because the apparent delay compared to the main bifurcative sets $\mathcal{B}_{1,2}$, could be related more to the consistency of the ABM method, which is strongly related to $h$, rather to the stability which yields the boundedness of solutions. Concluding, the following proposition could be numerically verified \begin{proposition} The results of the numerical integration of the system \eqref{eq2}, with the ABM method, is affected by the $h$-delayed effect. \end{proposition} \section{Conclusion} In this paper, the FO variant of an HNN has been numerically simulated and analyzed. The system is integrated with the ABM method for FDEs. A FO divergence is introduced and used to prove the instability of equilibria. The considered $BD$s versus the FO and versus a system parameter, reveal an interesting phenomenon, named in this paper $h$-delay. The bifurcative sets generated by initial conditions situated outside equilibria ``move'' in the considered bifurcation space towards the bifurcative sets generated with initial conditions near equilibria, once $h$ reduces. The bifurcative sets generated from equilibria maintain their positions. The phenomenon does not depend on the length of the integration time-interval. Note that, recently, this ``delay'' phenomenon has been discovered by the author in discrete systems of FO too (paper submitted). This study will be verified also with other numerical methods for FDEs. Since the spurious attractors have no connections with equilibria, they can be confused with hidden attractors and, therefore, this phenomenon requires a deep analysis, with determination of an adequate step-size $h$, to avoid false conclusions. \textbf{Declaration of Competing Interest:} Author declare that he does has no conflict of interest. \textbf{Funds:} No funding to declare
\section{Results} \textbf{Variational quantum disentangler assisted by deep Q-learning.} The disentangling circuit design is a challenging problem, consisting of designing a special unitary transformation as a finite sequence of unitary operators $A_t$ is chosen from a universal set of gates $\mathcal{G}$. In this work, we ask the agent to design a disentanglement unitary operation $U$, which can erase a target local entanglement entropy. Therefore, the goal of the agent is to find a unitary gate $U$, resulting from the composition of the gates in the sequence, that sufficiently erases the target entanglement entropy. We use the entanglement entropy $S$ to measure how much entanglement in the ground state of quantum systems. When a bipartite quantum system $AB$ is in a pure state, the entanglement entropy is calculated from the reduced density matrix $\rho_{A}$ or $\rho_{B}$ according to the formula \begin{equation} S \equiv-\operatorname{tr}\left(\rho_{A} \log _{2} \rho_{A}\right)=-\operatorname{tr}\left(\rho_{B} \log _{2} \rho_{B}\right). \end{equation} When either subsystem $A$ or $B$ is a spin-$\frac{1}{2}$ system, $S$ varies from $S=0$ (product state) to $S=1$ (maximally entangled state). For the ground state of the two studied models, we regard one site as subsystem $A$ and the rest as subsystem $B$, which means the measurement is performed on only one qubit. \begin{figure*} \begin{subfigure}[h]{0.4\linewidth} \includegraphics[width=\linewidth]{flow.pdf} \caption{\label{fig:flow}} \end{subfigure} \hfill \begin{subfigure}[h]{0.5\linewidth} \includegraphics[width=\linewidth]{rep.pdf} \caption{\label{fig:REP}} \end{subfigure}% \caption{The deep reinforcement learning (DRL) architecture. (a) The DRL environment can be described as a quantum circuit modeled by the optimized variational quantum circuit $U^{opt}_t$ with initial ground state $|g\rangle$ at each episode. At each time step $t$, the agent receives the current state of $U_t$ and based on that information, it chooses from the gate set $\mathcal{G}$ the next gate $A_t$ to apply on the quantum circuit. Therefore, the environment returns the real-valued reward $R_t$ to the agent, which is a function of the entanglement entropy $S$. The policy $\pi$ of the agent is encoded in a deep neural network. (b) State representation for RL agent. At each time-step, the agent receives as input a vector made by the architecture of the quantum circuit $U_t$. An array represents the circuit, and each element in this array represents a quantum gate in the given gate set. } \end{figure*} In our framework, the environment consists of a quantum circuit that starts as the identity at the beginning of each episode. It is built incrementally at each step by the agent, choosing a gate from $\mathcal{G}$ according to the policy $\pi$ encoded in the deep neural network, as shown in Fig.~\ref{fig:flow}. In particular, we consider a gate set $\mathcal{G}$ consisting of single-qubit rotation (along with x, y, or z-direction), Hadamard, and controlled-NOT (CNOT) gates. Together, they form a universal gate set. Whereas continuous variables parameterize rotation gates, respectively, the CNOT and Hadmard are fixed gates. All of the parameters of single-qubit rotation gates are initialized to $\pi$. Notice that the operation space is limited, which performs on the nearest qubits or next-nearest qubits of the target qubit. The reward of the agent received in each step is \begin{equation} R_{t}=\begin{cases} 0, & t\in\{0,1,\dots,N-1\}\\ \mathcal{R}, & t=N \end{cases} \label{reward} \end{equation} where $\mathcal{R}$ is the modified reward function for our learning task. The agent will get a reward not immediately, but at time $N$. In particular, we define $\mathcal{R}$ as \begin{equation} \mathcal{R} =\begin{cases} 0, & \text{ if } S_{RL}\ge S_{0}\\ \frac{S_{0}-S_{RL}}{S_{0}}, & \text{otherwise} \end{cases} \label{eq:reward2} \end{equation} where $S_{RL}$ is the final result entanglement entropy given by our RL-assistant quantum algorithm, and $S_{0}$ is the ground-state entanglement entropy given by the physical system. In this work, we exploit Deep Q-learning algorithms to train the agents, depending on the reward function. The details of the algorithm are described in supplementary materials. For the classical optimizer, we employ the BFGS algorithm implemented in SciPy~\cite{Virtanen2020}. This helps us determine the parameters on each gate from $U_t$ to $U^{opt}_t$. In the following, we propose a training scheme to identify phases and the critical point. This scheme is the main result of this work. We suppose that two states depend on a parameter that is $a$ and $b$, and we assume that there exists a critical point $a<c<b$ such that the states can be classified into two groups. However, we do not know the value of $c$. Then, we train our RL agent with the two states to get the disentangling circuits until convergence with circuit layer $p$. Next, we evaluate the performance of the disentangling circuits on the parameter range$(a,b)$ and refer to its total performance ($S_a$ and $S_b$), concerning the proposed critical point $c$, as $S_a(c)$ and $S_b(c)$. We will show that the performance of those two RL-ansatz disentangling circuits with deep layers is opposite, with the cross point at the correct critical point $c$, i.e., $S_a(c)=S_b(c)$. The performance of the circuit can be understood as follows. We assume that the entanglement has two different structures in the regimes below $c$ (phase $\mathcal{A}$) and above $c$ (phase $\mathcal{B}$) and that the circuits can distinguish and erase them. We refer to these different structures as features. When we set the states on the parameter range$(a,c')$ where $c'<c$, the circuit distinguishes the feature of phase $\mathcal{A}$ and thus correctly erases those entanglements. When in range$(c',c)$, in the phase $\mathcal{A}$, the circuit sees states with different features, but the majority feature is the same feature from $a$ to $c'$. The $S_a$ will increase, which means some entanglements cannot be eliminated. When in range$(c,b)$, the majority feature has changed, and the $S_a$ will rapidly rise until saturated. The situation of $S_b$ is precisely the opposite of $S_a$. If phases determine the entanglement structures, the number of features of the two phases will be the same when they are at the critical point $c$, i.e., $S_a(c)=S_b(c)$. On the contrary, if $S_a(c)\neq S_b(c)$, then the intersection must not be the critical point $c$ because the phase from the cross point to the critical point will be another phase. \textbf{Transverse field Ising model.} We first apply our method to one-dimensional transverse-field Ising model. The Hamiltonian for the Ising model on a 1D lattice with N sites in a transverse field is given by \begin{equation} H=-\sum_{j=0}^{N-1}\left(\lambda \sigma_{j}^{x} \sigma_{j+1}^{x}+\sigma_{j}^{z}\right), \end{equation} where $\sigma_{j}^{a}$ is the $a$ component of Pauli matrix ($a=x,y$ or $z$) at site $j$, and $\lambda$ is the inverse strength of the external field. We assume the periodic boundary conditions, i.e., the $N$th site is identified with the $0$th site. As is well known, there is a quantum phase transition at the critical point $\lambda=1$ for the transverse Ising model, which means the entanglement properties of the ground state changes dramatically when crossing this critical point. When $\lambda$ approaches zero, the TFIM ground state becomes a product of spins pointing in the positive $z$ direction, \begin{equation} |\psi_{\text{TFIM}}\rangle_{\lambda \rightarrow 0} = |0\rangle^{\otimes N}, \end{equation} where $|0\rangle$ and $|1\rangle$ denote the single spin state with spin up and with spin down along $z$-direction respectively. In the $\lambda \rightarrow \infty$ limit, the ground state becomes the GHZ state~\cite{PhysRevB.91.125121}: \begin{equation} |\psi_{\text{TFIM}}\rangle_{\lambda \rightarrow \infty} = \frac{1}{\sqrt{2}} ( |+ \rangle^{\otimes N} +|-\rangle^{\otimes N}), \end{equation} where $|+\rangle$ and $|-\rangle$ denote the single spin state with spin up and with spin down along $x$-direction respectively. Under the above two limits, the entanglement entropy of the ground state behaves as \begin{align} \label{eq:2} S_{\lambda\rightarrow 0} & = 0, \\ S_{\lambda\rightarrow \infty} & = 1. \end{align} At the critical point, $\lambda = 1$, there is a phase transition in the ground state structure in the thermodynamic limit~\cite{sachdev_2011}. The correlation function $\langle\sigma_{i}^{\alpha} \sigma_{j}^{\beta}\rangle-\langle\sigma_{i}^{\alpha}\rangle\langle\sigma_{j}^{\beta}\rangle$ decays polynomially as a function of separation at this point, while for all other values of $\lambda$, this decay is exponential. \begin{figure}[h] \centering \includegraphics[width=0.98\columnwidth{},keepaspectratio]{TFIM_N8.pdf} \caption{\label{fig:TFIM} Entanglement entropy versus $\lambda$ for 8-site TFIM. $P$ is the number of circuit layers and $|\psi_{\text{TFIM}}\rangle$ denotes the ground state of the model. The solid line denotes the disentangling circuit training from $\lambda=0.5$; the dashed line denotes the disentangling circuit training from $\lambda=1.5$. The dash-dotted line denotes the critical point at $\lambda=1$. We sample 11 points of TFIM ground states with $\lambda=0.5,0.6,0.7,0.8,0.9,1,1.1,1.2,1.3,1.4,1.5$.} \end{figure} In Fig.~\ref{fig:TFIM}, we show the results of the optimal variational algorithm to disentangle the ground state with different values of $\lambda$. We take two ground-states from two phases of the system to get the RL-ansatz quantum circuit. The operation space is set to the nearest qubits, i.e., three qubits. The performance of the designed algorithm is proportional to the circuit layer $p$. As the RL-ansatz disentangling circuit with one layer ($p=1$), the transformation space is not large enough to cut the correlation with the two subsystems, so different training samples have the same results. However, unlike the raw local entanglement entropy case, the disentangle circuit entropy shows three regions with different values of $\lambda$. In both cases, the entanglement entropy rises quickly from a small number from point $\lambda=0.5$ to point $\lambda=0.9$ and then slowly rises to the maximum value around the critical point $\lambda=1$. The situation after the critical point $\lambda=1$ is precisely the opposite of before. So we can divide the space of $\lambda$ into ``fast-slow-fast'' three regions according to the speed of entropy change. We find that the most significant entanglement is present in the parameter region close to the critical point. The slow region corresponds with the quantum critical region~\cite{phase}. This indicates that the local quantum entanglement has a deep relation with the phase transition region. However, with the layer number larger than one, the results show different structures of circuits with different phases of $\lambda$. As Fig.~\ref{fig:TFIM} shows, the designed circuit structures with two layers have two optimal circuits in different phases. Also, in this case, the characteristic is obtained, and we detect the transition at $\lambda=1$. We confirm that the results with $p=2$ are indeed convergence (see Supplementary materials, Fig. S3). \textbf{Understanding Agent Actions.} To confirm what agents have learned from disentanglement under TFIM, we first determine the optimal local disentanglement in theory. We proved that the minimum entropy $\rho_P$ decreased by local unitary operation is determined by the initial state $\rho_{RP}$ of the region $RP$, on which the unitary operation acts. More specifically, we have the following theorem. \begin{theorem} Suppose the eigen-decomposition of the state $\rho_{RP}$ is $\rho_{RP} = \sum_{i=1}^{d_P d_R} p_i \ket{\psi_i} \bra{\psi_i}$, where $d_P$ ($d_R$) is the dimension of subsystem $P$ ($R$). Without loss of generality, we assume these eigenvalues are in decreasing order, i.e., $p_i \ge p_{i+1}$. By performing a local unitary operation $U$ on the $RP$, the minimal entanglement entropy of the subsystem $P$ is \begin{equation} \min_U S(\rho_P(U)) = - \sum_m q_m {\rm \log_{2}} q_m, \end{equation} where $\rho_P(U) = {\rm Tr}_R \left[ U \rho_RP U^\dagger \right]$, $S(\sigma) = - {\rm Tr} \left[ \sigma {\rm \log_2} \sigma \right]$ is the Von-Neumann entropy of state $\sigma$, and $q_m = \sum_{j=1}^{d_R} p_{(m-1)d_R + j}$. \label{theorem1} \end{theorem} \begin{proof} The proof is given in the given in Supplementary materials, Section S-\uppercase\expandafter{\romannumeral1}. \end{proof} Although \textbf{Therorem~1} gives the optimal local disentanglement theoretically, it does not imply that we can distinguish quantum phases by directly applying the theorem. In fact, the relation between disentanglement and quantum phase is subtle. Because the optimal solution will destroy all entanglement structures equally, the minimal entanglement entropy in our problem is so small in both phases that it can not be used to distinguish the phases. However, the RL agent often find a local minimum but not a global one, which leads it to destroy the dominant entangled structure under a specific phase. Therefore, even if RL cannot give an optimal strategy in many cases, it may fits the problem. Interestingly, we found the RL agent finds the optimal solution to disentangle the local entanglement of the nearest two-body in the phase of $\lambda >1$ (Fig~\ref{fig:TFIMdua}), which is exactly the solution of \textbf{Theorem~1} when $RP$ is restricted to two nearest spins. At first glance, the RL-ansatz disentangling circuit in the phase of $\lambda <1$ may be a suboptimal disentanglement of a complex three-body local entanglement. However, we realize that there is a well known Kramers-Wannier duality in TFIM~\cite{PhysRev.60.252,PhysRevD.17.2637}. For the model, the self-dual point is the phase transition point $\lambda=1$. When we perform the duality transformation which defines new Pauli operators $\mu_{i}^{z}$ and $\mu_{i}^{x}$ in a dual lattice \begin{align} \mu_{j}^{x}=\prod_{i \leq j} \sigma_{i}^{z} \\ \mu_{j}^{z}=\sigma_{j+1}^{x} \sigma_{j}^{x}, \end{align} and the original Hamiltonian can be written as \begin{equation} H=-\sum_{j=0}^{N-1}\left(\mu_{j}^{x} \mu_{j+1}^{x}+\lambda \mu_{j}^{z}\right). \end{equation} We found the optimal disentanglement of the nearest neighbor two-body with duality just coincides with the RL-ansatz in the phase of $\lambda <1$ (Fig~\ref{fig:TFIMdub}). \begin{figure}[h] \centering \subfloat[]{% \includegraphics[width=0.45\textwidth]{TFIM_B2.pdf}\label{fig:TFIMdua}} \subfloat[]{% \includegraphics[width=0.45\textwidth]{TFIM_v2.pdf}\label{fig:TFIMdub}} \\ \caption{Entanglement entropy versus $\lambda$ with the RL-ansatz disentangling circuit and the nearest two-body optimal disentanglement for TFIM. } \end{figure} These results suggest that the agent learns that the duality of the Hamiltonian, which is an important feature in classifying quantum phases. This further shows that the RL agent has found the main local entanglement structure between different phases. \textbf{XXZ model.} The second model we apply our method to is the XXZ model. The Hamiltonian of the antiferromagnetic XXZ model on a 1D lattice with N sites is \begin{equation} H=\sum_{j=0}^{N-1}\left(\sigma_{j}^{x} \sigma_{j+1}^{x}+\sigma_{j}^{y}\sigma_{j+1}^{y}+\Delta\sigma_{j}^{z}\sigma_{j+1}^{z}\right), \end{equation} where $\Delta$ is a dimensionless parameter characterizing the anisotropy of the model. The XXZ spin chain has been widely studied~\cite{PhysRev.150.321,PhysRev.150.327,PhysRev.151.258,PhysRevA.2.1075,PhysRevA.3.786}. For the XXZ model, there exist two different phases at the ground state where $\Delta >0$, i.e., metallic phase, $0<\Delta\le1$, and antiferromagnetic phase, $\Delta >1$, which is resulted from that the former is gap-less while the latter is gapful. The critical point of quantum phase transition locates at the isotropic point $\Delta=1$ which is the Kosterlitz-Thouless quantum phase transitions (KT-QPTs). \begin{figure}[h] \centering \includegraphics[width=0.98\columnwidth{},keepaspectratio]{XXZ_N8.pdf} \caption{\label{fig:XXZ} Entanglement entropy versus $\Delta$ for 8-site XXZ model. $P$ is the number of circuit layers, and $|\psi_{\text{XXZ}}\rangle$ denotes the ground state of the model. The solid line denotes the disentangling circuit training from $\Delta=0.5$; the dashed line denotes the disentangling circuit training from of $\Delta=1.5$. The dash-dotted line denotes the critical point at $\Delta=1$. We sample 11 points of XXZ model ground states with $\Delta=0.5,0.6,0.7,0.8,0.9,1,1.1,1.2,1.3,1.4,1.5$.} \end{figure} First, we perform our learning scheme, using the same condition for the TFIM case. However, we found the results do not convergent. So we set the operation space to next-nearest qubits, i.e., five qubits. In Fig.~\ref{fig:XXZ}, we show the results of the optimal circuits to disentangle the ground state with different values of $\Delta$. Similar to the TFIM model mentioned above, the performance of the designed circuits is proportional to the circuit depth $p$. As the RL-ansatz disentangling circuit with one layer ($p=1$), this case has a universal circuit structure for different values of $\Delta$, which is similar to the TFIM result. Nevertheless, unlike the TFIM case, the performance is different in the two-layer case. From Fig.~\ref{fig:XXZ}, we observe interesting differences for disentangling circuit results at the crossing points. The intersection is far from the critical point because the number of layers of the quantum circuit is just between too shallow and enough layers. So we can see that there are two optimal solutions, but the intersection of the two is not the critical point. The above situation indicated that the ground-state entanglement structure of the XXZ model might be more complex than the TFIM case. When $p=3$, the optimal disentangling circuit is convergent (see Supplementary materials, Fig. S4), and the result is consistent with what we discussed in the former section. Also, we detect the transition at $\Delta=1$. \textbf{The robustness of the RL-ansatz disentangling circuit.} To confirm that the training scheme indeed extracts non-trivial structures from the input state, we have checked the performance from the training scheme when the quantum circuit is trained on different initial values and states. To show the robustness of the RL-ansatz quantum circuit, we examined our method with two example cases: (\romannumeral1) the initial parameters of rotation gate extracted from the uniform distribution with mean value $\{0,\pi/2,\pi\}$ and (\romannumeral2) the disentangling circuit training from different ground states of parameters ($\lambda$ or $\Delta$). \begin{figure*}[h] \centering \subfloat[]{% \includegraphics[width=0.45\textwidth]{TFIM_n0.pdf}} \hspace{\fill} \subfloat[]{% \includegraphics[width=0.45\textwidth]{TFIM_n1.pdf}} \hspace{\fill} \subfloat[]{% \includegraphics[width=0.45\textwidth]{TFIM_n2.pdf}}\\ \caption{Entanglement entropy versus $\lambda$ with the RL-ansatz disentangling circuit for TFIM with $N=8$ of (\romannumeral1) under different initial values. (A): uniform distribution with mean value $0$ (B): uniform distribution with mean value $\pi/2$ (C): uniform distribution with mean value $\pi$. The solid line denotes the disentangling circuit training from $\lambda=0.5$; the dashed line denotes the disentangling circuit training from $\lambda=1.5$.} \label{fig:TFIMn} \end{figure*} \begin{figure*}[h] \centering \subfloat[]{% \includegraphics[width=0.45\textwidth]{XXZ_n0.pdf}} \hspace{\fill} \subfloat[]{% \includegraphics[width=0.45\textwidth]{XXZ_n1.pdf}} \hspace{\fill} \subfloat[]{% \includegraphics[width=0.45\textwidth]{XXZ_n2.pdf}}\\ \caption{Entanglement entropy versus $\Delta$ with the RL-ansatz disentangling circuit for XXZ model with $N=8$ of (\romannumeral1) under different initial values. (A): uniform distribution with mean value $0$ (B): uniform distribution with mean value $\pi/2$ (C): uniform distribution with mean value $\pi$. The solid line denotes the disentangling circuit training from $\Delta=0.5$; the dashed line denotes the disentangling circuit training from $\Delta=1.5$.} \label{fig:XXZn} \end{figure*} \begin{figure*}[h] \centering \subfloat[]{ \includegraphics[width=0.45\textwidth]{TFIM_l1.pdf} } \subfloat[]{ \includegraphics[width=0.45\textwidth]{TFIM_l2.pdf} } \caption{Entanglement entropy versus $\lambda$ with the RL-ansatz disentangling circuit for TFIM with $N=8$ of (\romannumeral2) under different training states. (A): ground state with $\lambda=0.6, 1.3$ (B): ground state with $\lambda=0.7, 1.4$. The solid line denotes the disentangling circuit training from $\lambda=0.6, 0.7$; the dashed line denotes the disentangling circuit training from $\lambda=1.3, 1.4$.} \label{fig:TFIMl} \end{figure*} \begin{figure*}[h] \centering \subfloat[]{ \includegraphics[width=0.45\textwidth]{XXZ_l1.pdf} } \subfloat[]{ \includegraphics[width=0.45\textwidth]{XXZ_l2.pdf} } \caption{Entanglement entropy versus $\Delta$ with the RL-ansatz disentangling circuit for XXZ model with $N=8$ of (\romannumeral2) under different training states. (A): ground state with $\Delta=0.6, 1.3$ (B): ground state with $\Delta=0.7, 1.4$. The solid line denotes the disentangling circuit training from $\Delta=0.6, 0.7$; the dashed line denotes the disentangling circuit training from $\Delta=1.3, 1.4$.} \label{fig:XXZl} \end{figure*} As Fig.~\ref{fig:TFIMn} and Fig.~\ref{fig:TFIMl} show, the algorithm's performance with the TFIM is robust under different conditions. The same conclusion can be drawn in Fig.~\ref{fig:XXZn} and Fig.~\ref{fig:XXZl} with the XXZ model. In other words, we may also look for the phase transition at which the training is most independent of chosen conditions. \textbf{Scalability of the RL-ansatz disentangling circuit.} In previous discussions, there was no apparent relationship between the entanglement structure and the size of the system. Further, our method only operates on the local space of the target qubit, which is easy to expand the scale of the system. So we want to study the effect of disentangling circuit training in the small system on an extensive system. In Fig.~\ref{fig:TFIMN} and Fig.~\ref{fig:XXZN}, we show the results of the disentangling circuit trained in 8-qubit systems on N-qubit problems with $N > 10$. For the RL-designed disentangling circuit, the circuit is obtained by a training process on a problem with qubit number $N = 8$ then applied to problems having a larger number of qubits ($N = 10,12,14$). The results show that our solution is not affected by the size of the system. This further implies that the entanglement structure is not affected by the size but is more closely related to the quantum phase. \begin{figure*}[h] \subfloat[]{\includegraphics[width=.45\linewidth]{TFIM_N10.pdf}}\hfill \subfloat[]{\includegraphics[width=.45\linewidth]{TFIM_N12.pdf}}\par \subfloat[]{\includegraphics[width=.45\linewidth]{TFIM_N14.pdf}} \caption{Performance of RL-designed disentangling circuits applied to TFIM with different numbers of qubits. In this plot, the RL-designed circuits is obtained by training on the problem with qubit number $N = 8$ then applied to problems with a large number of qubits, (A):$N=10$ (B):$N=12$ (C):$N=14$.} \label{fig:TFIMN} \end{figure*} \begin{figure*}[h] \subfloat[]{\includegraphics[width=.45\linewidth]{XXZ_N10.pdf}}\hfill \subfloat[]{\includegraphics[width=.45\linewidth]{XXZ_N12.pdf}}\par \subfloat[]{\includegraphics[width=.45\linewidth]{XXZ_N14.pdf}} \caption{Performance of RL-designed disentangling circuits applied to XXZ model with different numbers of qubits. In this plot, the RL-designed circuits is obtained by training on the problem with qubit number $N = 8$ then applied to problems with a large number of qubits, (A):$N=10$ (B):$N=12$ (C):$N=14$.} \label{fig:XXZN} \end{figure*} \section{Conclusions and Outlook}\label{Conclusion} In this work, we show how to identify quantum phase transition via a single-qubit disentanglement. The RL-ansatz on disentangling circuits found by the method is capable of perfectly distinguishing quantum phases in the TFIM and the XXZ model. Further, for the TFIM we theoretically explain the results learned by the RL agent: a $2$-body optimal disentanglement when $\lambda>1$ and its Kramers-Wannier duality when $\lambda<1$, which allows the characterization of the quantum phase transition in the TFIM\@. According to the similarity in the numerical results learned between the TFIM and the XXZ model, we conjecture that some similar theoretical explanation exists for the XXZ model. Our results show a new perspective to study the relation between entanglement structures and quantum phase transition. We have proposed an RL-based framework to design a particular variational quantum circuit. This framework fits our problem very well. It can quickly find the main entanglement structure under the quantum phase and eliminate it. Using the advantage of RL to identify the central object quickly, we can expand the scope of RL in quantum information and study more complex systems without the need for optimal global solutions. Also, the current approach is flexible enough to be applied to different problems, such as quantum circuit optimization, ground state preparation, and novel quantum algorithm design. In summary, we associate the local entanglement structure of a quantum phase with an optimal single-qubit disentangling circuit. We show that the disentangling circuit can be used to characterize different phases in two typical models. We expect that our approach may be extended to characterize more exotic quantum phases, e.g., a phase with topological order and a spin liquid. It provides a universal way to quantify entanglement structures of quantum phases. \textsl{\textbf{Acknowledgments.--}} This work is supported by the National Key Research and Development Program of China (Grant No. 2021YFA0718302 and No. 2016YFA0300603), NSF of China (Grants No. 11775300 and No. 12075310), and the Strategic Priority Research Program of Chinese Academy of Sciences (Grant No. XDB28000000). \bibliographystyle{apsrev4-2}
\section{Introduction} The task of generative modeling in machine learning is as follows: Given $n$ sample points of an unknown probability distribution $P_*$, we would like to approximate $P_*$ well enough to be able to generate new samples. The generative adversarial network (GAN) \cite{goodfellow2014generative} is among the most popular models for this task. It has found diverse applications such as image generation \cite{karras2019style}, photo editing \cite{wu2019gp} and style transfer \cite{isola2017image}. More importantly, there are emerging scientific applications including inverse problems \cite{shah2018solving}, drug discovery \cite{prykhodko2019molecular}, cosmological simulation \cite{mustafa2019cosmogan}, material design \cite{mao2020material} and medical image coloration \cite{liang2021unpaired}, to name a few. Despite these promising successes, we are far from a satisfactory theory. Arguably, one of the most important problems is the generalization ability of GANs, namely how they are able to estimate the underlying distributions well enough to be able to generate new samples that appear highly realistic. There are at least two difficulties with generalization: \begin{enumerate} \item Curse of dimensionality: Let $P_*^{(n)}$ be the empirical distribution associated with the $n$ given sample points. Let $W_2$ be the Wasserstein metric. It is known that for any absolutely continuous $P_*$ \cite{weed2017sharp} \begin{equation} \label{W2 CoD} W_2(P_*,P_*^{(n)}) ~\gtrsim~ n^{-\frac{1}{d-\delta}} \end{equation} for any $\delta > 0$. The significance of (\ref{W2 CoD}) is that it sets a lower bound for the generalization error of all possible models: Let $A$ be any algorithm (a mapping) that maps from an $n$ sample set $X_n = \{\mathbf{x}_1,\dots\mathbf{x}_n\}$ of $P_*$ to an estimated distribution $A(X_n)$, then \cite{singh2018minimax} \begin{equation*} \inf_{A} \sup_{P_*} ~\mathbb{E}_{X_n}\big[W_2^2\big(P_*,A(X_n)\big)\big] ~\gtrsim ~n^{-\frac{2}{d}} \end{equation*} where $P_*$ ranges among all distributions supported in $[0,1]^d$. Thus, an exponential amount of samples $\epsilon^{-\Omega(d)}$ is needed to achieve an error of $\epsilon$, which is formidable for high-dimensional tasks (e.g. $d \geq 10^5$ for images). To overcome the curse of dimensionality, one needs to restrict to a smaller class of target distributions $\mathcal{P}_*$ such that \begin{equation} \label{hypothesis space} \inf_{A} \sup_{P_* \in \mathcal{P}_*} ~\mathbb{E}_{X_n}\big[W_2^2\big(P_*,A(X_n)\big)\big] ~\lesssim ~n^{-\alpha} \end{equation} for some constant $\alpha > 0$. Of course, to be relevant in practice, this restricted space of target distributions should not be too small. \item Memorization during training: There is another complication that we cannot avoid. It was argued in \cite{goodfellow2014generative} that the true optimizer of the GAN model is simply $P_*^{(n)}$. This is disappointing since $P_*^{(n)}$ does not provide any new information beyond the data we already know. It suggests that if a training algorithm converges, most likely it converges to $P_*^{(n)}$, i.e. it simply memorizes the samples provided. This is known as the ``memorization effect'' and has been analyzed on a simpler model in \cite{yang2020generalization}. Our best hope is there are intermediate times during the training process when the model provides a more useful approximation to the target distribution. However, this is a rather subtle issue. For instance, if we train a distribution $P_t$ by Wasserstein gradient flow over the loss \begin{equation*} L(P) = W_2^2(P, P_*^{(n)}) \end{equation*} then the training trajectory is exactly the Wasserstein geodesic from the initialization $P_0$ to $P_*^{(n)}$. Since the $W_2$ space has positive curvature (Theorem 7.3.2 \cite{ambrosio2008gradient}), the pairwise distances are comparable to those on a fat triangle (Figure \ref{fig: W2 geodesic} curve \textcircled{1}). This suggests that the generalization error $W_2(P_t,P_*)$ along the entire trajectory will be $n^{-O(1/d)}$ and suffers from the curse of dimensionality. \item Mode collapse and mode dropping. These are the additional difficulties that are often encountered in the training of GAN models. \end{enumerate} \begin{figure}[h] \centering \includegraphics[scale=0.2]{two_curves.png} \caption{Curve \textcircled{1} is the $W_2$ geodesic connecting $P_0$ and $P_*^{(n)}$. Curve \textcircled{2} is a training trajectory that generalizes.} \label{fig: W2 geodesic} \end{figure} Recently, an approach was proposed by \cite{yang2020generalization} to establish the generalization ability of a density estimator (the bias-potential model). Its hypothesis space $\mathcal{P}_*$ consists of Boltzmann distributions generated by kernel functions and satisfies universal approximation. Also, its training trajectory generalizes well: As illustrated by curve \textcircled{2} in Figure \ref{fig: W2 geodesic}, the trajectory comes very close to $P_*$ before eventually turning toward memorizing $P_*^{(n)}$. Thus, the generalization error achieved by early-stopping escapes from the curse of dimensionality: \begin{equation*} \text{KL}(P_*\|P) = O(n^{-1/4}) \end{equation*} This generalization ability is enabled by the function representation of the model. If the function class has small Rademacher complexity, then the model is insensitive to the sampling error $P_*-P_*^{(n)}$, and thus the generalization gap emerges very slowly. The implication to GAN is that its generalization ability should be attributable to (the function representation of) both its generator and discriminator. This paper will focus on analyzing the discriminator. In place of the generator, we will deal directly with the probability distribution. Our result confirms the intuition of Figure \ref{fig: W2 geodesic} curve \textcircled{2}: Despite the eventual memorization, early-stopping achieves a generalization error of \begin{equation} \label{W2 escapes CoD} W_2(P_*,P) = O(n^{-\alpha}) \end{equation} with a constant exponent $\alpha>0$. This paper is structured as follows. Section \ref{sec. problem setting} introduces our toy model of GAN. Sections \ref{sec. two time scale} and \ref{sec. one time scale} present the main results of this paper on generalization error (\ref{W2 escapes CoD}) with a two-time-scale training model ($\alpha=1/6$) and a one-time-scale training model ($\alpha=1/8$) respectively. We also show that memorization always happens in the long time limit. Section \ref{sec. slow deterioration} provides a supplementary result, that it is intractable to learn the Lipschitz discriminator of WGAN. Section \ref{sec. proofs} contains all the proofs. Section \ref{sec. discussion} concludes this paper with remarks on future directions. \subsection{Related work} \begin{itemize} \item GAN training: Currently there is little understanding of the training dynamics and convergence property of GAN, or any distribution learning model with a generator such as the variational autoencoder \cite{kingma2013auto} and normalizing flows \cite{tabak2010density}. The available results deal with either simplified models \cite{mescheder2018training,wu2019onelayer,feizi2020LQG,balaji2021understanding} or convergence to local saddle points \cite{nagarajan2017gradient,heusel2017gans,lin2020gradient}. The situation is further complicated by training failures such as mode collapse \cite{arora2018GAN,che2016mode}, mode dropping \cite{yazici2020empirical} and oscillation \cite{radford2015unsupervised,chavdarova2018sgan}. Since our emphasis is on the discriminator, we omit the generator to make the analysis tractable. \item GAN generalization: Due to the difficulty of analyzing the convergence of GAN, generalization error estimates have been obtained only for simplified models whose generators are linear maps or their variants \cite{feizi2020LQG,wu2019onelayer,lei2020sgd}. Another line of works \cite{arora2017generalization,zhang2017discrimination,bai2019approximability} focuses on the ``neural network distance", which are the GAN losses defined by neural network discriminators, and shows that these distances have a sampling error of $O(n^{-1/2})$. Although \cite{arora2017generalization} interprets this result as the inability of the discriminator to detect a lack of diversity, we show that this is in fact an advantage, such that the discriminator enables the training process to generalize well. Meanwhile, \cite{gulrajani2020towards} proposes to use the neural network distance with held-out data to measure memorization, while \cite{nagarajan2018memorization} discussed the dependence of memorization on the number of latent samples drawn by GAN. \item GAN design and regularization: The improvement of GAN has mainly focused on three aspects: alternative loss functions (e.g. WGAN \cite{arjovsky2017wasserstein} and least-square GAN \cite{mao2018effectiveness}), novel function representations (e.g. fully convolutional \cite{radford2015unsupervised} and self-attention \cite{jiang2021transgan}), and new regularizations. There are roughly three kinds of regularizations: the regularizations on the function values (e.g. gradient penalty \cite{gulrajani2017improved} and $L^2$ penalty \cite{xu2020understanding}), the regularizations on the parameters (e.g. spectral normalization \cite{miyato2018spectral} and weight decay \cite{krogh1992simple}) and the regularizations on the input values (e.g. batch normalization \cite{ioffe2015batch} and layer normalization \cite{ba2016layer}). See \cite{saxena2021generative} for a comprehensive review. Our proofs indicate how function representation and regularization influence the generalization ability of GAN. \item Function representation: The function class is central to the theoretical analysis of machine learning models. A good function representation, such as the Barron space and flow-induced space \cite{e2021barron} (which capture 2-layer networks and residual networks), is the key to the generalization ability of supervised learning models \cite{e2018priori,e2019residual,e2019min} and density estimator \cite{yang2020generalization}. Broadly speaking, a supervised learning model can be studied as a continuous calculus of variations problem \cite{e2020machine,e2020NNML} determined by four factors: its function representation, loss function, training rule, and their discretizations. Distribution learning has the additional factor of distribution representation \cite{yang2020generalization}, namely how the probability distribution is represented by functions. \end{itemize} \section{Problem Setting} \label{sec. problem setting} Consider the domain $\Omega = [0,1]^d$. Denote the space of probability measures by $\mathcal{P}(\Omega)$, and the space of finite signed Radon measures by $\mathcal{M}(\Omega)$. Denote the $p$-Wasserstein metric on $\mathcal{P}(\Omega)$ by $W_p$ \cite{villani2003topics}. Denote the modeled distribution by $P$, the target distribution by $P_*$. Let $\{\mathbf{x}_i\}_{i=1}^n$ be $n$ i.i.d. samples from $P_*$ and denote the empirical distribution by $P_*^{(n)} = \frac{1}{n}\sum_{i=1}^n \delta_{\mathbf{x}_i}$. If $P,P_*$ are absolutely continuous, denote their density functions by $p,p_*$. Conversely, given a density function $p$, denote the corresponding measure by $P$ (i.e. $p$ times the Lebesgue measure on $\Omega$). For convenience, we use density $p$ and measure $P$ interchangeably when there is no confusion. We use $f \lesssim g$ or $f = O(g)$ to indicate that $\limsup_{x\to\infty} f(x)/g(x) < \infty$. We use $f = o(g)$ to indicate that $\lim_{x\to\infty} f(x)/g(x) = 0$. The notations $f \gtrsim g$ and $f=\Omega(g)$ and $\omega(g)$ are defined similarly. We use $f \asymp g$ to indicate that $f \lesssim g$ and $f \gtrsim g$. {\color{black} \subsection{Distribution Representation} \label{sec. distribution representation} As we have discussed in the introduction, the generalization ability of a model comes from the representation or parametrization of its component functions. Thus, for the GAN model, it is reasonable to conjecture that \textit{either} the generator \textit{or} the discriminator alone can enable GAN to generalize well. Since this paper focuses on the discriminator, we prove that a discriminator with a good parametrization is sufficient for good generalization, without the help of the generator. To eliminate the confounding effect of the generator, one needs to construct a model whose generated distribution $P$ does not have any parametrization. The simplest way is to model $P$ by its density function $p$. We will consider $p$ as a function in $L^2(\Omega)$, and denote the space of probability densities by \begin{equation*} \Delta = \big\{p \in L^2(\Omega) ~\big|~ p \geq 0 ~\text{a.e.}, ~\int p = 1 \big\} \end{equation*} Henceforth, this abstract model will be referred to as adversarial density estimation. We will discuss how our results can be applied to the ordinary GAN in Section \ref{sec. the generator}. } \subsection{Function representation} \label{sec. function representation} To model the discriminator $D$, let us consider a simple function class that captures the two key properties of neural networks: universal approximation and dimension-independent complexity. Specifically, we model $D$ by the random feature functions (or kernel functions) \cite{rahimi2008uniform,e2021barron}: \begin{equation} \label{RFM discriminator} D(\mathbf{x}) = \mathbb{E}_{\rho_0(\mathbf{w},b)}[a(\mathbf{w},b)\sigma(\mathbf{w}\cdot\mathbf{x}+b)] \end{equation} where $\sigma$ is the ReLU activation, $\rho_0$ is a fixed parameter distribution, and $a$ is the parameter function to be learned. Assume for convenience that $\rho_0$ has bounded support: $\text{sprt} \rho_0 \subseteq \{\|\mathbf{w}\|_1+|b| \leq 1\}$. One can define the kernel \begin{equation} \label{RKHS kernel} k(\mathbf{x},\mathbf{x}') = \mathbb{E}_{\rho_0}[\sigma(\mathbf{w}\cdot\mathbf{x}+b)\sigma(\mathbf{w}\cdot\mathbf{x}'+b)] \end{equation} The RKHS space $\mathcal{H}$ with kernel $k$ is generated by the norm \begin{equation} \label{RKHS norm} \|D\|_{\mathcal{H}} = \|a\|_{L^2(\rho_0)} \end{equation} Regarding the universal approximation property, assume that $\text{sprt} \rho_0$ contains all directions: For any $(\mathbf{w},b) \neq 0$, there exists $\lambda > 0$ such that $\lambda (\mathbf{w},b) \in \text{sprt} \rho_0$ (e.g. let $\rho_0$ be the uniform distribution over the $L^1$ sphere). Then, \cite{sun2018RFM} implies that the RKHS space $\mathcal{H}$ is dense in $C(\Omega)$ under the supremum norm. It follows that the kernel (\ref{RKHS kernel}) is positive definite. Regarding complexity, the Rademacher complexity of $\mathcal{H}$ escapes from the curse of dimensionality (Theorem 6 of \cite{e2021barron}). Specifically, the following bound holds uniformly over any collection of $n$ points $\{\mathbf{x}_i\}_{i=1}^n \subseteq [-1,1]^d$, \begin{equation*} Rad_n(\{\|D\|_{\mathcal{H}}\leq r\}) \leq 2r\frac{\sqrt{2\log 2d}}{\sqrt{n}} \end{equation*} {\color{black}This property eventually leads to our generalization error estimates.} \subsection{Training loss} Denote by $L(P)$ a loss over the modeled distribution $P$. The GAN losses are constructed as dual norms over some family $\mathcal{D}$ of discriminators. The straightforward construction is the WGAN loss \cite{arjovsky2017wasserstein}, \begin{equation} \label{WGAN loss} L(P) = \sup_{D \in \mathcal{D}} \mathbb{E}_{P_*}\big[D(\mathbf{x})\big] - \mathbb{E}_P \big[D(\mathbf{x})\big] - R(D) \end{equation} where $R(D)$ is some regularization on $D$ such as gradient penalty \cite{gulrajani2017improved,kodali2017convergence}. The classical GAN loss \cite{goodfellow2014generative} is a weak version of the dual formulation of Jensen-Shannon divergence \begin{equation*} L(P) = \sup_{D \in \mathcal{D}} \mathbb{E}_{P_*}\big[\log\frac{e^{D(\mathbf{x})}}{1+e^{D(\mathbf{x})}}\big] + \mathbb{E}_P \big[\log\frac{1}{1+e^{D(\mathbf{x})}}\big] \end{equation*} There are many other constructions such as the $f$-divergence GAN loss \cite{nowozin2016f}, energy-based GAN loss \cite{zhao2016energy}, least-square GAN loss \cite{mao2018effectiveness} etc. \subsection{Training Rule} Rewrite the GAN loss (e.g. formula (\ref{WGAN loss})) as a joint loss in $p$ and $D$ \begin{equation*} \min_p \max_D L(p, D) \end{equation*} To solve this min-max problem, we need to consider the relative time scales for the training of the variables $p$ and $D$: \begin{enumerate} \item One time scale training: The learning rates for the parameters of $D_t$ and for $p_t$ have the same magnitude. \item Two time scale training: The learning rate for $D_t$ is much larger than that of $p_t$. Thus, on the time scale of $p_t$, the discriminator $D_t$ can be assumed optimal (at least when $L(p,D)$ is concave in the parameters of $D$). Effectively, $p_t$ is trained by gradient descent on $\sup_D L(p,D)$. This dynamics has been shown to closely approximate two-time scale training \cite{borkar1997timescale,heusel2017gans,lin2020gradient}. \end{enumerate} For the specific training rule, we will use continuous-time gradient flow. For the discriminator implemented by random feature functions (\ref{RFM discriminator}), we train its parameter function $a$ by gradient ascent \begin{align*} \frac{d}{dt} a_t(\mathbf{w},b) = \frac{\delta L(p,D_t)}{\delta a} = \int_{\Omega} \frac{\delta L(p,D_t)}{\delta D}(\mathbf{x}) \sigma(\mathbf{w}\cdot\mathbf{x}+b) \end{align*} where the variational gradients are taken in $L^2(\rho_0)$ and $L^2(\Omega)$. It follows that $D_t$ evolves by \begin{equation} \label{D gradient ascent} \frac{d}{dt}D_t = \mathbb{E}_{\rho_0(\mathbf{w},b)}\Big[\frac{d}{dt} a_t(\mathbf{w},b) \sigma(\mathbf{w}\cdot\mathbf{x}+b)\Big] = k*\frac{\delta L(p,D_t)}{\delta D} \end{equation} {\color{black}where $k$ is the kernel defined in (\ref{RKHS kernel})} and $k*$ denotes the convolution over $L^2(\Omega)$ \begin{equation} \label{k convolution} k*f(\mathbf{x}) = \int_{\Omega} k(\mathbf{x},\mathbf{x}')f(\mathbf{x}') \end{equation} Meanwhile, for the density function $p_t$, one option is the plain gradient descent \begin{equation} \label{p gradient descent} \frac{d}{dt} p_t = -\frac{\delta L(p_t, D_t)}{\delta p} \end{equation} In this case, $p_t$ is not guaranteed to remain as a probability density, but becomes a signed measure in $\mathcal{M}(\Omega)$. An alternative option is to perform projected gradient descent. Denote the tangent cone of the probability simplex $\Delta$ by \begin{equation*} \forall p \in \Delta, \quad T_p\Delta = \{q = q_+-q_- ~|~ q_{\pm} \geq 0, ~q_{\pm} \in L^2(\Omega), ~q_- \ll p\} \end{equation*} Let $\Pi_{\Delta}: L^2(\Omega) \to \Delta$ be the $L^2$ projection onto $\Delta$, and let $\Pi_{T_p\Delta}$ be the projection onto $T_p\Delta$. Then, the projected flow is given by \begin{align} \label{project gradient flow} \begin{split} \frac{d}{dt} p_t &= \Pi_{T_{p_t}\Delta} \Big(-\frac{\delta L(p_t,D_t)}{\delta p}\Big) = \lim_{\epsilon\to 0^+} \frac{\Pi_{\Delta}\big(p_t-\epsilon\delta_{p}L(p_t,D_t)\big)-p_t}{\epsilon} \end{split} \end{align} \subsection{Test Loss} The test loss is set to be the Wasserstein metric $W_2$ between the modeled distribution $P$ and the target $P_*$. If $p\in L^2(\Omega)$, we consider its projection \begin{equation} \label{W2 loss} W_2\big(\Pi_{\Delta}(p), P_*\big) \end{equation} {\color{black} The $W_2$ metric is chosen for two reasons. First, a key advantage of $W_2$ is that it is sensitive to memorization, such that any solution that approximates $P_*^{(n)}$ will exhibit the curse of dimensionality (\ref{W2 CoD}). Thus, a natural criterion for generalization ability is that a good model should achieve a $W_2$ test error with a dimension-independent rate (\ref{W2 escapes CoD}), despite that it is trained using only $P_*^{(n)}$. Second, the $W_2$ metric can be seen as the $L^2$ regression loss for probability measures, and thus is a natural choice for the loss function. Specifically, it is the quotient metric on $\mathcal{P}(\Omega)$ derived from the $L^2$ metric on the generators of GAN. \begin{proposition*} [Informal version of Proposition \ref{prop. W2 matching}] For any target distribution $P_*$ and a distribution $P$ generated by any generator $G$, \begin{equation*} W_2(P,P_*) = \inf_{G_*} \|G-G_*\|_{L^2} \end{equation*} where $G_*$ is any generator that generates $P_*$. \end{proposition*} The details are given in Section \ref{sec. between W2 and L2}. } \section{Two Time Scale Training} \label{sec. two time scale} First, we consider the setting with explicit regularization on the discriminator. Section \ref{sec. generalization gap} analyzes the generalization gap, and Section \ref{sec. generalization error} analyzes the generalization error and early stopping. The training loss is set to be the WGAN loss (\ref{WGAN loss}). Instead of fixing the family $\mathcal{D}$, we simply penalize the RKHS norm (\ref{RKHS norm}). Then, the loss associated with the discriminator in terms of the parameter function $a$ becomes \begin{align} \label{WGAN + RKHS} \begin{split} \max_a L_D(a) &= \mathbb{E}_{P_*}[D] - \mathbb{E}_P[D] - \|D\|_{\mathcal{H}}^2\\ &= \int \mathbb{E}_{\rho_0(\mathbf{w},b)} [a(\mathbf{w},b)\sigma(\mathbf{w}\cdot\mathbf{x}+b)] ~d(P_*-P)(\mathbf{x}) - \|a\|_{L^2(\rho_0)}^2 \end{split} \end{align} This loss is strongly concave with a unique maximizer $a_*${\color{black}, obtainable by taking the variational derivative in $a$} \begin{align*} a_*(\mathbf{w},b) &= \frac{1}{2} \int \sigma(\mathbf{w}\cdot\mathbf{x}'+b) ~d(P_*-P)(\mathbf{x}') \end{align*} So the optimal discriminator $D_*$ is given by \begin{align*} D_*(\mathbf{x}) &= {\color{black}\mathbb{E}_{\rho_0(\mathbf{w},b)}[a_*(\mathbf{w},b) \sigma(\mathbf{w}\cdot\mathbf{x}+b)]} = \frac{1}{2} \int k(\mathbf{x},\mathbf{x}') ~d(P_*-P)(\mathbf{x}') \end{align*} or $D_* = \frac{1}{2} k*(P_*-P)$, where the kernel $k$ is defined by (\ref{RKHS kernel}, \ref{k convolution}). With two-time-scale training and strong concavity, we can assume that the discriminator is always the maximizer $D_*$, so the WGAN loss (\ref{WGAN loss}) becomes \begin{equation} \label{MMD loss} L(P) = \mathbb{E}_{P_*}[D_*]-\mathbb{E}_P[D_*] = \frac{1}{2} \iint k ~d(P_*-P)^2 \end{equation} which is the squared MMD metric \cite{gretton2021kernel} with kernel $k$. Similarly, we denote the empirical loss by \begin{equation*} L^{(n)}(P) = \frac{1}{2} \iint k ~d(P_*^{(n)}-P)^2 \end{equation*} \subsection{Generalization Gap} \label{sec. generalization gap} The gradient descent training rule (\ref{p gradient descent}) and projected gradient descent (\ref{project gradient flow}) can be written respectively as \begin{align} \label{MMD gradient descent} \frac{d}{dt} p_t &= k*(P_*-P_t)\\ \label{MMD projected gradient descent} \frac{d}{dt} p_t &= \Pi_{T_{p_t}\Delta}\big(k*(P_*-P_t)\big) \end{align} If the empirical loss $L^{(n)}$ is used, we denote the training trajectory by $p_t^{(n)}$. \begin{proposition}[Generalization gap] \label{prop. generalization gap} With any target distribution $P_* \in \mathcal{P}(\Omega)$ and with probability $1-\delta$ over the sampling of $P_*^{(n)}$, \begin{enumerate} \item If $p_t, p_t^{(n)}$ are trained by gradient descent (\ref{MMD gradient descent}), then \begin{equation*} W_2\big(\Pi_{\Delta}(p_t),\Pi_{\Delta}(p_t^{(n)})\big) \leq \sqrt{d} ~\frac{4\sqrt{2\log 2d} + \sqrt{2\log (2/\delta)}}{\sqrt{n}}t \end{equation*} \item If $p_t, p_t^{(n)}$ are trained by projected gradient descent (\ref{MMD projected gradient descent}), then \begin{equation*} W_2(P_t,P_t^{(n)}) \leq \sqrt{d} ~\frac{4\sqrt{2\log 2d} + \sqrt{2\log (2/\delta)}}{\sqrt{n}}t \end{equation*} \end{enumerate} \end{proposition} \subsection{Generalization Error and Early-Stopping} \label{sec. generalization error} Let $p_t^{(n)}$ be trained by gradient descent (\ref{MMD gradient descent}) on the empirical loss $L^{(n)}$. \begin{theorem}[Generalization error] \label{thm. generalization error} Given any target density function $p_*$, with probability $1-\delta$ over the sampling of $P_*^{(n)}$, the generalization error of the trajectory $p_t^{(n)}$ is bounded by \begin{equation*} W_2\big(P_*,\Pi_{\Delta}(p_t^{(n)})\big) \leq \sqrt{d}\frac{\|p_*-p_0\|_{\mathcal{H}}}{\sqrt{t}} + \sqrt{d}~ \frac{4\sqrt{2\log 2d} + \sqrt{2\log (2/\delta)}}{\sqrt{n}}t \end{equation*} \end{theorem} This is a decomposition of the generalization error into training error plus generalization gap. It follows that with early stopping, we can escape from the curse of dimensionality. \begin{corollary}[Early stopping] \label{cor. early stopping} If we choose an early-stopping time $T$ as follows \begin{equation*} T \asymp \|p_*-p_0\|_{\mathcal{H}}^{2/3} \big(\frac{n}{\log d}\big)^{1/3} \end{equation*} then the generalization error obeys \begin{align*} W_2\big(P_*, \Pi_{\Delta}(p_T^{(n)})\big) &\lesssim \sqrt{d} \|p_*-p_0\|_{\mathcal{H}}^{2/3} \Big(\frac{\log d}{n}\Big)^{1/6} \end{align*} \end{corollary} This result suggests that for the adversarial density estimation model, a polynomial amount of samples $n = O(\epsilon^{-6})$ is needed to achieve an error of $\epsilon$, instead of an exponential amount $\epsilon^{-\Omega(d)}$. \subsection{Memorization} \label{sec. memorization} Despite that early-stopping solutions perform well, this adversarial density estimation model eventually memorizes the samples. \begin{proposition}[Memorization] \label{prop. memorization} Given the condition of Theorem \ref{thm. generalization error}, $P_t^{(n)}$ converges weakly to $P_*^{(n)}$. \end{proposition} We show a stronger result in Lemma \ref{lemma. universal convergence} that this model can be trained to converge to any distribution. \subsection{Remarks} \begin{remark}[Outside the Hypothesis Space] \normalfont Theorem \ref{thm. generalization error} requires that the target density belongs to the hypothesis space \begin{equation*} \mathcal{P}_* = \{p_* \in \Delta~|~\|p_*-p_0\|_{\mathcal{H}} < \infty\} \end{equation*} It is a weak condition, because given any $p_* \in \Delta$, the set $p_* + \mathcal{H}$ is dense in $L^2(\Omega)$, so there are plenty of initializations $p_0$ that can work. Even if $p_*-p_0 \notin \mathcal{H}$, it is straightforward to show that, \begin{equation*} \|p_*-p_t\|_{L^2} \leq \inf_{q} \frac{\|q-p_0\|_{\mathcal{H}}}{\sqrt{t}} + \|p_*-q\|_{L^2} \end{equation*} So if the target $p_*$ satisfies \begin{equation*} \inf_{\|p_0-q\|_{\mathcal{H}} \leq R} \|p_*-q\|_{L^2} \lesssim R^{-\beta} \end{equation*} for some $\beta > 0$, then the training error can be bounded by \begin{equation*} \|p_*-p_t\|_{L^2} \lesssim t^{-\frac{\beta}{2(1+\beta)}} \end{equation*} and the early-stopping generalization error becomes $O(n^{-\frac{\beta}{6\beta+4}})$. \end{remark} {\color{black} \begin{remark}[Finite neurons and approximation error] \label{remark: finite neurons} \normalfont The discriminator (\ref{RFM discriminator}) is defined as an average of a possibly infinite collection of feature functions, but in practice, there is only a finite number $m$ of neurons: \begin{equation*} D^{(m)}(\mathbf{x}) = \frac{1}{m} \sum_{j=1}^m a_j \sigma(\mathbf{w}_j\cdot\mathbf{x}+b_j) \end{equation*} where each $(\mathbf{w}_j,b_j)$ is sampled from the parameter distribution $\rho_0$. The model and its training dynamics (\ref{WGAN + RKHS}, \ref{MMD loss}, \ref{MMD gradient descent}) can be adapted to this finite-neuron setting, and we denote the empirical training trajectory by $p^{(n,m)}_t$. The generalization bound of Theorem \ref{thm. generalization error} continues to hold with an additional term of the approximation error, which scales as $O(\sqrt{t/m})$. Specifically, with probability $1-2\delta$ over the sampling of $P_*^{(n)}$ and $\rho_0^{(m)}$, \begin{equation*} \frac{W_2\big(P_*,\Pi_{\Delta}(p_t^{(n,m)})\big)}{\sqrt{d}} \leq \frac{\|p_*-p_0\|_{\mathcal{H}}}{\sqrt{t}} + \frac{\|p_*-p_0\|_{\mathcal{H}} \big[4+\sqrt{2\log(4/\delta)}\big]}{\sqrt{m}} \sqrt{t} + \frac{4\sqrt{2\log 2d} + \sqrt{2\log (2/\delta)}}{\sqrt{n}}t \end{equation*} The proof is given in Section \ref{sec. finite neurons}. In particular, this finite-neuron model is still able to avoid the curse of dimensionality. \end{remark} } \section{One Time Scale Training} \label{sec. one time scale} The previous section demonstrates that, with an explicit regularization $\|D\|_{\mathcal{H}}$, we can bound the Rademacher complexity of the discriminators and enable the adversarial density estimator to generalize well. This section shows that even if we do not explicitly bound the complexity of $D$, the early-stopping solutions still enjoy good generalization accuracy. \subsection{Ill-posedness} Recall that we are using the WGAN loss (\ref{WGAN loss}), which we write as a min-max problem: \begin{equation*} \min_p \max_D L(p, D) = \min_p \max_D \mathbb{E}_{P_*}[D] -\mathbb{E}_P[D] - R(D) \end{equation*} Instead of penalizing the parameters of the discriminator $R(D)=\|D\|_{\mathcal{H}}^2=\|a\|_{L^2(\rho_0)}^2$, we consider weaker regularizations on its function value. For instance, \begin{itemize} \item The $L^2$ penalty proposed by \cite{xu2020understanding} \begin{equation} \label{L2 penalty} R(D) = \|D\|_{L^2(\Omega)}^2 \end{equation} \item Gradient penalty \begin{equation} \label{gradient penalty} R(D) = \|\nabla D\|_{L^2(\Omega)}^2 \end{equation} \item The Lipschitz penalty proposed by \cite{gulrajani2017improved}. We present a simplified form for better illustration \begin{equation} \label{WGAN-GP penalty} R(D) = \|1-\|\nabla D\| \|_{L^2(\Omega)}^2 \end{equation} \item Other Lipschitz penalties \cite{kodali2017convergence,petzka2018regularization} in simplified forms \begin{equation} \label{WGAN-LP penalty} R(D) = \|\max(0,\|\nabla D\|-1)\|_{L^2(\Omega)}^2 \quad \text{or} \quad \|\max(0,\|\nabla D\|^2-1)\|_{L^1(\Omega)} \end{equation} \end{itemize} None of the above regularizations lead to a well-defined GAN loss. \begin{proposition}[Ill-posedness] \label{prop. ill-posedness} Consider the empirical loss function \begin{equation*} L^{(n)}(P) = \sup_{D\in C^1(\Omega)} \mathbb{E}_{P_*^{(n)}}[D] -\mathbb{E}_P[D] - c R(D) \end{equation*} with any $c\geq 0$, where the regularization $R$ is any of (\ref{L2 penalty}, \ref{gradient penalty}, \ref{WGAN-GP penalty}, \ref{WGAN-LP penalty}). Suppose the dimension $d \geq 3$. Then, for any distribution $P\neq P_*^{(n)}$ \begin{equation*} L^{(n)}(P) = \infty \end{equation*} \end{proposition} Heuristically, these regularizations are too weak to control the complexity of $D$, so that $D$ can diverge around the sample points of $P_*^{(n)}$, and thus the loss blows up. By the universal approximation property \cite{hornik1991approximation}, this result holds if we implement $D$ by neural networks or random feature functions. It follows that the two-time-scale training, with $D$ trained to optimality, is not applicable. \subsection{Generalization error} Nevertheless, we show that one-time-scale training still performs well and achieves a small generalization error. For simplicity, we focus on the $L^2$ regularization (\ref{L2 penalty}), \begin{equation} \label{WGAN+L2} \min_p \max_D L(p, D) = \min_p \max_D \mathbb{E}_{P_*}[D] -\mathbb{E}_P[D] - \frac{c}{2}\|D\|_{L^2(\Omega)}^2 \end{equation} with some $c > 0$. As usual we model $D$ by the random feature function (\ref{RFM discriminator}). The one-time-scale gradient descent-ascent (\ref{p gradient descent}, \ref{D gradient ascent}) can be written as \begin{align} \label{one time scale GD} \frac{d}{dt} p_t &= D_t, \quad \frac{d}{dt} D_t = k*(P_*-P_t) - ck*D_t \end{align} Again, denote by $p_t^{(n)}, D_t^{(n)}$ the training trajectory on the empirical loss $L^{(n)}$. \begin{theorem}[Generalization error] \label{thm. one-time-scale generalization error} Suppose $0 < c \leq \sqrt{2}$. Initialize $p_t^{(n)}$ by $p_0$ and the parameter function of the discriminator $D_t^{(n)}$ by $a_0^{(n)} \equiv 0$. With probability $1-\delta$ over the sampling of $P_*^{(n)}$, we have \begin{equation*} W_2\big(\Pi_{\Delta}(p_t^{(n)}),P_*\big) \leq \sqrt{\frac{d}{c}} \frac{\|p_*-p_0\|_{\mathcal{H}}}{\sqrt{t}} + {\color{black}\sqrt{\frac{d}{c}}~ \frac{4\sqrt{2\log 2d} + \sqrt{2\log (2/\delta)}}{\sqrt{n}} t^{3/2}} \end{equation*} \end{theorem} The condition $c \leq \sqrt{2}$ is imposed for convenience. Otherwise, the ``friction" is too large, so the convergence becomes slower and the formula becomes more complicated. Similar to Corollary \ref{cor. early stopping}, we show that early stopping can escape from the curse of dimensionality. \begin{corollary}[Early stopping] \label{cor. one-time-scale early stopping} Given the condition of Theorem \ref{thm. one-time-scale generalization error}, if we choose an early-stopping time $T$ as follows \begin{equation*} T \asymp \|p_*-p_0\|_{\mathcal{H}}^{1/2} \big(\frac{n}{\log d}\big)^{1/4} \end{equation*} then the generalization error obeys \begin{align*} W_2\big(P_*, \Pi_{\Delta}(p_T^{(n)})\big) &\lesssim {\color{black}\sqrt{d} \|p_*-p_0\|_{\mathcal{H}}^{3/4} \Big(\frac{\log d}{n}\Big)^{1/8}} \end{align*} \end{corollary} Finally, we can also establish memorization in the long time limit. \begin{proposition}[Memorization] \label{prop. memorization one-time-scale} Given the condition of Theorem \ref{thm. one-time-scale generalization error}, $P_t^{(n)}$ converges weakly to $P_*^{(n)}$. \end{proposition} \section{Slow Deterioration} \label{sec. slow deterioration} In the previous sections, we demonstrated that the generalization ability of the adversarial density estimation models, (\ref{WGAN + RKHS}) and (\ref{WGAN+L2}), can be attributed to the dimension-independent complexity of the discriminators during training (e.g. Rademacher complexity). This section provides a supplementary view, that because the complexity of $D_t$ grows slowly, it would take a very long time for $D_t$ to deteriorate to the optimal Lipschitz discriminator of WGAN \cite{arjovsky2017wasserstein}. Heuristically, this slow deterioration is beneficial, because as illustrated in Figure \ref{fig: W2 geodesic} curve \textcircled{1}, training on the Wasserstein landscape suffers from the curse of dimensionality. \footnote{Technically, Figure \ref{fig: W2 geodesic} curve \textcircled{1} concerns the $W_2$ loss, but it is reasonable to believe that training on $W_1$ or any $W_p$ loss cannot escape from the curse of dimensionality either.} Consider the empirical WGAN loss with Lipschitz discriminator \begin{equation*} \max_{\|D\|_{\text{Lip}}\leq 1} \mathbb{E}_{P_*^{(n)}}[D] -\mathbb{E}_P[D] \end{equation*} The Kantorovich-Rubinstein theorem \cite{villani2003topics} tells us that this is the $W_1$ metric between $P$ and $P_*^{(n)}$, while the Arzel\`{a}–Ascoli theorem implies that the maximizers $D_*$ exist (over the compact domain $\Omega$). It has been the focus of several GAN models (e.g. \cite{arjovsky2017wasserstein,gulrajani2017improved,kodali2017convergence,petzka2018regularization}) to try to learn these $D_*$ by neural networks. For convenience, suppose our modeled distribution $P$ is exactly $P_*$ and $P_*$ is the uniform distribution over $\Omega=[0,1]^d$. By Theorem 5.1 of \cite{dobric1995asymptotics}, we have \begin{equation} \label{W1 empirical} \max_{\|D\|_{\text{Lip}}\leq 1} \mathbb{E}_{P_*^{(n)}}[D] -\mathbb{E}_P[D] = W_1(P_*,P_*^{(n)}) \asymp n^{-1/d} \end{equation} The large gap $n^{-1/d}$ indicates that $D_*$ well separates $P_*$ and $P_*^{(n)}$, suggesting that during GAN training, $D_*$ can quickly drive $P$ away from $P_*$ and towards memorizing $P_*^{(n)}$. Let us consider the loss associated with the discriminator \begin{align*} \max_a L^{(n)}(a) &= \mathbb{E}_{P_*^{(n)}}[D] -\mathbb{E}_P[D] - R(a)\\ D(\mathbf{x}) &= \mathbb{E}_{\rho_0}[a(\mathbf{w},b)~ \sigma(\mathbf{w}\cdot\mathbf{x}+b)] \end{align*} where $D$ is again modeled as a random feature function. Assume two-time-scale training, so that $P=P_*$ is fixed as we train $D_t$. The regularization $R$ can be, for instance, the Lipschitz constraint \begin{equation} \label{Lipschitz constraint} R(a) = \begin{cases} 0 \text{ if } \|D\|_{\text{Lip}} \leq 1\\ \infty \text{ else} \end{cases} \end{equation} or a Lipschitz penalty, as in WGAN-GP \cite{gulrajani2017improved, kodali2017convergence, petzka2018regularization} \begin{equation} \label{Lipschitz penalty} R(a) = c \max(0,\|D\|_{\text{Lip}}-1) \end{equation} with $c \gg 1$. The following result indicates that $D_t$ cannot approximate $D_*$ efficiently. \begin{proposition}[Slow deterioration] \label{prop. slow deterioration} Suppose $R$ is any regularization term such that $L^{(n)}$ is bounded above and that we can train $a$ by continuous-time (sub)gradient flow. Let $a_t$ be the gradient ascent trajectory with any initialization $a_0 \in L^2(\rho_0)$, let $D_t$ be the discriminator, and let $D_*$ be any maximizer of (\ref{W1 empirical}). With probability $1-\delta$ over the sampling of $P_*^{(n)}$, we have \begin{equation*} \|D_t-D_*\|_{L^{\infty}(\Omega)} \geq \frac{3}{40} n^{-1/d} - \frac{2\sqrt{2\log 2d} + \sqrt{\log(2/\delta)/2}}{\sqrt{n}}o(\sqrt{t}) \end{equation*} \end{proposition} Both (\ref{Lipschitz constraint}) and (\ref{Lipschitz penalty}) satisfy the condition of Proposition \ref{prop. slow deterioration}, since $-L^{(n)}$ becomes a proper closed convex function. Hence, it takes at least $\omega(n^{1-\frac{2}{d}})$ time to learn the optimal Lipschitz discriminator. The generality of Proposition \ref{prop. slow deterioration} indicates that it could be futile to search for a Lipschitz regularization for WGAN. \section{Proofs} \label{sec. proofs} The results from Sections \ref{sec. two time scale}, \ref{sec. one time scale} and \ref{sec. slow deterioration} are proved in the following three subsections respectively. \subsection{Two time scale training} \begin{definition} \label{def. RKHS eigendecomposition} Let $k$ be the kernel defined in (\ref{RKHS kernel}). Consider the convolution (\ref{k convolution}) as a symmetric compact operator over $L^2(\Omega)$. By universal approximation (Section \ref{sec. function representation}), $k$ is positive definite. It follows that we can construct an orthonormal basis of eigenvectors $\{\mathbf{e}_i\}_{i=1}^{\infty}$ with eigenvalues $\lambda_i > 0$. Denote \begin{equation*} \tilde{\mathbf{e}}_i = \frac{\mathbf{e}_i}{\sqrt{\lambda_i}} \end{equation*} Then, $\{\tilde{\mathbf{e}}_i\}_{i=1}^{\infty}$ is an orthonormal basis of $\mathcal{H}$. \end{definition} Regarding the Wasserstein test loss (\ref{W2 loss}), we have the following convenient bound. \begin{lemma} \label{lemma. W2-L2 bound} For any $p,q \in L^2(\Omega)$, \begin{equation*} W_2\big(\Pi_{\Delta}(p), \Pi_{\Delta}(q)\big) \leq \sqrt{d} \|p-q\|_{L^2(\Omega)} \end{equation*} \end{lemma} \begin{proof} The $L^1$ difference between two probability densities is equivalent to an optimal transport distance with the loss \begin{equation*} c(\mathbf{x},\mathbf{y}) = \begin{cases}0 ~\text{if}~ \mathbf{x}=\mathbf{y}\\ 1 ~\text{else}\end{cases} \end{equation*} {\color{black} Since $\|\mathbf{x}-\mathbf{y}\| \leq \text{diam}(\Omega) c(\mathbf{x},\mathbf{y})$ for all $\mathbf{x},\mathbf{y} \in \Omega$, the $W_2$ metric is dominated by the $L^1$ distance} \begin{align*} W_2\big(\Pi_{\Delta}(p), \Pi_{\Delta}(q)\big) &\leq \sqrt{d} \|\Pi_{\Delta}(p)-\Pi_{\Delta}(q)\|_{L^1(\Omega)} \end{align*} Meanwhile, since $\Omega=[0,1]^d$ has unit volume \begin{align*} \|\Pi_{\Delta}(p)-\Pi_{\Delta}(q)\|_{L^1(\Omega)} &\leq \|\Pi_{\Delta}(p)-\Pi_{\Delta}(q)\|_{L^2(\Omega)} \leq \|p-q\|_{L^2(\Omega)} \end{align*} \end{proof} \noindent We also need the following lemma from \cite{yang2020generalization}. \begin{lemma} \label{lemma. RKHS Monte Carlo rate} For any distribution $P_* \in \mathcal{P}(\Omega)$ and any $\delta \in (0,1)$, with probability $1-\delta$ over the i.i.d. sampling of $P_*^{(n)}$, \begin{align*} \sup_{\|\mathbf{w}\|_1+|b| \leq 1} \Big|\int \sigma(\mathbf{w}\cdot\mathbf{x}+b) ~d(P_*-P_*^{(n)})(\mathbf{x})\Big| \leq \frac{4\sqrt{2\log 2d} + \sqrt{2\log (2/\delta)}}{\sqrt{n}} \end{align*} \end{lemma} \subsubsection{Proof of generalization gap} \begin{proof}[Proof of Proposition \ref{prop. generalization gap}] First, for the plain gradient flow (\ref{MMD gradient descent}), we have \begin{align*} \frac{d}{dt} \|p^{(n)}_t-p_t\|_{L^2(\Omega)} &= \big\langle \frac{p^{(n)}_t-p_t}{\|p^{(n)}_t-p_t\|}, ~k*(p_*^{(n)}-p_t^{(n)}) - k*(p_*-p_t) \big\rangle_{L^2(\Omega)}\\ &= \big\langle \frac{p^{(n)}_t-p_t}{\|p^{(n)}_t-p_t\|}, ~k*(p_*^{(n)}-p_*) - k*(p^{(n)}_t-p_t) \big\rangle_{L^2(\Omega)}\\ &\leq \big\langle \frac{p^{(n)}_t-p_t}{\|p^{(n)}_t-p_t\|}, ~k*(p_*^{(n)}-p_*) \big\rangle\\ &\leq \|k*(p_*^{(n)}-p_*)\|_{L^2(\Omega)}\\ &\leq \sup_{\mathbf{x}\in\Omega} \Big| \mathbb{E}_{\rho_0(\mathbf{w},b)}\Big[ \sigma(\mathbf{w}\cdot\mathbf{x}+b) \int \sigma(\mathbf{w}\cdot\mathbf{x}'+b) ~d(P_*^{(n)}-P_*)(\mathbf{x}') \Big]\Big|\\ &\leq \sup_{\|\mathbf{w}\|_1+|b| \leq 1} \Big|\int \sigma(\mathbf{w}\cdot\mathbf{x}+b) ~d(P_*-P_*^{(n)})(\mathbf{x})\Big| \end{align*} Then, Lemma \ref{lemma. RKHS Monte Carlo rate} implies that with probability $1-\delta$, \begin{equation} \label{L2 generalization gap} \|p^{(n)}_t-p_t\|_{L^2(\Omega)} \leq \int_0^t \frac{4\sqrt{2\log 2d} + \sqrt{2\log (2/\delta)}}{\sqrt{n}} \end{equation} One can conclude by Lemma \ref{lemma. W2-L2 bound} that \begin{equation*} W_2\big(\Pi_{\Delta}(p_t^{(n)}), \Pi_{\Delta}(p_t)\big) \leq \sqrt{d}~ \frac{4\sqrt{2\log 2d} + \sqrt{2\log (2/\delta)}}{\sqrt{n}}t \end{equation*} Next, for the projected gradient flow (\ref{MMD projected gradient descent}), we have \begin{align*} \frac{d}{dt} \|p^{(n)}_t-p_t\| &= \Big\langle \frac{p^{(n)}_t-p_t}{\|p^{(n)}_t-p_t\|}, ~\Pi_{T_{p_t^{(n)}}\Delta}\big(k*(p_*^{(n)}-p_t^{(n)})\big) - \Pi_{T_{p_t}\Delta}\big(k*(p_*-p_t)\big) \Big\rangle\\ &= \lim_{\epsilon\to 0^+} \Big\langle \frac{p^{(n)}_t-p_t}{\|p^{(n)}_t-p_t\|}, ~\frac{\Pi_{T\Delta}\big(p_{t,\epsilon}^{(n)}\big)-p_t^{(n)}}{\epsilon} - \frac{\Pi_{T\Delta}\big(p_{t,\epsilon}\big)-p_t}{\epsilon} \Big\rangle\\ \end{align*} where \begin{align*} p_{t,\epsilon} := p_t + \epsilon k*(p_*-p_t),\quad p_{t,\epsilon}^{(n)} := p_t^{(n)} + \epsilon k*(p_*^{(n)}-p_t^{(n)}) \end{align*} Since $\Pi_{\Delta}$ is a projection onto a convex set, \begin{align*} \big\langle p_t^{(n)}-p_t, ~p_{t,\epsilon}-\Pi_{\Delta}(p_{t,\epsilon}) \big\rangle &\leq \big\langle \Pi_{\Delta}(p_{t,\epsilon})-p_t, ~p_{t,\epsilon}-\Pi_{\Delta}(p_{t,\epsilon}) \big\rangle = O(\epsilon^2)\\ \big\langle p_t-p^{(n)}_t, ~p^{(n)}_{t,\epsilon}-\Pi_{\Delta}(p^{(n)}_{t,\epsilon}) \big\rangle &= O(\epsilon^2) \end{align*} It follows that \begin{align*} \frac{d}{dt} \|p^{(n)}_t-p_t\| &\leq \lim_{\epsilon\to 0^+} \Big\langle \frac{p^{(n)}_t-p_t}{\|p^{(n)}_t-p_t\|}, ~\frac{p_{t,\epsilon}^{(n)}-p_t^{(n)}}{\epsilon} - \frac{p_{t,\epsilon}-p_t}{\epsilon} \Big\rangle + O(\epsilon)\\ &= \Big\langle \frac{p^{(n)}_t-p_t}{\|p^{(n)}_t-p_t\|}, ~k*(p_*-p_t)-k*(p^{(n)}_*-p^{(n)}_t) \Big\rangle \end{align*} The proof is completed using the same argument for plain gradient flow. \end{proof} \subsubsection{Proof of generalization error} \begin{lemma}[Training error, two-time-scale] \label{lemma. training error} If $p_t$ is trained by the gradient flow (\ref{MMD gradient descent}) with any target distribution $p_* \in L^2(\Omega)$, we have {\color{black} \begin{align*} \|p_t-p_*\|_{L^2(\Omega)}^2 \leq \frac{\|p_0-p_*\|_{\mathcal{H}}^2}{t} \end{align*} } \end{lemma} \begin{proof} We show that the training rule (\ref{MMD gradient descent}) coincides with the training trajectory of RKHS regression: For any $a \in L^2(\rho_0)$, define the function \begin{equation*} f_a(\mathbf{x}) = \mathbb{E}_{\rho_0(\mathbf{w},b)}[a(\mathbf{w},b)\sigma(\mathbf{w}\cdot\mathbf{x}+b)] \end{equation*} If $\|p_0-p_*\|_{\mathcal{H}} < \infty$, we can choose $a_0$ such that $f(a_0) = p_0-p_*$. Then, if we train $a_t$ by gradient flow with initialization $a_0$ on the regression loss \begin{equation*} \min_a \Gamma(a) = \frac{1}{2} \|f_a\|_{L^2(\Omega)}^2, \end{equation*} the function $f_{a_t}$ evolves by \begin{align*} \frac{d}{dt} f_{a_t}(\mathbf{x}) &= \mathbb{E}_{\rho_0}\big[\frac{d}{dt}a_t~ \sigma(\mathbf{w}\cdot\mathbf{x}+b)\big]\\ &= \mathbb{E}_{\rho_0}\big[ -\int_{\Omega} f_{a_t}(\mathbf{x}') \sigma(\mathbf{w}\cdot\mathbf{x}'+b) d\mathbf{x}' \sigma(\mathbf{w}\cdot\mathbf{x}+b)\big]\\ &= -\int_{\Omega} f_{a_t}(\mathbf{x}') k(\mathbf{x}, \mathbf{x}') d\mathbf{x}' \end{align*} or equivalently \begin{equation*} \frac{d}{dt}f_{a_t} = -k * f_{a_t} \end{equation*} So the training dynamics of $f_{a_t}$ is the same as the training rule (\ref{MMD gradient descent}) for the function $p_t-p_*$. Since $f_{a_0} = p_0-p_*$, we have $f_{a_t} = p_t-p_*$ for all $t\geq 0$. It follows from the convexity of $\Gamma$ that \begin{equation*} \|p_t-p_*\|^2_{L^2(\Omega)} = \|f(a_t)\|^2_{L^2(\Omega)} \leq \frac{\|a_0\|^2_{\rho_0}}{t} = \frac{\|p_0-p_*\|_{\mathcal{H}}^2}{t} \end{equation*} \end{proof} \begin{proof}[Proof of Theorem \ref{thm. generalization error}] Decompose the generalization error into training error + generalization gap: \begin{align*} \|p_*-p_t^{(n)}\|_{L^2(\Omega)} \leq \|p_*-p_t\|_{L^2} + \|p_t-p_t^{(n)}\|_{L^2} \end{align*} The first term is bounded by Lemma \ref{lemma. training error} and the second term is bounded by (\ref{L2 generalization gap}). Therefore, \begin{align*} \|p_*-p_t^{(n)}\|_{L^2(\Omega)} \leq \frac{\|p_0-p_*\|_{\mathcal{H}}}{\sqrt{t}} + \frac{4\sqrt{2\log 2d} + \sqrt{2\log (2/\delta)}}{\sqrt{n}}t \end{align*} Then, we conclude by Lemma \ref{lemma. W2-L2 bound}. \end{proof} \subsubsection{Proof of memorization} Proposition \ref{prop. memorization} is a corollary of the following lemma. \begin{lemma}[Universal convergence, two-time-scale] \label{lemma. universal convergence} Given any signed measure $\tilde{P} \in \mathcal{M}(\Omega)$ and any initialization $p_0 \in L^2(\Omega)$, if we define $P_t$ by \begin{equation*} \frac{d}{dt} p_t = k * (\tilde{P}-P_t) \end{equation*} with any initialization $p_0 \in L^2(\Omega)$, then $P_t$ converges weakly to $\tilde{P}$. \end{lemma} \begin{proof} Let $\lambda_i$ and $\tilde{\mathbf{e}}_i$ be the eigendecomposition in Definition \ref{def. RKHS eigendecomposition}. Denote $f_t = k*P_t$ and $\tilde{f} = k*\tilde{P}$. Decompose $f_t-\tilde{f}$ into \begin{equation*} f_t-\tilde{f} = \sum_{i=1}^{\infty} y_t^i \tilde{\mathbf{e}}_i \end{equation*} Then, \begin{equation*} \frac{d}{dt} (f_t - \tilde{f}) = k*[k*(\tilde{P}-P_t)] = -k*(f_t - \tilde{f}) = -\sum_{i=1}^{\infty} y_t^i \lambda_i \tilde{\mathbf{e}}_i \end{equation*} It follows that $y_t^i = y_0^i e^{-\lambda_i t}$. Given that \begin{equation*} \sum_{i=1}^{\infty} (y_0^i)^2 = \|f_0 - \tilde{f}\|_{\mathcal{H}}^2 = \mathbb{E}_{(P_0-\tilde{P})^2}[k] \leq (\|P_0\|_{\text{TV}}+\|\tilde{P}\|_{\text{TV}})^2 \|k\|_{C(\Omega\times\Omega)} < \infty \end{equation*} we can apply dominated convergence theorem to obtain \begin{equation*} \lim_{t\to\infty} \|f_t - \tilde{f}\|_{\mathcal{H}}^2 = \lim_{t\to\infty} \sum_{i=1}^{\infty} (y_0^i)^2 e^{-2\lambda_i t} = 0 \end{equation*} Thus, $f_t \to \tilde{f}$ in $\mathcal{H}$, which implies \begin{equation*} \forall f \in \mathcal{H}, \quad \lim_{t\to\infty} \int f ~d(P_t-\tilde{P}) = \lim_{t\to\infty} \langle f_t-\tilde{f}, ~f\rangle_{\mathcal{H}} = 0 \end{equation*} As discussed in Section \ref{sec. function representation}, the RKHS space $\mathcal{H}$ is dense in $C(\Omega)$ under the supremum norm. It follows that \begin{equation*} \forall f \in C(\Omega), \quad \lim_{t\to\infty} \int f ~d P_t = \int f ~d\tilde{P} \end{equation*} Hence, $P_t$ converges weakly to $\tilde{P}$. \end{proof} \subsection{One time scale training} \subsubsection{Proof of ill-posedness} \begin{proof}[Proof of Proposition \ref{prop. ill-posedness}] Let $\{\mathbf{x}_i\}_{i=1}^n$ be the sample points of $P_*^{(n)}$. Define the function \begin{equation*} D(\mathbf{x}) = \sum_{i=1}^n \|\mathbf{x}-\mathbf{x}_i\|^{-d/2 + 1.1} \end{equation*} Let $\eta$ be a mollifier ($\eta$ is smooth, non-negative, supported in the unit ball and $\int \eta =1$). Define \begin{equation*} D_{\epsilon} = \int \eta(\mathbf{y}) D(\mathbf{x}-\epsilon\mathbf{y}) d\mathbf{y} \end{equation*} Then, $\sup_{\epsilon > 0} R(D_{\epsilon}) < \infty$, while for any $P \neq P_*^{(n)}$, \begin{equation*} \lim_{\epsilon\to 0^+} E_{P_*^{(n)}}[D_{\epsilon}] - \mathbb{E}_P[D_{\epsilon}] = \infty \end{equation*} It follows that \begin{equation*} \sup_{D \in C^1} \mathbb{E}_{P_*^{(n)}}[D] - \mathbb{E}_P[D] - R(D) = \infty \end{equation*} \end{proof} \subsubsection{Proof of generalization error} As usual, we try to bound the generalization error by the training error plus the generalization gap, and estimate them separately. \begin{lemma}[Duhamel's integral] \label{lemma. second order ODE} Consider the one-dimensional second-order ODE \begin{align*} \ddot{x} + b\dot{x} + ax &= q\\ x(0) = x_0, \quad \dot{x}(0) &= 0 \end{align*} where $a,b$ are constants and $q$ is a locally integrable function in $t$. If $4a>b^2$, then the solution is given by \begin{equation*} x(t) = x_0 e^{-\frac{b}{2}t}\Big[\cos\big(t\sqrt{a-\frac{b^2}{4}}\big) + \frac{\frac{b}{2}\sin\big(t \sqrt{a-\frac{b^2}{4}}\big)}{\sqrt{a-\frac{b^2}{4}}}\Big] + \int_0^t q(s) e^{-\frac{b}{2}(t-s)} \frac{\sin\big((t-s)\sqrt{a-\frac{b^2}{4}}\big)}{\sqrt{a-\frac{b^2}{4}}} ds \end{equation*} \end{lemma} \begin{proof} Direct verification. \end{proof} \begin{lemma} \label{lemma. k operator norm} Let $k$ be the kernel defined in (\ref{RKHS kernel}). Assume that the support of the parameter distribution $\rho_0$ is contained in $\{\|\mathbf{w}\|_1+|b|\leq 1\}$. Then, the operator norm of the convolution (\ref{k convolution}) over $L^2(\Omega)$ is bounded by $1$. \end{lemma} \begin{proof} \begin{align*} \|k\|_{op} &= \sup_{\|f\|_{L^2(\Omega)} \leq 1} \langle k*f, f\rangle_{L^2(\Omega)}\\ &= \sup_{\|f\|_{L^2} \leq 1} \mathbb{E}_{\rho_0(\mathbf{w},b)}\Big[\Big(\int_{\Omega} f(\mathbf{x}) \sigma(\mathbf{w}\cdot\mathbf{x}+b)\Big)^2\Big]\\ &\leq \mathbb{E}_{\rho_0(\mathbf{w},b)}\big[\|\sigma(\mathbf{w}\cdot\mathbf{x}+b)\|_{L^2}^2\big]\\ &\leq \sup_{\|\mathbf{w}\|_1+|b|\leq 1} \sup_{\mathbf{x}\in\Omega} \sigma(\mathbf{w}\cdot\mathbf{x}+b)^2\\ &\leq 1 \end{align*} \end{proof} \begin{lemma}[Training error, one-time-scale] \label{lemma. one time scale training error} Given any $0 < c \leq \sqrt{2}$, any target density $p_*$ and any initialization $p_0$ such that $\|p_*-p_0\|_{\mathcal{H}} < \infty$, let $p_t, D_t$ be the training trajectory (\ref{one time scale GD}) with $D_0 \equiv 0$, then we have \begin{equation*} \|p_*-p_t\|_{L^2} \leq \frac{\|p_*-p_0\|_{\mathcal{H}}}{\sqrt{ct}} \end{equation*} \end{lemma} \begin{proof} Let $\{\lambda_i,\tilde{\mathbf{e}}_i\}_{i=1}^{\infty}$ be the eigendecomposition given by Definition \ref{def. RKHS eigendecomposition}. Lemma \ref{lemma. k operator norm} implies that all $\lambda_i \in (0,1]$. Then, the condition $0 < c \leq \sqrt{2}$ implies that $2\lambda_i \geq c^2\lambda_i^2$. For any $t$, define the orthonormal decomposition \begin{equation*} p_t-p_* = \sum_{i=1}^{\infty} x^i(t) \tilde{\mathbf{e}}_i, \quad \sum_{i=1}^{\infty} x^i(0)^2 = \|p_0-p_*\|_{\mathcal{H}}^2 < \infty \end{equation*} Denote $u(t) = p_t-p_*$. The training rule (\ref{one time scale GD}) can be rewritten as \begin{equation*} \ddot{u} + ck*\dot{u} + k*u = 0 \end{equation*} Taking RKHS inner product with $\tilde{\mathbf{e}}_i$ for each $i$, we obtain \begin{align*} \forall i, \quad \ddot{x}^i + c\lambda_i \dot{x}^i + \lambda_i x^i &= 0\\ x^i(0) = x^i_0, \quad \dot{x}^i(0) &= 0 \end{align*} Since $4\lambda_i > c^2\lambda_i^2$, Lemma \ref{lemma. second order ODE} implies that \begin{equation*} \forall i, \quad x^i(t) = x^i_0 e^{-\frac{c\lambda_i}{2}t}\Big[\cos\big(t\sqrt{\lambda_i-\frac{c^2\lambda^2}{4}}\big) + \frac{\frac{c\lambda_i}{2}\sin\big(t \sqrt{\lambda_i-\frac{c^2\lambda_i^2}{4}}\big)}{\sqrt{\lambda_i-\frac{c^2\lambda_i^2}{4}}}\Big] \end{equation*} Since $\frac{4}{c^2\lambda_i} - 1 \geq 1$, \begin{equation*} |x^i(t)| \leq |x^i_0| e^{-\frac{c\lambda_i}{2}t}\Big|\cos\big(t\sqrt{\lambda_i-\frac{c^2\lambda^2}{4}}\big) + \sin\big(t \sqrt{\lambda_i-\frac{c^2\lambda_i^2}{4}}\big)\Big| \leq \sqrt{2} |x^i_0| e^{-\frac{c\lambda_i}{2}t} \end{equation*} It follows that \begin{align*} \|p_t-p_*\|_{L^2}^2 &= \sum_{i=1}^{\infty} \lambda_i x^i(t)^2 \leq \sum_{i=1}^{\infty} 2\lambda_i (x^i_0)^2 e^{-c\lambda_i t}\\ &\leq \sum_{i=1}^{\infty} \sup_{\lambda>0} 2\lambda (x^i_0)^2 e^{-c\lambda t} \leq \sum_{i=1}^{\infty} \frac{2}{e} \frac{1}{ct} (x^i_0)^2\\ &\leq \frac{\|p_*-p_0\|^2_{\mathcal{H}}}{ct} \end{align*} \end{proof} Recall that the one-time-scale training over the empirical loss $L^{(n)}$ is given by the following dynamics \begin{align} \label{one time scale GD empirical} \frac{d}{dt} p^{(n)}_t &= D^{(n)}_t, \quad \frac{d}{dt} D^{(n)}_t = k*(P_*^{(n)}-P^{(n)}_t) - ck*D^{(n)}_t \end{align} \begin{lemma}[Generalization gap, one-time-scale] \label{lemma. one time scale generalization gap} Given any $0 < c < 2$ and any target distribution $P_*$, let $p_t$ and $p_t^{(n)}$ be the trajectory of the dynamics (\ref{one time scale GD}) and (\ref{one time scale GD empirical}) with the same initialization $p_0 = p_0^{(n)}$ and $D_0 = D_0^{(n)} \equiv 0$. Then, with probability $1-\delta$ over the sampling of $P_*^{(n)}$, we have \begin{equation*} \|p_t-p_t^{(n)}\|_{L^2(\Omega)} \leq {\color{black}\frac{4\sqrt{2\log 2d} + \sqrt{2\log (2/\delta)}}{\sqrt{n}} \frac{t^{3/2}}{\sqrt{c}}} \end{equation*} \end{lemma} \begin{proof} Let $\{\lambda_i,\tilde{\mathbf{e}}_i\}_{i=1}^{\infty}$ be the eigendecomposition given by Definition \ref{def. RKHS eigendecomposition}. Lemma \ref{lemma. k operator norm} implies that $4\lambda_i > c^2\lambda_i^2$. For any $t$, define the orthonormal decompositions \begin{align*} p_t-p_t^{(n)} &= \sum_{i=1}^{\infty} y^i(t) \tilde{\mathbf{e}}_i\\ k*(P_*-P_*^{(n)}) &= \sum_{i=1}^{\infty} q^i \tilde{\mathbf{e}}_i \end{align*} Denote $u(t) = p_t-p_t^{(n)}$. Then, $u(0) = \dot{u}(0) \equiv 0$. The training rules (\ref{one time scale GD}, \ref{one time scale GD empirical}) imply that \begin{equation*} \ddot{u} + ck*\dot{u} + k*u = k*(P_*-P_*^{(n)}) \end{equation*} Taking RKHS inner product with $\tilde{\mathbf{e}}_i$ for each $i$, we obtain \begin{align*} \forall i, \quad \ddot{y}^i + c\lambda_i \dot{y}^i + \lambda_i y^i &= q^i\\ y^i(0) = \dot{y}^i(0) &= 0 \end{align*} Since $4\lambda_i > c^2\lambda_i^2$, Lemma \ref{lemma. second order ODE} implies that \begin{equation*} \forall i, \quad y^i(t) = q^i \int_0^t e^{-\frac{c\lambda_i}{2}(t-s)} \frac{\sin\big((t-s) \sqrt{\lambda_i-\frac{c^2\lambda_i^2}{4}}\big)}{\sqrt{\lambda_i-\frac{c^2\lambda_i^2}{4}}} ds \end{equation*} {\color{black}Then \begin{align*} \sqrt{\lambda_i} |y^i(t)| &\leq |q^i| \sqrt{\lambda_i} \int_0^t e^{-\frac{c\lambda_i}{2}(t-s)}(t-s) ds\\ &\leq |q^i| \sqrt{\lambda_i} \Big(\frac{c\lambda_i}{2}\Big)^{-2} \big(1-e^{-\frac{c\lambda_i}{2}t} - e^{-\frac{c\lambda_i}{2}t} \frac{c\lambda_i}{2}t \big)\\ &\leq |q^i| \sqrt{\frac{2}{c}} t^{3/2} z_i^{-3/2} [1-e^{-z_i}(1+z_i)], \quad z_i := \frac{c\lambda_i}{2}t\\ &\leq |q^i| \sqrt{\frac{2}{c}} t^{3/2} \sup_{z>0} z^{-3/2} [1-e^{-z}(1+z)]\\ &\leq |q^i| \frac{t^{3/2}}{\sqrt{c}} \end{align*} It follows that \begin{align*} \|p_t-p_t^{(n)}\|_{L^2(\Omega)}^2 &= \sum_{i=1}^{\infty} \lambda_i y^i(t)^2 \leq \sum_{i=1}^{\infty} (q^i)^2 \frac{t^3}{c} = \frac{t^3}{c} \|k*(P_*-P_*^{(n)})\|_{\mathcal{H}}^2 \end{align*} Lemma \ref{lemma. RKHS Monte Carlo rate} implies that with probability $1-\delta$, \begin{align*} \|k*(P_*-P_*^{(n)})\|_{\mathcal{H}}^2 &= \iint k ~d(P_*-P_*^{(n)})^2\\ &\leq \mathbb{E}_{\rho_0(\mathbf{w},b)} \Big[\Big|\int \sigma(\mathbf{w}\cdot\mathbf{x}+b) ~d(P_*-P_*^{(n)})(\mathbf{x}) \Big|^2\Big]\\ &\leq \Big(\frac{4\sqrt{2\log 2d} + \sqrt{2\log (2/\delta)}}{\sqrt{n}}\Big)^2 \end{align*} Hence, \begin{align*} \|p_t-p_t^{(n)}\|_{L^2(\Omega)}^2 &\leq \Big(\frac{4\sqrt{2\log 2d} + \sqrt{2\log (2/\delta)}}{\sqrt{n}}\Big)^2 \frac{t^3}{c} \end{align*} } \end{proof} \begin{proof}[Proof of Theorem \ref{thm. one-time-scale generalization error}] As usual, we bound the generalization error by training error plus generalization gap: \begin{align*} \|p_*-p_t^{(n)}\|_{L^2(\Omega)} \leq \|p_*-p_t\|_{L^2} + \|p_t-p_t^{(n)}\|_{L^2} \end{align*} where we assume the same initialization $p_0 = p_0^{(n)}$ and $a_0 = a_0^{(n)} \equiv 0$. The first term is bounded by Lemma \ref{lemma. one time scale training error} and the second term is bounded by Lemma \ref{lemma. one time scale generalization gap}. Therefore, \begin{align*} \|p_*-p_t^{(n)}\|_{L^2(\Omega)} \leq \frac{\|p_*-p_0\|_{\mathcal{H}}}{\sqrt{ct}} + \frac{4\sqrt{2\log 2d} + \sqrt{2\log (2/\delta)}}{\sqrt{n}} \frac{t^{3/2}}{\sqrt{c}} \end{align*} The proof is completed using Lemma \ref{lemma. W2-L2 bound}. \end{proof} \subsubsection{Proof of memorization} Proposition \ref{prop. memorization one-time-scale} is a corollary of the following lemma. \begin{lemma}[Universal convergence, one-time-scale] \label{lemma. one-time-scale universal convergence} Given any signed measure $\tilde{P} \in \mathcal{M}(\Omega)$, if we define $p_t$ by the dynamics \begin{equation*} \ddot{p}_t = - k * (p_t-\tilde{P}) - c k * \dot{p}_t \end{equation*} with any initialization $p_0 \in L^2(\Omega)$ and $\dot{p}_0 \equiv 0$, then $P_t$ converges weakly to $\tilde{P}$. \end{lemma} \begin{proof} Let $\lambda_i$ and $\tilde{\mathbf{e}}_i$ be the eigendecomposition from Definition \ref{def. RKHS eigendecomposition}. Define $u(t) = k*(P_t-\tilde{P})$ and decompose $u(t)$ into \begin{equation*} u(t) = \sum_{i=1}^{\infty} y^i(t) \tilde{\mathbf{e}}_i \end{equation*} Then, \begin{equation*} \ddot{u} = k*[-k*(p_t-\tilde{P}) - ck*\dot{p}_t] = -k*u - ck*\dot{u} = \sum_{i=1}^{\infty} -\lambda_i (y^i+c\dot{y}^i) \tilde{\mathbf{e}}_i \end{equation*} It follows that \begin{equation*} \forall i, \quad \ddot{y}^i + c\lambda_i \dot{y}^i + \lambda_i y^i = 0 \end{equation*} Using the argument from the proof of Lemma \ref{lemma. one time scale training error}, we obtain \begin{equation*} |y^i(t)| \leq \sqrt{2} |y^i(0)| e^{-\frac{c\lambda_i}{2}t} \end{equation*} Since \begin{equation*} \sum_{i=1}^{\infty} y_i(0)^2 = \|u_0\|_{\mathcal{H}}^2 = \mathbb{E}_{(P_0-\tilde{P})^2}[k] \leq \|P_0-\tilde{P}\|_{\text{TV}}^2 \|k\|_{C(\Omega\times\Omega)} < \infty \end{equation*} we can apply dominated convergence theorem to obtain \begin{equation*} \lim_{t\to\infty} \|u_t\|_{\mathcal{H}}^2 = \lim_{t\to\infty} 2 \sum_{i=1}^{\infty} y^i(0)^2 e^{-c\lambda_i t} = 0 \end{equation*} Thus, $u_t \to 0$ in $\mathcal{H}$, which implies \begin{equation*} \forall f \in \mathcal{H}, \quad \lim_{t\to\infty} \int f ~d(P_t-\tilde{P}) = \lim_{t\to\infty} \langle u_t, ~f\rangle_{\mathcal{H}} = 0 \end{equation*} Since $\mathcal{H}$ is dense in $C(\Omega)$ in the supremum norm, $P_t$ converges weakly to $\tilde{P}$. \end{proof} \subsection{Slow deterioration} \begin{lemma} \label{lemma. Lipschitz optimizer} With any set of $n$ points $\mathbf{x}_i \in \Omega$, \begin{equation*} \sup_{\|D\|_{\text{Lip}} \leq 1} \big|\mathbb{E}_{P_*}[D] - \frac{1}{n}\sum_{i=1}^n D(\mathbf{x}_i)\big| \geq \frac{3}{20} n^{-1/d} \end{equation*} \end{lemma} \begin{proof} By Lemma 3.1 of \cite{e2020kolmogorov}, we have \begin{equation} \label{Lipschitz optimizer lower bound} \sup_{\|D\|_{\text{Lip}} \leq 1} \big|\mathbb{E}_{P_*}[D] - \frac{1}{n}\sum_{i=1}^n D(\mathbf{x}_i)\big| \geq \frac{d}{d+1} \frac{1}{[(d+1)\omega_d]^{1/d}}\frac{1}{\text{diam}(\Omega)} n^{-1/d} \end{equation} where $\omega_d$ is the volume of the unit ball in $\mathbb{R}^d$, \begin{equation*} \omega_d = \frac{\pi^{\frac{d}{2}}}{\Gamma(\frac{d}{2}+1)} \asymp \frac{1}{\sqrt{\pi d}} \Big(\frac{2\pi e}{d}\Big)^{d/2} \end{equation*} Denote the right hand side of (\ref{Lipschitz optimizer lower bound}) by $C_d n^{-1/d}$. By direct computation, $C_d \geq 3/20$. \end{proof} \begin{lemma} \label{lemma. norm growth rate} Given the condition of Proposition \ref{prop. slow deterioration}, we have \begin{equation*} \lim_{t\to\infty} \frac{\|a_t\|_{L^2(\rho_0)}}{\sqrt{t}} = 0 \end{equation*} \end{lemma} \begin{proof} The arguments are adapted from Lemma 3.3 of \cite{wojtowytsch2020convergence}. Define the value \begin{equation*} L_{\infty}^{(n)} = \lim_{t\to\infty} L^{(n)}(a_t) \leq \sup_a L^{(n)} < \infty \end{equation*} which is assumed bounded by Proposition \ref{prop. slow deterioration}. Meanwhile, we also have \begin{align*} \frac{d}{dt}\|a_t\|_{L^2(\rho_0)} &= \big\langle \frac{a_t}{\|a_t\|}, ~\delta_a L^{(n)}(a_t)\big\rangle \leq \|\delta_a L^{(n)}(a_t)\|_{L^2} = \sqrt{\frac{d}{dt} L^{(n)}(a_t)} \end{align*} Thus, for any $t > t_0 \geq 0$, we have \begin{align*} \|a_t\|-\|a_{t_0}\| &\leq \int_{t_0}^t \sqrt{\frac{d}{dt} L^{(n)}(a_s)} ds \leq \sqrt{t-t_0} \sqrt{L^{(n)}(a_t)-L^{(n)}(a_{t_0})}\\ &\leq \sqrt{t-t_0} \sqrt{L^{(n)}_{\infty}-L^{(n)}(a_{t_0})} \end{align*} By choosing $t_0$ sufficiently large, the term $\sqrt{L^{(n)}_{\infty}-L^{(n)}(a_{t_0})}$ can be made arbitrarily small. \end{proof} \begin{proof}[Proof of Proposition \ref{prop. slow deterioration}] Lemma \ref{lemma. RKHS Monte Carlo rate} implies that with probability $1-\delta$, \begin{align*} \forall r > 0, &\quad \sup_{\|D\|_{\mathcal{H}} \leq r} \big|\mathbb{E}_{P_*}[D]-\mathbb{E}_{P_*^{(n)}}[D]\big|\\ &= \sup_{\|a\|_{L^2(\rho_0)} \leq r} \Big| \int \big[\mathbb{E}_{\rho_0}[a(\mathbf{w},b)\sigma(\mathbf{w}\cdot\mathbf{x}+b)] ~d(P_*-P_*^{(n)})(\mathbf{x}) \Big|\\ &\leq \sup_{\|a\|_{L_2(\rho_0)} \leq r} \|a\|_{L^1(\rho_0)} \Big\|[ \int \sigma(\mathbf{w}\cdot\mathbf{x}+b) ~d(P_*-P_*^{(n)})(\mathbf{x}) \Big\|_{L^{\infty}(\rho_0)}\\ &\leq r \Big(4\sqrt{\frac{2\log 2d}{n}} + \sqrt{\frac{2\log (2/\delta)}{n}}\Big) \end{align*} Meanwhile, Lemma \ref{lemma. Lipschitz optimizer} implies that \begin{align*} \|D_t-D_*\|_{L^{\infty}(\Omega)} &\geq \frac{1}{2}\Big|\int D_t-D_* ~d(P_*-P_*^{(n)}) \Big|\\ &\geq \frac{1}{2}\Big(\frac{3}{20}n^{-1/d} - \Big|\int D_t ~d(P_*-P_*^{(n)})\Big|\Big) \end{align*} Combining the two inequalities, we obtain with probability $1-\delta$, \begin{equation} \label{Linf gap via norm} \|D_t-D_*\|_{L^{\infty}(\Omega)} \geq \frac{1}{2}\Big[\frac{3}{20}n^{-1/d} - \|D_t\|_{\mathcal{H}} \Big(4\sqrt{\frac{2\log 2d}{n}} + \sqrt{\frac{2\log (2/\delta)}{n}}\Big)\Big] \end{equation} We conclude the proof by recalling Lemma \ref{lemma. norm growth rate}, which implies that \begin{equation*} \|D_t\|_{\mathcal{H}} = \|a_t\|_{L^2(\rho_0)} = o(\sqrt{t}) \end{equation*} \end{proof} \subsection{Relation between $W_2$ metric and $L^2$ loss} \label{sec. between W2 and L2} Recall that GAN, as well as other generative models, adopts the generator representation for its modeled distribution: \begin{equation*} P = G\#\mathcal{N} := law(X), \quad X = G(Z), \quad Z \sim \mathcal{N} \end{equation*} where $\mathcal{N}$ is some fixed input distribution and $G$ is the generator. Denote by $L^2(\mathcal{N};\mathbb{R}^d)$ the space of $L^2(\mathcal{N})$ functions from $\mathbb{R}^d$ to $\mathbb{R}^d$. Denote by $\mathcal{P}_{ac}(\mathbb{R}^d)$ the space of absolutely continuous probability measures, and by $\mathcal{P}_{2}(\mathbb{R}^d)$ probability measures with finite second moments. The $L^2$ regression loss on $G$ induces the $W_2$ metric on $P$. \begin{proposition} \label{prop. W2 matching} Given any target distribution $P_* \in \mathcal{P}_2(\mathbb{R}^d)$, any input distribution $\mathcal{N} \in \mathcal{P}_{2,ac}(\mathbb{R}^d)$, and any $L^2(\mathcal{N};\mathbb{R}^d)$ function $G$, denote $P = G\#\mathcal{N}$, then \begin{equation} \label{W2 matching} W_2(P,P_*) = \inf_{G_*} \|G-G_*\|_{L^2(\mathcal{N})} \end{equation} where $G_*$ ranges among all $L^2(\mathcal{N};\mathbb{R}^d)$ functions such that $P_* = G_*\#\mathcal{N}$. \end{proposition} \begin{proof} We have $P \in \mathcal{P}_2(\mathbb{R}^d)$ because \begin{equation*} \mathbb{E}_{P}[\|\mathbf{x}\|^2] = \mathbb{E}_{\mathcal{N}}[\|G(\mathbf{x})\|^2] = \|G\|_{L^2(\mathcal{N})}^2 < \infty \end{equation*} The set $\{G_* \in L^2(\mathcal{N};\mathbb{R}^d)~|~G_*\#\mathcal{N}=P_*\}$ is nonempty by Theorem 2.12 of \cite{villani2003topics}, so the right hand side of (\ref{W2 matching}) is well-defined. Furthermore, this term is continuous over $G \in L^2(\mathcal{N};\mathbb{R}^d)$ by triangle inequality. First, consider the simple case when $P \in \mathcal{P}_{2,ac}(\mathbb{R}^d)$. By Theorem 2.12 of \cite{villani2003topics}, there exists an optimal transport map $h$ from $P$ to $P_*$. Then, \begin{equation*} W_2(P,P_*) = \|Id-h\|_{L^2(\mathcal{N})} = \|G-h\circ G\|_{L^2(\mathcal{N})} \end{equation*} It follows that \begin{equation*} W_2(P,P_*) \geq \inf_{G_*\#\mathcal{N}=P_*} \|G-G_*\|_{L^2(\mathcal{N})} \end{equation*} Meanwhile, given any $G_* \in L^2(\mathcal{N};\mathbb{R}^d)$ ($G_*\#\mathcal{N} = P_*$), define a joint distribution by $\pi = (G,G_*)\#\mathcal{N}$, which is a coupling between $P$ and $P_*$. Then, \begin{equation*} W_2(P,P_*) \leq \mathbb{E}_{\pi(\mathbf{x},\mathbf{x}')}[\|\mathbf{x}-\mathbf{x}'\|^2] = \|G-G_*\|_{L^2(\Omega)} \end{equation*} Taking infimum over $G_*$, we obtain (\ref{W2 matching}). Next, for the general case with $P \in \mathcal{P}_2(\mathbb{R}^d)$, define the random variable $Z \sim P$ and an independent random variable $W$ with unit Gaussian distribution. Since $\mathcal{N}$ is absolutely continuous, Theorem 16 from Chapter 15 of \cite{royden1988real} implies that the measure space $(\mathcal{N},\mathbb{R}^d)$ is isomorphic to $[0,1]$ with Lebesgue measure, which is isomorphic to $\mathbb{R}^d$ with the unit Gaussian distribution. Thus, we can consider $W$ as a random variable defined on the measure space $(\mathbb{R}^d,\mathcal{N})$. For any $\epsilon>0$, define \begin{equation*} G_{\epsilon} = G+\epsilon W, \quad P_{\epsilon} = G_{\epsilon}\#\mathcal{N} \end{equation*} As $\epsilon \to 0^+$, the map $G_{\epsilon}$ converges to $G$ in $L^2(\mathcal{N};\mathbb{R}^d)$ and $P_{\epsilon}$ converges to $P$ in $W_2$. Since $P_{\epsilon} \in \mathcal{P}_{2,ac}(\mathbb{R}^d)$, our preceding result implies that \begin{equation*} W_2(P_{\epsilon}, P_*) = \inf_{G_*\#\mathcal{N}=P_*} \|G_{\epsilon}-G_*\|_{L^2(\mathcal{N})} \end{equation*} Taking the limit $\epsilon \to 0^+$, we obtain (\ref{W2 matching}) by continuity. \end{proof} {\color{black} \subsection{Finite-neuron discriminator} \label{sec. finite neurons} Recall that in Remark \ref{remark: finite neurons}, the finite-neuron discriminator is defined by \begin{equation*} D^{(m)}(\mathbf{x}) = \mathbb{E}_{\rho_0^{(m)}(\mathbf{w},b)}\big[a(\mathbf{w},b) \sigma(\mathbf{w}\cdot\mathbf{x}+b)\big], \quad \rho_0^{(m)} = \frac{1}{m} \sum_{j=1}^m \delta_{(\mathbf{w}_j,b_j)}, \quad a(\mathbf{w}_j,b_j) = a_j \end{equation*} The WGAN loss (\ref{WGAN + RKHS}) is modified into \begin{align*} L_D^{(m)}(a) &= \mathbb{E}_{P_*}[D^{(m)}] - \mathbb{E}_P[D^{(m)}] - \|a\|_{L^2(\rho_0^{(m)})}^2\\ &= \frac{1}{m}\sum_{j=1}^m \int a_j \sigma(\mathbf{w}_j\cdot\mathbf{x}+b_j) d(P_*-P)(\mathbf{x}) - \frac{1}{m}\sum_{j=1}^m a_j^2 \end{align*} Then, it is straightforward to check that the loss (\ref{MMD loss}) becomes \begin{equation*} L^{(m)}(P) = \frac{1}{2}\iint k^{(m)} d(P_*-P)^2, \quad L^{(m,n)}(P) = \frac{1}{2}\iint k^{(m)} d(P_*^{(n)}-P)^2 \end{equation*} where the kernel is given by \begin{equation*} k^{(m)}(\mathbf{x},\mathbf{x}') = \mathbb{E}_{\rho_0^{(m)}(\mathbf{w},b)}[\sigma(\mathbf{w}\cdot\mathbf{x}+b)\sigma(\mathbf{w}\cdot\mathbf{x}'+b)] = \frac{1}{m} \sum_{j=1}^m \sigma(\mathbf{w}_j\cdot\mathbf{x}+b_j) \sigma(\mathbf{w}_j\cdot\mathbf{x}'+b_j) \end{equation*} Similar to (\ref{MMD gradient descent}), the training dynamics of the population-loss trajectory $p^{(m)}_t$ and the empirical-loss trajectory $p^{(m,n)}_t$ are given by \begin{align*} \frac{d}{dt} p^{(m)}_t &= k^{(m)} * (P_*-P^{(m)}_t)\\ \frac{d}{dt} p^{(m,n)}_t &= k^{(m)} * (P_*^{(n)}-P^{(m,n)}_t) \end{align*} \begin{lemma} \label{lemma. empirical op gap} With probability $1-\delta$ over the sampling of $\rho_0^{(m)}$, the operator norm of $k-k^{(m)}$ over $L^2(\Omega)$ is bounded by \begin{equation*} \|k-k^{(m)}\|_{op} \leq \frac{2+\sqrt{\log(4/\delta)}/2}{\sqrt{m}} \end{equation*} \end{lemma} \begin{proof} For convenience, denote $\tilde{\mathbf{w}}=(\mathbf{w},b)$ and $\tilde{\mathbf{x}}=(\mathbf{x},1)$. Since $(k-k^{(m)})*$ is a symmetric operator, \begin{align*} \|k-k^{(m)}\|_{op} &= \sup_{\|h\|_{L^2(\Omega)} \leq 1} \big|\langle (k-k^{(m)})*h, h\rangle_{L^2(\Omega)}\big|\\ &= \sup_{\|h\|_{L^2(\Omega)} \leq 1} \Big| \int \Big(\int_{\Omega} h(\mathbf{x}) \sigma(\tilde{\mathbf{w}}\cdot\tilde{\mathbf{x}}) d\mathbf{x}\Big)^2 d(\rho_0-\rho_0^{(m)})(\tilde{\mathbf{w}}) \Big|\\ &= \sup_{f_0 \in \mathcal{F}_0} \Big| \int f_0(\tilde{\mathbf{w}}) d(\rho_0-\rho_0^{(m)})(\tilde{\mathbf{w}}) \Big| \end{align*} where we define the function families \begin{align*} \mathcal{F}_0 &= \Big\{\tilde{\mathbf{w}} \mapsto \big(\int_{\Omega} h(\mathbf{x}) \sigma(\tilde{\mathbf{w}}\cdot\tilde{\mathbf{x}}) d\mathbf{x}\big)^2 ~\Big|~ \|h\|_{L^2(\Omega)} \leq 1\Big\}\\ \mathcal{F}_1 &= \Big\{\tilde{\mathbf{w}} \mapsto \int_{\Omega} h(\mathbf{x}) \sigma(\tilde{\mathbf{w}}\cdot\tilde{\mathbf{x}}) d\mathbf{x} ~\Big|~ \|h\|_{L^2(\Omega)} \leq 1\Big\} \end{align*} Given any set $W = \{\tilde{\mathbf{w}}_j\}_{j=1}^m \subseteq \text{sprt} \rho_0$, the Rademacher complexity is defined as \begin{equation*} Rad_m(\mathcal{F} \circ W) = \frac{1}{m} \mathbb{E}_{\mathbf{\xi} \in \{\pm 1\}^m}\Big[\sup_{f\in\mathcal{F}} \sum_{j=1}^m \xi_j f(\tilde{\mathbf{w}}_j)\Big] \end{equation*} where $\xi_j$ are i.i.d. random variables with a uniform distribution over $\{\pm 1\}$. Recall that $\sigma$ is ReLU, $\Omega = [0,1]^d$ and $\text{sprt} \rho_0 \subseteq \{\|\tilde{\mathbf{w}}\|_1 \leq 1\} \subseteq \mathbb{R}^{d+1}$. It follows that \begin{equation*} \sup_{\tilde{\mathbf{w}} \in W} \sup_{f_1 \in \mathcal{F}_1} |f_1(\tilde{\mathbf{w}})| \leq \sup_{\tilde{\mathbf{w}} \in \text{sprt}\rho_0} \sup_{\mathbf{x}\in\Omega} |\sigma(\tilde{\mathbf{w}}\cdot\tilde{\mathbf{x}})| \leq 1 \end{equation*} Thus the contraction property of $Rad_m$ (Lemma 26.9 \cite{shalev2014understanding}) implies that \begin{equation*} Rad_m(\mathcal{F}_0 \circ W) \leq Rad_m(\mathcal{F}_1 \circ W) \end{equation*} Meanwhile, by Jensen's inequality \begin{align*} Rad_m(\mathcal{F}_1 \circ W) &= \frac{1}{m} \mathbb{E}_{\mathbf{\xi} \in \{\pm 1\}^m}\Big[\sup_{\|h\|_{L^2(\Omega)} \leq 1} \sum_{j=1}^m \xi_j \int_{\Omega} h(\mathbf{x}) \sigma(\tilde{\mathbf{w}}_j \cdot \tilde{\mathbf{x}})\Big]\\ &= \frac{1}{m} \mathbb{E}_{\mathbf{\xi} \in \{\pm 1\}^m}\Big[\sup_{\|h\|_{L^2(\Omega)} \leq 1} \int_{\Omega} h(\mathbf{x}) \sum_{j=1}^m \xi_j \sigma(\tilde{\mathbf{w}}_j \cdot \tilde{\mathbf{x}})\Big]\\ &\leq \frac{1}{m} \mathbb{E}_{\mathbf{\xi} \in \{\pm 1\}^m}\Big[\big\|\sum_{j=1}^m \xi_j \sigma(\tilde{\mathbf{w}}_j \cdot \tilde{\mathbf{x}})\big\|_{L^2(\Omega)}\Big]\\ &\leq \frac{1}{m} \Big(\mathbb{E}_{\mathbf{\xi} \in \{\pm 1\}^m}\Big[\big\|\sum_{j=1}^m \xi_j \sigma(\tilde{\mathbf{w}}_j \cdot \tilde{\mathbf{x}})\big\|_{L^2(\Omega)}^2\Big] \Big)^{1/2}\\ &= \frac{1}{m} \Big(\mathbb{E}_{\mathbf{\xi} \in \{\pm 1\}^m}\Big[ \int_{\Omega} \sum_{j=1}^m\sum_{l=1}^m \xi_j \xi_l \sigma(\tilde{\mathbf{w}}_j \cdot \tilde{\mathbf{x}}) \sigma(\tilde{\mathbf{w}}_l \cdot \tilde{\mathbf{x}}) \Big] \Big)^{1/2}\\ &= \frac{1}{m} \Big(\int_{\Omega} \sum_{j=1}^m \sigma(\tilde{\mathbf{w}}_j \cdot \tilde{\mathbf{x}})^2 \Big)^{1/2}\\ &\leq \frac{1}{m} \Big(\int_{\Omega} \sum_{j=1}^m 1 \Big)^{1/2}\\ &\leq \frac{1}{\sqrt{m}} \end{align*} Since the calculations hold for any subset $W$, we have \begin{equation*} \sup \big\{ Rad_m(\mathcal{F}_0 \circ W) ~\big|~ W=\{\tilde{\mathbf{w}}_j\}_{j=1}^m \subseteq \text{sprt}\rho_0 \big\} \leq \frac{1}{\sqrt{m}} \end{equation*} Note that for all $f_0 \in \mathcal{F}_0$, the function $f_0$ ranges in $[0,1]$. Then, Theorem 26.5 of \cite{shalev2014understanding} implies that with probability $1-\delta$ over the sampling of $\rho_0^{(m)}$, \begin{align*} &\quad \sup_{f_0 \in \mathcal{F}_0} \int f_0(\tilde{\mathbf{w}}) d(\rho_0-\rho_0^{(m)})(\tilde{\mathbf{w}})\\ &\leq 2 \mathbb{E}\big[Rad_m(\mathcal{F}_0 \circ W) ~\big|~ (\tilde{\mathbf{w}}_1, \dots \tilde{\mathbf{w}}_m) \sim \rho_0^m\big] + \sqrt{\frac{\log(2/\delta)}{2m}}\\ &\leq 2 \sup \big\{ Rad_m(\mathcal{F}_0 \circ W) ~\big|~ W=(\tilde{\mathbf{w}}_1, \dots \tilde{\mathbf{w}}_m) \subseteq \text{sprt}\rho_0 \big\} + \sqrt{\frac{\log(2/\delta)}{2m}}\\ &\leq \frac{2+\sqrt{\log(2/\delta)/2}}{\sqrt{m}} \end{align*} Applying the same argument to the function family $\{-f_0|f_0\in\mathcal{F}_0\}$, we obtain that with probability $1-2\delta$, \begin{equation*} \sup_{f_0 \in \mathcal{F}_0} \Big|\int f_0(\tilde{\mathbf{w}}) d(\rho_0-\rho_0^{(m)})\Big| \leq \frac{2+\sqrt{\log(2/\delta)/2}}{\sqrt{m}} \end{equation*} which concludes the proof. \end{proof} It remains to compare the training dynamics of $p_t$ and $p^{(m)}_t$: \begin{align*} \frac{d}{dt} \|p_t-p^{(m)}_t\|_{L^2(\Omega)} &= \big\langle \frac{p_t-p^{(m)}_t}{\|p_t-p^{(m)}_t\|}, ~k*(p_*-p_t) - k^{(m)} * (p_*-p^{(m)}_t) \big\rangle\\ &= \big\langle \frac{p_t-p^{(m)}_t}{\|p_t-p^{(m)}_t\|}, ~(k-k^{(m)}) * (p_*-p_t) - k^{(m)}*(p_t-p^{(m)}_t)\big\rangle\\ &\leq \big\langle \frac{p_t-p^{(m)}_t}{\|p_t-p^{(m)}_t\|}, ~(k-k^{(m)}) * (p_*-p_t) \big\rangle\\ &\leq \|k-k^{(m)}\|_{op} \|p_*-p_t\|_{L^2(\Omega)}\\ &\leq \|k-k^{(m)}\|_{op} \frac{\|p_*-p_0\|_{\mathcal{H}}}{\sqrt{t}} \end{align*} with the last step given by Lemma \ref{lemma. training error}. Then, Lemma \ref{lemma. empirical op gap} implies that with probability $1-\delta$, \begin{align*} \|p_t-p^{(m)}_t\|_{L^2(\Omega)} &\leq 2\sqrt{t} \|p_*-p_0\|_{\mathcal{H}} \|k-k^{(m)}\|_{op}\\ &\leq \|p_*-p_0\|_{\mathcal{H}} \frac{4+\sqrt{2\log(4/\delta)}}{\sqrt{m}} \sqrt{t} \end{align*} Moreover, it is straightforward to check that the proof of inequality (\ref{L2 generalization gap}) continues to hold if the kernel $k$ is replaced by $k^{(m)}$, so that (\ref{L2 generalization gap}) can be directly modified into \begin{equation*} \|p^{(m)}_t-p^{(m,n)}_t\|_{L^2} \leq \frac{4\sqrt{2\log 2d} + \sqrt{2\log (2/\delta)}}{\sqrt{n}}t \end{equation*} Hence, we can conclude with Lemma \ref{lemma. training error} that, with probability $1-2\delta$, \begin{align*} \|p_*-p^{(m,n)}_t\|_{L^2(\Omega)} &\leq \|p_*-p_t\|_{L^2} + \|p_t-p^{(m)}_t\|_{L^2} + \|p^{(m)}_t-p^{(m,n)}_t\|_{L^2}\\ &\leq \frac{\|p_*-p_0\|_{\mathcal{H}}}{\sqrt{t}} + \frac{\|p_*-p_0\|_{\mathcal{H}} \big[4+\sqrt{2\log(4/\delta)}\big]}{\sqrt{m}} \sqrt{t} + \frac{4\sqrt{2\log 2d} + \sqrt{2\log (2/\delta)}}{\sqrt{n}}t \end{align*} Then, Remark \ref{remark: finite neurons} follows from Lemma \ref{lemma. W2-L2 bound}. \subsection{Gradient analysis for the generator} This subsection provides the details of the calculation in Section \ref{sec. the generator}. First, to derive the formula \begin{equation*} \frac{\delta L}{\delta G} = \nabla_{\mathbf{x}} \frac{\delta L}{\delta P} \circ G \end{equation*} one simply note that for any perturbation $h \in L^2(\mathcal{N};\mathbb{R}^d)$ \begin{align*} \Big\langle h, \frac{\delta L}{\delta G} \Big\rangle_{L^2(\mathcal{N})} &= \lim_{\epsilon \to 0} \frac{L((G+\epsilon h)\#\mathcal{N}) - L(G\#\mathcal{N})}{\epsilon}\\ &= \lim_{\epsilon \to 0} \int \frac{\delta L}{\delta P}\Big|_{P=G\#\mathcal{N}} ~\text{d} \frac{(G+\epsilon h)\#\mathcal{N} - G\#\mathcal{N}}{\epsilon}\\ &= \lim_{\epsilon \to 0} \int \frac{1}{\epsilon} \Big[ \frac{\delta L}{\delta P}(G+\epsilon h) - \frac{\delta L}{\delta P}(G) \Big] \text{d}\mathcal{N}\\ &= \int \nabla_{\mathbf{x}} \frac{\delta L}{\delta P}(G) \cdot h ~\text{d}\mathcal{N}\\ &= \Big\langle h, \nabla_{\mathbf{x}} \frac{\delta L}{\delta P} \circ G \Big\rangle_{L^2(\mathcal{N})} \end{align*} Next, we try to bound the norm of the following term \begin{align*} \frac{\delta L}{\delta G}-\frac{\delta L^{(n)}}{\delta G} &= \nabla_{\mathbf{x}} \Big(\frac{\delta L}{\delta P} - \frac{\delta L^{(n)}}{\delta P}\Big) \circ G = \nabla_1 k * (P_*-P_*^{(n)}) \circ G \end{align*} where $\nabla_1$ means taking the gradient in the first entry of $k$. Note that \begin{align*} \|\nabla_1 k * (P_*-P_*^{(n)}) \circ G\|_{L^2(\mathcal{N})} &= \|\nabla_1 k * (P_*-P_*^{(n)})\|_{L^2(P)}\\ &= \Big\| \mathbb{E}_{\rho_0(\mathbf{w},b)} \big[ \nabla_{\mathbf{x}} \sigma(\mathbf{w}\cdot\mathbf{x}+b) \int \sigma(\mathbf{w}\cdot\mathbf{x}'+b) d(P_*-P_*^{(n)})\big] \Big\|_{L^2(P)}\\ &\leq \sup_{\mathbf{w},b \in \text{sprt} \rho_0} \Big| \|\mathbf{w}\|_2 \|\sigma\|_{Lip} \int \sigma(\mathbf{w}\cdot\mathbf{x}'+b) d(P_*-P_*^{(n)}) \Big|\\ &\leq \sup_{\|\mathbf{w}\|_1 + |b| \leq 1} \Big| \int \sigma(\mathbf{w}\cdot\mathbf{x}'+b) d(P_*-P_*^{(n)}) \Big| \end{align*} Then, Lemma \ref{lemma. RKHS Monte Carlo rate} implies that with probability $1-\delta$, \begin{equation*} \Big\| \frac{\delta L}{\delta G}-\frac{\delta L^{(n)}}{\delta G} \Big\|_{L^2(\mathcal{N})} \leq \frac{4\sqrt{2\log 2d} + \sqrt{2\log (2/\delta)}}{\sqrt{n}} \end{equation*} } \section{Discussion} \label{sec. discussion} Let us conclude with some of the insights obtained in this paper: \begin{itemize} \item Good generalization is achievable in high dimensions by early stopping and the error estimate escapes from the curse of dimensionality, whereas in the long term ($t\to\infty$), the trained distribution slowly deteriorates to the empirical distribution and exhibits memorization. This is an implicit regularization result, such that the progress toward $P_*$ and the deterioration due to $P_*-P_*^{(n)}$ occur on two time scales. \item The mechanism for generalization is the dimension-independent complexity of the function representation of the discriminator, which in our setting is the Rademacher complexity of random feature functions. It renders the loss landscape insensitive to the sampling error $P_*-P_*^{(n)}$, and thereby delays the onset of memorization. Our hardness of learning result for WGAN also follows from this small complexity. \item The regularization $R(D)$ is crucial for establishing the convergence of training. As demonstrated by the proof of Theorem \ref{thm. one-time-scale generalization error}, the role of $R(D)$ is to introduce ``friction" into the min-max training of $P_t$ and $D_t$ and dampens their oscillatory dynamics. Furthermore, Theorem \ref{thm. generalization error} demonstrates that regularizations on parameters may perform better than regularizations on function value. The former imposes a tighter control on the complexity of the discriminator, and thus the growth of the generalization gap is slower. Beyond the RKHS norm (\ref{RKHS norm}), one can also consider the spectral norm \cite{miyato2018spectral} or the Barron norm and flow-induced norm \cite{e2021barron}. \end{itemize} Finally, we discuss several possible directions for future research. {\color{black} \subsection{The generator} \label{sec. the generator} So far this paper has focused on analyzing the discriminator with the generator omitted. Here we show that part of our proof of generalization can be extended to the ordinary GAN with a generator. One key step in our argument is the comparison of the landscapes of the population loss $L$ and the empirical loss $L^{(n)}$: For any finite measure $P$, with high probability, we can compare the variational derivatives \begin{equation*} \Big\|\frac{\delta L}{\delta P} - \frac{\delta L^{(n)}}{\delta P}\Big\|_{L^2(\Omega)} = \|k*(P_*-P_*^{(n)})\| = O(n^{-1/2}) \end{equation*} (See the proof of Proposition \ref{prop. generalization gap} for more details.) It is this closeness between the two derivatives that eventually leads to the estimate of the generalization gap. For the ordinary GAN, the loss becomes $L(P), P=G\#\mathcal{N}$, where $\mathcal{N}$ is some input distribution such as the unit Gaussian. The variational gradient of the generator $G$ over $L^2(\mathcal{N};\mathbb{R}^d)$ is simply \begin{equation*} \frac{\delta L}{\delta G} = \nabla_{\mathbf{x}} \frac{\delta L}{\delta P} \circ G \end{equation*} It follows that the population loss and empirical loss landscapes differ by \begin{align*} \Big\|\frac{\delta L}{\delta G}-\frac{\delta L^{(n)}}{\delta G}\Big\|_{L^2(\mathcal{N})} &= \Big\|\nabla_{\mathbf{x}} \Big(\frac{\delta L}{\delta P} - \frac{\delta L^{(n)}}{\delta P}\Big) \circ G\Big\|_{L^2(\mathcal{N})}\\ &= \|\nabla_1 k * (P_*-P_*^{(n)}) \|_{L^2(P)}\\ &= O(n^{-1/2}) \end{align*} (See Section 6.5 for more details.) Then, one can conclude heuristically that the generalization gap for the ordinary GAN should also scale as $O(t/\sqrt{n})$. Nevertheless, the gap between this heuristic argument and a rigorous proof is that the loss landscape for $G$ is generally nonconvex, so the proof routines in Sections 6.1.1 and 6.1.2 need to be modified. \subsection{Wasserstein gradient flow} \label{sec. Wasserstein gradient flow} As discussed in Section \ref{sec. distribution representation}, the distribution $P$ is modeled as a density function in order to remove any parametrization in the generator. Its training depends on the linear topology of $\mathcal{P}(\Omega)$, such that the density function $p_t$ is updated vertically (\ref{MMD gradient descent}, \ref{MMD projected gradient descent}). However, to better capture the training of GAN (and generative models in general), one can try to use horizontal updates: Consider the distribution $P_t = G_t \# \mathcal{N}$, where $G_t$ is the generator during training, then the trajectory $P_{[0,T]}$ can be seen as a random smooth path \begin{equation*} P_{[0,T]} = law(\mathbf{x}_{[0,T]}), \quad \mathbf{x}_{[0,T]} = G_{[0,T]}(\mathbf{z}) \in C^1([0,T]\to\mathbb{R}^d), \quad \mathbf{z} \sim \mathcal{N} \end{equation*} In particular, $P_t$ satisfies the conservation of local mass, unlike the vertical updates that teleport mass. One natural way to perform horizontal updates without any parametrization in $G$ is to use the Wasserstein gradient flow \begin{equation*} \partial_t P_t = \nabla\cdot\Big(P_t\nabla\frac{\delta L(P_t)}{\delta P}\Big) = \nabla \cdot\big(P_t \nabla k*(P_t-P_*)\big) \end{equation*} One can try to bound its generalization gap as in Proposition \ref{prop. generalization gap}. \begin{conjecture} Let $P_t,P_t^{(n)}$ be the population-loss trajectory and empirical-loss trajectory. Then, for any $\delta \in (0,1)$, with probability $1-\delta$ over the sampling of $P_*^{(n)}$, \begin{equation*} W_2(P_t,P_t^{(n)}) \lesssim \frac{\sqrt{\log d}+\sqrt{\log 1/\delta}}{\sqrt{n}} t \end{equation*} \end{conjecture} The difficulty for horizontal updates is that one typically needs geodesic convexity in $W_2$ space, which is not known to hold for any of the GAN losses. For instance, the geodesic nonconvexity of the MMD metric (\ref{MMD loss}) has been analyzed in \cite{arbel2019maximum}. } \subsection{Sophisticated discriminators} Instead of the WGAN loss with random feature functions, one can study more general set-ups with diverse losses and discriminators. For the function representation of $D$, ideally one would like to consider any family $\mathcal{D}$ whose Rademacher complexity scales as $O(n^{-1/2})$. Examples include 2-layer networks with bounded Barron norm \cite{e2021barron}, deep residual networks with bounded flow-induced norm \cite{e2021barron} and multilayer networks with bounded path norm \cite{e2020banach}. For the training loss, one can consider the classical GAN loss \cite{goodfellow2014generative}, the $f$-GAN loss \cite{nowozin2016f}, the energy-based GAN loss \cite{zhao2016energy}, the least-square GAN loss \cite{mao2018effectiveness}, and any other losses defined as the dual over a discriminator family $\mathcal{D}$. {\color{black} Then, one can try to extend the generalization gap from Proposition \ref{prop. generalization gap} to these settings. The added difficulty, however, is that one no longer has a close-form formula for the dynamics of $p_t$ as in (\ref{MMD gradient descent}), making the comparison of the trajectories over the population loss and empirical loss less explicit. } \subsection{Slower deterioration} A shortcoming of Proposition \ref{prop. slow deterioration} is that its proof (in particular, inequality (\ref{Linf gap via norm})) does not utilize the fact that the discriminator $D_t$ during training has bounded Lipschitz norm \begin{equation*} \forall t > 0, \quad \|D_t\|_{\text{Lip}} \lesssim 1 \end{equation*} It seems reasonable that a more refined analysis would lead to a much stronger lower bound. For instance, one might conjecture that with probability $1-\delta$, \begin{equation*} \inf_D\big\{\|\nabla D-\nabla D_*\|_{L^2(\Omega)} ~\big|~ \|D\|_{\mathcal{H}} \leq R, ~\|D\|_{\text{Lip}} \leq 1\big\} \gtrsim \delta^{\frac{1}{nd}} R^{-\frac{2}{d-2}} n^{-\frac{1}{d}} - \frac{\sqrt{\log 2d} + \sqrt{\log 2/\delta}}{\sqrt{n}} \end{equation*} The exponent $\frac{2}{d-2}$ comes from Corollary 3.4 of \cite{e2020kolmogorov}, and we estimate $\|\nabla D-\nabla D_*\|$ because it is the gradient field $\nabla D_t$ that drives the distribution during GAN training. Then, Lemma \ref{lemma. norm growth rate} implies that it would take at least $n^{\Omega(d^2)}$ amount of time for $D_t$ to learn $D_*$. \section*{Conflict of Interest} On behalf of all authors, the corresponding author states that there is no conflict of interest.
\section{Introduction} Supersymmetric quantum field theories (SQFT) with a least eight supercharges are particularly amenable to exact, non-perturbative methods. The infrared (IR) physics on the Coulomb branch (CB) of 4d $\mathcal{N}=2$ supersymmetric field theories, in particular, is famously encoded in a Seiberg-Witten (SW) geometry \cite{Seiberg:1994rs, Seiberg:1994aj}. For 4d $\mathcal{N}=2$ field theories of rank one -- that is, when the Coulomb branch is one dimensional -- the SW geometry consists of an elliptic fibration over the Coulomb branch, and the effective gauge coupling for the low-energy $U(1)$ vector multiplet is identified with the modular parameter of the elliptic fiber. The original SW geometries for $SU(2)$ gauge theories were derived based on the semi-classical analysis and on deep physical intuition. Once the SW geometry of a 4d $\mathcal{N}=2$ theory is given to us, on the other hand, we can gain further insights into strong-coupling phenomena by analysing the SW geometry throughout its full parameter space. The Argyres-Douglas (AD) superconformal field theories (SCFTs) were discovered in that way on the Coulomb branch of 4d gauge theories~\cite{Argyres:1995jj, Argyres:1995xn}. Postulating the existence of other SW geometries with more complicated singularities also led to the discovery of 4d SCFTs with $E_n$ global symmetry, the Minahan-Nemeschansky (MN) theories \cite{Minahan:1996fg,Minahan:1996cj}. All these `classic' rank-one 4d $\mathcal{N}=2$ field theories can be understood within the framework of geometric engineering% \footnote{Of course, there are also methods for `engineering' these theories on D-branes or M5-branes -- see {\it e.g.} \protect\cite{Witten:1997sc, Gaiotto:2009we}. We will focus on the `purely geometric' string-theory engineering. } in Type-IIA string theory on local Calabi-Yau threefold singularities~\cite{Bershadsky:1996nh, Katz:1996fh}, with an interesting plot twist: from that particular string-theory point of view, the `most natural' rank-one theories are not these `ordinary' 4d $\mathcal{N}=2$ SQFTs. Instead they are {\it five-dimensional} field theories compactified on a circle. This fact is true for IIA geometric engineering of $\mathcal{N}=2$ SQFTs of any rank, since it is a simple consequence of the Type-IIA/M-theory duality \cite{Ganor:1996pc, Lawrence:1997jr}. At rank one, one can obtain in this way a small family of 5d SCFTs with $E_n$ symmetry \cite{Seiberg:1996bd, Morrison:1996xf}, which we will often call `the $E_n$ theories'. Their circle compactification gives us 4d $\mathcal{N}=2$ supersymmetric field theories `of Kaluza-Klein (KK) type' -- intuitively speaking, with an infinite number of `fields' organised in KK towers --, which we denote by $D_{S^1} E_n$. The 5d $E_n$ theories are all related by mass deformations, starting from the $E_8$ theory and mass-deforming to smaller $E_n$ subgroups. The 5d $E_8$ theory itself can be obtained as a deformation of the so-called $E$-string theory \cite{Ganor:1996mu}, which is a 6d $\mathcal{N}=(1,0)$ SCFT with $E_8$ symmetry, compactified on a circle. Similarly, the 4d MN theories naturally arise as subsectors of the $D_{S^1} E_n$ theories for $n=6,7,8$. By taking the so-called geometric-engineering limit \cite{Katz:1996fh} on the Type-IIA complexified K\"ahler parameters, one obtains the ordinary 4d $\mathcal{N}=2$ $SU(2)$ gauge theories with $N_f\leq 4$ flavours as a limit of the $D_{S^1} E_n$ theories with $n=N_f+1$. In this work, we revisit the Seiberg-Witten geometries of all these `classic' rank-one theories, with our main focus being on $D_{S^1} E_n$, the circle compactifications of the 5d $E_n$ SCFTs. Their SW curves are best understood in terms of local mirror symmetry in string theory \cite{Aspinwall:1993xz, Klemm:1996bj, Chiang:1999tz, Nekrasov:1996cz, Ganor:1996pc, Lerche:1996ni, Katz:1997eq, Lawrence:1997jr, Hori:2000kt, Hori:2000ck, Eguchi:2002fc}. We provide a detailed analysis of their Coulomb branches by a variety of methods, including: by a direct analysis of the electromagnetic periods $a$, $a_D$ using Picard-Fuchs equations; by a global analysis using the mathematical language of rational elliptic surfaces; by taking advantage of the beautiful modular properties that exist in many special cases. The main upshot of our analysis is threefold: \begin{itemize} \item We reach a systematic understanding of the possible CB configurations in all cases, including a classification of the Argyres-Douglas points that can arise. Part of the original motivation for this endeavour was to understand some RG flows between the 5d $E_n$ theories and Argyres-Douglas theories, whose existence was implied by the recent work of Bonelli, Del Monte and Tanzini \cite{Bonelli:2020dcp} relating some 5d BPS quivers~\cite{Closset:2019juk} to the gauge/Painlev\'e correspondence \cite{Bonelli:2016idi, Bonelli:2016qwg, Bonelli:2017gdk}. The most striking of such RG flows may be: \be D_{S^1} E_3 \rightarrow H_2~, \end{equation} where $H_2$ is the AD theory with flavour symmetry algebra $\frak{su}(3)$. The reason why this flow may look surprising is that $H_2$ appears on the CB of 4d $SU(2)$ with $N_f=3$ flavours~\cite{Argyres:1995xn} while the $E_3$ theory is related to 5d $SU(2)$ with $N_f=2$. In hindsight, this is not too disturbing, since the AD points arise in the strong-coupling region of the Coulomb branch. In this example, the $\frak{su}(3)$ flavour symmetry of $H_2$ in inherited from the symmetry $E_3= \frak{su}(3)\oplus \frak{su}(2)$ of the larger theory, which arises due to `infinite-coupling effects' from the 5d gauge theory point of view and is related to the condensation of instanton particles -- see {\it e.g.} \cite{Cremonesi:2015lsa}. As we will see explicitly, the AD points are ubiquitous on the extended Coulomb branch of the $D_{S^1} E_n$ theories as we tune the mass parameters. For instance, one can show that there are exactly 35 distinct CB configurations of the $D_{S^1} E_8$ theory with at least one $H_2$ AD point (33 configurations have one such point, 2 configurations have 2 distinct $H_2$ points). \item We explain how to determine the global symmetry of the rank-one SQFTs directly from the SW geometry itself. The SW geometry is an elliptic fibration with a distinguished section (the zero section), and it can have a non-trivial Mordell-Weil (MW) group. Firstly, we show that the free generators of the MW group correspond to abelian factors of the flavour symmetry group $G_F$. Secondly, we argue that the precise form of the flavour symmetry {\it group} (as opposed to its Lie algebra) is determined by the torsion part of the MW group. Thirdly and relatedly, we conjecture that the one-form symmetry of the theory \cite{Gaiotto:2014kfa} is also encoded in the MW torsion in a specific way.\footnote{Our precise findings differ from the discussion of one-form symmetries in appendix A of \protect\cite{Caorsi:2019vex}.} For the 5d and 4d $E_n$ theories, our derivation of the flavour symmetry group from the 4d infrared confirms the recent results in \cite{Apruzzi:2021vcu} and \cite{Bhardwaj:2021ojs}, respectively. Interestingly, our analysis also implies that the flavour symmetry group for the AD theories $H_1$ and $H_2$ is $SO(3)= SU(2)/\mathbb{Z}_2$ and $PSU(3)=SU(3)/\mathbb{Z}_3$, respectively -- for $H_1$, this was recently argued in~\cite{Buican:2021xhs}, while for $H_2$ this seems to be a new observation. \item Throughout our analysis, we emphasise the key role played by modularity, especially in the case of the massless $E_n$ theories on a circle. For all the massless $D_{S^1} E_n$ theories with $n<8$ and a semi-simple flavour symmetry algebra, the Coulomb branch is actually a modular curve $\mathbb{H}/ \Gamma$ for a finite-index subgroup $\Gamma \subset {\rm PSL}(2, \mathbb{Z})$ -- see table~\ref{tab:introMod} below. This is similar to the role played by the congruence subgroup $\Gamma^0(4)$ for the pure $SU(2)$ gauge theory~\cite{Seiberg:1994aj}, for instance. Somewhat relatedly, we also discuss the gravitational couplings $A(U)$ and $B(U)$ on the Coulomb branch of the $D_{S^1} E_n$ theories (in the so-called toric case), which gives a 5d generalisation of the same computation for the 4d $SU(2)$ gauge theories in~\cite{Manschot:2019pog}. These considerations are very important for the computation of supersymmetric partition functions as in {\it e.g.} \cite{Moore:1997pc, Losev:1997tp, Manschot:2021qqe}, as we will discuss elsewhere~\cite{toappear2021}. \end{itemize} \noindent In the rest of this introduction, we explain in more detail our general picture and our new results. We also discuss how our approach relates to the vast previous literature, and we emphasise unresolved issues and challenges for future work. \subsection*{The $U$-plane, CB configurations and rational elliptic surfaces} The one-dimensional Coulomb branch of the $D_{S^1} E_n$ theory is parameterised by a single complex parameter: \be U= \langle W \rangle~, \end{equation} which is the expectation value of a five-dimensional $\mathcal{N}=1$ supersymmetric `Wilson loop' operator wrapping the circle. (More precisely, when the 5d $E_n$ theory is mass-deformed to a 5d $SU(2)$ gauge theory with $N_f=n-1$ flavours, the operator $W$ flows to the fundamental Wilson loop.) Our main object, in this paper, is to understand the $U$-plane physics as thoroughly as we can -- we would like to explore the Coulomb branch `as pedestrians' \cite{Tachikawa:2013kta}, as it were. When studying 4d $\mathcal{N}=2$ and 5d $\mathcal{N}=1$ supersymmetric quantum field theories, one can gain invaluable insight by embedding these field theories within string theory. In fact, in the five-dimensional case, a definition of the 5d field theory via string theory is so-far unavoidable. In string-theory approaches to SQFT, many features of the field theory become `geometrised'. In the case at hand, the Seiberg-Witten geometry of 4d $\mathcal{N}=2$ field theories can be understood in terms of local mirror symmetry \cite{Katz:1997eq}: \be\label{IIAIIBmirr} \text{Type IIA on}\; \;\mathbb{R}^4 \times \widetilde \MG \qquad \longleftrightarrow \qquad \text{Type IIB on}\; \;\mathbb{R}^4 \times \widehat {\bf Y}~. \end{equation} Here, $\widetilde \MG$ will be the local $dP_n$ (or $\mathbb{F}_0$) geometry, {\it i.e.} the total space of the canonical line bundle over a del Pezzo surface of degree $9-n$ -- see {\it e.g.} \cite{Morrison:1996xf, Douglas:1996xp, Lerche:1996ni, Intriligator:1997pq, Lawrence:1997jr, Eguchi:2000fv}. This geometrically engineers the $D_{S^1} E_n$ theories for $n\leq 8$. (For $n=9$, this engineers the $E$-string theory on $T^2$.) The local mirror threefold in Type IIB, $\widehat {\bf Y}$, can be viewed as the suspension of an elliptic curve, which is precisely the SW curve of the $D_{S^1} E_n$ theory. Any rank-one SW geometry is given by a family of elliptic curves over the $U$-plane. (For strictly 4d theories, we should call it `the $u$-plane' instead, following standard terminology.) This can always be written in Weierstrass normal form: \be y^2 = 4 x^3 - g_2(U; {M_F}) x- g_3(U; {M_F})~, \end{equation} where ${M_F}$ denotes all the mass parameters. At fixed ${M_F}$, the total space of the elliptic fibration over the $U$-plane can be viewed as a {\it rational elliptic surface}, $\mathcal{S}$, by compactifying the point at infinity: \be E \rightarrow \mathcal{S} \rightarrow \mathbb{P}^1\cong \{ U \}~. \end{equation} For all the 5d and 4d theories, the SW fibration is singular at $U=\infty$, while the point at infinity is regular for the $E$-string compactified on $T^2$. \begin{table}[] \renewcommand{\arraystretch}{1.4} \begin{center} \begin{tabular}{ |c||c|c|c|c|c|c|c|c|c|} \hline $F_\infty$ &$I_{1}$ &$I_{2}$ &$I_{3}$ &$I_{4}$ &$I_5$& $I_6$& $I_7$& $I_8$ & $I_9$ \\ \hline $D_{S^1} \mathcal{T}_{\rm 5d}$ & \; $E_8$\; & \; $E_7$ \; & \; $E_6$ \; & \;$E_5$\; & $E_4$ & $E_3$ & $E_2$ & $E_1$ \text{or} $\widetilde E_1$ & $E_0$ \\ $\#\mathcal{S}$ & \; $227$\; & \; $140$ \; & \; $77$ \; & \;$51$\; & $26$ & $16$ & $6$ & $2+2$ & $1$ \\ \hline \hline $F_\infty$ &$II$ &$III$ &$IV$ &$I_0^\ast$&$I_1^\ast$&$I_2^\ast$&$I_3^\ast$ &$I_4^\ast$ & \\ \hline $ \mathcal{T}_{\rm 4d}$ & \; $E_8$\; & $E_7$ & $E_6$ & $D_4$ & $D_3$ & $D_2$ & $N_f=1$ & $N_f=0$ & \\ % $\#\mathcal{S}$ & \; $137$\; & $93$ & $49$ & $19$ & $13$ & $6$ & $2$ & $1$ & \\ \hline \hline $F_\infty$ & & & & &$IV^\ast$& $III^\ast$& $II^\ast$ & & \\ \hline $ \mathcal{T}_{\rm 4d}$ & & & & &$A_2\; (H_2)$ & $A_1\; (H_1)$ & $-\; (H_0)$ & & \\ % $\#\mathcal{S}$ & & & & &$8$ & $4$ & $2$ & & \\ \hline \end{tabular} \end{center} \caption{Correspondence between the singular fiber at infinity and the 5d and 4d theories. The field theories are denoted by their flavour symmetry algebra, except for the $SU(2)$ gauge theory with $N_f=1$ and $N_f=0$ flavours (denoted by $N_f=1$ and $N_f=0$, respectively). Thus, $D_{N_f}$ denotes the $SU(2)$ theory with $N_f$ flavours. The bottom line corresponds to the 3 AD theories $H_{N_f-1}$, which can be found on the CB of the $SU(2)$, $N_f>0$ gauge theory for $N_f=1,2,3$. We also give the number of distinct CB configurations, $\#\mathcal{S}$, in each case.} \label{tab:intro1} \end{table} Rational elliptic surfaces (RES) have been very thoroughly studied by mathematicians -- see~\cite{schuttshioda} for a beautiful and detailed introduction. In particular, they were fully classified by Persson and Miranda over 30 years ago \cite{Miranda:1986ex, Persson:1990, Miranda:1990}. A RES $\mathcal{S}$ is partially characterised by its set of singular fibers, $\{F_v\}$.% \footnote{It is fully characterised by $\{F_v\}$ and $\Phi$, its Mordell-Weil group, to be discussed below.} The possible singular fibers are given by the Kodaira classification, which is closely related to the ADE classification of simply-laced Lie algebras. In our physical setup, the singularity type of the fiber at infinity, $F_\infty$, essentially determines the field theory. All the theories studied in this work appear in table~\ref{tab:intro1}. In particular, the $D_{S^1} E_n$ theories are characterised by $F_\infty= I_{9-n}$, which is equivalent to having a prescribed monodromy at infinity $\mathbb{M}_\infty= T^{9-n}$. This follows from general considerations similar to the weak-coupling analysis for 4d $SU(2)$ gauge theories \cite{Seiberg:1994rs, Seiberg:1994aj}; here, the monodromy is determined by the 5d gauge theory one-loop $\beta$-function coefficient \cite{Seiberg:1996bd, Nekrasov:1996cz}, as we will show. Let us then denote by $\mathcal{T}_{F_\infty}$ the corresponding field theory. Any {\it CB configuration} of $\mathcal{T}_{F_\infty}$ corresponds to a RES with a fixed set of singular fibers: \be \text{$U$-plane of}\; \mathcal{T}_{F_\infty}\; \text{at fixed ${M_F}$}\qquad \leftrightarrow \qquad \mathcal{S} \;\; \text{with}\;\; \{F_\infty~,\, F_1~,\,\cdots~,\, F_k \}~. \end{equation} The Kodaira singularities {\it in the interior} of the $U$ plane have a well-understood low-energy physics interpretation -- see {\it e.g.}~\cite{Ganor:1996pc}. For instance, the AD fixed points $H_0$, $H_1$ and $H_2$ arise from Kodaira singularities of type $II$, $III$ and $IV$, respectively. We can then use the classification of rational elliptic surfaces to map out all possible CB configurations of a given rank-one 4d $\mathcal{N}=2$ field theory, simply by fixing $F_\infty$.% \footnote{From table~\protect\ref{tab:intro1}, one can see that the $F_\infty = I_8$ is either the $E_1$ or the $\widetilde E_1$ theory. The distinction between the two will be explained momentarily.} The number of distinct configuration in each case is given in table~\ref{tab:intro1} for all the 4d and 5d theories. The remaining possibility is for the fiber at infinity to be smooth, $F_\infty= I_0$, which corresponds to a CB configuration of $D_{T^2} E_8^{({\rm 6d})}$, the $E$-string theory on a torus; since the total number of distinct rational elliptic surfaces is 289 \cite{Persson:1990, Miranda:1990}, this is also the number of distinct CB configuration for $D_{T^2} E_8^{({\rm 6d})}$. We shall focus on the 4d and 5d theories (the `rational' and `trigonometric' cases) in this work, which are special limits of the $E$-string theory (the `elliptic' case). The relation between rank-one SW geometries and rational elliptic surfaces has appeared repeatedly in the string-theory literature -- see in particular \cite{Sen:1996vd, Banks:1996nj, Minahan:1998vr, Aspinwall:1998xj, Fukae:1999zs, Noguchi:1999xq, Yamada:1999xr, Mohri:2000wu, Eguchi:2002fc, Mizoguchi:2018zqp}. More recently, Caorsi and Cecotti used the RES formalism to explore the physics of strictly four-dimensional $\mathcal{N}=2$ field theories \cite{Caorsi:2018ahl}, in relation to the Argyres-Lotito-L\"u-Martone classifcation of rank-one 4d $\mathcal{N}=2$ SCFT \cite{Argyres:2015ffa, Argyres:2015gha, Argyres:2016xua, Argyres:2016xmc}. See also \cite{Argyres:2018taw} for a closely related approach. The present work builds on the approach of~\cite{Caorsi:2018ahl} by noting that {\it all} rational elliptic surfaces with a fixed $F_\infty$ have a nice CB interpretation, once we consider the 5d $E_n$ theories and the $E$-string theory. In addition, we provide an improved understanding of the flavour symmetry group of the 4d $\mathcal{N}=2$ theories in that language, as we will discuss next. On the other hand, we focus exclusively on the 5d $E_n$ theories and on their 4d descendants. The latter are the 4d $SU(2)$ gauge theories with $0 \leq N_f\leq 4$ flavours and the 6 `classic' 4d SCFTs without marginal couplings -- the 3 AD theories \cite{Argyres:1995xn} and the 3 Minahan-Nemeschansky theories \cite{Minahan:1996cj}. We believe that our analysis can be (and should be) generalised to include the remaining rank-one 4d SCFTs \cite{Argyres:2007tq, Argyres:2015ffa, Argyres:2015gha} by building on the insights from \cite{Caorsi:2018ahl, Argyres:2018taw} and on the S-fold approach \cite{Apruzzi:2020pmv, Heckman:2020svr, Giacomelli:2020gee}. This is left for future work. \subsection*{Mordell-Weil group and global symmetries} The flavour symmetries of the rank-one theories can be deduced directly from the structure of the associated SW fibration. This can be understood by using the particular structure of the Type IIB mirror geometry, which can be equivalently described in terms of a single D3-brane probing a collection of 7-branes in a F-theory construction \cite{Sen:1996vd, Banks:1996nj, Mikhailov:1998bx, Hori:2000ck}. In the F-theory language, the Kodaira singularities on the $U$-plane are non-compact 7-branes, which therefore give rise to flavour symmetry algebras of ADE type. We are particularly interested in determining the actual flavour symmetry {\it group} which, by definition, acts faithfully on gauge-invariant states. In that respect, an important role is played by the Mordell-Weil (MW) group of rational sections of the SW geometry $\mathcal{S}$, which is an abelian group of the general form: \be \Phi = {\rm MW}(\mathcal{S}) \cong \mathbb{Z}^{{\rm rk}(\Phi)} \oplus \Phi_{\rm tor}~, \qquad\qquad \Phi_{\rm tor}\cong \mathbb{Z}_{k_1}\oplus \cdots \oplus \mathbb{Z}_{k_t}~, \end{equation} where ${\rm rk}(\Phi)\in \mathbb{Z}_{\geq 0}$ is the rank of the MW group. The ${\rm rk}(\Phi)$ generators of the free part of $\Phi$ correspond to abelian symmetries. On the other hand, the torsion sections constrain the non-abelian part of the flavour symmetry group, similarly to the way the gauge group is determined in F-theory compactifications \cite{Aspinwall:1998xj, Park:2011ji, Morrison:2012ei, Mayrhofer:2014opa, Cvetic:2017epq, Monnier:2017oqd}. In our setup, a key role is played by the Kodaira singularity at infinity, $F_\infty$, which does not contribute to the IR flavour symmetry. It then turns out to be important to compute precisely how the sections $P\in \Phi$ intersect the reducible fibers in the interior and at infinity. We will define $\mathcal{Z}^{[1]} \subset \Phi_{\rm tor}$ to be the maximal subgroup of torsion sections that intersect `trivially' ({\it i.e.} like the zero section) all the fibers in the interior of the $U$-plane, and we will define the abelian group $\mathscr{F}$ to be the cokernel of the inclusion map: \be\label{SES tor} 0\rightarrow \mathcal{Z}^{[1]}\rightarrow \Phi_{\rm tor} \rightarrow \mathscr{F}\rightarrow 0~. \end{equation} Then, we claim that: \begin{itemize} \item $\mathcal{Z}^{[1]}$ gives the one-form symmetry of the 4d field theory. In particular, it does not change as we vary the mass parameters. Incidentally, this distinguishes between the $E_1$ and $\widetilde E_1$ configurations for $F_\infty =I_8$, in which case $\mathcal{Z}^{[1]}\cong \mathbb{Z}_2$ for $E_1$ while it is trivial for $\widetilde E_1$. \item The IR flavour symmetry group $G_F$, for any given CB configuration $\mathcal{S}$ of $\mathcal{T}_{F_\infty}$, takes the schematic form: \be\label{GF intro} G_F \cong \Big(U(1)^{{\rm rk}(\Phi)} \times \prod_{v\neq \infty} \widetilde G_v\Big) \Big/ \mathscr{F}~, \end{equation} where $\widetilde G_v$ is the simply-connected group with Lie algebra $\mathfrak{g}_v$, associated to each non-reducible Kodaira fiber $F_v$ in the interior of the $U$-plane. It follows from the general mathematical theory of RES that $\mathscr{F}$ injects into the center of $\prod_v \widetilde G_v$, so that the quotient in \eqref{GF intro} is well-defined. The expression \eqref{GF intro} is slightly imprecise when ${\rm rk}(\Phi)>0$, because we should specify the normalisations of the abelian charges, which are determined by the way the non-torsion sections intersect the reducible fibers. \end{itemize} We will explain all these statements in section~\ref{section:RES}, after reviewing the necessary mathematical background. Our identification of the one-form symmetry agrees with known results for all the theories under consideration. A complete `physics proof' of the identification of $\mathcal{Z}^{[1]}$ with the one-form symmetry, which would relate our approach to \cite{DelZotto:2015isa, Garcia-Etxebarria:2019cnb, Morrison:2020ool, Albertini:2020mdx, Closset:2020scj, DelZotto:2020esg}, is left for future work. On the other hand, we provide a detailed explanation, and much direct evidence, for the determination of the flavour symmetry group using the MW torsion. This confirms the recent results in \cite{Apruzzi:2021vcu, Bhardwaj:2021ojs}, which were derived by different (albeit related) methods. It is also tempting to identify $\Phi_{\rm tor}$ itself as a 2-group \cite{Kapustin:2013uxa, Sharpe:2015mja, Cordova:2018cvg, Benini:2018reh}, which can be non-trivial for 5d SCFTs~\cite{Apruzzi:2021vcu}; that is another interesting point that we leave for future work. \begin{table}[] \renewcommand{\arraystretch}{1.4} \begin{center} \begin{tabular}{ |c||c|c|c|c|c|c|c|} \hline $D_{S^1} \mathcal{T}_{\rm 5d}$ & \; $E_7$ \; & \; $E_6$ \; & \;$E_5$\; & $E_4$ & $E_3$ & $E_1$ & $E_0$ \\ \hline \hline $\Gamma$ & \; $\Gamma^0(2)$ \; & \; $\Gamma^0(3)$ \; & \;$\Gamma^0(4)$\; & $\Gamma^1(5)$ & $\Gamma^0(6)$ & $\Gamma^0(8)$ & $\Gamma^0(9)$ \\ \hline $(\Gamma:\Gamma(1))$ & \; $3$ \; & \; $4$ \; & \;$6$\; & $12$ & $12$ & $12$ & $12$ \\ \hline \end{tabular} \end{center} \caption{Modular groups for the massless $D_{S^1} E_n$ theories, and their index in ${\rm PSL}(2, \mathbb{Z})$. They are all congruence subgroups. The massless CB for $E_8$, $E_2$ and $\widetilde E_1$ are not modular.} \label{tab:introMod} \end{table} \subsection*{Modularity on the $U$-plane} It is well-known that the Coulomb branch of the pure $SU(2)$ gauge theory is a modular curve for the congruence subgroup $\Gamma^0(4)$ of ${\rm PSL}(2, \mathbb{Z})$ \cite{Seiberg:1994aj}. Similarly, the massless $u$-plane of 4d $SU(2)$ with $N_f=2$ and $N_f=3$ is modular with respect to $\Gamma(2)$ and $\Gamma_0(4)$, respectively \cite{Nahm:1996di, Moore:1997pc}.% \footnote{Note that the $\Gamma(2)$ curve also appeared in the original SW paper to describe the pure $SU(2)$ CB~\protect\cite{Seiberg:1994rs}. Our perspective here is that the `correct' pure $SU(2)$ CB is the $\Gamma^0(4)$ curve -- see {\it e.g.} the discussion in~\protect\cite{Tachikawa:2013kta} -- which is the one that arises naturally from local mirror symmetry.} By definition, a CB configuration is modular if the $U$-plane is a modular curve of genus zero: \be \{ U \} \cong \mathbb{H}/\Gamma~, \qquad \tau \mapsto U(\tau)~, \;\; \forall \tau \in \mathbb{H}~, \end{equation} for some modular group $\Gamma \subset {\rm PSL}(2, \mathbb{Z})$. In that case, the $U$-plane is isomorphic to a fundamental domain for $\Gamma$ on the upper-half-plane. The function $U(\tau)$ is called the Hauptmodul, or principal modular function, for $\Gamma$. Modularity often simplifies the analysis of the low-energy physics, as we will see in many examples. For instance, it allows us to easily identify the dyons that become massless at cusps, once we have chosen a fundamental domain. The latter can often be used to visualize how other configurations can be obtained by merging singularities, such as in the traditional case of the AD theories arising on the $u$-planes of the $SU(2)$ gauge theories \cite{Argyres:1995xn}. This also allows us to easily derive BPS quivers \cite{Denef:2002ru, Alim:2011kw, Chuang:2013wt} directly from the $U$-plane in many cases. This last point certainly deserves further study. Other recent discussions of BPS quivers in the present context include {\it e.g.}~\cite{Banerjee:2018syt, Banerjee:2019apt, Duan:2020qjy, Mozgovoy:2020has, Banerjee:2020moh, Longhi:2021qvz, ZottoEtx}. The modular groups for the massless `semi-simple' $E_n$ theories on a circle are shown in table~\ref{tab:introMod}. Most of these modular groups appeared in one guise or another in the string-theory literature when discussing local mirror symmetry -- see {\it e.g.} \cite{Lian:1994zv, Doran:1998hm, Mohri:2000kf, Mohri:2001zz, Huang:2006si, Aganagic:2006wq, Huang:2009md, Alim:2013eja}. On the gauge theory side, the recent work by Aspman, Furrer, and Manschot on the $SU(3)$ Coulomb branch \cite{Aspman:2020lmf} was a source of inspiration to us.% \footnote{ One day after the first version of this paper appeared on the arXiv, another paper by Aspman, Furrer and Manschot appeared~\protect\cite{Aspman:2021vhs} which studies 4d $SU(2)$ gauge theories. Their results partially overlap with section~\protect\ref{sec:rankone4d} of this paper. } Incidentally, it would be important, but probably challenging, to generalise our systematic approach to rank-two (and higher-rank) theories, in order to make contact with the recent renewed efforts in mapping out rank-two 4d SCFTs \cite{Martone:2021ixp, Kaidi:2021tgr, Martone:2021drm}. \subsection*{Gravitational couplings on the $U$-plane} In the last section of this paper, section~\ref{sec:grav}, which can be read in combination with section~\ref{sec:Enmirroretc} and independently of the rest of the paper, we study the effective gravitational couplings $A(U)$ and $B(U)$ on the $U$-plane, focussing on the simpler `toric' cases. These are the additional effective couplings that arise in addition to the prepotential in the low-energy effective field theory on a non-trivial four-manifold, and are necessary for S-duality~\cite{Witten:1995gf}. Our objective, there, is to verify explicitly the infrared prediction for these couplings, which is given in terms of the SW curve~\cite{Witten:1995gf, Moore:1997pc, Losev:1997tp}, by matching it to the microscopic prediction that follows from the asymptotic expansion of the Nekrasov partition function \cite{Nekrasov:2002qd, Nekrasov:2003rj} -- see also \cite{Nakajima:2003pg, Nakajima:2003uh, Nakajima:2005fg}. This amounts to a 5d generalisation of some of the computations in a recent work by Manschot, Moore and Zhang~\cite{Manschot:2019pog}. \medskip \medskip \noindent This paper is organised as follows. In section~\ref{sec:Enmirroretc}, we review the geometric engineering of the $E_n$ 5d SCFTs in M-theory and their circle reduction in Type IIA, and we discuss the SW curves for the $D_{S^1} E_n$ theories using local mirror symmetry. In section~\ref{section:RES}, we discuss the rank-one SW geometries in terms of rational elliptic surfaces, and we explain how to find the flavour symmetry group in that context. In section~\ref{sec:rankone4d}, we illustrate our general approach to the $U$-plane by revisiting the `classic' four-dimensional $\mathcal{N}=2$ theories. In sections~\ref{sec:E1},~\ref{sec:E0}, \ref{sec:E2} and \ref{sec:En}, we study the Coulomb branch of the $D_{S^1} E_n$ theories in full detail. In section~\ref{sec:grav}, we discuss the gravitational couplings on the $U$-plane. Some useful additional material is relegated to various appendices. \section{$E_n$ SCFT from M-theory, local mirror and Seiberg-Witten geometry}\label{sec:Enmirroretc} In this section, we review the geometric engineering of the $E_n$ 5d SCFTs from M-theory on del Pezzo ($dP$) singularities. These are of course the simplest 5d SCFTs we could consider -- the geometric engineering of general 5d SCFTs has attracted a lot of interest in recent years, see {\it e.g.}~\cite{DelZotto:2017pti,Xie:2017pfl,Jefferson:2017ahm,Jefferson:2018irk,Bhardwaj:2018yhy,Bhardwaj:2018vuu,Apruzzi:2018nre,Closset:2018bjz,Apruzzi:2019vpe,Apruzzi:2019opn,Apruzzi:2019enx,Bhardwaj:2019jtr,Bhardwaj:2019fzv,Bhardwaj:2019ngx,Saxena:2019wuy,Apruzzi:2019kgb,Bhardwaj:2019xeg, Gu:2019pqj, Bhardwaj:2020gyu,Eckhard:2020jyr,Morrison:2020ool, Albertini:2020mdx, Bhardwaj:2020kim, vanBeest:2020kou, Hubner:2020uvb,Bhardwaj:2020phs, Bhardwaj:2020ruf,Bhardwaj:2020avz, vanBeest:2020civ, Bergman:2020myx, Closset:2020afy,Braun:2021lzt,Collinucci:2021ofd, Cvetic:2021sxm}. The circle compactification of the $E_n$ theory is described by Type IIA string theory on the same $dP_n$ singularity, and the local mirror description in Type IIB gives us the Seiberg-Witten geometry we are interested in. After reviewing some standard facts about families of elliptic curves and Seiberg-Witten geometry, we discuss the $E_n$ Seiberg-Witten curves and derive the Picard-Fuchs (PF) equations satisfied by their periods. We also review the relation between the 5d $E_n$ theories and the 4d MN theories. \subsection{Geometric engineering at del Pezzo singularities}\label{subsec:geom engin} We are interested in the small family of 10 distinct rank-one 5d SCFTs with flavour symmetry algebra $E_n$ \cite{Seiberg:1996bd, Morrison:1996xf}, namely: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} &E_0 = \varnothing~, \qquad\quad &&E_2= \mathfrak{su}(2)\oplus \mathfrak{u}(1)~, && E_5= \mathfrak{so}(10)~, \cr & \widetilde E_1= \mathfrak{u}(1)~, \qquad\quad &&E_3= \mathfrak{su}(3)\oplus \mathfrak{su}(2)~, \qquad\quad && E_n= \mathfrak{e}_n\; \; \; (n=6,7,8)~. \cr & E_1= \mathfrak{su}(2)~, \qquad\quad &&E_4= \mathfrak{su}(5)~, \qquad\quad && \eea These 5d fixed points are all related to each other by five-dimensional RG flows, starting from the $E_8$ model and breaking down the flavour symmetry to $E_{n<8}$ by appropriate real-mass deformations \cite{Seiberg:1996bd, Morrison:1996xf, Cordova:2016xhm}. In this section, we will only discuss the flavour symmetry {\it algebra} of the $E_n$ theories. The global form of the flavour symmetry was recently derived in~\cite{Apruzzi:2021vcu}. Those results also follow from the Coulomb-branch analysis of the KK theory, as we will explain in section~\ref{section:RES}. These rank-1 5d SCFTs can be `geometrically engineered' as the low-energy limit of M-theory on $\mathbb{R}^5\times \MG_{E_n}$, where the $\MG_{E_n}$ is a canonical singularity that admits a crepant resolution with a single exceptional divisor \cite{Morrison:1996xf,Intriligator:1997pq}. Let $\mathcal{B}_4$ denote a Fano surface -- that is, either a del Pezzo surface or the Hirzebruch surface $\mathbb{F}_0 \cong \mathbb{P}^1\times \mathbb{P}^1$. We consider the local Calabi-Yau threefold obtained as the total space of the canonical line bundle over~$\mathcal{B}_4$: \be\label{K over B4} \widetilde \MG_{E_n} \cong {\rm Tot} \left( \mathcal{K} \rightarrow \mathcal{B}_4 \right)~. \end{equation} By blowing down the zero section, one obtains the canonical singularity $\MG_{E_n}$. The correspondence between del Pezzo surfaces and $E_n$ theories is summarized in table~\ref{table:dPnEn}. \begin{table}[t] \renewcommand{\arraystretch}{1.4} \centering \begin{tabular}{ |c||c |c| c | c|} \hline $ E_n$ & $E_0$ & $E_1$ & $\widetilde E_1$ & $E_n\, (n=2, \cdots, 8)$ \\%heading \hline $\mathcal{B}_4$&$\mathbb{P}^2$ & $\mathbb{F}_0 \cong \mathbb{P}^1\times \mathbb{P}^1$& $ \mathbb{F}_1 \cong dP_1= {\rm Bl}_{1}(\mathbb{P}^2)$ & $dP_n ={\rm Bl}_{n}(\mathbb{P}^2)\cong {\rm Bl}_{n-1}(\mathbb{F}_0)$ \\ \hline \end{tabular} \caption{Correspondence between $E_n$ SCFTs and del Pezzo surfaces. Here, ${\rm Bl}_k(\mathcal{B}_4)$ denotes the blow-up of the complex surface $\mathcal{B}_4$ at $k$ generic points. Note that $dP_1$ can also be viewed as the Hirzebruch surface $\mathbb{F}_1$. \label{table:dPnEn}} \end{table} The smooth threefold \eqref{K over B4} provides a crepant resolution of $\MG_{E_n}$, which corresponds physically to going onto the extended Coulomb branch (ECB) of the 5d SCFT, by turning on the real Coulomb branch VEV, $\langle \varphi \rangle \neq 0$, as well as $n$ real mass parameters $m_i$ ($i=1, \cdots, n$). The $n$ real masses should be understood as VEVs for real scalars in vector multiplets valued in the Cartan subalgebra $\oplus_{i=1}^n \mathfrak{u}(1)$ of $E_n$. In the M-theory geometric point of view, the full ECB is identified with the extended K\"ahler cone of $\widetilde \MG_{E_n}$ \cite{Intriligator:1997pq}. The $E_n$ symmetry at the fixed point arises because of M2-branes wrapping vanishing curves. Indeed, it is a beautiful mathematical fact that the second homology lattice of $dP_n$ can be decomposed as: \be\label{lattice En B4} H_2(\mathcal{B}_4, \mathbb{Z}) \cong \Lambda_{-\mathcal{K}} \oplus E_n^-~, \end{equation} with $\Lambda_\mathcal{K}\cong \mathbb{Z}$ generated by a choice of anticanonical divisor, $-\mathcal{K}$, of $\mathcal{B}_4$. Here, $E_n^-$ denotes `minus' the $E_n$ root lattice,% \footnote{That is, with an intersection pairing that is minus the Cartan matrix of $E_n$, in some appropriate basis.} which is generated by the curves orthogonal to $-\mathcal{K}$. As reviewed in appendix~\ref{app:Enchar}, one can pick a basis of curves, denoted by $\mathcal{C}_{\alpha_i}$, which are in one-to-one correspondence with the simple roots $\alpha_i$ of the flavour algebra $E_n$ and intersect according to its Dynkin diagram. The $E_n$ fixed point is also the UV completion of a non-normalizable 5d gauge theory with $\mathcal{N}=1$ supersymmetry, consisting of an $SU(2)$ vector multiplet coupled to $N_f=n-1$ hypermultiplets% \footnote{5d $\mathcal{N}=1$ $SU(2)$ with $N_f=n-1$, for short. For $n=1$, we have $SU(2)$ with $\theta$ angle $0$ or $\pi$, corresponding to $E_1$ or $\widetilde E_1$, respectively. The $E_0$ fixed point does not have a gauge theory interpretation but can be obtained as a deformation of the $\widetilde E_1$ theory \protect\cite{Morrison:1996xf}.} with inverse gauge coupling $m_0= 8\pi^2 g^{-2}_{\rm 5d}$ \cite{Seiberg:1996bd}. This gauge theory description is obtained by a mass deformation of the SCFT that breaks $E_n$ down to $\mathfrak{so}(2n-2)\oplus \mathfrak{u}(1)$: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{Dynkin diag En sec 1} \begin{tikzpicture}[x=.7cm,y=.7cm] \draw[ligne, black](-2,0)--(1.5,0); \draw[ligne, black](0,0)--(0,1); \draw[ligne, black](2.5,0)--(3,0); \node[wd] at (-2,0) [label=below:{{\scriptsize$\alpha_1$}}] {}; \node[wd] at (-1,0) [label=below:{{\scriptsize$\alpha_2$}}] {}; \node[wd] at (0,0) [label=below:{{\scriptsize$\alpha_4$}}] {}; \node[wd] at (1,0) [label=below:{{\scriptsize$\alpha_5$}}] {}; \node[] at (2,0) {{\scriptsize$\cdots$}}; \node[wd] at (3,0) [label=below:{{\scriptsize$\alpha_n$}}] {}; \node[wd] at (0,1) [label=above:{{\scriptsize$\alpha_3$}}] {}; \node[] at (6,0) {$\longrightarrow$}; \draw[ligne, black](10,0)--(12.5,0); \draw[ligne, black](11,0)--(11,1); \draw[ligne, black](13.5,0)--(14,0); \node[bd] at (9,0) [label=below:{{\scriptsize$\frak{u}(1)$}}] {}; \node[wd] at (10,0) [label=below:{{\scriptsize$\alpha_2$}}] {}; \node[wd] at (11,0) [label=below:{{\scriptsize$\alpha_4$}}] {}; \node[wd] at (12,0) [label=below:{{\scriptsize$\alpha_5$}}] {}; \node[] at (13,0) {{\scriptsize$\cdots$}}; \node[wd] at (14,0) [label=below:{{\scriptsize$\alpha_n$}}] {}; \node[wd] at (11,1) [label=above:{{\scriptsize$\alpha_3$}}] {}; \end{tikzpicture} \eea In the geometry, this corresponds to a partial resolution of the singularity. To describe the $SU(2)$, $N_f=n-1$ gauge theory geometrically, one should pick a ruling of the exceptional divisor $\mathcal{B}_4$. For our purposes, this consists of a choice of `fiber' and `base' rational curves, $\mathcal{C}_f\cong \mathbb{P}^1$ and $\mathcal{C}_b \cong \mathbb{P}^1$ respectively. For $n=1$, we have the Hirzebruch surfaces: \be \mathcal{C}_f \rightarrow \mathbb{F}_p \rightarrow \mathcal{C}_b~, \qquad p=0,1~. \end{equation} The trivial ($p=0$) or non-trivial ($p=1$) fibration of $\mathcal{C}_f$ over $\mathcal{C}_b$ gives us the $SU(2)_0$ or $SU(2)_\pi$ gauge theory in the limit where the fiber curve collapses to a point; the M2-brane wrapping $\mathcal{C}_f$ gives the $SU(2)$ $W$-boson, and the M2-brane wrapping $\mathcal{C}_b$ gives the 5d instanton particle. For $n>1$, we view $\mathcal{B}_4=dP_n$ as the blow-up of $\mathbb{F}_0$ at $N_f=n-1$ generic points. By a slight abuse of notation, we then denote by $\mathcal{C}_f$, $\mathcal{C}_b$ the same curves pulled back through the blow-down map $dP_n \rightarrow \mathbb{F}_0$. The $N_f$ exceptional curves are denoted by $E_i$, $i=1, \cdots, n-1$, and the corresponding wrapped M2-branes give us the hypermultiplets. In this work, we are interested in the 5d SCFT compactified on a finite-size circle with radius $\beta$. This gives us a 4d $\mathcal{N}=2$ supersymmetric theory `of Kaluza-Klein (KK) type', which we denote by $D_{S^1} E_n$. By the M-theory/Type IIA duality, we can engineer the theory as the low-energy limit of Type IIA string theory on $\mathbb{R}^4\times \MG_{E_n}$: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} &D_{S^1} E_n \equiv E_n \; \text{5d SCFT on} \; \mathbb{R}^4\times S^1&&\quad \longleftrightarrow\quad \text{M-theory on}\; \mathbb{R}^4\times S^1\times \MG_{E_n}\\ &&&\quad \longleftrightarrow\quad \text{IIA on }\; \mathbb{R}^4\times \MG_{E_n}~. \eea The Coulomb-branch physics of $D_{S^1} E_n$ is rather more subtle and interesting. This is due to quantum corrections, which kick in as soon as we compactify on a circle. In the geometric-engineering picture, we have worldsheet instanton corrections in Type IIA. Equivalently, in M-theory, we have to account for M2-branes wrapping $\mathcal{C}\times S^1$, with $\mathcal{C}$ some curve inside $\widetilde\MG_{E_n}$. Note that the 4d $\mathcal{N}=2$ theory $D_{S^1} E_n$ is a massive theory, since we introduced the KK-scale $m_{\rm KK}= 1/\beta$. For generic values of the parameters, this is an `abstract' strongly coupled quantum field theory defined by the IIA geometry. In some particular limit on the K\"ahler parameters, called the geometric engineering limit \cite{Katz:1996fh, Katz:1997eq}, we recover the 4d $\mathcal{N}=2$ $SU(2)$ theory with $N_f$ flavours, at least when $N_f \leq 4$, and the Coulomb branch physics is then governed by the celebrated Seiberg-Witten solution \cite{Seiberg:1994rs, Seiberg:1994aj}. (We will review what happens for $N_f >4$ at the end of this section.) More generally, the 5d gauge theory description remains useful for $m_0 \gg m_{\rm KK}$ \cite{Nekrasov:1996cz, Lawrence:1997jr}. \subsection{Introducing the $U$-plane: a gauge theory perspective} One can gain some useful intuition about the Coulomb-branch physics of $D_{S^1} E_n$ from the 5d gauge-theory description \cite{Nekrasov:1996cz}. Firstly and most importantly, the Coulomb branch is a one-complex dimensional variety because the 5d real scalar $\sigma$ in the abelian vector multiplet for $U(1)\subset SU(2)$ is paired with the $U(1)$ holonomy along the circle. Let us then define the dimensionless scalar: \be a = i \left(\beta \sigma+ i A_5\right)~, \qquad\qquad\quad A_5 \equiv{1\over 2\pi} \int_{S^1} A_M dx^M~. \end{equation} The classical $SU(2)$ Coulomb branch is then of the form $(\mathbb{R}\times S^1)/\mathbb{Z}_2$, which is spanned by $a\in \mathbb{C}$ modulo $a \rightarrow -a$ (the $SU(2)$ Weyl group action) and $a\rightarrow a+1$ (the five-dimensional large gauge tranformations along $S^1$). It will be useful to parameterize the Coulomb branch in a gauge invariant way, as: \be\label{U to a classical} U = e^{2\pi i a}+ e^{-2\pi i a}~. \end{equation} This corresponds to the classical expectation value of a five-dimensional supersymmetric Wilson line in the fundamental representation of $SU(2)$, wrapping the circle: \be\label{U intrinsic} U \equiv \langle W \rangle~, \qquad \qquad W\equiv {\rm Tr}\; {\rm P} \exp{\left( i \int_{S^1}(A- i \sigma d\psi)\right)}~. \end{equation} For each $U(1)_i\subset E_n$ symmetry on the ECB, we similarly introduce the complexified flavour parameters: \be\label{def nu} \nu_i = i \left(\beta m_i^{(F)}+ i A_{i, 5}^{(F)}\right)~, \qquad \qquad {M_F}_i \equiv e^{2\pi i \nu_i}~, \end{equation} which include flavour Wilson lines along the circle. Secondly, the classical relation \eqref{U to a classical} will be modified by quantum corrections. Let us consider \eqref{U intrinsic} as the intrinsic definition of $U$, valid in the full quantum theory. Recall that the 4d $\mathcal{N}=2$ low-energy description on the CB is fully determined, in flat space, by some holomorphic prepotential $\mathcal{F}(a)$. In particular, we have the effective gauge coupling: \be\label{tau of a} \tau= {\d^2 \mathcal{F}(a) \over \d a^2}~, \end{equation} at any given point on the Coulomb branch. The challenge is then to write down the low-energy parameter $a$ in terms of the VEV $U$ in \eqref{U intrinsic}. More generally, we will have: \be a= a(U, {M_F})~, \end{equation} including a dependence on the flavour parameters ${M_F}_i$. Then, \eqref{tau of a} gives us the effective gauge coupling on the CB as a function of $U$ and ${M_F}_i$. At large distance on the CB, namely for $U \rightarrow \infty$, one can compute the prepotential at the one-loop order similarly to the 4d gauge-theory case, by resumming the KK towers \cite{Nekrasov:1996cz}. For $SU(2)$ with $N_f$ flavours, one finds: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{F large U gauge th} &\mathcal{F} &=&\; \mathcal{F}_0 + {2\over (2\pi i)^3} {\text{Li}_3}\big(e^{4\pi i a}\big)- {1\over (2\pi i)^3}\sum_{i=1}^{n-1} \sum_\pm {\text{Li}_3}\big(e^{2\pi i(\pm a+ \mu_i)}\big)\cr & &\approx &\; \mathcal{F}_0 + {2\over (2\pi i)^3} {\text{Li}_3}\left({1\over U^2}\right)- {1\over (2\pi i)^3}\sum_{i=1}^{n-1} {\text{Li}_3}\left({1\over U}\right)~, \eea with $\mathcal{F}_0= {1\over 2} \mu_0 a^2$ a classical contribution, and the trilogarithms arise at one-loop. Here, the $\mu_i$'s are the complexified masses of the $n-1$ fundamental hypermultiplets, and we assumed $|a| \gg |\mu_i|$ on the second line. The mass parameters $\mu_0$, $\mu_i$ are related to the parameters $\nu_i$ in \eqref{def nu} in a specific way, as explained below and in appendix~\ref{app:Enchar}. \subsection{Monodromies, periods and Seiberg-Witten geometry}\label{subsec:monoSW} The low-energy scalar field $a$ is not a single-valued function of the parameter $U$. This is already true, in a somewhat trivial way, in the large distance approximation, where we have: \be\label{a large U} a = {1\over 2\pi i} \log\left({1\over U} \right) +\mathcal{O}\left({1\over U}\right)~. \end{equation} The presence of a logarithmic branch cut is equivalent to the statement that $a$ and $a+1$ are gauge equivalent. More importantly, the effective gauge coupling itself is not single-valued. As we go around the point at infinity, $U^{-1}=0$, we have: \be\label{shift tau at infinity} U^{-1} \rightarrow e^{2\pi i} U^{-1}\qquad : \qquad \tau \rightarrow \tau + 9-n~ \end{equation} which follows from \eqref{F large U gauge th}. This gives us a shift of the effective 4d $\theta$-angle by $2\pi b_0$, with $b_0$ the $\beta$-function coefficient of the 5d gauge theory \cite{Seiberg:1996bd}: \be b_0= 8-N_f= 9-n~. \end{equation} In the interior of the $U$-plane, one should then have more singularities, around which the effective gauge coupling $\tau$ transforms by some non-trivial elements of ${\rm PSL}(2, \mathbb{Z})$, exactly like in the case of purely four-dimensional $SU(2)$ theories \cite{Seiberg:1994rs, Seiberg:1994aj}. Such singularities are physically allowed because of the electric-magnetic duality of the 4d $\mathcal{N}=2$ abelian vector multiplet. Let $a_D$ denote the scalar field magnetic dual to $a$. It can be obtained in terms of the effective prepotential by: \be a_D = {\d \mathcal{F}\over \d a}~. \end{equation}% \begin{figure}[t] \begin{center} \tikzset{cross/.style={cross out, draw=black, fill=none, minimum size=2*(#1-\pgflinewidth), inner sep=0pt, outer sep=0pt}, cross/.default={2pt}} \begin{tikzpicture}[x=50pt,y=50pt] \begin{scope}[shift={(2,0)}] \draw (0.1,0) node[cross, blue] {}; \fill (-0.82,-0.85) circle[radius=1.8pt] {}; \fill (0.85,-0.85) circle[radius=1.8pt] {}; \fill (0.8,0.8) circle[radius=1.8pt] {}; \draw[blue, thick, ->] ($(0, 0)$) to[out=200, in=100] ($(-1, -1)$); \draw[blue, thick] ($(-1, -1)$) to[out=280, in=230] ($(0, -0.25)$); \draw[blue, thick, ->] ($(0.15, -0.2)$) to[out=300, in=200] ($(1, -1.2)$); \draw[blue, thick] ($(1, -1.2)$) to[out=20, in=340] ($(0.25, -0.1)$); \draw[blue, thick, ->] ($(0.25, 0)$) to[out=25, in=340] ($(1, 1)$); \draw[blue, thick] ($(1, 1)$) to[out=160, in=80] ($(0.15, 0.2)$); \node at (-0.2,0.2) {$U_0$}; \node at (-1.3,-0.9) {$U_{*1}$}; \node at (1.4,-0.9) {$U_{*k}$}; \node at (1,1.2) {$U_{\infty}$}; \node at (0,-0.85) {\ldots}; \end{scope} \end{tikzpicture} \end{center} \caption{Paths ${\boldsymbol{\gamma}}_v$ generating the fundamental group of the $U$-plane. The path around infinity is equal to minus the sum of all the other paths, ${\boldsymbol{\gamma}}_\infty=-({\boldsymbol{\gamma}}_1+ \cdots+{\boldsymbol{\gamma}}_k)$. \label{fig:paths U plane}} \end{figure}% Semi-classically, at large distance on the $U$-plane, the field $a_D$ describes a BPS monopole. The low-energy effective theory is fully determined by the data of a section $(a_D, a)$ of a rank-two holomorphic affine bundle% \footnote{This is an affine bundle instead of a vector bundle because of the presence of masses, as we will discuss momentarily. For now, let us focus on the ${\rm SL}(2, \mathbb{Z})$ part of the structure group.} over the $U$-plane, with structure group $\mathbb{C}^2 \rtimes {\rm SL}(2, \mathbb{Z})$, such that the effective gauge coupling is given by: \be\label{tau a aD formula} \tau= {\d a_D\over \d a}~. \end{equation} The low-energy scalars $a$ and $a_D$ are called the electric and magnetic `periods', respectively. As we go around any singularity $U=U_\ast$ on the $U$-plane (including the point at infinity) in a clockwise fashion, the periods transform as: \be\label{electromag Mast} \mat{a_D \\ a} \rightarrow \mathbb{M}_\ast \mat{a_D\\ a}~, \qquad \mathbb{M}_\ast \in {\rm SL}(2, \mathbb{Z})~. \end{equation} The ${\rm SL}(2, \mathbb{Z})$ matrix $\mathbb{M}_\ast$ is the so-called monodromy around that point. Let us denote the $k+1$ singularites on the $U$ plane (including the point at infinity, $U_{\infty}= \infty$) by $\widehat\Delta= \{ U_{\ast 1}, \cdots, U_{\ast k}, U_{\infty}\}$, and let: \be \mathcal{M}_C= \{U\}-\widehat\Delta \end{equation} be the Coulomb branch with its singular points removed. Given one of our rank-one theories with fixed mass parameters ${M_F}_i$, the quantum Coulomb branch data is an affine bundle $\boldsymbol{E}$ with $\mathbb{C}^2$ fibers: \be \mathbb{C}^2 \lhook\joinrel\longrightarrow \boldsymbol{E} \xrightarrow{~\pi~} \mathcal{M}_C~. \end{equation} By definition, the monodromy group at some base point $U_0$ is a representation of the fundamental group $\pi_1(\mathcal{M}_C, U_0)$ on the fiber $\mathbb{C}^2 \cong \pi^{-1}(U_0)$. It is generated by the matrices $\mathbb{M}_{\ast l}$, for some convenient choice of base point and of paths ${\boldsymbol{\gamma}}_v$, where each `vanishing path' goes once along a single singularity as shown in figure~\ref{fig:paths U plane}. We then have the obvious constraint: \be \label{MonodromyConstraint} \mathbb{M}_\infty \prod_{l=1}^k \mathbb{M}_{\ast l}= \mathbf{1}~. \end{equation} A good part of paper is dedicated to a thorough study of this elementary structure for the $D_{S^1} E_n$ theories. In particular, we would like to give a detailed account of the Coulomb branch singularities, and of the corresponding low-energy physics. \medskip \noindent The modular group ${\rm SL}(2, \mathbb{Z})$ is generated by the two matrices: \be S= \mat{0 & -1 \\ 1 & 0}~,\qquad \qquad T= \mat{1& 1 \\ 0 &1}~. \end{equation} Let us also denote by $P= S^2= - \mathbf{1}$ the generator of the $\mathbb{Z}_2$ center of ${\rm SL}(2, \mathbb{Z})$. The monodromy at $U=\infty$ can be computed from \eqref{F large U gauge th} and \eqref{a large U}, which gives: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} a_D \rightarrow a_D + (9-n) a + \mu_0- \sum_{i=1}^{n-1} \mu_i~, \qquad \quad a \rightarrow a+1~. \eea We then have the following ${\rm SL}(2,\mathbb{Z})$ monodromy at infinity: \be\label{Minfty} \mathbb{M}_\infty = T^{9-n}= \mat{1 & \, 9{-}n\\ 0 &1}~. \end{equation} Note that this is tied to the Witten effect \cite{Witten:1979ey}: a shift of the 4d $\theta$-angle as in \eqref{shift tau at infinity} induces an electric charge for the monopole, turning it into a dyon. \subsubsection{Central charge, massless BPS particles and $T^k$ monodromies} Half-BPS massive particle excitations on the Coulomb branch of $D_{S^1} E_n$ have a mass determined by their electromagnetic and flavour charges: \be \gamma \in \Gamma\cong \mathbb{Z}^{n+3}~, \qquad\qquad \gamma \cong (m, q, q^i_F, n_{\rm KK})~, \end{equation} according to the central-charge formula, $m_\gamma= |Z_\gamma|$. The integer-quantized charges consist of the magnetic and electric charges, $(m, q)$, the $E_n$ flavour charges $q_F^i$, and the KK momentum $n_{\rm KK}$ \cite{Closset:2019juk}. Using the KK scale as the unit of mass, let us define the dimensionless central charge $\mathcal{Z}\equiv \beta Z$. At any given point on the extended Coulomb branch, the central charge is a map $\mathcal{Z} : \Gamma \rightarrow \mathbb{C}$, which is given explicitly by: \be \mathcal{Z}_\gamma(U, M) =\mathbf{q} \,\boldsymbol{\Pi}= m a_D + q a + q^i_F \mu_i + n_{\rm KK}~, \end{equation} in terms of the electromagnetic periods. The parameters $\mu_i$ and $\mu_{\rm KK}{=}1$ are `exact periods', as we will review below. Around any singularity on the $U$-plane, we have an enlarged monodromy of the form: \be \boldsymbol{\Pi}\rightarrow\mathbf{M}_\ast\boldsymbol{\Pi}~, \qquad \qquad \boldsymbol{\Pi}\equiv\mat{a_D \\ a \\ \mu_i \\ 1}~, \qquad \mathbf{M}_\ast = \mat{m_{11} & m_{12} & n_{1}^i& n_{1}^0 \\ m_{21} & m_{22} & n_{2}^i& n_{2}^0 \\ 0 & 0 & 1& 0 \\0 & 0 & 0& 1}~, \end{equation} with $m_{11} m_{22}-m_{12} m_{21}=1$, the upper-left corner of $\mathbf{M}_\ast$ being the electromagnetic monodromy \eqref{electromag Mast}. Note that the monodromy can be equivalently understood as acting on the electromagnetic and flavour charges as: \be \mathbf{q} \rightarrow \mathbf{q} \mathbf{M}_\ast~, \qquad \qquad \mathbf{q} \equiv (m, q, q^i_F, n_{\rm KK})~. \end{equation} In general, we keep to the `electric' duality frame dictated by the non-abelian gauge theory limit (or, more precisely, the large volume limit, as we will see below). The local infrared physics is invariant under electric-magnetic duality, however. When analysing the physics at a given point on the $U$-plane, it can be convenient to change the duality frame. This change of basis leaves the central charge invariant and therefore acts on the charges and periods as: \be \mathbf{q} \rightarrow \mathbf{q} {\bf B}^{-1}~, \qquad \quad \boldsymbol{\Pi} \rightarrow {\bf B}\boldsymbol{\Pi} \end{equation} with ${\bf B}$ the basis-change matrix. The simplest type of singularity that can occur in the interior of the $U$-plane is when a single charged particle becomes massless. In the appropriate duality frame, the low-energy physics at that point is then governed by SQED, namely a $U(1)$ gauge field coupled to a single massless hypermultiplet of charge $1$, denoted by $\widetilde a$. Let us assume that a dyon of electromagnetic charge $(m,q)$ becomes massless at $U_\ast$, with $m$ and $q$ mutually prime, so that $\widetilde a = m a_D + q a$. Due to the $\beta$-function of SQED, the local monodromy is given by $T$, in the variables $(\widetilde a_D, \widetilde a)^T= B(a_D, a)^T$, and it thus follows that a massless dyon at $U_\ast$ induces a monodromy: \be\label{gen Mmq} \mathbb{M}_\ast^{(m,q)} = B^{-1}T B = \mat{1+m q&\, q^2\\ -m^2 & 1-m q}~. \end{equation} Any such singularity with a monodromy conjugate to $T$ is called an $I_1$ singularity. Similarly, we could have SQED with $k$ electrons (or some hypermultiplets of charges $q_j$ such that $\sum_j q_j^2=k$), with a monodromy conjugate to $T^k$ \cite{Seiberg:1994rs, Seiberg:1994aj}. That is called an $I_k$ singularity. Other types of singularities are possible, as we will review momentarily. For the $D_{S^1} E_n$ theory at generic values of the mass parameters ${M_F}$, there are $k= n+3$ singularities of type $I_1$ in the interior of the $U$-plane, at each of which a single BPS particle becomes massless. This number of Seiberg-Witten points can be understood in various ways. From the perspective of local mirror symmetry, which we take below, $n+3$ is the number of generators of the third homology of the Type IIB mirror threefold, which equals the total number of generators of the even homology of $\widetilde\MG$. From the point of view of the 5d gauge theory, if we admit that the pure 5d $SU(2)$ gauge theory on a circle has $4$ CB singularities~\cite{Nekrasov:1996cz}, then adding $N_f=n-1$ massive flavours adds $N_f$ singularities, which are semi-classical in some particular large-mass regime. \subsubsection{Seiberg-Witten geometry, Kodaira singularities and low-energy physics}\label{subsec:kodphys} For any rank-one 4d $\mathcal{N}=2$ field theory, the physical problem is to find exact expressions for the electromagnetic periods $(a_D, a)$ such that the CB metric is positive definite, namely: \be {\rm Im} \, \tau = {\rm Im}\, {\d a_D \over d a} >0~, \quad \qquad ds^2(\mathcal{M}_C) = {\rm Im} \,\tau \; da d \b a~, \end{equation} and which otherwise match the known asymptotics. The original Seiberg-Witten solution for 4d $\mathcal{N}=2$ $SU(2)$ gauge theories was obtained by realising that, given some physical ansatz for the singularities and monodromies on the Coulomb branch, a positive-definite metric can be elegantly obtained by viewing the low-energy fields $(a_D, a)$ as the periods of a meromorphic one-form, $\lambda_{\rm SW}$, on a family of elliptic curves \cite{Seiberg:1994rs, Seiberg:1994aj}. Let us review some useful facts about families of elliptic curves, and their relationship to 4d physics. At fixed mass parameters, we wish to consider a one parameter-family of elliptic curves, which we generally call `the Seiberg-Witten geometry': \be\label{SW geom 0} \Sigma \rightarrow \mathcal{S}_{\rm CB} \rightarrow \overline\mathcal{M}_C \cong \{U\}~. \end{equation} Here, $\mathcal{S}_{\rm CB}$ denotes a one-parameter family of elliptic curve over the $U$-plane, including the singularities. At each smooth point $U\in \mathcal{M}_C$ on the Coulomb branch, we have an elliptic curve $\Sigma_U\cong E$. One then identifies $\tau(U)$ with the modular parameter of that curve. The latter is computed as $\tau= {\omega_D \over \omega_a}$, where $\omega_D$ and $\omega_a$ are the periods of the holomorphic one-form $\boldsymbol{\omega}$ along the $A$- and $B$-cycles in $\Sigma_U$: \be \omega_D= \int_{\gamma_B} \boldsymbol{\omega}~, \qquad \qquad \omega_a= \int_{\gamma_A} \boldsymbol{\omega}~. \end{equation} We call these periods the `geometric periods'. The holomorphic one-form of an elliptic curve is unique up to rescaling. The Seiberg-Witten differential $\lambda_{\rm SW}$ is a meromorphic one-form such that: \be\label{SW lambda def 0} {d \lambda_{\rm SW} \over dU}= \boldsymbol{\omega}~, \end{equation} modulo an exact 1-form. The `physical periods' are then defined as: \be a_D= \int_{\gamma_B} \lambda_{\rm SW}~, \qquad \qquad a= \int_{\gamma_A} \lambda_{\rm SW}~. \end{equation} We then indeed have: \be\label{rels om omD} \omega_D = {d a_D \over d U}~, \qquad \omega_a = {d a\over d U}~,\qquad \qquad \tau= {\omega_D \over \omega_a}= {\d a_D \over \d a}~. \end{equation} The SW curve of $D_{S^1} E_n$, similarly to the case of the massive 4d $SU(2)$ gauge theories \cite{Seiberg:1994aj}, can be viewed, perhaps more precisely, as a genus-one Riemann surface with (generically) $n+1$ punctures, where the SW differential has simple poles with residues given by the masses (or `flavour periods') $\mu_i$ and $\mu_{\rm KK}$. For our purpose in this work, however, we can mainly bypass an explicit determination of the SW differential. It will often be enough to determine the geometric periods before using \eqref{rels om omD} to determine the electromagnetic periods up to integration constants. The latter will be fixed by matchings to known asymptotics. \paragraph{Weierstrass model and $J$-invariant.} All the SW curves considered in this work can be brought to the standard Weierstrass form: \be\label{Weierstrass form general} y^2 = 4x^3 - g_2(u) x - g_3(u)~, \end{equation} by a change of coordinates.\footnote{When viewing the SW curve as a compact curve, the Weierstrass equation can be read as the cubic $Y^2 = 4 X^3 - g_2 X Z^4- g_3 Z^6$ with $[X,Y,Z]=\mathbb{P}^2_{[2,3,1]}$. Here we are working on the patch $Z=1$. In fact, even though we call $\Sigma_U$ `an elliptic curve', we will remain somewhat agnostic about the precise mathematical definition. In some string-theory geometric engineering scenarios, it appear more natural to view the SW curve as an affine curve in $(\mathbb{C}^\ast)^2$ instead of a curve in projective space. These subtle differences of perspective will not affect our physical discussion. \label{footnote:P231} We used SAGE \protect\cite{sagemath} to find the explicit Weierstrass form of various curves (for instance for the `toric' mirror curves reviewed below or for various 4d curves from the literature).} Here, $u=(U, M, \cdots)$ denotes local coordinates on the base of the elliptic fibration. The discriminant of the curve is the function: \be \Delta(u) \equiv g_2(u)^3 - 27g_3(u)^2~. \end{equation} At fixed mass parameters, the roots of the polynomial $\Delta(U)$ give us the locations of the $U$-plane singularities. It is also very useful to consider the $J$-invariant: \be\label{J of u def} J(u)= {1\over 1728} j(u) = {g_2(u)^3 \over \Delta(u)}~, \end{equation} which is an absolute invariant of the curve (while $g_2$ and $\Delta$ depend on the choice of variables). Importantly, $J$ is a modular function when written in terms of the modular parameter $\tau$. It takes the following universal form: \be J(\tau) = {E_4(\tau)^3 \over E_4(\tau)^3 - E_6(\tau)^2}~, \end{equation} in terms of Eisenstein series. We refer to appendix~\ref{App:Congruence} for a review of useful facts about modular groups and modular forms. Let us note that the zeroes of the Eisenstein series on the canonical fundamental domain of the upper-half plane are at $\tau = \zeta_3$ and $\tau = i$ for $E_4$ and $E_6$, respectively, with $\zeta_3 = e^{2\pi i\over 3}$. These are elliptic points for the ${\rm SL}(2,\mathbb{Z})$ group. We have $J(\zeta_3) = 0$ and $J(i) = 1$. \begin{table} \centering \begin{tabular}{|c | c||c|c|c|| c|c|c| } % \hline fiber & $\tau$ &ord$(g_2)$ &ord$(g_3)$ & ord$(\Delta)$ & $\mathbb{M}_\ast$ & 4d physics & $\mathfrak{g}$ flavour \\ \hline\hline $I_k$ & $i \infty $& $0$ &$0$ & $k$ & $T^k$ & SQED & $\mathfrak{su}(k)$ \\ \hline $I_{k}^\ast$ &$i \infty$& $2$ &$3$ & $k+6$ & $PT^{k}$ & $SU(2)$, $N_f= 4+k > 4$ & $\mathfrak{so}(2k+8)$ \\ \hline $I_{0}^\ast$ &$\tau_0$& $\geq 2$ &$\geq 3$ & $6$ & $P$ & $SU(2)$, $N_f= 4$ & $\mathfrak{so}(8)$\\ \hline $II$ &$e^{{2\pi i \over 3}}$& $\geq 1$ &$1$ & $2$ & $(ST)^{-1}$ & AD$[A_1, A_2] = H_0$ & - \\ \hline $II^\ast$ &$e^{{2\pi i \over 3}}$& $\geq 4$ &$5$ & $10$ & $ST$ &MN $E_8$&$ \mathfrak{e}_8$ \\ \hline $III $&$i$ & $1$ &$\geq 2$ & $3$ & $S^{-1}$ & AD$[A_1, A_3] = H_1$ &$\mathfrak{su}(2)$\\ \hline $ III^\ast $&$i$& $3$ &$\geq 5$ & $9$ & $S$&MN $E_7$&$ \mathfrak{e}_7$\\ \hline $IV$ &$e^{{2\pi i \over 3}}$& $\geq 2$ &$2$ & $4$ & $(ST)^{-2}$ & AD$[A_1, D_4] = H_2$ & $\mathfrak{su}(3)$ \\ \hline $ IV^\ast$ &$e^{{2\pi i \over 3}}$ & $\geq 3$ &$4$ & $8$ & $(ST)^{2}$ & MN $E_6$&$ \mathfrak{e}_6 $ \\ \hline \end{tabular} \caption{Kodaira classification of singular fibers and associated 4d low-energy physics. The $I_k$ fibers are also called `multiplicative' or `semi-stable' fibers. ($I_0$ is the `stable' generic smooth fiber.) All the other types of fibers are called `additive' or `unstable'. \label{tab:kodaira}} \end{table} \paragraph{Kodaira classification and infrared physics.} The possible singularities of our Seiberg-Witten geometry are captured by the Kodaira classification of singular fibers. The singularity type can be read off from the Weierstrass form of the curve by looking at the order of vanishing at $U= U_\ast$ of $g_2$, $g_3$ and of the discriminant: \be g_2 \sim (U-U_\ast)^{\text{ord}(g_2)}~, \qquad g_3 \sim (U-U_\ast)^{\text{ord}(g_3)}~, \qquad \Delta \sim (U-U_\ast)^{\text{ord}(\Delta)}~. \end{equation} The different type of fibers, in Kodaira's notation, are listed in table~\ref{tab:kodaira}. This gives us a crucial tool to identify the types of singularities in the low-energy physical description, given the Seiberg-Witten geometry \cite{Ganor:1996pc}.% \footnote{In this work, we will only consider fibers that are `split' in the sense of~\protect\cite{Bershadsky:1996nh} -- see also~\protect\cite{Katz:2011qp}. } We already discussed the $I_k$ fibers. In the context of the 5d $E_n$ SW curves, we have an $I_{9-n}$ singularity at $U=\infty$, as shown in \eqref{Minfty}. We can also have an $I_k$ singularity in the interior of the $U$-plane, which is interpreted as $k$ BPS particles of the same charge becoming massless. The local physics at the singularity is then that of massless SQED with $k$ electrons, which is an IR-free theory. This is consistent with the fact that the effective inverse gauge coupling is $\tau=i\infty$ at that point. This theory has a Higgs branch which is isomorphic to the moduli space of one $SU(k)$ instanton.\footnote{This follows, for instance, from compactification to 3d together with 3d $\mathcal{N}=4$ mirror symmetry \protect\cite{Intriligator:1996ex}.} Therefore, there is a `quantum Higgs branch' emanating from such a point on the $U$-plane and, in particular, there is an $\mathfrak{su}(k)$ flavour symmetry associated to this type of singularity. The second and third type of singularity in table~\ref{tab:kodaira}, called $I_k^\ast$, has a monodromy conjugate to $PT^k$. The low-energy physics is that of a 4d $\mathcal{N}=2$ $SU(2)$ gauge theory with $N_f=4+k$ flavours, which is IR-free for $k>0$, and conformal for $k=0$. Its Higgs branch is the moduli space of one $SO(8+2k)$ instanton, and the flavour symmetry algebra is $\mathfrak{so}(8+2k)$. The Kodaira singularities of type $II$, $III$ and $IV$ realise the three `classic' rank-one Argyres-Douglas theories \cite{Argyres:1995jj, Argyres:1995xn}. These are non-trivial 4d $\mathcal{N}=2$ SCFTs with fractional scaling dimensions for the Coulomb branch operator (${6\over 5}$, ${4\over 3}$ and ${3\over 2}$, respectively). The flavour symmetry of the $H_0$ theory (Kodaira fiber $II$) is trivial, while the flavour symmetry of the $H_1$ and $H_2$ theory is $\mathfrak{su}(2)$ and $\mathfrak{su}(3)$, respectively. The latter two have a Higgs branch which is the moduli space of one $SU(2)$ or $SU(3)$ instanton, respectively. Finally, the Kodaira singularities of type $II^\ast$, $III^\ast$ and $IV^\ast$ correspond to the $E_n$ Minahan-Nemeschansky theories for $n=6,7,8$ \cite{Minahan:1996fg, Minahan:1996cj}, as indicated in the table. These 4d SCFTs have a Higgs branch isomorphic to the moduli space of one $E_n$ instanton. \paragraph{Picard-Fuchs equations.} Consider a one-parameter families of curves, $\Sigma_U$, by setting the various mass parameters to definite values. We consider the Weierstrass form \eqref{Weierstrass form general}, with $g_2(U)$ and $g_3(U)$ some polynomials in $U$, and we would like to determine the geometric periods: \be \omega = \int_{\gamma} \boldsymbol{\omega}~, \qquad \qquad \boldsymbol{\omega}= {dx\over y}~, \end{equation} with $\gamma$ any one-cycle $\gamma \in H_1(\Sigma_U)$. These periods satisfy a second-order linear differential equation, the Picard-Fuchs equation, which reads: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{PF eq general} \Delta(U) {d^2 \omega\over dU^2} + P(U) {d\omega \over d U} + Q(U)\, \omega= 0~, \eea with $P(U)$ and $Q(U)$ determined in terms of $g_2$ and $g_3$: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} & P(U)&=&{27 g_3 J^2\over g_2^4 J'} \Big( { -7 g_2{}^3 g_2' g_3'+9 g_2{}^2 g_2'{}^2 g_3 +108 g_2 g_3 g_3'{}^2-135 g_2' g_3{}^2 g_3' }\cr &&&\qquad \qquad\quad {+2 g_2{}^4 g_3'' - 3 g_2{}^3 g_2'' g_3 -54 g_2 g_3{}^2 g_3''+81 g_2'' g_3{}^3}\Big)~,\cr & Q(U)&=&{27 g_3 J^2\over 16 g_2^4 J'} \Big( {-8 g_2{}^3 g_2'' g_3' +8 g_2{}^3 g_2' g_3'' +216 g_2'' g_3{}^2 g_3' -216 g_2' g_3{}^2 g_3''} \cr &&&\qquad \qquad\quad {-18 g_2{}^2 g_2'{}^2 g_3' +21 g_2 g_2'{}^3g_3 +120 g_2 g_3'{}^3-108 g_2' g_3 g_3'{}^2} \Big)~. \eea Here, $J=J(U)$ is defined as in \eqref{J of u def}, and $f'\equiv{df\over dU}$ for any $f(U)$. By direct computation, one can check that \eqref{PF eq general} is equivalent to the following universal PF equation for $\Omega(J)$, a function of the $J$-invariant itself \cite{Klemm:1994wn, Brandhuber:1996ng}: \be \label{UniversalPicardFuchsEqn} {d^2\Omega \over dJ^2} + {1 \over J} {d\Omega \over dJ} + {31J - 4 \over 144J^2(1-J)^2}\Omega = 0~. \end{equation} This $\Omega$ is related to the geometric period $\omega$ by: \be \omega(U) = \sqrt{g_2(U)\over g_3(U)} \, \Omega(J(U))~. \end{equation} The solutions to this universal equation are known. In particular, we then have the following expression for the geometric periods $\omega_a$: \be\label{omegaa generic sol} \omega_a = {d a\over dU}= C_0 \sqrt{ {g_2(U) \over g_3(U)}} \sqrt{ {E_6(\tau) \over E_4(\tau)}} \end{equation} with $C_0$ some normalization constant to be determined. In practice, one can then obtain a useful expression for $\omega_a(U)$ by writing down $\tau(U)$ around $\tau=i\infty$, at any given order. To do this, consider the series expansion of the $J$-invariant: \be\label{j of tau} j(\tau)= 1728J(q) = {1 \over q} + 744 + 196884~q + 21493760~q^2 + \mathcal{O}\left(q^3\right)~, \end{equation} with $q\equiv e^{2\pi i \tau}$, and its inverse: \be \tau(j) = {1\over 2\pi i } \left(- \log(j(U)) + {744 \over j(U)} + {473652 \over j(U)^2} + {451734080 \over j(U)^3} + \mathcal{O}\left({1 \over j(U)^4}\right)\right)~. \end{equation} The dual period, $a_D$, can then be written as an expansion in that large-$U$ limit by using \eqref{rels om omD}, at least in principle. Note also that the expression \eqref{j of tau} can be re-expanded at large $U$ to obtain an explicit expression for $U(\tau)$. That is often quite useful, as we will see in examples. \subsection{Large-volume limit and mirror Calabi-Yau threefold}\label{subsec: lvgeom} In the type-IIA description of the $D_{S^1} E_n$ Coulomb branch, the BPS particles are D-branes wrapping holomorphic cycles inside the local del Pezzo geometry, at least semi-classically. (More generally, they are $\Pi$-stable objects in the derived category of coherent sheaves of $\widetilde \MG_{E_n}$ \cite{Douglas:2000ah}.) The associated `exact periods' are the `quantum volumes' of the D0-, D2- and D4-branes. In the large volume limit, we have: \be \Pi_{\rm D4} = \int_{\mathcal{B}_4} e^{(B+iJ)} {\rm ch}(L_\varepsilon) {\sqrt{{\rm Td}(T\mathcal{B}_4) \over {\rm Td}(N\mathcal{B}_4)}} + \mathcal{O}(\alpha')~, \end{equation} for the wrapped D4-brane. Here $J$ is the K\"ahler form, which is complexified by the $B$-field, and $L_\varepsilon$ is a (spin$^c$) line bundle, which must often be non-trivial \cite{Freed:1999vc}. The period of a D2-brane wrapped on any 2-cycle $\mathcal{C}^k \subset \mathcal{B}_4$ is given by the corresponding complexified K\"ahler parameter: \be \Pi_{{\rm D2}_{\mathcal{C}^k}} = t_k \equiv \int_{\mathcal{C}^k} (B+iJ)~. \end{equation} We also have $\Pi_{\rm D0}=1$, the D0-brane being stable at any point on the K\"ahler moduli space. For $n>0$, we view $dP_n$ as the blow up of $\mathbb{F}_0\cong \mathcal{C}_f\times \mathcal{C}_b$ at $n-1$ points, with exceptional curves $E_i$ ($i=1, \cdots, n-1$) as mentioned above -- see appendix \ref{app:Enchar}. We then choose a basis of K\"ahler parameters: \be t_f = \int_{\mathcal{C}_f} (B+i J)~, \qquad t_b = \int_{\mathcal{C}_b} (B+i J)~, \qquad t_{E_i} = \int_{E_i} (B+i J)~, \;\; i=1, \cdots, n-1~. \end{equation} Note that these parameters are only defined up to shifts by integers, due to large gauge transformations of the $B$-field. For any curve $\mathcal{C}$, we also define the single-valued parameter: \be\label{QCC def} Q_\mathcal{C} \equiv e^{2\pi i t_\mathcal{C}}~. \end{equation} Thus, the large K\"ahler volume limit for any effective curve $\mathcal{C}$ is equivalent to $Q_\mathcal{C}\rightarrow 0$. \medskip \noindent Let $\{\mathcal{C}^k\}$ be some basis of $H_2(\mathcal{B}_4, \mathbb{Z})$, with the intersection pairing: \be \mathcal{C}^k \cdot \mathcal{C}^l = \mathcal{I}^{kl}~. \end{equation} We also choose the worldvolume flux on the D4-brane to be: \be {1\over 2\pi}\int_{\mathcal{C}^k} F = \varepsilon_k~. \end{equation} These fluxes must generally be non-zero and half-integer, due to the Freed-Witten anomaly cancellation condition \cite{Freed:1999vc}: \be c_1(L_\varepsilon) + {1\over 2} c_1(\mathcal{K}) \in H^2(\mathcal{B}_4, \mathbb{Z})~. \end{equation} On the other hand, any integer-quantized flux on the D4-brane could be set to zero by a large gauge transformation of the $B$-field. The latter transformation corresponds to a large-volume monodromy. We then have: \be\label{PiD4explicit0} \Pi_{\rm D4} = {1\over 2} \sum_{k, l} (t_k+\varepsilon_k) \mathcal{I}^{kl} (t_l+\varepsilon_l) +{ \chi(\mathcal{B}_4)\over 24} + \mathcal{O}(\alpha')~. \end{equation} Note that the parameters $\varepsilon_k$ just amount to shifting $t_k$ by some half-integers. For the IIA geometries that are obtained by blowing up $\mathbb{F}_0$,% \footnote{Thus, in all cases except for $E_0$ and $\widetilde E_1$, which we can treat separately.} it will be convenient to choose another basis of K\"ahler parameters, denoted by $a$, $\mu_0$ and $\mu_i$ ($i=1, \cdots, n-1$), with: \be\label{def t to a m} t_f= 2a~, \qquad t_b= 2a + \mu_0~, \qquad t_{E_i}= a+ \mu_i~. \end{equation} The parameter $a$ is the low-energy photon in the `electric' frame. In the $SU(2)$ gauge-theory limit, the D2-brane wrapped on $\mathcal{C}_f$ is identified with the $W$-boson, and the factor of $2$ in \eqref{def t to a m} corresponds to the `$SU(2)$' normalisation of the electric charge such that it has charge $2$; similarly, the other identifications in \eqref{def t to a m} corresponds to the electric and flavour charges of the other D2 particles, {\it i.e.} five-dimensional instanton particles and flavour hypermultiplets. Note that the parameters $\mu_0$, $\mu_i$ are pure flavour parameters, in that the corresponding (non-effective) curves $\mathcal{C}_\mu$ have vanishing intersection with the compact four-cycle $\mathcal{B}_4\subset \widetilde\MG$. Consequently, they lie along the $E_n^-$ lattice in \eqref{lattice En B4}. From \eqref{PiD4explicit0}, we then find: \be \label{PiD4explicit1} \Pi_{\rm D4} =2a (2a+\mu_0) - {1\over 2} \sum_{i=1}^{n-1}(a+\mu_i+\varepsilon_i)^2+ {n+3\over 24} + \mathcal{O}(Q)~, \end{equation} where we chose $\varepsilon_f=\varepsilon_b=0$. Once we identify the $W$-boson as coming from a D2-brane wrapping $\mathcal{C}_f$ (and, more generally, the `electric' particles as being the wrapped D2-branes), then the wrapped D4-brane is identified with the magnetic monopole. We then have: \be a_D= {\d\mathcal{F}\over \d a}= \Pi_{\rm D4}~, \end{equation} and the large volume result \eqref{PiD4explicit1} then corresponds to a prepotential: \be\label{CF cubic lv} \mathcal{F}= \left(\mu_0 - {1\over 2} \sum_{i=1}^{n-1} \widetilde\mu_i \right) a^2 + {9-n\over 6} a^3 + \left({n+3\over 24}- {1\over 2} \sum_{i=1}^{n-1} \widetilde\mu_i^2 \right)a+ \mathcal{O}(Q)~, \end{equation} where we defined the shifted masses $\widetilde\mu_i \equiv \mu_i +\varepsilon_i$. This should be compared to the 5d prepotential for $SU(2)$ with $N_f=n-1$, which reads \cite{Intriligator:1997pq}: \be \mathcal{F}_{\rm 5d} = m_0 \sigma^2 + {4\over 3} \sigma^3 - {1\over 6} \sum_{i=1}^{n-1} \sum_\pm\Theta(\pm \sigma+ m_i) (\pm \sigma+ m_i)^3~, \end{equation} in the conventions of \cite{Closset:2018bjz}. We indeed recover the 5d prepotential from \eqref{CF cubic lv}, in the appropriate limit and in a specific K\"ahler chamber: \be \mathcal{F}_{\rm 5d} = \lim_{\beta\rightarrow \infty} {i\over \beta^3} \mathcal{F}~, \qquad \quad \sigma > |m_j|~, \; \;\; j=0, \cdots, n-1~, \end{equation} using the fact that ${\rm Im}(a)= \beta \sigma$ and ${\rm Im}(\mu_j) = \beta m_j$. \subsubsection{Local mirror symmetry for the toric models}\label{subsec:toric mirror} For $n\leq 3$, the $E_n$ singularity in Type IIA is also a toric Calabi-Yau threefold. The corresponding toric diagrams are: \be\label{toric diags} \begin{tikzcd} \begin{tikzpicture}[x=.8cm,y=.8cm] \draw[step=.8cm,gray,very thin] (-1,-1) grid (1,1); \draw[ligne] (-1,-1)--(0,-1)--(1,0)--(1,1)--(0,1)--(-1,0)--(-1,-1); \node[bd] at (-1,0)[label=left:{{\scriptsize$c_1$}}] {}; \node[bd] at (-1,-1)[label=left:{{\scriptsize$c_2$}}] {}; \node[bd] at (0,-1)[label=right:{{\scriptsize$c_3$}}] {}; \node[bd] at (1,0)[label=right:{{\scriptsize$c_4$}}] {}; \node[bd] at (1,1)[label=right:{{\scriptsize$c_5$}}] {}; \node[bd] at (0,1)[label=left:{{\scriptsize$c_6$}}] {}; \node[bd] at (0,0)[label=above:{{\scriptsize$\;\;\;\;\;c_0$}}] {}; \node[] at (0,1.6) {\small{$E_3$}} {}; \end{tikzpicture} \arrow[r] &\begin{tikzpicture}[x=.8cm,y=.8cm] \draw[step=.8cm,gray,very thin] (-1,-1) grid (1,1); \draw[ligne] (0,-1)--(1,0)--(1,1)--(0,1)--(-1,0)--(0,-1); \node[bd] at (-1,0)[label=left:{{\scriptsize$c_1$}}] {}; \node[bd] at (0,-1)[label=right:{{\scriptsize$c_3$}}] {}; \node[bd] at (1,0)[label=right:{{\scriptsize$c_4$}}] {}; \node[bd] at (1,1)[label=right:{{\scriptsize$c_5$}}] {}; \node[bd] at (0,1)[label=left:{{\scriptsize$c_6$}}] {}; \node[bd] at (0,0)[label=above:{{\scriptsize$\;\;\;\;\;c_0$}}] {}; \node[] at (0,1.6) {\small{$E_2$}} {}; \end{tikzpicture} \arrow[r] \arrow[d] & \begin{tikzpicture}[x=.8cm,y=.8cm] \draw[step=.8cm,gray,very thin] (-1,-1) grid (1,1); \draw[ligne] (0,-1)--(1,0)--(0,1)--(-1,0)--(0,-1); \node[bd] at (-1,0)[label=left:{{\scriptsize$c_1$}}] {}; \node[bd] at (0,-1)[label=right:{{\scriptsize$c_3$}}] {}; \node[bd] at (1,0)[label=right:{{\scriptsize$c_4$}}] {}; \node[bd] at (0,1)[label=left:{{\scriptsize$c_6$}}] {}; \node[bd] at (0,0)[label=above:{{\scriptsize$\;\;\;\;\;c_0$}}] {}; \node[] at (0,1.6) {\small{$E_1$}} {}; \end{tikzpicture} \\ & \begin{tikzpicture}[x=.8cm,y=.8cm] \draw[step=.8cm,gray,very thin] (-1,-1) grid (1,1); \draw[ligne] (0,-1)--(1,1)--(0,1)--(-1,0)--(0,-1); \node[bd] at (-1,0)[label=left:{{\scriptsize$c_1$}}] {}; \node[bd] at (0,-1)[label=right:{{\scriptsize$c_3$}}] {}; \node[bd] at (1,1)[label=right:{{\scriptsize$c_5$}}] {}; \node[bd] at (0,1)[label=left:{{\scriptsize$c_6$}}] {}; \node[bd] at (0,0)[label=above:{{\scriptsize$\;\;\;\;\;c_0$}}] {}; \node[] at (0,-1.8) {\small{$\widetilde E_1$}} {}; \end{tikzpicture} \arrow[r] & \begin{tikzpicture}[x=.8cm,y=.8cm] \draw[step=.8cm,gray,very thin] (-1,-1) grid (1,1); \draw[ligne] (0,-1)--(1,1)--(-1,0)--(0,-1); \node[bd] at (-1,0)[label=left:{{\scriptsize$c_1$}}] {}; \node[bd] at (0,-1)[label=right:{{\scriptsize$c_3$}}] {}; \node[bd] at (1,1)[label=right:{{\scriptsize$c_5$}}] {}; \node[bd] at (0,0)[label=above:{{\scriptsize$\;\;\;\;\;c_0$}}] {}; \node[] at (0,-1.8) {\small{$E_0$ }} {}; \end{tikzpicture} \end{tikzcd} \end{equation} Here, the arrows denote the possible partial resolutions of the singularities, which correspond to massive deformations of the 5d SCFTs. Let us then consider the $E_3$ singularity first, since the other toric singularities can be obtained from it by this partial resolution process. The internal point in the toric diagram, indicated by $c_0$ in \eqref{toric diags}, corresponds to the compact divisor $D_0 \cong \mathcal{B}_4 = dP_3$. Associated to each external point, indicated by $c_i$, $i=1, \cdots, 6$, we have a non-compact toric divisor $D_i$ of the threefold, which intersects the compact divisor along curves $\mathcal{C}_i$ inside the resolved singularity, $\mathcal{C}_i\cong D_0 \cdot D_i$, The intersection numbers between toric divisors and curves are captured by the following table, which is equivalent to the data of a GLSM \cite{Witten:1993yc}: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{dP3 glsm} \begin{tikzpicture}[x=.9cm,y=.9cm,baseline={([yshift=-.5ex]current bounding box.center)}] \draw[ligne] (-1,-1)--(0,-1)--(1,0)--(1,1)--(0,1)--(-1,0)--(-1,-1); \draw[ligne] (-1,-1)--(1,1); \draw[ligne] (-1,0)--(1,0); \draw[ligne] (0,-1)--(0,1); \node[bd] at (-1,0)[label=left:{{\scriptsize$D_1$}}] {}; \node[bd] at (-1,-1)[label=left:{{\scriptsize$D_2$}}] {}; \node[bd] at (0,-1)[label=below:{{\scriptsize$D_3$}}] {}; \node[bd] at (1,0)[label=right:{{\scriptsize$D_4$}}] {}; \node[bd] at (1,1)[label=right:{{\scriptsize$D_5$}}] {}; \node[bd] at (0,1)[label=above:{{\scriptsize$D_6$}}] {}; \node[bd] at (0,0)[label=below:{{\scriptsize$\;\;\;\; \; D_0$}}] {}; \end{tikzpicture} \qquad\quad \begin{tabular}{| c|c cccccc|c|} \hline & $D_1$ & $D_2$& $D_3$& $D_4$& $D_5$& $D_6$& $D_0$ & FI\\%heading \hline $\mathcal{C}_1$ & $-1$ & $1$& $0$ & $0$ & $0$ & $1$ & $-1$ & $\xi_1$\\ $\mathcal{C}_2$ & $1$ & $-1$& $1$ & $0$ & $0$ & $0$ & $-1$ & $\xi_2$\\ $\mathcal{C}_3$ & $0$ & $1$& $-1$ & $1$ & $0$ & $0$ & $-1$ & $\xi_3$\\ $\mathcal{C}_5$ & $0$ & $0$& $0$ & $1$ & $-1$ & $1$ & $-1$ & $\xi_5$\\ \hline $\mathcal{C}_4 $& $0$ & $0$& $1$ & $-1$ & $1$ & $0$ & $-1$ & $\xi_4$\\ $\mathcal{C}_6$ & $1$ & $0$& $0$ & $0$ & $1$ & $-1$ & $-1$ & $\xi_6$\\ \hline \end{tabular} \eea Note the linear equivalences $\mathcal{C}_4 \cong \mathcal{C}_1+ \mathcal{C}_2- \mathcal{C}_5$ and $\mathcal{C}_6\cong \mathcal{C}_2 + \mathcal{C}_3- \mathcal{C}_5$. The triangulated toric diagram shown in \eqref{dP3 glsm} corresponds to the smooth local $dP_3$ geometry. The real parameters $\xi_i$ are the K\"ahler volumes of the curves $\mathcal{C}_i$ in the local threefold -- they are the `FI parameters' in the GLSM language. The K\"ahler cone is spanned by $(\xi_1, \xi_2, \xi_3, \xi_5)\in \mathbb{R}^4$ satisfying: \be \xi_1\geq 0~, \quad \xi_2\geq 0~, \quad \xi_3\geq 0~, \quad \xi_5\geq 0~, \quad \xi_1+\xi_2 - \xi_5\geq 0~, \quad \xi_2+ \xi_3 - \xi_5\geq 0~. \end{equation} Other phases can be obtained by successive flops, therefore moving onto the extended K\"ahler cone of the singularity, which maps out the full extended Coulomb branch of the 5d SCFT $E_3$ \cite{Closset:2018bjz}. Viewing $dP_3$ as the blow-up of $\mathbb{F}_0$ at two points, we have the natural basis of curves discussed in subsection \ref{subsec:geom engin}: $\mathcal{C}_f$ and $\mathcal{C}_b$ are the `fiber' and `base' curves, respectively, and $E_1$ and $E_2$ are the two exceptional curves. This basis is related to the curves shown in \eqref{dP3 glsm} by: \be\label{CbCfE1E2} \mathcal{C}_f= \mathcal{C}_1 + \mathcal{C}_2~, \qquad \mathcal{C}_b= \mathcal{C}_2 + \mathcal{C}_3~,\qquad E_1 = \mathcal{C}_5~, \qquad E_2 = \mathcal{C}_2~. \end{equation} In the 5d $SU(2)$, $N_f=2$ gauge-theory description, the M2-branes wrapped over $\mathcal{C}_f$ and $\mathcal{C}_b$ give us the W-boson and the instanton particle, respectively, while the M2-branes wrapped over $E_1$ or $E_2$ give rise to hypermultiplets.% \footnote{We are following the analysis of \protect\cite{Closset:2018bjz}, where the gauge theory description is read off from a `vertical reduction' of the toric diagram.} The $E_1$ fixed point inself has an enhanced $E_3= SU(3)\times SU(2)$ symmetry. The simple roots of $E_3$ are in one-to-one correspondence with the curves: \be \mathcal{C}_{\alpha_1} = \mathcal{C}_b-\mathcal{C}_f~, \qquad\mathcal{C}_{\alpha_2} = \mathcal{C}_f- E_1-E_2~, \qquad \mathcal{C}_{\alpha_3} = E_1-E_2~, \end{equation} which intersect inside $dP_3$ according to the $E_3$ Cartan matrix. : \be \mathcal{C}_{\alpha_i} \cdot\mathcal{C}_{\alpha_j} = -A_{ij}={\small \mat{-2 & 1 & 0 \\ 1 & -2 & 0\\0& 0&-2}}~. \end{equation} Note that, using the 5d gauge-theory parameters \eqref{def t to a m}, the K\"ahler parameters associated to the roots are: \be t_{\alpha_1}= \mu_0~, \qquad t_{\alpha_2}= -\mu_1-\mu_2~, \qquad t_{\alpha_3}= \mu_1-\mu_2~. \end{equation} See appendix~\ref{app:Enchar} for more details on the 5d gauge-theory parameterisation. \paragraph{Local mirror description.} Let us now consider the mirror description of the extended Coulomb branch, as the complex structure deformations of the mirror threefold in IIB: \be D_{S^1} E_n\quad \longleftrightarrow\quad \text{IIA on} \; \mathbb{R}^4 \times \widetilde\MG \quad\longleftrightarrow\quad \text{IIB on} \;\mathbb{R}^4 \times \widehat\MGY \end{equation} For any toric singularity, the local mirror threefold, $ \widehat\MGY$, is given by a hypersurface in $\mathbb{C}^2 \times (\mathbb{C}^\ast)^2$, with equation \cite{Hori:2000kt}: \be\label{mirror hypersurface} \widehat\MGY = \left\{v_1 v_2 + F(t,w)=0 \; \big| \; (v_1, v_2)\in \mathbb{C}^2~, \; \; (t,w)\in (\mathbb{C}^\ast)^2\right\}~. \end{equation} Here, $F(t,w)$ is the Newton polynomial associated with the toric diagram, which takes the general form: \be F(t,w)= \sum_{m\in \Gamma_0} c_m t^{x_m} w^{y_m}~, \end{equation} where the sum runs over all the points in the toric diagram $\Gamma_0\subset \mathbb{Z}^2$, with coordinates $(x_m, y_m)$. The coefficients $c_m$ are the complex structure parameters of the mirror, modulo the gauge equivalences: \be\label{F gauge transfo U13 s} F(t, w) \sim s_0 F(s_1 t, s_2 w)~, \qquad (s_0, s_1, s_2)\in (\mathbb{C}^\ast)^3~. \end{equation} Let us associate to each effective curve $\mathcal{C}\subset \widetilde \MG$ a complexified K\"ahler parameter $Q_\mathcal{C}= e^{2\pi i t_\mathcal{C}}$ as in \eqref{QCC def}. Given a GLSM description of $\widetilde \MG$, as in \eqref{dP3 glsm}, the mirror parameter $z_\mathcal{C}$ is given by: \be z_\mathcal{C} = \prod_{m\in \Gamma_0} (c_m)^{q^m}~, \qquad q^m \equiv \mathcal{C} \cdot D_m~. \end{equation} Here, $D_m$ is the toric divisor associated to the point $m\in \Gamma_0$. This is normalized such that we have $ z_\mathcal{C}\approx Q_f$ in the large volume limit, or equivalently: \be t_f ={1\over 2\pi i}\log(z_f) + \mathcal{O}(z)~. \end{equation} The hypersurface \eqref{mirror hypersurface} is a so-called suspension of the affine curve: \be \Sigma= \{F(t,w)=0\} \subset (\mathbb{C}^\ast)^2~, \end{equation} and we may focus on the later. One may view the threefold $\widehat \MGY$ as a double fibration of $\Sigma$ and $\mathbb{C}^\ast$ over some complex plane $\{W\}\cong \mathbb{C}$, as we will review in section \protect\ref{subsec:RES and mirror}. The BPS particles arise from D3-branes wrapping supersymmetric 3-cycles which can be constructed explicitly in a standard way \cite{Klemm:1996bj, Hori:2000ck}. The exact periods are then given by the classical periods of the holomorphic 3-form on $\widehat\MGY$, which can be reduced to a line integral along a one-cycle $\gamma= S^3_\gamma \cap \Sigma$ on the curve $\Sigma$: \be \Pi_\gamma = \int_{S^3_\gamma} \Omega= \int_{\gamma} \lambda_{\rm SW}~. \end{equation} From these considerations, one finds the following Seiberg-Witten differential: \be \lambda_{\rm SW}= \log{t}\, {dw \over w}~, \end{equation} up to an overall numerical constant. \paragraph{The $E_3$ curve.} The mirror curve for the local $dP_3$ geometry is given by: \be\label{E3 curve gen} F_{dP_3}(w, t)= {1\over t}\left( c_1 + {c_2\over w}\right) + {c_3\over w} + c_6 w+ c_0+ t \left( c_4+ c_5 w\right)~. \end{equation} We denote by: \be z_f= {c_3 c_6\over c_0^2}~, \qquad z_b= {c_1 c_4\over c_0^2}~, \qquad z_{E_1}= {c_4 c_6\over c_5 c_0}~, \qquad z_{E_2}= {c_1 c_3\over c_2 c_0}~, \end{equation} the complex-structure parameters mirror to the K\"ahler volume of the curves \eqref{CbCfE1E2}. We find it useful to introduce the parameters $U$, $\lambda$, $M_1$ and $M_2$ such that: \be z_f= {1\over U^2}~, \qquad z_b= { \lambda\over U^2}~, \qquad z_{E_1}= -{1\over U M_1}~, \qquad z_{E_2}= -{1\over U M_2}~. \end{equation} Using the gauge freedom \eqref{F gauge transfo U13 s}, we may set $c_3=c_6=1$, $c_1=c_4$, and choose $c_0 = - U$, so that the $E_3$ Seiberg-Witten curve reads: \be\label{toric E3 curve} E_3\; : \qquad {\sqrt{\lambda}\over t}\left(1 + {M_2\over w}\right) + {1\over w} + w- U+ t \sqrt{\lambda} \left( 1+ M_1 w \right) =0~. \end{equation} The CB parameter $U$ is chosen such that: \be\label{U to a approx} U \approx {1\over \sqrt{Q_f}} = e^{-2\pi i a} \end{equation} at large volume, while the mass parameters $\lambda, M_1, M_2$ are related to the 5d gauge parameters as by the mirror map: \be\label{lambda to M} \lambda = {Q_b\over Q_f}= e^{2\pi i m_0}~, \qquad M_i =- {\sqrt{Q_f}\over Q_{E_i}}=e^{-2\pi i \widetilde \mu_i}= - e^{-2\pi i \mu_i}~, \quad i=1,2~, \end{equation} setting $\varepsilon_i={1\over 2}$ (mod $1$) for the exceptional 2-cycles $E_i$ in $\mathcal{B}_4 \cong {\rm Bl}_{n-1}(\mathbb{F}_0)$. Here, $\lambda$ corresponds to the 5d gauge coupling, and $M_1$, $M_2$ correspond to the two hypermultiplet masses. These `flavour' complex-structure parameters, which we will often call `the masses' by a slight abuse of terminology, are such that the massless limit corresponds to $\lambda=M_i=1$. Unlike the relation \eqref{U to a approx} between $U$ and $a$, which is corrected by worldsheet instantons from the IIA point of view, the large-volume relations \eqref{lambda to M} are exact in $\alpha'$, as is the case for any K\"ahler parameter $t_\mathcal{C}$ in $\widetilde \MG$ Poincar\'e dual to a non-compact divisor. \paragraph{The $E_2$ curve.} Let us consider the successive 5d mass deformations shown in \eqref{toric diags}, to obtain the curves for the other toric $E_n$ singularities. To obtain the $E_2$ geometry, we need to flop the curve $\mathcal{C}_2\subset dP_3$ and take it to large negative volume. This corresponds to the limit of large negative 5d mass, $m_2\rightarrow -\infty$, which is the limit $M_2\rightarrow 0$. This is equivalent to setting $c_2=0$ in \eqref{E3 curve gen}. We then obtain the curve: \be \label{E2Curve} E_2\; : \qquad {\sqrt{\lambda}\over t}+ {1\over w} + w- U+ t \sqrt{\lambda} \left( 1+ M_1w \right) =0~, \end{equation} The 5d gauge-theory phase is $SU(2)$ with $N_f=1$. The GLSM description of the $E_2$ toric geometry reads as follows: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{dP2 glsm} \begin{tikzpicture}[x=.9cm,y=.9cm,baseline={([yshift=-.5ex]current bounding box.center)}] \draw[ligne] (0,-1)--(1,0)--(1,1)--(0,1)--(-1,0)--(0,-1); \draw[ligne] (0,0)--(1,1); \draw[ligne] (-1,0)--(1,0); \draw[ligne] (0,-1)--(0,1); \node[bd] at (-1,0)[label=left:{{\scriptsize$D_1$}}] {}; \node[bd] at (0,-1)[label=below:{{\scriptsize$D_3$}}] {}; \node[bd] at (1,0)[label=right:{{\scriptsize$D_4$}}] {}; \node[bd] at (1,1)[label=right:{{\scriptsize$D_5$}}] {}; \node[bd] at (0,1)[label=above:{{\scriptsize$D_6$}}] {}; \node[bd] at (0,0)[label=below:{{\scriptsize$\;\;\;\; \; D_0$}}] {}; \end{tikzpicture} \qquad\quad \begin{tabular}{| c|c ccccc|c|} \hline & $D_1$ & $D_3$& $D_4$& $D_5$& $D_6$& $D_0$ & FI\\%heading \hline $\mathcal{C}_f= \mathcal{C}_1$ & $0$ & $1$& $0$ & $0$ & $1$ & $-2$ & $\xi_1$\\ $\mathcal{C}_b=\mathcal{C}_3$ & $1$ & $0$& $1$ & $0$ & $0$ & $-2$ & $\xi_3$\\ $E_1= \mathcal{C}_5$ & $0$ & $0$& $1$ & $-1$ & $1$ & $-1$ & $\xi_5$\\ \hline $\mathcal{C}_4 \cong \mathcal{C}_1-\mathcal{C}_5$& $0$ & $1$ & $-1$ & $1$ & $0$ & $-1$ & $\xi_4$\\ $\mathcal{C}_6\cong \mathcal{C}_3-\mathcal{C}_5$ & $1$ & $0$ & $0$ & $1$ & $-1$ & $-1$ & $\xi_6$\\ \hline \end{tabular} \eea \paragraph{The $E_1$ curve.} Starting from the $E_2$ theory in its gauge-theory phase, we can integrate out the hypermultiplet with either $m_1 \rightarrow -\infty$ or $m_1 \rightarrow \infty$ in 5d, which gives us the $SU(2)_0$ or the $SU(2)_\pi$ 5d gauge theory, respectively. In the first limit, we have $M_1 \rightarrow 0$ and therefore we find the $E_1$ curve: \be\label{E1 toric curve} E_1\; : \qquad \sqrt{\lambda} \left({1\over t} + t \right) + {1\over w} + w- U=0~. \end{equation} For completeness, let us recall the GLSM description of the resolved $E_1$ singularity: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{F0 glsm} \begin{tikzpicture}[x=.9cm,y=.9cm,baseline={([yshift=-.5ex]current bounding box.center)}] \draw[ligne] (0,-1)--(1,0)--(0,1)--(-1,0)--(0,-1); \draw[ligne] (-1,0)--(1,0); \draw[ligne] (0,-1)--(0,1); \node[bd] at (-1,0)[label=left:{{\scriptsize$D_1$}}] {}; \node[bd] at (0,-1)[label=below:{{\scriptsize$D_3$}}] {}; \node[bd] at (1,0)[label=right:{{\scriptsize$D_4$}}] {}; \node[bd] at (0,1)[label=above:{{\scriptsize$D_6$}}] {}; \node[bd] at (0,0)[label=below:{{\scriptsize$\;\;\;\; \; D_0$}}] {}; \end{tikzpicture} \qquad\quad \begin{tabular}{| c|c cccc|c|} \hline & $D_1$ & $D_3$& $D_4$& $D_6$& $D_0$ & FI\\%heading \hline $\mathcal{C}_f= \mathcal{C}_1\cong \mathcal{C}_4$ & $0$ & $1$& $0$ & $1$ & $-2$ & $\xi_1$\\ $\mathcal{C}_b=\mathcal{C}_3\cong\mathcal{C}_6$ & $1$ & $0$& $1$ & $0$ & $-2$ & $\xi_3$\\ \hline \end{tabular} \eea \paragraph{The $\widetilde E_1$ curve.} This case is distinct from the all other $E_n$ with $n>0$, since $dP_1\cong \mathbb{F}_1$ is not a blow-up of $\mathbb{F}_0$. Instead, we have the non-trivial fibration: \be \mathcal{C}_f\rightarrow \mathbb{F}_1 \rightarrow \mathcal{C}_b~. \end{equation} The GLSM description reads: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{dP1 glsm} \begin{tikzpicture}[x=.9cm,y=.9cm,baseline={([yshift=-.5ex]current bounding box.center)}] \draw[ligne] (0,-1)--(1,1)--(0,1)--(-1,0)--(0,-1); \draw[ligne] (-1,0)--(0,0); \draw[ligne] (0,-1)--(0,1); \draw[ligne] (1,1)--(0,0); \node[bd] at (-1,0)[label=left:{{\scriptsize$D_1$}}] {}; \node[bd] at (0,-1)[label=below:{{\scriptsize$D_3$}}] {}; \node[bd] at (1,1)[label=right:{{\scriptsize$D_5$}}] {}; \node[bd] at (0,1)[label=above:{{\scriptsize$D_6$}}] {}; \node[bd] at (0,0)[label=below:{{\scriptsize$D_0\;\;\;\;\;$}}] {}; \end{tikzpicture} \qquad\quad \begin{tabular}{| c|c cccc|c|} \hline & $D_1$ & $D_3$& $D_5$& $D_6$& $D_0$ & FI\\%heading \hline $\mathcal{C}_f= \mathcal{C}_1\cong \mathcal{C}_5$ & $0$ & $1$& $0$ & $1$ & $-2$ & $\xi_1$\\ $\mathcal{C}_b=\mathcal{C}_3$ & $1$ & $1$& $1$ & $0$ & $-3$ & $\xi_3$\\ \hline $\mathcal{C}_6\cong \mathcal{C}_3-\mathcal{C}_5$ & $1$ & $0$& $1$ & $-1$ & $-1$ & $\xi_5$\\ \hline \end{tabular} \eea Let us note that the instanton particle, which is the D2-brane wrapping $\mathcal{C}_b$, has electromagnetic charge $(m,q)=(0,3)$, since $D_0\cdot \mathcal{C}_b=-3$. We then have the identification: \be t_f= 2 a~, \qquad t_b = 3a+\mu_0~, \end{equation} which is distinct from \eqref{def t to a m}. Starting from the $E_2$ curve, we should take the limit $M_1 \rightarrow \infty$. Using the gauge freedom \eqref{F gauge transfo U13 s}, we first rescale $t\rightarrow t/\sqrt{M_1}$ and redefine $\lambda \rightarrow \lambda/ \sqrt{M_1}$. We then have: \be\label{E1t toric SWcurve} \widetilde E_1\; : \qquad \sqrt{\lambda} \left({1\over t} + t w \right) + {1\over w} + w- U =0~. \end{equation} \paragraph{The $E_0$ curve.} Finally, we can take the limit from $\widetilde E_1$ to $E_0$, which corresponds to a `negative 5d gauge coupling', $\lambda \rightarrow \infty$. We should first perform a gauge transformation \eqref{F gauge transfo U13 s} with $(s_0, s_1, s_2)=(\lambda^{-{1\over 3}}, \lambda^{-{1\over 3}}, \lambda^{{1\over 6}})$, rescale $U \rightarrow 3 \lambda^{{1\over 3}} U$ (the factor $3$ being there for future convenience), and then take the limit $\lambda \rightarrow \infty$. One then obtains: \be\label{E0 toric curve} E_0\; : \qquad {1\over t} + {1\over w} + t w - 3 U=0~. \end{equation} The local $\mathbb{P}^2$ geometry (also known as $dP_0$) has the GLSM description: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{dP0 glsm} \begin{tikzpicture}[x=.9cm,y=.9cm,baseline={([yshift=-.5ex]current bounding box.center)}] \draw[ligne] (0,-1)--(1,1)--(-1,0)--(0,-1); \draw[ligne] (-1,0)--(0,0); \draw[ligne] (0,-1)--(0,0); \draw[ligne] (1,1)--(0,0); \node[bd] at (-1,0)[label=left:{{\scriptsize$D_1$}}] {}; \node[bd] at (0,-1)[label=below:{{\scriptsize$D_3$}}] {}; \node[bd] at (1,1)[label=right:{{\scriptsize$D_5$}}] {}; \node[bd] at (0,0)[label=below:{{\scriptsize$D_0\;\;\;\;\;$}}] {}; \end{tikzpicture} \qquad\quad \begin{tabular}{| c|c ccc|c|} \hline & $D_1$ & $D_3$& $D_5$&$D_0$ & FI\\%heading \hline $H$ & $1$ & $1$& $1$ & $-3$ & $\xi$\\ \hline \end{tabular} \eea \paragraph{4d limit.} It is also interesting to consider the four-dimensional `geometric-engineering' limit of the $E_3$ curve \eqref{toric E3 curve}, given by the small-$\beta$ limit. We pick: \be\label{w to x} w= e^{-2\pi \beta x}~, \end{equation} for the coordinate $w$, as well as: \be \label{4dLimitCurves} \lambda = \left(2\pi i \beta \Lambda_{(2)}\right)^2~, \qquad M_1= - e^{2\pi \beta m_1}~, \qquad M_2= - e^{-2\pi \beta m_2}~, \end{equation} for the mass parameters,% \footnote{We changed the sign of $m_2$ in 4d, in keeping with conventions used later in the text.} keeping $\Lambda_{(2)}$ fixed. This scale is identified with the dynamical scale of 4d $\mathcal{N}=2$ $SU(2)$ with two flavours. Recall, that, for $SU(2)$ with $N_f$ flavours, we have: \be \Lambda_{(N_f)}^{b_0}= \mu^{b_0} e^{2 \pi i \tau(\mu)}~, \qquad b_0= 4-N_f~, \qquad \tau= {\theta\over 2 \pi}+ {4\pi i \over g^2_{\rm 4d}}~. \end{equation} We identify the 5d and 4d gauge couplings at the threshold scale $\mu \sim {1\over \beta}$, according to $\beta m_0\propto {1\over g^2_{\rm 4d}}$. The 5d $U$-parameter and the 4d $u$-parameter can be matched as: \be\label{U to u E3} U = 2+ 4\pi^2 u \beta^2+ O(\beta^3)~, \qquad u =\langle {\rm Tr}(\Phi^2)\rangle \approx -a^2~, \qquad \Phi= -{i\over \sqrt2}\mat{a& 0 \\ 0& -a}~. \end{equation} We then obtain the 4d curve: \be {\Lambda (x+m_1)\over t}+ \Lambda t (x+m_2) + x^2 -u=0~, \end{equation} with the replacement $t\rightarrow -i t$ done for convenience. Due to the change of coordinate \eqref{w to x}, the 4d curve is now a curve in $\mathbb{C}\times \mathbb{C}^\ast$. The residual $\mathbb{Z}_2$ symmetry of the 4d $u$-plane for the $N_f=2$ curve is restored by shifting $u$ by an $a$-independent term, namely: $\widetilde u = u - \Lambda^2/2$. As pointed out in \cite{Manschot:2019pog}, this leads to $a$-independent terms in the prepotential, which have no effect on the low-energy effective action. From the five-dimensional curve perspective, we can view this as a mixing of the $\mathcal{O}(\beta^2)$ term in \eqref{U to u E3} with $\lambda$, due to the fact that the parameters $u$ and $\Lambda_{(2)}^2$ have the same scaling dimension. Such mixings will be a general feature of 4d limits. The identification \eqref{4dLimitCurves} is in agreement with Nekrasov partition function computations in 4d and in 5d, as discused in section~\ref{sec:grav} and appendix~\ref{app:nek}. Similar 4d limits can be taken from the $E_2$, $E_1$ and $\widetilde{E}_1$ curves, with: \be \lambda_{E_2} = -i\left(2\pi i \beta \Lambda_{(1)}\right)^3~, \qquad \lambda_{E_1} = \lambda_{\widetilde{E}_1} = \left(2\pi i \beta\Lambda_{(0)}\right)^4~. \end{equation} For both the $E_1$ and the $\widetilde{E}_1$ theory, this gives us the curve corresponding to the pure $SU(2)$ gauge theory in four-dimensions: \be \frac{\Lambda^2_{(0)}}{t} + \Lambda^2_{(0)}t + x^2 - u = 0~. \end{equation} Similarly, the limit on the Weierstrass form of the $E_2$ curve leads to a four-dimensional curve isomorphic to: \be \frac{\Lambda_{(1)}}{t}(x+m_1) + \Lambda_{(1)}^2t + x^2 - u = 0~. \end{equation} We give the Weierstrass form of all these curves in appendix \ref{app:SWcurves}. \subsubsection{The $E_n$ Seiberg-Witten curves}\label{subsec:Encurves} While the mirror curves for the local toric $dP_n$ geometries ({\it i.e.} $n\leq 3$) can be found from the toric data, the curves for the non-toric cases ($n\geq 4$) can be determined as limits of the $E$-string theory SW curve \cite{Ganor:1996pc, Eguchi:2002fc, Eguchi:2002nx}, or, alternatively, using toric-like diagrams \cite{Kim:2014nqa}. These curves are most easily written in terms of the $E_n$ characters: \be \chi^{E_n}_{\mathcal{R}} (\nu) = \sum_{\rho\in \mathcal{R}} e^{2\pi i \rho(\nu)}~, \end{equation} for $\rho=(\rho_i)$ the weights of the representation $\mathcal{R}$, and $\nu=(\nu_i)$ the $E_n$ flavour parameters, with the index $i \in \{1, \ldots, n\}$. The relation between these parameters and the 5d gauge-theory parameters can be found as explained in appendix \ref{app:Enchar}. The curves are written explicitly in Weierstrass form in appendix \ref{app:SWcurves}. The massless $E_n$ curves correspond to the $S^1$ reduction of the 5d SCFTs, with no mass deformations turned on. The massless limit of these curves is obtained by setting the characters equal to the dimension of the corresponding representation. For the $E_{6,7,8}$ theories, they read: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} E_8~:~ & y^2 = 4x^3 - {1 \over 12}U^4 x +\frac{1}{216} (U-864) U^5~, \\ E_7~:~ & y^2 = 4x^3 - \frac{1}{12} (U-36) (U+12)^3 x +\frac{1}{216} (U-60) (U+12)^5~, \\ E_6~:~ & y^2 = 4x^3 - \frac{1}{12} (U-18) (U+6)^3 x + \frac{1}{216} (U^2-24 U+36) (U+6)^4~, \\ \eea with the following singular fibers at finite $U$: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} E_8~:~ & \quad II^* \oplus I_1~, \\ E_7~:~ & \quad III^* \oplus I_1~, \\ E_6~:~ & \quad IV^* \oplus I_1~. \eea This manifestation of the flavour symmetry in the mirror threefold occurs for all $E_n$ theories. Furthermore, from this configuration of singular fibers it is straightforward to obtain the four-dimensional limit of these theories. This is done by identifying the $I_1$ singularities with the KK charge and decoupling it from the bulk by `zooming in' around the $E_n$ type Kodaira singularity on the $U$-plane. Is is well known that these flow in 4d to the Minahan-Nemeschansky (MN) theories \cite{Minahan:1996fg, Minahan:1996cj}, which have the following scaling dimensions for the Coulomb-branch parameter: $(\Delta_{E_8},\Delta_{E_7},\Delta_{E_6}) = (6,4,3)$. Thus, we have: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} E_8~:~ & \quad (U,x,y) \longrightarrow (\beta^6 u, \beta^{10}x, \beta^{15}y)~,\\ E_7~:~ & \quad (U,x,y) \longrightarrow (\beta^4u - 12, \beta^{6}x, \beta^{9}y)~, \\ E_6~:~ & \quad (U,x,y) \longrightarrow (\beta^3 u -6, \beta^4x, \beta^6y)~, \eea including constant shifts to bring the relevant singularity to the origin of the $u$-plane. This leads to the massless SW curves for the four-dimensional MN theories: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} E_8^{({\rm 4d})}~:~ & \quad y^2 = 4x^3 - 4u^5~, \\ E_7^{({\rm 4d})}~:~ & \quad y^2 = 4x^3 + 4 u^3 x~, \\ E_6^{({\rm 4d})}~:~ & \quad y^2 = 4x^3 + u^4~, \eea which are standard $E_n$ double-point singularities at the origin of $(x,y,u)\in \mathbb{C}^3$. One can also reproduce the deformation patterns of these singularities by keeping track of the various 5d mass parameters \cite{Eguchi:2002nx, Eguchi:2002fc}. The other massless $E_n$ curves can be analysed in a similar way. One finds that the $U$-plane has the following singularities, in addition to the $I_{9-n}$ singularity at infinity \cite{Ganor:1996pc}: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} E_5~:~ & \quad I_1^* \oplus I_1~,\\ E_4~:~ & \quad I_5 \oplus I_1 \oplus I_1~, \\ E_3~:~ & \quad I_3 \oplus I_2 \oplus I_1~, \\ E_2~:~ & \quad I_2 \oplus I_1 \oplus I_1 \oplus I_1 ~, \\ E_1~:~ & \quad I_2 \oplus I_1 \oplus I_1~, \\ \widetilde E_1~:~ & \quad I_1 \oplus I_1 \oplus I_1 \oplus I_1~, \\ E_0~:~ & \quad I_1 \oplus I_1 \oplus I_1~. \eea The 4d low-energy effective field theories obtained from the circle compactification of the 5d $E_{n}$ SCFTs are IR free for $n<6$. Interestingly, the $E_5$ theory, which has a gauge-theory phase corresponding to $SU(2)$, $N_f = 4$ in five dimensions, becomes an $SU(2)$ theory with $N_f = 5$ upon $S^1$ reduction, which matches the $E_5=\mathfrak{so}(10)$ symmetry of the UV theory. In some sense, the `instanton particle' becomes a perturbative hypermultiplet in four-dimensions, but it is more accurate to say that the full IR-free $SU(2)$ description is a magnetic dual description of the UV theory. For the $E_4$ theory, we have an $I_5$ point, corresponding to SQED with five flavours, which again reproduces the $E_4= \mathfrak{su}(5)$ symmetry. Note that the $E_3$ theory is special in that there are now two distinct points with a non-trivial Higgs branch. This matches with the fact that the Higgs branch of the 5d SCFT $E_3$ is the union of two cones, on which each of the two factors in $E_3= \mathfrak{su}(3)\oplus \mathfrak{su}(2)$ act independently. In 4d, the instanton corrections separate the two Higgs branch cones along the complexified Coulomb branch. Similarly, the $E_2$ and $E_1$ theories both have an $\mathfrak{su}(2)$ symmetry that is reproduced by an $I_2$ singularity. On the other hand, the abelian part of $E_2= \mathfrak{su}(2)\oplus \mathfrak{u}(1)$ and $\widetilde E_1= \mathfrak{u}(1)$ is encoded in the Seiberg-Witten geometry in a more subtle manner, which we will discuss in the next section. \section{Rational elliptic surfaces, Mordell-Weil group and global symmetries}\label{section:RES} In the previous section, we mentioned the flavour symmetry {\it algebra} of various rank-one theories, but it is natural to ask whether one can also determine the global form of the {\it flavour symmetry group} -- that is, the group that acts faithfully on gauge-invariant states -- directly from the SW geometry. For the massless $E_n$ theory, the Higgs branch is always isomorphic to the moduli space of one $E_n$-instanton, or equivalently to the minimal nilpotent orbit of $E_n$. (Except for $\widetilde E_1$ and $E_2$, which one should discuss separately.) These Higgs branches are consistent with the actual flavour symmetry group of the massless theory being: \be\label{flavour sym En} G_F= {\rm E}_n/{\rm Z}({\rm E}_n)~, \end{equation} where ${\rm E}_n$ denotes the simply-connected Lie group with Lie algebra $E_n$, and ${\rm Z}({\rm E}_n)$ denotes its center -- see table~\ref{tab:centersEn}. Very recently, the flavour symmetry group was determined to be precisely the centerless \eqref{flavour sym En} by looking at the 5d BPS states in M-theory \cite{Apruzzi:2021vcu} -- see also~\cite{BenettiGenolini:2020doj} and the index computation in~\cite{Kim:2012gu}. In this work, we will give two complementary derivations of that same fact, both from the 4d Coulomb-branch point of view. In addition, we will discuss the abelian symmetries, and any flavour symmetry-breaking pattern, in a unified manner, by taking full advantage of the elliptic fibration structure of the rank-one SW geometry. In order to do so, it is useful to introduce some additional formalism, namely the theory of rational elliptic surfaces.% \footnote{For further background on this subject, we refer to the very accessible book by Sch\"utt and Shioda \protect\cite{schuttshioda}, from which much of the mathematical discussion in this section is taken. } From that more global perspective, one can study the physics of $D_{S^1} E_n$ throughout its whole parameter space rather systematically and efficiently. This perspective also leads to an improved understanding of the `well-known' 4d gauge theories and SCFTs, as we will discuss in the next section. \subsection{The Seiberg-Witten geometry as a rational elliptic surface} Consider the SW geometry \eqref{SW geom 0} at fixed mass parameters. We write it as as an elliptic fibration: \be E \longrightarrow \mathcal{S} \overset{\pi}{\longrightarrow} \mathbb{P}^1~, \end{equation} where the genus-zero base $\overline\mathcal{M}_C \cong \mathbb{P}^1$ is the $U$-plane with the point at infinity added, and the fiber $E$ is the Seiberg-Witten curve. Its minimal Weierstrass model reads: \be\label{Weirestrass model} y^2 = 4x^3 - g_2(U) x - g_3(U)~, \end{equation} which is a single equation in the complex variables $(x, y, U)$, thus describing a dimension-two complex variety. By using homogeneous coordinates (as in footnote~\ref{footnote:P231}), this can be interpreted as a projective variety. Importantly, this rational elliptic fibration has a section, called the zero {\it section} $O$, which is given explicitly by the point `at infinity', $O=(x,y)=(\infty, \infty)$ on each elliptic fiber.% \footnote{In the notation of footnote~\protect\ref{footnote:P231}, the zero section is $[X,Y,Z]=[1,1,0]$. At smooth fibers, this defines the `origin' of the elliptic curve $E\cong T^2$. } \begin{table}[] \renewcommand{\arraystretch}{1} \begin{center} \begin{tabular}{ |c||c|c|c|c|c|c|c|} \hline $n$& $1$ & $3$ & $4$& $5$& $6$& $7$& $8$\\ \hline ${\rm E}_n$& $ SU(2)$ & $ SU(3)\times SU(2)$ & $ SU(5)$& $ {\rm Spin}(10)$& ${\rm E_6}$& ${\rm E_7}$& ${\rm E_8}$ \\ \hline ${\rm Z}({\rm E}_n)$& $\mathbb{Z}_2$ & $\mathbb{Z}_3\times \mathbb{Z}_2\cong \mathbb{Z}_6$ & $\mathbb{Z}_5$& $\mathbb{Z}_4$& $\mathbb{Z}_3$ &$\mathbb{Z}_2$ & $0$ \\ \hline\end{tabular} \end{center} \caption{Simply-connected ${\rm E}_n$ groups and their centers.} \label{tab:centersEn} \end{table} The Weierstrass model \eqref{Weirestrass model} has codimension-one singularities along the discriminant locus $\Delta(U)=0$, as discussed in the last section (see table~\ref{tab:kodaira}). In the $(x,y,U)$ variables, they look locally like ADE singularities. Each singular Kodaira fiber $F_v$ at $U=U_{\ast, v}$ can then be resolved in a canonical fashion, giving us smooth reducible fibers: \be\label{Fv decompo} \pi^{-1}(U_{\ast, v})= F_{v} \cong \sum_{i=0}^{m_v-1} \widehat m_{v, i} \Theta_{v,i}~, \end{equation} where $\Theta_{v,i}$ are the $m_v$ irreducible fiber components, of multiplicity $\widehat m_{v, i}$, in $F_{v}$. If $m_v=1$, the irreducible fiber $F_v=\Theta_{v,0}$ is a genus-zero curve (a rational curve with a node or with a cusp, for $F_v$ of type $I_1$ or $II$, respectively). In all other cases, $F_v$ is reducible and the exceptional fibers together with $\Theta_{0,v}$ (all of genus zero) intersect according to the {\it affine} Dynkin diagram of $\frak{g}$, where $\frak{g}$ is the flavour algebra listed in table~\ref{tab:kodaira}, and $\widehat m_{v, i}$ are the Coxeter labels; in particular, every irreducible component $\Theta_{v,i}$ has self-intersection $-2$ and corresponds to a simple root of $\frak{g}_v$. For every resolved fiber $F_v$, the zero section $O$ intersects $F_v$ only through the fiber component $\Theta_{v,0}$ (which corresponds to the affine node in the ADE Dynkin diagram of $F_v$). Some of the relevant affine Dynkin diagrams are shown in figure~\ref{fig:affineDynkin}. The resulting smooth surface $\widetilde \mathcal{S} \rightarrow \mathcal{S}$, called the Kodaira-Neron model, is birational to the Weierstrass model $\mathcal{S}$ of the SW geometry. \begin{figure}[t] \centering \begin{subfigure}{0.25\textwidth} \centering \begin{tikzpicture}[x=20pt,y=20pt] \begin{scope} \node [] (0) at (0, 0) {}; \node [] (1) at (0, 2) {}; \node [] (4) at (1.5, 0) {}; \node [] (5) at (2.5, 2) {}; \node [] (6) at (3.5, 0) {}; \draw [style=edge 1, bend left=45] (0.center) to (1.center); \draw [style=edge 1, bend right=45] (0.center) to (1.center); \draw [style=edge 1] (4.center) to (5.center); \draw [style=edge 1] (5.center) to (6.center); \draw [style=edge 1] (4.center) to (6.center); \node [style=red dot] (2) at (0, 0) {}; \node [style=light red dot] (3) at (0, 2) {}; \node [style=red dot] (7) at (1.5, 0) {}; \node [style=light red dot] (8) at (2.5, 2) {}; \node [style=light red dot] (9) at (3.5, 0) {}; \end{scope} \end{tikzpicture} \caption{$I_2\oplus I_3 \; (E_3)$ } \end{subfigure}% \begin{subfigure}{0.25\textwidth} \centering \begin{tikzpicture}[x=20pt,y=20pt] \begin{scope} \node [] (0) at (0, 0) {}; \node [] (1) at (2, 0) {}; \node [] (2) at (2.5, 1.5) {}; \node [] (3) at (-0.5, 1.5) {}; \node [] (4) at (1, 2.5) {}; \draw [style=edge 1] (0) to (1); \draw [style=edge 1] (1) to (2); \draw [style=edge 1] (2) to (4); \draw [style=edge 1] (4) to (3); \draw [style=edge 1] (3) to (0.center); \node [style=red dot] (5) at (0, 0) {}; \node [style=light red dot] (6) at (-0.5, 1.5) {}; \node [style=light red dot] (7) at (2, 0) {}; \node [style=light red dot] (8) at (2.5, 1.5) {}; \node [style=light red dot] (9) at (1, 2.5) {}; \end{scope} \end{tikzpicture} \caption{$I_5 \; (E_4)$ } \end{subfigure}% \begin{subfigure}{0.25\textwidth} \centering \begin{tikzpicture}[x=20pt,y=20pt] \begin{scope} \node [] (0) at (0, 0) {}; \node [] (1) at (0, 2) {}; \node [] (2) at (0.75, 1) [label=below:{\scriptsize$2$}] {}; \node [] (3) at (2.25, 1) [label=below:{\scriptsize$2$}] {}; \node [] (4) at (3, 2) {}; \node [] (5) at (3, 0) {}; \draw [style=edge 1] (2) to (1); \draw [style=edge 1] (0) to (2); \draw [style=edge 1] (2) to (3); \draw [style=edge 1] (3) to (4); \draw [style=edge 1] (3) to (5); \node [style=red dot] (6) at (0, 0) {}; \node [style=light red dot] (7) at (0, 2) {}; \node [style=light red dot] (8) at (3, 2) {}; \node [style=light red dot] (9) at (3, 0) {}; \node [style=blank dot] (10) at (0.75, 1) {}; \node [style=blank dot] (11) at (2.25, 1) {}; \end{scope} \end{tikzpicture} \caption{ $I_1^\ast \; (E_5)$} \end{subfigure}% \begin{subfigure}{0.25\textwidth} \centering \begin{tikzpicture}[x=20pt,y=20pt] \begin{scope} \node [] (0) at (0, 0) [label=below:{\scriptsize$3$}] {}; \node [] (1) at (1.25, 0) [label=below:{\scriptsize$2$}] {}; \node [] (2) at (2.5, 0) {}; \node [] (3) at (-1.25, 0) [label=below:{\scriptsize$2$}] {}; \node [] (4) at (-2.5, 0) {}; \node [] (5) at (0, 1.25) [label=right:{\scriptsize$2$}] {}; \node [] (6) at (0, 2.5) {}; \draw [style=edge 1] (6) to (5); \draw [style=edge 1] (5) to (0); \draw [style=edge 1] (0) to (1); \draw [style=edge 1] (1) to (2); \draw [style=edge 1] (0) to (3); \draw [style=edge 1] (3) to (4); \node [style=red dot] (7) at (0, 2.5) {}; \node [style=light red dot] (8) at (2.5, 0) {}; \node [style=light red dot] (9) at (-2.5, 0) {}; \node [style=blank dot] (10) at (-1.25, 0) {}; \node [style=blank dot] (11) at (0, 0) {}; \node [style=blank dot] (12) at (0, 1.25) {}; \node [style=blank dot] (13) at (1.25, 0) {}; \end{scope} \end{tikzpicture} \caption{ $IV \; (E_6)$} \end{subfigure}% \\ % \begin{subfigure}{0.5\textwidth} \centering \begin{tikzpicture}[x=20pt,y=20pt] \begin{scope} \node [] (0) at (0, 0) [label=below:{\scriptsize$4$}] {}; \node [] (1) at (1.25, 0) [label=below:{\scriptsize$3$}] {}; \node [] (2) at (2.5, 0) [label=below:{\scriptsize$2$}] {}; \node [] (3) at (3.75, 0) {}; \node [] (4) at (-1.25, 0) [label=below:{\scriptsize$3$}] {}; \node [] (5) at (-2.5, 0) [label=below:{\scriptsize$2$}] {}; \node [] (6) at (-3.75, 0) {}; \node [] (7) at (0, 1.25) [label=right:{\scriptsize$2$}] {}; \draw [style=edge 1] (0) to (7); \draw [style=edge 1] (0) to (1); \draw [style=edge 1] (1) to (2); \draw [style=edge 1] (2) to (3); \draw [style=edge 1] (0) to (4); \draw [style=edge 1] (4) to (5); \draw [style=edge 1] (5) to (6); \node [style=red dot] (8) at (-3.75, 0) {}; \node [style=blank dot] (9) at (-2.5, 0) {}; \node [style=blank dot] (10) at (0, 1.25) {}; \node [style=light red dot] (11) at (3.75, 0) {}; \node [style=blank dot] (12) at (-1.25, 0) {}; \node [style=blank dot] (13) at (0, 0) {}; \node [style=blank dot] (14) at (1.25, 0) {}; \node [style=blank dot] (15) at (2.5, 0) {}; \end{scope} \end{tikzpicture} \caption{$III \; (E_7)$ } \end{subfigure}% \begin{subfigure}{0.5\textwidth} \centering \begin{tikzpicture}[x=20pt,y=20pt] \begin{scope} \node [] (0) at (0, 0) [label=below:{\scriptsize$6$}] {}; \node [] (1) at (1.25, 0) [label=below:{\scriptsize$5$}] {}; \node [] (2) at (2.5, 0) [label=below:{\scriptsize$4$}]{}; \node [] (3) at (3.75, 0) [label=below:{\scriptsize$3$}] {}; \node [] (4) at (-1.25, 0) [label=below:{\scriptsize$4$}]{}; \node [] (5) at (-2.5, 0) [label=below:{\scriptsize$2$}] {}; \node [] (7) at (0, 1.25) [label=right:{\scriptsize$3$}] {}; \node [] (16) at (5, 0) [label=below:{\scriptsize$2$}] {}; \node [] (17) at (6.25, 0) {}; \draw [style=edge 1] (0) to (7); \draw [style=edge 1] (0) to (1); \draw [style=edge 1] (1) to (2); \draw [style=edge 1] (2) to (3); \draw [style=edge 1] (0) to (4); \draw [style=edge 1] (4) to (5); \draw [style=edge 1] (3) to (16); \draw [style=edge 1] (16) to (17); \node [style=blank dot] (9) at (-2.5, 0) {}; \node [style=blank dot] (10) at (0, 1.25) {}; \node [style=blank dot] (12) at (-1.25, 0) {}; \node [style=blank dot] (13) at (0, 0) {}; \node [style=blank dot] (14) at (1.25, 0) {}; \node [style=blank dot] (15) at (2.5, 0) {}; \node [style=blank dot] (18) at (3.75, 0) {}; \node [style=blank dot] (19) at (5, 0) {}; \node [style=red dot] (20) at (6.25, 0) {}; \end{scope} \end{tikzpicture} \caption{$II \; (E_8)$ } \end{subfigure}% \caption{Examples of affine Dynkin diagrams corresponding to resolved Kodaira fibers. These are the ones that correspond to the semi-simple $E_n$ Lie algebras. The affine node $\Theta_{v, 0}$ is indicated in dark red, and the nodes with unit multiplicity ($\widehat m_{v, i}=1$) are all the nodes in (dark or light) red. The multiplicities $\widehat m_{v, i}>1$ are indicated next to the nodes. \label{fig:affineDynkin}} \end{figure} For future reference, to each reducible fiber $F_v$, let us associate the finite abelian group: \be\label{ZFv def} Z(F_v) \equiv {R_v^\vee / R_v}~, \end{equation} where $R_v$ is the root lattice of $\mathfrak{g}_v$ and $R_v^\vee$ is its dual lattice.% \footnote{In the present case of an ADE algebra, we have $R_v^\vee \cong \Lambda_v$, with $\Lambda_v$ the weight lattice of $\widetilde G_v$ such that ${\rm Lie}(\widetilde G_v)=\mathfrak{g}_v$ and $\pi_1(\widetilde G_v)=0$. } It is isomorphic to the center $Z(\widetilde G_v)$ of the simply-connected Lie group $\widetilde G_v$ associated with that algebra, and it has order: \be\label{def Nv} N_v = |Z(F_v)|= |{\rm det}(A_{\mathfrak{g}_v})|~, \end{equation} where $A_{\mathfrak{g}_v}$ denotes the Cartan matrix of the Lie algebra $\mathfrak{g}_v$. Note that $N_v$ is the number of components $\Theta_{v, i}$ of $F_v$ with $\widehat m_{v, i}=1$ in the decomposition \eqref{Fv decompo}. \subsubsection{Mathematical interlude (I): rational elliptic surfaces} What we have described so far is a rational complex surface that admits an elliptic fibration with a section. By definition,% \footnote{To be precise, we should also require that the fibration be relatively minimal, meaning that one should blow down any exceptional curve ({\it i.e.} any $(-1)$-curve) in the fiber.} $\mathcal{S}$ (or rather, its resolution $\widetilde\mathcal{S}$) is a {\it rational elliptic surface} (RES). Such surfaces are tightly constrained, and a full classification exists \cite{Persson:1990, Miranda:1990}. Any rational elliptic surface can be obtained by blowing up $\mathbb{P}^2$ at nine points -- in other words, a RES is an almost del Pezzo surface $dP_9$. In particular, it is also K\"ahler. The most important topological fact about $\widetilde \mathcal{S}$ is that it is simply-connected and that its topological Euler characteristic $e(\widetilde\mathcal{S})$ is equal to $12$. We further have that $\chi=1$ for the holomorphic Euler characteristic, and that the canonical divisor has trivial self-intersection:% \footnote{Recall that $\mathcal{K}\cdot \mathcal{K}= 9-n$ for $dP_n$. In the physics literature, RES are sometimes called ${1\over 2}$K3 surfaces.} Thus: \be b_2= h^{1,1}= 10~, \qquad\qquad h^{2,0}=0~, \qquad\qquad \mathcal{K}_{\widetilde\mathcal{S}}\cdot \mathcal{K}_{\widetilde\mathcal{S}}=0~, \qquad \end{equation} with the Betti numbers $b_k= {\rm dim}\, H_k(\widetilde\mathcal{S}, \mathbb{Z})$ and $h^{p,q}= {\rm dim}\, H^{p,q}(\widetilde\mathcal{S})$. We then have: \be {\rm NS}(\widetilde\mathcal{S})\cong H^{1,1}(\widetilde\mathcal{S}) \cap H^2(\widetilde\mathcal{S}, \mathbb{Z}) \cong \mathbb{Z}^{10}~, \end{equation} for the Neron-Severi (NS) group of $\widetilde \mathcal{S}$ -- {\it i.e.} the group of divisors modulo linear equivalences, in the present context. It is naturally endowed with an integral {\it lattice structure}, with the bilinear form given by the intersection pairing: \be {\rm NS}(\widetilde\mathcal{S}) \times {\rm NS}(\widetilde\mathcal{S}) \rightarrow \mathbb{Z}~, \qquad (D, D') \mapsto \langle D, D' \rangle_{\rm NS} \equiv D\cdot D'~. \end{equation} A beautiful mathematical fact, which we will discuss further below, is that the NS lattice of a rational elliptic surface takes the explicit form \cite{schuttshioda}: \be\label{structure of NS lattice} {\rm NS}(\widetilde\mathcal{S}) = U \oplus E_8^{-}~. \end{equation} In particular, it is unimodular and of signature $(1,9)$. Here, $U$ is the dimension-2 lattice generated by the zero section $(O)$ and the generic fiber $F \cong E$, with intersection pairing: \be U \cong {\rm Span}((O), F)~, \qquad \qquad I_U= \mat{-1 & 1 \\ 1 & 0}~, \end{equation} and $E_8^-$ is the $E_8$ lattice with an overall minus sign ({\it i.e.}, $I_{E_8^-}= - A_{E_8}$, with $A_{E_8}$ the $E_8$ Cartan matrix). Note that this generalizes to $dP_9$ the structure of the intersection pairing for the $dP_n$ surfaces ($n\leq 8$), which have lattices $\mathbb{Z} \oplus E_n^{-}$. \medskip \noindent Another very important set of global constraints is as follows. To each exceptional fiber $F_v$, one associates its Euler number, which is given by: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} &e(F_v)&=&\; {\begin{cases} m_v = k \qquad &\text{if $F_v$ is of type $I_{k>0}$ }\\ m_v +1 \qquad& \text{otherwise} \end{cases}} \cr & &=&\; {\rm ord}(\Delta) \; \text{at} \; U_{\ast, v}~, \eea where ${\rm ord}(\Delta)$ is as listed in table~\ref{tab:kodaira}. We also associate an ADE Lie algebra $\mathfrak{g}_v$ to each fiber $F_v$, including the trivial algebra for $F_v$ of type $I_1$ or $II$, with rank: \be\label{def rankFv} {\rm rank}(F_v) \equiv {\rm rank}(\mathfrak{g}_v) = m_v-1~. \end{equation} Given these definitions, we have the two conditions: \be\label{2topconds} \sum_v e(F_v) = 12~,\qquad\qquad \sum_v {\rm rank}(F_v) \leq 8~, \end{equation} which severely restrict the possible configurations of singular fibers. Using these and some more subtle geometric constraints (see in particular the discussion in subsection~\ref{subsec:MW lattice} below), the complete list of all rational elliptic surfaces was first constructed by Persson \cite{Persson:1990} and further checked by Miranda \cite{Miranda:1990}. There are exactly 289 distinct RES. We will see that a given surface can be interpreted as the Coulomb branch of several distinct $E_n$ theories on a circle; there are then 548 distinct $D_{S^1} E_n$ CB configurations in total, as summarised in table~\ref{tab:intro1} in the introduction. \paragraph{Quadratic twist and `transfer of $^*$' operation.} The allowed coordinate transformations that preserve the Weierstrass form are $(x,y) \rightarrow (f^2 x, f^3 y)$, with $f= \mathbb{C}(U)$. On the other hand, a `quadratic twist' is a rescaling of the form: \be (x, y)\rightarrow (f x, f^{3\over 2} y)~, \qquad f\in \mathbb{C}(U)~, \end{equation} which is equivalent to the rescaling: \be\label{quadratwist} (g_2, g_3) \rightarrow (f^{-2} g_2, f^{-3} g_3)~,\qquad f\in \mathbb{C}(U)~. \end{equation} A quadratic twist induces a so-called `transfer of $^*$' amongst the singular fibers, wherever $\sqrt{f}$ has branch cuts (which can be at a smooth fiber, $I_0$). The corresponding changes of fiber types are: \be I_k \leftrightarrow I_k^\ast \;\;\; (k \geq 0)~, \qquad II\leftrightarrow IV^\ast~, \qquad III\leftrightarrow III^\ast~, \qquad IV\leftrightarrow II^\ast~. \end{equation} This simple operation relates many distinct rational elliptic surfaces amongst themselves \cite{Miranda:1990}. \subsubsection{Local mirror, rational elliptic surface and the F-theory picture}\label{subsec:RES and mirror} Recall that the local Calabi-Yau threefold $\widehat {\bf Y}$ mirror to the local $dP_n$ geometry $\widetilde\MG_{E_n}$ is a suspension of the $E_n$ Seiberg-Witten curve. In the toric case, in particular, it is given by~\eqref{mirror hypersurface}. Let $F(x, y; U)=0$ denote the SW curve at a particular value of $U\in \mathbb{C}$. By introducing some complex variables $v_1, v_2$ and $W$, one can write down the threefold as a complete intersection in five variables $(x,y,v_1,v_2,W)$ \cite{Hori:2000ck}: \be\label{Y double fibration} F(x, y; W)=0~,\qquad \qquad v_1v_2= U- W~. \end{equation} This describes the mirror threefold as a double fibration over the $W$-plane, at fixed $U$ (and, implicitly, fixed mass parameters $M$): \be E\times \mathbb{C}^\ast \rightarrow \widehat {\bf Y} \rightarrow \mathbb{C}\cong \{W\}~. \end{equation} The SW curve fibered over the $W$-plane is again our RES $\mathcal{S}$, with $W$ substituted for $U$. The $\mathbb{C}^\ast \cong \mathbb{R}\times S^1_\ast$ fiber contains a non-trivial one-cycle $S^1_\ast$ which degenerates precisely when $W=U$. The Coulomb-branch BPS states arise from D3-branes wrapping Lagrangian 3-cycles $S^3_\gamma$ calibrated by the holomorphic 3-form. The latter takes the form $\Omega= \Omega_2 \wedge {dv_1\over v_1}$. The 3-cycle $S^3_\gamma$ can be constructed explicitly as follows \cite{Hori:2000ck}. Consider a path on the $W$-plane from a singularity $W=W_\ast$, where the elliptic fiber $E$ degenerates along some one-cycle $\gamma \in E$, to $W=U$, where the $\mathbb{C}^\ast$ fiber degenerates. By fibering the torus $T^2\cong \gamma \times S^1_\ast$ over that path, one spans out the closed 3-cycle $S^3_\gamma$, which is topologically a three-sphere. Let $\Gamma_2\subset S^3_\gamma$ be the two-chain with boundary along $\gamma \in E_U$ above the fiber at $W=U$, obtained by forgetting the $S^1_\ast$ fiber. We then have the periods: \be\label{periods in S} \Pi_\gamma = \int_{S^3_\gamma \subset \widehat {\bf Y}} \Omega = \int_{\Gamma\subset \mathcal{S}} \Omega_2 = \int_{\gamma\in E} \lambda_{\rm SW}~, \end{equation} with $\d\Gamma= \gamma$, provided that: \be \Omega_2 = d\lambda_{\rm SW} ~, \end{equation} inside $\mathcal{S}$. Here, the closed (and exact) 2-form $\Omega_2$ is the holomorphic symplectic 2-form on $\mathcal{S}$ that appears in the integrable-system description of Seiberg-Witten theory \cite{Donagi:1995cf}. Note that we simply have: \be\label{Omega2 explicit} \Omega_2 = \boldsymbol{\omega} \wedge dU~, \end{equation} with $ \boldsymbol{\omega}$ the holomorphic one-form of the elliptic fiber, as follows from \eqref{SW lambda def 0}; here and in the following, we freely switch back and forth between $W$ and $U$ to describe the `$U$-plane' base of the rational elliptic surface $\mathcal{S}$. It is important to note, however, that $W$ is a coordinate on the IIB geometry while $U$ is a complex structure parameter. It is the double fibration structure \eqref{Y double fibration} that allows us to substitute one for the other in the obvious way. In general, one should also consider more general paths on the $W$-plane to construct supersymmetric 3-cycles. The electro-magnetic charge of the BPS state is fixed by a choice of $\gamma$ at the `base point' $W=U$, but the path can branch out and meet several Kodaira singularities, as long as the total charge $\gamma$ is conserved. More formally, we may also consider candidate `pure flavour states', which are closed 2-cycles $\Gamma$ with $\d\Gamma=0$, constructed by connecting directly different Kodaira singularities in the appropriate manner. In all cases, it follows from \eqref{periods in S} and \eqref{Omega2 explicit} that a necessary topological condition for a 2-cycle or 2-chain $\Gamma\subset \mathcal{S}$ to give rise to a BPS state is that is has `one leg along the base and one leg along the fiber'. \paragraph{Correspondence with F-theory.} Since part of the IIB mirror symmetry appears to have an elliptic fibration, it is useful to think about it in the language of $F$-theory. In our original setup, we have a pure geometry in Type IIB with constant axio-dilaton, which is then `F-theory' on $\mathbb{R}^4\times \widehat{\bf Y}\times T^2$. If we now interpret the elliptic fiber $E$ as the axio-dilaton, instead of the trivial $T^2$ factor, the Kodaira singularities of the Weierstrass model correspond to 7-branes in the standard way. In this picture, the singularity of the $\mathbb{C}^\ast$ fibration at $W=U$ is interpreted as the position of a probe D3-brane on the $W$-plane \cite{Hori:2000ck}. This gives a nice alternative description of the $U$-plane as the geometry seen by a D3-brane in the background of some fixed 7-branes. The F-theory language offers some additional physical intuition. Firstly, it is clear in this picture that the Kodaira singularities of the SW geometry realize the non-abelian ADE-type {\it flavour symmetries} of the theory, simply because the 7-branes wrap non-compact cycles $\mathbb{C}^\ast\times T^2\subset \widehat{\bf Y}\times T^2$. The BPS states from the 2-chains $\Gamma\subset \mathcal{S}$ here correspond to {\it string junctions} on the $W$-plane, which are open-string networks connecting the D3-brane to the 7-branes in a supersymmetric fashion. Such string junctions have been extensively studied in the literature, in this very same context \cite{Gaberdiel:1997ud, Gaberdiel:1998mv, DeWolfe:1998zf, DeWolfe:1999hj, Fukae:1999zs, Mohri:2000wu, Grassi:2014ffa}. Secondly, it is well-known in F-theory that sections of the elliptic fibration are related to abelian symmetries and to the global form of the `gauge group' -- see {\it e.g.} the review~\cite{Cvetic:2018bni}. In the rest of this section, we will argue, not surprisingly given what we have written so far, that essentially the same conclusions can be reached when interpreting sections of the rank-one Seiberg-Witten geometries in terms of the 4d flavour symmetry. Let us also recall that the F-theory perspective leads to a nice interpretation of the Higgs branch that emanates from a Kodaira singularity with reducible components \cite{Banks:1996nj}. Indeed, moving onto that Higgs branch corresponds to moving the D3-brane probe on top of the 7-brane stack at $W=U_{\ast, v}$ before `dissolving' it into the 7-branes, which gives the Higgs branch as the $\widetilde G_v$ one-instanton moduli space.% \footnote{When a perturbative open-string description of this process exists (in particular, for $k$ D7-branes in the case of an $I_k$ singularity), it reproduces exactly the ADHM construction.} \paragraph{Fixing $F_\infty$, the fiber at infinity.} Consider a fixed rank-one 4d $\mathcal{N}=2$ supersymmetric field theory $\mathcal{T}_{F_\infty}$, which is either a 5d SCFT on a circle, a 4d SCFT, or a 4d $\mathcal{N}=2$ asymptotically-free theory. For each theory, we are interested in the class of all rational elliptic surfaces with a fixed singularity at $U=\infty$, whose corresponding (resolved) Kodaira fiber is denoted by $F_\infty$. The choice of $F_\infty$ fixes the `UV definition' of the field theory:% \footnote{With the important exception of $F_\infty= I_8$, which includes both $E_1$ and $\widetilde E_1$.} \be\label{CTFinf def} \mathcal{T}_{F_\infty} \qquad \longleftrightarrow \qquad \{\mathcal{S} \; | \; \pi^{-1}(\infty)= F_\infty\}~. \end{equation} For purely four-dimensional theories, this point of view was emphasized in~\cite{Caorsi:2018ahl}. As we reviewed in the previous section, the SW geometry for the KK theory $D_{S^1} E_n$ has an $I_{9-n}$ fiber at infinity, as determined by the large volume monodromy in Type IIA. We can then obtain the strictly four-dimensional theories by additional limits, thus `growing' the singularity at infinity. The 4d limits from the 5d $E_n$ SCFT to the 4d $E_n$ MN SCFT for $n=6,7,8$ correspond to the degenerations: \be F_\infty^{\rm 5d} \rightarrow F_\infty^{\rm 4d} \; :\qquad \; I_{3}\rightarrow IV\quad (E_6)~, \qquad I_{2}\rightarrow III\quad (E_7)~, \qquad \; I_{1}\rightarrow II\quad (E_8)~, \end{equation} at infinity, wherein one $I_1$ collides with the `5d' fiber at infinity $F_\infty^{\rm 5d}$ to give the `4d' fiber $F_\infty^{\rm 4d}$. Similarly, the geometric-engineering limit from the $D_{S^1} E_n$ theory with $1 \leq n\leq 5$ to the 4d $SU(2)$ gauge theory with $N_f=n-1$ corresponds to: \be F_\infty^{\rm 5d} \rightarrow F_\infty^{\rm 4d} \; :\qquad I_{8-N_f} \rightarrow I^\ast_{4-N_f}\quad (E_{N_f-1}, \, N_f=0,1,2,3,4)~, \end{equation} wherein two $I_1$'s are brought in to merge with the $I_{8-N_f}$ fiber at infinity. The correspondence between $F_\infty$ and 4d $\mathcal{N}=2$ theories was summarised in table~\ref{tab:intro1} in the introduction. The remaining choices, $F_\infty= II^\ast$, $III^\ast$ or $IV^\ast$ correspond to the Argyres-Douglas theories $H_0$, $H_1$ and $H_2$, respectively, as also discussed in \cite{Caorsi:2018ahl}. We will discuss the purely 4d theories further in section~\ref{sec:4dtheories}. Finally, we should mention that one may also consider the `generic' situation for which the fiber at infinity is trivial. The interpretation of that configuration is that we are considering the 6d $\mathcal{N}=(1,0)$ $E$-string SCFT with $E_8$ symmetry compactified on $T^2$, whose $U$-plane has the singularities \cite{Ganor:1996pc}: \be\label{6dEstring massless} \text{6d $E$-string ($F_\infty^{\rm 6d}=I_0$):}\qquad II\oplus I_1\oplus I_1~, \end{equation} in the massless limit. The 5d $E_8$ theory with $F_\infty= I_1$ is obtained from the $E$-string theory by sending one $I_1$ singularity to infinity, which corresponds to shrinking the $T^2$ to $S^1$ \cite{Eguchi:2002nx}. \subsection{Mordell-Weil group and global symmetries}\label{subsec:Phi and flav} Let us finally explain how the flavour symmetry group is encoded by the rank-one Seiberg-Witten geometry. This involves reviewing some very interesting mathematical results, following closely \cite{schuttshioda}. \subsubsection{Mathematical interlude (II): Mordell-Weil group and Shioda map} \label{subsec:MW lattice} \paragraph{The Mordell-Weil group of sections.} Any elliptic curve famously has the structure of an additive group; viewing the curve as the torus $E \cong \mathbb{C}/(\mathbb{Z}+\tau \mathbb{Z})$, the neutral element is the origin, and the addition operation is simply the addition of complex numbers. This becomes more interesting for an elliptic curve defined over the field $\mathbb{Q}$, in which case the equation $F(x,y)=0$ for the curve has a finite number of rational solutions, which form a finitely generated abelian group. More generally, we are here considering the equation \eqref{Weirestrass model} where $g_2, g_3$ are valued in $\mathbb{C}(U)$, the field of rational functions of $U$. A {\it rational section} of this elliptic fibration is a rational solution to the equation \eqref{Weirestrass model}: \be P= (x(U), y(U))~, \qquad \text{with}\quad x(U), y(U)\in \mathbb{C}(U)~. \end{equation} By the Mordell-Weil theorem, the sections of $\mathcal{S}$ form a finitely generated abelian group, which we denote by either ${\rm MW}(\mathcal{S})$ or $\Phi$.% \footnote{We will denote the MW {\it group} by $\Phi$, and use the symbol ${\rm MW}(\mathcal{S})$ for the MW {\it lattice}, to be defined below.} We then have: \be \Phi = {\rm MW}(\mathcal{S}) \cong \mathbb{Z}^{{\rm rk}(\Phi)} \oplus \mathbb{Z}_{k_1}\oplus \cdots \oplus \mathbb{Z}_{k_t}~. \end{equation} Here, ${\rm rk}(\Phi)$ is the rank of the MW group -- that is, the number of independent generators of the free part of $\Phi$. Note that the point `at infinity' $O=(\infty, \infty)$ is the neutral element of the MW group, and therefore does not contribute to the rank. The MW group also generally has a torsion component, which we denote by $\Phi_{\rm tor}$. The addition on sections in $\Phi $ is given by the standard addition of rational points of an elliptic curve. Let $P_1=(x_1, y_1)$ and $P_2=(x_2, y_2)$ be two distinct points in $\Phi $. Their sum is given by: \be P=P_1+P_2= (x,y)~, \qquad \begin{cases} x= -(x_1+x_2) +{1\over 4} \left({y_1-y_2\over x_1-x_2}\right)^2~, \\ y= -{y_1-y_2\over x_1-x_2}(x-x_1) - y_1~. \end{cases} \end{equation} For $P_1=P_2$, we have the duplication formula: \be P=2P_1= (x,y)~, \qquad \begin{cases} x= -2 x_1 +\xi^2~, \qquad\qquad\qquad \xi \equiv {12 x_1^2- g_2\over 4 y_1}~, \\ y= -2\xi (x-x_1) - y_1~. \end{cases} \end{equation} The inverse of a point $P=(x,y)$ is given by $-P=(x, -y)$, so that $P-P=O$. A section $P$ is $\mathbb{Z}_k$ torsion if $k P= P+P+\cdots +P= O$. Each section $P$ defines a divisor $(P)\in {\rm NS}(\widetilde\mathcal{S})$. \paragraph{Vertical and horizontal divisors.} One defines the {\it trivial lattice} of {\it vertical divisors} in $\widetilde \mathcal{S}$ as the sublattice ${\rm Triv}(\widetilde\mathcal{S}) \subset {\rm NS}(\widetilde\mathcal{S})$ generated by the zero section, $(O)$, and by the fiber components. We then have: \be {\rm Triv}(\widetilde\mathcal{S}) \cong U \oplus T^-~, \qquad \qquad T\equiv \bigoplus_v R_{v}~, \end{equation} where $R_v$ is the root lattices of the Lie algebra $\mathfrak{g}_v$ associated to the reducible fiber $F_v$ in the Kodaira-Neron model, with the intersection form given by the Cartan matrix. Note that: \be (I_v)_{ij}= (-A_{\mathfrak{g}_v})_{ij}= \Theta_{v, i}\cdot \Theta_{v, j}~, \end{equation} for $T^-$. We will call $T$ `the 7-brane root lattice', as a nod to the F-theory picture. We have: \be {\rm rank}(T)= \sum_v {\rm rank}(\mathfrak{g}_v)~, \end{equation} with ${\rm rank}(\mathfrak{g}_v)$ as in \eqref{def rankFv}. Note that, in accordance to \eqref{structure of NS lattice}, $T$ is a sublattice of the $E_8$ lattice. The `non-trivial' divisors, or {\it horizontal divisors}, must then span the complement of $T$ in $E_8$. They are precisely generated by the (non-zero) sections $P$; each divisor $(P)$ decomposes into a horizontal and a vertical component, but there are enough sections to generate all vertical divisors. More precisely, we have the following theorem: \be\label{Phi NS mod triv} \Phi \cong {\rm NS}(\widetilde\mathcal{S})/{\rm Triv}(\widetilde\mathcal{S})~, \end{equation} as an isomorphism of abelian groups. It follows, in particular, that: \be\label{rankMW and rankT} {\rm rk}(\Phi)=8- {\rm rank}(T)~, \end{equation} which implies the second condition in \eqref{2topconds}. The simple relation \eqref{rankMW and rankT} will be important to understand the flavour symmetry on the $U$-plane. \paragraph{The Shioda map.} The isomorphism \eqref{Phi NS mod triv} would be more useful if it could be `split', {\it i.e.} if we could embed the MW group of sections inside the NS group of divisors. This can be done at the price of tensoring with $\mathbb{Q}$. There exists a unique group homomorphism \cite{Shioda1990a}: \be\label{shioda map 0} \varphi \;:\; \Phi \rightarrow {\rm NS}(\widetilde\mathcal{S})\otimes \mathbb{Q}~, \end{equation} which maps sections to horizontal divisors with rational coefficients. In other words, we must have that $\varphi(P)=(P)$ mod ${\rm Triv}(\widetilde\mathcal{S})\otimes \mathbb{Q}$ and that: \be\label{horizontalconds} \varphi(P) \cdot (O)=0~, \qquad \varphi(P) \cdot F=0~,\qquad \varphi(P) \cdot \Theta_{v, i}=0~,\; \forall v, i~. \end{equation} The map \eqref{shioda map 0}, known as the Shioda map, is given explicitly by: \be \varphi(P)= (P) -(O)- ((P)\cdot (O)+1) F + \sum_v \sum_{i=1}^{{\rm rank}(\mathfrak{g}_v)} \lambda_{v, i}^{(P)} \Theta_{v,i}~, \end{equation} with the rational coefficients: \be \lambda_{v, i}^{(P)}= \sum_{j=1}^{{\rm rank}(\mathfrak{g}_v)} (A^{-1}_{\mathfrak{g}_v})_{ij}\, \Theta_{v, j}\cdot (P)~, \end{equation} given in terms of the inverse of the Cartan matrix of $\mathfrak{g}_v$. In particular, for each $F_v$, the coefficients $\lambda_{v, i}$ are valued in ${1\over N_v}\mathbb{Z}$, with $N_v$ defined in \eqref{def Nv}. Note also that $\lambda_{v, i}=0$, $\forall i$, if $P$ intersects the resolved Kodaira fiber $F_v$ at the `trivial' affine node $\Theta_{v, 0}$. \paragraph{The MW lattice and the narrow MW lattice.} Given two sections $P$ and $Q$, define the $\mathbb{Q}$-valued bilinear form: \be \langle P, Q\rangle = - (\varphi(P)\cdot \varphi(Q))~. \end{equation} In this way, the intersection pairing induces a (positive-definite) lattice structure on the free part of the MW group: \be {\rm MW}(\widetilde\mathcal{S})_{\rm free} \equiv \Phi / \Phi_{\rm tor}~. \end{equation} This defines the {\it Mordell-Weil lattice} (MWL). The intersection pairing on sections is called the height pairing. It is often useful to define some natural sublattices of the MW lattice. In particular, one defines the {\it narrow Mordell-Weil lattice} ${\rm MS}(\mathcal{S})_0$ as: \be\label{NarrowMWLdef} {\rm MS}(\widetilde\mathcal{S})_0 = \big\{ P \in {\rm MW}(\mathcal{S}) \;\big| \; (P) \; \text{intersects $\Theta_{v,0}$ for all $F_v$}\; \big\}~, \end{equation} with the lattice structure defined by the height pairing. Since $\lambda_{v, i}=0$ for narrow sections, the narrow MW lattice is an integral lattice. One also defines the `essential sublattice' $L$ as minus the complement of the trivial lattice inside the NS lattice: \be {\rm NS}(\widetilde\mathcal{S})= L^- \oplus {\rm Triv}(\widetilde\mathcal{S})~. \end{equation} Using the fact that the NS lattice of a RES is unimodular, one can show that the essential lattice is isomorphic to the narrow MW lattice, and that the MW lattice itself is isomorphic to the dual lattice: \be\label{thm on L} {\rm MW}(\widetilde\mathcal{S})_0 \cong L~, \qquad \qquad {\rm MW}(\widetilde\mathcal{S})_{\rm free} \cong L^\vee~. \end{equation} Finally, we have the important fact that, given \eqref{structure of NS lattice}, $L$ is the orthogonal complement of the 7-brane root lattice $T$ inside the $E_8$ lattice: \be\label{L as compl} L = T^{\perp} \; \text{in}\; E_8~. \end{equation} While $T=\oplus_v R_v$ is the root lattice of a semi-simple subalgebra $\mathfrak{g}_T= \oplus_v \mathfrak{g}_v$ of $E_8$, the essential sublattice $L$ depends not only on $\mathfrak{g}_T$ as a Lie algebra, but on its particular embedding inside $E_8$. We review some relevant facts about subalgebras of $E_8$ in appendix~\ref{appendix:subsec:subalg}. \paragraph{Torsional sections.} The kernel of the Shioda map is precisely the torsion part of the Mordell-Weil group: \be {\rm ker}(\varphi)= \Phi_{\rm tor}~. \end{equation} Equivalently, a section $P$ is torsion if and only if $\langle P, P \rangle=0$. It follows that, if $P$ is torsion, we have $\varphi(P)\cdot \Gamma=0$ for any divisor $\Gamma \in {\rm NS}(\widetilde\mathcal{S})$, and therefore we have the non-trivial integrality condition: \be\label{integral condition} \sum_v \sum_{i=1}^{{\rm rank}(\mathfrak{g}_v)} \lambda_{v, i}^{(P)} \Theta_{v,i}\cdot \Gamma \, \in \mathbb{Z}~. \end{equation} Let $T'$ denote the primitive closure of the 7-brane root lattice $T$ inside the $E_8$ lattice:% \footnote{A sublattice $M\subset N$ is called primitive if $N/M$ is torsion-free. The primitive closure of any sublattice $N$ in $M$ is the smallest primitive sublattice $N'\subset M$ that contains $N$.} \be T' = (T\otimes \mathbb{Q})\cap E_8~. \end{equation} One can prove that: \be \Phi_{\rm tor} \cong T'/T~. \end{equation} Moreover, since $T'$ is a sublattice of the dual lattice $T^\vee$, we have the important property that the torsion subgroup of the Mordell-Weil group is injective onto the center group $Z(T)= T^\vee/T$:\be \Phi_{\rm tor} \hookrightarrow Z(T) = \bigoplus_v Z(F_v)~, \end{equation} with $Z(F_v)$ defined in \eqref{ZFv def}. This embedding can be determined by explicit computation in the Kodaira-Neron model $\widetilde\mathcal{S}$. \subsubsection{Flavour symmetry group from the SW elliptic fibration} To study the flavour symmetry of a theory $\mathcal{T}_{F_\infty}$ with a Coulomb branch described by a family of rational elliptic surfaces as in \eqref{CTFinf def}, it is useful to consider two opposite limits. We first consider the `massless curve' -- in particular, we have then ${M_F}=1$ for the theories $D_{S^1} E_n$. In the massless limit, the full flavour symmetry of the UV theory should be manifest. The other limit is the `maximally massive curve', wherein the UV flavour symmetry $G_F$ is broken explicitly to a maximal torus, $U(1)^f$. \paragraph{Structure of the flavour symmetry algebra.} Consider the $U$-plane of a 4d $\mathcal{N}=2$ theory $\mathcal{T}_{F_\infty}$ with fixed masses (and/or relevant deformations) turned on, which is described by a particular RES $\mathcal{S}$ with Kodaira fibers: \be F_v = F_\infty \oplus F_1 \oplus\cdots \oplus F_k~. \end{equation} We decompose the 7-brane root lattice in terms of the contribution from infinity and of the contribution from the interior: \be T = R_\infty \oplus R_{F}~, \qquad \qquad R_F=\bigoplus_{v=1}^k R_v~, \end{equation} Here, the `flavour 7-brane root lattice' $R_F$ is the root lattice of the non-abelian flavour algebra of the theory $\mathcal{T}_{F_\infty}$ for some fixed values of the masses: \be\label{flavour alg FgNA} \mathfrak{g}^{\rm NA}_F=\bigoplus_{v=1}^k \mathfrak{g}_v~. \end{equation} On the other hand, the fiber at infinity does not contribute to the flavour symmetry. The reason for this is perhaps easiest to explain in the F-theory picture: BPS states charged under the flavour symmetry are open strings stretched between the probe D3-brane and stacks of 7-branes, which have a mass proportional to the distance between the D3- and the 7-branes. Modes of open strings stretching all the way to infinity have infinite mass, and are therefore not part of the 4d $\mathcal{N}=2$ theory under consideration. In addition, the flavour group generally includes abelian factors. They are precisely generated by infinite-order sections, $P\in \Phi_{\rm free}$. Indeed, that is how $U(1)$ gauge fields arise in F-theory \cite{Park:2011ji, Morrison:2012ei}. Consider the $E_n$ theories, for definiteness (the other 4d $\mathcal{N}=2$ theories being obtained from them in appropriate limits). In the IIB description on $\widehat {\bf Y}$, we have 3-cycles of the schematic form $\varphi(P) \times S^1_\ast$, which are mirror to `flavour' two-cycles in the $E_n$ sublattice of $H_2(\widetilde\MG, \mathbb{Z})$ \cite{Hauer:1999pt}. Reducing the $C_4$ RR gauge field of IIB on that 3-cycle, we obtain a background $U(1)$ gauge field in the low-energy description. The horizontality conditions \eqref{horizontalconds} ensure that the abelian gauge field is massless and neutral under the non-abelian flavour symmetry $\mathfrak{g}^{\rm NA}_F$. The number of abelian factors in the low-energy flavour symmetry is then given by the rank of the Mordell-Weil group, and we have the full flavour algebra: \be\label{gF general alg} \mathfrak{g}_F =\bigoplus_{s=1}^{{\rm rk}(\Phi)} \mathfrak{u}(1)_s \oplus \bigoplus_{v=1}^k \mathfrak{g}_v~, \end{equation} for any extended CB configuration described by a particular RES $\mathcal{S}$. In particular, we see from \eqref{rankMW and rankT} that: \be {\rm rank}(\mathfrak{g}_F) = 8 - {\rm rank}(F_\infty)~. \end{equation} This equation only depends on the fiber at infinity, and gives the rank of the flavour symmetry $G_F$ of $\mathcal{T}_{F_\infty}$, as indicated. The physical reason for this is clear: as we vary the mass parameters of a given theory $\mathcal{T}_{F_\infty}$, we may break the UV symmetry group $G_F$ to its maximal torus, or to any allowed subgroup, while keeping the rank fixed. This is precisely what being on the extended Coulomb branch, as opposed to the Higgs or mixed branches, means. Such extended CB deformations are realised by `fusing' or `splitting' 7-branes by continuously varying the complex structure parameters of the mirror threefold $\widehat{\bf Y}$ or, equivalently, the parameters of the Weierstrass model $\mathcal{S}$ over the $W$-plane. \paragraph{Flavour charges of the BPS states.} Consider any BPS state on the Coulomb branch, corresponding to a 2-chain $\Gamma$ in $\widetilde\mathcal{S} \subset \widehat{\bf Y}$. Its flavour charges under the non-abelian flavour symmetry $\mathfrak{g}_v\subset \mathfrak{g}_F$ associated to the Kodaira fiber $F_v$ are determined by the intersection numbers: \be w_i^{(\mathfrak{g}_v)}(\Gamma) = \Theta_{v, i}\cdot \Gamma~. \end{equation} The integers $w_i^{(\mathfrak{g}_v)}$ give us the weight vectors in the Dynkin basis, and thus determine which representations of $\mathfrak{g}_v$ are spanned by the BPS states. Any physical state of the theory $\mathcal{T}_{F_\infty}$ should have finite mass, and therefore its corresponding 2-chain $\Gamma$ should not intersect the fiber at infinity. We then have: \be\label{physical state cond} \Gamma \; \text{physical} \qquad \Leftrightarrow \qquad w_i^{(F_\infty)}(\Gamma)= \Theta_{\infty, i}\cdot \Gamma=0~, \end{equation} which can be taken as a `topological' definition of what we mean by a physical state. \paragraph{Massless limit with $G_F$ semi-simple.} Consider a theory $\mathcal{T}_{F_\infty}$ in the massless limit such that $\mathfrak{g}_F$ is semi-simple, and let $\widetilde G_F$ denote the corresponding simply-connected group. That is the case, in particular, for all the $E_n$ KK theories with the exception of $\widetilde E_1$ and $E_2$. This means that the Mordell-Weil group of $\mathcal{S}$ is purely torsion, $\Phi= \Phi_{\rm tor}$, and so ${\rm rk}(\Phi)=0$. Such rational elliptic surfaces are called {\it extremal} -- we will discuss them further in subsection~\ref{subsec:extremalRES}. The flavour algebra $\mathfrak{g}_F=\mathfrak{g}_F^{\rm NA}$ is a maximal semi-simple Dynkin sub-algebra of $E_8$ (see appendix~\ref{appendix:subsec:subalg}). As explained above, $\Phi_{\rm tor}$ injects into the finite abelian group $Z(T)= T^\vee/T$, which is: \be\label{injectPhitor} \Phi_{\rm tor} \hookrightarrow Z(T)= Z(F_\infty)\oplus Z(\widetilde G_F)~. \end{equation} In the extremal case, $T'=E_8$ and the torsion group is related to the embedding of the full 7-brane lattice inside the $E_8$ lattice: \be \Phi_{\rm tor} \cong E_8/T~. \end{equation} Let us denote by $\mathcal{Z}^{[1]}$ the subgroup of sections that are narrow in the interior of the $U$-plane: \be \mathcal{Z}^{[1]} = \big\{ P \in \Phi_{\rm tor} \;\big| \; (P) \; \text{intersects $\Theta_{v,0}$ for all $F_{v\neq \infty}$}\; \big\}~, \end{equation} and let us denote by $\mathscr{F}$ the cokernel of the inclusion map $\mathcal{Z}^{[1]} \rightarrow \Phi_{\rm tor}$. In other words, $\mathscr{F}$ is the abelian group defined by the short exact sequence: \be\label{SES tor} 0\rightarrow \mathcal{Z}^{[1]}\rightarrow \Phi_{\rm tor} \rightarrow \mathscr{F}\rightarrow 0~. \end{equation} Note that $\mathscr{F}$ is a subgroup of $Z(\widetilde G_F)$. Given the injection \eqref{injectPhitor}, we can write any element of $\Phi_{\rm tor}$ as $P\sim (z_\infty, z_F)$, where $z_\infty \in Z(F_\infty)$ and $z_F\in Z(\widetilde G)_F$. The subgroup $\mathcal{Z}^{[1]}$ corresponds to elements of the form $P\sim (z_\infty, 0)$, while the group $\mathscr{F}$ contains all the elements in the image of the projection map $ (z_\infty, z_F) \mapsto z_F$. We then claim that the {\it flavour symmetry group} of the theory $\mathcal{T}_{F_\infty}$ is given by: \be\label{GF exact} G_F = \widetilde G_F/ \mathscr{F}~. \end{equation} The argument for \eqref{GF exact} is similar to the one given in the F-theory context \cite{Aspinwall:1998xj, Mayrhofer:2014opa, Cvetic:2017epq}. One should consider all possible {\it closed} 2-cycles $\Gamma \in {\rm NS}(\widetilde\mathcal{S})$, which give rise to formal `pure flavour' states. The existence of torsion sections $P_{\rm tor}$ constrains the allowed weights of the pure flavour states due to the integrability condition \eqref{integral condition}, which gives: \be \sum_{l=1}^{{\rm rank}(F_\infty)} \lambda_{\infty, l}^{(P_{\rm tor})} w_i^{(F_\infty)} +\sum_{i=1}^{{\rm rank}(\mathfrak{g}_F^{\rm NA})} \lambda_{v, i}^{(P_{\rm tor})} w_i^{(\mathfrak{g}_F^{\rm NA})} \, \in \mathbb{Z}~. \end{equation} For the pure flavour states that satisfy the physical state condition \eqref{physical state cond}, we have: \be\label{contraints Fsections} \sum_{i=1}^{{\rm rank}(\mathfrak{g}_F^{\rm NA})} \lambda_{v, i}^{(P_{\rm tor})} w_i^{(\mathfrak{g}_F^{\rm NA})} \, \in \mathbb{Z}~, \qquad \forall \,P_{\rm tor}\in \mathscr{F}~. \end{equation} The only sections that contribute to the constraint \eqref{contraints Fsections} are the elements of $ \mathscr{F}$ since, by definition, the `interior-narrow' sections in $\mathcal{Z}^{[1]}\subset \Phi_{\rm tor} $ lead to the constraint: \be\label{contraints Z1sections} \sum_{i=1}^{{\rm rank}(F_\infty)} \lambda_{\infty, i}^{(P_{\rm tor})} w_i^{(F_\infty)} \, \in \mathbb{Z}~, \qquad \forall \, P_{\rm tor}\in \mathcal{Z}^{[1]} ~, \end{equation} which is trivial on physical states. This determines \eqref{GF exact} as the effectively acting non-abelian group on pure flavour states. We should note that the actual BPS states, which correspond to two-chains ending on the fiber above $W=U$ and thus carry electro-magnetic charge, will typically be charged under the center of $\widetilde G_F$, but the heuristic argument above shows that the `gauge invariant states' are only charged under the smaller group $G_F$. We will also check this claim explicitly in many examples, using a more direct but essentially equivalent argument presented in subsection~\ref{subsec:flavfromspec}. We should also note that the `interior-narrow' section constraint \eqref{contraints Z1sections} would be non-trivial when dealing with defect states, which are BPS D3-branes on non-compact 3-cycles stretching all the way to infinity. This leads us to the natural {\it conjecture} that this group is isomorphic to the one-form symmetry of the field theory: \be\label{conject on 1form} \mathcal{Z}^{[1]} \cong \text{1-form symmetry of $\mathcal{T}_{F_\infty}$.} \end{equation} We will show that this agrees with all the known results. For instance, if the conjecture holds, it must be true that, for a fixed $F_\infty$, $ \mathcal{Z}^{[1]}$ remains the same for any configuration of the singular fibers $\{F_v\}$ in the interior, which is a very strong constraint. We leave a more detailed discussion and derivation of \eqref{conject on 1form} for future work. In particular, it would be important to relate precisely the group $ \mathcal{Z}^{[1]}$ with the defect group of the UV theory, which can be computed directly from the mirror threefold $\widehat{\bf Y}$ \cite{Closset:2020scj, DelZotto:2020esg}. In the case of the $D_{S^1} E_1$ theory, we will observe that the full Mordell-Weil torsion encodes the $\mathbb{Z}_4$ two-group symmetry recently discovered in~\cite{Apruzzi:2021vcu}. We then have the more general conjecture: \be\label{conj2group} \Phi_{\rm tor} \cong \text{2-group symmetry of $\mathcal{T}_{F_\infty}$ on its Coulomb branch.} \end{equation} We again leave a deeper discussion of this point for future work.% \paragraph{Non-abelian flavour symmetry $G^{\rm NA}_F$ in general.} In any theory $\mathcal{T}_{F_\infty}$ with a flavour algebra \eqref{flavour alg FgNA} for some fixed values of the masses, the same argument as above determines the global form of the non-abelian part of the flavour symmetry group: \be\label{GF exact BIS} G_F^{\rm NA} = \widetilde G_F^{\rm NA}/ \mathscr{F}~, \end{equation} where $\mathscr{F}$ is defined as in \eqref{GF exact} in terms of the torsion part of the Mordell-Weil group. Of course, conjecture \eqref{conject on 1form} should still hold as well. \paragraph{Abelian limit with generic masses.} The opposite limit to the extremal limit is when the rank of the Mordell-Weil group is the maximal one allowed by the fiber at infinity: \be {\rm rk}(\Phi)= 8- {\rm rank}(F_\infty) ={\rm rank}(G_F)~. \end{equation} In that limit, the flavour group is abelian and thus entirely generated by sections. The singular fibers in the interior are then irreducible (that is, of type $I_1$ or $II$). This corresponds to the maximal symmetry breaking allowed on the extended CB, {\it i.e.} with generic masses turned on: \be G_F\rightarrow \prod_{s=1}^{{\rm rank}(G_F)} U(1)_s~. \end{equation} Let the sections $P_s$ be the corresponding generators of $\Phi_{\rm free}$. The divisor dual to $U(1)_s$ is given by $\varphi(P_s)$. Then, the $U(1)_s$ charge of any `pure flavour' state $\Gamma$ is given by: \be q_s(\Gamma) \equiv \varphi(P_s)\cdot \Gamma~. \end{equation} From the Shioda map, we then obtain an integrality condition: \be q_s - \sum_{i=1}^{{\rm rank}(F_\infty)} \lambda_{\infty, i}^{(P_s)} w_i^{(F_\infty)} \, \in \mathbb{Z}~. \end{equation} On states satisfying the physical condition \eqref{physical state cond}, the second contribution is trivial, and we simply have: \be q_s(\Gamma)\in \mathbb{Z} \quad \text{if $\Gamma$ is `physical'.} \end{equation} Since there is are no reducible fibers in this abelian configuration, the physical states actually span the narrow Mordell-Weil lattice \eqref{NarrowMWLdef}. Let $\Lambda_{\rm phys}$ denote the weight lattice of flavour charges for the physical states, which is then isomorphic to the narrow MWL -- in particular, it is an integral lattice. According to \eqref{thm on L} and \eqref{L as compl}, this physical flavour weight lattice is isomorphic to the complement of the 7-brane lattice at infinity inside the $E_8$ lattice: \be \Lambda_{\rm phys}\cong L \cong R_\infty^{\perp} \;\;{\rm in}\; E_8~. \end{equation} For $\mathfrak{g}_F$ semi-simple in the UV, we can check in each case (either for the 5d $E_n$ theories or for the 4d theories considered in section~\ref{sec:4dtheories}), according to the general classification results \cite{Oguiso1991TheML, schuttshioda}, that $\Lambda_{\rm phys}$ is the root lattice of $\mathfrak{g}_F$. Therefore, since $Z(G_F)\cong \Lambda_{\rm phys}/\Lambda_r$, the actual flavour group is the centerless group, $G_F= \widetilde G_F/Z(\widetilde G_F)$. This gives a complementary derivation of \eqref{GF exact} which avoids having to carefully compute the intersection of torsion sections with the reducible fibers.% \footnote{See~\protect\cite{Monnier:2017oqd} for a related argument in the context of F-theory on an elliptically fibered Calabi-Yau threefold. } \paragraph{Symmetry group $G_F$ in the general case.} In the general case of a flavour algebra \eqref{gF general alg}, physical states $\Gamma$ carry both weights under $\mathfrak{g}^{\rm NA}_F$ and abelian charges: \be w_i^{(\mathfrak{g}_v)}(\Gamma) = \Theta_{v, i}\cdot \Gamma~, \qquad \qquad q_s(\Gamma) \equiv \varphi(P_s)\cdot \Gamma~. \end{equation} The allowed weights are constrained by torsion sections as in \eqref{contraints Fsections}, and the abelian charges satisfy the conditions: \be\label{cond on qs gen} q_s - \sum_{i=1}^{{\rm rank}(\mathfrak{g}_F^{\rm NA})} \lambda_{v, i}^{(P_s)} w_i^{(\mathfrak{g}_F^{\rm NA})} \, \in \mathbb{Z}~, \qquad \forall \,P_{s}\in \Phi_{\rm free}~. \end{equation} Thus, for any given RES $\widetilde\mathcal{S}$ corresponding to an extended CB configuration of $\mathcal{T}_{F_\infty}$, the global form of the IR flavour symmetry takes the schematic form: \be G_F= { U(1)^{{\rm rk}(\Phi)} \times \widetilde G_F^{\rm NA} \over \prod_{s=1}^{{\rm rk}(\Phi)} \mathbb{Z}_{m_s} \times \prod_{j=1}^{p} \mathbb{Z}_{k_p}}~, \end{equation} where the two factors in the denominator are determined by the conditions \eqref{cond on qs gen} and by the torsion sections, respectively. In this work, we will mostly focus on the case of $G_F$ semi-simple. The detailed form of \eqref{cond on qs gen} can also be deduced from the general classification of Mordell-Weil lattices \cite{Oguiso1991TheML, schuttshioda}, in principle, by mass-deforming into a purely abelian flavour phase. \subsubsection{Global symmetries from the BPS spectrum}\label{subsec:flavfromspec} As a consistency check of the above discussion, it is interesting to also compute the flavour group more directly, which can be done if we know the low-energy spectrum $\mathscr{S}$, similarly to the recent discussion in \cite{Apruzzi:2021vcu}. As a reasonably good approximation of the strong-coupling spectrum, for our purpose, we can often consider $\mathcal{S}$ to be the set of dyons that become massless at the SW singularities $U_\ast$. This is closely related to the existence of quiver point, which we will briefly discuss in subsection~\ref{subsec:modular} and throughout later sections. At a generic point on the Coulomb branch, there is a $U(1)_m^{[1]}\times U(1)_e^{[1]}$ one-form symmetry in the strict IR limit, which is the one-form symmetry of a pure $U(1)$ gauge theory \cite{Gaiotto:2014kfa}. One can think of $U(1)_e^{[1]}$ as the group of global gauge transformations in the electric frame, and similarly for $U(1)_m^{[1]}$ in the magnetic frame. This accidental continuous one-form symmetry is broken explicitly to a discrete subgroup (which can be trivial) by the spectrum of charged massive BPS particles $\mathscr{S}$. The one-form symmetry of the full 4d $\mathcal{N}=2$ theory is then given by that subgroup.% \footnote{We are very grateful to M.~Del Zotto for explaining this to us.} See also~\cite{ZottoEtx} for further discussion. Given a theory at fixed masses with a flavour symmetry algebra $\mathfrak{g}_F$ which is non-abelian, for simplicity, let $\widetilde G_F$ denote the corresponding simply-connected group, and let $Z(\widetilde G_F)$ be its center. For concreteness, let us have $Z(\widetilde G_F)= \mathbb{Z}_{n_1}\times \cdots \mathbb{Z}_{n_p}$. The dyons in $\mathscr{S}$ fall in representations $\mathfrak{R}_\psi$ of $\mathfrak{g}_F$. Let us denote these states $\psi$ by the charges: \be\label{psi state charges} \psi \; :\; (m,q; l_1, \cdots, l_p)~, \qquad l_1\in \mathbb{Z}_{n_1}~, \cdots~, l_p\in \mathbb{Z}_{n_p}~, \end{equation} where $(m,q)$ are the electromagnetic charges, and the integers $l_j$ mod $n_j$ give the charges of $\psi$ under the center $Z(\widetilde G_F)$. Let us define the subgroup: \be \mathscr{E}\; \subset \; U(1)_m^{[1]}\times U(1)_e^{[1]} \times Z(\widetilde G_F)~, \end{equation} as the maximal subgroup that leaves the spectrum $\mathscr{S}$ invariant. We will denote the generators of $\mathscr{E}$ by: \be\label{gE gens} g^\mathscr{E} = (k_m, k_q; z_1, \cdots, z_p)~, \qquad k_m\in \mathbb{Q}~, \; k_q\in \mathbb{Q}~, \,\; z_j\in \mathbb{Z}_{n_j}~. \end{equation} This is a generator that acts on a state \eqref{psi state charges} as: \be g^\mathscr{E}\; : \;\;\; \psi \rightarrow e^{2\pi i \left(k_m m+ k_q q+ \sum_{j=1}^p { z_i l_i\over n_i}\right)}\psi~. \end{equation} Let $\mathcal{Z}^{[1]}$ denote the subgroup of $\mathcal{E}$ generated by: \be g^{\mathcal{Z}^{[1]}} = (k_m, k_e; 0, \cdots, 0)~. \end{equation} In addition, the projection $\pi_F : U(1)_m^{[1]}\times U(1)_e^{[1]} \times Z(\widetilde G_F) \rightarrow Z(\widetilde G_F)$ gives a subgroup $\mathscr{F}$ of $Z(\widetilde G_F)$ generated by: \be g^\mathscr{F}=( z_1, \cdots, z_p)~, \end{equation} for each generator \eqref{gE gens}. These three groups are related by a short exact sequence: \be 0\rightarrow \mathcal{Z}^{[1]}\rightarrow \mathcal{E} \rightarrow \mathscr{F}\rightarrow 0~, \end{equation} precisely as in \eqref{SES tor}. Here, $\mathcal{Z}^{[1]}$ is exactly the one-form symmetry. On the other hand, ${\mathscr{F}}$ is the subgroup of the flavour center $Z(\widetilde G_F)$ that can be compensated by gauge transformations, and therefore the actual non-abelian flavour group of the theory is $G_F = \widetilde G_F/ \mathscr{F}$, as in \eqref{GF exact}. In the presence of both a one-form symmetry and a non-trivial flavour symmetry, the group $\mathscr{E}$ itself could be a non-trivial 2-group of the field theory, as shown in \cite{Apruzzi:2021vcu}. This leads to the conjecture \eqref{conj2group}. In this work, we will focus on the computation of the global non-abelian symmetry group. \subsection{Extremal rational elliptic surfaces and Coulomb branch configurations}\label{subsec:extremalRES} A small and particularly interesting subset of all rational elliptic surfaces consists of those with a Mordell-Weil group of rank zero, ${\rm rk}(\Phi)=0$, which are called \textit{extremal}. There are only 16 of them, as classified by Miranda and Persson \cite{Miranda:1986ex}. We list them in tables~\ref{tab:Extremal1} and~\ref{tab:Extremal2}. By our general discussion, they correspond to Coulomb branch configurations with a semi-simple flavour symmetry. A given extremal RES generally corresponds to several 4d $\mathcal{N}=2$ theories $\mathcal{T}_{F_\infty}$, simply by choosing which of the Kodaira fibers sits `at infinity' on the one-dimensional Coulomb branch. The four surfaces listed in table~\ref{tab:Extremal1} do not have any multiplicative fibers, and therefore they cannot correspond to the $D_{S^1} E_n$ theories, which have $F_\infty= I_{9-n}$. Instead, they correspond to the seven `classic' 4d SCFTs associated to the 7 additive Kodaira singularities $II$, $III$, $IV$, $II^*$, $III^*$, $IV^*$ and $I_0^*$ -- this was previously discussed in \cite{Caorsi:2018ahl}. In each case, the massless curve has a single Kodaira singularity at the origin, and therefore the singularity at infinity is such that $\mathbb{M}_0 \mathbb{M}_\infty= \mathbf{1}$. Thus, the first three extremal surfaces in table~\ref{tab:Extremal1} describe both the $E_n$ Minahan-Nemeschansky theories \cite{Minahan:1996fg, Minahan:1996cj} and the three rank-one AD theories. The last surface, $X_{11}(j)$, describes $SU(2)$ with four flavours. It is the only extremal surface that comes in a one-dimensional family~\cite{Miranda:1986ex} (all the other extremal fibrations are unique), corresponding to the marginal gauge coupling of this 4d SCFT. From the MW torsion of these surfaces, one can also deduce the flavour symmetry group. This will be discussed in section~\ref{sec:4dtheories}. \begin{table}[] \renewcommand{\arraystretch}{1} \begin{center} \begin{tabular}{ |c||c|c|c|c|} \hline $\{F_v\}$& \textit{Notation} & $\Phi_{\rm tor}$& \textit{4d theory} & $\mathfrak{g}_F$ \\ \hline \hline \multirow{2}{*}{$II^*, II$} & \multirow{2}{*}{$X_{22}$} & \multirow{2}{*}{ -} & \text{AD} $H_0$ & - \\ \cline{4-5} & & & $E_8$ \text{MN} & $E_8$ \\ \hline \hline \multirow{2}{*}{$III^*, III$} & \multirow{2}{*}{$X_{33}$} & \multirow{2}{*}{ $\mathbb{Z}_2$} & \text{AD} $H_1$ & $A_1$ \\ \cline{4-5} & & & $E_7$ \text{MN} & $E_7$ \\ \hline \hline \multirow{2}{*}{$IV^*, IV$} & \multirow{2}{*}{$X_{44}$} & \multirow{2}{*}{ $\mathbb{Z}_3$} & \text{AD} $H_2$ & $A_2$ \\ \cline{4-5} & & & $E_8$ \text{MN} & $E_6$ \\ \hline \hline $I_0^\ast, I_0^\ast$ & $X_{11}(j)$ & $\mathbb{Z}_2\times \mathbb{Z}_2$ &$SU(2), N_f=4$ & $D_4$ \\ \hline \end{tabular} \end{center} \caption{Extremal rational elliptic surfaces without multiplicative ({\it i.e.} $I_k$) fibers.} \label{tab:Extremal1} \end{table} \renewcommand{\arraystretch}{1} \begin{table}[] \begin{center} \begin{tabular}{ |c||c|c|c|c|c|} \hline $\{F_v\}$& \textit{Notation} & $\Phi_{\rm tor}$& \textit{Field theory} & $\mathfrak{g}_F$ & \textit{Modularity} \\ \hline \hline \multirow{2}{*}{$II^*, I_1, I_1$} & \multirow{2}{*}{$X_{211}$} & \multirow{2}{*}{ $-$} & $D_{S^1} E_8$ & $\blue{E_8}$ & \multirow{2}{*}{$-$} \\\cline{4-5} & & & \text{AD} $H_0$ & $-$ & \\ \hline \hline \multirow{3}{*}{$III^*, I_2, I_1$} & \multirow{3}{*}{$X_{321}$} & \multirow{3}{*}{$\mathbb{Z}_2$} & $D_{S^1} E_8$ & $\blue{E_7 \oplus A_1}$ & \multirow{3}{*}{$\Gamma_0(2)$} \\ \cline{4-5} & & & $D_{S^1} E_7$ & $E_7$ & \\ \cline{4-5} & & & \text{AD} $H_1$ & $A_1$ & \\ \hline \hline \multirow{3}{*}{$IV^*, I_3, I_1$} & \multirow{3}{*}{$X_{431}$} & \multirow{3}{*}{$\mathbb{Z}_3$} & $D_{S^1} E_8$ & $\blue{E_6 \oplus A_2}$ & \multirow{3}{*}{$\Gamma_0(3)$} \\ \cline{4-5} & & & $D_{S^1} E_6$ & $E_6$ & \\ \cline{4-5} & & & \text{AD} $H_2$ & $A_2$ & \\ \hline \hline \multirow{2}{*}{$I_4^*, I_1, I_1$} & \multirow{2}{*}{$X_{411}$} &\multirow{2}{*}{ $\mathbb{Z}_2$} & $D_{S^1} E_8$ & $\blue{D_8}$ & \multirow{2}{*}{$\Gamma_0(4)$ }\\ \cline{4-5} & & & \text{4d pure} $SU(2)$ & $-$ & \\ \hline \hline \multirow{3}{*}{$I_1^*, I_4, I_1$} & \multirow{3}{*}{$X_{141}$} & \multirow{3}{*}{$\mathbb{Z}_4$} & $D_{S^1} E_8$ & $\blue{D_5 \oplus A_3}$ & \multirow{3}{*}{$\Gamma_0(4)$} \\ \cline{4-5} & & & $D_{S^1} E_5$ & $D_5$ & \\\cline{4-5} & & & \text{4d} $SU(2)\, N_f=3$ & $A_3$ & \\ \hline \hline \multirow{2}{*}{$I_2^*, I_2, I_2$} & \multirow{2}{*}{$X_{222}$} & \multirow{2}{*}{$\mathbb{Z}_2\times \mathbb{Z}_2$ }& $D_{S^1} E_7$ & $D_6 \oplus A_1 $ &\multirow{2}{*}{ $\Gamma(2)$ } \\\cline{4-5} & & & \text{4d} $SU(2)\, N_f=2$ & $A_1\oplus A_1$ & \\ \hline \hline \multirow{2}{*}{$I_9, I_1, I_1, I_1$} & \multirow{2}{*}{$ X_{9111}$} & \multirow{2}{*}{$\mathbb{Z}_3$} & $D_{S^1} E_8$ & $\blue{A_8}$ & \multirow{2}{*}{$\Gamma_0(9)$} \\ \cline{4-5} & & & $D_{S^1} E_0$ & $-$ & \\ \hline \hline \multirow{3}{*}{$I_8, I_2, I_1, I_1$} & \multirow{3}{*}{$X_{8211}$} & \multirow{3}{*}{$\mathbb{Z}_4$} & $D_{S^1} E_8$ & $\blue{A_7 \oplus A_1}$ & \multirow{3}{*}{$\Gamma_0(8)$} \\ \cline{4-5} & & & $D_{S^1} E_7$ & $A_7$ & \\ \cline{4-5} & & & $D_{S^1} E_1$ & $A_1$ & \\\hline \hline \multirow{2}{*}{$I_5, I_5, I_1, I_1$} & \multirow{2}{*}{$X_{5511}$} & \multirow{2}{*}{$\mathbb{Z}_5$} & $D_{S^1} E_8$ & $\blue{A_4 \oplus A_4}$ & \multirow{2}{*}{$\Gamma_1(5)$} \\ \cline{4-5} & & & $D_{S^1} E_4$ & $A_4$ & \\\hline \hline \multirow{4}{*}{$I_6, I_3, I_2, I_1$} & \multirow{4}{*}{$X_{6321}$} & \multirow{4}{*}{$\mathbb{Z}_6$} & $D_{S^1} E_8$ & $\blue{A_5 \oplus A_2 \oplus A_1}$ & \multirow{4}{*}{$\Gamma_0(6)$} \\ \cline{4-5} & & & $D_{S^1} E_7$ & $A_5 \oplus A_2 $ & \\ \cline{4-5} & & & $D_{S^1} E_6$ & $A_5 \oplus A_1 $ & \\ \cline{4-5} & & & $D_{S^1} E_3$ & $A_2 \oplus A_1$ & \\ \hline \hline \multirow{2}{*}{$I_4, I_4, I_2, I_2$} & \multirow{2}{*}{$X_{4422}$} & \multirow{2}{*}{$\mathbb{Z}_4\times \mathbb{Z}_2$} & $D_{S^1} E_7$ & $A_3 \oplus A_3 \oplus A_1 $& \multirow{2}{*}{$\Gamma_0(4) \cap \Gamma(2)$} \\ \cline{4-5} & & & $D_{S^1} E_5$ & $A_3 \oplus A_1 \oplus A_1 $ & \\ \hline \hline $I_3, I_3, I_3, I_3$ & $X_{3333}$ & $\mathbb{Z}_3 \times \mathbb{Z}_3$ & $D_{S^1} E_6$ & $A_2 \oplus A_2 \oplus A_2 $ & $\Gamma(3)$ \\ \hline \end{tabular} \end{center} \caption{Extremal rational elliptic surfaces with $I_k$ fibers and corresponding field theories.} \label{tab:Extremal2} \end{table} The remaining 12 extremal RES are listed in table~\ref{tab:Extremal2}. These are also all the extremal RES that have more than 2 singular fibers -- in fact, they can only have 3 or 4 singular fibers. The first and second columns in table~\ref{tab:Extremal2} indicate the singular fibers and the names of the corresponding surfaces in the notation of~\cite{Miranda:1986ex}. The third column gives the MW group of the elliptic fibration, which is purely torsion. The fourth column lists the 4d $\mathcal{N}=2$ field theories for which this extremal RES describes a CB configuration, while the fifth column gives the unbroken flavour symmetry algebra in each case. % The last column in table~\ref{tab:Extremal2} indicates the modular group of the surface, up to conjugacy. The modular group is identified by working out the expression for $U(\tau)$ from the SW curve as explained in section~\ref{subsec:kodphys}. We will discuss these modular properties in more detail in the following sections. All the massless $E_n$ KK theories other than $E_2$ and $\widetilde{E}_1$ appear in table~\ref{tab:Extremal2}. These last two are the exceptions because their flavour group includes one $U(1)$ factor, and therefore the corresponding rational elliptic surfaces have ${\rm rk}(\Phi) = 1$. (Similarly so for 4d $SU(2)$ with $N_f=1$.) All but one of the extremal rational surfaces with more than 2 singularities have interesting modular properties. The monodromy group turns out to be a congruence subgroup, as listed in table~\ref{tab:Extremal2} up to conjugacy. The first three curves in this table, $X_{211}$, $X_{321}$ and $X_{431}$, are the massless curves for the $E_{8}, E_7$ and $E_6$ theories, respectively. Since the corresponding five-dimensional SCFTs flow to SCFTs in four-dimensions, their congruence subgroups must have elliptic points, which is indeed the case for the modular groups $\Gamma^0(2)$ and $\Gamma^0(3)$, respectively. The CB for the massless $D_{S^1} E_8$ theory is not a modular curve. All these CB configurations will be discussed in more detail in section~\ref{sec:En}. Note that none of the other elliptic curves have elliptic points. Moreover, we observe that the list of modular groups for the extremal elliptic fibrations includes all possible torsion-free congruence subgroups of ${\rm PSL}(2,\mathbb{Z})$ up to index $12$ -- the latter have been classified in~\cite{Sebbar:2001}. For each five-dimensional $E_n$ theory, we can realise many of the corresponding subalgebras of rank $s=n$ (see table~\ref{tab:Sublattices E8} in appendix), but not all of them. Instead, for each simple algebra $E_n$, we realise a CB for each of its regular `maximal' semi-simple subalgebra, whose Dynkin diagram is obtained by deleting a single node of the {\it affine} $E_n$ Dynkin diagram \cite{Dynkin:1957um}. For $D_{S^1} E_8$, in particular, we have the 9 distinct CB configurations with flavour algebras indicated in blue in table~\ref{tab:Extremal2}, including $\mathfrak{g}_F=E_8$ itself: \be E_8 \rightarrow E_8~, \; E_7\oplus A_1~, \; E_6\oplus A_2~, \; D_5\oplus A_3~, \; A_4^2~, \; A_5\oplus A_2\oplus A_1~, \; A_8~,\; A_7\oplus A_1~,\; D_8~. \end{equation} Two of the remaining 6 subalgebras ($D_4\oplus A_1^4$ and $A_1^8$) cannot be realised as the 7-brane root lattice of a RES \cite{Persson:1990}. The remaining 4 cases are: \be A_2^4 \; \; (4 I_3)~, \quad D_6\oplus A_1^2\;\; (I_2^\ast \oplus 2 I_2)~, \quad D_4^2 \;\; (2 I_0^\ast)~, \quad A_3^2\oplus A_1^2 \;\; (2 I_4 \oplus 2 I_2)~, \end{equation} which are realised by the extremal fibrations $X_{3333}$, $X_{222}$, $X_{11}(j)$ and $X_{4422}$, respectively. These 4 subalgebras of $E_8$ are realised physically as CB configurations of the 6d $E$-string theory on $T^2$ which are obtained as mass deformations of the $E_8$ configuration \eqref{6dEstring massless} and do not descent to CB configurations of the 5d KK theory $D_{S^1} E_8$. Similarly, we have the regular semi-simple subalgebras of the simple groups $E_n$: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} &E_7 &&\rightarrow\quad E_7~, \; D_6\oplus A_1~, \; A_5\oplus A_2~, \; A_3^2\oplus A_1~, \; A_7~, \cr &E_6 &&\rightarrow\quad E_6~, \; A_5\oplus A_1~, \; A_2^3~, \cr &E_5 &&\rightarrow\quad D_5~,\; A_3\oplus A_1^2~,\cr &E_4 &&\rightarrow\quad A_4~, \eea which are all realised in table~\ref{tab:Extremal2}. Finally, let us note that the last configuration in table~\ref{tab:Extremal2}, $X_{3333}$, gives the so-called $T_3$ description of the $E_6$ theory, in which only an $A_2^3$ algebra is manifest; similarly, the configuration $X_{4422}$ for $E_7$ with $A_{3}^2\oplus A_1$ realised, and the configuration $X_{6321}$ for $E_8$ with $A_5\oplus A_2\oplus A_1$ realised, can be obtained by Higgsing from the $T_4$ and $T_6$ theories, respectively \cite{Benini:2009gi}. \subsection{Modularity on the $U$-plane and BPS quivers}\label{subsec:modular} We end this section with some general comments, before delving into many examples in the rest of this paper. Our approach, in the following, will be to explore the $U$-plane at various special points in parameters space, fixing the $E_n$ masses ${M_F}$ ($\lambda$ and $M_i$, and similarly for the 4d theories) and then studying the electromagnetic periods $a$, $a_D$ and their monodromies on the resulting $U$-plane. In general, the Picard-Fuchs equation \eqref{PF eq general} will be unyieldy and an explicit solution will be out of reach with the methods we are using -- for instance, for generic mass parameters the $E_n$ theory has $n+3$ $I_1$ singularities, and the monodromy group will be generated by $n+3$ monodromy matrices $\mathbb{M}_v$, each conjugate to $T$, and such that: \be \prod_{v=1}^{n+3} \mathbb{M}_v= T^{n-9}~, \end{equation} for some appropriate base point and ordering, as in figure~\ref{fig:paths U plane}. We do not attempt to solve for the $\mathbb{M}_v$ in that general case. Instead, we first fix some {\it interesting} values of the masses, such as the massless points discussed above. In such special limits, we can often give an explicit solution for the electromagnetic periods; it is then instructive to compute the monodromies by brute force. In some interesting special cases, we can use a much more powerful and elegant method, however. It turns out that, in many instances, the $U$-plane is a modular curve -- that is, a quotient of the upper-half plane by a subgroup $\Gamma$ of the modular group ${\rm PSL}(2, \mathbb{Z})$: \be\label{U modular gen} \{ U \} \cong \mathbb{H}/\Gamma~, \qquad \tau \mapsto U(\tau)~, \;\; \forall \tau \in \mathbb{H}~. \end{equation} In this case, we can describe the $U$-plane equivalently as a fundamental domain for $\Gamma$ in the upper-half-plane. Under this map, the fibers of type $I_k$ and $I_k^*$ correspond to cusps of width $k$ of $\Gamma$, while the remaining additive fibers correspond to the elliptic points of order two or three, depending on the value of $\tau$ in table~\ref{tab:kodaira}. The corresponding monodromies can then be read off directly by conjugating the monodromies for the cusp and elliptic points of the modular group ${\rm PSL}(2, \mathbb{Z})$ itself. We will see this simple but powerful approach at work in many examples. To identify which CB configurations are modular, we employ a combination of methods. Firstly, we can always compute $U(\tau)$ explicitly in the weak-coupling regime, as explained at the end of section~\ref{subsec:kodphys}, and try to see whether it can be identified with a principal modular function -- a so-called Hauptmodul -- for some $\Gamma$. In the cases when the $q$-series expansion of $U(\tau)$ is a McKay-Thompson series of the Monster group \cite{Conway:1979qga}, this identification is eased by the fact that all such series arising in Moonshine are Hauptmoduls of certain genus zero-modular groups. In this paper, we will mainly focus on congruence subgroups, which have been classified in \cite{Sebbar:2001, Cummins2003}. This classification provides configurations of singular fibers (up to quadratic twists) for each congruence subgroup, which thus allows for the identification of all the modular curves \eqref{U modular gen} with $\Gamma$ a congruence subgroup. The last point that we would like to mention concerns a by-product of our computations, which would deserve a more serious investigation. Namely, we can often identify {\it quiver points} on the $U$-planes. Those are points where the central charges of $n+3$ `light' BPS particles almost align -- for the $D_{S^1} E_n$ theories, they become real -- and where, conjecturally, the full BPS spectrum can be obtained as bound-states of the $n+3$ elementary particles. The problem of finding the spectrum, as such a point, can be formulated in terms of a BPS quiver -- see {\it e.g.} \cite{Denef:2002ru, Alim:2011kw, Chuang:2013wt, Closset:2019juk}. The rough intuition for quiver points, and an explicit way to compute the resulting quivers, follows from considering the IIB mirror geometry, $\widehat {\bf Y}$. We mentioned that BPS particles correspond to D3-branes wrapping Lagrangian 3-cycles. In the IIA description, the full $\mathcal{B}_4$ collapses to zero-volume in the classical picture, and the (derived) category of quiver representations is expected to accurately describe the category of B-branes in that regime. In the mirror IIB description, we have `light' wrapped D3-branes on the `small' 3-cycles mirror to the shrinking D0/D2/D4 bound states, that correspond to string junctions connecting a base point $W=U_0$ near the origin of the $W$-plane to the `7-branes' around it. In many cases, the fractional branes are then simply the smallest `vanishing paths' (in the sense of Picard-Lefschetz theory) on the $W$-plane \cite{Hori:2000ck}. In other words, in an ideal situation, the fractional branes are the dyons that becomes massless at the $U$-plane singularities around the base point. Once we have identified the electromagnetic charge $\gamma_i = (m_i, q_i)$ of these dyons, the BPS quiver is obtained by assigning a quiver node $(i)\sim \mathcal{E}_{\gamma_i}$ to each light dyon, and a number $n_{ij}$ or arrows from node $(i)$ to $(j)$ given by the Dirac pairing, which is also the oriented intersection number between the 3-cycles inside $\widehat {\bf Y}$: \be n_{ij}= m_i q_j - q_i m_j = \langle S^3_{\gamma_i}, S^3_{\gamma_j}\rangle~. \end{equation} For the $D_{S^1} E_n$ theories, we recover in this way many known `fractional brane quivers' for $dP_n$, toric and non-toric -- as emphasised in \cite{Closset:2019juk}, fractional-brane quivers {\it are} 5d BPS quivers. The quivers are best understood in terms of CB configurations with only multiplicative fibers, where each $I_k$ singularity corresponds to a `block' of quiver nodes; in particular, the cases of a $D_{S^1} E_n$ CB with 3 multiplicative fibers in the interior, corresponding to a configuration $\mathcal{S}\cong (I_{9-n}, I_{k_1}, I_{k_2},I_{k_3})$ with $k_1+k_2+k_3=n+3$, reproduce quivers obtained from 3-block exceptional collections on del Pezzo surfaces~\cite{Karpov1998} -- see {\it e.g.}~\cite{Herzog:2003zc, Wijnholt:2002qz, Beaujard:2020sgs}. Finally, let us mention that, importantly, a BPS quiver generally comes with a non-trivial superpotential, which should be computed, in principle, by a careful consideration of the disk instantons -- see {\it e.g.} \cite{Feng:2005gw} for the case of the mirror to a toric threefold. It would be very interesting, but probably challenging, to compute the superpotential in the non-toric cases discussed below. \section{Rank-one 4d $\mathcal{N}=2$ theories, revisited}\label{sec:4dtheories} \label{sec:rankone4d} In this section, we discuss the well-known case of purely four-dimensional rank-one theories. In particular, we revisit the Coulomb branches of the $SU(2)$ gauge theories with $N_f \leq 3$ flavours, which are asymptotically free. This serves to illustrates the general formalism in a familiar setting. Moreover, our observations on the precise interpretation of the Mordell-Weil group of the SW geometry appear to be new. Finally, the 4d theories arise as limits of the 5d theories, and are thus important as such. \subsection{Four-dimensional theories: A bird's-eye view} Let us start with some general comments, before delving into more detailed computations in the next subsections. As we explained in the previous section, the SW geometry of the 4d $\mathcal{N}=2$ $SU(2)$ gauge theory coupled to $N_f$ fundamental hypermultiplets is described by rational elliptic surfaces with $F_\infty= I^\ast_{4-N_f}$. In the limit of vanishing quark masses, the flavour symmetry group for $N_f >1$ is the quotient of ${\rm Spin}(2N_f)$ by its center, namely: \be\label{SU2Nf flavour} \begin{tabular}{|c|| c|c|c|} \hline $N_f$ & $2$ & $3$ & $4$ \\%heading \hline $G_F$ & $(SU(2)/\mathbb{Z}_2)\times (SU(2)/\mathbb{Z}_2)$ & $SU(4)/\mathbb{Z}_4$& ${\rm Spin}(8)/(\mathbb{Z}_2 \times \mathbb{Z}_2)$ \\ \hline \end{tabular} \end{equation} For $N_f=1$, the flavour symmetry is abelian. For $N_f=0$, the flavour symmetry group is trivial and we have a $\mathbb{Z}_2$ electric one-form symmetry, $\mathcal{Z}^{[1]}=\mathbb{Z}_2$. The flavour symmetry groups \eqref{SU2Nf flavour} are easily understood in the free UV description: there is an $SO(2N_f)$ symmetry acting on $2N_f$ half-hypermultiplets in the fundamental of the $SU(2)$ gauge group, but the action of the $\mathbb{Z}_2$ center of $SO(2N_f)$ on the matter fields is equivalent to the action of the center of the gauge $SU(2)$. Therefore, the actual {\it flavour} symmetry is $SO(2N_f)/\mathbb{Z}_2$, which the same as \eqref{SU2Nf flavour}. At first sight, this appears to be in tension with the discussion in~\cite{Seiberg:1994aj}, where it is shown that various dyons sit in spinors of ${\rm Spin}(2N_f)$. These are not gauge-invariant states, however, thus there is no contradiction. In what follows, we will give other derivations of the flavour symmetry groups \eqref{SU2Nf flavour} by using the low-energy description. As a further confirmation, note that this global form of the flavour symmetry group is in perfect agreement with the Schur index as given in \cite{Cordova:2015nma}. \begin{figure}[t] \begin{center} \tikzset{cross/.style={cross out, draw=black, fill=none, minimum size=2*(#1-\pgflinewidth), inner sep=0pt, outer sep=0pt}, cross/.default={2pt}} \begin{subfigure}{0.3\textwidth} \centering \begin{tikzpicture}[x=30pt,y=30pt] \begin{scope}[shift={(0,0)}] \draw[blue,semithick, -] (0,1.25) arc (90:360+90:1.25); \draw[thick] (0,1.25) node[cross=3pt] {}; \node at (0,1.6) { $I_4^\ast$}; \draw[thick] (-0.8,0) node[cross=3pt] {}; \node at (-0.8,-0.3) {$I_1$}; \draw[thick] (0.8,0) node[cross=3pt] {}; \node at (0.8,-0.3) {$I_1$}; \end{scope} \end{tikzpicture} \caption{ $N_f=0$. \label{curveSU2Nf0}} \end{subfigure}% \begin{subfigure}{0.3\textwidth} \centering \begin{tikzpicture}[x=30pt,y=30pt] \begin{scope}[shift={(0,0)}] \draw[blue,semithick, -] (0,1.25) arc (90:360+90:1.25); \draw[thick] (0,1.25) node[cross=3pt] {}; \node at (0,1.6) { $I_3^\ast$}; \draw[thick] (-0.4,0+0.693) node[cross=3pt] {}; \node at (-0.4,-0.3+0.693) {$I_1$}; \draw[thick] (-0.4,0-0.693) node[cross=3pt] {}; \node at (-0.4,0.3-0.693) {$I_1$}; \draw[thick] (0.8,0) node[cross=3pt] {}; \node at (0.8,-0.3) {$I_1$}; \end{scope} \end{tikzpicture} \caption{ $N_f=1$. \label{curveSU2Nf0}} \end{subfigure}% \begin{subfigure}{0.3\textwidth} \centering \begin{tikzpicture}[x=30pt,y=30pt] \begin{scope}[shift={(0,0)}] \draw[blue,semithick, -] (0,1.25) arc (90:360+90:1.25); \draw[thick] (0,1.25) node[cross=3pt] {}; \node at (0,1.6) { $I_2^\ast$}; \draw[thick] (-0.8,0) node[cross=3pt] {}; \node at (-0.8,-0.3) {$I_2$}; \draw[thick] (0.8,0) node[cross=3pt] {}; \node at (0.8,-0.3) {$I_2$}; \end{scope} \end{tikzpicture} \caption{ $N_f=2$. \label{curveSU2Nf0}} \end{subfigure}% \\ \begin{subfigure}{0.3\textwidth} \centering \begin{tikzpicture}[x=30pt,y=30pt] \begin{scope}[shift={(0,0)}] \draw[blue,semithick, -] (0,1.25) arc (90:360+90:1.25); \draw[thick] (0,1.25) node[cross=3pt] {}; \node at (0,1.6) { $I_1^\ast$}; \draw[thick] (0,0) node[cross=3pt] {}; \node at (0,-0.3) {$I_4$}; \draw[thick] (0.8,0) node[cross=3pt] {}; \node at (0.8,-0.3) {$I_1$}; \end{scope} \end{tikzpicture} \caption{ $N_f=3$. \label{curveSU2Nf0}} \end{subfigure}% \begin{subfigure}{0.3\textwidth} \centering \begin{tikzpicture}[x=30pt,y=30pt] \begin{scope}[shift={(0,0)}] \draw[blue,semithick, -] (0,1.25) arc (90:360+90:1.25); \draw[thick] (0,1.25) node[cross=3pt] {}; \node at (0,1.6) { $I_0^\ast$}; \draw[thick] (-0,0) node[cross=3pt] {}; \node at (-0,-0.35) {$I_0^\ast$}; \end{scope} \end{tikzpicture} \caption{ $N_f=4$. \label{curveSU2Nf0}} \end{subfigure}% \end{center} \caption{The $u$-plane of 4d $\mathcal{N}=2$ $SU(2)$ with $N_f$ massless flavours. \label{fig:SU2curves}} \end{figure} The $u$-planes for the massless 4d $SU(2)$ gauge theories are depicted in figure~\ref{fig:SU2curves}. If $N_f\neq 1$, the corresponding rational surfaces are extremal, in agreement with the fact that the flavour symmetry has no abelian factor. The Mordell-Weil group for all the massless theories are~\cite{Miranda:1986ex, Persson:1990}: \be \begin{tabular}{|c||c |c|c|c|c|c|} \hline $N_f$ &$0$& $1$& $2$ & $3$ & $4$ \\%heading \hline $\Phi$&$\mathbb{Z}_2$ &$\mathbb{Z}$ & $\mathbb{Z}_2^2$ & $\mathbb{Z}_4$& $\mathbb{Z}_2^2$ \\ \hline \end{tabular} \end{equation} This agrees with our discussion from section~\ref{subsec:Phi and flav}. For the pure $SU(2)$ theory, there is no reducible Kodaira fiber in the interior and therefore $\mathscr{F}=0$. Instead, $\Phi= \mathbb{Z}_2$ injects into $Z(F_\infty)= \mathbb{Z}_2^2$. According to the conjecture \eqref{conject on 1form}, it is then interpreted as the electric one-form symmetry of the $SU(2)$ gauge theory. For $N_f=1$, the Mordell-Weil group is free and the flavour symmetry is abelian. For $N_f>1$, $\Phi=\Phi_{\rm tor}= \mathscr{F}$, which leads to \eqref{SU2Nf flavour}. For generic masses, we have $N_f+2$ $I_1$ singularities in the interior of the Coulomb branch, and $\Phi= \mathbb{Z}^{N_f}$. As we vary the mass parameters, we can obtain a number of other singularities. In fact, we can obtain all possible configurations allowed by the classification of rational elliptic surfaces, at fixed $F_\infty$. The exact number of distinct configurations of Kodaira singularities for every 4d theory is given in table~\ref{tab:RESin4d}. \begin{table}[] \renewcommand{\arraystretch}{1} \begin{center} \begin{tabular}{ |c||c|c|c|c|c|} \hline $SU(2), N_f$ \text{flavours,} \;\; $F_\infty= I^*_{4-N_f}$ & $N_f=0$ & $N_f=1$& $N_f=2$& $N_f=3$& $N_f=4$ \\ $\# \,\mathcal{S}$'s & $1$ & $2$ & $6$ & $13$& $19$ \\ \hline \hline \text{AD theories,} \;\; $F_\infty= II^*, III^*, IV^*$& & $H_0$& $H_1$& $H_2$& \\ $\# \,\mathcal{S}$'s & & $2$ & $4$ & $8$& \\ \hline \hline \text{MN theories,} \;\; $F_\infty= IV, III, II$ & & $E_6$& $E_7$& $E_8$& \\ $\# \,\mathcal{S}$'s & & $49$ & $93$ & $137$& \\ \hline \end{tabular} \end{center} \caption{Number of distinct rational elliptic surfaces on the extended CB of each 4d theory.} \label{tab:RESin4d} \end{table} \paragraph{AD points and flavour symmetry.} Some of these configurations are: \be I^\ast_3\oplus II\oplus I_1~, \qquad I^\ast_2\oplus III\oplus I_1~, \qquad I^\ast_1\oplus IV\oplus I_1~, \end{equation} including the fiber at infinity, which are the maximal Argyres-Douglas points on the Coulomb branch of $SU(2)$ with $N_f=1,2,3$. One can `zoom in' onto the AD point, which amounts to merging the $I_1$ with the $I_{4-N_f}^\ast$ at infinity. This is the 4d $\mathcal{N}=2$ SCFT limit, and the corresponding SW geometry is described by an extremal RES as in table~\ref{tab:Extremal1}. For the $H_1$ and $H_2$ theories, we have $\mathbb{Z}_2$ and $\mathbb{Z}_3$ Mordell-Weil torsion which embeds diagonally into $Z(T)= \mathbb{Z}_2^2$ and $\mathbb{Z}_3^2$, respectively. Following our interpretation of the MW group, we find that the flavour symmetry group of the rank-one AD theories is: \be G_F[H_0]= 0~, \qquad G_F[H_1]=SU(2)/\mathbb{Z}_2~, \qquad G_F[H_2]= SU(3)/\mathbb{Z}_3~. \end{equation} This is in agreement with the Schur index computation \cite{Buican:2015ina, Cordova:2015nma} and with the BPS spectrum, as we will discuss below. Incidentally, we also see that, according to \eqref{conject on 1form}, these AD theories do not have 1-form symmetries, in agreement with \cite{Closset:2020scj, DelZotto:2020esg}. \paragraph{MN theories and flavour symmetry.} The remaining `classic' 4d SCFTs are the $E_n$ MN theories. They are directly obtained from circle compactification of the 5d theory, as we reviewed in section~\ref{subsec:Encurves}. In the massless limit, they are described by the same rational elliptic surfaces as the AD theories, simply by sending $U$ to $1/U$ (see table~\ref{tab:Extremal1}). It then follows from our general considerations that: \be G_F[E_6 \, {\rm MN}]= {\rm E}_6/\mathbb{Z}_3~, \qquad G_F[E_7 \, {\rm MN}]= {\rm E}_7/\mathbb{Z}_2~, \qquad G_F[E_8 \, {\rm MN}]= {\rm E}_8~, \end{equation} just like their 5d parents. This same result was recently obtained in \cite{Bhardwaj:2021ojs}. \subsection{The pure $SU(2)$ SW solution} Let us first review the celebrated Seiberg-Witten solution for the four-dimensional $\mathcal{N}=2$ supersymmetric $SU(2)$ gauge theory \cite{Seiberg:1994rs, Seiberg:1994aj}. The Weierstrass form of the pure $SU(2)$ SW curve is given by \cite{Seiberg:1994aj}: \be\label{g2g3pure su2} g_2(u) = {4u^2 \over 3}-4\Lambda^4~, \qquad\ g_3(u) = -{8u^3 \over 27} + {4\over 3}u\Lambda^4~, \end{equation} with the discriminant $\Delta=16 \Lambda ^8 \left(u^2-4 \Lambda ^4\right)$. Fixing the dynamical scale such that $\Lambda^4={1\over 4}$ for convenience, the $u$-plane singularities are at $u_\ast = \pm 1$ and $\infty$. The $J$-invariant then reads: \be \label{4dSU2Jinv} J(u) = {(4u^2 -3)^3 \over 27(u^2-1)}~, \end{equation} such that $J\sim u^4$ in the classical limit, while in the strong coupling regime we have $J\sim(u-u_\ast)^{-1}$. Consequently, the monodromies will be conjugate to $T^4$ and $T$, respectively, in ${\rm SL}(2, \mathbb{Z})$. Let us note that the $J$-invariant only depends on $z\equiv u^2$.% \footnote{This is a manifestation of the spontaneously broken $\mathbb{Z}_2$ symmetry on the Coulomb branch. In terms of $z$, we have: $$ z(\tau) = 1 + {1\over 64}\left( {\eta({\tau\ov2}) \over \eta(\tau)}\right)^{24}= {1\over 64}\left(q^{-{1\ov2}} + 40 + 276q^{1\ov2} - 2048q + \mathcal{O}\left(q^{1\ov2}\right) \right)~,$$ with coefficients matching the McKay-Thompson series of class $2B$ for the Monster group. This is a Hauptmodul for $\Gamma^0(2)$, a subgroup of index $3$ with two cusps. } Inverting the expression \eqref{4dSU2Jinv} in the weak coupling regime leads to: \be\label{uoftau pure SU2} u(\tau) = {1\over 8}\left(q^{-{1\ov4}}+20 q^{1\ov4}-62 q^{3\ov4}+216 q^{5\ov4}-641 q^{7\ov4}+1636 q^{9\ov4} +\mathcal{O}\left(q^{11\ov4}\right) \right)~. \end{equation} The coefficients match the McKay-Thompson series of class $4C$ for the Monster group~\cite{Conway:1979qga}, which are reproduced by the exact expression: \be u(\tau) = {\vartheta_2(\tau)^4 + \vartheta_3(\tau)^4 \over 2\vartheta_2(\tau)^2\vartheta_3(\tau)^2} = 1 + {1\over 8}\left( \eta({\tau\ov4})\over \eta(\tau)\right)^8~. \label{Gamma0(4)hauptmodul} \end{equation} In this way, we verify that $u(\tau)$ is a modular function for $\Gamma^0(4)$, which is an index $6$ subgroup with three cusps. Using the modular properties of either the $\vartheta$ functions or the Dedekind-$\eta$ function, one can find the $\tau$ values that correspond to the $u$-plane singularities. For instance, under an $S$-transformation: \be u_D(\tau_D) = 1+32q_D + 256 q_D^2 +1408 q_D^3+ \mathcal{O}\left(q_D^4\right) ~, \end{equation} and thus the $u=1$ singularity corresponds to the $\tau = 0$ cusp. Note that the sign of \eqref{Gamma0(4)hauptmodul} changes under a $T^2$ transformation and thus the $u=-1$ cusp is mapped to $\tau = 2$ (or, equivalently, to $\tau=-2$). Incidentally, as pointed out in \cite{Aspman:2020lmf}, the origin of the Coulomb branch corresponds to the points in the orbit of $\tau = 1+i$. A fundamental domain for $\Gamma^0(4)$ consistent with these cusps is shown in figure \ref{FunDomainPureSU2}. \begin{figure}[t] \centering \begin{subfigure}{0.5\textwidth} \centering \scalebox{0.7}{\input{Gamma04.tikz}} \caption{ } \label{FunDomainPureSU2} \end{subfigure}% \begin{subfigure}{0.5\textwidth} \centering \scalebox{0.7}{\input{Gamma04Cuts.tikz}} \caption{ } \label{FunDomainPureSU2Cuts} \end{subfigure} \caption{Fundamental domains for $\Gamma^0(4)$. Figure (a) shows a standard choice, with width one cusps at $\tau = 0$ and $2$, while in figure (b) the cusp at $\tau = \pm 2$ is split, with the branch cut of the periods indicated by the dashed line.} \end{figure} We can read off the monodromies around the cusps from the choice of the fundamental domain, as discussed in section~\ref{subsec:modular} and in appendix~\ref{App:Congruence}. There are two strong coupling cusps at $\tau=0, 2$ of width one (since they are $I_1$ type singularities), and one cusp of width $4$ at infinity, with the associated monodromies: \be \mathbb{M}_{u=1} = STS~, \qquad \quad \mathbb{M}_{u=-1} =(T^2S)T(T^2S)^{-1}~, \qquad \quad \mathbb{M}_{\infty} = PT^4~. \end{equation} The periods $a$, $a_D$ can be written throughout the whole $u$-plane in terms of hypergeometric functions \cite{Ferrari:1996sv}, which involves a choice of non-trivial branch cuts. In this approach, it is directly apparent that the monodromies around the strong coupling singularities depend on the base-point in the $u$-plane. The standard choice of cuts for the hypergeometric functions corresponds to a `splitting' of the fundamental domain as shown in figure~\ref{FunDomainPureSU2Cuts}, such that the cusps at $\tau=-2$ and $\tau = 2$ are identified. We will come back to this picture when we discuss the 5d $E_1$ theory in section~\ref{sec:E1}. Finally, we can determine the BPS states becoming massless at the $u$-plane singularities from the monodromies as follows. Recall that the monodromy around a singularity where $k$ particles of charge $(m,e)$ become massles is $\mathbb{M}_{(m,e)}^k$, with $\mathbb{M}_{(m,e)}$ given in \eqref{gen Mmq}. We thus see that the monopole $(1,0)$ and dyons $(1,\pm 2)$ are the particles becoming massless at the $\tau = 0$ and $\pm 2$ cusps, respectively. \paragraph{Torsion and one-form symmetry.} The pure $SU(2)$ SW geometry has a Mordell-Weil group which is purely torsion, $\Phi=\mathbb{Z}_2$, generated by the section: \be\label{P pure su2} P=\left({u\over 3}, 0\right)~, \qquad 2P=O~. \end{equation} Indeed, one easily checks that $P$ is a solution to $y^2=4x^3-g_2 x-g_3$ with $g_2$ and $g_3$ given in \eqref{g2g3pure su2}. According to \eqref{conject on 1form}, this captures the electric one-form symmetry of the theory. Note that we can see the $\mathbb{Z}_2$ one-form symmetry more directly from the low-energy spectrum \cite{Gaiotto:2014kfa}, following the logic of section~\ref{subsec:flavfromspec}. At strong coupling, the full spectrum is generated by the dyons that become massless at the cusps, while at weak coupling we have a tower of dyons and the $W$-boson \cite{Seiberg:1994rs, Ferrari:1996sv}: \be \mathscr{S}_S~:~ \; (1, 0)~, \quad (1,\pm 2) ~, \qquad\qquad \mathscr{S}_W~:~ \; (0, 2)~, \quad (1 , 2n)~, \; n\in \mathbb{Z}~. \end{equation} In either regime, the spectrum is left invariant by: \be g^\mathscr{E} = \left(0, {1\over 2} \right)~, \end{equation} following the notation \eqref{gE gens}. We therefore have an electric one-form symmetry $\mathbb{Z}_2\subset U(1)_e^{[1]}$, as expected from the UV description \cite{Gaiotto:2014kfa}. \subsection{Asymptotically-free $SU(2)$ theories and Argyres-Douglas points} Consider the 4d $SU(2)$ gauge theories with $0<N_f\leq 3$ flavours. Their SW curves, with all the mass parameters turned on, are given in appendix~\ref{app:SWcurves}, equation~\eqref{WeierstrassFrom4dSU2}. The monodromy at infinity is determined by the one-loop $\beta$-function \cite{Seiberg:1994rs, Seiberg:1994aj}: \be\label{Minfty SU2Nf} \mathbb{M}_{\infty} = PT^{4-N_f} = \mat{-1 &\; N_f-4\\0&-1}~, \end{equation} which correspond to $F_\infty= I^*_{4-N_f}$. The $u$-planes of the massless theories are depicted in figure~\ref{fig:SU2curves}. The Weierstrass form of the SW curves are given by: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \label{WeierstrassFrom4dSU2massless} & N_f = 1~:\;\; && g_2(u) = {4u^2\over 3}~,\quad && g_3(u) = -{8u^3 \over 27} + \frac{16}{27}~,\\ & N_f = 2~:\;\; && g_2(u) =\frac{4 u^2}{3}+4~,\quad && g_3(u) =-\frac{8 u^3}{27}+\frac{8 u}{3}~,\\ & N_f = 3~:\;\; && g_2(u) =\frac{4}{3} \left(u^2-16 u+16\right)~,\quad && g_3(u) = -\frac{8}{27} \left(u^3+30 u^2-96 u+64\right)~,\\ \eea in the conventions of appendix~\ref{app:subsec:SU2urves}, where the dynamical scales are set to \eqref{4dSU2 DynamicalScales} for convenience. The $u$-planes manifest a spontaneously broken $\mathbb{Z}_{4-N_f}$ symmetry \cite{Seiberg:1994aj}. For $N_f=2$ and $N_f=3$, we have the non-trivial SW singularities $I_2\oplus I_2$ and $I_4$, respectively, and the corresponding low-energy descriptions in terms of SQED with $2$ or $4$ electrons, respectively, reproduce the expected Higgs branches. For $N_f=2$, the Higgs branch consists of two cones of the form $\mathbb{C}^2/\mathbb{Z}_2$ which arise at two distinct points on the Coulomb branch, and the two factors of the flavour group $G_F=SO(3)\times SO(3)$ act on these two cones independently. \begin{table}[t]\renewcommand{\arraystretch}{1.9} \begin{center} \begin{tabular}{|c||c|c|c|c|c|c|} \hline \textit{Theory} & $\Delta(u) = 0$ & $F_{v\neq \infty}$ & $F_\infty$ & \textit{Modular Function} & \textit{Monodromy} & \textit{Cusps} $\tau$ \\\hline \hline $N_f=0$ & $+1, -1$ & $I_1, I_1$ & $I^*_4$ & $u(\tau) = 1 + {1 \over 8}\left( {\eta({\tau\ov4})\over \eta(\tau)} \right)^8$ & $\Gamma^0(4)$ & $0, 2, i\infty$\\ \hline $N_f = 1$ & $u^3 = 1$ & $3 I_1$ & $I^*_3$ & $u^3 = {2 E_4(\tau)^{3\ov2} \over E_4(\tau)^{3\ov2} + E_6(\tau)}$ & $\Gamma_{N_f=1}$ & $0,1,2,i\infty$\\\hline $ N_f = 2$ & $+1, -1$ & $I_2, I_2$ & $I^*_2$ & $u(\tau) = 1 + {1\over 8}\left( {\eta({\tau\ov2})\over \eta(2\tau)} \right)^8$ & $\Gamma(2)$ & $0,1,i\infty$ \\ \hline $N_f = 3$ & $0,1$ & $I_4, I_1$ & $I^*_1$ & $u(\tau) = -{1 \over 16}\left( {\eta(\tau) \over \eta(4\tau)} \right)^8$ & $\Gamma_0(4)$ & $0, -{1 \over 2}, i\infty$ \\ \hline \end{tabular} \end{center} \caption{Properties of the 4d $SU(2)$ theory with $N_f<3$ flavours. Note that the modular groups for $N_f=0$, $2$ and $3$ are in the same ${\rm PSL}(2, \mathbb{R})$ conjugacy class. } \label{tab:4dSU2} \renewcommand{\arraystretch}{1} \end{table} Similarly to the $N_f=0$ case, one can directly compute $u(\tau)$ from the massless curves: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{utau su2Nf massless} & N_f=1\; :\; && u(\tau) = {1\over 2^{2\ov3} 6}\left(q^{-{1\ov3}}+104 q^{2\ov3}-7396 q^{5\ov3}+\mathcal{O}\left(q^{8\ov3}\right) \right)~,\cr & N_f=2\; :\;&& u(\tau)= {1\over 8}\left(q^{-{1\over 2}}+20q^{1\ov2}-62 q^{3\ov2}+216 q^{5\ov2}+O\left(q^{7\ov2}\right)\right)~,\cr & N_f=3\; :\; && u(\tau)= -{1\over 16}\left( q^{-1}-8+20 q-62 q^3+216 q^5+\mathcal{O}\left(q^6\right) \right)~. \eea For $N_f=2, 3$, the coefficients of the $q$-series expansion of $u(\tau)$ are those of the McKay-Thompson series of class $4C$, just like in \eqref{uoftau pure SU2}. The monodromy group differs in each case, however. The basic global data of the massless $u$-planes are given in table~\ref{tab:4dSU2}. For any $N_f$, the relation $J(u)= J(q)$ gives a polynomial equation for $u(\tau)$ of order $6$. It follows that the monodromy group $\Gamma_{N_f}$ for $N_f$ massless flavours should be an index $6$ subgroup, with $T^{N_f - 4}\in \Gamma_{N_f}$. For $N_f=1$, the theory has three strong coupling singularities, reflecting the residual $\mathbb{Z}_3$ symmetry of the $u$-plane. A similar curve arises in the context of the pure $SU(3)$ SYM theory~\cite{Aspman:2020lmf}. In this case, $u(\tau)$ can be written in closed form in terms of fractional powers of Eisenstein series~\cite{Nahm:1996di}. It is not a modular function for either ${\rm SL}(2,\mathbb{Z})$ or any of the congruence subgroups. A possible fundamental domain for the monodromy group is shown in figure \ref{FunDomainSU2Nf1}. % \begin{figure}[t] \centering \begin{subfigure}{0.4\textwidth} \centering \scalebox{0.7}{\input{GammaNf=1.tikz}} \caption{ } \label{FunDomainSU2Nf1} \end{subfigure}% \begin{subfigure}{0.3\textwidth} \centering \scalebox{0.7}{\input{Gamma2.tikz}} \caption{ } \label{FunDomainSU2Nf2} \end{subfigure}% \begin{subfigure}{0.3\textwidth} \centering \scalebox{0.7}{\input{Gamma_04.tikz}} \caption{ } \label{FunDomainSU2Nf3} \end{subfigure} \caption{Fundamental domains for 4d $SU(2)$ theories with $N_f = 1, 2, 3$ flavours.} \end{figure} For the massless $N_f=2$ theory, $u(\tau)$ turns out to be a modular function for $\Gamma(2)$. Similarly, the monodromy group for $N_f = 3$ is $\Gamma_0(4)$. Possible choices of fundamental domains are drawn in figures~\ref{FunDomainSU2Nf2} and~\ref{FunDomainSU2Nf3}. In summary, for all the asymptotically free $SU(2)$ gauge theories with $N_f\neq 1$, the $u$-plane is a modular curve, with the modular group as indicated. % % We can again use the modular properties of $u(\tau)$ to match the cusps with the $u$-plane singularities in each case. For $N_f=1$ and $N_f=2$, the strong-coupling cusps are related by the $\mathbb{Z}_{4-N_f}$ symmetry of the $u$-plane. For $N_f=3$, we use the transformations: \be\nonumber u(\tau) = -{1\over 16}\left( {\eta(\tau) \over \eta(4\tau)}\right)^8 \xrightarrow[]{~S~} -16\left( {\eta(\tau) \over \eta({\tau\ov4})} \right)^8 \xrightarrow[]{~T^2~} 16\left({\eta({\tau\ov4})\eta(\tau)^2 \over \eta({\tau\ov2})^3} \right)^8 \xrightarrow[]{~S~} \left( {\eta(4\tau)\eta(\tau)^2 \over \eta(2\tau)^3} \right)^8~. \end{equation} Here, $\tau$ successively denotes $\gamma \tau$ for the appropriate transformed element $\gamma \in {\rm SL}(2,\mathbb{Z})$. These relations can be proven using the identities reviewed in appendix~\ref{App:Congruence}. They imply the identification of the $u=1$ singularity with the cusp at $\tau = {1\over 2}$ (or $\tau = -{1\over 2}$). For all $N_f\leq 3$, the monodromies can then be read off from the list of coset representatives, which of course reproduces the well-known results \cite{Seiberg:1994aj}. In the rest of this section, we further comment on the global symmetry groups and on the possible Coulomb branch configurations, in particular the ones that include Argyres-Douglas points \cite{Argyres:1995xn}. \subsubsection{Symmetry group and BPS spectrum} Let us consider the global symmetry in each case, in order to check \eqref{SU2Nf flavour} from the infrared perspective. We consider the three cases in turn: \paragraph{$\boldsymbol{N_f=1, \, G_F= U(1)}$.} The flavour group is abelian and of rank one. Correspondingly, there is a single free generator of the Mordell-Weil group: \be P_1 = \left({u \over 3}, \Lambda^3 \right)~, \end{equation} with $ \Lambda^3 =-\frac{4 i}{3 \sqrt{3}}$ in our conventions. Note that this section generates $\Phi\cong \mathbb{Z}$ also for non-zero mass $m$. As we take the limit $m_1 \rightarrow \infty$ with $m_1 \Lambda^3$ fixed, $P_1$ becomes the torsion section \eqref{P pure su2} of the pure $SU(2)$ theory. \paragraph{ $\boldsymbol{N_f=2, \, G_F= SO(3)\times SO(3)$}.} This massless SW geometry has three torsion sections: \be P_1 = \left( - {2 u \over 3}, 0 \right)~, \qquad P_2 = \left( {1 \over 3}(u -3), 0 \right)~, \qquad P_3 = \left( {1 \over 3}(u + 3), 0 \right)~, \end{equation} which satisfy $2 P_i =O$, and $P_i + P_j = P_k$ for $i\neq j$ and $k \neq i,j$, thus spanning $\Phi= \mathbb{Z}_2\times \mathbb{Z}_2$. Note that $P_2$ ($P_3$) intersects the `trivial' component $\Theta_{v,0}$ of the $I_2$ singular fiber at $u = -1$ (and $u=1$, respectively). Each of these sections generates a $\mathbb{Z}_2$ subgroup that injects into $\Phi$ according to \eqref{SES tor}. Since the subgroup of sections that are narrow is trivial and the two subgroups $\mathbb{Z}_2^{(f)} = \Phi/\mathbb{Z}_2$ act on the individual $SU(2)$ factors of the flavour symmetry, we find that $G_F = SO(3)\times SO(3)$, as previously mentioned. This global symmetry can also be understood directly from either the strong- or the weak-coupling spectrum \cite{Seiberg:1994aj, Bilal:1996sk}: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \mathscr{S}_S~:~ & (1, 0; 1, 0)~, \qquad (\pm 1,1; 0, 1) ~, \\ \mathscr{S}_W~:~ & (0, 2; 0, 0)~, \qquad (0, 1; 1, 1)~, \qquad (1 , 2n; 1, 0)~, \qquad (1, 2n+1; 0, 1)~. \eea The charges are $(m, q; 2j_1, 2j_2)$ for a dyon $(m,q)$ in the representation of spin $(j_1, j_2)$ of the universal cover $\widetilde G_F=SU(2)\times SU(2)$. Moreover, $(2j_1, 2j_2)$ mod $2$ is the charge under the $\mathbb{Z}_2\times \mathbb{Z}_2$ center of $\widetilde G_F$. All these states are left invariant by the $\mathbb{Z}_2\times \mathbb{Z}_2$ action generated by: \be g^\mathscr{E} \; =\; \left( {1\over 2}, {1\over 2}; 1,0\right)~, \quad \left( 0 , {1\over 2}; 0, 1\right)~, \end{equation} in the notation \eqref{gE gens}, from which we conclude that the actual flavour group is $SO(3)\times SO(3)$. \paragraph{ $\boldsymbol{N_f=3, \, G_F= PSU(4)$}.} This massless SW geometry also has three torsion sections: \be P_1 = \left( {1 \over 3}(u+4), -4u \right)~, \quad P_2 = \left( -{2 \over 3}(u -2), 0 \right)~, \quad P_3 = \left( {1 \over 3}(u + 4), 4u \right)~, \end{equation} which satisfy $ P_k + P_l = P_{k+l\, ({\rm mod}\, 4)}$ with $P_0\equiv O$, thus spanning $\Phi= \mathbb{Z}_4$. Note that all sections intersect non-trivially the $I_4$ singular fiber. We then have the flavour group $G_F=PSU(4)= SU(4)/\mathbb{Z}_4$ by our general argument. This can also be verified at the level of the BPS spectrum. In the weak and strong coupling regions, we have \cite{Seiberg:1994aj, Bilal:1996sk}: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \mathscr{S}_S~:~ & (2, -1; 0)~, \qquad (1,0; 1) ~, \qquad (-1, 1; 1)~, \\ \mathscr{S}_W~:~ & (0, 1; 2)~, \qquad (0, 2; 0)~, \qquad (1, 2n; 1)~, \qquad (1, 2n+1; -1)~, \qquad (2, 2n+1; 0)~. \eea where the last entry $z$ (mod $4$) in $(m, q; z)$ denotes the charge of the corresponding dyons under the center $\mathbb{Z}_4$ of ${\rm Spin}(6)=SU(4)$. The $\mathbb{Z}_4$ action generated by: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} g^\mathscr{E} = \left( -{1\over 4}, {1\over 2}; 1\right)~, \eea leaves all the BPS states invariants. The actual flavour group is therefore $PSU(4)$. \subsubsection{Configurations for $SU(2),\, N_f=1$}\label{subsec:SU2Nf1} Let us now consider all possible distinct SW geometries for each theory, using the classification of rational elliptic surfaces. With one flavour, there are only two allowed configurations, listed below: \be\label{configsNf1} \renewcommand{\arraystretch}{1.5} \begin{tabular}{ |c||c|c|c|c|} \hline $\{F_v\}$& {$m_1$} & $\mathfrak{g}_F$ & ${\rm rk}(\Phi)$ &$\Phi_{\rm tor}$\\ \hline \hline $ I_3^*, 3I_1$ & $m_1$ & $\frak{u}(1)$ & $1$ & $-$ \\ \hline $ I_3^*, II, I_1$ & $m_1^3 = {27\over 16}\Lambda^3$ & $\frak{u}(1)$ & $1$ & $-$ \\ \hline \end{tabular} \renewcommand{\arraystretch}{1} \end{equation} The generic configuration $(I_3^*, 3I_1)$ includes the $\mathbb{Z}_3$-symmetric massless curve for $m_1=0$. At the three $I_1$ singularities, the dyons $(1,0)$, $(1,-1)$ and $(1,-2)$ become massless. This can be seen from the fundamental domain in figure \eqref{FunDomainSU2Nf1}, as follows: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \mathbb{M}_{(\tau = k)} = (T^kS)T(T^kS)^{-1} = \mathbb{M}_{(1,-k)}~, \eea for $k = 0, 1, 2$. In fact, keeping track of the branch cuts of the periods, one can `split' the fundamental domain at $\tau=2$ as shown in figure~\ref{BPSstates1flavour}, so that either the dyon $(1,1)$ or the $(1,-2)$ become massless at that third cusp, depending on the sheet. \begin{figure}[t] \centering \scalebox{0.7}{\input{GammaNf=1Cuts.tikz}} \caption{Fundamental domain for the massless $4d~SU(2)~N_f=1$ theory, with the branch cut of the periods indicated by the dashed line. We also indicate the BPS particles becoming massless at the $I_1$ cusps.} \label{BPSstates1flavour} \end{figure} The second configuration in \eqref{configsNf1} is obtained by tuning the mass into the strong coupling region, as indicated. Let us consider the configuration containing the $AD$ theory on the CB. Here, we fix $\Lambda = {2^{4/3}\over 3}$ so that $m_1 = 1$, for convenience. One then finds: \be J(u) = - {(3u-4)(3u+4)^3 \over 64(3u+5)}~. \end{equation} One root of $J = J(\tau)$ is: \be \label{1FlavADmodular} u(\tau) = -{5\over 3} - {1\over 9} \left( {\eta\left({\tau \over 3} \right) \over \eta(\tau) } \right)^{12}~, \end{equation} which is the Hauptmodul of $\Gamma^0(3)$. We note that, in this case, the periods can be expressed in terms of hypergeometric functions. However, for our purposes, it suffices to read the monodromies from the fundamental domain. The AD theory $H_0$ can be obtained in 3 equivalent ways, by `colliding' a pair of $I_1$ cusps. At these points, two mutually non-local particles become massless. In terms of $u(\tau)$, we recover the Hauptmodul of $\Gamma^0(3)$ and its $T$ and $T^2$ transformations, respectively, in the three distinct cases. The pairs of BPS particles becoming massless in each case are the `neighbouring' dyons indicated in figure \ref{BPSstates1flavour}. Let us also note that: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} & \mathbb{M}_{(1,1)} \mathbb{M}_{(1,0)} = (ST)^{-1}~, \cr & \mathbb{M}_{(1,0)} \mathbb{M}_{(1,-1)} = T(ST)^{-1}T^{-1}~, \cr & \mathbb{M}_{(1,-1)} \mathbb{M}_{(1,-2)} = T^2(ST)^{-1}T^{-2}~, \eea which is indeed, in each case, the monodromy for a singularity of type $II$. For the case when $u(\tau)$ is given by \eqref{1FlavADmodular}, the remaining $I_1$ cusp is at $\tau = 0$, where the dyon $(1,0)$ becomes massless, and we have the monodromies: \be \mathbb{M}_{I_1}= STS^{-1}~,\qquad \mathbb{M}_{II}= T^2(ST)^{-1}T^{-2}~, \qquad \mathbb{M}_{\infty}= PT^3~, \end{equation} which satisfy $ \mathbb{M}_{I_1} \mathbb{M}_{II} \mathbb{M}_{\infty}= \mathbf{1}$. These monodromies are in agreement with the fundamental domain drawn in figure~\ref{FunDomain1FlavAD}, where the AD theory appears at the elliptic point. Similar fundamental domains can be drawn for the other two cases, by shifting the cusp and the elliptic point appropriately. \begin{figure}[t] \centering \scalebox{0.7}{\input{GammaNf=1AD.tikz}} \caption{Fundamental domain for $\Gamma^0(3)$ corresponding to the configuration $(I_3^*, I_1, II)$ on the CB of the 4d $SU(2)$, $N_f=1$ theory. The marked point $\tau = 2+ e^{2i\pi/3}$ is the elliptic point of the congruence subgroup $\Gamma^0(3)$.} \label{FunDomain1FlavAD} \end{figure} \subsubsection{Configurations for $SU(2),\, N_f=2$} With two flavours, there are six allowed configurations: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{configs Su2Nf2} \renewcommand{\arraystretch}{1.5} \begin{tabular}{ |c||c|c|c|c|c|} \hline $\{F_v\}$& \textit{$m_1$} & \textit{$m_2$} &$\mathfrak{g}_F$ & ${\rm rk}(\Phi)$ &$\Phi_{\rm tor}$\\ \hline \hline $ I_2^*, 2I_2$ & $0$ & $0$ & $A_1 \oplus A_1$ & $0$ & $\mathbb{Z}_2\times \mathbb{Z}_2$ \\ \hline $ I_2^*, I_2, 2I_1$ & $m_1\neq \pm \Lambda$ & $m_1$ & $A_1 \oplus \frak{u}(1) $ & $1$ & $\mathbb{Z}_2$ \\ \hline $ I_2^*, III, I_1$ & $m_1 = \pm \Lambda $ & $m_1$ & $A_1 \oplus \frak{u}(1) $ & $1$ & $\mathbb{Z}_2$ \\ \hline $ I_2^*, 2II$ & $\sqrt{2}e^{i\pi/4}\Lambda$ & $e^{i\pi/2} m_1$ & $2\frak{u}(1) $ & $2$ & $-$ \\ \hline $ I_2^*, II, 2I_1$ & ${ 1\over 2}e^{3\pi i/4} \Lambda$ & $e^{i\pi/2}m_1$ & $2\frak{u}(1) $ & $2$ & $-$ \\ \hline $ I_2^*, 4I_1$ & $m_1$ & $m_2$ & $2\frak{u}(1) $ & $2$ & $-$ \\ \hline \end{tabular} \eea Here, we only listed some particular values of the parameters $m_{1,2}$ for the curve \eqref{WeierstrassFrom4dSU2} which give rise to the corresponding configuration. For generic values of the masses, we have the last configuration, $4I_1$ singularities. The general structure of the extended CB can be understood starting from the large-mass limit \cite{Seiberg:1994aj}. For equal bare masses $m_1 = m_2 \gg \Lambda$, the two $I_1$ singularities corresponding to the quarks collide, giving rise to one $I_2$ singularity, from which emanate a classical Higgs branch $\mathbb{C}^2/\mathbb{Z}_2$, while we have the two $I_1$ singularities of the pure $SU(2)$ theory in the strong-coupling region. This configuration is the one on the second line in \eqref{configs Su2Nf2}. Colliding this $I_2$ singularity with one of the other two $I_1$'s (which would correspond to the monopole and dyon of the pure $SU(2)$, in the large mass limit), we can obtain a type-$III$ singularity, as two types of mutually non-local BPS states become massless \cite{Argyres:1995xn}. This is the third line in \eqref{configs Su2Nf2}. \renewcommand{\arraystretch}{1} Recall that the massless configuration $(I_2^*, 2I_2)$ corresponds to an extremal rational elliptic surface associated to the congruence subgroup $\Gamma(2)$ with $u(\tau)$ given in \eqref{utau su2Nf massless} and in table~\ref{tab:4dSU2}. By performing an $S$-transformation, one can show that one $I_2$ cusp is at $u(\tau = 0) = 1$. Furthermore, $u(\tau)$ changes sign under a $T$, transformation, so that $u(\tau = \pm 1) = -1$. In the large mass picture, one $I_2$ cusp is obtained from the pair of quarks, while the other $I_2$ is obtained by `colliding' the monopole and dyon of pure $SU(2)$ after a non-trivial monodromy as $m_1=m_2\rightarrow 0$ \cite{Argyres:1995xn}. At this point, the flavour symmetry is enhanced from $\mathfrak{u}(2)$ to $\mathfrak{so}(4)$ and the `second' $\mathbb{C}^2/\mathbb{Z}_2$ Higgs branch appears. The BPS states becoming massless at the two $I_2$ cusps of the massless theory have charges $(1,0)$ and $(1,\pm 1)$, in agreement with \cite{Bilal:1996sk}. The corresponding fundamental domain is shown in figure \ref{BPSstates2flavoura}. \begin{figure}[t] \centering \begin{subfigure}{0.5\textwidth} \centering \scalebox{0.7}{\input{GammaNf=2.tikz}} \caption{Massless theory.} \label{BPSstates2flavoura} \end{subfigure}% \begin{subfigure}{0.5\textwidth} \centering \scalebox{0.7}{\input{GammaNf=2AD.tikz}} \caption{AD point $H_1$. \label{BPSstates2flavourb}} \end{subfigure} \caption{Fundamental domains for the $4d~SU(2)~N_f=2$ theory. (a) Choice of fundamental domain for $m_1=m_2=0$ with a branch cut structure indicated by the dotted lines. The $\tau = 0,\pm 1$ singularities are $I_2$ cusps. (b) Choice of fundamental domain for the configuration involving a type-$III$ singularity. Three BPS states become massless at the point at $\tau = i$. } \label{BPSstates2flavour} \end{figure} In particular, the monodromy matrices: \be \mathbb{M}_{I_2}= \mathbb{M}_{(1,0)}^2 = ST^2S^{-1}~, \quad \mathbb{M}_{I_2}'= \mathbb{M}_{(1,\pm 1)}^2 = (T^{\mp 1}S)T^2(T^{\mp 1}S)^{-1}~, \quad \mathbb{M}_{\infty}= PT^2~, \end{equation} can be read off directly from figure~\ref{BPSstates2flavoura}. Let us analyse in more detail the configuration containing the type-$III$ singularity. For $m_1=m_2 = \Lambda$, with $\Lambda = \sqrt{2}$, we find: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{u tau for III} & u(\tau) &=&\; -5 + {1\over 8}\left( {\eta(\tau)^2 \over \eta({\tau\over 2})\eta(2\tau)} \right)^{24} \cr &&=&\; {1\over 8}\left({1\over q^{1\ov2}} - 16 + 276 q^{1\ov2}+ 2048 q + 11202 q^{3\ov2} + \mathcal{O}(q^2) \right)~, \eea whose coefficients match the $4A$ McKay-Thompson series of the monster group \cite{Conway:1979qga}. The expression \eqref{u tau for III} is related by a $T$ transformation to the McKay-Thompson series of class $2B$, namely: \be u(\tau) = - 5 - {1\over 8} \left( {\eta\left( {\tau \pm 1 \over 2}\right) \over \eta(\tau\pm 1)} \right)^{24}~, \end{equation} which is the Hauptmodul of the congruence subgroup $\Gamma^0(2)$. Compared to the analysis for $N_f = 1$, here we split one of the $I_2$ cusps of the massless $N_f = 2$ theory into two $I_1$'s, and collide one of those with the other $I_2$ cusp. Thus, in terms of the BPS particles, one of the two dyons of the split $I_2$, say a dyon $(1,\mp 1)$, will also become massless, together with the two monopoles $(1,0)$ at the other $I_2$ cusp. Indeed, we have: \be \mathbb{M}_{(1,0)}^2 \mathbb{M}_{(1,-1)} = \mathbb{M}_{(1,1)} \mathbb{M}_{(1,0)}^2 = S^{-1}~, \end{equation} which is exactly the monodromy around the type-$III$ elliptic point at $\tau = i$ in figure~\ref{BPSstates2flavourb}. A similar analysis can be done for the case when the two $(1,\pm 1)$ dyons and a monopole $(1,0)$ collide to form a type-$III$ singularity. Let us also note that the flavour symmetry group $SO(3)$ of the AD point can be corroborated from the corresponding BPS states. Indeed, at the AD point in the configuration above, we have a single dyon $(1, \mp1; 0)$ and a doublet of $\widetilde G_F=SU(2)$, denoted by $(1,0; 1)$, where the last entry denotes the charge under the center of $SU(2)$. We then find that the actual flavour symmetry is $SU(2)/\mathbb{Z}_2$, by the same argument as for the massless curve. Moreover, the full spectrum of the 4d gauge theory is compatible with that symmetry, which agrees with the fact that the MW group of this configuration is $\Phi=\mathbb{Z}_2$. \medskip \noindent Finally, the remaining possibilities in \eqref{configs Su2Nf2} involve `colliding' $I_1$'s corresponding to $(1,0)$ states with the $(1,\pm 1)$ states, forming type-$II$ singularities. For instance, we can obtain the $(I_2^*, 2II)$ configuration by tuning the masses to the values given in \eqref{configs Su2Nf2}. In that case, we find: \be J(u) = 1 + {u^2 \over 27} \qquad \Leftrightarrow \qquad u^2(\tau) = -27 + 27 {E_4(\tau)^3 \over E_4(\tau)^3 - E_6(\tau)^2}~, \end{equation} with $u(\tau)$ itself having coefficients matching the McKay-Thompson series of class $2A$. In this case, the monodromy group is $\Gamma^2$, the group whose elements are the squares of ${\rm PSL}(2,\mathbb{Z})$, with the fundamental domain drawn in figure~\ref{BPS2Flav2IIAD}. \begin{figure}[t] \centering \scalebox{0.7}{\input{GammaNf=2AD2II.tikz}} \caption{Fundamental domain for the $(I_2^*, 2II)$ configuration on the CB of the $4d~SU(2)~N_f=2$ theory.} \label{BPS2Flav2IIAD} \end{figure} Note that the type-$II$ singularities are elliptic points of order $3$, namely those for which $J(\tau_*)=0$, which correspond to the zeroes of the Eisenstein series $E_4$ at $\tau_* = e^{2i\pi/3}$. As a result, we expect two type-$II$ elliptic points at $\tau_*$ and $1+\tau_*$. We note that: \be \mathbb{M}_{(1,1)} \mathbb{M}_{(1,0)} = (ST)^{-1}~, \qquad \mathbb{M}_{(1,0)} \mathbb{M}_{(1,-1)} = T(ST)^{-1}T^{-1}~, \end{equation} in agreement with the domain shown in figure~\ref{BPS2Flav2IIAD}. \subsubsection{Configurations for $SU(2),\, N_f=3$} \label{subsec:Su2Nf3} With three flavours, there are $13$ allowed configurations: \be\label{configs su2Nf3} \renewcommand{\arraystretch}{1.5} \begin{tabular}{ |c||c|c|c|c|c|c|} \hline $\{F_v\}$& \textit{$m_1$} & \textit{$m_2$} & \textit{$m_3$} &$\mathfrak{g}_F$ & ${\rm rk}(\Phi)$ &$\Phi_{\rm tor}$\\ \hline \hline $ I_1^*, I_4, I_1$ & $0$ & $0$ & $0$ & $A_3$ & $0$ & $\mathbb{Z}_4$ \\ \hline $ I_1^*, I_3, 2I_1$ & $m_1$ & $m_1$ & $m_1$ & $A_2 \oplus \frak{u}(1)$ & $1$ & $-$ \\ \hline $ I_1^*, IV, I_1$ & $\Lambda/2$ & $m_1$ & $m_1$ & $A_2 \oplus \frak{u}(1)$ & $1$ & $-$ \\ \hline $ I_1^*, I_3, II$ & $-\Lambda/16$ & $m_1$ & $m_1$ & $A_2 \oplus \frak{u}(1)$ & $1$ & $-$ \\ \hline $ I_1^*, III, I_2$ & $\Lambda/4$ & $0$ & $0$ & $2A_1\oplus \frak{u}(1)$ & $1$ & $\mathbb{Z}_2$ \\ \hline $ I_1^*, 2I_2, I_1$ & $m_1$ & $0$ & $0$ & $2A_1 \oplus \frak{u}(1)$ & $1$ & $\mathbb{Z}_2$ \\ \hline $ I_1^*, III, II$ & $-{7 \over 4} \Lambda $ & $i\sqrt{2}\Lambda$ & $m_1$ & $A_1 \oplus 2\frak{u}(1)$ & $2$ & $-$ \\ \hline $ I_1^*, III, 2I_1$ & ${m_2^2 \over \Lambda}+{\Lambda \over 4}$ & $m_2$ & $m_1$ & $A_1 \oplus 2\frak{u}(1)$ & $2$ & $-$ \\ \hline $ I_1^*, II, I_2, I_1$ & $m_1$ & ${(4m_1+\Lambda)^{3/2} \over 6\sqrt{3\Lambda} }$ & $m_1$ & $A_1 \oplus 2\frak{u}(1)$ & $2$ & $-$ \\ \hline $ I_1^*, I_2, 3I_1$ & $m_1$ & $m_2$ & $m_1$ & $A_1 \oplus 2\frak{u}(1)$ & $2$ & $-$ \\ \hline $ I_1^*,2II, I_1$ & \multicolumn{3}{|c|}{$\left(-2T_2\Lambda + {13\over 8}\Lambda^3,~ 5T_2\Lambda^2 - {57\over 16}\Lambda^4 \right)$} & $3\frak{u}(1)$ & $3$ & $-$ \\ \hline $ I_1^*, II, 3I_1$ & \multicolumn{3}{|c|}{$\left( {1\over 4}T_2\Lambda - {1\over 16}\Lambda^3,~ {1\over 2}T_2\Lambda^2 - {3\over 16}\Lambda^4 \right)$} & $3\frak{u}(1)$ & $3$ & $-$ \\ \hline $ I_1^*, 5I_1$ & $m_1$ & $m_2$ & $m_3$ & $3\frak{u}(1)$ & $3$ & $-$ \\ \hline \end{tabular} \renewcommand{\arraystretch}{1} \end{equation} We use the $N_f=3$ curve given in \eqref{4dCurves}, and we again only specified the masses for some simple configurations of interest. For the configurations $(I_1^*, 2II, I_1)$ and $(I_1^*, II, 3I_1)$ we give values for the $SO(6)$ Casimirs $(T_3, T_4)$ defined in \eqref{Casimirs Nf=3}. Note that the $(I_1^*, II, 3I_1)$ configuration can be in fact obtained by only `fixing' one of the Casimirs. Here we give a subfamily for which this configuration is realized. For generic masses, we have $5I_1$ singularities. For equal bare masses $m_1 = m_2 = m_3$, three of these singularities collide, forming an $I_3$ singularity, with flavour symmetry $\mathfrak{u}(3)$, as in the second line in \eqref{configs su2Nf3}. In the massless limit, the $I_3$ merges with another $I_1$ cusp, leading to the enhanced $\mathfrak{so}(6)\cong \mathfrak{su}(4)$ flavour algebra, and the Higgs branch dimension increases accordingly. This is the first line in \eqref{configs su2Nf3}. As discussed above, the massless configuration $(I_1^*, I_4, I_1)$ corresponds to the extremal rational elliptic surface $X_{141}$, and in that case the $u$-plane is a modular curve for $\Gamma_0(4)$. From the fundamental domain shown in figure~\ref{FunDomainSU2Nf3}, one can read off the monodromies: \be \mathbb{M}_{I_4} =ST^4S^{-1} = \mathbb{M}_{(1,0)}^4~, \quad \mathbb{M}^{\pm}_{I_1} = (ST^{\pm 2}S)T(ST^{\pm 2}S)^{-1}=\mathbb{M}_{(2, \pm 1)}~, \quad \mathbb{M}_{\infty}= PT~. \end{equation} They satisfy: \be \mathbb{M}_{I_4} \mathbb{M}^{-}_{I_1} \mathbb{M}_{\infty} = \mathbb{M}^+_{I_1} \mathbb{M}_{I_4} \mathbb{M}_{\infty} = \mathbf{1}~, \end{equation} as expected. Therefore, in the massless gauge theory, we have four monopoles $(1,0)$ becoming massless at $\tau = 0$ and one dyon $(2,\mp 1)$ becoming massless at $\tau = \pm {1\over 2}$. Note that the BPS quiver for that massless configuration takes the form \cite{Alim:2011kw}: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{quiverNf3} \begin{tikzpicture}[baseline=1mm] \node[] (1) []{$\mathcal{E}_{\gamma_5=(2,-1)}$}; \node[] (2) [left = of 1]{$\mathcal{E}_{\gamma_1=(1,0)}$}; \node[] (3) [above = of 1]{$\mathcal{E}_{\gamma_2=(1,0)}$}; \node[] (4) [right = of 1]{$\mathcal{E}_{\gamma_3=(1,0)}$}; \node[] (5) [below = of 1]{$\mathcal{E}_{\gamma_4=(1,0)}$}; \draw[->-=0.5] (1) to (2); \draw[->-=0.5] (1) to (3); \draw[->-=0.5] (1) to (4); \draw[->-=0.5] (1) to (5); \end{tikzpicture} \quad \cong \quad \begin{tikzpicture}[baseline=1mm] \node[] (1) []{$\mathcal{E}_{\gamma_5=(2,-1)}$}; \node[] (2) [left = of 1]{$\mathcal{E}_{\gamma_{1,2,3,4}=(1,0)}$};; \draw[->-=0.5] (1) to (2); \end{tikzpicture} \eea Note that, depending on the base point on the $U$-plane, we have either the dyon $\gamma_5=(2,-1)$ or $\gamma_5'=(2,1)$. The corresponding quivers differ by the orientation of the arrows, and are related by a quiver mutation (see {\it e.g.} \cite{Alim:2011kw}) on the central node. On the right-hand-side of \eqref{quiverNf3}, and in the following sections, we use the `block' notation, wherein several nodes with the same dyonic charge (the four monopoles $(1,0)$, in this case) are written as one node, with the understanding that the arrows between blocks connect each node of one block to each node of the other. \begin{figure}[t] \centering \begin{subfigure}{0.3\textwidth} \centering \scalebox{0.7}{\input{Gamma_04.tikz}} \caption{ } \label{FunDomainSU(2)Nf3} \end{subfigure}% \begin{subfigure}{0.3\textwidth} \centering \scalebox{0.7}{\input{Gamma_03.tikz}} \caption{ } \label{FunDomainSU2Nf3II} \end{subfigure}% \begin{subfigure}{0.3\textwidth} \centering \scalebox{0.7}{\input{Gamma01star.tikz}} \caption{ } \label{FunDomainSU2Nf3IV} \end{subfigure} \caption{Fundamental domains for $SU(2)~N_f=3$ configurations. (a)~$\Gamma_0(4)$ corresponding to $(I_1^*, I_4, I_1)$, the massless configuration. (b)~$\Gamma_0(3)$ corresponding to the configuration $(I_1^*, I_3, II)$, involving the $H_0$ AD point. (c)~Fundamental domain for the CB configuration $(I_1^*, IV, I_1)$ involving the $H_2$ AD point. This last configuration is not modular. The transitions between these configurations can be seen from the fundamental domains.} \end{figure} \medskip \noindent Another interesting limit is obtained by starting with equal masses $m_1=m_2=m_3$ and by tuning that equal mass $m_1 = \Lambda/2$, as shown on the third line of \eqref{configs su2Nf3}. In that case, the $I_3$ cusp merges with one $I_1$ cusp, forming an $IV$ singularity, while the Higgs branch remains the same. Setting $\Lambda = 4$ for simplicity, we find: \be u(\tau) = -19 - 27 {E_4(\tau)^{3/2} + E_6(\tau) \over E_4(\tau)^{3/2} - E_6(\tau)}~. \end{equation} The elliptic point of type $IV$ corresponds to the zero of the Eisenstein series $E_4$, namely $\tau_\ast = e^{2i\pi/3}$. The monodromies are: \be \mathbb{M}_{IV} =(ST)^{-2}~, \qquad \mathbb{M}_{I_1} = STS^{-1}~, \qquad \mathbb{M}_{\infty} = PT~, \end{equation} satisfying $\mathbb{M}_{IV} \mathbb{M}_{I_1} \mathbb{M}_{\infty} = \mathbf{1}$, as expected. Importantly, we have: \be \mathbb{M}_{IV} = \mathbb{M}_{(2,1)} \mathbb{M}_{(1,0)}^3~, \end{equation} so that the AD point can be interpreted as having three monopoles $(1,0)$ and one dyon $(2,1)$ becoming massless \cite{Argyres:1995xn}. This corresponds to `spitting' the $I_4$ cusp of the massless gauge theory into $I_3\oplus I_1$ before merging the $I_3$ with the other, mutually non-local, $I_1$ singularity. The fundamental domain for this configuration is shown in figure~\ref{FunDomainSU2Nf3IV}. It follows that the BPS quiver for the AD theory $H_2$ can be obtained from \eqref{quiverNf3} by deleting one of the four `monopole' nodes, say $\mathcal{E}_{\gamma_1=(1,0)}$. Let us also comment on the flavour group at this AD point. The flavour symmetry algebra of the configuration, which can be read off from the SW geometry, is $\frak{su}(3)\oplus \frak{u}(1)$, which corresponds precisely to the splitting $I_4\rightarrow I_3\oplus I_1$. Moreover, the Mordell-Weil group is torsionless in this case. If we focus on the AD point itself, the relevant BPS particles are $(2,1;0)$ and $(1,0; 1)$, and the corresponding flavour symmetry group is $SU(3)/\mathbb{Z}_3$ due to the $\mathbb{Z}_3$ action $({1\over 3}, {1\over 3}; 1)$ that leaves the configuration invariant. On the other hand, the full theory includes the additional flavour singlet $(1,0;0)$ which is not invariant under this $\mathbb{Z}_3$, and therefore the flavour symmetry group of the full configuration is $SU(3)$. As we `zoom in' into the AD point, one sends that additional dyon singularity to infinity, fusing $I_1^\ast\oplus I_1 \rightarrow IV^\ast$ to obtain the configuration $(IV^\ast, IV)$ of the 4d SCFT $H_2$. In that limit, we recover the flavour group $SU(3)/\mathbb{Z}_3$, consistently with the non-trivial Mordell-Weil torsion of that limiting configuration. \medskip \noindent All the other configurations in \eqref{configs su2Nf3} can be discussed similarly. For instance, if we set $m_1=m_2=m_3 = -\Lambda / 16$, we obtain the configuration $(I_1^*, I_3, II)$ on the fourth line in \eqref{configs su2Nf3}. In that case, we find: \be u(\tau) = -{1\over 16}\left( 7 + \left({\eta(\tau) \over \eta(3\tau)}\right)^{12}\right)~, \end{equation} which is the Hauptmodul for $\Gamma_0(3)$. The fundamental domain for this configuration is shown in figure~\ref{FunDomainSU2Nf3II}. We find the monodromies: \be \mathbb{M}_{I_3} = ST^3S^{-1} = \mathbb{M}_{(1,0)}^3~, \qquad \quad \mathbb{M}_{II} = ST^2 (ST)^{-1} (ST^2)^{-1}= \mathbb{M}_{(2,1)} \mathbb{M}_{(1,0)}~, \end{equation} which satisfy $ \mathbb{M}_{II} \mathbb{M}_{I_3} \mathbb{M}_{\infty}= \mathbf{1}$. \section{The $E_1$ and $\widetilde E_1$ theories -- 5d $SU(2)_\theta$}\label{sec:E1} In this and the next two sections, we explore the $U$-plane of the $E_n$ theories with $n \leq 3$. The corresponding toric geometries in Type IIA, and their Type IIB mirror, have been well studied in the literature -- see {\it e.g.} \cite{Lawrence:1997jr, Chiang:1999tz, Katz:1999xq, Hori:2000ck}. Here, we focus on the 5d interpretation and conduct a systematic analysis of the possible Coulomb branch configurations. Moreover, we solve for the physical periods as explicitly as possible for some interesting values of the masses, and in particular in the massless limit. We also discuss the modular properties of the $U$-plane as well as aspects of the global symmetries, following the general approach outlined in the previous sections. \subsection{The $E_1$ theory -- 5d $SU(2)_0$: $\mathbb{Z}_4$ torsion and BPS quivers} Let us first consider the $E_1$ theory, which is the UV completion of the five-dimensional $SU(2)_0$ gauge theory \cite{Seiberg:1996bd}. Its SW curve was first derived and studied in \cite{Nekrasov:1996cz, Lawrence:1997jr}. The `toric' expression \eqref{E1 toric curve} for the curve can be brought to the Weierstrass form \eqref{Weierstrass form general}, with: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{g2g3E1} g_2(U) & = \frac{1}{12}\Big(U^4 - 8(1+\lambda)U^2 + 16\left(1 - \lambda + \lambda^2\right) \Big)~, \\ g_3(U) & = -\frac{1}{216}\Big(U^6 - 12(1+\lambda)U^4 + 24\left(2 +\lambda+2\lambda^2\right)U^2-32\left(2 - 3\lambda - 3\lambda^2 + 2\lambda^3\right) \Big)~, \eea and with discriminant: \be\label{DeltaE1} \Delta(U) = \lambda^2\Big( U^4 - 8(1+\lambda)U^2 + 16(1-\lambda)^2\Big)~. \end{equation} At generic values of $\lambda$, the discriminant has four distinct roots, and we have four distinct $I_1$ singularities in the interior of the $U$-plane, plus the $I_8$ singularity at infinity -- see figure~\ref{fig:E1curves}. Note that $g_2$ and $g_3$ in \eqref{g2g3E1} depend on $U^2$ instead of $U$, and therefore the $\mathbb{Z}_2$ action: \be\label{Z2 oneform E1} \mathbb{Z}_2\; :\quad U\rightarrow -U~, \end{equation} is a symmetry of the $U$-plane for any value of the complexified 5d gauge coupling, $\lambda$. This symmetry has a simple physical explanation. Recall that $U$ is defined as the expectation value of the five-dimensional fundamental Wilson loop wrapped on $S^1$. Then \eqref{Z2 oneform E1} is precisely the action of the $\mathbb{Z}_2$ one-form symmetry of the $E_1$ theory \cite{Morrison:2020ool,Albertini:2020mdx}, which gives rise to both a one-form and an ordinary (zero-form) symmetry of the KK theory $D_{S^1} E_1$. Both are spontaneously broken on the Coulomb branch. It is useful to note that the $E_1$ SW geometry is a two-to-one covering of the pure $SU(2)$ geometry \cite{Nekrasov:1996cz}: \begin{equation} u_{({\rm 4d})} \longleftrightarrow {U^2 \over 4} - 1 -\lambda~, \qquad \quad \Lambda^4_{({\rm 4d})} \longleftrightarrow \lambda~, \end{equation} with the 4d curve given in \eqref{g2g3pure su2}. \begin{figure}[t] \begin{center} \tikzset{cross/.style={cross out, draw=black, fill=none, minimum size=2*(#1-\pgflinewidth), inner sep=0pt, outer sep=0pt}, cross/.default={2pt}} \begin{subfigure}{0.3\textwidth} \centering \begin{tikzpicture}[x=30pt,y=30pt] \begin{scope}[shift={(0,0)}] \draw[blue,semithick, -] (0,1.25) arc (90:360+90:1.25); \draw[thick] (0,1.25) node[cross=3pt] {}; \node at (0,1.6) { $I_8$}; \draw[thick] (-0.8,0) node[cross=3pt] {}; \node at (-0.8,-0.3) {$I_1$}; \draw[thick] (0,0) node[cross=3pt] {}; \node at (0,-0.3) {$I_2$}; \draw[thick] (0.8,0) node[cross=3pt] {}; \node at (0.8,-0.3) {$I_1$}; \end{scope} \end{tikzpicture} \caption{ Massless case, $\lambda=1$. \label{curveE1massless}} \end{subfigure}% \begin{subfigure}{0.3\textwidth} \centering \begin{tikzpicture}[x=30pt,y=30pt] \begin{scope}[shift={(0,0)}] \draw[blue,semithick, -] (0,1.25) arc (90:360+90:1.25); \draw[thick] (0,1.25) node[cross=3pt] {}; \node at (0,1.6) { $I_8$}; \draw[thick] (-0.68,-0.49) node[cross=3pt] {}; \node at (-0.68,-0.49-0.3) {$I_1$}; \draw[thick] (0.12,-0.49) node[cross=3pt] {}; \node at (0.12,-0.49-0.3) {$I_1$}; \draw[thick] (-0.12,0.49) node[cross=3pt] {}; \node at (-0.12,0.49+0.3){$I_1$}; \draw[thick] (0.68,0.49) node[cross=3pt] {}; \node at (0.68,0.49+0.3) {$I_1$}; \end{scope} \end{tikzpicture} \caption{ $\lambda=e^{2\pi i\over 3}$. \label{curveE1massless}} \end{subfigure}% \begin{subfigure}{0.3\textwidth} \centering \begin{tikzpicture}[x=30pt,y=30pt] \begin{scope}[shift={(0,0)}] \draw[blue,semithick, -] (0,1.25) arc (90:360+90:1.25); \draw[thick] (0,1.25) node[cross=3pt] {}; \node at (0,1.6) { $I_8$}; \draw[thick] (-0.4,0.4) node[cross=3pt] {}; \node at (-0.4,0.7) {$I_1$}; \draw[thick] (0.4,0.4) node[cross=3pt] {}; \node at (0.4,0.7) {$I_1$}; \draw[thick] (-0.4,-0.4) node[cross=3pt] {}; \node at (-0.4,-0.7) {$I_1$}; \draw[thick] (0.4,-0.4) node[cross=3pt] {}; \node at (0.4,-0.7) {$I_1$}; \end{scope} \end{tikzpicture} \caption{ $\lambda=-1$. \label{curveE1massless}} \end{subfigure}% \end{center} \caption{The $U$-plane of the $D_{S^1} E_1$ theory for some values of $\lambda$. Notice the $\mathbb{Z}_2$ symmetry, which is enhanced to $\mathbb{Z}_4$ at $\lambda=-1$. \label{fig:E1curves}} \end{figure} Let us study the $U$-plane in some detail. There are two configurations of singular fibers depending on the value of the parameter $\lambda$, as shown in table~\ref{tab:E1 configurations}.% \renewcommand{\arraystretch}{1.5} \begin{table}[] \centering \begin{tabular}{|c||c|c|c|c|} \hline $\{F_v\}$& $\lambda$ &$\mathfrak{g}_F$& ${\rm rk}(\Phi)$ & $\Phi_{\rm tor}$ \\ \hline \hline $I_8, 2I_1, I_2$ & $1$ & $A_1$ & $0$ & $\mathbb{Z}_4$ \\ \hline $I_8, 4I_1$ & $\lambda \neq 1$ & $\frak{u}(1)$ & $1$ & $\mathbb{Z}_2$\\ \hline \end{tabular} \caption{The two configurations of singular fibers for the $E_1$ theory.} \label{tab:E1 configurations} \end{table} \renewcommand{\arraystretch}{1} The case $\lambda=1$ is the massless point, which gives us the low-energy description of the 5d SCFT $\mathbb{R}^4\times S^1$ with vanishing real masses and without any non-trivial flavour Wilson line. For $\lambda \neq 1$, the corresponding configuration $(I_8,4I_1)$ is not extremal, with the $\frak{su}(2)$ flavour algebra broken to the Cartan subalgebra. The point $\lambda=-1$ corresponds to setting to zero the fundamental flavour Wilson line for $E_1= \mathfrak{su}(2)$: \be \chi_1^{E_1}= \sqrt{\lambda}+{1\over \sqrt{\lambda}}=0~. \end{equation} The corresponding $U$-plane turns out to be $\mathbb{Z}_4$ symmetric, and the periods can be expressed in terms of hypergeometric functions. \subsubsection{The $E_1$ massless curve} Let us first consider the massless $E_1$ curve, by fixing $\lambda = 1$. In this case, it will be useful to consider the variable:% \footnote{This $w$ is distinct from the variable $w\in \mathbb{C}^\ast$ used to describe the mirror curves $F(t,w)=0$ in the previous section. We will discuss various distinct `$w$-planes' in the next subsections. This should cause no confusion.} \be\label{w def E1 massless} w= {U^2\over 16}= {1\over 16 z_f}~. \end{equation} Let $(a_D, a)$ be the physical periods, which are related to the D4- and D2-brane periods as discussed in section~\ref{subsec: lvgeom}. We also introduce the geometric periods $\omega= {d\Pi\over dU}$, namely: \be \Pi_{D4} = a_D~, \qquad \Pi_{D2_f} = 2a~, \qquad \qquad \omega_{D}= {da_D\over dU}~, \qquad \omega_a={da\over dU}~. \end{equation} with the D4 period as given by \eqref{PiD4explicit0}: \be \label{PiD4 for E1} \Pi_{\rm D4} = \Pi_{{\rm D2}_f}\Pi_{{\rm D2}_b} + {1\over 6} = 2a\left(2a + {1 \over 2\pi i}\log(\lambda)\right) + {1\over 6}~, \end{equation} These geometric periods satisfy the Picard-Fuchs equation: \be {d^2\omega \over d U^2} + {3U^2-16 \over U(U^2-16)} {d\omega \over dU} +{1\over U^2 -16} \omega=0~. \end{equation} One can analyse the solutions to this equation, and their monodromies, rather explicitly. We will first discuss the periods on the $w$-plane, before going back to the physical $U$-plane. \paragraph{Geometric periods on the $w$-plane.} In terms of $w$ defined as in \eqref{w def E1 massless}, the massless $E_1$ curve takes the Weierstrass form: \be\label{g2g3w E1massless} g_2(w) = \frac{4}{3}(16w^2 - 16w + 1)~,\qquad \qquad g_3(w) = - \frac{8}{27}(64 w^3 - 96w^2 + 30w + 1)~, \end{equation} with a discriminant $\Delta(w) = 256(w-1)w$. Thus, this one-parameter family of curves has two $I_1$ singularities (at $w=0$ and $w=1$) in the interior of the $w$-plane. One can also check that the fiber at infinity is of type $I_4^\ast$, which is consistent with the fact that the $w$-plane is isomorphic to the four-dimensional pure $SU(2)$ Coulomb branch. The $w$-plane analysis that follows is then essentially the same as in \cite{Ferrari:1996sv}. \medskip \noindent Starting from the curve \eqref{g2g3w E1massless}, one can consider a distinct curve obtained by a rescaling: \be (g_2, g_3) \rightarrow \left((16w)^2 g_2, (16w)^3 g_3\right)~. \end{equation} This is a quadratic twist, as explained around \eqref{quadratwist}. The Kodaira singular fibers are then transmuted according to: \be\label{kodaira fiber E1 w} w=(0, 1, \infty)\; : \qquad (I_1, I_1, I_4^*)\rightarrow (I_1^*, I_1, I_4)~. \end{equation} This operation is equivalent to a rescaling of the coordinates $(x,y) \rightarrow \left((16w)^{-1}x, (16w)^{-{3\over 2}}y\right)$, which has the effect of rescaling the holomorphic one-form as $\boldsymbol{\omega} \rightarrow (16 w)^{-{1\over 2}} \boldsymbol{\omega}$. In addition, we find it convenient to multiply the geometric periods of this new curve by the regular function $16w$, so that we actually consider: \be \widetilde \omega_\gamma \equiv \sqrt{16w}\, \omega_\gamma = U {d \Pi_\gamma \over d U}~. \end{equation} Let us now study these rescaled geometric periods on the $w$-plane. Firstly, they satisfy the following PF equation: \begin{equation} (w-1) \frac{d\widetilde{\omega}}{dw^2} + \frac{d\widetilde{\omega}}{dw} - \frac{1}{4w^2}\widetilde{\omega}=0~. \end{equation} This is a standard hypergeometric differential equation, with singularities at $w=0, 1, \infty$. In particular, at each of the three singularities there is only one regular solution. A convenient basis of solutions is given by: \be \widetilde{\omega}_a(w) = -\frac{1}{2\pi i} \prescript{}{2}{F}_1 \left(\frac{1}{2},\frac{1}{2},1;\frac{1}{w}\right)~, \qquad \widetilde{\omega}_D(w) = -\frac{1}{\pi} \prescript{}{2}{F}_1 \left(\frac{1}{2},\frac{1}{2},1; 1-\frac{1}{w} \right)~. \end{equation} The period $\widetilde\omega_a$ is regular in the large volume limit, $w=\infty$, while the `dual period' $\widetilde\omega_D$ is regular at the `conifold point', $w = 1$. A Gauss-Ramanujan identity for the hypergeometric function provides a way of analytically continuing these solutions past their respective regions of convergence, to unit argument: \begin{equation} \prescript{}{2}{F}_1 \left(\frac{1}{2},\frac{1}{2},1;x\right) \approx \frac{4}{\pi}\log(2) - \frac{1}{\pi}\log(1-x) + \mathcal{O}\left[(1-x)\log(1-x)\right]~. \end{equation} To analytically continue to $w=0$, we use the Barnes integral representation: \begin{equation} \prescript{}{2}{F}_1 \left(\frac{1}{2},\frac{1}{2},1;x\right) = \frac{1}{2\pi i \, \Gamma\left(\frac{1}{2}\right)^2} \int_{-i\infty}^{i\infty} \frac{\Gamma\left(\frac{1}{2}+t\right)^2 \Gamma(-t)}{\Gamma(1+t)}(-x)^t dt~, \end{equation} for $|{\rm arg}(-x)|<\pi$. The integration contour separates the poles of $\Gamma\left(\frac{1}{2}+t\right)$ from those of $\Gamma(-t)$. Consequently, when closing the contour to the right we recover the regular solution for $\widetilde{\omega}_a$ at $w = \infty$, while when closing it to the left we find the asymptotic expansion: \begin{equation} \label{AnalyticContinuation2F1} \prescript{}{2}{F}_1 \left(\frac{1}{2},\frac{1}{2},1;\frac{1}{w}\right) \longrightarrow \frac{w^{1\over 2}}{\pi i} \prescript{}{2}{F}_1 \left(\frac{1}{2},\frac{1}{2},1;w\right)~\left(-\log\left(-{w\over 16}\right)\right) - \frac{w^{3\over 2}}{2\pi i} f(w)~, \end{equation} where $f(w)$ is given by:% \footnote{The rational coefficients $\kappa_k$ can be written as the following residues: $$\kappa_k= {2\over \pi} {\rm Res}_{s=k}\left[2^{4(s-k)} \Gamma(-s)^2\, \Gamma\big({1\over 2}+s\big)^2 \right]~.$$} \begin{equation} f(w) =\sum_{k=1}^\infty \kappa_k w^{k-1} = 1 + \frac{21}{32} w + \frac{185}{384}w^2 + \frac{18655}{49152}w^3 + \frac{102501}{327680}w^4 + \mathcal{O}\left(w^5\right)~. \end{equation} We thus find: \be \widetilde\omega_a(w)= {\epsilon \sqrt{w}\over 2\pi^2}\left[ \prescript{}{2}{F}_1 \left(\frac{1}{2},\frac{1}{2},1;w\right) \log\left(-{w\over 16}\right) + {w\over 2}f(w) \right]~, \end{equation} at $w=0$. Here we introduced the sign $\epsilon= {\rm sign}\left({\rm Im}(w)\right)$, corresponding to a choice of branch for the square root. This expression with $\epsilon=1$ holds on the principal branch of $\widetilde{\omega}_a$. Note that $\widetilde\omega_a$ has a branch cut on the interval $w \in (0,1]$.% \begin{figure}[h] \centering \begin{tikzpicture}[x=90pt,y=90pt,decoration = snake] \begin{scope}[shift={(2,0)}] \draw[thin,gray,-stealth] (-1,0) -- (1,0) node[right] {}; \draw[thin,gray,-stealth] (0,-0.5) -- (0,0.5) node[above] {}; \draw[thin,gray,-stealth] (1.5,0) -- (3.5,0) node[right] {}; \draw[thin,gray,-stealth] (2.5,-0.5) -- (2.5,0.5) node[above] {}; \draw[very thin, black, ->] (-0.25,0) arc(-180:170:0.25); \draw[very thin, black, ->] (2.75,0) arc(0:350:0.25); \draw[red,thick,decorate] (2.5,0) -- (3,0) {}; \draw[red,thick,decorate] (-0.8,0) -- (0,0) {}; \fill (0,0) circle[radius=2pt] {}; \fill (0.5,0) circle[radius=2pt] {}; \fill (2.5,0) circle[radius=2pt] {}; \fill (3,0) circle[radius=2pt] {}; \node at (0,-0.1) {\small$w=0$}; \node at (2.5,-0.1) {\small$w=0$}; \node at (3.2,0.1) {\small$w=1$}; \node at (0.7,0.1) {\small$w=1$}; \node at (-0.45,0.1) {\small$\pi$}; \node at (-0.47,-0.1) {\small $-\pi$}; \node at (2.85,0.1) {\small$0$}; \node at (2.85,-0.1) {\small$2\pi$}; \end{scope} \end{tikzpicture} \caption{Branch cuts of the geometric periods $\widetilde{\omega}_D$ and $\widetilde{\omega}_a$, respectively.} \label{fig:Cuts Geometric Periods} \end{figure} The same method can be used to analytically continue $\widetilde\omega_D$ to $w = 0$. The leading asymptotics for the two periods are as follows: \begin{equation} \label{GeometricPeriodsAsymptotics} \begin{aligned} w = \infty~:~ & ~ \widetilde{\omega}_a(w) \approx -\frac{1}{2\pi i}\left(1 + \frac{1}{4w} + \mathcal{O}\left(\frac{1}{w^2}\right) \right)~, \\ & ~ \widetilde{\omega}_D(w) \approx -\frac{1}{\pi^2} \log(16w) + \mathcal{O}\left(\frac{1}{w}\right)~, \\ w=1~:~ & ~ \widetilde{\omega}_a(u) \approx \frac{1}{2\pi^2 i}\log\left({u\over 16}\right) + \mathcal{O}\left(u \log(u)\right)~,\\ &~ \widetilde{\omega}_D(u) \approx -\frac{1}{\pi}\left( 1 + \frac{1}{4}u + \mathcal{O}(u^2)\right)~, \\ w = 0~:~ & ~\widetilde{\omega}_a(w) \approx \frac{\sqrt{w}}{2\pi^2} \Big(i\pi - \epsilon~ \log\left({w\over 16}\right)\Big) + \mathcal{O}\left( w^{3\ov2}\right)~, \\ &~ \widetilde{\omega}_D(w) \approx \frac{\sqrt{w}}{\pi^2} \log\left({w\over 16}\right) + \mathcal{O}\left( w^{3\over 2}\right)~. \end{aligned} \end{equation} where we introduced the coordinate $u=1-\frac{1}{w}$. Note that the principal branch of $\widetilde{\omega}_a$ differs from that of $\widetilde{\omega}_D$. The branch cuts of the two periods are shown in figure~\ref{fig:Cuts Geometric Periods}. The factor of $\epsilon$ is then necessary to match the two principal branches, allowing us to consider linear combinations of the periods. As a consistency check, let us compute the monodromies of the geometric periods in the $(\widetilde{\omega}_D, \widetilde{\omega}_a)$ basis. As we go around $w=0$ ($w \rightarrow e^{2\pi i}w$), one finds: \be \mathbb{M}^{(g)+}_{w = 0} = \left(\begin{matrix} -3 & -4 \\ 1 & 1 \end{matrix}\right)~, \qquad \mathbb{M}^{(g)-}_{w = 0} = \left(\begin{matrix} 1 & -4 \\ 1 & -3 \end{matrix}\right) \end{equation} corresponding to a base point in the upper- or lower-half plane, respectively. The monodromies at $w=1$ and $w=\infty$ (with $u \rightarrow e^{2\pi i}u$ and $w \rightarrow e^{-2\pi i}w$ at $w = \infty$, respectively) are: \begin{equation} \mathbb{M}^{(g)}_{w = 1} = \left(\begin{matrix} 1 & 0 \\ -1 & 1 \end{matrix}\right)~,\qquad \mathbb{M}^{(g)}_{w = \infty} = \left(\begin{matrix} 1 & 4 \\ 0 & 1 \end{matrix}\right)~. \end{equation} These matrices satisfy: \begin{equation} \mathbb{M}_{w=1}\mathbb{M}^{-}_{w=0} \mathbb{M}_{w=\infty} = \mathbf{1} = \mathbb{M}^{+}_{w=0} \mathbb{M}_{w=1} \mathbb{M}_{w=\infty}~, \end{equation} as expected. Let us note also that these can be written as: \begin{equation} \begin{aligned} \mathbb{M}^{(g)\epsilon}_{w=0} = (T^{-2\epsilon}S)(-T)(T^{-2\epsilon}S)^{-1}~, \qquad \mathbb{M}^{(g)}_{w=1} = S T S^{-1}~, \qquad \mathbb{M}^{(g)}_{w=\infty} = T^4~, \end{aligned} \end{equation} for $\epsilon = \pm 1$. This is of course consistent with the global analysis, wherein we have the Kodaira fibers $(I_1^\ast, I_1, I_4)$ as in \eqref{kodaira fiber E1 w}. In particular, the point at $w=0$ is the $I_1^\ast$ singularity. Interestingly, the $w$-plane can be viewed as a modular curve for the congruence subgroup $\Gamma^0(4)$ of ${\rm SL}(2, \mathbb{Z})$, exactly like the Coulomb branch of the pure $SU(2)$ SW geometry \cite{Seiberg:1994aj}. The dependence of $\mathbb{M}_{w=0}$ on the base point is due to our choices of branch cuts \cite{Ferrari:1996sv}, and it can be interpreted as a `splitting' of the fundamental domain, as shown in figure~\ref{FunDomainPureSU2Cuts}, such that the cusps at $\tau=-2$ and $\tau = 2$ are identified. \paragraph{Physical periods on the $w$-plane.} The physical periods on the $w$-plane can now be obtained, in principle, from the geometric periods, using the fact that: \begin{equation} \widetilde{\omega}_{\gamma} = U \frac{d}{dU}\Pi_{\gamma}~. \end{equation} Let us also note that they satisfy the following third order differential equation: \be \left(z\left(\theta_z- {1\over 2}\right)^2-\theta_z^2 \right)\theta_z\Pi_\gamma =0~, \end{equation} with $z={1\over w}$ and $\theta = z{d\over dz}$. This is a Meijer equation, and therefore the solutions can be written in terms of Meijer $G$-functions. In order to fix a basis that corresponds to the physical periods $(a_D, a)$, let us first consider the asymptotics of the periods obtained by integrating the geometric periods. These are: \begin{equation} \begin{aligned} w = \infty~:~ & ~ a(w) \approx \alpha_{\infty}-\frac{1}{4\pi i}\log\left( w\right) +\mathcal{O}\left(\frac{1}{w}\right)~, \\ & ~ a_D(w) \approx \beta_{\infty}+\frac{1}{(2\pi i)^2}\log^2\left(\frac{1}{16w}\right) + \mathcal{O}\left(\frac{1}{w}\right)~, \\ w=1~:~ & ~ a(u) \approx \alpha_1 -\frac{1}{4\pi^2 i}\Big(1-\log\left({u\over 16}\right)\Big) u + \mathcal{O}\left(u^2\right)~,\\ &~ a_D(u) \approx \beta_1 -\frac{u}{2\pi} +\mathcal{O}(u^2)~, \\ w=0~:~ & ~a(w) \approx \alpha_{0} + \frac{\epsilon \sqrt{w}}{2\pi^2} \Big(2 - \log\left(-\frac{w}{16}\right)\Big) +\mathcal{O}\left( w^{3\over 2}\right)~, \\ &~ a_D(w) \approx \beta_{0}-\frac{ \sqrt{w}}{\pi^2}\Big( 2 - \log\left(\frac{w}{16}\right)\Big) + \mathcal{O}\left( w^{3\over 2}\right)~, \end{aligned} \end{equation} with $\alpha_\ast$, $\beta_\ast$ some integration constants to be determined. We fix two of the constants, namely: \be \alpha_{\infty} = -\frac{1}{4\pi i}\log(16)~, \qquad\quad \quad \beta_1 = 0~, \end{equation} such that $2a(w)$ matches with the D2-brane period on $\mathcal{C}_f$ at large volume $a\approx {1\over 4\pi i}\log z_f$, and such that $a_D(w)$ vanishes at $w=1$. Note that, a priori, this $a_D(w)$ might not match with the D4-brane period at large volume. Comparing to the D4-brane period \eqref{PiD4 for E1}, this fixes $\beta_\infty= {1\over 6}$, and we will check that this is indeed consistent. In order to fix $\beta_0$, we proceed as in \cite{Mohri:2000wu}. Using the connection formula: \begin{equation} \prescript{}{2}{F}_1 \left(\frac{1}{2},\frac{1}{2},1;1-x\right) = x^{-{1\over 2}} \prescript{}{2}{F}_1 \left(\frac{1}{2},\frac{1}{2},1;1-\frac{1}{x}\right) ~, \end{equation} which analytically continues the $a_D$ period from the region $|u|<1$ towards $w = 0$ (excluding the point $w=0$ point) in the $|w|<1$ region, we have: \begin{equation} \begin{aligned} a_D(w=1) & = -\frac{1}{2\pi}\int_{0}^{1}\frac{1}{\sqrt{w}}~\prescript{}{2}{F}_1 \left(\frac{1}{2},\frac{1}{2},1;1-w\right) dw + \beta_{0} \\ & = -\frac{1}{2\pi^2}\int_{0}^{1} \frac{1}{\sqrt{w}}\sum_{n=0}^{\infty}~\frac{1}{n!}\frac{\Gamma\left(\frac{1}{2}+n\right)^2}{ \Gamma(1+n)}\left(1-w\right)^n d w + \beta_{0} \\ &= -\frac{1}{2\pi^2}~\pi^2 + \beta_{0}~. \end{aligned} \end{equation} Given that $a_D$ vanishes at $w=1$, it follows that $\beta_{0} ={1\over 2}$. Having fixed this constant, we can write the periods in terms of Meijer $G$-functions: \begin{equation} \begin{aligned} a(w) & = -\frac{1}{4\pi^2 i} G_{3,3}^{2,2}\left( \begin{matrix}\frac{1}{2}& \frac{1}{2}& 1 \\0&0&0\end{matrix}~ \middle\vert -\frac{1}{w} \right) +\frac{\widetilde\epsilon}{4}~, \\ a_D(w) & =-\frac{1}{2\pi^3} G_{3,3}^{3,2}\left( \begin{matrix}\frac{1}{2}& \frac{1}{2}& 1 \\0&0&0\end{matrix}~ \middle\vert ~\frac{1}{w} \right) + \frac{1}{2}~, \end{aligned} \end{equation} where $\widetilde\epsilon= \pm 1$ (modulo even integers) to match the large volume limit of $a(w)$ on a given branch. Using the Barnes-type integral representation of the $G$-functions,% \footnote{We have: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\nonumber &G^{2,2}_{3,3}\left({ \begin{matrix}\frac{1}{2}& \frac{1}{2}& 1 \\0&0&0\end{matrix}}~ \middle\vert\, x\right) = {1\over 2 \pi i} \int {\Gamma(-s)^2\, \Gamma\left({1\over 2}+s\right)^2 \over \Gamma(1+s) \Gamma(1-s)} x^s ds~,\;\;\; &G^{3,2}_{3,3}\left({ \begin{matrix}\frac{1}{2}& \frac{1}{2}& 1 \\0&0&0\end{matrix} }~\middle\vert\, x\right) = {1\over 2 \pi i} \int {\Gamma(-s)^3\, \Gamma\left({1\over 2}+s\right)^2 \over \Gamma(1-s)} x^s ds~. \eea } one can check that $\beta_{\infty} = \frac{1}{6}$, and one also finds $\alpha_{0} = \frac{\widetilde \epsilon}{4}$. We thus have: \begin{equation} a(w=0) = \frac{\widetilde\epsilon}{4}~, \qquad \qquad a_D(w=0) = \frac{1}{2}~. \end{equation} Finally, to fix the remaining constant $\alpha_1$ at $w=1$, one can directly evaluate the Meijer $G$-function at unit argument. This gives the `quantum volume' of the curve $\mathcal{C}_f$ at the conifold point: \begin{equation} \Pi_{{\rm D2}_f}(w=1) = 2 a(w=1) = 2 \alpha_1 = \frac{1+\widetilde\epsilon}{2}+i \frac{4G}{\pi^2}~, \end{equation} where $G\approx 0.916$ is the Catalan constant. This agrees with the recent discussion in \cite{Gu:2021ize}. \paragraph{Geometric periods on the $U$-plane.} Having obtained explicit expressions for the periods on the $w$-plane, the next step is to analytically continue the periods on the $U$-plane, which is a double-cover of the $w$-plane. Let us first consider the geometric periods. We introduce the functions: \begin{equation} f_a(w) = -\frac{1}{2\pi i}\prescript{}{2}{F}_1 \left( \frac{1}{2}, \frac{1}{2}; 1; \frac{16}{U^2} \right)~, \qquad f_D(w) = -\frac{1}{\pi} \prescript{}{2}{F}_1 \left( \frac{1}{2}, \frac{1}{2}; 1; 1-\frac{16}{U^2} \right)~. \end{equation} Since the map $U \mapsto w$ is $2$ to $1$, we will split the $U$-plane into two regions separated by the imaginary axis, which we denote by $A$ (for ${\rm Re}(U)>0$) and $B$ (for ${\rm Re}(U)<0$). The above functions have branch cuts inherited from the hypergeometric function. Thus, it is not directly obvious what their expressions throughout the whole $U$-plane are. Here, we will interpret $f_D$ as a \textit{local} function, which is well defined only around one of the two `conifold' singularities at $U^2 = 16$. The branch cuts of $f_a$ connect the singularities at $U=\pm 4$ to the $U=0$ singularity. We choose the branch cut of $f_D$ to run along $U\in [0,i\infty)$, in agreement with the $w$-plane branch cut. Recall also that the large volume asymptotics on the $w$ plane gives: \begin{equation} \begin{aligned} f_a(w) & \approx -\frac{1}{2 \pi i} + \mathcal{O}\left(\frac{1}{w}\right)~, \qquad f_D(w) & \approx -\frac{1}{\pi^2} \log(16 w)+ \mathcal{O}\left(\frac{1}{w}\right)~. \end{aligned} \end{equation} The geometric periods in the $A$ and $B$ regions will be linear combinations of $f_a$ and $f_D$, with the large volume ($U \rightarrow \infty$) asymptotics: \begin{equation} \begin{aligned} \widetilde{\omega}_a \approx-\frac{1}{2\pi i}~, \qquad \quad \widetilde{\omega}_D \approx~\frac{2}{\pi^2} \log \left(\frac{1}{U}\right)~, \end{aligned} \end{equation} which reproduce the large volume monodromy: \be \mathbb{M}_{U=\infty}=\mat{1& 8\\ 0 &1} =T^8~. \end{equation} We first note that $f_a$ can be used for the $a$ period in both regions of the $U$-plane, since the large volume expression is a regular function. The $\widetilde\omega_a$ period will thus have two branch cuts, running along $U\in(0_+, 4]$ and $U\in[-4, 0_-)$. We can choose $U_{*}=-4$ to be the cusp where $a_D(U_*) = 0$. Thus, in region $B$, the dual period $\widetilde{\omega}_D$ will be given by $f_D$. The mapping of the angles between the $w$-sheets and the $U$-plane is: \begin{equation} \begin{aligned} U~:~ & -\frac{3\pi}{2}\rightarrow -\pi~,~ \quad ~-\pi~ \rightarrow -\frac{\pi}{2}~,~ \quad ~-\frac{\pi}{2} \rightarrow 0~,~ \quad ~0 \rightarrow \frac{\pi}{2}~, \\ w~:~ & -3\pi\rightarrow -2\pi~,~ \quad ~-2\pi \rightarrow -\pi~,~ \quad ~-\pi \rightarrow 0~,~ \quad ~0 \rightarrow \pi~. \\ \end{aligned} \end{equation} Recall that ${\rm arg}(w) \in (-\pi,\pi)$ was the principal branch of $\widetilde{\omega}_D$ in the $w$-plane. Now, consider the function $f_D$ in region $A$. Analytic continuation to $U\rightarrow \infty$ leads to: \begin{equation} f_D^{(A)} \approx -\frac{1}{\pi^2}\log(16w^{(A)}) = -\frac{1}{\pi^2} \Big( \log(16 w^{(B)}) - 2\pi i \Big)~. \end{equation} In order for this to match with the asymptotic expansion of $\widetilde{\omega}_D$ in all regions, we must substract a factor of $4f_a$. We then have: \begin{equation} \begin{aligned} A~: ~&~\quad \widetilde{\omega}_D(U) = f_D(U)+4f_a(U)~,\cr B~: ~&~\quad \widetilde{\omega}_D(U) = f_D(U)~. \end{aligned} \end{equation} while: \begin{equation} \widetilde{\omega}_a(U) = f_a(U)~, \end{equation} for the entire $U$-plane. The branch cuts of the geometric periods $\widetilde{\omega}_D$ and $\widetilde{\omega}_a$ are shown in figure~\ref{fig:cuts of omegaa aD}. \begin{figure}[t] \begin{center} \begin{tikzpicture}[x=90pt,y=90pt,decoration = snake] \begin{scope}[shift={(2,0)}] \draw[thin,gray,-stealth] (-1,0) -- (1,0) node[right] {}; \draw[very thick,gray,-stealth] (0,-0.6) -- (0,0.7) node[above] {}; \draw[thin,gray,-stealth] (1.5,0) -- (3.5,0) node[right] {}; \draw[very thick,gray,-stealth] (2.5,-0.6) -- (2.5,0.7) node[above] {}; \draw[red,thick,decorate] (90:0.62) -- (0,0) {}; \draw[red,thick,decorate] (0,0) -- (0.5,0) {}; \draw[red,thick,decorate] (2,0) -- (2.5,0) {}; \draw[red,thick,decorate] (2.5,0) -- (3,0) {}; \fill (0,0) circle[radius=2pt] {}; \fill (-1/2,0) circle[radius=2pt] {}; \fill (1/2,0) circle[radius=2pt] {}; \fill (2.5,0) circle[radius=2pt] {}; \fill (2,0) circle[radius=2pt] {}; \fill (3,0) circle[radius=2pt] {}; \node at (-0.8,0.1) {\small$U=-4$}; \node at (0,-0.1) {\small$U=0$}; \node at (0.6,0.1) {\small$U=4$}; \node at (1.85,0.1) {\small$U=-4$}; \node at (2.5,-0.1) {\small$U=0$}; \node at (3,0.1) {\small$U=4$}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (-0.7,0.5) {B}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (0.7,0.5) {A}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (1.8,0.5) {B}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (3.2,0.5) {A}; \draw[very thin, black, ->] (0,0.3) arc(90:440:0.3); \node at (-0.2,0.45) {$-\frac{3\pi}{2}$}; \node at (0.2,0.45) {$\frac{\pi}{2}$}; \end{scope} \end{tikzpicture} \end{center} \caption{Branch cuts for $\widetilde\omega_D(U)$ and $\widetilde\omega_a(U)$, respectively. \label{fig:cuts of omegaa aD}} \end{figure} The monodromies around the two singularities at $U=\pm 4$ read: \begin{equation} \mathbb{M}_{U=-4} = \left( \begin{matrix} 1 & 0 \\ -1 & 1 \end{matrix} \right) = S T S~, \qquad \mathbb{M}_{U=4} = \left( \begin{matrix} -3 & 16 \\ -1 & 5 \end{matrix} \right) = (T^4S) T (T^4S)^{-1}~. \end{equation} For the series expansion around $U = 0$, one needs to take into account the various branch cuts of $\widetilde{\omega}_a$ and $\widetilde{\omega}_D$. In the region where ${\rm Re}(U)>0$, and ${\rm Im}(U)<0$, for instance, the asymptotics are: \be \widetilde{\omega}_a(U) \approx-{U\over 2\pi^2} \log{U\over 4} + i {U\over 2\pi} + \mathcal{O}\left( U^3\right)~, \qquad \widetilde{\omega}_D(U) \approx-{U\over 4\pi^2} \log{U\over 4} + i {U\over 8 \pi} + \mathcal{O}\left( U^{3}\right)~, \end{equation} leading to the monodromy: \begin{equation} \mathbb{M}_{U=0} = \left( \begin{matrix} -3 & 8 \\ -2 & 5 \end{matrix} \right) = (T^{2}S)T^2(T^{2}S)~. \end{equation} which, in particular, agrees with the fact that $U=0$ is an $I_2$ singularity. These monodromies satisfy the consistency condition: \be \mathbb{M}_{U=-4} \mathbb{M}_{U=0} \mathbb{M}_{U=4}= \mathbb{M}_{U=\infty}^{-1}~. \end{equation} Our explicit analysis of the $U$-plane periods thus recovers the Kodaira singularities expected from the discriminant of the Seiberg-Witten curve: \be (I_1, I_2, I_1, I_8) \qquad \text{at}\qquad U_\ast= -4, 0, 4, \infty~. \end{equation} Finally, by integrating the geometric periods once, we can obtain the physical periods on the $U$-plane, similarly to the analysis on the $w$-plane. One can determine in that way which BPS particles become massless at which points. This can also be understood, more simply, from the explicit monodromy matrices that we just derived. \paragraph{Massless dyons and 5d BPS quiver.} One finds that the following dyons of the KK theory $D_{S^1} E_1$ become massless at these points: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \label{E1 BPS states} & U=-4 \; && (I_1) \; \;&&: \quad && \text{a monopole of charge $(1,0)$, becomes massless,}\cr & U=0 \; && (I_2) \; \;&&:\quad && \text{two dyons of charge $(-1,2)$, become massless,}\cr & U=4 \; && (I_1) \; \;&&:\quad && \text{a dyon of charge $(1,-4)$, becomes massless.} \eea Here, we fixed the overall signs of the electromagnetic charges such that the total charge vanishes. Interestingly, the point $U=0$ is also a {\it quiver point}, where these BPS particles are mutually BPS. Using the fact that $a={1\over 4}$ and $a_D={1\over 2}$ at the origin, we find the central charges: \be \mathcal{Z}_{\gamma=(1,0)}(U=0)= {1\over 2}~, \qquad \mathcal{Z}_{\gamma=(-1,2)}(U=0)= 0~, \qquad \mathcal{Z}_{\gamma=(1,-4)}(U=0)= {1\over 2}~. \end{equation} The central charges of the $\gamma=(1,-4)$ also carries a contribution from one unit of KK momentum (D0-brane charge) \cite{Closset:2019juk}. The associated 5d BPS quiver is obtained by assigning one node $\mathcal{E}_\gamma$ to each of the four dyons, and by drawing a net number of arrows $n_{ij}$ from $\mathcal{E}_{\gamma_i}$ to $\mathcal{E}_{\gamma_j}$ given by the Dirac pairing, $n_{ij}=\det{(\gamma_i, \gamma_j)}$. The resulting quiver reads: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{quiverF0I2} \begin{tikzpicture}[baseline=1mm] \node[] (1) []{$\mathcal{E}_{\gamma_1=(1,0)}$}; \node[] (2) [right = of 1]{$\mathcal{E}_{\gamma_2=(-1,2)}$}; \node[] (3) [below = of 1]{$\mathcal{E}_{\gamma_3=(-1,2)}$}; \node[] (4) [below = of 2]{$\mathcal{E}_{\gamma_4=(1,-4)}$}; \draw[->>-=0.5] (1) to (2); \draw[->>-=0.5] (1) to (3); \draw[->>-=0.5] (2) to (4); \draw[->>-=0.5] (3) to (4); \draw[->>>>-=0.5] (4) to (1); \end{tikzpicture} \eea This is a well-known `toric' quiver for local $\mathbb{F}_0$ -- see {\it e.g.} \cite{Feng:2000mi}. \paragraph{Modularity.} The Coulomb branch of the massless $E_1$ theory on a circle can be written as a modular curve for the congruence subgroup $\Gamma^0(8)$. To see this explicitly, we should look at the explicit map $U=U(\tau)$, which can be worked out as explained in section~\ref{subsec:monoSW}. We find: \be\label{hauptmodul E1} U(\tau) = {\eta\left({\tau\over 2}\right)^{12} \over \eta\left({\tau\over 4}\right)^4~\eta(\tau)^8} = q^{-{1\ov8}} + 4q^{1\ov8} + 2q^{3\ov8} - 8q^{5\ov8} - q^{7\ov8} + \mathcal{O}\left( q\right) ~. \end{equation} We refer to appendix~\ref{App:Congruence} for some background on modular functions. The $\eta$-quotient \eqref{hauptmodul E1} is the Hauptmodul for $\Gamma^0(8)$. Note that this expression is obviously invariant under the action of $T^8$.% \begin{figure}[t] \centering \scalebox{0.8}{\input{Gamma08.tikz}} \label{FunDomainGamma0(8)} \caption{A fundamental domain for $\Gamma^0(8)$ on the upper-half plane. The four cusps at $\tau = 0, 2, 4, i \infty$ have widths $1$, $2$, $1$ and $8$, respectively. The modular curve $\mathbb{H}/\Gamma^0(8)$ is isomorphic to the Coulomb branch of the massless $D_{S^1} E_1$ theory.} \end{figure} Its series expansion reproduces the coefficients of the McKay-Thompson series of class $8E$ of the Monster group \cite{Conway:1979qga}. Using the $S$-transformation properties of the Dedekind $\eta$ function: \begin{equation} \eta\left({\tau\over \alpha}\right) = i^{-{1\over 2}}\sqrt{\alpha~\tau_D}~ \eta(\alpha~\tau_D)~, \end{equation} for $\tau_D = -{1\over \tau}$, we find the $q$-series expansion around $\tau_D = 0$: \begin{equation} U(\tau_D) = 4~\frac{\eta(2\tau_D)^{12}}{\eta(4\tau_D)^4~\eta(\tau_D)^8}~ =~ 4+32q_D + 128 q_D^2 + 384 q_D^3 + \mathcal{O}(q_D^4) ~. \end{equation} Therefore, the cusp at $\tau = 0$ corresponds to the type-$I_1$ Kodaira singularity at $U=4$ on the $U$-plane. Similarly, under a $T^2$ transformation $\tau \rightarrow \widetilde{\tau} = \tau + 2$, \eqref{hauptmodul E1} becomes: \begin{equation} U(\widetilde{\tau}) = -i\left(\frac{\eta\left({\widetilde \tau\over 4}\right) }{\eta(\widetilde{\tau})}\right)^4~ = -i\left(\widetilde{q}^{~-{1\ov8}} - 4\widetilde{q}^{~{1\ov8}} + 2\widetilde{q}^{~{3\ov8}} + 8\widetilde{q}^{~{5\ov8}} + \mathcal{O}\left(\widetilde{q}^{~{7\ov8}}\right) \right)~. \end{equation} Under an additional $S$-transformation, we find the following series expansion for $\widetilde{\tau}_D = \tau_D + 2$: \begin{equation} U(\widetilde{\tau}_D) = -16i\left(\frac{\eta(4\widetilde{\tau}_D)}{\eta(\widetilde{\tau}_D)}\right)^4~ = -16i\left( \widetilde{q}_D^{~{1\over 2}} + 4\widetilde{q}_D^{~{3\ov2}} + 14 \widetilde{q}_D^{~{5\ov2}} + \mathcal{O}\left(\widetilde{q}_D^{~{7\ov2}}\right) \right)~. \end{equation} Therefore, the cusp at $\tau=2$ corresponds to the $I_2$ type singularity located at $U=0$. Finally, note that \eqref{hauptmodul E1} changes sign under a $T^4$ transformation, and thus the cusp at $\tau=4$ corresponds to $U=-4$. There is therefore a one-to-one mapping between the cusps of $\Gamma^0(8)$ and the $U$-plane singularities. The periods themselves have interesting modular properties. For instance, the geometric period $\omega_a$ turns out to be a modular form of weight $1$, which can be expressed in terms of the Jacobi $\vartheta$-function: \begin{equation} \frac{da}{dU}(\tau) ~ = -{1\over 8\pi i}\vartheta_2\left(\frac{\tau}{2}\right)^2 = ~ -\frac{1}{2\pi i}\left(q^{1\ov8} + 2q^{5\ov8} + q^{9\ov8} + 2q^{13\ov8} + \mathcal{O}\left(q^{17\ov8}\right) \right)~. \end{equation} We will see similar modular properties appear for most of the massless $E_n$ theories. \medskip \noindent \paragraph{Global flavour symmetry.} The massless $E_1$ curve has three non-trivial sections: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{Z4 torsion E1} P_1 = \left( {1\over 12}(U^2 + 4), - U\right)~, \quad P_2 = \left( {1\over 12}(U^2 - 8), 0\right)~, \quad P_3 = \left( {1\over 12}(U^2 + 4), U\right)~, \eea which span a $\mathbb{Z}_4$ torsion group with $P_k + P_l = P_{k+l~(\text{mod }4)}$. Let us note that the sections $P_1$ and $P_3$ intersect non-trivially the $I_2$ singular fiber at $U=0$. The remaining section, $P_2$, only intersects the `trivial' component of this fiber and therefore generates a $\mathbb{Z}^{[1]}_2$ subgroup which injects in the torsion group $\mathbb{Z}_4$ according to \eqref{SES tor}. The group $\mathscr{F}=\mathbb{Z}_2^{(f)} = \mathbb{Z}_4/\mathbb{Z}^{[1]}_2$ then constraints the global form of the flavour group to be: \be\label{GF for E1} G_F = SU(2)/\mathbb{Z}_2^{(f)} \cong SO(3)~, \end{equation} in agreement with \cite{Apruzzi:2021vcu}. We also identify the $\mathbb{Z}^{[1]}_2$ subgroup as the one-form symmetry of the $E_1$ theory. Indeed, the same structure can be derived using the BPS spectrum, which can be deduced in principle from the quiver \eqref{quiverF0I2}. We have the states: \be \mathscr{S}\;\; :\; \; \; (1,0; 0)~, \quad (-1,2;1)~, \quad (1,-4; 0)~, \end{equation} where the charges $(m,q; l)$ are given as in \eqref{psi state charges}, with $l\in \mathbb{Z}_2$ the charge under the center of the flavour $\widetilde G_F \cong SU(2)$. The spectrum is left invariant by a group $\mathscr{E} =\mathbb{Z}_4$ generated by: \be g^\mathscr{E} = \left(0, {1\over 4}; 1\right)~. \end{equation} This $\mathbb{Z}_4$ contains a $\mathbb{Z}_2^{[1]}$ subgroup: \be\label{gZ1 E1} g^{\mathcal{Z}^{[1]}} =\left(0, {1\over 2}; 0\right)~, \end{equation} which implies that the theory has an electric one-form symmetry $\mathbb{Z}_2^{[1]}$, as expected \cite{Morrison:2020ool, Albertini:2020mdx}. We also have the cokernel $\mathscr{F}=\mathbb{Z}_2^{(f)}$ as above, which implies \eqref{GF for E1}. \subsubsection{The $E_1$ curve with $\lambda=-1$} The Picard-Fuchs equations for the periods can be solved for generic values of $\lambda$ using Frobenius' method. However, there is a second value of the $\lambda$ parameter for which the geometric periods are standard hypergeometric functions, namely at $\lambda = -1$. In that limit, the $U$-plane has a $\mathbb{Z}_4$ symmetry, rather than the generic $\mathbb{Z}_2$ symmetry of the $E_1$ theory. Furthermore, the associated rational elliptic surface has $\Phi_{\rm tor} = \mathbb{Z}_2$ for $\lambda \neq 1$. Let us introduce the coordinate: \be \label{w for E1 lambda-1} w = -\frac{U^4}{64} = e^{i\pi s}\frac{U^4}{64}~, \end{equation} and start by discussing the periods on this $w$-plane. Here the parameter $s=\pm 1~(mod~2)$ is introduced in order to keep track of logarithmic ambiguities. \paragraph{Geometric periods on the $w$-plane.} In terms of $w$, the PF equation for the $\widetilde{\omega}$ periods reads: \be (w-1)\frac{d^2\widetilde{\omega}}{dw^2} + \frac{d\widetilde{\omega}}{dw} - \frac{3}{16w^2}\widetilde{\omega} = 0~. \end{equation} This is again a standard hypergeometric differential equation, as for $\lambda = 1$. However, there are now two regular solutions at $w = 0$, as the singularity at $w=0$ is in fact an elliptic point rather than a cusp. We would like to normalize the periods in the large volume limit as: \be \widetilde{\omega}_a \approx -\frac{1}{2\pi i}~, \qquad \quad \widetilde{\omega}_D \approx \frac{1}{2\pi^2}\Big(- 6\log(2) + \log\left(\frac{e^{i\pi s}}{w}\right) + \log(\lambda)\Big) ~, \end{equation} such that $\widetilde{\omega}_D$ includes the $\log(\lambda)$ contribution of the $D4$ brane in \eqref{PiD4 for E1}. It will become clear momentarily that, in order for the $D4$ period to vanish at the `conifold' point $w=1$, we must impose: \be \label{Constraint E1 lambda-1} \log(\lambda) = -i\pi s~. \end{equation} As a result, it is convenient to set $s=-1$. Thus, we use the following geometric periods: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \widetilde{\omega}_a = -\frac{1}{2\pi i} \prescript{}{2}{F}_1\left(\frac{1}{4},\frac{3}{4}; 1; \frac{1}{w}\right)~, \qquad \quad \widetilde{\omega}_D = -\frac{1}{\sqrt{2}\pi} \prescript{}{2}{F}_1\left(\frac{1}{4},\frac{3}{4}; 1; 1-\frac{1}{w}\right)~. \eea These functions have the same branch cuts as the $\lambda = 1$ geometric periods shown in figure~\ref{fig:Cuts Geometric Periods}, and their asymptotics can be found as before. For the expressions at $w = 0$, one can either use Barnes' type integrals or Kummer's connection formulae. We find the following monodromies for $u\rightarrow e^{2\pi i}u$ around $w=1$, and $w\rightarrow e^{-2\pi i}w$ around the point at infinity, respectively: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{Mw E1m1 mono} \mathbb{M}_{w = 1} = \left(\begin{matrix} 1 & 0 \\ -1 & 1 \end{matrix}\right) = S T S^{-1}~, \qquad \mathbb{M}_{w = \infty} = \left(\begin{matrix} 1 & 2 \\ 0 & 1 \end{matrix}\right) = T^2~, \eea Similarly, for the monodromy around $w=0$ (with $w \rightarrow e^{2\pi i}w$) we have: \be\label{MZ4mon} \mathbb{M}^{\pm}_{w = 0} = T^{-\epsilon} S T^{\epsilon}~. \end{equation} with $\epsilon = {\rm sign}\left({\rm Im}(w)\right)$, by keeping track of the base-point. As a result, the three singularities are $(I_2, I_1, III^*)$, which correspond to the singular points of the $\Gamma^0(2)$ elliptic curve\footnote{The congruence subgroup $\Gamma^0(2)$ has two cusps of widths $1$ and $2$ and one elliptic point of order $2$.}. Note also that both `orbifold' monodromies \eqref{MZ4mon} satisfy $(\mathbb{M}_{w=0})^4 = \mathbf{1}$, which will be useful below. \paragraph{Physical periods on the $w$-plane.} Recall that the geometric periods $\widetilde{\omega}$ are the logarithmic derivative of the physical periods. Due to the minus sign in the definition of $w$, one needs to take additional care with the logarithmic ambiguities. The analysis is similar to the $\lambda=1$ case and we only outline the main steps of the computation. Integrating the asymptotics of the geometric periods, we find that the physical periods can be expressed in terms of Meijer-G functions, namely: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \label{lambda=-1MeijerG} a(w) & \approx -\frac{1}{8\sqrt{2}\pi^2 i} G_{3,3}^{2,2}\left( \begin{matrix} \frac{1}{4} & \frac{3}{4}& 1\\ 0 & 0 & 0 \end{matrix}\middle\vert -\frac{1}{w} \right) +\frac{s-1}{8}~, \\ a_D(w) & \approx -\frac{1}{8\sqrt{2}\pi^3}G_{3,3}^{3,2}\left( \begin{matrix} \frac{1}{4} & \frac{3}{4}& 1\\ 0 & 0 & 0 \end{matrix}~\middle\vert \frac{1}{w} \right) + \frac{1}{4}~. \eea where the above expression of $a_D$ is chosen such that it vanishes at $w=1$. It now becomes clear from the asymptotics of $a_D$ that for this to satisfy the asymptotics of the $D4$ period, one must impose the constraint \eqref{Constraint E1 lambda-1} introduced before. In this setting, we find that at $w=0$ the periods become: \be\label{aaD E1 Z4 values origin} a_D(w=0) = {1\over 4}~, \qquad a(w=0) = {s-1\over 8}= -{1\over 4}~. \end{equation} Note that, compared to the $\lambda = 1$ case, we can now evaluate both the values of $a(w = 1)$ and $a_D(w=1)$, without the use of the Meijer-G function. Using the methods of \cite{Mohri:2000wu}, we find: \be a(w=1) \approx -\frac{s}{8} + 0.15257~i~, \end{equation} in agreement with \cite{Mohri:2000kf}. \paragraph{Periods on the $U$-plane.} Consider now the geometric periods on the $U$-plane. In analogy to the $\lambda=1$ case, we first introduce the functions: \be f_a = -\frac{1}{2\pi i}\prescript{}{2}{F}\left(\frac{1}{4},\frac{3}{4}; 1; -\frac{64}{U^4}\right)~, \qquad f_D = -\frac{1}{\sqrt{2}\pi} \prescript{}{2}{F}\left(\frac{1}{4},\frac{3}{4}; 1; 1+\frac{64}{U^4}\right)~. \end{equation} Since $f_a$ is a regular function at $U\rightarrow \infty$, we will use this to define $\widetilde{\omega}_a$ throughout the $U$-plane. The map $U \mapsto w$ is $4$ to $1$, and thus we will split the $U$-plane in four quadrants, labelled $A$ to $D$, as shown in figure~\ref{fig:Cuts PhysicalE1 lambda-1}. Recall also that on the $w$-plane, $f_D$ has the following behaviour at large volume ($w\rightarrow \infty$): \be f_D(w) \approx -\frac{1}{2\pi^2}\Big(6\log(2) + \log(w)\Big)~. \end{equation} Given that the principal branch of the $w$-plane matches with region $A$ of the $U$-plane, let us choose $U = 2\sqrt{2}e^{i\pi/4}$ as the point where $\widetilde{w}_D = 0$. Hence, $f_D$ can be used to describe the $\widetilde\omega_D$ period in region $A$. However, since the other regions correspond to other sheets of the $w$-plane, analytic continuation of $f_D$ (which we take to be well defined around the relevant $U^4 = -64$ singularity) to large volume differs by the large volume expression obtained in region $A$. In particular: \be f_D^{(n)}(U) \approx -\frac{1}{2\pi^2}\Big(6\log(2) + \log(w^{(A)}) + 2\pi i ~n\Big)~, \end{equation} with $n=1,2,3$ for regions $B,C$ and $D$, respectively. By $\log(w^{(A)})$ here, we mean that the underlying $\log(U)$ term will have the same principal branch as the logarithm from region $A$. Because of this, we then find: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \widetilde{\omega}_D (u) = f_D (u) -2n f_a(u)~,\qquad \quad \widetilde{\omega}_a (U) = f_a(U)~. \eea where we introduce $u = 1-U_{i}$, with $U_{i}$ the four singularities. The branch cuts of these periods are shown in figure~\ref{fig:Cuts PhysicalE1 lambda-1}.% \begin{figure} \centering \begin{tikzpicture}[x=90pt,y=90pt,decoration = snake] \begin{scope}[shift={(2,0)}] \draw[thin,gray,-stealth] (-1,0) -- (1,0) node[right] {}; \draw[thin,gray,-stealth] (0,-0.8) -- (0,0.8) node[above] {}; \draw[thin,gray,-stealth] (1.5,0) -- (3.5,0) node[right] {}; \draw[thin,gray,-stealth] (2.5,-0.8) -- (2.5,0.8) node[above] {}; \draw[very thin, black, ->] (0.4,0) arc(0:350:0.4); \draw[red,thick,decorate] (0:0.93) -- (0,0) {}; \draw[red,thick,decorate] (3,0.5) -- (2.5,0) {}; \draw[red,thick,decorate] (2.5,0) -- (2,0.5) {}; \draw[red,thick,decorate] (2.5,0) -- (2,-0.5) {}; \draw[red,thick,decorate] (2.5,0) -- (3,-0.5) {}; \draw[red,thick,decorate] (-0.5,0.5) -- (0,0) {}; \draw[red,thick,decorate] (-0.5,-0.5) -- (0,0) {}; \draw[red,thick,decorate] (0.5,-0.5) -- (0,0) {}; \fill (0,0) circle[radius=2pt] {}; \fill (-1/2,-1/2) circle[radius=2pt] {}; \fill (-1/2,1/2) circle[radius=2pt] {}; \fill (1/2,1/2) circle[radius=2pt] {}; \fill (1/2,-1/2) circle[radius=2pt] {}; \fill (2.5,0) circle[radius=2pt] {}; \fill (2,0.5) circle[radius=2pt] {}; \fill (2,-0.5) circle[radius=2pt] {}; \fill (3,0.5) circle[radius=2pt] {}; \fill (3,-0.5) circle[radius=2pt] {}; \node at (0,-0.25) {\small$U=0$}; \node at (2.5,-0.25) {\small$U=0$}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (-0.7,0.5) {B}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (0.7,0.5) {A}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (-0.7,-0.5) {C}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (0.7,-0.5) {D}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (1.8,0.5) {B}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (3.2,0.5) {A}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (1.8,-0.5) {C}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (3.2,-0.5) {D}; \node at (0.5,0.1) {\small$0$}; \node at (0.5,-0.1) {\small$2\pi$}; \end{scope} \end{tikzpicture} \caption{Possible choices of branch cuts for the physical periods $a_D(U)$ and $a(U)$ for the $E_1$ theory with $\lambda = -1$.} \label{fig:Cuts PhysicalE1 lambda-1} \end{figure} Given the behaviour of $f_a$ around the $U^4 = -64$ singularities for $u\rightarrow e^{2\pi i}u$, namely: $f_a \rightarrow f_a - f_D$, we can readily find the monodromies: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \label{E1 lambda-1 Monodromies} \mathbb{M}_{U_n} = \left( \begin{matrix} 2n+1 & 4n^2 \\ -1 & -2n+1 \end{matrix} \right) = (T^{-2n}S) T(T^{-2n}S)^{-1}~, \eea which correspond to $I_1$ cusps. Furthermore, the monodromy at large volume (for $ w \rightarrow e^{-2\pi i}w$) becomes: \be \mathbb{M}_{U=\infty} = \left( \begin{matrix} 1 & 8 \\ 0 & 1 \end{matrix} \right) = T^{8}~, \end{equation} corresponding to an $I_8$ singularity. \paragraph{Modularity.} Let us now comment on the modular properties of this configuration. The $\mathbb{Z}_4$ symmetry of the $U$-plane becomes manifest at the level of the $J$-invariant, which only depends on $X = U^4$. Thus, we can start by solving the cubic\footnote{This is in fact a degree $12$ equation in $U$.}: \be (64+X) j(\tau) = (48+X)^3~. \end{equation} One root of the above equation is given by: \be X(\tau) = U(\tau)^4 = -\left(64 +\left( {\eta({\tau\ov2})\over \eta(\tau)}\right)^{24}\right)~, \end{equation} whose $q$-series expansion is the McKay-Thompson series of class $2B$. Another root can be obtained from a $T$ transformation and turns out to be the McKay-Thompson series of class $4A$. We can further show that the above $\eta$-quotient is in fact a modular function for the $\Gamma^0(2)$ congruence subgroup, in agreement with the $w$-plane monodromies previously found. Taking the fourth root of $X(\tau)$, we can then obtain an expression for $U(\tau)$ -- we can then view the monodromy group for the $U$-plane as a 4-to-1 cover of $\Gamma^0(2)$. As a result, the monodromies around the `conifold' singularities can be read from the coset representatives $T^{2n}S$, for $n\in\{0,1,2,3\}$, for instance, which are also the monodromies we derived using the physical periods \eqref{E1 lambda-1 Monodromies}. Let us also note that, the derivative of the $a$ period can be expressed in terms of the Jacobi theta function: \be \frac{d a}{dU}(\tau) ~=~ {e^{{5\pi i \over 4}} \over 8\pi i}~\vartheta_2\left({\tau\over 2}\right)^2~. \end{equation} \paragraph{Massless dyons and 5d BPS quiver.} The previous prescription for the periods on the $U$-plane implies that the KK theory has the dyons $(1,0)$, $(1,-2)$, $(1,-4)$ and $(1,-6)$ that become massless at the four $I_1$ singularities, respectively. These states do not appear to corresponds to physical states, however. Instead, we interpret them as defects corresponding D3-branes wrapping non-compact 3-cycles that `end' at the $I_1$ cusps. The dual compact 3-cycles should be identified with the `fractional branes' in that case -- see {\it e.g.} \cite{Hori:2000ck, Herzog:2003zc}. It is not entirely clear why our particular computation gives us this basis of `external states'. It appears to be related to the fact that we implicitly chose a base point at large volume, instead of choosing it at $U=0$; we hope to clarify this point in future work. To identify the actual dynamical BPS particles that vanish at the four points $U^4= -64$, which corresponds to the usual `fractional brane states' on the local $\mathbb{F}_0$ singularity, it is safer to proceed as follows. We know that one of the BPS states is the D4-brane in IIA, which is the monopole $(1,0)$ that vanishes at the `conifold point' on the $U$-plane, with a corresponding conifold monodromy $ \mathbb{M}_{w=1} $ given in \eqref{Mw E1m1 mono}. Then, the other 3 singularities on the $U$-plane can be obtained by conjugating the conifold monodromy with the $\mathbb{Z}_4$ `orbifold' monodromy at the origin: \be \mathbb{M}_k = \mathbb{M}_{\rm orb}^k \mathbb{M}_{0} \mathbb{M}_{\rm orb}^{-k}~, \qquad \mathbb{M}_{0}= STS^{-1}~, \quad \mathbb{M}_{\rm orb}=TST^{-1}~, \end{equation} for $k=0,1,2,3$. The corresponding BPS states agree with the known results about fractional branes, and give us the $\mathbb{Z}_4$-symmetric quiver: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{quiver E1 second phase} \begin{tikzpicture}[baseline=1mm] \node[] (1) []{$\mathcal{E}_{\gamma_1=(1,0)}$}; \node[] (2) [right = of 1]{$\mathcal{E}_{\gamma_2=(-1,2)}$}; \node[] (4) [below = of 1]{$\mathcal{E}_{\gamma_4=(1,-2)}$}; \node[] (3) [below = of 2]{$\mathcal{E}_{\gamma_3=(-1,0)}$}; \draw[->>-=0.5] (1) to (2); \draw[->>-=0.3] (2) to (3); \draw[->>-=0.5] (3) to (4); \draw[->>-=0.3] (4) to (1); \end{tikzpicture} \eea This is the well-known second `toric phase' for the 5d BPS quiver of the $E_1$ theory, as discussed in detail in \cite{Closset:2012ep, Closset:2019juk}. Using the known brane charges of the fractional branes and the exact periods \eqref{aaD E1 Z4 values origin} at the origin of the $U$-plane, one can check that the 4 fractional branes have a real central charge, $\mathcal{Z}={1\over 4}$, so that we indeed have a quiver point at $U=0$.\footnote{There are some ambiguities in this identification, which we hope to discuss elsewhere. Importantly, for this computation, one must use the Chern characters of the branes, which include induced D0-charge from worldvolume flux. Then, if we use for instance the `dictionary' of equation (5.26) in \protect\cite{Closset:2012ep} together with our result $\Pi_{\rm D4}={1\over 4}$, $\Pi_{{\rm D2}_f}=-{1\over 2}$ and $\Pi_{{\rm D2}_b}= 0$ from this section, we indeed obtain $\mathcal{Z}={1\over 4}$ for the four fractional branes.} \paragraph{Torsion section and one-form symmetry.} Finally, let us discuss the global symmetries in the general case $\lambda\neq 1$. The MW group for the $(I_8, 4 I_1)$ configuration is $\Phi=\mathbb{Z}\oplus \mathbb{Z}_2$. The $U(1)$ symmetry is generated by the horizontal divisor $\varphi(P)$ associated to the section: \be P= \left({ U^2 +4(2 -\lambda)\over 12}~,\, -U\right)~, \end{equation} which generates the free part of $\Phi$, and reduces to the $\mathbb{Z}_4$ generator $P_1$ in \eqref{Z4 torsion E1} when $\lambda=1$. We have a $\mathbb{Z}_2$ torsion section: \be P_{\rm tor}= \left({U^2 - 4(1+\lambda) \over 12}~,\, 0\right)~, \end{equation} which reduces to $P_2$ in \eqref{Z4 torsion E1} when $\lambda=1$. For any $\lambda\neq 1$, we have $\Phi_{\rm tor}=\mathcal{Z}^{[1]}= \mathbb{Z}_2^{[1]}$, consistent with our identification of $\mathcal{Z}^{[1]}$ with the one-form symmetry of the field theory. This is also confirmed by the dyonic charges in \eqref{quiver E1 second phase}, which are left invariant by~\eqref{gZ1 E1}. \subsection{The $\widetilde E_1$ theory -- 5d $SU(2)_\pi$: an Argyres-Douglas point on the $U$-plane} The $\widetilde E_1$ theory is the UV completion of the parity-violating $SU(2)_\pi$ gauge theory in 5d. Let us briefly discuss its $U$-plane. The Weierstrass form of the curve~\eqref{E1t toric SWcurve} read: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} g_2(U) & = \frac{1}{12}\left( U^4 - 8U^2 - 24 \lambda U + 16 \right)~, \\ g_3(U) & = -\frac{1}{216}\left( U^6 - 12U^4 - 36\lambda U^3 +48U^2 +216\lambda^2 - 64 \right)~, \eea with the massless limit corresponding to $\lambda = 1$. By direct inspection, we find the following allowed configurations of singular fibers: \be \label{E1t Configurations} \renewcommand{\arraystretch}{1.5} \begin{tabular}{ |c||c|c|c|c|} \hline $\{F_v\}$& $\lambda$ & $\mathfrak{g}_F$ & ${\rm rk}(\Phi)$ & $\Phi_{\rm tor}$ \\ \hline \hline $I_8, 2I_1, II$ & $\pm \frac{16i}{3\sqrt{3}}$ & $\frak{u}(1)$ & $1$ & $-$ \\ \hline $I_8, 4I_1$ & $\lambda$ & $\frak{u}(1)$ & $1$ & $-$ \\\hline \end{tabular} \end{equation} This is of course in agreement with the Persson classification \cite{Persson:1990}. As for $E_1$, the generic point on the Coulomb branch of $\widetilde{E}_1$ has $4I_1$ type singularities. It is worth pointing out that the classification of rational elliptic surfaces includes two distinct configurations with singular fibers $(I_8, 4I_1)$, which are distinguished by their MW torsion. That mathematical fact dovetails nicely with the existence of two distinct theories with $T^8$ monodromy at large volume, $E_1$ and $\widetilde E_1$, with only the former having a non-trivial one-form symmetry \cite{Morrison:2020ool, Albertini:2020mdx}. One can write down the Picard-Fuchs equation for the geometric periods as in \eqref{PF eq general}, but its explicit form is not particularly illuminating. In particular, we do not find any modular properties in terms of congruence subgroups, nor any configuration for which the periods can be expressed in terms of hypergeometric functions. Around any given point, the periods can always be found as series expansions using the Frobenius method. The $D_{S^1} \widetilde E_1$ Coulomb branch exhibits a feature that did not appear on the CB of the $E_1$ theory, however: there exists an allowed configuration with a singularity of type $II$, whose low-energy description is in terms of $H_0$, the Argyres-Douglas theory without flavour symmetry. As we reviewed in section \ref{subsec:SU2Nf1}, $H_0$ also appears on the Coulomb branch of the $SU(2)$ theory with $N_f=1$. In fact, as we mentioned in the introduction, it is clear from the classification of RES that $H_0$ appears rather generically on rank-one Coulomb branches of theories with enough parameters -- we `simply' need to tune the parameters such that two mutually non-local BPS particles $\mathcal{E}_{1, 2}$ with Dirac pairing $\langle \mathcal{E}_1 , \mathcal{E}_2\rangle= 1$ become massless at the same point. Recall that the Coulomb branch operator of the $H_0$ fixed point has scaling dimension $\Delta_u = {6\over 5}$. We can then `zoom-in' around the type-$II$ singularity as we have done for the $E_{n}$ MN theories in section~\ref{subsec:Encurves}, as follows. Setting $\lambda = {16 i \over 3\sqrt{3}}$, the type-$II$ singularity sits at $U = -2i\sqrt{3}$, and we thus consider: \renewcommand{\arraystretch}{1} \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{E1t scaling} U \longrightarrow \beta^{{6\ov5}} u - 2i\sqrt{3}~, \qquad (x,y) \longrightarrow \left(\beta^{{2\ov5}}x,~\beta^{{3\ov5}} y\right)~, \eea in the $\beta \rightarrow 0$ limit, which leads to the 4d curve: \be y^2 = 4x^3 - \frac{64i}{9\sqrt{3}}~u~. \end{equation} We can also study the deformation pattern of this curve by introducing the parameter $c$ of the $H_0$ theory, with scaling dimension $\Delta_c = 2 - \Delta_u = {4\over 5}$. For this purpose, we consider the following limit: \be U \longrightarrow u~\beta^{{6\ov5}} - 2i\sqrt{3} - \frac{3c}{4}\beta^{{4\ov5}}~, \qquad \quad \lambda \longrightarrow \frac{16i}{3\sqrt{3}} + c~\beta^{{4\ov5}}~, \end{equation} such that, under the same rescaling of $(x,y)$ as in \eqref{E1t scaling}, we obtain the curve: \be y^2 = 4x^3 + \frac{4i}{\sqrt{3}}~c~x - \frac{64i}{9\sqrt{3}}~u~, \end{equation} which, up to a rescaling of the parameters, is precisely the curve for $H_0$ with the relevant coupling turned on \cite{Argyres:1995jj}. We have thus found an RG flow from the $\widetilde E_1$ theory to the Argyres-Douglas theory. In the above limit viewed from the point of view of the RES, the fiber at infinity, $F_\infty= I_8$, becomes an $II^\ast$ fiber after merging with two $I_1$ singularities from the interior. \section{The $E_0$ fixed point: $\mathbb{Z}_3$ symmetry on the $U$-plane}\label{sec:E0} Let us now consider the $E_0$ theory. This is a 5d SCFT without flavour symmetry, and therefore it does not have any relevant deformations, nor any gauge-theory phase. It can be obtained as a deformation of the $\widetilde E_1$ theory \cite{Morrison:1996xf}, since it is realised in M-theory on a local $\mathbb{P}^2$, which is obtained from $dP_1$ by blowing down the exceptional curve. The $D_{S^1} E_0$ theory is then realised in Type IIA on that same geometry, which is the simplest example of a local Calabi-Yau threefold with an exceptional divisor. The origin of the K\"ahler cone, where the $\mathbb{P}^2$ shrinks to zero size, is the orbifold singularity $\mathbb{C}^3/\mathbb{Z}_3$. This geometry has obviously been studied in much detail in the literature -- see in particular~\cite{Aspinwall:1993xz, Douglas:2000qw, Hori:2000ck, Aspinwall:2004jr}. The $E_0$ SW curve \eqref{E0 toric curve} takes the Weierstrass form: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} g_2(U) = {3\over 4}U \left(9U^3 - 8 \right)~, \qquad \quad g_3(U) = -{1\over 8}\left( 27U^6 - 36U^3 + 8 \right)~, \eea with the discriminant: \be \Delta(U) = 27(U^3 - 1)~. \end{equation} This has three distinct roots, leading to three $I_1$ cusps in the interior of the $U$-plane, with an additional $I_9$ singularity at infinity. The $J$-invariant: \be J(U) = {U^3(9U^3 - 8)^3 \over 64(U^3 - 1)}~, \end{equation} only depends on $U^3$, which reflects the spontaneously broken $\mathbb{Z}_3$ symmetry of the $U$-plane. This $\mathbb{Z}_3$ is inherited from the $\mathbb{Z}_3$ one-form symmetry of the 5d $E_0$ theory \cite{Morrison:2020ool,Albertini:2020mdx}. The total space of the SW fibration is the RES with singular fibers $(I_9, 3I_1)$, which has a MW group $\Phi=\mathbb{Z}_3$ torsion, in full agreement with the conjecture~\eqref{conject on 1form}. Let us introduce the useful variable: \be w = U^3~. \end{equation} We will first compute the periods on the $w$-plane, similarly to the $E_1$ theory. In the large volume limit in IIA, the physical periods correspond to the D2-brane wrapping the hyperplane class $H\cong \mathbb{P}^1$ inside $\mathbb{P}^2$ and to the D4-brane wrapping the $\mathbb{P}^2$. Let us denote the single K\"ahler parameter by: \be \label{E0 LogAmbiguities} T = \frac{1}{2\pi i}\int_{H} (B+iJ) = {1\over 2\pi i} \log\left({1 \over -27w}\right) = {1\over 2\pi i} \log\left({ e^{-i\pi s} \over 27w}\right)~, \end{equation} with the parameter $s$ introduced to keep track of logarithmic ambiguities, as for the $E_1$ theory. Then, the `naive' brane periods are: \be t_{\rm D2} = T + \mathcal{O}\left({1\over w}\right)~, \qquad \quad t_{\rm D4} = \frac{1}{2}T^2 + \frac{1}{8} + \mathcal{O}\left({1\over w}\right)~. \end{equation} However, due to the Freed-Witten anomaly \cite{Freed:1999vc}, the D4-brane period must carry half a unit of world-volume flux. This induces $-{1\over 2}$ unit of D2-brane charge and ${1\over 8}$ of a D0-brane charge~\cite{Diaconescu:1999dt}. The physical periods are then: \be \Pi_{\rm D2} = t_{D2}~, \qquad \quad \Pi_{\rm D4} = t_{\rm D4} - \frac{1}{2}t_{\rm D2} + \frac{1}{8}~. \end{equation} We will work in the basis $(a_D, a)$, with: \be \Pi_{\rm D2} = 3a~, \qquad \Pi_{\rm D4} = a_D~. \end{equation} Note the factor of $3$, which is the electric charge of a wrapped D2-brane, since $[H]\cdot [\mathbb{P}^2]=-3$ inside $\widetilde \MG$. The geometric periods $\omega = {d \Pi\over dU}$ satisfy the PF equation: \be {d^2\omega \over dU^2} + {3U^2 \over U^3 - 1} {d\omega \over dU} + {U \over U^3 - 1} \omega = 0~. \end{equation} \paragraph{Geometric periods on the $w$-plane.} Upon rescaling $(g_2, g_3) \rightarrow (U^2 g_2, U^3 g_3)$, the Weierstrass form of the curve only depends on $w = U^3$, with: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} g_2(w) = {3\over 4}w(9w - 8)~, \qquad \quad g_3(w) = -{1\over 8}w(27w^2 - 36w + 8)~, \eea while the discriminant becomes: \be \Delta(w) = 27w^2 (w-1)~. \end{equation} This curve has one $I_1$ singularity at $w=1$, one type-$II$ elliptic point at $w=0$ and one $I_{3}^*$ singularity at infinity. By performing a quadratic twist, these can be mapped to $(I_1, IV^*, I_3)$, with the $I_3$ at infinity, to match the large volume monodromy in IIA. These transformations amount to a rescaling of the holomorphic one-form as $\boldsymbol{\omega} \rightarrow (w)^{-{1\ov3}} \boldsymbol{\omega}$. We then consider the rescaled geometric periods: \be \label{E0geomPeriods} \widetilde \omega = w^{1\ov3} \omega = U {d \Pi \over dU}~, \end{equation} which satisfy the following PF equation: \be (w-1){d^2\widetilde\omega \over dw^2} + {d\widetilde \omega \over dw} - {2\over 9w^2} \widetilde\omega = 0~. \end{equation} This is a standard hypergeometric differential equation with singularities at $w = 0,1,\infty$, with two regular solutions at $w=0$ and only one regular solution at each of the other two singularities. A convenient basis of solutions is given by: \be \widetilde\omega_a(w) = -\frac{1}{2\pi i}\prescript{}{2}{F}_1 \left( \frac{1}{3}, \frac{2}{3}; 1; \frac{1}{w}\right)~, \qquad \widetilde \omega_D(w) = -\frac{\sqrt{3}}{2\pi }\prescript{}{2}{F}_1 \left( \frac{1}{3}, \frac{2}{3}; 1;1- \frac{1}{w}\right)~. \end{equation} Note that we will need to set $s=-1$ in \eqref{E0 LogAmbiguities} so that $\widetilde\omega_D$ agrees with the D4-brane asymptotics. We can also check that this function is the `correct' geometric period because it leads to a vanishing D4-brane period at $w=1$, the conifold point. Analytic continuation to $w=0$ can be done using the Barnes' integral representations of the hypergeometric function, as well as Kummer's connection formulae. Additionally, the Gauss-Ramanujan formula can be used to obtain expressions at unit argument. A basis of solutions at $w=0$ is given by: \be w^{1\ov3} \prescript{}{2}{F}_1 \left( \frac{1}{3}, \frac{1}{3}; \frac{1}{3}; w\right)~, \qquad \quad w^{2\ov3} \prescript{}{2}{F}_1 \left( \frac{2}{3}, \frac{2}{3}; \frac{4}{3}; w\right)~. \end{equation} Note the cubic roots, which give rise to a $\mathbb{Z}_3$ monodromy. With a bit of work, we can then explicitly compute all the monodromies. At large volume and at the conifold point, we find: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \mathbb{M}_{w=\infty} = \left( \begin{matrix} 1 & 3 \\ 0 & 1 \end{matrix}\right) = T^3~, \qquad \mathbb{M}_{w=1} = \left( \begin{matrix} 1 & 0 \\ -1 & 1 \end{matrix}\right) = STS^{-1}~, \eea while the $\mathbb{Z}_3$ orbifold point monodromy reads: \be \label{E0 Orbifold Monodromies} \mathbb{M}^{+}_{w=0} = T^{-1} (ST)^2 T~, \qquad \mathbb{M}^{-}_{w=0} = T^{2} (ST)^2 T^{-2}~, \end{equation} depending on the base point being in the upper- or lower-half-plane. These monodromies do indeed correspond to the singularities $I_3$, $I_1$ and $IV^*$, respectively, and span the monodromy group $\Gamma^0(3)$. The dependence on the base-point in \eqref{E0 Orbifold Monodromies} can be visualised as a splitting of the fundamental domain for the modular group $\Gamma^0(3)$, as in previous examples. \paragraph{Physical periods on the $w$-plane.} Recall that the physical periods are related to the geometric periods by \eqref{E0geomPeriods}. Integrating the asymptotics of the geometric periods, we only need to fix the remaining constants of integration. The solutions of the Picard-Fuchs equation satisfied by the physical periods can be expressed in terms of Meijer-G functions. Fixing the integration constants such that $a_D(w=1) = 0$ and $\Pi_{D2} = 3a$ in the large volume limit, we have: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \label{E0MeijerG} a(w) & = -\frac{1}{4\sqrt{3}\pi^2 i} G_{3,3}^{2,2}\left( \begin{matrix} \frac{1}{3} & \frac{2}{3} & 1\\ 0 & 0 & 0 \end{matrix}\middle\vert -\frac{1}{w} \right) - \frac{s+1}{6} ~, \\ a_D(w) & = -\frac{\sqrt{3}}{8\pi^3}G_{3,3}^{3,2}\left( \begin{matrix} \frac{1}{3} & \frac{2}{3} & 1\\ 0 & 0 & 0 \end{matrix}~\middle\vert \frac{1}{w} \right) + \frac{1}{3}~, \eea with $s$ as introduced in \eqref{E0 LogAmbiguities}. Then, the large volume asymptotics of $a_D$ is fixed to: \be a_D(w) = -{1\over 8\pi^2}\log\left( {1\over 27w} \right)^2 + {1\over 8}~. \end{equation} Thus, for this to be consistent with D-brane periods, we must `set' $s = -1$, as previously mentioned. We then find: \be a_D(w=0)= {1\over 3}~, \qquad\quad a(w=0) = 0~, \end{equation} at the orbifold point. Lastly, we need to fix the integration constant for $a$ at the conifold point, which we can evaluate numerically using the methods of \cite{Mohri:2000wu}: \be a(w=1) = \frac{1}{6} + i {3\over 2\pi^2} {\rm Im}\left({\text{Li}_2}(e^{\pi i \over 3})\right) = \frac{1}{6} + 0.1543 i~. \end{equation} This is consistent with the results of \cite{Mohri:2000kf, Aspinwall:2004jr} and with~\cite{Gu:2021ize}, which gives the analytic result quoted here. \paragraph{Geometric periods on the $U$-plane.} Consider next the geometric periods on the $U$-plane. As before, we introduce: \be f_a = -\frac{1}{2\pi i}\prescript{}{2}{F}_1\left(\frac{1}{3},\frac{2}{3}; 1; \frac{1}{U^3}\right)~, \qquad f_D = -\frac{\sqrt{3}}{2\pi}\prescript{}{2}{F}_1\left(\frac{1}{3},\frac{2}{3}; 1; 1-\frac{1}{U^3}\right)~. \end{equation} The function $f_a$ is regular at $U\rightarrow \infty$ and can be used as $\widetilde{\omega}_a$ for the entire $U$-plane. The map $U \mapsto w$ is $3$ to $1$ and we thus split the $U$-plane in three regions labelled by $A, B$ and $C$, each containing one of the $U^3 = 1$ singularities and covering a third of the $U$-plane, namely: $\theta_A \in (-\pi/3, \pi/3) $, $\theta_B \in (\pi/3, \pi)$ and $\theta_C \in (-\pi, -\pi/3)$, as shown in figure~\ref{fig:E0 PhysicalCuts}. The angles are mapped as: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} U~:~ & \quad ~-\pi \rightarrow -\frac{\pi}{3}~, \quad -\frac{\pi}{3} \rightarrow \frac{\pi}{3}~, \quad \frac{\pi}{3} \rightarrow \pi~,\\ w~:~ & \quad -3\pi \rightarrow -\pi~, \quad ~-\pi \rightarrow \pi~, \quad~ \pi \rightarrow 3\pi~. \eea% \begin{figure} \centering \begin{tikzpicture}[x=90pt,y=90pt,decoration = snake] \begin{scope}[shift={(2,0)}] \draw[thin,gray,-stealth] (-1,0) -- (1,0) node[right] {}; \draw[thin,gray,-stealth] (0,-0.7) -- (0,0.8) node[above] {}; \draw[thin,gray,-stealth] (1.5,0) -- (3.5,0) node[right] {}; \draw[thin,gray,-stealth] (2.5,-0.7) -- (2.5,0.8) node[above] {}; \draw[very thin, black, ->] (-0.3,0) arc(-180:165:0.3); \draw[red,thick,decorate] (-0.8,0) -- (0,0) {}; \draw[red,thick,decorate] (-0.25,0.433) -- (0,0) {}; \draw[red,thick,decorate] (-0.25,-0.433) -- (0,0) {}; \draw[red,thick,decorate] (2.5,0) -- (3,0) {}; \draw[red,thick,decorate] (2.25,0.433) -- (2.5,0) {}; \draw[red,thick,decorate] (2.25,-0.433) -- (2.5,0) {}; \draw [dashed] (0,0) -- (0.4,0.693) {}; \draw [dashed] (0,0) -- (0.4,-0.693) {}; \draw [dashed] (2.5,0) -- (2.9,0.693) {}; \draw [dashed] (2.5,0) -- (2.9,-0.693) {}; \fill (0,0) circle[radius=2pt] {}; \fill (1/2,0) circle[radius=2pt] {}; \fill (-1/4,0.433) circle[radius=2pt] {}; \fill (-1/4,-0.433) circle[radius=2pt] {}; \fill (2.5,0) circle[radius=2pt] {}; \fill (3,0) circle[radius=2pt] {}; \fill (2.25,0.433) circle[radius=2pt] {}; \fill (2.25,-0.433) circle[radius=2pt] {}; \node at (2.25,-0.05) {\small$U=0$}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (-0.7,0.5) {B}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (0.7,0.15) {A}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (-0.7,-0.5) {C}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (1.8,0.5) {B}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (3.2,0.15) {A}; \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] at (1.8,-0.5) {C}; \node at (-0.4,0.1) {\small$\pi$}; \node at (-0.45,-0.1) {\small$-\pi$}; \end{scope} \end{tikzpicture} \caption{Choice of branch cuts for the physical periods $a_D(U)$ and $a(U)$ of the $E_0$ theory.} \label{fig:E0 PhysicalCuts} \end{figure}% Recall that the large volume asymptotics of the function $f_D$ on the $w$-plane are given by: \be f_D(w) \approx -\frac{3}{4\pi^2}\Big(3\log(3) + \log(w) \Big)~. \end{equation} Consequently, choosing region $A$ to be the one that contains the singularity ($U=1$) where $\widetilde{\omega}_D \rightarrow 0$, we must have: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \widetilde{\omega}_D (U) = f_D(U) + 3n~f_a(U)~, \eea for $n = 0, 1, -1$ in regions $A$, $B$ and $C$, respectively. The monodromies can be computed by making use of the behaviour of $f_a$ around the $U^3 = 1$ singularities, namely: $f_a \rightarrow f_a - f_D$ under $u \rightarrow e^{2\pi i} u$, for $u = U-U_n $. Thus, we find: \be \label{E0Matrices} \mathbb{M}_{(n)} = \left( \begin{matrix} 1-3n & 9n^2 \\ -1 & 1+3n \end{matrix}\right) = (T^{3n}S) T(T^{3n}S)^{-1}~, \end{equation} with $n = 0, 1,-1$, as before. Furthermore, the monodromy at $\infty$ becomes $T^9$, and thus we find the cusps $(I_9, 3I_1)$, with an obvious $\mathbb{Z}_3$ symmetry. Note also that: \be \mathbb{M}_{(n)} \mathbb{M}_{(n+1)} \mathbb{M}_{(n+2)} = T^{-9}~, \end{equation} as expected. \begin{figure}[h] \centering \scalebox{0.8}{\input{Gamma09.tikz}} \caption{`Standard' fundamental domain for $\Gamma^0(9)$, with $I_1$ cusps at $\tau = 0$, $3$ and $6$.} \label{fig:Gamma0(9)} \end{figure} These monodromies generate $\Gamma^0(9)$ and agree with the `simplest' fundamental domain for this congruence subgroup, which is depicted in figure~\ref{fig:Gamma0(9)}. We will show momentarily that $U(\tau)$ is indeed the Hauptmodul for $\Gamma^0(9)$, supporting the claim that this is the monodromy group of the theory. \paragraph{Fractional branes and BPS quiver.} The $\mathbb{Z}_3$ symmetry of the $U$-plane is a $\mathbb{Z}_3$ orbifold symmetry in string theory, and the corresponding fractional branes are well understood -- see {\it e.g.} \cite{Douglas:2000qw}. The $\mathbb{Z}_3$ orbifold monodromy on the $w$-plane is given by \eqref{E0 Orbifold Monodromies}: \be \mathbb{M}_{\rm orb}^{+} = \left( \begin{matrix} -2 & -3 \\ 1 & 1\end{matrix}\right)~, \qquad \quad \mathbb{M}_{\rm orb}^{-} = \left( \begin{matrix} 1 & -3 \\ 1 & -2\end{matrix}\right)~,\qquad \qquad \left( \mathbb{M}_{\rm orb}^\pm\right)^3 = 1~. \end{equation} for a base point in the upper- or lower-half-plane, respectively. The $U$-plane monodromies with a base point near the origin can be constructed by conjugating the conifold monodromy: \be\label{MCn Z3} \mathbb{M}_{C_k} = (\mathbb{M}_{\rm orb})^{k} \mathbb{M}_{w=1} (\mathbb{M}_{\rm orb})^{-k}~, \end{equation} for $k = 0,1,2$. We will use $\mathbb{M}_{\rm orb}=\mathbb{M}_{\rm orb}^-$ in the following discussion. Note that we have: \be \mathbb{M}_{C_{0}}\mathbb{M}_{C_{1}}\mathbb{M}_{C_2} = T^{-9}~. \end{equation} In terms of the matrices $\mathbb{M}_{(n)}$ in \eqref{E0Matrices}, these monodromies are: \be \mathbb{M}_{C_0} = \mathbb{M}_{(n=0)} = STS^{-1}~, \qquad \mathbb{M}_{C_{2}} = \mathbb{M}_{(n=3)} = (T^{3}S)T(T^{3}S)^{-1}~, \end{equation} while $\mathbb{M}_{C_{1}}$ takes the more complicated form: \be \mathbb{M}_{C_{1}} = \mathbb{M}_* T \mathbb{M}_*^{-1}~, \qquad \mathbb{M}_* = \left( \begin{matrix} 3 & -2 \\ 2 & -1 \end{matrix}\right) = T^{2}S T^{2}S~. \end{equation} We thus have 3$I_1$ cusps, as expected, but with monodromies that are distinct from~\eqref{E0Matrices}. The monodromies~\eqref{E0Matrices} are associated to the massless BPS states: \be\label{spec E0 a} \mathscr{S}\; : \; \; (1, 0)~, \qquad (-1,3)~, \qquad (1,-6)~, \end{equation} respectively. The corresponding BPS quiver reads: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{quiver E0 a} \begin{tikzpicture}[baseline=1mm] \node[] (1) []{$\mathcal{E}_{\gamma_1=(1,0)}$}; \node[] (2) [right = of 1]{$\mathcal{E}_{\gamma_3=(1,-6)}$}; \node[] (3) [below = of 1]{$\mathcal{E}_{\gamma_2=(-1,3)}$}; \draw[->>>-=0.5] (1) to (3); \draw[->>>>>>-=0.3] (2) to (1); \draw[->>>-=0.5] (3) to (2); \end{tikzpicture} \eea On the other hand, the monodromies \eqref{MCn Z3} are associated to the massless BPS states: \be\label{spec E0} \mathscr{S}\; : \; \; (1, 0)~, \qquad (-2, 3)~, \qquad (1,-3)~, \end{equation} respectively. The corresponding BPS quiver is the well-known $\mathbb{C}^3/\mathbb{Z}_3$ orbifold quiver \cite{Douglas:2000qw}: \begin{figure}[t] \centering \scalebox{0.8}{\input{Gamma09FractionalBranes.tikz}} \caption{Different fundamental domain for $\Gamma^0(9)$, with $I_1$ cusps at $\tau = 0, {3\over 2}$ and $3$.} \label{fig:Gamma0(9) FractionalBranes} \end{figure} \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{quiver E0} \begin{tikzpicture}[baseline=1mm] \node[] (1) []{$\mathcal{E}_{\gamma_1'=(1,0)}$}; \node[] (2) [right = of 1]{$\mathcal{E}_{\gamma_2'=(-2,3)}$}; \node[] (3) [below = of 1]{$\mathcal{E}_{\gamma_3'=(1,-3)}$}; \draw[->>>-=0.5] (1) to (2); \draw[->>>-=0.3] (2) to (3); \draw[->>>-=0.5] (3) to (1); \end{tikzpicture} \eea These two quivers are related by a mutation on the `bottom' node, in which case the electromagnetic charges transform as \cite{Alim:2011kw}: \be \gamma_1'= \gamma_1~, \qquad \gamma_3' = -\gamma_2~, \qquad \gamma_2'= \gamma_3+3 \gamma_2~. \end{equation} The BPS states \eqref{spec E0} suggest a different choice of the fundamental domain for $\Gamma^0(9)$, which is shown in figure~\ref{fig:Gamma0(9) FractionalBranes}. Note, however, that for this choice of fundamental domain it is not immediately obvious that the width of the cusp at $\tau = i\infty$ is $9$. \paragraph{Modularity.} Let us analyse the modular properties of the $E_0$ curve. Recall that the $J$-invariant only depends on $w = U^3$: \be J(w) = {w(9w-8)^3 \over 64 (w-1)}~, \end{equation} from which we find: \be w(\tau) = {1 \over 27}\left( q^{-{1\ov3}} + 15 + 54 q^{1\ov3} - 76q^{2\ov3} - 243 q + \mathcal{O}(q^{4\ov3})\right)~, \end{equation} which is the McKay-Thompson series of class 3B for the Monster group \cite{Conway:1979qga}. We can thus write this in closed form as: \be \label{E0wModular} w(\tau) = 1 + {1\over 27}\left( {\eta({\tau\ov3})\over \eta(\tau)}\right)^{12}~, \end{equation} which is the Hauptmodul for $\Gamma^0(3)$, as expected. Under an $S$-transformation, this becomes: \be w(\tau_D) = 1 + 27\left( {\eta(3\tau_D)\over \eta(\tau_D)}\right)^{12} = 1+27q_D + 324 q_D^2 + \mathcal{O}(q_D^3)~, \end{equation} where $\tau_D = -1/\tau$. We thus find that the cusps at $w = \infty, 1$ correspond to $\tau = i\infty$ and $\tau = 0$, respectively. Furthermore, $w(\tau)$ vanishes for $\tau = 2 + e^{2i\pi/3}$ or $\tau = -1 + e^{2i\pi/3}$, in agreement with the splitting of the fundamental domain observed in \eqref{E0 Orbifold Monodromies}. To obtain the $U$-plane modular function, we take a cubic root of \eqref{E0wModular}, to find: \be U(\tau) = {1\over 3}\left(q^{-{1\ov9}} + 5q^{2\ov9} - 7q^{5\ov9} + 3q^{8\ov9} + \mathcal{O}(q) \right) = 1 + {1\over 3}\left({\eta({\tau\ov9})\over \eta(\tau)}\right)^3~. \end{equation} This is the Hauptmodul for $\Gamma^0(9)$, and it is obviously invariant under $T^9$ transformations. Its series expansion reproduces the McKay-Thompson series of class $9B$. Under a $T^{3n}$ transformation, this expression changes by a phase factor: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} T^{3n}~:~ & U(\widetilde\tau) = e^{{4 n \pi i \over 3}}\Bigg(1 + {1\over 3}\left({\eta({\widetilde\tau\ov9})\over \eta(\widetilde\tau)}\right)^3\Bigg)~, \eea for $\widetilde\tau = \tau + 3n$. Furthermore, under an $S$-transformation, we have: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} S~:~ & U(\tau_D) = 1 + 9\left({\eta(9\tau_D) \over \eta(\tau_D)}\right)^3 = 1 + 9q_D + 27 q_D^2 + \mathcal{O}(q_D^3)~, \eea for $\tau_D = -{1 \over \tau}$. We thus see that the singularity at $U = 1$ corresponds to the $\tau = 0$ cusp. Using the fact that $U(\tau)$ picks up phases under $T^3$ and $T^6$ transformations, we find that the cusps at $U = e^{4\pi i \over 3}$ and $U = e^{2\pi i \over 3}$ are in the $\Gamma^0(9)$ orbits of $\tau = 3$ and $\tau = 6$ (or $\tau = -3$), respectively. Let us further note that under the transformation: \be \gamma: \tau_* \mapsto {-\tau_* + 9 \over -\tau_* + 8}~, \end{equation} the cusp at $\tau_* = 6$ is mapped to $\tau = {3 \over 2}$. The element of ${\rm PSL}(2,\mathbb{Z})$ that corresponds to this transformation is: \be \gamma = \left( \begin{matrix} -1 & 9 \\ -1 & 8 \end{matrix} \right) \in \Gamma^0(9)~. \end{equation} As a result, $\tau = 6, -3$ and ${3\over 2}$ are all in the same orbit of $\Gamma^0(9)$. This shows that the two fundamental domains shown in figures~\ref{fig:Gamma0(9)} and~\ref{fig:Gamma0(9) FractionalBranes} are indeed fundamental domains of $\Gamma^0(9)$. Finally, let us note that the $a$ period satisfies: \be {da \over dU}(\tau) = -{3\over 2\pi i} {\eta(\tau)^3 \over \eta\left({\tau\over 3}\right)}~. \end{equation} \paragraph{Torsion and one-form symmetry.} We already mentioned that the $\mathbb{Z}_3$ symmetry of the $U$-plane is inherited from the one-form symmetry in 5d. The $D_{S^1} E_0$ SW geometry is an extremal RES with singular fibers $(I_9,3I_1)$ and with a MW group $\Phi = \mathbb{Z}_3$ spanned by the sections: \be P_1 = \left({3\over 4}U^2, -1 \right)~, \qquad P_2 = \left( {3\over 4}U^2, 1\right)= - P_1~. \end{equation} We thus identify this $\mathbb{Z}_3^{[1]}$ group with the one-form symmetry of the $D_{S^1} E_0$ theory, according to our conjecture \eqref{conject on 1form}. The one-form symmetry can also be seen directly from the BPS spectrum generated by the `fractional branes' states \eqref{spec E0}, which are left invariant by the generator $g^{\mathcal{Z}^{[1]}} =\big(0, {1\over 3})$ of the $\mathbb{Z}_3$ group. \section{The $E_2$ and $E_3$ theories -- 5d $SU(2)$ with one or two flavours}\label{sec:E2} In this section, we discuss the $U$-plane of the $E_2$ and $E_3$ theories, which are the UV-completion of the 5d $SU(2)$ gauge theory with one and two flavours, respectively. \subsection{CB configurations for the $E_2$ theory} The Weierstrass form of the $D_{S^1} E_2$ curve \eqref{E2Curve} reads: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{g2g3E2} g_2 & = \frac{1}{12} \Big( U^4 -8(1+\lambda)U^2 - 24\lambda M_1 U + 16\left(1 - \lambda + \lambda^2 \right) \Big)~,\\ g_3 & = -\frac{1}{216} \Big(U^6 -12(1+\lambda)U^4 - 36\lambda M_1 U^3 + 144\lambda M_1(1+\lambda)U + \\ & \qquad + 24\left(2 + \lambda + 2\lambda^2\right)U^2 - 8\left( 8- 12\lambda - 3\left(4+9M_1^2\right)\lambda^2 + 8\lambda^3\right) \Big)~. \eea The massless curve is obtained by setting $\lambda=M_1=1$. However, similarly to the $\widetilde E_1$ case, it is not extremal, nor modular, because of the $\frak{u}(1)$ factor in the flavour symmetry algebra. As per the classification of rational elliptic surfaces, the allowed CB configurations are: \be \label{E2 Configurations} \renewcommand{\arraystretch}{1.5} \begin{tabular}{ |c||c|c|c|c|c|} \hline $\{F_v\}$ & $\lambda$ & $M_1$ & $\mathfrak{g}_F$ & ${\rm rk}(\Phi)$ & $\Phi_{\rm tor}$ \\ \hline \hline $I_7, I_2, 3I_1$ & $1$ & $1$ & $A_1 \oplus \frak{u}(1)$ & $1$ & $-$ \\ \hline $I_7, III, 2I_1$ & $1$ & $2i$ & $A_1 \oplus \frak{u}(1)$ & $1$ & $-$ \\ \hline $I_7, I_2, II, I_1$ & $1$ & $\pm \frac{2}{3\sqrt{3}}$ & $A_1 \oplus \frak{u}(1)$ & $1$ & $-$ \\ \hline $I_7, 2II, I_1$ & $e^{i\theta_0}$ & $2^{{7\ov4}} e^{i\theta_1}$ & $2 \frak{u}(1)$ & $2$ & $-$ \\ \hline $I_7, II, 3I_1$ & $e^{\frac{\pi i}{3}}$ & $\frac{2}{3^{3/4}}e^{\frac{5\pi i}{12}}$ & $2 \frak{u}(1)$ & $2$ & $-$ \\ \hline $I_7, 5I_1$ & $\lambda$ & $M_1$ & $2 \frak{u}(1)$ & $2$ & $-$ \\\hline \end{tabular} \end{equation} Here, $\theta_0 = -\pi + \tan^{-1}\left({91\sqrt{7} \over 87}\right)$ and $\theta_1 = \frac{1}{2}\tan^{-1}\left( {7\sqrt{7} \ov13 }\right)$. Note that some of the choices of parameters are not unique. For the first three configurations, setting $\lambda = 1$ leads to an $I_2$ singularity in the bulk. As in the case of the $\widetilde E_1$ theory, we see that there are configurations that include the AD theories $H_0$ and $H_1$, corresponding to the type-$II$ and $III$ singularities, respectively. Since the $E_2$ theory admits a gauge-theory deformation to the 5d $SU(2)$ $N_f = 1$ theory, we did expect the existence of at least one $H_0$ point, but we can bypass the 4d gauge-theory limit entirely. For instance, consider the configuration $(I_7,I_2,II,I_1)$ with $M_1 = {2\over 3\sqrt{3}}$. The type-$II$ singularity sits at $U = -2\sqrt{3}$, so we consider the limit: \renewcommand{\arraystretch}{1} \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} (I_7, I_2, II, I_1)\,: &~~ \, U \rightarrow u~\beta^{{6\ov5}}- 2\sqrt{3} - \frac{c}{\sqrt{3}}~\beta^{{4\ov5}} ~, \quad \lambda \rightarrow 1 +c~\beta^{{4\ov5}}~, \quad M_1 \rightarrow \frac{2}{3\sqrt{3}}~, \eea with $\beta \rightarrow 0$, leading to the curve: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} y^2 = 4x^3 + \frac{8}{9}~c~x - \frac{16}{9\sqrt{3}}~u~. \eea which gives us directly the SW curve of the $H_0$ theory \cite{Argyres:1995jj}. Similarly, the $H_1$ AD theory can be recovered from the CB configuration $(I_7,III,2I_1)$, with the type-$III$ singularity sitting at at $U=-2i$ for the values of the parameters in \eqref{E2 Configurations}. Recalling that we have $\Delta_u = {4\over 3}$ and that the 4d parameters $(c,\mu)$ have scaling dimensions $\left({2\over 3},1\right)$, we consider the 4d limit: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} (I_7, III, 2I_1)\; : & \quad \lambda \rightarrow 1 +\mu~\beta~, \quad M_1 \rightarrow 2i + c~\beta^{{2\ov3}}~, \\ & \quad U \rightarrow u~\beta^{{4\ov3}} - 2i -c~\beta^{{2\ov3}} - i~\mu~\beta~. \eea The resulting four-dimensional curve reads: \be y^2 = 4x^3 - \left(-\frac{4c^2}{3}+4i~u\right)x - \left( \frac{8i}{27}~c^3 + \frac{4c}{3}~u + \mu^2\right)~. \end{equation} Then, upon the redefinition: \be u\longrightarrow -i~u -\frac{i}{4}~c^2~, \end{equation} followed by the rescalings $(x,y) \rightarrow \left(e^{{\pi i \over 2}} x, e^{{3\pi i \over 4}}y\right)$ and $u\rightarrow 4u$, $c \rightarrow 2c$, $\mu \rightarrow 2e^{-{\pi i \over 4}}\mu $, we recover the curve: \be y^2 = 4x^3 - \left(\frac{4c^2}{3} - 16u \right)~x + \left( \frac{8c^3}{27} + \frac{32c}{3}~u + 4\mu^2\right)~, \end{equation} which is the Weiertrass form of the $H_1$ curve \cite{Argyres:1995xn, Shapere:1999xr}: \be \label{H1 Weierstrass Form} y^2 + u = x^4 + c~x^2 + \mu~x~. \end{equation} In this limit, note that it is $\lambda$ that plays the role of the flavour parameter in the Argyres-Douglas theory, while $M$ is related to the parameter conjugate to $u$. This is because the $\frak{su}(2)$ flavour symmetry of $H_1$ is here inherited from the $\frak{su}(2)$ flavour symmetry of the $E_2$ theory, under which the 5d W-boson and instanton particle transform as a doublet. This can be contrasted with the physics of the 4d $SU(2)$ $N_f=2$ CB, where the $\frak{su}(2)$ comes from a pair of quarks, which are then combined with a light dyon \cite{Argyres:1995xn}. \paragraph{Modularity and AD configuration.} We already mentioned that the massless $E_2$ curve is not modular, but one may wonder whether any of the other configurations in \eqref{E2 Configurations} could have some interesting modular properties. The genus-zero congruence subgroups of ${\rm PSL}(2,\mathbb{Z})$ have been completely classified in \cite{Sebbar:2001,Cummins2003}. Using their lists, we find that most of the $D_{S^1} E_2$ CB configurations of $D_{S^1} E_2$ cannot be modular.% \footnote{At least with respect to a congruence subgroup. In fact, two other configurations are modular with respect to non-congruence subgroups.} This leaves us with the $(I_7,2II, I_1)$ configuration, which could be modular under $\Gamma^0(7)$. Note that this was one of the `missing groups' in the naive pattern that would assign $\Gamma^0(9-n)$ to $D_{S^1} E_n$. To check this explicitly, let us first relate the SW curve \eqref{g2g3E2}, which was obtained from the `toric' curve \eqref{E2Curve}, to the $D_{S^1} E_2$ curve obtained as a limit of the $E$-string curve \cite{Eguchi:2002fc}. This is simply done by finding the map between the gauge theory parameters and the $E_2= SU(2)\times U(1)$ characters, as explained in appendix \ref{app:Enchar}, which gives: \be \chi_1^{E_2} = \sqrt{\lambda}+{1\over \sqrt{\lambda}}~, \qquad \quad \chi_{U(1)}^{E_2} = \lambda^{{1 \over 4}} M_1~. \end{equation} Additionally, the $U$ parameter differs by an overall normalization $ \lambda^{{1 \over 4}}$. In terms of the $E_2$ characters, the $(I_7, 2II, I_1)$ configuration occurs for: \be \chi_1^{E_2} = {13\over 8\sqrt{2}}~, \qquad \quad \chi_{U(1)}^{E_2} = 2^{{7\over 4}}~, \end{equation} We then find that: \be \lambda^{-{1 \over 4}} U(\tau) = 2^{ {1\over 4} } \left( {9\over 2} + \left( {\eta\left( {\tau\over 7}\right) \over \eta(\tau)}\right)^4 \right)~, \end{equation} which is indeed the Hauptmodul for $\Gamma^0(7)$. One can check that the $I_1$ singularity is at $\tau = 0$ and that the type-$II$ elliptic points are in the $\Gamma^0(7)$ orbit of $\tau_1 =3+ e^{2\pi i\over 3}$ and $\tau_2 = 5+ e^{2\pi i\over 3}$, respectively. \subsection{CB configurations for the $E_3$ theory} Let us now consider the $E_3$ theory, which is the UV fixed point of the 5d $SU(2)$ gauge theory with $N_f=2$. The Weierstrass form of the toric curve \eqref{toric E3 curve} reads: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{E3 curve g23} g_2(U) & = \frac{1}{12} \Big( U^4 -8\left(1+(1+p)\lambda \right)U^2 - 24\lambda s U\\ & \qquad \qquad+ 16\left(1 - (1+p)\lambda + (1-p+p^2)\lambda^2 \right) \Big)~, \\ g_3(U) & = -{1\over 216} \Big( U^6 - 12\left(1+(1+p)\lambda \right)U^4-36\lambda s U^3 \\ & \qquad \qquad \;+ 24\left(2+(1+p)\lambda + (2+p+p^2)\lambda^2 \right) U^2 +144\lambda s\left(1+(1+p)\lambda\right) U \\ & \qquad\qquad\; + 4\lambda^2 \left(8-96p+216p^2+54s^2 + \left(22+27p+3p^2 - 2p^3\right)\lambda \right) \Big)~, \eea where we introduced $s = M_1 + M_2$ and $p = M_1M_2$. Additionally, the $E_3$ characters can be worked out as described in appendix \ref{app:Enchar}. One finds: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \chi_1^{E_3} = \frac{1+\lambda (1+p)}{\kappa_{E_3}^2}~, \qquad \chi_2^{E_3} = \lambda\frac{1+(1+\lambda)p}{\kappa_{E_3}^4}~, \qquad \chi_3^{E_3} = \frac{s\lambda}{\kappa_{E_3}^3}~, \eea for $\kappa_{E_3} \equiv p^{1\ov6}\lambda^{1\ov3}$. Here, $\chi_1$ and $\chi_2$ are the $SU(3)$ characters, and $\chi_3$ is the $SU(2)$ character. The 16 allowed configurations of singular fibers are listed in table~\ref{tab: E3 Configurations}. % \renewcommand{\arraystretch}{1.5}% \begin{table}[t] \centering \begin{tabular}{ |c|c||c|c|c|c|c|c|} \hline $\mathcal{S}_\#$& $\{ F_v\}$ & $\lambda$ & $M_1$ & $M_2$ & $\mathfrak{g}_F$ & ${\rm rk}(\Phi)$ & $\Phi_{\rm tor}$\\ \hline \hline $1$& $I_6, I_3, I_2, I_1$ & $1$ & $1$ & $1$ & $A_2\oplus A_1 $ & $0$ & $\mathbb{Z}_6$ \\ \hline $2$&$I_6, IV, 2I_1$ & $1$ & $i$ & $-i$ & $A_2\oplus \frak{u}(1) $ & $1$ & $\mathbb{Z}_3$ \\ \hline $3$&$I_6, I_3, 3I_1$ & $1$ & $e^{\frac{2\pi i}{3}}$ & $e^{\frac{4\pi i}{3}}$ & $A_2\oplus \frak{u}(1) $ & $1$ & $\mathbb{Z}_3$ \\ \hline $4$& $I_6, 2I_2, 2I_1$ & $1$ & $M$ & $M$ & $2A_1\oplus \frak{u}(1) $ & $1$ & $\mathbb{Z}_2$ \\ \hline $5$& $I_6, III, I_2, I_1$ & $1$ & $\frac{1}{2}$ & $\frac{1}{2}$ & $2A_1\oplus \frak{u}(1) $ & $1$ & $\mathbb{Z}_2$ \\ \hline $6$& $I_6, III, II, I_1$ & $1$ & $\delta - i$ & $\delta + i$ & $A_1\oplus 2\frak{u}(1) $ & $2$ & $-$ \\ \hline $7$& $I_6, III, 3I_1$ & ${(1\pm M)^2 \over M^2}$ & $M$ & $M$ & $A_1\oplus 2\frak{u}(1) $ & $2$ & $\mathbb{Z}_2$ \\ \hline $8$& $I_6, III, 3I_1$ & $-{(1 - M^2)^2 \over 4M^2}$ & $M$ & ${1\over M}$ & $A_1\oplus 2\frak{u}(1) $ & $2$ & $-$ \\ \hline $9$& $I_6, I_2, 2II$ & $1$ & $\frac{1}{2\sqrt{2}}$ & $-\frac{1}{2\sqrt{2}}$ & $A_1\oplus 2\frak{u}(1) $ & $2$ & $-$ \\ \hline $10$& $I_6, I_2, II, 2I_1$ & $-1$ & $\alpha_{+}$ & $\alpha_-$ & $A_1\oplus 2\frak{u}(1) $ & $2$ & $-$ \\ \hline $11$& $I_6, I_2, 4I_1$ & $\lambda$ & $M$ & $M$ & $A_1\oplus 2\frak{u}(1) $ & $2$ & $\mathbb{Z}_2$ \\ \hline $12$& $I_6, I_2, 4I_1$ & $\lambda$ & $M$ & ${1\over M}$ & $A_1\oplus 2\frak{u}(1) $ & $2$ & $-$ \\ \hline $13$& $I_6, 3II$ & $e^{\frac{2\pi i}{3}}$ & $\kappa_- e^{\frac{5\pi i}{6}} $ & $\kappa_+e^{\frac{11\pi i}{6}}$ & $3\frak{u}(1) $ & $3$ & $-$ \\ \hline $14$& $I_6, 2II, 2I_1$ & \multicolumn{3}{l|}{\qquad $\qquad \chi=\left(-\frac{3}{8},3,0\right) $} & $3\frak{u}(1) $ & $3$ & $-$ \\ \hline $15$& $I_6, II, 4I_1$ & \multicolumn{3}{l|}{$\quad \chi=\left(-6+b^2,12-6b,6\right) $} & $3\frak{u}(1) $ & $3$ & $-$ \\ \hline $16$& $I_6, 6I_1$ & $\lambda$ & $M_1$ & $M_2$ & $3\frak{u}(1) $ & $3$ & $-$ \\ \hline \end{tabular} \caption{Allowed configurations of singular fibres on the Coulomb branch of the $D_{S^1} E_3$ theory. Here, we have $\delta = \frac{3^{3/4}}{2}e^{\frac{5\pi i}{12}} $, $\alpha_{\pm} = \frac{1}{9}(7\sqrt{6}\pm 5\sqrt{15})$ and $\kappa_{\pm} = 2\pm \sqrt{3}$ and $b\in \mathbb{C}$.} \label{tab: E3 Configurations} \end{table}% \renewcommand{\arraystretch}{1}% Some of the configurations shown in the table appear in one- or multi-parameter families, being particular examples which exhibit enhanced $U$-plane symmetry. It is implicitly understood that, for the families with explicit free parameters, the given configuration appears for generic values of the parameter, with finitely many exceptions. It should be pointed out that two configurations appear more than once in Persson's classification \cite{Persson:1990}. These are: \renewcommand{\arraystretch}{1} \be \mathcal{S}_{7 \, {\rm or}\, 8} \cong (I_6, III, 3I_1)~, \qquad \qquad \mathcal{S}_{11 \, {\rm or}\, 12} \cong (I_6, I_2, 4I_1)~, \end{equation} which both appear with two possible choices of MW torsion groups, $\mathbb{Z}_2$ or trivial. We will discuss the difference between the two momentarily. \medskip \noindent It is interesting to explore how various configurations can be connected, similarly to the 4d gauge-theory analysis. For instance, one can first start by setting the masses equal, $M_1 = M_2 = M$, which automatically leads to an $I_2$ singularity, namely the $\mathcal{S}_{11}$ configuration. Imposing $\lambda = {1\over M^2}$ (or $\lambda = 1$), one finds a one-parameter family for the configuration $\mathcal{S}_4 \cong (I_6,2I_2,2I_1)$. Furthermore, tuning $M = \pm 2$ (or $M = \pm {1\over 2}$, respectively) leads to the configuration $\mathcal{S}_5\cong (I_6,III, I_2, I_1)$, as one of the $I_2$ singularities combines with a mutually non-local $I_1$. Alternatively, starting from $\mathcal{S}_{11} \cong (I_6,I_2,4I_1)$, one can set $\lambda = {(1\pm M)^2 \over M^2}$ instead, which leads to the $\mathcal{S}_7\cong (I_6,III,3I_1)$ configuration. Note that from the family $\mathcal{S}_7$, it is not possible to further tune the parameter $M$ in such a way as to obtain the type-$IV$ singularity in the configuration $\mathcal{S}_2$. Another starting point would be to set the masses $M_1 = {1\over M_2} = M $, which, in the 4d gauge-theory limit, would still correspond to $|m_1^{({\rm 4d})}| = |m_2^{({\rm 4d})}|$. In this case we also an $I_2$ fiber along that family, which we will argue to be $\mathcal{S}_{12}$. Compared to the previous case, it is now possible to obtain a type-$IV$ singular fiber, as follows. One can first set $\lambda = 1$, leading to $\mathcal{S}_3 =(I_6,I_3,3I_1)$, and then subsequently set $M = i$ to reach $\mathcal{S}_2\cong(I_6, IV,2I_1)$. Alternatively, one can tune $\lambda = -{(1-M^2)^2 \over 4M^2}$ to find $\mathcal{S}_8\cong (I_6,III,3I_1)$, which is further `enhanced' to $\mathcal{S}_2\cong (I_6, IV,2I_1)$ by setting again $M = i$. In other words, if we start from the massless configuration $\mathcal{S}_1\cong (I_6,I_3,I_2,I_1)$, the type-$IV$ singularity is formed when the $I_2$ fiber `splits' into two $I_1$ singular fibers, with one of them merging with the $I_3$. From these considerations, we see that the two configurations $\mathcal{S}_7$ and $\mathcal{S}_8$, despite having the same singular fiber types, have different physics. The different torsion groups reflect that fact.% \footnote{For instance, the fact that $\mathcal{S}_8$ contains $\mathcal{S}_2$ as a limit implies it cannot have $\mathbb{Z}_2$ torsion, because $\mathcal{S}_2$ has $\mathbb{Z}_3$ torsion and $\mathbb{Z}_2$ is not a subgroup of $\mathbb{Z}_3$.} A similar reasoning can be applied to the two distinct $(I_6,I_2, 4I_1)$ configurations. It is apparent from table~\ref{tab: E3 Configurations} that we can find interesting configurations on the Coulomb branch of the $D_{S^1} E_3$ theory even for $|\lambda| = |M_i|=1$. In field theory language, this corresponds to turning on flavour Wilson lines along the $S^1$ in an otherwise massless five-dimensional theory. We analyse some of these configurations in the following, starting with the massless curve. \subsubsection{Massless curve, modularity and flavour symmetry group} The massless configuration corresponds to the extremal rational elliptic surface $X_{6321}$, which has a $\mathbb{Z}_6$ MW group. The Weierstrass form of the massless curve reads: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} g_2(U) & = {1\over 12} U \Big( U^3 - 24U - 48\Big)~, \\ g_3(U) & = -{1\over 216}\Big(U^6 - 36U^4 - 72U^3 + 216U^2 +864U + 864 \Big)~, \eea with the discriminant: \be \Delta(U) = (U-6)(U+2)^3(U+3)^2~. \end{equation} Consequently, the $U$-plane has three singularities in the bulk, $(I_1,I_3,I_2)$, and one $I_6$ cusp at infinity. The geometric periods: \be \omega = {d\Pi \over dU}~, \end{equation} satisfy the Picard-Fuchs equation: \be\label{PF for massless E3} (U-6)(U+2)(U+3){d^2\omega \over dU^2} + (3U^2 - 2U -24){d\omega \over dU} + U \omega = 0~. \end{equation} Compared to the previous examples, this has four singular points. We will not solve \eqref{PF for massless E3} directly, but rather use the modular properties of the curve~\cite{Harnad:1998hh}. One can first compute $U(\tau)$, to find: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} & U(\tau) = q^{-{1\over 6}} + 1 + 6q^{{1\over 6}} + 4q^{{1\over 3}} - 3q^{{1\over 2}} - 12q^{{2\over 3}} - 8q^{{5\over 6}} + \mathcal{O}(q) = 6 + {\eta\left({\tau \over 6}\right)^5 \eta\left({\tau \over 2}\right) \over \eta(\tau)^5 \eta\left({\tau \over 3}\right)}~, \eea which gives the McKay-Thompson series of class $6E$ of the Monster group and the Hauptmodul for $\Gamma^0(6)$. The massless $D_{S^1} E_3$ SW geometry is therefore modular for that congruence subgroup. This expression is invariant under a $T^6$ transformation, while under an $S$ transformation it becomes: \be U(\tau_D) = 6 + 72 {\eta(6\tau_D)^5 \eta(2\tau_D) \over 2 \eta(\tau_D)^5 \eta(3\tau_D)} = 6 + 72 q_D + 360 q_D^2 + \mathcal{O}(q_D^3)~, \end{equation} where $\tau_D = -{1\over\tau}$. Thus, the $I_1$ singularity at $U = 6$ corresponds to an $I_1$ cusp at $\tau = 0$. To find the other cusps, we use the properties of the $\eta$-function listed in appendix \ref{App:Congruence}. One can show that, under an $ST^3$ transformation, we have: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} & U(\widetilde\tau_D) &=&\; 6 - {9\eta\left( 3\widetilde\tau_D \right)^{14} \over \eta\left( 6\widetilde\tau_D\right)^5 \eta\left( 2\widetilde\tau_D\right) \eta\left( {3\widetilde\tau_D \over 2}\right)^5 \eta\left( \widetilde\tau_D\right)^2 \eta\left( {\widetilde\tau_D\over 2}\right)} ~=~ - 3 - 9\widetilde q_D^{~{1\ov2}} +\mathcal{O}\left(\widetilde q_D\right)~, \eea where $\widetilde\tau_D = - {1 \over \tau + 3}$. As a result, the $I_2$ cusp at $\tau = 3$ corresponds to the $U = -3$ singularity. Finally, an $ST^2$ transformation leads to a more involved closed form expression, with the power series: \be U(\widetilde \tau_D ) = -2 -8e^{{2\pi i \over 3}~} \widetilde q_D^{~{1\over 3}} - 24 e^{{\pi i \over 3}~}\widetilde q_D^{~{2\over 3}} +\mathcal{O}(\widetilde q_D)~, \end{equation} where here $\widetilde\tau_D = - {1 \over \tau + 2}$, and thus the $U=-2$ singularity corresponds to the $I_3$ cusp at $\tau = 2$. The corresponding fundamental domain of $\Gamma^0(6)$ is shown in figure~\ref{fig:Gamma0(6) domain}. We also find that the $a$ period satisfies: \be {d a\over dU}(\tau) = -{1 \over 2\pi i} {\eta\left({\tau\ov6}\right) \eta(\tau)^6 \over \eta\left({\tau\over 3}\right)^2 \eta\left({\tau\over 2}\right)^3}~. \end{equation} \begin{figure}[t] \centering \scalebox{0.8}{\input{Gamma06.tikz}} \caption{Fundamental domain for $\Gamma^0(6)$ with cusps at $\tau = 0, 2, 3$ and $i\infty$ of widths $1, 3, 2$ and $6$, respectively.} \label{fig:Gamma0(6) domain} \end{figure} \paragraph{Flavour symmetry group, BPS states and BPS quiver.} From the fundamental domain shown in figure~\ref{fig:Gamma0(6) domain}, we can directly read off the monodromies around the singularities of the massless $E_3$ curve. We find that the following dyons of the KK theory $D_{S^1} E_3$ become massless at these points: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \label{E3 BPS states} & U=~~6 ~(\tau = 0)\; && (I_1) \; : && \text{a monopole of charge $(1,0; 0,0)$ becomes massless,}\cr & U=-2 ~(\tau = 2)\; && (I_3) \; : && \text{three dyons of charge $(-1,2; 0, 1)$ become massless,}\cr & U=-3 ~(\tau = 3)\; && (I_2) \; : && \text{two dyons of charge $(1,-3; 1, 0)$ become massless,} \eea in the notation $(m, q; l_1, l_2)$ of \eqref{psi state charges}, with $(l_1, l_2)\in \mathbb{Z}_2\times \mathbb{Z}_3$ the charge under the center of the $SU(2)\times SU(3)$ flavour group associated to the $I_2$ and $I_3$ cusps. where the states are charged under $U(1)_m^{[1]}\times U(1)_e^{[1]} \times \mathbb{Z}_2 \times \mathbb{Z}_3$, with $\mathbb{Z}_k$ the center of the flavour symmetry associated to the $I_k$ cusps. In particular let us also note that the group $\mathscr{E} = \mathbb{Z}_2 \times \mathbb{Z}_3\cong \mathbb{Z}_6$, generated by: \be g^{\mathscr{E}} = \left(0, {1\over 3}; 0, 1\right)~, \quad \left(0, {1\over 2}; 1, 0\right)~, \end{equation} leaves these states invariants. We can then conclude that the actual flavour group is: \be G_F= {\rm E}_3/\mathbb{Z}_6 = PSU(3)\times SO(3)~, \end{equation} as expected. The BPS quiver corresponding to the states \eqref{E3 BPS states} takes the form of a 3-blocks quiver, for a total of $6$ nodes: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{quiver E3a} \begin{tikzpicture}[baseline=1mm] \node[] (1) []{$\mathcal{E}_{\gamma_1=(1,0)}$}; \node[] (2) [right = of 1]{$\mathcal{E}_{\gamma_{2,3,4}=(-1,2)}$}; \node[] (3) [below = of 1]{$\mathcal{E}_{\gamma_{5,6}=(1,-3)}$}; \draw[->>-=0.5] (1) to (2); \draw[->-=0.3] (2) to (3); \draw[->>>-=0.5] (3) to (1); \end{tikzpicture} \eea which makes the $\mathfrak{su}(3)\oplus \mathfrak{su}(2)$ symmetry -- or rather, its Weyl group $S_3\times S_2$ -- apparent. This quiver is a well-known `toric quiver' for local $dP_3$ -- see for example the `Model 10d' in \cite{Hanany:2012hi}. \paragraph{Torsion sections for the massless curve.} The global form of the flavour group of massless $D_{S^1} E_3$ can also be understood from the MW group $\Phi \cong \mathbb{Z}_6$. The sections of the massless $E_3$ curve are given explicitly by: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} P_1 & =\left( {1\over 12}(U^2+12U+24), -(U+2)(U+3)\right)~, \\ P_2 & = \left({1\over 12}U^2~, -(U+2)\right)~, \\ P_3 & = \left( {1\over 12}(U^2-12), 0\right)~, \\ P_4 & = \left( {1\over 12}U^2, U+2\right)~, \\ P_5 & = \left( {1\over 12}(U^2 + 12U+24), (U+2)(U+3)\right)~, \eea which indeed span a $\mathbb{Z}_6 \cong \mathbb{Z}_2 \times \mathbb{Z}_3$ torsion group, with $P_k + P_l = P_{k+l~(\text{mod }6)}$. One can then check that $P_2$ and $P_4$ only intersect the $\Theta_{v,0}$ component of the $I_2$ fiber, so that these sections generate a $\mathbb{Z}_3$ subgroup which injects into $\mathbb{Z}_3 = Z(SU(3))$ at the $I_3$ singularity. Similarly, the $P_3$ section intersects the $\Theta_{v,0}$ component of the $I_3$ fiber, and generates a $\mathbb{Z}_2$ subgroup that injects into $\mathbb{Z}_2= Z(SU(2))$ at the $I_2$ singularity. As a result, the global form of the flavour symmetry is indeed $(SU(3)\times SU(2))/\mathbb{Z}_6$. \subsubsection{Other interesting $D_{S^1} E_3$ CB configurations} \paragraph{$\boldsymbol{\mathcal{S}_{16} \cong (I_6, 6I_1)}$ with $\mathbb{Z}_6$ symmetry.} The configuration $\mathcal{S}_{16}$ appears at generic points on the Coulomb branch of $E_3$. We can, however, tune the parameters to obtain a $\mathbb{Z}_6$-symmetric configuration, with the $U$-plane singularities organized as the roots of $U^6 = 432$. This occurs for $(\lambda, M_1, M_2) = (e^{4\pi i \over 3}, e^{7\pi i \over 6}, e^{i\pi \over 6})$. Note that this corresponds to setting the three $E_3$ characters to zero. In this case, $U(\tau)$ is a solution to: \be\label{E3Z6SymmetryX} (X(\tau) - 432) j(\tau) = X(\tau)^2~, \end{equation} for $X(\tau) = U(\tau)^6$~. This leads to the solutions: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} X(\tau) & = 864~{E_4(\tau)^{3\ov2} \over E_4(\tau)^{3\ov2} \pm E_6(\tau)}~. \eea This function appeared for the massless 4d $SU(2)$ $N_f = 1$ theory in table~\ref{tab:4dSU2}, and it is not a modular function for any of the congruence subgroups. Nonetheless, the $\mathbb{Z}_6$ symmetry leads to a major simplification of the PF equation, and the geometric periods can be expressed in terms of hypergeometric functions. In particular, we find that: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} {da \over dU} = -{1\over 2\pi i}{1 \over U} \prescript{}{2}{F}_1 \left({1 \over 6},{5 \over 6},1; {432 \over U^6} \right)~, \qquad \Pi_f = 2a~. \eea The periods can thus be determined explicitly on the $U$-plane, exactly as for the $E_1$ theory. Using the $\mathbb{Z}_6$ symmetry of the $U$-plane one can first determine the geometric periods $\widetilde \omega = \theta_U \Pi$ on the $w = {U^6\over 432}$ plane. In this case, the $\mathbb{Z}_6$ `orbifold' monodromy corresponds to a type-$II^*$ singularity at the origin of the $w$-plane. It reads: \be \mathbb{M}_{w=0}^+ = \left( \begin{matrix} 0 & -1 \\ 1 & 1 \end{matrix} \right) = ST~, \qquad \mathbb{M}_{w=0}^- = \left( \begin{matrix} 1 & -1 \\ 1 & 0 \end{matrix} \right) = T(ST)T^{-1}~, \end{equation} for a base point in the upper/lower half-plane, respectively. Consequently, we can find the $U$-plane monodromies by conjugating the `conifold' monodromy, exactly as in previous examples: \be \mathbb{M}_{k} = \left( \mathbb{M}^-_{w=0} \right)^k \mathbb{M}_{w=1} \left( \mathbb{M}^-_{w=0} \right)^{-k}~, \qquad \mathbb{M}_{w=1} = STS^{-1}~. \end{equation} for $k = 0, \ldots, 5$. We then find that the BPS states becoming massless at the six $I_1$ cusps are: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \pm(1,0)~, \qquad \pm (0,1)~, \qquad \pm (1,-1)~. \eea The corresponding $\mathbb{Z}_6$-symmetric quiver takes the form: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{quiver E3 Z6} \begin{tikzpicture}[baseline=1mm] \node[] (b1) []{}; \node[] (2) [right = of b1]{$\;\mathcal{E}_{\gamma_{2}=(0,1)}$}; \node[] (3) [right = of 2]{$\;\mathcal{E}_{\gamma_{3}=(-1,1)}$}; \node[] (b2) [right = of 3]{}; \node[] (1) [below = of b1]{$\mathcal{E}_{\gamma_{1}=(1,0)}$}; \node[] (4) [below = of b2]{$\mathcal{E}_{\gamma_{4}=(-1,0)}$}; \node[] (b3) [below = of 1]{}; \node[] (6) [right = of b3]{$\mathcal{E}_{\gamma_{6}=(1,-1)}$}; \node[] (5) [right = of 6]{$\mathcal{E}_{\gamma_{5}=(0,-1)}$}; \draw[->-=0.5] (1) to (2); \draw[->-=0.5] (1) to (3); \draw[->-=0.5] (2) to (3); \draw[->-=0.5] (2) to (4); \draw[->-=0.5] (3) to (4); \draw[->-=0.5] (3) to (5); \draw[->-=0.5] (4) to (5); \draw[->-=0.5] (4) to (6); \draw[->-=0.5] (5) to (6); \draw[->-=0.5] (5) to (1); \draw[->-=0.5] (6) to (1); \draw[->-=0.5] (6) to (2); \end{tikzpicture} \eea This is again a well-known quiver for $dP_3$, called `Model 10a' in \cite{Hanany:2012hi}. Let us also mention that the $a$ period satisfies the simple relation: \be U(\tau) {d a\over dU}(\tau) = -{1\over 2\pi i} E_4(\tau)^{1\over 4}~. \end{equation} With a bit more work, one can also establish the existence of a quiver point at $U=0$, where the central charges of the 6 fractional branes align to $\mathcal{Z}={1\over 6}$. \paragraph{$\boldsymbol{\mathcal{S}_7 \cong (I_6,III,3I_1)}$ with $\mathbb{Z}_3$ symmetry.} This configuration can be obtained for unit absolute values of the parameters from the one-parameter family $\mathcal{S}_7$ in table~\ref{tab: E3 Configurations} by setting $M = e^{{2\pi i \over 3}}$, for instance. This is equivalent to $(\lambda, M_1, M_2)= ( e^{-{2\pi i \ov3}}, e^{{2\pi i \ov3}}, e^{{2\pi i \ov3}})$, or to setting the $E_3$ characters to $\chi_1^{E_3} = \chi_2^{E_3} = 0$ and $\chi_3^{E_3} = 2$. In that case, the discriminant becomes: \be \Delta(U) = U^3(U^3-64)~, \end{equation} with three $I_1$ type singularities at $U^3 = 64$ and an elliptic point (a type-$III$ singularity) at $U=0$, where we have a $H_1$ AD theory at low energy. As in previous examples, we can flow directly to this Argyres-Douglas fixed point, bypassing the 4d gauge theory. Before taking the 4d limit explicitly, let us look at the modular properties of this $D_{S^1} E_3$ curve. $U(\tau)$ can be obtained by solving the cubic equation: \be (X(\tau)-64)j(\tau) = (X(\tau)-48)^3~, \end{equation} for $X(\tau) =U(\tau)^3$. It turns out that $X(\tau)$ is a modular function for the $\Gamma^0(2)$ congruence subgroup, with a root: \be X(\tau) = 64 + \left({\eta\left({\tau \over 2}\right)\over \eta(\tau)}\right)^{24} ~, \end{equation} which is the Hauptmodul for $\Gamma^0(2)$. Furthermore, the $a$-period satisfies: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} {da \over dU} = -{1\over 2\pi i}{1 \over U} \prescript{}{2}{F}_1 \left( {1 \over 4},{3 \over 4},1;{64 \over U^3} \right)~, \qquad U(\tau) {da \over dU}(\tau) = -{\sqrt{2}\over 4\pi i}~\Big(\vartheta_3(\tau)^4 + \vartheta_4(\tau)^4\Big)^{1\over 2}~. \eea As a result, one can find the analytic continuation of the periods throughout the whole $U$-plane, as before, and one can determine which BPS states become massless at the $U$-plane singularities. In order to better understand the difference between this configuration, $\mathcal{S}_7\cong (I_6,III, 3I_1)$, and the configuration $\mathcal{S}_8$ to be discussed momentarily, let us look at the BPS states from the point of view of the massless theory. In the configuration at hand, where $M_1 = M_2$, the type-$III$ singularity is obtained when the two dyons $(1,-3)$ of the $I_2$ singularity in \eqref{E3 BPS states} as well as one of the dyons $(-1,2)$ or $(1,0)$ become massless at the same point on the $U$-plane, depending on the deformation pattern. In the first case, for instance, we have: \be \mathbb{M}_{III} = \mathbb{M}_{(1,-2)} \mathbb{M}_{(1,-3)}^2 = T^3S^{-1}T^{-3}~. \end{equation} In this configuration, we have the light BPS states: \be\label{BPS S7} \mathscr{S}\; :\; \; \underbrace{(1, -3; 1)~,\; (1, -2; 0)}_{H_1}~, \quad 2(-1,2; 0)~, \quad (1,0;0)~, \end{equation} where the third entry is the $\mathbb{Z}_2$ center charge associated with the $\mathfrak{su}(2)$ symmetry from the type-$III$ singularity. Here, we see that all the particles are left invariant by a $\mathbb{Z}_2$ generated by: \be\label{gE S7} g^\mathscr{E}= \left(0, {1\over 2}; 1\right)~, \end{equation} and therefore the non-abelian part of the flavour symmetry of this CB configuration is $SU(2)/\mathbb{Z}_2$, in agreement with the MW torsion. We can `zoom in' onto the AD theory by taking a 4d limit, as in other examples. In order to keep track of the parameters of the $H_1$ theory, we consider the limit: \be U \rightarrow u~\beta^{{4 \over 3}} + 2c~\beta^{{2 \ov3}}~, \quad \lambda \rightarrow e^{{4\pi i \over 3}}\left(1-2c~\beta^{{2\over 3}} \right)~, \quad M_{1,2} \rightarrow e^{{2\pi i\ov3}}\left( 1\pm \mu~\beta\right)~. \end{equation} Using the scaling $(x,y) \rightarrow (\beta^{{2 \over 3}}x, \beta y)$, the curve reduces to: \be y^2 = 4x^3 - \left( {16c^2\over 3}-4u\right)~x - \left( \frac{64c^3}{27} - \frac{8c}{3}~u - 4\mu^2\right)~, \end{equation} which, upon the redefinition $u \rightarrow 4u +c^2$ becomes the Weierstrass form of the usual curve \eqref{H1 Weierstrass Form} for the $H_1$ AD theory. This shows that there exists an RG flow from the $E_3$ theory to the $H_1$ Argyres-Douglas theory, which moreover preserves the full symmetry group $SO(3) \subset {\rm E_3}/\mathbb{Z}_6$ along the flow. We emphasise again that, in this setup, the starting point is the massless $E_3$ theory with certain Wilson lines turned on along the $S^1$. \paragraph{$\boldsymbol{\mathcal{S}_8 \cong (I_6,III,3I_1)}$.} This other $(I_6,III, 3I_1)$ configuration can be obtained from the massless configuration by first `splitting' the $I_2$ singularity of the massless curve through setting $M_1 = 1/M_2$, and then merging one of the resulting $I_1$ fibers with an $I_2$ subset of the $I_3$ fiber. In terms of the BPS states \eqref{E3 BPS states}, we then have the monodromy: \be \mathbb{M}_{III} = \mathbb{M}_{(1,-2)}^2 \mathbb{M}_{(1,-3)} = T^2S^{-1}T^{-2}~. \end{equation} It is interesting to contrast the charges of the light BPS states to \eqref{BPS S7}. In the present case, we have: \be \mathscr{S}\; :\; \; \underbrace{(1,- 3; 0)~,\; (-1, 2; 1)}_{H_1}~, \quad (-1,2; 0)~,\quad (1,-3,0)~, \quad (1,0;0)~. \end{equation} In this case, the $\mathbb{Z}_2$ action $g^\mathscr{E}= ({1\over 2}, {1\over 2}; 1)$ leaves invariant the states involved in the $H_1$ point, but not the full spectrum of the larger theory. This is similar to the discussion at the end of section~\ref{subsec:Su2Nf3}. \paragraph{$\boldsymbol{\mathcal{S}_2\cong (I_6,IV,2I_1)}$ and the $H_2$ AD point.} This configuration shows perhaps the most `unexpected' structure of the $U$ plane. For the values of the parameters displayed in table~\ref{tab: E3 Configurations}, the discriminant becomes: \be \Delta(U) = U^4(U^2 - 27)~, \end{equation} with two $I_1$ singularities at $U^2 = 27$ and a type-$IV$ singularity at the origin. In this configuration, the $E_3$ characters are: \be \chi_1^{E_3} = 3~, \qquad \chi_2^{E_3} = 3~, \qquad \chi_3^{E_3} = 0~. \end{equation} The low-energy physics of this singularity is the AD theory $H_2$, which appears on the Coulomb branch of the 4d $SU(2)$ theory with $N_f=3$ flavours, while the gauge theory phase of the $E_3$ theory only has $N_f=2$. \begin{figure}[t] \centering \scalebox{0.8}{\input{Gamma06withIV.tikz}} \caption{Fundamental domain for the $(I_6,IV,2I_1)$ configuration on the CB of the $D_{S^1} E_3$ theory.} \label{fig:Gamma0(6) IV domain} \end{figure} Let us first analyse the modular properties of this curve. $U(\tau)$ can be obtained by solving: \be (X(\tau)-27)~ j(\tau) = X(\tau)(X(\tau)-24)^3~, \end{equation} with $X(\tau) = U(\tau)^2$. While the $\mathcal{S}_2$ curve is not modular, we find that $X(\tau)$ itself is a modular function for the $\Gamma^0(3)$ congruence subgroup, being generated by: \be \label{HauptmodulE3IV} X(\tau) = 27+\left(\frac{\eta\left({\tau\over 3}\right)}{\eta(\tau)} \right)^{12}~. \end{equation} Furthermore, the $a$ period satisfies: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} {d a \over dU} = -{1 \over 2\pi i}{1\over U}\prescript{}{2}{F}_1\left({1\over 3}, {2\over 3}; 1; {27 \over U^2} \right)~, \eea which can be thus solved explicitly on the $U$-plane. The way this configuration appears can be also understood from the corresponding fundamental domain, which is shown in figure~\ref{fig:Gamma0(6) IV domain}. Note that the despite the fact that the configuration $\mathcal{S}_2$ is not modular, we can draw a fundamental domain by making use of the fundamental domain of $\Gamma^0(3)$. Starting with the BPS states of the massless theory \eqref{E3 BPS states}, the type-$IV$ singularity appears when the three dyons $(-1,2)$ of the $I_3$ cusp become massless at the same point with one of the dyons $(1,-3)$ of the $I_2$ cusp, with the monodromy: \be \mathbb{M}_{IV} = \mathbb{M}_{(-1,2)}^3 \mathbb{M}_{(1,-3)} = T^2 (ST)^{-2}T^{-2}~. \end{equation} This is consistent with the $\Gamma^0(3)$ Hauptmodul given in \eqref{HauptmodulE3IV}, as one can check that $X(\tau_*) = 0$, for $\tau_* = 2+e^{{2\pi i \over 3}}$. We can again obtain the full 4d curve, including all the 4d parameters, from the full $D_{S^1} E_3$ curve. Recall that the $H_2$ theory has a Coulomb branch parameter $u$ of scaling dimension $\Delta_u ={3\over 2}$, together with the parameters $(c, \mu_1,\mu_2)$, of scaling dimensions $\left({1\over 2},1,1\right)$. We then consider: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} U \longrightarrow u~\beta^{{3\ov2}} + 2c~\beta^{{1\ov2}}~, \quad \lambda \longrightarrow 1-\mu_1\beta~, \qquad M_{1,2}\rightarrow \pm i - c~\beta^{{1\ov2}} \pm \frac{i~\mu_2}{2}\beta~, \eea together with $(x,y)\rightarrow \left(\beta x, \beta^{{3\ov2}}y\right)$. Upon the redefinition $u \rightarrow u - c~\mu_1~$, the curve becomes: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} g_2(u) & = \frac{4}{3}\left(\mu_1^2 - \mu_1\mu_2 + \mu_2^2 - 3cu \right)~, \\ g_3(u) & = \frac{1}{27}\left(8(\mu_1^3+\mu_2^3) -12\mu_1\mu_2(\mu_1+\mu_2) - 27c^2\mu_1^2 + 18c(\mu_1-2\mu_2)u - 27u^2 \right)~. \eea This is the Weierstrass form of the curve: \be F(x,t)= \mu_2t + \mu_1 x + u +t x(t+x)+t^2 c = 0~, \end{equation} which is precisely the SW curve for the AD theory $H_2$ \cite{Argyres:1995xn, Shapere:1999xr}. \begin{figure}[t] \centering \begin{subfigure}{0.5\textwidth} \centering \scalebox{0.5}{\input{GammaE3-I6-I2-2II.tikz}} \caption{$6C^0$, $\mathcal{S}_9\cong (I_6, I_2, 2II)$} \end{subfigure}% \begin{subfigure}{0.5\textwidth} \centering \scalebox{0.5}{\input{GammaE3-I6-3II.tikz}} \caption{$6A^0$, $\mathcal{S}_{13}\cong(I_6, 3II)$} \end{subfigure} \caption{Fundamental domains for two modular configurations on the CB of $D_{S^1} E_3$.} \label{fig: E3 ModularConfigs} \end{figure} \paragraph{Modular configurations.} Let us briefly comment on the remaining configurations. As for $D_{S^1} E_2$, we can use the classification of the genus-zero congruence subgroups \cite{Cummins2003} to check which configurations are modular. We find that the configurations $\mathcal{S}_9\cong(I_6, I_2, 2II)$ and $\mathcal{S}_{13}\cong (I_6, 3II)$ correspond to the congruence subgroups $6C^0$ and $6A^0$, respectively, in their notation. For the first configuration, for the values of the parameters listed in table~\ref{tab: E3 Configurations}, the $U$-plane is $\mathbb{Z}_2$ symmetric and we find that: \be U(\tau) = {i\over \sqrt{2}} \left( {\eta\left( {\tau \over 3}\right) \over \eta( \tau)} \right)^6~, \end{equation} which reproduces the completely replicable function of class 6c~\cite{alexander1992completely}. One can further check that the type-$II$ elliptic points correspond to $\tau_1 = 2+e^{2\pi i\over 3}$ and $\tau_2 = 5+e^{2\pi i\over 3}$, while the $I_2$ cusp sits at $\tau = 0$. Finally, for the $\mathbb{Z}_3$ symmetric configuration $(I_6, 3II)$ listed in table~\ref{tab: E3 Configurations}, the $J$-invariant is a quadratic polynomial in $w = U^3$ and the monodromy group on the $w$-plane will be the subgroup of square elements of ${\rm PSL}(2,\mathbb{Z})$, usually denoted by $\Gamma^2$. This has a cusp of width two and two elliptic points of order two, one of which is the `orbifold' point on the $w$-plane. Going back to the $U$-plane, the orbifold singularity will be resolved, and thus, $\Gamma^2$ can be viewed as a triple cover of the monodromy group on the $U$-plane. We draw fundamental domains for these configurations in figure~\ref{fig: E3 ModularConfigs}. \section{The non-toric $E_n$ theories -- 5d $SU(2)$, $3 \leq N_f\leq 7$}\label{sec:En} In this section, we discuss various configurations of singular fibers of rational elliptic surfaces that correspond to the non-toric $D_{S^1} E_n$ theories. An important subset that we will focus on here consists of the extremal rational elliptic surfaces, which we introduced in section~\ref{subsec:extremalRES}. \subsection{Massless curves and modularity} The Seiberg-Witten curves mirror to the non-toric local $dP_n$ geometries can be determined as limits of the $E$-string theory curve \cite{Ganor:1996pc, Eguchi:2002fc, Eguchi:2002nx}, and are usually expressed in terms of the $E_n$ characters, as we reviewed in section~\ref{subsec:Encurves}. The massless curves are obtained when the characters are set to the dimension of the corresponding $E_n$ representations. The modular properties of the curves for $n>4$ were discussed in \cite{Alim:2013eja}, while the periods for the $D_{S^1} E_n$ theories with $n>5$ have been explicitly computed in {\it e.g.} \cite{Lian:1994zv, Klemm:1994wn, Mohri:2001zz}. For completeness, we summarise some relevant results below. Additionally, we list the torsion sections and discuss the global form of the flavour symmetry, which confirms that the flavour group is the centerless ${\rm E}_n/Z({\rm E}_n)$, as anticipated in \eqref{flavour sym En}. We will also comment on the modular properties of these curves, which we anticipated in section~\ref{subsec:extremalRES}. In table~\ref{tab:Extremal2}, and more specifically in table~\ref{tab:introMod} in the introduction, we see the obvious pattern $\Gamma=\Gamma^0(9-n)$ for $E_n$, with $n=4$ being the important exception.% \footnote{Another exception is $n=8$: $\Gamma^0(1)= {\rm PSL}(2,\mathbb{Z})$ is indeed the monodromy group on the massless $E_8$ CB, but that CB configuration is not modular, as we will see.} The massless $E_4$ curve corresponds to the configuration $\mathcal{S}\cong (2I_5,2I_1)$ while, on the other hand, the congruence subgroup $\Gamma^0(5)$ has only two cusps% \footnote{More generally, the congruence subgroup $\Gamma^0(p)$ for prime $p$ has only two cusps. This also `explains' why $\Gamma^0(7)$ could not be a modular group for massless $E_2$.} and thus cannot be the correct modular group. By direct computation, we find that $U(\tau)$ is in fact a modular function for $\Gamma^1(5)$, in this case. Note, however, that $\overline{\Gamma}^0(n) = \overline{\Gamma}^1(n)$ for $n = 2,3,4,6$, where we use the $\overline{\Gamma}$ notation to emphasise that these are subgroups of ${\rm PSL}(2,\mathbb{Z})$ rather than the full ${\rm SL}(2,\mathbb{Z})$, and we can thus view the pattern $\Gamma_{E_n} = \Gamma^1(9-n)$ as valid for $n > 2$ instead.% \footnote{By a slight abuse of notation, we used $\Gamma(N), \Gamma^0(N), \cdots$ to denote the corresponding congruence subgroups of ${\rm PSL}(2,\mathbb{Z})$ instead of ${\rm SL}(2,\mathbb{Z})$.} \subsubsection{The massless $D_{S^1} E_4$ theory} The massless curve for the $D_{S^1} E_4$ theory is obtained from the mass-deformed curve by setting the characters to $\chi = \{5,10,5,10\}$. In our conventions, it reads: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} g_2(U) & = {1\over 12}\left( U^4 -40U^2 -120U - 80\right)~, \\ g_3(U) & = -{1\over 216}\left(U^6 -60U^4 - 180U^3 + 480U^2 + 2736 U + 3160\right)~, \eea with the discriminant: \be \Delta(U) = (U^2 - 5U - 25)(U+3)^5~, \end{equation} from which we see the $I_1, I_1, I_5$ singularities in the bulk, and the $I_5$ at infinity. \paragraph{Modular properties.} The PF equation \eqref{PF eq general} for this theory becomes: \be (U+3)(U^2-5U-25) {d^2\omega \over dU^2} + (3U^2 - 4U-40) {d\omega \over dU}+ U\omega = 0~, \end{equation} This differential equation has four singular points, and the solutions can be expressed in terms of the local Heun function \cite{Maier2006}. Here, we instead use the modular properties of the curve to analyse the light BPS states appearing in the massless theory. We first find that: \be U(\tau) = q^{-{1\ov5}} + 2 +10 q^{{1\ov5}} + 5 q^{{2\ov5}} - 15q^{{3\ov5}} - 24 q^{{4\ov5}} + \mathcal{O}(q) ~. \end{equation} This turns out the be the Hauptmodul for $\Gamma^1(5)$, given explicitly in \cite{Sebbar:2001}: \be U(\tau) = -3 + q^{-{1\ov5}}\prod_{n=1}^{\infty} \left(1-q^{{n\ov5}}\right)^{-5 \left( {n\over 5} \right)}~, \end{equation} where $\left({n\over 5}\right)$ denotes the Legendre symbol. It is convenient to rewrite the above expression in terms of the Hauptmodul of $\Gamma^0(5)$: \be f(\tau) = \left( {\eta\left({\tau\over 5}\right) \over \eta(\tau)} \right)^6~, \end{equation} as described in \cite{Sebbar:2001}. We find that, around the cusp at infinity, we have: \be U(\tau) = {1\over 2}\left( 5 + f(\tau) + \sqrt{125+f(\tau)(22+f(\tau))} \right)~. \end{equation} A fundamental domain for $\Gamma^1(5)$ is shown in figure~\ref{FunDomainE4massless}. \begin{figure}[t] \centering \scalebox{0.8}{\input{Gamma15.tikz}} \caption{Fundamental domain for $\Gamma^1(5)$, with $(I_1,I_1,I_5,I_5)$ cusps at $\tau = 0,{5\over 2}, 3$ and $i\infty$.} \label{FunDomainE4massless} \end{figure} \paragraph{BPS states and flavour group.} Using the fundamental domain in figure~\ref{FunDomainE4massless}, one finds the following BPS states: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \label{E4 BPS states} & \tau = 0 \; && (I_1) \; \;&&: \quad && \text{a monopole of charge $(1,0; 0)$~,}\cr & \tau = {5\over 2} \; && (I_1) \; \;&&:\quad && \text{a dyon of charge $(-2,5; 0)$~,}\cr & \tau = 3\; && (I_5) \; \;&&:\quad && \text{five dyons of charge $(1,-3; 1)$~,} \eea where $(m,q; l)$ includes $l\in \mathbb{Z}_5$, indicating thus the charge under the center of the flavour $SU(5)$. The corresponding BPS quiver is a 3-blocks quiver with 7 nodes: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{quiver E4} \begin{tikzpicture}[baseline=1mm] \node[] (1) []{$\mathcal{E}_{\gamma_1=(1,0)}$}; \node[] (2) [right = of 1]{$\mathcal{E}_{\gamma_{2}=(-2,5)}$}; \node[] (3) [below = of 1]{$\mathcal{E}_{\gamma_{3,4,5,6,7}=(1,-3)}$}; \draw[->>>>>-=0.5] (1) to (2); \draw[->-=0.3] (2) to (3); \draw[->>>-=0.5] (3) to (1); \end{tikzpicture} \eea This is a known quiver for $dP_4$ \cite{Wijnholt:2002qz}. Note that the D0-brane state corresponds to the ranks $(1;3;1)$ for the three blocks of this quiver. % The BPS states \eqref{E4 BPS states} are left invariant by $\mathscr{E}= \mathbb{Z}_5$ generated by: \be g^\mathscr{E}= \left( 0, {2\over 5}; 1\right)~, \end{equation} which confirms the global form of the flavour group, $G_F=PSU(5)$. \paragraph{Torsion sections.} Another way to see the global form of the flavour group is from the MW group. In our conventions, the sections of the extremal rational elliptic surface are: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} P_1 & = \left( {1\over 12}(U^2 - 8), U + 3 \right)~, \\ P_2 & = \left( {1\over 12}(U^2 + 12U + 28), -(U + 3)^2 \right)~, \\ P_3 & = \left( {1\over 12}(U^2 + 12U + 28), (U + 3)^2 \right)~, \\ P_4 & = \left( {1\over 12}(U^2 - 8), -(U + 3) \right)~, \eea with $ P_k + P_l = P_{k+l~(\text{mod}~5)}$. These sections intersect the $I_5$ fiber non-trivially, and thus the full $\Phi_{\rm tor} = \mathbb{Z}_5$ restricts the global form of the flavour symmetry, as expected. \subsubsection{The massless $D_{S^1} E_5$ theory} The other massless theories can be treated similarly. The massless $E_5$ curve is obtained by fixing the characters $\chi^{E_5} = \{ 10, 45, 16, 120, 16 \}$, which gives: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} g_2(U) & = {1\over 12}(U+4)^2 (U^2 - 8U -32)~, \\ g_3(U) & = -{1\over 216}(U+4)^3(U^3 - 12U^2 -24U + 224)~, \eea with the discriminant: \be \Delta(U) = (U+4)^7(U-12)~. \end{equation} This is the $(I_4, I_1^*, I_1)$ configuration of singular fibers. Note that this configuration is related to the one for the pure 4d $SU(2)$ theory by a quadratic twist. \paragraph{Picard-Fuchs equation and modularity.} The Picard-Fuchs equation \eqref{PF eq general} for the geometric periods $\omega = d\Pi/dU$ reduces to: \be (U+4)^2 (U-12) {d^2\omega \over dU^2} + (U+4)(3U-20) {d\omega \over dU} + U \omega = 0~. \end{equation} This is a hypergeometric differential equation, as can be easily seen by introducing $w = {U+4\over 16}$. A convenient basis of solutions for this is given by: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} & \omega_a = -{1\over 2\pi i}{1\over U+4}\prescript{}{2}{F}_1 \left( {1\over 2}, {1\over 2}; 1; {16\over U+4}\right)~, \\ & \omega_D = -{1\over \pi} {1\over U+4}\prescript{}{2}{F}_1 \left( {1\over 2}, {1\over 2}; 1; 1-{16\over U+4}\right)~, \eea where $\omega_D$ is chosen such that it reproduces the $T^4$ monodromy at infinity. Then, the monodromies around the other cusps read: \be \label{E5 massless monodromies} \mathbb{M}_{U=12} = STS^{-1}~, \qquad \mathbb{M}_{U=-4} = (T^{\pm 2}S)(-T)(T^{\pm 2}S)^{-1} ~, \end{equation} where, for $U=-4$, one needs to specify the base point. The above monodromies can also be found from the modular properties of the curve. Solving the equation $J = J(\tau)$, we find that: \be U(\tau) = 12 + \left( {\eta\left({\tau \over 4}\right) \over \eta(\tau)} \right)^8~, \end{equation} which is the Hauptmodul for $\Gamma^0(4)$. Using the properties of the $\eta$-function, one can show that the $(I_1, I_1^*)$ cusps at $\tau = 0$, $\pm 2$ correspond to the singularities at $U = 12$, $-4$, as expected. The fundamental domain consistent with these values is shown in figure~\ref{fig: FunDomain E5massless} below. \paragraph{Torsion sections and flavour group.} The discussion of the BPS states at the massless points of the $D_{S^1} E_n$ theories with $n>4$ is more subtle, and we postpone it to the next subsection, and to future work. We can still determine the flavour symmetry group from our general approach using the MW torsion. In this case, we an extremal RES with $\Phi =\mathbb{Z}_4$, as shown in table~\ref{tab:Extremal2}. The sections are given explicitly by: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} P_1 & = \left({1\over 12}(U+4)(U+8), (U+4)^2 \right)~, \\ P_2 & = \left({1\over 12}(U^2 - 16),0 \right)~, \\ P_3 & = \left({1\over 12}(U+4)(U+8), -(U+4)^2 \right)~, \eea with $P_k + P_l = P_{k+l~(\text{mod}~4)}$. They intersect non-trivially the $I_1^*$ fiber, and thus we can again argue that the flavour symmetry is given by $G_F = {\rm Spin}(10)/\mathbb{Z}_4$. \subsubsection{The massless $D_{S^1} E_6$ theory} The massless curve of the $D_{S^1} E_6$ theory takes the simple form: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} g_2(U) = {1\over 12}(U+6)^3 (U-18)~, \qquad g_3(U) = -{1\over 216}(U+6)^4(U^2-24U + 36)~, \eea with the discriminant: \be \Delta(U) = (U+6)^8(U-21)~. \end{equation} This corresponds to the configuration $(I_3, IV^*, I_1)$, which is an extremal RES with $\Phi = \mathbb{Z}_3$. \paragraph{Picard-Fuchs equation and modularity.} The PF equation \eqref{PF eq general} for the geometric periods reads: \be (U+6)^2 (U-21) {d^2\omega \over dU^2} + 3(U+6)(U-12) {d\omega \over dU} + U \omega = 0~, \end{equation} which is again a hypergeometric differential equation, similar to that of $D_{S^1} E_0$ on the $w = U^3$ plane. A a convenient basis of solutions is given by: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} & \omega_a = -{1\over 2\pi i}{1\over U+6}\prescript{}{2}{F}_1 \left( {1\over 3}, {2\over 3}; 1; {27\over U+6}\right)~, \\ & \omega_D = -{\sqrt{3}\over 2\pi} {1\over U+6}\prescript{}{2}{F}_1 \left( {1\over 3}, {2\over 3}; 1; 1-{27\over U+6}\right)~, \eea with $\omega_D$ chosen such that the monodromy at infinity is $T^3$. The monodromies around the other singularities are: \be \label{E7 massless Monodromies} \mathbb{M}_{U ={21}} = STS^{-1}~, \qquad \quad \mathbb{M}_{U=-6} = T^k(ST)^2T^{-k}~, \end{equation} for $k=-1$ or $k=2$, depending on the base point. These monodromies can be also recovered from the modular properties of the curve. We find that: \be U(\tau) = 21 + \left({\eta\left({\tau\over 3}\right) \over \eta(\tau)} \right)^{12}~, \end{equation} which is the Hauptmodul for $\Gamma^0(3)$. One can then easily show that $U(\tau = 0) =21$. Furthermore, it can be checked that $U(-1+\tau_*) = U(2+\tau_*) = -6$, with $\tau_* = e^{{2\pi i \over 3}}$, in agreement with the monodromies found from the geometric periods. \paragraph{Torsion sections and flavour group.} The SW geometry for the massless $D_{S^1} E_6$ theory is an extremal RES with $\Phi = \mathbb{Z}_3$. The sections read: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} P_1 = \left({1\over 12}(U+6)^2, (U+6)^2 \right)~, \qquad P_2 = \left({1\over 12}(U+6)^2, -(U+6)^2 \right)~, \eea with $P_1+P_2=O$. They intersect non-trivially the $IV^*$ singular fiber, and thus we argue that the global form of the flavour symmetry is $G_F = E_6/\mathbb{Z}_3$. \subsubsection{The massless $D_{S^1} E_7$ theory} The curve of the massless $D_{S^1} E_7$ theory is given by: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} g_2(U) = {1\over 12}(U+12)^3(U-36)~, \qquad g_3(U) = -{1\over 216}(U+12)^5(U-60)~, \eea with the discriminant: \be \Delta(U) = (U+12)^9(U-52)~. \end{equation} This corresponds to the extremal configuration $(I_2, III^*, I_1)$, which has $\Phi =\mathbb{Z}_2$. \medskip \paragraph{Picard-Fuchs equation and modularity.} The geometric periods satisfy the hypergeometric differential equation: \be (U+12)^2(U-52) {d^2\omega \over dU^2} + (U+12)(3U-92){d\omega \over dU} + U\omega = 0~, \end{equation} which is similar to that of the $\lambda = 1$ configuration for the $D_{S^1} E_1$ theory (on the $w = U^4$ plane of that theory). A convenient basis is given by: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} & \omega_a = -{1\over 2\pi i}{1\over U+12}\prescript{}{2}{F}_1 \left( {1\over 4}, {3\over 4}; 1; {64\over U+12}\right)~, \\ &\omega_D = -{1\over \sqrt{2}\pi} {1\over U+12}\prescript{}{2}{F}_1 \left( {1\over 4}, {3\over 4}; 1; 1-{64\over U+12}\right)~, \eea with $\omega_D$ chosen such that the monodromy at infinity is $T^2$. The monodromies around the other singularities are: \be \label{E7 massless Monodromies} \mathbb{M}_{U ={52}} = STS^{-1}~, \qquad \mathbb{M}_{U=-12} = T^kST^{-k}~, \end{equation} for $k = \pm 1$, depending on the base point. We can again show that these monodromies are consistent with the modular properties of the curve. We first find that: \be U(\tau) = 52 + \left( {\eta \left( {\tau \over 2}\right) \over \eta(\tau) }\right)^{24}~, \end{equation} which is the Hauptmodul for $\Gamma^0(2)$. This congruence subgroup only has two cusps of widths $1$ and $2$, respectively, and an elliptic point of order 2. One can check that $U(\tau = 0) = 52$ and, additionally, that $U(\pm 1+i) = -12$. Thus, the elliptic point of $\Gamma^0(2)$ is precisely the type-$III^*$ singularity of the massless $D_{S^1} E_7$ curve. \paragraph{Torsion sections and flavour group.} It is straightforwad to check that the non-trivial section of the massless $D_{S^1} E_7$ curve is: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} P_1 & = \left({1\over 12}(U+12)^2, 0 \right)~, \eea which spans a $\mathbb{Z}_2$ torsion group. It intersects non-trivially the type-$III^*$ singular fiber, and therefore the flavour symmetry group is $G_F = {\rm E}_7/\mathbb{Z}_2$. \subsubsection{The massless $D_{S^1} E_8$ theory} Finally, the massless curve for the $D_{S^1} E_8$ theory reads: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} g_2(U) & = {1\over 12}U^4~, \qquad g_3(U) & = -{1\over 216}(U-864)U^5~, \eea with the discriminant and $j$-invariant: \be \Delta(U) = (U-432)U^{10}~, \qquad j(U) = {U^2 \over (U-432)}~. \end{equation} The rational elliptic surface associated to this Seiberg-Witten curve is extremal, with the singular fibers $(2I_1, II^*)$ and no torsion. The geometric periods can be determined explicitly, as they again satisfy a hypergeometric differential equation: \be U^2(U-432) {d^2 \omega \over dU^2} + 3U (U-288){d\omega \over dU} + (U-60) \omega = 0~, \end{equation} which is similar to that of the $\mathbb{Z}_6$ symmetric configuration of the $D_{S^1} E_3$ theory. We choose the periods: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \omega_a = -{1\over 2\pi i}{1\over U}\prescript{}{2}{F}_1 \left( {1\over 6}, {5\over 6}; 1; {432\over U}\right)~, \qquad \omega_D = -{1\over 2\pi} {1\over U}\prescript{}{2}{F}_1 \left( {1\over 6}, {5\over 6}; 1; 1-{432\over U}\right)~, \eea with $\omega_D$ chosen such that the monodromy at infinity is $T$. The other monodromies read: \be \label{E8 massless Monodromies} \mathbb{M}_{U ={432}} = STS^{-1}~,\quad \qquad \mathbb{M}_{U=0} = T^k(ST)T^{-k}~, \end{equation} for $k = 0$ or $1$, depending on the base point. As for the modular properties, solving $J = J(\tau)$, the root corresponding to the cusp at $\tau = i\infty$ is given by: \be \label{E8MasslessHauptmodul} U(\tau) = 864 {E_4(\tau)^3 + E_4(\tau)^{{3\over 2}} E_6(\tau) \over E_4(\tau)^3 - E_6(\tau)^2}~, \end{equation} with its $S$-transformation: \be U(\tau_D) = 864 {E_4(\tau)^3 - E_4(\tau)^{{3\over 2}} E_6(\tau) \over E_4(\tau)^3 - E_6(\tau)^2}~. \end{equation} From the zeroes of the Eisenstein series $E_4$, it follows that the elliptic point of type $II^*$ corresponds to $\tau_* = e^{{2\pi i\ov3}}$ (or $e^{{\pi i\ov3}}$), in agreement with the monodromies found above. A fundamental domain can be chosen as in figure~\ref{FunDomainSU2Nf3IV}, by replacing $IV$ with $II^\ast$ (a quadratic twist relates that configuration $(I_1^*, IV, I_1)$ to the $(I_1, II^*, I_1)$ configuration of interest here). Note that the monodromies \eqref{E8 massless Monodromies} generate the full ${\rm PSL}(2,\mathbb{Z})$ while the fundamental domain for the CB configuration consists of two copies of the ${\rm PSL}(2,\mathbb{Z})$ fundamental domain, therefore the massless $D_{S^1} E_8$ CB is not a modular curve. This is consistent with the fact that the unique index $2$ subgroup of ${\rm PSL}(2,\mathbb{Z})$ only has one $I_2$ cusp \cite{Cummins2003, Sebbar:2001}. \subsection{Other configurations: modular curves and 5d BPS quivers} In the rest of this section, we discuss some other interesting CB configurations for the non-toric $D_{S^1} E_n$ theories. Let us start with some general comments on the Higgs branch enhancement as we vary the parameters, using the 5d gauge-theory intuition as a guide, in analogy with the 4d gauge theory analysis \cite{Seiberg:1994aj, Argyres:1995xn}. We begin by setting the 5d hypermultiplet mass parameters equal, $M_i = M$. This can be done explicitly by working out the map between the characters of $E_n$ and the gauge theory parameters $(\lambda, M_i)$, as discussed in appendix \ref{app:Enchar}. In this equal-mass setting and for generic values of the `5d gauge coupling' $\lambda$, $N_f = n-1$ of the $I_1$ cusps will merge together into an $I_{N_f}$ singularity. The corresponding Higgs branch is the one associated classically with $N_f$ massive fundamental hypermultiplets of $SU(2)$. The flavour symmetry of these theories will thus be $\frak{su}(N_f)$. As the mass is turned off, {\it i.e.} for $M \rightarrow 1$ with $\lambda \neq 1$, this enhances to $\frak{so}(2N_f)$ -- see table~\ref{tab:En NonToricConfigurations}. \begin{table}[t] \begin{center} \renewcommand{\arraystretch}{1} \begin{tabular}{ |c||c|c|c|c|c|} \hline \textit{Theory} & \textit{Generic} & $M_i = M,~ \lambda\neq 1$ & $M_i = 1,~ \lambda\neq 1$ & $M_i = M,~ \lambda = 1$ & $M_i = 1,~ \lambda=1 $ \\ \hline \hline $D_{S^1} E_4$ & $7I_1$ & $4I_1, I_3$ & $3I_1, I_4$ & $2I_1, I_2, I_3$ & $2I_1, I_5$ \\ \hline $D_{S^1} E_5$ & $8I_1$ & $4I_1, I_4$ & $2I_1, I_0^*$ & $2I_1, I_2, I_4$ & $I_1, I_1^*$ \\ \hline $D_{S^1} E_6$ & $9I_1$ & $4I_1, I_5$ & $2I_1, I_1^*$ & $2I_1, I_2, I_5$ & $I_1, IV^*$ \\ \hline $D_{S^1} E_7$ & $10I_1$ & $4I_1, I_6$ & $2I_1, I_2^*$ & $2I_1, I_2, I_6$ & $I_1, III^*$ \\ \hline $D_{S^1} E_8$ & $11I_1$ & $4I_1, I_7$ & $2I_1, I_3^*$ & $2I_1, I_2, I_7$ & $I_1, II^*$ \\ \hline \end{tabular} \end{center} \caption{Some $M_i=M$ configurations for the $D_{S^1} E_n$ theories. Only the singularities in the interior of the $U$-plane are indicated.} \label{tab:En NonToricConfigurations} \end{table} One can instead set $\lambda = 1$ first, in which case the $U$-plane singularities are $(2I_1, I_2, I_{N_f})$. In the large-mass limit ($M \gg 1$ or $M \ll 1$), the $(2I_1, I_2)$ cusps can be viewed as the bulk singularities of the `massless' $D_{S^1} E_1$ theory, with the BPS states becoming massless at the various cusps listed in \eqref{E1 BPS states}. Then, as $M\rightarrow 1$, the Higgs branch of the $D_{S^1} E_n$ theories changes as follows. For the $D_{S^1} E_4$ theory, the $I_{N_f = 3}$ and the $I_2$ fibers merge, forming an $I_5$ singular fiber. For the other cases ($D_{S^1} E_{n>4}$), the $I_{N_f = n-1}$ and the $I_2$ singularity also merge with an $I_1$ singularity, leading to the massless configurations. We note that this discussion exactly parallels the F-theory analysis of the combinations of 7-branes needed to produce the $E_n$ 7-brane \cite{Sen:1996vd, Dasgupta:1996ij, Gaberdiel:1997ud}, which is of course no coincidence. For $n=6,7, 8$, in the fully massless limit $M=\lambda=1$, the `elliptic' singularities $IV^*$, $III^*$ and $II^*$, respectively, that appear on the $U$-plane have a low-energy description in terms of the 4d MN theories \cite{Ganor:1996pc}, as we reviewed in section~\ref{subsec:Encurves}. It is worth remarking that this embedding of the 4d MN theories into the $U$-plane is qualitatively different from the way the AD points often appear (either on 4d $u$-planes or on the $U$-plane). In the latter case, the AD fixed points correspond to points where singularities merge without affecting flavour symmetry algebra nor the Higgs branch. On the other hand, at these $E_n$ MN singularities, the flavour algebra enhances and the Higgs branch dimension increases dramatically -- see {\it e.g.} \cite{Cremonesi:2015lsa} for a discussion of the corresponding five-dimensional physics. \subsubsection{$D_{S^1} E_4$ configurations} Persson's list for the allowed configurations of singular fibers \cite{Persson:1990} contains $26$ configurations with an $I_5$ fiber, which should all be achievable on the extended Coulomb branch of the $D_{S^1} E_4$ theory. The only configuration with non-trivial torsion turns out to be the massless one. Let us briefly comment on some of these configurations which show interesting symmetries or modular properties. One such configuration is obtained by setting all the $E_4$ characters to zero. This is the $(I_5, 2I_1, II)$ configuration, with ${\rm rk}(\Phi) = 4$, with the $U$-plane showing a $\mathbb{Z}_5$ symmetry. The geometric periods $\widetilde\omega = \theta_U\Pi$ can be solved in closed form on the $w = U^5$ plane and are similar to those of the massless $E_8$ configuration. Another non-trivial configuration is the $(I_5, 3I_1, IV)$ configuration, which occurs for $(M_i)= (1, e^{i\pi\ov3}, e^{-{i\pi\ov3}})$. In this case the masses are not equal, and thus merging singularities correspond to non-local BPS states becoming massless at the same point. Based on the classification of genus-zero congruence subgroups~\cite{Cummins2003}, we can also list all $D_{S^1} E_4$ configurations for which the monodromy group is a congruence subgroup. These are given below: \be \label{E4 Configurations} \renewcommand{\arraystretch}{1.2} \begin{tabular}{ |c||c|c|c|c|} \hline $\{ F_v \}$ & ${\rm rk}(\Phi)$ & $\Phi_{\rm tor}$ & $\mathfrak{g}_F$ & $\Gamma\in {\rm PSL}(2,\mathbb{Z})$ \\ \hline \hline $2I_5, 2I_1$ & $0$ & $\mathbb{Z}_5$& $A_4$ & $\Gamma^1(5)$ \\ \hline $I_5, I_1, 2III$ & $2$ & $-$ & $2A_1$ & $\Gamma^0(5)$ \\ \hline $I_5, III, 2II$ & $3$ & $-$ & $A_1$ & $5A^0$ \\ \hline \end{tabular} \end{equation} where $5A^0$ is an index $5$ congruence subgroup, with only one cusp of width $5$. We leave a detailed study of the corresponding $U$-planes for future work. \subsubsection{$D_{S^1} E_5$ configurations} For the $D_{S^1} E_5$ theory there are $51$ allowed configurations, some of which already appear in table~\ref{tab:En NonToricConfigurations}. Consider first the case where all characters vanish, leading to the generic configuration $(I_4, 8I_1)$, but with a $\mathbb{Z}_4$ symmetry on the $U$-plane. In fact, tuning to an odd looking value, $\chi_2 = 37 + 24\sqrt{3}$, we find that the $U$-plane is $\mathbb{Z}_8$ symmetric instead. As before, we can also list all the $D_{S^1} E_5$ configurations for which the monodromy group is a congruence subgroup: \be \label{E5 Configurations} \renewcommand{\arraystretch}{1.2} \begin{tabular}{ |c||c|c|c|c|} \hline $\{ F_v \}$ & ${\rm rk}(\Phi)$ & $\Phi_{\rm tor}$& $\mathfrak{g}_F$ & $\Gamma\in {\rm PSL}(2,\mathbb{Z})$ \\ \hline \hline $I_4, I_1^*, I_1$ & $0$ & $\mathbb{Z}_4$ & $D_5$ & $\Gamma^0(4)$ \\ \hline $2I_4, 2I_2$ & $0$ & $\mathbb{Z}_4\times \mathbb{Z}_2$ & $A_3\oplus 2A_1$ & $\Gamma^0(4)\cap \Gamma(2)$ \\ \hline $I_4, I_0^*, 2I_1$ & $1$ & $\mathbb{Z}_2$ & $D_4$ & $\Gamma^0(4)$ \\ \hline $2I_4, 2II$ & $2$ & $-$ & $A_3$ &$4D^0$ \\ \hline $I_4, 2III, I_2$ & $2$ & $\mathbb{Z}_2$ & $3A_1$ &$4C^0$ \\ \hline $I_4, 2III, II$ & $3$ & $-$ & $2A_1$ &$4A^0$ \\ \hline \end{tabular} \end{equation} where $4D^0$, $4C^0$ and $4A^0$ are congruence subgroups of index $8$, $6$ and $4$, respectively. As pointed out in table~\ref{tab:Extremal2}, there is another rational elliptic surface associated to a configuration of the $U$-plane that is extremal other than the massless one, namely the $(2I_4, 2I_2)$ configuration. This can be obtained by setting $\chi_1 = -2$, $\chi_2 = -3$, $\chi_4 = 8$, with the other characters set to zero. In this case, we find: \be U(\tau) = \left( {\eta\left({\tau \over 2}\right) \over \eta(2\tau)} \right)^4 ~ \xrightarrow[]{\quad T \quad} \quad - {i\eta(\tau)^{12} \over \eta(2\tau)^8 \eta\left({\tau \over 2}\right)^4}~, \end{equation} which is the Hauptmodul for $\Gamma^0(4) \cap \Gamma(2)$ \cite{Sebbar:2001}. From the corresponding fundamental domain shown in figure~\ref{fig: E5 Configurations}, we read off the following BPS states: \be\label{a config for dP5} I_2:~ 2\; (1,0; 1,0,0)~, \quad I_4:~4 \; (-1,1; 0,1,0)~, \quad I_2:~ 2\; (1,-2;0,0,1)~, \end{equation} where we also indicated charges under the $\mathbb{Z}_2\times \mathbb{Z}_4\times \mathbb{Z}_2$ center of the flavour group. The corresponding 3-blocks 5d BPS quiver reads: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{quiver E5 orbi} \begin{tikzpicture}[baseline=1mm] \node[] (1) []{$\mathcal{E}_{\gamma_{1,2}=(1,0)}$}; \node[] (2) [right = of 1]{$\mathcal{E}_{\gamma_{3,4,5,6}=(-1,1)}$}; \node[] (3) [below = of 1]{$\mathcal{E}_{\gamma_{7,8}=(1,-2)}$}; \draw[->-=0.5] (1) to (2); \draw[->-=0.3] (2) to (3); \draw[->>-=0.5] (3) to (1); \end{tikzpicture} \eea This is a known quiver for local $dP_5$ -- in fact, this is also a quiver for a particular degenerate toric limit of local $dP_5$ into an orbifold of the conifold, see {\it e.g.} `Model 4d' in \cite{Hanany:2012hi}. From the fractional-brane basis \eqref{a config for dP5}, we can also compute the global form of the flavour group in this extremal configuration. The BPS states are left invariant by a $\mathbb{Z}_4\times \mathbb{Z}_2$ generated by: \be\label{action Z4Z2 expl} g^\mathscr{E}_{\mathbb{Z}_4} = \left({1\over 2}, {1\over 4}; 1,1,0\right)~, \qquad g^\mathscr{E}_{\mathbb{Z}_2} = \left({1\over 2}, {1\over 2}; 1,0,1\right)~. \end{equation} From this perspective, we find the flavour group: \be G_F= {SU(2) \times SU(4)\times SU(2)\big/ \mathbb{Z}_4\times \mathbb{Z}_2}~, \end{equation} with the non-trivial quotient determined from \eqref{action Z4Z2 expl}. This also agrees with a direct analysis of the sections in the MW group $\Phi= \mathbb{Z}_4\times \mathbb{Z}_2$. Note that, unlike other examples for the massless theories, this flavour group is semi-simple but with a non-trivial center, $Z(G_F)=\mathbb{Z}_2$. \begin{figure}[t] \centering \begin{subfigure}{0.5\textwidth} \centering \scalebox{0.7}{\input{GammaE5-2I2-2I4.tikz}} \caption{$(2I_4, 2I_2)$} \label{fig: FunDomain 2I4-2I2} \end{subfigure}% \begin{subfigure}{0.5\textwidth} \centering \scalebox{0.7}{\input{GammaE5massless.tikz}} \caption{$(I_4, I_1, I_1^*)$} \label{fig: FunDomain E5massless} \end{subfigure} \caption{Fundamental domains for configurations on the CB of $D_{S^1} E_5$.} \label{fig: E5 Configurations} \end{figure} This extremal configuration can be also used to understand the BPS spectrum of the massless theory, as follows. Recall that, setting $M_i = M$ and $\lambda = 1$, we obtain the $(2I_4, I_2, 2I_1)$ configuration. By further setting $M_i = e^{\pm i\pi/2}$, we recover the above $(2I_4, 2I_2)$ configuration. Thus, we can obtain the massless limit by `breaking' one of the $I_2$ fibers and merging the $I_1$, $I_2$ and $I_4$ fibers into an $I_1^*$ singularity -- this can also be understood as an embedding of $A_3 \oplus A_1 \oplus \frak{u}(1)$ inside $D_5$. In terms of the monodromies associated to these massless BPS states, this is: \be \mathbb{M}_{I_1^*} = \mathbb{M}_{(1,0)} \mathbb{M}_{(-1,1)}^4 \mathbb{M}_{(1,-2)}^2 = \left( \begin{matrix} 1 & -4 \\ 1 & -3 \end{matrix} \right)= (T^2S)(-T)(T^2S)^{-1}~, \end{equation} which agrees with the $I_1^*$ monodromy determined directly from the periods in \eqref{E5 massless monodromies}. The fundamental domains for these two configurations are shown in figure~\ref{fig: E5 Configurations}. There are multiple other $D_{S^1} E_5$ configurations for which we can find closed form expressions for the periods. One such example is the $(I_4, 4I_2)$ configuration, which can be obtained for $\chi_2 = -3$, with the other characters vanishing. In terms of the gauge theory parameters, the configuration is obtained by setting $M_1 = M_2 = e^{\pi i/4}$, $M_3=M_4 = e^{3\pi i/4}$, and thus two of the $I_2$ cusps correspond to two semi-classical `flavour' cusps. Additionally, we also set $\lambda = 1$, which results into pairing the remaining singularities. In this case, the $U$-plane is $\mathbb{Z}_4$ symmetric and, the monodromy group on the $w = U^4$ plane is $\Gamma_0(2)$. A similar analysis as that for $\lambda = 1$ for $E_1$ leads to the orbifold monodromy: \be \mathbb{M}_{\rm orb} = (ST^{\pm \epsilon})S(ST^{\pm \epsilon})^{-1}~, \end{equation} with $\epsilon = \pm 1$. Since $\mathbb{M}_{\rm orb}^4 = \mathbb{I}$, this can then be used to determine the $U$-plane monodromies, leading to the BPS states $ \pm (1,0)$ and $ \pm(1,-1)$, with two identical states becoming massless at each of the $I_2$ cusps. The corresponding 5d BPS quiver is a 8-nodes, 4-blocks quiver: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \begin{tikzpicture}[baseline=1mm] \node[] (1) []{$\mathcal{E}_{\gamma_{1,2}=(1,0)}$}; \node[] (2) [right = of 1]{$\mathcal{E}_{\gamma_{3,4}=(-1,1)}$}; \node[] (3) [below = of 2]{$\mathcal{E}_{\gamma_{5,6}=(-1,0)}$}; \node[] (4) [below = of 1]{$\mathcal{E}_{\gamma_{7,8}=(1,-1)}$}; \draw[->-=0.5] (1) to (2); \draw[->-=0.3] (2) to (3); \draw[->-=0.5] (3) to (4); \draw[->-=0.3] (4) to (1); \end{tikzpicture} \eea This is also a known quiver for $dP_5$ and for its toric limit \cite{Wijnholt:2002qz,Hanany:2012hi}. We can also check that the flavour group acting effectively on the BPS spectrum takes the form $G_F= U(1)\times SU(2)^4\big/ \mathbb{Z}_2^2$, in agreement with the MW group $\Phi\cong \mathbb{Z}\oplus \mathbb{Z}_2^2$. \subsubsection{$D_{S^1} E_6$ configurations} For the $D_{S^1} E_6$ theory, there are $77$ allowed configurations, three of which are extremal. Let us list the cases corresponding to rational elliptic surfaces associated to congruence subgroups, in the notation of \cite{Cummins2003}: \be \label{E6 Configurations} \renewcommand{\arraystretch}{1.2} \begin{tabular}{ |c||c|c|c|c|} \hline $\{ F_v \}$ & ${\rm rk}(\Phi)$ & $\Phi_{\rm tor}$ & $\mathfrak{g}_F$ & $\Gamma\in {\rm PSL}(2,\mathbb{Z})$ \\ \hline \hline $I_3, I_1, IV^*$ & $0$ & $\mathbb{Z}_3$ & $E_6$ & $\Gamma^0(3)$ \\ \hline $4I_3$ & $0$ & $\mathbb{Z}_3\times \mathbb{Z}_3$ & $3A_2$ & $\Gamma(3)$ \\ \hline $I_3, I_6, I_2, I_1$ & $0$ & $\mathbb{Z}_6$ & $A_5\oplus A_1$ & $\Gamma^0(3)\cap \Gamma_0(2)$ \\ \hline $I_3, I_1^*, II$ & $1$ & $-$ & $D_5$ & $\Gamma^0(3)$ \\ \hline $I_3, I_0^*, I_1, II$ & $2$ & $-$ & $D_4$ & $\Gamma^0(3)$ \\ \hline $2I_3, 2III$ & $2$ & $-$ & $A_2\oplus 2A_1$ & $3C^0$ \\ \hline $I_3, 3III$ & $3$ & $-$ & $3A_1$ & $\Gamma^3$ \\ \hline \end{tabular} \end{equation} We have already discussed the massless configuration $(I_3, IV^*, I_1)$ in the previous section, so let us discuss the other two extremal cases. The first one is $(4I_3)$, which can be obtained for $\chi_3 = -3$, $\chi_4 = 9$, with the other characters set to zero. Note that this configuration can only appear on the Coulomb branch of the $D_{S^1} E_6$ theory. We find that: \be U(\tau) = 3 + \left( {\eta \left( {\tau\over 3}\right) \over \eta(3\tau)} \right)^3~, \end{equation} which is the Hauptmodul for $\Gamma(3)$. The map between the $U$-plane and the $\tau$-plane can be found easily, as the above Hauptmodul only changes by an overall factor of $e^{-2\pi i/3}$ upon $T$ transformations. To obtain a quiver description, let us first determine the periods on the $w = U^3$ plane, where the monodromy group is $\Gamma_0(3)$, with the orbifold monodromy: \be \mathbb{M}_{\rm orb} = (ST^k)(ST)^2(ST^k)^{-1}~, \end{equation} with $k=-1$ or $2$, depending on the base point. Then, by our usual trick, the BPS states associated to the $I_3$ cusps become $(1,0)$, $(-2,1)$ and $(1,-1)$, each of multiplicity $3$. The corresponding quiver is variously known as the $T_3$ quiver or as the $\mathbb{C}^3/(\mathbb{Z}_3\times \mathbb{Z}_3)$ quiver, this orbifold being a degenerate limit of the local $dP_6$: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{quiver E6 orbi} \begin{tikzpicture}[baseline=1mm] \node[] (1) []{$\mathcal{E}_{\gamma_{1,2,3}=(1,0)}$}; \node[] (2) [right = of 1]{$\mathcal{E}_{\gamma_{4,5,6}=(-2,1)}$}; \node[] (3) [below = of 1]{$\mathcal{E}_{\gamma_{7,8,9}=(1,-1)}$}; \draw[->-=0.5] (1) to (2); \draw[->-=0.3] (2) to (3); \draw[->-=0.5] (3) to (1); \end{tikzpicture} \eea We can analyse the BPS states and the MW torsion section, as in other examples, to conclude that the flavour group of this configuration is $SU(3)^3/\mathbb{Z}_3^2$. The other extremal configuration is $(I_3, I_6, I_2, I_1)$, which can be obtained by setting the characters $\chi^{E_6}$ to $\{ 3,-9,-2,-35,-9,3\}$, for instance. In this case, we have: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} U(\tau) = 6 + {\eta\left( {\tau\over 3}\right)^5 \eta(\tau) \over \eta\left( {2\tau\over 3}\right) \eta\left( 2\tau\right)^5}~. \eea This is the Hauptmodul for $\Gamma^0(3) \cap \Gamma_0(2)$, which is a congruence subgroup conjugate to $\Gamma^0(6)$. This is consistent with the fact that this configuration is also the massless $D_{S^1} E_3$ configuration. The $(I_2, I_6, I_1)$ cusps will then be at $\tau = 0$, $1$ and ${3\over 2}$, respectively, with the BPS states becoming massless at these singularities being: \be \mathscr{S}\; :\quad I_2:~ 2(1,0)~, \qquad I_6:~ 6(-1,1)~, \qquad I_1:~(2,-3)~. \end{equation} The corresponding 5d BPS quiver: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{quiver E6 B} \begin{tikzpicture}[baseline=1mm] \node[] (1) []{$\mathcal{E}_{\gamma_{1,2}=(1,0)}$}; \node[] (2) [right = of 1]{$\mathcal{E}_{\gamma_{3,4,5,6,7,8}=(-1,1)}$}; \node[] (3) [below = of 1]{$\mathcal{E}_{\gamma_{9}=(2,-3)}$}; \draw[->-=0.5] (1) to (2); \draw[->-=0.3] (2) to (3); \draw[->>>-=0.5] (3) to (1); \end{tikzpicture} \eea is of course another $dP_6$ quiver, which can be obtained from \eqref{quiver E6 orbi} by a series of quiver mutations. Here the D0-brane representation has quiver rank $(1;1;2)$. The flavour symmetry group of this configuration is $SU(6)\times SU(2)/\mathbb{Z}_6$, by our usual arguments. Furthermore, we can use the light BPS states of this configuraiton to understand how the $IV^*$ singularity appears in the massless limit, similarly to the previous examples. For instance, one can fuse the $I_6$ with two other mutually non-local particles, to obtain the monodromy: \be \mathbb{M}_{(1,0)}\mathbb{M}_{(-1,1)}^6 \mathbb{M}_{(2,-3)} = T^2(ST)^2 T^{-2}~, \end{equation} which is precisely the one around the $IV^*$ singularity found from the periods in \eqref{E7 massless Monodromies}. This can be understood as an embedding of $A_5 \oplus 2\frak{u}(1)$ inside $E_6$. Incidentally, this gives a first principle derivation of a BPS quiver for the four-dimensional $E_6$ MN theory (although not of the superpotential) \cite{Alim:2011kw} -- according to this particular realisation of the type-$IV^\ast$ singularity, the BPS quiver of the 4d MN theory can be simply obtained from \eqref{quiver E6 B} by removing the node corresponding to the dyon $\gamma_1=(1,0)$. Another $D_{S^1} E_6$ configuration that is modular is the $(I_3,3III)$ configuration, obtained for $\chi_3 = 78$, $\chi_4 = -1935$ and $\chi_{i\neq 3, 4} = 0$ for the other characters. In this case the $J$-invariant is simply given by: \be j(U) = U^3~, \end{equation} and thus $U^3$ is a modular function for ${\rm PSL}(2,\mathbb{Z})$ itself. As a result, $U(\tau)$ will be a modular function for $\Gamma^3$, which is the subgroup generated by the cubes of the elements of ${\rm PSL}(2,\mathbb{Z})$. Let us finally mention the configuration $(I_3, 6I_1, III)$ which is obtained for $\chi_i = 0$. In this case the $U$-plane is $\mathbb{Z}_3$ symmetric and the periods can be determined explicitly on the $w=U^3$ plane. \medskip \subsubsection{$D_{S^1} E_7$ configurations} For the $D_{S^1} E_7$ theory, Persson's classification contains $140$ allowed configurations, five of which are extremal. Based on \cite{Cummins2003}, the following cases are modular for a congruence subgroup: \be \label{E7 Configurations} \renewcommand{\arraystretch}{1.2} \begin{tabular}{ |c||c|c|c|c|} \hline $\{ F_v \}$ & ${\rm rk}(\Phi)$ & $\Phi_{\rm tor}$ & $\mathfrak{g}_F$ & $\Gamma\in {\rm PSL}(2,\mathbb{Z})$ \\ \hline \hline $I_2, I_1, III^*$ & $0$ & $\mathbb{Z}_2$ & $E_7$ & $\Gamma^0(2)$ \\ \hline $2I_2, I_2^*$ & $0$ & $\mathbb{Z}_2\times \mathbb{Z}_2$ & $D_6\oplus A_1$ & $\Gamma(2)$ \\ \hline $I_2, I_8, 2I_1$ & $0$ & $\mathbb{Z}_4$ & $A_7$ & $\Gamma^0(2) \cap \Gamma_0(4)$ \\ \hline $I_2, I_6, I_3, I_1$ & $0$ & $\mathbb{Z}_6$ & $A_5 \oplus A_2$ & $\Gamma^0(2) \cap \Gamma_0(3)$ \\ \hline $2I_2, 2I_4$ & $0$ & $\mathbb{Z}_4 \times \mathbb{Z}_2$ & $2A_3 \oplus A_1$ & $\Gamma_0(4) \cap \Gamma(2)$ \\ \hline $I_2, I_1^*, III$ & $1$ & $\mathbb{Z}_2$ & $D_5\oplus A_1$ & $\Gamma^0(2)$ \\ \hline $I_2, IV^*, II$ & $1$ & $-$ & $E_6$ & $\Gamma^2$ \\ \hline $3I_2, I_0^*$ & $1$ & $\mathbb{Z}_2 \times \mathbb{Z}_2$ & $D_4 \oplus 2A_1$ & $\Gamma(2)$ \\ \hline $I_2, I_0^*, III, I_1$ & $2$ & $\mathbb{Z}_2$ & $D_4\oplus A_1$ & $\Gamma^0(2)$ \\ \hline $I_2, I_4, 2III$ & $2$ & $\mathbb{Z}_2$ & $A_3 \oplus 2A_1$ & $4C^0$ \\ \hline $I_2, I_6, 2II$ & $2$ & $-$ & $A_5$ & $6C^0$ \\ \hline $I_2, I_0^*,2II$ & $3$ & $-$ & $D_4$ & $\Gamma^2$ \\ \hline \end{tabular} \end{equation} The first configuration is the massless configuration, which we have already discussed in the previous subsection. Additionally, this is related to the $(I_2,I_1^*,III)$ configuration by a quadratic twist, and thus the two have the same $J$-invariant. The $(2I_2, I_2^*)$ configuration is also the configuration of the massless 4d $SU(2)$ $N_f=2$ theory, discussed in section \ref{sec:4dtheories}. This can be achieved for $\chi^{E_7} = \{5,-59,-16,-330,-144,3,8\}$, leading to: \be U(\tau) = 12 + \left( {\eta\left( {\tau \over 2} \right) \over \eta(2\tau)} \right)^8~, \end{equation} which is the Hauptmodul for $\Gamma(2)$. Note that this subgroup is conjugate to $\Gamma^0(4)$. Let us also discuss the $(2I_2, 2I_4)$ configuration, which also appeared on the CB of the $D_{S^1} E_5$ theory. Here, this can be obtained for instance for $\chi_1 = -3$, $\chi_2 = 5$, $\chi_4 = -10$ and $\chi_6 = 3$, with the other characters set to zero. We find that: \be U(\tau) = { \eta(2\tau)^{12} \over {\eta(4\tau)^8 \eta (\tau)^4} }~, \end{equation} which is the Hauptmodul for $\Gamma_0(4) \cap \Gamma(2)$, as outlined in \cite{Sebbar:2001}. Using the properties of the $\eta$-function, we find that the $(I_4, I_4, I_2)$ cusps correspond to $\tau = 0$, $1$ and ${1\over 2}$, respectively, leading to the BPS states: \be \mathscr{S}\; : I_4:~ 4(1,0)~, \qquad I_2:~ 2(-2,1)~, \qquad I_4:~ 4(1,-1)~. \end{equation} This gives a $3$-blocks BPS quiver: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{quiver E7A} \begin{tikzpicture}[baseline=1mm] \node[] (1) []{$\mathcal{E}_{\gamma_{1,2,3,4}=(1,0)}$}; \node[] (2) [right = of 1]{$\mathcal{E}_{\gamma_{5,6}=(-2,1)}$}; \node[] (3) [below = of 1]{$\mathcal{E}_{\gamma_{7,8,9,10}=(1,-1)}$}; \draw[->-=0.5] (1) to (2); \draw[->-=0.3] (2) to (3); \draw[->-=0.5] (3) to (1); \end{tikzpicture} \eea This is a known $dP_7$ quiver \cite{Wijnholt:2002qz}, with the D0-brane representation having rank $(1; 2; 1)$. The details of the flavour symmetry group can be worked out as in other examples. Starting from this configuration, the massless configuration $(I_2, I_1, III^*)$ can be obtained by the recombination: \be \mathbb{M}_{(1,0)}^3 \mathbb{M}_{(-2,1)}^2 \mathbb{M}_{(1,-1)}^4 = TST^{-1}~, \end{equation} which indeed is the monodromy around the type-$III^*$ singularity as determined in \eqref{E7 massless Monodromies}. This can be viewed as an embedding of $A_2 \oplus A_1 \oplus A_3 $ inside $E_7$. Note that this also gives us a BPS quiver for the 4d $E_7$ MN theory, simply by removing node $\gamma_1=(1,0)$ in \eqref{quiver E7A}. \medskip \noindent Let us also briefly comment on the $(I_2, IV^*, II)$ configuration. It turns out that in this case the $J$ invariant is a degree $2$ polynomial in $U$, and thus the monodromy group is $\Gamma^2$, {\it i.e.} the subgroup containing the squares of the elements of ${\rm PSL}(2,\mathbb{Z})$. A fundamental domain can be easily drawn for this subgroup, with the coset representatives $\{\mathbb{I}, T \}$. In this case, the order-$2$ elliptic points will be at $\tau = e^{\pi i\ov3}$ and $e^{2\pi i\ov3}$. \medskip \subsubsection{$D_{S^1} E_8$ configurations} Finally, for the $D_{S^1} E_8$ theory, there are $227$ allowed configurations in Persson's classification, nine of which are extremal. Based on \cite{Cummins2003}, the configurations that are modular for a congruence subgroup are shown in table~\ref{tab: E8 Configurations}. % \begin{table}[] \centering \renewcommand{\arraystretch}{1.2} \begin{tabular}{ |c||c|c|c|c|} \hline $\{ F_v \}$ & ${\rm rk}(\Phi)$ & $\Phi_{\rm tor}$ & $\mathfrak{g}_F$ & $\Gamma\in {\rm PSL}(2,\mathbb{Z})$ \\ \hline \hline $I_1,I_2, III^*$ & $0$ & $\mathbb{Z}_2$ & $E_7\oplus A_1$ & $\Gamma_0(2)$ \\ \hline $I_1, I_3, IV^*$ & $0$ & $\mathbb{Z}_3$ & $E_6\oplus A_2$ & $\Gamma_0(3)$ \\ \hline $2I_1, I_4^*$ & $0$ & $\mathbb{Z}_2$ & $D_8$ & $\Gamma_0(4) $ \\ \hline $I_1, I_4, I_1^*$ & $0$ & $\mathbb{Z}_4$ & $D_5\oplus A_3$ & $\Gamma_0(4) $ \\ \hline $2I_1, 2I_5$ & $0$ & $\mathbb{Z}_5$ & $A_4\oplus A_4$ & $\Gamma_1(5)$ \\ \hline $I_1, I_6, I_3, I_2$ & $0$ & $\mathbb{Z}_6$ & $A_5 \oplus A_2 \oplus A_1$ & $\Gamma_0(6)$ \\ \hline $2I_1, I_8, I_2$ & $0$ & $\mathbb{Z}_4$ & $A_7 \oplus A_1$ & $\Gamma_0(8)$ \\ \hline $3I_1, I_9$ & $0$ & $\mathbb{Z}_3$ & $A_8$ & $\Gamma_0(9)$ \\ \hline $I_1, III^*, II$ & $1$ & $-$ & $E_7$ & $PLS(2,\mathbb{Z})$ \\ \hline $I_1, III, IV^*$ & $1$ & $-$ & $E_6\oplus A_1$ & $PLS(2,\mathbb{Z})$ \\ \hline $I_1, I_2^*, III$ & $1$ & $\mathbb{Z}_2$ & $D_6 \oplus A_1$ & $\Gamma_0(2)$ \\ \hline $I_1, I_3^*, II$ & $1$ & $-$ & $D_7$ & $\Gamma_0(3)$ \\ \hline $2I_1, I_0^*, I_4$ & $1$ & $\mathbb{Z}_2$ & $D_4 \oplus 2A_1$ & $\Gamma_0(4)$ \\ \hline $I_1, I_0^*, III, I_2$ & $2$ & $\mathbb{Z}_2$ & $D_4 \oplus 2A_1$ & $\Gamma_0(2)$ \\ \hline $I_1, I_0^*, I_3, II$ & $2$ & $-$ & $D_4 \oplus A_2$ & $\Gamma_0(3)$ \\ \hline $I_1, I_5, 2III$ & $2$ & $-$ & $A_4 \oplus 2A_1$ & $\Gamma_0(5)$ \\ \hline $I_1, I_7, 2II$ & $2$ & $-$ & $A_6$ & $\Gamma_0(7)$ \\ \hline $I_1, I_0^*, III, II$ & $3$ & $-$ & $D_4 \oplus A_1$ & $PSL(2,\mathbb{Z})$ \\ \hline \end{tabular} \caption{Configurations on the Coulomb branch of the $D_{S^1} E_8$ theory that are modular with respect to a congruence subgroup. The flavour algebra excludes the abelian $\frak{u}(1)$ factors.} \label{tab: E8 Configurations} \renewcommand{\arraystretch}{1} \end{table} Many of these configurations have already appeared on the Coulomb branch of the other $D_{S^1} E_n$ theories, some of them being also analysed in \cite{Eguchi:2002nx}. Let us consider one of the extremal configurations that could be useful in visualising how the type-$II^*$ singularity appears in the massless limit. For simplicity, take again the $(I_1, I_6, I_3, I_2)$ configuration\footnote{This can be obtained for $\boldsymbol{\chi}^{E_8} = \{3, 15, -8, 19, -10, -1, 5, -3\}$, for instance.}, where now the monodromy group is $\Gamma_0(6)$, with the cusps $(I_6, I_2, I_3)$ at $\tau = 0$, ${1\over 3}$ and ${1\over 2}$, respectively. The associated BPS states are: \be \mathscr{S}\; :\qquad I_6:~ 6(1,0)~, \qquad I_2:~ 2(-3,1)~, \qquad I_3:~ 3(2,-1)~, \end{equation} which gives the 5d BPS quiver: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation}\label{quiver E8A} \begin{tikzpicture}[baseline=1mm] \node[] (1) []{$\mathcal{E}_{\gamma_{1,2,3,4,5,6}=(1,0)}$}; \node[] (2) [right = of 1]{$\mathcal{E}_{\gamma_{7,8}=(-3,1)}$}; \node[] (3) [below = of 1]{$\mathcal{E}_{\gamma_{9,10,11}=(2,-1)}$}; \draw[->-=0.5] (1) to (2); \draw[->-=0.3] (2) to (3); \draw[->-=0.5] (3) to (1); \end{tikzpicture} \eea This is a correct $3$-blocks quiver for $dP_8$ \cite{Wijnholt:2002qz}, with the D0-brane representation having rank $(1; 3; 2)$. Starting from this configuration, the $II^*$ monodromy in \eqref{E8 massless Monodromies} can be realised as: \be \mathbb{M}_{(1,0)}^5 \mathbb{M}_{(-3,1)}^2 \mathbb{M}_{(2,-1)}^3 = T(ST)T^{-1}~. \end{equation} As in the $E_6$ and $E_7$ examples, this construction also gives us a derivation of a BPS quiver for the 4d $E_8$ MN theory, which is obtained from \eqref{quiver E8A} by removing the dyon $\gamma_1=(1,0)$. We hope to return to this important point in future work. \section{Gravitational couplings on the $U$-plane for the $D_{S^1} E_n$ theories}\label{sec:grav} One can consider any 4d $\mathcal{N}=2$ field theory on a compact 4-manifold, $\mathcal{M}_4$, with the topological twist \cite{Witten:1988ze}. The low-energy effective field theory then includes effective gravitational couplings of the form \cite{Witten:1995gf, Moore:1997pc, Losev:1997tp}: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} &S_{\rm grav} &=&\; {i\over 16\pi} \int_{\mathcal{M}_4} \, {\rm Tr}(R\wedge \ast R)\, \mathcal{A}(a) +{i\over 12\pi} \int_{\mathcal{M}_4} \,{\rm Tr}(R\wedge R)\, \mathcal{B}(a)~, \eea where $a$ is the low energy photon and $R$ the Riemann curvature. On the Coulomb branch, the field $a$ is constant and we simply have: \be\label{Sgrav} S_{\rm grav} = 2\pi i\, \left(e(\mathcal{M}_4) \, \mathcal{A}(a) + \sigma(\mathcal{M}_4)\, \mathcal{B}(a)\right)~, \end{equation} with $e$ and $\sigma$ the topological Euler characteristic and the signature of $\mathcal{M}_4$, respectively. In general, the topological twist data must also include a choice of spin$^c$ line bundle, which affects the path integral in a subtle way -- see {\it e.g.} \cite{Labastida:1997rg, Marino:1996sd, Manschot:2021qqe}. Here, we focus on the type-$A$ and type-$B$ gravitational couplings on the $U$-plane, defined as: \be\label{A and B def} e^{-S_{\rm grav} }= A^e B^\sigma~, \qquad A(U)= e^{-2\pi i \mathcal{A}}~, \qquad B(U)= e^{-2\pi i \mathcal{B}}~, \end{equation} using the `mirror map' $a=a(U)$. A general infrared prescription for these couplings was given in~\cite{Witten:1995gf, Moore:1997pc, Losev:1997tp} based on the S-duality of the low-energy theory. Given any rank-one SW geometry, in particular, we should have: \be\label{AB IR expect} A(U)= \alpha \left({d U\over d a}\right)^{1\over 2}~, \qquad B(U)=\beta \left( \Delta^{\rm phys}\right)^{1\over 8}~, \end{equation} with $ \Delta^{\rm phys}$ the so-called `physical discriminant', and $\alpha$, $\beta$ some prefactors to be determined. In our examples, the physical discriminant will be equal to the geometric discriminant $\Delta$ of the $D_{S^1} E_n$ curves written in Weierstrass normal form, up to an overall factor. The gravitational couplings \eqref{A and B def} can also be extracted from the microscopic calculation provided by the Nekrasov partition function on the $\Omega$-background \cite{Nekrasov:2002qd, Nekrasov:2003rj, Nakajima:2003pg, Nakajima:2005fg, Gottsche:2006bm}. In this section, we consider the $\mathbb{R}^4\times S^1$ Nekrasov partition functions for the $D_{S^1} E_n$ theories with $n \leq 3$ in order to extract the gravitational couplings, and we match that result to the infrared expectation \eqref{AB IR expect}. We will focus on the $E_1$ and $E_3$ theories in the following.% \footnote{The other two toric theories with a gauge theory interpretation, $\widetilde E_1$ and $\widetilde E_2$, can be treated similarly, either intrinsically or as limits of the $E_3$ theory, but there are a few subtleties related to the 5d partity anomaly, which we hope to discuss elsewhere.} We find perfect agreement between the UV and IR prescriptions up to three-instantons. This computation can be seen as a 5d generalisation of recent computations in \cite{Manschot:2019pog}, where the same IR/UV matching was investigated for rank-one 4d theories; our results reproduce theirs in the 4d gauge-theory limit. We will discuss some other interesting aspects of the gravitational couplings in~\cite{toappear2021}. \subsection{Instanton partition functions and gravitational couplings} The $\mathbb{R}^4\times S^1$ ($K$-theoretic) Nekrasov partition function for $U(N)$ gauge theories is computed via a simple prescription involving Young diagrams \cite{Nekrasov:2002qd, Nekrasov:2003rj, Nakajima:2005fg, Gottsche:2006bm}, which can be adapted to $SU(N)$ gauge theories by carefully decoupling the additional $U(1)$ contribution. For 4d gauge theories, this $U(1)$ factor was first discussed in the context of the AGT correspondence. For the 5d `toric' theories, the partition function can be determined from the (refined) topological vertex formalism \cite{Aganagic:2003db, Iqbal:2007ii}, which allows for the identification of the correct $SU(N)$ instanton counting prescription. We review the relevant formulas and set our conventions in appendix \ref{app:nek}. Consider the Coulomb branch of a 5d SCFT on the $\Omega$-background. As described in section \ref{sec:Enmirroretc}, such theories are engineered in M-theory on: \be \mathbb{C}^2_{\tau_1, \tau_2} \times S^1 \times \MG_{E_n}~, \end{equation} where $\MG_{E_n}$ is a canonical singularity that admits a crepant resolution. We consider the local del Pezzo geometries $\widetilde \MG = {\rm Tot}( \mathcal{K} \rightarrow \mathcal{B}_4)$ engineering the $D_{S^1} E_n$ theories. Let $\tau_i = \beta \epsilon_i$, $i=1,2$, be the dimensionless $\Omega$-background parameters, and let us introduce the notation: \be q=e^{2\pi i \tau_1}~, \qquad t= e^{-2\pi i \tau_2}~. \end{equation} Recall also that, for the complexified K\"ahler parameters associated to curves $\mathcal{C} \in H_2(\mathcal{B}_4,\mathbb{Z})$, we introduced the single-valued parameters: \be Q_{\mathcal{C}}= e^{2 \pi i t_{\mathcal{C}}}~,\qquad \quad t_{\mathcal{C}} = \int_{\mathcal{C}} (B + i J)~, \end{equation} The instanton counting prescription for the partition function is valid in the gauge theory phase of the $D_{S^1} E_n$ theories, where it leads to a power series in the instanton counting parameter: \be\label{lambda QbQf nek} \lambda = {Q_{\mathcal{C}_b}\over Q_{\mathcal{C}_f}}~, \end{equation} in our conventions, for $\mathcal{C}_{f,b}$ the fiber and base curves of the Fano surface $\mathcal{B}_4$. In the non-equivariant limit, $\tau_{1,2}\rightarrow 0$, the Nekrasov partition function has the asymptotic expansion: \be \label{EquivariantLimitNekrasovZ} - \log(Z_{\mathbb{C}^2\times S^1}(Q, \tau_1,\tau_2)) = \frac{2\pi i}{\tau_1 \tau_2}\left( \mathcal{F} + (\tau_1+\tau_2)\mathcal{H} + \tau_1 \tau_2 \mathcal{A} + \frac{\tau_1^2 + \tau_2^2}{3}\mathcal{B} \right) + \mathcal{O} \left(\tau\right) ~, \end{equation} from which one can extract the prepotential $\mathcal{F}$ and the gravitational corrections $\mathcal{A}$ and $\mathcal{B}$ \cite{Nekrasov:2002qd}. Closed-form expressions for the latter two can be determined from holomorphic anomaly equations -- see {\it e.g.} \cite{Huang:2011qx, Huang:2013yta}. Here, we will determine $\mathcal{A}$ and $\mathcal{B}$ from the Seiberg-Witten curve and from \eqref{EquivariantLimitNekrasovZ}, leading to consistent results. In four dimensions, this same computation was recently discussed in \cite{Manschot:2019pog}. The 4d limit of our computation agrees with \cite{Manschot:2019pog}, once we fix our conventions appropriately. We also note that the term $\mathcal{H}$ in \eqref{EquivariantLimitNekrasovZ} is expected to vanish on general grounds, because there are no gravitational terms that it could correspond to on the standard $\Omega$-background, where only the $SU(2)_R$ gauge field is turned on -- see {\it e.g.}~\cite{Kim:2020hhh}. \medskip \noindent Recall that the gauge-theory phase of the 5d theory is obtained in a special limit where the fiber curve $\mathcal{C}_f$ shrinks to zero while the base curve $\mathcal{C}_b$ remains large, in which case $\lambda$ is very small. A more natural limit, however, is the large volume limit in the local Calabi-Yau $\widetilde\MG$, in which all effective curves are on equal footing, with their corresponding parameters $Q_{\mathcal{C}} \rightarrow 0$. In that limit, the $\mathbb{R}^4\times S^1$ partition function can be written as a product over contributions of some (generally infinite) number of five-dimensional massive BPS particles, with masses set by the K\"ahler parameters $Q_\mathcal{C}$, and with spins given by the corresponding representations of the little group $SO(4) = SU(2)_L \times SU(2)_R$. That partition function captures the (refined) Gopakumar-Vafa invariants \cite{Gopakumar:1998jq} of $\widetilde\MG$, and can be computed in terms of the refined topological string partition function \cite{Iqbal:2007ii}. For our present purposes, however, it will suffice to compute the $\mathbb{R}^4\times S^1$ partition function in the `gauge-theory phase', order by order in the instanton-counting parameter \eqref{lambda QbQf nek}, and to compare with the quantities obtained from the Seiberg-Witten geometry in that same limit. \subsubsection{$Z_{\mathbb{R}^4\times S^1}$ partition function of the $E_1$ theory} Let us first review the computation of the Nekrasov partition function for the 5d pure $SU(2)$ gauge theory, which is the gauge-theory phase of the $E_1$ SCFT. This can be obtained directly from the $U(2)$ gauge-theory partition function by imposing the traceless condition on the VEV of the 5d scalars. Using the conventions summarised in appendix \ref{app:nek}, we thus write the partition function as: \be Z_{\mathbb{C}^2\times S^1}(Q,\tau_1,\tau_2) = Z^{\rm class}_{\rm vector}(Q,\tau_1,\tau_2 )Z^{\rm pert}_{\rm vector} (Q,\tau_1,\tau_2 )Z^{\rm inst}_{\rm vector} (Q,\tau_1,\tau_2)~, \end{equation} where $Z^{\rm class}$, $Z^{\rm pert}$, $Z^{\rm inst}$ are the classical, perturbative and non-perturbative contributions, respectively. Here we introduced $Q \equiv e^{4\pi ia}$, with $a$ the dimensionless scalar defined in \eqref{U to a classical}. Note that the gravitational corrections do not receive any classical contributions. As argued in \eqref{F large U gauge th}, the perturbative contribution to the prepotential reads \cite{Nekrasov:1996cz}: \be \label{E1 Prepotential Perturbative} \mathcal{F}^{\rm pert} = {2\over (2\pi i)^3}{\text{Li}_3}(Q)+ {2\over 3} a^3~. \end{equation} The perturbative contribution to the gravitational couplings is discussed briefly in appendix~\ref{app:Zpert}. For the pure $SU(2)$ theory, this reduces to the following contributions to the gravitational corrections: \be \label{E1 pert AB} \mathcal{A}^{\rm pert} = \mathcal{B}^{\rm pert} = -{1\over 2\pi i}\left({1\over 2}\log(1-Q)-{1\over 4}\log{Q}\right)~. \end{equation} The complete expression for the prepotential is of the form: \be \mathcal{F} = \mathcal{F}^{\rm pert} + {1\over (2\pi i)^3}\sum_{k=1}^{\infty}\mathfrak{q}_{E_1}^k \mathcal{F}_k~. \end{equation} where $\mathfrak{q}$ is the instanton counting parameter and $\mathcal{F}_k$ are the $k$-instanton contributions. From the prescription outlined in appendix \ref{app:nek}, we find the following instanton contributions $\mathcal{F}_k$ to the prepotential: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \label{E1 instanton Prep} k=1: &\quad \frac{2Q}{(1-Q)^2} = 2Q + 4Q^2 + 6Q^3 + 8Q^4 + 10Q^5 + 12Q^6 + \mathcal{O}(Q^7)~, \\ k=2: & \quad \frac{Q^2(1+18Q+Q^2)}{4(1-Q)^6} = \frac{Q^2}{4} + 6Q^3 + \frac{65Q^4}{2} + 110 Q^5 + {1155\over 4}Q^6 + \mathcal{O}(Q^7) ~,\\ k=3: & \quad \frac{2Q^3\left(1+98Q+450Q^2+98Q^3 + Q^4\right)}{27(1-Q)^{10}} = \frac{2}{27}Q^3 + 8Q^4 + 110 Q^5 + \mathcal{O}(Q^6)~, \eea where the series expansion in $Q$ is done in order to relate this result to the large volume computations from the Seiberg-Witten curve. Additionally, we find that the instanton corrections to the order $1/\tau$ term in \eqref{EquivariantLimitNekrasovZ} vanishes, as expected. For the gravitational coupling $\mathcal{A}$, the first instanton contributions are: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \label{E1 instanton A} 2\pi i\,\mathcal{A}^{\rm inst} = & ~\mathfrak{q}_{E_1} \left(\frac{Q}{2}+5Q^2 + \frac{35Q^3}{2} + 42 Q^4 + \frac{165Q^5}{2}+ \mathcal{O}(Q^6)\right)\\ &\; +\mathfrak{q}_{E_1}^2 \left(\frac{Q^2}{4} + \frac{35Q^3}{2}+\frac{355Q^4}{2} + \frac{1919Q^5}{2} +\mathcal{O}(Q^6)\right)\\ &\; + \mathfrak{q}_{E_1}^3\left(\frac{Q^3}{6} + 42Q^4 + \frac{1919}{2}Q^5+\mathcal{O}(Q^6) \right) + \mathcal{O}\left(\mathfrak{q}_{E_1}^4\right)~. \eea Similarly, the first few instanton contributions to $\mathcal{B}$ read: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \label{E1 instanton B} 2\pi i\,\mathcal{B}^{\rm inst} = & ~\mathfrak{q}_{E_1} \left(\frac{Q}{2} + 7Q^2 + \frac{51Q^3}{2}+62 Q^4 + \frac{145Q^5}{2}+\mathcal{O}(Q^6)\right) \\ & \; + \mathfrak{q}_{E_1}^2 \left(\frac{Q^2}{4}+\frac{51Q^3}{2}+\frac{551Q^4}{2} + \frac{3055Q^5}{2} +\mathcal{O}(Q^6)\right) \\ & \;+ \mathfrak{q}_{E_1}^3 \left(\frac{Q^3}{6} + 62Q^4 + \frac{3055Q^5}{2}+\mathcal{O}(Q^6)\right) +\mathcal{O}(\mathfrak{q}_{E_1}^4)~. \eea \subsubsection{$Z_{\mathbb{R}^4\times S^1}$ partiton function of the $E_3$ theory} As another example, let us consider the partition function of the $E_3$ theory in the $\Omega$-background. The corresponding gauge-theory phase is the 5d $SU(2)$ gauge theory with $N_f=2$. The partition function that corresponds to the $E_3$ Seiberg-Witten geometry \eqref{E3 curve gen} is given by \cite{Taki:2014pba}: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} &Z^{\rm inst}_{E_3}(a,\mu_1,\mu_2,\tau_1,\tau_2) =\\ &\qquad \sum_{\boldsymbol{Y}} \left({t\over q} \mathfrak{q}_{E_3}\right)^{|\boldsymbol{Y}|} Z^{\rm vector}_{\boldsymbol{Y}}(a,\tau_1,\tau_2) Z_{\boldsymbol{Y}}^{\text{fund}}(a,\mu_1,\tau_1,\tau_2)Z_{\boldsymbol{Y}}^{\text{a-fund}}(a,\mu_2,\tau_1,\tau_2)~. \eea where $\mu_{1,2}$ are the complex masses for the two flavours, with the various factors defined in appendix \ref{app:nek}. In order to simplify our expressions, let us define: \be \label{E3 instanton sp} s = -e^{-2\pi i \mu_1} - e^{-2\pi i\mu_2}~, \qquad p = e^{-2\pi i(\mu_1+\mu_2)}~. \end{equation} As we will see below, these parameters can be matched to the parameters $s, p$ introduced to describe the $E_3$ curve in~\eqref{E3 curve g23}. As was the case for the $E_1$ theory, the instanton partition function will be a series in the instanton counting parameter $\mathfrak{q}_{E_3}$. We consider a further limit $Q \rightarrow 0$, in order to compare to the large volume limit. The first non-perturbative corrections to the prepotential then read: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \label{E3 instanton prep} & (2\pi i)^3 \mathcal{F}^{\rm inst}_{E_3} = \mathfrak{q}_{E_3}\left( s Q^{{1\over 2}} + 2(1+ p)Q + 3 sQ^{{3\over 2}} + 4(1+ p)Q^2 + 5 s Q^{{5\over 2}} + 6(1+ p)Q^3 \right) + \\ & + \mathfrak{q}_{E_3}^2 \left({2 p - s^2\over 8}Q + {1+16 p + p^2 \over 4}Q^2 + 5 s(1+ p)Q^{{5\over 2}} + {48(1+ p^2) +198 p +45 s^2 \over 8} Q^3 \right) \\ & + \mathfrak{q}_{E_3}^3 \left( { s( s^2 - 3p) \over 27}Q^{{5\over 2}} + {2(1+81 p + 81 p^2 + p^3) \over 27} Q^3 \right) + \mathcal{O}(\mathfrak{q}_{E_3}^4)~, \eea where we supress the terms of order $\mathcal{O}(Q^{{7\over 2}})$. As was the case for the $E_1$ partition function, we again find that the order $\mathcal{O}(\tau^{-1})$ terms vanish. For $\mathcal{A}$, we find: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} (2\pi i) \mathcal{A}^{\rm inst} & = \mathfrak{q}_{E_3}\left({1+ p \over 2}Q + 2 s Q^{{3\over 2}} + 5(1+ p)Q^2 + 10 s Q^{{5\over 2}} +{35(1+ p)\over 2}Q^3 \right) \\ & + \mathfrak{q}_{E_3}^2\left( {1+20 p + p^2 \over 4}Q^2 +10 s(1+ p)Q^{{5\over 2}} + {35(1+ p^2) + 154 p +33 s\over 2}Q^3 \right) \\ & + \mathfrak{q}_{E_3}^3~ {1\over 6}\left(1 + 105 p + 105 p^2 + p^3\right)Q^3 + \mathcal{O}(\mathfrak{q}_{E_3}^4)~, \eea and similarly for $\mathcal{B}$, we have: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} & (2\pi i) \mathcal{B}^{\rm inst} = \mathfrak{q}_{E_3}\left(-{1\over 8} s Q^{{1 \over 2}} + {1+ p \over 2}Q + {21 s \over 8} Q^{{3 \over 2}} + 7(1+ p)Q^2 + {115 s \over 8}Q^{{5\ov2}} + {51(1+ p) \over 2}Q^3 \right) \\ & + \mathfrak{q}_{E_3}^2\left({ s^2 - 2 p \over 16}Q + {1 +28 p + p^2\over 4}Q^2 + {115 s(1+ p) \over 8}Q^{{5\over 2}} + {408(1+ p^2) + 9(218 p +43 s^2) \over 16}Q^3 \right)\\ & + \mathfrak{q}_{E_3}^3\left( { s(3 p- s^2) \over 24}Q^{{3\over 2}} + {1 + 153 p + 153 p^2 + p^3 \over 6}Q^3 \right) + \mathcal{O}(\mathfrak{q}_{E_3}^4)~. \eea where we again supress the terms of order $\mathcal{O}(Q^{{7\over 2}})$. \subsection{Seiberg-Witten geometry computations of $\mathcal{F}$, $\mathcal{A}$ and $\mathcal{B}$} We now turn our attention to the toric mirror curves \eqref{E3 curve gen}. We first show how to compute the quantities of interest from the $E_1$ curve, and then also present the explicit results for the $E_3$ theory. The expressions for the other toric theories follow by flavour decoupling. \subsubsection{Instanton expansion from the $D_{S^1} E_1$ curve} Consider first the $E_1$ curve \eqref{E1 toric curve}, and introduce the dimensionless parameters associated to the complexified K\"ahler parameters of the IIA geometry: \be Q_f \equiv Q = e^{2\pi i t_f}= e^{4\pi i a}~, \qquad Q_b = e^{2\pi i t_b}= e^{2\pi i (2 a+\mu_0)}~, \end{equation} where $t_{f,b}$ are the periods corresponding to D2-branes wrapping the curves $\mathcal{C}_f$ and $\mathcal{C}_b$, respectively, with $Q_b = \lambda Q_f$. The D4-brane period is given by $\Pi_{\rm D4}=a_D$, and the prepotential can be written as: \be \mathcal{F} = {1 \over 2} \int \Pi_{\rm D4}~d t_f = {1 \over 4} \int dt_f \int dt_f ~\tau~, \qquad \tau = {da_D \over da} = 2{d\Pi_{\rm D4}\over d t_f}~. \end{equation} Let us first consider the `classical' contribution to the prepotential. This is obtained from the large-volume analysis of the D-brane periods, leading to: \be \mathcal{F}^{\rm class} = {4\over 3}a^3 + {1\over 2\pi i}\log(\lambda) \, a^2 + {1\over 6} a~, \end{equation} as in \eqref{CF cubic lv}. Note that, in the strict 5d limit, the instanton corrections are supressed, and thus we reproduce the real prepotential for the $E_1$ theory from \cite{Seiberg:1996bd, Nekrasov:1996cz}: \be \mathcal{F}^{(5d)} = \lim_{\beta \rightarrow \infty} {i \over \beta^3}\mathcal{F}^{\rm class} = {4\over 3}\sigma^3 + m_0 \sigma^2~, \end{equation} for $\lambda \rightarrow e^{-2\pi \beta m_0}$, with $\sigma$ the real scalar of the 5d $\mathcal{N} = 1$ vector multiplet and $m_0$ the inverse gauge coupling. The Picard-Fuchs equation \eqref{PF eq general} for the periods can be solved in the large volume limit for generic values of the parameters, using Frobenius' method. However, this is equivalent to the `universal' PF equation \eqref{UniversalPicardFuchsEqn} for the geometric periods, with one of the solutions given by \eqref{omegaa generic sol}. Choosing the appropriate normalization constant, one can match this period with the $a$ period. For the $E_1$ theory, this is: \be 2\pi i {d\over dU}a(U,\lambda) = -{1\over U} - {2(1+\lambda) \over U^3} - {6(1+4\lambda + \lambda^2) \over U^5} - {20(1+9\lambda + 9\lambda^2+1) \over U^7} + \mathcal{O}\left( {1\over U^9}\right)~. \end{equation} It is then straightforward to invert this series expansion to find: \be U(Q,\lambda) = Q^{-{1\over 2}} + (1+\lambda)Q^{{1\over 2}} + 3\lambda Q^{{3\over 2}} + 5\lambda(1+\lambda)Q^{{5\over 2}} + \mathcal{O}\left( Q^{{7\over 2}}\right)~, \end{equation} where we again used $Q=e^{4\pi i a}$. Finally, combining this with the expression $\tau = \tau(j)$ obtained by inverting \eqref{j of tau} we obtain the prepotential: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} (2\pi i)^3\mathcal{F} & = (2\pi i)^3 \mathcal{F}_{\rm class} + \left(2Q + {1\over 4}Q^2 + {2\over 27}Q^3 + {1\over 32}Q^4 \right) + \lambda \left(2Q + 4Q^2 + 6Q^3 + 8Q^4\right) \\ & \qquad + \lambda^2\left({1\over 4}Q^2 + 6Q^3 + {65\over 2}Q^4\right) + \lambda^3 \left({2\over 27}Q^3 + 8Q^4\right) + \mathcal{O}(\lambda^4)~, \eea where terms of order $\mathcal{O}(Q^5)$ are supressed. We thus immediately notice that this agrees with the instanton counting results \eqref{E1 instanton Prep}, upon the identification: \be \mathfrak{q}_{E_1} = \lambda~. \end{equation} This comes as no surprise, since we already observed that the 4d limit of the SW curve involves taking $\lambda \rightarrow (2\pi i \beta \Lambda)^4$, which is the instanton counting parameter of the resulting four-dimensional theory. Let us also note that the perturbative part of the above expression reproduces the series expansion of the trilogarithm, and thus agrees with \eqref{E1 Prepotential Perturbative}. The remaining task is to identify the correct expressions for the gravitational corrections $\mathcal{A}$ and $\mathcal{B}$. Following closely the four-dimensional computation in \cite{Manschot:2019pog}, we first consider the quantity: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \label{E1 LogdUdQ} -{1\over 2}\log&\left( -Q\frac{dU}{dQ}\right) = a_0 + \lambda \left(\frac{1}{2}Q +5Q^2 + \frac{35}{2}Q^3 + 42Q^4 + \frac{165}{2}Q^5 \right) \\ & + \lambda^2 \left({1 \over 4}Q^2 + \frac{35}{2}Q^3 + \frac{355}{2}Q^4+ \frac{1919}{2}Q^5 \right) + \lambda^3 \left( \frac{1}{6}Q^3 + 42Q^4 + \frac{1919}{2}Q^5\right) ~, \eea up to orders $\mathcal{O}(Q^6)$ and $\mathcal{O}(\lambda^4)$, with $a_0$ encoding the perturbative contribution: \be a_0 = -{1\over 2}\log(1-Q) + {1\over 4}\log(Q) + {1\over 2}\log(2)~. \end{equation} The perturbative and non-perturbative corrections are in perfect agreement with \eqref{E1 pert AB} and \eqref{E1 instanton A}, respectively. We then find that: \be A = \sqrt{2} \left(- {1\over 4\pi i} {dU\over da} \right)^{1\over 2}~. \end{equation} with $A$ given in \eqref{A and B def}. For the $\mathcal{B}$ gravitational coupling, let us first define the `physical' discriminant as: \be \Delta^{\rm phys}(U) = \lambda^{-2} \Delta_{\rm E_1}(U) ~, \end{equation} where $\Delta_{\rm E_1}$ is the discriminant of the $E_1$ curve in \eqref{DeltaE1}. Then, we find that: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \label{E1 LogDelta} -\frac{1}{8}\log&\left( \Delta^{\rm phys}\right) = b_0 + \lambda \left( \frac{1}{2}Q + 7Q^2 + \frac{51}{2}Q^3 + 62 Q^4 + \frac{245}{2}Q^5\right) \\ & + \lambda^2\left(\frac{1}{4}Q^2 + \frac{51}{2}Q^3 + \frac{551}{2}Q^4 + \frac{3055}{2}Q^5 \right) + \lambda^3\left( \frac{1}{6}Q^3 + 62 Q^4 + \frac{3055}{2}Q^5 \right)~, \eea with the terms of orders $\mathcal{O}(Q^6)$ and $\mathcal{O}(\lambda^4)$ suppressed, and with: \be b_0 = -{1\over 2}\log(1-Q) + {1\over 4}\log(Q) ~. \end{equation} This matches the contributions to the $\mathcal{B}$ gravitational correction in \eqref{E1 pert AB} and \eqref{E1 instanton B} and, as a result, we find: \be B = \left( \Delta^{\rm phys}\right)^{{1\over 8}}~. \end{equation} It is also instructive to consider the 4d limit of these expressions. First, the perturbative part \eqref{E1 pert AB} of these quantities becomes: \be \label{SU2 Perturbative AB} -{1\over 2}\log(1-Q)~\approx~-{1\over 2}\log\left(-4\pi i \beta a \right) + \mathcal{O}(\beta) \approx -{1\over 2}\log\left(-{2a\over \Lambda} \right) + \mathcal{O}(\beta) ~, \end{equation} where we introduce the dynamical scale $\Lambda$ as $(2\pi i\beta)^{-1}$. The K-theoretic Nekrasov partition function reduces to its 4d counterpart in the 4d limit, by definition, and it is then not difficult to see that the 4d limits of the expressions for $\mathcal{A}$ and $\mathcal{B}$ are in agreement with the expressions given in \cite{Manschot:2019pog}. Note that, in order to take the 4d limit at each order in the instanton expansion, one needs to use the exact expression for the $k$-instanton correction instead of the above $Q$-series. Let us show this explicitly for the $1$-instanton correction. The $1$-instanton corrections to the gravitational couplings which reproduce the series \eqref{E1 instanton A},~\eqref{E1 instanton B} are: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \mathcal{A}:~ &~\quad \mathfrak{q}_{E1}{ Q(1+6Q+Q^2) \over 2(1-Q)^4} ~\approx~ {\Lambda^4 \over 4a^4} + \mathcal{O}(\beta^2)~, \\ \mathcal{B}:~ &~\quad \mathfrak{q}_{E1}{ Q(1+10Q+Q^2) \over 2(1-Q)^4} ~\approx~ {3\Lambda^4 \over 8a^4} + \mathcal{O}(\beta^2)~. \\ \eea The physical discriminant reduces to $\Delta^{\rm phys}\approx 16(2\pi i\beta)^4\Delta^{(\rm 4d)}$ in the 4d limit, with $\Delta^{(\rm 4d)} =(u^2-4\Lambda^4)$, and we find: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} A = {1\over \sqrt{\Lambda} } \left(- {du\over d a} \right)^{1\over 2}~, \qquad B = {\sqrt{2}\over \sqrt{\Lambda} } \left(\Delta^{(\rm 4d)} \right)^{{1\over 8}}~, \eea in good agreement with \cite{Manschot:2019pog}. \subsubsection{Instanton expansion from the $D_{S^1} E_3$ curve} The same computation can be carried out for the $E_3$ curve \eqref{E3 curve gen}, with the parameters $s = M_1 + M_2$ and $p = M_1M_2$. For generic values of the mass parameters, we find: \be\nonumber U = Q^{-{1\over 2}}+ \left(1+\lambda(1+p)\right) Q^{{1\over 2}} + 2s\lambda Q + 3\lambda\left(1+(1+\lambda)p\right) Q^{{3\over 2}} + 4s\lambda\left(1+(1+\lambda)p\right)Q^2 + \mathcal{O}\left(Q^{{5\over 2}}\right)~. \end{equation} We should again arrange our expressions in terms of the parameter $\lambda$. Up to the first instanton correction, the prepotential reads: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \label{PrepotentialForE3} &(2\pi i)^3\mathcal{F}_{E_3} =\\ &~\; \mathcal{F}_{0} + \lambda \left( sQ^{{1\over 2}} + 2(1 + p) Q + 3s Q^{{3\over 2}} + 4(1+p)Q^2 +5sQ^{{5\over 2}} + 6(1+p) Q^3 +\mathcal{O}(Q^{{7\over 2}})\right)~, \eea which agrees with \eqref{E3 instanton prep} upon the identifications $M_i = -e^{-2\pi i \mu_i}$, as in \eqref{lambda to M}. This shows that the parameters $s$ and $p$ defined in \eqref{E3 instanton sp} are identical to the ones introduced above. We checked explicitly that the IR and UV computations of the prepotential agree up to the three-instanton correction. The $\mathcal{F}_{0}$ contribution is essentially the perturbative $1$-loop contribution: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} (2\pi i)^3\mathcal{F}^{\rm pert} & =\; 2{\text{Li}_3}(Q) - \sum_{j=1}^2 \left( {\text{Li}_3}\left(-M_j \sqrt{Q}\right) + {\text{Li}_3}\left(-{\sqrt{Q} \over M_j }\right) \right) \\ & =\; 2{\text{Li}_3}(Q) - \sum_{j=1}^2 \left( {\text{Li}_3} \left(e^{2\pi i(a-\mu_j)}\right) + {\text{Li}_3} \left(e^{2\pi i(a+\mu_j)}\right)\right)~, \eea where we omit a cubic polynomial in $a$. We define the physical discriminant as: \be \Delta^{\rm phys}(U) = {1\over \lambda^2 M_1M_2} \Delta_{E_3}(U)~, \end{equation} such that the coefficient of the higest power in $U$ in the physical discriminant is unity. We then checked the following relations up to the three-instanton correction: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} \label{LogdUdQforE3} -{1\over 2}\log\left( - {1\over 4\pi i}{dU \over da} \right) = &~ a_0(Q) + 2\pi i\mathcal{A}^{\rm inst}~, \\ -{1\over 8} \log\left( \Delta^{\rm phys}(U)\right) = &~ b_0(Q) + 2\pi i\mathcal{B}^{\rm inst}~, \eea where $a_0$ and $b_0$ are given by: \begin{equation} \begin{aligned}} \newcommand{\eea}{\end{aligned} \end{equation} a_0 & = -{1\over 2}\log(1-Q) + {1\over 4}\log(Q) + {1\over 2}\log(2)~, \\ b_0 & = -{1\over 2}\log(1-Q) + {3\over 8}\log(Q) -{1\over 8}\sum_{j=1}^2 \left( \log\left(1+M_j \sqrt{Q}\right) + \log\left(1+{\sqrt{Q}\over M_j} \right)\right)~. \eea These factors are the correct perturbative contributions for the 5d $SU(2)$ gauge theory with $N_f=2$. We then find perfect agreement between the IR and UV computations of the effective gravitational couplings for the $D_{S^1} E_3$ theory. \subsection*{Acknowledgements} We are grateful to Fabio Apruzzi, Lakshya Bhardwaj, Matthew Buican, Stefano Cremonesi, Michele Del Zotto, Alba Grassi, Simone Giacomelli, Max H\"ubner, Heeyeon Kim, Pietro Longhi, Joseph McGovern, Boris Pioline, and especially Sakura Sch\"afer-Nameki for interesting discussions, feedback and correspondences. The work of CC is supported by a University Research Fellowship 2017, ``Supersymmetric gauge theories across dimensions'', of the Royal Society. CC is also a Birmingham Fellow. The work of HM is supported by a Royal Society Research Grant for Research Fellows.
\section{Preliminaries} We start at notations and definitions, then list some basic results. They will be used throughout this paper. A point in $\R^{n}$ is written as $$ x=(x_1,\cdots,x_{n-1}, x_n)=(x',x_n)$$ and as $x=(x_1,x'',x_n) $ if $n\geq 3$. Let $\R_+^n= \{x\in \R^n|\, x_n>0\} $ be the upper half-space. Then $\overline{\R_+^n}= \{x\in \R^n|\, x_n\geq 0\}$. We will take the convention $$R^{n-1}=\partial \R_+^n = \{x\in \R^n|\, x_n=0\}, \ \ R^{n-2}=\{x\in \R^n|\, x_1= x_n=0\}$$ from time to time. Denote by $\I$ (or $\I'$, $\I''$) the identity matrices of size $n$ (or $n-1$, $n-2$), $B_r(x)$ (or $B_r'(x')$, $B_r''(x'')$) the ball of radius $r$ centered at $x$ (or $x'$, $x''$) in $\R^n$ (or $\R^{n-1}$, $\R^{n-2} $ respectively), $B_r^+(x)=\{y\in B_r(x):\; y_n>0\}$ and $\P x= x'$ is the projection mapping onto the $\R^{n-1}$. The oscillation function of a function $W$ over a domain $E$ is denoted by $$Osc_{E}W=\sup_{y,z\in E}|W(y)-W(z)|.$$ Suppose that $u$ satisfies the assumption of Theorem \ref{liouville theorem}. Since $u$ is continuous up to boundary, we have \begin{equation}\label{section innitial assump} S_1(0) \supset B_{\kappa_0}^+(0) \end{equation} for some $\kappa_0>0$, where we have used notation \eqref{section definition} (Also see (2.4) below). When $n\geq 3$, the quadratic growth condition \eqref{growth condition} will be replaced by \begin{equation}\label{growth innitial assump} u(0,x'',0) <\frac{K}{2}(|x''|^2+1) , \forall x''\in \R^{n-2} \end{equation} for a constant $K>0$. We will use {\sl $\sigma_i:[0,\infty) \to [0,\infty)$, $(i = 0, 1,2 )$, to denote some universal strictly increasing $C^0$ function with $\sigma_i(0)=0$ that depends only on $(n,a,\kappa_0, K)$. } $\lambda $ and $ \Lambda $ will denote known positive constants. We always use the {\sl convention that $c$ or $C$ denotes various positive constants depending only on $n,a$,$\kappa_0, K $, $\lambda $ and $\Lambda$, } which are often called as {\sl universal constants}. If not specified, the $\operatorname{det}D^2 u$ will be understood as the general Monge-Amp\`ere measure of convex functions\cite{[F],[G]}, which yields the (Alexandrov) generalized solution to the equation $\operatorname{det}D^2 u=f$, and it is equivalent to the viscosity solution in the domain where $f$ is continuous. If $u$ is a viscosity subsolution (or supersolution) of the equation $\operatorname{det}D^2 u=f $, we say that $u$ is a viscosity solution to the inequalities $\operatorname{det}D^2 u\geq (or \leq) f $, or $u$ solves these inequalities in viscosity senses. The sub-differential of $u$ at point $x_0$ is defined by \[ \partial u(x_0) := \{ p|\, L:=u(x_0) + p \cdot (x-x_0)\text{ is a support plane of } u \text{ at } x_0 \}.\] We define $\nabla u(x_0)$ as a fixed element of $\partial u(x_0)$ for interior point. When $n=2$ or when $n\geq 3$ and the assumption \eqref{growth condition} is satisfied, we will show the viscosity solution to \eqref{liouville problem}, $u$, is strictly convex in $\R_+^n$. Then the classical interior estimate \cite{[C1], [C3]} means that $u \in C_{loc}^{\infty}(\R_+^n)$ and $\nabla u$ is uniquely determined in $\R_+^n$. Take a point $y=(y',0)\in \partial \R_+^n$. If $u$ is convex, viscosity solution to problem\eqref{liouville problem}, by the definition we have \begin{equation} \label{viscosity sub equiv} \sup_{a\in \partial u(y) }\{ a\cdot e_n\} \leq ay_1 , \end{equation} and by Lemma \ref{viscosity neumann equiv} in Section 3, one may define \[ D_nu(y) = \varlimsup_{t\to 0^+}D_n u(y+te_n):=\lim_{t\to 0^+} \sup\{ p\cdot e_n:\; p\in \partial u(y+te_n) \}. \] And in Corollary \ref{en continues}, we will prove that there exists $p_y \in \partial u(y)$ such that \[p \cdot e_n = ay_1=D_n u(y).\] Hence, we define {\sl $\nabla u(y)$ as a fixed $p_y$ for any boundary point $y \in \partial \R_+^n$}. In this way, {\sl the section of $u$ centered at $y \in \overline{\R_+^n}$ with height $h>0$ } can be defined by \begin{equation}\label{2.5} S_{h}^{u}(y): =\left\{x \in \overline{\R_+^n}|\, u(x)<u(y)+\nabla u(y)\cdot(x-y)+h\right\}, \end{equation} and its {\sl Neumann boundary } is defined by \begin{equation}\label{boundary innitial def} G_{h}^{u}(y) := S_{h}^{u}(y) \cap \partial \R_+^{n}. \end{equation} Sometimes, the notations $S_{h}^{u}(0)$, $G_{h}^{u}(0)$ , $B_r(0)$ and $B_r^+(0)$ will be shorten as $S_{h}$, $G_{h} $, $B_r$ and $B_r^+ $respectively. {\sl When we are going to prove Theorem \ref{liouville theorem}, we may assume \begin{equation}\label{u=0 nabla u =0} a\geq 0, \ \ u(0)=0 , \ \ \nabla u(0)=0 \; \text{ and } u\geq 0\ \ \text {in } \overline{\R_+^n} \end{equation} by considering the function $u(x, -x_n)$ and subtracting the linear function $u(0)+ \nabla u(0)\cdot x $. } \begin{Definition}[Good Shape] \label{good shape definition} We say that a section $S_{h}^{u}(0)$ is of good shape if it satisfies the following two property: $S_{h}^{u}(0)$ has finite density at $0$, i.e., \begin{equation*} c \leq \frac{\operatorname{Vol}(S_{h}^{u}({0}))}{h^{\frac{n}{2}} } \leq C, \end{equation*} and \begin{equation*} c\P S_{h}^{u}({0}) \subset \P G_{h}^{u}(0) \cap (-\P G_{h}^{u}(0) ) . \end{equation*} \end{Definition} When blowing up at infinity, we will need to modify the class $\Theta$ to $\Theta(\delta)$. \begin{Definition}[$\Theta( \delta)$ Class] \label{theta delta class} Suppose that $n\geq 3$, $b\in R$ and $u$ satisfies \begin{equation*} D_n u(x',0)=bx_1, \forall x'\in \R^{n-1} \end{equation*} and \begin{equation*} u(0,z'',0)\leq z''^T\Q z'' +\delta, \forall x''\in \R^{n-2} \end{equation*} for some $( n-2) \times( n-2) $ symmetric matrix $\Q$ and $\delta >0$. We say $u \in\Theta( \delta)$ if the pair $(b,\Q) $ satisfies \begin{equation*} 0 \leq b \leq c \ \ \text{ and } \ \ b^2 \operatorname{det} \Q\leq C . \end{equation*} \end{Definition} \begin{Definition} \label{balance def} We say that a closed set $E\in \R^{n}$ is balance about $x$ up to a constant $ \kappa $, if \begin{equation*} t(x-E)\subset E-x\; \text{ for } \; t\leq c\kappa. \end{equation*} When $\kappa$ is universal, we say that $E\in \R^{n}$ is balance about $x$. \end{Definition} The following lemmas will be used in our article. Use $\operatorname{Vol}_k(E)$ to denote the $k-$dimensional Lebesgue measure and denote $\operatorname{Vol}(E)=\operatorname{Vol}_n(E)$. \begin{Lemma} \label{balance kappa lem} Given any convex set $E \in \R^n$. Suppose the line $l(t): =x+ te_n $ intersects $E$ at the points $p,q$. Then \begin{equation}\label{quasi vol} |p_n-q_n| \cdot \operatorname{Vol}_{n-1}(\P E) \leq C\operatorname{Vol}(E). \end{equation} In addition, if $\P E$ is balance about $\P q$ up to a constant $ \kappa $, then we have the reverse inequality \begin{equation}\label{quasi k vol} |p_n-q_n| \cdot \operatorname{Vol}_{n-1}(\P E) \geq c\kappa \operatorname{Vol} (E). \end{equation} \end{Lemma} \begin{proof} Consider the non-negative concave function defined on $\P E$ \[ L(x')=\sup\{ (y-z)\cdot e_n|\, y, z\in E,\ \text{ such that } \P y=\P z=x' \}.\] Then \[\operatorname{Vol} (E) \sim ||L||_{L^{\infty}} \operatorname{Vol}_{n-1}(\P E), \] which yields (2.7). Now, suppose that $\P E$ is balance about $\P q$ up to the constant $ \kappa $. By concavity $L(\P q) \geq c\kappa ||L||_{L^{\infty}}$, and \eqref{quasi k vol} follows. \end{proof} \begin{Lemma} \label{boundary nabla estimate} Let $u\in C(\overline{B_1^+(0) })$ be a convex function. Suppose that \begin{equation*} 0\leq u \leq \sigma_1(|x|) \text{ in } B_c^+(0) \end{equation*} and \begin{equation*} \varlimsup_{t\to 0^+}D_n u(x',t) \geq -\sigma_0(|x'|), \forall (x' ,0) \in \overline{B_c^+(0)}. \end{equation*} Then \begin{equation}\label{boundary nabla estimate equation} |\nabla u(y)| \leq C\left( \inf_{ |y| \leq t \leq c}\frac{2\sigma_1(1+t)}{t}+\sigma_0(|y'|)\right) \text{ in } B_c^+(0). \end{equation} Here we do not require $\sigma_i(0)=0\; (i=0, 1).$ \end{Lemma} \begin{proof} Given $y \in B_{c}^+(0)$, $c \leq \frac{1}{2}$, let $p \in \partial u(y) $. The assumption and the convexity implies that \[ p_n \geq -\sigma_0(|y'|).\] Suppose that $| p'|>0$. Note that for every constant $a \in [0,1]$, the point $z=y+a| y|(\frac{p'}{|p'|},1)$ is in $ B_1^+(0)$. Hence, by the convexity we have \[ a|y|(p_n+|p'| )=p\cdot (z-y) \leq u(z)-u(y) \leq 2\sigma_1((1+a)|y|).\] Letting $t=a|y|$, we obtain the desired \eqref{boundary nabla estimate equation}. We may ignore the estimation for $y\in \pom $, because $\nabla u(y)$ in this paper is determined by taking the internal limit. (See the above definition for $D_nu(y)$ and Corollary \ref{en continues}). \end{proof} Similar to Lemma \ref{boundary nabla estimate}, we can prove \begin{Lemma}\label{interior nabla estimate} Write $x\in \R^n$ as $x=(x^1,\cdots,x^k)$, $x^j \in \R^{a_j}$, $\sum_{j=1}^{k} a_j=n$. Let $u\in C( \bar B_r(0) )$ be a convex function, satisfying \[u(x) \leq u(0)+ \sum_{i=1}^{k} \sigma_i(|x^i|).\] Then \[ |\nabla_{x_j}u(0)| \leq C \inf_{ 0 \leq t \leq cr}\frac{2\sigma_j(Ct)}{t}.\] \end{Lemma} \begin{Corollary} \label{small perturb means gradient lemma} Let $\epsilon>0$ be small constant, $u\in C(\overline{B_1^+(0) })$ and $v \in C^2(\overline{B_1^+(0) })$ be two convex functions. Suppose that \begin{equation*} ||u-v||_{L^{\infty}} \leq \epsilon \end{equation*} and \begin{equation*} \varlimsup_{t\to 0^+}D_n u(x',t) \geq D_nv(x',0)-\epsilon^{\frac{1}{2}}, \forall (x ,0) \overline{B_1^+(0) } . \end{equation*} Then \begin{equation}\label{small perturb means gradient} |\nabla u(y)-\nabla v(y)| \leq C_v\epsilon^{\frac{1}{2}}\text{ in } B_c^+(0), \end{equation} where $C_v$ is aconstant which may depends on $||v||_{C^2}$. \end{Corollary} \begin{proof} Given point $y \in B_c^+(0)$. Consider the function \[ U^y(x) = u(x) +2\epsilon-v(y) -\nabla v(y) \cdot (x-y).\] Then by the assumption we have \[ 0\leq U^y(x) \leq 2\epsilon+v(x) +2\epsilon-v(y) -\nabla v(y) \cdot (x-y) \leq C_v |x-y|^2+4\epsilon,\] and \[ \varlimsup_{t\to 0^+}D_n U^y(x',t) \geq D_n v(x', 0) -\epsilon^{\frac{1}{2}}-D_nv(y',0) \geq -C_v|x'-y'|-\epsilon^{\frac{1}{2}}.\] Regarding $y$ as origin and applying Lemmas \ref{boundary nabla estimate} and \ref{interior nabla estimate} to $U^y(x)$, we get the desired results. \end{proof} The following is well-known John's Lemma. See \cite{[F], [G],[John]} for example. \begin{Lemma}[Jhon's Lemma] \label{Jhon Lemma} If $\Omega $ is a bounded convex set with non-empty interior in $\R^n$ and $E$ is the ellipsoid of smallest volume containing $\Omega , $ then after an affine transformation $T,$ \begin{equation*} B_{c(n)} \subset T(\Omega) \subset B_{C(n)}:=T(E). \end{equation*} \end{Lemma} \begin{Lemma} \label{comparison principle} If $\Omega $ is a bounded convex set in $\R^n$ and $u, v\in C(\overline{\Omega})$ are convex functions in $\Omega$ satisfying \begin{equation*} \begin{cases} \operatorname{det} D^2v \leq \operatorname{det} D^2u & \text{ in } \Omega\\ u\leq v & \text{ on } \partial \Omega \\ \end{cases}, \end{equation*} then $u \leq v $ on $\overline{\Omega}$. \end{Lemma} \begin{proof} See Theorem 2.10 in \cite{[F]}. \end{proof} \begin{Lemma}[ Comparison principle for mixed problem] \label{comparison principle for mixed problem} Supposed that $\Omega$ is a bounded convex set in $\R^n$, $ G_1\subset\partial \Omega$ and $G_2=\partial \Omega \backslash G_1 $ are piecewise $C^1$ smooth, and $\beta$ is inward vector fieled on $ \partial \Omega_2 $. If $u, v$ are continuous, convex function defined on $\overline{\Omega}$ such that either $u$ or $v$ is $C^2$ smooth, satisfying \begin{equation}\label{comparison problem 2.9} \begin{cases} \operatorname{det} D^2v < \operatorname{det} D^2u < \infty & \text{ in } \Omega\\ u < v &\text{ on } G_1 \\ D_{\beta}v < D_{\beta}u & \text{ on } G_2 \end{cases} \end{equation} in the viscosity sense, then $u < v $ on $\overline{\Omega}$. \end{Lemma} \begin{proof} On the contrary to the conclusion, we suppose that $w=u-v$ archives positive maximum value $m$ at a point $x_0 \in \overline{\Omega}$. According to the assumption and the first two inequalities in \eqref{comparison problem 2.9} we can take $x_0\in \partial \Omega_2$ such that $u(x_0)-v(x_0)=m$. This means that $u-[v(x_0)+\nabla v(x_0)\cdot (x-x_0)+m]$ archives the maximum at $x_0$ when $v$ is $C^2$ smooth, or $v-[u(x_0)+\nabla u(x_0)\cdot (x-x_0)-m]$ archives the minimum at $x_0$ when $u$ is $C^2$ smooth, which contradicts the third inequality in \eqref{u=0 nabla u =0} by the definition of viscosity solution. \end{proof} \begin{Lemma}\label{volume bound by measure} If $\Omega$ is a bounded convex domain in $\R^n$ and $u$ is a convex function satisfying \[ \operatorname{det} D^2u > \lambda \text{ in } \Omega , \] then \begin{equation} \label {2.11} \operatorname{Vol}(\Omega) \leq C(\lambda)|| u||_{L^{\infty}}^{\frac{n}{2}} . \end{equation} In particular, \begin{equation} \label {2.12} \operatorname{Vol}(S_h) \leq Ch^{\frac{n}{2}}. \end{equation} \end{Lemma} \begin{proof} \eqref{2.12} was proved in Corollary 3.2.5 in \cite{[G]}, and \eqref{2.11} can be proved as its proof. \end{proof} \begin{Lemma} \label{c1/n boundary estimate} Suppose that $\Omega$ is a convex domain in $\R^n$ such that $B_{c}(0)\subset \Om \subset B_{C}(0)$ and $u\in C(\overline{\Omega})$ is a convex function. If \[ \lambda \leq \operatorname{det} D^2u \leq \Lambda \text{ in } \Omega, \ u=0 \text{ on } \partial \Omega ,\] then \begin{equation*} u(x) \geq -C\operatorname{dist}(x,\partial \Omega)^{\frac{1}{n}}. \end{equation*} \end{Lemma} \begin{proof} This is the Aleksandrove's maximum principle. See Theorem 1.4.2 in \cite{[G]}. \end{proof} \begin{Lemma} \label{c2a classical estimate} Suppose that $B_{c}(0)\subset \Om \subset B_{C}(0)$ and $u$ is a convex function defined on convex domain $\bar \Omega$ such that \[ \lambda \leq \operatorname{det} D^2u =f(x)\leq \Lambda \text{ in } \Omega, \ u=0 \text{ on } \partial \Omega. \] If $||f||_{C^{k,\alpha}}(\Omega)\leq C$ for some $k \geq 0$ and $ \alpha\in (0,1)$, then \begin{equation*} ||u||_{C^{k+2,\alpha}( \frac{1}{2}\Omega)} \leq C. \end{equation*} \end{Lemma} \begin{proof} When $k=0$, this is the famous interior $C^{2, \alpha}$ estimate in \cite{[C2]}. Also see \cite{[JW1]}. Then the case of $k\geq 1$ follows from the standard regularity result for linear elliptic equations. \end{proof} \begin{Lemma} \label{strict classical line lemma} Let $u\in C(B_1(0) )$ be a convex solution to \[0 < \lambda \leq \operatorname{det} D^2u \leq \Lambda . \] For $x\in B_1(0)$ and $p\in \partial u(x)$, define $ \Sigma:=\{y\in B_1(0)|\,u(y)=u(x)+p\cdot (y-x)\}.$ Then, either $\Sigma=\{x\}$ or $\Sigma $ has no extremal point inside $B_1(0)$. \end{Lemma} \begin{proof} See \cite{[C1]}. \end{proof} The following result is already well-known. See\cite{[Jo], [Ca], [P1], [P2], [CY]} or the books\cite{[F],[G]}. \begin{Theorem} \label{global classical results} Let $u \in C({\R^n})$ be a continuous, convex solution. If $\operatorname{det} D^2 u =1$ in $\R^n$, then $u$ is a quadratic polynomial. \end{Theorem} \begin{Remark}\label{reflect classical results} The case $a=0$ of Theorem \ref{liouville theorem} can be obtained directly from Theorem \ref{global classical results}. In fact, Lemma \ref{viscosity neumann equiv} in next section allow us to reflect $u$, the solution to problem \eqref{liouville problem}, with respect to $\partial \R_+^{n}$. Then we get a convex function $\bar{u}$. Corollary \ref{en continues} also means that $D_n\bar{u}(\partial \R_+^n ) \subset \partial \R_+^{n} . $ Thus $\bar{u}$ solves the equation \[ \operatorname{det} D^2 \bar{u} =1, \text{ in } \; \R^{n}.\] Hence $\bar u$ is a quadratic polynomial by Theorem \ref{global classical results}, so is $u$. \end{Remark} \section{Interior strict convexity and normal derivative estimate } In this section, we first prove that a viscosity solution to problem \eqref{liouville problem} is interior strict convexity, then give its normal derivative estimates. \begin{Lemma} \label{strict convex in interior} Suppose $u$ is a viscosity solution to problem \eqref{liouville problem}. Then the graph of $u$ can't contains any ray, and $u$ is strictly convex away from the boundary $\partial \R_+^{n}$. \end{Lemma} \begin{proof} If the graph of $u$ contains a ray $l$ and take $y \in l'=\P l $, the function $$u^y(x)= u(x) -u(y)- \nabla u(y) \cdot (y-x) $$ is bounded in the tubular domain $E:=(l'-y+B_1(y)) \cap \overline{\R_+^n}$ and \[ \operatorname{det} D^2u^y =1 \text{ in } E, \] which contradicts Lemma \ref{volume bound by measure} since $E$ has infinite volume. Suppose $y \in \R_+^{n} $. Let \begin{equation} \label{maximum section heigh} h_y^u := \sup\{ h |\, S_{t}^{u}(y) \subset \R_+^n,\ \forall t < h\}. \end{equation} Since $u$ is strictly convex in the interior of sections\cite{[C1]}, it is enough for the strict convexity of $u$ away from the boundary $\partial \R_+^n$ to show $h_y^u >0$ for $y \in \R_+^{n}$. Otherwise, if $h_y=0$, the convex set \[\Gamma:=\{ x\in \R_+^n |\, u(x)= u(y) +\nabla u(y) \cdot (x-y)\}\] should contain more than one point. Lemma \ref{strict classical line lemma} implies that the extremal point of $\Gamma$ is not in interior. There are two cases: either $\Gamma$ contains a line $l$ parallel to $\R^{n-1}$, or $\Gamma$ contains a ray $l$ starting from point $z=(z',0)$ on $\partial \R_+^{n}$. Both cases contradicts the previous fact that the graph of $u$ can't contains any ray. \end{proof} \begin{Lemma} \label{viscosity neumann equiv} Suppose $u$ is a viscosity solution to problem \eqref{liouville problem} and $y \in \partial \R_+ ^{n}$. Then $D_nu(y):=\overline{\lim_{t\to 0^+}}D_n u(y', t)$ is well-defined. Moreover, \begin{equation} \label{viscosity sup equiv} D_n u(y)=ay_1 \end{equation} and \begin{equation} \label{en growth neumann} u(y+te_n) \geq u (y)+ tay_1, \ \ \forall t >0. \end{equation} \end{Lemma} \begin{proof} Without loss of generality we may assume $y=0$. By Lemma \ref{strict convex in interior} and the convexity of $u$, $D_n(te_n)$ are well-definend and continuous for $t>0$. Hence, $$D_nu(0):=\overline{\lim_{t\to 0^+}}D_n u( te_n)= \lim_{t\to 0^+}D_n u( te_n)$$ is well-defined. Notice that $ay_1|_{y=0}=0$. Were if \eqref{viscosity sup equiv} false, then \[\lim_{t \to 0^+} D_n u (te_n)< -2\epsilon \] for some $\epsilon >0$. Consider the tubular domain \[ \Gamma= \{(x', 0)+st_0 e_n |\, x'\in B'_r(0), \ s\in (0,1) \} \] and choose the function \[ v (x)= u(0)+\frac{ 2\operatorname{Osc}_{B_r^+(0)}u}{r^2}|x'|^2 -\epsilon x_n ,\] where $t_0 $ and $r= r(\epsilon , t_0, u )$ are positive and so small that \[ D_nu(t_0 e_n ) < -2\epsilon t_0, \ \ 2\operatorname{Osc}_{B_r^+(t_0e_n)}u \leq \epsilon t_0 \text{ and } |a|r < \epsilon ,\] which implies \[ \sup_{y \in B_r(t_0e_n) \cup \partial B_r^+(0)} (u(y)-v(y)) <0. \] Notice that $v$ is linear along the $e_n$ direction and $u$ is convex, we find that $v$ is strictly greater than $u$ on the boundary $\partial \Gamma_1:= \overline{\partial \Gamma \setminus \R^{n-1}} $. Then, $v(0)=u(0)$ means that $v+c_0$ will touch $u$ by above at some point $z \in \overline{\Gamma }\setminus \partial \Gamma_1$ for a proper $c_0 \in R$. Moreover, $\operatorname{det} D^2v=0 <1= \operatorname{det} D^2u $ implies $z \notin \Gamma $. Therefore, $z \in \partial \Gamma \cap R^{n-1}$. However, \[D_{n}v(z) = -\epsilon < -|a|r \leq az_1=D_{n}u(z), \] which contradicts the definition of viscosity supersolution. Thus, \eqref{viscosity sup equiv} is proved and \eqref{en growth neumann} follows by a direct integral. \end{proof} \begin{Corollary} \label{en continues} If $u$ is a viscosity solution to problem \eqref{liouville problem} and $y \in \partial \R_+^{n}$, then there exists an element $p\in \partial u(y)$ such that $p\cdot e_n=D_n u(y)$. \end{Corollary} \begin{proof} Without loss of generality we may assume $y=0$. Let $p_t= \nabla u(te_n) $ and $l_t(x):=u(te_n) +p_t \cdot (x-te_n)$ be the support function of $u$ at $te_n$. Lemmas 3.2 and 2.5 implies that $p_t$ is uniformly bounded as $t\to 0^+$. Then, as $t\to 0^+$, $\{l_t \}$ is pre-compact and contains a subsequence that converges to some support function $l(x):=u(0)+p \cdot x $ of $u$ at $0$. Hence $p\in \partial u(0)$ and $D_n u(te_n) =p_t \cdot e_n$ monotonically decreases to $p\cdot e_n$. Furthermore, by \eqref{viscosity sub equiv} and \eqref{viscosity sup equiv} we see that $p\cdot e_n=0=D_nu(0)$. \end{proof} \begin{Lemma} \label{linearized problem} Suppose $u$ is a viscosity solution to problem \eqref{liouville problem}. Then $D_n u \in C(\overline {\R_+^n})$ and $v(x):=D_nu(x)-D_nu(x',0)$ is a viscosity solution to following linearized problem: \begin{equation} \label{linearized equation} \begin{cases} U^{ij} D_{ij}v=0 & \text{ in } {\R_+^n}\\ v \geq 0 & \text{ on } \overline {\R_+^n} \\ v= 0 & \text{ on } {\partial \R_+^{n}} \end{cases}, \end{equation} where $U^{ij}$ is the cofactor of the Hessian $D^2 u$. \end{Lemma} \begin{proof} First, Lemmas $3.1$ and 2.13 means that $u\in C_{loc}^{\infty}({\R_+^n})$. Then it follows from the proof of Corollary \ref{en continues} that the family of continuous function $f_t(x')=D_nu(x',t)$ point-wisely decreases to function $f_0(x') =D_nu(x',0)=ax_1$ monotonically as $t\to 0^+$. Finally, the finite cover Lemma implies that this convergence is uniformly. Therefore $D_nu$ is continuous up to boundary. The linearized equation $U^{ij} D_{ij}v=0 $ comes directly from the equation $\operatorname{det} D^2u =1$. The other two in \eqref{linearized equation} follows from the convexity of $u$ and the continuity of $D_n u$ at the boundary. \end{proof} Next, we introduce two functions, $w^{y,+}(x)$ and $w^{y,-}(x)$, which will be used as the upper/below barriers of $v$ at $y$ to the linearized problem \eqref{linearized equation}. Given $y\in G_{\frac{1}{2}}^u(0)$ and consider the functions \begin{equation}\label{subtract support function} u^y(x)= u(x) -u(y)- \nabla u(y) \cdot (y-x) \end{equation} and \begin{equation} \label{test function} w^{y}(x) =u^y(x)-\frac{n}{2}x_nD_nu^y . \end{equation} { \sl Define \begin{equation} \label{sup sub test function} \begin{cases} w^{y,+}(x) =C_1[ w^{y}(x) +C_2x_n]\\ w^{y,-}(x) =c_1[x_n-c_2 w^{y}(x) ] \end{cases}. \end{equation} } Since $\operatorname{det} D^2u=1$, we have $ U^{ij}D_{ij} D_n u=0$ in $\R_+^n$. Hence \begin{equation} \label{sup sub test equationn} U^{ij}D_{ij}w^{y}=U^{ij}D_{ij}w^{0}= n \operatorname{det} D^2u-\frac{n}{2}(U^{in}D_{in}u+U^{ni}D_{ni}u)=0 \; \text{in}\; \R_+^n. \end{equation} \begin{Lemma} \label{sup solution to lip} Suppose that $u$ is a viscosity solution to problem \eqref{liouville problem} and \eqref{u=0 nabla u =0} is satisfied. If \begin{equation*} B_c^+(0) \subset S_1(0) \subset B_C^+(0) \end{equation*} and \begin{equation}\label{3.9} ||D_nu ||_{L^{\infty}(S_1(0))} \leq C, \end{equation} then, $w^{0,+}(x)$ defined in \eqref{sup sub test function} is the upper barrier of $v$ at $0$ to the linearized problem \eqref{linearized equation} in $S_1(0)$. (See \eqref{sup comparion} below). This implies \begin{equation}\label{en sup quadratic} D_n u(te_n) \leq Ct \ \ \text{and}\ \ u(te_n) \leq Ct^2 \end{equation} for all $t\geq 0$ such that $te_n\in S_1(0)$. \end{Lemma} \begin{proof} It follows from \eqref{3.9} that $$v(x)=D_nu(x)-D_nu(x',0)\leq C, \ \ \forall x\in S_1(0) $$ and $$u(x)-\frac{n}{2}x_nD_nu \geq 1-Cx_n, \ \ \forall x\in \partial S_1(0) \setminus G_1(0) .$$ In \eqref{sup sub test function} we choose $C_1$ and $C_2$ such that they are larger than the $C$. Then, $w^{0,+}(x) \geq C_1 $ on $ \partial S_1(0) \setminus G_1(0) $ by (3.6). This, together with \eqref{subtract support function}-\eqref{sup sub test equationn}, we see that \begin{equation} \label{sup comparion} \begin{cases} U^{ij} D_{ij}w^{0,+}=0 & \text{ in } S_1(0)\\ w^{0,+} \geq v & \text{ on } \partial S_1(0) \setminus G_1(0) \\ w^{0,+}\geq 0 =v & \text{ on } {G_1(0)} \end{cases}. \end{equation} Hence, the comparison principle implies that $ v(x) \leq w^{0,+}(x)$ in $S_1(0)$, which, together with the convexity, yields the desired \eqref{en sup quadratic}. \end{proof} \begin{Lemma} \label{sub solution by low bar} Under the assumption of Lemma \ref{sup solution to lip}, there exists a small $\bar{\sigma}>0$ depending on $\sigma_0$ such that if \begin{equation}\label{low bar assump} v(x) \geq \sigma_0(x_n)-\bar{\sigma} \text{ in } S_1(0), \end{equation} then $w^{0,-}(x)$ defined in \eqref{sup sub test function} is the lower barrier of $v$ at $0$ to the linearized problem \eqref{linearized equation} in $S_1(0)$ (see \eqref{sub quadratic} below). This implies that \begin{equation} \label{en sub quadratic} v(te_n) \geq ct\ \ and \ \ u(te_n) \geq ct^2 \end{equation} for all $t\geq 0$ such that $te_n\in S_1(0)$. \end{Lemma} \begin{proof} Denote $K=Cn||D_nu ||_{L^{\infty}(S_1(0))}$. Assume that $\bar \sigma >0$ is small and satisfies \[ \sigma_0^{-1}(2\bar \sigma) \leq \frac{1}{2K}.\] Recall that $ \sigma_0$ denotes a strictly increasing and continuous function from $[0, +\infty )$ to $[0, +\infty )$ with $\sigma_0(0)=0$. Let $c_0= \sigma_0^{-1}(2\bar{\sigma})$. By \eqref{low bar assump} and the convexity we have \[ v(x) \geq \max\{\sigma_0(x_n)-\bar{\sigma},0\} \geq \bar{\sigma} \chi_{\{x_n \geq c_0\}},\] where $\chi_E$ denotes the characteristic function of the set $E$, i.e., $\chi_E(x)=1$ if $x\in E$, otherwise $\chi_E(x)=0$. Take $c_1=\frac{\bar{\sigma}}{2c}$ and $c_2=2c_0$. We have \[w^{0}(x) \geq 1-Kx_n, \ \ on \ \ \partial S_1(0) \setminus G_1(0). \] Hence on $\partial S_1(0) \setminus G_1(0)$, we see that \begin{align*} w^{0,-}(x)& \leq c_1[x_n+c_2(Kx_n-1)] \\ & \leq c_1[(2x_n-c_2) \chi_{\{x_n \leq c_0\}}+2x_n\chi_{\{x_n \geq c_0\}}] \\ & \leq 2c_1 C\chi_{\{x_n \geq c_0\}} \\ & = \bar{\sigma} \chi_{\{x_n \geq c_0\}} \leq v(x). \end{align*} In conclusion, we have \begin{equation} \label{sub quadratic} \begin{cases} U^{ij} D_{ij}w^{0,-}=0 & \text{ in } S_1(0)\\ w^{0,-} \leq v & \text{ on } \partial S_1(0) \setminus G_1(0) \\ w^{0,-}\leq 0 =v & \text{ on } {G_1(0)} \end{cases}. \end{equation} The comparison principle implies that $ w^{0,-}(x) \leq v(x)$ in $S_1(0)$. In particular, $$v(te_n) \geq w^{0,-}(te_n) \geq c_1(t- Cc_2t)\geq \frac{c_1}{2}t$$ when $c_2=2\sigma_0^{-1}(2\bar \sigma)>0$ is small, which is equivalent to $\bar \sigma>0$ is small enough. This proves \eqref{en sub quadratic}. \end{proof} \begin{Corollary} \label{lip unversal by sup} Under the assumption of Lemma \ref{sup solution to lip}, there exists a small $\rho >0$ such that if \begin{equation} \label{lip unversal by eq} \sup_{B_{\rho}'(0)} || u(y' ,0)|| \leq \sigma_0 (\rho) \rho, \end{equation} then for any $y' \in B_{\rho}'(0)$ and $y=(y, 0)$, the function $w^{y,+}(x)$ defined in \eqref{sup sub test function} is the upper barrier of $v$ at $y$ to the linearized problem \eqref{linearized equation}. This also implies that $u^y(y+te_n) \leq Ct^2$ for small $t>0$ if $u(y)=0$ and $\nabla u(y)=0$. \end{Corollary} \begin{proof} If $\rho$ is small, the assumption implies that \[ \sup_{B_{\rho}'(0)} ||\nabla u (y' ,0|| \leq \min\{ \sigma_0 (\rho) , C\rho\} <<\frac{1}{2}. \] Then, the section \[ S_{\frac{1}{2}}(y) \subset S_{1-C|\nabla u(y)|}(y) \subset S_1(0). \] Regarding $y$ as $0$ in Lemma \ref{sup solution to lip}, we see that this corollary is a direct consequence of Lemma \ref{sup solution to lip}. \end{proof} Similarly, we have \begin{Corollary Under the assumption of Lemma \ref{sub solution by low bar}, there exists a small $\rho>0$ such that if \eqref{lip unversal by eq} holds, then for any $y' \in B_{\rho}'(0)$ and $y=(y, 0)$, the function $w^{y,-}(x)$ defined in \eqref{sup sub test function} is the lower barrier of $v$ at $y$ to the linearized problem \eqref{linearized equation}. This also implies $u^y(y+te_n) \geq ct^2$ for small $t>0$ if $u(y)=0$ and $\nabla u(y)=0$. \end{Corollary} \vspace{8pt} \section{Strict Convexity Lemma and Examples Recalling that if $u\in C(\overline{B_1^+(0) })$ is a convex function and satisfies \begin{equation}\label{4.1} \lambda\leq \operatorname{det}D^2u \leq \Lambda \text{ in } B_1^+(0), \end{equation} we can naturally {\sl define $$ D_n u(x',0) =\varlimsup_{t\to0+}D_n u(x',t) , \ \ \forall x' \in B'_1(0). $$} See Lemma 3.2 for the proof. In this section, we first study the strict convexity for such functions. The we provide an example showing that the growth assumption for the strict convexity is optimal. \begin{Lemma}\label{strict convex lemma half} Given positive constants $H, M_1$ and $ M_2$. Suppose that $u\in C(\overline{B_1^+(0) })$ is a convex function satisfying \eqref{4.1} and \begin{equation*} D_n u(x',0) \geq -M_2 \text{ in } B'_1(0) . \end{equation*} There exists $\sigma=\sigma (H,M_1, M_2, \lambda, \Lambda, n)>0 $ such that if $u$ satisfies \begin{equation*} 0 \leq u( x_1, x'',0 ) \leq \sigma + M_1|x''|^2 \text{ in } B_1'(0), \end{equation*} then \begin{equation*} \sup_{B_1^+(0) }u \geq H. \end{equation*} \end{Lemma} \begin{proof} Assume by way of contradiction that there exists $\sigma_k \to 0^+$ and convex functions $u_k$ defined on $B_1^+(0) \subset \R^n$, satisfying \[0 < \lambda \leq \operatorname{det} D^2u_k \leq \Lambda \text{ in } B_1^+(0) , \ D_n u_k(x',0) \geq -M_2 \text{ in } B'_1(0) ,\] \[ 0 \leq u_k(x_1, x'',0) \leq \sigma_k + M_1|x''|^2 \text{ in } B'_1(0) , \] and \[ \sup_{B_1^+(0) }u_k \leq H. \] Applying Lemma \ref{boundary nabla estimate} we see that $u_k$ is locally Lipschitz with $$||u_k||_{Lip(\overline{B_{4c}^+(0) })} \leq C(H+M_2).$$ Hence, \[u_k ( x ) \leq \sigma_k+ M_1|x''|^2 +C(H+M_2)|x_n| \text{ in } B_{4c}^+(0).\] Let $h_k= \sigma_k^{\frac{1}{2}}$ and $\D_k=\operatorname{diag}(1, h_k^{\frac{1}{2}}\I'', h_k) $. Consider the functions \[ v_k( x)= \frac{u_k( \D_k x)}{h_k},\ x\in \Omega_k:= \D_k^{-1}B_{4c}^+(0) .\] Then $0 < \lambda \leq \operatorname{det} D^2v_k \leq \Lambda $ in $ \Omega_k $, \[ v_k ( x ) \leq \sigma_k^{\frac{1}{2}}+ M_1|x''|^2 +C(H+M_2)|x_n| \text{ in } \D_k^{-1} B_{1}^+(0) \] and \[ D_n v_k(x',0) \geq -M_2 \text{ on } \D_k^{-1} B'_{1}(0) . \] Similar to Lemma \ref{boundary nabla estimate}, for any given $R>0$, we can prove that \[ ||v_k||_{Lip (B_R(0)\cap \Omega_k)} \leq C( H+M_1+M_2)R^2. \] Therefore, $v_k$ is locally uniformly Lipschitz, and there is a subsequence that locally uniformly converges to a convex function $v$ defined on $ \Om := [-4c,4c] \times \R^{n-1}$. Moreover, we have \begin{equation} \label{4.2} 0 < \lambda \leq \operatorname{det} D^2v \leq \Lambda, \end{equation} and \begin{equation} \label{4.3} v( x ) \leq M_1|x''|^2 +C(H+M_2)|x_n| \text{ in } B_{4c}^+(0) , \ D_n v(x',0) \geq -M_2 \text{ on } B_R'(0). \end{equation} Furthermore, \eqref{4.3} implies that \begin{equation}\label{4.4} a(x_1 )= \lim_{t \to 0^+}\frac{ v (x_1, 0,t )}{t} \end{equation} is well-defined, and \[ -M_2 \leq a(x_1) \leq C( H+M_2).\] Again, we can consider the blow-up of $v$ along axis $e_1$ by taking $$\bar{h}_k= 2^k, \; \bar{\D}_k:=\operatorname{diag}(1, \bar{h}_k^{\frac{1}{2}}\I'', \bar{h}_k), \; \bar{v}_k( x)= \frac{v( \bar{\D}_k x)}{\bar{h}_k}, \; x\in\bar{\D}_k^{-1}\Om .$$ The limit $\bar{v}$ still satisfies \eqref{4.2}, \eqref{4.3}. And \eqref{4.4} gives \[ \bar{v}( x_1, 0,x_n )= a(x_1)x_n.\] Obviously, $\nabla \bar v(e_n) \cdot e_n=a(x_1)$. The non-negative function \[w(x)=\bar v(x)-\bar v(e_n) -\nabla \bar v(e_n) \cdot x, \] is zero on the line $te_n$. This is, $w$ is bounded on a convex domain with infinite volume. However, $ 0 < \lambda \leq \operatorname{det} D^2w \leq \Lambda$, which contradicts with Lemma 2.11. \end{proof} \begin{Lemma} \label{strict convex lemma plane} Given positive constants $H$ and $M_1 $. Suppose $u\in C(\overline{B_1(0) })$ is a convex function satisfying \begin{equation*} \lambda \leq \operatorname{det} D^2u \leq \Lambda \text{ in } B_1(0). \end{equation*} There exists $\sigma=\sigma (H,M_1, M_2, \lambda, \Lambda, n)>0 $ such that if $u$ satisfies \begin{equation*} 0 \leq u( x_1, x'',0 ) \leq \sigma + M_1|x''|^2 \text{ on } B_1'(0), \end{equation*} then \begin{equation*} \sup_{B_1(0) }u \geq H. \end{equation*} \end{Lemma} \begin{proof} Assume by way of contradiction that $\sup_{B_1(0) }u < H$. Then, the assumption of Lemma \ref{strict convex lemma plane} immediately implies that $u \in Lip(B_c(0))$ and $|\nabla' u(0)| \leq C(\sigma+\sigma^{\frac{1}{2}})$( See Lemma 2.6). After subtracting the supporting function $u(0)+\nabla u(0) \cdot x$ at $0$, $u$ satisfies the assumption of Lemma \ref{strict convex lemma half} with $M_2=\sigma+\sigma^{\frac{1}{2}}$. Applying Lemma \ref{strict convex lemma half} we obtain a contradiction, completing the proof. \end{proof} We point that the constant $\sigma $ in the growth assumption of Lemma 4.1 and 4.2 can not be allowed to be zero. Otherwise, the constant $H$ may tend to $\infty$, yielding a contradiction. Moreover, the following example shows that the growth exponent $2$ is optimal. \begin{Example} Suppose $n \geq 3$, constants $1<a ,b <\infty$ and $\delta >0$ is small such that $$\frac{1}{a}=\frac{1}{2}+\frac{1}{n-2}\delta,\; 1-\delta =\frac{1}{b} .$$ Let \[E_1:=\{x' \in \R^{n-1}: \; |x''|^a \geq |x_1|^b\} ,\ \ E_2:=\{x' \in \R^{n-1}: \;|x_1|^b \geq |x''|^a \} . \] Consider the function \begin{equation}\label{4.8} W_{a,b}(x')=\begin{cases} |x''|^{a}+|x''|^{a-\frac{2a}{b}}|x_1|^2, &x\in E_1 \\ \frac{2b+a-ab}{b}|x_1|^{b}+\frac{ab-a}{b}|x_1|^{b-\frac{2b}{a}}|x''|^2,& x\in E_2 \end{cases} \end{equation} and \begin{equation}\label{4.9} W(x)= (1+x_n^2)W_{a,b}(x'). \end{equation} We will show that there is a $\rho=\rho (\delta)>0$ such that $ W$ is a convex function in $R^{n-1}\times (-\rho, \rho) )$ satisfying \begin{equation}\label{4.10} c(\delta)\leq \operatorname{det} D^2W \leq C(\delta), \ D_nW(x',0)=0 \; \text{in}\; R^{n-1}\times (-\rho , \rho ). \end{equation} \end{Example} \begin{proof} Notice that $W \in C^1(\R^n) \cap C^2(\R^n\setminus \{x'=0\})$, $\nabla W (\{x'=0\}) \subset \{x'=0\}$ and the n-dim Hausdroff measure of the set $\nabla W (\{x'=0\}) $ is zero. The second equation in \eqref{4.10} is obvious. Hence, it is enough to show that $W$ is convex and satisfies the first inequality in \eqref{4.10} in the sense of (Alexandrov) generalized solution. For this purpose, we need to calculate $\operatorname{det} D^2 W$ at any point $x'\neq 0$. It is easy to see that \begin{equation*} D^2 W= \left[ \begin{array}{cc} (1+x_n^2)D'^2 W_{a,b}& 2x_nD' W_{a,b} \\ 2x_nD' W_{a,b} & 2 W_{a,b} \end{array} \right]. \end{equation*} So the convexity of $W$ and $\det D^2W$ is reduced to the study of the matrix \begin{equation*} \A= \left[ \begin{array}{cc} (1+x_n^2)D'^2 W_{a,b}-2W_{a,b}^{-2}x_n^2D' W_{a,b} \otimes D' W_{a,b} & 0 \\ 0 & 2 W_{a,b} \end{array} \right]. \end{equation*} First, we assume $x'\in E_1$. Then $$ |x''|^a \leq W_{a,b} \leq 2 |x''|^a ,\ \ \forall x'\in E_1 . $$ Set the matrix functions $$\K_1'(x'')=\operatorname{diag}\{ |x''|^{a-\frac{2a}{b}}, |x''|^{a-2}\I'' \} , \ \ \K_1 (x'')=\operatorname{diag}\{\K_1', |x''|^{a}\}.$$ Then by the assumption on $a$ and $b$ we have \begin{equation} \label{4.11} \operatorname{det} \K_1 =|x''|^{2a(\frac{n}{2}-\frac{1}{b}-\frac{n-2}{a})}\equiv 1. \end{equation} Observing that $C(a, b)$ can be written as $C(\delta)$, we have \[0 \leq 2W_{a,b}^{-2}D' W_{a,b} \otimes D' W_{a,b} \leq C(\delta) \K_1' ,\ \ D'^2 W_{a,b} \leq C(\delta) \K_1',\ \ \forall x'\in E_1 . \] Hence, in $E_1$ we have \begin{equation} \label{4.12} C(\delta) \K_1 \geq \A \geq \left[ \begin{array}{cc} (1+x_n^2)D'^2 W_{a,b}- x_n^2 C(\delta)\K_1' & 0 \\ 0 & C(\delta)|x''|^{a} \end{array} \right]. \end{equation} Since $|x_n |\leq \rho$ will be small, by \eqref{4.11}-\eqref{4.12} we can conclude the convexity of $W$ and the first inequality in \eqref{4.10} after we prove \begin{equation}\label{4.13} D'^2 W_{a,b} \geq \epsilon(\delta) \K_1', \ \ \forall x'\in E_1 . \end{equation} Denote \[\B_1=\sqrt{\K_1'},\ X=|x''|^{-1}x'', \ y= |x_1||x''|^{-\frac{a}{b}} \] and \[ m=a[\I''+(a-2)X\otimes X]+ (a-\frac{2a}{b})[\I''+(a-\frac{2a}{b}-2)X\otimes X] y.\] By a direct calculation we have \begin{equation}\label{4.14}\B_1^{-1}D'^2 W_{a,b} \B_1^{-1} = \left[ \begin{array}{cc} 2& 2 (a-\frac{2a}{b}) yX\\ 2 (a-\frac{2a}{b}) yX^{T} & m \end{array} \right]. \end{equation} Observe that \begin{equation}\label{4.15} m-2(a-\frac{2a}{b})^2 |y|^2 X\otimes X= f_1 \I''-f_2 X\otimes X \end{equation} where, $ f_1= 2a-\frac{2a}{b}$ and \[ f_2 =2(a-\frac{2a}{b})^2y^2-(a-\frac{2a}{b})(a-\frac{2a}{b}-2)y^2-a(a-2).\] Notice that \begin{align*} 2(a-\frac{2a}{b})^2-(a-\frac{2a}{b})(a-\frac{2a}{b}-2) &=(a-\frac{2a}{b})(a-\frac{2a}{b}+2) \\ &= a (a-\frac{2a}{b})(\frac{1}{n-2}-1)\delta \\ & \geq 0. \end{align*} Obviously, $|y|\leq 1$ in $E_1$. Recall $\delta $ is small, $ a\geq \frac{2a}{b}-a \geq \frac{7}{4} >\frac{3}{2}$, thus we get \[ f_1-f_2 \geq (a-\frac{1}{2})^2-(\frac{2a}{b}-a-\frac{1}{2})^2 \geq c[a-(\frac{2a}{b}-a)]\geq c\delta a.\] Since \[ \I''- X\otimes X \geq 0,\] we obtain \[ m-2(a-\frac{2a}{b})^2 |y|^2 X\otimes X \geq ca\delta \I''.\] Replacing this in \eqref{4.15} and using \eqref{4.13}-\eqref{4.14}, we finally obtain \eqref{4.13}. Second, we assume $x\in E_2$. Then we have $$c(\delta)|x_1|^b \leq W_{a,b} \leq C(\delta)|x_1|^b .$$ Denote $$ \K_2'=\operatorname{diag}\{ |x_1|^{b-2}, |x_1|^{b-\frac{2b}{a}} \I'' \} \; \text{ and}\; \K_2 =\operatorname{diag}\{\K_2', |x_1|^{b}\}.$$ Then \[ \operatorname{det} \K_2 =|x_1|^{2b(\frac{n}{2}-\frac{1}{b}-\frac{n-2}{a})}\equiv 1.\] Similar to the first case in $E_1$, it is enough to show that \begin{equation}\label{4.16} D'^2 W_{a,b} \geq \epsilon(\delta) \K_2'\ \ in E_2 . \end{equation} Denote \[\B_2=\sqrt{\K_2'},\ Y = |x''|^{-1} x'',\ y\ =|x_1|^{-\frac{b}{a}}|x''|\] and $$ d=(2-a\delta)b(b-1)+a\delta (b-\frac{2b}{a})(b-\frac{2b}{a}-1)y^2.$$ By a direct calculation we obtain \begin{equation}\label{4.17} \B_2^{-1}D'^2 W_{a,b} \B_2^{-1} = \left[ \begin{array}{cc} d & 2 a\delta (b-\frac{2b}{a}) yY\\ 2a\delta (b-\frac{2b}{a}) yY & 2 a\delta \I'' \end{array} \right] . \end{equation} Write \[ d-2a\delta(b-\frac{2b}{a})^2 y^2 |Y|^2=g_1-g_2 y^2 , \] where \begin{align*} g_2 &=a\delta (b-\frac{2b}{a})(b-\frac{2b}{a}-1)-2a\delta(b-\frac{2b}{a})^2\\ &=\delta b^2(2-a)(\frac{2}{a}+\frac{1}{b}-1) \\ & \geq 0 \end{align*} Obviously, $|y|\leq 1$ in $E_1$. If $\delta >0 $ is small, we have \begin{align*} d-2a\delta(b-\frac{2b}{a})^2 y^2 |Y|^2 & \geq b^2 \delta[(2-a\delta)+a\frac{2\delta }{n-2} (1-\frac{2}{a}-\frac{1}{b})- 2a(\frac{2\delta }{n-2})^2 ] \\ & \geq cb^2 \delta, \end{align*} which, together with \eqref{4.17}, implies the desired \eqref{4.16}. \end{proof} \begin{Remark} Suppose that $R>0$, $W$ is given by \eqref{4.8}-\eqref{4.9}, and consider the Dirichlet problem \begin{equation}\label{4.18} \begin{cases} \operatorname{det} D^2 W_R^+ =c(\delta) & \text{ in } B_{R}'(0) \times [-\rho, \rho]\\ W_R^+ =W & \text{ on } \partial (B_{R}'(0) \times [-\rho, \rho]). \end{cases}. \end{equation} It is known that there exists a convex solution $W_R^+ $, which is still symmetric about $x_n=0$ since so is $W$. This is to say \[D_nW_R^+(x',0)=0.\] Comparison principle (Lemma \ref{comparison principle}) implies \[W_R^+ \geq W \geq 0\] if $c(\delta)>0$ is small. The convexity means \[ W_R^+(x',t) \leq \max \{W_R^+(x',\rho), W_R^+(x',-\rho)\} \leq 4W(x',0),\ \ x\in B_{R}'(0), t\in [-\rho, \rho]. \] and it follows that \[ W_R^+(te_n) =0. \] This mean $W_R^+$ has the same asymptotic behavior around $0$ as $W$. \end{Remark} \section{Good Shape Lemma} In this section, we assume that $u$ is a viscosity solution to problem \eqref{liouville problem}, satisfying \eqref{u=0 nabla u =0} and the hypothesis of Theorem \ref{liouville theorem}. We are going to prove that its height section $S_h:=S_h^u(0)$ (defined by \eqref{2.5}) is of good shape for large $h$, then we will introduce the normalization family $(u_h, S_1^h)$ of $(u, S_h)$. At first, we mention here that the good shape property is invariant under any linear transform of the form $\A=\operatorname{diag}\{\A',a_n\}$ with $c\leq a_n, \; \operatorname{det} \A' \leq C$. Let $p_h$ be the mass center of $S_h $, and consider the {\sl sliding transformation} \[\A_h^c x=x- \sum_{i=1}^{n-1}\frac{p_h \cdot e_i}{p_h\cdot e_n} x_n e_i. \] Take $y_h \in \overline{\P (\A_h^cS_h )}$ such that \[ |y_h \cdot e_1|=\sup\{ x\cdot e_1 |\, x\in \P (\A_h^cS_h )\}\] and consider another sliding transformation \[\A_h x=x- \sum_{i=2}^{n-1}\frac{y_h \cdot e_i}{y_h\cdot e_1} x_1 e_i . \] Apply John's lemma (Lemma \ref{Jhon Lemma}) to $\{x'' \in R^{n-2} |\, (x_1,x'', 0) \in \A_h \P (\A_h^cS_h )\}$, we can find a new coordinates $\{e_i\}_{i=1}^n$ which keeps $e_1$ and $e_n$ (or only $e_n$ for $\A_h^c $) invariant such that \[ \D_h B_{1}(q_h) \subset \A_h \A_h^c S_{h} \subset \D_h B_{C (n)}(q_h) \subset \D_h B_{2C (n)}^+(0),\] where $q_h= \A_h \A_h^c p_h$, $\D_h :=\operatorname{diag}(d_{1}(h), \cdots, d_n(h))$ is the diagonal matrix satisfying $$ \Pi_{i=1}^n d_{i}(h)=\operatorname{det}\D_h=Vol(S_h).$$ It follows from Lemma \ref{volume bound by measure} that $\operatorname{Vol} (S_{h}) \leq Ch^{\frac{n}{2}}$. Denote $$\tau_h= \frac{(\operatorname{det}\D_{h})^{\frac{1}{n}}}{h^{\frac{1}{2}}}, \; \bar{\D_h}=\tau_h^{-1} \D_{h}:= \operatorname{diag}(\bar{d}_{1}(h), \cdots, \bar{d}_n(h)).$$ We first consider the rescaling $(u_h, S_1^h )$ of $(u, S_h)$ given by \begin{equation} \label{normalization tau definition} {u}_{h}(x)= \frac{u( {\A}_{h} ^{-1} \bar{\D_h} x)}{h}, \ \ x \in S_1^h := \bar{\D_h}^{-1}{\A}_{h} S_{h}, \end{equation} then we have \begin{equation} \label{nomailzaition slide en} {\A}_{h}^* B_{\tau_h }(x_h) \subset S_1^h \subset {\A}_{h}^* B_{C (n)\tau_h }(x_h) \subset \{ x_n \leq 2\tau_n C(n)\} \end{equation} for some $x_h$, where \[ A_h^*= \bar{\D_h}^{-1} \A_h \A_h^c \A_h^{-1}\bar{\D_h} \] is still a sliding transformation of the form $ A_h^*x=x-\sum_{i=1}^{n-1}\beta_h^i x_ne_i$. We use the notation $G_1^{h} := S_1^h \cap \partial \R_+^{n}$ similar to \eqref{boundary innitial def}. And we will simplify ${S}_t^{h}, {G}_t^{h}$ by ${S}_t,{G}_t$ when the dependence on $h$ and ${u}_h$ is self-evident from the context. In Section 7, we will use the corresponding notations $S_t^R, G_t^R$ for the $(u_R, S_1^R)$ as we just defined $S_1^h ,G_1^h$ for $(u, S_1)$. Now, the Neumann problem \eqref{liouville problem} becomes \begin{equation} \label{nomailzaition tau equation} \begin{cases} \operatorname{det}D^2 {u}_h=1 & \text{ in } {S}_1^h\\ D_{n} {u}_h =a_h x_1 & \text{ on } {G}_1^h \\ {u}_{h}=1 & \text{ on } \partial {S}_1^h \setminus {G}_1^h \end{cases} \end{equation} where \begin{equation} \label{nomailzaition tau neumann equation} a_h =\frac{\bar{d}_1(h)\bar{d}_n(h)}{h}a. \end{equation} Recall that if $n\geq 3, $ $u\in \Theta $ and \eqref{growth innitial assump} is satisfied. Let \begin{equation*} \delta_h=\frac{K}{h}, \ \bar{\Q}_h=\frac{C\bar{\D_h}''^TI'' \bar{\D_h}''}{h}. \end{equation*} We have \begin{equation} \label{nomailzaition tau growth equation} u_h(0,z,0) \leq z^T \bar \Q_h z +\delta_h, \; \forall z\in R^{n-2} \end{equation} and \begin{equation} \label{nomailzaition tau aQ equation} a_h^2 \operatorname{det}\Q_h = C^n \tau_h ^{-2n} \frac{(\operatorname{det}\D_{h})^2}{h^{n} }a^2 \leq C . \end{equation} If $h \geq 2K$, \eqref{growth innitial assump} also implies $d_i(h) \geq ch^{\frac{1}{2}}$ for $2 \leq i \leq n-1$. More precisely, \[ \Pi_{i=2}^{n-1}\bar{d}_i(h) \geq C\tau_h^{-\frac{n-2}{2}}\operatorname{Vol}_{n-2}(S_h(0) \cap \R^{n-2} )\geq Ch^{\frac{n-2}{2}}.\] Therefore $\operatorname{det}\Q_h \geq c $ and $0 \leq a_h \leq C$. To conclude, we have obtained that \begin{equation} \label{nomailzaition tau general assump} 0 \leq a_h \leq C, \ \ u_h\in \Theta (\delta_h), \ \ \forall h \geq 2K . \end{equation} The Good Shape Lemma is stated as follows. \begin{Theorem}[Good Shape] \label{good shape theorem} For large $h$, the normalization $(u_h,S_1^h)$ given by \eqref{normalization tau definition} satisfies \begin{align} \label{good shape cover} & \ \P S_1^h(0) \subset C\P G_1^h(0) \text{ and } S_1^h(0) \subset B_{C (n)\tau_h }(0),\\ \label{good shape volume} & \ c \leq \operatorname{Vol}(S_1^h(0)) \leq C \; \text{ and } \; c\leq \tau_h \leq C , \\ \label{good shape symmetric} & \ \P G_1^h(0) \subset -C\P G_1^h(0). \end{align} \end{Theorem} We are going to prove the theorem by the coming three lemmas. \begin{Lemma} \label{gs cover lemma} The normalization $(u_h,S_1^h)$ given by \eqref{normalization tau definition} satisfies \eqref{good shape cover} for large $h$. More precisely, \begin{equation*} \P S_1^h(0) \subset (1+C|a_h|) \P G_1^h(0) \subset C\P G_1^h(0). \end{equation*} \end{Lemma} \begin{proof} If there exists an unit direction $e, e\bot e_n$ such that \[ \frac{\sup \{s |\, se\in \P S_1^h(0)\}}{\sup \{s |\, te\in \P G_1^h(0), \ \forall t\in (0,s)\}} \geq M >1. \] We assume that the maximum values are attained at points $y$ and $z$ respectively: $$ y=y_ee+y_ne_n\in \partial \overline{S_1^h(0)}, \ \ z=z_ee \in \partial \overline{G_1^h(0)}.$$ It is clear that \begin{equation} \label{5.11} u(z)=u(y)=1, \ \ y_e \geq Mz_e, \ \ 0< y_n \leq C, \end{equation} where we have used \eqref{nomailzaition slide en} for the last inequality. Since the transforms $ \A_h^*$ leaves $\R^{n-1}$ invariant, we have $|z| \leq C$. Let \[l_{y,0}=\{sy,\ s\in (0,1)\} ,\] \[ l_{z}^{e_n}=\{z+t e_n, \ t\in [0,\infty)\} .\] There exists a point $p= sy=z+ty_ne_n \in l_{y,0} \cap l_{z}^{e_n} $ with $s,t\in (0,\frac{1}{M}]$. By convexity, \eqref{u=0 nabla u =0} and \eqref{5.11} we have \[u(p) \leq s u(y) +(1-s)u(0) \leq \frac{1}{M} .\] However, Lemma \ref{viscosity neumann equiv}, \eqref{5.11}, the convexity again, and the fact $|z| \leq C$ implies that \[u(p) \geq u(z)+t y_n D_{n}u(z) \geq 1+ta_hy_nz\cdot e_1 \geq 1- C t|a_h|y_n \geq 1-\frac{C|a_h|}{M}.\] These two inequalities mean that $M \leq 1+C|a_h| \leq C$ by \eqref{nomailzaition tau general assump}, which implies $S_1^h(0) \subset B_{C (n)\tau_h }(0)$. Combining this and (5.2) we have \[S_1^h \subset \{x_n \leq C\tau_h\} \cap\{ CG_1^h \times [0,\infty]\} \subset B_{C\tau_h }(0).\] \end{proof} \begin{Lemma} \label{gs volume lemma} The normalization $(u_h,S_1^h)$ given by \eqref{normalization tau definition} satisfies \eqref{good shape volume} for large $h$. \end{Lemma} \begin{proof} Since $\operatorname{det}\D_h=Vol(S_h)\le Ch^{\frac{n}{2}}$ by Lemma 2.11, we see that $\tau_h\leq C$ by its definition. Notice that $$\tau_h^{ n} \sim \operatorname{Vol}(S_1^h(0))= \tau_h^{ n} \operatorname{\A _h}\sim \tau_h^{ n} .$$ It is enough for (5.9) to prove that $\tau_h \geq c$. Consider the function $\upsilon$ defined by \[ \upsilon(x)=\tau_h^{-1}\left(\frac{| x|^2 }{8C_n^2}+\frac{x_n}{2C_n}\right). \] If $\tau_h>0$ is small, by \eqref{nomailzaition tau equation}, \eqref{nomailzaition tau general assump} and \eqref{good shape cover} we have \[\upsilon \leq \tau_h^{-1}\left(\frac{\tau_h^2}{8}+ \frac{\tau_h}{2}\right) < 1 \leq u_h \; \text{ on } \partial S_1^h \setminus G_1^h , \] \[\operatorname{det} D^2\upsilon \geq c\tau_h^{-n}>1 =\operatorname{det} D^2u_h\; \text{ in } S_1^h,\] and \[D_{n}v\geq \frac{1}{2C_n\tau_h} > C \geq D_{n}u_h\; \text{ on } G_1^h. \] By comparison principle (Lemma \ref{comparison principle for mixed problem}) $v <u_h$ in $S_1^h$ , which contradicts $v(0)=0 = u_h(0)$. Therefore $\tau_h \geq c$.\\ \end{proof} \begin{Lemma} \label{gs sym lemma} The normalization $(u_h,S_1^h)$ given by \eqref{normalization tau definition} satisfies \eqref{good shape symmetric} for large $h$. \end{Lemma} \begin{proof} Lemmas 5.2 and 5.3 mean that $\tau_h$ is between two positive universal constants, and \begin{equation} \label{5.12} \P S_1^h \subset C \P G_1^h \text{ and } B_c(x_h) \subset S_1^h \subset B_C(0) \end{equation} for some $x_h\in R_+^n$. Therefore, we only need to show $\P G_1^h$ is balance about $0$, this is \begin{equation} \label{5.13} \P {G}_1^h \supset B_c'(0). \end{equation} Let $M \geq 4n^{4n}C^{4n}$ is large universal, $\theta = M^{-\frac{1}{n+1}}$, $m=M^{-1}$ and $\delta = \frac{1}{ M^3 }$ is small enough. On the contrary to (5.13), there would exist a $p=(p_1, p'') \in \partial \P{G}_1^h $ such that \begin{equation}\label{point distant less than delta} |p|=\operatorname{dist}(0,p)=\operatorname{dist}(0,\partial \P {G}_1^h ) \leq \delta. \end{equation} Without loss of generality, we may assume that $p_1 \geq 0$. There are two cases: Case 1:\; $ |a_h| \geq CM^{-1}$. Then we have $$ \max\{d_2(h), \cdots, d_{n-1}(h) \}\leq CMh^{\frac{1}{2}},$$ which means that \[ B_{cM^{-1}}''(0) \subset \P {S}_1^h(0) \subset B_C'(0) .\] By convexity and \eqref{point distant less than delta}, we get \[ \sup \{x_1| x \in {G}_1^h\} \leq CM\delta \leq \frac{C}{M}.\] Therefore, \eqref{nomailzaition tau general assump} and the Neumann condition in \eqref{nomailzaition tau equation} implies \[ |D_nu_h(x',0) | \leq \frac{C}{M}, \text{ on } x_1\geq -\frac{1}{M}. \] Case 2:\; $ |a_h| \leq CM^{-1}$. Then \[ |D_nu_h(x',0) | \leq \frac{C}{M}, \text{ on } {G}_1^h . \] Next, we consider a new coordinate with zero as based point, axis ${e}_1= p/|p|$ and $e_i (i \geq 2) $ unchanged. For simplicity, we still use the notation $(e_1, e_2,\cdots , e_n)$. In both cases, consider the domain $E= \{x\in S_1^h| x_1 > -\frac{1}{M}\}$. Then $ \partial E=E_1 \cup E_2\cup E_3$, where \[ \begin{array}{l} E_1=\overline{E}\cap \{ x_1 = -\frac{1}{M}\}, \\ E_2=\overline{E}\cap G_1^h \cap \{ x_1 > -\frac{1}{M}\} ,\\ E_3 =\overline{E}\cap ( \partial S_1^h \setminus G_1^h ). \end{array} \] For the function \[ \upsilon(x)=\left[Q(Mx_1) +\theta \sum_{i=2}^{n}Q(\frac{x_i}{ C}) \right] \] where $Q(t)= \frac{1}{4nC^2}(\frac{t^2}{2}+2t), $ we claim that \begin{equation}\label{gs sym com equ} \begin{cases} \operatorname{det} D^2 {u_h} < \operatorname{det} D^2\upsilon & \text{ in } E\\ D_{-x}{u_h} < D_{-x}\upsilon & \text{ on } E_1 \\ D_{n} {u_h} < D_{n}\upsilon & \text{ on } E_2 \\ \upsilon < {u_h} &\text{ on } E_3\\ \end{cases} . \end{equation} By comparison principle (Lemma \ref{comparison principle for mixed problem}) we have $ \upsilon < u_h$ in $E$. This would contradict $\upsilon(0)= u_h(0)$ and hence \eqref{5.13} is proved. Finally, let us verify \eqref{gs sym com equ}. First, by convexity and \eqref{u=0 nabla u =0} we see that $$D_{-x}{u_h}=-D {u_h}\cdot x \leq u_h(0)-u_h(x) \leq 0 $$ holds in viscosity sense. Applying this, the results of Case 1 and 2, and the largeness of $M$, we have: in $E$, $\operatorname{det} D^2 \upsilon \geq CM^2 \theta^{n-1} >1=\operatorname{det} D^2 {u_h}$; on $E_1$, $D_{-x}\upsilon \geq c-\theta \sum_{i=2}^{n-1}C >0 \geq D_{-x} u_h$; on $E_2$, $D_{n}\upsilon \geq c\theta >\frac{C}{M} \geq D_{n}u_h $; on $E_3$, $\upsilon\leq \frac{3}{4} <1={u_h}$. \end{proof} In this way, we have proved Theorem 5.1. Since $c\leq \tau_h\leq C$, we can still take $$\D_h =\operatorname{diag}\{ d_1(h), \cdots , d_n(h)\}$$ in \eqref{normalization tau definition} instead of $\bar \D_h$. This yields the definition of normalization family. \begin{Definition}\label{normal definition} The normalization family $(u_h,S_1^h) $ of $(u, S_h)$ is defined as \begin{equation} \label{normal function} {u}_{h}(x)= \frac{u( {\D_h}{\A}_{h} ^{-1} x)}{h}, \ x \in S_1^h: = {\A}_{h}{\D_h}^{-1} S_{h}. \end{equation} \end{Definition} By \eqref{section innitial assump}, \eqref{nomailzaition tau equation}-\eqref{good shape symmetric}, we have the following properties for large $h$: {\sl \begin{equation} \label{normal section} B_{c}^+(0) \subset S_1^h \subset B_{C }(0) , \end{equation} \begin{equation} \label{normal equation} \begin{cases} \operatorname{det}D^2 {u}_h=1 & \text{ in } {S}_1^h\\ D_{n} {u}_h =a_h x_1 & \text{ on } {G}_1^h \\ {u}_{h}=1 & \text{ on } \partial {S}_1^h \setminus {G}_1^h \end{cases} \end{equation} where \begin{equation} \label{normal neumann} a_h =\frac{{d}_1(h){d}_n(h)}{h}a, \end{equation} \begin{equation} \label{normal growth} u_h(0,z,0) \leq z^T \Q_h z +\delta_h \end{equation} where \begin{equation}\label{normal Qdelta} \delta_h=\frac{K}{h}, \ \bar{\Q}=\frac{C{\D_h}''^TI'' {\D_h}''}{h}, \end{equation} and \begin{equation} \label{normal genral assump} 0\leq a_h \leq C\text{ and } a_h^2 \operatorname{det} \Q_h \leq C. \end{equation} Moreover, Theorem 5.1 still holds for the normalization family $(u_h,S_1^h) $. } \section{Stationary Theorem} In this section, we study the normalization family $(u_h, S_1^h)$ given by \eqref{normal function} in the case $a_h$ is small. For simplify we omit $h$ and write it by $(u,S_1 )$. This leads us to study the standard model \begin{equation} \label{6.1} \begin{cases} \operatorname{det}D^2 {u}=1 & \text{ in } {S}_1\\ D_{n} {u} =a x_1 & \text{ on } {G}_1 \\ {u}=1 & \text{ on } \partial {S}_1 \setminus {G}_1 \end{cases} \end{equation} and \begin{equation} \label{6.2} u(0)=0 , \ \nabla u(0)=0,\ u\geq 0 \; in \; S_1, \ B_{c}^+(0) \subset S_1 \subset B_{C }(0) . \end{equation} For every $a\in R$, set \begin{equation} \label{6.3} Q_{a} (x):= \frac{1}{2}\left[\sqrt{1+a^2}(x_1^2+x_n^2)+2ax_1x_n+\sum_{i=2}^{n-1}x_i^2\right]. \end{equation} Obviously, $\operatorname{det}D^2 Q_{a} (x) \equiv 1 $ and $D_n Q_{a} (x', 0)= ax_1$. We will prove the following \begin{Theorem} \label{stationary thm} Suppose that $u\in (\overline{S_1})$ is a viscosity solution to problem \eqref{6.1} and \eqref{6.2} is satisfied. There exists universal constants $b_0>0$, $c_0>0$ such that if \begin{equation} \label{6.4} \begin{split} ||u-Q_a||_{L^{\infty}(S_1^{Q_a}(0))}+ ||D_nu-D_nQ_a||_{L^{\infty}(S_1^{Q_a}(0) )} \leq b_0, \end{split} \end{equation} then $u \in C^{2,\alpha}(\overline{B_{c_0}^+(0)})$ for some $\alpha >0$ and \[||u||_{C^{2,\alpha}(\overline{B_{c_0}^+(0)})} \leq C.\] \end{Theorem} With this theorem, we will also show \begin{Theorem}\label{zero petrub neumann} Suppose that $u\in (\overline{S_1})$ is a viscosity solution to problem \eqref{6.1} and \eqref{6.2} is satisfied. There exists universal constants $\delta_0>0$, $c_0>0$ such if $ a \in (- \delta_0, \delta_0)$, then then $u \in C^{2,\alpha}(\overline{B_{c_0}^+(0)})$ for some $\alpha >0$ and \begin{equation} \label{6.6} \begin{split} ||u||_{C^{2,\alpha}(\overline{B_{c_0}^+(0)})} \leq C. \end{split} \end{equation} \end{Theorem} Denote \begin{align*} \F_{a}^* (x): =& \{ Q|\, Q(x)=\sum_{i, j=1}^na^{ij}x_ix_j \text{ is a quadratic polynomial,} \\ & \text{ and } Q \text{ solves the first and second equations of problem }\eqref{6.1} \} \end{align*} and \[ \F_{a} (x):= \{ l(x')+Q(x)|\, Q \in \F_a^*, l(x') \text{ is a linear function }, l(0)=0 \}.\] Theorem \ref{stationary thm} relies on the following Lemma. \begin{Lemma} \label{station lemma} Let $u \in C(\overline{S_1(0)})$ be a viscosity solution to problem \eqref{6.1}, and satisfy \eqref{6.2}. For any small constant $\mu>0$, there exists a small $\epsilon_0=\epsilon_0(\mu)>0$ such that if \begin{equation} \label{6.9} ||u-P||_{L^{\infty}(S_1)} \leq \epsilon ,\ \ ||D_nu-D_nQ||_{L^{\infty}(S_1)} \leq C \epsilon \end{equation} for some $\epsilon \in (0, \epsilon_0) $ and $P(x)=l(x') +Q(x) \in \F_{a}$, then \begin{equation} \label{6.10} |Dl|\leq C\epsilon^{\frac{1}{2}}, \end{equation} and \begin{equation} \label{6.11} |u-P^0| \leq C \epsilon \mu^{\frac{3}{2}}, \ \ |D_nu-D_nQ^0|\leq C\epsilon \mu \text{ in } S_{\mu}^{Q^0} \end{equation} for some $P^0=l^0+ Q^0 \in \F_{a}$. Moreover, \begin{equation} \label{6.12} |D^2Q-D^2Q^0|\leq 2\epsilon \text{ in } S_{\mu}^{Q^0}. \end{equation} \end{Lemma} \begin{proof} By virtue of the fact $l(0)=0 $, \eqref{6.9} gives $|D l| \leq C\epsilon$. One can choose $x=(x', 0)\in G_1$ such that $$-l(x')=\frac{1}{n}|Dl||x'| \, \text{ and }\; |x'|\sim \epsilon^{\frac{1}{2}}.$$ It follows from \eqref{6.2} and \eqref{6.9} that \begin{align*} \frac{1}{n} |Dl||x'| =-l(x') & \leq u(x',0)-l(x') \\ & \leq |u(x, 0)-l(x')-Q(x', 0))| +|Q(x',0)| \\ & \leq \epsilon+C|x'|^2 \leq C|x'|^2 . \end{align*} Therefore $|Dl|\leq C\epsilon^{\frac{1}{2}}$ and \eqref{6.10} holds. In following discussion, we will replace $u$ by $u-l(x')$ and need only to consider the case $P=Q$ in \eqref{6.9}. \eqref{6.2} and \eqref{6.9} implies that $c\I \leq D^2 Q \leq C\I$. For simplicity, we further assume $Q=Q_a$ (see \eqref{6.3}). This is because we can always find a new coordinate with the aid of the sliding transform $\B x :=x-2D''Q^{-1}D_{1i}Q x_1e_i $, under which $Q$ may be transformed to $Q_a$. Let \begin{equation} \label{6.13} {u}_0:= u -P=u-Q, \ v_{\varepsilon}:= \frac{ {u}_0}{ \varepsilon }, \ \ \varepsilon >0 . \end{equation} In fact, we may assume $ ||u-Q||_{L^{\infty}(S_1)}>0$ and take $\varepsilon =||u-Q||_{L^{\infty}(S_1)} $. We will show the system $(v_{\varepsilon},D_nv_{\varepsilon})$ could be well approximated by $(w,D_nw)$, a solution of some linearized problem. More precisely, let $F= S_{\frac{1}{2}}^{Q}(0)$ and \[ Lw:= \sqrt{1+a^2}(w_{11}+w_{nn})+ a w_{1n} +\Delta''w ,\] where $\Delta'' :=\sum_{i=2}^{n-1}\partial_{x_i}^2$. We will show that as if $\varepsilon \to 0^+$, the corresponding $(v_{\varepsilon},D_nv_{\varepsilon})$ will have a subsequence converging uniformly to $(w,D_nw)$, a solution of the problem: \begin{equation} \label {6.15} Lw= 0 \text{ in } F,\ w(0)=0 ,\ D_nw= 0 \text{ on } \{ x_n=0\} . \end{equation} \textbf{Step 1}. We first consider the convergence on compact subset $E=\{ x_n \geq C\epsilon^{\frac{1}{2}} \} \cap F$, where $\epsilon>0$ is sufficiently small. For any point $y$ such that $B_{C\rho}(y ) \subset E $ for some $\rho >>c\epsilon^{\frac{1}{2}}$. Then $B_{c\rho}(y) \subset S_{\rho^2}^{Q}(y) \subset B_{C\rho}(y ) $ by the fact $Q=Q_a$. It follows from (6.1) that \begin{equation} \label {6.16} 0 = \operatorname{det} D^{2}{u}-\operatorname{det} D^{2} Q=Tr ( AD^2({u}-Q ))= \varepsilon Tr ( AD^2 v_\varepsilon ), \end{equation} where \[ A =[A_{ij} ]_{n\times n}:= \int_0^1 cof ( ( 1-t )D^2Q+tD^2{u} ) dt,\] and $cof M$ denotes the cofactor matrix of $M$. Since \eqref{6.9} gives us $ |u-Q|\leq \epsilon$ in $S_1$, we see that $$B_{2c\rho}(y ) \subset S_{\rho^2/2}^u(y) \subset B_{C\rho}(y ).$$ Hence, the classical interior estimate (Lemma \ref{c2a classical estimate} and its proof in [3]) means that \[ ||{u}||_{C^{k}(B_{c\rho}(y))} \leq C \rho^{2-k} \text{ and } c\I \leq D^2{u}\leq C\I \text{ in } B_{c\rho}(y).\] Therefore, the operator $\bar L f:=A_{ij} f_{ij}$ is uniformly elliptic with smooth coefficients. By \eqref{6.16}, we obtain \begin{equation} \label {6.17} ||{v}_\varepsilon||_{C^{k}(B_{c\rho}(y))}\leq C\rho^{-k}, \end{equation} which means \[ | D^{2}{u}- D^{2} Q| \leq C\varepsilon \rho^{-2} \text{ and } | A- D^{2} Q|\leq C\varepsilon \rho^{-2} \; \text{in} \; B_{c\rho}(y)) .\] Let $ \varepsilon \to 0^+$, we have $(v_\varepsilon,D_n{v}_\varepsilon)$ converges to $(w,D_nw)$ in $ B_{c\rho}(y)$. By (6.10), we see that $$ w (0)=0, \ \ L w=0 \; \text{ in }\; B_{c\rho}(y).$$ \textbf{Step 2}. We gives the uniform control of $(v_\varepsilon, D_nv_\varepsilon)$ near $\{ x_n =0\}$, so as to show \begin{equation} \label{6.19} |D_n v_\varepsilon(x)| \leq C|x_n| \text{ in } S_{\frac{1}{4}}(0) \end{equation} and \begin{equation} \label{6.20} \operatorname{Osc}_{B_r(x)}v_\varepsilon \leq C \max\{r^{\frac{2}{3}},\epsilon\} \text{ for } x \in G_{\frac{1}{4}}. \end{equation} Given $y \in G_{\frac{1}{2}}(0) $. It follows from \eqref{6.9} and Corollary \ref{small perturb means gradient lemma} that $$|\nabla u-\nabla P|\leq C\epsilon^{\frac{1}{2}}\; \text{in}\; S_{\frac{1}{2}}(y)$$ if $\epsilon$ is small enough. Hence, the function $u^y(x)$ defined in \eqref{subtract support function} still satisfies \[ u^{y}(x) \geq c \text{ on } \partial S_{\frac{1}{4}}(y). \] As in Lemma \ref{linearized problem}, $V :=D_n{v}_\varepsilon$ satisfies \begin{equation} \label{6.22} \begin{cases} U^{ij} D_{ij}(\pm V) =0 & \text{ in } S_{\frac{1}{4}}(0)\\ |V |\leq C & \text{ on } \partial S_{\frac{1}{4}}(0) \setminus G_{\frac{1}{4}}(0) \\ \pm V= 0 & \text{ on } {G_{\frac{1}{4}}(0)} \end{cases}. \end{equation} Notice that the second in \eqref{6.22} is equivalent to $V\leq C$ or $-V\leq C$, which comes from \eqref{6.9}. Similar to Corollary \ref{lip unversal by sup}, we see that the function $ w^{y,+}(x) =C_1[ w^{y}(x) +C_2x_n]$ defined in \eqref{sup sub test function} is a supersolution for $V$ and $-V$ in\eqref{6.22} respectively. Hence we get \[ |D_nv_\varepsilon(x)|=|V(x)|\leq w^{(x',0),+}(x',x_n) \leq Cx_n, \text{ in } S_{\frac{1}{4}}(0).\] This roves \eqref{6.19}. To prove \eqref{6.20}, we observe that \eqref{6.19} implies \begin{equation} \label{6.23} |v_\varepsilon (x',0)-v_\varepsilon(x',x_n)| \leq Cx_n^2 \text{ in } S_{\frac{1}{4}}(0). \end{equation} It is enough to estimate $|v_\varepsilon(p)-v_\varepsilon(q)|$ for $p=(p',0), q=(q',0)$ in $G_{\frac{1}{2}}(0)$. Suppose that $$|p'-q'| =r , \ \, \rho=C\max\{r^{\frac{1}{3}},\epsilon^{\frac{1}{2}}\}, \ \, A=p+\rho e_n,\ \ B=q+\rho e_n.$$ As $\rho \geq C\epsilon^{\frac{1}{2}}$, \eqref{6.17} implies \[ |v_\varepsilon(A)-v_\varepsilon(B)| \leq \frac{r}{\rho},\] which, together with \eqref{6.23}, gives \[ |v_\varepsilon(p)-v_\varepsilon(q)| \leq C\rho^2 +\frac{r}{\rho} \leq C\max\{r^{\frac{2}{3}},\epsilon\}.\] In summary, we have proved \eqref{6.19} and \eqref{6.20}. By this and the result of Step 1 we conclude that {\sl as $ \varepsilon \to 0^+$, $(v_\varepsilon, D_n v_\varepsilon)$ has a subsequence converging to a solution $w$ of problem \eqref{6.15} in $S_{\frac{1}{4}}(0)$ uniformly.} \textbf{Step 3}. The classical regular results then shows the function $w \in C_{loc}^3 $. Since $w(0)=0$, $D_nw(0)=0$ and $D'D_{n}w(0)=0$ by \eqref{6.15}, there exists a linear function \[l^0(x) =\sum_{i=1}^{n-1} a_ix_i\] and a quadratic function \[R(x)= \sum_{1\leq i,j \leq n-1} a_{ij}x_ix_j+b_nx_n^2\] such that \[ |w(x) -l^0(x)- R(x)| \leq C|x|^3 \text{ and } |D_n w(x) -2b_nx_n | \leq C|x|^2.\] Here, $a_i,a_{ij},b_n$ are bounded by a universal constant, and \[\sqrt{1+a^2}(a_{11}+b_ n)+ \sum_{i=2}^{n-1}a_{ii}= 0\] by \eqref{6.15}. As $\varepsilon\to 0^+ $, the uniform convergence means \[ |v_\varepsilon (x) -l^0(x)- R(x)| \leq \sigma+ C|x|^3 \text{ and } |D_n v_\varepsilon (x) -D_nR | \leq \sigma+ C|x|^2,\] where $\sigma =\sigma( \varepsilon ) \to 0^+ $. If we let $\mu \geq \sigma^{\frac{1}{3}} +\varepsilon ^{\frac{1}{3}}$, then \begin{equation} \label {6.25} | u- \left[Q+\varepsilon (l^0 +R) \right]| \leq C \varepsilon \mu^{\frac{3}{2}} \text{ in } S_{\mu}^{Q}, \end{equation} and \begin{equation} \label {6.26} |D_n u -(D_nQ+ \varepsilon D_nR)| \leq C \varepsilon \mu \text{ in } S_{\mu}^{Q}. \end{equation} \textbf{Step 4}. Let \[f(t):=\operatorname{det} \left[D^{2} Q+\epsilon D^2R+t \I \right].\] Notice that $|f(0)-1| \leq C\epsilon^2$, $f'(t) \sim C$. The equation $f(t)=1$ is solvable. The solution $t_0$ satisfies \begin{equation}\label{6.27} |t_0| \leq C\epsilon^2. \end{equation} Let \begin{equation}\label{6.28} Q^0 (x)= Q(x)+ \epsilon R(x) +\frac{t_0}{2}|x|^2, \ P^0=\epsilon l^0+Q^0. \end{equation} Then \[\operatorname{det} D^{2}P^0=1,\ D_nP^0=D_nQ= ax_1\text{ on } \{ x_n=0\}, \] which means that $P^0 \in \F_{a}$. Finally, we combine \eqref{6.25}, \eqref{6.26}, \eqref{6.27} and \eqref{6.28} to obtain \[ |{u}(x)-P^0(x)| \leq C\epsilon^2 \mu +C \epsilon \mu^{\frac{3}{2}} \leq C \epsilon \mu^{\frac{3}{2}} \text{ in } S_{\mu}^{Q^0}, \] and \[ |D_n{u}(x)-D_n P^0(x)| \leq C\epsilon^2 \mu^{\frac{1}{2}} +C \epsilon \mu \leq C \epsilon \mu \text{ in } S_{\mu}^{Q^{0}}. \] Noticing that $S_{\mu/2}^{Q_0} \subset S_{\mu}^{Q} $ and replacing $\mu$ with $\mu/2$, we have proved the desired \eqref{6.11}, while \eqref{6.12} follows directly from \eqref{6.28}. \end{proof} {\bf Proof of Theorem \ref{stationary thm}: } Let $C, \mu, $ and $ \epsilon_0(\mu)$ are the same as in Lemma \ref{station lemma}. Choose $0<\alpha<1$ and $0< \mu \leq (4C)^{\frac{2}{\alpha-1}}$ . Let $$C_{\infty}= \max\{\Pi_{j=0}^{\infty}(1+4C^2\mu^{\frac{j\alpha}{2}}), e^{4C}\}.$$ Observing that \[ \log C+ \Sigma_{j=0}^{k}\log (1+4CC_{\infty}^2\epsilon_0\mu^{\frac{k\alpha}{2}-2}) \leq 2C+\epsilon_0C(\mu) C_{\infty}^3\leq \log C_{\infty} , \] we can assume that $\epsilon_0$ is sufficiently small such that the sequence \[ C_0=C, \ C_k =(1+4CC_{\infty}^2\epsilon_0\mu^{\frac{k\alpha}{2}-2}) C_{k-1}, k=1, 2, 3, \cdots \] is bounded by $C_{\infty}$. We will prove by mathematical induction that there exists a sequence of constants $a_k$, transformations \[\M_k=\operatorname{diag}\{ \M_k',\M_{k,nn}\}, \ \det {\M_k} =1\] (where $\M_k'$ is a $n-1$ square matrix), and linear functions $l_k=\sum_{i=1}^{n-1} a_i^kx_i$ such that at height $h_k:=\mu ^k$, the normalization solution $(u_{k}, \Omega_{k} )$ of $(u, \Omega)$ given by \begin{equation} \label{22} u_{k}(x)= \frac{u( \T_k x)}{h_{k}},\ x \in \Omega_k:= \T_k^{-1} S_{h_k}(0), \ \T_k = h_k^{\frac{1}{2}}\M_k \end{equation} satisfying problem (6.1) and \begin{equation} \label{23} ||u_k-l_k-Q_{a_k}||_{L^{\infty}(S_1^{P_{k}})} +||D_nu_k-D_nQ_{a_k}||_{L^{\infty}(S_1^{P_{k}})} \leq \epsilon_k:= \epsilon_0 \mu^{\frac{{k\alpha}}{2}}, \end{equation} for $P_k=l_k+Q_k \in \F_{a}$, where \[ Q_k(x):= \frac{1}{2}\left[\sqrt{1+a_k^2}(x_1^2+x_2^2)+2a_kx_1x_2+\sum_{i=2}^{n-1}x_i^2\right].\] Moreover, \begin{equation} \label{24} \begin{cases} & |b_{k-1}| \leq C(C_{\infty})\epsilon_{k-1}^{\frac{1}{2}}, \ \ |a_k| \leq C_k, \ \ |{\M}_k{\M}_{k-1}^{-1}-\I|\leq C_k\epsilon_{k-1}\\ & C_k^{-1}B_1(0) \cap \Omega_k \subset S_1^{u_k}(0) \subset C_kB_1(0). \end{cases}. \end{equation} The case $k=0$ is the assumption of Theorem 6.1. If the case of $k$ holds we will prove it for the case $k+1$. We check for $ \epsilon_k$ whether $u_k $ satisfies the conditions in Lemma 6.3. By induction hypothesis (6.23), we have \[ |u_{k}-P_k| \leq \epsilon_{k} \text{ in } \Omega_{k} \cap S_1^{P_k}.\] Apply lemma 6.3 to $u_k$, we obtain the quadratic function $ \bar P_{k+1}=\bar l_{k+1}+\bar Q_{k+1} \in \F_{a}$ satisfies \begin{equation} \label{25} \begin{cases} & \operatorname{dist}_{\mu}(u_k,\bar P_{k+1},0) \leq C{\epsilon}_k \mu^{\frac{3}{2}} \leq \epsilon_{k+1} \mu, \\ & |b_k| \leq C\epsilon_{k}^{\frac{1}{2}} \; \text{ and } \; |D^2Q_k-D^2 \bar Q_{k+1}|\leq C{\epsilon}_k . \end{cases}. \end{equation} Then there exists $a_k$ and positive matrix $\B_{k+1} =\operatorname{diag}\{ \B_k',\B_{k,nn}\}$ satisfies \[\B_{k+1}^TD^2Q_k \B_{k+1} = D^2 Q_{k+1}\] and \[ |a_{k+1} -a_k| \leq CC_k \epsilon_k \text{ and } |\B_{k+1}-\I| \leq CC_{k}{\epsilon}_k .\] In particular, $|a_{k+1}| \leq C_{k+1}$. Take $\M_{k+1}=\M_k\B_{k+1}$, $\T_{k+1}= \mu^{\frac{1}{2}}\T_k\B_{k+1}$ and let \[ u_{k+1}(x)= \frac{u({\T}_{k+1} x)}{h_{k+1}},\ S_1^{u_{k+1}}(0)= \T_{k+1}^{-1} S_{h_{k+1}}(0), \ h_{k+1}= \mu^{{(k+1)\alpha}}.\] Then we have \[ (1-CC_{\infty}^2\mu^{-1}\epsilon_{k})C_k^{-1} B_1(0) \cap \Omega_{k+1} \subset S_1^{u_{k+1}}(0) \subset (1+CC_{\infty}^2\mu^{-1}\epsilon_{k})C_k B_1(0) ,\] which is \[ C_{k+1}^{-1}B_1(0) \cap \Omega_{k+1} \subset S_1^{u_{k+1}}(0) \subset C_{k+1}B_1(0).\] Using the above facts and (6.25), one may verify by direct calculations that (6.23)-(6.24) holds for $k+1$. It follows that $|a_k| \leq C_k$, $|\M_k| \leq C_k$ converge geometrically to $a_{\infty}$, $\M_{\infty} $ and \[ |\M_{\infty}\M_{k}^{-1}-\I| \leq C_k \epsilon_{k} \leq C_{\infty}h_k^{\frac{{\alpha}}{2}}.\] We replace each $\M_{k}$ by $\M_{\infty}$ and $Q_k $ by $ Q_{\infty}$, the inductive hypothesis still holds with a large universal constant. This is \[ |u(x ) -h_k^{\frac{1}{2}} l_k(\M_{\infty}^{-1} x)-Q_{\infty}(\M_{\infty}^{-1}x )| \leq C_1C_{\infty}^2h_k^{1+\frac{{\alpha}}{2}} \text{ in } B_{ch_k^{\frac{1}{2}}}(0).\] Recalling that $|Dl_k|\leq C\epsilon_{k-1}^{\frac{1}{2}}$, we obtain \[ |u(x ) -Q_{\infty}(\M_{\infty}^{-1}x )| \leq C_1C_{\infty}^2h_k^{1+\frac{{\alpha}}{2}} \text{ in } B_{ch_k^{\frac{1}{2}}}(0),\] which means \begin{equation} \label {26} |u(x ) -Q_{\infty}(\M_{\infty}^{-1}x )| \leq C_1C_{\infty}^2|x|^{2+\alpha } . \end{equation} The above induction argument and Lemma 6.3 could be applies to any point $y\in G_{c_0}(0)$. As a result, we may obtain that \begin{equation*} |u(y+x ) -Q^y( x )| \leq C|x|^{2+{\alpha}} \end{equation*} for a quadratic polynomial depending on the based point $y$. In fact, consider $p=y+\theta e_n$ with $\theta >0$ is small enough. The height section $S_{c_1\theta^2}^{Q^y}( p) $ is contained in $S_1$ with \[ B_{c\theta^2}(p ) \subset S_{c_1\theta^2}^{Q^y}( p) \subset B_{C\theta^2}(p ). \] By (6.26) we have $$\begin{cases} \operatorname{det} D^{2}u (x ) = 1 & \text{ in } S_{c_1\theta^2}^{Q^y}( p)\\ |u-Q^y(x ) |\leq C|\theta|^{2+\alpha} & \text{ on } \partial S_{c_1\theta^2}^{Q^y}( p ) \end{cases}. $$ By interior $C^{2,\alpha}$ theory and its perturbation method (See [3] for the details), $ ||u||_{C^{2,\alpha}(B_{c\theta^2}(p ))}\leq C$. Since the constant $C$ is independent of $y$ and $\theta$, $u \in C^{2,\alpha}(\overline{B_{c_0}^+(0)})$ for a small $c_0>0$. \vskip 0.5cm {\bf Proof of Theorem \ref{zero petrub neumann}: } Choose $\delta_0=b_0^{6n}$ and $c_0= cb_0$, where $\alpha, \mu, $ and $b_0$ are the same as in the proof of Theorem \ref{stationary thm}. Take $a\in (-\delta_0, \delta_0)$. We are going to construct a quadratic approximation of $u $ near $ 0 $ as \eqref{6.4}, and applying Theorem \ref{stationary thm} to complete the proof of Theorem \ref{zero petrub neumann}. Lemma \ref{gs cover lemma} implies \[ \P S_1(0) \subset (1+C\delta_0)G_1(0).\] For $(x', 0)\in PS_1(0)$, let $g( x' )$ be the maximum/minimum value such that $( x',g( x' ) ) \in S_1(0)$. We consider the convex set \[ E=\{ ( x' , x_n ) | (x', 0)\in PS_1(0), 0 \leq x_n \leq g( x' )\},\] and \[ S=\{ ( x' , \pm x_n ) | ( x' , x_n ) \in E\}.\] Then \[\partial S_1 \setminus G_1 \subset E_{C\delta_0} =\{x \in \R ^n| \operatorname{dist}( x, \partial E ) \leq C\delta_0 \}. \] By the standard theory(see \cite{[F], [G]} for example) we see that there is a convex function $v$ symmetric about the hyperplane $\{x_n=0\}$ solving \[\begin{cases} \operatorname{det} D^2 v = 1 & \text{ in } S\\ v= 1 & \text{ on } \partial S \\ \end{cases}.\] Moreover, by \eqref{6.2} and Lemma \ref{c2a classical estimate}, $v$ is smooth in the interior and Lemma \ref{c1/n boundary estimate} tells us \[ v( x ) \geq 1-C\operatorname{dist}( x, \partial S )^{\frac{1}{n}}.\] Thus, $v$ is also a solution to the following Neumann problem \begin{equation} \label{6.38} \begin{cases} \operatorname{det} D^2 v = 1 & \text{ in } S_1\\ 1-b_0^6 \leq v \leq 1 & \text{ on } \partial S_1 \setminus G_1 \\ D_nv= 0 & \text{ on } G_1\\ \end{cases}. \end{equation} Since $|a|<\delta_0$ and $b_0>0$ is small, then $v^{\pm}:=v\pm 2b_0^6(2C-x_n)$ must be supersolution/subsolution of $u$ to \eqref{6.1}, which implies \begin{equation} \label{6.39} ||v-u||_{L^{\infty}(S_1)} \leq C b_0^6 \end{equation} by the comparison principle (Lemma \ref{comparison principle for mixed problem}). Let $w=u-v$, by Corollary \ref{small perturb means gradient lemma} we have \begin{equation} \label{6.40} |\nabla w| \leq Cb_0^{3} \text{ in } B_{c}^+(0). \end{equation} By \eqref{6.38} we have $D_{in}v=0$ for $i\neq n$ in $G_1$. Let \[\M = D_{ij}v(0), \ \ R(x)=x^T\M x , \ \ \M=\B^2,\] where $\B=(b_{ij})_{n\times n}$ may be chosen such that it is bounded symmetric matrix with $b_{in}=0$ for $i\neq n$ because of the same property of $\M$. Consider the diagonal matrices $\B_1$ defined by $$ \B_1^2=[\frac{1}{2}diag\{\sqrt{1+a^2}, I'' , \sqrt{1+a^2}\}]^{-1}$$ and the function \[ \tilde{u}(x) = \frac{ u(b_0 (\B\B^{-1})x)}{b_0^2}, \\ Q(x)=\frac{Q_a(b_0 (\B \B_1)^{-1}x)}{b_0^2}, \ x \in B_C(0),\] where $Q_a$ is the same as in (6.3). Letting $E_0= B_{Cb_0}(0)$ and noticing $v \in C^3(B_c(0))$, we see that \begin{align*} || \tilde{u} -Q||_{L^{\infty}(E_0)} & \leq \frac{1}{b_0^2}||u-R||_{L^{\infty}(E_0)} +C|a| \\ & \leq \frac{1}{b_0^2}||u-v||_{L^{\infty}(E_0)}+Cb_0 +C|a| \\ & \leq Cb_0 \end{align*} and \begin{align*} ||D_n \tilde{u} - D_n Q||_ {L^{\infty}(E_0)} & \leq \frac{1}{b_0}||D_nu-x_nD_{nn}v||_{L^{\infty}(E_0)}+C|a| \\ & \leq \frac{1}{b_0}||D_nu-D_n v||_{L^{\infty}(E_0)}+Cb_0+C|a| \\ & \leq Cb_0. \end{align*} By Theorem \ref{stationary thm}, we have $\tilde{u} \in C^{2,\alpha}(\overline{B_c^+(0)}) $, therefore $u\in C^{2,\alpha}(\overline{B_{c_0}^+(0)})$ for $c_0=cb_0$. \section{Universal Strict Convexity}\ Throughout this section, we assume that $u$ is a viscosity solution to problem \eqref{liouville problem}, satisfying \eqref{growth condition} (or \eqref{growth innitial assump}), \eqref{section innitial assump} and \eqref{u=0 nabla u =0}. By \eqref{section innitial assump} and Theorem \ref{good shape theorem} we may assume \begin{equation}\label{7.1} B_{c}^+(0) \subset S_1(0) \subset B_{C}(0). \end{equation} We will study the geometry of the section $S_R(0)$ for large $R$. In particular, we will show the uniformly strict convexity for the normalization family $(u_R,S_1^R)$ defined by \eqref{normal function}. Recall the notations from the beginning in Section 5 to \eqref{normalization tau definition}. When we fix a $R$, we will use the notation $\A _R$, $d_i(R)$ and $\D _R$ instead of $\A _h$, $d_i(h)$ and $\D _h$. We define the section $S_t^R(0)$ of $(u_R, S_1^R)$ as we defined $S_1^h(0)$ of $(u, S_h)$ by \eqref{normalization tau definition} in Section 5. Set \[ d_i^R(t) = \frac{d_{i}(tR)}{d_i(R)}, \ \D_t^R=\D_{tR}(\D_R)^{-1} \text{ and } {\A}_{t}^{R}=(D_R)^{-1} \A_{tR} (\A_R)^{-1} D_{R},\] The normalization of $(u_R,S_1^R)$ at height $t$ is essentially the same as $(u_{tR},S_1^{tR})$: \[ {u}_{tR}(x):= \frac{u_R( (\A_t^R)^{-1} \D_t^R x)}{t}, \ x \in S_1^{tR}:= (\D_t^R)^{-1} \A_t^R S_1^R.\] Here is the main result of this section. \begin{Theorem} \label{uniformly strict convex thm} Given large constants $R_0 >0$ and $C_0>1$. There exists a small constant $\eta >0$ such that for any $R\geq R_0$, \begin{equation}\label{7.3} C_0 \eta S_{R}(0) \subset S_{\eta R}(0) \subset (1-\eta) S_{R}(0). \end{equation} Moreover, there exist $\bar{\delta}=\delta_{R_0}$ and $\gamma \in (0,1)$ such that \begin{equation}\label{7.4} c|x|^{\frac{1+\gamma}{\gamma}}-C\delta_R/\bar{\delta} \leq u_R(x) \leq C|x|^{1+\gamma}+C\delta_R/\bar{\delta}, \ \ \forall x\in S_1^R, \end{equation} where $\delta_R$ denotes a constant depending on $R$ and tends to $0$ as $R \to \infty$. \end{Theorem} \begin{Claim}\label{iteration discussion} \eqref{7.3} is a scaling invariant property. Using iterative techniques, one can see that \eqref {7.3} and \eqref {7.4} are equivalent. More precisely, regardless of the term $ C\delta_R/\bar{\delta}$, the left side of \eqref{7.3} and the right side of \eqref{7.4} are equivalent to \[ u_R(x) \leq \sigma_1(|x|)|x| \text{ for all large } R,\] and the right side of \eqref{7.3} and the left side of \eqref{7.4} are equivalent to \[ u_R(x) \geq \sigma_0(|x|) \text{ for all large } R, \] where $\sigma_0, \sigma_1 $ are some universal strictly increasing $C^0$ function with $\sigma_i(0)=0$ $(i=0, 1)$. The right side of \eqref{7.3} implies $S_{\eta^{k}} ^{\eta^{-k}R} \subset B_{(1-\eta)^k C}(0)$. Thus, if we need to obtain the global type estimate of $u_R$ in $ S_1^R$, we only need to prove the corresponding local estimate of $u_{\eta^{-k}R} $ in $S_{\eta^{k}} ^{\eta^{-k}R} $ for some universal large $k$. Especially, we can obtain that $D_nu_R$ is uniformly bounded in $S_1^R(0)$. By Lemma \ref{boundary nabla estimate} and the Neumann boundary value condition, the right side of \eqref{7.4} provides a universal $C^{1,\gamma}$ module for $u_R$ at $0$. \end{Claim} To prove Theorem \ref{uniformly strict convex thm}, in addition to the notations $\delta_0, c_0$ in Theorem \ref{zero petrub neumann} and $a_R$ in \eqref{normal neumann} we need the following lemma. \begin{Lemma} If $R \geq R_0$ is large, then $a_R \geq c\delta_0 a$ and \begin{equation} \label{7.5} cR^{\frac{1}{2}}\I'' \leq D_R'' \leq CR^{\frac{1}{2}}\I''. \end{equation} \end{Lemma} \begin{proof} Assume by way of contradiction that $a_R \leq c\delta_0 a\leq \delta_0$. Then Theorem \ref{zero petrub neumann}, together with \eqref{u=0 nabla u =0} and \eqref{7.1}, implies that the normalization solution $u_R$ is $C^{2,\alpha}$ near $0$. This is \[ B_c^+(0) \subset t^{-\frac{1}{2}}S_{t}^R(0) \subset B_C^+(0), \; \forall t \in (0, cc_0^2).\] We recall \eqref{7.1} and $S_{1}(0)=\D_R^{-1}\A_R S_{\frac{1}{R}}^R(0). $ If $R \geq Cc_0^{-2}$ is large, we can take $t=\frac{1}{R} $ to obtain \[c\I \leq \D_R^{-1}\A_R R^{\frac{1}{2}}\leq C\I.\] This gives $d_i(R) \leq CR^{\frac{1}{2}}$ for $2 \leq i \leq n-1$. Hence, \[ a_R =\frac{d_1(R)d_n(R)}{R} a \geq Ca,\] which is a contradiction. Thus $a_R \geq c\delta_0 a$, which implies $\Pi_{i=2}^{n-2} d_i(R) \leq C_1\delta_0^{-1} R^{\frac{n-2}{2}}$. Noticing that $d_i(R) \geq cR^{\frac{1}{2}}$ for $2 \leq i \leq n-1$ (see \eqref{growth innitial assump}), we see that \eqref{7.5} holds for $C=(C_1\delta_0^{-1})^{\frac{1}{n-2}}$. \end{proof} \begin{Remark} By Lemma 7.3 we could improve \eqref{growth innitial assump} to \[ c|z''|^2-\bar{\delta}^{-1} \leq u(0,z'',0) \leq C|z''|^2,\] which implies \begin{equation} \label{7.7} c|z''|^2-\delta_R/\bar{\delta} \leq u_R(0,z'',0) \leq C|z''|^2 \text{ for } R \geq \bar{\delta}. \end{equation} At this moment, the above also holds when $a=0$. \end{Remark} {\bf Proof of Theorem \ref{uniformly strict convex thm}:} Due to Claim \ref{iteration discussion}, it is sufficient to prove (7.3), which will be completed by four steps. According to Theorem 5.1, we only need to prove (7.3) in normal direction and on tangent plane. {\bf Step 1}. Let $E_R= S_1^R \setminus S_{\delta_R/\bar{\delta}}^R$, we first prove that \begin{equation} \label{7.9} \begin{split} u_R(x) \geq \sigma_0 (\max\{ |x_1|,|x_n|\})-C\delta_R \text{ on } E_R \end{split} \end{equation} for some universal module $\sigma_0$. Assume $q=(q' ,0)=(q_1, q'',0)\in \P E_R$ with $q_1\neq 0$, let $$\B x=x-\sum_{i=2}^{n-1}\frac{q_i}{q_1}x_1e_i $$ and consider the positive function \[ \upsilon(x)= \frac{u(\frac{q}{2}+\frac{q_1 \B^{-1}x}{8C})}{ q_1^2}, \ x \in B_1^+ (0).\] By the convexity, (7.5) and the assumption on $u$, we have \[ 0 \leq \upsilon( x ) \leq \frac{C}{ q_1^2} \] and \[ \upsilon( x_1, x'',0 ) \leq \frac{u(q)}{ q_1^2} + C(|x''|^2 +\frac{\delta_R}{ q_1^2}) \leq C|x''|^2+\frac{u(q)+C\delta_R}{ q_1^2}. \] The Neumann boundary value condition guarantees \[ D_n \upsilon( x_1, x'',0 ) \geq -C .\] Regarding $\frac{u(q_n)+C\delta_R}{ q_1^2}$ as small constant and $q_1^{-1}$ as universal constant, we use Lemma \ref{strict convex lemma half} to obtain \[ \begin{split} \frac{u(q)+C\delta_R}{ q_1^2} \geq \sigma(\frac{C}{ q_1^2}). \end{split} \] Letting $ \sigma_0(t) = t^2{\sigma}(C/t^2)$, we get \begin{equation} \label{7.11} u(q',0) \geq \hat \sigma_0(q_1) -C\delta_R, \ \ \forall (q' ,0)\in \P E_R. \end{equation} Next, assume $q=q_ne_n$ and consider the positive function \[ v(x)= \frac{u(\frac{3q}{4}+\frac{q_nx}{8C})}{ q_n^2}, \ x \in B_1 (0).\] Similarly, we have \[ 0 \leq v( x ) \leq \frac{C}{ q_n^2} \text{ and } v( 0, x'',x_n ) \leq C|x''|^2+\frac{u(q)+C\delta_R}{ q_n^2}. \] Using Lemma \ref{strict convex lemma plane}, we get \begin{equation} \label{7.13} u(q_ne_n) \geq \sigma_0(q_n) -C\delta_R \end{equation} for $\sigma_0(t) = t^2{\sigma}(C/t^2)$. Since $S_t$ is of good shape for $t \geq \delta_R/\bar{\delta}$, combining \eqref{7.11} and \eqref{7.13}, we have proved the desired \eqref{7.9}. \textbf{Step 2}. We first choose a large $R_0$ such that $\bar{\delta}R_0^{-1} $ is small enough, and define $ \delta_R= (\bar{\delta}R^{-1}$. Then $ \delta_R\leq \delta R_0$ for $R \geq R_0$. For simplicity, we only consider the point $x \in E:=S_{1}^R(0) \setminus S_{\delta_R}^R(0)$ and assume $t \geq \delta_R$ in the rest of this Step. By iteration, (7.6) means that there exists universal $\gamma \in (0,1)$ such that \[ u_R(x) \geq c \max \{ |x_1|,|x_n|\}^{\frac{1+\gamma}{\gamma}},\] which is \[ \max\{d_1^R(t),d_n^R(t)\} \leq Ct^{\frac{\gamma}{1+\gamma }}.\] Recalling (7.4) and $\Pi_{i=1}^n d_i^R(t) =t^{\frac{n}{2}}$, we have \[ \min\{d_1^R(t),d_n^R(t)\} \geq ct^{\frac{1}{1+\gamma }}.\] This gives (7.3) in the normal direction. \textbf{Step 3}. We now have \begin{equation}\label{d1 control} ct^{\frac{1}{1+\gamma }} \leq d_1^R(t) \leq Ct^{\frac{\gamma}{1+\gamma }}, \end{equation} whose right side gives \[ u_R (x',0) \geq c|x_1|^{\frac{1+\gamma}{\gamma }}.\] Noticing (7.5) and that $u_R$ is locally Lipschitz, we get \begin{equation}\label{d12 mix low barrier 1} u_R (x',0) \geq \max\{ c|x''|^2-\frac{C\delta_R}{\delta}|x_1| ,0\}. \end{equation} Let $E_1 =\{x'\P(E):\; |x_1| \leq \frac{c^2}{4}|x''|^2\} $ and $E_2= \P(E)\setminus E_1$. The above two inequalities implies that \begin{align*} u_R (x',0) & \geq \max\{ c|x''|^2-C|x_1| ,0\} \chi_{E_1} + c|x_1|^{\frac{1+\gamma}{\gamma }}\chi_{E_2}\\ & \geq \frac{c}{2}|x''|^2\chi_{E_1} + c|x_1|^{\frac{1+\gamma}{\gamma }}\chi_{E_2} \\ & \geq c|x'|^{\frac{2(1+\gamma)}{\gamma }}, \end{align*} Which proves the right side of (7.3) on the tangent plane. \textbf{Step 4}. Given constant $M$, we claim that there exist universal $ \varepsilon $, such that \[ \sup\{ s|\, se_1 \in G_{t}^R(0) \} \geq M \varepsilon \] for some $t \in [ \varepsilon , \frac{1}{2}]$. Then This claim, (7.5) and (5.8) implies that \[\varepsilon^{-1}G_\varepsilon^R(0) \supset t^{-1}G_t^R(0) \supset cMB_1(0) \supset cM\P(S_1^R(0)),\] which proves the left side of (7.3) on the tangent plane. On the contrary to this claim, by the balance property of $G_{t}^R(0)$ we get \[ u_R(x_1,0) \geq M^{-1}|x_1| \text{ for } x_1 \geq CM\varepsilon.\] For simplicity, we may require the point $x \in S_{1}^R(0) \setminus (S_{CM\varepsilon}^R(0) \cap \{ |x_1| \leq 2CM\varepsilon \})$ and assume constant $t \geq CM\varepsilon$ in the rest of this Step. Then by the convexity and (7.5) we have \[ u_R(x_1,x'',0) \geq 2u_R(2x_1,0,0 ) - u_R(0,-x'',0 ) \geq 2M^{-1}|x_1| -C|x''|^2. \] This together with (7.10) implies that \[ G_t^R(0) \subset \{ c(|x''|^2 -t) \leq |x_1 | \leq CM(|x''|^2 +t)\}.\] Since $0 \in G_t^R(0) $, the above relation then implies that \[ G_t^R(0) \subset \{ |x_1| \leq CM^4t\}.\] Thus, $d_1^R(t) \leq CM^4t$. Taking $t=\varepsilon $ is small enough, this contradicts (7.9). In this way, we completes the proof of Theorem 7.1. \section{Liouville Theorem} In this section, we will modify the techniques developed from the classical $C^{1,\alpha}$ estimate \cite{[C3]} to prove Theorem \ref{liouville theorem}. We always suppose that $u$ is a viscosity solution to problem \eqref{liouville problem} and the hypothesis of Theorem \ref{liouville theorem} is satisfied. As we have said, we may assume \eqref{u=0 nabla u =0}. Recall the normalization family $(u_R, S_1^R)$ defined by \eqref{normal function}, which satisfies \eqref{normal section}-\eqref{normal genral assump}. Consider the function \begin{equation}\label{8.1} v_R(x)=D_nu_R(x)-a_Rx_1, \end{equation} and let \begin{equation} \label{8.2} \begin{split} & m_R =\inf\{\frac{v_R(x)}{x_n}|\, x\in S_1^R(0)\}, \\ & M_R =\sup\{\frac{v_R(x)}{x_n}|\, x\in S_1^R(0)\},\\ & \omega_R =\frac{M_R}{m_R}-1. \end{split} \end{equation} Our goal is to prove that \begin{equation} \label{8.3} c \leq m_R \leq M_R \leq C \end{equation} and $\omega_R$ is strictly increasing in $R$. For this purpose, we need the auxiliary function like those from \eqref{subtract support function} to \eqref{sup sub test function}. Given $y\in G_{\frac{1}{2}}^R(0)$, let \begin{equation} \label{8.4} u^{R,y}(x)= u_R(x) - u_R(y)-\nabla u_R(y) \cdot (y-x) \end{equation} and define the functions \begin{equation} \label{8.5} \begin{split} & w^{R,y}(x) =[u^{R,y}(x)-\frac{n}{2}x_nD_nu^{R,y}(x)],\\ & w^{R,y,+}(x) =C_1[ w^{R,y}(x) +C_2x_n],\\ & w^{R,y,-} (x) =c_1[x_n-c_2 w^{R,y}(x) ]. \end{split} \end{equation} In order to show that $w^{R,y,\pm}$ are supersolution/subsolution to the following linearized problem \eqref{8.17}for $v_R$, we need the following two lemmas. \begin{Lemma} \label{strict quali line lemma} Suppose that $u$ is a viscosity solution to the first equation of problem (1.1) and (2.6) is satisfied. Assume that \begin{equation} \label{8.6} B_c^+(0) \subset S_1^u(0) \subset B_C^+(0)\; \text{and}\; ||u||_{Lip(B_C(0))} \leq C. \end{equation} Define $h_x^u = \sup\{ h |\, S_{t}^u(x) \subset B_1^+(0),\ \forall t < h\}$. There exists small universal constants $\delta >0$, $\rho >0$ such that if \begin{equation}\label{8.7} c|x|^{\frac{1+\gamma}{\gamma}}-\delta\leq u(x) \leq C|x|^{1+\gamma}+\delta, \ \ \forall x\in S_1^u(0), \end{equation} then \[ h_x^u \geq \sigma_0(x_n) \text{ in } B_{\rho}^+(0).\] \end{Lemma} \begin{proof} If the result were false, we could find a constant $\tau >0$, a sequence of convex viscosity solutions $u_k$ satisfying (8.6)-(8.7) and points $p_k \in B_{\rho}(0)$ such that \[p_k \cdot e_n \geq \tau, \ \ \text{and}\; h_{p_k}^{u_k} \to 0.\] Letting $k \to \infty$, we get a limit $v$ which still satisfies our assumption and $p_k$ converges to a point $p$ such that $h_{p}^{v}=0$. Let $\Sigma :=S_0^v(p)$. Then $\Sigma $ is not a single point set. (8.7) implies that $ \Sigma \subset B_{\delta_1}(0)$ for some constant $\delta_1>0 $ depending on $\delta , \rho$. Hence we can find an interior extremal point \[q\in \{ y|\, y\in \Sigma , y_n =\sup_{x\in \Sigma}x_n\} ,\] which contradicts Lemma 2.14. \end{proof} \begin{Lemma For large $R \geq R_0$, one has \begin{equation}\label{8.8} \sigma_0(x_n) \leq v_R(x) \leq C \text{ in } S_1^R(0). \end{equation} \end{Lemma} \begin{proof} As we have discussed in Claim \ref{iteration discussion}, we need only to prove (8.8) for $ y \in S_{\sigma_0(|c_0|)}^R(0)\subset B_{c_0}(0)$ for a small universal $c_0$. According to Lemma 2.5, the Neumann boundary value condition and \eqref{7.4} provides a $C^1$ module for $u_R$ at $0$. This is, \begin{equation}\label{8.9}|\nabla u(x)| \leq C|x|^{\gamma}, \; \text{for}\; x \; \text{near}\; 0, \end{equation} which implies the right side of \eqref{8.8}. As in Lemma 8.1 we denote \begin{equation} \label{8.10} h_y^R = \sup\{ h |\, S_{t}^{R}(y) \subset \R_+^n,\ \forall t < h\}. \end{equation} We will find a universal $C^0$ module $\sigma_0$ such that the following three inequalities hold in $ S_1^R(0) $: \begin{equation} \label{8.11} h_x^R \geq \sigma_0(x_n), \end{equation} \begin{equation} \label{8.12} \sigma_0(x_n) \I \leq D^2u_R(x) \leq \frac{1}{ \sigma_0(x_n)} \I, \end{equation} and \begin{equation} \label{8.13} v_R(x)\geq \sigma_0(x_n). \end{equation} Again, it is sufficient to prove (8.10)-(8.12) for $x$ around $0$. Suppose $c_0>0$ is small and $y\in S_{ c_0} ^R(0)$, then (7.3) and (8.9) means \begin{equation*} |\nabla u_R(y)|+u_R(y) \leq c_1:=c_0+Cc_0^{\gamma} \end{equation*} and $c_1$ is still small. Thus, the section $S_{h_y^R}^R(y) \cap B_C(0) $ is contained in $S_{c_1}^R(0) \subset S_{\frac{1}{2}}^R(0)$ and will touch $\partial \R_+^{n}$ at some point $z=(z',0) \in G_{c_1}^R(0)$. Let $l_{zy}$ be the line segment connecting $z$ and $y$. Extend $l_{zy}$ such that it intersects $\partial B_{{c}}^+(0)$ at point $q$. Set $$w(x)=u_R(x)-u_R(y)-\nabla u_R(y)\cdot (x-y).$$ Then \begin{equation} \label{8.14} w(x) \leq h_y^R, \ x \in l_{yz}. \end{equation} Furthermore, it follows from Theorem 7.1 and Lemma 8.1 that \begin{equation} \label{8.15} h_y^R \geq \sigma_0(y_n) \end{equation} for $\sigma_0(t) :=ct^{\frac{2}{n}} \sigma(c t^{-\frac{2}{n}})$. The classical estimate result (see Lemma \ref{volume bound by measure}) gives $\operatorname{Vol}(_{h_y^R}^R(y)) \sim (h_y^R)^{\frac{n}{2}}$. Notice that $S_{h_y^R} ^R \subset B_C^+(0)$, thus $S_{h_y^R}^R\supset B^+_{c(h_y^R)^{\frac{1}{2}}}(0) $ and the classical interior estimate (See Lemma \ref{c2a classical estimate} and its proof) then gives \begin{equation} \label{8.16} \hat \sigma_0(y_n) \I \leq D^2u_R(y) \leq \frac{1}{\hat \sigma_0(y_n)} \I \end{equation} for $\hat \sigma_0(y_n)=\min\{ [\sigma_0(y_n)]^{n-2}, \sigma_0(y_n)\}$. Now, up to a bounded linear transform which maps in $S_{\sigma_0}^R(0)$ to $S_1^{\sigma_0 R}$, (8.15)-(8.16) and the statement in Claim \ref{iteration discussion} implies that (8.11) and (8.12) in $S_1^R(0) $. Finally, let us prove the (8.13). Similarly as Lemma \ref{linearized problem}, the non-negative function $v_R (x)$ in \eqref{8.1} solves the linearized problem: \begin{equation} \label{8.17} \begin{cases} U_R^{ij} D_{ij}v_R=0 & \text{ in } S_1^R(0)\\ 0\leq v_R \leq C & \text{ in } S_1^R(0) \\ v_R= 0 & \text{ on } {G_1^R(0)} \end{cases}. \end{equation} Notice that we also have $v_R(ce_n) \geq c $ by the convexity. Due to (8.12), the first equation in (8.17) is uniformly elliptic with norm of the elliptic coefficients depending on $\sigma_0(y_n)$ in the domain $E(y_n)=S_1^R(0) \cap \{ x_n \geq \frac{y_n}{2}\}$. We apply the classical Harnack inequality to obtain \begin{equation}\label{8.18} v_R(y',y_n) \geq C(||U_R^{ij}||_{E(y_n)},||U_R^{ij,-1}||_{E(y_n)}, \frac{y_n}{2}) v_R(ce_n) \geq \sigma_0(y_n) \end{equation} in $ S_{\frac{1}{2}} \cap \{x_n \geq \frac{y_n}{2}\}$ for some new $\sigma_0$. Thus, the proof is completed. \end{proof} \textbf{Proof of Theorem \ref{liouville theorem}:} It follows from Lemma 8.2 that $v_R (x)$ satisfies the following problem: \begin{equation} \label{8.19} \begin{cases} U_R^{ij} D_{ij}v_R=0 & \text{ in } S_1^R(0)\\ \sigma_0(x_n) \leq v_R \leq C & \text{ on } \partial S_1^R(0) \setminus G_1^R(0) \\ v_R= 0 & \text{ on } {G_1^R(0)} \end{cases}. \end{equation} Then as Corollary \ref{lip unversal by sup} and 3.8 we see that the function $ w^{R,y,\pm}(x)$ in \eqref{8.5} are supersolution/subsolution of problem (8.19) in $S_c^R(0)$, and $cx_n \leq v_R (x) \leq Cx_n$ in $ S_c^R(0)$. Using the definition (8.2), we get \begin{equation*} c \leq m_R \leq M_R \leq C, \end{equation*} which is the desired (8.3). Next, we are going to prove \begin{equation} \label{8.20} \omega_{\rho R} \leq (1-\theta)\omega_{ R} \end{equation} for some universal $\rho >0$ and $\theta\in (0, 1)$. Let \begin{equation*} \begin{split} & m_{R,t} =\inf\{\frac{ v_R(x)}{x_n}|\, x\in S_t^R(0)\} ,\\ & M_{R,t} =\sup\{\frac{ v_R(x)}{x_n} |\, x\in S_t^R(0)\}, \\ & \omega_{R,t} =\frac{M_{R,t}}{m_{R,t}}-1. \end{split} \end{equation*} It is clear that for all $ t\in (0, 1)$, \[ m_{R,1} \leq m_{R,t} \leq M_{R,t} \leq M_{R,1} \] and \[\omega_{R,t} =\omega_{Rt}.\] To prove (8.20), it is sufficient to prove \begin{equation} \label {8.21} \omega_{R,\rho } \leq (1-\theta)\omega_{ R,1} \end{equation} for some universal $\rho >0$ and $\theta\in (0, 1)$. Assume $\omega_{ R,1}>0$ and consider the two non-negative functions: \begin{equation} \label{8.22} \begin{split} H_1(x) =\frac{v_R(x)-m_{R,1}x_n}{M_{R,1}-m_{R,1}}, \\ H_2(x) =\frac{M_{R,1}x_n-v_R(x)}{M_{R,1}-m_{R,1}}. \end{split} \end{equation} It follows from (8.19) that each $H_i $ $ (i=1, 2)$ solves \begin{equation} \label{8.23} \begin{cases} U_R^{ij} D_{ij} H_i=0 & \text{ in } S_1^{R}(0)\\ 0 \leq H_i \leq 1 & \text{ in } S_1^{R}(0) \\ H_i= 0 & \text{ on } {G_1^R(0)} \end{cases}. \end{equation} While $H_1+H_2=x_n$, we may assume $H_1(ce_n) \geq \frac{c}{2}$ without loss of generality. Since (8.12) means that the first equation in (8.23) is universal elliptic away from $G_1^R(0)$, as (8.18) we have \begin{equation} \label{8.24} \begin{split} H_1(x) \geq \sigma_0(x_n)H_1(ce_n) \text{ in } B_{c/2}^+(0). \end{split} \end{equation} Again, for any $y=(y',0) \in G_{c_0}^R(0)$ with $c_0>0$ small enough, we could find a universal constant $\bar{c}>0$ such that $B_{c(\bar{c})/2}^+(0) \subset S_{\bar{c}}^{R}(y) \subset B_{c/2}^+(0) $. With some universal constant $C_1, C_2, c_1, c_2$ depending on $\bar{c}$ and $\sigma_0(x_n)$, the function $ w^{R,y,\pm}(x)$ in \eqref{8.5} is still supersolution/subsolution of $H_1$ to the following problem: \begin{equation} \label{8.25} \begin{cases} U_R^{ij} D_{ij}H_1=0 & \text{ in } S_{\bar{c}}^{R}(y)\\ \sigma_0(x_n) \leq H_1 \leq 1 & \text{ on } \partial S_{\bar{c}}^{R}(y) \setminus G_{\bar{c}}^{R}(y) \\ H_1= 0 & \text{ on } G_{\bar{c}}^{R}(y) \end{cases}. \end{equation} In conclusion, we have \begin{equation} \label{8.26} H_1(y+te_n) \geq w^{R,y,-}(y+te_n) \geq \frac{c_1}{2} t \; \text{ for } \; t \leq t_0. \end{equation} On the other hand, it follows from (7.2) (or (7.3)) that \begin{equation} \label{8.27} S_{\rho}^R(0) \subset G_{c_0}^R(0) \times [0,t_0) \; \text{ for} \; \rho =c\min\{ c_0^{\frac{(1+\gamma)^2}{\gamma}}, t_0\}. \end{equation} Combining (8.26) and (8.27), we have \begin{equation*} \frac{v_R(x)-m_{R,1}x_n}{M_{R,1}-m_{R,1}}\geq \theta x_n \; \text{ in } \; S_{\rho}^R(0) \end{equation*} for $\theta=\frac{cc_1}{2} $. That is \[m_{R,\rho}\geq m_{R,1}+\theta ( M_{R,1}-m_{R,1}) \; \text{ in } \; S_{\rho}^R(0) ,\] which yields the desired (8.21). In this way, (8.20) has been proved. By (8.3) and (8.20) we see that \begin{equation*} \omega_{R} =\omega_{\rho^k \rho^{-k}R} \leq (1-\theta)^k\omega_{ R\rho^{-k}} \leq C(1-\theta)^k. \end{equation*} Letting $k \to 0$, we get $\omega_{R}=0$ for any $R$. Hence, $v_R(x)=D_nu_R-a_Rx_1$ is a linear function in $S_R(0)$. Then letting $R\to \infty$, we get the limit function $\hat v(x):=D_nu(x)-ax_1=cx_n$ for some $c>0$. Lemma \ref{strict convex in interior} means that $u$ is strict convex and smooth away from $\partial \R_+^{n}$. Thus $$u(x) = f(x')+ax_1x_n+cx_n^2$$ for some smooth function $f$ in $\R^{n-1}$. Let $$g(x')=f(x')-\frac{a^2}{4c}x_1^2.$$ Since $D^2 u(x',1) > 0$, we have $D^2g(x') >0$. Therefore, $g$ is a convex, smooth function solving \begin{equation*} \operatorname{det} D^2 g =1\; \text{ in }\; \R^{n-1}. \end{equation*} The classical results (Theorem \ref{global classical results}) shows that $g$ is quadratic polynomial of $x'$, which implies that $u$ is a quadratic polynomial of $x$. The proof of Theorem \ref{liouville theorem} is completed. \begin{Remark} In the case $n=2$, there are two other proofs for Theorem \ref{liouville theorem}, which depends on the strict convex Lemma \ref{strict convex lemma half} and \ref{strict convex lemma plane}. With the two lemmas, one can show the solution is $C^1$ up to boundary and is of super-linearity growth at infinite. This fact, together with partial Legendre transform and the Liouville theorem for harmonic functions, will gives us the first proof. As for the second proof, we need to use Wang's function\cite{[W95]} to construct supersolution/subsolution and so prove that the $u$ is $C^{1,1}$ up to boundary, then by blowing up at infinity to obtain $D^2u=c\I$. \end{Remark} As the end of this paper, we give the two proofs in more details. \textbf{Proof 1.} We write a point in $\R^2$ as $(x, y)$ and use the classical partial Legendre transform in the $x$-variable. For any $p \in R$, define \[ u^*\left(p,y\right):= \sup_{x \in R}\{ px-u\left(x,y\right)\}. \] The uniformly strict convexity of $u$ at boundary and the smoothness of $u$ at interior also implies the superlinearity at infinite, which guarantees the uniqueness and existence of $x= X\left(p,y\right) $ such that the above supremum is attained. By a calculation the two dimensional case of problem \eqref{liouville problem}, \[\operatorname{det} D^2u=1 \; in \; \R_+^2,\ \ D_2 u\left(x,0\right)= ax \; on \; R\] is turned to the problem for $u^*$: $$\begin{cases} \Delta u^*=1 & \text{ in } \R_+^2\\ D_{v^*}u^*= 0 & \text{ on } \R \end{cases}, $$ where $v^*=e_2+ae_1$. Differentiating $u^*$ with respect to $v^*$ and letting $V=D_{v^*}u^*$ we obtain $$\begin{cases} \Delta V= 0 & \text{ in } \R_+^2\\ V= 0 & \text{ on } \R \end{cases}. $$ Note that $$V=D_{v^*}u^*\left(p,y\right)=aX\left(p,y\right)-u_2\left(X,y\right) = u_2\left(X,0\right)-u_2\left(X,y\right) \leq 0.$$ We can use the Liuoville theorem for harmonic functions to see that the only solutions to above problem are $$V(x, y)=D_{v^*}u^*\left(x,y\right) \equiv A$$ for some constant $A$. Then \[ u^*\left(p,y\right)=g\left(p-ay\right)+ Ay \] for some function $g:[0,\infty ) \to R $. Recalling $\Delta u^*=1, D_{v^*}u^*= 0 $, we have \[g\left(0\right)=0 \ and \ \left(1+a^2\right)g''=1 , \] which implies that $u^*$ is a quadratic polynomial, and so is the $u$. \textbf{Proof 2. } As we have said, when $n=2$, one could use strict convexity Lemma \ref{strict convex lemma half} and \ref{strict convex lemma plane} to show that the solution $u$ to problem \eqref{liouville problem} is uniformly $C^{1,\alpha}$ up to boundary\cite{[C3]}. We consider Wang's singular function with bounded positive Monge-Amp\'epre measure for large $a>>2$: \[ W_{a,b}\left(p,q\right)=\begin{cases} p^{a}+\frac{a^2-1}{a(a-2)}p^{a-\frac{2a}{b}}q^2,\ |p|^a \geq |q|^b \\ \frac{4a-5}{2(a-2)}q^{b}+\frac{1}{2a}q^{b-\frac{2b}{a}}p^2,\ |q|^b \geq |p|^a \end{cases}. \] Let $$W\left(x_1,x_2\right)= Ca W_{a,b}\left(\tau x_1,x_2/ \tau \right),$$ where $\tau >0 $ is small and satisfies $a\tau^a \leq c$. One can use this function to construct a supersolution $(W^+ )$/subsolution $(W^- )$at boundary point: \[ \begin{cases}w^+\left(x\right) = u\left(x\right)- W\left(x_1,x_2\right) +Mx_2 \\ w^-\left(x\right) = \epsilon_1 \left(W\left(x_1,x_2\right)-u\left(x\right)+\epsilon_2 x_2\right) \end{cases}. \] This will give the uniform estimate $c \leq D_{nn}u \leq C$ on the boundary. Therefore $u$ is $C^{1,1}$ and then in $C^{2,\alpha}$. After blowing up at infinite, this together with the superlinearity will imply $D^2u=c\I$ and the proof is completed. \newpage
\section{Motivation} \begin{comment} Understanding the structure and interactions of nuclei from fundamental interactions is a key problem in theoretical physics. With the help of high performance supercomputers, many ab initio approaches have been developed for solid nuclear structure and reaction studies based on fundamental nuclear interactions. These include coupled-cluster expansions~\cite{Hagen:2012fb,Jensen:2019zkr}, no-core configuration interactions~\cite{Barrett:2013nh,Maris:2020qne}, in-medium similarity renormalization group~\cite{Hergert:2012nb,Yao:2019rck}, self-consistent Green’s functions~\cite{Soma:2012zd,Arthuis:2020toz}, Green’s function Monte Carlo simulations~\cite{Rocco:2015cil,Piarulli:2017dwd}, and auxiliary-field diffusion Monte Carlo simulations~\cite{Lonardoni:2017hgs,Lonardoni:2018nob}. \end{comment} While real physical systems reside in continuous space, it is often computationally advantageous to model space as a discrete set of points forming a lattice grid. This is especially useful for computationally heavy calculations such as the case for quantum systems with many particles. Lattice simulations have been used to study a wide range of different phenomena in quantum many-body systems. For example, lattice simulations in low-energy nuclear physics have been used to describe nuclear forces, structure, reactions, and thermodynamics \cite{Lee:2004si,Borasoy:2006qn,Abe:2007fe,Lee:2008fa,Drut:2012md,Wlazlowski:2014jna,Elhatisari:2015iga,Elhatisari:2016owd,Korber:2017emn,Elhatisari:2017eno,Lu:2018bat,Lahde:2019npb,Lu:2019nbg,Alexandru:2020zti}. In such calculations, a question of paramount concern is whether the systematic errors induced by the lattice grid can be properly removed from the final results. In order to verify independence upon the lattice geometry, it would clearly be useful to perform calculations using more than one lattice geometry. For reasons of simplicity and familiarity, however, nearly all quantum many-body calculations have been performed on simple cubic lattices. In this paper we broaden the menu of computational lattice options and show how to perform quantum many-body calculations on a three-dimensional body-centered cubic (BCC) lattice. The BCC lattice is convenient because it preserves the octahedral symmetry of the simple cubic lattice. Having this large rotational symmetry group is helpful when approximating the full rotational symmetry of continuous space. There are, however, some differences with the simple cubic lattice. Instead of one lattice site per unit cell, it has two lattice sites per unit cell. And instead of six nearest neighbor lattice sites, it has eight nearest neighbors. We show one unit cell of the BCC lattice in Fig.~\ref{BCC_lattice}. \begin{figure}[h] \centering \includegraphics[width=5cm]{BCC_lattice.png}\\ \caption{Drawing of one unit cell of the BCC lattice.} \label{BCC_lattice} \end{figure} In the literature one can find several studies of various spin models on BCC lattices \cite{Guttman:1961,Adler:1993kp,Caselle:1993jh,Butera:1995kr,Butera:1997ak,Butera:1998rk,Butera:1999qa,Campostrini:2000yf,Butera:2000zt,Butera:2018kjb,Radicevic:2019vyb,Shirley:2019,Murtazaev:2020,You:2020}. To the best of our knowledge, BCC lattices have not yet been used for calculations of quantum many-body systems involving fermions. The main goal of this paper is to show how simulations of quantum many-body systems with fermions can be realized on a BCC lattice. We illustrate with a well-studied but nontrivial quantum many-body system called the unitary Fermi gas. \section{Unitary Fermi gas} The unitary Fermi gas refers to an interacting system of two-component fermions with zero range interactions and infinite scattering length. The ground state of the unitary Fermi gas is a superfluid that sits in the crossover region between a weakly-coupled Bardeen-Cooper-Schrieffer (BCS) superfluid and strongly-coupled Bose-Einstein condensate (BEC). Much of the nuclear physics interest comes from the fact that the unitary Fermi gas approximately describes the physics of dilute neutron matter found in the inner crust of a neutron star. It is in that region that the interparticle spacing between neutrons is larger than the range of the neutron-neutron interactions (about 3 fm) but smaller than the neutron-neutron scattering length (about 19 fm). The unitary Fermi gas is a scale-invariant system with no intrinsic length scale. We can therefore use simple dimensional analysis to determine the scaling of observables with respect to the Fermi momentum $k_F$. In particular, the ground state energy of the unitary Fermi gas must have the form \begin{equation} E_0 = \xi E_{\rm FG}, \end{equation} where $\xi$ is a universal dimensionless constant and $E_{\rm FG}$ is the ground state energy of the non-interacting Fermi gas. The constant $\xi$ is sometimes called the Bertsch parameter and has been measured in many experiments using ultracold trapped atoms \cite{O'Hara:2002,Partridge:2006,Gehm:2003,Bourdel:2004,Bartenstein:2004,Kinast:2005,Regal:2005,Stewart:2006,Luo:2009,Navon:2010,Nascimbene:2010,Ku:2012}. It has also been calculated by analytical methods \cite{Engelbrecht:1997,Baker:1999,Steele:2000,Heiselberg:2001,Strinati:2004,Schafer:2005,Papenbrock:2005,Nishida:2006,Haussman:2007,Veillette:2007,Arnold:2007,Chen:2007,Nishida:2009}. In addition, a substantial number of numerical studies have been made using lattice and continuum quantum Monte Carlo simulations as well as other techniques \cite{Endres:2012cw,Jensen:2019zkr,Mihaila:2011pq,Carlson:2003,Chang:2004,Astrakharchik:2004,Carlson:2005,Lee:2006a,Lee:2006b,Bulgac:2006,Lee:2006c,Juillet:2007,Lee:2008a,Lee:2008b,Li:2011,Bulgac:2008,Abe:2009,Magierski:2008wa,Gandolfi:2011,Endres:2012cw,Forbes:2010gt,Carlson:2011kv}. In this work, we compute $\xi$ for $33$ spin-up and $33$ spin-down fermions using a BCC lattice. We will compare the performance and results with recent lattice calculations for the same system of $33$ spin-up and $33$ spin-down fermions using a simple cubic lattice~\cite{He:2019ipt}. To facilitate a direct comparsion, we follow as closely as possible the same lattice formalism and methods used in Ref.~\cite{He:2019ipt}. \section{Lattice action} As we can see in Fig.~\ref{BCC_lattice}, there are two lattice sites per unit cell of the BCC lattice, and the length of the unit cell is what we call our lattice spacing $a_{\rm latt}$. In our lattice calculations, we use cubic periodic boundary conditions with $L \times L \times L$ unit cells. Unless otherwise indicated, we use units where factors of $a_{\rm latt}$ and $\hbar$ are not explicitly written. The BCC lattice can be viewed as two simple cubic sublattices, both with lattice spacing $a_{\rm latt}$, such that the sites of one sublattice are positioned at the centers of the lattice cubes of the other sublattice and vice versa. The points of the first sublattice are located at integer triples $(n_x,n_y,n_z)$, while the points of the second sublattice are shifting by $\left(\frac{1}{2},\frac{1}{2},\frac{1}{2}\right)$ from the first sublattice points. The total number of lattice points is $2L^3$. We denote the full set of lattice sites as ${\boldsymbol n}$, while the first sublattice is written as ${\boldsymbol n}_1$ and the second sublattice is written as ${\boldsymbol n}_2$. The mass of all our fermions is $m$ and our lattice time step, $a_t$, is taken to be $0.0107\,ma_{\rm latt}^2\hbar^{-1}$. The lattice Hamiltonian consists of free and interaction parts, \begin{eqnarray} H= H_{\rm free} +V. \end{eqnarray} The free Hamiltonian takes the form \begin{eqnarray} H_{\rm free}&=&\frac{\hbar^2}{2m}\sum_{{\bm n}} \left[ w_0a^\dagger({\bm n})a({\bm n}) +w_1\sum_{{\boldsymbol \Delta \in S_{\boldsymbol \Delta}}}a^\dagger({\bm n}+{\boldsymbol \Delta})a({\bm n}) \right. \nonumber \\ & & \left. \quad +w_2\sum_{{\boldsymbol \Delta \in S_{\boldsymbol \Delta}}}a^\dagger({\bm n}+2{\boldsymbol \Delta})a({\bm n}) +w_3\sum_{{\boldsymbol \Delta \in S_{\boldsymbol \Delta}}}a^\dagger({\bm n}+3{\boldsymbol \Delta})a({\bm n})+\cdots \right]\, , \end{eqnarray} where the eight displacement vectors in $S_{\boldsymbol \Delta}$ are \begin{eqnarray} S_{\boldsymbol \Delta}= \left(\pm \frac{1}{2},\pm \frac{1}{2},\pm \frac{1}{2}\right). \end{eqnarray} The eigenstates of our free Hamiltonian are momentum eigenstates $|{\bm p}\rangle$ with momenta ${\bm p}=(p_x,p_y,p_z)$ such that \begin{eqnarray} H_{\rm free}|{\bm p}\rangle = \frac{\hbar^2}{2m} f({\bm p}) |{\bm p}\rangle, \end{eqnarray} where \begin{eqnarray} f({\bm p})&=& w_0 +8w_1 \cos\left(\frac{p_x}{2}\right) \cos\left(\frac{p_y}{2}\right) \cos\left(\frac{p_z}{2}\right)\nonumber \\ & & +8w_2 \cos\left( p_x \right) \cos\left( p_y\right) \cos\left( p_z \right)\nonumber \\ & & +8w_3 \cos\left( \frac{3p_x}{2}\right) \cos\left( \frac{3p_y}{2}\right) \cos\left( \frac{3p_z}{2}\right) +\cdots\, . \end{eqnarray} The values of the coefficients $w_i$ are fixed such that $f({\bm p})$ gives the desired $p^2$ behavior up to some prescribed order in powers of the momentum. At ${\cal O}(p^2)$, we have \begin{eqnarray} w_0=8, \quad w_1=-1 ,\quad w_2 =0,\quad w_3=0. \end{eqnarray} At ${\cal O}(p^4)$, \begin{eqnarray} w_0=10, \quad w_1=-\frac{4}{3} ,\quad w_2 =\frac{1}{12},\quad w_3=0. \end{eqnarray} At ${\cal O}(p^6)$, \begin{eqnarray} w_0=\frac{98}{9}, \quad w_1=-\frac{3}{2} ,\quad w_2 =\frac{3}{20},\quad w_3=-\frac{1}{90}. \end{eqnarray} In this work, we use the free Hamiltonian valid up to ${\cal O}(p^6)$. For the lattice interaction we use the nonlocal smearing method described in Ref.~\cite{He:2019ipt}. It has the advantage of allowing the tuning of the S-wave scattering phase shifts as desired without introducing interactions in other partial wave channels. The interaction has the form \begin{eqnarray} V=\frac{C_0}{2}\sum_{{\bm n}} : \rho_{\rm NL}({\bm n})\rho_{\rm NL}({\bm n}): , \end{eqnarray} where $::$ denotes normal ordering, where the annihilation operators are on the right and the creation operators are on the left. The nonlocal density operator is defined by \begin{eqnarray} \rho_{\rm NL}({\bm n})&=&\sum_{\sigma=\uparrow,\downarrow} a^\dagger_{\sigma,{\rm NL}}({\bm n})a_{\sigma,{\rm NL}}({\bm n}), \end{eqnarray} where \begin{eqnarray} a_{\sigma,{\rm NL}}({\bm n})&=& a_\sigma({\bm n})+s_{\rm NL} \sum_{{\boldsymbol \Delta} \in S_{\boldsymbol \Delta}} a_\sigma({\bm n} + \Delta),\nonumber \\ a^\dagger_{\sigma,{\rm NL}}({\bm n})&=& a^\dagger_\sigma({\bm n})+s_{\rm NL} \sum_{{\boldsymbol \Delta} \in S_{\boldsymbol \Delta}} a^\dagger_\sigma({\bm n} + \Delta). \end{eqnarray} For the unitary Fermi gas, we set $C_0=-0.744917$ in lattice units and $s_{\rm NL}=-9.5337 \times 10^{-4}$, which corresponds to infinite scattering length and an effective range of about $0.06$ lattice units. In Fig.~\ref{phase_shift}, we show the S-wave phase shifts computed on the BCC lattice versus relative momentum. At low momenta, the phase shifts are in excellent agreement with the unitary limit, which corresponds to a constant phase shift equal to $90$ degrees. The lattice phase shifts are determined using the spherical wall method \cite{Borasoy:2007vy,Lu:2015riz}. \begin{figure} \centering \includegraphics[width=12cm]{ph_in_unitary_limit.pdf}\\ \caption{S-wave phase shifts computed on the BCC lattice versus relative momentum. The dashed line marks the unitary limit, which corresponds to a constant phase shift equal to $90$ degrees.} \label{phase_shift} \end{figure} \begin{center} \section{Auxiliary-field Monte Carlo simulations} \end{center} The transfer matrix $M$ is defined as the normal-ordered time evolution operator, \begin{equation} M = :\exp[-Ha_t]:. \end{equation} Let $|\Psi_I \rangle$ and $|\Psi_F \rangle$ be the initial and final state wave functions respectively. So long as the initial and final states have nonzero overlap with the ground state, we can project out the ground state by multiplying powers of $M$. The projection amplitude is given by \begin{equation} Z(L_t) = \braket{ \Psi_F | \tilde{M}^{L'_t} M^{L_t} \tilde{M}^{L'_t} | \Psi_I }. \end{equation} In order to reduce the number of time steps needed to converge to the ground state, we have multiplied the initial and final states by $L'_t$ powers of the modified transfer matrix, \begin{equation} \tilde{M} = :\exp[-\tilde{H}\tilde{a}_t]:. \end{equation} In this modified transfer matrix, the interaction coefficient is stronger, with interaction coefficient $\tilde{C}_0=1.6 C_0$, and the time step $\tilde{a}_t$ is taken to be larger, $\tilde{a}_t=5a_t$. We compute the ground state energy, $E_0$ by taking the limit \begin{eqnarray} E_0 = \lim_{L_t \rightarrow \infty} a_t^{-1}\log \frac{Z(L_t-1)}{Z(L_t)}. \end{eqnarray} For the calculations performed here, we take $|\Psi_I \rangle$ and $|\Psi_F \rangle$ to be the same and equal to the Slater determinant state corresponding to the ground state of the free Fermi gas, $| \Psi_0^{\rm free} \rangle$. For the system we are considering with $33$ spin-up and $33$ spin-down fermions in a periodic cube, the free Fermi ground state is unique. This corresponds to momentum states with $|{\boldsymbol p}|$ less than or equal to $4\pi\hbar/(La_{\rm latt})$. We can write the interaction at time step $n_t$ and position $\mathbf{n}$ using an auxiliary field $s(\mathbf{n},n_t)$. We define $V_s^{(n_t)}$ to be \begin{equation} V_s^{(n_t)} = \sqrt{-C_0}\sum_{\mathbf{n}} s(\mathbf{n}, n_t) \rho_{\rm NL}(\mathbf{n}), \end{equation} and the quadratic part of the auxiliary-field action is defined as \begin{equation} V_{ss}^{(n_t)} = \frac{1}{2} \sum_{\mathbf{n}}s^2(\mathbf{n}, n_t). \end{equation} Then the transfer matrix at time step $n_t$ can be expressed as \begin{equation} M^{(n_t)} = \prod_{\mathbf{n}} \bigg [ \int_{-\infty}^{\infty} \sqrt{\frac{1}{2\pi}}ds(\mathbf{n},n_t) \bigg ] \\ :\exp[-H_{\rm free} a_t - V_s^{(n_t)}\sqrt{a_t} - V_{ss}^{(n_t)}]:. \end{equation} Instead of the particles interacting with each other, the particles now only interact with the auxiliary field.\\ \section{Results} We perform BCC lattice simulations of $N_{\uparrow} = 33$ spin-up fermions and $N_{\downarrow} = 33$ spin-down fermions in the unitary limit with lattice lengths $L= 4, \cdots , 10$. This covers a range from $2L^3=128$ lattice points for $L=4$ and $2L^3=2000$ lattice points for $L=10$. The range is comparable to the $L=5, \cdots, 11$ simple cubic lattices used in Ref.~\cite{He:2019ipt}, with $L^3=125$ points for $L=5$ and $L^3=1331$ points for $L=11$. For the auxiliary field updates, we use the shuttle algorithm described in Ref.~\cite{Lu:2019nbg}. More details about how the lattice calculations are performed can be found in Ref.~\cite{Lee:2008fa,Lahde:2019npb}. As discussed in Ref.~\cite{Bour:2011xt}, there are two different ways to define the ground state ratio $\xi=E_0/E_{\rm FG}$ for a system with a finite number of particles. One can either define $E_{\rm FG}$ as the ground state energy of the free fermion gas computed with the same lattice parameters or from the asymptotic formula valid in the thermodynamic and continuum limits. We define $\xi^{\rm few}$ to be the ratio computed using the free fermion gas energy on the lattice with the same lattice parameters, $E^{\rm few}_{\rm FG}$. We define $\xi^{\rm thermo}$ to be the ratio computed using $E^{\rm thermo}_{\rm FG}$, where \begin{eqnarray} E^{\rm thermo}_{\rm FG} = \frac{3}{5}\frac{k_{F}^2}{2m}(N_{\uparrow}+ N_{\downarrow}), \end{eqnarray} where \begin{eqnarray} k_F=\frac{(6\pi^2N_{\uparrow})^{1/3}\hbar}{L}=\frac{(6\pi^2N_{\downarrow})^{1/3}\hbar}{L}. \end{eqnarray} For $N_{\uparrow} = 33$ and $N_{\downarrow} = 33$, we find that, in the continuum limit, $\xi^{\rm thermo}/\xi^{\rm few}=0.995$. In the following, we will therefore restrict our focus to computing $\xi^{\rm few}$ and multiply by $0.995$ to obtain $\xi^{\rm thermo}$. To find the ground state energy, we need to take the limit \begin{eqnarray} E_0 = \lim_{L_t \rightarrow \infty} E(L_t), \end{eqnarray} where \begin{eqnarray} E(L_t) = a_t^{-1}\log \frac{Z(L_t-1)}{Z(L_t)}. \end{eqnarray} Since we will work with ground state ratios, it is convenient to define \begin{eqnarray} \xi^{\rm few}(L_t) = \frac{E(L_t)}{E^{\rm few}_{\rm FG}}. \end{eqnarray} We perform the extrapolation to an infinite number of time steps by using the asymptotic form \begin{eqnarray} \xi^{\rm few}(L_t) \simeq \xi^{\rm few} + \beta e^{-L_t a_t \Delta E}\, , \label{asymptotic} \end{eqnarray} where the unknown parameters $\xi^{\rm few}, \beta, \Delta E$ are fitted. When there are multiple sets of data available for the same system, we perform simultaneous fits using the asymptotic form given in Eq.~(\ref{asymptotic}), with a common value for the extrapolated parameter $\xi^{\rm few}$. In Fig. \ref{fig:ltfitl45}, we plot the lattice results for $\xi^{\rm few}(L_t)$ versus $L_t$ for the $L=4$ and $L=5$ BCC lattices. In each case we present data for $L'_t = 0$ and $L'_t=5$ and show the results of the asymptotic fits. \begin{figure}[h] \centering \includegraphics[width=0.48\linewidth]{Lt_fit_L4} \includegraphics[width=0.48\linewidth]{Lt_fit_L5} \caption{Lattice results for $\xi^{\rm few}(L_t)$ versus $L_t$ for the $L=4$ and $L=5$ BCC lattices. In each case we present data for $L'_t = 0$ and $L'_t=5$ and show the results of the asymptotic fits.} \label{fig:ltfitl45} \end{figure} In Fig. \ref{fig:ltfitl67}, we plot the lattice results for $\xi^{\rm few}(L_t)$ versus $L_t$ for the $L=6$ and $L=7$ BCC lattices. We present data for $L'_t = 0$ and $L'_t=5$ and show the results of the asymptotic fits. \begin{figure}[h] \centering \includegraphics[width=0.48\linewidth]{Lt_fit_L6} \includegraphics[width=0.48\linewidth]{Lt_fit_L7} \caption{Lattice results for $\xi^{\rm few}(L_t)$ versus $L_t$ for the $L=6$ and $L=7$ BCC lattices. We show data for $L'_t = 0$ and $L'_t=5$ and the results of the asymptotic fits.} \label{fig:ltfitl67} \end{figure} In Fig. \ref{fig:ltfitl89}, we plot the lattice results for $\xi^{\rm few}(L_t)$ versus $L_t$ for the $L=8$ and $L=9$ BCC lattices. For $L=8$ we present data for $L'_t = 0$ and $L'_t=5$, while for $L=9$ we present data for $L'_t=5$ only. In each case we show the results of the asymptotic fits. \begin{figure}[h] \centering \includegraphics[width=0.48\linewidth]{Lt_fit_L8} \includegraphics[width=0.48\linewidth]{Lt_fit_L9} \caption{Lattice results for $\xi^{\rm few}(L_t)$ versus $L_t$ for the $L=8$ and $L=9$ BCC lattices. For $L=8$ we show $L'_t = 0$ and $L'_t=5$, while for $L=9$ we present data for $L'_t=5$ only. In each case we show the results of the asymptotic fits.} \label{fig:ltfitl89} \end{figure} In Fig. \ref{fig:ltfitl10}, we plot the lattice results for $\xi^{\rm few}(L_t)$ versus $L_t$ for the $L=10$ lattice. We present data for $L'_t = 5$ and $L'_t=40$ and show the results of the asymptotic fits. \begin{figure}[h] \centering \includegraphics[width=0.48\linewidth]{Lt_fit_L10} \caption{Lattice results for $\xi^{\rm few}(L_t)$ versus $L_t$ for the $L=10$ BCC lattice. We present data for $L'_t = 5$ and $L'_t=40$ and show the results of the asymptotic fits.}\label{fig:ltfitl10} \end{figure} We see that all of the asymptotic fits do a good job of reproducing the behavior at large $L_t$. In Table~\ref{table1}, we show the extracted values for $\xi^{\rm few}(L)$ using BCC lattices for $L=4, \cdots, 10$. \begin{table} \caption{\label{table1} Extracted values for $\xi^{\rm few}(L)$ using BCC lattices for $L=4, \cdots, 10$.} \begin{tabular}{|@{\hspace{1em}}r@{\hspace{1em}}|@{\hspace{1em}}l@{\hspace{1em}}|} \hline $L$ & $\xi^{\rm few}(L)$ \\ \hline 4 & 0.3208(2) \\ 5 & 0.3468(1) \\ 6 & 0.3567(2) \\ 7 & 0.3626(2) \\ 8 & 0.3669(3) \\ 9 & 0.3684(11) \\ 10 & 0.3692(12) \\ \hline \end{tabular} \end{table} In order to extrapolate $\xi^{\rm few}$ to the continuum limit, we use the fitting function \begin{eqnarray} \xi^{\rm few}(\rho) = d_1 \rho + d_\gamma \rho^\gamma + \xi^{\rm few}, \end{eqnarray} where $\rho$ is the density particles in lattice units, \begin{eqnarray} \rho = \frac{N_{\uparrow}+N_{\downarrow}}{L^3} = \frac{66}{L^3}. \end{eqnarray} In Fig. \ref{fig:rhofit} we plot the continuum limit extrapolations for $\xi^{\rm few}(\rho)$ using $\gamma=\frac{1}{3},\frac{2}{3}, \frac{4}{3},\frac{5}{3}$. We see that the dependence on $\gamma$ is quite minor and the extrapolation is dominated by the $\rho^1$ dependence. Incorporating the extrapolation fits for all values of $\gamma$, we obtain the value $\xi^{\rm few}=0.371(2)$, From this we multiply by $0.995$ to obtain $\xi^{\rm therm}=0.369(2)$. These are consistent with cubic lattice results $\xi^{\rm finite}=0.372(2)$ and $\xi^{\rm thermo}=0.369(2)$~\cite{He:2019ipt}, as well as other numerical calculations~\cite{Forbes:2010gt, Carlson:2011kv, Endres:2012cw, Jensen:2019zkr} and the experimental measurement of 0.376(4) \cite{Ku:2012}. \begin{figure}[h] \centering \includegraphics[width=0.7\linewidth]{rho_fit} \caption{Plots of the continuum limit extrapolations of $\xi^{\rm few}(\rho)$ using $\gamma=\frac{1}{3},\frac{2}{3}, \frac{4}{3},\frac{5}{3}$.} \label{fig:rhofit} \end{figure} \section{Summary and outlook} \label{Sec:Summary} We have performed quantum many-body calculations using auxiliary-field Monte Carlo simulations on a three-dimensional BCC lattice. To our knowledge, this is the first calculation of a fermionic many-body system on a BCC lattice. As a benchmark test, we have calculated the ground state energy $E_0$ of 33 spin-up and 33 spin-down fermions in the unitary limit. Using periodic boxes with lattice lengths $L=4, \cdots, 10$, we find that the ground state energy ratio is $E_0/E_{\rm FG}= 0.369(2)$, $0.371(2)$, using two different definitions of the finite-system energy ratio. This is in excellent agreement with recent results obtained on a simple cubic lattice \cite{He:2019ipt} using similar auxiliary-field Monte Carlo methods. The agreement between BCC and simple cubic results gives some confidence that any remnants of the underlying lattice geometry have been removed by performing the continuum limit extrapolation. In our calculations we have not yet considered the thermodynamic limit where the number of particles are taken to infinity, but we hope to address this challenge in the future. We find that the amount of computational effort required for the BCC lattice calculations is very similar to that for the simple cubic lattice calculations with the same number of lattice points. There is a slight increase in computational time arising from the fact that the BCC lattice has eight nearest neighbor sites as opposed to six nearest neighbor sites for the simple cubic lattice. However, the resulting difference in the computing time is minor. The quality of the results that one can extract on the BCC lattice seems also quite comparable. In both cases, we used the shuttle algorithm described in Ref.~\cite{Lu:2019nbg} to update the auxiliary fields. In the lattice calculations presented here, we have not required any Fourier transformation calculations. Fast Fourier transformations on BCC lattices as well as face-centered cubic (FCC) lattices have been presented in the literature. Momenta on rectangular lattices are considered in Ref.~\cite{Alim:2009}, while momenta on BCC and FCC lattices are discussed in Ref.~\cite{Zheng:2014}. In the future, we hope to present a similar study for lattice calculations on an FCC lattice, which has four sites per unit cell and presents yet another lattice geometry with octahedral symmetry. Having the ability to perform calculations using several different lattice spacings and more than one lattice geometry will be useful for studying the correlations of particles in quantum many-body systems such as the nucleons in an atomic nuclei. The correlations of nucleons at densities comparable to the saturation density of nuclear matter or greater are of much interest for both atomic nuclei and the equation of state of dense matter in neutron stars. Obtaining consistent results from simulations using different lattice geometries would mitigate the need to perform computationally expensive calculations with the lattice spacing much smaller than $1$~fm. \begin{acknowledgments} We are grateful for discussions with Ulf-G. Meißner. Computational resources were partly provided by the National Supercomputing Center of Korea with supercomputing resources including technical support (KSC-2018-COL-0002, KSC-2020-CRE-0027). The work of Y.H.S. and Y.K. was supported by the Rare Isotope Science Project of Institute for Basic Science, funded by Ministry of Science and ICT (MSICT) and by National Research Foundation of Korea (2013M7A1A1075764). D.L. acknowledges financial support from the U.S. Department of Energy (DE-SC0013365 and DE-SC0021152) and NUCLEI SciDAC-4 collaboration (DE-SC0018083) as well as computational resources from the Oak Ridge Leadership Computing Facility through the INCITE award ``Ab-initio nuclear structure and nuclear reactions'', the J\"ulich Supercomputing Centre at Forschungszentrum J\"ulich, RWTH Aachen, and Michigan State University. \end{acknowledgments}
\section{Conclusion} In this work we have taken a fine-grained view of the complexity of popular notions of dynamic data races. We have established a range of lower bounds on the complexity of detecting $\operatorname{\acr{HB}}$ races, sync-preserving races, as well as races based on the locking discipline (lock-cover/lock-set races). Moreover, we have characterized cases where lower bounds based on SETH are not possible under NSETH. Finally, we have proven new upper bounds for detecting $\operatorname{\acr{HB}}$ and lock-set races. To our knowledge, this is the first work that characterizes the complexity of well-established dynamic race-detection techniques, allowing for a rigorous characterization of their trade-offs between expressiveness and running time. \subsection{Concurrent Program Executions and Data Races} \myparagraph{Traces and Events}{ We consider execution traces (or simply \emph{traces}) generated by concurrent programs, under the sequential consistency memory model. Under this memory model, a trace $\sigma$ is a sequence of events. Each event $e$ is labeled with a tuple $\mathsf{lab}(e) = \ev{t, op}$, where $t$ is the (unique) identifier of the thread that performs the event $e$, and $op$ is the operation performed in $e$. We will often abuse notation and write $e = \ev{t, op}$ instead of $\mathsf{lab}(e) = \ev{t, op}$. For the purpose of this presentation, an operation can be one of \begin{enumerate*}[label=(\alph*)] \item read ($\opfont{r}(x)$) from, or write ($\opfont{w}(x)$) to, a shared memory variable $x$, \item $\opfont{acq}(\ell)$ or $\opfont{rel}(\ell)$ of a lock $\ell$. \end{enumerate*} For an event $e = \ev{t, op}$, we use $\ThreadOf{e}$ and $\OpOf{e}$ to denote respectively the thread identifier $t$ and the operation $op$. For a trace $\sigma$, we use $\events{\sigma}$ to denote the set of events that appear in $\sigma$. Similarly, we will use $\threads{\sigma}$, $\locks{\sigma}$ and $\vars{\sigma}$ to denote respectively the set of threads, locks and shared variables that appear in trace $\sigma$. We denote by $\mathcal{N}=|\events{\sigma}|$, $\mathcal{T}=|\threads{\sigma}|$, $\mathcal{L}=|\locks{\sigma}|$, and $\mathcal{V}=|\vars{\sigma}|$. The set of read events and write events on variable $x \in \vars{\sigma}$ will be denoted by $\reads{\sigma}(x)$ and $\writes{\sigma}(x)$, and further we let $\accesses{\sigma}(x) = \reads{\sigma}(x) \cup \writes{\sigma}(x)$. Similarly, we let $\acquires{\sigma}(\ell)$ and $\releases{\sigma}(\ell)$ denote the set of lock-acquire and lock-release events, respectively, of $\sigma$ on lock $\ell$. The \emph{trace order} of $\sigma$, denoted $\trord{\sigma}$, is the total order on $\events{\sigma}$ induced by the sequence $\sigma$. Finally, the \emph{thread-order} of $\sigma$, denoted $\tho{\sigma}$ is the smallest partial order on $\events{\sigma}$ such that for any two events $e_1, e_2 \in \events{\sigma}$, if $e_1 \trord{\sigma} e_2$ and $\ThreadOf{e_1} = \ThreadOf{e_2}$, then $e_1 \tho{\sigma} e_2$. Traces are assumed to be well-formed in that critical sections on the same lock do not overlap. For a lock $\ell \in \locks{\sigma}$, let $\proj{\sigma}{\ell}$ be the projection of the trace $\sigma$ on the set of events $\setpred{e}{\OpOf{e} \in \set{\opfont{acq}(\ell), \opfont{rel}(\ell)}}$. Also, let $t_1, \ldots t_k$ be the thread identifiers in $\threads{\sigma}$. Well-formedness then entails that for each lock $\ell$, the projection $\proj{\sigma}{\ell}$ is a prefix of some string in the language of the grammar with production rules $S \rightarrow \varepsilon | S \cdot S_{t_1} | S \cdot S_{t_2} | \cdots | S \cdot S_{t_k}$ and $S_{t_i} \rightarrow \ev{t_i, \opfont{acq}(\ell)} \cdot \ev{t_i, \opfont{rel}(\ell)}$ and start symbol $S$. Thus, every release event $e$ has a unique matching acquire event, which we denote by $\match{\sigma}(e)$. Likewise for an acquire event $e$, $\match{\sigma}(e)$ denotes the unique matching release event if one exists. For an acquire event $e$, the critical section of $e$ is the set of events $\crit{\sigma}(e)=\setpred{f}{e \tho{\sigma} f \tho{\sigma} \match{\sigma}(e)}$ if $\match{\sigma}(e)$ exists, and $\crit{\sigma}(e)=\setpred{f}{e \tho{\sigma} f}$ otherwise. } \myparagraph{Data Races}{ Two events $e_1, e_2 \in \events{\sigma}$ are said to be \emph{conflicting} if they are performed by different threads, they are access events touching the same memory location, and at least one of them is a write access. Formally, we have (i)~$\ThreadOf{e_1} \neq \ThreadOf{e_2}$, (ii)~$e_1, e_2\in \accesses{\sigma}(x)$ for some $x\in \vars{\sigma}$, and (iii)~$\{e_1, e_2\}\cap \writes{\sigma}(x)\neq \emptyset$. An event $e \in \events{\sigma}$ is said to be $\emph{enabled}$ in a prefix $\rho$ of $\sigma$, if for every event $e' \neq e$ with $e' \tho{\sigma} e$, we have $e' \in \events{\rho}$. A data race in $\sigma$ is a pair of conflicting events $(e_1, e_2)$ such that there is a prefix $\rho$ in which both $e_1$ and $e_2$ are simultaneously enabled. Depending on the type of access of $e_1$ and $e_2$, we often distinguish between write-write races and write-read races. } \subsection{Our Contributions}\label{subse:contributions} Here we give a full account of the main results of this work, while we refer to later sections for precise definitions and proofs. We also refer to \cref{sec:fine_grained} for relevant notions in fine-grained complexity and popular hypotheses. The input is always a concurrent trace $\sigma$ of length $\mathcal{N}$, consisting of $\mathcal{T}$ threads, $\mathcal{L}$ locks, and $\mathcal{V}$ variables. \Paragraph{Happens-before races.} We first study the fine-grained complexity of $\operatorname{\acr{HB}}$ races, as they form the most popular class of dynamic data races. The task of most techniques is to report all events in $\sigma$ that participate in an $\operatorname{\acr{HB}}$ race, which is known to take $O(\mathcal{N}\cdot \mathcal{T})$ time~\cite{djit1999}. Note that the bound is quadratic when $\mathcal{T}=\Theta(\mathcal{N})$, and multiple heuristics have been developed to address it in practice (see e.g.,~\cite{Flanagan09}). Our first result shows that polynomial improvements below this quadratic bound are unlikely. \begin{restatable}{theorem}{hbovhard}\thmlabel{hb-ov-hard} For any $\epsilon>0$, there is no algorithm that detects even a single $\operatorname{\acr{HB}}$ race that involves a read in time $O(\mathcal{N}^{2-\epsilon})$, unless the $\textsf{OV}$ hypothesis fails. \end{restatable} Orthogonal vectors ($\textsf{OV}$) is a well-studied problem with a long-standing quadratic worst-case upper bound. The associated hypothesis states that there is no sub-quadratic algorithm for the problem~\cite{Williams18}. It is also known that the strong exponential time hypothesis (\textsf{SETH}) implies the Orthogonal Vectors hypothesis~\cite{Williams05}. Thus, under the $\textsf{OV}$ hypothesis, \thmref{hb-ov-hard} establishes a quadratic lower bound for $\operatorname{\acr{HB}}$ race detection. Note that the hardness of \thmref{hb-ov-hard} arises out of the requirement to detect $\operatorname{\acr{HB}}$ races that involve a read. A natural follow-up question is whether detecting if the input contains \emph{any} $\operatorname{\acr{HB}}$ race (i.e., not necessarily involving a read) has a similar lower bound based on \textsf{SETH}. Our next theorem shows that under the non-deterministic \textsf{SETH}~(\textsf{NSETH})~\cite{CarmosinoGIMPS2016}, there is no fine-grained reduction from \textsf{SETH}{} that proves any lower bound for this problem above $\mathcal{N}^{3/2}$. \begin{restatable}{theorem}{hbdecidenosethbetterthanthreeovertwo}\thmlabel{hb-decide-no-seth-better-than-3/2} For any $\epsilon>0$, there is no $(2^{\mathcal{N}}, \mathcal{N}^{3/2+\epsilon})$-fine-grained reduction from $\textsf{SAT}$ to the problem of detecting any $\operatorname{\acr{HB}}$ race with bound, unless \textsf{NSETH}{} fails. \end{restatable} Given the impossibility of \thmref{hb-decide-no-seth-better-than-3/2}, it would be desirable to at least show a super-linear lower bound for detecting any $\operatorname{\acr{HB}}$ data race. To tackle this question, we show that detecting any $\operatorname{\acr{HB}}$ race is hard for the general problem of model checking first-order formulas quantified by $\forall\exists\exists$ on structures of size $n$ with $m$ relational tuples (denoted \textsf{FO}($\mathsf{\forall\exists\exists}$){}). \begin{restatable}{theorem}{hbdecidemchard}\thmlabel{hb-decide-mc-hard} For any $\epsilon>0$, if there is an algorithm for detecting any $\operatorname{\acr{HB}}$ race in time $O(\mathcal{N}^{1+\epsilon})$, then there is an algorithm for \textsf{FO}($\mathsf{\forall\exists\exists}$){} formulas in time $O(m^{1+\epsilon})$. \end{restatable} It is known that \textsf{FO}($\mathsf{\forall\exists\exists}$){} can be solved in $O(m^{3/2})$ time~\cite{Gao2018}, which yields a bound $O(n^3)$ for dense structures (i.e., when $m=\Theta(n^2)$). \thmref{hb-decide-mc-hard} implies that if $m^{3/2}$ is the best possible bound for \textsf{FO}($\mathsf{\forall\exists\exists}$){}, then detecting any $\operatorname{\acr{HB}}$ race cannot take $O(\mathcal{N}^{1+\epsilon})$ time for any $\epsilon <1/2$. Although improvements for \textsf{FO}($\mathsf{\forall\exists\exists}$){} over the current $O(m^{3/2})$ bound might be possible, we find that a truly linear bound $O(m)$ would require major breakthroughs~\footnote{Even the well-studied problem of testing triangle freeness, which is a special case of the similarly flavored \textsf{FO}($\mathsf{\exists\exists\exists}$), has the super-linear bound $O(n^{\omega})$.}. Under this hypothesis, \thmref{hb-decide-mc-hard} implies a super-linear bound for $\operatorname{\acr{HB}}$ races. Finally, we give an improved upper bound for this problem when $\mathcal{L}=o(\mathcal{T})$. \begin{restatable}{theorem}{hbalgo}\thmlabel{hb-algo} Deciding whether $\sigma$ has an $\operatorname{\acr{HB}}$ race can be done in time $O(\mathcal{N}\cdot \min(\mathcal{T}, \mathcal{L}))$. \end{restatable} In fact, similar to existing techniques~\cite{Flanagan09}, the algorithm behind \thmref{hb-algo} detects \emph{all} variables that participate in an $\operatorname{\acr{HB}}$ race (instead of just reporting $\sigma$ as racy). \Paragraph{Synchronization-preserving races.} Next, we turn our attention to the recently introduced sync-preserving races~\cite{Mathur2020b}. It is known that detecting sync-preserving races takes $O(\mathcal{N}\cdot\mathcal{V}\cdot \mathcal{T}^3)$ time. As sync-preserving races are known to be more expressive than $\operatorname{\acr{HB}}$ races, the natural question is whether sync-preserving races can be detected more efficiently, e.g., by an algorithm that achieves a bound similar to \thmref{hb-algo} for $\operatorname{\acr{HB}}$ races. Our next theorem answers this question in negative. \begin{restatable}{theorem}{syncpovthreehard}\thmlabel{syncp-ov3-hard} For any $\epsilon>0$, there is no algorithm that detects even a single sync-preserving race in time $O(\mathcal{N}^{3-\epsilon})$, unless the $\orthvk{3}$ hypothesis fails. Moreover, the statement holds even for traces over a single variable. \end{restatable} As $\operatorname{\acr{HB}}$ races take at most quadratic time, \thmref{syncp-ov3-hard} shows that the increased expressiveness of sync-preserving races incurs a complexity overhead that is unavoidable in general. \Paragraph{Races based on the locking discipline.} We now turn our attention to data races based on the locking discipline, namely \emph{lock-cover races} and \emph{lock-set races}. It is known that lock-cover races are more expressive than lock-set races. On the other hand, existing algorithms run in $O(\mathcal{N}^2\cdot \mathcal{L})$ time for lock-cover races and in $O(\mathcal{N}\cdot \mathcal{L})$ time for lock-set races, and thus hint that the former are computationally harder to detect. Our first theorem makes this separation formal, by showing that even with just two threads, having slightly more that logarithmically many locks implies a quadratic hardness for lock-cover races. \begin{restatable}{theorem}{lockcoverquadraticlowerbound}\thmlabel{lock-cover-quadratic-lower-bound} For any $\epsilon>0$, any $\mathcal{T} \geq 2$ and any $\mathcal{L}=\omega(\log \mathcal{N})$, there is no algorithm that detects even a single lock-cover race in time $O(\mathcal{N}^{2-\epsilon})$, unless the $\textsf{OV}$ hypothesis fails. \end{restatable} Observe that the $O(\mathcal{N}\cdot \mathcal{L})$ bound for lock-set races also becomes quadratic, when the number of locks is unbounded (i.e., $\mathcal{L} =\Theta(\mathcal{N}))$. Is there a \textsf{SETH}-based quadratic lower bound similar to \thmref{lock-cover-quadratic-lower-bound} for this case? Our next theorem rules out this possibility, again under \textsf{NSETH}{}. \begin{restatable}{theorem}{lock-set-nseth}\thmlabel{lock-set-nseth} For any $\epsilon>0$, there is no $(2^\mathcal{N},\mathcal{N}^{1+\epsilon})$-fine-grained reduction from $\textsf{SAT}$ to the problem of detecting any lock-set race, unless \textsf{NSETH}{} fails. \end{restatable} Hence, even though we desire a quadratic lower bound, \thmref{lock-set-nseth} rules out any super-linear lower-bound based on \textsf{SETH}. Alas, our next theorem shows that a quadratic lower bound for lock-set races does exist, based on the hardness of the hitting set ($\textsf{HS}$) problem. \begin{restatable}{theorem}{locksetquadraticlowerbound}\thmlabel{lock-set-quadratic-lower-bound} For any $\epsilon>0$ and any $\mathcal{T} = \omega(\log n)$, there is no algorithm that detects even a single lock-set race in time $O(\mathcal{N}^{2-\epsilon})$, unless the $\textsf{HS}$ hypothesis fails. \end{restatable} Hitting set is a problem similar to $\textsf{OV}$, but has different quantifier structure. Just like the $\textsf{OV}$ hypothesis, the $\textsf{HS}$ hypothesis states that there is no sub-quadratic algorithm for the problem~\cite{Abboud2016}. Although $\textsf{HS}$ implies $\textsf{OV}$, the opposite is not known, and thus \thmref{lock-set-quadratic-lower-bound} does not contradict \thmref{lock-set-nseth}. In conclusion, we have that both lock-cover and lock-set races have (conditional) quadratic lower bounds, though the latter is based on a stronger hypothesis ($\textsf{HS}$), and requires more threads and locks for hardness to arise. Finally, on our way to \thmref{lock-set-nseth}, we obtain the following theorem. \begin{restatable}{theorem}{locksetsinglevariablelinear}\thmlabel{lock-set-single-variable-linear} Deciding whether a trace $\sigma$ has a lock-set race on a variable $x$ can be performed in $O(\mathcal{N})$ time. Thus, deciding whether $\sigma$ has a lock-set race can be performed in $O(\mathcal{N}\cdot \min(\mathcal{L}, \mathcal{V}))$ time. \end{restatable} Hence, \thmref{lock-set-single-variable-linear} strengthens the $O(\mathcal{N} \cdot \mathcal{L})$ upper bound for lock-set races when $\mathcal{V}=o(\mathcal{L})$. \section{Fine-Grained Complexity and Popular Hypotheses}\label{sec:fine_grained} In this section we present notions of fine-grained complexity theory that are relevant to our work. We refer to the survey \cite{Williams18} for a detailed exposition on the topic. This theory relates the computational complexity of problems under the following, more refined, notion of reduction than the standard ones used in traditional complexity theory. Informally, the definition says that if there is an algorithm for some problem B faster than its assumed lower bound, then such a reduction from some problem A to B gives an algorithm for A thatis faster than its conjectured lower bound. \Paragraph{Fine-grained Reductions.} Assume that A and B are computational problems and $a(n)$ and $b(n)$ are their conjectured running time lower bounds, respectively. Then we say A $(a,b)$-reduces to B, denoted by A \fgr{a}{b} B, if for every $\epsilon>0,$ there exists $\delta > 0$, and an algorithm R for A that runs in time $a(n)^{(1-\delta)}$ on inputs of length $n$, making $q$ calls to an oracle for B with query lengths $n_1,\dotsc, n_q$, where, $$\sum_{1}^{q}(b(n))^{(1-\epsilon)}\le (a(n))^{(1-\delta)}.$$ Problems that can be reduced to each other such that the lower bounds for each problem are the same in both reductions, i.e., A\fgr{a}{b}B and B\fgr{b}{a}A, are intuitively thought to have the same underlying `reason' for hardness, and are said to be fine-grained equivalent. A reduction A\fgr{a}{b}B would be interesting for B if $a(n)$ was a proven or well-believed conjectured lower bound on A, thus implying a believable lower bound on B. One such well-believed conjecture in complexity theory is \textsf{SETH}{}~\cite{ImpagliazzoP01} for the classic CNF-SAT problem, originally defined for deterministic algorithms, but now widely believed for randomized algorithms as well. \begin{hypothesis} [Strong Exponential Time Hypothesis (\textsf{SETH})]\deflabel{seth} For every $\epsilon>0$ there exists an integer $k\ge 3$ such that CNF-SAT on formulas with clause size at most $k$ and $n$ variables cannot be solved in $O(2^{(1-\epsilon)n})$ time even by a randomized algorithm. \end{hypothesis} \textsf{SETH}{} implies a lower bound conjecture, denoted by \textsf{OVH}{}, on the Orthogonal Vectors problem \textsf{OV}{}, as shown by a reduction from CNF-SAT to $\orthvk{k}$ \cite{Williams05}. Thus, a conditional lower bound under \textsf{OVH}{} implies one under \textsf{SETH}{} as well, leading to numerous conditional lower bound results under \textsf{OVH}{} [See \cite{Williams18} for a detailed literature review]. This paper will also prove such results on several data race detection problems, hence we now state $\orthvk{k}$ and \textsf{OVH}{} formally. An instance of $\orthvk{k}$ is an integer $d=\omega(\log n)$ and $k$ sets $A_i\subseteq \{0,1\}^d,\ i\in [n]$ such that $|A_i|=n,$ and denoted by $\orthv(n,d){}$. \begin{problem}[Orthogonal Vectors ($\orthvk{k}$)]\problabel{ov-definition} Given an instance $\ovinsthree{k}$, the \orthvk{k} problem is to decide if there are $k$ vectors $a_i\in A_i$ for all $i\in [n]$ such that the sum of their point wise product is zero, i.e., $\sum_{j=1}^d \prod_{i=1}^k a_i[j]=0.$ \end{problem} For ease of exposition, we denote $\ovinsthree{2}$ and $\orthvk{2}$ by \orthv(n,d){} and \textsf{OV}{} respectively. \begin{hypothesis} [Orthogonal Vectors Hypothesis (\textsf{OVH})]\deflabel{ovc} No randomized algorithm can solve $\orthvk{k}$ for an instance $\ovinsthree{k}$ in time $O(n^{(k-\epsilon)}\cdot \operatorname{poly}(d))$ for any constant $\epsilon>0$. \end{hypothesis} There is an impossibility result from \cite{CarmosinoGIMPS2016} that proves that a reduction under \textsf{SETH}{}, and hence under \textsf{OVH}{}, is not possible unless the following \textsf{NSETH}{} conjecture is false. \begin{hypothesis} [Non-deterministic \textsf{SETH}{} (\textsf{NSETH})]\deflabel{nseth} For every $\epsilon>0$, there exists a $k$ so that k-TAUT is not in $\ntime{2^{n(1-\epsilon)}}$, where k-TAUT is the language of all k-DNF formulas which are tautologies. \end{hypothesis} The impossibility result \cite[Corollary~2]{CarmosinoGIMPS2016} is as follows. \begin{theorem}\thmlabel{better-than-t-unlikely-under-seth} If \textsf{NSETH}{} holds and a problem C $\in \ntime{T_C}\cap \contime{T_C},$ then for any problem B that is \textsf{SETH}{}-hard under deterministic reductions with time $T_B,$ and $\gamma>0,$ we cannot have a fine-grained reduction B \fgr{T_B}{c} C where $c=T_C^{(1+\gamma)}.$ \end{theorem} We show some of our problems satisfy the conditions of \thmref{better-than-t-unlikely-under-seth}, and hence show lower bounds for these conditioned on one of two other hypotheses called \textsf{HSH}{} and \textsf{FOPH}($\mathsf{\forall\exists\exists}$){}, described below. An instance of the hitting set problem, denoted by \textsf{HS}{}, is an integer $d=\omega(\log n)$ and sets $X,Y\subseteq \{0,1\}^d,\ i\in [n]$ such that $|X|=|Y|=n,$ and denoted by \hsins{}. \begin{problem}[Hitting Sets (\textsf{HS})]\problabel{hs-definition} Given an instance \hsins{}, the \textsf{HS}{} problem is to decide if there is a vector $x\in X$ such that for all $y\in Y$ we have $x\cdot y\ne 0,$ or informally, some vector in $X$ hits all vectors in $Y.$ \end{problem} \begin{hypothesis} [Hitting Sets Hypothesis (\textsf{HSH})]\deflabel{hsc} No randomized algorithm can solve \textsf{HS}{} for an instance \hsins{} in time $O(n^{(2-\epsilon)}\cdot \operatorname{poly}(d))$ for any constant $\epsilon>0.$ \end{hypothesis} \textsf{HSH}{} implies \textsf{OVH}{}, but the reverse direction is not known. Finally we consider a subclass of first order formula over structures of size $n$ and with $m$ relational tuples~\cite{Gao2018}. \begin{problem}[\textsf{FO}($\mathsf{\forall\exists\exists}$){}]\problabel{first-order-forall-exist-exist} Decide if a given a first-order formula quantified by $\forall\exists\exists$ has a model on a structure of size $n$ with $m$ relational tuples. \end{problem} It is known that \textsf{FO}($\mathsf{\forall\exists\exists}$){} can be solved in $O(m^{3/2})$ time using ideas from triangle detection algorithms~\cite{Gao2018}. For dense structures ($m=\Theta(n^2))$, this yields the bound $O(n^3)$. Although sub-cubic algorithms might be possible, achieving a truly quadratic bound seems unlikely or at least highly non-trivial. \subsection{Algorithm for $\operatorname{\acr{HB}}$ Races} \seclabel{hb-upper-bound} In this section, we outline our $O(\mathcal{N} \cdot \mathcal{L})$-time algorithm for checking if a trace $\sigma$ has an $\operatorname{\acr{HB}}$-race, thereby proving \thmref{hb-algo}. As with the standard vector clock algorithm~\cite{djit1999}, our algorithm is based on computing timestamps for each event. However, unlike the standard algorithm that assigns thread-indexed timestamps, we use \emph{lock-indexed} timestamps, or \emph{lockstamps}, which we formalize next. We fix the input trace $\sigma$ in the rest of the discussion. \Paragraph{Lockstamps}{ A lockstamp is a mapping from locks to natural numbers (including infinity) $L : \locks{\sigma} \to \mathbb{N}\cup\{\infty\}$. Given lockstamps $L, L_1, L_2$ and lock $\ell$, we use the notation \begin{enumerate*}[label=(\roman*)] \item $L[\ell \mapsto c]$ to denote the the lockstamp $\lambda m {\cdot} \text{ if } m = \ell \text{ then } c \text{ else } L(m)$, \item $L_1 \sqcup L_2$ to denote the pointwise maximum, i.e., $(L_1\sqcup L_2)(\ell) = \max(L_1(\ell), L_2(\ell))$ for every $\ell$, \item $L_1 \sqcap L_2$ to denote the pointwise minimum, and \item $L_1 \sqsubseteq L_2$ to denote the predicate $\forall \ell {\cdot} L_1(\ell) \leq L_2(\ell)$. \end{enumerate*} } Our algorithm computes \emph{acquire} and \emph{release} lockstamps $\acqls{\sigma}_e$ and $\rells{\sigma}_e$ for every event $e \in \events{\sigma}$. Let us formalize these next. For a lock $\ell$ and acquire event $f \in \acquires{\sigma}(\ell)$ (resp. release event $g \in \releases{\sigma}(\ell)$), let $pos_\sigma(f) = |\setpred{f' \in \acquires{\sigma}(\ell)}{f' \trord{\sigma} f}|$ (resp. $pos_\sigma(g) = |\setpred{f' \in \releases{\sigma}(\ell)}{f' \trord{\sigma} f}|$) denote the relative position of $f$ (resp. $g$) among all acquire events (resp. release events) of $\ell$. Then, for an event $e \in \events{\sigma}$ the lockstamps $\acqls{\sigma}_e$ and $\rells{\sigma}_e$ are defined as follows (we assume that $\max\emptyset = 0$ and $\min\emptyset = \infty$.) \begin{equation} \begin{array}{rcl} \acqls{\sigma}_e(\ell) &=& \lambda \ell \cdot \max\setpred{pos_\sigma(f)}{f \in \acquires{\sigma}(\ell), f \hb{\sigma} e} \\ \quad \\ \rells{\sigma}_e(\ell) &=& \lambda \ell \cdot \min\setpred{pos_\sigma(f)}{f \in \releases{\sigma}(\ell), e \hb{\sigma} f} \end{array} \end{equation} Our $O(\mathcal{N} \cdot \mathcal{L})$ algorithm now relies on the following observations. First, the $\operatorname{\acr{HB}}$ partial order can be inferred by comparing lockstamps of events (\lemref{hb-isomorphic-lockstamp}). Second, there is an $O(\mathcal{N} \cdot \mathcal{L})$ time algorithm that computes the acquire and release lockstamps for each event in the input trace. Third, the existence of an $\operatorname{\acr{HB}}$ race can be determined by examining only $O(\mathcal{N})$ pairs of conflicting events (using their lockstamps), instead of all possible $O(\mathcal{N}^2)$ pairs (\lemref{num-consecutive}). Finally, we can also examine all the $O(\mathcal{N})$ pairs in time $O(\mathcal{N} \cdot \mathcal{L})$ (using $O(\mathcal{N})$ lockstamp comparisons) and thus determine the existence of an $\operatorname{\acr{HB}}$ race in the same asymptotic running time. Let us first state how we use lockstamps to infer the $\operatorname{\acr{HB}}$ relation. \begin{restatable}{lemma}{hbisomorphiclockstamp}\lemlabel{hb-isomorphic-lockstamp} Let $e_1 \trord{\sigma} e_2$ be events in $\sigma$ such that $\ThreadOf{e_1} \neq \ThreadOf{e_2}$. We have, $e_1 \hb{\sigma} e_2 \iff \neg (\acqls{\sigma}_{e_2} \sqsubseteq \rells{\sigma}_{e_1})$ \end{restatable} \myparagraph{Computing Lockstamps}{ We now illustrate how to compute the acquire lockstamps for all events, by processing the trace $\sigma$ in a forward pass. For each thread $t$ and lock $\ell$, we maintain lockstamp variables $\mathbb{C}_t$ and $\mathbb{L}_\ell$. We also maintain an integer variable $\mathsf{p}_\ell$ for each lock $\ell$ that stores the index of the latest $\opfont{acq}(\ell)$ event in $\sigma$. Initially, we set each $\mathbb{C}_t$ and $\mathbb{L}_m$ to the \emph{bottom} map $\lambda \ell \cdot 0$, and $\mathsf{p}_m$ to $0$, for each thread $t$ and lock $m$. We traverse $\sigma$ left to right, and perform updates to the data structures as described in \algoref{assign-acquire-ls}, by invoking the appropriate \emph{handler} based on the thread and operation of the current event $e = \ev{t, op}$. At the end of each handler, we assign the lockstamp $\acqls{\sigma}_e$ to $e$. The computation of release lockstamps is similar, albeit in a reverse pass, and presented in \appref{proofs_hb_ub}. Observe that each step takes $O(\mathcal{L})$ time giving us a total running time of $O(\mathcal{N} \cdot \mathcal{L})$ to assign lockstamps. } \input{algo-hb-ls} We say that a pair of conflicting access events $(e_1, e_2)$ (with $e_1 \trord{\sigma} e_2$) to a variable $x$ is a \emph{consecutive conflicting pair} if there is no event $f \in \writes{\sigma}(x)$ such that $e_1 \stricttrord{\sigma} f \stricttrord{\sigma} e_2$. We make the following observation. \begin{restatable}{lemma}{numconsecutive}\lemlabel{num-consecutive} A trace $\sigma$ has an $\operatorname{\acr{HB}}$-race iff there is pair of consecutive conflicting events in $\sigma$ that is an $\operatorname{\acr{HB}}$-race. Moreover, $\sigma$ has at most $O(\mathcal{N})$ many consecutive conflicting pairs of events. \end{restatable} \myparagraph{Checking for an $\operatorname{\acr{HB}}$ race}{ We now describe the algorithm for checking for an $\operatorname{\acr{HB}}$ race in $\sigma$. We perform a forward pass on $\sigma$ while storing the release lockstamps of some of the earlier events. When processing an access event $e$, we check if it is in race with an earlier event by comparing the acquire lockstamp of $e$ with a previously stored release lockstamp. More precisely, we maintain a variable $\mathbb{W}_x$ to store the release lockstamp of the last write event on $x$, a variable $t^w_x$ to store the thread that performed this write and set $\mathsf{S}_x$ to store pairs $(t, L)$ of threads and release lockstamps of all the read events performed since the last write on $x$ was observed. Initially, $t^w_x = \texttt{NIL}$, $\mathbb{W}_x=\lambda \ell \cdot \infty$ and $\mathsf{S}_x = \emptyset$. The update performed at each event $e = \ev{t, op}$ are presented in the corresponding handler in \algoref{check-hb-race}. \input{algo-hb-check} } We refer to \appref{proofs_hb_ub} for the correctness, which concludes the proof of \thmref{hb-algo}. \section{Happens-Before Races} \seclabel{hb} In this section we prove the results for detecting $\operatorname{\acr{HB}}$ races, i.e., \thmref{hb-ov-hard}~to \thmref{hb-algo}. \input{hb-upper-bound} \subsection{Hardness Results for $\operatorname{\acr{HB}}$} \seclabel{hb-lower-bound} We now turn our attention to the hardness results for $\operatorname{\acr{HB}}$ race detection. To this end, we prove \thmref{hb-ov-hard}, \thmref{hb-decide-no-seth-better-than-3/2}, and \thmref{hb-decide-mc-hard}. We start with defining the graph $\textsf{G}(\hb{\tr})$, which can be thought of as a form of transitive reduction of the $\operatorname{\acr{HB}}$ relation. \myparagraph{The graph $\textsf{G}(\hb{\tr})$}{ Given a trace $\sigma$, the graph $\textsf{G}(\hb{\tr})$ is a graph with node set $\events{\sigma}$, and we have an edge $(e_1, e_2)$ in $\textsf{G}(\hb{\tr})$ iff \begin{enumerate*}[label=(\roman*)] \item $e_2$ is the immediate successor of $e_1$ wrt the thread order $\tho{\sigma}$, or \item $e_1$ is a $\opfont{rel}(\ell)$ event, $e_2$ is a $\opfont{acq}(\ell)$ event, $e_1\trord{\sigma}e_2$, and there is no intermediate event in $\sigma$ that accesses lock $\ell$. \end{enumerate*} It follows easily that for any two distinct events $e_1, e_2$, we have $e_1\hb{\sigma}e_2$ iff $e_2$ is reachable from $e_1$ in $\textsf{G}(\hb{\tr})$. Moreover, every node has out-degree $\leq 2$ and thus $\textsf{G}(\hb{\tr})$ is sparse, while it can be easily constructed in $O(\mathcal{N})$ time. } \input{figures/hb_ov} \Paragraph{\textsf{OV}{} hardness of write-read $\operatorname{\acr{HB}}$ races.} Given a \textsf{OV}{} instance \orthv(n,d){} on two vector sets $A_1, A_2$, we create a trace $\sigma$ as follows. For the part $A_1$ of \textsf{OV}{}, we introduce $n\cdot (d+1)$ threads denoted by $t(x,i)$, for $x\in[n], i\in \{0\}\cup [d],$ and $d$ locks, each denoted by $l_i$, for $i\in[d]$. For the second part $A_2$ we introduce $n\cdot d$ locks denoted by $l(y,i)$, for $y\in [n], i\in [d],$ and $n$ threads, denoted by $t_y$, for $y\in [n]$. Finally, we have a single variable $z$. We first describe the threads $t(x,i)$. We order the vectors in $A_1$ arbitrarily. For each vector $x$, for each $i\in [d]$ with $x[i]=1$, we introduce a critical section on the lock $l_i$. If $x$ is the last vector of $A_1$ with $x[i]=1,$ we also insert the critical sections $l_{(y,i)}$ for all $y\in [n]$, to $t(x,i)$ after the critical section of $l_x$. Finally, we construct a thread $t_{x,0}$ which starts with a write event $\opfont{w}(z)$, followed by a critical section on lock $l^x$. We also insert a critical section on lock $l^x$ to all threads $t(x,i)$, for $i\in [d]$. Hence the $\opfont{w}(z)$ event is ordered by $\operatorname{\acr{HB}}$ before all other events of $t(x,i)$. See \figref{ov-hb-example} for an illustration. Now we describe the threads $t_y$. For each $i\in [d],$ if $y[i]=1$, we add a critical section of the lock $l(y,i)$ in $t_y$. We end the thread with a read event $\opfont{r}(z)$. Finally, we construct $\sigma$ by first executing each thread $t(x,i)$ in the pre-determined order of $x\in A_1$, followed by executing the traces $t_y$ in any order. See \figref{ov-hb-graph} for an illustration. We refer to \cref{sec:proofs_hb} for the correctness, which concludes the proof of \thmref{hb-ov-hard}. \input{figures/hb_ov_2} We now turn our attention to the problem of detecting a single $\operatorname{\acr{HB}}$ race (i.e., not necessarily involving a read event). We define a useful multi-connectivity problem on graphs. \begin{problem}\problabel{multi-conn} [\textsf{MCONN}{}] Given a directed graph $G$ with $n$ nodes and $m$ edges, and $k$ pairs of nodes $(s_i,t_i),i\in[k],$ decide if there is a path in $G$ from every $s_i$ to the corresponding $t_i.$ \end{problem} Due to \lemref{num-consecutive}, detecting whether there is an $\operatorname{\acr{HB}}$ race in $\sigma$ reduces to testing \textsf{MCONN}{} between all $O(\mathcal{N})$ pairs of consecutive conflicting events in $\sigma$. \Paragraph{Short witnesses for $\operatorname{\acr{HB}}$ races.} We now prove \thmref{hb-decide-no-seth-better-than-3/2}. Following \cite[Corollary~2]{CarmosinoGIMPS2016}, it suffices to show that deciding \textsf{MCONN}{} can be done in $\ntime{\mathcal{N}^{3/2}}\cap \contime{\mathcal{N}^{3/2}}$. At a first glance, the bound $\ntime{\mathcal{N}^{3/2}}$ may seem too optimistic, as there are $\Theta(\mathcal{N})$ paths $P_i\colon s_i\rightsquigarrow t_i$, and each of them can have size $\Theta(\mathcal{N})$. Hence even just guessing these paths appears to take quadratic time. Our proof shows that more succinct witnesses exist. \begin{proof}[Proof of \thmref{hb-decide-no-seth-better-than-3/2}] First consider the simpler case where $\sigma$ has an $\operatorname{\acr{HB}}$-race. Phrased as a \textsf{MCONN}{} problem on $\textsf{G}(\hb{\tr})$, it suffices to show that there is a pair $(s_i,t_i)$ such that $s_i$ does not reach $t_i$. We construct a non-deterministic algorithm for this task that simply guesses the pair $(s_i,t_i)$, and verifies that there is no $s_i\rightsquigarrow t_i$ path. Since $\textsf{G}(\hb{\tr})$ is sparse, this can be easily verified in $O(\mathcal{N})$ time. Now consider the case when there is no $\operatorname{\acr{HB}}$-race. Phrased as a \textsf{MCONN}{} problem on $\textsf{G}(\hb{\tr})$, it suffices to verify that for every pair $(s_i,t_i)$, we have that $s_i$ reaches $t_i$. We construct a non-deterministic algorithm for this task, as follows. The algorithm operates in two phases, using a set $A$, initialized as $A=\{(s_i, t_i)\}_{i\in k}$. \begin{compactenum} \item In the first phase, the algorithm repeatedly guesses a node $u$ that lies on at least $\mathcal{N}^{1/2}$ paths $s_i\rightsquigarrow t_i$, for $(s_i, t_i)\in A$. It verifies this guess via a backward and a forward traversal from $u$. The algorithm then removes all such $(s_i, t_i)$ from $A$, and repeats. \item In the second phase, the algorithm guesses for every remaining $(s_i, t_i)\in A$ a path $P_i\colon s_i\rightsquigarrow t_i$, and verifies that $P_i$ is a valid path. \end{compactenum} Phase 1 can be execute at most $\mathcal{N}^{1/2}$ iterations, while each iteration takes $O(\mathcal{N})$ time since $\textsf{G}(\hb{\tr})$ is sparse. Hence the total time for phase $1$ is $O(\mathcal{N}^{3/2})$. Phase 2 takes $O(\mathcal{N}^{3/2})$ time, as every node of $\textsf{G}(\hb{\tr})$ appears in at most $\mathcal{N}^{1/2}$ paths $P_i$. The desired result follows. \end{proof} \Paragraph{A super-linear lower bound for general $\operatorname{\acr{HB}}$ races.} Finally, we turn our attention to \thmref{hb-decide-mc-hard}. The problem \textsf{FO}($\mathsf{\forall\exists\exists}$){} takes as input a first-order formula $\phi$ with quantifier structure $\forall \exists \exists$ and whose atoms are tuples, and the task is to verify whether $\phi$ has a model on a structure of $n$ elements and $m$ relational tuples. For simplicity, we can think of the structure as a graph $G$ of $n$ nodes and $m$ edges, and $\phi$ a formula that characterizes the presence/absence of edges (e.g., $\phi=\forall x\exists y \exists z~e(x,y) \land \neg e(y,z)$). The crux of the proof of \thmref{hb-decide-mc-hard} is showing the following lemma. \begin{restatable}{lemma}{fomulticonn}\lemlabel{fo-multiconn} \textsf{FO}($\mathsf{\forall\exists\exists}$){} reduces to \textsf{MCONN}{} on a graph $G$ with $O(n)$ nodes in $O(n^2)$ time. \end{restatable} Finally, we arrive at \thmref{hb-decide-mc-hard} by constructing in $O(n^2)$ time a trace $\sigma$ with $\mathcal{N}=\Theta(n^2)$ such that $\textsf{G}(\hb{\tr})$ is similar in structure to the graph $G$ of \lemref{fo-multiconn}. In the end, detecting an $\operatorname{\acr{HB}}$ race in $\sigma$ in $O(\mathcal{N}^{1+\epsilon})$ time yields an algorithm for \textsf{FO}($\mathsf{\forall\exists\exists}$){} in $\Theta(n^{2+\epsilon'})$ time. We refer to \cref{sec:proofs_hb} for the details, which conclude the proof of \thmref{hb-decide-mc-hard}. \section{Introduction} Concurrent programs that communicate over shared memory are prone to \emph{data races}. Two events are \emph{conflicting} if they access the same memory location and one (at least) modifies that location. Data races occur when conflicting access happen concurrently between different threads, and form one of the most common bugs in concurrency. In particular, data races are often symptomatic of bugs in software like data corruption~\cite{boehmbenign2011,racemob2013,Narayanasamy2007}, and they have been deemed \emph{pure evil}~\cite{evil2012} due to the problems they have caused in the past \cite{SoftwareErrors2009}. Moreover, many compiler optimizations are unsound in the presence of data races~\cite{Sevcik2008,Sevcik2011}, while data-race freeness is often a requirement for assigning well-defined semantics to programs~\cite{boehmadvec++2008}. The importance of data races in concurrency has led to a multitude of techniques for detecting them efficiently~\cite{Banerjee06,vonPraun2011}. By far the most standard approach is via \emph{dynamic analyses}. Instead of analyzing the full program, dynamic analyzers try to \emph{predict} the existence of data races by observing and analyzing concurrent executions~\cite{Smaragdakis12,Kini17,Pavlogiannis2020}. As full dynamic data race prediction is $\textsf{NP-hard}$ in general~\cite{Mathur2020b}, researchers have developed several approximate notions of dynamic races, accompanied by efficient techniques for detecting each notion. \SubParagraph{Happens-before races.} The most common technique for detecting data races dynamically is based on Lamport's \emph{happens-before ($\operatorname{\acr{HB}}$)} partial order~\cite{Lamport78}. Two conflicting events form an $\operatorname{\acr{HB}}$ race if they are unordered by $\operatorname{\acr{HB}}$, as the lack of ordering between them indicates the fact that they may execute concurrently, thereby forming a data race. The standard approach to $\operatorname{\acr{HB}}$ race detection is via the use of vector clocks~\cite{djit1999}, and has seen wide success in commercial race detectors~\cite{threadsanitizer}. As vector clock computation is known to require $\Theta(\mathcal{N}\cdot \mathcal{T})$ time on traces of $\mathcal{N}$ events and $\mathcal{T}$ threads~\cite{CharronBost1991}, $\operatorname{\acr{HB}}$ race detection is often assumed to suffer the same bound, and has thus been a subject of further practical optimizations~\cite{Pozniansky03,Flanagan09}. \SubParagraph{Synchronization preserving races.} HB races were recently generalized to sync(hronization)-preserving races~\cite{Mathur21}. Intuitively, two conflicting events are in a sync-preserving race if the observed trace can be soundly reordered to a witness trace in which the two events are concurrent, but without reordering synchronization events (e.g., locking events). Similar to HB races, sync-preserving races can be detected in linear time when the number of threads is constant. However, the dependence on the number of threads is cubic for sync-preserving races, as opposed to the linear dependence for HB races. On the other hand, sync-preserving races are known to offer better precision in program analysis. \SubParagraph{Races based on the locking discipline.} The locking discipline dictates that threads that access a common memory location must do so inside \emph{critical sections}, using a common lock, when performing the access~\cite{vonPraun2011}. Although this discipline is typically not enforced, it is considered good practice, and hence instances that violate this principle are often considered indicators of erroneous behavior. For this reason, there have been two popular notions of data races based on the locking discipline, namely \emph{lock-cover races}~\cite{Dinning91} and \emph{lock-set races}~\cite{Savage97}. Both notions are detectable in linear time when the number of locks is constant, however, lock-set race detection is typically faster in practice, which also comes at the cost of being less precise. Observe that, although techniques for all aforementioned notions of races are generally thought to operate in linear time, they only do so assuming certain parameters, such as the number of threads, are constant. However, as these techniques are deployed in runtime, often with extremely long execution traces, they have to be as efficient as absolutely possible, often in scenarios when these parameters are very large. When a data-race detection technique is too slow for a given application, the developers face a dilemma:~do they look for a faster algorithm, or for a simpler abstraction (i.e., a different notion of dynamic races)? For these reasons, it is important to understand the \emph{fine-grained} complexity of the problem at hand with respect to such parameters. Fine-grained lower bounds can rule out the possibility of faster algorithms, and thus help the developers focus on new abstractions that are more tractable for the given application. Motivated by such questions, in this work we settle the fine-grained complexity of dynamically detecting several popular notions of data races. \input{contributions} \input{related} \section{Violations of the Locking Discipline}\label{sec:locking_discipline} \subsection{Lock-Cover Races} We start with a simple reduction from \textsf{OV}{} to detecting lock-cover races. Given a \textsf{OV}{} instance \orthv(n,d){} on two vector sets $A_1, A_2$, we create a trace $\sigma$ as follows. We have a single variable $x$ and two threads $t_1, t_2$. We associate with each vector of the set $A_i$ a write access event $e = \ev{t_i, \opfont{w}(x)}$. Moreover, each such event holds up to $d$ locks, so that $e$ holds the $k^{th}$ lock iff $k^{th}$ coordinate of the vector corresponding to the event is $1$. The trace $\sigma$ is formed by ordering the sequence of events corresponding to vectors of $A_1$ of \textsf{OV}{} first, in a fixed arbitrary order, followed by the sequence of events corresponding to $A_2$, again in arbitrary order. We refer to \cref{sec:proofs_locking_discipline} for the correctness, which concludes the proof of \thmref{lock-cover-quadratic-lower-bound}. \subsection{Lock-Set Races} We now turn our attention to lock-set races. We first prove \thmref{lock-set-single-variable-linear}, i.e., that determining whether a trace $\sigma$ has a lock-set race on a specific variable $x$ can be performed in linear time. \Paragraph{A linear-time algorithm per variable.} Verifying that there are two conflicting events on $x$ is straightforward by a single pass of $\sigma$. The more involved part is in computing the lock-set of $x$, i.e., the set $\bigcap_{e \in \accesses{\sigma}(x)} \lheld{\sigma}(e)$, in linear time. Indeed, each intersection alone requires $\Theta(\mathcal{L})$ time, resulting to $\Theta(\mathcal{N}\cdot \mathcal{L})$ time overall. Here we show that a somewhat more involved algorithm achieves the task. The algorithm performs a single pass of $\sigma$, while maintaining three simple sets $A$, $B$, and $C$. While processing an event $e$, the sets are updated to maintain the invariant \begin{align}\label{eq:lockset_invariant} A=\lheld{\sigma}(e)\quad\; B=\locks{\sigma}\cap \bigcap_{e' \in \accesses{\sigma}(x), e'\trord{\sigma} e} \lheld{\sigma}(e') \quad\; C=\overline{A}\cap B \end{align} The sets are initialized as $A=\emptyset$, $B=C=\locks{\sigma}$. Then the algorithm performs a pass over $\sigma$ and processes each event $e$ according to the description of \algoref{compute-lockset-variable}. \input{algo-lock-set} The correctness of \algoref{compute-lockset-variable} follows by proving the invariant in \cref{eq:lockset_invariant}. We refer to \cref{sec:proofs_locking_discipline} for the details, which concludes the proof of \thmref{lock-set-single-variable-linear}. \Paragraph{Short witnesses for lock-set races.} Besides the advantage of a faster algorithm, \thmref{lock-set-single-variable-linear} implies that lock-set races have short witnesses that can be verified in linear time. This allows us to prove that detecting a lock-set race is in $\ntime{\mathcal{N}}\cap \contime{\mathcal{N}}$, and we can thus use \cite[Corollary~2]{CarmosinoGIMPS2016} to prove \thmref{lock-set-nseth}. \begin{proof}[Proof of \thmref{lock-set-nseth}] First we argue that the problem is in $\ntime{\mathcal{N}}$. Indeed, the certificate for the existence of a lock-set race is simply the variable $x$ on which there is a lock-set race. By \thmref{lock-set-single-variable-linear}, verifying that we indeed have a lock-set race on $x$ takes $O(\mathcal{N})$ time. Now we argue that the problem is in $\contime{\mathcal{N}}$, by giving a certificate to verify in linear time that $\sigma$ does not have a race of the required form. The certificate has size $O(|\vars{\sigma}|)$, and specifies for every variable, either the lock that is held by all access events of the variable, or a claim that there exist no two conflicting events on that variable. The certificate can be easily verified by one pass over $\sigma$. \end{proof} \Paragraph{Lock-set races are Hitting-Set hard.} Finally we prove \thmref{lock-set-quadratic-lower-bound}, i.e., that determining a single lock-set race is \textsf{HS}{}-hard, and thus also carries a conditional quadratic lower bound. We establish a fine-grained reduction from \textsf{HS}{}. Given a \textsf{HS}{} instance \hsins{} on two vector sets $X, Y$, we create a trace $\sigma$ using $d+1$ threads $\{t_j\}_{j\in \{0\}\cup [d]}$, $n$ locks $\{\ell_i\}_{i\in[n]}$, and $n$ variables $\{z_i\}_{k\in [n]}$. Thread $t_0$ that executes $ \opfont{acq}(\ell_1),\dots, \opfont{acq}(\ell_n), \opfont{w}(z_1),\dots \opfont{w}(z_n), \opfont{rel}(\ell_n), \dots \opfont{rel}(\ell_1) $. Each of the threads $t_j$, for $j\in[d]$, has a single nested critical section consisting of the locks $\ell_i\in [n]$ such that the $i^{th}$ vector of $Y$ has its $j^{th}$ coordinate $0$, i.e, $y_i[j]=0$. The events in the critical section are all write events of all variables $z_k\in [n]$ with $x_k[j]=1$. The trace orders all events of each thread $t_d$ consecutively, and all the events overall in increasing order of $d$. See \cref{fig:hs_to_lock_set} for an illustration. We refer to \cref{sec:proofs_locking_discipline} for the correctness, which concludes the proof of \thmref{lock-set-quadratic-lower-bound}. \input{figures/lockset_hs} \section{Preliminaries} \input{concurrent_setting} \input{race_notions} \section{Proofs of \cref{sec:hb}}\label{sec:proofs_hb} \input{proofs_hb_upper_bound} \subsection{Proofs from \secref{hb-lower-bound}} \applabel{proofs_hb_lb} \hbovhard* \begin{proof} Consider a pair of events $\opfont{w}(z)$ from the $d$ threads $t(x,i),i\in[d],$ and $\opfont{r}(z)\in t_y$ for some $x,i,y$. We have $\opfont{w}(z)\hb{\sigma} \opfont{r}(z)$ iff there is some path from $\opfont{w}(z)$ to $\opfont{r}(z)$ in $\textsf{G}(\hb{\tr})$. As $\opfont{w}(z)$ and $\opfont{r}(z)$ are in different threads, such a path can only be through lock events in a sequence of threads such that the first and last threads are $t(x,i)$ for some $i\in[d]$ and $t_y$, and every consecutive pair of threads in the sequence holds a common lock. Now all the locks in $t_y$ are $l(y,i)$ for all $i$ where $y[i]=1$. Consider the lock corresponding to any $i\in [d]$. The only thread $t(x',i)$ that also holds this lock corresponds to the last $x'$ such that $x'[i]=1$. The only other lock held by $t(x',i)$ is $l_i.$ If $\opfont{w}(z)$ is in $t(x',i),$ we are done. Otherwise the only common lock between these threads $t(x',i)$ and those of $\opfont{w}(z)$ can be one of the $l_i$. The threads of $\opfont{w}(z)$ contain all $l_i$ where $x[i]=1.$ Hence, for there to be a common lock between these threads, there must be at least one $i$ such that $x'[i]=1$ and $x[i]=1$. As this thread also has the lock $l(y,i),$ $y[i]$ is also $1$. Thus, there is a path from $\opfont{w}(z)$ to $\opfont{r}(z)$ if and only if there is at least one $i\in[d]$ such that $x[i]=y[i]=1,$ hence $x$ and $y$ are not orthogonal. A pair of orthogonal vectors of \textsf{OV}{} thus corresponds to a write-read $\operatorname{\acr{HB}}$-race in the reduced trace. Finally we turn our attention to the complexity. In time $O(n\cdot d),$ we have reduced an \textsf{OV}{} instance to determining whether there is a write-read $\operatorname{\acr{HB}}$ race in a trace of $\mathcal{N}=O(nd)$ events. If there was a sub-quadratic i.e. $O((n\cdot d)^{(2-\epsilon)})=n^{(2-\epsilon)}\cdot \operatorname{poly}(d)$ algorithm for detecting a write-read $\operatorname{\acr{HB}}$ race, then this would also solve \textsf{OV}{} in $n^{(2-\epsilon)}\cdot \operatorname{poly}(d)$ time, refuting the \textsf{OV}{} hypothesis. \end{proof} \fomulticonn* \begin{proof} For intuition, assume the first order property is on an undirected graph with $n$ variables and $m$ edges. Let the property be specified in quantified $3$-DNF form with a constant number of predicates, i.e., $\phi=\forall x\exists y\exists z\ (\psi_1\vee \psi_2\vee\dotsc \psi_k),$ where $x,y,z$ represent nodes of the graph, and each $\psi_i$ is a conjunction of $3$ variables representing edges of the graph, for example $e(x,y)\wedge \neg e(y,z) \wedge e(x,z)$. The property is then true if and only if some predicate is satisfied, which is true if all of its variables are satisfied ($e(x,y)$ is satisfied when edge $(x,y)$ is in the graph). Denote the graph on which $\phi$ is defined by $H(I,J),$ where $I$ and $J$ are respectively the sets of nodes and edges of $H.$ The instance of \textsf{MCONN}{} is constructed given $H$ and $\phi$ as follows. Construct a $(2k+2)$-partite graph $G(V,E)$ by first creating $2k+2$ copies of $I.$ Denote these copies by $S,Y_i,Z_i,T,\ i\in[k],$ and the copy of each node $x\in I$ in any part, say $S,$ by $x(S).$ $\psi_i=(e_1\wedge e_2 \wedge e_3)$ is encoded by connecting the sets $(S,Y_i)$ to represent $e_1$, $(Y_i,Z_i)$ for $e_2$ and $(Z_i,T)$ for $e_3$ as follows. If $e_i$ is of the form $e(x,y)$ (and not its negation), then draw a copy of $H$ between its corresponding sets, say $S$ and $Y_i$ without loss of generality. That is, for every $x,y,$ $(x,y)\in J \Leftrightarrow (x(S),y(Y_i))\in E$. If on the other hand $e_i$ is of the form $\neg e(x,y)$ then connect a copy of the complement of $H$, i.e., $(x,y)\notin J\Leftrightarrow (x(S),y(Y_i))\in E.$ Finally define $|I|$ pairs $(x(S),x(T))$ as the $(s,t)$ pairs for \textsf{MCONN}{}. We now prove this reduction is correct. First, assume $\phi$ is true. Then for every node $x,$ there exist nodes $y,z$ such that some predicate is true. If $\psi_i$ is the predicate that is satisfied for some node $u,$ then there is a path between $u(S)$ and $u(T)$ through the parts $S,Y_i,Z_i$ and $T$ as follows. As the first variable is satisfied, then if it is $e(x,y),$ then $(x,y)\in J,$ and $x(S)$ is connected to $y(Y_i),$ and if it is $\neg e(x,y),$ then $(x,y)\notin J$ and again $x(S)$ is connected to $y(Y_i).$ Similarly, $y(Y_i)$ is connected to $z(Z_i),$ and $z(Z_i)$ to $x(T).$ These edges form a $3$ length path between $x(S)$ and $x(T)$. Now consider the reverse case, and assume the \textsf{MCONN}{} problem is true, that is , there is a path between every $(x(S),x(T))$ pair. Note that the construction of edges in $G$ is such that any path from $x(S)$ to $x(T)$ has to be a $3$ length path, connecting the copy of $x$ in $S$ to its copy in some $Y_i,$ from this $Y_i$ to its corresponding $Z_i,$ and from $Z_i$ to $T.$ Also, this path exists only if all variables of the corresponding $\psi_i$ are true. Hence, as there is a path between every pair $(x(S),x(T)),$ and one pair is defined for every variable $x,$ some predicate is satisfied for every $x.$ Thus $\phi$ is also true. Finally, the time of the reduction is equal to the size of $G.$ This is $2k+2=O(1)$ graphs, each of which is either $H$ or its complement. Hence $|G|=O(m+n +(n^2-m)+n)=O(n^2).$ \end{proof} \hbdecidemchard* \begin{proof} We first reduce the instance of \textsf{FO}($\mathsf{\forall\exists\exists}$){} to \textsf{MCONN}{} as in the proof of \lemref{fo-multiconn}. Let $G(V,E)$ be the multi-partite graph for \textsf{MCONN}{} and $S,T$ the first and last parts of nodes of $G$. We add a sufficient number of nodes, referred as dummy nodes, to make G sparse. Let every node $x$ of $V\backslash T$ correspond to a distinct thread $t_x$ and form one write access event to a distinct variable $v_x$ in the thread. Let each node $t$ in $T$ also correspond to a write access event of the variable corresponding to the copy of $t$ in $S,$ and be in a new thread. Define $|E|$ locks, and for every edge $(a,b)\in E,$ let the events corresponding to $v_a$ and $v_b$ hold the lock $l_{(a,b)}$ corresponding to $(a,b).$ The trace $\sigma$ for first lists all threads corresponding to the dummy nodes in some fixed arbitrary order, then the threads corresponding to nodes in $S,$ followed by those in each $Y_i,$ followed by those in each $Z_i,$ in a fixed arbitrary order, and finally those in $T$. This reduction is seen to be correct by observing that $G$ was modified to be the transitive reduction graph of $\sigma,$ and the only $\operatorname{\acr{HB}}$-race events can be the pairs of write events corresponding to the pairs of nodes given as input to \textsf{MCONN}{}. Thus, each pair of events does not form an $\operatorname{\acr{HB}}$-race if and only if $G$ has a path between its corresponding pair of nodes. To analyze the time of the reduction, first we see that the size of $\sigma$ is the size of $G,$ with dummy nodes added to have $n=O(n^2),$ and hence $O(n^2).$ There are $O(n^2)$ variables, locks and threads in $\sigma.$ If deciding if the given trace has an $\operatorname{\acr{HB}}$-race has an $O((n^2)^{1+\epsilon})$ time algorithm, then \textsf{FO}($\mathsf{\forall\exists\exists}$){} can be solved in $O(n^{2+\epsilon'})$ time, which is $O(m^{1+\epsilon'})$ time for properties on dense structures. \end{proof} \subsection{Proofs from \secref{hb-upper-bound}} \applabel{proofs_hb_ub} \hbisomorphiclockstamp* \begin{proof} ($\Rightarrow$) Let $e_1 \hb{\sigma} e_2$. Using the definition of $\hb{\sigma}$, there must be a sequence of events $f_1,f_2 \ldots f_k$ with $k > 1$, $f_1 = e_1$, $f_k = e_2$, and for every $1 \leq i < k$, $f_i \trord{\sigma} f_{i+1}$ and either $f_i \tho{\sigma} f_{i+1}$ or there is a lock $\ell$, such that $f_i \in \releases{\sigma}(\ell)$ and $f_{i+1} \in \acquires{\sigma}(\ell)$. Let $j$ be the smallest index $i$ such that $\ThreadOf{f_i} \neq \ThreadOf{f_{i+1}}$; such an index exists as $\ThreadOf{e_1} \neq \ThreadOf{e_2}$. Observe that there must be a lock $\ell$ for which $\OpOf{f_j} = \opfont{rel}(\ell)$ and $\OpOf{f_{j+1}} = \opfont{acq}(\ell)$. Observe that $pos_\sigma(f_j) < pos_\sigma(f_{j+1})$, $\rells{\sigma}_{e_1}(\ell) \leq pos_\sigma(f_j)$ and $pos_\sigma(f_{j+1}) \leq \acqls{\sigma}_{e_2}$, giving us $\rells{\sigma}_{e_1}(\ell) < \acqls{\sigma}_{e_2}(\ell)$. ($\Leftarrow$) Let $\ell$ be a lock such that $\rells{\sigma}_{e_1}(\ell) < \acqls{\sigma}_{e_2}(\ell)$. Then, there is a release event $f$ and an acquire event $g$ on lock $\ell$ such that $pos_\sigma(f) < pos_\sigma(g)$,$e_1 \hb{\sigma} f$ and $g \hb{\sigma} e_2$. This means $f \hb{\sigma} g$ and thus $e_1 \hb{\sigma} e_2$. \end{proof} For the sake of completeness, we present the computation of release lockstamps. As with \algoref{assign-acquire-ls}, we maintain the following variables. For each thread $t$ and lock $\ell$, we will maintain variables $\mathbb{C}_t$ and $\mathbb{L}_\ell$ that take values from the space of all lockstamps. We also additionally maintain an integer variable $\mathsf{p}_\ell$ for each lock $\ell$ that stores the index (or relative position) of the earliest (according to the trace order $\trord{\sigma}$) release event of lock $\ell$ in the trace. Initially, we set each $\mathbb{C}_t$ and $\mathbb{L}_m$ to $\lambda \ell \cdot \infty$, for each thread $t$ and lock $m$. Further, for each lock $m$, we set $\mathsf{p}_m$ to $n_m+1$, where $n_m$ is the number of release events of $m$ in the trace; this can be obtained in a linear scan (or by reading the value of $\mathsf{p}_m$ at the end of a run of \algoref{assign-acquire-ls}). We traverse the events according to the total trace order and perform updates to the data structures as described in \algoref{assign-release-ls}, by invoking the appropriate \emph{handler} based on the thread and operation of the event $e = \ev{t, op}$ being visited. At the end of each handler, we assign the lockstamp $\rells{\sigma}_e$ to the event $e$. { \footnotesize \begin{algorithm*}[h] \begin{multicols}{3} \myhandler{\acqhandler{$t$, $\ell$}}{ $\mathbb{L}_\ell\gets \mathbb{C}_t$ \; $\rells{\sigma}_e \gets \mathbb{C}_t$ } \myhandler{\relhandler{$t$, $\ell$}}{ $\mathsf{p}_\ell\gets \mathsf{p}_\ell - 1$ \; $\mathbb{C}_t\gets \mathbb{C}_t[\ell \mapsto \mathsf{p}_\ell] \sqcap\mathbb{L}_\ell$ \; $\rells{\sigma}_e \gets \mathbb{C}_t$ } \myhandler{\rdhandler{$t$, $x$}}{ $\rells{\sigma}_e \gets \mathbb{C}_t$ } \BlankLine \myhandler{\wthandler{$t$, $x$}}{ $\rells{\sigma}_e \gets \mathbb{C}_t$ } \end{multicols} \normalsize \caption{\textit{Assigning release lockstamps to events in the trace}} \algolabel{assign-release-ls} \SetAlgoInsideSkip{medskip} \end{algorithm*} \normalsize } Let us now state the correctness of \algoref{assign-acquire-ls} and \algoref{assign-release-ls}. \begin{lemma} \lemlabel{lockstamp-assigment-correct} On input trace $\sigma$, \algoref{assign-acquire-ls} and \algoref{assign-release-ls} correctly compute the lockstamps $\acqls{\sigma}_e$ and $\rells{\sigma}_e$ respectively for each event $e \in \events{\sigma}$. \end{lemma} \begin{proof}[Proof Sketch] We focus on the correctness proof of \algoref{assign-acquire-ls}; the proof for \algoref{assign-release-ls} is similar. The proof relies on the invariant maintained by \algoref{assign-acquire-ls} the variables $\mathbb{C}_t$, $\mathbb{L}_\ell$ and $\mathsf{p}_\ell$ for each thread $t$ and lock $\ell$, which we state next. Let $\pi$ be the prefix of the trace processed at any point in the algorithm. Let $C^\pi_t$, $L^\pi_\ell$ and $p^\pi_\ell$ be the values of the variables $\mathbb{C}_t$, $\mathbb{L}_\ell$ and $\mathsf{p}_\ell$ after processing the prefix $\pi$. Then, the following invariants are true: \begin{itemize} \item $C^\pi_t = \acqls{\pi}_{e^\pi_t} = \acqls{\sigma}_{e^\pi_t}$, where $e^\pi_t$ is the last event in $\pi$ performed by thread $t$ \item $L^\pi_\ell = \acqls{\pi}_{e^\pi_\ell} = \acqls{\sigma}_{e^\pi_\ell}$, where $e^\pi_\ell$ is the last acquire event on lock $\ell$ in $\pi$. \item $p^\pi_\ell = pos^\pi_\ell(e^\pi_\ell)$, where $e^\pi_\ell$ is the last acquire event on lock $\ell$ in $\pi$. \end{itemize} These invariants can be proved using a straightforward induction, each time noting the definition of $\hb{\sigma}$. \end{proof} \begin{lemma} \lemlabel{time-assign-lockstamps} For a trace with $\mathcal{N}$ events and $\mathcal{L}$ locks, \algoref{assign-acquire-ls} and \algoref{assign-release-ls} both take $O(\mathcal{T} \cdot \mathcal{L})$ time. \end{lemma} \begin{proof} We focus on \algoref{assign-acquire-ls}; the analysis for \algoref{assign-release-ls} is similar. At each acquire event, the algorithm spends $O(1)$ time for updating $\mathsf{p}_\ell$, $O(\mathcal{L})$ time for doing the $\sqcup$ operation, and $O(\mathcal{L})$ time for the copy operation (`$\acqls{\sigma}_e \gets \mathbb{C}_t$'). For a release event, we spend $O(\mathcal{L})$ for the two copy operations. At read and write events, we spend $O(\mathcal{L})$ for copy operations. This gives a total time of $O(\mathcal{N} \cdot \mathcal{L})$. \end{proof} \numconsecutive* \begin{proof} We first prove that if there is a an $\operatorname{\acr{HB}}$-race in $\sigma$, then there is a pair of consecutive conflicting events that is in $\operatorname{\acr{HB}}$-race. Consider the first $\operatorname{\acr{HB}}$-race, i.e., an $\operatorname{\acr{HB}}$-race $(e_1,e_2)$ such that for every other $\operatorname{\acr{HB}}$-race $(e'_1, e'_2)$, either $e_2 \trord{\sigma} e'_2$ or $e_2 = e'_2$ and $e'_1 \trord{\sigma} e_1$. We remark that such a race $(e_1, e_2)$ exists if $\sigma$ has any $\operatorname{\acr{HB}}$-race. We now show that $(e_1, e_2)$ are a consecutive conflicting pair (on variable $x$). Assume on the contrary that there is an event $f \in \writes{\sigma}(x)$ such that $e_1 \stricttrord{\sigma} f \stricttrord{\sigma} e_2$. If either $(e_1, f)$ or $(f, e_2)$ is an $\operatorname{\acr{HB}}$-race, then this contradicts our assumption that $(e_1, e_2)$ is the first $\operatorname{\acr{HB}}$-race in $\sigma$. Thus, $e_1 \hb{\sigma} f$ and $f \hb{\sigma} e_2$, which gives $e_1 \hb{\sigma} e_2$, another contradiction. We now turn our attention to the number of consecutive conflicting events in $\sigma$. For every read or write event $e_2$, there is at most one write event $e_1$ such that $(e_1, e_2)$ is a consecutive conflicting pair (namely the latest conflicting write event before $e_2$) Further, for every read event $e_1$, there is at most one write event $e_2$ such that $(e_1, e_2)$ is a consecutive conflicting pair (namely the earliest conflicting write event after $e_1$). This gives at most $2\mathcal{N}$ consecutive conflicting pairs of events. \end{proof} Let us now state the correctness of \algoref{check-hb-race}. \begin{lemma} \lemlabel{lockstamp-checking-correct} For a trace $\sigma$, \algoref{check-hb-race} reports a race iff $\sigma$ has an $\operatorname{\acr{HB}}$-race. \end{lemma} \begin{proof}[Proof Sketch.] The proof relies on the following straightforward invariants; we skip their proofs as they are straightforward. In the following, $e^\pi_x$ is the last event with $\OpOf{e^\pi_x} = \opfont{w}(x)$ in a trace $\pi$. \begin{itemize} \item After processing the prefix $\pi$ of $\sigma$, $t^w_x = \ThreadOf{e^\pi_x}$ and $\mathbb{W}_x = e^\pi_x$. \item After processing the prefix $\pi$ of $\sigma$, the set $\mathsf{S}_x$ is $\setpred{(t, L)}{\exists e \in \reads{\pi}(x), e^\pi_x \trord{\pi} e, \ThreadOf{e} = t, \rells{\sigma}_e = L}$. \end{itemize} The rest of the proof follows from \lemref{time-assign-lockstamps} and \lemref{lockstamp-assigment-correct}. \end{proof} Let us now characterize the time complexity of \algoref{check-hb-race}. \begin{lemma} \lemlabel{lockstamp-checking-complexity} On an input trace with $\mathcal{N}$ events and $\mathcal{L}$ locks, \algoref{check-hb-race} runs in time $O(\mathcal{N} \cdot \mathcal{L})$. \end{lemma} \begin{proof}[Proof Sketch] Each pair $(t, L)$ of thread identifier and lockstamp is added atmost once in some set $\mathsf{S}_x$ (for some $x$). Also, each such pair is also compared against another timestamp atmost once. Each comparison of timestamps take $O(\mathcal{L})$ time. This gives a total time of $O(\mathcal{N} \cdot \mathcal{L})$. \end{proof} \hbalgo* \begin{proof} We focus on proving that there is an $O(\mathcal{N} \cdot \mathcal{L})$ time algorithm, as the standard vector-clock algorithm~\cite{djit1999} for checking for an $\operatorname{\acr{HB}}$-race runs in $O(\mathcal{N} \cdot\mathcal{T})$ time. Our algorithm's correctness is stated in \lemref{lockstamp-checking-correct} and its total running time is $O(\mathcal{N} \cdot \mathcal{L})$ (\lemref{lockstamp-checking-complexity} and \lemref{time-assign-lockstamps}). \end{proof} \section{Proofs of \cref{sec:locking_discipline}}\label{sec:proofs_locking_discipline} \lockcoverquadraticlowerbound* \begin{proof}[Proof of \thmref{lock-cover-quadratic-lower-bound}] To see why the reduction is correct, observe that if there a solution to \textsf{OV}{}, that is, a pair of vectors $x,y$ such that for all $k\in [d],$ $x[k]=0$ or $y[k]=0,$ implies that the corresponding events in $\sigma,$ say $e_x$ and $e_y,$ have for each lock $k\in [d]$ either $e_x$ does not hold the lock or $e_y$ does not. As they have distinct thread ids too, $e_x$ and $e_y$ form two conflicting events with $\lheld{\sigma}(e_1)\cap \lheld{\sigma}(e_2)=\emptyset.$ Similarly, a lock-cover race implies that for every lock, one of the events in race do not hold the lock, hence have their corresponding coordinate in \textsf{OV}{} $0.$ The events are thus orthogonal to each other. Regarding the complexity, we have used $O(n\cdot d)$ time to construct a trace $\sigma$ with $\mathcal{N}=O(n\cdot d)$ events. If we can detect a lock-cover race in $\sigma$ in $O(\mathcal{N}^{(2-\epsilon)})$ time, then \textsf{OV}{} can be solved in $O(n^{(2-\epsilon)}\cdot \operatorname{poly}(d))$ time, contradicting the \textsf{OV}{} hypothesis. \end{proof} \locksetsinglevariablelinear* \begin{proof} We first argue that the algorithm maintains the invariant stated in \cref{eq:lockset_invariant}. The invariant for $A$ is trivial to verify. Moreover, it is easy to see that, assuming that the invariant holds before processing an $\opfont{acq}(\ell)$ or $\opfont{rel}(\ell)$ event, it also holds after processing that event. Indeed, for an event $\opfont{acq}(\ell)$, we have $\ell\in A$, and to maintain $C=\overline{A}\cap B$, we remove $\ell$ from $C$ if $\ell\in B$. Similarly for an event $\opfont{rel}(\ell)$. To see that the invariant is maintained after processing an access event $\opfont{w}(x)/\opfont{r}(x)$, note that we have \[ B\setminus C = B\cap \overline{C} = B\cap \left(\overline{B\cap \overline{A}}\right) = B\cap \left(\overline{B}\cup A\right) = B\cap A \] and thus updating $B\gets B\setminus C$ yields \[ \locks{\sigma}\cap \bigcap_{\substack{e' \in \accesses{\sigma}(x) \\ e'\stricttrord{\sigma} e}} \lheld{\sigma}(e') \cap \lheld{tr}(e) = \locks{\sigma}\cap \bigcap_{\substack{e' \in \accesses{\sigma}(x) \\ e'\trord{\sigma} e}} \lheld{\sigma}(e') \] Finally, at this point we have $\overline{A}\cap B = \overline{A} \cap B\cap A=\emptyset$, thus the invariant also holds for $C$. We now turn our attention to complexity. Using a bit-set representation of the sets $A$, $B$ and $C$, it is clear that each of the operations except $\opfont{w}(x)/\opfont{r}(x)$ take constant time per event. Each $\opfont{w}(x)/\opfont{r}(x)$ operation takes $O(|C|)$ time. Note, however, that because of the previous invariant, every lock is removed from $B$ at most once, hence the total time for performing all set differences $B\gets B\setminus C$ is $O(\mathcal{N} + \mathcal{L}) = O(\mathcal{N})$. Thus the total time is $O(\mathcal{N})$. The desired result follows. \end{proof} \locksetquadraticlowerbound* \begin{proof} First, assume there is a solution to \textsf{HS}{}, i.e., $\exists x_k\in X\ \forall y_i\in Y\ \exists j\in [d]\ x_k[j]=y_i[j]=1$. Then for the variable $z_k$, for every lock $\ell_i$, there is a thread $t_j$ that contains $\opfont{w}(z_k)$ (as $x_k[j]=1$) but does not contain lock $\ell_i$ (as $y_i[j]=1$). Thus $\bigcap_{e \in \accesses{\sigma}(z_k)} \lheld{\sigma}(e) = \emptyset$, and we have a lock-set race on variable $z_k$ as there are at least two $\opfont{w}(z_k)$ conflicting events, one in the thread $t_j$ and the other in thread $t_0$. For the opposite direction, assume that \textsf{HS}{} does not have a solution, i.e., $\forall x_k\in X\ \exists y_i\in Y\ \forall j\in [d]\ (x_k[j]=0 \text{ or }y_i[j]=0)$. Then for each variable $z_k$, there is some lock $\ell_i$ such that every thread that contains a write event $\opfont{w}(z_k)$ (thus $x_k[j]=1$) also contains the lock $\ell_i$ (as necessarily $y_i[j]=0$). Hence, for every variable $z_k,$ some lock $\ell_i$ is held by all its access events. Thus $\sigma$ does not have a lock-set race. Regarding the complexity, we have created a trace $\sigma$ with $\mathcal{N} = O(n\cdot d)$ events in $O(n\cdot d)$ time. Thus, any $O(\mathcal{N}^{(2-\epsilon)})$ time algorithm for \textsf{HS}{} implies an $O(n^{(2-\epsilon)}\cdot \operatorname{poly}(d))$ time algorithm for \textsf{HS}{}, contradicting the \textsf{HS}{} hypothesis. \end{proof} \section{Proofs of \cref{sec:syncp}}\label{sec:proofs_syncp} \input{figures/syncp_ov3_intuition} \syncpovthreehard* \begin{proof} Consider any sync-preserving correct reordering $\rho$ of $\sigma$ that exposes a data race $(\opfont{w}(z), \opfont{r}(z))$ on the local traces $t_x$ and $t_y$. The following statements are straightforward to verify based on the definition of sync-preserving correct reorderings. \begin{compactenum} \item\label{item:obs1} For every $k\in[d]$, the first $\opfont{sync}(\ell_k)$ event the trace $t_k$ is also in $\rho$. \item\label{item:obs2} The auxiliary trace $t$ cannot have an open critical section in $\rho$. This implies that for every trace $t_k$ with $k\in[d]$, the last event of $t_k$ in $\rho$ cannot be its $i^{th}$ $\opfont{sync}(\ell_k)$ event, where $i$ is even. Moreover, the number of $\opfont{sync}(\ell_k)$ events in $\rho$ is the same for every trace $t_k$ with $k\in[d]$. \end{compactenum} First, consider that the \orthvk{3} instance has a solution, i.e., there exist $x\in A_1$, $y\in A_2$ and $z\in A_3$ such that $x,y,z$ are orthogonal, and we argue that $\sigma$ has a data race that is also sync-preserving. We construct a sync-preserving correct reordering $\rho$ of $\sigma$ that exposes the data race. We only specify the local traces that exist in $\rho$, as their interleaving that constructs $\rho$ will be identical to the one in $\sigma$ (in other words, we only specify the prefix up to which every local trace of $\sigma$ is executed in $\rho$). We execute the traces $t_x$ and $t_y$ all the way before the corresponding $\opfont{w}(z)$ and $\opfont{r}(z)$ events (hence we are exposing a race between these two events). For every $k\in [d]$ if $z[k]=0$ or $x[k]=0$, we execute $t_k$ up to the $(2\cdot i)^{th}$ $\opfont{sync}(\ell_k)$ event, where $i$ is such that $z$ is the $i^{th}$ vector of $A_3$. On the other hand, if $y[k]=0$, we execute $t_k$ up to the first $\opfont{rel}(\ell_k)$ event that appears after the $(2\cdot i)^{th}$ $\opfont{sync}(\ell_k)$ event in $t^k$. Finally, we execute $t^k$ until its $(i-1)^{th}$ $\opfont{rel}(X)$ event. It is easy to verify that $\rho$ is a valid correct reordering. Indeed, we have two open critical sections in the threads $t_x$ and $t_y$, on the locks $X$ and $Y$ respectively. Moreover, for every $k\in[d]$, we have the following. \begin{compactenum} \item If $z[k]=0$, there are no other open critical sections. \item If $z[k]=1$ and $x[k]=0$, there is one open critical section in the thread $z[k]$ on lock $l_k$. \item If $z[k]=x[k]=1$ and $y[k]=0$, there is one open critical section in the thread $z[k]$ on lock $l'_k$. \end{compactenum} We now consider the opposite direction, i.e., assume that there is a sync-preserving race in $\sigma$, and we argue that there exist $x\in A_1$, $y\in A_2$ and $z\in A_3$ such that $x,y,z$ are orthogonal. Consider any sync-preserving correct reordering $\rho$ that exposes a race on the access events of two local traces $t_x$ and $t_y$. Because of \cref{item:obs1} above, every trace $t_k$ is at least partially present in $\rho$. Because of \cref{item:obs1} above, every such trace executes the same number of $\opfont{sync}(\ell_k)$ events in $\rho$, and this number is odd. We argue that the triplet $x,y,z$ is orthogonal, where $z$ is the $i^{th}$ vector of $A_3$ such that each $t_k$ executes $2\cdot (i-1)+1$ $\opfont{sync}(\ell_k)$ events in $\rho$. Indeed, consider any $k\in[d]$ and assume that $x[k]=y[k]=1$. If $z[k]=1$, then we have a $\opfont{acq}(\ell)$ event in $t_k$ that immediately precedes its last $\opfont{sync}(\ell_k)$ event. Since $x[k]=1$, the trace $t_x$ also has an $\opfont{acq}(l_k)$ event. Since the $\opfont{acq}(l_k)$ event of $t_x$ is after the $\opfont{acq}(l_k)$ event of $t_k$ in $\sigma$, the matching $\opfont{rel}(l_k)$ of $t_k$ must also be in $\rho$. This implies that the $\opfont{acq}(l'_k)$ event of $t_k$ that immediately succeeds its last $\opfont{rel}(l_k)$ event is also in $\rho$. Since $y[k]=1$, the trace $t_y$ also has an $\opfont{acq}(l'_k)$ event. Since the $\opfont{acq}(l'_k)$ event of $t_y$ is after the $\opfont{acq}(l'_k)$ event of $t_k$ in $\sigma$, the matching $\opfont{rel}(l'_k)$ of $t_k$ must also be in $\rho$. However, we now have another $\opfont{sync}(\ell_k)$ event of $t_k$ in $\rho$, in particular, the $\opfont{sync}(\ell_k)$ event that immediately precedes its last $\opfont{rel}(l'_k)$ event. But this results in an even number of $\opfont{sync}(\ell_k)$ events of $t_x$ being present in $\rho$, which contradicts our observation in \cref{item:obs2}. Thus, if $x[k]=y[k]=1$, we necessarily have that $z[k]=0$, and the triplet $x,y,z$ is orthogonal. The desired result follows. \end{proof} \subsection{Notions of Dynamic Data Races} As the problem of determining whether a concurrent program has an execution with a data race is undecidable, dynamic techniques observe program traces and report whether certain events indicate the presence of a race. Depending on the technique, such reports can be sound (i.e., they guarantee the presence of a race in the program), Here we describe in detail some popular approaches to dynamic race detection that are the subject of this work. \Paragraph{Happens-Before Races.} Given a trace $\sigma$, the \emph{happens before} order $\hb{\sigma}$ is the smallest partial order on $\events{\sigma}$ such that \begin{enumerate*}[(a)] \item $\tho{\sigma} \subseteq \hb{\sigma}$, and \item for any lock $\ell \in \locks{\sigma}$ and for events $e \in \acquires{\sigma}(\ell)$ and $f \in \releases{\sigma}(\ell)$, if $e \trord{\sigma} f$ then $e \hb{\sigma} f$. \end{enumerate*} A pair of conflicting events $(e_1, e_2)$ is an $\operatorname{\acr{HB}}$-race in $\sigma$ if they are unordered by $\operatorname{\acr{HB}}$, i.e., $e_1 \not\hb{\sigma} e_2$ and $e_2 \not\hb{\sigma} e_1$. The associated decision question is, \emph{given a trace $\sigma$, determine whether $\sigma$ has an $\operatorname{\acr{HB}}$ race}. Typically $\operatorname{\acr{HB}}$ race detectors are tasked to report all events that form $\operatorname{\acr{HB}}$ race with an earlier event in the trace~\cite{threadsanitizer,intel-inspector,helgrind}). That is, they solve the following function problem:\emph{given a trace $\sigma$, determine all events $e_2\in \events{\sigma}$ for which there exists an event $e_1\in \events{\sigma}$ such that $e_1 \trord{\sigma} e_2$, and $(e_1, e_2)$ is an $\operatorname{\acr{HB}}$ race of $\sigma$}. The standard algorithm for solving both versions of the problem is a vector-clock algorithm that runs in $O(\mathcal{N}\cdot \mathcal{T})$ time~\cite{djit1999}. \Paragraph{Synchronization Preserving Races.} Next, we present the notion of \emph{sync(hronization)-preserving races}~\cite{Mathur2020b}. For a trace $\sigma$ and a read event $e$, we use $\lw{\sigma}(e)$ to denote the write event observed by $e$. That is, $e' = \lw{\sigma}(e)$ is the last (according to the trace order $\trord{\sigma}$) write event $e'$ of $\sigma$ such that $e$ and $e'$ access the same variable and $e' \trord{\sigma} e$; if no such $e'$ exists, then we write $\lw{\sigma}(e) = \bot$. A trace $\rho$ is said to be a correct reordering of trace $\sigma$, if \begin{enumerate*}[label=(\alph*)] \item $\events{\rho} \subseteq \events{\sigma}$ \item $\events{\rho}$ is downward closed with respect to $\tho{\sigma}$, and further $\tho{\rho} \subseteq \tho{\sigma}$, and \item for every read event $e \in \events{\rho}$, $\lw{\rho}(e) = \lw{\sigma}(e)$. \end{enumerate*} We say that $\rho$ is \emph{sync-preserving} with respect to $\sigma$ if for every lock $\ell$ and for any two acquire events $e_1, e_2 \in \acquires{\rho}(\ell)$, we have $e_1 \trord{\rho} e_2$ iff $e_1 \trord{\sigma} e_2$. That is, the order of two critical sections on the same lock is the same in $\sigma$ and $\rho$. A pair of conflicting events $(e_1, e_2)$ is a \emph{sync-preserving race} in $\sigma$ if $\sigma$ has a sync-preserving correct reordering $\rho$ such that $(e_1, e_2)$ is a data race of $\rho$. The associated decision question is, \emph{given a trace $\sigma$, determine whether $\sigma$ has a sync-preserving race}. As with $\operatorname{\acr{HB}}$ races, we are typically interested in reporting all events $e_2\in \events{\sigma}$ for which there exists an event $e_1\in \events{\sigma}$ such that $e_1 \trord{\sigma} e_2$, and $(e_1, e_2)$ is an $\operatorname{\acr{HB}}$ race of $\sigma$. It is known one can report all such events $e_2$ in time $O(\mathcal{N}\cdot \mathcal{V} \cdot \mathcal{T}^3)$. \Paragraph{Lock-Cover and Lock-Set Races.} Lock-cover and lock-set races indicate violations of the \emph{locking discipline}. For an event $e$ in a trace $\sigma$, let $\lheld{\sigma}(e) = \setpred{\ell}{ \exists f \in \acquires{\sigma}(\ell), \text{ such that } e \in \crit{\sigma}(f)}$, i.e., $\lheld{\sigma}(e)$ is the set of locks held by thread $\ThreadOf{e}$ when $e$ is executed. A pair of conflicting events might indicate a data race if $\lheld{\sigma}(e_1)\cap \lheld{\sigma}(e_2)=\emptyset$. Although this condition does not guarantee the presence of a race, it constitutes a violation of the locking discipline and can be further investigated. A pair of conflicting events $(e_1, e_2)$ is a \emph{lock-cover race} if $\lheld{\sigma}(e_1)\cap \lheld{\sigma}(e_2)=\emptyset$. The decision question is, \emph{given a trace $\sigma$, determine if $\sigma$ has a lock-cover race}. The problem is solvable in $O(\mathcal{N}^2\cdot \mathcal{L})$ time, by checking the above condition over all conflicting event pairs. As the algorithm for lock-cover races takes quadratic time, developers often look for less expensive indications of violations of locking discipline, called lock-set races (as proposed by \textsc{Eraser}\xspace race detector~\cite{Savage97}). A trace $\sigma$ has a \emph{lock-set race} on variable $x\in \vars{\sigma}$ if \begin{compactenum}[(a)] \item there exists a pair of conflicting events $(e_1, e_2)\in \writes{\sigma}(x)\times \accesses{\sigma}(x)$, and \item $\bigcap_{e \in \accesses{\sigma}(x)} \lheld{\sigma}(e) = \emptyset$. \end{compactenum} The associated decision question is, \emph{given a trace $\sigma$, determine if $\sigma$ has a lock-set race}. Note that a lock-cover race implies a lock-set race, but not the other way around. On the other hand, determining whether $\sigma$ has a lock-set race is easily performed in $O(\mathcal{N}\cdot \mathcal{L})$ time. \input{examples-races} \Paragraph{Example.} We illustrate the different notions of races in \figref{ex-races}. We use $e_i$ to denote the $i^\text{th}$ event of the trace in consideration. First consider the trace $\sigma_a$ in \figref{ex-hb}. The events $e_2$ and $e_4$ are conflicting and unordered by $\hb{\sigma_a}$, thus $(e_2, e_4)$ is an $\operatorname{\acr{HB}}$-race. Second, in trace $\sigma_b$ of \figref{ex-syncp}, the pair $(e_1, e_6)$ is not an $\operatorname{\acr{HB}}$-race as $e_1 \hb{\sigma_b} e_6$. But this is a sync-preserving race witnessed by the correct reordering $e_4,e_5$, as both $e_1$ and $e_6$ are enabled. Third, in trace $\sigma_c$ of \figref{ex-lock-cover}, the pair $(e_2, e_7)$ is neither a sync-preserving race nor an $\operatorname{\acr{HB}}$ race, but is a lock-cover race as $\lheld{\sigma_c}(e_2) \cap \lheld{\sigma_c}(e_7) = \emptyset$. Finally, the trace $\sigma_d$ in \figref{ex-lockset} has no $\operatorname{\acr{HB}}$, sync-preserving or lock-cover race, as all $\opfont{w}(x)$ are protected by a common lock. But there is a lock-set race on $x$ as there is no single lock that protects all $\opfont{w}(x)$. \subsection{Related Work}\label{subsec:related} \Paragraph{Dynamic data-race detection.} There exists a rich literature in dynamic techniques for data race detection. Methods based on vector clocks (\textsc{Djit}\xspace algorithm~\cite{djit1999}) using Lamport's Happens Before ($\operatorname{\acr{HB}}$)~\cite{Lamport78} and the lock-set principle in Eraser~\cite{Savage97} were the first ones to popularize dynamic analysis for detecting data races. Later work attempted to increase the performance of these notions using optimizations as in~\cite{Pozniansky03} and \textsc{FastTrack}\xspace~\cite{Flanagan09}, altogether different algorithms (e.g., the \textsf{GoldiLocks}\xspace algorithm~\cite{Elmas07}), and hybrid techniques~\cite{OCallahan03}. $\operatorname{\acr{HB}}$ and lock-set based race detection are respectively sound (but incomplete) and complete (but unsound) variants of the more general problem of data-race \emph{prediction}~\cite{Koushik05}. While earlier work on data race prediction focused on explicit~\cite{Koushik05} or symbolic~\cite{rvpredict,Said11} enumeration, recent efforts have focused on scalability~\cite{Smaragdakis12,Mathur18,Kini17,Pavlogiannis2020,Roemer18,Sulzmann2020}. The more recent notion~\cite{Mathur21} of sync-preserving races generalizes the notion of $\operatorname{\acr{HB}}$. As the complexity of race prediction is prohibitive ($\textsf{NP-hard}$ in general~\cite{Mathur2020b}), this work characterizes the fine-grained complexity of popular, more relaxed notions of dynamic races that take polynomial time. \Paragraph{Fine-grained complexity.} Traditional complexity theory usually shows a problem is intractable by proving it NP-hard, and tractable by showing it is in $\textsf{P}$. For algorithms with large input sizes, this distinction may be too coarse. It becomes important to understand, even for problems in $\textsf{P}$, whether algorithms with smaller degree polynomials than the known are possible, or if there are fine-grained lower bounds making this unlikely. Fine-grained complexity involves proving such lower bounds, by showing relationships between problems in $\textsf{P},$ with an emphasis on the degree of the complexity polynomial, and is nowadays a field of very active study. We refer to~\cite{Bringmann2019} for an introductory, and to~\cite{Williams18} for a more extensive exposition on the topic. Fine-grained arguments have also been instrumental in characterizing the complexity of various problems in concurrency, such as bounded context-switching~\cite{Chini2017}, safety verification~\cite{Chini2018}, data-race prediction~\cite{Mathur2020b} and consistency checking~\cite{Chini2020}. \section{Summary of Results} The algorithm of \cite{Savage97} processes the trace in a one-pass streaming fashion and \rcomment{solves \textsf{Lock-set}{}} in linear time, assuming parameters like $\mathcal{L}$ are constant. Is the assumption of these parameters being constant crucial in establishing the linear time upper bound? In other words, is it possible to get a linear time algorithm if this assumption is relaxed? We show a conditional negative answer to the latter question, assuming \textsf{HSH}{}. First we show why \textsf{OVH}{} cannot be used to show such a result. Corollary $2$ from \cite{CarmosinoGIMPS2016} implies that if there is a non-deterministic linear time algorithm for a problem and its complement, that is, a linear time verifiable certificate for both positive and negative instances of the problem, then assuming \textsf{NSETH}{}, any conjecture that assumes \textsf{SETH}{} cannot be used to prove a higher than linear time lower bound. We show that such a \rcomment{linear time algorithm} exists for \textsf{Lock-set}{}. The proof of \thmref{nclv-no-seth-hardness} implies an $O(\mathcal{N}\cdot \min\{\mathcal{L},\mathcal{V}\})$ time algorithm. Contrast this with \thmref{cedl-quadratic-lower-bound}, which shows that \textsf{Lock-cover}{} is $\Omega(\mathcal{N}^2)$ hard even with $1$ memory location access and $O(\log\mathcal{N})$ locks. We next show a conditional $\Omega(\mathcal{N}^2)$ hardness for \textsf{Lock-set}{} assuming \textsf{HSH}{}, matching its upper bound when there are $O(\mathcal{N})$ number of locks and as many memory location accesses. We then turn our attention to detecting $\operatorname{\acr{HB}}$-races dynamically. As observed \ucomment{in sec..}, the popular vector clock algorithm for detecting $\operatorname{\acr{HB}}$-races runs in time \rcomment{Placeholder content from here till end of section.} We first show an algorithm with an improved bound of $O(\mathcal{N}\min\{\mathcal{T},\mathcal{L}\})$, then prove that the general problem is hard under \textsf{OVH}. As listing all $\operatorname{\acr{HB}}$-races is unlikely to have a sub-quadratic algorithm, it is then natural to ask if the problem of deciding whether a given trace has an $\operatorname{\acr{HB}}$-race is easier. We show that this decision version too will not have a better than $O(\mathcal{N}^{3/2})$ time algorithm. We also show, using \thmref{better-than-t-unlikely-under-seth}, that a better lower bound under \textsf{SETH}{} is improbable. Finally we show that the problem of detecting sync preserving races is even harder, by giving a cubic lower bound under \textsf{OVH}{} for the same. We show this bound is tight in the sense that a better bound cannot be obtained conditioned on \textsf{SETH}{}. \section{Synchronization-Preserving Races}\label{sec:syncp} In this section we discuss the dynamic detection of sync-preserving races, and prove \thmref{syncp-ov3-hard}. For notational convenience, we will frequently use the composite \emph{sync} events. A $\opfont{sync}(\ell)$ event represents the sequence $\opfont{acq}(\ell), \opfont{r}(x_{\ell}), \opfont{w}(x_{\ell}), \opfont{rel}(\ell)$. The key idea behind sync events is as follows. Assume that in a trace $\sigma$ we have two $\opfont{sync}(\ell)$ events $e_1$ and $e_2$ with $e_1\stricttrord{\sigma} e_2$. Then any correct reordering $\rho$ of $\sigma$ with $e_2\in \events{\rho}$ satisfies the following. \begin{compactenum}[(a)] \item We have $e_1\in \events{\rho}$, as the read event of $e_2$ must read from the write event of $e_1$. \item For every $e'_1, e'_2\in \events{\rho}$ such that $e'_1\tho{\sigma}e_1$ and $e_2\tho{\sigma}e'_2$, we have $e'_1\stricttrord{\rho} e'_2$. \end{compactenum} We hence use sync events to ensure certain orderings in any sync-preserving correct reordering of $\sigma$ that exposes a sync-preserving data race. \Paragraph{Intuition.} Before we proceed with the detailed reduction, we provide a high-level description. The input to \orthvk{3} is three sets of vectors $A_1=\{x_i\}_{i\in [n]}$, $A_2=\{y_i\}_{i\in [n]}$, and $A_3=\{z_i\}_{i\in [n]}$. Every vector $x\in A_1$ is represented by a thread $t_x$, ending with the critical section $\opfont{acq}(X), \opfont{w}(z), \opfont{rel}(X)$. Similarly, every vector $y\in A_1$ is represented by a thread $t_y$, ending with the critical section $\opfont{acq}(Y), \opfont{r}(z), \opfont{rel}(Y)$. Notice that we can only have a race between the write event of a thread $t_x$ and the read event of a thread $t_y$. The search for such a race corresponds to the search of the corresponding vectors $x\in A_1$ and $y\in A_2$ such that there is a vector $z\in A_3$ which makes the triplet $x,y,z$ orthogonal. To establish this correspondence, we insert in $t_x$ empty critical sections on locks $l_k$, for $k\in [d]$ that represent the coordinates $k$ for which $x[k]=1$. We use a similar encoding with locks $l'_k$ for the threads $t_y$, capturing that $y[k]=1$. To encode the vectors in $ A_3$, we use $k$ threads $t_k$, for $k\in [d]$, such that the $i^{th}$ segment of $t_k$ encodes $z_i[k]$:~we have two interleaved critical sections on locks $l_k$ and $l'_k$ iff $z_i[k]=1$. Finally, we use some $\opfont{sync}$ events to force all threads $t_k$ be partially executed whenever we want to execute the write event of any thread $t_x$. Hence, any correct reordering of $\sigma$ that exposes a data race in $\sigma$, must execute all $t_k$ at least partially. We make all threads $t_k$ execute before all $t_x$ and $t_y$ in $\sigma$. The notion of sync-preservation ensures that if we have a correct reordering that exposes a race between two threads $t_x$ and $t_y$, then the following holds. For every coordinate $k\in [d]$ in which $x[k]=y[k]=1$, since the corresponding threads $t_x$ and $t_y$ have critical sections on locks $l_k$ and $l'_k$, the thread $t_k$ must execute up to a point where it does not have critical sections on these locks. This means that we have found a vector $z$ with $z[k]=0$, and thus the triplet $x,y,z$ is orthogonal on that coordinate. \input{figures/syncp_ov3} \myparagraph{Reduction}{ Given an \orthvk{3} instance \ovinsthree{3} on vector sets $A_1=\{x_i\}_{i\in [n]}$, $A_2=\{y_i\}_{i\in [n]}$, and $A_3=\{z_i\}_{i\in [n]}$, we create a trace $\sigma$ as follows (see \figref{ex-syncp-race}). We have $\mathcal{T}=2\cdot n + d + 1$ threads, while all access events (not counting the sync events) are of the form $\opfont{w}(z)/\opfont{r}(z)$ in a single variable $z$. We first describe the threads, and then how they interleave in $\sigma$. \SubParagraph{Threads.} We introduce a thread $t_x$ for every vector $x\in A_1$ and a lock $l_k$ for every $k\in[d]$. Each thread $t_x$ consists of two segments $t^1_x$ and $t^2_x$. We create $t^1_x$ as follows. For every $k\in [d]$ where $x[k]=1,$ we add an empty critical section $\opfont{acq}(l_k),\opfont{rel}(l_k)$ in $t^1_x$. We create $t^2_x$ as the sequence $\opfont{acq}(X),\opfont{w}(z),\opfont{rel}(X)$, where $X$ is a new lock, common for all $t^2_x$. For the vectors in $A_2$, we introduce threads similar to those of part $A_1,$ as follows. We have a thread $t_y$ for every vector $y\in A_2$ and a lock $l'_k$ for every $k\in[d]$. Each thread $t_y$ consists of two segments $t^1_y$ and $t^2_y$. For every $k\in [d]$ where $y[k]=1,$ we add an empty critical section $\opfont{acq}(l'_k),\opfont{rel}(l'_k)$ in $t^1_y$. In contrast to the $t^1_x$, every $t^1_y$ also has an event $\opfont{sync}(s_y)$ at the very beginning. We create $t^2_y$ as the sequence $\opfont{acq}(Y),\opfont{r}(z),\opfont{rel}(Y)$, where $Y$ is a new lock, common for all $t^2_y$. The construction of the threads corresponding to the vectors in $A_3$ is more involved. We have one thread $t_k$ for every $k \in [d]$. Each thread has some fixed $\opfont{sync}$ events, as well as critical sections corresponding to one coordinate of all $n$ vectors in $A_3$. In particular, we construct each $t_{k}$ as follows. We iterate over all $z_i$, and if $z_i[k]=0$, we simply append two events $ \opfont{sync}(\ell_k),\opfont{sync}(\ell_k)$ to $t_k$. On the other hand, if $z_i[k]=1$, we interleave these sync events with two critical sections, by appending the sequence $ \opfont{acq}(l_k), \opfont{sync}(\ell_k), \opfont{acq}(l'_k), \opfont{rel}(l_k), \opfont{sync}(\ell_k), \opfont{rel}(l'_k) $. Lastly, we have a single auxiliary trace $t$ that consists of three parts $t^1$, $t^2$ and $t^3$, where \begin{align*} t^1&= \opfont{sync}(\ell_1),\dots, \opfont{sync}(\ell_k), \opfont{sync}(s_{y_1}),\dots \opfont{sync}(s_{y_n})\\ t^2&=\left(\opfont{acq}(Y), \opfont{sync}(\ell_1),\dots, \opfont{sync}(\ell_k), \opfont{sync}(\ell_1),\dots, \opfont{sync}(\ell_k), \opfont{rel}(Y)\right)^{n-1}\\ t^3&=\opfont{acq}(Y), \opfont{sync}(\ell_1),\dots, \opfont{sync}(\ell_k), \opfont{acq}(X), \opfont{rel}(X), \opfont{rel}(Y) \end{align*} \SubParagraph{Concurrent trace.} We are now ready to describe the interleaving of the above threads in order to obtain the concurrent trace $\sigma$. \begin{compactenum} \item We execute the auxiliary trace $t$ and all traces $t_k$, for $k\in [d]$ (i.e., the threads corresponding to the vectors of $A_3$) arbitrarily, as long as for every $k\in[d]$, every sequence of $\opfont{sync}(\ell_k)$ events \begin{enumerate*}[(a)] \item starts with the $\opfont{sync}(\ell_k)$ event of $t_k$ and proceeds with the $\opfont{sync}(\ell_k)$ event of $t$, \item strictly alternates in every two $\opfont{sync}(\ell_k)$ events between $t$ and $t_k$, and \item ends with the last $\opfont{sync}(\ell_k)$ event of $t_k$. \end{enumerate*} \item We execute all $t^1_x$ and $t^1_y$ (i.e., the first parts of all threads that correspond to the vectors in $A_1$ and $A_2$) arbitrarily, but after all traces $t_k$, for $k\in [d]$. \item We execute all $t^2_x$ (i.e., the second parts of all traces that correspond to the vectors in $A_1$) arbitrarily, but before the segment $\opfont{acq}(X), \opfont{rel}(X), \opfont{rel}(Y)$ of $t$. \item We execute all $t^2_y$ (i.e., the second parts of all traces that correspond to the vectors in $A_2$) arbitrarily, but after the segment $\opfont{acq}(X), \opfont{rel}(X), \opfont{rel}(Y)$ of $t$. \end{compactenum} } We refer to \cref{sec:proofs_syncp} for the correctness of the reduction and thus the proof of \thmref{syncp-ov3-hard}.
\section{Introduction} Consider a physical object consisting of two different materials. It might be a machine part manufactured as a metal-plastic composite, or a fragile cultural heritage object unearthed at an archaeological site, or a two-phase fluid flow inside a process industry pipeline at a given time instant. We are interested in using X-ray tomography as a means of nondestructive testing to find out how the two materials are intertwined. To this end, we introduce a {\it novel regularization method} for dual-energy X-ray tomography for material decomposition and propose a {\it specialized interior point method} to solve the underlying optimization problem. We restrict here to the intersection of the object with a two-dimensional square $\Omega\subset\mathbb{R}^2$. The measured X-rays thus are assumed to travel in the plane determined by $\Omega$; one can then stack several 2D reconstructions to achieve a 3D reconstruction. This restriction is only for simplicity of exposition and computation; our methods do generalize to higher dimensions. We discretize $\Omega$ into $N\times N$ square-shaped pixels. There are two unknowns: non-negative $N\times N$ matrices $G^{(1)}$ and $G^{(2)}$ modelling the distributions of material 1 and material 2, respectively. The number $G^{(\ell)}_{i,j}\geq 0$ represents the concentration of material $\ell$ in pixel $(i,j)$, where $i$ is row index and $j$ is column index. In numerical computations we represent the elements of the pair of material matrices $(G^{(1)},G^{(2)})\in(\mathbb{R}^{N\times N})^2$, as a vertical vector $$ \mathbf{g} = \left[\!\!\begin{array}{l}\mathbf{g}^{(1)}\\\mathbf{g}^{(2)}\end{array}\!\!\right]\in \mathbb{R}^{2N^2}. $$ We consider recording X-ray transmission data with two different energies, low and high, resulting in two $M$-dimensional data vectors called $ \mathbf{m}^L$ and $\mathbf{m}^H$. The low-energy measurement is given by \begin{equation}\label{measmodel_low} \mathbf{m}^L = c_{11}A^L\mathbf{g}^{(1)} + c_{12}A^L\mathbf{g}^{(2)}, \end{equation} as both materials attenuate the low-energy X-rays with individual strengths described by the constants $c_{11}>0$ and $c_{12}>0$. Note that empirical values of $c_{11}$ and $c_{12}$ can be found by measuring pure samples of each of the two known materials. The $M{\times}N^2$ matrix $A^L$ encodes the geometry of the tomographic measurement in a standard way \cite[Section 2.3.4]{mueller2012linear}; it contains path lengths of X-rays traveling inside the pixels in $\Omega$. We have $M = r_0P$ with $P$ the number of projection directions and $r_0$ the amount of detector elements in the one-dimensional line camera. Analogously we get for the high-energy measurement \begin{equation}\label{measmodel_high} \mathbf{m}^H = c_{21}A^H\mathbf{g}^{(1)} + c_{22}A^H\mathbf{g}^{(2)}, \end{equation} where the geometric system matrix $A^H$ is possibly different from $A^L$. See Figure \ref{fig:arrangement} for examples of imaging geometries. Again, $c_{21}>0$ and $c_{22}>0$ can be determined empirically. \begin{figure} \begin{picture}(200,170) \put(10,10){\includegraphics[width=5cm]{dual_arrangement1b}} \put(0,165){(a)} \put(155,80){1:LH} \put(135,128){2:LH} \put(75,157){3:LH} \put(7,139){4:LH} \put(220,10){\includegraphics[width=5cm]{dual_arrangement2}} \put(210,165){(b)} \put(365,80){1:H} \put(345,128){2:L} \put(285,157){3:H} \put(225,139){4:L} \end{picture} \caption{Alternative imaging protocols. (a) Two projection images are recorded from each source location: one with low (L) and another with high (H) energy. In this case we have $A^H=A^L$. (b) Only one projection image is recorded at every source location, alternating between low and high energies. In this case we have $A^H\not=A^L$.} \label{fig:arrangement} \end{figure} Now we can combine both measurements in a unified linear system: \begin{equation}\label{unifiedsystem} \mathbf{m}=\left[\!\!\begin{array}{l}\mathbf{m}^L\\\mathbf{m}^H\end{array}\!\!\right] =\begin{bmatrix} c_{11}A^L &c_{12}A^L\\ c_{21}A^H &c_{22}A^H\\ \end{bmatrix} \left[\!\!\begin{array}{l}\mathbf{g}^{(1)}\\\mathbf{g}^{(2)}\end{array}\!\!\right]=\mathcal{A} \mathbf{g}. \end{equation} The core idea in dual-energy X-ray tomography for material decomposition is to choose the two energies so that the two materials respond to them differently. For example, one material might be quite indifferent to the energy change, while the other could attenuate very differently according to energy. Then the solution of (\ref{unifiedsystem}) is rather analogous to solving a system of two linear equations for two variables. We propose a novel variational regularization approach in the space $\mathbf{g}\in \mathbb{R}^{2N^2}$, including a non-negativity constraint: \begin{equation}\label{variational_cont} \widetilde{\mathbf{g}}_{\alpha,\beta} = \mathop{\mbox{arg\,min}}_{\mathbf{g}^{(j)}\geq 0} \left\{\|\mathbf{m}-\mathcal{A} \mathbf{g}\|_2^2 + \alpha\mathcal{R}(\mathbf{g}) + \beta\mathcal{S}(\mathbf{g}) \right\}, \end{equation} where $\alpha,\beta>0$ are regularization parameters, $\mathbf{g}^{(j)}\geq 0$ means that the elements of the vector are non-negative numbers and the regularizer $\mathcal{R}$ can be any of the standard choices such as the Tikhonov penalty \begin{equation}\label{tikhonov_penalty} \mathcal{R}(\mathbf{g}) = \|\mathbf{g}\|_2^2. \end{equation} The novelty arises from the term that penalises the Inner Product (IP) of $g^{(1)}$ and $g^{(2)} \in \mathbb{R}^{N^2}$: \begin{equation}\label{materialsep_penalty} \mathcal{S}(\mathbf{g}) = \mathcal{S}(\left[\!\!\begin{array}{l}\mathbf{g}^{(1)}\\\mathbf{g}^{(2)}\end{array}\!\!\right]) := 2\langle \mathbf{g}^{(1)},\mathbf{g}^{(2)}\rangle = 2\sum_{i=1}^{N^2} \mathbf{g}^{(1)}_{i} \mathbf{g}^{(2)}_{i}. \end{equation} Together with the non-negativity constraint, $\mathcal{S}$ promotes the point-wise separation of the two materials: {\it at each pixel, at least one of the images, $G^{(1)}$ or $G^{(2)}$, needs to have a zero value to make $\mathcal{S}$ minimal.} Due to the presence of the inner product, we denote this approach as IP method. The quadratic program resulting from the application of the novel variational regularization is solved using an Interior Point Method \cite{wright,gondzio_25}; we develop an efficient preconditioner for the normal equations which guarantees a spectrum of the preconditioned matrix to remain independent of the IPM iteration. The numerical experience indicates that this approach allows us to solve the largest problem ($N$=512) in a matter of minutes on a standard laptop. We demonstrate the feasibility of our new approach to material decomposition with computational experiments. Our specific focus is in low-dose imaging, and therefore we consider imaging with only 65 projection directions. This is roughly one order of magnitude less than in standard tomographic scans. Also, we add simulated noise to the measurements for modelling low-dose exposures. As the baseline method for comparison of reconstruction quality we pick the Joint Total Variation Regularization (JTV), which has been used for dual-energy X-ray CT in \cite{Toivanen2020}. We find that under traditional image quality measures, such as square norm error, SSIM or HaarPSI, neither of the two methods show clear superiority over the other. However, when we look at the number of pixels where the materials are correctly identified, our new method outperforms JTV. For simplicity we restrict here to the case of two materials and two X-ray energies. However, the model readily generalizes to higher numbers of both, as long as there are at least as many energies as there are materials. Moreover, we only consider a two-dimensional slice to be imaged using a one-dimensional linear array X-ray detector. A similar problem could be formulated for 3D objects imaged in cone-beam geometry with a planar X-ray camera; the changes are mathematically straightforward but computationally heavy. In an initial feasibility study like this we find it better to stick with numerically straightforward 2D scenarios. The paper is organized as follows. In Section \ref{sec:contform} we discuss the continuous theory behind our discrete variational regularization method. Section \ref{sec:IPM} is devoted to presenting an efficient numerical optimization method tailored for finding the minimizer of (\ref{variational_cont}). In Section \ref{sec:JTV} we recall the formulation of the Joint Total Variation regularization approach. In Section \ref{sec:methods} we describe the testing environment and in Section \ref{sec:results} we report numerical results of applying two methods: the new proposed IP regularization and the standard JTV regularization used to analyse several test images. Additionally, we briefly illustrate the behaviour of the preconditioned conjugate gradient, the specialized linear solver applied by the interior point method used to optimize the IP regularization problem. Finally, we summarize our findings in Section \ref{sec:discussion}. \section{Continuous form of the new regularization functional}\label{sec:contform} In many inverse problems there is an accurate continuous model for the measurement process. Regularized inversion methods can then be designed and analyzed in infinite-dimensional function spaces \cite{engl1996regularization,mueller2012linear,schuster2012regularization}. Tomography is a prime example. Given a well-behaving function $f:\Omega\rightarrow \mathbb{R}$, the Radon transform $Rf$ organizes the set of all possible line integrals of $f$: $$ Rf(\theta,s) = \int_{x\cdot\theta=s}f(x) dL, $$ where $\theta\in\mathbb{R}^2$ is a unit vector, $s\in\mathbb{R}$, and $dL$ stands for the one-dimensional Lebesgue measure on the line $x\cdot\theta=s$. Homogenising the molecular scale, we can use a non-negative function $f$ as a model of X-ray attenuation inside a physical object. Further, a logarithmically transformed pixel value in an X-ray camera approximates $Rf(\theta,s)$ with $\theta$ and $s$ determined by the path of the ray hitting the pixel \cite{natterer2001mathematics,mueller2012linear}. In practical inverse problems, the unknown needs a finite representation to be used in computational reconstruction. For example, in this work we pixelize $\Omega$, represent $f$ computationally as a function having a constant value on each pixel, and use a pencil-beam model to arrive at the model (\ref{variational_cont}). Ideally, practical reconstructions can bee seen as discrete approximations of the regularized inversion results described by the continuous theory. This is a great situation as the theorems concerning the continuous model cover all discrete resolutions in one go, providing discretization-invariance for the inversion approach. However, the relationship between discrete and continuous inversion models is not always straightforward. For example, in \cite{lassas2004can} two of the authors showed that the total variation prior depends on the discretization in an unexpected and harmful way when used in Bayesian inversion. A discretization-invariant theory was developed using wavelets in \cite{Lassas2009}. Also, the usual assumption of discrete white noise in the practical data requires careful treatment at the infinite-dimensional limit \cite{kekkonen2016posterior}. With those caveats in mind, we feel that it is important to provide our new discrete regularization method with a rigorous continuum limit. Let $L^2_+(\Omega)=\{g\in L^2(\Omega):\ g(x)\geq 0\hbox{ a.e.}\}$ and $g(x)=(g_1(x),g_2(x))\in L^2_+(\Omega)^2$, $\mathcal H$ be a Hilbert space and $A:L^2(\Omega)^2\to \mathcal H$ be a bounded linear operator (such as the Radon transform). We consider the minimization problem \begin{equation}\label{variational continuous} \widetilde{g}_{\alpha,\beta} = \mathop{\mbox{arg\,min}}_{g\in L^2_+(\Omega)^2} \left\{\|m-A g\|_{ \mathcal H}^2 + \alpha\mathcal{R}(g) + \beta\mathcal{S}(g) \right\}, \end{equation} where $\alpha>\beta>0$ are regularization parameters, and \begin{equation}\label{tikhonov_penalty continuous} \mathcal{R}(g) = \int_\Omega(|g_1(x)|^2+|g_2(x)|^2)dx \end{equation} and \begin{equation}\label{materialsep_penalty continuous} \mathcal{S}(g) = \int_\Omega g_1(x)g_2(x)\, dx. \end{equation} Let $U({j,N})\subset \Omega$, $j=1,2,\dots,N$ be disjoint sets such that $\bigcup_{j=1}^NU({j,N})=\Omega$ and $\hbox{diam}(U({j,N}))\to 0$ as $N\to \infty$. Let ${\bf 1}_{U({j,N})}(x)=1$ for $x\in U({j,N})$ and ${\bf 1}_{U({j,N})}(x)=0$ for $x\not \in U({j,N})$. In the context of problem (\ref{variational_cont}), the interior of each $U({j,N})$ coincides with the interior of one of the pixels in our discretization of $\Omega$. Then $$ \phi_{j,N}(x)=|{U({j,N})}|^{-1/2}{\bf 1}_{U({j,N})}(x),\quad j=1,2,\dots,N, $$ {\color{black}where $|\cdot |$ denotes Lebesgue measure,} are orthogonal piecewise constant functions. Let $\mathcal P_N\subset L^2(\Omega)$ be the span of the functions $\phi_{j,N}(x)$, $j=1,2,\dots,N$ and $$ P_Nu=\sum_{j=1}^N \langle u,\phi_{j,N}\rangle_{L^2(\Omega)}\phi_{j,N} $$ be the orthogonal projector in $L^2(\Omega)$ onto $\mathcal P_N$. For $g=(g_1,g_2)\in L^2(\Omega)^2$ we denote $P_Ng=(P_Ng_1,P_Ng_2)$. When $\Omega\subset \mathbb{R}^2$ is the unit square and the interiors of $U({j,N})$ coincide with the interiors of our pixels, the minimizer $\tilde \mathbf{g}_{\alpha,\beta}$ defined in (\ref{variational_cont}) corresponds to a piecewise constant function that solves the minimization problem \begin{eqnarray}\label{discretized problem 2} \min_{g\in Y\cap\mathcal P_N^2}\overline F(g),\quad \overline F(g)=\|m-A g\|_{ \mathcal H}^2 + \alpha\mathcal{R}(g) + \beta\mathcal{S}(g). \end{eqnarray} As $\overline F:Y\cap\mathcal P_N^2 \to \mathbb{R}$ is a strictly convex function and $\mathcal P_N^2$ is a finite dimensional vector space, we see that $\overline F:Y\cap\mathcal P_N^2 \to \mathbb{R}$ has a unique minimizer. To study an analogous continuous problem, let $F:L^2(\Omega)^2\to \mathbb{R}\cup\{\infty\}$ be the function \begin{eqnarray*} F(g)&=&\|m-A g\|_{ \mathcal H}^2 + \alpha\mathcal{R}(g) + \beta\mathcal{S}(g)+\chi_{L^2_+(\Omega)^2}(g), \end{eqnarray*} where $\chi_{L^2_+(\Omega)^2}(g)=0$ if $g\in L^2_+(\Omega)^2$ and $\chi_{L^2_+(\Omega)^2}(g)=\infty$ if $g\not \in L^2_+(\Omega)^2$. To study the convergence of the discrete problems, we define also an auxiliary function $F_N:L^2(\Omega)^2\to \mathbb{R}\cup\{\infty\}$, \begin{eqnarray*} F_N(g)&=&\|m-A P_Ng\|_{ \mathcal H}^2 + \alpha\mathcal{R}(g) + \beta\mathcal{S}(P_Ng)+\chi_{L^2_+(\Omega)^2}(g). \end{eqnarray*} Let $Y=L^2(\Omega)^2$ and $\tau_Y$ be the norm topology of $Y$ and $\tau_w$ be the weak topology of $Y$. Consider now a sequence $y_N\in Y$ that converges weakly in $Y$ to $y$. As $A:Y\to \mathcal H$ is bounded, and thus $A^*: \mathcal H\to Y$ is bounded, we see that $Ay_N$ converges weakly in $\mathcal H $ to $Ay$. Thus, as the norm of a Hilbert space, $\|\cdot\|_{\mathcal H}$, is a weakly lower-semicontinuous function, we see that $F:Y\to \mathbb{R}\cup\{\infty\}$ is lower-semicontinuous in $(Y,\tau_w)$. As $F:Y\to \mathbb{R}\cup\{\infty\}$ is a strictly convex lower-semicontinous function in $(Y,\tau_w)$, it has a unique minimizer. Similarly, $F_N:Y\to \mathbb{R}\cup\{\infty\}$ has a unique minimizer. Moreover, we see that if $g^*_N\in Y$ is a minimizer of $F_N:Y\to \mathbb{R}\cup\{\infty\}$, then $g^*_N\in\mathcal P_N^2$. As $F_N(P_Ng)\leq F_N(g)$, we see that the minimizer of $F_N$ satisfies $g^*_N\in\mathcal P_N^2$. Next, we recall the definition of the $\Gamma$-convergence. Let $(Y,\tau)$ be a topological space and $\{\mathcal{F}_{N}:Y\to [-\infty,\infty],\,N>0\}$ be a 1-parameter family of functionals on $Y$. For $y\in Y$ let $N(x)$ denote the set of all open neighbourhoods $U\subset Y$ of $x$, with respect to the topology $\tau$. If \[ \mathcal{F}(x)= \sup_{U\in N(x)}\liminf_{N\to \infty}\inf_{y\in U} \mathcal{F}_{N} (y)= \sup_{U\in N(x)}\limsup_{N\to \infty}\inf_{y\in U} \mathcal{F}_{N}(y), \] we say that \emph{$\mathcal{F}_N$ $\Gamma$-converges to $\mathcal{F}$} in $Y$ with respect to topology $\tau$ as $N\to \infty$. \begin{theorem}\label{thm:discretecont} Let $\alpha>\beta$ and $g^*_N\in Y$ be the minimizers of functions $F_N$ and $g^*\in Y$ be the minimizer of $F$. Then \begin{eqnarray} \lim_{N\to \infty } \|g^*_N-g^*\|_Y=0. \end{eqnarray} \end{theorem} \begin{proof} Let us first recall the reason why the projectors $P_N$ converge strongly to the identity operator in $Y$ as $N\to \infty$. Let $g\in Y$ and $\epsilon>0$. Then there is a function $g'\in C^1(\overline \Omega)^2$ such that $\|g-g'\|_Y<\epsilon/4$. Then, $\|P_N(g'-g)\|_Y\leq\|g-g'\|_Y<\epsilon/4$. Let $M=\|g'\|_{C^1}.$ When $N_0$ is so large that for all $N>N_0$ we have $\hbox{diam}(U({j,N}))<\epsilon/(2M)$, we see by considering averages of $g'$ in the sets $U(j,N)$ that $\|g'-P_Ng'\|_Y\leq\epsilon/2$. Thus, for $N>N_0$ we have $$ \|g-P_Ng\|_Y\leq \|g-g'\|_Y+\|g'-P_Ng'\|_Y+\|P_Ng'-P_Ng\|_Y<\epsilon. $$ This shows that the projectors $P_N$ converge strongly to $I$ in $Y$ as $N\to \infty$. \noindent Let $H,H_N:Y\to \mathbb{R}$ be the quadratic functions \begin{eqnarray*} H(g)&=&\|m-A g\|_{L^2(\Omega)^2}^2 + \alpha\mathcal{R}(g) + \beta\mathcal{S}(g) ,\\ H_N(g)&=&\|m-A P_Ng\|_{L^2(\Omega)^2}^2 + \alpha\mathcal{R}(g) + \beta\mathcal{S}(P_ng). \end{eqnarray*} and $Q,Q_N:Y\to \mathbb{R}$ be the quadratic forms \begin{eqnarray*} Q(g)&=&\|A g\|_{L^2(\Omega)^2}^2 + \alpha\mathcal{R}(g) + \beta\mathcal{S}(g) ,\\ Q_N(g)&=&\|A P_Ng\|_{L^2(\Omega)^2}^2 + \alpha\mathcal{R}(g) + \beta\mathcal{S}(P_ng). \end{eqnarray*} Observe that for all $g\in Y$ the values $H_N(g)$ converge to $H(g)$ as $N\to \infty,$ that is, $H_N$ converges to $H$ pointwisely in $Y$. As $H_N$ are convex and uniformly bounded in balls of $Y$, \cite{DalMaso}, Proposition 5.12, implies that $H_N$ $\Gamma$-converges to $H$ in $(Y,\tau_Y)$ as $N\to \infty.$ Moreover, $H_N$ converges to $H$ both pointwisely and in the sense of $\Gamma$-convergence, and the mapping $g\mapsto \chi_{L^2_+(\Omega)^2}(g)$ is lower-semicontinuous in $(Y,\tau_Y)$. Then \cite[Propositions 5.9 and 6.25]{DalMaso} imply that $F_N:Y\to \mathbb{R}\cup\{\infty\}$ $\Gamma$-converges to $F$ in $(Y,\tau_Y)$ as $N\to \infty.$ As $Q_N(g)\geq (\alpha-\beta) \|g\|_Y^2$, we see that the family of functions $F_N:Y\to \mathbb{R}\cup\{\infty\}$, $N>0,$ is equicoersive in $(Y,\tau_n)$ by \cite{DalMaso}, Def. 7.6 and Prop 7.7. By \cite{DalMaso}, Theorem 7.8, we have $$ F(g^*)=\min_{g\in Y} F(b)=\lim_{N\to \infty}\min_{g\in Y} F_N(b)=\lim_{N\to \infty}F_N(g^*_N). $$ Observe that as $g^*_N\in\mathcal P_N^2$, we have $F_N(g^*_N)=F(g^*_N)$. As $F_N(g)\geq (\alpha-\beta) \|g\|_Y^2$, we see that $g^*_N$ are uniformly bounded in $Y$. To show that $g^*_N$ converges weakly in $Y$ to $g^*$ as $N\to \infty$, we next assume the opposite. Then, by choosing a subsequence if necessary, we can assume that there is $\epsilon_1>0$ and $y\in Y$ such that \begin {eqnarray}\label{limits are not same} |\langle g^*_N,y\rangle_Y-\langle g^*,y\rangle_Y|>\epsilon_1. \end {eqnarray} By Banach-Alaoglu theorem, by choosing a subsequence if necessary, we can assume that $g^*_N$ converges weakly in $Y$ to some $\tilde g\in Y$. By \eqref{limits are not same}, $\tilde g\not=g^*$. As $F$ is lower-semicontinuous in $(Y,\tau_w)$, we have that \begin {eqnarray}\label{limit of values} F(\tilde g)\leq \lim_{N\to \infty}F_N(g^*_N)= F(g^*)=\min_{g\in Y} F(g). \end {eqnarray} Thus, $F(\tilde g)=F(g^*)$ and $\tilde g$ is a minimizer of $F:Y\to \mathbb{R}\cup\{\infty\}$. As the minimizer of $F$ is unique, we have $\tilde g=g^*$ which is not possible. This shows that $g^*_N$ converges weakly in $Y$ to $g^*$. This weak convergence, limit \eqref{limit of values} and the fact that $g^*_N,g^*\in L^2_+(\Omega)^2$ implies that \begin {eqnarray}\label{limit of values forms} \lim_{N\to \infty}Q_N(g^*_N)=Q(g^*). \end {eqnarray} Observe that $Q:Y\to \mathbb{R}$ is a strongly positive quadratic form, that is, $Q(g)\geq (\alpha-\beta)\|g\|_Y^2$ and $\alpha-\beta>0.$ Thus, by \cite{Martin}, Def. 1.1 and property P5 (see also \cite{Hestenes}), the quadratic form $Q:Y\to \mathbb{R}$ is a Legendre form and it has the property that if $y_N\to y$ in the weak topology of $Y$ and $Q(y_N)\to Q(y)$ as $N\to \infty,$ then $y_N\to y$ in the norm topology of $Y$. Above we have seen that $g^*_N$ converges weakly to $g^*$ in $Y$ and the limit \eqref{limit of values forms} holds. As $Q$ is a Legendre form this implies that $g^*_N$ converges in the norm topology $Y$ to $g^*$. \end{proof} The message of Theorem \ref{thm:discretecont} is that when we increase the resolution in problems of the form (\ref{variational_cont}), they converge towards a well-defined infinite-dimensional problem. This is a form of discretization-invariance. \section{Optimization with preconditioned interior point method (IPM)}\label{sec:IPM} By combining the use of Tikhonov regularizer (\ref{tikhonov_penalty}) and the Inner Product regularizer (\ref{materialsep_penalty}), which promotes the point-wise separation of two materials, we arrive at the constrained quadratic programming task \begin{equation}\label{variational_Tikhonov} \mathop{\mbox{arg\,min}}_{\mathbf{g}^{(j)}\geq 0} \left\{\|\mathbf{m}-\mathcal{A} \mathbf{g}\|_2^2 + \alpha\|\mathbf{g}\|_2^2 + \beta\, \mathbf{g}^T L \mathbf{g} \right\}, \end{equation} where $$ L=\left[ \begin{array}{cc} 0 & I \\ I & 0 \end{array}\right], $$ with four blocks of size $N^2{\times}N^2$ each. The problem may be written as an explicit quadratic program with inequality (non-negativity) constraints \begin{equation} \mathop{\mbox{arg\,min}}_{\mathbf{g}^{(j)}\geq 0} -\mathbf{m}^T \mathcal{A} \mathbf{g} +\frac{1}{2} \mathbf{g}^T(Q_1+Q_2)\mathbf{g} \label{minproblem} \end{equation} where \begin{equation} \small Q_1=\left[ \begin{array}{cc} c^2_{11}(A^L)^T A^L+c^2_{21}(A^H)^T A^H & c_{11}c_{12}(A^L)^TA^L+c_{21}c_{22}(A^H)^TA^H \\ c_{11}c_{12}(A^L)^TA^L+c_{21}c_{22}(A^H)^TA^H & c^2_{12}(A^L)^T A^L+c^2_{22}(A^H)^T A^H \end{array}\right], \label{matrixQ1} \end{equation} \begin{equation} Q_2=\left[ \begin{array}{cc} \alpha I & \beta I \\ \beta I & \alpha I \end{array}\right]. \label{matrixQ2} \end{equation} Notice that $Q=Q_1+Q_2$ can be written as \begin{equation} \label{Qkronecker} {\small Q=\begin{bmatrix} c_{11}^2 & c_{11}c_{12}\\c_{11}c_{12} & c_{12}^2\end{bmatrix}\otimes (A^L)^TA^L+\begin{bmatrix} c_{21}^2 & c_{21}c_{22}\\c_{21}c_{22} & c_{22}^2\end{bmatrix}\otimes (A^H)^TA^H+\begin{bmatrix} \alpha & \beta\\\beta & \alpha\end{bmatrix}\otimes I,} \end{equation} where $\otimes$ represents the Kronecker product. Recall this important property of the Kronecker product: \begin{lemma} \label{kroneig} Given two square matrices $T$ and $Z$, the eigenvalues of the Kronecker product $T \otimes Z$ are given by $t \cdot z$, where $t$ is an eigenvalue of $T$ and $z$ is an eigenvalue of $Z$. \end{lemma} \begin{lemma} \label{lemmaconvex} If $\alpha\ge\beta$, problem \eqref{minproblem} is convex. \end{lemma} \begin{proof} We just need to show that matrix $Q$ in \eqref{Qkronecker} is positive semi-definite. We know that matrix \[\begin{bmatrix} \alpha & \beta\\\beta & \alpha\end{bmatrix}\] is positive semi-definite if $\alpha\ge\beta$; the other matrices in the right hand side of \eqref{Qkronecker} are always positive semi-definite. Therefore, using Lemma~\ref{kroneig}, $Q$ is the sum of semi-definite matrices and is then positive semi-definite. \end{proof} Therefore, in the following we will always assume that $\alpha\ge\beta$. \subsection{Interior point method formulation} We decided to solve problem~\eqref{minproblem} using an interior point method \cite{wright,gondzio_25}: these methods are among the most efficient solvers for quadratic programs of large dimensions and can often outperform the more common first order methods in terms of speed of convergence and accuracy. For this problem we aim at reaching large dimensions, and the FISTA method \cite{fista}, already for moderate problem sizes ($N=128$), was not able to match the results of the interior point solver; we thus decided to consider only the latter in this work. Since the problem (\ref{variational_Tikhonov}) does not involve any linear equality constraints, we can obtain a formulation that is simpler than the general one. In the following, $\mathbf{e}=(1,1,\dots,1)^T$ and for any vector $\mathbf v$, we define a diagonal matrix $V=\text{diag}(\mathbf v)$. To apply an interior point method to (\ref{variational_Tikhonov}), we proceed in the usual way and start from adding a logarithmic barrier to form the Lagrangian: \begin{equation}L(\mathbf{g},\mu)=\frac{1}{2}\mathbf{g}^TQ\mathbf{g}-\mathbf{m}^T\mathcal A\mathbf{g}-\mu\sum_{i=1}^{2N^2}\log g_i.\label{lagrangian}\end{equation} The coefficient $\mu$ is the centrality parameter, which guides the approximations along the central path and which is driven to zero throughout the iterations. The gradient of~\eqref{lagrangian} is \[\nabla_gL(\mathbf{g},\mu)=Q\mathbf{g}-\mathcal A^T\mathbf{m}-\mu G^{-1}\mathbf{e}.\] If we define variables $\mathbf{s}$ as $\mu G^{-1}\mathbf{e}=S\mathbf{e}$, then the optimality conditions become \[\begin{cases} Q\mathbf{g}-\mathbf{s}=\mathcal A^T\mathbf{m}\\ GS\mathbf{e}=\mu\mathbf{e}\\ \mathbf{g},\mathbf{s}>0. \end{cases}\] The Newton step $(\Delta\mathbf{g},\Delta\mathbf{s})$ for the previous nonlinear system can be found solving \[\begin{bmatrix} Q & -I\\S & G\end{bmatrix}\begin{bmatrix}\Delta\mathbf{g}\\\Delta \mathbf{s}\end{bmatrix}=\begin{bmatrix}\mathbf{r_1}\\\mathbf{r_2}\end{bmatrix},\] where $\mathbf{r_1}=\mathcal A^T\mathbf{m}-Q\mathbf{g}+\mathbf{s}$ and $\mathbf{r_2}=\sigma\mu\mathbf{e}-GS\mathbf{e}$; $\sigma$ is a coefficient that is responsible for the reduction of the parameter $\mu$ \cite{gondzio_25}. If we form the normal equations, we obtain the final linear system that we need to solve: \begin{equation} \label{normalequations} (Q+G^{-1}S)\Delta\mathbf{g}=\mathbf{r_1}+G^{-1}\mathbf{r_2}. \end{equation} We can then retrieve $\Delta\mathbf{s}$ as \begin{equation} \label{deltas} \Delta\mathbf{s}=G^{-1}(\mathbf{r_2}-S\Delta\mathbf{g}). \end{equation} \begin{remark} Notice that we can use the normal equations without the need to compute the inverse of Q. This would not be possible for a general quadratic program, but here it follows from the fact that we do not have any linear equality constraint. \end{remark} At every IPM iteration we need to find the Newton step using \eqref{normalequations}-\eqref{deltas} and calculate the step sizes $\alpha_g$ and $\alpha_s$, so that the new point $(\mathbf{g}+\alpha_g\Delta\mathbf{g},\mathbf{s}+\alpha_s\Delta\mathbf{s})$ remains positive. We then update the centrality measure $\mu=\mathbf{g}^T\mathbf{s}/2N^2$ and choose the coefficient $\sigma$ for the next iteration. In practice, a more sophisticated method is used, which involves predictors and correctors. In particular the predictor, or affine-scaling direction, is computed solving~\eqref{normalequations} with $\sigma=0$. A sequence of correctors is then computed by solving~\eqref{normalequations} with $\mathbf{r_1}=0$ and $\mathbf{r_2}$ chosen in order to improve the centrality of the approximation, by pushing the point towards a symmetric neighbourhood \begin{equation} N=\{(\mathbf{g},\mathbf{s})\mid\mathbf{g}>0,\,\mathbf{s}>0,\,\gamma\mu\le g_js_j\le\mu/\gamma,\,\forall j\}. \label{neighbourhood} \end{equation} This technique, called multiple centrality correctors, has been analyzed in detail in \cite{gondzio_mcc,colombo_gondzio}. To stop the IPM iterations, we check the normalized dual residual and the complementarity measure: \begin{equation} \frac{\|\mathcal A^T\mathbf{m}-Q\mathbf{g}+\mathbf{s}\|}{\|\mathcal A^T\mathbf{m}\|}<\texttt{tol}, \quad \mu<\texttt{tol}, \label{IPMstop} \end{equation} where $\texttt{tol}$ is the IPM tolerance. The matrix $Q$ in \eqref{normalequations} is not known explicitly; it is accessible only via matrix-vector products performed using the Radon transform. Hence, to solve the linear system we need to use a matrix free approach; this is done employing conjugate gradient with an appropriate preconditioner. \subsection{Preconditioner} The matrix of the system is $Q_1+Q_2+G^{-1}S$, with $Q_1$ given in~\eqref{matrixQ1} and $Q_2$ given in~\eqref{matrixQ2}. $G^{-1}S$ is diagonal, $Q_2$ has a $2\times2$ block structure with diagonal blocks, while the structure of $Q_1$ depends on matrices $(A^L)^TA^L$ and $(A^H)^TA^H$. Let us analyze an instance where $A^L=A^H=A$. Matrix $A^TA$ is dense in general, but almost all its mass is concentrated in some of its diagonals. Indeed, this can be seen from Figure \ref{fullmatrix}, which shows the magnitude of the elements for the case $N=32$. In particular, every $N$ diagonals, there is one with larger elements; these elements are almost constant along a specific diagonal, giving matrix $A^TA$ a Toeplitz-like structure. The further away from the diagonal, the smaller the elements become, as can be seen from Figure \ref{diagonaldecay}: here, the mean of the elements along a specific diagonal is plotted against the distance from the main diagonal. \begin{figure}[h] \centering \subfloat[\label{fullmatrix}]{\includegraphics[width=.5\textwidth]{fullmatrix2}} \subfloat[\label{diagonaldecay}]{\includegraphics[width=.5\textwidth]{diagonaldecay}} \caption{{\bf (a)} Magnitude of the elements of $A^TA$ for $N=32$. {\bf (b)} Magnitude of the mean element along a specific diagonal against the distance from the main diagonal.} \end{figure} These facts suggest that it may be possible to approximate matrix $A^TA$ considering only some of the diagonals with large elements. The simplest choice is to use just the main diagonal, in a similar way to what is done in compressed sensing \cite{mf_cs}. Thus, matrix $Q_1$ can be approximated using a $2\times2$ block matrix with diagonal blocks; adding matrix $Q_2$ and $G^{-1}S$ we get the preconditioner: \begin{equation} \label{blockdiagprec} P=\begin{bmatrix}(c_{11}^2+c_{21}^2)\rho I+\alpha I+(G^{-1}S)_1 & (c_{11}c_{12}+c_{21}c_{22})\rho I+\beta I\\ (c_{11}c_{12}+c_{21}c_{22})\rho I+\beta I & (c_{12}^2+c_{22}^2)\rho I+\alpha I+(G^{-1}S)_2\end{bmatrix}, \end{equation} where we have split the entries of $G^{-1}S$ into the two blocks; $\rho$ is an approximation of the diagonal elements of $A^TA$, obtained through random sampling of this matrix. We will denote the diagonal blocks as $D_{11}$, $D_{12}$ and $D_{22}$ according to their position. This preconditioner is easy to invert: when we need to apply it, we have to solve \[\begin{bmatrix} D_{11} & D_{12}\\D_{12} & D_{22}\end{bmatrix}\begin{bmatrix}\mathbf{x_1}\\\mathbf{x_2}\end{bmatrix}=\begin{bmatrix}\mathbf{y_1}\\\mathbf{y_2}\end{bmatrix}.\] This system can be solved forming the Schur complement, which is diagonal: \[(D_{22}-D_{12}^2D_{11}^{-1})\mathbf{x_2}=\mathbf{y_2}-D_{12}D_{11}^{-1}\mathbf{y_1}\] and retrieving $\mathbf{x_1}$ from $\mathbf{x_1}=D_{11}^{-1}(\mathbf{y_1}-D_{12}\mathbf{x_2})$. Notice that most of the terms involved in the preconditioner are constant, while some vary through the IPM iterations, but are immediately available from vectors $\mathbf{g}$ and $\mathbf{s}$. This preconditioner is thus very cheap both to compute and apply. \begin{remark} Notice that, if $A^L\ne A^H$, the same preconditioner can be used with a small modification: we just need to approximate both the diagonal of $(A^L)^TA^L$ and $(A^H)^TA^H$ with two different coefficients $\rho^L$ and $\rho^H$. \end{remark} In order to use PCG with the proposed preconditioner, we need to show that matrices $Q_1+Q_2+G^{-1}S$ and $P$ are positive definite. \begin{lemma} If $\alpha\ge\beta$, $M=Q_1+Q_2+G^{-1}S$ and $P$ are symmetric positive definite. \end{lemma} \begin{proof} From Lemma \ref{lemmaconvex} we know that if $\alpha\ge\beta$, matrix $Q$ is positive semi-definite. Matrix $G^{-1}S$ is trivially strictly positive definite, hence $M$ is positive definite. For $P$, write it as \[P=\begin{bmatrix} c_{11}^2 & c_{11}c_{12}\\c_{11}c_{12} & c_{12}^2\end{bmatrix}\otimes \rho^L I+\begin{bmatrix} c_{21}^2 & c_{21}c_{22}\\c_{21}c_{22} & c_{22}^2\end{bmatrix}\otimes \rho^H I+\begin{bmatrix} \alpha & \beta\\\beta & \alpha\end{bmatrix}\otimes I+G^{-1}S\] and proceed in the same way. \end{proof} Let us define the matrices \[F=\begin{bmatrix}f_1 & f_2\\f_2 & f_3\end{bmatrix}\quad K=\begin{bmatrix} \alpha & \beta\\\beta & \alpha\end{bmatrix}\] where $f_1=c_{11}^2+c_{21}^2$, $f_2=c_{11}c_{12}+c_{21}c_{22}$, $f_3=c_{12}^2+c_{22}^2$. We can now analyze the spectrum of the preconditioned matrix: \begin{lemma}\label{lemma_bound} The eigenvalues of the preconditioned matrix $P^{-1}M$, where $P$ is defined in \eqref{blockdiagprec} and $M=Q_1+Q_2+G^{-1}S$, when $A^L=A^H=A$ satisfy \[\lambda\in\Bigg[\frac{\alpha-\beta}{\rho\Lambda_F+\alpha+\beta},\frac{\sigma_\text{max}^2(A)\Lambda_F+\alpha+\beta}{\rho\lambda_F+\alpha-\beta}\Bigg],\] where $\Lambda_F\ge\lambda_F$ are the two eigenvalues of matrix $F$. \end{lemma} \begin{proof} We want to study the generalized eigenvalue problem $M\mathbf{v}=\lambda P\mathbf{v}$, where \[M=F\otimes A^TA+K\otimes I+G^{-1}S,\] \[P=F\otimes\rho I+K\otimes I+G^{-1}S.\] Let us fix $\|\mathbf{v}\|=1$. The eigenvalues can be expressed as \[\lambda=\frac{\mathbf{v}^TM\mathbf{v}}{\mathbf{v}^TP\mathbf{v}}=\frac{\mathbf{v}^T(F\otimes A^TA)\mathbf{v}+\mathbf{v}^T(K\otimes I)\mathbf{v}+\mathbf{v}^T(G^{-1}S)\mathbf{v}}{\mathbf{v}^T(F\otimes\rho I)\mathbf{v}+\mathbf{v}^T(K\otimes I)\mathbf{v}+\mathbf{v}^T(G^{-1}S)\mathbf{v}}.\] Let us call the eigenvalues of matrix $F$ as $\Lambda_F>\lambda_F\ge0$, where the last inequality follows from \begin{align} f_1f_3-f_2^2&=(c_{11}^2+c_{21}^2)(c_{12}^2+c_{22}^2)-(c_{11}c_{12}+c_{21}c_{22})^2\notag\\ &=c_{11}^2c_{22}^2+c_{21}^2c_{12}^2-2(c_{11}c_{22})(c_{12}c_{21})\notag\\ &=(c_{11}c_{22}-c_{12}c_{21})^2\ge0\notag. \end{align} The eigenvalues of $K$ are $\alpha\pm\beta$ and under the assumption $\alpha\ge\beta$, we are sure that this matrix is positive semidefinite. Using Lemma \ref{kroneig}, we can say that: \begin{align} \mathbf{v}^T(K\otimes I)\mathbf{v}&\in[\alpha-\beta,\alpha+\beta],\notag\\ \mathbf{v}^T(F\otimes\rho I)\mathbf{v} &\in[\rho\lambda_F,\rho\Lambda_F],\notag\\ \mathbf{v}^T(F\otimes A^TA)\mathbf{v}&\in[0,\Lambda_F\sigma_\text{max}^2(A)].\notag \end{align} Therefore \begin{equation}\label{lambdaboundupper} \lambda\le\frac{\sigma_\text{max}^2(A)\Lambda_F+\alpha+\beta+\mathbf{v}^T(G^{-1}S)\mathbf{v}}{\rho \lambda_F+\alpha-\beta+\mathbf{v}^T(G^{-1}S)\mathbf{v}},\end{equation} \begin{equation}\label{lambdaboundlower} \lambda\ge\frac{\alpha-\beta+\mathbf{v}^T(G^{-1}S)\mathbf{v}}{\rho\Lambda_F+\alpha+\beta+\mathbf{v}^T(G^{-1}S)\mathbf{v}}.\end{equation} Recall the following result: if $A, B, C>0$ then \[\frac{A+C}{B+C}\ge\frac{A}{B} \Leftrightarrow B\ge A.\] It is clear that $\rho\Lambda_F+\alpha+\beta\ge\alpha-\beta$ and that $\sigma_\text{max}^2(A)\Lambda_F+\alpha+\beta\ge\rho\lambda_F+\alpha-\beta$, since $\rho$ is the mean eigenvalue of $A^TA$ while $\sigma_\text{max}^2(A)$ the maximum. Thus \[\lambda\in\Bigg[\frac{\alpha-\beta}{\rho\Lambda_F+\alpha+\beta},\frac{\sigma_\text{max}^2(A)\Lambda_F+\alpha+\beta}{\rho\lambda_F+\alpha-\beta}\Bigg].\] \end{proof} \begin{remark} \label{remark_cg} Both these bounds do not depend on the IPM iteration. The lower bound depends only on $\alpha$, $\beta$, the coefficients $c_{ij}$ and $\rho$, which does not depend on $N$; hence the lower bound does not depend on $N$. The upper bound, instead, grows as $N$ increases, since the term $\sigma_\text{max}^2(A)$ depends on $N$. Thus, the spectral properties of the preconditioned matrix and the performance of the PCG may deteriorate as N grows. \end{remark} A similar result holds in the case $A^L\ne A^H$: \begin{lemma} The eigenvalues of the preconditioned matrix $P^{-1}M$, with $A^L\ne A^H$, satisfy \[\lambda\in\Bigg[\frac{\alpha-\beta}{\Lambda_\rho+\alpha+\beta},\frac{\sigma_\text{max}^2(A^L)\Lambda_{F_L}+\sigma_\text{max}^2(A^H)\Lambda_{F_H}+\alpha+\beta}{\lambda_\rho+\alpha-\beta}\Bigg],\] where $\lambda_\rho$, $\Lambda_\rho$, $\Lambda_{F_L}$ and $\Lambda_{F_H}$ are defined below. \end{lemma} \begin{proof} In this case, the eigenvalue satisfies {\small\[\lambda=\frac{\mathbf{v}^T(F_L\otimes(A^L)^TA^L)\mathbf{v}+\mathbf{v}^T(F_H\otimes(A^H)^TA^H)\mathbf{v}+\mathbf{v}^T(K\otimes I)\mathbf{v}+\mathbf{v}^T(G^{-1}S)\mathbf{v}}{\mathbf{v}^T((\rho_L F_L+\rho_H F_H)\otimes I)\mathbf{v}+\mathbf{v}^T(K\otimes I)\mathbf{v}+\mathbf{v}^T(G^{-1}S)\mathbf{v}},\]} where \[F_L=\begin{bmatrix} c_{11}^2 & c_{11}c_{12}\\c_{11}c_{12} & c_{12}^2\end{bmatrix},\quad F_H=\begin{bmatrix} c_{21}^2 & c_{21}c_{22}\\c_{21}c_{22} & c_{22}^2\end{bmatrix}.\] As before, fix $\|\mathbf{v}\|=1$; we can say that \begin{align} \mathbf{v}^T(F_L\otimes(A^L)^TA^L)\mathbf{v}&\in[0,\Lambda_{F_L}\sigma_\text{max}^2(A^L)],\notag\\ \mathbf{v}^T(F_H\otimes(A^H)^TA^H)\mathbf{v}&\in[0,\Lambda_{F_H}\sigma_\text{max}^2(A^H)],\notag\\ \mathbf{v}^T((\rho_L F_L+\rho_H F_H)\otimes I)\mathbf{v}&\in[\lambda_\rho,\Lambda_\rho]\notag,\end{align} where we have defined \[\lambda_\rho=\lambda_\text{min}(\rho_L F_L+\rho_H F_H),\quad\Lambda_\rho=\lambda_\text{max}(\rho_L F_L+\rho_H F_H).\] Therefore \[\lambda\le\frac{\sigma_\text{max}^2(A^L)\Lambda_{F_L}+\sigma_\text{max}^2(A^H)\Lambda_{F_H}+\alpha+\beta+\mathbf{v}^T(G^{-1}S)\mathbf{v}}{\lambda_\rho+\alpha-\beta+\mathbf{v}^T(G^{-1}S)\mathbf{v}},\] \[\lambda\ge\frac{\alpha-\beta+\mathbf{v}^T(G^{-1}S)\mathbf{v}}{\Lambda_\rho+\alpha+\beta+\mathbf{v}^T(G^{-1}S)\mathbf{v}}.\] In the same way as before, the final bound becomes \[\lambda\in\Bigg[\frac{\alpha-\beta}{\Lambda_\rho+\alpha+\beta},\frac{\sigma_\text{max}^2(A^L)\Lambda_{F_L}+\sigma_\text{max}^2(A^H)\Lambda_{F_H}+\alpha+\beta}{\lambda_\rho+\alpha-\beta}\Bigg].\] \end{proof} \section{The comparison method: Joint Total Variation (JTV)}\label{sec:JTV} We have chosen Joint Total Variation (JTV) as a benchmark method for our new Inner Product (IP) regularization method. JTV is a multi-channel joint reconstruction approach where all the unknown images are reconstructed simultaneously by solving one combined inverse problem. Basic (non-joint) TV as a regularizer favors piecewise constant images where the boundary curves separating different constant areas are as short as possible. JTV also promotes piecewise-constantness in each image channel, but additionally {\it requiring that the jump curves in all channels coincide.} There are many slightly different formulations of the JTV functional in the literature; see \cite{yang2009fast,blomgren1998color,ehrhardt2020multi,chung2010numerical,danad2015new}. Total Generalized Variation (TGV) has been used for multi-channel electron microscopy tomography in \cite{huber2019total}. Let us explain the JTV model used here. Let $\mathbf{f}^{\,\square}$ be a $N\times N$ matrix, and denote its vertical vector form by $\mathbf{f}\in\mathbb{R}^{N^2}$. Define two $N^2{\times}N^2$ matrices: $L_H$ implementing horizontal differences and $L_V$ vertical differences. The matrix $L_H$ is determined by the formula \begin{eqnarray} (L_H\mathbf{f})_{\ell} &=& \mathbf{f}^{\,\square}_{k,m+1}-\mathbf{f}^{\,\square}_{k,m},\qquad 1\leq \ell \leq N^2, \end{eqnarray} where the row index $k$ and column index $m$ are defined as follows. We write the integer $\ell-1$ in the form $$ \ell-1 = (m-1)N + (k-1), $$ where $0\leq (m-1) < N$ is the quotient and $0\leq (k-1) <N$ is the remainder. Also, we use the convention that $\mathbf{f}^{\,\square}_{k,N+1}=0$ for all $1\leq k\leq N$. The matrix $L_V$ is determined similarly by the formula \begin{eqnarray} (L_V\mathbf{f})_{\ell} &=& \mathbf{f}^{\,\square}_{k+1,m}-\mathbf{f}^{\,\square}_{k,m} \end{eqnarray} with the convention that $\mathbf{f}^{\,\square}_{N+1,m}=0$ for all $1\leq m\leq N$. We use JTV for vectors of the form $$ \mathbf{g} = \left[\!\!\begin{array}{l}\mathbf{g}^{(1)}\\\mathbf{g}^{(2)}\end{array}\!\!\right], $$ including a non-negativity constraint: \begin{equation} \widetilde{\mathbf{g}}_{\gamma} = \mathop{\mbox{arg\,min}}_{\mathbf{g}^{(j)}\geq 0} \left\{\|\mathbf{m}-\mathcal{A} \mathbf{g}\|_2^2 + \gamma\mathcal{R}(\mathbf{g}) \right\}, \end{equation} where $\gamma>0$ is the regularization parameter. The discrete JTV regularizer is \begin{eqnarray}\label{discreteJTV} \mathcal{R}(\mathbf{g}) &=& \sum_{\ell=1}^{N^2}\left( \left|(L_H\mathbf{g}^{(1)})_{\ell}\right|+ \left|(L_V\mathbf{g}^{(1)})_{\ell}\right|+ \left|(L_H\mathbf{g}^{(2)})_{\ell}\right|+ \left|(L_V\mathbf{g}^{(2)})_{\ell}\right|\right). \end{eqnarray} In practice we deploy the classical trick of replacing the absolute values in (\ref{discreteJTV}) with a rounded approximate absolute value function $|x|_\kappa =\sqrt{x^2+\kappa}$ with a small parameter $\kappa>0$. This makes the objective functional smooth, allowing straightforward gradient-based minimization. \section{Materials and methods} \label{sec:methods} We need to find a way to assess the quality of our new method described in the introduction \eqref{variational_cont}. In the spirit of applied inverse problems, we try to evaluate how well the end-users of the algorithm are getting what they want. The main goal is to recover the location of the two different materials in the target, assuming that the materials do not mix. We compare the outcome of our method with the corresponding results from JTV approach to find out if we have reached any improvement. The new IP method approaches the problem by explicitly representing the two materials as two separate images $\mathbf{g}^{(1)}$ and $\mathbf{g}^{(2)}$ in (\ref{unifiedsystem}), taking into account the energy-dependence of the attenuation coefficients of the materials. The regularized reconstruction determined by (\ref{variational_cont}) gives correspondingly two material images $$ \widetilde{\mathbf{g}}_{\alpha,\beta} = \left[\!\!\begin{array}{l}\widetilde{\mathbf{g}}^{(1)}_{\alpha,\beta}\\\\ \widetilde{\mathbf{g}}^{(2)}_{\alpha,\beta}\end{array}\!\!\right]. $$ For a known test target we can then check how well the images $\widetilde{\mathbf{g}}^{(1)}_{\alpha,\beta}$ and $ \widetilde{\mathbf{g}}^{(2)}_{\alpha,\beta}$ match the true locations of the materials. JTV gives us correspondingly two separate material images, which makes comparison straightforward. We will approximate the quality of our reconstruction method with classical error measures and with pixel error measure, which describes the separation of the materials. We calculate the classical $L_2$-error: $$ L_2\text{-error} = \frac{\text{norm}(\text{phantom}(:)-\text{reconstruction}(:))}{\text{norm(phantom(:))}}, $$ the structural similarity index (SSIM) \cite{wang2004image} and Haar wavelet-based perceptual similarity index (HaarPSI) \cite{reisenhofer2018haar} for both approaches, (JTV and IP) and for both of the materials separately. We calculate these quality measures by comparing the original phantoms with the resulting reconstructions. Same hold for calculating the pixel error. The error calculation protocol needs the following two phases: \begin{itemize} \item[Phase 1.] {\bf Choice of optimal regularization parameters.} To allow for a fair comparison between JTV and IP, we need an objective methodology for choosing the regularization parameters. For JTV we look for $\alpha>0$ for which the geometric mean of the relative $L_2$ -errors of the two material images, $E_{\mbox{mean}} = \sqrt{E_1 E_2}$, attains its minimum. For IP method we let $\alpha>0$ vary and take $\beta = 0.8\cdot\alpha$. Then we find the $\alpha$ that minimizes $E_{\mbox{mean}}$. \item[Phase 2.] {\bf Material characterization error.} The final quality measure for both methods is how well they identify the correct material in each pixel. We assume that we know {\it a priori} the relative amount of each of the two materials. In other words, we know how many pixels should have value one in a material image; the rest of the pixels must be zero. We segment the reconstruction images of both JTV and IP methods by choosing the threshold that yields a binary image with the correct (or most correct) number of pixels with value one. For example, with HY phantom we have two separate material images, containing only black or white pixels. We use resolution 128$\cdot$128 and can calculate the relative amount of white pixels in the material image 1: $$ \text{white pixels} = \frac{\text{nnz}(\text{material 1})}{N\cdot N}, $$ where nnz-function calculates the number of non-zero pixels. Now when we know the proportion of white pixels, we can define a value of a threshold (tr) so that it sets correct amount of white pixels: $$ \text{Segmented material 1}(\text{reconstruction 1} > tr) = 1; \label{eq:segmentation1} $$ and a correct amount of black pixels: $$ \text{Segmented material 1}(\text{reconstruction 1} < tr) = 0; $$ \label{eq:segmentation2} in our segmented material image. \end{itemize} \subsection{Computational parameters in the measurement model} There were several common settings which we used in the numerical simulations implemented with inner product (IP) method and joint total variation (JTV) method. The size of reconstructed images was fixed to be 128x128 pixels in both methods. This quite small resolution was selected for practical reasons: to save memory space and computation time. It was important to avoid the inverse crime in the computations, so we added noise and modelling error to the simulations. The relative noise level in both simulations was 0.01. It was added to the measured sinogram by calculating \texttt{noiselevel*max(abs(m(:)))*randn(size(m))}, where m was the simulated sinogram. Besides adding random noise, we avoided the inverse crime by rotating the object 45 degrees, so that the orientation of X-rays changes and interpolation causes small (about 1-2\%) modelling error. The number of angles in tomographic simulations was chosen to be sparse. Measurement angles were selected between 0 and 180 degrees with constant intervals. (Measurement geometry A, See Figure \ref{fig:arrangement} as an example of imaging geometry). We used parallel-beam geometry and 65 angles for tomographic projections in all of the measurements. Attenuation coefficients for high and low energies where selected from NIST-database to simulate the materials of PVC (polyvinyl chloride) and iodine when imaged with 30 kV or 50 kV. Selected values are c11: 1.491 (PVC low energy), c12: 8.561 (Iodine low energy), c21: 0.456 (PVC high energy), c22: 12.32 (Iodine high energy). See table \ref{tab:att_coeff} for clarity. \begin{table}[H] \centering \begin{tabular}{c|c|c} Attenuation coefficient & Simulated material & Tube voltage\\ \hline 1.491 & PVC & 30 kV\\ 8.561 & Iodine & 30 kV\\ 0.456 & PVC & 50 kV\\ 12.32 & Iodine & 50 kV\\ \end{tabular} \caption{Attenuation coefficients selected for simulating the two different materials with low and high tube energies.} \label{tab:att_coeff} \end{table} \subsection{Phantoms} We used four different phantoms in all our simulations. First phantom has letters "H" and "Y" in it. This HY phantom represents a piece of plastic, where the letters have been hollowed out, and the holes are filled with iodine. Second "Bone" phantom is an image of a cross section of a bone with bone marrow. Third phantom is a pattern resembling an ancient Egyptian document written in hieroglyph and named as "Egypt" phantom and the last one "Circuit" is an image of an electric circuit. These four different phantoms pose various challenges to our reconstruction algorithms. We start with a fairly simple HY phantom and gradually add details to raise the standard, so that with the last Circuit phantom we have already many small structures, which are difficult for the algorithms to catch, especially now when data is sparsely collected. For clarity, we show in larger images the results of the more detailed phantoms (Egypt and Circuit). \begin{figure}[H] \centering \hspace{0.5cm} \textbf{HY}\hspace{1.7cm} \textbf{Bone}\hspace{1.9cm} \textbf{Egypt}\hspace{1.9cm} \textbf{Circuit}\hspace{0.3cm} \includegraphics[width=12cm]{phantoms_2.png} \caption{Original phantoms. The four different phantoms which we used in our simulations are shown here in the resolution we actually used. First row shows material one (PVC in these simulations) and second row shows material 2 (iodine in these simulations). These images show the perfect separation of the materials into their own images, so they serve us as a ground truth, where the results of the other methods can be compared.} \label{fig:phantoms} \end{figure} \section{Results} \label{sec:results} In this section we show first reconstruction results and material decomposition results for our IP method and for standard JTV approach for comparison. We estimate the quality of reconstructions with classical error measures and with material characterization error (misclassified pixels) as described in Section \ref{sec:methods}. We have collected these numerical measures in Table \ref{tab:error_table}. We show also numerical results for assessing the quality of the preconditioner of the IPM method. \subsection{Reconstruction results of the IP method} In IP method we apply Tikhonov regularization and use the inner product $(g^{(1)})^T g^os$ We have two regularization parameters $\alpha$ and $\beta$ in this method. The regularization parameter $\alpha$ is chosen by minimizing the mean L2 error in the resulting reconstructions. Parameter $\beta$ adjusts the new regularization term and controls the point-wise separation of the two materials. We fixed $\beta = 0.8\cdot\alpha$ in these simulations. It is important that we always have $\alpha > \beta$. Such a choice prevents from the problem getting non-convex, which could lead to lengthy computations and an instability of the solution. The stopping criterion for the method is to check the normalized dual residual and the complementarity (duality) gap, see \eqref{IPMstop}. In all our computations the tolerance was set to 1e-8. The reconstructions made with IP method for four different phantoms (HY, Bone, Egypt and Circuit), are always in the second column in the following result images \ref{fig:Hy_recos}, \ref{fig:Bone_recos}, \ref{fig:reconstruction_results_Egypt}, \ref{fig:reconstruction_results_Circuit}. In the first column we have JTV reconstructions for comparison and in the right most column the ground truth. All resulting images have been scaled so that they are in the same scale and thus comparable. \begin{figure}[!ht] \centering \begin{subfigure}{0.45\linewidth} \hspace{0.2cm} \textbf{JTV}\hspace{0.8cm} \textbf{IP}\hspace{0.3cm} \textbf{\scriptsize Ground\hspace{0.1cm}truth}\hspace{5cm} \includegraphics[width=\linewidth]{results_HY.png} \caption{HY} \label{fig:Hy_recos} \end{subfigure} \hfil \begin{subfigure}{0.45\linewidth} \hspace{0.2cm} \textbf{JTV}\hspace{0.8cm} \textbf{IP}\hspace{0.3cm} \textbf{\scriptsize Ground\hspace{0.1cm}truth}\hspace{1.9cm} \includegraphics[width=\linewidth]{results_Bone.png} \caption{Bone} \label{fig:Bone_recos} \end{subfigure} \caption{Reconstruction results with JTV and IP regularizations for HY and Bone phantoms. The first row represents material 1 and the second row represents material 2. First column shows JTV reconstructions, second column shows IP-method reconstructions and third column is the ground truth.} \label{fig:HY_and_bone_recos} \end{figure} \begin{figure}[H] \centering \hspace{0.4cm} \textbf{JTV}\hspace{2.5cm} \textbf{IP}\hspace{1.5cm} \textbf{Ground truth}\hspace{1.9cm} \includegraphics[width=12cm]{results_Egypt.png} \caption{Reconstruction results with JTV and IP regularizations for Egypt phantom. The first row represents material 1 and the second row represents material 2. First column shows JTV reconstructions, second column shows IP reconstructions and third column is the ground truth.} \label{fig:reconstruction_results_Egypt} \end{figure} \begin{figure}[H] \centering \hspace{0.4cm} \textbf{JTV}\hspace{2.5cm} \textbf{IP}\hspace{1.5cm} \textbf{Ground truth}\hspace{1.9cm} \includegraphics[width=12cm]{results_Circuit.png} \caption{Reconstruction results with JTV and IP regularizations for electric circuit phantom. The first row represents material 1 and the second row represents material 2. First column shows JTV reconstructions, second column shows IP reconstructions and third column is the ground truth.} \label{fig:reconstruction_results_Circuit} \end{figure} \subsection{Reconstruction results with JTV} In JTV we use standard Tikhonov regularization for the two image system. Hence we have only one adjustable regularization parameter, $\gamma$. Parameter $\gamma$ was chosen so that it minimizes the mean L2 error in the resulting reconstructions and the value we selected for all cases was $\gamma = 0.001$. The stopping criterion for iterations in JTV was the point where no more progress was made. For all our examples the criterion was achieved in 400 iterations. The reconstructions made with JTV method for four different phantoms (HY, Bone, Egypt and Circuit) are always in the first column in the reconstruction result images \ref{fig:Hy_recos}, \ref{fig:Bone_recos}, \ref{fig:reconstruction_results_Egypt}, \ref{fig:reconstruction_results_Circuit}. The second column shows IP method reconstructions and the rightmost column shows the actual ground truth. \begin{table}[H] \caption{Error calculations for the four phantoms, including the JTV and IP regularizers. Regularization parameters have been adjusted manually to achieve the minimal L2 error. Note that for L2 and {\it misclassifications} a smaller number means better quality, whereas for SSIM and HPSI a greater number means better quality. For JTV we used $\gamma=0.001$. For IP we used $\alpha=150$ and $\beta=120$. For each of the phantoms and fixed quality measure, we have underlined the better result of the two.} \label{tab:error_table} \centering \begin{tabular}{ccccccc} Phantom & Method & \phantom{mm}L2\phantom{mm} & SSIM & HPSI & misclassif.\\ \hline \\ HY 1 & JTV & 0.30 & 0.23 & 0.21 & 0.05 \\%& 200 HY 1 & IP & \underline{0.27} & \underline{0.29} & \underline{0.28} & \underline{0.02} \\%& 19/6098 \\ HY 2 & JTV & \underline{0.27} & \underline{0.75} & \underline{0.56} & 0.01\\% & 200 HY 2 & IP & 0.28 & 0.60 & 0.53 &0.01 \\%& 19/6098 \hline \\ Bone 1 & JTV & 0.55 & 0.24 & 0.15 & 0.14 \\%& 400 Bone 1 & IP & \underline{0.44} & \underline{0.41} & \underline{0.36} & \underline{0.06} \\%& 22/9314 \\ Bone 2 & JTV & 0.32 & 0.66 & 0.50 & 0.04 \\%& 400 Bone 2 & IP & \underline{0.29} & \underline{0.71} & 0.50 & \underline{0.03} \\%& 22/9314 \hline \\ Egypt 1 & JTV & 0.40 & 0.25 & \underline{0.30} & 0.13\\% & 400 Egypt 1 & IP & \underline{0.38} & \underline{0.33} & 0.29 & \underline{0.08}\\% & 18/7317\\ \\ Egypt 2 & JTV & 0.62 & 0.69 & 0.56 & 0.06\\% & 400 Egypt 2 & IP & \underline{0.61} & 0.69 & 0.56 & 0.06\\% & 18/7317\\ \hline \\ Circuit 1 & JTV & 0.62 & 0.17 & \underline{0.30} & 0.28\\% & 400\\ Circuit 1 & IP & \underline{0.56} & \underline{0.32} & 0.28 & \underline{0.18}\\% &21/9120 \\ \\ Circuit 2 & JTV & 0.59 & 0.59 & 0.50 & 0.16\\% & 400\\ Circuit 2 & IP & 0.59 & \underline{0.62} & 0.50 & 0.16\\% & 21/9120\\ \end{tabular} \end{table} \subsection{Material decomposition results} The final quality measure for IP and JTV methods is how well they manage to identify the correct material in each pixel in the reconstructions. Because we work with simulations, we can calculate how many pixels we should have representing material 1 and material 2. With this {\it a priori} knowledge we can adjust the threshold so that it produces the correct number of pixels representing each material. The actual ratio of misclassified pixels (divided by the number of all pixels in the image) is listed in the rightmost column of Table \ref{tab:error_table}. We have underlined the better result of the two in the table to make it easier to compare the outcome of the methods. We show the results of the thresholding also in the following colored segmentation images. Material 1 is represented with yellow color and material 2 with blue color. We hope this makes it easier to qualitatively compare how the methods performed in distinguishing the different materials from each other. We arranged the colored segmentation images as a grid, where column represents the method and row represents the outcome. The first row in the segmentation result shows both materials in the same image. The second and third row show the materials separately in their own images: Material 1 in the second row and material 2 in the third row. Columns in all images have been organized so that JTV approach is always in the first column, IP regularization is in the second column and the actual ground truth is in the rightmost column. The ground truth represents the ideal situation where the classification of the materials has succeeded perfectly. \begin{figure}[!ht] \centering \begin{subfigure}{0.45\linewidth} \hspace{0.2cm} \textbf{JTV}\hspace{0.8cm} \textbf{IP}\hspace{0.3cm} \textbf{\scriptsize Ground\hspace{0.1cm}truth}\hspace{5cm} \includegraphics[width=\linewidth]{segmentation_results_HY.png} \caption{HY} \label{fig:seg_results} \end{subfigure} \hfil \begin{subfigure}{0.45\linewidth} \hspace{0.2cm} \textbf{JTV}\hspace{0.8cm} \textbf{IP}\hspace{0.3cm} \textbf{Ground truth}\hspace{1.9cm} \includegraphics[width=\linewidth]{segmentation_results_Bone.png} \caption{Bone} \label{fig:Bone_segmentations} \end{subfigure} \caption{Segmentation results for HY and bone phantoms. The first row shows both materials of the phantom together, the second row shows only material 1 and the third row shows only material 2. The first column shows JTV segmentations, the second column shows IP segmentations and the third column is the ground truth.} \label{fig:HY_and_bone_segmentations} \end{figure} \begin{figure} \centering \hspace{0.4cm} \textbf{JTV}\hspace{2.5cm} \textbf{IP}\hspace{1.5cm} \textbf{Ground truth}\hspace{1.9cm} \includegraphics[width=10cm]{segmentation_results_Egyptian.png} \caption{Segmentation results for Egypt phantom. The first row shows both materials of the phantom together, the second row shows only material 1 and the third row shows only material 2. The first column shows JTV segmentations, the second column shows IP segmentations and the third column is the ground truth.} \label{fig:segmentation_results_Egypt} \end{figure} \begin{figure} \centering \hspace{0.4cm} \textbf{JTV}\hspace{2.5cm} \textbf{IP}\hspace{1.5cm} \textbf{Ground truth}\hspace{1.9cm} \includegraphics[width=10cm]{segmentation_results_Circuit.png} \caption{Segmentation results for Circuit phantom. The first row shows both materials of the phantom together, the second row shows only material 1 and the third row shows only material 2. The first column shows JTV segmentations, the second column shows IP segmentations and the third column is the ground truth.} \label{fig:segmentation_results_Circuit} \end{figure} \subsection{Numerical effect of preconditioning} In this section we present the results which provide an insight into the behaviour of optimization technique employed to solve the IP segmentation problem (\ref{variational_Tikhonov}). We briefly discuss the performance of interior point method applied to solve the underlying convex quadratic programming problem and focus on illustrating the behaviour of the preconditioned conjugate gradient algorithm applied to normal equations (\ref{normalequations}) arising in IPM. We start by showing in Figure~\ref{spectrumiteration} the eigenvalues of the normal equations, with and without preconditioner (\ref{blockdiagprec}), for the problem with $N=32$. It is clear that the spectrum of the preconditioned matrix is bounded independently of the IPM iteration, which is what we were expecting according to Lemma~\ref{lemma_bound}. \begin{figure}[H] \caption{Eigenvalues of the normal equations with and without preconditioner for $N=32$, $\alpha=500$, $\beta=250$} \label{spectrumiteration} \centering \includegraphics[width=.9\textwidth]{eigiteration3} \end{figure} Next, we show in Table~\ref{ipm_results} the results in terms of IPM iterations, PCG iterations and computational time, for various values of N. The IPM tolerance in~\eqref{IPMstop} is set to $10^{-8}$; we employed 3 centrality correctors with a symmetric neighbourhood~\eqref{neighbourhood} with parameter $\gamma=0.2$. The default PCG tolerance is $10^{-6}$, but we also employ an early termination strategy, based on the estimate of the IPM convergence indicators throughout the CG iterations (see \cite{cg_termination} for more details). \begin{table}[H] \caption{Results with $\alpha=500$, $\beta=250$.} \label{ipm_results} \centering \begin{tabular}{rr|rrr} \toprule $N$ & Dimension & IPM iter & PCG iter & Time (s) \\ \midrule 32 & 2,048 & 19 & 1,038 & 2.25\\ 64 & 8,192 & 24 & 1,484 & 7.90\\ 128 & 32,768 & 25 & 1,986 & 32.69\\ 256 & 131,072 & 28 & 2,678 & 157.79\\ 512 & 524,288 & 34 & 3,772 & 881.90\\ \bottomrule \end{tabular} \end{table} As we were expecting from Remark~\ref{remark_cg}, we can see that the number of CG iterations per IPM iteration grows slowly as N increases. However, such behaviour is acceptable, and the computational time in the case of $N=512$ is still reasonable. \subsubsection{Effect of the regularization} We also show some results that underline the effect of the newly added penalty term~\eqref{materialsep_penalty}. We expect from this regularizer to create a separation in the vectors $\mathbf{g}^{(1)}$ and $\mathbf{g}^{(2)}$, i.e.\ we expect the scalar product $\mathbf{g}^{(1),T}\mathbf{g}^{(2)}$ to be pushed close to zero. We performed some tests with different values of $\beta$ and a fixed value $\alpha=500$, in the case $N=64$. Table \ref{betaeffect} shows the number of elements of the component-wise products of $\mathbf{g}^{(1)}$ and $\mathbf{g}^{(2)}$ that are smaller than $10^{-6}$, and the average value of the same product, i.e.\ $(\mathbf{g}^{(1),T}\mathbf{g}^{(2)})/N^2$. We can see that as $\beta$ is increased, the number of small elements grows and the average product decreases, confirming the effect that we expected. \begin{table}[H] \caption{Number of small elements and average product of $\mathbf{g}^{(1)}$ and $\mathbf{g}^{(2)}$ for different values of $\beta$; $\alpha=500$, $N=64$.} \label{betaeffect} \centering \begin{tabular}{rcc} \toprule $\beta$ & small elements & $(\mathbf{g}^{(1),T}\mathbf{g}^{(2)})/N^2$\\ \midrule 50 & 1056 & 4.86E3\\ 100 & 1091 & 4.07E3\\ 150 & 1123 & 3.17E3\\ 200 & 1161 & 2.36E3\\ 250 & 1607 & 1.54E3\\ 300 & 2075 & 1.23E3\\ 350 & 2210 & 1.07E3\\ 400 & 2412 & 0.93E3\\ 450 & 2581 & 0.83E3\\ \bottomrule \end{tabular} \end{table} Figure \ref{g1g2product} shows the elements of the component-wise products of $\mathbf{g}^{(1)}$ and $\mathbf{g}^{(2)}$, sorted according to their magnitude, in the case $\beta=50$ and $\beta=450$. The number of small elements is substantially larger in the latter case, confirming what we expected. \begin{figure}[H] \caption{Magnitude of the elements of the component-wise products of $\mathbf{g}^{(1)}$ and $\mathbf{g}^{(2)}$.} \label{g1g2product} \centering \includegraphics[width=.7\textwidth]{betareg} \end{figure} \section{Discussion}\label{sec:discussion} When we compare the color segmentation results achieved with the two approaches JTV and IP, we can easily see that IP delivers a segmentation with fewer misclassified pixels. Hence IP method produces more accurate separation of the materials. The actual ratio of misclassified pixels compared to all pixels is listed in Table \ref{tab:error_table}. This numerical evidence suggests that IP is consistently better in pixel misclassification quality measure which is a crucial quality indicator for the application we have in mind. IP is also a frequent winner (although less consistent) for the remaining quality measures. To be precise, JTV is better than IP only in 1 case out of 8 on L2 measure, only in 1 case out of 8 on SSIM and in 3 cases out of 8 on HPSI. Furthermore, it seems that JTV always produces visibly worse reconstruction of Material 1 image than that of Material 2. This could probably be alleviated by a different weighting of the gradient components. However, in the comparisons in this paper we used both methods in their basic forms, as both can undoubtedly be improved by tweaking various parameters. One such tweak would be a smarter thresholding, taking into account both material reconstructions and the piece of {\it a priori} knowledge that each pixel contains exactly one type of material. The natural next step is to test the new method with two-dimensional X-ray images recorded of a three-dimensional object, using voxels instead of pixels for computational discretization. \bibliographystyle{plain}
\section{Introduction} The efficient and fast generation of body-fitted meshes for complex geometries remains one of the most time-consuming preprocessing steps in numerical simulations involving finite volume (FV) and discontinuous Galerkin (DG) schemes. As a result, the usage of Cartesian embedded boundary meshes becomes more and more popular. Out of the different existing variants, we use the following approach: We simply cut the geometry out of an underlying Cartesian mesh, resulting in so called \textit{cut cells} along the boundary of the object. Cut cells are typically irregular and can become arbitrarily small. This causes various problems. In the context of solving hyperbolic conservation laws on cut cell meshes, for which one typically uses \textit{explicit} time stepping schemes, the most severe problem is the so called \textit{small cell problem}: choosing the time step based on the size of the larger background cells results in stability problems on small cut cells and their neighbors. Therefore, special methods must be developed. The focus of this contribution is on addressing this problem. For more information on the small cell problem we refer to \cite{BERGER2017,FVCA_May}. The supposedly easiest approach to overcoming the small cell problem is \textit{cell merging} or \textit{cell agglomeration} \cite{Krivodonova2013, Kummer2016,Quirk1994}: one simply merges cut cells that are too small with bigger neighbors. This approach is very intuitive but very difficult to do in three dimensions in a robust way and puts all the complexity back into the mesh generation process. The alternative is to develop algorithmic solutions to the small cell problem. In the context of FV schemes, two well established approaches are the \textit{flux redistribution} method \cite{Chern_Colella,Colella2006} and the \textit{h-box} method \cite{Berger_Helzel_2012,Berger_Helzel_Leveque_2002}. More recent approaches include a \textit{dimensionally split} flux stabilization \cite{Klein_cutcell_3d,Klein_cutcell}, the \textit{mixed explicit implicit} scheme \cite{May_Berger_explimpl}, the extension of the \textit{active flux} method to cut cells \cite{FVCA_Helzel_Kerkmann}, and the \textit{state redistribution} method \cite{Berger_Giuliani_2021}. In the context of DG schemes there exists only very little work addressing the small cell problem. While there are many different approaches for stabilizing discretizations for elliptic and parabolic problems on cut cell meshes (for an overview see, e.g., \cite{OverviewUCLWorkshop}) the research for hyperbolic problems is still at the beginning but with a lot of current activity. Some very recent work \cite{Massing2018,Kreiss_Fu,Sticko_Kreiss} is based on applying the ghost penalty stabilization \cite{Burman2010}, which is a well-known approach for elliptic equations, to hyperbolic problems. Out of these contributions, only Fu and Kreiss \cite{Kreiss_Fu} address the small cell problem for first-order hyperbolic problems by developing a stabilization for the solution of scalar conservation laws in one dimension. A different approach to overcoming the small cell problem was taken by Giuliani \cite{Giuliani_DG} who extends the state redistribution scheme to the DG setting. This approach seems to work well in practice but it is challenging to verify theoretical properties. In \cite{DoD_SIAM_2020}, we introduced together with Engwer and N\"u{\ss}ing the \textit{Domain of Dependence} (DoD) stabilization. To the best of our knowledge, this is the first contribution to overcoming the small cell problem in a DG setting in a monotone way. The DoD stabilization introduces penalty terms that shift mass between small cut cells and their neighbors in a physical way: within one time step, mass is transported from the \textit{inflow} neighbors of small cut cells \textit{through} the cut cells to their \textit{outflow} neighbors. This way we restore the proper domain of dependence of the outflow neighbors and create a stable update on small cut cells for standard explicit time stepping. The work in \cite{DoD_SIAM_2020} treats the case of linear advection for piecewise linear polynomials. In this contribution we take the next step and extend the stabilization to higher order polynomials and to non-linear systems of hyperbolic conservation laws in one dimension, in particular to the compressible Euler equations. For the extension to higher order polynomials we observed that it is not sufficient to penalize derivatives only on small cut cells. We therefore added terms to control derivatives on their neighbors as well. For the extension to non-linear systems, the main challenge consisted in accounting for the various flow directions. For scalar conservation laws, our extended formulation has the following theoretical properties: for piecewise constant polynomials in space combined with explicit Euler in time, the resulting scheme is monotone, independent of the size of the small cut cell; thus, this result transfers from the linear to the non-linear case. For the semi-discrete setting, there holds $L^2$ stability for arbitrary polynomial degrees $p$ as a result of also controlling derivatives on cut cells' neighbors. Our numerical results for scalar equations and systems show convergence rates of $p+1$ for polynomials of degree $p$ for smooth solutions and robust behavior for problems involving shocks. The paper is structured as follows: we will first provide in section \ref{sec: setting} the general setting, which includes the cut cell model problem and the unstabilized DG discretization. In section \ref{sec: DoD stab}, we will present the DoD stabilization for non-linear problems and higher order polynomials. We will also give a short comparison between the new formulation and the formulation in \cite{DoD_SIAM_2020} for the case of the advection equation. Section \ref{sec: theoretical results} contains theoretical results for scalar conservation laws, like the monotonicity property and the $L^2$ stability result for the semi-discrete formulation. Finally, in section \ref{sec: numerical results} we will present numerical results for scalar equations and systems of conservation laws to support our theoretical findings. We will conclude with an outlook in section \ref{sec: outlook}. \section{Setting}\label{sec: setting} We consider time-dependent systems of hyperbolic conservation laws in one space dimension of the form \begin{equation}\label{eq: conservation law} \mathbf{u}_t+ \mathbf{f}(\mathbf{u})_x = \mathbf{0}\quad \text{ in } \Omega \times (0,T) \end{equation} with initial data $\mathbf{u}_0=\mathbf{u}(\cdot,0)$. The spatial domain is given by $\Omega = (x_L,x_R)$ with $x_L,x_R \in \mathbb{R}, x_L < x_R$, and the final time is given by $T\in \mathbb{R_+}$. Further, $\mathbf{u} : \Omega\times(0,T) \rightarrow \mathbb{R}^m$, $m \in \mathbb{N}$, is the vector of conserved variables and $\mathbf{f}:\mathbb{R}^m\rightarrow\mathbb{R}^m$ is the flux function. We assume the system to be hyperbolic, i.e., that the Jacobian $\mathbf{f}_{\mathbf{u}}(\mathbf{u})$ is diagonalizable with real eigenvalues for each physically relevant value $\mathbf{u} \in \mathbb{R}^m$, compare LeVeque \cite{Leveque02}. In particular, we will consider the compressible Euler equations, which satisfy \eqref{eq: conservation law} with \begin{equation}\label{eq: Euler equations} \mathbf{u} = \begin{pmatrix} \rho \\ \rho v \\ E \end{pmatrix} \quad \text{and} \quad \mathbf{f}(\mathbf{u}) = \begin{pmatrix} \rho v \\ \rho v^2 + p \\ (E + p)v \end{pmatrix}. \end{equation} Here, $\rho$ denotes the density, $v$ the velocity, $p$ the pressure, and $E$ the energy. The system is completed by the equation of state \begin{equation*} E = \frac{p}{\gamma-1} + \frac 1 2 \rho v^2. \end{equation*} We will set $\gamma=1.4$ in our numerical tests. We will also consider linear systems given by \begin{equation}\label{eq: lin system} \mathbf{u} + \mathbf{A} \mathbf{u}_x = \mathbf{0}, \end{equation} with the matrix $\mathbf{A} \in \mathbb{R}^m \times \mathbb{R}^m$ being diagonalizable with real eigenvalues. For the theoretical results, we will focus on scalar conservation laws \begin{equation}\label{eq: scalar cons law} u_t + f(u)_x = 0. \end{equation} Important representatives include the linear advection equation given by \begin{equation}\label{eq: lin adv} u_t + \beta u_x = 0, \quad \beta > 0 \text{ constant,} \end{equation} and Burgers equation given by \begin{equation*} u_t + f(u)_x = 0, \quad f(u) = \frac 1 2 u^2. \end{equation*} \subsection{The cut cell model problem}\label{sec: model problem} To examine the behavior of solving \eqref{eq: conservation law} on a cut cell mesh, we create a model problem: We first discretize $\Omega$ in $N$ cells $I_j = (x_{j-\frac{1}{2}},x_{j+\frac{1}{2}}), j=1\ldots,N,$ of equal length $h = \frac{x_R - x_L}{N}$. Then we take one cell, the cell $I_k$, in the interior of the domain and split it into two cut cells, $I_{k_{1}}$ and $I_{k_{2}}$, of lengths $\alpha h$ and $(1-\alpha)h$ with $\alpha\in (0,\frac{1}{2}]$. This way we obtain a one dimensional cut cell mesh shown in figure \ref{fig: model problem} with $N+1$ cells, which we will refer to as $\Th$; compare also \cite{DoD_SIAM_2020}. \begin{figure}[ht] \begin{center} \begin{tikzpicture}[ axis/.style={very thick, line join=miter, ->}] \draw [very thick] (-4.8,0) -- (0,0); \draw [green!80!black,very thick] (0,0) -- (0.6,0); \draw [blue!80!green!40!white,very thick] (0.6,0) -- (2,0); \draw [axis] (2,0) -- (6.4,0) node(xline)[right] {$x$}; \draw (-4,-0.2) -- (-4,0.2); \draw (-2,-0.2) -- (-2,0.2); \draw ( 0,-0.2) -- ( 0,0.2); \draw ( 2,-0.2) -- ( 2,0.2); \draw ( 4,-0.2) -- ( 4,0.2); \draw ( 6,-0.2) -- ( 6,0.2); \draw[color=orange,densely dashed, thick] (0.6,-0.3) -- (0.6,0.3); \node[] at (-3,0.75) {$I_{k-2}$}; \node[] at (-1,0.75) {$I_{k-1}$}; \node[] at (1 ,0.75) {$I_{k}$}; \node[] at (3 ,0.75) {$I_{k+1}$}; \node[] at (5 ,0.75) {$I_{k+2}$}; \scriptsize \node[] at (.3 ,-0.25) {$I_{k_1}$}; \node[] at (1.3 ,-0.25) {$I_{k_2}$}; \node[] at ( -3,0.25) {$h$}; \node[] at ( -1,0.25) {$h$}; \node[] at (0.3,0.25) {$\alpha h$}; \node[] at (1.3,0.25) {$(1-\alpha) h$}; \node[] at ( 3,0.25) {$h$}; \node[] at ( 5,0.25) {$h$}; \node[] at (-4,-0.6) {$x_{k-\tfrac{5}{2}}$}; \node[] at (-2,-0.6) {$x_{k-\tfrac{3}{2}}$}; \node[] at ( 0,-0.6) {$x_{k-\tfrac{1}{2}}$}; \node[] at ( 2,-0.6) {$x_{k+\tfrac{1}{2}}$}; \node[] at ( 4,-0.6) {$x_{k+\tfrac{3}{2}}$}; \node[] at ( 6,-0.6) {$x_{k+\tfrac{5}{2}}$}; \node[color=orange] at (.75,-0.5) {$x_{\text{cut}}$}; \end{tikzpicture} \caption{Cut cell mesh $\Th$: equidistant mesh with cell $I_{k}$ split into two cells of lengths $\alpha h$ and $(1-\alpha) h$ with $\alpha \in (0,\frac{1}{2}]$. We denote the new edge coordinate by $x_{\text{cut}}$.} \label{fig: model problem} \end{center} \end{figure} \begin{definition} For the model problem $\mathcal{M}_h$, we define the following index sets \begin{equation} \mathcal{I}_{\text{equi}} = \{ 1 \le j \le N \lvert j \neq k \}, \: \mathcal{I}_{\text{all}} = \mathcal{I}_{\text{equi}} \cup \{ k_{1}, k_{2} \}, \: \mathcal{I}_{\mathcal{N}} = \{k-1,k_{1},k_{2} \}. \end{equation} \end{definition} Here, $\mathcal{I}_{\text{equi}}$ contains the indices of all cells of length $h$, and $\mathcal{I}_{\mathcal{N}}$ contains the indices of the small cut cell $I_{k_{1}}$ and its left and right neighbor. We will use this model problem for explaining our stabilization and for the theoretical results in section \ref{sec: theoretical results}. For the numerical results in section \ref{sec: numerical results}, we will build different test cases upon this model problem, which use many cut cell pairs. \subsection{Unstabilized RKDG scheme} We use a Runge-Kutta DG (RKDG) approach. We first discretize in space using a DG approach. Then we discretize in time using an \textit{explicit} strong stability preserving (SSP) RK scheme \cite{GottliebShu, Kraaijevanger1991}. \begin{definition}[Discrete Function Space] We define the discrete space $\mathcal{V}_h^p \subset (L^2(\Omega))^m$ by \begin{equation*} \mathcal{V}_h^p = \left\{ \mathbf{v}^h \in (L^2(\Omega))^m \ \vline \ \mathbf{v}^h_l{\vert_{I_j}} \in P^p(I_j) \right. \left. \text{for each component }l=1,\ldots,m \text{ and for all}\ j\in \mathcal{I}_{\text{all}} \right\}, \end{equation*} where $P^p$ denotes the polynomial space of degree $p$. \end{definition} As functions $\mathbf{v}^h\in \mathcal{V}_h^p$ are not well-defined on cell edges, we define jumps. \begin{definition}[Jump] Using the notation $x_{j+\frac{1}{2}}^{\pm} = \lim_{\varepsilon \to 0} x_{j+\frac{1}{2}} \pm \varepsilon$ we define the jump at an interior edge $x_{j+\frac{1}{2}}, 1\le j \le N-1,$ as \begin{equation*} \jump{\mathbf{v}^h}_{j+\frac{1}{2}} = \mathbf{v}^h(x_{\jj+\frac{1}{2}}^-) - \mathbf{v}^h(x_{\jj+\frac{1}{2}}^+). \end{equation*} Analogously, we define $\jump{\mathbf{v}^h}_{\text{cut}} = \mathbf{v}^h(x_{\text{cut}}^-) - \mathbf{v}^h(x_{\text{cut}}^+)$. At the boundary edges $x_{\frac 1 2}$ and $x_{N+\frac 1 2}$ we define \begin{equation*} \jump{\mathbf{v}^h}_{\frac 1 2} = -\mathbf{v}^h(x_{\frac 1 2}^+) \quad \text{and} \quad \jump{\mathbf{v}^h}_{N+\frac 1 2} = \mathbf{v}^h(x_{N+\frac 1 2}^-). \end{equation*} \end{definition} Our stabilization is based on extending the influence of the polynomial solutions on cells $I_{k-1}$ and $I_{k_{2}}$ into the small cut cell $I_{k_{1}}$. We therefore introduce an extension operator, compare \cite{DoD_SIAM_2020}. \begin{definition}[extension operator]\label{def: extr op} The extension operator $\mathcal{L}^{\operatorname{ext}}_j$ extends the function $\mathbf{u}^h \in \mathcal{V}_h^p$ from a cell $I_j, j\in \mathcal{I}_{\text{all}},$ to the whole domain $\Omega$: \begin{equation*} \mathcal{L}^{\operatorname{ext}}_{j}: \mathcal{V}_h^p|_{I_j} \rightarrow P^p(\Omega) \quad \text{s.t. } \mathcal{L}^{\operatorname{ext}}_{j}(\mathbf{u}^h) \in P^p(\Omega) \text{ and } \mathcal{L}^{\operatorname{ext}}_{j}(\mathbf{u}^h)|_{I_j} = \mathbf{u}^h|_{I_j}. \end{equation*} This extension is simply given by evaluating the polynomials $\mathbf{u}_l^h|_{I_j} \in P^p(I_j), l=1\ldots,m,$ outside of their original support. \end{definition} \begin{notation} In the following, we will often use the shortcut notation \begin{equation*} \mathbf{u}_j(x) = \mathcal{L}^{\operatorname{ext}}_{j}(\mathbf{u}^h)(x), \quad x \in \Omega, \end{equation*} which corresponds to evaluating the discrete polynomial function from cell $j$ at a point $x$, possibly outside of $I_j$. If necessary, we will use the subindex $l$ to denote the $l^{\text{th}}$ component. Therefore, $\mathbf{u}_{j,l}(x)$ corresponds to the $l^{\text{th}}$ component of $\mathcal{L}^{\operatorname{ext}}_{j}(\mathbf{u}^h)(x)$. Using this notation, one can equivalently express the jump as \begin{equation*} \jump{\mathbf{v}^h}_{j+\frac{1}{2}} = \mathbf{v}_j(x_{j+\frac{1}{2}}) - \mathbf{v}_{j+1}(x_{j+\frac{1}{2}}). \end{equation*} \end{notation} We now introduce the standard, unstabilized DG scheme for system \eqref{eq: conservation law}. The DoD stabilization, which will make it possible to use explicit time stepping despite the presence of the small cut cell $I_{k_{1}}$, will be introduced in section \ref{sec: DoD stab}. The semi-discrete problem for the mesh $\Th$ is given by: Find $\mathbf{u}^h \in \mathcal{V}_h^p$ such that \begin{equation}\label{eq: scheme 1d wo stab} \scpL{d_t\mathbf{u}^h(t)}{\mathbf{w}^h}+a_h\left(\mathbf{u}^h(t), \mathbf{w}^h\right)= 0\quad\forall \, \mathbf{w}^h\in \mathcal{V}_h^p, \end{equation} with \begin{multline*} a_h (\mathbf{u}^h,\mathbf{w}^h) = -\sum_{j \in \mathcal{I}_{\text{all}}} \int_{j} \mathbf{f}(\mathbf{u}^h)\cdot \partial_x \mathbf{w}^h\dd{x}\\ + \sum_{j=0}^{N} \numflux{\mathbf{u}_j}{\mathbf{u}_{j+1}}(x_{j+\frac{1}{2}})\cdot\jump{\mathbf{w}^h}_{j+\frac{1}{2}} + \numflux{\mathbf{u}_{k_{1}}}{\mathbf{u}_{k_{2}}}(x_{\text{cut}})\cdot\jump{\mathbf{w}^h}_{\text{cut}}. \end{multline*} Here, $\mathbf{a}\cdot\mathbf{b}$ denotes the standard scalar product in $\mathbb{R}^m$ given by $\mathbf{a}\cdot\mathbf{b} = \sum_{l=1}^m \mathbf{a}_l \mathbf{b}_l$ and $(\cdot,\cdot)_{L^2}$ denotes the standard scalar product in $(L^2(\Omega))^m$. Further, $\numflux{\mathbf{a}}{\mathbf{b}}(x)$ denotes the numerical flux function with arguments $\mathbf{a}(x)$ and $\mathbf{b}(x)$. Finally, we incorporate boundary conditions by suitably defining $\mathbf{u}_0(x_{\frac 1 2})$ and $\mathbf{u}_{N+1}(x_{N+\frac 1 2})$ in $\numflux{\mathbf{u}_0}{\mathbf{u}_{1}}(x_{\frac{1}{2}})$ and in $\numflux{\mathbf{u}_{N}}{\mathbf{u}_{N+1}}(x_{N+\frac{1}{2}})$, respectively. The choices of $\mathbf{u}_0(x_{\frac 1 2})$ and $\mathbf{u}_{N+1}(x_{N+\frac 1 2})$ will be discussed in section \ref{sec: numerical results}. \begin{notation} In formulae we typically refer to the $j^{\text{th}}$ cell $I_j$ by using only the letter $`j'$ for brevity, i.e., $\int_j$ corresponds to $\int_{I_j}.$ \end{notation} \section{DoD stabilization}\label{sec: DoD stab} To handle the small cell problem, we suggest an algebraic approach, which adds special stabilization terms, summarized in $J_h$, to the semi-discrete formulation \eqref{eq: scheme 1d wo stab}. The resulting DoD stabilized scheme is then given by: Find $\mathbf{u}_h \in \mathcal{V}_h^p$ such that \begin{equation}\label{eq: stab. scheme} \scpL{d_t\mathbf{u}^h(t)}{\mathbf{w}^h}+a_h(\mathbf{u}^h(t), \mathbf{w}^h) + J_h(\mathbf{u}^h(t),\mathbf{w}^h) = 0 \quad\forall\, \mathbf{w}^h\in \mathcal{V}_h^p. \end{equation} The penalty term $J_h$ is linear in the test function $\mathbf{w}^h$ and in general non-linear in the solution $\mathbf{u}^h(t)$. \subsection{General structure of the penalty term \texorpdfstring{$J_h$}{J\_h}} We only stabilize the smaller cut cell $I_{k_{1}}$ in the model mesh $\Th$. Therefore, the stabilization is given by \begin{equation*} J_h(\mathbf{u}^h,\mathbf{w}^h) = J_h^{0,k_{1}}(\mathbf{u}^h,\mathbf{w}^h) + J_h^{1,k_{1}}(\mathbf{u}^h,\mathbf{w}^h) \end{equation*} with \begin{align}\label{eq: def J0} \begin{split} J_h^{0,k_{1}}(\mathbf{u}^h,\mathbf{w}^h) &= \eta_{\Kone} \left[\numflux{\mathbf{u}_{k-1}}{\mathbf{u}_{k_{2}}} (x_{k-\frac{1}{2}})- \numflux{\mathbf{u}_{k-1}}{\mathbf{u}_{k_{1}}}(x_{k-\frac{1}{2}})\right]\cdot\jump{\mathbf{w}^h}_{k-\frac{1}{2}} \\ &+ \eta_{\Kone} \left[\numflux{\mathbf{u}_{k-1}}{\mathbf{u}_{k_{2}}}(x_\text{cut})-\numflux{\mathbf{u}_{k_{1}}}{\mathbf{u}_{k_{2}}}(x_\text{cut})\right]\cdot\jump{\mathbf{w}^h}_\text{cut} \end{split} \end{align} and $J_h^{1,k_{1}}$ being defined below. Here, $\eta_{\Kone} \in \mathbb{R_+}$ is a penalty factor. The stabilization term $J_h^{0,k_{1}}$ is designed to properly redistribute mass \textit{between} the cells $I_{k-1},$ $I_{k_{1}},$ and $I_{k_{2}}.$ We achieve this by adding new fluxes at $x_{k-1/2}$ and $x_{\text{cut}}$, which move mass between the left neighbor $I_{k-1}$ and the small cut cell $I_{k_{1}}$ and between $I_{k_{1}}$ and the right neighbor $I_{k_{2}}$, respectively. The sizes of these fluxes depend on the flux differences of a newly introduced flux $\numflux{\mathbf{u}_{k-1}}{\mathbf{u}_{k_{2}}}(\cdot)$ and the standard fluxes $ \numflux{\mathbf{u}_{k-1}}{\mathbf{u}_{k_{1}}}(\cdot)$ and $ \numflux{\mathbf{u}_{k_{1}}}{\mathbf{u}_{k_{2}}}(\cdot)$, respectively. Note that the new flux $\numflux{\mathbf{u}_{k-1}}{\mathbf{u}_{k_{2}}}(\cdot)$ introduces a direct coupling between cells $I_{k-1}$ and $I_{k_{2}}$. We emphasize the symmetric structure of the two terms in $J_h^{0,k_{1}}$: we add jump terms at both edges of $I_{k_{1}}$, accounting for the two possible flow directions. Note that we make use of the extrapolation operator $\mathcal{L}^{\operatorname{ext}}$ here when we evaluate $\mathbf{u}_{k-1}$ and $\mathbf{u}_{k_{2}}$ at $x_{\text{cut}}$ and $x_{k-\frac 1 2}$, respectively. The stabilization term $J_h^{1,k_{1}}$ controls the mass distribution primarily \textit{within} the small cut cell $I_{k_{1}}$ and secondarily \textit{within} its neighbors $I_{k-1}$ and $I_{k_{2}}$. The stabilization accounts for how much mass has been moved into and out of the small cut cell $I_{k_{1}}$ from and to its left and right neighbors by means of $a_h$ and $J_h^{0,k_{1}}$. The terms are derived from the proof of the $L^2$ stability, compare Theorem \ref{theorem: l2 stability}. Analogously to the ansatz functions, we also extrapolate the test functions to be used within their direct neighbor but outside of their original support. The stabilization term $J_h^{1,k_{1}}$ is given by \begin{align}\label{eq: def J1} \begin{split} J_h^{1,k_{1}}(\mathbf{u}^h,\mathbf{w}^h) &= \eta_{\Kone}\sum_{j\in\mathcal{I}_{\mathcal{N}}} \mathbf{K}(j)\int_{k_{1}}\left(\numflux{\mathbf{u}_{k-1}}{\mathbf{u}_{k_{2}}}-\mathbf{f}(\mathbf{u}_j)\right)\cdot\partial_x \mathbf{w}_{j}\dd x\\ &+\eta_{\Kone}\sum_{j\in \mathcal{I}_{\mathcal{N}}} \mathbf{K}(j)\int_{k_{1}}\left(\numfluxa{\mathbf{u}_{k-1}}{\mathbf{u}_{k_{2}}}\mathbf{u}_j\right)\cdot\partial_x \mathbf{w}_{k-1}\dd x\\ &+\eta_{\Kone}\sum_{j\in \mathcal{I}_{\mathcal{N}}} \mathbf{K}(j)\int_{k_{1}}\left(\numfluxb{\mathbf{u}_{k-1}}{\mathbf{u}_{k_{2}}}\mathbf{u}_j\right)\cdot\partial_x \mathbf{w}_{k_{2}}\dd x. \end{split} \end{align} Here, the matrices $\mathbf{K}(j) \in \mathbb{R}^{m \times m}, j \in \mathcal{I}_{\mathcal{N}},$ incorporate information about the flow directions. They are defined using positive semi-definite matrices $\mathbf{L}_{k_{1}},\mathbf{R}_{k_{1}} \in \mathbb{R}^{m \times m}$ and the identity matrix $\mathbf{I}^m \in \mathbb{R}^{m \times m}$. We set \begin{equation*} \mathbf{K}(k-1)=\mathbf{L}_{k_{1}}, \quad \mathbf{K}(k_{1})=-\mathbf{I}^m, \quad \text{and} \quad \mathbf{K}(k_{2})=\mathbf{R}_{k_{1}}. \end{equation*} The choices of $\mathbf{L}_{k_{1}},\mathbf{R}_{k_{1}}, \text{and } \eta_{\Kone}$ will be discussed below. Further, $\numfluxa{\mathbf{u}^-}{\mathbf{u}^+} \in \mathbb{R}^{m \times m}$ denotes the Jacobian of the numerical flux $\numflux{\mathbf{u}^-}{\mathbf{u}^+}$ with respect to the first argument, i.e., $\left(\frac{\partial}{\partial (\mathbf{u}^-)_j} \numflux{\mathbf{u}^-}{\mathbf{u}^+}_i\right)_{i,j=1}^m$. Analogously, $\numfluxb{\mathbf{u}^-}{\mathbf{u}^+}$ denotes the Jacobian with respect to the second argument $\mathbf{u}^+$. The stabilization might seem a bit overwhelming. Below, we will examine the stabilization for the two special cases of linear advection for $P^p$ and of scalar conservation laws for $P^0$ in more detail. This will provide a better understanding. \begin{remark} We note that the stabilized DG scheme is {\em locally mass conservative} but that the local mass conservation must be understood in a slightly broader sense: when checking for mass conservation (by testing with indicator functions), the penalty term $J_h^{1,k_{1}}$ vanishes. The penalty term $J_{h}^{0,k_{1}}$ stays and (depending on the flow direction) connects the cells $I_{k-1}$, $I_{k_{1}}$, and $I_{k_{2}}$. This is intended to overcome the small cell problem. As a result, we have local mass conservation with respect to the extended control volume $I_{k-1} \cup I_{k_{1}} \cup I_{k_{2}}$. \end{remark} \subsection{Choice of parameters} We now discuss how to choose $\mathbf{L}_{k_{1}}$, $\mathbf{R}_{k_{1}}$, and $\eta_{\Kone}$. \subsubsection{Choice of \texorpdfstring{$\mathbf{L}_{k_{1}}$}{L\_k} and \texorpdfstring{$\mathbf{R}_{k_{1}}$}{R\_k}} The parameter matrices $\mathbf{L}_{k_{1}}$ and $\mathbf{R}_{k_{1}}$ incorporate information about the flow direction. Let us first consider \textit{linear} problems. For the scalar linear advection equation \eqref{eq: lin adv} with $\beta>0$, we set $L_{k_{1}}=1$ and $R_{k_{1}}=0.$ For linear systems, given by \eqref{eq: lin system}, we decompose the matrix $\mathbf{A}$. Thanks to the assumption of hyperbolicity, $\mathbf{A}$ is diagonalizable with real eigenvalues $\lambda_{i}, i=1,\ldots,m,$. Therefore, we can rewrite $ \mathbf{A} = \mathbf{Q}\mathbf{\Lambda} \mathbf{Q}^{-1}, $ with the columns of $\mathbf{Q}$ containing the right eigenvectors of $\mathbf{A}$ and $\mathbf{\Lambda}$ being a diagonal matrix containing the eigenvalues $(\lambda_i)_i$. Based on $\mathbf{\Lambda}$, we define the diagonal matrices $\mathbf{I}^+, \mathbf{I}^- \in \mathbb{R}^{m \times m}$ by choosing element-wise for $i=1,\ldots,m$ \begin{equation*} \mathbf{I}^+_{ii} = \begin{cases} 1 & \text{if } \mathbf{\Lambda}_{ii} > 0,\\ \frac{1}{2} & \text{if } \mathbf{\Lambda}_{ii} = 0,\\ 0 & \text{if } \mathbf{\Lambda}_{ii} < 0, \end{cases} \quad \text{and} \quad \mathbf{I}^-_{ii} = \begin{cases} 0 & \text{if } \mathbf{\Lambda}_{ii} > 0,\\ \frac{1}{2} & \text{if } \mathbf{\Lambda}_{ii} = 0,\\ 1 & \text{if } \mathbf{\Lambda}_{ii} < 0. \end{cases} \end{equation*} Then, we define \begin{equation}\label{eq: choice tau kappa system} \mathbf{L}_{k_{1}} = \mathbf{Q}\mathbf{I}^+ \mathbf{Q}^{-1} \quad \text{and} \quad \mathbf{R}_{k_{1}} = \mathbf{Q}\mathbf{I}^- \mathbf{Q}^{-1}. \end{equation} Note that $\mathbf{L}_{k_{1}}$ and $\mathbf{R}_{k_{1}}$ are positive semi-definite matrices, which satisfy $\mathbf{L}_{k_{1}} + \mathbf{R}_{k_{1}} = \mathbf{I}^m$. For \textit{non-linear} problems, we use the same approach but replace $\mathbf{A}$ by the (non-linear) Jacobian matrix $\mathbf{f}_{\mathbf{u}}(\mathbf{u})$, evaluated at a suitable average $\hat{\mathbf{u}}$ of $\mathbf{u}_{k-1}(x_{k_{1}})$ and $\mathbf{u}_{k_{2}}(x_{k_{1}})$, with $x_{k_{1}}$ denoting the cell centroid of cell $I_{k_{1}}$. For scalar problems, i.e., $m=1$, we simply use the arithmetic average $\hat{u} = (u_{k-1}(x_{k_{1}})+u_{k_{2}}(x_{k_{1}}))/2$ and set \begin{equation*} (L_{k_{1}},R_{k_{1}}) = \begin{cases} (1,0) & \text{if } \hat{u} > 0, \\ (\frac{1}{2},\frac{1}{2}) & \text{if } \hat{u} = 0, \\ (0,1) & \text{if } \hat{u} < 0. \end{cases} \end{equation*} For solving the compressible Euler equations, compare \eqref{eq: Euler equations}, we use the Roe average given by \begin{equation*} \hat{\mathbf{u}}(\mathbf{u}_{k-1},\mathbf{u}_{k_{2}}) =\frac{1}{2} \begin{pmatrix} \sqrt{\rho_{k-1}}+\sqrt{\rho_{k_{2}}}\\ \sqrt{\rho_{k-1}}v_{k-1}+\sqrt{\rho_{k_{2}}}v_{k_{2}}\\ \sqrt{\rho_{k-1}}H_{k-1}+\sqrt{\rho_{k_{2}}}H_{k_{2}} \end{pmatrix} \end{equation*} with $H=\frac{E+p}{\rho}$ and with dropping the evaluation point $x_{k_{1}}$ for brevity. Then, we decompose $\mathbf{f}_{\mathbf{u}}(\hat{\mathbf{u}})$ into $\mathbf{Q}\mathbf{\Lambda} \mathbf{Q}^{-1}$ and use again the definition \eqref{eq: choice tau kappa system}. \subsubsection{Choice of \texorpdfstring{$\eta_{\Kone}$}{eta\_k1}} We choose the stabilization parameter $\eta_{\Kone}$ as \begin{equation}\label{eq: eta} \eta_{\Kone} = \max \left( 1-\frac{\alpha}{\nu}, 0 \right) \end{equation} with $\alpha$ being the cut cell fraction and $\nu$ the CFL parameter. The CFL parameter is used for setting the time step $\Delta t$. We use the standard formula for computing the time step length for DG schemes given by \begin{equation}\label{eq: time step} \Delta t = \frac{1}{2p+1} \frac{\nu h}{\lambda_{\max}} \end{equation} with $ \lambda_{\max} = \max_i \abs{\lambda_i} $ being the maximum eigenvalue. Examining \eqref{eq: eta}, we observe that for $\alpha \ge \nu$ there holds $\eta_{\Kone} = 0$ and therefore the stabilization $J_h$ vanishes. This is intended as in this case the standard CFL condition on cell $I_{k_{1}}$ is satisfied and we do not have a small cell problem. In the following, we typically implicitly assume $\alpha < \nu$, in which case there holds $\eta_{\Kone} = 1- \frac{\alpha}{\nu} > 0$. \begin{remark} There is a certain (limited) flexibility in the choice of $\eta_{\Kone}$. For a more detailed discussion we refer to \cite{DoD_SIAM_2020,Enumath_proceedings}. \end{remark} \subsection{Effect of additional stabilization terms in \texorpdfstring{$J_h^{1,k_{1}}$}{Jh1}} We now briefly discuss our new formulation for the case of the linear advection equation and compare it to the formulation used in \cite{DoD_SIAM_2020}, where we presented the DoD stabilization for the advection equation for piecewise \textit{linear} polynomials. We start with examining $J_h^{0,k_{1}}$ as formulated in \eqref{eq: def J0}. When using an upwind flux, the first term simply cancels and the second term reduces to the formulation of $J_h^{0,k_{1}}$ used in \cite{DoD_SIAM_2020}; thus, the two formulations coincide for $J_h^{0,k_{1}}$. This is not the case for $J_h^{1,k_{1}}$. Compared to \cite{DoD_SIAM_2020}, we have added terms to stabilize the mass distribution within the cells $I_{k-1}, I_{k_{1}}$, and $I_{k_{2}}$ for higher order polynomials. We discuss this in more detail in the following. For solving the linear advection equation \eqref{eq: lin adv} with the upwind flux, the derivatives of the numerical flux are given by \begin{equation*} \numfluxa{u_a}{u_b} = \beta \quad \text{and} \quad \numfluxb{u_a}{u_b} = 0, \end{equation*} and the coefficients $L_k$ and $R_k$ reduce to $L_k = 1$ and $R_k = 0$. Thus, the stabilization is of the form \begin{align}\label{eq: stabilization linear advection} \begin{split} J_h(u^h,w^h) = & \beta \eta_{\Kone}\left[u_{k-1}(x_\text{cut})-u_{k_{1}}(x_\text{cut})\right]\jump{w_h}_\text{cut} \\ &+\beta \eta_{\Kone}\int_{k_{1}} \left[u_{k-1}(x)-u_{k_{1}}(x)\right]\left[\partial_x w_{k-1}(x)-\partial_x w_{k_{1}}(x)\right] \dd{x}. \end{split} \end{align} The stabilization suggested in \cite{DoD_SIAM_2020} for the same setting has the form \begin{align}\label{eq: stab lin adv old} \begin{split} J_h(u^h,w^h) = & \beta \eta_{\Kone}\left[u_{k-1}(x_\text{cut})-u_{k_{1}}(x_\text{cut})\right]\jump{w_h}_\text{cut} \\ &\quad -\beta \eta_{\Kone}\int_{k_{1}} \left[u_{k-1}(x)-u_{k_{1}}(x)\right]\partial_x w_{k_{1}}(x) \dd{x}. \end{split} \end{align} Therefore, the only but essential difference is the expression \begin{equation}\label{eq: difference term siam} \int_{k_{1}}\beta\eta_{\Kone} \left[u_{k-1}(x)-u_{k_{1}}(x)\right]\partial_x w_{k-1}(x)\dd x. \end{equation} To examine the effect of the additional term \eqref{eq: difference term siam}, especially for higher polynomial degrees, we study the eigenvalues of the semi-discrete system \begin{equation*} U_t = M^{-1}L U. \end{equation*} Here, we denote by $M$ the mass matrix, by $L$ the stabilized stiffness matrix, and by $U$ the coefficient vector of $u_h$. We use a modified version of our model problem $\Th$ here: we discretize the domain $(0,1)$ by 100 equidistant cells and then split all cells in $(0.1,0.9)$ in cut cell pairs of length $\alpha h$ and $(1-\alpha)h$. All cells of length $\alpha h$ are identified as cells of type $I_{k_{1}}$ and are stabilized. We compare the results for $\alpha=10^{-1}$ with the results for $\alpha=10^{-6}$. \begin{table}[t] \centering \begin{tabular}{|c|c|c|c|c|} \hline & \multicolumn{2}{|c|}{$\alpha = 10^{-1}$} & \multicolumn{2}{|c|}{$\alpha = 10^{-6}$}\\ \hline P$^p$ & without \eqref{eq: difference term siam} & with \eqref{eq: difference term siam} & without \eqref{eq: difference term siam} & with \eqref{eq: difference term siam} \\ \hline P$^1$ & -4.81e-16 & 4.38e-17 & -1.58e-17 & 8.40e-17 \\ P$^2$ & 2.51e-04 & -1.73e-15 & 1.10e-15 & -6.53e-16 \\ P$^3$ & 5.11e-03 & 2.50e-15 & 3.84e-17 & 2.46e-16 \\ \hline \end{tabular} \caption{Effect of adding the term \eqref{eq: difference term siam}: Comparison of the spectral abscissa for the modified model problem for $\alpha = 10^{-1}$ and $\alpha=10^{-6}$. }\label{Table: spectral abscissa comparison} \end{table} In table \ref{Table: spectral abscissa comparison} we show the spectral abscissa of $M^{-1}L$ for the two different stabilizations for polynomial degrees $p=1,2$, $3$. The spectral abscissa $\mu$ is defined as the supremum over the real parts of all eigenvalues $\hat{\lambda}_i$ of $M^{-1}L$, i.e., $\mu = \sup_{i}( \text{Re}(\hat{\lambda}_i))$. It is a good indicator for the stability of a semi-discrete system, compare \cite{Mitchell2020,Trefethen2005}. We need to prevent $\mu>0$. Usually, the tiny cut cells are the trouble-makers. For $\alpha=10^{-6}$ though all values in table \ref{Table: spectral abscissa comparison} are zero (within the range of machine precision) and therefore fine. So one might think that the formulation \eqref{eq: stab lin adv old}, which we introduced in \cite{DoD_SIAM_2020} for linear polynomials only, also works for higher order polynomials. Surprisingly though we have problems for the `big' cut cells with volume fraction $\alpha = 10^{-1}$. For $P^1$ the values look good for both formulations. For $P^2$ and $P^3$ however the formulation without the term \eqref{eq: difference term siam} shows values for $\mu$ of the order of $10^{-4}$ and $10^{-3}$, i.e., a clear indication of instability. For our new formulation, which adds the term \eqref{eq: difference term siam}, the values are zero again. When examining the term \eqref{eq: difference term siam}, we can confirm that it should be more relevant for relatively large volume fractions $\alpha$ as we integrate over cells of type $I_{k_{1}}$, which have length $\alpha h$, and the derivative $\partial_x w_{k-1}$ scale like $\mathcal{O}(1/h)$. This example also shows that it is important to not only focus on the case of tiny $\alpha$'s but to also ensure that everything runs stable for larger volume fractions as well. \begin{remark} A similar observation seems to hold true for solving the Euler equations: reducing $J_h^{1,k_{1}}$ to only using the single term \begin{equation*} - \eta_{\Kone}\int_{k_{1}}\left(\numflux{\mathbf{u}_{k-1}(x)}{\mathbf{u}_{k_{2}}(x)}-\mathbf{f}(\mathbf{u}_{k_{1}}(x))\right)\cdot\partial_x \mathbf{w}_{k_{1}}(x)\dd x \end{equation*} leads to stable results for $P^1$ polynomials in our tests but causes instabilities for higher order polynomials. \end{remark} \subsection{Limiter}\label{sec: limiter} To run test cases involving a shock in a stable way, we need a limiter. We use the {\em total variation diminishing in the means} (TVDM) generalized slope limiter developed by Cockburn and Shu \cite{Cockburn1998,CockburnShu1989}, which we modify appropriately for the neighbors $I_{k-1}$ and $I_{k_{2}}$ of the small cut cell. The standard scheme for limiting the discrete solution $u_j$ on a cell $I_j, j \in \mathcal{I}_{\text{all}},$ (of a non-uniform mesh) can be summarized as follows: \begin{enumerate} \item Compute the limited extrapolated values $u_j^{\lim}(x_{j-\frac{1}{2}}^+)$ and $u_j^{\lim}(x_{j+\frac{1}{2}}^-)$: \begin{align*} u_j^{\lim}(x_{j-\frac{1}{2}}^+) &= \bar{u}_j - \tilde{m}(\bar{u}_j-u_j(x_{j-\frac{1}{2}}^+),\bar{u}_j-\bar{u}_{j-1},\bar{u}_{j+1}-\bar{u}_j)\\ u_j^{\lim}(x_{j+\frac{1}{2}}^-) &= \bar{u}_j + \tilde{m}(u_j(x_{j+\frac{1}{2}}^-)-\bar{u}_j,\bar{u}_j-\bar{u}_{j-1},\bar{u}_{j+1}-\bar{u}_j) \end{align*} with $\bar{u}_j$ denoting the average mass of $u_j$ over cell $I_j$ and $\tilde{m}$ being the \textit{minmod} function given by \begin{equation*} \tilde{m}(a_1,\ldots, a_n) = \begin{cases} s \cdot \min_{1\le i \le n} \abs{a_i} & \text{if } \text{sign}\,(a_1) = \ldots = \text{sign}\,(a_n) = s,\\ 0 & \text{otherwise.} \end{cases} \end{equation*} \item If the limited values $u_j^{\lim}(x_{j-\frac{1}{2}}^+)$ and $u_j^{\lim}(x_{j+\frac{1}{2}}^+)$ are equal to the unlimited values $u_j(x_{j-\frac{1}{2}}^+)$ and $u_j(x_{j+\frac{1}{2}}^+)$, set $u_j^{\lim}=u_j$. Otherwise, reduce $u_j$ to $P^1$ by setting higher order coefficients to zero. (Note that this does not change the mass as we use a Legendre basis.) Then, limit the linear polynomial such that the edge evaluations of the limited polynomial do not exceed $u_j^{\lim}(x_{j-\frac{1}{2}}^+)$ and $u_j^{\lim}(x_{j+\frac{1}{2}}^+)$, respectively. Use the outcome as $u_j^{\lim}$. \end{enumerate} Note that despite using the minmod function, this approach of limiting is more in the spirit of the MC limiter. In the penalty term $J_h$, we evaluate the solutions of cells $I_{k-1}$ and $I_{k_{2}}$ outside of their original support. We therefore postprocess the limiting on these cells to additionally enforce \begin{gather*} \min \left(\bar{u}_{k-1}^n, \bar{u}_{k_{1}}^n, \bar{u}_{k_{2}}^n \right) \le u_{k-1}(x_{\text{cut}}) \le \max \left(\bar{u}_{k-1}^n, \bar{u}_{k_{1}}^n, \bar{u}_{k_{2}}^n \right),\\ \min \left(\bar{u}_{k-1}^n, \bar{u}_{k_{1}}^n, \bar{u}_{k_{2}}^n \right) \le u_{k_{2}}(x_{k-\frac{1}{2}}) \le \max \left(\bar{u}_{k-1}^n, \bar{u}_{k_{1}}^n, \bar{u}_{k_{2}}^n \right). \end{gather*} As for the standard cells, we first apply a check whether it is necessary to change the high order polynomial (see Step 1) and only adjust the solution if needed. \begin{remark} This limiter has been adjusted to our stabilization and produces robust results but tends to be diffusive for higher order. The focus of this work is on the development of the stability term $J_h$, not on limiting. Limiting in this setup is a very challenging task as it combines the issues of not limiting higher order polynomials at smooth extrema and complications caused by the cut cell geometry \cite{May_Berger_LP}. We plan to address this in future work. \end{remark} \section{Theoretical results}\label{sec: theoretical results} In this section we present theoretical results concerning the stability of the stabilized scheme. For this, we focus on \textit{scalar} conservation laws given by \eqref{eq: scalar cons law}. We also require some standard properties for the numerical flux, compare, e.g., Cockburn and Shu \cite{CockburnShu1989}. \begin{prerequisite} \label{properties num flux} We request the numerical flux $\mathcal{H}$ to satisfy the following properties: \begin{enumerate} \item Consistency: $\numflux{u}{u} = f(u)$. \item Continuity: $\numflux{u^-}{u^+}$ is at least Lipschitz continuous with respect to both arguments $u^-$ and $u^+$. \item Monotonicity: $\numflux{u^-}{u^+}$ \begin{itemize} \item is a non-decreasing function of its first argument $u^-$, \item is a non-increasing function of its second argument $u^+$. \end{itemize} \end{enumerate} \end{prerequisite} Then, the flux has the E-flux property defined by Osher \cite{Osher1984}: For all $u$ between $u^-$ and $u^+$ there holds \begin{equation}\label{eq: e flux} (\numflux{u^-}{u^+}-f(u))(u^+-u^-)\leq 0. \end{equation} \subsection{Theoretical results for \texorpdfstring{$P^0$}{P0}} We first consider the case of piecewise constant polynomials. Then, the stabilization $J_h^{1,k_{1}}$, which involves derivatives of the test functions, vanishes, and the stabilization for the model problem $\Th$ reduces to $J_h(u^h,w^h)= J_h^{0,k_{1}}(u^h,w^h)$. In time we use explicit Euler. This results in the following update formulae in the neighborhood of the small cut cell $I_{k_{1}}$ \begin{align}\label{eq: formula for P0} \begin{split} u^{n+1}_{k-2} = & u^n_{k-2}-\frac{\Delta t}{h}\lbrace \numflux{u^n_{k-2}}{u^n_{k-1}}-\numflux{u^n_{k-3}}{u^n_{k-2}}\rbrace,\\ u^{n+1}_{k-1} = & u^n_{k-1}-\frac{\Delta t}{h}\lbrace(1-\eta_{\Kone})\numflux{u^n_{k-1}}{u^n_{k_{1}}} +\eta_{\Kone}\numflux{u^n_{k-1}}{u^n_{k_{2}}}-\numflux{u^n_{k-2}}{u^n_{k-1}}\rbrace,\\ u^{n+1}_{k_{1}} = & u^n_{k_{1}}-\frac{\Delta t}{\alpha h}(1-\eta_{\Kone})\lbrace\numflux{u^n_{k_{1}}}{u^n_{k_{2}}}-\numflux{u^n_{k-1}}{u^n_{k_{1}}}\rbrace,\\ u^{n+1}_{k_{2}} = & u^n_{k_{2}}-\frac{\Delta t}{(1-\alpha)h}\lbrace\numflux{u^n_{k_{2}}}{u^n_{k+1}}-(1-\eta_{\Kone})\numflux{u^n_{k_{1}}}{u^n_{k_{2}}}-\eta_{\Kone} \numflux{u^n_{k-1}}{u^n_{k_{2}}}\rbrace,\\ u^{n+1}_{k+1} = & u^n_{k+1}-\frac{\Delta t}{h}\lbrace \numflux{u^n_{k+1}}{u^n_{k+2}}-\numflux{u^n_{k_{2}}}{u^n_{k+1}}\rbrace. \end{split} \end{align} We use the common FV notation and denote the solution in cell $I_j$ at time $t^n$ by $u_j^n$. Evaluation points $'x'$ are not necessary as we only consider piecewise constant solutions. The update formulae in \eqref{eq: formula for P0} gives some insight in the effect of the stabilization. Let us first consider the update for the small cell $I_{k_{1}}$. The factor $(1-\eta_{\Kone}) = \frac{\alpha}{\nu}$ in front of the flux difference balances the factor $\alpha$ (from the cell size $\alpha h$) in the denominator and provides the prerequisite for a stable update on $I_{k_{1}}$. Further, there now exists an additional flux $\numflux{u_{k-1}}{u_{k_{2}}}$ between the cells $I_{k-1}$ and $I_{k_{2}}$, which are not direct neighbors. The scaled mass given by $\eta_{\Kone} \numflux{u_{k-1}}{u_{k_{2}}}$ is directly transported between cells $I_{k-1}$ and $I_{k_{2}}$ (depending on the flow direction), skipping the small cut cell $I_{k_{1}}$. \subsubsection{Monotonicity} A standard first-order FV/DG scheme is monotone on a uniform mesh for scalar conservation laws. We can also show this property for our stabilized scheme on the model mesh $\Th$. This guarantees that overshoot cannot occur. For explicit schemes, a monotone scheme can be defined as follows, compare Toro \cite{Toro}. \begin{definition}\label{def: monotonicity} A method $ u^{n+1}_j = H(u^n_{j-i_L},u^n_{j-i_L+1},...,u^n_{j+i_R}) $ is called {\em monotone}, if $\:\forall j$ there holds for every $l$ with $-i_L\le l\le i_R$ \begin{equation}\label{Def_monotone_coeff} \frac{\partial H}{\partial u_{j+l}}(u_{j-i_L},...,u_{j+i_R})\geq 0. \end{equation} \end{definition} \begin{theorem}\label{theorem: monotonicity} Consider the stabilized scheme \eqref{eq: stab. scheme} for $P^0$ polynomials for the model problem $\Th$ with explicit Euler in time, applied to a scalar conservation law. Let the time step be given by $\Delta t = \frac{\nu h}{\lambda_{\max}}$ for $0 < \alpha < \nu < 1-\alpha$. Let the numerical flux $\mathcal{H}$ satisfy prerequisite \ref{properties num flux}. Further, we require: \begin{equation}\label{eq: numflux condition} \abso{\numfluxa{u}{v}} + \abso{\numfluxb{w}{u}} \le \frac{\nu h}{\Delta t} \quad \forall u,v,w. \end{equation} Then, the stabilized scheme is monotone. \end{theorem} \begin{remark} Condition \eqref{eq: numflux condition} is a common condition for monotonicity on regular meshes, compare \cite{Mishra_Abgrall}. \end{remark} \begin{proof} Away from the two cut cells, we use a standard first-order DG scheme on a uniform mesh, which is monotone under the given assumptions. It therefore suffices to show property \eqref{Def_monotone_coeff} for the three cells $I_j, j\in\mathcal{I}_{\mathcal{N}},$ that are affected by our stabilization. The update formulae are given by \eqref{eq: formula for P0}. Due to $0<\eta_{\Kone}<1$, the non-negativity of $\frac{\partial}{\partial u_i^n} u_j^{n+1}$ for $i \neq j$ follows directly from the monotonicity of the fluxes. It remains to examine $\frac{\partial}{\partial u^n_j} u_j^{n+1}$ for $j \in \mathcal{I}_{\mathcal{N}}$. We start with cell $I_{k-1}$: \begin{align*} \frac{\partial}{\partial u^n_{k-1}} u^{n+1}_{k-1} =& \,1-\frac{\Delta t}{h}\{(1-\eta_{\Kone})\numfluxa{u^n_{k-1}}{u^n_{k_{1}}}+\eta_{\Kone}\numfluxa{u^n_{k-1}}{u^n_{k_{2}}}\\ &\qquad -(1-\eta_{\Kone})\numfluxb{u^n_{k-2}}{u^n_{k-1}} -\eta_{\Kone} \numfluxb{u^n_{k-2}}{u^n_{k-1}} \}\\ \geq & \,1-\frac{\Delta t}{h}\left\{ (1-\eta_{\Kone})\frac{\nu h}{\Delta t} + \eta_{\Kone} \frac{\nu h}{\Delta t} \right\}\geq 0. \end{align*} For the small cut cell $I_{k_{1}}$ there holds with $\eta_{\Kone} = 1 - \frac{\alpha}{\nu}$ \begin{align*} \frac{\partial}{\partial u^n_{k_{1}}} u^{n+1}_{k_{1}} =& \, 1-\frac{\Delta t }{\alpha h}(1-\eta_{\Kone})\{\numfluxa{u^n_{k_{1}}}{u^n_{k_{2}}}-\numfluxb{u^n_{k-1}}{u^n_{k_{1}}}\}\\ \geq & \, 1-\frac{\Delta t}{\alpha h}\frac{\alpha}{\nu}\frac{\nu h}{\Delta t}\geq 0. \end{align*} Finally, for cell $I_{k_{2}}$ we get \begin{align*} \frac{\partial}{\partial u^n_{k_{2}}} u^{n+1}_{k_{2}} =& \, 1-\frac{\Delta t}{(1-\alpha) h}\{(1-\eta_{\Kone})\numfluxa{u^n_{k_{2}}}{u^n_{k+1}} + \eta_{\Kone}\numfluxa{u^n_{k_{2}}}{u^n_{k+1}}\\ &\qquad \qquad\quad -(1-\eta_{\Kone})\numfluxb{u^n_{k_{1}}}{u^n_{k_{2}}} -\eta_{\Kone}\numfluxb{u^n_{k-1}}{u^n_{k_{2}}}\}\\ \geq& \, 1-\frac{\Delta t}{(1-\alpha) h} \frac{\nu h}{\Delta t} \geq 0. \end{align*} This concludes the proof. \end{proof} \subsection{\texorpdfstring{$L^2$}{L2} stability for \texorpdfstring{$P^p, p \ge 0$}{Pp, p ge 0}} In this section we prove that the stabilized semi-discrete scheme \eqref{eq: stab. scheme} is $L^2$ stable for arbitrary polynomial degree $p$ for the model problem $\Th$. The time is not discretized here and we consider scalar conservation laws. We note that the \textit{un}stabilized semi-discrete scheme \eqref{eq: scheme 1d wo stab} is also $L^2$ stable in this setting as shown in the proof below. But when combined with an explicit time stepping scheme, one would need to take tiny time steps to ensure stability for the fully discrete scheme. This is not the case for our stabilized scheme. The difficulty in designing the stabilization term $J_h$ is to find a formulation that is both $L^2$ stable for the semi-discrete setting and solves the small cell problem for the fully discrete setting in a monotone way. \begin{theorem}\label{theorem: l2 stability} Let $u^h(t)$, with $u^h(t) \in \mathcal{V}_h^p$ for any fixed $t$, be the solution to the semi-discrete problem \eqref{eq: stab. scheme} for the scalar equation \eqref{eq: scalar cons law} with periodic boundary conditions. Let the numerical flux function $\mathcal{H}$ satisfy prerequisite \ref{properties num flux}. Then, the solution satisfies for all $t\in (0,T)$ \begin{equation*} \norm{u^h(t)}_{L^2(\Omega)} \leq \norm{u^h(0)}_{L^2(\Omega)}. \end{equation*} \end{theorem} \begin{proof} We choose $w^h = u^h(t)$ in \eqref{eq: stab. scheme} to get \begin{equation*} \scpLscalar{d_t u^h(t)}{u^h(t)}+a_h(u^h(t), u^h(t)) + J_h(u^h(t),u^h(t)) = 0. \end{equation*} We integrate in time to get for the first term \begin{equation*} \int_{0}^t \scpLscalar{d_{\tau} u^h(\tau)}{u^h(\tau)} \: \dd \tau = \int_0^t \frac{d}{d\tau} \frac{1}{2} \norm{u^h(\tau)}_{L^2(\Omega)}^2 \dd \tau = \frac 1 2 \norm{u^h(t)}_{L^2(\Omega)}^2 - \frac 1 2 \norm{u^h(0)}_{L^2(\Omega)}^2. \end{equation*} It remains to show that for any fixed $t$ \begin{equation*} a_h(u^h(t), u^h(t)) + J_h(u^h(t),u^h(t)) \ge 0. \end{equation*} In the following we will suppress the explicit time dependence for brevity. \textbf{Unstabilized case:} We first prove $L^2$ stability for the unstabilized case, i.e., we show $a_h(u^h,u^h) \ge 0$. Here, we follow Jiang and Shu \cite{JiangShu} for the special case of the square entropy function. We define \begin{equation*} g(u) = \int^u f(\hat{u})\dd \hat{u}. \end{equation*} This implies $g'(u) = f(u)$. By the E-flux property \eqref{eq: e flux} and the mean value theorem, there holds \begin{equation}\label{eq: relation H and f} \numflux{u^-}{u^+} (u^- - u^+) - (g(u^-) - g(u^+)) \ge 0. \end{equation} Further, there holds for an arbitrary cell $I_i$ and an arbitrary $u_j$ \begin{equation*} \int_i f(u_j) \: \partial_x u_j \dd x = g(u_j(x_{i+\frac{1}{2}}))-g(u_j(x_{i-\frac{1}{2}})). \end{equation*} We define the flux \begin{equation*} F_{i+\frac{1}{2}}(u) = \numflux{u_{i}}{u_{i+1}}(x_{i+\frac{1}{2}})\; u_{i}(x_{i+\frac{1}{2}})- g(u_i(x_{i+\frac{1}{2}})). \end{equation*} Then we can rewrite the contribution of the bilinear form $a^h$ for a single, arbitrary cell $I_i$ as \begin{align*} -\int_i &f(u_i(x)) \partial_x u_i(x)\dd x + \numflux{u_i}{u_{i+1}}(x_{i+\frac{1}{2}}) \: u_i(x_{i+\frac{1}{2}}) - \numflux{u_{i-1}}{u_{i}}(x_{i-\frac{1}{2}}) \: u_i(x_{i-\frac{1}{2}}) \\ =&- g(u_i(x_{i+\frac{1}{2}}))+g(u_i(x_{i-\frac{1}{2}})) + \numflux{u_i}{u_{i+1}}(x_{i+\frac{1}{2}}) \: u_i(x_{i+\frac{1}{2}}) - \numflux{u_{i-1}}{u_{i}}(x_{i-\frac{1}{2}}) \: u_i(x_{i-\frac{1}{2}}) \\ =& F_{i+\frac{1}{2}}(u) + g(u_i(x_{i-\frac{1}{2}})) - \numflux{u_{i-1}}{u_{i}}(x_{i-\frac{1}{2}}) \: u_i(x_{i-\frac{1}{2}}) \\ =& F_{i+\frac{1}{2}}(u) - F_{i-\frac{1}{2}}(u) - g(u_{i-1}(x_{i-\frac{1}{2}})) + g(u_i(x_{i-\frac{1}{2}})) + \numflux{u_{i-1}}{u_{i}}(x_{i-\frac{1}{2}}) \jump{u^h}_{i-\frac{1}{2}}. \end{align*} Using the notation $\jump{g(u)}_{i+\frac{1}{2}} = g(u_{i}(x_{i+\frac{1}{2}})) - g(u_{i+1}(x_{i+\frac{1}{2}}))$, we can summarize \begin{align*} a_h (u^h,u^h) =& \sum_{j \in \mathcal{I}_{\text{equi}}} \left( F_{j+\frac{1}{2}}(u) - F_{j-\frac{1}{2}}(u) + \numflux{u_{j-1}}{u_{j}}(x_{j-\frac{1}{2}}) \jump{u^h}_{j-\frac{1}{2}} - \jump{g(u)}_{j-\frac{1}{2}} \right) \\ &+ \left( F_{\text{cut}}(u) - F_{k-\frac{1}{2}} (u) + \numflux{u_{k-1}}{u_{k_{1}}}(x_{k-\frac{1}{2}}) \jump{u^h}_{k-\frac{1}{2}} - \jump{g(u)}_{k-\frac{1}{2}} \right) \\ & + \left( F_{k+\frac{1}{2}}(u) - F_{\text{cut}}(u) + \numflux{u_{k_{1}}}{u_{k_{2}}}(x_{\text{cut}}) \jump{u^h}_{\text{cut}} - \jump{g(u)}_{\text{cut}} \right). \end{align*} Due to the fluxes $F$ building a telescope sum and the usage of periodic boundary conditions, this implies \begin{equation*} a_h (u^h,u^h) = \mathbb{T}_1 + \mathbb{T}_2 \end{equation*} with \begin{align*} \mathbb{T}_1 =& \sum_{j \in \mathcal{I}_{\text{equi}}} \left( \numflux{u_{j-1}}{u_{j}}(x_{j-\frac{1}{2}}) \jump{u^h}_{j-\frac{1}{2}} - \jump{g(u)}_{j-\frac{1}{2}} \right), \\ \mathbb{T}_2 =& \: \numflux{u_{k-1}}{u_{k_{1}}}(x_{k-\frac{1}{2}}) \jump{u^h}_{k-\frac{1}{2}} - \jump{g(u)}_{k-\frac{1}{2}} + \numflux{u_{k_{1}}}{u_{k_{2}}}(x_{\text{cut}}) \jump{u^h}_{\text{cut}} - \jump{g(u)}_{\text{cut}}. \end{align*} Note that due to \eqref{eq: relation H and f} $\mathbb{T}_1, \mathbb{T}_2 \ge 0.$ \textbf{Contribution of stabilization:} Now we consider the stabilization. We will not show $J_h(u^h,u^h) \ge 0$ but instead $a_h(u^h,u^h)+J_h(u^h,u^h) \ge 0$. For the edge stabilization, we get \begin{align*} \frac{1}{\eta_{\Kone}} J_h^{0,k_{1}}(u^h,u^h) & = \left[\numflux{u_{k-1}}{u_{k_{2}}} (x_{k-\frac{1}{2}})- \numflux{u_{k-1}}{u_{k_{1}}}(x_{k-\frac{1}{2}})\right] \jump{u^h}_{k-\frac{1}{2}}\\ &\quad + \left[\numflux{u_{k-1}}{u_{k_{2}}}(x_\text{cut})-\numflux{u_{k_{1}}}{u_{k_{2}}}(x_\text{cut})\right] \jump{u^h}_{\text{cut}} \\ & = -\mathbb{T}_2 + \mathbb{T}_3 \end{align*} with \begin{equation*} \mathbb{T}_3 = \numflux{u_{k-1}}{u_{k_{2}}} (x_{k-\frac{1}{2}}) \jump{u^h}_{k-\frac{1}{2}} - \jump{g(u)}_{k-\frac{1}{2}} + \numflux{u_{k-1}}{u_{k_{2}}}(x_\text{cut}) \jump{u^h}_{\text{cut}} - \jump{g(u)}_{\text{cut}}. \end{equation*} Since $\eta_{\Kone} \in (0,1)$, we can later take care of the negative term $-\eta_{k_{1}} \mathbb{T}_2$ by adding the bilinear form $a_h$ to get \begin{equation*} a_h(u^h,u^h)-\eta_{\Kone} \mathbb{T}_2 = \mathbb{T}_1 + (1-\eta_{\Kone}) \mathbb{T}_2 \ge 0. \end{equation*} It remains to examine $\mathbb{T}_3$ and the volume stabilization term $J_h^{1,k_{1}}$. Here, we make use of the assumption of the flux $\mathcal{H}$ being differentiable a.e. to write \begin{equation*} \frac{\dd}{\dd x}\numflux{u_{k-1}}{u_{k_{2}}} = \numfluxa{u_{k-1}}{u_{k_{2}}}\partial_x u_{k-1}+\numfluxb{u_{k-1}}{u_{k_{2}}}\partial_x u_{k_{2}}. \end{equation*} This implies \begin{align*} \frac{1}{\eta_{\Kone}} &J^{1,k_{1}}_h(u^h,u^h) =\sum_{j\in \mathcal{I}_{\mathcal{N}}} K(j)\int_{k_{1}}\left(\numflux{u_{k-1}}{u_{k_{2}}}-f(u_j)\right)\partial_x u_j\dd x\\ &+\sum_{j\in \mathcal{I}_{\mathcal{N}}} K(j)\int_{k_{1}}\numfluxa{u_{k-1}}{u_{k_{2}}}\,u_j \:\partial_x u_{k-1}\dd x +\sum_{j\in \mathcal{I}_{\mathcal{N}}} K(j)\int_{k_{1}}\numfluxb{u_{k-1}}{u_{k_{2}}}\,u_j \:\partial_x u_{k_{2}}\dd x\\ &= \sum_{j\in \mathcal{I}_{\mathcal{N}}} K(j)\int_{k_{1}}\numflux{u_{k-1}}{u_{k_{2}}}\partial_x u_j\dd x -\sum_{j\in \mathcal{I}_{\mathcal{N}}} K(j)\left(g(u_j(x_{\text{cut}}))-g(u_j(x_{k-\frac{1}{2}}))\right)\\ &+ \sum_{j\in \mathcal{I}_{\mathcal{N}}}K(j) \int_{k_{1}}\left(\frac{\dd }{\dd x}\numflux{u_{k-1}}{u_{k_{2}}}\right)u_j \: \dd x. \end{align*} Using $\frac{d}{dx}\left( \numflux{u_{k-1}}{u_{k_{2}}}u_j \right) = \numflux{u_{k-1}}{u_{k_{2}}}\partial_x u_j + \frac{\dd }{\dd x}\numflux{u_{k-1}}{u_{k_{2}}}u_j$, we get \begin{align*} \frac{1}{\eta_{\Kone}} J^{1,k_{1}}_h(u^h,u^h) = \sum_{j\in \mathcal{I}_{\mathcal{N}}} K(j) & \bigl[\left(\numflux{u_{k-1}}{u_{k_{2}}}u_j\right)(x_{\text{cut}}) -\left(\numflux{u_{k-1}}{u_{k_{2}}}u_j\right)(x_{k-\frac{1}{2}}) .\\ &- g(u_j(x_{\text{cut}}))+g(u_j(x_{k-\frac{1}{2}}))\bigr]. \end{align*} Recall that \begin{equation*} K(k-1) = L_{k_{1}}, \quad K(k_{1}) = -1, \quad K(k_{2}) = R_{k_{1}} \end{equation*} with $L_{k_{1}},R_{k_{1}} \in [0,1]$ and $L_{k_{1}} + R_{k_{1}} = 1$. Then, skipping some tedious computations for brevity, we get \begin{align*} \frac{1}{\eta_{\Kone}} J^{1,k_{1}}_h(u^h,u^h) + \mathbb{T}_3 =& \numflux{u_{k-1}}{u_{k_{2}}}(x_{k-\frac{1}{2}})u_{k-1}(x_{k-\frac{1}{2}}) - \numflux{u_{k-1}}{u_{k_{2}}}(x_{\text{cut}})u_{k_{2}}(x_{\text{cut}}) \\ & \qquad - g(u_{k-1}(x_{k-\frac{1}{2}})) + g(u_{k_{2}}(x_{\text{cut}})) \\ & + L_{k_{1}} \left[ \numflux{u_{k-1}}{u_{k_{2}}}(x_{\text{cut}})u_{k-1}(x_{\text{cut}}) - \numflux{u_{k-1}}{u_{k_{2}}}(x_{k-\frac{1}{2}})u_{k-1}(x_{k-\frac{1}{2}}) \right.\\ &\left. \qquad - g(u_{k-1}(x_{\text{cut}})) + g(u_{k-1}(x_{k-\frac{1}{2}}))\right] \\ &+ R_{k_{1}} \left[ \numflux{u_{k-1}}{u_{k_{2}}}(x_{\text{cut}})u_{k_{2}}(x_{\text{cut}}) - \numflux{u_{k-1}}{u_{k_{2}}}(x_{k-\frac{1}{2}})u_{k_{2}}(x_{k-\frac{1}{2}}) \right.\\ & \left. \qquad - g(u_{k_{2}}(x_{\text{cut}})) + g(u_{k_{2}}(x_{k-\frac{1}{2}}))\right]\\ =& \mathbb{T}_4 + \mathbb{T}_5 \end{align*} with \begin{align*} \mathbb{T}_4 & =L_{k_{1}}\left[\numflux{u_{k-1}}{u_{k_{2}}}(x_{\text{cut}})\left(u_{k-1}(x_{\text{cut}})-u_{k_{2}}(x_{\text{cut}})\right) -g(u_{k-1}(x_{\text{cut}}))+ g(u_{k_{2}}(x_{\text{cut}}))\right]\\ \mathbb{T}_5 &=R_{k_{1}}\left[\numflux{u_{k-1}}{u_{k_{2}}}(x_{k-\frac{1}{2}})\left(u_{k-1}(x_{k-\frac{1}{2}})-u_{k_{2}}(x_{k-\frac{1}{2}})\right) -g(u_{k-1}(x_{k-\frac{1}{2}}))+g(u_{k_{2}}(x_{k-\frac{1}{2}}))\right]. \end{align*} Note that we use $L_{k_{1}} + R_{k_{1}} = 1$ here. Again, $\mathbb{T}_4, \mathbb{T}_5 \ge 0$ due to \eqref{eq: relation H and f}. In total, we get for the stabilization \begin{equation*} J^{0,k_{1}}_h(u^h,u^h) + J^{1,k_{1}}_h(u^h,u^h) = -\eta_{\Kone} \mathbb{T}_2 + \eta_{\Kone} \mathbb{T}_4 + \eta_{\Kone} \mathbb{T}_5. \end{equation*} Together with the bilinear form $a_h$, this gives \begin{equation*} a_h(u^h,u^h) + J_h(u^h,u^h) = \mathbb{T}_1 + (1-\eta_{\Kone}) \mathbb{T}_2 + \eta_{\Kone} \mathbb{T}_4 + \eta_{\Kone} \mathbb{T}_5. \end{equation*} As $\mathbb{T}_1, \mathbb{T}_2, \mathbb{T}_4, \mathbb{T}_5 \ge 0$ and all prefactors are non-negative due to $0 < \eta_{\Kone} < 1$, this concludes the proof. \end{proof} \begin{remark} Let us consider the special case of the linear advection equation with $\beta=1$ and upwind flux. Then, $g(u)=\frac 1 2 u^2$ and $a_h(u^h,u^h)$ reduces to \begin{equation*} a_h(u^h,u^h) = \underbrace{\sum_{j \in \mathcal{I}_{\text{equi}}} \frac 1 2 \jump{u^h}^2_{j-\frac{1}{2}}}_{=\mathbb{T}_1} + \underbrace{\frac 1 2 \jump{u^h}^2_{k-\frac{1}{2}} + \frac 1 2 \jump{u^h}^2_{\text{cut}}}_{=\mathbb{T}_2} . \end{equation*} In the stabilization several terms drop out, compare \eqref{eq: stabilization linear advection}, and we get \begin{equation*} \frac{1}{\eta_{\Kone}} J_h(u^h,u^h) \ = \underbrace{- \frac 1 2 \jump{u^h}^2_{k-\frac{1}{2}} - \frac 1 2 \jump{u^h}^2_{\text{cut}}}_{=- \mathbb{T}_2} + \underbrace{\frac{1}{2} \left[ u_{k_{2}}(x_{\text{cut}}) - u_{k-1}(x_{\text{cut}}) \right]^2}_{= \mathbb{T}_4}. \end{equation*} When considering the sum $a_h(u^h,u^h) + J_h(u^h,u^h)$, we observe that the stabilization has the effect of replacing a certain portion, identified by $\eta_{\Kone}$, of the `standard' jumps $(\mathbb{T}_2)$ at both edges $x_{k-\frac 1 2}$ and $x_{\text{cut}}$ of the small cut cell $I_{k_{1}}$ by an `extended' jump $(\mathbb{T}_4)$, evaluated at $x_{\text{cut}}$. \end{remark} \section{Numerical results}\label{sec: numerical results} In this section we present numerical results for both scalar conservation laws and systems of conservation laws. We will show results for piecewise constant polynomials in space as well as for higher order polynomials to assess accuracy and stability of the proposed scheme. To test convergence properties we need smooth solutions, which is non-trivial for, e.g., the compressible Euler equations. We will use \textit{manufactured solutions} for this purpose: we define a smooth function $\mathbf{u}(x,t)$ that we would like to be the solution of our system. Then we insert $\mathbf{u}(x,t)$ in the corresponding equations of the system. This typically results in a non-zero source term $\mathbf{g}$ on the right hand side. As a consequence, instead of solving \eqref{eq: conservation law}, we now solve the system \begin{equation}\label{eq: conservation law with sourceterm} \mathbf{u}_t+ \mathbf{f}(\mathbf{u})_x = \mathbf{g}\quad \text{ in } \Omega \times (0,T). \end{equation} The semi-discrete problem is then given by: Find $\mathbf{u}^h \in \mathcal{V}_h^p$ such that \begin{equation*} \scpL{d_t\mathbf{u}^h(t)}{\mathbf{w}^h}+a_h\left(\mathbf{u}^h(t), \mathbf{w}^h\right) + J_h(\mathbf{u}^h(t),\mathbf{w}^h) = \mathcal{S}_h\left(\mathbf{g},\mathbf{w}^h\right)\quad\forall \, \mathbf{w}^h\in \mathcal{V}_h^p, \end{equation*} with \begin{equation*} \mathcal{S}_h(\mathbf{g},\mathbf{w}^h) = \sum_{j \in \mathcal{I}_{\text{all}}} \int_{j} \mathbf{g} \cdot \mathbf{w}^h\dd{x}. \end{equation*} We will discretize this semi-discrete problem with a time stepping scheme whose order is chosen to match the order of the space discretization: When using the polynomial degree $p$ in space, we will use an SSP RK scheme of order $p+1$ in time. In particular, for piecewise constant polynomials in space we will use explicit Euler in time. Our test cases are extensions of the model problem $\Th$: we will use many cut cell pairs instead of using only one pair. Unless otherwise specified, we choose $\Omega = (0,1)$ and split \textit{every} cell $I_k$ between $x=0.1$ and $x=0.9$ in cut cell pairs $(I_{k_{1}},I_{k_{2}})$ of lengths $\alpha_k h$ and $(1-\alpha_k)h$, where $\alpha_k\in (0,\frac{1}{2}]$ may be different for different $k$. We consider two cases: \begin{itemize} \item Case 1 ('$\alpha = 10^{-\square}$'): The cut cell fraction $\alpha_k$ is the same for all cut cell pairs, i.e. $\alpha_k \equiv \alpha$. \item Case 2 ('rand $\alpha$'): The cut cell fraction $\alpha_k$ varies and is computed randomly as $\alpha_k = 10^{-2}X_k$ with $X_k$ being a uniformly distributed random number in $(0,1)$. \end{itemize} We compute the time step length according to \eqref{eq: time step} using $\nu=0.4$ in all our experiments. For systems, we compute the $L^1$ and $L^{\infty}$ error as \begin{equation*} \norm{\mathbf{u}(\cdot,T)}_1 = \sum_{l=1}^m \norm{\mathbf{u}_l(\cdot,T)}_{L^1(\Omega)}, \quad \norm{\mathbf{u}(\cdot,T)}_{\infty} = \max_{1\le l \le m} \norm{\mathbf{u}_l(\cdot,T)}_{L^{\infty}(\Omega)}. \end{equation*} For the tests involving Burgers' equation and the linear system, we use the exact Riemann solver. For the Euler equations, we use the approximate Roe Riemann solver \cite{Toro}. We implement periodic boundary conditions by setting $\mathbf{u}_0(x_{\frac{1}{2}}) = \mathbf{u}_N(x_{N+\frac{1}{2}})$ and $\mathbf{u}_{N+1}(x_{N+\frac{1}{2}}) = \mathbf{u}_1(x_{\frac{1}{2}})$. For transmissive boundary conditions we use $\mathbf{u}_0(x_{\frac{1}{2}}) = \mathbf{u}_1(x_{\frac{1}{2}})$ and $\mathbf{u}_{N+1}(x_{N+\frac{1}{2}}) = \mathbf{u}_N(x_{N+\frac{1}{2}})$. \subsection{Burgers equation} We start with two tests for Burgers equation. In both cases, we initialize the solution with a sine curve. In the first test, we force the solution to stay smooth. In the second test, we allow the shock and rarefaction waves to develop. \begin{figure}[ht] \centering \begin{subfigure}[h]{0.37\linewidth} \includegraphics[width=\linewidth]{Kapitel_5/Burgers/L1_Burgers.pdf} \end{subfigure} \begin{subfigure}[h]{0.18\linewidth} \includegraphics[width=\linewidth]{Kapitel_5/Burgers/legend.pdf} \end{subfigure} \begin{subfigure}[h]{0.37\linewidth} \includegraphics[width=\linewidth]{Kapitel_5/Burgers/LMax_Burgers.pdf} \end{subfigure} \caption{Convergence test for manufactured solution for Burgers equation: Error in the $L^1$ and $L^{\infty}$ norm.}\label{fig: err burgers} \end{figure} \subsubsection{Accuracy test with a manufactured solution} We consider the manufactured solution \begin{equation*} u(x,t) = \sin(4\pi(x-t)) \end{equation*} with periodic boundary conditions. This results in the source term \begin{equation*} g(x,t) = 4\pi\cos(4\pi(x-t))\left(\sin(4\pi(x-t))-1\right). \end{equation*} In figure \ref{fig: err burgers} we show the error, measured in the $L^1$ and in the $L^\infty$ norm, for different values of the volume fractions $\alpha_k$ and different polynomial degrees at the final time $T=1$. We observe standard convergence rates, i.e., rates $p+1$ for polynomial degree $p$ for both the $L^1$ and the $L^{\infty}$ norm. We also note that the error sizes for the different test cases involving varying values of $\alpha_k$ are quite similar. \subsubsection{Stability test} Next, we consider a non-smooth problem. We choose the initial data \begin{equation*} u_0(x) = \sin{(4\pi (x+0.5))} \end{equation*} with periodic boundary conditions and use $g=0$. As is well-known, these initial data result in the development of shock waves in the regions where the derivative of $u_0$ is negative. Figure \ref{fig: Burgers Sine} shows the solution at final time $T=0.1$ for different polynomial degrees for $\alpha_k$ being chosen randomly as specified above. The cut cell mesh was created from a mesh with $N=100$ equidistant cells, and therefore contains 180 cells. For piecewise constant polynomials, the computed solution does not overshoot, consistent with the monotonicity result in theorem \ref{theorem: monotonicity}. We also show the solution for $P^3$ polynomials, with and without the limiter. Without the limiter, the solution produces overshoot near the shock. Nevertheless, as is the case on a regular mesh, the numerical tests are stable and do not break despite using small cut cells. With limiter, the overshoot is gone. \begin{figure}[ht] \centering \begin{subfigure}{0.4\linewidth} \includegraphics[width=\linewidth]{Kapitel_5/Burgers/Burgers_P0.pdf} \end{subfigure} \begin{subfigure}{0.4\linewidth} \includegraphics[width=\linewidth]{Kapitel_5/Burgers/Burgers_P3_limited_and_unlimited.pdf} \end{subfigure} \caption{Stability test for Burgers equation: Solution at final time for piecewise constant polynomials (left) and piecewise cubic polynomials with and without a limiter (right).}\label{fig: Burgers Sine} \end{figure} \subsection{Linear systems} We now consider the linear system given by equation \eqref{eq: lin system} with \begin{equation*} \mathbf{A}=\begin{pmatrix*}[r] 4 & 2.5 & -7\\ -1 & 0.5 & 7\\ -0.5 & 1.25 & 1.5 \end{pmatrix*} \quad \text{and} \quad \mathbf{u}_0(x,t) = \begin{pmatrix*} \sin(2\pi x) \\ -\frac{1}{3}\cos(2\pi x)\\ \frac{1}{2}\sin(2\pi x) \end{pmatrix*}. \end{equation*} The eigenvalues of $\mathbf{A}$ are $\lambda_1 = -2$, $\lambda_2=3$ and $\lambda_3 = 5$. We again use periodic boundary conditions. In figure \ref{fig: err lin system}, we show the errors in the $L^1$ and in the $L^{\infty}$ norm for piecewise linear, piecewise quadratic, and piecewise cubic polynomials for different values of the volume fractions $\alpha_k$. As for Burgers equation, we observe convergence rates $p+1$ for polynomial degree $p$ for both the $L^1$ and $L^{\infty}$ error. \begin{figure}[ht] \centering \begin{subfigure}[h]{0.37\linewidth} \includegraphics[width=\linewidth]{Kapitel_5/Lin_System/L1_Lin_system.pdf} \end{subfigure} \begin{subfigure}[h]{0.18\linewidth} \includegraphics[width=\linewidth]{Kapitel_5/Lin_System/legend.pdf} \end{subfigure} \begin{subfigure}[h]{0.37\linewidth} \includegraphics[width=\linewidth]{Kapitel_5/Lin_System/LMax_Lin_system.pdf} \end{subfigure} \caption{Convergence test for linear system: Error in the $L^1$ and $L^{\infty}$ norm.} \label{fig: err lin system} \end{figure} \subsection{Euler equations} For the Euler equations we present two tests: a test with a smooth manufactured solution and the Sod shock tube test. \subsubsection{Accuracy test with manufactured solution} \begin{figure \centering \begin{subfigure}[h]{0.37\linewidth} \includegraphics[width=\linewidth]{Kapitel_5/Euler/L1_Euler.pdf} \end{subfigure} \begin{subfigure}[h]{0.18\linewidth} \includegraphics[width=\linewidth]{Kapitel_5/Lin_System/legend.pdf} \end{subfigure} \begin{subfigure}[h]{0.37\linewidth} \includegraphics[width=\linewidth]{Kapitel_5/Euler/LMax_Euler.pdf} \end{subfigure} \caption{Convergence test for manufactured solutions for Euler equations: Error in the $L^1$ and $L^{\infty}$ norm.} \label{fig: err Euler system} \end{figure} We define the solution (in terms of primitive variables) as \begin{equation*} \begin{pmatrix} \rho \\ v \\ p \end{pmatrix} = \begin{pmatrix} 2+\sin (2\pi(x-t))\\ \sin(2\pi(x-t))\\ 2+\cos(2\pi(x-t)) \end{pmatrix} \end{equation*} together with periodic boundary conditions. The source term $\mathbf{g}(x,t)$ can be calculated by inserting the vector of conserved variables $\mathbf{u}(x,t)$ into equation \eqref{eq: conservation law with sourceterm} (but it is not given here due to its length). In figure \ref{fig: err Euler system} we show the $L^1$ and the $L^\infty$ error for different test cases at time $T=1$. Again, we see optimal convergence rates in the $L^1$ and in the $L^\infty$ norm for the different polynomial degrees. \subsubsection{Sod shock tube test} We conclude the numerical results with the well-known Sod shock tube test \cite{Toro}. The initial data are given by the following Riemann problem \begin{equation*} \left(\rho, \rho v , E \right) = \begin{cases} \left(1, 0, 2.5\right) &\text{ if } x<0,\\ \left(0.125, 0, 0.25\right) &\text{ otherwise}. \end{cases} \end{equation*} For this test, we choose $\Omega = (-1,1)$ and use transmissive boundary conditions. We discretize $\Omega$ with $N=100$ equidistant cells and split every cell in $[-0.75,0.75]$ into a pair of two cut cells with the volume fraction $\alpha_k$ chosen randomly as described above. We set $T=0.4$. In figure \ref{fig: euler sod p0} we show the solution for density and for velocity at the final time using piecewise constant polynomials. As expected for $P^0$, the solution looks good but is quite diffusive. Figure \ref{fig: euler sod p1} shows the solution for piecewise linear, limited polynomials. We applied the limiter described in subsection \ref{sec: limiter} to the components of the conserved variables and added a check to ensure that the pressure stays positive. Compared to the results for $P^0$, the results are significantly less diffusive while mostly being free of oscillations. \begin{figure}[ht] \centering \includegraphics[width=0.65\linewidth]{Kapitel_5/Euler/Euler_Sod_P0.pdf} \caption{Sod shock tube test: Numerical solution for density $\rho$ and velocity $v$ at final time using piecewise constant polynomials.}\label{fig: euler sod p0} \end{figure} \begin{figure}[ht] \centering \includegraphics[width=0.65\linewidth]{Kapitel_5/Euler/Euler_Sod_P1.pdf} \caption{Sod shock tube test: Numerical solution for density $\rho$ and velocity $v$ at final time using piecewise linear polynomials with limiter.}\label{fig: euler sod p1} \end{figure} \section{Conclusions and outlook}\label{sec: outlook} In this contribution we have presented the extension of the DoD stabilization to non-linear problems and to higher order polynomials. To account for the latter, we have extended the support of test functions from small cut cells' neighbors into the small cut cells, compare $J_h^{1,k_{1}}$ in \eqref{eq: def J1}. This stabilizes the derivatives on the cut cells' neighbors. To account for the changing flow directions in non-linear problems, we make use of Riemann solvers in both $J_h^{0,k_{1}}$ and $J_h^{1,k_{1}}$. Note also that both penalty terms treat the left and right neighbors of small cut cells in a symmetric way. For our new formulation we can show that the fully discrete, first-order scheme is monotone for scalar conservation laws. For the semi-discrete formulation, we have an $L^2$ stability result for arbitrary polynomial degree $p$. Our numerical results confirm that the DoD stabilized scheme has the same order of accuracy as standard RKDG schemes on equidistant meshes. Further, we observe robust behavior in the presence of shocks. The choice of $J_h^{0,k_{1}}$ followed in a fairly straightforward way from the choice of $J_h^{0,k_{1}}$ for linear advection in \cite{DoD_SIAM_2020} by accounting for the changing flow directions. The design of $J_h^{1,k_{1}}$ was significantly more complicated. The goal of ensuring $L^2$ stability has been a major guideline in the development of the terms. The next step will be the extension of the formulation to higher dimensions. Here, the main difficulty will consist in extending the penalty term $J_h^{1,k_{1}}$ appropriately. Solving a Riemann problem in the interior of a cell in two dimensions is non-trivial. We believe that it will be necessary to replace this formulation by a suitable approximation, similarly to using approximate Riemann solvers instead of exact ones. We also believe that the results presented in this contribution are an essential step and a very good guideline towards reaching that goal. \section*{Acknowledgments} The authors would like to thank Christian Engwer, Andrew Giuliani, and Tim Mitchell for helpful discussions. F.S. gratefully acknowledges support by the Deutsche Forschungsgesellschaft (DFG, German Research Foundation) - 439956613 (Hypercut). \bibliographystyle{plain}
\section{Background on Submodularity and Contention Resolution Schemes}\label{app:background} \subsection{Useful Lemmas}\label{app:background1} Below we state several relevant lemmas regarding sampling and submodular functions that we need. \begin{lemma}[Lemma 2.2 from \cite{buchbinder}]\label{lem:buchbinder} Let $f : 2^\cN \to \Rp$ be submodular. Denote by $A(p)$ a random subset of $A$ where each element appears with probability at most $p$ (not necessarily independently). Then, \[ \E[f(A(p))] \geq (1-p) \cdot f(\emptyset). \] \end{lemma} \begin{lemma}[Lemma 2.2 from \cite{vondrak}]\label{lem:vondrak2} Let $g : 2^\cN \to \Rp$ be submodular. Denote by $A(p)$ a random subset of $A$ where each element appears with probability exactly $p$ (not necessarily independently). Then \[ \E[g(A(p))] \geq (1 - p) \cdot g(\emptyset) + p \cdot g(A). \] \end{lemma} \begin{lemma}[Lemma 2.3 from \cite{vondrak}]\label{lem:vondrak3} Let $f : 2^\cN \to \Rp$ be submodular, $A, B \subseteq \cN$ two (not necessarily disjoint) sets and $A(p), B(q)$ their independently sampled subsets, where each element of $A$ appears in $A(p)$ with probability $p$ and each element of $B$ appears in $B(q)$ with probability $q$. Then \[ \E[f(A(p) \cup B(q))] \geq (1-p)(1-q) \cdot f(\emptyset) + p(1-q) \cdot f(A) + (1-p)q \cdot f(B) + pq \cdot f(A \cup B). \] \end{lemma} \begin{lemma}[Lemma 4.3 from \cite{vondrak}]\label{lem:sampling} Let $f : 2^\cN \to \Rp$ be a submodular function, let $A_1, A_2, \dots, A_k \subseteq \cN$ be $k$ (not necessarily disjoint) sets and let $A_1(p_1), A_2(p_2), \dots, A_k(p_k)$ their independently sampled subsets, where each element of $A_i$ appears in $A_i(p_i)$ with probability $p_i$, for all $1 \leq i \leq k$. Then \[ \E\left[f\left(\bigcup_{i = 1}^k A_i(p_i)\right)\right] \geq \sum_{I \subseteq [k]} {\left(\prod_{j \in I} {p_j} \prod_{j \notin I} {(1 - p_j)} f\left(\bigcup_{j \in I} {A_j} \right)\right)}. \] \end{lemma} The next Lemma appears in \cite{crs}, but its proof is slightly obfuscated within Lemma B.2. For clarity, we present it here on its own. \begin{lemma}[\cite{crs}]\label{lem:crs} Let $a_1 \geq \dots \geq a_m \in \Rp$, and $q_1, \dots, q_m \in [0, 1]$ such that $\sum_{k = 1}^m {q_k} = 1$. Then \[ \sum_{k = 1}^m {q_k \: a_k \prod_{j = 1}^{k-1} {(1 - q_j)}} \geq \left(1 - \frac{1}{e}\right) \cdot \sum_{j = 1}^m {q_j a_j}. \] \end{lemma} \begin{proof} Since the above inequality is linear in the parameters $a_i$, it suffices to prove it for the special case $a_1 = a_2 = \dots = a_r = 1$ and $a_{r+1} = \dots = a_m = 0$. (A general decreasing sequence of $a_j$ can be obtained as a positive linear combination of such special cases). Hence, it remains to prove \[ \sum_{k = 1}^r {q_k \prod_{j = 1}^{k-1} {(1 - q_j)}} \geq \left(1 - \frac{1}{e}\right) \cdot \sum_{j = 1}^r {q_j}. \] We start from the left-hand side, which we expand to \[ \sum_{k = 1}^r {q_k \prod_{j = 1}^{k-1} {(1 - q_j)}} = 1 - \prod_{k = 1}^r {(1 - q_k)} \geq 1 - {\left(1 - \frac{1}{r} \sum_{k = 1}^r {q_k} \right)}^r, \] where the inequality follows from the arithmetic-geometric mean inequality. Finally, we use the concavity of $\phi_r(x) \coloneqq 1 - {\left(1 - \frac{x}{r}\right)}^r$, and the fact that $\phi_r(0) = 0$, to get \[ \phi_r(x) \geq \phi_r(1) \cdot x = \left(1 - {\left(1 - \frac{1}{r}\right)}^r\right) \cdot x \] for $x \in [0, 1]$. Since $\left(1 - {\left(1 - \frac{1}{r}\right)}^r\right) \geq \left(1 - \frac{1}{e}\right)$ for all $r$, we get \[ \phi_r(x) \geq \left(1 - \frac{1}{e}\right) \cdot x. \] which implies that \[ \phi_r\left(\sum_{k = 1}^r {q_k} \right) = 1 - {\left(1 - \frac{1}{r} \sum_{k = 1}^r {q_k} \right)}^r \geq \left(1 - \frac{1}{e}\right) \cdot \sum_{k = 1}^r {q_k}. \] \end{proof} \subsection{Constraints and rounding via Contention Resolution Schemes}\label{app:background2} Let $\cN$ be a finite ground set. A constraint family over $\cN$ is simply a subset $\cI \subseteq 2^\cN$; a set $S \in \cI$ is called feasible, while a set $S \not \in \cI$ is called infeasible. We are interested only in downward-closed families of constraints; $\cI$ is downward-closed if and only if $A \in \cI$ implies that any set $B \subset A$ is also in $\cI$. Classical examples of downward-closed families include those induced by a matroid on $\cN$ or intersections of several matroids on $\cN$, independent sets of graphs, matchings in graphs and hypergraphs, boolean vectors that satisfy packing constraints of the form $A\bm{x} \le b$ for non-negative $A,b$, among many others. We will use the terminology $(\cN,\cI)$ to indicate a constraint family. The maximum weight independent set problem over $(\cN,\cI)$ is the following: given $w: \cN \rightarrow \mathbb{R}$ solve $\max_{S \in \cI} w(S)$ where $w(S) = \sum_{e \in \cN} w(e)$. Since many of these problems are NP-Hard, a common technique is to use polyhedral (or more generally convex) relaxations. We say $\cP \subseteq [0,1]^\cN$ is a polyhedral relaxation of $(\cN,\cI)$ if $\cP$ is a polyhedron and $\1_S \in \cP$ for all $S \in \cI$ (here $\1_S$ is the characteristic vector of $S$). We say that $\cP$ is \emph{solvable} if one can efficiently do linear optimization over $\cP$, that is, given $w : \cN \rightarrow \mathbb{R}$, there is a polynomial time algorithm that computes $\max_{\bm{x} \in \cP} \sum_i w_ix_i$. Via the multilinear relaxation, the polyhedral approach to approximation has been extended successfully to submodular function maximization \cite{ccpv,crs,bf-survey}. \paragraph{Contention Resolution Schemes:} These are rounding schemes introduced in \cite{crs} for submodular function maximization. \begin{definition}[Contention Resolution Scheme] Let $b, c \in [0,1]$. A $(b, c)$-balanced {\em Contention Resolution Scheme} $\pi$ for $\cP_\cI$ is a procedure that for every $\bm{x} \in b \cdot \cP_{\cI}$ and $A \subseteq \cN$, returns a random set $\pi_{\bm{x}}(A) \subseteq A \cap \text{support}(\bm{x})$ and satisfies the following properties: \begin{enumerate} \item $\pi_{\bm{x}}(A) \in \cI$ with probability $1, \quad \forall A \subseteq \cN, \bm{x} \in b \cdot \cP_{\cI}$, and \item for all $i \in \text{support}(\bm{x})$, $\Pr\brk{i \in \pi_{\bm{x}}(R(\bm{x})) \midd i \in R(\bm{x})} \geq c, \quad \forall \bm{x} \in b \cdot \cP_{\cI}$. \end{enumerate} The scheme is said to be {\em monotone} if $\Pr\brk{i \in \pi_{\bm{x}}(A_1)} \geq \Pr\brk{i \in \pi_{\bm{x}}(A_2)}$ whenever $i \in A_1 \subseteq A_2$. \end{definition} CRSs are offline rounding schemes. {\em Online Contention Resolution Schemes (OCRS)} were introduced by Feldman, Svensson and Zenklusen \cite{ocrs} to handle online settings such as the SPI\xspace problem where the arrival order of the elements is adversarial. {\em Random Order Contention Resolution Schemes (ROCRS)} were introduced by \cite{rocrs} to handle the cases where the arrival of the elements is a uniformly random permutation. \begin{definition}[Online Contention Resolution Scheme (OCRS)] Let us consider the following online selection setting. A point $\bm{x} \in \cP$ is given and let $R(\bm{x})$ be a random subset of active elements. The elements $e \in \cN$ reveal one by one whether they are active, i.e., $e \in R(\bm{x})$, and the decision whether to select an active element is taken irrevocably before the next element is revealed. An {\em Online Contention Resolution Scheme} for $\cP$ is an online algorithm that selects a subset $I \subseteq R(\bm{x})$ such that $\1_I \in \cP$. \end{definition} Monotonicity of a CRS is important for rounding the multilinear relaxation of submodular functions \cite{crs}, although such a condition is not needed for modular functions. In the online setting, \cite{ocrs} defines the notion of a \emph{greedy} OCRS which is helpful in rounding for submodular functions. \begin{definition}[Greedy OCRS] Let $\cP \subseteq {[0,1]}^n$ be a relaxation for the feasible sets $\cF \subseteq 2^\cN$. A {\em greedy OCRS} $\pi$ for $\cP$ is an OCRS that for any $\bm{x} \in \cP$ defines a down-closed subfamily of feasible sets $\cF_{\pi, \bm{x}} \subseteq \cF$, and an element $e$ is selected when it arrives if, together with the already selected elements, the obtained set is in $\cF_{\pi, \bm{x}}$. If the choice of $\cF_{\pi, \bm{x}}$ given $\bm{x}$ is randomized, we talk about a randomized greedy OCRS; otherwise, we talk about a deterministic greedy OCRS. \end{definition} For a greedy OCRS, the quality of the approximation guaranteed with respect to the multilinear relaxation is governed by the notion of $(b,c)$-selectability \cite{ocrs}. \begin{definition}[$(b,c)$-selectability] Let $b, c \in [0,1]$. A greedy OCRS for $\cP$ is $(b, c)$-selectable if for any $\bm{x} \in b \cdot \cP$, we have \[ \Pr\brk{I \cup \{e\} \in \cF_{\pi, \bm{x}} \quad \forall I \subseteq R(\bm{x}), \: I \in \cF_{\pi, \bm{x}}} \geq c, \quad \forall e \in \cN. \] \end{definition} \section{Correlation Gap for Non-Negative Submodular Functions} \label{app:correlation-gap} In this section we prove Theorems~\ref{thm:intro-gap} and \ref{thm:intro-gap-mcg2} on the correlation gap for non-negative submodular functions. Theorem~\ref{thm:intro-gap} is a direct approach to the correlation gap, whereas Theorem~\ref{thm:intro-gap-mcg2} utilizes the Measured Continuous Greedy algorithm. The proofs of the theorems are qualitatively different and we present them in separate sections. \subsection{Proof of Theorem~\ref{thm:intro-gap}} We split the proof into two parts, the upper bound and the lower bound, state them separately and give their proof. \paragraph{Upper bound:} As we remarked in Section~\ref{sec:intro}, the proof of this upper bound is inspired by the proof in \cite{crs} for the monotone case, which is different from the earlier one in \cite{vondrak}. \begin{theorem}\label{thm:upper-gap} Let $f : 2^\cN \to \Rp$ be a non-negative submodular function, where $n = |\cN|$. Let $\bm{x} \in {[0, 1]}^n$, such that $\bm{x} \leq p \cdot \bm{1}_\cN$ for some $p \in [0,1]$. Then, \[ F(\bm{x}) \geq (1-p) \left(1 - \frac{1}{e}\right) f^+(\bm{x}). \] \end{theorem} \begin{proof} Consider a basic feasible solution ${(q_j, A_j)}_{j \in [m]}$ to the linear program that defines $f^+(\bm{x})$. In other words, $f^+(\bm{x}) = \sum_{j = 1}^m {q_j f(A_j)}$, where $\sum_{j = 1}^m {q_j} = 1$, $\sum_{j : i \in A_j} {q_j} = x_i$, for all $i$, and $q_j \geq 0$ for all $j$. Notice that, since we chose a basic feasible solution and the LP that defines $f^+(\bm{x})$ has only $n + 1$ constraints, apart from the non-negativity constraints, we have $m \leq n + 1$. Next, consider the following process to generate a subset of elements. For each $j \in [m]$ sample independently each element of $A_j$ with probability $q_j$. An element $i \in \cN$ is not selected with probability equal to $\prod_{j : i \in A_j} {(1 - q_j)}$, thus, $i$ is selected with probability equal to $1 - \prod_{j : i \in A_j} {(1 - q_j)}$. Notice that we can assume without loss of generality that $q_j \neq 1$ for all $j$; if $q_j = 1$ for some $j$ then that implies that $x_i = 1$ for every element $i \in A_j$, and $q_{j'} = 0$ for all $j' \neq j$, which then leads us to $F(\bm{x}) = f(A_j) = f^+(\bm{x})$. However, we want to make each element $i$ to be selected with probability exactly equal to $x_i = \sum_{j : i \in A_j} {q_j}$. To do this, we simply need to sample again each element $i$ with probability $r_i$, where \begin{align}\label{eq:rs} 1 - (1 - r_i) \cdot \prod_{j : i \in A_j} {(1 - q_j)} &= \sum_{j : i \in A_j} {q_j}. \end{align} It is easy to see that $0 \leq r_i \le x_i \le p$. Consider the sampling scheme described above, and let $R$ denote a random set created via this sampling scheme. Notice that in our sampling scheme, each element $i$ is chosen independently with probability $x_i$, which implies that $\E_R[f(R)] = F(\bm{x})$. We consider $m+n$ sets $B_1,B_2,\ldots,B_{m+n}$ where $B_j = A_j$ for $1 \leq j \leq m$, and $B_{m+i} = \{i\}$ for $1 \leq i \leq n$. Let $\cJ$ denote a random subset of $[m+n]$ obtained by including each $j \in \{1, 2, \dots, m\}$ independently with probability $q_j$ and each $i \in \{m+1,m+2, \dots, m+n\}$ independently with probability $r_i$. Also, let $R' \subseteq \cN$ denote a random set where \[ R' = \bigcup_{j \in \cJ} B_j. \] The next claim is based on the submodularity of $f$. \begin{claim}\label{clm:sampl-submod} \[ F(\bm{x}) \geq \E_{\cJ}\left[f(R')\right]. \] \end{claim} \begin{proof} Since $F(\bm{x}) = \E_R[f(R)]$, it suffices to show that \[ \E_{R}\left[f(R)\right] \geq \E_{\cJ}\left[f(R')\right]. \] We apply Lemma \ref{lem:sampling} for $k = m+n$, $A_j = B_j$ for $1 \leq j \leq m+n$, $p_j = q_j$ for $1 \leq j \leq m$, and $p_{m+i} = r_i$ for $1 \leq i \leq n$. Notice that \[ \E_{R}\left[f(R)\right] = \E\left[f\left(\bigcup_{i = 1}^k B_i(p_i)\right)\right], \] while \[ \E_{\cJ}\left[f(R')\right] = \sum_{I \subseteq [k]} {\left(\prod_{j \in I} {p_j} \prod_{j \notin I} {(1 - p_j)} f\left(\bigcup_{j \in I} {B_j} \right)\right)}, \] and thus, by Lemma \ref{lem:sampling}, we get \[ \E_{R}\left[f(R)\right] \geq \E_{\cJ}\left[f(R')\right]. \] \end{proof} \begin{claim}\label{clm:conditioning} \[ \E_{\cJ}\left[f(R')\right] \geq (1-p) \left(1 - \frac{1}{e}\right) \cdot f^+(\bm{x}). \] \end{claim} \begin{proof} Assume, without loss of generality, that $f(A_1) \geq \dots \geq f(A_m)$. We analyze $\E[f(R')]$ by conditioning on the minimum index $j$ that belongs to $\cJ$. For $k \in [m]$, let \[ J_k = \set{I \subseteq [m+n] \: \midd \: k \in I \text{ and } \ell \notin I, \forall \ell < k}. \] Furthermore, for $k \in [m]$ define the set function $g_k:2^\cN \rightarrow \Rp$ where $g_k(S) = f(B_k \cup S)$ for all $S \subseteq \cN$. It is easy to verify that $g_k$ is non-negative and submodular because $f$ is non-negative and submodular. $\cJ \in J_k$ implies that $B_k \subseteq R'$, hence, \begin{align*} \E_{\cJ}[f(R') \mid \cJ \in J_k] &= \E_{\cJ}\brk{f(B_k \cup (R' \setminus B_k)) \midd \cJ \in J_k} \\ &= \E_{\cJ}[g_k(R' \setminus B_k) \mid \cJ \in J_k]. \end{align*} For any fixed $i \in \cN$ we analyze the probability that $i \in R' \setminus B_k$ conditioned on $\cJ \in J_k$. Using independence of the choice of each index in $\cJ$ we obtain the following. \begin{align*} \Pr_{\cJ}[i \in (R' \setminus B_k) \mid \cJ \in J_k] &= 1 - (1 - r_i) \prod_{j : i \in A_j, k < j \le m} {(1 - q_j)} \\ & \le 1 - (1 - r_i) \prod_{j : i \in A_j, j \in [m]} (1 - q_j) \\ &= x_i \leq p. \end{align*} Thus, applying Lemma \ref{lem:buchbinder} to $g_k$ yields \[ \E_{\cJ}[g_k(R'\setminus B_k) \mid \cJ \in J_k] \geq (1-p) g_k(\emptyset) = (1-p) f(B_k). \] Combining the above, \begin{equation}\label{eq:cond-prob} \E_{\cJ}\left[f(R') \midd \cJ \in J_k \right] \geq (1-p) \cdot f(B_k). \end{equation} Also notice that \begin{equation}\label{eq:prob} \Pr_{\cJ}[\cJ \in J_k] = \Pr_{\cJ}[k \in \cJ] \cdot \prod_{j = 1}^{k-1} {\left(1 - \Pr_{\cJ}[j \in \cJ]\right)} = q_k \cdot \prod_{j = 1}^{k-1} {(1 - q_j)}. \end{equation} Therefore, \begin{align}\label{eq:cond} \E_{\cJ}\left[f(R')\right] & = \sum_{k = 1}^m {\Pr_{\cJ}[\cJ \in J_k] \cdot \E_{\cJ}\left[f(R') \midd \cJ \in J_k \right]} \nonumber \\ &\qquad + \Pr_{\cJ}\left[\cJ \cap [m] = \emptyset \right] \cdot \E_{\cJ}\left[f(R') \midd \cJ \cap [m] = \emptyset \right] \nonumber \\ & \geq \sum_{j = 1}^m {\Pr_{\cJ}[\cJ \in J_k] \cdot \E_{\cJ}\left[f(R') \midd \cJ \in J_k \right]} \nonumber \\ & \geq \sum_{k = 1}^m {\Pr_{\cJ}[\cJ \in J_k] \cdot (1-p) \cdot f(B_k)} \nonumber \\ & = (1 - p) \sum_{k = 1}^m {q_k f(B_k) \prod_{j = 1}^{k-1} {(1 - q_j)}}, \end{align} where the first inequality follows from the non-negativity of $f$, the second inequality follows from \eqref{eq:cond-prob} and the last equality from \eqref{eq:prob}. However, for $1 \leq k \leq m$, we have $B_k = A_k$, and thus \[ \E_{\cJ}\left[f(R')\right] \geq (1 - p) \sum_{k = 1}^m {q_k f(A_k) \prod_{j = 1}^{k-1} {(1 - q_j)}}. \] Finally, utilizing Lemma \ref{lem:crs} for $a_k = f(A_k)$ , we get that \begin{equation}\label{eq:crs} \sum_{k = 1}^m {q_k f(A_k) \prod_{j = 1}^{k-1} {(1 - q_j)}} \geq \left(1 - \frac{1}{e}\right) \cdot \sum_{j = 1}^m {q_j f(A_j)} = \left(1 - \frac{1}{e}\right) \cdot f^+(\bm{x}). \end{equation} Combining \eqref{eq:cond} and \eqref{eq:crs}, \[ \E_{\cJ}\left[f(R')\right] \geq (1-p) \left(1 - \frac{1}{e}\right) \cdot f^+(\bm{x}). \] \end{proof} Finally, combining Claims \ref{clm:sampl-submod} and \ref{clm:conditioning}, we obtain \[ F(\bm{x}) \geq (1-p) \left(1 - \frac{1}{e}\right) \cdot f^+(\bm{x}), \] which completes the proof. \end{proof} \paragraph{Lower bound:} A simple example on $n = 2$ shows that $F(\bm{x}) \le (1-p)f^+(\bm{x})$; the function is the cut function of a directed graph on two vertices. For monotone functions, a simple coverage example shows that $F(\bm{x}) \le (1-1/e) f^+(\bm{x})$. We combine and generalize these two examples to create an instance for non-monotone functions and obtain the following theorem. \begin{theorem}\label{thm:lower-gap} There exists a non-negative submodular function $f : 2^\cN \to \Rp$ such that, for any $0 \leq p \leq 1$, there exists an $\bm{x} \in {[0,1]}^n$ where $\|\bm{x}\|_\infty \leq p$ and \[ F(\bm{x}) \leq \left(1 - e^{-(1-p)}\right) f^+(\bm{x}). \] \end{theorem} \begin{proof} Consider the following graph $G = (V, E)$, where $V = \{u_1, \dots, u_n, v\}$, and $E = \{(u_i, v) \mid 1 \leq i \leq n\}$. Let $x_{u_i} = \frac{1-p}{n}$ for all $i \in \{1, \dots, n\}$ and $x_v = p$. We define a function $f : 2^V \to \Rp$ as follows \[ f(S) = \begin{cases} 1 & \text{if } v \notin S \text{ and } S \neq \emptyset, \\ 0 & \text{otherwise.} \end{cases} \] \begin{figure}[!ht] \centering \includegraphics[width=0.5\textwidth]{graph.png} \caption{Graph $G$ which yields the desired lower bound.} \end{figure} It is easy to see that $f$ is submodular. Notice that \[ f^+(\bm{x}) = 1 - p, \] as the coefficients that maximize $\sum_S {a_S f(S)}$ subject to the constraints are $a_{\{v\}} = p$, $a_{\{u_i\}} = \frac{1 - p}{n}$ for all $i \in \{1, \dots, n\}$ and $a_S = 0$, for $|S| \neq 1$. In other words, $a_{\{u\}} = x_u$ for all $u \in V$, and $a_S = 0$, if $|S| \neq 1$. Next, notice that, if $R(\bm{x}) \subseteq V$ is a random set, where each element $u \in V$ is sampled with probability $x_u$, then $f(R(\bm{x})) = 1$ if and only if $v$ is not selected in $R(\bm{x})$, but at least one element of $V \setminus \{v\}$ is selected. Therefore, \[ F(\bm{x}) = \E[f(R(\bm{x}))] = (1-p) \cdot \left(1 - {\left( 1 - \frac{1-p}{n}\right)}^n\right), \] which implies that \[ \frac{F(\bm{x})}{f^+(\bm{x})} = \frac{(1-p) \cdot \left(1 - {\left( 1 - \frac{1-p}{n}\right)}^n\right)}{1 - p} = 1 - {\left( 1 - \frac{1-p}{n}\right)}^n. \] As $n \to \infty$, we get \[ \lim_{n \to \infty} {1 - {\left( 1 - \frac{1-p}{n}\right)}^n} = 1 - e^{-(1-p)}. \] We conclude that, for any $0 \leq p < 1$, when $x_i \leq p$ for all $i$, \[ F(\bm{x}) \leq \left(1 - e^{-(1-p)}\right) f^+(\bm{x}). \] \end{proof} \subsection{Proof of Theorem~\ref{thm:intro-gap-mcg2}} The proof of the correlation gap is via the Measured Continuous Greedy (MCG\xspace) algorithm and its analysis \cite{mcg}, when applied to an appropriate polytope. Earlier, we remarked that known results on the MCG\xspace algorithm \cite{mcg, rocrs} imply that $F_{\max}(\bm{x}) \geq \frac{1}{e} f^+(\bm{x})$. We quickly sketch the idea implicit in prior work, before we proceed. Let $f:2^\cN \rightarrow \Rp$ be a non-negative submodular function and let $\bm{x} \in [0,1]^n$, where $n = |\cN|$. Consider a down-closed polytope $\cP$ defined by all points in $[0,1]^n$ dominated by the given point $\bm{x}$: $\cP \coloneqq \set{\bm{y} \in [0,1]^n \midd \forall \: 1 \leq i \leq n, \: \: y_i \leq x_i}$. Suppose we run the MCG\xspace algorithm on $\cP$. From Lemma 8.3 of \cite{rocrs} for $b = 1$, for any $\eps > 0$, the algorithm can be used to find a point $\bm{z}_\eps \in \cP$ such that $F(\bm{z}_\eps) \geq \prn{\frac{1}{e} - \eps} \max_{\bm{y} \in \cP} {f^+(\bm{y})} \geq \prn{\frac{1}{e} - \eps} f^+(\bm{x})$. Since such a point $\bm{z}_\eps \in \cP$ exists for any $\eps >0$, by the compactness of $\cP$ and the continuity of $F$ and $f^+$, it follows that there exists a point $\bm{y} \in \cP$ such that $F(\bm{y}) \geq \frac{1}{e} \cdot f^+(\bm{x})$. Also notice that $\bm{x} \in \cP$, and thus \[ F_{\max}(\bm{x}) = \max_{\bm{z} \in \cP} {F(\bm{z})} \geq F(\bm{y}) \geq \frac{1}{e} \cdot f^+(\bm{x}). \] To prove Theorem~\ref{thm:intro-gap-mcg2}, we use the same proof outline as above, but in the algorithm's analysis, we take advantage of the fact that $\|\bm{x}\|_{\infty} \le p$. Theorem~\ref{thm:intro-gap-mcg2} generalizes Lemma 8.3 in \cite{rocrs}, used above. \mcggap* \begin{proof} Let $\bm{\hat{x}} = \argmax_{\bm{z} \in \cP} {f^+(\bm{z})}$. Recall that there exists $\bm{\alpha} \in [0,1]^{2^\cN}$ such that \[ f^+(\bm{\hat{x}}) = \sum_{S \subseteq \cN} {\alpha_S f(S)}, \quad \sum_{S \subseteq \cN} {\alpha_S} = 1 \: \: \text{ and } \: \: \sum_{S \subseteq \cN} {\alpha_S \1_S} = \bm{\hat{x}}. \] From the analysis of Measured Continuous Greedy and the fact that $\bm{x}(b) \in \cP$, we know that, at time $b$, for all $i \in \cN$ we have \[ x_i(b) \leq \min\{1 - e^{-b}, p\}. \] Let $\bm{x} = \bm{x}(b)$, and, for $S \subseteq \cN$, consider a line of direction $\bm{d}_S = (\bm{x} \vee \1_S) - \bm{x} = (\1_S - \bm{x}) \vee \bm{0}$. Notice that $\bm{0} \leq \bm{d}_S \leq \1_S$ for all $S \subseteq \cN$. From Section 2.3 of \cite{ccpv}, it follows that \[ \bm{d}_S \cdot \nabla F(\bm{x}) \geq F(\bm{x} \vee \1_S) - F(\bm{x}). \] Since $f$ may not be monotone, $\nabla F(\bm{x})$ may have negative entries. Let $\bm{d'}_S$ be a vector obtained from $\bm{d}_S$ as follows: $\prn{\bm{d'}_S}_i = \prn{\bm{d}_S}_i$ if ${\nabla F(\bm{x})}_i \geq 0$, otherwise $\prn{\bm{d'}_S}_i = 0$. We have $\bm{0} \leq \bm{d'}_S \leq \bm{d}_S$ and, \[ \bm{d'}_S \cdot \nabla F(\bm{x}) \geq \max\{0, \bm{d}_S \cdot \nabla F(\bm{x})\} \geq \max\{0, F(\bm{x} \vee \1_S) - F(\bm{x})\}. \] Since ${\bm{x}(b)}_i \leq \min\{1 - e^{-b}, p\}$ for all $i \in \cN$, by Lemma III.5 of \cite{mcg}, we have \[ F(\bm{x} \vee \1_S) \geq \prn{1 - \min\{1 - e^{-b}, p\}} f(S). \] Therefore, \begin{align*} \bm{d'}_S \cdot \nabla F(\bm{x}) &\geq \max\{0, (1-p) f(S) - F(\bm{x}), e^{-b} f(S) - F(\bm{x})\} \\ &\geq \max\{1-p, e^{-b}\} f(S) - F(\bm{x}). \end{align*} Next, let $\bm{\hat{d}} = \sum_{S \subseteq \cN} {\alpha_S \bm{d'}_S}$. Since $\bm{d}_S \leq \1_S$ and $\bm{d'}_S \leq \bm{d}_S$, we have $\bm{d'}_S \leq \1_S$, and thus \[ \bm{\hat{d}} = \sum_{S \subseteq \cN} {\alpha_S \bm{d'}_S} \leq \sum_{S \subseteq \cN} {\alpha_S \1_S} = \bm{\hat{x}}. \] Since $\cP$ is downward-closed and $\bm{\hat{x}} \in \cP$, we know that $\bm{\hat{d}} \in \cP$. Therefore, from the above and the fact that $\bm{v}_{\text{max}} = \argmax_{\bm{v} \in \cP} {\bm{v} \cdot \nabla F(\bm{x})}$, we have \begin{align*} \der{F(\bm{x}(b))}{b} &= \bm{v}_{\text{max}}(\bm{x}) \cdot \nabla F(\bm{x}) \\ &\geq \bm{\hat{d}}_S \cdot \nabla F(\bm{x}) \\ &= \sum_{S \subseteq \cN} {\alpha_S \cdot \bm{d'}_S \cdot \nabla F(\bm{x})} \\ &\geq \sum_{S \subseteq \cN} {\alpha_S \prn{\max\{1-p, e^{-b}\} f(S) - F(\bm{x})}} \\ &\geq \max\{1-p, e^{-b}\} \sum_{S \subseteq \cN} {\alpha_S f(S)} - \sum_{S \subseteq \cN} {\alpha_S F(\bm{x})} \\ &\geq \max\{1-p, e^{-b}\} f^+(\bm{\hat{x}}) - F(\bm{x}). \end{align*} We proceed to solve the above differential inequality. For brevity, let $y = F(\bm{x})$. Then, \begin{gather} \dif{y} + y \dif{b} \geq f^+(\bm{\hat{x}}) \max\{1-p, e^{-b}\} \dif{b} \nonumber \\ e^b \dif{y} + y e^b \dif{b} \geq f^+(\bm{\hat{x}}) \max\{(1-p) e^b, 1\} \dif{b} \nonumber \\ \dif{\prn{y e^b}} \geq f^+(\bm{\hat{x}}) \max\{(1-p) e^b, 1\} \dif{b} \nonumber \\ \label{eq:refined-1} y \geq e^{-b} f^+(\bm{\hat{x}}) \int_0^b {\max\{(1-p) e^u, 1\} \dif{u}}. \end{gather} Notice that, for $0 \leq u \leq \ln{\prn{\frac{1}{1-p}}}$, we have $(1-p) e^u \leq 1$, while for $\ln{\prn{\frac{1}{1-p}}} \leq u \leq 1$, we have $1 \leq (1-p) e^u$. Therefore, for $b \leq \ln{\prn{\frac{1}{1-p}}}$, \eqref{eq:refined-1} becomes \[ y \geq e^{-b} f^+(\bm{\hat{x}}) \int_0^b {1 \dif{u}} = b \cdot e^{-b} \cdot f^+(\bm{\hat{x}}), \] whereas for $b \geq \ln{\prn{\frac{1}{1-p}}}$, \eqref{eq:refined-1} becomes \begin{align*} y &\geq e^{-b} f^+(\bm{\hat{x}}) \prn{\int_0^{\ln{\prn{\frac{1}{1-p}}}} {1 \dif{u}} + \int_{\ln{\prn{\frac{1}{1-p}}}}^{b} {(1-p) e^u \dif{u}}} \\ &= \prn{1 - p - e^{-b}\prn{1 + \ln{(1-p)}}} f^+(\bm{\hat{x}}). \end{align*} We conclude that \[ F(\bm{x}(b)) \geq \begin{cases} b \cdot e^{-b} \cdot \max_{\bm{z} \in \cP} {f^+(\bm{z})}, & \text{for } 0 \leq b \leq \ln{\prn{\frac{1}{1-p}}} \\ \prn{1 - p - e^{-b} \prn{1 + \ln{(1-p)}}} \cdot \max_{\bm{z} \in \cP} {f^+(\bm{z})}, & \text{for } \ln{\prn{\frac{1}{1-p}}} \leq b \leq 1. \end{cases} \] \end{proof} \section{Reduction to Small Probabilities}\label{app:reduction} \begin{observation}[Observation~\ref{obs:reduction}] Let $I = (\cN, \cU, \bm{D}, \bm{X}, f, \cC)$ be an instance of the Submodular Prophet Inequality problem. For every fixed $\eps > 0$, there is a reduction of $I$ to another instance $I' = (\cN, \cU', \bm{D'}, \bm{Y}, g, \cC)$ of the SPI problem such that that (i) for all $e \in \cU'$, $\bm{D'}(e) \le \eps$ and (ii) there exists an $\alpha$-competitive algorithm for $I$ if and only if there exists an $\alpha$-competitive algorithm for $I'$. \end{observation} \begin{sketch} Consider the original instance $I$ and recall that each $\cD_i$ is a probability distribution over $\cU_i$. Our goal is to ensure that $\cD_i(e) \le \eps$ for every $e \in \cU_i$. Suppose there is an element $e$ such that $\cD_i(e) > \eps$. We obtain a new instance $I'$ as follows. We replace $e \in \cU_i$ by $h = \ceil{1/\eps}$ ``copies'' $e_1,e_2,\ldots,e_h$; let $S_e$ denote this set of copies. Let $\cU'_i$ be the new set of elements. We obtain a probability distribution $\cD'_i: \cU'_i \rightarrow [0,1]$ as follows. If $e' \in \cU_i$ such that $e' \neq e$ then $\cD'_i(e') = \cD_i(e')$ (nothing changes for $e'$). For each copy $e_j$ of $e$ we set $\cD'_i(e_j) = \cD_i(e)/h$ and by our choice of $h$ we have $\cD'_i(e_j) \le 1/h \le \eps$, for all $e_j \in S_e$. Thus, $\sum_{j=1}^h \cD'_i(e_j) = \cD_i(e)$. Since we replaced $e$ by $h$ copies of it, the ground set $\cU$ changes to $\cU'$ and we now define a new submodular function $g:\cU' \rightarrow \mathbb{R}_+$ that is derived from $f$. The function $g$ treats the copies of $e$ as a ``single'' element and hence mimics $f$. More formally, for any $A \subseteq \cU'$: $g(A) = f(A)$ if $A \cap S_e = \emptyset$, else $g(A) = f((A \setminus S_e) \cup \{e\})$. It is easy to verify that if $f$ is non-negative and submodular, then $g$ is also non-negative and submodular, and also inherits monotonicity from $f$. Let $I'$ be the resulting modified instance. We observe that in $I'$, the probability of an element from $S_e$ being chosen is precisely equal to $\cD_i(e)$ and hence the copies of $e$ act as proxies for $e$ and the submodular function $g$ ensures that every copy behaves the same as $e$ in $f$. Note that we crucially relied on the power of submodularity in this reduction. One can apply this reduction repeatedly to reduce all realization probabilities to at most $\eps$. One also notices that the reduction is computationally efficient as a function of $\eps$. For any fixed $\eps$, the size of $I'$ is at most $O(1/\eps)$ times the size of $I$ and a value oracle for $f$ can be used to efficiently and easily obtain a value oracle for the new submodular function $g$. \end{sketch} \section{Submodular Prophet Secretary}\label{app:sps} A natural question for the prophet inequality setting is whether one can obtain better prophet inequalities when the arrival order of the random variables is not chosen by the adversary but instead is chosen uniformly at random or even chosen by the algorithm. In \cite{esf-prophsec}, the authors introduce the {\em prophet secretary} model, combining the best of both the secretary and prophet inequality worlds. In particular, in the prophet secretary model, the arrival order of the random variables is chosen uniformly at random. There has been much work on this model and we refer to \cite{Correa-survey,EhsaniHKS18} for several interesting results in this and related models. We can consider the {\em Submodular Prophet Secretary (SPS)} problem as a generalization of the standard prophet secretary problem. The setting of the SPS\xspace problem is exactly the same as the setting of the SPI\xspace problem, with the only difference being that the arrival order of the random variables in the SPS\xspace problem is chosen uniformly at random instead of adversarially. We note that our results use the OCRS for the given feasibility constraint in a black-box fashion, and thus we can use better contention resolution schemes to obtain stronger bounds for the random-order setting. Specifically, in \cite{rocrs}, the authors introduce the notion of a {\em Random Order Contention Resolution Scheme (ROCRS)}, which has improved guarantees compared to the adversarial order setting. We can use an ROCRS as a black-box, instead of an OCRS, to obtain improved bounds for the SPS\xspace problem. We do not present these bounds in this version of the paper. \section{Conclusion} \label{sec:conclusions} We presented a general framework for submodular prophet inequalities in the model of \cite{rs} via greedy Online Contention Resolution Schemes and correlation gaps. The framework yields substantially improved constant factor competitive ratios for both monotone and general submodular functions, and can be implemented in polynomial time for many classes of interesting constraints. The framework resolves the open question posed in \cite{Lucier-survey} regarding the model of \cite{rs}. Along the way, we strengthened the notion of correlation gap for non-negative submodular functions introduced in \cite{rs}, and provided a fine-grained variant of the standard correlation gap. For both cases, our bounds are cleaner and tighter. Moreover, we presented a refined analysis of the Measured Continuous Greedy algorithm for polytopes with small coordinates and general non-negative submodular functions, showing that, for these cases, it yields a bound that matches the bound of Continuous Greedy for the monotone case. An interesting open question is whether our fine-grained correlation gap for general non-negative submodular functions can be made tight. It is tempting to conjecture that the lower bound on the gap shown in Theorem \ref{thm:lower-gap} is tight for all values of $p$. We leave this as an interesting open problem to resolve. It is also interesting to obtain further improvements in the bounds we showed for SPI\xspace. Of particular interest is the cardinality constraint. \section{Introduction}\label{sec:intro} Prophet inequalities arose from stochastic optimization and stopping theory in the '70s. In the basic setting there are $n$ independent real-valued random variables $X_1,X_2,\ldots,X_n$ with prescribed distributions $\cD_1,\ldots,\cD_n$; they correspond to values of some items. An online algorithm (or agent) knows the distributions of the random variables a priori but sees their realizations in an \emph{adversarial} order, and has to choose exactly one of them. The algorithm has to make an irrevocable decision on whether to accept an item or not when it arrives. In the single item setting the first accepted item stops the process. The algorithm's performance is measured with respect to the value of a prophet who gets to see all the realizations and then picks the variable with the largest value. The expected value of the prophet is $V^* = \E[\max_i X_i]$. An online algorithm $\alpha$-competitive if its expected value is at least $\alpha V^*$. Krengel and Sucheston \cite{kren-such} showed that $1/2$ is the optimal competitive ratio for the single item setting. Secretary problems are closely related to prophet inequalities. In the classical version an online algorithm sees $n$ adversarially chosen values in a \emph{random order} and has to pick one item irrevocably and compete with the maximum value. A classical result of Dynkin \cite{dynkin} shows an optimal competitive ratio of $1/e$. There has been substantial recent interest in prophet inequalities and secretary problems in theoretical computer science. Initial interest arose from strong connections to online mechanism design and posted price mechanisms for revenue maximization \cite{haji, ChawlaHMS} (see \cite{Hartline-survey, Chawla-survey} for surveys on Bayesian mechanism design). Subsequent work explored several different variants including prophet inequality and secretary problems in more general settings. Of particular interest to us is the setting where multiple variables/items from $X_1,X_2,\ldots,X_n$ can be chosen such that the chosen items are feasible in some combinatorial constraint family. Two important examples are choosing $k$ items for some integer $k \ge 1$ \cite{Alaei14} and a further generalization where the items chosen are independent in a matroid \cite{klein-wein}. These generalizations had several motivations including algorithmic game theory, combinatorial optimization, stochastic optimization, and online algorithms. A rich body of work has emerged with several elegant and useful results. We refer the reader to surveys on prophet inequalities by Lucier \cite{Lucier-survey} and Correa et al.\ \cite{Correa-survey}, a survey by Dinitz on the secretary problem \cite{Dinitz-survey} and by Gupta and Singla generally on random-order models \cite{GuptaS-survey}, for several pointers to the extensive literature on these problems and related topics. \medskip \noindent {\bf Combinatorial Prophet Inequalities:} Prophet inequalities and secretary problems were mostly studied with modular/additive objective functions, by which we mean that the total value of a subset $S$ of variables is simply the sum of their values. However, more general combinatorial objective functions have many useful applications. By a combinatorial objective we mean that the value of a subset of items from $[n]$ is specified by a set function $f:2^{[n]} \rightarrow \mathbb{R}$. Prominent examples are submodular\footnote{A real-valued set function $f:2^\cN \rightarrow \mathbb{R}$ is submodular if and only if $f(A) + f(B) \ge f(A \cup B) + f(A \cap B)$ for all $A,B \subseteq \cN$. } and subadditive\footnote{A real-valued set function $f:2^\cN \rightarrow \mathbb{R}$ is subadditive if $f(A \cup B) \le f(A) + f(B)$ for all $A, B \subseteq \cN$. A non-negative submodular function is subadditive.} set functions, and their special cases. The secretary problem was studied with submodular objectives and it was shown that it can be reduced to the modular case with a constant factor loss \cite{submod-sec}. This motivated Rubinstein and Singla to define a model of combinatorial prophet inequalities which is the main object of study in this paper. We restrict our attention to submodular objectives which form a rich class and, following \cite{rs}, we refer to this as the Submodular Prophet Inequality (SPI\xspace) problem. The model defined by Rubinstein and Singla is the following elegant generalization of the standard prophet inequality problem. The input consists of $n$ independent random variables $X_1,X_2,\ldots,X_n$. Unlike the standard prophet inequality where $X_i$ is a real-valued random variable, in the combinatorial setting, each $X_i$ is a discrete-valued random variable over a finite set $\cU_i$. Thus $\cD_i$ is a discrete probability distribution over $\cU_i$. For technical reasons one assumes that $\cU_1,\cU_2,\ldots,\cU_n$ are mutually disjoint. Let $\cU = \bigcup_i \cU_i$. There is a non-negative submodular function $f:2^{\cU} \rightarrow \mathbb{R}_+$ defined over the ground set $\cU$. As in the standard prophet inequality setting, the variables arrive in an adversarial order. The online algorithm has to make irrevocable decisions about accepting the outcome of a variable after seeing its realization when it arrives, and its goal is to maximize the value $f(S)$ of the selected set $S \subseteq \cU$. What about the constraints? Recall that in the standard prophet inequality, the goal is to select a subset of variables from a feasible collection of sets. Similarly, we assume that there is a downward-closed family of sets $\cI \subseteq 2^{[n]}$, and it is required that the chosen variables belong to $\cI$. We emphasize that $\cI$ is defined over $[n]$ and not $\cU$. The prophet, which gets to see all the realizations, can optimize offline, and one can see that its expected profit is $\E[\max_{S \in \cI} f(\bigcup_{i \in S} \{X_i\})]$. We briefly motivate a scenario for the setup above. First, we observe that the standard prophet inequality with additive functions and arbitrary downward-closed constraints can be modeled by the combinatorial setting. We simply need to approximate a real-valued random variable $X_i$, sufficiently closely, by a discrete distribution over point values. This is relatively easy to do for most distributions of interest. Now consider the modeling power of the combinatorial setting. Suppose we have an online advertising situation where one sees on each day (or time slot) a customer of some type drawn from a known distribution. It is natural to assume that customer types are discrete (or can be approximated fairly well by a discrete distribution with a sufficiently large domain). The agency has to irrevocably decide whether to show an ad to the customer when they arrive. The agency has various constraints on the ads that it can show. For instance, there could be a budget constraint which dictates that at most $k$ ads can be shown overall which corresponds to picking $k$ days/variables from the set of $n$ arrivals. What is the value of serving the ads? That depends on the application at hand. Rich objective functions allow substantial flexibility in the ability to model the profit. For instance it is easy to imagine a decreasing marginal utility for showing ads to the same type of customers and this can be easily captured by submodular functions. The model proposed by \cite{rs} allows arbitrary submodular functions over the entire universe $\cU$, which is fairly powerful. The goal of our description is to point out the generality of the model as it relates to the traditional prophet inequality setting which has already seen many applications. Rubinstein and Singla showed that one can obtain an $O(1)$-competitive algorithm for SPI\xspace when the constraint on selecting the days is a matroid constraint. However, they did not explicitly consider the case of monotone submodular functions and they focused only on a single matroid constraint. Moreover, the constant they obtained is very large (in the thousands, although they did not try to optimize it) and they did not consider or emphasize the computational aspects of the online algorithm. We note that prophet inequalities in the standard setting of modular/additive objectives are fairly small. For instance, the well-known result of Kleinberg and Weinberg \cite{klein-wein} showed a bound of $1/2$ even for arbitrary matroid constraints, and it is also known that the bound for a cardinality constraint with $k$ items is $(1-O(1/\sqrt{k}))$ (hence it tends to $1$ as $k \rightarrow \infty$) \cite{Alaei14}. \medskip \noindent {\bf Motivation and technical challenges:} Our main motivation is to obtain improved bounds for SPI\xspace via a clean framework that applies to a wide variety of constraints. This question was explicitly raised by Lucier in his survey on prophet inequalities \cite{Lucier-survey}. Another motivation for this paper, related to the goal of obtaining improved bounds, comes from a technical tool that Rubinstein and Singla relied upon, namely the notion of the correlation gap. One reason for the large constant in their prophet inequality comes from the correlation gap they prove for non-negative submodular functions. In addition to the correlation gap bound, a second technical challenge comes from the model. On each day $i$ a single element from $\cU_i$ is realized. Thus the overall distribution over $\cU$ is correlated. Known rounding schemes for submodular functions such as (Online) Contention Resolution Schemes \cite{crs,ocrs,rocrs} rely on independence and one needs to suitably adapt them when handling general classes of constraints beyond a single matroid, considered in \cite{rs}. We describe the important notion of the correlation gap that is of independent interest beyond the prophet inequality setting. \smallskip \noindent \emph{Correlation gap of non-negative submodular functions:} The term correlation gap of a set function was introduced in the work of Agrawal et al.\ \cite{adsy-corgap} and has since found several applications. For any non-negative real-valued set function $f:2^\cN \rightarrow \mathbb{R}_+$ the correlation gap of $f$ is the worst-case ratio of two continuous extension of $f$, namely the multilinear extension $F$ and the concave closure $f^+$ \footnote{For some background on submodular functions along with several lemmas used throughout the paper see Appendix~\ref{app:background1}.}. In probabilistic terms, consider a distribution $\cD$ over $\cN = [n]$ with marginals given by $\bm{x} \in [0,1]^n$. The multilinear extension $F(\bm{x})$ measures the expected value of $f$ under the product distribution with marginals $\bm{x}$. The concave closure $f^+(\bm{x})$ gives the maximum expected value of $f$ over all distributions with marginals $\bm{x}$. The ratio $\inf_{\bm{x} \in [0,1]^n}\frac{F(\bm{x})}{f^+(\bm{x})}$ is the correlation gap. If $f$ is a modular/additive function, it is easy to see that the correlation gap is $1$. An important result in submodular optimization is that the correlation gap is at most $(1-1/e)$ for any \emph{monotone}\footnote{A real-valued set function $f$ is monotone if $f(A) \le f(B)$ whenever $A \subseteq B$.} submodular function \cite{adsy-corgap,ccpv,vondrak}. However, it is known that the correlation gap for general non-negative submodular functions (which can be non-monotone) can be arbitrarily small. Rubinstein and Singla \cite{rs} instead use the correlation gap of a related function, namely, $f_{\max}$ defined as follows: $f_{\max}(S) = \max_{T \subseteq S} f(T)$. The function $f_{\max}$ is monotone, but is in general not submodular, even when $f$ is. It is shown in \cite{rs} that for any non-negative submodular function $f$, $\inf_{\bm{x} \in [0,1]^n} \frac{F_{\max}(\bm{x})}{f^+(\bm{x})} \ge 1/200$, where $F_{\max}$ is the multilinear extension of $f_{\max}$. The main technical claim they prove is that $F\prn{\frac{1}{2} \bm{x}} \ge \frac{1}{200} f^+(\bm{x})$ for any $\bm{x} \in [0,1]^n$. The proof in \cite{rs} relies on existing tools but is involved and goes via another continuous extension. In this paper, we seek to improve the bound but also to give a refined analysis of the correlation gap for non-negative functions via a parameter $p = \max_{i \in \cN} x_i$. \subsection{Our contributions} In this paper we make two high-level contributions. First, we consider the correlation gap for non-negative submodular functions both in the original definition and in the modified sense of \cite{rs} described above. In both cases, we obtain substantially improved bounds. Second, we revisit the SPI\xspace problem and address three issues: (i) significantly improved constants for the prophet inequalities for monotone and non-monotone functions, (ii) a clean black-box reduction to greedy Online Contention Resolution Schemes that allows one to obtain prophet inequalities for various other constraints beyond a single matroid constraint and (iii) computational aspects of the prophet inequality that were not explicitly addressed in \cite{rs}. In essence, we answer the open question in \cite{Lucier-survey} in the affirmative. \paragraph{Correlation gap:} For a non-negative submodular function, for any given $p \in [0,1]$, there is a simple instance even when $n = 2$ such that $F(\bm{x}) \le (1-p)f^+(\bm{x})$ and this implies that, as $p$ tends to $1$, the correlation gap tends to $0$. In particular, it turns out that $p = \max_i x_i = |\bm{x}|_{\infty}$. This phenomenon manifests itself in non-monotone submodular function maximization in various ways and the typical way to overcome this is to restrict attention to settings where $p$ is away from $1$. Nevertheless, there has been little work on precisely quantifying the correlation gap as a function of this parameter. Our first theorem addresses this. \begin{theorem} \label{thm:intro-gap} Let $f:2^\cN \rightarrow \Rp$ be a non-negative submodular function and let $\bm{x} \in [0,1]^n$, where $n = |\cN|$. Let $p = \max_i x_i$. Then $F(\bm{x}) \ge (1-p)(1-1/e)f^+(\bm{x})$. Given any $p \in [0,1]$ there are instances such that $F(\bm{x}) \le (1-e^{-(1-p)})f^+(\bm{x})$. \end{theorem} The upper bound of $(1-p)(1-1/e)$ is optimal when $p$ is close to $0$ or when $p$ is close to $1$. The lower bound on the gap that we show, $1-e^{-(1-p)}$, agrees nicely with the extremes, but we do not know whether it is the right bound for all ranges of $p$ and leave it as an interesting open problem. We then consider the correlation gap considered by \cite{rs} with respect to the function $f_{\max}$. We observe that known results on the Measured Continuous Greedy (MCG\xspace) algorithm \cite{mcg,rocrs} show that $F_{\max}(\bm{x}) \ge \frac{1}{e}f^+(\bm{x})$. We strengthen this observation by considering the parameter $p$. \begin{theorem}\label{thm:intro-gap-mcg3} Let $f:2^\cN \rightarrow \Rp$ be a non-negative submodular function and let $\bm{x} \in [0,1]^n$, where $n = |\cN|$. Let $p = \max_i x_i$. There exists a point $\bm{y} \in [0,1]^n$, where $\bm{y} \le \bm{x}$ (coordinate wise), such that $F(\bm{y}) \ge \max\{\frac{1}{e}, (1-p-\frac{1}{e}(1 + \ln(1-p)))\} f^+(\bm{x})$. \end{theorem} We obtain the preceding theorem as a corollary of the following more technical theorem. \begin{restatable}{theorem}{mcggap}\label{thm:intro-gap-mcg2} Let $p \in [0,1)$, $f$ be a non-negative submodular function with multilinear extension $F$ and $\cP$ be a downward-closed solvable polytope\footnote{Informally, a polytope $\cP$ is solvable if one can efficiently do linear optimization over it. A formal definition is given in Appendix~\ref{app:background2}.} on $\cN$, such that $\cP \subseteq p \cdot [0,1]^{\cN}$ (that is, if $\bm{z} \in \cP$ then $z_i \leq p$ for all $i \in \cN$). Then, the output of the Measured Continuous Greedy (MCG\xspace) algorithm on $F$ and $\cP$ at time $b \in [0,1]$ is a vector $\bm{x}(b) \in b \cdot \cP$ such that \[ F(\bm{x}(b)) \geq \begin{cases} b \cdot e^{-b} \cdot \max_{\bm{z} \in \cP} {f^+(\bm{z})}, & \text{for } 0 \leq b \leq \ln{\prn{\frac{1}{1-p}}} \\ \prn{1 - p - e^{-b} \prn{1 + \ln{(1-p)}}} \cdot \max_{\bm{z} \in \cP} {f^+(\bm{z})}, & \text{for } \ln{\prn{\frac{1}{1-p}}} \leq b \leq 1. \end{cases} \] \end{restatable} Theorems~\ref{thm:intro-gap} and \ref{thm:intro-gap-mcg2} are useful when one has a situation where $p$ is already small and we will see later that this can indeed be achieved in some cases, such as in the SPI\xspace problem, via a reduction. \paragraph{Submodular Prophet Inequality:} For SPI\xspace we follow the high level framework of \cite{rs} via the correlation gap and greedy Online Contention Resolution Schemes (OCRSs) \footnote{The OCRSs that we will need in this paper are greedy OCRSs. We will abuse notation and omit greedy for the most part.} \cite{ocrs} (see Appendix~\ref{app:background2} for some background and formal definitions). Our main contributions are several technical improvements and refinements that lead to significantly improved constants and, we believe, clarity on the parameters that affect the constants. The competitive ratio that we achieve for a particular constraint family is dictated by the OCRS available for that family. Roughly speaking, an OCRS for a constraint family is an online rounding scheme for a given polyhedral relaxation of the constraints. The approximation quality of the OCRS is governed by two parameters $b,c \in [0,1]$ via the notion of $(b,c)$-selectability. For matroids there is $(b,1-b)$-selectable OCRS for any $b \in [0,1]$, while there is a $(b,e^{-2b})$-OCRS for matching constraints and a $\prn{1- \frac{t}{\sqrt{k}}, 1- \exp(\frac{-t^2}{4})}$-OCRS for the special case of a uniform matroid of rank $k$ (picking at most $k$ elements); see \cite{ocrs}\footnote{For the uniform matroid of rank $k$ the OCRS we claim is not in \cite{ocrs} but it is easy to derive and was explicitly done in an unpublished senior thesis \cite{Kalhan-thesis}.}. \begin{theorem}[{\bf Informal}] \label{thm:sps-informal} For the SPI\xspace problem with a monotone function $f$ over a constraint family with a $(b,c)$-selectable OCRS, there is a $c \cdot (e^{-b}-\eps) (1-e^{-b})$-competitive algorithm for any fixed $\eps > 0$. For non-negative submodular functions there is a $\frac{c}{4} \cdot (e^{-b}-\eps) (1-e^{-b})$-competitive algorithm for any fixed $\eps > 0$. These competitive ratios can be achieved by an efficient randomized polynomial time algorithm, assuming value oracle access to $f$ and efficiency of the corresponding OCRS. \end{theorem} So far we have avoided mentioning the power of the adversary in choosing the order of the variables. Our results hold in the setting of an almighty adversary who can adaptively decide the ordering of the variables based on the full realization of all the variables and the choices of the algorithm at each step. We note that the competitive ratios we obtain are explicit and relatively small. We summarize our concrete competitive ratios for several constraints of interest below. OCRSs for constraints can be composed nicely (similar to CRSs) and our black box reduction is hence very useful. \begin{table*}[!h] \begin{small} \begin{center} \begin{tabular}{|c|c|c|} \hline {Feasibility constraint} & \multicolumn{2}{|c|}{Competitive Ratio} \\ & {Monotone Submodular} & {General Submodular} \\ \hline \hline Uniform matroid of rank $k \rightarrow \infty$ & $1/4.3$ & $1/17.2$ \\ \hline Matroid & $1/7.4$ & $1/30$ \\ \hline Matching & $1/9.5$ & $1/38$ \\ \hline Knapsack & $1/17.5$ & $1/70$ \\ \hline Intersection of $k$ matroids & $\Omega(1/k)$ & $\Omega(1/k)$\\ \hline \end{tabular} \caption{A summary of our results for several feasibility constraints.} \label{tab:concrete-results} \end{center} \end{small} \end{table*} \subsection{Brief overview of technical ideas}\label{sec:brief-overview} \emph{Correlation gap:} The correlation gap for monotone functions \cite{ccpv07,vondrak} used a continuous time argument by relating $F(\bm{x})$ and $f^+(\bm{x})$ via another continuous extension $f^*$ and this was the same approach followed in \cite{rs}. We take a different approach. For the exact correlation gap in Theorem~\ref{thm:intro-gap} we build on a proof for the monotone case from \cite{crs} which is less well-known; we adapt their proof for the non-negative case via the parameter $p$. As we remarked, another approach to bound the correlation gap is via properties of the MCG\xspace algorithm. The original papers on the MCG\xspace algorithm \cite{ccpv,mcg} related the quality of the output to that of the multilinear relaxation. It was only observed later, motivated by stochastic optimization, that the guarantees of these algorithms are stronger and can be shown with respect to the optimum concave closure (see \cite{ward,rocrs}). We build on these to derive Theorem~\ref{thm:intro-gap-mcg3}. \smallskip \noindent \emph{SPI\xspace:} We follow the high-level approach of \cite{rs} but make several technical improvements that we briefly describe. The approach in \cite{rs} is to obtain a fractional solution offline and then round it online via a greedy OCRS. There are three technical ingredients. First is the correlation gap; we already discussed our improvements on this issue. Second is the fact that the distribution over $\cU_i$ on each day is a \emph{correlated} distribution. Rubinstein and Singla essentially show that the limited correlation in the distribution on each day can be approximately simulated by a product distribution over $\cU_i$. In this process one loses large constant factors. We show a simple reduction that reduces the original SPI\xspace instance to another one in which the probability of any item in $\cU_i$ being realized can be made arbitrarily small. This allows us to substantially improve the constants in several interrelated ways. Third, \cite{rs} rely on the greedy OCRS schemes from \cite{ocrs} in order to round the fractional solution. As we remarked, the constraints are on the days/variables while the objective is defined over $\cU$. In \cite{rs} the authors implicitly use the fact that the derived constraint on $\cU$ is still a matroid constraint, if the original constraint on $\cN$ is a matroid. However, this does not generalize to other constraints. One way to handle this is to obtain a new OCRS for the derived constraint over $\cU$ from that on $\cN$. This would lead to technical difficulties and also lose further constants. In this paper we overcome this difficulty by using the greedy OCRS for $(\cN,\cI)$ in a black box fashion. We obtain a clean algorithm that works for any constraint on $\cN$ that admits a greedy OCRS. Our analysis relies on opening up the internal properties of a greedy OCRS from \cite{ocrs}. \subsection{Other related work} We already referred to recent surveys on prophet inequalities and secretary problems and related models \cite{Lucier-survey, Correa-survey, GuptaS-survey, Dinitz-survey}. An older survey on prophet inequalities from a stopping theory point of view is due to Hill and Kertz \cite{hill-kertz-survey}. The work here is connected to submodular optimization, stochastic optimization, online algorithms, and mechanism design which have extensive literature. It is infeasible to describe all the related work; Singla's thesis \cite{singla-thesis} touches upon several of these themes and has several pointers. Contention Resolution Schemes (CRSs) have found many applications since their introduction \cite{crs}; in fact Bayesian mechanism design and posted price mechanisms \cite{ChawlaHMS} and subesequent work by Yan \cite{yan}, connecting mechanism design with the correlation gap, played an important role in \cite{crs}. Online CRSs were developed \cite{ocrs} with applications to Bayesian mechanism design as one of the main motivations and they yield prophet inequalities in the modular case. Random order CRSs were introduced in \cite{rocrs} and yield improved bounds when the arrival order is random. We discuss a variant of the SPI\xspace problem for this setting in more detail in Appendix~\ref{app:sps}. Random Order CRSs found several applications including to \emph{(submodular) stochastic probing} which has been extensively studied in the past several years \cite{ward, gupta1, gupta2, gupta3, singla, asad-nazer}. There are some high-level connections between submodular stochastic probing and the SPI\xspace model, and it is not too surprising that continuous extensions and CRSs play a role in prior work and ours. However the probing model requires items to be chosen if examined, and thus differs from the prophet inequality model, in which items are allowed to be examined before making the decision. As we remarked already, the SPI\xspace model introduces a particular nuance due to correlations which is absent in prior models. Submodular functions and constraints that we consider such as cardinality, matroids, and others provide generality and computational tractability. It is possible to go beyond and consider more general objective functions such as subadditive and monotone XOS functions, as well as more complex and general independence constraints. In such settings one can ignore computational considerations and focus on the online competitive ratio or assume access to a demand oracle (even though a demand oracle may be NP-Hard in general). We refer to \cite{rubin, rs} for some recent work and pointers. Such functions have also been considered under the related model of ``combinatorial auctions'' \cite{Dutting2, DuttingKL, AssadiKS}, in which a seller wants to sell distinct items to buyers that have combinatorial valuation functions for the items. The seller wishes to maximize either the social welfare or the revenue. In this model, Dutting, Feldman, Kesselheim and Lucier \cite{Dutting2} obtained a $2$ prophet inequality for submodular functions, while Dutting, Kesselheim and Lucier \cite{DuttingKL} obtained a $O(\log \log m)$ prophet inequality for subadditive functions. For the latter, the authors also show that achieving a constant factor prophet inequality for subadditive valuation functions is impossible via their techniques and requires a different approach. \paragraph{Organization:} Section~\ref{sec:preliminaries} sets up technical preliminaries on submodular functions and introduces our notation. Section~\ref{sec:spi} describes the relaxation of the prophet's objective. Section~\ref{sec:rounding} describes the algorithm and analysis for SPI\xspace. We describe some open questions in Section~\ref{sec:conclusions}. For several lemmas on submodular functions and sampling used throughout the paper, see Appendix~\ref{app:background1}. For background information on contention resolution schemes, see Appendix~\ref{app:background2}. The proofs of Theorems~\ref{thm:intro-gap} and \ref{thm:intro-gap-mcg2} have been moved to Appendix~\ref{app:correlation-gap} due to space constraints. The reduction to small probabilities can be found in Appendix~\ref{app:reduction}. Appendix~\ref{app:sps} contains a discussion on a variant of the SPI\xspace problem, the SPS\xspace problem, in which the random variables arrive uniformly at random instead of in adversarial order. \section{Preliminaries}\label{sec:preliminaries} Let $\cN$ be a finite ground set. A real-valued set function $f : \{0, 1\}^\cN \to \Rp$ is called {\em submodular} if, for all $A, B \subseteq \cN$, it satisfies $f(A) + f(B) \geq f(A \cup B) + f(A \cap B)$. $f$ is {\em monotone} if $f(A) \leq f(B)$ for all $A \subseteq B$. In the rest of this paper we work with non-negative normalized functions that satisfy $f(\emptyset) = 0$ and $f(A) \geq 0$ for all $A \subseteq \cN$. We often equate $\cN$ with $[n] = \{1,2,\ldots,n\}$. We use the terminology $S+i$ and $S-i$ as shorthands for $S \cup \{i\}$ and $S \setminus \{i\}$ respectively. The following continuous extensions of submodular functions to $[0,1]^\cN$ play an important role in our discussion. \begin{definition}[Multilinear Extension] Let $f : {\{0, 1\}}^\cN \to \R_{\geq 0}$. For any $\bm{x} \in {[0, 1]}^n$, let $S \sim \bm{x}$ denote a random set $S$ that contains each element $i \in \cN$ independently w.p. $x_i$. The {\em multilinear extension} of $f$ is defined as \[ F(\bm{x}) \coloneqq \E_{S \sim \bm{x}}[f(S)] = \sum_{S \subseteq N} {f(S) \prod_{i \in S} {x_i} \prod_{i \notin S} {(1 - x_i)}}. \] \end{definition} \begin{definition}[Concave Closure] Let $f : {\{0, 1\}}^\cN \to \R_{\geq 0}$. Moreover, let $\1_S$ denote the characteristic vector of length $n = |\cN|$. For any $\bm{x} \in {[0, 1]}^n$, the {\em concave closure} of $f$ is defined as \[ f^+(\bm{x}) \coloneqq \max_{\bm{a} \in [0,1]^{2^\cN}}\left\{\sum_{S \subseteq \cN} {a_S f(S)} \midd \sum_{S \subseteq \cN} {a_S} = 1, \sum_{S \subseteq \cN} {a_S \1_S} = \bm{x} \right\}. \] \end{definition} Recall that $f^+(\bm{x})$ can be interpreted as the maximum expected value of $f(R)$ where $R$ is generated by a distribution whose marginal values are given by $\bm{x}$. Since $F(\bm{x})$ corresponds to the product distribution defined by $\bm{x}$, which is a specific distribution, it follows that $F(\bm{x}) \le f^+(\bm{x})$ for all $\bm{x}$. We also need the following notation, which will be useful in our analysis when dealing with the input constraints. \begin{definition}[Blowup of a Ground Set] Let $\cN$ denote a finite set. Suppose for each $e \in \cN$ there is an associated finite non-empty set $A_e$ such that the sets $A_e, e \in \cN$ are mutually disjoint. Let $\mathcal{A} = \{A_e \mid e \in N\}$. We call $\cN' = \bigcup_{e \in N} A_e$ the {\em blowup} of $\cN$ by $\mathcal{A}$. \end{definition} Recall that each day only one item from $\cU_i$ is realized and this motivates the following definition of a constraint family. \begin{definition}[Partition Extension of a Constraint] Let $\cC = (\cN, \cI)$ be a downward-closed constraint family over $\cN$. Consider a blowup $\cN'$ of $\cN$ induced by sets $A_e, e \in \cN$. Consider the function $g: \cN' \rightarrow \cN$ where $g(e') = e$ if and only if $e' \in A_e$. The {\em partition extension} of $\cC$, denoted by $\cC'$, is a constraint family $(\cN', \cI')$ where \[ \cI'_{A} = \set{S \subseteq \cN' \midd g(S) \in \cI \text{ and } \forall e \in \cN, \: |A_e \cap S| \le 1}. \] \end{definition} \section{Submodular Prophet Inequality Problem}\label{sec:spi} In the {\em Submodular Prophet Inequality (SPI)} problem, we are given $n$ random variables $X_1, \dots, X_n$ following (known) distributions $D_1, \dots, D_n$, along with a constraint $\cC$ on $\cN = \{1, 2, \dots, n\}$. The random variables are arranged in adversarial (worst-case) order. Let $\cU_i$ denote the image (range) of $X_i$, and $\cI$ denote the independent sets of $\cC$. The online algorithm starts with a set $S = \emptyset$ of selected elements and a set $Z = \emptyset$ of selected days. At the $i$-th time step, it is presented with the realization $e \in \cU_i$ of $X_i$. At that moment, it has to decide irrevocably whether to include $e$ in $S$ (and hence $i$ in $Z$) or not, subject to $Z$ remaining independent in $\cC$. The algorithm is also given a non-negative submodular function $f : \cU \to \Rp$, where $\cU \triangleq \bigcup_{i = 1}^n {\cU_i}$. The algorithm's objective is to maximize $f(S)$, subject to $Z$ being independent in $\cC$. In this model, we are comparing against the almighty adversary who already knows all realizations and can adaptively change the order in which to reveal the random variables based on the algorithm's actions so far and also the random coins it uses (if the algorithm is randomized). The prophet/adversary will select the best possible set $S^*$ according to the constraints with knowledge of the realizations. Thus, we compare the expected value of the online algorithm against the expected value of the prophet, which is \[ {\rm OPT} = \E_{\bm{X}}\left[\max_{T \in \cI} f\left(\left\{X_i \midd i \in T\right\}\right)\right]. \] Later, we will use an OCRS to round the fractional solution we obtain in this section. Since $f$ is defined over $\cU$ but the constraint given is over $\cN$, the days, we cannot immediately apply an OCRS for rounding. To overcome this issue, we view $\cU$ as the blowup of $\cN$ with respect to $\set{\cU_i}_{i = 1}^n$. On each day $i$, only one element arrives. Therefore, our input constraint $\cC$ is equivalent to a new constraint $\cC'$ on $\cU$, where we are allowed to pick only one element from each day. Notice that this is exactly the partition extension $\cC'=(\cU,\cI')$ of $\cC$. We also denote $\bm{X} = \set{X_1, X_2, \dots, X_n}$ and $\bm{D} = \set{D_1, D_2, \dots, D_n}$. For an element $e \in \cU_i$ we let $D_i(e)$ denote the probability of $e$ being realized; we also use the notation $\cD(e)$ to denote the probability of $e \in \cU$ when we do not need to specify the part it belongs to. Note that the elements within $\cU_i$ are correlated and hence we do not have a product distribution on $\cU$. \paragraph{Algorithmic approach:} Following the description in Section~\ref{sec:intro}, we design an online algorithm following the general approach of \cite{rs} but with technical differences. First, we obtain a relaxation of the prophet's objective. Afterwards, to design an online algorithm, we obtain an \emph{offline} fractional point $\bm{z}$ based on the input, and round it \emph{online} using a greedy OCRS and other tools. In this section, we describe the relaxation of the prophet's objective and how to obtain an offline fractional point $\bm{z}$. The process of rounding $\bm{z}$ online using a greedy OCRS is presented in Section~\ref{sec:rounding}. Before we proceed, we describe a simple but technically important reduction that allows us to obtain improved bounds. \begin{observation}[Reduction to small probabilities]\label{obs:reduction} Let $I = (\cN, \cU, \bm{D}, \bm{X}, f, \cC)$ be an instance of the Submodular Prophet Inequality problem. For every fixed $\eps > 0$, there is a reduction of $I$ to another instance $I' = (\cN, \cU', \bm{D'}, \bm{Y}, g, \cC)$ of the SPI problem such that that (i) for all $e \in \cU'$, $\bm{D'}(e) \le \eps$ and (ii) there exists an $\alpha$-competitive algorithm for $I$ if and only if there exists an $\alpha$-competitive algorithm for $I'$. \end{observation} \begin{remark} The reduction's simplicity may make the reader wonder why it is useful in achieving improved bounds. The reason is a combination of the model and the power of submodularity. The fact that we can only pick a single random variable from each day allows us to make copies of the elements, and we can use a derived submodular function to treat the copies as a single element. \end{remark} We describe the reduction in Appendix~\ref{app:reduction}, but only sketch its correctness since it is rather simple and easy to see, though tedious to formally prove. The reduction to small probabilities allows us to use improved correlation gaps, as well as obtain better bounds in the rounding algorithm. \subsection{An upper bound on the prophet's value:} Let $\cP$ denote a solvable polyhedral relaxation of $\cC$ \footnote{For some background on polyhedral relaxations see Appendix~\ref{app:background2}}. Then one can easily develop a solvable polyhedral relaxation of $\cC'$ as follows: \[ \cP' = \set{\bm{y} \in [0,1]^{|\cU|} \midd \sum_{e \in \cU_i} y_e = x_i, \,\,\, i \in [n], \bm{x} \in \cP}. \] Consider any algorithm, including an offline algorithm, that computes a feasible output given the realizations of the random variables. For any fixed algorithm $\cA$ (deterministic or randomized) we have a probability $p_{\cA}(e)$ for each $e \in \cU$ appearing in the output of $\cA$. Since an element $e \in \cU$ is realized with probability $\cD(e)$, $e$ cannot appear in the output of $\cA$ with probability more than $\cD(e)$. Moreover, for a given realization, each output of the algorithm is feasible. Putting these facts together we obtain the following observation. \begin{observation} Let $\cA$ be any online or offline algorithm for a given instance of the problem. Let $p_{\cA}(e)$ denote the probability that $e$ is in the output of $\cA$. Then the vector $\bm{p}$ is in the polytope \[ \cP'' = \set{ \bm{z} \in [0,1]^{|\cU|} \midd \bm{z} \in \cP', z_e \le \cD(e) \,\, e \in \cU}. \] \end{observation} We are now ready to proceed with the relaxation of the prophet's objective. \begin{claim}\label{clm:fmax-opt} Consider an instance of the Submodular Prophet Inequality problem. Then \[ \max_{\bm{z} \in \cP''} {f^+(\bm{z})} \ge {\rm OPT}. \] \end{claim} \begin{proof} Fix an optimal strategy for the prophet and let $\bm{y^*} \in [0,1]^{|\cU|}$ denote the vector of probabilities of the elements appearing in the output of the prophet's strategy. We have $\bm{y^*} \in \cP''$. By the definition of the concave closure of $f$, $f^+(\bm{y^*})$ maximizes the value of $f$ among all distributions with the marginals $\bm{y^*}$ (note that the distribution that achieves this may not be a feasible strategy for any algorithm). Therefore, $f^+(\bm{y^*}) \geq {\rm OPT}$, which also implies that $\max_{\bm{z} \in \cP''} {f^+(\bm{z})} \geq {\rm OPT}$. \end{proof} \subsection{Fractional Solution and Correlation Gap}\label{sec:fractional} From Claim~\ref{clm:fmax-opt}, $\max_{\bm{z} \in \cP''} {f^+(\bm{z})} \ge {\rm OPT}$. Since OCRSs are designed to relate the quality of their output to that of the multilinear relaxation, we need to relate $F(\bm{z})$ to $f^+(\bm{z})$ and hence to ${\rm OPT}$. We present two different ways to do this --- via a direct correlation gap and via the Measured Continuous Greedy (MCG\xspace) algorithm --- with the second yielding strictly better results than the first. \paragraph{The direct correlation gap approach} The first approach is not computationally efficient and relies on optimally solving the optimization problem $\max_{\bm{z} \in \cP''} {f^+(\bm{z})}$. Let $\bm{z^*}$ be the optimum solution. We can then use the correlation gap to relate $F(\bm{z^*})$ to ${\rm OPT}$. For monotone functions we have $F(\bm{z^*}) \ge (1-1/e)f^+(\bm{z^*}) \ge (1-1/e){\rm OPT}$. For non-negative functions we can use Theorem \ref{thm:intro-gap}, the proof of which, along with all results on the direct correlation gap approach, can be found in Appendix~\ref{app:correlation-gap}. Following the reduction that we described earlier, we can assume that $z_e^* \le \max_e \bm{D}(e) \le \eps$ for all $e$ and this implies, via Theorem \ref{thm:intro-gap} that $F(\bm{z^*}) \ge (1-\eps)(1-1/e) f^+(\bm{z^*}) \ge (1-\eps)(1-1/e) {\rm OPT}$. In rounding it is useful to have a solution $\bm{z} \in b \cdot \cP''$ for some parameter $b \in (0,1)$. One can of course use $\bm{z} = b\bm{z^*}$ and in this case, we can use the concavity of $f^+$ to see that $f^+(b\bm{z^*}) \ge b f^+(\bm{z^*})$, and then apply the correlation gap to $b\bm{z^*}$ to conclude that, in the monotone case, $F(b \bm{z^*}) \ge b(1-1/e) f^+(\bm{z^*}) \ge b(1-1/e) {\rm OPT}$ and, in the non-monotone case, $F(b \bm{z^*}) \ge b(1-\eps)(1-1/e) f^+(\bm{z^*}) \ge b(1-\eps)(1-1/e) {\rm OPT}$. \paragraph{The measured continuous greedy approach} The second approach is algorithmic and relies on the Measured Continuous Greedy (MCG\xspace) algorithm and its properties. We state two relevant known results about the algorithm. For these results as well as Theorem~\ref{thm:intro-gap-mcg2}, we assume the submodular function $f$ is given via a value oracle, and that the algorithms are randomized and run in polynomial time and are correct with high probability. \begin{lemma}[Lemma 4 of \cite{ward}]\label{lem:mon-cont-greedy} Let $f$ be a monotone submodular function with multilinear extension $F$, and let $\cP$ be a solvable downward-closed polytope. Let $\bm{x}(b)$ be solution produced by the Continuous Greedy algorithm on $F$ and $\cP$ until time $b \in (0, 1]$. Then (i) $\bm{x}(b) \in b \cdot \cP$ and (ii) $F(\bm{x}(b)) \geq \prn{1 - e^{-b} - o(1)} \cdot \max_{\bm{y} \in \cP} {f^+(\bm{y})}$. \end{lemma} For a general non-negative submodular function, the MCG\xspace algorithm achieves the following bound. \begin{lemma}[Lemma 8.3 of \cite{rocrs}]\label{lem:non-mon-cont-greedy} Let $b \in [0,1]$, $f$ be a non-negative submodular function with multilinear extension $F$, and let $\cP$ be a solvable downward-closed polytope. Then, the solution $\bm{x}(b) \in {[0,1]}^n$ produced by the MCG\xspace algorithm satisfies (i) $\bm{x}(b) \in b \cdot \cP$ and (ii) $F(\bm{x}(b)) \geq \prn{b \cdot e^{-b} - \eps} \cdot \max_{\bm{y} \in \cP} {f^+(\bm{y})}$, for any fixed $\eps > 0$. \end{lemma} The two preceding lemmas are algorithmic. If $\cP$ is solvable then the underlying algorithms can be implemented efficiently. Based on our reduction to small probabilities it is useful to consider whether the preceding lemmas can take advantage of this. No advantage is possible in the monotone setting, however, we show below that one can indeed take advantage of the reduction when $f$ is non-monotone. We provide a refined analysis of the standard bound of the MCG\xspace algorithm, which depends on a parameter $p$ that quantifies the maximum value of any coordinate that is feasible in the polytope. For small enough $p$, Theorem~\ref{thm:intro-gap-mcg2} constitutes an improvement over Lemma~\ref{lem:non-mon-cont-greedy}, which comprises the main result of this section. We restate the theorem here, while its proof can be found in Appendix \ref{app:correlation-gap}. Notice that Theorem~\ref{thm:intro-gap-mcg3} follows from Theorem~\ref{thm:intro-gap-mcg2} by setting $b = 1$. \mcggap* \begin{remark}\label{rmk:refined-mcg} Notice that, for the SPI\xspace problem, due to our reduction, we can assume that all vectors $\bm{z} \in \cP''$ have $z_i \leq \eps'$ for all $i \in \cN$, for any fixed constant $\eps' > 0$. Therefore, for any fixed constant $\eps > 0$, there exists an $\eps'$ such that \[ F(\bm{x}(b)) \geq \prn{1 - e^{-b} - \eps} \cdot \max_{\bm{z} \in \cP} {f^+(\bm{z})}, \] where $\bm{x}(b) \in b \cdot \cP''$ is the output of the MCG\xspace algorithm at time $b$. \end{remark} We summarize the results via both methods below. We observe that for both monotone and non-monotone functions the bounds are best when $p \rightarrow 0$, which we can ensure via the reduction. Once we make this assumption, the bounds provided by the correlation gap approach are essentially $(1-1/e)$ when $b = 1$ which is optimal. However, these bounds are matched by the Continuous Greedy approach. When $b < 1$, which will be the case when applying the rounding schemes, the bound in Lemma~\ref{lem:mon-cont-greedy} and our new refined bound in Theorem~\ref{thm:intro-gap-mcg2} are superior and have the further advantage of being computable in polynomial time. \section{Rounding the fractional solution} \label{sec:rounding} In the preceding section we described ways to obtain a vector $\bm{z} \in b \cdot \cP''$ for some $b \in [0,1]$ such that $F(\bm{z}) \geq \alpha \cdot OPT$ for various constants $\alpha$ depending on the approach. In this section we show how to round $\bm{z}$ in an online fashion. We follow the high-level approach of \cite{rs} but refine it in several ways. We will use a greedy OCRS for $\cC$ via the relaxation $\cP$ as a black box. Recall that our rounding needs to produce a feasible set in $\cC'$ with ground set $\cU$, while the OCRS is for the constraint on days/variables $\cN$. Moreover the distribution $\bm{D}$ is \emph{not} a product distribution on $\cU$. These are the technical challenges that need to be overcome in the algorithm and analysis. The quality of the output will depend on the properties of the OCRS for $\cP$. We assume that the greedy OCRS for $\cP$ is $(b,c)$-selectable, where $c$ is some function of $b$. This depends on the specific constraint family $\cC$ and the polyhedral relaxation $\cP$. At the end of the section, we use known results to derive concrete competitive ratios for several constraint families of interest. We note that $\bm{z} \in \cP''$, which also implies that $\bm{z} \in \cP'$. For rounding purposes we only work with $\cP'$ and $\cP$; $\cP''$ is only necessary to obtain an upper bound on ${\rm OPT}$. We rely on the certain parts of the analysis of OCRS for submodular function maximization from \cite{ocrs}. In the following, we will use $\pi$ to denote the mapping function for the OCRS over the ground set $\cN$ and the polytope $\cP$. Technically the mapping $\pi$ is a function of $\bm{x} \in \cP$ and should be written as $\pi_{\bm{x}}$ but we omit $\bm{x}$ for notational simplicity. We also note that $\pi$ can be randomized. An important definition from \cite{ocrs} in the analysis of OCRSs is the characteristic CRS of a greedy OCRS. \begin{definition}[Characteristic CRS of an OCRS]\label{def:char-crs} The {\em characteristic CRS} $\bar{\pi}$ of a greedy OCRS $\pi$ for a polytope $\cP$ is a CRS for the same polytope $\cP$. It is defined for an input $x \in \cP$ and a set $A \subseteq \cN$ by $\bar{\pi}(A) = \set{e \in A \midd I \cup \{e\} \in \cF_{\pi, \bm{x}}, \: \: \forall I \subseteq A, \: I \in \cF_{\pi, \bm{x}}}$. Notice that, if $\pi$ is randomized, then $\bar{\pi}$ is randomized as well. \end{definition} We will also need the following known results from \cite{ocrs}. \begin{observation}[Observation 3.3 of \cite{ocrs}]\label{obs:char-crs} For every set $A \subseteq \cN$ and a characteristic CRS $\bar{\pi}$ of a greedy OCRS $\pi$, the set $\bar{\pi}(A)$ is always a subset of the elements selected by $\pi$ when the active elements are the elements of $A$. \end{observation} \begin{lemma}[Lemma 3.4 of \cite{ocrs}]\label{lem:char-crs} The characteristic CRS $\bar{\pi}$ of a $(b, c)$-selectable greedy OCRS $\pi$ is $(b, c)$-balanced and monotone. \end{lemma} For any $S \subseteq \cU$, we define $S_\downarrow \subseteq \cN$ to be the projection of $S$ onto $\cN$, i.e. \[ S_\downarrow \coloneqq \set{i \in \cN \midd S \cap \cU_i \neq \emptyset}. \] Also, for a greedy OCRS $\pi$, we denote the characteristic CRS of $\pi$ by $\bar{\pi}$. We now define a CRS $\pi'$ for $\cP'$ that we will need for our analysis later on. We define $\pi'$ using the characteristic CRS $\bar{\pi}$ of $\pi$ as follows. For any set $S \subseteq \cU$, \[ \pi'(S) \coloneqq \bigcup_{\stack{i \in \bar{\pi}(S_\downarrow)}{|S \cap \cU_i| = 1}} {(S \cap \cU_i)}. \] \begin{lemma}\label{lem:new-crs} For any $(b, c)$-selectable greedy OCRS $\pi$ for $\cP$ and $\bm{z} \in \cP'$, the mapping $\pi'$ is is a $(b, c \cdot \gamma)$-balanced monotone CRS $\pi'$ for $\cP'$, where $\gamma = \min_{i \in \cN} {\prod_{e \in \cU_i} {(1 - z_e)}}$. \end{lemma} \begin{proof} First, notice that $\pi'$ is a CRS, since $\pi'(S) \subseteq S$ for all $S \subseteq \cU$. This follows immediately from the definition of $\pi'$ as $S \cap \cU_i \subseteq S$ for all $i \in \cN, S \subseteq \cU$. Next, we show that $\pi'$ is monotone. Fix an element $e \in S_1 \subseteq S_2 \subseteq \cU$, and an instantiation of $\cF_{\pi, \bm{x}}$ (this is relevant if the OCRS is randomized). Let $e \in \cU_i$ for some $i \in \cN$. Suppose $e \in \pi'(S_2)$. This implies that $|S_2 \cap \cU_i| = 1$ and since $S_1 \subseteq S_2$ and $e \in S_1$, we have $|S_1 \cap \cU_i| = 1$. Furthermore, we know that $i \in \bar{\pi}({S_2}_\downarrow)$. Since $S_1 \subseteq S_2$, it follows that ${S_1}_\downarrow \subseteq {S_2}_\downarrow$. By Lemma \ref{lem:char-crs}, we know that $\bar{\pi}$ is monotone, and thus, since $i \in \bar{\pi}({S_2}_\downarrow)$, it follows that $i \in \bar{\pi}({S_1}_\downarrow)$. Therefore, we know that $e \in \pi'(S_1)$. Since $e \in \pi'(S_2)$ implies that $e \in \pi'(S_1)$, unconditioning over the instantiation of $\cF_{\pi, \bm{x}}$ yields \[ \Pr\brk{e \in \pi'(S_1)} \geq \Pr\brk{e \in \pi'(S_2)}. \] We now show that $\pi'$ is $(b, c \cdot \gamma)$-balanced, for $\gamma = \min_{i \in \cN} {\prod_{e \in \cU_i} {(1 - z_e)}}$. It suffices to show that, for any $e \in \cU$ \[ \Pr_{S \sim R(\bm{z})}\brk{e \in \pi'(S) \midd e \in S} \geq c \cdot \gamma. \] Notice that, for any realization $S$ of $R(\bm{z})$, $e \in \pi'(S)$ if and only if $S \cap \cU_i = \{e\}$ and $i \in \bar{\pi}(S_\downarrow)$. Thus, \begin{align} \Pr_{S \sim R(\bm{z})}\brk{e \in \pi'(S) \midd e \in S} &= \Pr_{S \sim R(\bm{z})}\brk{S \cap \cU_i = \{e\} \wedge i \in \bar{\pi}(S_\downarrow) \midd e \in S} \nonumber \\ &= \Pr_{S \sim R(\bm{z})}\brk{S \cap \cU_i = \{e\} \midd e \in S} \nonumber \\ & \qquad \cdot \Pr_{S \sim R(\bm{z})}\brk{i \in \bar{\pi}(S_\downarrow) \midd S \cap \cU_i = \{e\}, e \in S} \nonumber \\ &= \Pr_{S \sim R(\bm{z})}\brk{S \cap \cU_i = \{e\} \midd e \in S} \nonumber \\ \label{eq:bc-balanced-1} & \qquad \cdot \Pr_{S \sim R(\bm{z})}\brk{i \in \bar{\pi}(S_\downarrow) \midd S \cap \cU_i = \{e\}}, \end{align} where the last equality follows from the fact that, if $S \cap \cU_i = \{e\}$, then $e \in S$. We lower bound each probability in \eqref{eq:bc-balanced-1} separately, starting from \begin{align}\label{eq:bc-balanced-2} \Pr_{S \sim R(\bm{z})}\brk{S \cap \cU_i = \{e\} \midd e \in S} = \prod_{e' \neq e, e' \in \cU_i} {(1 - z_{e'})} \geq \prod_{e' \in \cU_i} {(1 - z_{e'})} \geq \gamma. \end{align} Also, notice that $\bar{\pi}$ is a CRS over $\cN$ and does not depend on which $S \cap \cU_i$ led to $i \in S_\downarrow$. Therefore, \[ \Pr\brk{i \in \bar{\pi}(S_\downarrow) \midd i \in S_\downarrow} = \Pr\brk{i \in \bar{\pi} \midd S \cap \cU_i = T} \] for all $T \subseteq \cU_i$ such that $T \neq \emptyset$. Specifically, for $T = \{e\}$, \begin{equation}\label{eq:bc-balanced-3} \Pr\brk{i \in \bar{\pi} \midd S \cap \cU_i = \{e\}} = \Pr\brk{i \in \bar{\pi}(S_\downarrow) \midd i \in S_\downarrow} \geq c, \end{equation} where the last inequality follows from the fact that fact that $\bar{\pi}$ is $(b,c)$-balanced, by Lemma \ref{lem:char-crs}. Combining \eqref{eq:bc-balanced-1}, \eqref{eq:bc-balanced-2} and \eqref{eq:bc-balanced-3}, we obtain \[ \Pr_{S \sim R(\bm{z})}\brk{e \in \pi'(S) \midd e \in S} \geq c \cdot \gamma. \] \end{proof} \begin{remark}\label{rmk:small-z} Notice that via Observation \ref{obs:reduction}, we can assume without loss of generality that, for any fixed $\eps' > 0$, $z_{e} \leq \eps'$ for all $e \in \cU$. By choosing $\eps'$ sufficiently small, for any fixed $\eps > 0$ we have \[ \gamma = \min_{i \in \cN} {\prod_{e \in \cU_i} {(1 - z_e)}} \geq \min_{i \in \cN} {\prn{\prod_{e \in \cU_i} {e^{- z_{e}}}}} - \eps = \min_{i \in \cN} {\prn{e^{- \sum_{e \in \cU_i} {z_e}}}} - \eps \geq e^{-b} - \eps, \] where the last inequality follows from the fact that $\bm{z} \in b \cdot \cP'$. Thus, $c \cdot \gamma \geq c \cdot (e^{-b} - \eps)$, and we obtain the following as corollary: For any $(b, c)$-selectable greedy OCRS $\pi$ for $\cP$ and fixed $\eps > 0$, $\pi'$ defined earlier is a $\prn{b, c\prn{e^{-b} - \eps}}$-balanced monotone CRS for $\cP'$. \end{remark} Now we are ready to describe our online algorithm. We describe and analyze the algorithms for monotone and non-monotone cases separately, since there are technical differences. The algorithms are similar to the one in \cite{rs}, however, the main technical difference is that we use the OCRS for $\cN$ as a black box; in \cite{rs} the authors use an OCRS over $\cU$ since they work in the special case of matroids. \subsection{Monotone Non-Negative Submodular Functions} We assume we have already computed a vector $\bm{z} \in b \cdot \cP''$ for some $b \in [0,1]$ such that $F(\bm{z}) \ge \alpha \cdot {\rm OPT}$ for some $\alpha$. Note that the adversary is almighty and can alter the order in which it feeds the variables to the algorithm based on knowledge of the full realizations of the variables and the actions of the algorithm so far. Let $\bm{z_i}$ denote the product distribution on $\cU_i$ defined by marginals $z_i(e), e \in \cU_i$. We write $R \sim \bm{z_i}$ to denote a random set $R \subseteq \cU_i$ realized according to this product distribution, and we denote $z_i(e)$ by $z_e$ when $i$ is clear from context or irrelevant. Furthermore, let $\bm{x} \in [0,1]^n$ be the vector where $x_i = \Pr_{R \sim \bm{z_i}}\brk{R \neq \emptyset} = 1 - \prod_{e \in \cU_i} {(1 - z_e)}$, for all $i \in \cN$. We assume that $\bm{x}$ is the input vector to our OCRS $\pi_{x}$ for $\cP$ and its characteristic CRS $\bar{\pi}_{\bm{x}}$. To simplify our notation, we denote $\pi_{\bm{x}}$ and $\bar{\pi}_{\bm{x}}$ by $\pi$ and $\bar{\pi}$, respectively. \begin{algorithm}\underline{{\sc{Monotone Rounding}}{$\prn{\cU, f, \bm{D}, \cC, \pi, \bm{z}}$}} \\ $T_{\text{ALG}} = \emptyset$ \\ \For{$h \from 1$ \KwTo $n$}{ Let $X_i$ be variable that arrives on day $h$ \\ Let $e \in \cU_i$ be the realization of $X_i$ \\ With probability $\frac{\Pr_{R \sim \bm{z_i}}\brk{R = \{e\}}}{\cD_i(e)}$, set $T_i \from \{e\}$ \\ Otherwise, set $T_i$ to be a random subset $R$ of $\cU_i$, drawn according to $\bm{z}_i$, conditioned on $|R| \neq 1$ \\ \If{$T_i \neq \emptyset$}{ Feed $i$ to OCRS $\pi$ for $\cP$ \\ \If{$\pi$ accepts $i$ \emph{and} $T_i = \{e\}$}{ $T_{\text{ALG}} \from T_{\text{ALG}} \cup \{e\}$}}} Return $T_{\text{ALG}}$ \caption{Algorithm for Monotone Non-Negative Submodular Functions} \label{alg:mon} \end{algorithm} The online algorithm on the $h$-th day receives a random variable $X_i$ decided by the almighty adversary, and once $X_i$ is received the algorithm also sees the realization $e \in \cU_i$ of $X_i$ according to the distribution $\cD_i$. The online algorithm generates a random set $T_i \subseteq \cU_i$ \emph{after} seeing the realization $e$. The idea is that if one does not see the realization $e$ of $X_i$, the distribution of $T_i$ appears identical to the product distribution generated by $\bm{z_i}$. Note that, for $S \subseteq \cU_i$, $\Pr_{R \sim \bm{z_i}}[R = S] = \prod_{e \in S} z_{e} \prod_{e \in \cU \setminus S} \prn{1 - z_{e}}$. \begin{lemma}\label{lem:ti-indep} For any $i \in \cN$ and $S \subseteq \cU_i$, \[ \Pr[T_i = S] = \Pr_{R \sim \bm{z_i}}[R = S]. \] \end{lemma} \begin{proof} Let $\cE_e$ be the event that $e \in \cU_i$ is the realization of $X_i$. Note that $\Pr[\cE_e] = \cD_i(e)$. Consider $S \subseteq \cU_i$ such that $|S| \neq 1$. We see from the algorithm's description that \[ \Pr[T_i = S\mid \cE_e] = \prn{1 - \frac{\Pr_{R}\brk{R\prn{\bm{z}_i} = \{e\}}}{D_i(e)}} \cdot \frac{\Pr_{R}\brk{R\prn{\bm{z}_i} = S}}{1 - \Pr_{R}\brk{|R\prn{\bm{z}_i}| = 1}}. \] Summing up over all realizations of $X_i$, we have that, for any $S$ such that $|S| \neq 1$, \begin{align*} \Pr\brk{T_i = S} &= \sum_{e \in \cU_i} {D_i(e) \Pr\brk{T_i = S \midd \cE_e}} \\ &= \sum_{e \in \cU_i} {D_i(e) \prn{1 - \frac{\Pr_{R}\brk{R\prn{\bm{z}_i} = \{e\}}}{D_i(e)}} \cdot \frac{\Pr_{R}\brk{R\prn{\bm{z}_i} = S}}{1 - \Pr_{R}\brk{|R\prn{\bm{z}_i}| = 1}}} \\ &= \frac{\Pr_{R}\brk{R\prn{\bm{z}_i} = S}}{1 - \Pr_{R}\brk{|R\prn{\bm{z}_i}| = 1}} \cdot \sum_{e \in \cU_i} {D_i(e) \prn{1 - \frac{\Pr_{R}\brk{R\prn{\bm{z}_i} = \{e\}}}{D_i(e)}}} \\ &= \frac{\Pr_{R}\brk{R\prn{\bm{z}_i} = S}}{1 - \Pr_{R}\brk{|R\prn{\bm{z}_i}| = 1}} \cdot \prn{\sum_{e \in \cU_i} {D_i(e)} - \sum_{e \in U_i}{\Pr_{R}\brk{R\prn{\bm{z}_i} = \{e\}}}} \\ &= \frac{\Pr_{R}\brk{R\prn{\bm{z}_i} = S}}{1 - \Pr_{R}\brk{|R\prn{\bm{z}_i}| = 1}} \cdot \prn{1 - \sum_{e \in \cU_i}{\Pr_{R}\brk{R\prn{\bm{z}_i} = \{e\}}}} \\ &= \frac{\Pr_{R}\brk{R\prn{\bm{z}_i} = S}}{1 - \Pr_{R}\brk{|R\prn{\bm{z}_i}| = 1}} \cdot \prn{1 - \Pr_{R}\brk{|R\prn{\bm{z}_i}| = 1}} \\ &= \Pr_{R}\brk{R\prn{\bm{z}_i} = S}. \end{align*} Next, consider any set $S$ with $|S| = 1$ and, without loss of generality, assume $S = \{e\}$ for some $e \in \cU_i$. It can be seen from the algorithm description that $T_i = \{e\}$ if and only if $e$ is the realization of $X_i$ and the algorithm succeeds in Line 5 in setting $T_i = \{e\}$ which happens with probability $\frac{\Pr_{R \sim \bm{z_i}}\brk{R = \{e\}}}{\cD_i(e)}$. Hence \[ \Pr[T_i = \{e\}] = \cD_i(e) \cdot \frac{\Pr_{R \sim \bm{z_i}}\brk{R = \{e\}}}{\cD_i(e)} = \Pr_{R \sim \bm{z_i}}\brk{R = \{e\}}, \] as desired. \end{proof} We now analyze the expected value of $f(T_{\text{ALG}})$ relying on the CRS $\pi'$ that we set up (this is inspired by the use of characteristic CRS in \cite{ocrs}). \begin{lemma}\label{lem:mon-alg} Given a $(b, c)$-selectable greedy OCRS $\pi$ for $\cP$, for any $\bm{z} \in b \cdot \cP''$ and fixed $\eps > 0$, Algorithm \ref{alg:mon} returns a set $T_{\text{ALG}} \subseteq \cU$ such that \[ \E\brk{f(T_{\text{ALG}})} \geq c \prn{e^{-b} - \eps} \cdot F(\bm{z}). \] \end{lemma} \begin{proof} It is easy to see from the algorithm's description that, for any $X_i$, only the actual realization of $X_i$ can be potentially chosen to be added to $T_{\text{ALG}}$. Furthermore, the variables chosen by the algorithm are feasible in $\cC$, since this is ensured by the OCRS. Let $T_i$ be the random set generated by the online algorithm for variable $X_i$. We see that $T_i$ is independent of $T_{i'}$ for $i \neq i'$, due to independence of the realization of the random variables $X_1,\ldots,X_n$ and the independence of the coins used in the algorithm across days. From Lemma~\ref{lem:ti-indep}, the distribution of $T_i$ is according to the product distribution $R \sim \bm{z_i}$ over $\cU_i$. Let $Q = \bigcup_{i=1}^n T_i$. It follows that $Q$ is a random set drawn from the product distribution induced by $\bm{z}$ over $\cU$. Consider the distribution of the set $Q_\downarrow \in \cN$. Because of the product distribution of $Q$ it can be see that the distribution of $Q_\downarrow$ is a product distribution on $\cN$ where $i \in \cN$ appears in $Q_\downarrow$ with probability $x_i = 1 - \prod_{e \in \cU_i} (1-z_e) \le b$ since $z \in b \cdot \cP''$. Note that the algorithm feeds $Q_\downarrow$ to the OCRS $\pi$ which is $(b,c)$-selectable. Let $\bar{\pi}$ be the characteristic CRS of $\pi$. Fix a realization $S$ of $Q$, along with an instantiation of $\cF_{\pi, \bm{x}}$. Notice $e \in T_{\text{ALG}} \cap \cU_i$ if and only if $|S \cap \cU_i| = \{e\}$ and $i \in \pi(S_\downarrow)$. In fact, \[ T_{\text{ALG}} = \bigcup_{\stack{i \in \pi(S_\downarrow)}{|S \cap \cU_i| = 1}} {(S \cap \cU_i)}, \] by the description of Algorithm \ref{alg:mon}. By Observation \ref{obs:char-crs}, we have $\bar{\pi}(A) \subseteq \pi(A)$ for any $A \subseteq \cN$, and thus $\pi'(S) \subseteq T_{\text{ALG}}$. Therefore, by the monotonicity of $f$, we have $f\prn{T_{\text{ALG}}} \geq f\prn{\pi'(S)}$, and by unconditioning \[ \E\brk{f\prn{T_{\text{ALG}}}} \geq \E\brk{f\prn{\pi'(Q)}}. \] Finally, by Lemma \ref{lem:new-crs} and Remark \ref{rmk:small-z}, we have that for any $\bm{z} \in b \cdot \cP''$ and any fixed $\eps > 0$, \[ \E\brk{f\prn{\pi'(Q)}} \geq c \prn{e^{-b} - \eps} \cdot F(\bm{z}), \] which yields \[ \E\brk{f\prn{T_{\text{ALG}}}} \geq c \prn{e^{-b} - \eps} \cdot F(\bm{z}). \] \end{proof} We are now ready for the main theorem of this section, which follows from Lemmas \ref{lem:mon-alg} and \ref{lem:mon-cont-greedy}, and Claim \ref{clm:fmax-opt}. \begin{theorem}\label{thm:mon} Let $(\cN, \bm{D}, \cC, f)$ be an instance of the Submodular Prophet Inequality model and let $OPT$ denote the prophet's value. Given a $(b, c)$-selectable greedy OCRS $\pi$ for $\cP$, for a non-negative monotone submodular function $f$, $\bm{z} \in b \cdot \cP''$ and fixed $\eps > 0$, Algorithm \ref{alg:mon} returns a set $T_{\text{ALG}}$ such that \[ \E\brk{f(T_{\text{ALG}})} \geq c \prn{e^{-b} - \eps} \prn{1 - e^{-b}} \cdot {\rm OPT}. \] \end{theorem} Next, we provide concrete results for several constraints, given an OCRS for these constraints. First, we summarize known greedy OCRSs for various constraints of interest below. \begin{lemma}[Theorem 1.1 from \cite{ocrs}]\label{lem:ocrs-items} There exist: \vspace{-0.5em} \begin{itemize} \setlength\itemsep{0.0em} \item For every $b \in [0, 1]$, a $(b, 1 - b)$-selectable deterministic greedy OCRS for matroid polytopes. \item For every $b \in [0, 1]$, a $(b, e^{-2b})$-selectable randomized greedy OCRS for matching polytopes. \item For every $b \in [0, \frac{1}{2}]$, a $(b, \frac{1 - 2b}{2 - 2b})$-selectable randomized greedy OCRS for the natural relaxation of a knapsack constraint. \end{itemize} \end{lemma} By combining Lemma \ref{lem:ocrs-items} with Theorem \ref{thm:mon}, we obtain the following corollary. \begin{corollary}\label{cor:mon} Let $(\cN, \bm{D}, \cC, f)$ be an instance of the Submodular Prophet Inequality model and let $OPT$ denote the prophet's value. For a non-negative monotone submodular function $f$ and any fixed $\eps > 0$, Algorithm \ref{alg:mon} returns a set $T_{\text{ALG}}$ such that \begin{align*} \E_{\bm{X}, \cT}[f(T_{\text{ALG}})] &\geq (1 - b) \prn{e^{-b} - \eps} \prn{1 - e^{-b}} \cdot OPT, & \forall b \in [0,1], \text{ if } \cC \text{ is a matroid constraint} \\ \E_{\bm{X}, \cT}[f(T_{\text{ALG}})] &\geq e^{-2b} \prn{e^{-b} - \eps} \left(1 - e^{-b}\right) \cdot OPT, & \forall b \in [0,1], \text{ if } \cC \text{ is a matching constraint} \\ \E_{\bm{X}, \cT}[f(T_{\text{ALG}})] &\geq \frac{1 - 2b}{2 - 2b} \prn{e^{-b} - \eps} \left(1 - e^{-b}\right) \cdot OPT, & \forall b \in \left[0,\frac{1}{2}\right], \text{ if } \cC \text{ is a knapsack constraint} \end{align*} where $\cT = \{T^1, \dots, T^n\}$ denotes the set of random sets Algorithm \ref{alg:mon} generates. \end{corollary} \subsection{Non-Negative Submodular Functions} Below we describe the algorithm for non-negative functions. It is very similar to the monotone case except for a minor change in accepting an element $e$; in the final step, the algorithm tosses an additional random coin and accepts $e$ with probability $1/2$ (see Line 10 in the algorithm). This is inspired by the similar idea in \cite{ocrs} in handling non-monotone functions. \begin{algorithm}\underline{{\sc{General Rounding}}{$\prn{\cU, f, \bm{D}, \cC, \pi, \bm{z}}$}} \\ $T_{\text{ALG}} = \emptyset$ \\ \For{$h \from 1$ \KwTo $n$}{ Let $X_i$ be variable that arrives on day $h$ \\ Let $e \in \cU_i$ be the realization of $X_i$ \\ With probability $\frac{\Pr_{R \sim \bm{z_i}}\brk{R = \{e\}}}{\cD_i(e)}$, set $T_i \from \{e\}$ \\ Otherwise, set $T_i$ to be a random subset $R$ of $\cU_i$, drawn according to $\bm{z}_i$, conditioned on $|R| \neq 1$ \\ \If{$T_i \neq \emptyset$}{ Feed $i$ to OCRS $\pi$ for $\cP$ \\ \If{$\pi$ accepts $i$ \emph{and} $T_i = \{e\}$}{ With probability $\frac{1}{2}$, $T_{\text{ALG}} \from T_{\text{ALG}} \cup \{e\}$}}} Return $T_{\text{ALG}}$ \caption{Algorithm for General Non-Negative Submodular Functions} \label{alg:non-mon} \end{algorithm} Notice that Lemmas \ref{lem:new-crs} and \ref{lem:ti-indep} still hold, as they do not depend on the monotonicity of $f$. We present the following analogue of Lemma \ref{lem:mon-alg} for general submodular functions. The proof of the next lemma relies on an argument similar to that in \cite{ocrs}. \begin{lemma}\label{lem:non-mon-alg} Given a $(b, c)$-selectable greedy OCRS $\pi$ for $\cP$, for any $\bm{z} \in b \cdot \cP''$ and fixed $\eps > 0$, Algorithm \ref{alg:non-mon} returns a set $T_{\text{ALG}} \subseteq \cU$ such that \[ \E\brk{f(T_{\text{ALG}})} \geq \frac{c \prn{e^{-b} - \eps}}{4} \cdot F(\bm{z}). \] \end{lemma} \begin{proof} At every step $i$, Algorithm \ref{alg:non-mon} draws a random set $T_i$ according to the product distribution on $\cU_i$ with probabilities $\bm{z_i}$, by Lemma \ref{lem:ti-indep}. Let $Q = \bigcup_{i \in \cN} {T_i}$. Since the realizations between days are independent, $Q$ is a random set that follows the product distribution on $\cU$ with probabilities $\bm{z}$. Fix a realization $S$ of $Q$ and an instantiation of $\cF_{\pi, \bm{x}}$. Notice that $e \in T_{\text{ALG}} \cap \cU_i$ if and only if $|S \cap \cU_i| = 1$, $i \in \pi(S_\downarrow)$ and the coin toss of Line 10 succeeds. In fact, if we denote \[ W = \bigcup_{\stack{i \in \pi(S_\downarrow)}{|S \cap \cU_i| = 1}} {(S \cap \cU_i)}, \] we have that $\E\brk{f(T_{\text{ALG}})} = \E[f(W(1/2))]$, by the description of Algorithm \ref{alg:non-mon}. By Observation \ref{obs:char-crs}, we have $\bar{\pi}(A) \subseteq \pi(A)$ for any $A \subseteq \cN$, and thus $\pi'(S) \subseteq W$. For ease of notation, we denote $\pi'(S)$ by $L$. For our fixed choice of $S$ and $\cF_{\pi, \bm{x}}$, $L$ is deterministic. Therefore, we can think of $W(1/2)$ as obtained by first calculating a set $L(1/2)$ in which every element of $L$ appears with probability $1/2$ independently, and then adding to it a random set $\Delta \subseteq \cU \setminus L$. The almighty prophet can control the order in which the elements arrive, and thus can make the distribution of $\Delta$ depend on $L(1/2)$. However, $\Delta$ is guaranteed to contain every element with probability at most $1/2$, for every given realization of $L(1/2)$. Thus, \begin{align*} \E\brk{f(W(1/2)) \midd S, \cF_{\pi, \bm{x}}} &= \E\brk{f(L(1/2) \cup \Delta) \midd S, \cF_{\pi, \bm{x}}} \\ &= \sum_{B \subseteq L} {\Pr\brk{L(1/2) = B \midd S, \cF_{\pi, \bm{x}}} \cdot \E\brk{f(B \cup \Delta) \midd S, \cF_{\pi, \bm{x}}}} \\ &\geq \sum_{B \subseteq L} {\Pr\brk{L(1/2) = B \midd S, \cF_{\pi, \bm{x}}} \cdot \frac{\E\brk{f(B) \midd S, \cF_{\pi, \bm{x}}}}{4} } \\ &= \frac{\E\brk{f(L(1/2)) \midd S, \cF_{\pi, \bm{x}}}}{2} \\ &= \frac{\E\brk{f(L) \midd S, \cF_{\pi, \bm{x}}}}{4}, \end{align*} where the first inequality follows from Lemma \ref{lem:buchbinder} since the function $h_B(T) = h(B \cup T)$ is non-negative and submodular for all $B \subseteq \cU$, and the second inequality follows from Lemma \ref{lem:vondrak2}. Taking an expectation over all possible realizations of $S$ and $\cF_{\pi, \bm{x}}$, we obtain \[ \E\brk{f(W(1/2))} = \E_{S, \cF_{\pi, \bm{x}}}\brk{\E\brk{f(W(1/2)) \midd S, \cF_{\pi, \bm{x}}}} \geq \E_{S, \cF_{\pi, \bm{x}}}\brk{\frac{\E\brk{f(L) \midd S, \cF_{\pi, \bm{x}}}}{4}} = \frac{\E\brk{f(L)}}{4}. \] Finally, by Lemma \ref{lem:new-crs} and Remark \ref{rmk:small-z}, we have that for any $\bm{z} \in b \cdot \cP''$ and any fixed $\eps > 0$, \[ \frac{\E\brk{f(L)}}{4} \geq \frac{c \prn{e^{-b} - \eps}}{4} \cdot F(\bm{z}), \] which implies \[ \E\brk{f(T_{\text{ALG}})} = \E\brk{f(W(1/2))} \geq \frac{c \prn{e^{-b} - \eps}}{4} \cdot F(\bm{z}). \] \end{proof} We are now ready to proceed with the main result for general submodular functions, which follows from Lemma \ref{lem:non-mon-alg}, Theorem \ref{thm:intro-gap-mcg2}, and Claim \ref{clm:fmax-opt}. \begin{theorem}\label{thm:non-mon} Let $(\cN, \bm{D}, \cC, f)$ be an instance of the Submodular Prophet Inequality model and let $OPT$ denote the prophet's value. Given a $(b, c)$-selectable greedy OCRS $\pi$ for $\cP$, for a non-negative submodular function $f$, $\bm{z} \in b \cdot \cP''$ and fixed $\eps > 0$, Algorithm \ref{alg:non-mon} returns a set $T_{\text{ALG}}$ such that \[ \E\brk{f(T_{\text{ALG}})} \geq \frac{c \prn{e^{-b} - \eps}}{4} \cdot \prn{1 - e^{-b} - \eps} \cdot OPT. \] \end{theorem} By combining Lemma \ref{lem:ocrs-items} with Theorem \ref{thm:non-mon}, we obtain the following corollary. \begin{corollary}\label{cor:non-mon} Let $(\cN, \bm{D}, \cC, f)$ be an instance of the Submodular Prophet Inequality model and let $OPT$ denote the prophet's value. For a non-negative submodular function $f$ and any fixed $\eps > 0$, Algorithm \ref{alg:non-mon} returns a set $T_{\text{ALG}}$ such that \begin{align*} \E[f(T_{\text{ALG}})] &\geq \frac{(1 - b) \prn{e^{-b} - \eps}}{4} \cdot \prn{1 - e^{-b} - \eps} \cdot OPT, & \forall b \in [0,1], \text{ if } \cC \text{ is a matroid constraint} \\ \E[f(T_{\text{ALG}})] &\geq \frac{e^{-2b} \prn{e^{-b} - \eps}}{4} \cdot \prn{1 - e^{-b} - \eps} \cdot OPT, & \forall b \in [0,1], \text{ if } \cC \text{ is a matching constraint} \\ \E[f(T_{\text{ALG}})] &\geq \frac{(1 - 2b) \prn{e^{-b} - \eps}}{8 - 8b} \cdot \prn{1 - e^{-b} - \eps} \cdot OPT, & \forall b \in \brk{0, \frac{1}{2}}, \text{ if } \cC \text{ is a knapsack constraint} \end{align*} where $\cT = \{T^1, \dots, T^n\}$ denotes the set of random sets Algorithm \ref{alg:mon} generates. \end{corollary}
\section{Introduction} With the development of convolutional neural networks (CNNs), many computer vision tasks have achieved great progress in recent years. Even though supervised learning shows promising results, training CNNs needs large labeled datasets like ImageNet \cite{deng2009imagenet} and Kinetics \cite{kay2017kinetics}. However, it is very expensive and time-consuming to annotate large-scale datasets, especially for complex annotation tasks. To explain it further, the semantic segmentation task requires the category of each pixel, and action detection requires the borders and category of each action instance. From this point of view, training CNNs in a self-supervised manner is of great significance. Recently, self-supervised learning is proposed to utilize unlabeled data to learn representations. Typically, self-supervised methods automatically generate labels from raw data itself and design a proxy task to predict the labels. In this manner, CNNs are encouraged to learn representative features without manual annotations, and the learned features can be used to finetune downstream tasks. For image self-supervised learning, early methods intended to learn representations by predicting the angle of images \cite{gidaris2018unsupervised}, the relative patch location \cite{noroozi2016unsupervised}, or the removed region of the image \cite{pathak2016context}. For video self-supervised learning, a growing number of researches focused on modeling temporal transformations of videos. {\cite{lee2017unsupervised,misra2016shuffle,xu2019self}} shuffled video frames or clips and utilized the original order as the learning target. SpeedNet \cite{benaim2020speednet}, PRP \cite{yao2020video}, PacePred \cite{wang2020self} randomly sped up the video and predicted the speed of the video to learn representations. {\cite{jenni2020video}} investigated 4 temporal transformations ({\it e.g. speed, random, periodic, and warp}) and demonstrated their effectiveness to guide representation learning. While promising results have been achieved, the above works still have some drawbacks. First of all, they do not sufficiently exploit the information provided by videos. The motion of an object contains two parameters: magnitude and direction. For temporal representation learning, speed/playback rate based methods \cite{benaim2020speednet,yao2020video} modify the magnitude of motion and use it as the learning target. They ignore the moving direction of objects. Moreover, previous methods in video self-supervised learning tend to focus on temporal feature learning. Most of them do not exploit tasks for spatial representation learning. However, appearance information, including the semantics of the moving objects and environmental information, are also essential for video-related tasks. Secondly, the preprocessing strategies proposed by previous methods tend to destroy the video's semantic structure, resulting in unreasonable content. For example, order-based method \cite{xu2019self} disrupts the motion pattern and uses the original order as the learning target. However, shuffling video frames will seriously affect the content semantics. While (cubic puzzle \cite{kim2019self}, VCP \cite{luo2020video}) design spatial labels, they severely destroy the spatial structure. Therefore, we intend to investigate how motion direction, as well as spatial semantics, contribute to video representation learning in a simple-yet-effective manner. In this paper, we propose a novel self-supervised representation learning approach referred to as video 3D Sampling (V3S). As shown in Fig. \ref{fig:introduction}, our goal is to make full use of the spatio-temporal information in videos without changing its semantics. To learn temporal features, we leverage the direction and magnitude of motions as the learning target. To learn spatial features, we apply spatial scale and spatial projection to modify the size of objects and the direction of motions. Accordingly, we apply temporal scale and temporal projection for temporal representation learning. To avoid losing too many frames in the speed-up process, which might lead to the loss of the original semantic information, we propose a progressive fast-forward sampling strategy. In this way, we transform the task of predicting the speed to that of predicting the changing pattern of the speed. As a self-supervised method, the transformations mentioned above are used as supervisory signals. In order to fully integrate spatial and temporal features, we set V3S as a multi-task learning framework. The main contributions of this work are summarized as follows: \begin{itemize} \item We propose video 3D sampling to learn spatio-temporal representations. Targeting at exploiting the information a video contains comprehensively, V3S samples video information at all three dimensions of width, height, and time. \item For spatial representation learning, we modify the aspect ratio of objects as the learning target. For temporal representation learning, we exploit the direction of motions and propose to speed up videos progressively. \item We verify V3S's effectiveness on 4 backbones (C3D, R3D, R(2+1)D, S3D-G) and 3 tasks (action recognition, video retrieval, action similarity labeling), which demonstrates that V3S improves the state-of-the-arts with significant margins. \end{itemize} \section{Related Work} In this section, we first introduce video representation learning in self-supervised manners. Then we introduce the recent development of video action recognition. \subsection{Self-Supervised Representation Learning} By generating pseudo labels from the raw data, self-supervised learning methods can learn rich representations without leveraging expensive human-annotated labels. Self-supervised image representation learning has witnessed rapid progress. Various proxy tasks have been proposed such as jigsaw puzzle \cite{noroozi2016unsupervised}, rotation prediction \cite{gidaris2018unsupervised}, colorization \cite{zhang2016colorful}, inpainting \cite{pathak2016context}, and context prediction \cite{doersch2015unsupervised}, to name a few. Video representation learning can be categorized into temporal representation learning and spatiao-temporal representation learning. \subsubsection{Temporal Representation Learning} Existing self-supervised learning methods in image classification can be directly applied to video representation learning due to the fact that video frames are images in essence. Moreover, distinct temporal information of videos was demonstrated effective for many vision tasks (e.g. action recognition). Prior works have explored the temporal ordering of the video frames as a supervisory signal. Based on 2D-CNNs, \cite{lee2017unsupervised,misra2016shuffle} took temporally shuffled frames as inputs and trained a ConvNet to sort the shuffled sequences. \cite{wei2018learning} exploited the arrow of time as a supervisory signal. In \cite{fernando2017self}, an odd-one-out network was proposed to identify the unrelated or odd clips from a set of otherwise related clips. Recently, video self-supervised learning performance has been largely boosted due to 3D-CNNs (e.g. C3D \cite{tran2015learning}, S3D-G \cite{xie2018rethinking}). VCOP \cite{xu2019self} extended the 2D frame ordering pretext tasks to 3D clip ordering. In SpeedNet \cite{benaim2020speednet} and PRP \cite{yao2020video}, the network was trained to predict the video playback rate, which was proved to be effective in learning the foreground moving objects. Similarly, \cite{wang2020self} introduced a pace prediction task that fused the novel option of slow motion. Furthermore, \cite{jenni2020video} investigated multiple different temporal transformations (\emph{speed}, \emph{periodic}, \emph{warp}, \emph{etc.}) to build a useful representation of videos for action recognition. \begin{figure*} \centering \includegraphics[width=2.1\columnwidth]{figure/img_2.png} \caption{Illustration of V3S framework. Given a raw video, spatial and temporal transformations are carried out on it in turn. A model is applied to extract the feature of the transformed video, then the feature is fed to two FC layers to predict the specific category in space and time separately. $O$ denotes the original video, $S_S$ denotes the spatial scale transformation, $S_P$ spatial projection, $T_S$ temporal scale, $T_P$ temporal projection. The details of the parameters are discussed in Sec. \ref{sec:method}.} \label{fig:method} \end{figure*} \subsubsection{Spatio-Temporal Representation Learning} Despite the success in temporal representation learning, spatial transformations applied to video frames are still necessary. It can be interpreted that spatial representation learning focuses more on the appearance of objects while temporal representation learning tends to learn motion patterns. Several spatio-temporal self-supervised methods have been proposed recently. \cite{kim2019self} trained 3D-CNNs by completing space-time cubic puzzles. \cite{jing2018self} proposed 3DRotNet using rotation angel as a supervisory signal, which extended the rotation operation from images to videos. \cite{wang2019self} proposed to regress both motion and appearance statistics along spatial and temporal dimensions for representation learning. VCP \cite{luo2020video} designed the video cloze procedure task to learn the spatio-temporal information of videos to full advantage. In addition, future frame prediction \cite{han2019video,han2020memory}, was usually a considered approach for video representation learning. Self-supervised learning combined with contrastive learning currently has demonstrated promising results, e.g. \cite{wang2020self}. In this paper, we focus on designing pure proxy tasks and leave the potential extension to contrastive learning as future research. \subsection{Video Action Recognition} Action recognition is one of the most important tasks for video understanding. It takes a video clip as the input and outputs the specific action category of the video. Since the dynamic information is complex to understand, action recognition is challenging. Based on the 2D CNNs feature extractor, \cite{simonyan2014two} proposed two-stream convolutional networks where the results of RGB stream and optical flow stream were fused. TSN \cite{wang2016temporal} extracted multiple clips for a video and utilized the whole action video level supervision. \cite{zhou2018temporal} built temporal dependencies among video frames for action recognition. Recently, 3D CNNs feature extractors have attracted much attention due to their strong ability for temporal modeling. C3D \cite{tran2015learning} designed 3D convolutional kernels, which can model spatial and temporal features simultaneously. R3D \cite{tran2018closer} extended C3D with ResNet\cite{he2016deep}. S3D-G \cite{xie2018rethinking} replaced 3D CNNs at the bottom of the network with low-cost 2D convolutions. \section{Methods} \label{sec:method} Recent methods use sampling interval \cite{benaim2020speednet} or clip order \cite{xu2019self} as the learning target to learn temporal features. Specifically, \cite{benaim2020speednet} generates speed-up videos by interval sampling, which enhances the magnitude of the motions. In this work, in addition to learning the magnitude of motions, we also leverage the direction of motions as one of our learning targets. Moreover, spatial semantics are used in our methods, which are ignored by previous methods. Our goal is to encourage CNNs to learn rich spatial and temporal representations. For spatial representation learning, we apply scale and projection transformations. For temporal representation learning, we further extend scale and projection transformation on the temporal dimension. We are going to describe these transformations in the following. \subsection{Spatial Transformation} \label{transformation} To encourage the model to learn spatial representations, we design two transformations on the appearance of video clips. Let $I(x,y)$ be the original frame, $I(u,v)$ be the transformed frame. There is a conversion formula which maps ($x$,$y$) to ($u$,$v$): $$ u =\frac{m_{0}*x+m_{1}*y+m_{2}}{m_{6}*x+m_{7}*y+1}, v =\frac{m_{3}*x+m_{4}*y+m_{5}}{m_{6}*x+m_{7}*y+1}. $$ $$ \begin{bmatrix} m_{0}& m_{1}& m_{2} \\ m_{3}& m_{4}& m_{5} \\ m_{6}& m_{7}& 1 \end{bmatrix} is calculated by solving linear system: $$ $$ \begin{bmatrix} x_{0}& y_{0}& 1 & 0 & 0 & 0 & -x_{0}*u_{0} & -y_{0} * u_{0} \\ x_{1}& y_{1}& 1 & 0 & 0 & 0 & -x_{1}*u_{1} & -y_{1} * u_{1}\\ x_{2}& y_{2}& 1 & 0 & 0 & 0 & -x_{2}*u_{2} & -y_{2} * u_{2}\\ x_{3}& y_{3}& 1 & 0 & 0 & 0 & -x_{3}*u_{3} & -y_{3} * u_{3}\\ 0 & 0 & 0 &x_{0}& y_{0}& 1 & -x_{0}*v_{0} & -y_{0} * v_{0}\\ 0 & 0 & 0 &x_{1}& y_{1}& 1 & -x_{1}*v_{1} & -y_{1} * v_{1}\\ 0 & 0 & 0 &x_{2}& y_{2}& 1 & -x_{2}*v_{2} & -y_{2} * v_{2}\\ 0 & 0 & 0 &x_{3}& y_{3}& 1 & -x_{3}*v_{3} & -y_{3} * v_{3} \\ \end{bmatrix} \cdot \begin{bmatrix} m_0\\ m_1\\ m_2\\ m_3\\ m_4\\ m_5\\ m_6\\ m_7\\ \end{bmatrix} = \begin{bmatrix} u_0\\ u_1\\ u_2\\ u_3\\ v_0\\ v_1\\ v_2\\ v_3\\ \end{bmatrix} $$ , where $(x_i,y_i),(u_j,v_j)(i,j=1,2,3,4)$ are the coordinates of the four vertices of the original and the transformed image. To explain it in detail, we firstly obtain the coordinates $(x,y)$ of four vertices in the original frame, and then calculate the coordinates $(u,v)$ of vertices after transformation. Then, $m_i (i=0,...,7)$ is calculated by the above formula. Thus, every pixel in the original image can find the corresponding location in the transformed frame. To make it simple, we set $(x_0,y_0) = (0,0), (x_1,y_1) = (0,H), (x_2,y_2)$ $= (W,H), (x_3,y_3) = (W,0)$, where $W,H$ denotes the width and the height of the original image. We also set $(u_0,v_0) = (0,0)$. In the following, we are going to describe the detail of the transformations. \textbf{Scale:} In order to change the size (aspect ratio) of the object, we modify the height or width of the video frame. It should be noted that we do not scale the height and width equally (with the same rate), because this only changes the resolution of the image, which is trivial to learn. Moreover, if we change the aspect ratio of the object, and the network can still learn its original proportion, it demonstrates that the network has learned the semantic information of the object. In scale, we set $(u_1,v_1) = (0,b*H), (u_2,v_2) = (a*W,b*H), (u_3,v_3) = (a*W,0)$. It denotes that the width and height of the transformed video frame is $a$ and $b$ times of that of the original video frame. In our implementation, $(a,b)$ is the hyperparameter and the learning target. Fig: \ref{fig:method} shows an example of $(a,b) = (1,0.3) $. \textbf{Projection}: Projection transforms a cuboid into a trapezoid. The head end of the trapezoid is smaller than the tail end, which has the effect of expanding objects close to the camera and shrinking distant objects. In order to change the sizes of objects in different regions with different rates, we apply projection on the video frame. To transform the frame to a trapezoid, we randomly choose one side as the head end and shorten the length. For example, we take the right side as the head end and set $(u_1,v_1) = (0,H)$, $(u_2,v_2)$ =$ (W,(H+c*H)/2),(u_3,v_3) = (W,(H-c*H)/2)$. It denotes that the transformed frame is a trapezoid which takes the left side as the bottom end and the right as the head end. The length of the head end is =$c*H$. For spatial projection, $c$ and the head end side is the learning target. Fig. \ref{fig:method} shows an example of $c = 0.5$ and the head end is the right side. Through spatial transformations, we can change the size (aspect ratio) of the objects uniformly (scale) or non-uniformly (projection) whilst maintaining the semantic information. Fig. \ref{fig:direction} shows the example of a three-frame video with an object moving in a straight line. Through spatial transformations, we can modify the direction of motions. \begin{figure} \centering \includegraphics[width=1.0\columnwidth]{figure/img_4.png} \caption{The left (video frames) shows moving objects in videos. The right (motions) shows the magnitude and direction of the motions. V3S can leverage the direction of motions as the learning target. } \label{fig:direction} \end{figure} \subsection{Temporal Transformation} To encourage the model to learn rich temporal representations, two temporal transformations on video clips are carried out. We design different frame sampling strategies for different temporal transformations. \textbf{Scale}: The scale transformation in spatial modifies the size of the object along its width or height. Accordingly, we change the duration of an action in temporal scale. To achieve that, we speed up a video by interval sampling, and the interval is saved as the learning target. Specifically, let $n$ be the speed, the interval is $n-1$. That is, given a video $V=\{v_i\}$, where $v_i$ is the $i$-$th$ frame in $V$. We generated $V^s$, which is s times speed of $V$ as $V^{s}=[{v_{r},v_{r+s-1},v_{r+2(s-1)},...,v_{r+l(s-1)}}]$, where $r+l(s-1) \leq$ the length of $V$, $r$ is a random start frame in $V$ and $l$ is the length of $V^{s}$. In our implementation, $l = 16$. For temporal scale, the speed $s$ is the learning target. Fig. \ref{fig:method} shows an example of $s=2$. \textbf{Projection}: The spatial projection scales objects in different regions of the video frame at different rates. Accordingly, we propose temporal projection to progressively speed up a video so that it has different playback rates in different stages. In our implementation, we use a multi-stage speed-up mode, which means the video has multiple speeds in the same video. To generate the training samples, when a video $V$ is given, we first sample $l_1$ frames at $s_1-1$ intervals, then $l_2$ frames at $s_2-1$ intervals. The total length of $V^p$ $l = l_1 + l_2 $. In our implementation, $l_1 = l_2 = 8$. Given a specific speed pattern $p = (s_1,s_2)$ and $V$, we generate $V^p$ as $V^{s_1,s_2}=[{V^{S_1},V^{S_2}}]$. The generation of $V^{S_1},V^{S_2}$ is same as the operation in temporal scale. For temporal projection learning, $p$ is the learning target. Fig. \ref{fig:method} shows an example of $p = (1,2)$. With temporal transformation, we speed up the video straightforwardly (scale) or progressively (projection), which encourages the model to capture rich temporal representations. \subsection{Representation Learning} Given a video clip, we first apply a spatial transformation and then a temporal transformation on it. Then we feed it to a backbone to extract features and use a multi-task network to predict the specific transformation. \textbf{Feature Extraction:} To extract video representations, we choose C3D \cite{tran2015learning}, R3D, R(2+1)D \cite{tran2018closer}, and S3D-G \cite{xie2018rethinking} as backbones. C3D stacks five 3D convolution blocks with 3$\times$3$\times$3 convolution kernels in all layers. Within the framework of residual learning, R3D block consists of two 3D convolution layers followed by batch normalization and ReLU layers. R(2+1)D are ResNets with (2+1)D convolutions, which decompose full 3D convolutions into a 2D convolution followed by a 1D convolution. Unlike many other 3D CNNs, S3D-G replaces many of the 3D convolutions, especially the 3D convolutions at the bottom of the network, by low-cost 2D convolutions. S3D-G exhibits distinguished feature extraction ability for action recognition. \textbf{Category Prediction:} To complete the prediction, we take it as a classification task. For each transformation, we fix the parameters and take them as a specific category for classification. To be noted, to make most use of spatial and temporal transformation, we take V3S as a multi-task network. Given the feature extracted by 3D CNNs, it is then fed to two fully connected (FC) layers, which completes the prediction. The output of each FC layer is a probability distribution over different categories. With $a_i$ is the $i$-$th$ output of the fully connected layer for transformation, the probabilities are as follows: $$ p_i=\frac{\exp(a_i)}{\sum^{n}_{j=1}\exp(a_j)} $$ \noindent where $p_i$ is the probability that the transformation belongs to class $i$, and $n$ is the number of transformations. We update the parameters of the network by minimizing the regularized cross-entropy loss of the predictions: $$ \mathcal{L} = -\sum^n_{i=1}y_i\log(p_i) $$ \noindent where $y_i$ is the groundtruth. Let $\mathcal{L^S}$ be the entropy loss for spatial transformation prediction and $\mathcal{L^T}$ be the loss for temporal transformation prediction. The objective function of V3S is : $$ \mathcal{L}_{\mathcal{ST}} = \mathcal{L^S} + \mathcal{L^T} $$ \iffalse \subsection{Contrastive Learning} \label{contrastive learning} The key idea of contrastive learning is to pull together positive pairs and to push off negative pairs. In previous video instance discrimination works, video clips from the same video and their augmentations are taken as positive samples. Whilst clips from different videos and their augmentations counterpart are viewed as negative samples. In V3S framework, we define a clip-level augmentation set $\mathcal{A}=\{T_S, T_P, S_S, S_P\}$. Each transformation in $\mathcal{A}$ is introduced in detail in Sec.\ref{transformation}. Augmentations in $\mathcal{A}$ may greatly change the appearance and motion pattern of the raw actionness, but the high-level semantics like action categories should remain unchanged. To be noted, previous commonly used augmentation methods, such as \emph{RandomFilp}, \emph{GaussianBlur}, \emph{ColorJitterring}, \emph{etc.} are still used randomly in V3S. For the spatial projection branch, the performance of the model increases with the increase of the spatial distortion intensity. The performance when the spatial distortion intensity is the largest is 0.2 higher than the minimum. For the spatial scaling branch, the score is the highest when the spatial distortion intensity is k , Is m. Finally, we adopted the projection intensity a and the zoom intensity b as the setting of the spatial branch. In table \ref{table:ablation} we discuss the impact of the number of options on the performance of V3S time branching. It can be seen that for the time projection and time scaling branches, as the number of options increases, the performance of the model will increase accordingly. This shows that for time series tasks, a more difficult pseudo-task setting is more conducive to the model learning better features. We adopted 4 options and 3 options as the final V3S settings. Given a video set $\mathcal{V}=\{v_i\}_{i=1}^N$ containing $N$ videos, we firstly sample two clips $c_i, c_j$ from a randomly chosen video $v_n$ and $K$ clips $\{c_n\}_{n=1}^K$ from $K$ videos in subset $\mathcal{V}\backslash v_n$. Next we randomly apply different transformations $a (a \in \mathcal{A})$ on each clip. After augmentation, we feed each clip into the CNN backbones followed by a projection head to get their corresponding features $z_i$, $z_j$, and $\{z_n\}_{n=1}^K$. In this way, we now get a positive sample pair $\{(z_i, z_j)\}$ and $K$ negative pairs $\{(z_i, z_1), (z_i, z_2),...,(z_i, z_K)\}$. Then the InfoNCE loss for contrastive learning is: \begin{equation} \mathcal{L}_{ctr} =-\mathrm{log} \frac{\mathrm{exp}(z_i\cdot z_j / \tau)} {\mathrm{exp}(z_i\cdot z_j/ \tau) + \sum_{k=1}^K \mathrm{exp}(z_i\cdot z_k / \tau)} \end{equation} \noindent where $z_i\cdot z_j$ refers to the dot product between two vectors, and $\tau$ is a temperature hyperparameter \cite{wu2018unsupervised} which affects the concentration level of distribution. We realize the contrastive learning part based on the Moco \cite{he2020momentum} framework. Two CNN encoders with same architectures but different parameters are used to extract video clips' features. One of them is updated by stochastic gradient descent, and the other one is updated by momentum. An addition queue with size $T$ is maintained, which stores up negative features. \subsection{General scheme} The total loss can be written as: \begin{equation} \mathcal{L}_{all} = \mathcal{L}_\mathcal{ST} + \lambda \mathcal{L}_{ctr} \end{equation} \noindent where $\mathcal{L}_\mathcal{ST}$ and $\mathcal{L}_{ctr}$ denote the loss functions of each task, respectively, and $\lambda$ is a fixed weight coefficient ($\lambda=1$ in our experiments). \fi \begin{figure}[!t] \centering \includegraphics[width=0.9\columnwidth]{figure/speed.png} \caption{ Visualization of the motion speediness curve of the cliff diving action video. Cliff diving action can be divided into 3 stages: 1. Before the jumping, the motion speediness curve is constant around 0; 2. Moment of jumping, the speediness curve rises rapidly from 0 to 0.9; 3. Falling, the speediness curve constantly fluctuates around 0.9. Our V3S tries to capture the speed patterns at different action stages. } \label{fig:speed} \end{figure} \subsection{Discussion} \label{sec:discussion} In Fig. \ref{fig:speed}, we show the motion speediness curve \cite{benaim2020speednet} of cliff diving action. As one can see, the speediness of the action is different in different stages, rather than a constant value. Take the cliff diving action as an example, there is a rapid rise of the motion speediness from stage 1 to stage 3. We argue that if the network can sense the variation of speed, it can better understand the characteristics of an action. V3S proposes to utilize temporal projection to capture the variation of speed, thereby completes the deficiencies in previous speed-based methods. \section{Experiment} \label{sec:Experiment} \subsection{Experimental Setting} \subsubsection{Datasets} In our experiments, we use four datasets: the UCF101 \cite{soomro2012ucf101}, the HMDB51 \cite{kuehne2011hmdb}, the Kinetics-400(K-400)\cite{kay2017kinetics} and the ASLAN \cite{kliper2011action} to evaluate the effectiveness of our method. UCF101 is a widely used dataset in action recognition task, which is collected from websites including Prelinger archive, YouTube and Google videos. The dataset contains 101 action categories with 9.5k videos for training and 3.5k videos for testing. HMDB51 is extracted from a variety of sources ranging from digitized movies to YouTube, which contains 3.4k videos for training and 1.4k videos for testing with 51 action categories. Kinetics-400 contains 246K train videos. The videos are collected from realistic YouTube videos. ASLAN is an action similarity labeling dataset. It includes 3,631 videos in over 400 action categories. The goal of action similarity labeling task is to estimate if two videos present the same action or not, and this dataset is composed of video pairs with "same" or "not-same" labels. This task is challenging because its test set only contains videos of never-before-seen actions. We use this task to verify the spatio-temporal feature extraction capabilities of our model. \begin{table} \begin{tabular}{lll} \toprule Method &Value& Acc.\\ \midrule $S_S$ & \{(1,1.15), (1,1.3), (1,1.45), (1.15,1), (1.3,1), (1.45,1)\} & 73.2\\ $S_S$ & \{(1,1.3), (1,1.6), (1,1.9), (1.3,1), (1.6,1), (1.9,1)\} & 71.1\\ $S_S$& \{(1,1.45), (1,1.9), (1,2.35), (1.45,1), (1.9,1), (2.35,1)\} & 72.8\\ \midrule $S_P$ & \{0.8, 0.75, 0.7\} & 73.5\\ $S_P$ & \{0.8, 0.7, 0.6\} & 73.6\\ $S_P$ & \{0.8, 0.65, 0.5\} & 73.7\\ \midrule $T_S$& \{1, 2\} & 71.0\\ $T_S$ & \{1, 2, 3\} & 76.4\\ $T_S$ & \{1, 2, 3, 4\} & 76.3\\ \midrule $T_P$ & \{(1,2) ,(2,3), (2,1), (3,2) \} & 75.0\\ $T_P$ & \{(1,2), (2,3), (3,4), (2,1), (3,2), (4,3)\} & 76.8\\ $T_P$ &\{(1,2), (2,3), (3,4), (4,5), (2,1), (3,2),(4,3), (5,4)\} & 77.0\\ \bottomrule \end{tabular} \caption{Evaluation of V3S with R(2+1)D under different parameters. $S_S$ denotes spatial scale, $S_P$ spatial projection, $T_S$ temporal scale, $T_P$ temporal projection.} \label{table:ablation} \end{table} \begin{table*} \centering \begin{tabular}{lcccccc} \toprule Method & Network & Input Size & Params & Pre-train Dataset & UCF101& HMDB51\\ \midrule Random&C3D& 112 × 112&58.3M&UCF101& 63.7 & 24.7\\ VCP\cite{luo2020video}&C3D&112 × 112&58.3M&UCF101& 68.5 & 32.5 \\ PRP\cite{yao2020video}&C3D&112 × 112&58.3M&UCF101& 69.1 & 34.5 \\ V3S(Ours) &C3D&112 × 112&58.3M&UCF101& \textbf{74.8} & \textbf{34.9}\\ \midrule Random&R3D&112 × 112&33.6M&UCF101& 54.5 & 23.4\\ ST-puzzle\cite{kim2019self}&R3D&224 × 224&33.6M&Kinetics-400&65.8 & 33.7 \\ VCP\cite{luo2020video}&R3D&112 × 112&33.6M&UCF101& 66.0 & 31.5\\ PRP\cite{yao2020video}& R3D&112 × 112&33.6M&UCF101& 66.5 & 29.7\\ V3S(Ours)&R3D&112 × 112&33.6M&UCF101 & \textbf{74.0} & \textbf{38.0}\\ \midrule Random&R(2+1)D&112 × 112&14.4M&UCF101& 55.8 & 22.0\\ VCP\cite{luo2020video}&R(2+1)D&112 × 112&14.4M&UCF101& 66.3 & 32.2\\ PRP\cite{yao2020video}&R(2+1)D&112 × 112&14.4M&UCF101 & 72.1 & 35.0\\ PacePred\cite{wang2020self} w/o Ctr&R(2+1)D&112 × 112&14.4M&UCF101& 73.9 & 33.8\\ PacePred\cite{wang2020self}&R(2+1)D&112 × 112&14.4M&UCF101& 75.9 & 35.0\\ PacePred\cite{wang2020self}&R(2+1)D&112 × 112&14.4M&Kinetics-400& 77.1 & 35.0\\ V3S(Ours)&R(2+1)D&112 × 112&14.4M&UCF101 & 79.1 & 38.7\\ V3S(Ours)&R(2+1)D&112 × 112&14.4M&Kinetics-400 & \textbf{79.2} & \textbf{40.4}\\ \midrule SpeedNet\cite{benaim2020speednet} &S3D-G&112 × 112&9.6M&Kinetics-400&81.1 & 48.8\\ CoCLR\cite{han2020self} &S3D&128 × 128&9.6M&UCF101&81.4 & 52.1\\ V3S(Ours) &S3D-G&112 × 112&9.6M&UCF101& \textbf{85.4} & \textbf{53.2} \\ \bottomrule \end{tabular} \caption{Action recognition accuracy on UCF101 and HMDB51.} \label{table:action-recognition} \end{table*} \subsubsection{Implementation Details} For 3D sampling, we firstly transform the raw video and then sample a 16-frame clip from it. Each frame is resized to 224 $\times$ 224 and randomly cropped to 112 $\times$ 112. Specially for spatial projection, if the head end is shorter than 224, we simply crop the frame by $l \times l$, where $l$ is the length of the head end, then it is resized to 112 $\times$ 112. We set the initial learning rate to be 0.01, momentum to be 0.9, and batch size to be 32. Our pre-training process stops after 300 epochs and the best validation accuracy model is used for downstream tasks. Specially, to match the requirement of S3D-G, each frame is firstly resized to 256 $\times$ 256, then randomly cropped to 224 $\times$ 224. In addition, we set the learning rate to be 0.005 for R3D for better convergence. For UCF101, the training set of the first split is used in our pre-training stage, where we randomly choose 800 videos for validation. For Kinetics-400, we use its training set to train our self-supervised model, and randomly select 3000 samples to build the validation set. The batch size with Kinetics-400 is 16 and we train it for 70 epochs. \begin{table} \begin{tabular}{l|ccc|ccc|c} \toprule Method & $S_S$&$S_P$&$S_S$+$S_P$&$T_S$&$T_P$&$T_S$+$T_P$&V3S \\ \midrule Acc. &73.2&73.7&73.8&76.4&77.0&78.0&79.1 \\ \bottomrule \end{tabular} \caption{Combining spatial and temporal transformations. V3S denotes $S_S+S_P+T_S+T_P$.} \label{table:ab2} \vspace{-2em} \end{table} \subsection{Ablation Study} In this section, we evaluate the effectiveness and discuss the hyperparameters of the designed four transformations on the first split of UCF101. For simplicity, we choose R(2+1)D as the backbone for our ablation studies. As shown in table \ref{table:ablation}, we conduct extensive experiments for the selection of each parameter. In table \ref{table:ablation}, we discuss the influence of hyperparameters for spatial transformations. To explain it further, we discuss $(a,b)$ for spatial scale $S_S$, and $c$ for spatial projection $S_P$. For $S_S$ , we randomly select $(a,b)$ $\in$ \{(1,1.15), (1,1.3), (1,1.45), (1.15,1), (1.3,1), (1.45,1)\} in the following experiments, because it demonstrates the best performance among the settings (73.2\% to 71.1\%$\backslash$72.8\%). For $S_P$, we accordingly select projection magnitude $c$ $\in$ \{0.8, 0.65, 0.5\} in the following experiments. In table \ref{table:ablation} (bottom), we discuss the hyperparameters for temporal transformations, which are $s$ for $T_S$ and $p$ for $T_P$. For $T_S$ , we randomly select $s$ from $\{1, 2\}$, $\{1,2,3\}$ or $\{1, 2, 3, 4\}$. When sampling $s$ $\in$ $\{1,2,3\}$, it demonstrates the best performance (76.4\% to 71.0\%$\backslash$76.3\%). we thus set a sampling speed $s \in \{1, 2, 3\}$ in the following experiments. For $T_P$, we accordingly select the speed pattern $p$ $\in$ \{(1,2), (2,3), (3,4), (4,5), (2,1), (3,2), (4,3), (5,4)\} in the following experiments. To combine the designed transformations, we integrate $S_S$, $S_P$, $T_S$, $T_P$ in Table \ref{table:ab2}. After combining spatial scale $S_S$ and spatial projection $S_P$, V3S achieves 73.8\%. V3S also show better performance (78.0\%) when combining $T_S$ and $T_P$. After combining all these four spatial and temporal transformations, the accuracy of 79.1\% is achieved, which surpasses the accuracy of the individual spatial or temporal transformations. In summary, the spatial and temporal transformations are complementary, thus with the combination as the final proxy task, more powerful representations can be learned. \begin{table} \centering \resizebox{\columnwidth}{!}{ \begin{tabular}{lccccc} \toprule Method &Top1&Top5&Top10&Top20&Top50 \\ \midrule Jigsaw & 19.7 & 28.5 & 33.5 & 40.0 & 49.4\\ OPN & 19.9 & 28.7 & 34.0 & 40.6 & 51.6\\ $\mathrm{B\ddot{u}chler}$& 25.7 & 36.2 & 42.2 & 49.2 & 59.5\\ \midrule C3D(random) & 16.7 & 27.5 & 33.7 & 41.4 & 53.0\\ C3D(VCP\cite{luo2020video}) & 17.3 & 31.5 & 42.0 & 52.6 & 67.7\\ C3D(PRP\cite{yao2020video}) & \textbf{23.2} & 38.1 & 46.0 & 55.7 & 68.4\\ C3D(PacePred\cite{wang2020self})& 20.0 & 37.4 & 46.9 & \textbf{58.5} & \textbf{73.1}\\ C3D(V3S) & 21.8 & \textbf{39.0} & \textbf{47.7} & 57.0 & 69.2\\ \midrule R3D(random) & 9.9 & 18.9 & 26.0 & 35.5 & 51.9\\ R3D(VCP\cite{luo2020video}) & 18.6 & 33.6 & 42.5 & 53.5 & 68.1\\ R3D(PRP\cite{yao2020video}) & 22.8 & 38.5 & 46.7 & 55.2& 69.1\\ R3D(PacePred\cite{wang2020self}) & 19.9&36.2&46.1&55.6&69.2\\ R3D(V3S) & \textbf{28.3} & \textbf{43.7} & \textbf{51.3} & \textbf{60.1} & \textbf{71.9}\\ \midrule R(2+1)D(random) & 10.6 & 20.7 & 27.4 & 37.4 & 53.1\\ R(2+1)D(VCP\cite{luo2020video}) & 19.9 & 33.7 & 42.0 & 50.5 & 64.4\\ R(2+1)D(PRP\cite{yao2020video}) & 20.3 & 34.0 & 41.9 & 51.7 & 64.2\\ R(2+1)D(PacePred\cite{wang2020self})&17.9&34.3&44.6&55.5&72.9\\ R(2+1)D(V3S) & 23.1 & \textbf{40.5} &48.7 & 58.5 &72.4\\ R(2+1)D(V3S*) & \textbf{23.5} & 40.0 &\textbf{49.4} & \textbf{59.7} & \textbf{73.9}\\ \midrule S3D-G(SpeedNet*\cite{benaim2020speednet}) & 13.0& 28.1 & 37.5 &49.5 & 65.0\\ S3D-G(V3S) & \textbf{16.6} & \textbf{32.2} & \textbf{41.8} & \textbf{52.3} &\textbf{68.0}\\ \bottomrule \end{tabular} } \caption{Video retrieval performance on UCF101. Methods marked with * are pretrained with Kinetics-400.} \label{table:retrieval-UCF} \vspace{-1cm} \end{table} \subsection{Action Recognition} Utilizing self-supervised pre-training to initialize action recognition models is an established and effective way for evaluating the representation learned via self-supervised tasks. To verify the effectiveness of our method, we conduct experiments on the action recognition task. We initialize the backbone with V3S pre-trained model, and initialize the fully connected layer randomly. Following the protocol of \cite{xu2019self}, we train backbones for 300 epochs during training and make the fine-tuning procedure stop after 160 epochs. For testing, we sample 10 clips for each video and average the possibility of predictions to obtain the final action category. For C3D, R3D and R(2+1)D, we set the initial learning rate to be 0.001. The number of the clip frames is 16 and each frame is first resized to 128 $\times$ 171 and randomly cropped to 112 $\times$ 112. For S3D-G, we set the initial learning rate to be 0.01, the input clip length is 64 frames and each frame is first resized to 256 $\times$ 256 and randomly cropped to 224 $\times$ 224. For action recognition, the batch size is set to 8 and the momentum is set to 0.9. Table \ref{table:action-recognition} shows the split-1 accuracy on UCF101 and HMDB51 for action recognition task. With S3D-G pretrained on UCF101, V3S obtains 85.4\% and 53.2\% on UCF101 and HMDB51 respectively, outperforms CoCLR \cite{han2020self} by 4.0\% and 1.1\%. With R(2+1)D pretrained on Kinetics-400, V3S achieves 79.2\% and 40.4\% on UCF101 and HMDB51, which outperforms PacePred\cite{wang2020self} by 2.1\% and 5.4\%. With C3D, R3D, V3S obtains 74.8\%$\backslash$34.9\% and 74.0\%$\backslash$38.0\%. To be noted, V3S is purely pretext task based, and does not incorporate contrastive learning. However, its performance is better than a series of methods with contrastive loss such as PacePrediction\cite{wang2020self} and CoCLR\cite{han2020self}. This can further verify its effectiveness. \begin{table} \centering \resizebox{\columnwidth}{!}{ \begin{tabular}{lccccc} \toprule Method &Top1&Top5&Top10&Top20&Top50\\ \midrule C3D(random) & 7.4 & 20.5 & 31.9 & 44.5 & 66.3\\ C3D(VCP\cite{luo2020video}) & 7.8 & 23.8 & 35.5& 49.3 & 71.6\\ C3D(PRP\cite{yao2020video}) & \underline{10.5} & \textbf{27.2 }&\textbf{40.4} & \textbf{56.2} & \underline{75.9}\\ C3D(PacePred\cite{wang2020self}) &8.0&25.2&37.8&\underline{54.4}&\textbf{77.5}\\ C3D(V3S) & \textbf{11.1} & \underline{26.5} & \underline{38.0} & 52.0 & 73.0\\ \midrule R3D(random) & 6.7 & 18.3 & 28.3 & 43.1 & 67.9\\ R3D(VCP\cite{luo2020video}) & 7.6 & 24.4 & 36.6 & \underline{53.6} & \underline{76.4} \\ R3D(PRP\cite{yao2020video}) & \underline{8.2} & \underline{25.8} & \underline{38.5} & 53.3 & 75.9\\ R3D(PacePred\cite{wang2020self}) &\underline{8.2}&24.2&37.3&53.3&74.5\\ R3D(V3S) &\textbf{10.8} & \textbf{30.6} & \textbf{42.3 }& \textbf{56.2} & \textbf{77.1}\\ \midrule R(2+1)D(random) & 4.5 & 14.8 & 23.4 & 38.9 & 63.0\\ R(2+1)D(VCP\cite{luo2020video}) & 6.7 & 21.3 & 32.7 & 49.2 & 73.3\\ R(2+1)D(PRP\cite{yao2020video}) & 8.2 & \underline{25.3} & 36.2 & 51.0 & 73.0\\ R(2+1)D(PacePred\cite{wang2020self}) &\textbf{10.0}&24.6&\underline{37.6}&\textbf{54.4}& \underline{77.1}\\ R(2+1)D(V3S) & 9.6 & 24.0 & 37.2 & \underline{54.3} &\textbf{77.9}\\ R(2+1)D(V3S*) & \underline{9.8} & \textbf{26.9} & \textbf{38.5} & 52.7 & 72.2\\ \bottomrule \end{tabular} } \caption{Video retrieval performance on HMDB51. Methods marked with * are pretrained with Kinetics-400. The best results are bold, and the second best results are underlined.} \label{table:retrieval-HMDB} \end{table} \subsection{Video Retrieval} To further validate the effectiveness of V3S, we adopt video retrieval as another downstream task. In the process of retrieval, we generate features at the last pooling layer of extractors. For each clip in the testing split, we query top-K nearest videos from the training set by computing the cosine similarity between two feature vectors. When the testing video and a retrieved video are from the same category, a correct retrieval is counted. Video retrieval results on UCF101 and HMDB51 are listed in Table \ref{table:retrieval-UCF} and Table \ref{table:retrieval-HMDB} respectively. Note that we outperform SOTA methods with different backbones from Top1 to Top50. These results indicate that in addition to providing a good weight initialization for the downstream model, V3S can also extract high-quality and discriminative spatiao-temporal features. \begin{table} \begin{tabular}{lcccc} \toprule Features & Hand-crafted & Sup.&Self-sup.&Acc.\\ \midrule C3D&&\checkmark&&78.3\\ \midrule HOF&\checkmark&&&56.7\\ HNF&\checkmark&&&59.5\\ HOG&\checkmark&&&59.8\\ \midrule STS\cite{wang2019self},R3D&&&\checkmark&60.9\\ V3S,R3D&&&\checkmark&\textbf{65.4}\\ \bottomrule \end{tabular} \caption{Action similarity accuracy on ASLAN.} \label{table:Action similarity} \end{table} \subsection{Action Similarity Labeling} In this section, we exploit action similarity labeling task \cite{kliper2011action} to verify the quality of the learned spatio-temporal representations from another perspective on the ASLAN dataset\cite{kliper2011action}. Unlike action recognition task, the action similarity labeling task focuses on action similarity (same/not-same). The model needs to determine whether the action categories of the two videos are the same. This task is quite challenging as the test set contains never-before-seen actions. \begin{figure*} \centering \includegraphics[width=2.0\columnwidth]{figure/CAM.png} \caption{Attention maps of video frames.} \label{fig:attention} \end{figure*} To evaluate on the action similarity labeling task, we use pre-trained model to extract features from video pairs, and use a linear SVM for the binary classification. Specifically, for each video pairs, each video is first split into 16-frame clips with stride length 8. The network takes these video clips as input to extract clip-level features from the pool3, pool4 and pool5 layers. Then, the clip-level features are averaged and L2 Normalized to get a spatiao-temporal video-level feature. In order to measure the similarity of these two video-level features, we calculate 12 different distances for each feature as described in \cite{kliper2011action}. A 36-dimensional feature is obtained by concatenating these three types of video features and this feature is normalized to ensure that the scale of each distance is the same, following \cite{tran2015learning}. Finally, a linear SVM is used to determine whether the two videos are in the same category or not. Action similarity results on ASLAN are listed in Table \ref{table:Action similarity}. The results show that the accuracy of V3S on R3D outperforms that of the previous methods, and it further shortens the gap between supervised and unsupervised methods. It demonstrates that the features extracted by the V3S network have excellent intra-class similarity and inter-class dissimilarity. \subsection{Visualization} In order to gain a better understanding of what V3S learns, we adopt the Gradient-weighted Class Activation Mapping (Grad-CAM) {\cite{selvaraju2017grad}}, an improved version of CAM\cite{zhou2016learning} to visualize the attention map. Fig. \ref{fig:attention} shows the samples (baseball pitching, archery, band marching, baseball pitch, walking with dog, wall pushups, typing) of such heat maps. One can see that the highly activated regions of these heat maps have a great correlation with the movement of actions. For example, in different stages of the archery action, the activation area varies along the motion. When the man takes out of the arrow, the activation area concentrates on the left hand that is drawing the arrow, and when the man is drawing the bow, the activation area moves to the right hand. \section{Conclusion} In this paper, we propose a novel self-supervised method referred to as V3S to obtain rich spatio-temporal features without human annotations. In V3S, to fully utilize the information in videos, we propose spatial scale and spatial projection to uniformly or non-uniformly scale the objects in a video. We propose temporal scale and temporal projection to straightforwardly or progressively speed up a video. Experimental results show the effectiveness of V3S for downstream tasks such as action recognition, video retrieval and action similarity labeling. Our work inspires the field of video understanding with two aspects: non-contrastive learning based self-supervised pretext task learning is still below the upper bound, and powerful representations can be learned with relatively small datasets like UCF101. \bibliographystyle{ACM-Reference-Format}
\section{Abstract} A Bayesian approach to predicting traffic flows at signalised intersections is considered using the the INLA framework. INLA is a deterministic, computationally efficient alternative to MCMC for estimating a posterior distribution. It is designed for latent Gaussian models where the parameters follow a joint Gaussian distribution. An assumption which naturally evolves from an LGM is that of a Gaussian Markov Random Field (GMRF). It can be shown that a traffic prediction model based in both space and time satisfies this assumption, and as such the INLA algorithm provides accurate prediction when space, time, and other relevant covariants are included in the model. \section{Introduction} Hamilton City Council currently operates 104 signalised intersections in the Waikato region. Traffic counts are recorded at each of these using a device called a Detector in each lane of the oncoming roadways. Decisions for changes to infrastructure are made taking traffic flow into account, and as such it is important to accurately predict future traffic flow. In addition the detectors often fail, resulting in missing traffic counts at various times. This missing data is explored as part of the model fitting and the fitted values from the model output is considered as a form of imputation. \newline The goal of the model is to find the variables with a large influence on the traffic count, and use them to fit a prediction model in INLA. These variables are explored to gain an understanding of their use as covariates in the model. Prediction error for each model is obtained to distinguish between the prediction accuracies of the respective models. \section{INLA} The need to efficiently analyse large datasets of spatial and temporal models has increasing importance with the recent advances in big data collection. INLA is a computational, deterministic algorithm designed for efficient inference of models with a high spatial and temporal resolution. While MCMC models have traditionally been used for this class of models, there is a high computational load when dealing with large datasets. Instead of the simulation based algorithm used by MCMC, INLA is an analytic approximation based on the Laplace method. \subsection{Latent Gaussian Models} A latent field comprises of unobserved variables which is used to infer on a set of parameters $\theta$ $=$ \{$\beta_{0}$, $\beta$, $f$\}. In order to define a latent Gaussian field, the observed data needs to be specified: y $=$ (y$_{1}$, $\cdots$, y$_{n}$). Each y$_{i}$ is characterised by some parameter $\phi_{i}$, which can be defined by an additive structured predictor $\eta_{i}$ through the link function. The linear predictor $\eta_{i}$ is given as: \begin{equation} \eta_{i} = \beta_{0} + \sum_{m=1}^{m}\beta_{m}x_{mi} + \sum_{l=1}^{L}f_{l}(z_{li}) \end{equation} $\beta_{0}$ is a scalar that acts as the intercept in the model, $\beta$ relates to the coefficients that quantify the effects of the covariates $x$ in the model, and $f$ is a collection of the functions that are defined as a result of the set of covariates $z$. As mentioned, the latent field components are collected in a set of parameters $\theta$, defined as $\theta$ $=$ ($\beta_{0}$, $\beta$, $f$) and the hyperparameters for the model is $\Psi$ $=$ \{$\Psi_{1}$, $\cdots$, $\Psi_{K}$\}. Two properties that are prevalent in most latent fields are the assumption of conditional independence, and that the number of hyperparameters in the model is relatively small. The data that are being explored is not necessarily normally distributed, but the latent field is. The likelihood of the $n$ observations in the data, assuming they are from the exponential family of distributions and are conditionally independent, is given by the likelihood \begin{align} p(y|\theta,\Psi) = \prod_{i=1}^{n}p(y_{i}|\theta_{i},\Psi), \end{align} where each observation $y_{i}$ is connected to only one element $\theta_{i}$ in the latent field of parameters $\theta$. [1] \subsection{Gaussian Markov Random Fields} The conditional independence property allows for the creation of a sparse precision matrix $\mathcal{Q}$($\Psi$). This feature within the latent field, gives rise to the Guassian Markov random field (GMRF). There is a significant computational benefit when GMRFs are used in models due to the sparse nature of the precision matrix. GMRFs also have the Markov property, which is needed for models that rely on MCMC sampling. When areal data is used for a given area $i$, its neighbors $\mathcal{N}$($i$) are strictly the areas which it shares its borders with. The Markovian property in the context of a spatio-temporal model means that an observation $y_{i}$ for the $i$th area, is independent of all other observations, given the set of neighbors $i$ has. [1] \begin{align} y_{i} \perp y_{j}|Y_{\_ij}, i \neq j \end{align} \subsection{Laplace Approximation} Laplace approximation is an alternative to simulation-based Monte Carlo integration, where the aim is to approximate the posterior. We are interested in computing the integral \begin{align} \int f(x)dx = \int exp(log f(x))dx \end{align} The Laplace approximation will find a Gaussian approximation to the conditional distribution of a set of continuous variables. The maximum of an integral is found, and then Taylor series approximation is applied to the logarithm of the function to calculate the Laplace approximation. The integral evaluated in the interval $\alpha, \beta$ is approximated by \begin{align} \int_{\alpha}^{\beta} f(x)dx \approx f(x^{*})\sqrt{2\pi \sigma^{2^{*}}}(\Phi{\beta})-\Phi(\alpha)) \end{align} where $\Phi(.)$ represents the cumulative density function of the Normal$(x^{*}, \sigma^{2^{*}})$ distribution. In the case of a Gamma distribution, the mode $x^{*}$ is obtained by solving $\frac{\partial log f(x)}{\partial x} = 0$. The variance $\sigma^{2^{*}}$ is obtained by evaluating $-1/\frac{\partial^{2} log f(x)}{\partial x^{2}}$ at the mode $x^{*}$ [1]. The Laplace approximation is then given by \begin{align} \text {Gamma}(a,b) \approx \text{Normal}(x^{*} = \frac{a-1}{b}, \sigma^{2^{*}} = \frac{a-1}{b^{2}}) \end{align} \section{Data} \subsection{SCATS Detectors} Hamilton City Council controls all of the traffic lights in the city boundaries, including those on State Highways. The system used to manage them is called SCATS. SCATS is installed in 154 cities across 25 countries to manage the timing of signal phases at intersections. Devices called detectors are installed at the end of the each lane at a signalised intersection. They are inductive coils that send a message to the detector controller when a car passes over them. SCATS dynamically manages the timing of the signals in accordance with the number of vehicles passing over the detectors. For example at intersections with a primary and secondary road, during non peak hours the signals at the secondary road will stay red until a vehicle is waiting at it. \\ One form of data output from SCATS is the count of vehicles passing over each detector over a given time span. We will be using these counts to predict the number of vehicles at each detector of an intersection at a given time. The counts in a SCATS traffic count export represent the total number of vehicles that have passed completely across the detector. It will not count vehicles twice, unless a vehicle happens to reverse back past the detector and over it again. The detectors are placed just before the end of the lane so that turning vehicles can be distinguished from through vehicles. Although data is available for individual detectors, we will be using the sum of all detectors to summarise the counts into the total number of vehicles passing through the intersection in a given time span. \begin{figure}[H]% \centering \subfloat[Detector placement at a signalised intersection (RAMM)]{{\includegraphics[width=8cm]{Images/Diagram} }}% \qquad \subfloat[Detector placement at Moonlight-Borman]{{\includegraphics[width=7cm]{Images/Borman} }}% \end{figure} \subsection{SCATS Data Cleaning} The raw exports from SCATS require a large amount of cleaning before they can be used in the INLA model. As the data for each intersection includes the counts for all detectors, the sum of the detector counts is not necessarily the total number of vehicles passing through the intersection. To achieve this each site was examined for the detectors to keep. The above SCATS intersection diagram (right) shows the detector placement at an intersection in northern Hamilton. Detectors 7 and 1 generally count the same number of vehicles, as do 2 and 8, 3 and 9, 5 and 6, and 4 and 10. The detectors further back from the intersection are known as 'advance detectors'. For our purposes these are not needed. The detectors closest to the stop line count all traffic passing through the intersection, and as such all other detector counts were removed from the data. \\ A sum variable was added for each site. This is the sum of the counts at all remaining detectors. In most cases this represents the total vehicles passing through the intersection within each 30 minute interval. A site variable was also added for distinguishing between sites when the data was merged into one data frame. In addition sites outside the city boundaries were removed - Sites 50, 54, 76, 90, 91, 94, and 104. Site 52 is not a valid site and was also removed. The remainder is a total of 96 sites in the city boundary. 61 of these are at signalised intersections and the remaining 35 are pedestrian crossings. \\ The clean data for all sites was joined row-wise, such that the variables of the data are in columns and each observation is a row. A large amount of missing data was found. The detectors at times fail for various reasons, and when this occurs the count is recorded as 'BAD'. HCC currently use an Excel macro to impute some of this missing data, which copies over the data from the previous or following day. In the interest of data integrity we did not impute or remove any missing data. A date range with a large amount of missing data was compared to a range with substantially less, and the two models compared to understand the effect of the missing data on prediction accuracy. The results of this are explained further in Section *. \textit{Plot of NA per week}. \begin{table}[H] \centering \caption{Example of the cleaned SCATS data} \begin{tabular}{lllll} \hline \multicolumn{1}{|l|}{\textbf{Date}} & \multicolumn{1}{l|}{\textbf{Time}} & \multicolumn{1}{l|}{\textbf{Site}} & \multicolumn{1}{l|}{\textbf{Sum}} & \multicolumn{1}{l|}{\textbf{ID}} \\ \hline 16/10/17 & 00:00-00:30 & 1 & 90 & 1 \\ \hline 16/10/17 & 00:30-01:00 & 1 & 67 & 1 \\ \hline \end{tabular} \end{table} \subsection{Data Exploration} Prior to modelling an exploration was first carried out on the cleaned dataset to understand how the traffic count varies over time and space. \begin{lstlisting} > summary(data) X Date Time Site Sum Min. : 1 Min. :2017-10-16 Length:855744 Min. : 1.00 Min. : 1.0 1st Qu.:213937 1st Qu.:2017-12-01 Class :character 1st Qu.: 24.75 1st Qu.: 78.0 Median :427872 Median :2018-01-16 Mode :character Median : 48.50 Median : 283.0 Mean :428337 Mean :2018-01-16 Mean : 50.51 Mean : 428.7 3rd Qu.:641808 3rd Qu.:2018-03-04 3rd Qu.: 75.50 3rd Qu.: 651.0 Max. :864658 Max. :2018-04-19 Max. :103.00 Max. :2674.0 NA's :78241 \end{lstlisting} Here 'Sum' represents the total traffic through a given intersection at a given time. There are a total of 864,658 observations. Of these, 74,241 of the Sum values are missing. The max Sum value is unusual in comparison to the previous quartile values. This could indicate a right skewed distribution. \begin{figure}[H] \centering \includegraphics[width=12cm]{Images/SumHistogram} \caption{Histogram of the Sum variable, showing a right skewed distribution.} \end{figure} The mean per individual site was then calculated. There is a high amount of variation between sites. The mean count ranges from 21.2 for site 87 to 1040 for site 38. \begin{lstlisting}[basicstyle=\small] > site_means [1] 759.42925 441.98785 448.31918 623.85218 282.13367 764.74474 277.34876 324.37975 [9] 299.42688 274.73450 415.45149 405.90955 323.46327 594.90033 493.13527 675.71001 [17] 758.92793 621.85340 868.91672 493.19930 323.07675 650.71247 616.00422 593.23522 [25] 483.36278 401.65174 280.81331 227.69805 577.40712 398.69556 416.32734 439.94986 [33] 372.82661 514.34503 431.93221 309.78825 353.07126 1040.16937 396.77779 396.42508 [41] 700.99394 881.75169 583.08680 625.66561 276.10636 664.14990 189.29603 271.97679 [49] 93.87942 314.89299 30.09410 283.12855 857.37885 160.34653 280.71154 276.90954 [57] 871.64668 263.55210 127.70718 460.65924 891.65010 320.14514 328.53539 355.92475 [65] 620.24575 534.23944 963.58047 832.36417 821.75009 170.79412 283.38387 374.61378 [73] 254.41712 583.16942 122.64221 347.20161 174.09591 123.17792 123.64903 249.70587 [81] 137.03924 103.61872 305.51688 118.52460 264.16922 576.14453 21.20215 242.60216 [89] 232.07296 482.56088 172.29681 290.42743 168.53986 399.13894 113.73490 124.29912 \end{lstlisting} \begin{figure}[H] \centering \includegraphics[width=12cm]{Images/BarplotMeanID} \caption{Mean traffic sum per site} \end{figure} Plotting the Sum by time shows a slight morning peak followed by a steady rise until the evening peak. \begin{figure}[H] \centering \includegraphics[width=12cm]{Images/AllSitesByTime} \caption{Mean Traffic Count (Sum) across all sites by time.} \end{figure} This varies significantly by site, although most sites appear to follow the same general shape over time. The top line is Site 38 - Te Rapa Road/Wairere Drive, which is the only site with a larger lunchtime peak than evening peak. A few sites stand out with an unusual zig-zag shape. These sites record an unusually low count every second half hour. HCC was contacted about this and were unaware of the issue. It is hoped that the INLA prediction will give more realistic predictions for the true traffic count at these sites. It is likely that the prediction error for the sites will be high, so it is useful to note these beforehand. \begin{figure}[H] \centering \includegraphics[width=14cm]{Images/EachSiteByTime} \caption{Mean Traffic Count (Sum) across each sites by time.} \end{figure} There is a total of 78,241 missing values from 864,658 observations. These values were visualised to understand if certain sites or time periods had an unusual amount of missing values. \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=20cm]{Images/MissingData}} \caption{Left: Missing data per week, from 16 October 2017 to 19 April 2018. Right: Missing data per Site ID.} \end{figure} There is a large amount of missing observations from weeks 20 to 24. This period covers both school holidays and school dates. The difference between these periods will be tested, as it is expected that sites near school experience a increase in traffic during school hours. The effect of this will be analysed in the INLA model as a covariate. The chosen time period does not include the Christmas holiday period during which less traffic is expected. The large number of missing data in this time period may have an effect on the predictive accuracy of the model. An additional model was run for the weeks 1-9. There is comparatively a smaller amount of missing data in this period. The difference in Mean Percentage Error was evaluated for days, weeks and sites between the two date ranges. The difference was found to be insignificant. For this reason we chose to subset the data to the date range 15 January 2018 - 13 April 2018. \\ As seen in Figure 5 (right), there are a few sites with an unusually high amount of missing data. When HCC was contacted about this they advised that these sites are minor and as a result their repair is low priority. Often some or all detectors were found to be offline at these sites, although they were still included in the model as there are periods during which they are recording. This data is valuable for the predictions at nearby sites. \section{Spatio-Temporal Correlation} The intersections are defined as realisations of the stochastic traffic flow indexed by locations in the space domain $D$. The count $y$ is a random outcome at each location, while the spatial index $s$ varies continuously in the city boundary $D$. The data is represented in space as a collection of observations $y = y(s_{1}),y(s_{n}),...,y(s_{n})$ where $s_{1},...,s_{n}$ indicate the intersection locations.\\ The geographical correlation can be defined with a sparse matrix $n \times n$, where n is the number of observed locations. Each value in the matrix represents the existence of spatial correlation between sites $r$ and $c$, where $r$ represents the location at row index $r$ and $c$ represents the location at column index $c$. If each location only has a few neighbors, in the case of the intersection network, most elements of the matrix will be zero. This greatly reduces the computational complexity of computing the correlation existing in the spatial structure. A sparse matrix was created for the traffic model using GIS. Where two sites were nearby and on the same road, the traffic count at one site is expected to be correlated with the traffic at the second site in the same time interval. The presence of correlation was represented as a '1', with all other cells empty for valid input into the INLA model.\\ \begin{figure}[H] \centering \includegraphics[width=6cm, height=6cm]{Images/sparse_matrix} \caption{Sparse matrix for the intersections. A black square denotes correlation between the site in row r and column c. Note each index is sequential and not representative of the site number. The sparse matrix was changed for the final two models (13 and 14) which removed three sites.} \end{figure} Note: The site numbers were recoded to ID's for input into the INLA model, as INLA expects sequential area ID's. Further reference to sites will used the ID instead of the site number, which may not necessarily be the same. \\ The temporal variation is a Markov process such that $P(X_{n} = j | X_{n-1} = i)$. When using only time as a variable, the traffic count at a particular time value is dependent only on the previous time value. Both the spatial and temporal correlation need to be accounted for in the model. The process indexed by space and time is \begin{align} Y(s,t) \equiv {y(s,t),(s,t) \in \box \subset \mathbb{R}^{2} \times \mathbb{R}} \end{align} observed at $n$ spatial locations and $T$ time points. For a seasonal model, there is an additional dependence on the same time point in the previous season. A natural definition of a season in the traffic model is a day. For traffic at 8am at a given site is related to the traffic at 7am on the same day, as well as 8am on the previous day. \\ The spatial variable is structured while the time is both structured and unstructured with a random $iid$ effect. The model is defined as \begin{align} n_{it} = \beta_{0} + \mu_{i} + \upsilon_{i} + \gamma_{t} + \phi_{t} \end{align} where $n_{it}$ is the link function \\ $\beta_{0}$ is the intercept \\ $\mu_{i}$ is the structured spatial effect modelled as BYM \\ $\upsilon_{i}$ is the unstructured spatial effect modelled as $iid$ \\ $\gamma_{t}$ is the structured time effect modelled as seasonal with period p\\ and $\phi_{t}$ is the unstructured time effect modelled as $iid$. \\ An interaction effect can be added to the model. This occurs where the change in the response between different spatial areas is dependent on the time period, and vice versa. For example the change in traffic at Site 1 from 5pm-6pm may be different to the same change from 5pm-6pm at Site 2. if no interaction is assumed, this change is assumed to be constant, varying only between time periods and the site. The INLA model allows for multiple interaction types to be specified depending on the structure of the space and time variables. Both space and time are structured in the traffic data. The structure matrix can be written as the Kronecker product of $R_{\delta} = R_{u} \otimes R_{\gamma}$, and has a rank of (T-1)(n-1) for a random walk of order 1, and of (T-2)(n-1) for a random walk of order 2. Although this interaction type is appropriate in the context of the traffic model, we were unable to successfully run the INLA model with this interaction effect. As an alternative we resorted to the Type I interaction, which assumes an interaction between the two unstructured effects time and space. The structure matrix is written as \begin{align} R_{\delta} = R_{v} \otimes R_{\phi} = I \otimes I = I \end{align} \section{INLA Model} \subsection{Evaluating Model Performance} Hamilton City Council have indicated that they are seeking a prediction error less than 10\%. That is for the traffic in one hour at each site, the predicted count is no further than 10\% from the observed count for the majority of total observations. This can be expressed as the average percentage difference between the observed and predicted values. For a given site this is represented as \begin{align} MPE_{s,t} = \frac{1}{n}\sum_{i \in s,t}^{}(\frac{abs(y_{i}-\hat{y_{i}})}{y_{i}} \times 100) \end{align} Where $MPE_{s,t}$ is the mean percentage deviation of the predicted value from the observed value at site $s$ and time $t$, and $n$ is the total number of observations at site $s$. Equivalently this can be expressed as an MPE for a given time or day across all sites. The overall MPE for all observations is the average of all individual MPE's: \begin{align} MPE = \frac{1}{n}\sum_{i=1}^{n}(\frac{abs(y_{i}-\hat{y_{i}})}{y_{i}} \times 100) \end{align} The predictive accuracy was evaluated for a full week for each model. Multiple models were tested, beginning with the most basic model using only time, space and no interaction. In addition the performance of each INLA control setting was checked. This was done at the beginning with further models created using the fastest one, provided the accuracy was similar to the rest. Covariates were progressively added, with both interaction and non interaction so that the reduction in effect of the interaction could be evaluated at each step. In addition the effect of missing data was investigated. As seen in Figure 5, the first three months of the data set have a much smaller amount of missing data compared to the last three months. As noted in Section 4.3 the larger amount of missing data in the last three months did not have a noticeable effect on the predictive accuracy of the model. \subsection{Model 11} \begin{table}[H] \centering \small \caption{Model 11 Parameters} \begin{tabular}{|l|l|l|l|l|l|} \hline \multicolumn{1}{|l|}{\textbf{Time Aggregation}} & \multicolumn{1}{l|}{\textbf{Interaction}} & \multicolumn{1}{l|}{\textbf{Covariates}} & \multicolumn{1}{l|}{\textbf{Date Range}} & \multicolumn{1}{l|}{\textbf{Prediction Range}} & \multicolumn{1}{l|}{\textbf{Control}} \\ \hline 1 Hour & Yes & None & Weekdays, Jan 15-Apr 13 & Weekdays, Apr 7 - Apr 13 & Gaussian + EB \\ \hline \end{tabular} \end{table} \begin{lstlisting} model.formula = Y ~ f(ID, model = "bym", graph = H) + f(Time, model = "seasonal", season.length = 12) + f(Time1, model = "iid") + f(ID.Time, model = "iid") model = inla(model.formula, family = "poisson", data = data.subset, control.predictor = list(link = 1, compute = TRUE), verbose = T, control.inla = list(strategy = "gaussian", int.strategy = "eb")) \end{lstlisting} \centering{\Large{\textbf{MPE: 14.25}}} \begin{table}[H] \centering \begin{tabular}{rrrrrr} \hline & Monday & Tuesday & Wednesday & Thursday & Friday \\ \hline 1 & 16.17 & 14.54 & 14.14 & 13.27 & 13.19 \\ \hline \end{tabular} \end{table} \begin{table}[H] \centering \small \begin{tabular}{rrrrrrrrrrrrr} \hline & 7-8 & 8-9 & 9-10 & 10-11 & 11-12 & 12-13 & 13-14 & 14-15 & 15-16 & 16-17 & 17-18 & 18-19 \\ \hline & 21.25 & 16.37 & 9.42 & 12.30 & 14.76 & 14.32 & 13.40 & 9.94 & 12.83 & 10.68 & 14.13 & 21.74 \\ \hline \end{tabular} \end{table} \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=20cm]{Images/Model11}} \caption{Left: MPE per site. Right: Observed vs Predicted for last week.} \end{figure} \subsection{Model 12} \begin{table}[H] \centering \small \caption{Model 12 Parameters} \begin{tabular}{|l|l|l|l|l|l|} \hline \multicolumn{1}{|l|}{\textbf{Time Aggregation}} & \multicolumn{1}{l|}{\textbf{Interaction}} & \multicolumn{1}{l|}{\textbf{Covariates}} & \multicolumn{1}{l|}{\textbf{Date Range}} & \multicolumn{1}{l|}{\textbf{Prediction Range}} & \multicolumn{1}{l|}{\textbf{Control}} \\ \hline 1 Hour & Yes & None & Weekends, Jan 15-Apr 13 & Weekends, Apr 7-Apr 13 & Gaussian + EB \\ \hline \end{tabular} \end{table} \begin{lstlisting} model.formula = Y ~ f(ID, model = "bym", graph = H) + f(Time, model = "seasonal", season.length = 12) + f(Time1, model = "iid") + f(ID.Time, model = "iid") model = inla(model.formula, family = "poisson", data = data.subset, control.predictor = list(link = 1, compute = TRUE), verbose = T, control.inla = list(strategy = "gaussian", int.strategy = "eb")) \end{lstlisting} \centering{\Large{\textbf{MPE: 17.71}}} \begin{table}[H] \centering \begin{tabular}{rrr} \hline & Saturday & Sunday \\ \hline 1 & 15.28 & 20.18 \\ \hline \end{tabular} \end{table} \begin{table}[H] \centering \small \begin{tabular}{rrrrrrrrrrrrr} \hline & 7-8 & 8-9 & 9-10 & 10-11 & 11-12 & 12-13 & 13-14 & 14-15 & 15-16 & 16-17 & 17-18 & 18-19 \\ \hline & 36.67 & 29.59 & 21.04 & 18.17 & 15.58 & 14.06 & 13.36 & 10.76 & 11.51 & 11.50 & 12.79 & 17.77 \\ \hline \end{tabular} \end{table} \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=20cm]{Images/Model12}} \caption{Left: MPE per site. Right: Observed vs Predicted for last week.} \end{figure} \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=20cm]{Images/BadSitesModel11}} \caption{Left: 3 sites with the highest MPE} \end{figure} \begin{flushleft} There are three obvious outliers in Figure 15 (left). Two of these, IDs 51 and 87, are pedestrian crossings near schools in Rototuna. They experience comparatively very little traffic compared to school drop off and pick up times. The model predicts well for most hours apart from school pick up and drop off times, where it is underpredicting. In addition as seen in the above figure (left), the model is overpredicting for Site 7 by a significant margin. This is assumed to be a fault in the detector recording. The model is likely predicting a more realistic count given the count of nearby sites in each time period. All three sites were deemed by HCC as unimportant for prediction. To investigate the influence of removing these sites on the MPE, two additional models were run for both weekdays and weekends with these three sites removed. The sparse matrix was updated accordingly as described in Section 5. \end{flushleft} \subsection{Model 13} \begin{table}[H] \centering \small \caption{Model 13 Parameters} \begin{tabular}{|l|l|l|l|l|l|} \hline \multicolumn{1}{|l|}{\textbf{Time Aggregation}} & \multicolumn{1}{l|}{\textbf{Interaction}} & \multicolumn{1}{l|}{\textbf{Covariates}} & \multicolumn{1}{l|}{\textbf{Date Range}} & \multicolumn{1}{l|}{\textbf{Prediction Range}} & \multicolumn{1}{l|}{\textbf{Control}} \\ \hline 1 Hour & Yes & None & Weekdays, Jan 15-Apr 13 & Weekdays, Apr 7-Apr 13 & Gaussian + EB \\ \hline \end{tabular} \end{table} \begin{lstlisting} model.formula = Y ~ f(ID, model = "bym", graph = H) + f(Time, model = "seasonal", season.length = 12) + f(Time1, model = "iid") + f(ID.Time, model = "iid") model = inla(model.formula, family = "poisson", data = data.subset, control.predictor = list(link = 1, compute = TRUE), verbose = T, control.inla = list(strategy = "gaussian", int.strategy = "eb")) \end{lstlisting} \centering{\Large{\textbf{MPE: 11.96}}} \begin{table}[H] \centering \begin{tabular}{rrrrrr} \hline & Monday & Tuesday & Wednesday & Thursday & Friday \\ \hline 1 & 12.48 & 12.25 & 11.89 & 11.54 & 11.64 \\ \hline \end{tabular} \end{table} \begin{table}[H] \centering \small \begin{tabular}{rrrrrrrrrrrrr} \hline & 7-8 & 8-9 & 9-10 & 10-11 & 11-12 & 12-13 & 13-14 & 14-15 & 15-16 & 16-17 & 17-18 & 18-19 \\ \hline 1 & 18.05 & 14.64 & 7.69 & 10.43 & 11.84 & 11.91 & 11.71 & 8.02 & 10.05 & 8.92 & 12.58 & 17.66 \\ \hline \end{tabular} \end{table} \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=20cm]{Images/Model13}} \caption{Left: MPE per site. Right: Observed vs Predicted for last week.} \end{figure} \begin{table}[H] \centering \begin{tabular}{rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr} \hline 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\ \hline 5.22 & 8.30 & 7.42 & 5.73 & 8.16 & 6.94 & 8.62 & 16.28 & 20.27 & 9.29 & 10.01 & 9.85 & 11.72 & 9.13 & 6.88 \\\\ \hline 16 & 17 & 18 & 19 & 20 & 21 & 22 & 23 & 24 & 25 & 26 & 27 & 28 & 29 & 30 \\ \hline 4.46 & 9.34 & 7.07 & 8.29 & 7.89 & 9.24 & 8.34 & 5.25 & 6.18 & 8.46 & 11.71 & 30.16 & 5.20 & 6.56 & 25.18 \\\\ \hline 31 & 32 & 33 & 34 & 35 & 36 & 37 & 38 & 39 & 40 & 41 & 42 & 43 & 44 & 45 \\ \hline 6.67 & 8.46 & 6.93 & 7.00 & 22.51 & 9.06 & 8.66 & 6.74 & 8.41 & 9.21 & 6.83 & 8.77 & 9.45 & 7.10 & 12.69 \\\\ \hline 46 & 47 & 48 & 49 & 50 & 51 & 52 & 53 & 54 & 55 & 56 & 57 & 58 & 59 & 60 \\ \hline 14.27 & 7.46 & 17.51 & 6.57 & 22.73 & 6.27 & 13.86 & 11.91 & 6.35 & 8.05 & 12.74 & 12.98 & 13.22 & 10.64 & 10.96 \\\\ \hline 61 & 62 & 63 & 64 & 65 & 66 & 67 & 68 & 69 & 70 & 71 & 72 & 73 & 74 & 75 \\ \hline 9.24 & 7.52 & 14.01 & 15.00 & 10.58 & 13.10 & 12.62 & 17.63 & 12.47 & 6.30 & 20.37 & 8.56 & 9.83 & 26.35 & 42.69 \\\\ \hline 76 & 77 & 78 & 79 & 80 & 81 & 82 & 83 & 84 & 85 & 86 & 87 & 88 & 89 & 90 \\ \hline 12.01 & 12.84 & 14.96 & 21.80 & 16.29 & 8.82 & 25.34 & 8.80 & 9.15 & 13.31 & 9.83 & 7.11 & 18.96 & 8.86 & 16.08 \\\\ \hline 91 & 92 & 93 \\ \hline 10.60 & 31.50 & 28.35 \end{tabular} \caption{MPE per site} \end{table} \begin{table}[H] \centering \begin{tabular}{rrrrrr} \hline & Monday & Tuesday & Wednesday & Thursday & Friday \\ \hline 7-8 & 17.34 & 18.63 & 19.26 & 18.47 & 16.54 \\ 8-9 & 14.25 & 14.59 & 14.77 & 15.75 & 13.85 \\ 9-10 & 6.19 & 7.57 & 7.69 & 9.47 & 7.55 \\ 10-11 & 12.43 & 11.29 & 9.06 & 9.63 & 9.74 \\ 11-12 & 13.95 & 11.55 & 12.10 & 10.50 & 11.11 \\ 12-13 & 13.36 & 15.31 & 12.30 & 9.13 & 9.45 \\ 13-14 & 13.59 & 14.44 & 10.43 & 9.95 & 10.15 \\ 14-15 & 8.85 & 8.40 & 5.75 & 8.33 & 8.75 \\ 15-16 & 10.19 & 7.96 & 9.37 & 9.50 & 13.21 \\ 16-17 & 8.89 & 7.80 & 8.72 & 9.36 & 9.84 \\ 17-18 & 12.14 & 12.74 & 13.55 & 12.04 & 12.42 \\ 18-19 & 18.58 & 16.67 & 19.61 & 16.40 & 17.06 \\ \hline \end{tabular} \caption{MPE per day and time. Note the time is in 24 hour format.} \end{table} \subsection{Model 14} \begin{table}[H] \centering \small \caption{Model 14 Parameters} \begin{tabular}{|l|l|l|l|l|l|} \hline \multicolumn{1}{|l|}{\textbf{Time Aggregation}} & \multicolumn{1}{l|}{\textbf{Interaction}} & \multicolumn{1}{l|}{\textbf{Covariates}} & \multicolumn{1}{l|}{\textbf{Date Range}} & \multicolumn{1}{l|}{\textbf{Prediction Range}} & \multicolumn{1}{l|}{\textbf{Control}} \\ \hline 1 Hour & Yes & None & Weekends, Jan 15-Apr 13 & Weekends, Apr 7-Apr 13 & Gaussian + EB \\ \hline \end{tabular} \end{table} \begin{lstlisting} model.formula = Y ~ f(ID, model = "bym", graph = H) + f(Time, model = "seasonal", season.length = 12) + f(Time1, model = "iid") + f(ID.Time, model = "iid") model = inla(model.formula, family = "poisson", data = data.subset, control.predictor = list(link = 1, compute = TRUE), verbose = T, control.inla = list(strategy = "gaussian", int.strategy = "eb")) \end{lstlisting} \centering{\Large{\textbf{MPE: 15.06}}} \begin{table}[H] \centering \begin{tabular}{rrr} \hline & Saturday & Sunday \\ \hline 1 & 12.67 & 17.45 \\ \hline \end{tabular} \end{table} \begin{table}[H] \centering \small \begin{tabular}{rrrrrrrrrrrrr} \hline & 7-8 & 8-9 & 9-10 & 10-11 & 11-12 & 12-13 & 13-14 & 14-15 & 15-16 & 16-17 & 17-18 & 18-19 \\ \hline & 34.45 & 25.83 & 15.24 & 14.38 & 13.79 & 10.86 & 10.62 & 9.21 & 8.99 & 9.54 & 10.77 & 17.05 \\ \hline \end{tabular} \end{table} \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=20cm]{Images/Model14}} \caption{Left: MPE per site. Right: Observed vs Predicted for last week.} \end{figure} \begin{table}[H] \centering \begin{tabular}{rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr} \hline 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\ \hline 1 15.10 & 19.55 & 17.11 & 14.23 & 17.89 & 14.68 & 17.89 & 20.72 & 20.06 & 21.70 & 22.75 & 20.13 & 10.39 & 10.46 & 14.91 \\\\ \hline 16 & 17 & 18 & 19 & 20 & 21 & 22 & 23 & 24 & 25 & 26 & 27 & 28 & 29 & 30 \\ \hline 14.35 & 13.79 & 10.77 & 9.09 & 11.52 & 9.06 & 7.87 & 8.49 & 13.62 & 14.24 & 17.52 & 14.99 & 7.80 & 14.81 & 19.61 \\\\ \hline 31 & 32 & 33 & 34 & 35 & 36 & 37 & 38 & 39 & 40 & 41 & 42 & 43 & 44 & 45 \\ \hline 12.62 & 12.84 & 13.23 & 14.87 & 9.58 & 8.97 & 20.69 & 9.86 & 13.77 & & & 21.51 & 19.83 & 10.10 & 22.81 \\\\ \hline 46 & 47 & 48 & 49 & 50 & 51 & 52 & 53 & 54 & 55 & 56 & 57 & 58 & 59 & 60 \\ \hline 11.14 & 18.70 & 11.94 & 12.34 & 42.48 & 11.97 & 8.81 & 12.19 & 7.73 & 11.82 & 22.73 & 9.23 & & 14.94 & 20.91 \\\\ \hline 61 & 62 & 63 & 64 & 65 & 66 & 67 & 68 & 69 & 70 & 71 & 72 & 73 & 74 & 75 \\ \hline 12.06 & 9.70 & 9.27 & 9.86 & 13.08 & 10.01 & 25.15 & 19.77 & 9.20 & 8.80 & 40.09 & 9.39 & 9.73 & 16.16 & 38.85 \\\\ \hline 76 & 77 & 78 & 79 & 80 & 81 & 82 & 83 & 84 & 85 & 86 & 87 & 88 & 89 & 90 \\ \hline 9.94 & 18.03 & 11.84 & 12.02 & 18.12 & 14.28 & 17.18 & 11.50 & 11.03 & 24.82 & 12.71 & 10.30 & 12.15 & 15.26 & 20.84 \\\\ \hline 91 & 92 & 93 \\ \hline 9.37 & 18.36 & 14.85 \\ \hline \end{tabular} \caption{MPE per site} \end{table} \begin{table}[H] \centering \begin{tabular}{rrr} \hline & Saturday & Sunday \\ \hline 7-8 & 19.93 & 48.98 \\ 8-9 & 16.05 & 35.62 \\ 9-10 & 11.19 & 19.29 \\ 10-11 & 13.93 & 14.83 \\ 11-12 & 13.52 & 14.06 \\ 12-13 & 11.61 & 10.11 \\ 13-14 & 11.29 & 9.96 \\ 14-15 & 11.18 & 7.24 \\ 15-16 & 10.30 & 7.68 \\ 16-17 & 10.43 & 8.65 \\ 17-18 & 9.02 & 12.53 \\ 18-19 & 13.63 & 20.47 \\ \hline \end{tabular} \caption{MPE per day and time. Note the time is in 24 hour format.} \end{table} \begin{flushleft} Removing site IDs 7, 51 and 87 resulted in a significant reduction across the MPE for each day and time. As seen in the MPE per site tables (Table 17 and 20), the MPE for most sites is close to or below the desired 10\% error. For the weekdays model, a few sites remain with 10-30\% error. IDs 92 and 93 are relatively high, and ID 75 has the highest MPE at 42.69\%. In the weekends model, IDs 92 and 93 are performing better while ID 75 is still high. The two models lead to different MPE's for each ID. In some cases ID's with a low MPE in the weekday model have a high MPE in the weekend model, and vice versa. \\ In the weekday model, the MPE 9am-10am across all days is low. This is also true for 2pm-6pm. There is not a large difference between days. In the weekends model, the MPE during Sunday from 7am-9am and 6pm-7pm is high, while 12pm-5pm is low. The MPE for Saturday is relatively constant, but 7am-9am is high, consistent with the rest of the week. Overall the model is underpredicting for most times in the weekdays and Saturday, but overpredicting for Sunday. \newline The final model is defined as \begin{align} n_{it} = \beta_{0} + \mu_{i} + \upsilon_{i} + \gamma_{t} + \phi_{t} \end{align} where $n_{it}$ is the link function \\ $\beta_{0}$ is the intercept \\ $\mu_{i}$ is the structured spatial effect modelled as BYM \\ $\upsilon_{i}$ is the unstructured spatial effect modelled as $iid$ \\ $\gamma_{t}$ is the structured time effect modelled as seasonal with period 12\\ and $\phi_{t}$ is the unstructured time effect modelled as $iid$. \\ \end{flushleft} \raggedright \section{Comparison to prediction using the prior mean} In the Bayesian context, a prior can be defined for the prediction of traffic count at a given site, time and day. For equivalent comparison to the prediction given by the INLA model, this was taken as the mean of the previous seven weeks. Given that the predictors follow a fixed set of values, it is expected that using solely the prior mean will give an accurate prediction. \newline For all observations at 7am on Monday, the mean was taken for all 7am Monday observations for the first 8 weeks of our date range and compared to the observed value at 7am Monday for the final week. This was compared to the prediction from Model 11. The MPE for the INLA model was only slightly smaller than the prediction by taking the mean of the previous observations for the same time and day. \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=14cm]{Images/Seven}} \caption{Observed vs Mean and Predicted for 7am (all sites)} \end{figure} \begin{lstlisting} mean(meanPE, na.rm = T) = 22.30767 mean(predPE, na.rm = T) = 21.18661 \end{lstlisting} The above comparison was extended to all times on Monday to see if this remains constant for other times from 7am-7pm. This is shown below for a sample of sites. \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=16cm]{Images/SitesMeanvsPred}} \caption{Observed vs Mean of prior 7 weeks vs Predicted for Monday, Site IDs 1, 38, 70 and 92} \end{figure} \begin{lstlisting} mean(meanPE, na.rm = T) = 11.6286 mean(predPE, na.rm = T) = 16.17448 \end{lstlisting} In the above, meanPE is the MPE between the prior 7 week mean and the observed count for the same site, time and day. predPE is the MPE between the INLA prediction using model 11 and the observed count for the same site, time and day. The MPE using the prior mean was 11.63\%, compared to 16.17\% for the INLA prediction. \newline The INLA prediction seems to better predict the traffic count at peak times, although the mean prediction more closely follows the pattern from 7am-7pm. This suggests that the pattern of the traffic is relatively similar across the same site, hour and day. Although this may be affected by covariates such as schools, weather, roadworks and major events, in most cases the mean prediction is sufficient. When the nature of the data is not as consistent or predictable, INLA will likely be more accurate. The mean prediction does not take into account covariates, and therefore when these are highly influential the INLA prediction is likely to outperform the mean prediction. \newline Perhaps using this process as a prior for the INLA model will result in a more accurate model overall. The prior in this model will act as a baseline, with the further complexity of the spatio-temporal structure and the INLA algorithm providing additional accuracy for the predicted time period. INLA provides a robust structure for defining a prior, although it was not used in the final model. \begin{table}[H] \centering \begin{tabular}{rrrrrr} \hline & ActualY & pred & mean & meanPE & predPE \\ \hline 1 & 2382 & 2208.88 & 1992.42 & 16.36 & 7.27 \\ 2 & 1509 & 1435.24 & 1232.83 & 18.30 & 4.89 \\ 3 & 1536 & 1437.64 & 1263.27 & 17.76 & 6.40 \\ 4 & 2124 & 1966.71 & 1772.83 & 16.53 & 7.41 \\ 5 & 1062 & 941.12 & 866.36 & 18.42 & 11.38 \\ 6 & 3017 & 2411.92 & 2407.83 & 20.19 & 20.06 \\ 7 & 153 & 678.36 & 472.29 & 208.68 & 343.37 \\ 8 & 904 & 1038.13 & 715.25 & 20.88 & 14.84 \\ 9 & 1005 & 962.24 & 656.67 & 34.66 & 4.25 \\ 10 & 772 & 714.95 & 506.50 & 34.39 & 7.39 \\ 11 & 1230 & 1336.73 & 968.67 & 21.25 & 8.68 \\ 12 & 1198 & 1325.13 & 964.25 & 19.51 & 10.61 \\ 13 & 1007 & 1072.79 & 777.75 & 22.77 & 6.53 \\ 14 & 2090 & 1793.84 & 1792.08 & 14.25 & 14.17 \\ 15 & 1861 & 1494.27 & 1552.08 & 16.60 & 19.71 \\ 16 & 2459 & 2109.15 & 1981.83 & 19.40 & 14.23 \\ 17 & 2504 & 2349.14 & 2013.18 & 19.60 & 6.18 \\ 18 & 1984 & 1918.44 & 1730.58 & 12.77 & 3.30 \\ 19 & 3164 & 2508.33 & 2656.75 & 16.03 & 20.72 \\ 20 & 1839 & 1514.82 & 1397.50 & 24.01 & 17.63 \\ \hline \end{tabular} \caption{Comparison between the observed count, prior mean, and INLA prediction for the first twenty site ID's at 7am Monday April 9} \end{table} As seen in Figure 27 below, INLA appears to provide more accurate imputations where a response was provided for time periods around the imputed point. Most detectors were down at Site 17 during a certain hourly time period, and therefore the count was recorded as significantly lower than the previous and following hours. The yellow line shows the INLA prediction. The prediction for the faulty recording period appears to be much a realistic estimate of the expected count. As the INLA imputation takes into account the spatio-temporal structure in addition to the historical and following data, it is likely a more precise estimate than the prior mean method. \newline \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=16cm]{Images/Site17}} \caption{A detector error imputed by the INLA model. The yellow line is the predicted count by the INLA model.} \end{figure} \raggedright \section{Future Considerations} Further improvements to the model can be made by investigating the underperforming sites, times and days. As seen in the final model for both weekdays and weekends, there are particular sites with a high MPE. These should be investigated further for the reason. The morning and evening periods have the highest MPE. There could be various reasons for this, such as certain sites experiencing a disproportionate amount of traffic in the morning and evening peak compared to hours outside of peak times. This was seen in the two sites at Rototuna. Removing these sites in the final two models resulted in a significant gain in prediction accuracy, although additions to the model formula such as a structured Type IV interaction could compensate for this disparity in traffic at peak times compared to other sites. \newline The Type IV interaction should result in a gain in prediction accuracy, given that both time and space are structured in the model. In addition to this, an interaction effect could be explored between day and time or weekend/weekday and time to better fit the difference in shape between days. \newline Using a fixed effect for schools did not result in a significant gain in prediction accuracy, although an interaction effect could lead to a different result. Different methods of inputting the school covariate into the INLA model should be investigated. Additional covariates such as roadworks, weather and major events could be explored. A proportion of the prediction error in our final model could be explained by these covariates. For example, the traffic during the Sevens rugby tournament would be expected to be higher in areas near FMG Stadium. We are likely seeing underprediction for sites in this area during this time, as our model included the dates of the tournament. \newline A significant advantage of INLA is the ability to use SPDE models. This extends the prediction range to a continuous domain, which would be particularly useful in the context of traffic prediction. With the fast growing nature of Hamilton, new roads are regularly constructed and existing intersections are modified. The ability to attain an accurate prediction of the traffic count at an intersection not currently controlled by SCATS is extremely valuable for planning purposes. The base form of the INLA SPDE model extends predictions over a continuous domain with no defined boundaries. [2]. This is useful for applications such as prediction over a plot of land or rainfall across a city. In these examples there are no constraints on where a prediction can be made in the spatial area. However in the context of traffic prediction, boundaries need to be defined as roads in the domain of the HCC road network. The paper 'Non-stationery Gaussian models with physical barriers (Bakka, Vanhatalo, Illian, Simpson \& Rue, 2016) is an ongoing exploration of the use of these models in INLA. The addition of this feature to the current model has the potential to serve as an important tool for future planning in Hamilton. \section{Conclusion} There is a great benefit in having a model that can accurately predict the traffic counts for certain sites, at a given time and/or day. The information about the traffic dispersion and traffic counts, is essential for future planning regarding the infrastructure of the city. In this report, the two final INLA models separating weekdays and weekends performed well for prediction. We have found that for this data using the mean for the same site, hour and day from several weeks prior was almost equally accurate. Although we could not identify any covariates that are significant in our model, this avenue can be explored more in an attempt to get the overall MPE of models to less than 10\%. The true utility of INLA will be in its ability to predict in yet unobserved locations. By using a more complex barrier model with additional interactions and covariates, predictions could be made at locations without SCATS control. For example, there are certain intersections in Hamilton changing from roundabouts or crossroads to signalised intersections. As traffic data is not currently collected at these locations, INLA could provide a cost effective method for understanding the traffic flow. \newline As with all regression models, a key advantage to using an historical mean is the ability to account for unseen or extreme predictor values. If a historical mean is used, a prediction can only be obtained using a specific set of predictor values which have been previously observed. In the case of the traffic models, the key predictors are day, time and location. The values of each of these fall within an expected range with no chance of outliers. If the predictors do not meet this criteria, using a model such as INLA will be a much more effective method than using an historical mean. \newline While the prior mean and macro method were simpler and provided a sufficiently accurate estimate, INLA was effective in modelling the complex spatio-temporal structure. It provided sufficiently precise predictions, and where the existing data was missing or unusual the model was able to use the data from neighboring locations and times to impute the count. The algorithm's flexibility will likely result in opportunities to use it at HCC where current models are insufficient or need improvement. \newpage \section{Appendix A} \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=16cm]{Images/SchoolProximity}} \caption{Site Proximity to schools. Green is less than 300m, red is further than 800m} \end{figure} \newpage \section{Appendix B} \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=14cm]{Images/MapMPEPrediction}} \caption{MPE per Site for the prediction range (Model 11)} \end{figure} \section{Abstract} A Bayesian approach to predicting traffic flows at signalised intersections is considered using the the INLA framework. INLA is a deterministic, computationally efficient alternative to MCMC for estimating a posterior distribution. It is designed for latent Gaussian models where the parameters follow a joint Gaussian distribution. An assumption which naturally evolves from an LGM is that of a Gaussian Markov Random Field (GMRF). It can be shown that a traffic prediction model based in both space and time satisfies this assumption, and as such the INLA algorithm provides accurate prediction when space, time, and other relevant covariants are included in the model. \section{Introduction} Hamilton City Council currently operates 104 signalised intersections in the Waikato region. Traffic counts are recorded at each of these using a device called a Detector in each lane of the oncoming roadways. Decisions for changes to infrastructure are made taking traffic flow into account, and as such it is important to accurately predict future traffic flow. In addition the detectors often fail, resulting in missing traffic counts at various times. This missing data is explored as part of the model fitting and the fitted values from the model output is considered as a form of imputation. \newline The goal of the model is to find the variables with a large influence on the traffic count, and use them to fit a prediction model in INLA. These variables are explored to gain an understanding of their use as covariates in the model. Prediction error for each model is obtained to distinguish between the prediction accuracies of the respective models. \section{INLA} The need to efficiently analyse large datasets of spatial and temporal models has increasing importance with the recent advances in big data collection. INLA is a computational, deterministic algorithm designed for efficient inference of models with a high spatial and temporal resolution. While MCMC models have traditionally been used for this class of models, there is a high computational load when dealing with large datasets. Instead of the simulation based algorithm used by MCMC, INLA is an analytic approximation based on the Laplace method. \subsection{Latent Gaussian Models} A latent field comprises of unobserved variables which is used to infer on a set of parameters $\theta$ $=$ \{$\beta_{0}$, $\beta$, $f$\}. In order to define a latent Gaussian field, the observed data needs to be specified: y $=$ (y$_{1}$, $\cdots$, y$_{n}$). Each y$_{i}$ is characterised by some parameter $\phi_{i}$, which can be defined by an additive structured predictor $\eta_{i}$ through the link function. The linear predictor $\eta_{i}$ is given as: \begin{equation} \eta_{i} = \beta_{0} + \sum_{m=1}^{m}\beta_{m}x_{mi} + \sum_{l=1}^{L}f_{l}(z_{li}) \end{equation} $\beta_{0}$ is a scalar that acts as the intercept in the model, $\beta$ relates to the coefficients that quantify the effects of the covariates $x$ in the model, and $f$ is a collection of the functions that are defined as a result of the set of covariates $z$. As mentioned, the latent field components are collected in a set of parameters $\theta$, defined as $\theta$ $=$ ($\beta_{0}$, $\beta$, $f$) and the hyperparameters for the model is $\Psi$ $=$ \{$\Psi_{1}$, $\cdots$, $\Psi_{K}$\}. Two properties that are prevalent in most latent fields are the assumption of conditional independence, and that the number of hyperparameters in the model is relatively small. The data that are being explored is not necessarily normally distributed, but the latent field is. The likelihood of the $n$ observations in the data, assuming they are from the exponential family of distributions and are conditionally independent, is given by the likelihood \begin{align} p(y|\theta,\Psi) = \prod_{i=1}^{n}p(y_{i}|\theta_{i},\Psi), \end{align} where each observation $y_{i}$ is connected to only one element $\theta_{i}$ in the latent field of parameters $\theta$. [1] \subsection{Gaussian Markov Random Fields} The conditional independence property allows for the creation of a sparse precision matrix $\mathcal{Q}$($\Psi$). This feature within the latent field, gives rise to the Guassian Markov random field (GMRF). There is a significant computational benefit when GMRFs are used in models due to the sparse nature of the precision matrix. GMRFs also have the Markov property, which is needed for models that rely on MCMC sampling. When areal data is used for a given area $i$, its neighbors $\mathcal{N}$($i$) are strictly the areas which it shares its borders with. The Markovian property in the context of a spatio-temporal model means that an observation $y_{i}$ for the $i$th area, is independent of all other observations, given the set of neighbors $i$ has. [1] \begin{align} y_{i} \perp y_{j}|Y_{\_ij}, i \neq j \end{align} \subsection{Laplace Approximation} Laplace approximation is an alternative to simulation-based Monte Carlo integration, where the aim is to approximate the posterior. We are interested in computing the integral \begin{align} \int f(x)dx = \int exp(log f(x))dx \end{align} The Laplace approximation will find a Gaussian approximation to the conditional distribution of a set of continuous variables. The maximum of an integral is found, and then Taylor series approximation is applied to the logarithm of the function to calculate the Laplace approximation. The integral evaluated in the interval $\alpha, \beta$ is approximated by \begin{align} \int_{\alpha}^{\beta} f(x)dx \approx f(x^{*})\sqrt{2\pi \sigma^{2^{*}}}(\Phi{\beta})-\Phi(\alpha)) \end{align} where $\Phi(.)$ represents the cumulative density function of the Normal$(x^{*}, \sigma^{2^{*}})$ distribution. In the case of a Gamma distribution, the mode $x^{*}$ is obtained by solving $\frac{\partial log f(x)}{\partial x} = 0$. The variance $\sigma^{2^{*}}$ is obtained by evaluating $-1/\frac{\partial^{2} log f(x)}{\partial x^{2}}$ at the mode $x^{*}$ [1]. The Laplace approximation is then given by \begin{align} \text {Gamma}(a,b) \approx \text{Normal}(x^{*} = \frac{a-1}{b}, \sigma^{2^{*}} = \frac{a-1}{b^{2}}) \end{align} \section{Data} \subsection{SCATS Detectors} Hamilton City Council controls all of the traffic lights in the city boundaries, including those on State Highways. The system used to manage them is called SCATS. SCATS is installed in 154 cities across 25 countries to manage the timing of signal phases at intersections. Devices called detectors are installed at the end of the each lane at a signalised intersection. They are inductive coils that send a message to the detector controller when a car passes over them. SCATS dynamically manages the timing of the signals in accordance with the number of vehicles passing over the detectors. For example at intersections with a primary and secondary road, during non peak hours the signals at the secondary road will stay red until a vehicle is waiting at it. \\ One form of data output from SCATS is the count of vehicles passing over each detector over a given time span. We will be using these counts to predict the number of vehicles at each detector of an intersection at a given time. The counts in a SCATS traffic count export represent the total number of vehicles that have passed completely across the detector. It will not count vehicles twice, unless a vehicle happens to reverse back past the detector and over it again. The detectors are placed just before the end of the lane so that turning vehicles can be distinguished from through vehicles. Although data is available for individual detectors, we will be using the sum of all detectors to summarise the counts into the total number of vehicles passing through the intersection in a given time span. \begin{figure}[H]% \centering \subfloat[Detector placement at a signalised intersection (RAMM)]{{\includegraphics[width=8cm]{Images/Diagram} }}% \qquad \subfloat[Detector placement at Moonlight-Borman]{{\includegraphics[width=7cm]{Images/Borman} }}% \end{figure} \subsection{SCATS Data Cleaning} The raw exports from SCATS require a large amount of cleaning before they can be used in the INLA model. As the data for each intersection includes the counts for all detectors, the sum of the detector counts is not necessarily the total number of vehicles passing through the intersection. To achieve this each site was examined for the detectors to keep. The above SCATS intersection diagram (right) shows the detector placement at an intersection in northern Hamilton. Detectors 7 and 1 generally count the same number of vehicles, as do 2 and 8, 3 and 9, 5 and 6, and 4 and 10. The detectors further back from the intersection are known as 'advance detectors'. For our purposes these are not needed. The detectors closest to the stop line count all traffic passing through the intersection, and as such all other detector counts were removed from the data. \\ A sum variable was added for each site. This is the sum of the counts at all remaining detectors. In most cases this represents the total vehicles passing through the intersection within each 30 minute interval. A site variable was also added for distinguishing between sites when the data was merged into one data frame. In addition sites outside the city boundaries were removed - Sites 50, 54, 76, 90, 91, 94, and 104. Site 52 is not a valid site and was also removed. The remainder is a total of 96 sites in the city boundary. 61 of these are at signalised intersections and the remaining 35 are pedestrian crossings. \\ The clean data for all sites was joined row-wise, such that the variables of the data are in columns and each observation is a row. A large amount of missing data was found. The detectors at times fail for various reasons, and when this occurs the count is recorded as 'BAD'. HCC currently use an Excel macro to impute some of this missing data, which copies over the data from the previous or following day. In the interest of data integrity we did not impute or remove any missing data. A date range with a large amount of missing data was compared to a range with substantially less, and the two models compared to understand the effect of the missing data on prediction accuracy. The results of this are explained further in Section *. \textit{Plot of NA per week}. \begin{table}[H] \centering \caption{Example of the cleaned SCATS data} \begin{tabular}{lllll} \hline \multicolumn{1}{|l|}{\textbf{Date}} & \multicolumn{1}{l|}{\textbf{Time}} & \multicolumn{1}{l|}{\textbf{Site}} & \multicolumn{1}{l|}{\textbf{Sum}} & \multicolumn{1}{l|}{\textbf{ID}} \\ \hline 16/10/17 & 00:00-00:30 & 1 & 90 & 1 \\ \hline 16/10/17 & 00:30-01:00 & 1 & 67 & 1 \\ \hline \end{tabular} \end{table} \subsection{Data Exploration} Prior to modelling an exploration was first carried out on the cleaned dataset to understand how the traffic count varies over time and space. \begin{lstlisting} > summary(data) X Date Time Site Sum Min. : 1 Min. :2017-10-16 Length:855744 Min. : 1.00 Min. : 1.0 1st Qu.:213937 1st Qu.:2017-12-01 Class :character 1st Qu.: 24.75 1st Qu.: 78.0 Median :427872 Median :2018-01-16 Mode :character Median : 48.50 Median : 283.0 Mean :428337 Mean :2018-01-16 Mean : 50.51 Mean : 428.7 3rd Qu.:641808 3rd Qu.:2018-03-04 3rd Qu.: 75.50 3rd Qu.: 651.0 Max. :864658 Max. :2018-04-19 Max. :103.00 Max. :2674.0 NA's :78241 \end{lstlisting} Here 'Sum' represents the total traffic through a given intersection at a given time. There are a total of 864,658 observations. Of these, 74,241 of the Sum values are missing. The max Sum value is unusual in comparison to the previous quartile values. This could indicate a right skewed distribution. \begin{figure}[H] \centering \includegraphics[width=12cm]{Images/SumHistogram} \caption{Histogram of the Sum variable, showing a right skewed distribution.} \end{figure} The mean per individual site was then calculated. There is a high amount of variation between sites. The mean count ranges from 21.2 for site 87 to 1040 for site 38. \begin{lstlisting}[basicstyle=\small] > site_means [1] 759.42925 441.98785 448.31918 623.85218 282.13367 764.74474 277.34876 324.37975 [9] 299.42688 274.73450 415.45149 405.90955 323.46327 594.90033 493.13527 675.71001 [17] 758.92793 621.85340 868.91672 493.19930 323.07675 650.71247 616.00422 593.23522 [25] 483.36278 401.65174 280.81331 227.69805 577.40712 398.69556 416.32734 439.94986 [33] 372.82661 514.34503 431.93221 309.78825 353.07126 1040.16937 396.77779 396.42508 [41] 700.99394 881.75169 583.08680 625.66561 276.10636 664.14990 189.29603 271.97679 [49] 93.87942 314.89299 30.09410 283.12855 857.37885 160.34653 280.71154 276.90954 [57] 871.64668 263.55210 127.70718 460.65924 891.65010 320.14514 328.53539 355.92475 [65] 620.24575 534.23944 963.58047 832.36417 821.75009 170.79412 283.38387 374.61378 [73] 254.41712 583.16942 122.64221 347.20161 174.09591 123.17792 123.64903 249.70587 [81] 137.03924 103.61872 305.51688 118.52460 264.16922 576.14453 21.20215 242.60216 [89] 232.07296 482.56088 172.29681 290.42743 168.53986 399.13894 113.73490 124.29912 \end{lstlisting} \begin{figure}[H] \centering \includegraphics[width=12cm]{Images/BarplotMeanID} \caption{Mean traffic sum per site} \end{figure} Plotting the Sum by time shows a slight morning peak followed by a steady rise until the evening peak. \begin{figure}[H] \centering \includegraphics[width=12cm]{Images/AllSitesByTime} \caption{Mean Traffic Count (Sum) across all sites by time.} \end{figure} This varies significantly by site, although most sites appear to follow the same general shape over time. The top line is Site 38 - Te Rapa Road/Wairere Drive, which is the only site with a larger lunchtime peak than evening peak. A few sites stand out with an unusual zig-zag shape. These sites record an unusually low count every second half hour. HCC was contacted about this and were unaware of the issue. It is hoped that the INLA prediction will give more realistic predictions for the true traffic count at these sites. It is likely that the prediction error for the sites will be high, so it is useful to note these beforehand. \begin{figure}[H] \centering \includegraphics[width=14cm]{Images/EachSiteByTime} \caption{Mean Traffic Count (Sum) across each sites by time.} \end{figure} There is a total of 78,241 missing values from 864,658 observations. These values were visualised to understand if certain sites or time periods had an unusual amount of missing values. \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=20cm]{Images/MissingData}} \caption{Left: Missing data per week, from 16 October 2017 to 19 April 2018. Right: Missing data per Site ID.} \end{figure} There is a large amount of missing observations from weeks 20 to 24. This period covers both school holidays and school dates. The difference between these periods will be tested, as it is expected that sites near school experience a increase in traffic during school hours. The effect of this will be analysed in the INLA model as a covariate. The chosen time period does not include the Christmas holiday period during which less traffic is expected. The large number of missing data in this time period may have an effect on the predictive accuracy of the model. An additional model was run for the weeks 1-9. There is comparatively a smaller amount of missing data in this period. The difference in Mean Percentage Error was evaluated for days, weeks and sites between the two date ranges. The difference was found to be insignificant. For this reason we chose to subset the data to the date range 15 January 2018 - 13 April 2018. \\ As seen in Figure 5 (right), there are a few sites with an unusually high amount of missing data. When HCC was contacted about this they advised that these sites are minor and as a result their repair is low priority. Often some or all detectors were found to be offline at these sites, although they were still included in the model as there are periods during which they are recording. This data is valuable for the predictions at nearby sites. \section{Spatio-Temporal Correlation} The intersections are defined as realisations of the stochastic traffic flow indexed by locations in the space domain $D$. The count $y$ is a random outcome at each location, while the spatial index $s$ varies continuously in the city boundary $D$. The data is represented in space as a collection of observations $y = y(s_{1}),y(s_{n}),...,y(s_{n})$ where $s_{1},...,s_{n}$ indicate the intersection locations.\\ The geographical correlation can be defined with a sparse matrix $n \times n$, where n is the number of observed locations. Each value in the matrix represents the existence of spatial correlation between sites $r$ and $c$, where $r$ represents the location at row index $r$ and $c$ represents the location at column index $c$. If each location only has a few neighbors, in the case of the intersection network, most elements of the matrix will be zero. This greatly reduces the computational complexity of computing the correlation existing in the spatial structure. A sparse matrix was created for the traffic model using GIS. Where two sites were nearby and on the same road, the traffic count at one site is expected to be correlated with the traffic at the second site in the same time interval. The presence of correlation was represented as a '1', with all other cells empty for valid input into the INLA model.\\ \begin{figure}[H] \centering \includegraphics[width=6cm, height=6cm]{Images/sparse_matrix} \caption{Sparse matrix for the intersections. A black square denotes correlation between the site in row r and column c. Note each index is sequential and not representative of the site number. The sparse matrix was changed for the final two models (13 and 14) which removed three sites.} \end{figure} Note: The site numbers were recoded to ID's for input into the INLA model, as INLA expects sequential area ID's. Further reference to sites will used the ID instead of the site number, which may not necessarily be the same. \\ The temporal variation is a Markov process such that $P(X_{n} = j | X_{n-1} = i)$. When using only time as a variable, the traffic count at a particular time value is dependent only on the previous time value. Both the spatial and temporal correlation need to be accounted for in the model. The process indexed by space and time is \begin{align} Y(s,t) \equiv {y(s,t),(s,t) \in \box \subset \mathbb{R}^{2} \times \mathbb{R}} \end{align} observed at $n$ spatial locations and $T$ time points. For a seasonal model, there is an additional dependence on the same time point in the previous season. A natural definition of a season in the traffic model is a day. For traffic at 8am at a given site is related to the traffic at 7am on the same day, as well as 8am on the previous day. \\ The spatial variable is structured while the time is both structured and unstructured with a random $iid$ effect. The model is defined as \begin{align} n_{it} = \beta_{0} + \mu_{i} + \upsilon_{i} + \gamma_{t} + \phi_{t} \end{align} where $n_{it}$ is the link function \\ $\beta_{0}$ is the intercept \\ $\mu_{i}$ is the structured spatial effect modelled as BYM \\ $\upsilon_{i}$ is the unstructured spatial effect modelled as $iid$ \\ $\gamma_{t}$ is the structured time effect modelled as seasonal with period p\\ and $\phi_{t}$ is the unstructured time effect modelled as $iid$. \\ An interaction effect can be added to the model. This occurs where the change in the response between different spatial areas is dependent on the time period, and vice versa. For example the change in traffic at Site 1 from 5pm-6pm may be different to the same change from 5pm-6pm at Site 2. if no interaction is assumed, this change is assumed to be constant, varying only between time periods and the site. The INLA model allows for multiple interaction types to be specified depending on the structure of the space and time variables. Both space and time are structured in the traffic data. The structure matrix can be written as the Kronecker product of $R_{\delta} = R_{u} \otimes R_{\gamma}$, and has a rank of (T-1)(n-1) for a random walk of order 1, and of (T-2)(n-1) for a random walk of order 2. Although this interaction type is appropriate in the context of the traffic model, we were unable to successfully run the INLA model with this interaction effect. As an alternative we resorted to the Type I interaction, which assumes an interaction between the two unstructured effects time and space. The structure matrix is written as \begin{align} R_{\delta} = R_{v} \otimes R_{\phi} = I \otimes I = I \end{align} \section{INLA Model} \subsection{Evaluating Model Performance} Hamilton City Council have indicated that they are seeking a prediction error less than 10\%. That is for the traffic in one hour at each site, the predicted count is no further than 10\% from the observed count for the majority of total observations. This can be expressed as the average percentage difference between the observed and predicted values. For a given site this is represented as \begin{align} MPE_{s,t} = \frac{1}{n}\sum_{i \in s,t}^{}(\frac{abs(y_{i}-\hat{y_{i}})}{y_{i}} \times 100) \end{align} Where $MPE_{s,t}$ is the mean percentage deviation of the predicted value from the observed value at site $s$ and time $t$, and $n$ is the total number of observations at site $s$. Equivalently this can be expressed as an MPE for a given time or day across all sites. The overall MPE for all observations is the average of all individual MPE's: \begin{align} MPE = \frac{1}{n}\sum_{i=1}^{n}(\frac{abs(y_{i}-\hat{y_{i}})}{y_{i}} \times 100) \end{align} The predictive accuracy was evaluated for a full week for each model. Multiple models were tested, beginning with the most basic model using only time, space and no interaction. In addition the performance of each INLA control setting was checked. This was done at the beginning with further models created using the fastest one, provided the accuracy was similar to the rest. Covariates were progressively added, with both interaction and non interaction so that the reduction in effect of the interaction could be evaluated at each step. In addition the effect of missing data was investigated. As seen in Figure 5, the first three months of the data set have a much smaller amount of missing data compared to the last three months. As noted in Section 4.3 the larger amount of missing data in the last three months did not have a noticeable effect on the predictive accuracy of the model. \subsection{Model 11} \begin{table}[H] \centering \small \caption{Model 11 Parameters} \begin{tabular}{|l|l|l|l|l|l|} \hline \multicolumn{1}{|l|}{\textbf{Time Aggregation}} & \multicolumn{1}{l|}{\textbf{Interaction}} & \multicolumn{1}{l|}{\textbf{Covariates}} & \multicolumn{1}{l|}{\textbf{Date Range}} & \multicolumn{1}{l|}{\textbf{Prediction Range}} & \multicolumn{1}{l|}{\textbf{Control}} \\ \hline 1 Hour & Yes & None & Weekdays, Jan 15-Apr 13 & Weekdays, Apr 7 - Apr 13 & Gaussian + EB \\ \hline \end{tabular} \end{table} \begin{lstlisting} model.formula = Y ~ f(ID, model = "bym", graph = H) + f(Time, model = "seasonal", season.length = 12) + f(Time1, model = "iid") + f(ID.Time, model = "iid") model = inla(model.formula, family = "poisson", data = data.subset, control.predictor = list(link = 1, compute = TRUE), verbose = T, control.inla = list(strategy = "gaussian", int.strategy = "eb")) \end{lstlisting} \centering{\Large{\textbf{MPE: 14.25}}} \begin{table}[H] \centering \begin{tabular}{rrrrrr} \hline & Monday & Tuesday & Wednesday & Thursday & Friday \\ \hline 1 & 16.17 & 14.54 & 14.14 & 13.27 & 13.19 \\ \hline \end{tabular} \end{table} \begin{table}[H] \centering \small \begin{tabular}{rrrrrrrrrrrrr} \hline & 7-8 & 8-9 & 9-10 & 10-11 & 11-12 & 12-13 & 13-14 & 14-15 & 15-16 & 16-17 & 17-18 & 18-19 \\ \hline & 21.25 & 16.37 & 9.42 & 12.30 & 14.76 & 14.32 & 13.40 & 9.94 & 12.83 & 10.68 & 14.13 & 21.74 \\ \hline \end{tabular} \end{table} \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=20cm]{Images/Model11}} \caption{Left: MPE per site. Right: Observed vs Predicted for last week.} \end{figure} \subsection{Model 12} \begin{table}[H] \centering \small \caption{Model 12 Parameters} \begin{tabular}{|l|l|l|l|l|l|} \hline \multicolumn{1}{|l|}{\textbf{Time Aggregation}} & \multicolumn{1}{l|}{\textbf{Interaction}} & \multicolumn{1}{l|}{\textbf{Covariates}} & \multicolumn{1}{l|}{\textbf{Date Range}} & \multicolumn{1}{l|}{\textbf{Prediction Range}} & \multicolumn{1}{l|}{\textbf{Control}} \\ \hline 1 Hour & Yes & None & Weekends, Jan 15-Apr 13 & Weekends, Apr 7-Apr 13 & Gaussian + EB \\ \hline \end{tabular} \end{table} \begin{lstlisting} model.formula = Y ~ f(ID, model = "bym", graph = H) + f(Time, model = "seasonal", season.length = 12) + f(Time1, model = "iid") + f(ID.Time, model = "iid") model = inla(model.formula, family = "poisson", data = data.subset, control.predictor = list(link = 1, compute = TRUE), verbose = T, control.inla = list(strategy = "gaussian", int.strategy = "eb")) \end{lstlisting} \centering{\Large{\textbf{MPE: 17.71}}} \begin{table}[H] \centering \begin{tabular}{rrr} \hline & Saturday & Sunday \\ \hline 1 & 15.28 & 20.18 \\ \hline \end{tabular} \end{table} \begin{table}[H] \centering \small \begin{tabular}{rrrrrrrrrrrrr} \hline & 7-8 & 8-9 & 9-10 & 10-11 & 11-12 & 12-13 & 13-14 & 14-15 & 15-16 & 16-17 & 17-18 & 18-19 \\ \hline & 36.67 & 29.59 & 21.04 & 18.17 & 15.58 & 14.06 & 13.36 & 10.76 & 11.51 & 11.50 & 12.79 & 17.77 \\ \hline \end{tabular} \end{table} \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=20cm]{Images/Model12}} \caption{Left: MPE per site. Right: Observed vs Predicted for last week.} \end{figure} \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=20cm]{Images/BadSitesModel11}} \caption{Left: 3 sites with the highest MPE} \end{figure} \begin{flushleft} There are three obvious outliers in Figure 15 (left). Two of these, IDs 51 and 87, are pedestrian crossings near schools in Rototuna. They experience comparatively very little traffic compared to school drop off and pick up times. The model predicts well for most hours apart from school pick up and drop off times, where it is underpredicting. In addition as seen in the above figure (left), the model is overpredicting for Site 7 by a significant margin. This is assumed to be a fault in the detector recording. The model is likely predicting a more realistic count given the count of nearby sites in each time period. All three sites were deemed by HCC as unimportant for prediction. To investigate the influence of removing these sites on the MPE, two additional models were run for both weekdays and weekends with these three sites removed. The sparse matrix was updated accordingly as described in Section 5. \end{flushleft} \subsection{Model 13} \begin{table}[H] \centering \small \caption{Model 13 Parameters} \begin{tabular}{|l|l|l|l|l|l|} \hline \multicolumn{1}{|l|}{\textbf{Time Aggregation}} & \multicolumn{1}{l|}{\textbf{Interaction}} & \multicolumn{1}{l|}{\textbf{Covariates}} & \multicolumn{1}{l|}{\textbf{Date Range}} & \multicolumn{1}{l|}{\textbf{Prediction Range}} & \multicolumn{1}{l|}{\textbf{Control}} \\ \hline 1 Hour & Yes & None & Weekdays, Jan 15-Apr 13 & Weekdays, Apr 7-Apr 13 & Gaussian + EB \\ \hline \end{tabular} \end{table} \begin{lstlisting} model.formula = Y ~ f(ID, model = "bym", graph = H) + f(Time, model = "seasonal", season.length = 12) + f(Time1, model = "iid") + f(ID.Time, model = "iid") model = inla(model.formula, family = "poisson", data = data.subset, control.predictor = list(link = 1, compute = TRUE), verbose = T, control.inla = list(strategy = "gaussian", int.strategy = "eb")) \end{lstlisting} \centering{\Large{\textbf{MPE: 11.96}}} \begin{table}[H] \centering \begin{tabular}{rrrrrr} \hline & Monday & Tuesday & Wednesday & Thursday & Friday \\ \hline 1 & 12.48 & 12.25 & 11.89 & 11.54 & 11.64 \\ \hline \end{tabular} \end{table} \begin{table}[H] \centering \small \begin{tabular}{rrrrrrrrrrrrr} \hline & 7-8 & 8-9 & 9-10 & 10-11 & 11-12 & 12-13 & 13-14 & 14-15 & 15-16 & 16-17 & 17-18 & 18-19 \\ \hline 1 & 18.05 & 14.64 & 7.69 & 10.43 & 11.84 & 11.91 & 11.71 & 8.02 & 10.05 & 8.92 & 12.58 & 17.66 \\ \hline \end{tabular} \end{table} \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=20cm]{Images/Model13}} \caption{Left: MPE per site. Right: Observed vs Predicted for last week.} \end{figure} \begin{table}[H] \centering \begin{tabular}{rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr} \hline 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\ \hline 5.22 & 8.30 & 7.42 & 5.73 & 8.16 & 6.94 & 8.62 & 16.28 & 20.27 & 9.29 & 10.01 & 9.85 & 11.72 & 9.13 & 6.88 \\\\ \hline 16 & 17 & 18 & 19 & 20 & 21 & 22 & 23 & 24 & 25 & 26 & 27 & 28 & 29 & 30 \\ \hline 4.46 & 9.34 & 7.07 & 8.29 & 7.89 & 9.24 & 8.34 & 5.25 & 6.18 & 8.46 & 11.71 & 30.16 & 5.20 & 6.56 & 25.18 \\\\ \hline 31 & 32 & 33 & 34 & 35 & 36 & 37 & 38 & 39 & 40 & 41 & 42 & 43 & 44 & 45 \\ \hline 6.67 & 8.46 & 6.93 & 7.00 & 22.51 & 9.06 & 8.66 & 6.74 & 8.41 & 9.21 & 6.83 & 8.77 & 9.45 & 7.10 & 12.69 \\\\ \hline 46 & 47 & 48 & 49 & 50 & 51 & 52 & 53 & 54 & 55 & 56 & 57 & 58 & 59 & 60 \\ \hline 14.27 & 7.46 & 17.51 & 6.57 & 22.73 & 6.27 & 13.86 & 11.91 & 6.35 & 8.05 & 12.74 & 12.98 & 13.22 & 10.64 & 10.96 \\\\ \hline 61 & 62 & 63 & 64 & 65 & 66 & 67 & 68 & 69 & 70 & 71 & 72 & 73 & 74 & 75 \\ \hline 9.24 & 7.52 & 14.01 & 15.00 & 10.58 & 13.10 & 12.62 & 17.63 & 12.47 & 6.30 & 20.37 & 8.56 & 9.83 & 26.35 & 42.69 \\\\ \hline 76 & 77 & 78 & 79 & 80 & 81 & 82 & 83 & 84 & 85 & 86 & 87 & 88 & 89 & 90 \\ \hline 12.01 & 12.84 & 14.96 & 21.80 & 16.29 & 8.82 & 25.34 & 8.80 & 9.15 & 13.31 & 9.83 & 7.11 & 18.96 & 8.86 & 16.08 \\\\ \hline 91 & 92 & 93 \\ \hline 10.60 & 31.50 & 28.35 \end{tabular} \caption{MPE per site} \end{table} \begin{table}[H] \centering \begin{tabular}{rrrrrr} \hline & Monday & Tuesday & Wednesday & Thursday & Friday \\ \hline 7-8 & 17.34 & 18.63 & 19.26 & 18.47 & 16.54 \\ 8-9 & 14.25 & 14.59 & 14.77 & 15.75 & 13.85 \\ 9-10 & 6.19 & 7.57 & 7.69 & 9.47 & 7.55 \\ 10-11 & 12.43 & 11.29 & 9.06 & 9.63 & 9.74 \\ 11-12 & 13.95 & 11.55 & 12.10 & 10.50 & 11.11 \\ 12-13 & 13.36 & 15.31 & 12.30 & 9.13 & 9.45 \\ 13-14 & 13.59 & 14.44 & 10.43 & 9.95 & 10.15 \\ 14-15 & 8.85 & 8.40 & 5.75 & 8.33 & 8.75 \\ 15-16 & 10.19 & 7.96 & 9.37 & 9.50 & 13.21 \\ 16-17 & 8.89 & 7.80 & 8.72 & 9.36 & 9.84 \\ 17-18 & 12.14 & 12.74 & 13.55 & 12.04 & 12.42 \\ 18-19 & 18.58 & 16.67 & 19.61 & 16.40 & 17.06 \\ \hline \end{tabular} \caption{MPE per day and time. Note the time is in 24 hour format.} \end{table} \subsection{Model 14} \begin{table}[H] \centering \small \caption{Model 14 Parameters} \begin{tabular}{|l|l|l|l|l|l|} \hline \multicolumn{1}{|l|}{\textbf{Time Aggregation}} & \multicolumn{1}{l|}{\textbf{Interaction}} & \multicolumn{1}{l|}{\textbf{Covariates}} & \multicolumn{1}{l|}{\textbf{Date Range}} & \multicolumn{1}{l|}{\textbf{Prediction Range}} & \multicolumn{1}{l|}{\textbf{Control}} \\ \hline 1 Hour & Yes & None & Weekends, Jan 15-Apr 13 & Weekends, Apr 7-Apr 13 & Gaussian + EB \\ \hline \end{tabular} \end{table} \begin{lstlisting} model.formula = Y ~ f(ID, model = "bym", graph = H) + f(Time, model = "seasonal", season.length = 12) + f(Time1, model = "iid") + f(ID.Time, model = "iid") model = inla(model.formula, family = "poisson", data = data.subset, control.predictor = list(link = 1, compute = TRUE), verbose = T, control.inla = list(strategy = "gaussian", int.strategy = "eb")) \end{lstlisting} \centering{\Large{\textbf{MPE: 15.06}}} \begin{table}[H] \centering \begin{tabular}{rrr} \hline & Saturday & Sunday \\ \hline 1 & 12.67 & 17.45 \\ \hline \end{tabular} \end{table} \begin{table}[H] \centering \small \begin{tabular}{rrrrrrrrrrrrr} \hline & 7-8 & 8-9 & 9-10 & 10-11 & 11-12 & 12-13 & 13-14 & 14-15 & 15-16 & 16-17 & 17-18 & 18-19 \\ \hline & 34.45 & 25.83 & 15.24 & 14.38 & 13.79 & 10.86 & 10.62 & 9.21 & 8.99 & 9.54 & 10.77 & 17.05 \\ \hline \end{tabular} \end{table} \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=20cm]{Images/Model14}} \caption{Left: MPE per site. Right: Observed vs Predicted for last week.} \end{figure} \begin{table}[H] \centering \begin{tabular}{rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr} \hline 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\ \hline 1 15.10 & 19.55 & 17.11 & 14.23 & 17.89 & 14.68 & 17.89 & 20.72 & 20.06 & 21.70 & 22.75 & 20.13 & 10.39 & 10.46 & 14.91 \\\\ \hline 16 & 17 & 18 & 19 & 20 & 21 & 22 & 23 & 24 & 25 & 26 & 27 & 28 & 29 & 30 \\ \hline 14.35 & 13.79 & 10.77 & 9.09 & 11.52 & 9.06 & 7.87 & 8.49 & 13.62 & 14.24 & 17.52 & 14.99 & 7.80 & 14.81 & 19.61 \\\\ \hline 31 & 32 & 33 & 34 & 35 & 36 & 37 & 38 & 39 & 40 & 41 & 42 & 43 & 44 & 45 \\ \hline 12.62 & 12.84 & 13.23 & 14.87 & 9.58 & 8.97 & 20.69 & 9.86 & 13.77 & & & 21.51 & 19.83 & 10.10 & 22.81 \\\\ \hline 46 & 47 & 48 & 49 & 50 & 51 & 52 & 53 & 54 & 55 & 56 & 57 & 58 & 59 & 60 \\ \hline 11.14 & 18.70 & 11.94 & 12.34 & 42.48 & 11.97 & 8.81 & 12.19 & 7.73 & 11.82 & 22.73 & 9.23 & & 14.94 & 20.91 \\\\ \hline 61 & 62 & 63 & 64 & 65 & 66 & 67 & 68 & 69 & 70 & 71 & 72 & 73 & 74 & 75 \\ \hline 12.06 & 9.70 & 9.27 & 9.86 & 13.08 & 10.01 & 25.15 & 19.77 & 9.20 & 8.80 & 40.09 & 9.39 & 9.73 & 16.16 & 38.85 \\\\ \hline 76 & 77 & 78 & 79 & 80 & 81 & 82 & 83 & 84 & 85 & 86 & 87 & 88 & 89 & 90 \\ \hline 9.94 & 18.03 & 11.84 & 12.02 & 18.12 & 14.28 & 17.18 & 11.50 & 11.03 & 24.82 & 12.71 & 10.30 & 12.15 & 15.26 & 20.84 \\\\ \hline 91 & 92 & 93 \\ \hline 9.37 & 18.36 & 14.85 \\ \hline \end{tabular} \caption{MPE per site} \end{table} \begin{table}[H] \centering \begin{tabular}{rrr} \hline & Saturday & Sunday \\ \hline 7-8 & 19.93 & 48.98 \\ 8-9 & 16.05 & 35.62 \\ 9-10 & 11.19 & 19.29 \\ 10-11 & 13.93 & 14.83 \\ 11-12 & 13.52 & 14.06 \\ 12-13 & 11.61 & 10.11 \\ 13-14 & 11.29 & 9.96 \\ 14-15 & 11.18 & 7.24 \\ 15-16 & 10.30 & 7.68 \\ 16-17 & 10.43 & 8.65 \\ 17-18 & 9.02 & 12.53 \\ 18-19 & 13.63 & 20.47 \\ \hline \end{tabular} \caption{MPE per day and time. Note the time is in 24 hour format.} \end{table} \begin{flushleft} Removing site IDs 7, 51 and 87 resulted in a significant reduction across the MPE for each day and time. As seen in the MPE per site tables (Table 17 and 20), the MPE for most sites is close to or below the desired 10\% error. For the weekdays model, a few sites remain with 10-30\% error. IDs 92 and 93 are relatively high, and ID 75 has the highest MPE at 42.69\%. In the weekends model, IDs 92 and 93 are performing better while ID 75 is still high. The two models lead to different MPE's for each ID. In some cases ID's with a low MPE in the weekday model have a high MPE in the weekend model, and vice versa. \\ In the weekday model, the MPE 9am-10am across all days is low. This is also true for 2pm-6pm. There is not a large difference between days. In the weekends model, the MPE during Sunday from 7am-9am and 6pm-7pm is high, while 12pm-5pm is low. The MPE for Saturday is relatively constant, but 7am-9am is high, consistent with the rest of the week. Overall the model is underpredicting for most times in the weekdays and Saturday, but overpredicting for Sunday. \newline The final model is defined as \begin{align} n_{it} = \beta_{0} + \mu_{i} + \upsilon_{i} + \gamma_{t} + \phi_{t} \end{align} where $n_{it}$ is the link function \\ $\beta_{0}$ is the intercept \\ $\mu_{i}$ is the structured spatial effect modelled as BYM \\ $\upsilon_{i}$ is the unstructured spatial effect modelled as $iid$ \\ $\gamma_{t}$ is the structured time effect modelled as seasonal with period 12\\ and $\phi_{t}$ is the unstructured time effect modelled as $iid$. \\ \end{flushleft} \raggedright \section{Comparison to prediction using the prior mean} In the Bayesian context, a prior can be defined for the prediction of traffic count at a given site, time and day. For equivalent comparison to the prediction given by the INLA model, this was taken as the mean of the previous seven weeks. Given that the predictors follow a fixed set of values, it is expected that using solely the prior mean will give an accurate prediction. \newline For all observations at 7am on Monday, the mean was taken for all 7am Monday observations for the first 8 weeks of our date range and compared to the observed value at 7am Monday for the final week. This was compared to the prediction from Model 11. The MPE for the INLA model was only slightly smaller than the prediction by taking the mean of the previous observations for the same time and day. \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=14cm]{Images/Seven}} \caption{Observed vs Mean and Predicted for 7am (all sites)} \end{figure} \begin{lstlisting} mean(meanPE, na.rm = T) = 22.30767 mean(predPE, na.rm = T) = 21.18661 \end{lstlisting} The above comparison was extended to all times on Monday to see if this remains constant for other times from 7am-7pm. This is shown below for a sample of sites. \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=16cm]{Images/SitesMeanvsPred}} \caption{Observed vs Mean of prior 7 weeks vs Predicted for Monday, Site IDs 1, 38, 70 and 92} \end{figure} \begin{lstlisting} mean(meanPE, na.rm = T) = 11.6286 mean(predPE, na.rm = T) = 16.17448 \end{lstlisting} In the above, meanPE is the MPE between the prior 7 week mean and the observed count for the same site, time and day. predPE is the MPE between the INLA prediction using model 11 and the observed count for the same site, time and day. The MPE using the prior mean was 11.63\%, compared to 16.17\% for the INLA prediction. \newline The INLA prediction seems to better predict the traffic count at peak times, although the mean prediction more closely follows the pattern from 7am-7pm. This suggests that the pattern of the traffic is relatively similar across the same site, hour and day. Although this may be affected by covariates such as schools, weather, roadworks and major events, in most cases the mean prediction is sufficient. When the nature of the data is not as consistent or predictable, INLA will likely be more accurate. The mean prediction does not take into account covariates, and therefore when these are highly influential the INLA prediction is likely to outperform the mean prediction. \newline Perhaps using this process as a prior for the INLA model will result in a more accurate model overall. The prior in this model will act as a baseline, with the further complexity of the spatio-temporal structure and the INLA algorithm providing additional accuracy for the predicted time period. INLA provides a robust structure for defining a prior, although it was not used in the final model. \begin{table}[H] \centering \begin{tabular}{rrrrrr} \hline & ActualY & pred & mean & meanPE & predPE \\ \hline 1 & 2382 & 2208.88 & 1992.42 & 16.36 & 7.27 \\ 2 & 1509 & 1435.24 & 1232.83 & 18.30 & 4.89 \\ 3 & 1536 & 1437.64 & 1263.27 & 17.76 & 6.40 \\ 4 & 2124 & 1966.71 & 1772.83 & 16.53 & 7.41 \\ 5 & 1062 & 941.12 & 866.36 & 18.42 & 11.38 \\ 6 & 3017 & 2411.92 & 2407.83 & 20.19 & 20.06 \\ 7 & 153 & 678.36 & 472.29 & 208.68 & 343.37 \\ 8 & 904 & 1038.13 & 715.25 & 20.88 & 14.84 \\ 9 & 1005 & 962.24 & 656.67 & 34.66 & 4.25 \\ 10 & 772 & 714.95 & 506.50 & 34.39 & 7.39 \\ 11 & 1230 & 1336.73 & 968.67 & 21.25 & 8.68 \\ 12 & 1198 & 1325.13 & 964.25 & 19.51 & 10.61 \\ 13 & 1007 & 1072.79 & 777.75 & 22.77 & 6.53 \\ 14 & 2090 & 1793.84 & 1792.08 & 14.25 & 14.17 \\ 15 & 1861 & 1494.27 & 1552.08 & 16.60 & 19.71 \\ 16 & 2459 & 2109.15 & 1981.83 & 19.40 & 14.23 \\ 17 & 2504 & 2349.14 & 2013.18 & 19.60 & 6.18 \\ 18 & 1984 & 1918.44 & 1730.58 & 12.77 & 3.30 \\ 19 & 3164 & 2508.33 & 2656.75 & 16.03 & 20.72 \\ 20 & 1839 & 1514.82 & 1397.50 & 24.01 & 17.63 \\ \hline \end{tabular} \caption{Comparison between the observed count, prior mean, and INLA prediction for the first twenty site ID's at 7am Monday April 9} \end{table} As seen in Figure 27 below, INLA appears to provide more accurate imputations where a response was provided for time periods around the imputed point. Most detectors were down at Site 17 during a certain hourly time period, and therefore the count was recorded as significantly lower than the previous and following hours. The yellow line shows the INLA prediction. The prediction for the faulty recording period appears to be much a realistic estimate of the expected count. As the INLA imputation takes into account the spatio-temporal structure in addition to the historical and following data, it is likely a more precise estimate than the prior mean method. \newline \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=16cm]{Images/Site17}} \caption{A detector error imputed by the INLA model. The yellow line is the predicted count by the INLA model.} \end{figure} \raggedright \section{Future Considerations} Further improvements to the model can be made by investigating the underperforming sites, times and days. As seen in the final model for both weekdays and weekends, there are particular sites with a high MPE. These should be investigated further for the reason. The morning and evening periods have the highest MPE. There could be various reasons for this, such as certain sites experiencing a disproportionate amount of traffic in the morning and evening peak compared to hours outside of peak times. This was seen in the two sites at Rototuna. Removing these sites in the final two models resulted in a significant gain in prediction accuracy, although additions to the model formula such as a structured Type IV interaction could compensate for this disparity in traffic at peak times compared to other sites. \newline The Type IV interaction should result in a gain in prediction accuracy, given that both time and space are structured in the model. In addition to this, an interaction effect could be explored between day and time or weekend/weekday and time to better fit the difference in shape between days. \newline Using a fixed effect for schools did not result in a significant gain in prediction accuracy, although an interaction effect could lead to a different result. Different methods of inputting the school covariate into the INLA model should be investigated. Additional covariates such as roadworks, weather and major events could be explored. A proportion of the prediction error in our final model could be explained by these covariates. For example, the traffic during the Sevens rugby tournament would be expected to be higher in areas near FMG Stadium. We are likely seeing underprediction for sites in this area during this time, as our model included the dates of the tournament. \newline A significant advantage of INLA is the ability to use SPDE models. This extends the prediction range to a continuous domain, which would be particularly useful in the context of traffic prediction. With the fast growing nature of Hamilton, new roads are regularly constructed and existing intersections are modified. The ability to attain an accurate prediction of the traffic count at an intersection not currently controlled by SCATS is extremely valuable for planning purposes. The base form of the INLA SPDE model extends predictions over a continuous domain with no defined boundaries. [2]. This is useful for applications such as prediction over a plot of land or rainfall across a city. In these examples there are no constraints on where a prediction can be made in the spatial area. However in the context of traffic prediction, boundaries need to be defined as roads in the domain of the HCC road network. The paper 'Non-stationery Gaussian models with physical barriers (Bakka, Vanhatalo, Illian, Simpson \& Rue, 2016) is an ongoing exploration of the use of these models in INLA. The addition of this feature to the current model has the potential to serve as an important tool for future planning in Hamilton. \section{Conclusion} There is a great benefit in having a model that can accurately predict the traffic counts for certain sites, at a given time and/or day. The information about the traffic dispersion and traffic counts, is essential for future planning regarding the infrastructure of the city. In this report, the two final INLA models separating weekdays and weekends performed well for prediction. We have found that for this data using the mean for the same site, hour and day from several weeks prior was almost equally accurate. Although we could not identify any covariates that are significant in our model, this avenue can be explored more in an attempt to get the overall MPE of models to less than 10\%. The true utility of INLA will be in its ability to predict in yet unobserved locations. By using a more complex barrier model with additional interactions and covariates, predictions could be made at locations without SCATS control. For example, there are certain intersections in Hamilton changing from roundabouts or crossroads to signalised intersections. As traffic data is not currently collected at these locations, INLA could provide a cost effective method for understanding the traffic flow. \newline As with all regression models, a key advantage to using an historical mean is the ability to account for unseen or extreme predictor values. If a historical mean is used, a prediction can only be obtained using a specific set of predictor values which have been previously observed. In the case of the traffic models, the key predictors are day, time and location. The values of each of these fall within an expected range with no chance of outliers. If the predictors do not meet this criteria, using a model such as INLA will be a much more effective method than using an historical mean. \newline While the prior mean and macro method were simpler and provided a sufficiently accurate estimate, INLA was effective in modelling the complex spatio-temporal structure. It provided sufficiently precise predictions, and where the existing data was missing or unusual the model was able to use the data from neighboring locations and times to impute the count. The algorithm's flexibility will likely result in opportunities to use it at HCC where current models are insufficient or need improvement. \newpage \section{Appendix A} \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=16cm]{Images/SchoolProximity}} \caption{Site Proximity to schools. Green is less than 300m, red is further than 800m} \end{figure} \newpage \section{Appendix B} \hspace*{-1.5in} \begin{figure}[H] \centerline{\includegraphics[width=14cm]{Images/MapMPEPrediction}} \caption{MPE per Site for the prediction range (Model 11)} \end{figure}
\section*{Acknowledgement} \bibliographystyle{ieeetr} \input{root.bbl} \end{document} \section{Conclusions} In this paper, we proposed a RL-based negotiation-aware adaptive motion planning framework to deal with the sidewalk problem by alleviating social dilemmas that exist in autonomous driving. We employ ACKTR and curriculum learning to train the policy network with sequential OGM images as inputs. According to the prediction horizon policy generated by the policy network, we use polynomial planner with prediction module to generating the optimal trajectories. The effectiveness of our framework is evaluated both in simulation and real-driving scenarios. We find that our framework could regulating driving social behavior and outperform the common alternatives in driving efficiency with safety properly considered. \section{Experiment} \begin{figure*}[ht] \centering \subfigure[driving time]{ \label{subfig:push_driving_time} \begin{minipage}[t]{0.33\linewidth} \centering \includegraphics[width=2.5in]{figure/push_time.pdf} \end{minipage}% }% \subfigure[suspend number]{ \label{subfig:push_pause_number} \begin{minipage}[t]{0.33\linewidth} \centering \includegraphics[width=2.5in]{figure/push_pause.pdf} \end{minipage} }% \subfigure[reward]{ \label{subfig:push_reward} \begin{minipage}[t]{0.33\linewidth} \centering \includegraphics[width=2.5in]{figure/push_reward.pdf} \end{minipage}% }% \centering \caption{Performance comparisons of our framework in push experiment setting. As \ref{subfig:push_driving_time} \ref{subfig:push_pause_number} show, all the algorithm could complete driving task in limit time, while the adaptive behavior planner has better driving efficiency and take less suspend time; Thus the proposed framework tends to have a higher reward in \ref{subfig:push_reward}.} \label{fig:perf_push} \end{figure*} \begin{figure*}[ht] \centering \subfigure[driving time]{ \label{subfig:yield_driving_time} \begin{minipage}[t]{0.33\linewidth} \centering \includegraphics[width=2.5in]{figure/yield_time.pdf} \end{minipage}% }% \subfigure[suspend number]{ \label{subfig:yield_pause_number} \begin{minipage}[t]{0.33\linewidth} \centering \includegraphics[width=2.5in]{figure/yield_pause.pdf} \end{minipage} }% \subfigure[reward]{ \label{subfig:yield_reward} \begin{minipage}[t]{0.33\linewidth} \centering \includegraphics[width=2.5in]{figure/yield_reward.pdf} \end{minipage}% }% \centering \caption{Performance comparisons of our framework in yield experiment setting. Because of a closer social vehicle distance and the social vehicle's intent of pushing, ego vehicle will yield to keep safe. \ref{subfig:yield_driving_time} shows that except the proposed algorithm, other schemes could not reach the goal position in limit time. To yield to social vehicles, the suspend time tends to be more than that in push experiment setting as shown in \ref{subfig:yield_pause_number}.} \label{fig:pef_yield} \end{figure*} \subsection{Experimental settings} The proposed algorithm was trained and tested in the narrow lane navigation scenario. Relative distances from the narrow corridor and driving styles of the two vehicles are the key features to impact the driving behavior. The initial position of the social vehicle is randomly sampled in a range. As for the training and testing in the simulator, a polynomial planner introduced in interactive motion planning section is arranged for the social vehicle which is identical with the one used in our framework. We also implemented and evaluated our work on a real autonomous vehicle in a campus scenario. \subsection{Implementation details} The initial positions of the social vehicle are sampled from $11.99$m to $14.02$m for conservative behavior and $16.33$m to $18.80$m for aggressive behavior. As for the ego autonomous vehicle, the position is fixed with $13.35$m. The frequency of the implementation is 5Hz and we sampled sequential OGM of $84\times84$ size every second in the last 4 seconds, which means that 4 channels of OGM are given to our CNN encoder at a time. The CNN encoder which extracts features from OGM sequence has 3 convolution layers with the filter size of $32\times8\times8$, $64\times4\times4$ and $64\times3\times3$, followed with 1 fully connected layer with 512 output neurons. Both value and policy networks are fully connected networks with 2 hidden layers with 128 units. The Policy network has 4 discrete outputs units to represent time horizon $\{ 0, 2, 4, 6 \}$ while the value network has only one output. We use Adam as the optimizer and a learning rate of $10^{-4}$ and $10^{-3}$ for policy network and value networks respectively. For the setting of RL, we use mini-batch size of $m=512$, trajectory length of $H=128$, number of trajectories to collect for each iteration of $N=200$, and $\gamma=0.99$ as the discount factor. \subsection{Results and discussion} We tested the negotiation-aware framework in both push and yield experiment settings in narrow lane navigation and demonstrate the effectiveness of our proposed framework compared to the polynomial planner with different fixed prediction horizons in this section. Fig~\ref{fig:perf_push} and Fig~\ref{fig:pef_yield} illustrate the performance comparisons in the two experiment settings respectively. In the push setting where the social vehicle is further from narrow corridor than ego vehicle, most of the algorithms could dominate autonomous vehicle reach its target within time limit while our proposed algorithm takes less time and suspend times to reach the target. In the yield setting scenario, the vehicles with polynomial planner tends to get into a social dilemma with the almost identical relative distances. On the contrary, our algorithm could decide to yield in advance before stuck in a dilemma by reasoning the other vehicle's behavior. Generally, compared with the polynomial planner with fixed prediction horizon, our adaptive framework could complete the driving task in shorter time. One reason could explain the outstanding performance in driving efficiency is the less hesitate in driving interaction as shown in Fig~\ref{subfig:push_pause_number} and Fig~\ref{subfig:yield_pause_number}. Another reason is that our framework learns the approximating optimum yield position from the sequential OGM images which describes the environment dynamics. This makes the autonomous vehicle has less chance to get into dilemma situations with social vehicles. As a result, our framework has a higher reward than the polynomial planner with fixed prediction horizon. The statistical results also show that the performance of our proposed framework has better stability because of the robustness w.r.t to environment dynamics consists of social participants and road geometry. \begin{figure}[t] \centering \subfigure[Behavior index in the push experiment setting.]{ \label{subfig:svo_push} \includegraphics[width=2.3in]{figure/svo_push.pdf} } \\ \subfigure[Behavior index in the yield experiment setting]{ \label{subfig:svo_yield} \includegraphics[width=2.3in]{figure/svo_yield.pdf} } \caption{The change of driving behavior index in narrow lane navigation scenario. In the push experiment setting, the index value is always negative. However in the yield experiment setting, the index value shows that the autonomous vehicle will yield to the social vehicle at first.} \label{fig:svo_change} \end{figure} The behavior of prosocial or egoistic could be measured by Social Value Orientation (SVO), which is an index represents the weight assignment for the interests of ego vehicle and others in the formation of angles~\cite{schwarting2019social}. Inspired by the work in~\cite{schwarting2019social}, we also use an angle like index as the measurement for the social behavior in sidewalk scenario, \begin{equation}\label{equ:svo_like} \begin{aligned} \psi = \text{atan}{\frac{s_{\rm soc}-s_{\rm ego}}{d_{\rm ini, ego}/d_{\rm ini, soc}}}, \end{aligned} \end{equation} where $d$ is the initial distance from the corridor, $s$ is the travel distance of ego and social vehicles respectively. Both distances are counted at the time step since the social vehicle enter the ego vehicle's perception. Such index works the same as SVO, that the behavior tends to be prosocial for positive values and competitive for a negative ones. The numerator of \eqref{equ:svo_like} describes the fact that which vehicle dominants the driving interaction and the denominator considers the impact of the initial position. Fig~\ref{fig:svo_change} shows the change of driving behavior index $\phi$ in push and yield experiment setting respectively. The behavior of autonomous vehicle in the interactive driving and the driving behavior index could verify each other. In the push scenario the adaptive framework will regulate the prediction horizon to performance aggressively to pass the narrow corridor as soon as possible when the social vehicle is further from the corridor. Fig~\ref{subfig:svo_push} shows negative index values during driving which reflects the aggressive driving behavior. And in the yield experiment setting. To keep safe and retain driving efficiency at the same time, ego vehicle will pause at a reasonable position to yield to the social vehicle. After the interactive vehicle passes the corridor, our ego vehicle will perform aggressively to reach to the goal. Fig~\ref{subfig:svo_yield} illustrates the driving behavior tunning procedure in this scenario, that the index value is positive and then negative. We implemented the framework onto a real autonomous vehicle and tested in a real world narrow lane navigation scenario as shown in Fig~\ref{fig:real_world}. Our proposed approach demonstrates a good generalization in real world driving. A supplementary video is provided to show the performance of our work\footnote{See videos at \url{https://youtu.be/j9FK_RNbbI0}}. \begin{figure}[t \centering \setlength{\abovecaptionskip}{0pt} \setlength{\belowcaptionskip}{0em} \includegraphics[scale=0.75]{figure/real_world.pdf} \caption{Testing of negotiation-aware framework in real-world driving.} \label{fig:real_world} \end{figure} \section{Introduction} With promising potential to improve traffic efficiency and safety, the history of Autonomous Vehicles (AVs) could be traced back to the first half of the twentieth century~\cite{kroger2016automated}. Motion planning is one of the critical capabilities for AVs~\cite{katrakazas2015real}. In order to take its responsibility to find a dynamically feasible, collision free, and comfortable resulting trajectory, motion planning module need to identify uncertainties in dynamic environments~\cite{latombe2012robot}. General formulation is built as optimization problems, which fulfill the requirements of safety and comfortability by maximizing a complex reward function. However, AVs are exposed to complex interactions among traffic participants in real world driving where prediction and re-planning are required to generate safe trajectories~\cite{schwarting2018planning}. It requires the module capable of understanding and adapting to the participants' intents and driving styles by responding in predictable ways without explicit communication. In order to overcome the challenge, in this paper we propose a negotiation-aware planning framework that integrates reinforcement learning (RL) as a negotiation skill selector into motion planning. We model the interaction between the AV and the other traffic participants as a Markov Decision Process (MDP) under such framework. The key idea is adopting RL to adjust planning modality by dynamically modifying hyper-parameters of the motion planner in real time according to the event of a change in environment, typically triggered by traffic participants' switch of intents with different driving styles. By taking advantages of RL, which tends to have a promising performance in dealing with dynamic environments, the approach embeds implicit prediction and reasoning for the intentions of other vehicles with different driving styles in our framework with a temporal sequence of occupancy grid maps (OGMs) as inputs~\cite{mohajerin2019multi}. Narrow lane navigation is one of the typical real world scenarios for autonomous driving, which could be formulated as a sidewalk problem. The sidewalk problem is a benchmark problem for cooperative stochastic games and interactive decision making, in which the agents have to deviate from the optimal path considering their original intersect guidance trajectories~\cite{iselesidewalk}. It is usually hard to reason intentions of other agents let alone interacting to drive efficiently. For the reason of biased estimation, interactive vehicles may perform aggressively and reach to a bottleneck situation or both vehicles yield to others and driving tentatively, which lead to the social dilemma problem~\cite{schwarting2019social}. We applied our method to narrow lane navigation to deal with the sidewalk problem in both simulation and real-world driving to demonstrate that the proposed method outperforms the common alternative due to its advantage in alleviating the social dilemma problem with proper negotiation skills. Thus the main contributions of this paper are as follows: (1) We introduce an interactive motion planning approach and establish a mapping from the length of planner's prediction horizon to the negotiation skills. (2) Based on the mapping relations, we propose a negotiation-aware planning framework by regulating the prediction horizon via RL to adjust the planning modality adaptively in real time. (3) The framework is implemented in narrow lane navigation and demonstrated the capability for dealing with the sidewalk problem. The rest of this paper is organized as follows. Section II reviews related literatures. Section III proposes our problem statement and negotiation-aware planning framework. Then we look into simulation and experiment results in section IV and conclude this work in section V. \section{Negotiation-aware Adaptive Planning} The negotiation-aware planning framework integrates planning and RL to alleviate driving social dilemmas caused by interactive driving scenarios. In this section, we formulate the narrow lane navigation problem as an MDP under our proposed framework and introduce details of the framework. \begin{figure}[t \centering \setlength{\abovecaptionskip}{0pt} \setlength{\belowcaptionskip}{0em} \includegraphics[scale=0.2]{figure/narrow_driving.pdf} \caption{The {narrow lane navigation} scenario. Both of the vehicles wish to pass the narrow corridor as soon as possible and keep safe at the same time.} \label{fig:narrow_driving} \end{figure} \subsection{Narrow lane navigation} {We focus on investigating the narrow lane navigation, a typical real world scenario that could be formulated as a benchmark sidewalk problem}. As shown in Fig~\ref{fig:narrow_driving}, there exists a narrow corridor due to {the on street parking, which is common in residential communities}. {The goal for both the AV and the social vehicle} is to pass through the corridor and reach their targets on the other side considering both {safety and efficiency}. \subsection{Negotiation-aware Planning Framework} \begin{figure*}[t \centering \setlength{\abovecaptionskip}{0pt} \setlength{\belowcaptionskip}{0em} \includegraphics[scale=0.75]{figure/frame_work.pdf} \caption{An illustration of the relationship between {the} planning behavior and {the} prediction horizon. When considering shorter future trajectories of {social} vehicles, the ego vehicle tends to be more aggressive and vice versa.} \label{fig:frame_work} \end{figure*} {Our proposed framework consists of two parts including a RL module that outputs planner's prediction horizon and an interactive motion planning module responsible for generating feasible trajectories. As shown in Fig \ref{fig:frame_work}, at every time step, a temporal sequential OGM generated by a perception system that represents the current state of the environment is given to the network, then taking into the selection of prediction horizon from RL module as well as guidance route and objects information from perception system, the planner will give a future trajectory.} The RL module is composed of a CNN encoder, a value network and a policy network. The CNN encoder is used to distill the information of history environment dynamics from the sequential OGM images. Both of the value and policy networks are fully connected networks trained to obtain the optimal policy for regulating planner's prediction horizon by achieving the desired goal. We applied ACKTR algorithm, a policy gradient algorithm to optimize our training procedure~\cite{wu2017scalable}. As for the various of interactive situations, we leveraged curriculum learning to handle it~\cite{bengio2009curriculum}. \subsection{Interactive Motion Planning} Motion planning could be formulated as an optimization problem as follows: \begin{equation}\label{equ:opt_pro} \begin{aligned} \underset{\bm{x}}{\text{argmin}} \quad & \sum_{t\in[0, H_{\rm plan}]}c(x_t)\\ \text{subject to} \quad & f_t(x_t, \dot{x}_t, ...) \leq 0 \quad t\in[0, H_{\rm plan}],\\ \end{aligned} \end{equation} where $t$ is time step, $H_{\rm plan}$ is the planning horizon, $\bm{x}=\{x_1, x_2, ..., x_{H_{\rm plan}}\}$ represents the planning trajectory, $c$ and $f_t$ are cost function and constraints considering safety, vehicle dynamics and comfort respectively. Since finding an optimal solution of the problem \eqref{equ:opt_pro} is PSPACE-hard with the nonholonomic constraints, we approximate the solution by sampling a set of physically valid trajectories and pick the one with minimum cost. We adopt a semi-reactive motion planner by means of optimal-control strategies~\cite{Werling2010Optimal}. The planner takes inputs include HD map and LiDAR sweeps for navigation guidance reference and objects array collision checking. The trajectory set is generated by polynomial approximation that quintic polynomials are the jerk-optimal connection between two secondary order states $[x_0, \dot{x}_0, \ddot{x}_0]$ and $[x_{H_{\rm plan}}, \dot{x}_{H_{\rm plan}}, \ddot{x}_{H_{\rm plan}}]$. Lateral and longitudinal movements are generated by sampling along Frenet-Frame independently and checked against acceleration values of dynamic limitation before combination. The trajectory with the lowest conjoint cost function and free of collision is picked out for the downstream controller to track. In order to consider the interaction with other social vehicles, a prediction module is embedded into our motion planner. We use $\bm{\hat{x}} = \{ \hat{x}_1, \hat{x}_2, ..., \hat{x}_{H_{\rm pred}} \}$ to denote the $H_{\rm pred}$ steps rollout for a prediction trajectory of each vehicle. The prediction trajectory is projected onto the SLT frame for the collision checking. As default, the length of prediction horizon $H_{\rm pred}$ should be the same as planning horizon $H_{\rm plan}$. The prediction trajectories of other vehicles are hardly to be precise, longer prediction horizon normally lead to a relatively conservative choice of plans and shorter ones could otherwise lead to a more aggressive driving behavior as shown in Fig~\ref{fig:beh_n_hor}. AVs requires conservative behaviors for safe operations because of lacking capability of precise predictions for dynamics. However, social vehicles with various driving styles could react to our AV differently, thus being conservative constantly could have a passive influence on driving efficiency or even lead to traffic bottlenecks, especially when the other vehicles also drive in a modest fashion. On the other hand, being blindly aggressive without proper negotiations could still cause traffic dilemmas. \subsection{RL formulation} \subsubsection*{\textbullet \quad Markov Decision Process} MDP is an mathematical framework for modeling decision making process for an agent to achieve a goal by learning from a continual interaction with the environment. The agent selects actions and the environment responds to these actions with rewards and presents new situations to the agent. An MDP is a tuple $\langle S,A,P,R,\gamma \rangle$, where $S$ is a finite set of states represent the environment's situations, $A$ is a finite set of possible actions for the agent, $P$ denotes the state transition probability function $P\!=\!P(S_{t+1}\!=\!s'|S_t\!=\!s,A_t\!=\!a)$, $R$ denotes for the reward function $R\!=\!E[R_{t+1}|S_t\!=\!s,A_t\!=\!a]$, and $\gamma$ is a discount factor that $\gamma\in[0,1]$. Policy $\pi$ describes the agent behavior that is a distribution over actions given states. The goal is to find the optimal policy $\pi^*$ in an MDP by maximizing the cumulative discounted rewards with finite horizon $H$: \begin{equation}\label{equ:opt_pro} \begin{aligned} \bm{\pi^*} = \underset{\bm{\pi}}{\text{argmax}} & \, E[\sum_{t=0}^{H} \gamma^{t}R(s_t,\pi(s_t))] \\ \end{aligned} \end{equation} where the reward function $R$ receives the current state $s_t$ and the action determined by current policy $\pi$ given $s_t$. \subsubsection*{\textbullet \quad State and action {representation}} An OGM is a grid map of size $L_{\rm W} \times L_{\rm H}$ pixels rendered into the top-down coordinate system, which represent the occupancy state of regions around the ego-vehicle. It is easy to generate in the simulation environment or could be constructed by the meta data form LiDAR in real world driving. Compared with the raw sensor data representation, OGM shows its advantages in flexibility and generalization\cite{BansalChauffeurNet}. As the state representation of RL, a sequence of temporal OGMs are sampled according to a fixed time step $\Delta t$ from past $T_{\rm ogm}$ seconds, thus the inputs dimension is $[T_{\rm ogm} \times L_{\rm W} \times L_{\rm H}]$. Coordination transformation based on current vehicle-link frame is implemented in order to make the temporal sequential representation could indicate the potential dynamics from current view. According to the mapping relations from planner's prediction horizon to planning modality, we discretized the prediction horizon into a $H_{\rm pred}$ dimension vector which refers to different driving styles from aggressive to conservative. \begin{figure}[t \centering \setlength{\abovecaptionskip}{0pt} \setlength{\belowcaptionskip}{0em} \includegraphics[scale=0.42]{figure/beh_n_hor.pdf} \caption{An illustration of the relationship between planning behavior and prediction horizon. When considering shorter future trajectories of interactive vehicles, the ego vehicle tends to be more aggressive and vice versa.} \label{fig:beh_n_hor} \end{figure} \subsubsection*{\textbullet \quad Reward setting} {The task is designed to terminate and reset either all vehicles reach their target positions or collision. Since the step by step interaction process between the AV and the social vehicle is hard to be intuitively described, we consider the safety, efficiency and task completion for reward function design in a sparse manner. A negative reward is given to penalize collision and a positive reward for the vehicles both finish their driving tasks. Also, a negative per-step reward is accumulatively given with fixed episodic horizon $H$ to encourage efficiency. A detailed reward setting is shown in \eqref{equ:reward}.} { \begin{equation}\label{equ:reward} R = \begin{cases} -0.25 * t,& \rm \textit{per-step penalty,} \\ -5,& \rm \textit{collision penalty,} \\ 10,& \rm \textit{reached targets} \end{cases} \end{equation} } \subsubsection*{\textbullet \quad Algorithm} The RL algorithm we adopt in this work named actor critic using Kronecker-factored trust region (ACKTR)~\cite{wu2017scalable}. ACKTR is a policy gradient method with the trust region optimization method use second order optimizer. By applying the Kronecker-factored approximation to optimize both actor and critic, ACKTR will speed up the optimization and stabilize the training procedure. With an actor critic architecture, we need to optimize a stochastic policy $\pi_{\theta}:S\times A\rightarrow\mathbb{R}_+$ that parameterized by $\theta$. Given the state $s_t$ from $S$, which are assumed to be the OGM based observations of the environment, with actions $a_t$ from the action space $A$ chosen by the policy distribution $\pi_{\theta}(\cdot|s_t)$. The AV interact with the environment with prediction horizon assigned motion planner and perceived next state $s_{t+1}\sim P(s_{t+1}|s_t,a_t)$ and the immediate reward $R(s_t,a_t)\in\mathbb{R}$ according to the reward function defined in \eqref{equ:reward}. Altogether, it can be formalized as an $\gamma$-discounted MDP with the expected discounted cumulative return is: \begin{equation}\label{equ:policy gradient} \begin{aligned} J(\Theta)= E_{\pi}[\sum_{t=0}^{H} \gamma^{t}R(s_t,\pi(s_t))]. \\ \end{aligned} \end{equation} Update the $\theta$ w.r.t the policy gradient defined as: \begin{equation}\label{equ:policy gradient} \begin{aligned} \nabla_{\Theta}J(\Theta) = E_{\pi}[\sum_{t=0}^{H} \Psi^{t}\nabla_{\Theta}log\pi_{\theta}(a_t|s_t)], \\ \end{aligned} \end{equation} where $\Psi^t$ denotes for the advantage function $A^{\pi}(s_t,a_t)$. The advantage is calculated as follows: \begin{equation}\label{equ:policy gradient} \begin{aligned} A^{\pi}(s_t,a_t)=\sum_{i=0}^{k-1} (\gamma^{i}R(s_{t+i},a_{t+i}) + \gamma^{k}V^{\pi}_{\phi}(s_{t+k}))-V^{\pi}_{\phi}(s_{t}),\\ \end{aligned} \end{equation} where $V^{\pi}_{\phi}(s_{t})$ denotes for the value network that estimate the expected reward with policy $\pi$. We train the network by performing temporal difference updates to minimize the squared difference between the $k$-step bootstrapped returns $\hat{R}_t$ and $V^{\pi}_{\phi}(s_t)$. \subsubsection*{\textbullet \quad Curriculum Learning} In order to enhance the training efficiency and robustness of our algorithm, we employ curriculum learning that could help intelligent agents to learn better with organized examples which gradually illustrate more and more complex concepts. In our training procedure, the initial position of the social vehicle is selected from a certain range with a driving style assigned. We deploy interactive motion planning method to control social vehicles and define the driving styles from aggressive to conservative w.r.t the mapping from prediction horizons to planning behaviors. Different distributions of both the initial position and the driving style significantly affect the difficulty of our task and the curriculum is designed by decomposing the learning procedure into multiple phases accordingly. For instance, in first phase we set initial positions far away from the narrow corridor for conservative social vehicles and nearby positions for aggressive ones, than in order to increase the difficulty, the distributions of initial positions will be set closer to each other. Finally, our AV learns to reasoning about the social vehicle's intent according to its driving style and road geometry, and thus react with proper choice of skill w.r.t task situation and goal. The corresponding training procedure is shown in Algorithm~\ref{alg:Framwork}. \begin{algorithm}[t] \caption{ Curriculum learning procedure.} \label{alg:Framwork} \begin{algorithmic}[1] \Require \begin{varwidth}[t]{\linewidth} distribution $D_0$,..., $D_s$, iteration numbers $K_0$,..., $K_s$, \\task batch size $M$, number of trajectories $N$ \end{varwidth} \Ensure policy and value networks $\pi_{\theta}$, $V_{\phi}$ \State Randomly initialize $\theta$, $\phi$ \While {\emph{not done}} \For{$(K, D) \in \{ (K_0, D_0), ..., (K_s, D_s) \}$} \For{$k \in \{(1, ..., K)\}$} \parState{Sample M number of tasks $T \in D$} \For{\textbf{all} $T$} \parState{Sample $N$ trajectories $\tau^{1:N}$ with $\pi_{\theta}$} \EndFor \State update network $\pi_{\theta}$ and $V_{\phi}$ using ACKTR \EndFor \EndFor \EndWhile \end{algorithmic} \end{algorithm} \section{Preliminaries} \section{Related Work} Many works have investigated the methods for motion planning based on graph search, sampling and optimization. A*, RRT, and their variations are classical approaches applied in {autonomous} driving~\cite{bacha2008odin,leonard2008perception}. Considering the structured constraints of road lane, decomposing lateral and longitudinal movement planning in Frenet-frame is a promising method to simplify the optimization based planning in {practice}~\cite{fan2018baidu}. To model the inherent unpredictability of other traffic and the resulting uncertainty, a semi-reactive trajectory generation method based on polynomial approximation is proposed, which can be tightly integrated into the behavioral layer~\cite{Werling2010Optimal}. Most of the planning schemes are integrated with prediction of other vehicles' future trajectories to avoid collisions~\cite{tran2013modelling}. However, the interaction scenarios in real driving is too complex to be handled perfectly by the prediction module~\cite{dong2017intention}. Besides deducing the intentions of other human traffic participants, driving behavior of {the AV} also need to be {inferred} by other vehicles~\cite{schwarting2018planning}. {Modeling} interactions as multi-agent game~\cite{bahram2015game} or cooperative optimization~\cite{wang2018parallel,lenz2016tactical}, which will generate behavior more interactive rather than reactive. However, both modeling the game and dealing {with} the complexity of solution are all intriguing problems. Partially observable Markov decision process (POMDP) is also a normal way of executing the interaction problem, which assuming that the intentions and re-planning procedures of the other agents are not directly observable and are encoded in hidden variables~\cite{luo2018porca,hubmann2017decision}. In {such situation}, finding a suitable symbolic representation for POMDP is challenging~\cite{somani2013despot}. Learning-based approach is a promising way for autonomous driving~\cite{zeng2019end,rosbach2019driving}. Reinforcement learning (RL) has shown {its benefits} in many fields, especially in dynamic environment with complex {interactions}~\cite{silver2016mastering,mnih2015human}. By fitting a policy for sequential decision problems, RL has been applied to self-driving~\cite{sallab2017deep}. The framework integrating RL and planning could combine the properties of both algorithms, in which planning is responsible for safety by restricting collision actions and RL is used to reason the intentions of other vehicles and {handle} the interaction uncertainty. Kesleman \emph{et al.} used RL to train a heuristic represented by a deep neural networks and combine it with A*~\cite{keselman2018reinforcement}. Scholz \emph{et al.} proposed a method in which the RL aims to learn the optimization criteria for model-based planning~\cite{scholz2010combining}. For tactical decision making, Hoel \emph{et al.} introduced a general framework, which combines planning and learning in the form of Monte Carlo tree search and RL~\cite{hoel2019combining}. In this work, we {propose} a framework integrating RL and {planning} which takes a sequential of OGM as inputs of the learning algorithm. Compared with other combined schemes which learn cost map, heuristic search space or subgoals~\cite{rosbach2019driving,keselman2018reinforcement,scholz2010combining,hoel2019combining}, our approach provides a way to adaptively {adjust planning modality referring to negotiation skill selection w.r.t the event of a change in the environment. We utilize the benefits of RL to implicitly reason the intentions of other traffic participants under different driving styles and select negotiation skill respectively while taking advantage of the planner's property to keep safe from collisions in the dynamic environment. As a result, our framework has the advantage of reasoning behaviors of other traffic participants and adopting an appropriate planning skill to avoid social dilemmas compared to traditional planners which are usually predefined with one fixed driving fashion limited to prior knowledges of algorithm designers.}
\section{Introduction} Learning online has become the new norm after the COVID-19 pandemic. Increasing demand for online language learning has made Computer-Aided Pronunciation Training (CAPT) even more popular than before. Automatic speech evaluation, a key component in CAPT, aims to score speaking proficiency according to the standardized assessment criteria \cite{levy2013call,ESKENAZI2009832, 7820782}. Traditional speech assessment studies usually focus on extracting features from the Hidden Markov Model (HMM) based automatic speech recognizer (ASR) (e.g. \cite{596227,WITT200095,4518800}). \cite{596227} explored posterior probabilities and duration related features in automatic scoring. As a variation of likelihood ratio, Goodness of Pronunciation (GOP) \cite{WITT200095} is one of the the most widely adopted feature in speech evaluation task \cite{4518800}. With the development of deep neural network (DNN), GOP was further optimized to predict better phone segmentation and posterior estimation \cite{hu2013new,HU2015154,huang2017transfer}. Weighted GOP was also proposed to improve its discriminative ability in non-native speech \cite{van2010using}. Recently, an ASR-free approach was proposed, which drives features from the marginal distribution of speech signals \cite{cheng2020asrfree}. Linguistic features have also attracted research interests. As in \cite{8639697}, a prompt-aware feature was proposed for spontaneous speech evaluation. A context-aware GOP was proposed in\cite{shi2020context} to incorporate phone transition factor and phone duration factor into the calculation of GOP. \cite{7404814} leveraged Bidirectional Long Short Term Memory (Bi-LSTM) to learn high-level abstraction features by encoding both time-sequence and time aggregated information from speech. \cite{8462562} proposed to encode lexical information and acoustic information in separate neural networks. All these studies are focused on languages with rich resources. Extracting cross language effective features, especially on low resource languages, is still challenging. In terms of modeling approaches, early scoring strategies were based on statistical models such as Gaussian process \cite{van2015automatically}. Recent studies employed more deep learning approaches. \cite{lee2016language} proposed to utilize Convolution Neural Network (CNN) along with a multi-layer perceptron classifier. \cite{tao2016exploring} explored three deep learning based acoustic models including Tandem GMM-HMM, DNN, CNN, and found they provide substantial improvement in scoring performance. Long short-term memory recurrent network (LSTM) was adopted in pronunciation assessment \cite{yu2015using,Li2017}. More recently, attention mechanism has also been applied \cite{lin2020automatic,8462562,8639697} to speech evaluation. These studies have presented promising improvement on speech evaluation performance in the language specific tasks. However, multilingual speech scoring task was not explored. In this paper, we propose a unified framework for fine-grained multilingual speech evaluation on assessing pronunciation, rhythm, and intonation by leveraging robust feature representations. Specifically, we investigate rhythm-aware tempo features and multilingual vector representations. Moreover, multi-task learning strategy is employed to further improve the evaluation performance on the low-resource languages. \section{Methods} \subsection{Setup} All the experiments in this paper follow the system diagram in Figure \ref{fig:system}: Given a speech utterance from a student, forced alignment and phone decoding is applied to an acoustic model to obtain phoneme level timing and the acoustic log likelihood. Various features are derived to train scoring model to predict fine-grained scores to quantify oral language skills (i.e. pronunciation, rhythm, and intonation).\\ \noindent\textbf{Performance Metrics}: The Pearson Correlation Coefficient (PCC) and Mean Square Error (MSE) between model prediction and the average score of teachers. \begin{figure}[ht] \centering \includegraphics[width=0.35\textwidth]{image/SpeechEval.png} \caption{Speech evaluation framework, fine-grained scores include the metrics of pronunciation, fluency, and intonation.} \label{fig:system} \end{figure} \subsection{Acoustic Model} Mel-filter bank feature (29 dimensional) was adopted in acoustic modeling. Optimized on various ASR tasks, this model is designed as a combination of different neural networks: At the bottom levels, a stack of specially designed convolution neural network (CNN) running on 2D windows across time and frequency is trained to extract robust intermediate representation from the filter bank outputs. Time Delay Neural Network (TDNN) and LSTM are placed on top of these CNN. The output of the final LSTM is linked to 1500 output senones via a fully connected layer. This model was trained on WSJ \cite{paul-baker-1992-design}, Switchboard \cite{225858} and Fisher \cite{WITT200095}, using lattice-free Maximum Mutual Information (MMI) criterion with a sub-sampling factor of 3 \cite{Hadian2018}. To minimize the acoustic mismatch on L2 speech evaluation tasks, acoustic adaptation was implemented using the speechocean762 training data as described in Section 3.\\ \noindent\textbf{Malay and Tamil Acoustic Models:} Malay and Tamil acoustic models have the same configuration and were trained on 600 hours' Malay speech (1,500 native speakers from Singapore and Malaysia) and 200 hours' Tamil speech (700 native speakers from Singapore) respectively. \subsection{Feature Representation} \label{sec:feature} \subsubsection{Acoustic Posterior Probability} Goodness of Pronunciation (GOP) \cite{WITT200095} has been widely adopted in speech evaluation. Phone level GOP is the time average of log posterior probability over the phone duration: \begin{equation} \begin{aligned} \small \mathrm{GOP}(p) =\frac{1}{T}log(P(p|\mathbf{O}))\\ \end{aligned} \end{equation} where $\mathbf{O}=[\mathbf{o}_1,...,\mathbf{o}_T]^T$ is a speech segment of phone $p$ in the alignment. \begin{equation} \begin{aligned} \small &P(p|\mathbf{O})=\frac{P(p)P(\mathbf{O}|p)}{\sum_{q\in{Q}}{P(q)P(\mathbf{O}|q)}}\\ \end{aligned} \end{equation} where $Q$ is the collection of all possible paths on the observation $\mathbf{O}$. $P(p)$ and $P(q)$ are the priors of $p$ and $q$. \subsubsection{Tempo / Duration} In musical terminology, tempo is the pace of a given piece \cite{scheirer1998tempo}. It is usually measured in beats per minute. We borrow this concept to measure the phonological timing patterns in speech. In this study, speech tempo is defined as a combination of speaking rate and normalized phone duration: \begin{equation} \mathrm{T}(p) = \mathrm{concat}(1/\tau, (\tau - \mu)/\sigma ) \end{equation} where $\tau$ is the duration of current canonical phone in the alignment, $(\mu,\sigma)$ are the normal distribution parameters of $\tau$ in the sentence. The instant phone tempo is spliced with its context into a tempo vector: \begin{equation} \mathbf{T}(p) = \mathrm{concat}(\mathrm{T}(p_{i-k}),....,\mathrm{T}(p_{i}),...,\mathrm{T}(p_{i+k})) \end{equation} where $k$ is the number of neighboring phones considered in each direction.\\ For comparison, phone duration feature was also tested. Similar to the tempo feature, phone duration and duration difference between successive phones are spliced with its neighbors into a duration vector. \subsubsection{Multilingual Phonemic Embedding} In this work, we propose to use a multilingual vector representation to characterize the spoken utterances from English, Malay and Tamil. Representing the speech signal with phonetic features from other languages have shown to be useful in many tasks, including speech recognition \cite{zissman1996comparison}, spoken term detection \cite{wallace2007phonetic}, speech summarization \cite{chen2013minimal}, and spoken language identification \cite{pellegrino2000automatic}. However, such multilingual representations have not been applied to speech evaluation. Therefore, in this work, we adapt distributed linguistic representation and apply well tested approaches in NLP to characterize the multilingual phonemic space. A phoneme embedding matrix was estimated by Google's Word2Vec \cite{41224} on a multilingual training corpus (words were mapped to phoneme strings). Items in language-specific phoneme tables $Q_{English}$,$Q_{Malay}$ and $Q_{Tamil}$ are prefixed with corresponding language ID and merged together to form a multilingual phoneme table,$Q_{Multilingual}$. Each canonical phone in alignment is assigned a unique one-hot index from this multilingual phoneme table. By multiplying the embedding matrix, this one-hot phoneme index is transformed into a $D$ dimensional vector. $D=32$ in this study. \subsubsection{Pitch} Pitch provides acoustic cues for a speaker's intonation, confidence and expressiveness. In this study, a feature vector including raw log pitch, normalized log pitch, delta log pitch and wrapped NCCF (Normalized Cross Correlation Function) was extracted from Kaldi \cite{6854049}. Frame-wise pitch vectors are averaged in each canonical phone's duration. \subsubsection{Feature Assembly} For each canonical phone, relevant features are concatenated in a sequence. \begin{equation} \footnotesize \mathbf{V}(p)=\{\mathrm{GOP}(p),\mathrm{Tempo}(p),\mathrm{PhoEmb},\mathrm{Pitch}\} \end{equation} At the end of each sentence, an utterance ending symbol is appended. \subsection{Scoring Module} The scoring module aims to map the meta features described in Section \ref{sec:feature} to the fine-grained proficiency scores assigned by human raters. RNN is investigated as the deep learning backbone, in particular, stacked Bi-directional long short term memory (Bi-LSTM) is utilized in sequential modeling. Finally, the hidden representations encoded by RNN are fed into a linear layer followed by a $\mathrm{tanh}$ activation function to predict the scores. The human scores are re-scaled into the range of $(-1,+1)$ before training, and the model predictions are scaled back before comparing with human scores. MSE is chosen as the loss function in training. In this study, both monolingual and bilingual models have approximately the same numbers of parameters (around 2M). \subsection{Low Resource Speech Evaluation} \label{low-resource} Collecting and labeling L2 speech data is time consuming and labor intensive, so data preparation is often the bottleneck when developing speech evaluation models for low resource languages. From our experience, we speculate that for the same type of fine-grained metrics, be it pronunciation, rhythm, or intonation, there is certain language agnostic information that teachers use during scoring. This type of language agnostic information could help mitigate the adverse effects stemming from the scarcity of linguistic resources. In Singapore, while Malay and Tamil are two of the four official languages and there is strong support to develop spoken language technology to help students learn their ethnic mother tongues, 67\% Malay households and 70\% Indian households speak English as their main language. Only 3\% of the population speaks Tamil at home\cite{household}. Therefore, we employ two strategies to tackle the low-resource challenge. The first is model adaptation: Tamil model could be adapted from a well trained English or Malay model. The second is data augmentation: Multilingual tasks are learned simultaneously by sharing most model parameters and a language-specific linear layer before the output $\mathrm{tanh}$. In this work, we used Malay and Tamil for multilingual speech evaluation as the teaching scoring data are more homogeneous; both Malay and Tamil were scored by teachers certified by the Ministry of Education in Singapore, whereas the English data was scored outside Singapore. \begin{table*}[htp!] \linespread{1} \centering \small \begin{tabular}{l|cc|cc|cc} \hline \multirow{2}*{\textbf{Feature}} & \multicolumn{2}{c|}{\textbf{Pronunciation}} & \multicolumn{2}{c|}{\textbf{Rhythm}} & \multicolumn{2}{c}{\textbf{Intonation}} \\ \cline{2-7} ~ & \textbf{MSE} & \textbf{PCC} & \textbf{MSE} & \textbf{PCC} & \textbf{MSE} & \textbf{PCC}\\ \hline \textit{GOP} &1.428 & 0.639 & 1.065 & 0.694 & 1.009 & 0.713 \\ \textit{GOP+Dur} & 1.392 & 0.647 & 1.021 & 0.707 & 1.018 & 0.710 \\ \textit{GOP+Tempo} & 1.346 & 0.662 & 1.006 & 0.712 & 0.980 & 0.723 \\ \textit{GOP+Tempo+PhoEmb} & \textbf{1.341} & \textbf{0.667} & \textbf{0.958} & \textbf{0.729} & \textbf{0.970} & \textbf{0.726} \\ \textit{GOP+Tempo+PhoEmb+Pitch} & 1.368 & 0.654 & 1.037 & 0.702 & 1.064 & 0.699 \\ \hline \textit{Human} & - & 0.754 & - & 0.767 & - & 0.753 \\ \hline \end{tabular} \caption{Results on English: MSE and PCC scores of different model and feature configurations. } \label{tab:English_results} \vspace{-0.2cm} \end{table*} \begin{table*}[ht] \linespread{1} \centering \small \begin{tabular}{p{3.39cm}|p{3.98cm}|cc|cc|cc} \hline \multirow{2}*{\textbf{Model}} & \multirow{2}*{\textbf{Feature}} &\multicolumn{2}{c|}{\textbf{Pronunciation}} & \multicolumn{2}{c|}{\textbf{Fluency}} & \multicolumn{2}{c}{\textbf{Intonation}} \\ \cline{3-8} ~&~ & \textbf{MSE} & \textbf{PCC} & \textbf{MSE} & \textbf{PCC} & \textbf{MSE} & \textbf{PCC}\\ \hline \multirow{5}*{Monolingual}&\textit{GOP}& 0.537 & 0.473 & 0.580 & 0.487 & 0.707 & 0.415\\ &\textit{GOP+Dur}& 0.536 & 0.474 & 0.579 & 0.487 & 0.703 & 0.421\\ &\textit{GOP+Tempo}& 0.530 & 0.482 & 0.572 & 0.497 & 0.697 & 0.429 \\ &\textit{GOP+Tempo+PhoEmb} & 0.523 & 0.494 & 0.563 & 0.509 & 0.691 & 0.437 \\ &\textit{GOP+Tempo+PhoEmb+Pitch} & 0.518 & 0.500 & 0.546 & 0.531 & 0.658 & 0.479 \\ \hline \textit{Malay, Tamil Bilingual }&\textit{GOP+Tempo+PhoEmb+Pitch} & \textbf{0.506} & \textbf{0.518} & \textbf{0.538} & \textbf{0.540} & \textbf{0.656} & \textbf{0.482} \\ \hline \textit{Human} & & - & 0.547 &- & 0.571 &- & 0.545 \\ \hline \end{tabular} \caption{Results on Malay: MSE and PCC scores of different feature configurations.} \label{tab:Malay_results} \vspace{-0.2cm} \end{table*} \begin{table*}[htp!] \linespread{1} \centering \small \begin{tabular}{l|l|cc|cc|cc} \hline \multirow{2}*{\textbf{Model}} & \multirow{2}*{\textbf{Feature}} & \multicolumn{2}{c|}{\textbf{Pronunciation}} & \multicolumn{2}{c|}{\textbf{Fluency}} & \multicolumn{2}{c}{\textbf{Intonation}} \\ \cline{3-8} ~ &~ & \textbf{MSE} & \textbf{PCC} & \textbf{MSE} & \textbf{PCC} & \textbf{MSE} & \textbf{PCC}\\ \hline \multirow{5}*{Monolingual}&\textit{GOP}& 0.344 & 0.490 & 0.354 & 0.584 & 0.259 & 0.552 \\ &\textit{GOP+Dur}& 0.334 & 0.513 & 0.348 & 0.594 & 0.254 & 0.563 \\ &\textit{GOP+Tempo}& 0.333 & 0.516 & 0.342 & 0.603 & 0.250 & 0.573 \\ &\textit{GOP+Tempo+PhoEmb}& 0.330 & 0.522 & 0.348 & 0.594 & 0.260 & 0.552\\ &\textit{GOP+Tempo+PhoEmb+Pitch} & 0.332 & 0.518 & 0.347 & 0.595 & 0.258 & 0.555 \\ \cline{1-8} \textit{Monolingual (Adaptation)}&\textit{GOP+Tempo+PhoEmb+Pitch } & 0.334 & 0.519 & 0.339 & 0.608 & 0.254 & 0.562 \\ \cline{1-8} \textit{Tamil, Malay Bilingual}&\textit{GOP+Tempo+PhoEmb+Pitch} & \textbf{0.324} & \textbf{0.534} & \textbf{0.338} & \textbf{0.608} & \textbf{0.249} & \textbf{0.575} \\ \hline \textit{Human}& & - & 0.568 & - & 0.619 & - & 0.582 \\ \hline \end{tabular} \caption{Results on Tamil: MSE and PCC scores of different feature configurations and training strategies.} \label{tab:Tamil_results} \vspace{-0.5cm} \end{table*} \section{Experiments} \subsection{Speech Corpora} \label{sec:corpora} Experiments were conducted in three languages: English, Malay, and Tamil. \\ \noindent\textbf{English:} Speechocean762\footnote{http://www.openslr.org/101/}, a recently released data set for speech evaluation was investigated in this study. It consists of 5000 English utterances collected from 250 nonnative speakers. Half of the data, i.e. 2500 utterances and 125 speakers are reserved as the test data. There is no speaker overlap between testing and training. Mandarin Chinese is the first language for all speakers. Half of the speakers are children. For each utterance, five raters' scores are provided at 3 levels: phoneme level, word level and sentence level. Sentence level scores were investigated in this study. The average inter-rater PCC are 0.754, 0.767and 0.753 on pronunciation, rhythm, and intonation respectively.\\ \noindent\textbf{Malay:} Our Malay corpus contains 14,088 utterances and 230 Singapore speakers between 9-16 years old. The average inter-rater PCC are 0.547, 0.571, 0.545 on pronunciation, fluency, and intonation respectively.\\ \noindent\textbf{Tamil:} Our Tamil corpus consists of 5,215 utterances collected from 100 Singapore speakers between 9-16 years old. Each utterance was scored by four raters. The average inter-rater PCC are 0.568, 0.619, and 0.582 on pronunciation, fluency, and intonation respectively.\\ \noindent\textbf{Score Annotations from Teachers:} English utterances from Speechocean762 are scored by human-raters independently using a 10-point scale (1 is the lowest, 10 is the highest). Malay and Tamil utterances were scored by human-raters independently using a 5-point scale. (1 is the lowest, 5 is the highest). For Malay and Tamil, the average rating scores were used as ground truth scores. For each corpus, multiple inter-rater PCC were calculated between the scores of one rater and the average scores of the rest of all raters \cite{lin2020automatic}. By averaging all inter-rater PCC, the upper bound of the scoring performance (Human performance) was obtained (see the bottom lines in Table \ref{tab:Malay_results}-\ref{tab:Tamil_results}). For Speechocean762, the median scores were adopted following the example score files coming with the database. Multiple inter-rater PCC were calculated between the scores of one rater and the median scores of the rest of all raters as shown in Table \ref{tab:English_results}. \subsection{Results} All model and feature configurations are compared with PCC and MSE metrics following setup in previous work \cite{8462562,lin2020automatic}. \\ \\ \noindent\textbf{English Experimental Results}: The results for English are shown in Table \ref{tab:English_results}\footnote{Speechocean762's scoring categories are accuracy, fluency and prosody, which primarily evaluate the pronunciation, rhythm and intonation according to http://www.openslr.org/101/. We adapt the terminology to be more consistent with other datasets to make it easier for comparing performance.}. It is expected that GOP feature performs acceptably on the speech evaluation task. The scoring performance was improved by replacing normal duration feature with tempo feature, which reduced MSE by 3.3\%, 1.5\%, 3.7\% relatively and improved PCC by 2.3\%,0.7\%, 1.8\% relatively on the three oral proficiency measures, i.e. pronunciation, rhythm, and intonation, respectively. The phoneme embedding feature boosted the performance further by 0.4\%, 4.8\%, 1.0\% relative MSE decrements and 0.8\%, 2.4\%, 0.4\% relative PCC improvements on the three oral proficiency measures.\\ \\ \noindent\textbf{Malay Experimental Results:} The results for Malay are shown in Table \ref{tab:Malay_results}. Replacing duration feature with tempo feature brought 1.1\%, 1.2\% and 0.9\% relative MSE reductions and 1.7\%, 2.1\% and 1.9\% relative PCC improvements on the three oral proficiency measures respectively. By using phoneme embedding feature, scoring performance was further improved by 1.3\%, 1.5\% and 0.9\% relatively for MSE and 2.5\%, 2.4\% and 1.9\% relatively for PCC on the three oral proficiency measures respectively. Pitch feature improved the PCC performance by another 1.2\%,4.3\% and 9.6\% relatively. In addition, multi-task learning strategy benefited to Malay speech scoring task, especially for pronunciation and fluency proficiency measures. \\ \\ \noindent\textbf{Tamil Experimental Results:} Table \ref{tab:Tamil_results} shows the results for Tamil. Similar to English and Malay, the tempo feature performs better than duration. The multilingual embedding feature brought improvements on pronunciation while the pitch feature brought improvements on fluency and intonation. As data scarcity is a major bottleneck for Tamil speech evaluation, two cross language training strategies were further investigated: acoustic adaptation and data augmentation (multi-task learning). The results in Table \ref{tab:Tamil_results} show that both methods are effective. Especially, multi-task learning reduced MSE by 2.4\%, 2.6\%, 3.5\% relatively and improved PCC performance by 3.1\%, 2.2\%, and 3.6\% relatively on the three oral proficiency measures respectively. \section{Discussion} \noindent\textbf{Speech Tempo:} There have been studies on speech measurements that compare different rhythmic patterns across languages \cite{RAMUS2000AD3,inbook,ling2000q}. We adopted speech tempo as the three languages we are investigating are known to possess distinct rhythm patterns: stress-timed for English, syllable-timed for Malay and mora-timed for Tamil. We empirically show that speech tempo features are straightforward to use and effective in speech evaluation modeling, showing consistent improvements compared to traditional duration features for the PCC metric. \noindent\textbf{Multilingual Phoneme-Aware Scoring:} By introducing a multilingual phoneme embedding feature, data from the same phoneme is trained in a phoneme-specific subspace, while data from different phonemes would be trained in separate sub-spaces. The variability in the scoring model is attributed to both the pronunciation variation that is phoneme independent and the pronunciation variation that is phoneme dependent. Phoneme aware modeling decouples these two variations and provides a better prediction on the language proficiency. \noindent\textbf{Cross Lingual Modeling:} On low resource tasks such as Tamil, we attempted to improve model performance by leveraging from Malay. Both model adaptation and data augmentation have been shown to be effective. Consistent improvement was observed, suggesting language-agnostic information could potentially help speech evaluation scoring. Especially data augmentation improved data efficiency and alleviated training data over-fitting on low resource speech scoring tasks. We did explore using English data and models to help Tamil, but only observed minimal gains. We suspect this is because the English data was scored from a different standard than Malay and Tamil (the latter two is based on needs of Singapore Education). How to further exploit English resources to help lower-resource languages for speech evaluation is a theme of on-going work \noindent\textbf{Pitch:} In the Malay task, We observed obvious contribution by using pitch feature though similar trends were not observed for other languages such as English. We leave further analysis and investigations on how to more appropriately exploit pitch-related features for future work. \vspace{-0.2cm} \section{Conclusion} We systematically compared different feature configurations on multilingual speech evaluation tasks, focusing on sentence level fine-grained metrics. Tempo feature and multilingual phoneme embedding features were introduced. Consistent improvements were observed in experiments by adopting tempo-aware and phoneme-aware features in evaluation modeling. While Malay and Tamil are from different language, cross-lingual experiments showed that data and models in other languages could help improve speech evaluation performance. In the future, we will explore unsupervised error pattern discovery to diagnose speaker-specific pronunciation problems \cite{7472858}. \bibliographystyle{IEEEtran}
\section{Autonomous Navigation and Control}\label{sec:autonomous_navigation} The ROS navigation stack move\textunderscore base\footnote{\url{http://wiki.ros.org/move_base}} is employed for navigating the Jackal UGV. The {\it move\textunderscore base} package utilizes costmap\textunderscore 2d\footnote{\url{http://wiki.ros.org/costmap_2d}} approach to accomplish navigation tasks. Cost map, which aids in determining the areas in the map where the robot's motion is permitted, is calculated from an occupancy grid built from the sensory data. The generated cost map allows the UGV to plan its own path based on the goal location, obstacle configuration and actual robot position. For estimating the UGV location, the system must have an established localization algorithm. For this purpose, we use Lightweight Ground-Optimized LiDAR Odometry and Mapping (LeGO-LOAM)~\cite{8594299} on the point cloud generated by the LiDAR. LeGO-LOAM is an extended version of LiDAR Odometry and Mapping (LOAM)~\cite{Zhang-2014-7903}, which extracts edge and surface point features in a LiDAR point cloud based on the roughness of the local surface. Then the features are re-projected on the next scan based on a motion model. Finally, the 3D motion is estimated recursively by minimizing the sum of overall distances between point correspondences. LeGO-LOAM introduces a procedure to determine the ground plane and distinguishes between features detected on ground plane and on obstacles. The algorithm presents better accuracy when the Jackal IMU is used since it exploits the sensor fusion among the two sensors. Combining the localization algorithm with the move\textunderscore base navigation stack, resulted in autonomous navigation of the robot in the tested environment. The waypoint generation by the move\textunderscore base is achieved by specifying the goal locations from the current location. For motion planning, the stack maintains two planners: a global planner that generates a plan for the robot to navigate avoiding obstacles and a local planner that generates velocity commands to track the global plan. The global planner goal location can either be obtained from the user or from the planning system itself. Once a goal location is specified, a cost map is generated such to guide the UGV from current location to the goal location. Cost map generation is dynamic, which makes it possible for the planner to update its path based on real-time occupancy. To control the robot arm using ROS, we need to build and setup four different modules~\cite{mobile_MoveIt}. First ROS needs to understand the modeling properties of our robot arm as well as the kinematic relationships between joints. This is conventionally defined in robot\textunderscore description on the parameter server. Next, we need to utilize a motion planning algorithm to compute the optimal path for the robot to reach given goals. We determined that RRT-Connect~\cite{844730} in the Open Motion Planning Library (OMPL) is a suitable planner for our application as it presents a simple and efficient randomized algorithm for generating paths in high-dimensional configuration spaces. Third, we need to construct an environment model, either through pre-defined user settings or interpreted by the sensors in real time. This helps the robot arm to avoid collisions and understand where to place the end-effector to complete the mission. Lastly, our computer needs a method to communicate with the robot arm to convert all the generated trajectories into physical motions, both in simulation and in real world. The four modules are conveniently taken care of by Moveit!~\cite{6174325}, a motion planning library which integrates the different aspects of robot control and ensures the information consistency between each module. By configuring it using the setup assistant GUI, we are able to load the robot properties in the form of Universal Robot Description Files (URDF). We also configure RRT-Connect planner to be compatible with our Kinova arm so the user can provide a goal in either Cartesian or joint space, and the planner generates a trajectory for the robot arm to reach the desired location. Additionally, communication to the robot controllers is setup to execute the planned trajectories. The Kinova low--level driver publishes joint state information and provides a routine to execute trajectory tracking. We can achieve the following objectives \begin{itemize} \item Integrate the kinematics information of our robot arm to the motion planning library \item Collision checking of robot arm with the UGV, sensors and peripherals mounted on the UGV, and the environment \item Take into account the physical hardware limits of the specific robot arm we are using while planning and executing trajectories for task completion \item Dynamically update the location of the robot arm and environment \item Notify user when a specific motion execution is completed \end{itemize} All of this is done by one script file, which is launched when starting up the system. The library contains many useful API’s we can directly or indirectly utilize to achieve the firefighting tasks such as setting goals and executing trajectories. However, considering the re-usability of code and convenience of operation, it is desired to create a task level planner that generalizes and wraps all the useful API's into one single function. Therefore, we created an interface that aggregates all the necessary API’s provided by Moveit! into a single action server and standardized the action goal. Rather than writing multiple routines for path planning, users can now simply call the task-level planner using a unified message to activate the path planning pipeline. Therefore, when controlling the robot arm in state machines, or stand-alone calls, the user can easily interface with the robot arm without having to write a separate node. \section{System Overview}\label{sec:overview} \subsection{Hardware Overview} In order to fulfill the task of extinguishing fire in an indoor environment, a fire-fighting ground robot has been designed. Figure \ref{fig:hardware} visualizes all the sensors integrated in the system independently. The system is made of an UGV Clearpath Jackal, a 32-beam Ouster LiDAR, a 6-DoF Kinova Gen2 robotic lightweight arm mounted on the top of the ground vehicle and equipped with an RGB camera, and a GSI outdoors $15$ litre water container. The integrated robot is shown in Fig.~\ref{fig:armCandid}. The Ouster LiDAR is used to generate a point cloud of the environment for localization and mapping, along with the IMU integrated with Jackal UGV. A thermal camera is used for detecting high temperature hot--spots in the environment, and an RGB-D camera is utilized to measure its distance and position. A water-pump system is designed and manufactured to abate the detected fire. The maximum speed of the UGV is $2.0$ m/s, with a maximum payload of $20$ Kg. The UGV is also equipped with a 3DM-GX3-25\footnote{\url{https://www.microstrain.com/inertial/3dm-gx3-25}} IMU, that has a data output rate of up to 1000 Hz. The Kinova Gen2 Ultra lightweight robotic arm is a 6 DoF curved wrist arm with a reach of $90~\si{cm}$. It has a mid-range continuous maximum payload of $2.6$ Kg, with $2.2$ Kg full-reach peak/temporary maximum payload. It has a maximum linear arm speed of $20$ cm/s. We designed a custom end-effector, which is equipped with an Intel RealSense D435\footnote{\url{https://www.intelrealsense.com/depth-camera-d435}} depth camera and a FLIR Lepton 3.5\footnote{\url{https://lepton.flir.com/news-and-updates/new-lepton-3-5-with-radiometry}} LWIR (Long Wave Infrared) thermal camera. The Intel RealSense D435 depth camera is utilized on the system to estimate the depth of a heat source, if present. It has a maximum range of $10\si{.m}$, with a Depth Field Of View (FOV) of $87^{\circ}\pm$3$^{\circ}$ $\times$ $58^{\circ}\pm 1^{\circ}$ $\times$ $95^{\circ}\pm 3 ^{\circ}$. The RGB sensor FOV (H $\times$ V $\times$ D) is $69.4^{\circ}$ $\times$ $42.5^{\circ}$ $\times$ $77^{\circ}$ ($\pm$3$^{\circ}$). The RGB frame rate is $30$ fps with the depth frame rate to be up to $90$ Hz. The FLIR Lepton $3.5$ LWIR thermal, attached to the designed end-effector of the arm, has a horizontal FOV of $57^{\circ}$ and a diagonal FOV of $71^{\circ}$. The effective frame rate of the camera is $8.7$ Hz with a thermal sensitivity of 0.05$^{\circ}$C. The Ouster OS-1 $32$ channel LiDAR is used in the system for autonomous navigation. It has a maximum range of $120\si{.m}$ with a precision of $\pm(1.5-5)$ cm, a vertical FOV of $45^{\circ}$ with a vertical angular precision varying from $0.35^{\circ}$ to $2.8^{\circ}$, and a horizontal FOV of $360^{\circ}$. An AMD Ryzen 5 3600 6-Core, 12-Thread\footnote{\url{https://www.amd.com/en/products/cpu/amd-ryzen-5-3600}} with 16 GB memory is used as onboard computer to run our algorithms. A 15 liter water cube\footnote{\url{https://gsioutdoors.com/15-l-water-cube.html}} is located at the rear of the UGV to supply the water pump. It is controlled by our system to pressurize the water through the piping system and exits from the nozzle. The direction of the nozzle can be altered by the movement of the robot arm and the UGV platform to guide the water stream to the desired location. The water is ejected from the nozzle, housed inside the end-effector supplied from a water pump. An overview of the water projecting mechanism is demonstrated in Fig.~\ref{fig:waterPumpHardware}. \begin{figure}[!t] \centering \includegraphics[width=1.0\linewidth]{sections/images/merge35.png} \caption{Flowchart of the water-pump system.} \label{fig:waterPumpHardware} \vspace{-10pt} \end{figure} The constraints and performance requirements that our fire extinguishing system needs to achieve are the water stream reach and flow rate. To prevent the water from reflecting back on to the robot once hitting a hard surface, the water should reach at least $1.5$ meters. Therefore, after sizing the appropriate motor, piping system, and nozzle design, a $24$ V DC inline pump that is capable of delivering $1$ bar of pressure has been employed. The piping of the system routes the pressurized water stream from the base of the robot arm to the tip of the end-effector. The design of the end-effector is shown in the top-left corner of Fig.~\ref{fig:armCandid}. \begin{figure}[!t] \centering \includegraphics[width=0.45\linewidth]{sections/images/endEffectorCropfinred.jpg} \includegraphics[width=0.46\linewidth]{sections/images/endEffectorCropfinCAD.jpg} \caption{Designed CAD end-effector (left) and corresponding 3D printed prototype (right).} \label{fig:endEffector2} \vspace{-10pt} \end{figure} The end-effector is designed to house three components, a RGB-D camera, a thermal camera, and a nozzle. In Fig.~\ref{fig:endEffector2}, the flange extended on the top is used for housing the RGB-D camera, specifically designed for the Intel RealSense D435. The thermal camera is designed to mount right on the center of the circular surface and aligning with the axis of rotation of joint $6$. Lastly, the nozzle is extended from the side of the end-effector and has a male receptor for connecting the piping and an opening on the other end for the jet stream to exit from. The nozzle is $0.15$ inches in diameter which yields an exit velocity that meets our requirement. The water pump is controlled using an Arduino Nano\footnote{\url{https://store.arduino.cc/usa/arduino-nano}}. The output of the Arduino is connected to a transistor which acts as an electronically activated switch to supply $24$ V DC to the water pump. A diode is also placed into circuit to prevent back EMF from damaging the controller. Finally, the actuation of the water pump is controlled using PWM signal. The Arduino Nano uses ATmega328 USB to TTL serial chip to communicate with the on--board PC. Figure~\ref{fig:waterPumpHardware} presents the circuit diagram to control our water pump system. \subsection{Software Overview} To achieve the autonomous fire detection task, the proposed system needs to accomplish different intermediate tasks such as autonomous navigation through the environment, the robot arm control, the detection of the heat sources, and the deployment of the water pump system. Using the hardware design described in the previous section, we provide an overview of the software system architecture. The implementation of all the functions relies on Robotic Operating System (ROS)~\cite{ros}, which is an open-source development tool widely used nowadays in the robotics community. Since this is a mobile system, a navigation system is needed to drive the UGV from initial state to target locations. The combination of LiDAR along with the default IMU of the jackal UGV are the incorporated sensors which help the system in achieving this goal. Further, a heat detection algorithm is required. The thermal camera is the key sensor which is used to detect the heat source. Based on the heat source information, the RGB-D camera is used to locate it with respect to the robot arm. The water pump is then activated to achieve the final goal of extinguishing the fire at identified target locations. A control and planning policy is also needed for the robotic manipulator. Finally, we do require a state--machine that is able to activate and coordinate all the different sub--tasks in a sequential or concurrent manner. \section{Conclusion}\label{sec:conclusion} In this work, we developed a mobile manipulator equipped with a specialized end--effector to detect heat sources in indoor environments and abate them. The challenges included autonomous navigation of the mobile platform, design heat source identification, and control of a water pump system such to obtain fire abatement. \begin{figure}[!b] \centering \includegraphics[width=0.8\linewidth]{sections/images/final.jpg} \caption{Our team during the ceremony celebrating the first place in the Grand Challenge.} \label{fig:mbzirc_competition} \end{figure} The presented results show the effectiveness of our approach and its applicability in real firefighting scenarios. We believe that the proposed solution can be considered a first step toward the transitioning ground robotic solutions to realistic rapid fire suppression systems and search and rescue scenarios. The system has been designed as part of a solution in the MBZIRC 2020 for the Challenge No. 3 – Fire Fighting Inside a High-Rise Building and for the Grand Challenge. The proposed solution was instrumental and one of the key elements to win the Grand Challenge in the MBZIRC competition as captured in Fig.~\ref{fig:mbzirc_competition}. It was the smallest UGV solution proposed among the competing teams and scored during the Grand Challenge the highest number of points among all UGV firefighting solutions presented by the 17 teams admitted to the final competition. Future works will consist the ability to increase the autonomy and localization by detecting semantic cues in the environments, tracking heat sources concurrently while moving the UGV and the arm, and incorporation of exchangeable end effectors with different properties. Although developed, for the specific needs of the competition, the system has shown to be a promising solution to be employed in the future in real and complex urban firefighting scenarios and has the potential to be commercialized as well by our team members. \section*{Acknowledgements} The outstanding results of the MBZIRC project would not have been achieved without the help and collaboration of each member of our team, comprising people from the Czech Technical University in Prague, the University of Pennsylvania, and New York University (see Fig.~\ref{fig:mbzirc_competition}). This work was supported by the Mohamed Bin Zayed International Robotics Challenge through Khalifa University that supported 17 selected teams for the MBZIRC competition. \section{Introduction}\label{sec:Introduction} \begin{figure}[!b] \vspace{-10pt} \centering \includegraphics[width=0.5\linewidth]{sections/images/coverPic2.png} \caption{Proposed UGV system and manipulator for firefighting, deployed during the MBZIRC competition.} \label{fig:armCandid} \vspace{-20pt} \end{figure} Arm manipulators have proved to assist humans and substantially speed up tasks ranging from automotive \cite{8384639,8274801,8383972,9087500} to pharmaceutical \cite{8007498,8686979,8399114}, while increasing human safety. Unmanned Ground Vehicles (UGVs) have been employed to autonomously solve complex autonomous missions in dark or poorly illuminated confined and cluttered environments~\cite{LAMP,1242260}. A good overview and summary about the different approaches over the last 10 years is provided in~\cite{doi:10.1002/rob.21871}. The use of a mobile base coupled with a robot arm can provide the flexibility to the arm system to solve more complex tasks and to be conveniently deployed in multiple locations increasing the arm workspace. The complex configurations, achieved by the robotic arm, aid the mobile base immensely. For instance, by attaching a camera at the end--effector of the arm, and moving it along its base joint, a 360$^{\circ}$ vision is obtained from the camera, without affecting the UGV motion. The robotic arm holds the advantage of achieving complex configurations, which aids the mobile robot base to keep its movement practical and simple. A mobile robotic arm presents the mechanical redundancy easing the detection of objects in all the robot's directions. In 2018, only in the US, there were an estimated $379,600$ fires, which resulted in an estimated $\$8.1$ billion loss in residential buildings~\cite{residentialBuldingStats}, and $103,600$ fires, which resulted in a $\$2.6$ billion loss in non--residential buildings~\cite{nonResidentialBuldingStats}. The reports~\cite{residentialBuldingStats,nonResidentialBuldingStats,sprinklers} indicate that systems capable of early fire suppression can reduce fire damage by more than $55$\% and life loss by $97$\%. In particular, automatic sprinkler systems can extinguish local fires by activating only a few nozzles, limiting the fire spread as well as the damage caused by water. However, their installation is expensive and they require maintenance and regular checks. Moreover, traditional sprinkler heads act upon a larger area instead of delivering the water in a targeted way, causing unnecessary damage, waste of water, and sometimes failing to reach the fire~\cite{sprinklers}. These disadvantages can be mitigated by the use of small mobile robots, capable of early, autonomous and targeted fire suppression. This motivates the need to create autonomous robots solutions capable of early intervention and human assistance in firefighting tasks, which are typical in urban scenarios. This is as well the main task to solve in the Challenge 3 and in the Grand Challenge of the Mohammed Bin Zayed International Robotics Challenge\footnote{\url{http://mbzirc.com}} (MBZIRC) 2020. The robot needs to detect and extinguish a fire in an indoor environment represented by a heat source. To address this problem, we designed an autonomous mobile platform, as shown in Fig.~\ref{fig:armCandid}. The proposed system is incorporated with multiple sensors and actuators to concurrently assist the robot in navigation, heat source detection, and fire abating. The use of robots for firefighting operations has been much discussed in the recent years. Most current firefighting robots that are deployed are teloperated. The authors in~\cite{5353970} introduce a lightweight portable robot which gathers information of the affected building and transmits it to a human controller. This method requires a human observer to control and navigate it in the environment. Furthermore, it lacks the capability to extinguish a fire. In~\cite{KHOON20121145}, the authors incorporate a flame sensor in its design. The major drawback in their method is that the mobile robot has to rotate 360$^{\circ}$ in order to scan the entire area. Moreover, the navigation system is based on a line follower method, which does not scale well to real world scenarios. In~\cite{Zaman}, a small and cost-effective firefighting solution based on Arduino Nano is presented. The approach does not address the autonomy challenges and solutions to operate in urban firefighting scenarios. The authors focus mainly on video--streaming capabilities and the robot design is too small and with very limited computational resources to operate in urban settings. The approach proposed in~\cite{7251507} greatly summarizes the use of a fan as an extinguishing tool in many approaches. While this strategy may work well in small scale environments to abate candles, it does not successfully scale in our envisioned scenario. Finally multiple works~\cite{Raj,8996761,4381341,7977097} present some preliminary robot designs for firefighting scenarios. However, these solutions do not show any experimental validation or deployment in real--world settings to corroborate the effectiveness of their proposed solution. In this paper, inspired by the MBZIRC 2020 Challenge No. 3 – Fire Fighting Inside a High-Rise Building as shown in Fig.~\ref{fig:building_cad} and by the competition Grand Challenge, we address the design of an autonomous ground vehicle equipped with a robotic arm, which is able to detect heat sources and abate the corresponding fire employing a water-pump system. The task outline suggested that one liter of water successfully aimed at the heat source as the goal to extinguish the synthetic fire. Our solution scored the highest number of points among all UGV firefighting solutions proposed by the 17 teams admitted to the competition during the Grand Challenge\footnote{\url{https://www.mbzirc.com/winning-teams/2020/challenge4\#viewwinner}}, while concurrently being the most compact one. It was instrumental to win the Grand Challenge scenario. \begin{figure}[!h] \vspace{-10pt} \centering \includegraphics[width=0.54\linewidth]{sections/images/building_competition.jpg} \includegraphics[width=0.38\linewidth]{sections/images/building_ugv_cad.png} \caption{The tall structure simulating a high-rise building (left). A CAD of the building obtained by photogrammetry during rehearsals (right).} \label{fig:building_cad} \end{figure} \\ This work presents multiple contributions. First, we present a novel mobile platform composed by a mobile base and a robot arm. The system is equipped with a water tank used to extinguish the detected fire. Second, we present how to obtain a reliable state estimation, planning, and control for our mobile robot solution to autonomously navigate, locate, and abate the fire sources. Third, this is the first time that design, estimation, planning, and control problems are addressed simultaneously in a such challenging scenario. We test our methodologies in a challenging environment, where the robot needs to enter a building and solve a fire--extinguishing task. Finally, we plan to release our current framework upon acceptance as an open source package to the community ~\cite{github}. This work represents a first step toward robots' deployment in real world firefighting urban scenarios. The ability to test our methodologies in the MBZIRC test--bed allows us to evaluate the ability to transition our approaches to more complex settings. To contribute and boost this transition process as well as to facilitate new teams becoming part of the MBZIRC in the upcoming editions, we open--source our designs and algorithms. The paper is organized as follows. Section~\ref{sec:overview} introduces the hardware design and software overview of the system. Section~\ref{sec:autonomous_navigation} presents our methodology to control the UGV and the incorporated robotic arm. Section~\ref{sec:aim} explains our strategy to detect the heat source and then to align the UGV as closely to the identified target. Section~\ref{sec:experimental_results} presents our experimental results, and Section~\ref{sec:conclusion} concludes the work and presents future opportunities. \begin{figure}[!t] \centering \includegraphics[width=0.7\linewidth]{sections/images/hardwareSystem.jpg} \caption{The proposed system architecture.} \label{fig:hardware} \vspace{-30pt} \end{figure} \section{Heat Source Detection and Localization}\label{sec:aim} To extinguish the fire, the water stream has to pass through a relatively narrow aperture. While the localization drift of the used navigation system was low, the overall positional error after travelling several meters would prevent the water stream to reach the heat source even if the heat source position would be known a--priori. Therefore, we implemented a module, which would locate the heat source and aim the end effector precisely enough to reach the heat source. The artificial fire sources comprised anodized aluminium heating elements of dimensions \SI{3.5}{\centi\meter} $\times$ \SI{6.0}{\centi\meter} mounted on plexiglass backplates, and were covered \SI{15}{\centi\meter} in the front by another plexiglass plate with a circular hole \SI{15}{\centi\meter} in diameter, see Fig. \ref{fig:target}. We detected these heating elements using FLIR Lepton $3.5$ LWIR thermal camera that outputs an image where the values of pixels correspond to the estimated temperature in the given region. The heating elements were set to maintain a temperature of \SI{120}{\celsius}, but due to the lower emissivity of anodized aluminium of $0.55$ \cite{minkina2009infrared} compared to the reference value of 1 appear to be of lower temperature, approximately \SI{70}{\celsius}. See Fig. \ref{fig:thermal2} for an example of the view of the heat source from the thermal camera during the competition. \begin{figure}[!b] \centering \includegraphics[height=0.3\linewidth]{sections/images/thermalTarget2.png} \includegraphics[trim=50 0 50 20, clip, height=0.3\linewidth]{sections/images/rgb_target1.png} \includegraphics[trim=50 0 50 20, clip, height=0.3\linewidth]{sections/images/depth_target2.png} \caption{The white region represents the heat source present in thermal camera feed. (left). Corresponding RGB and depth images of the heat target (middle, right)} \label{fig:thermal2} \end{figure} We assumed that the detection in this sub-task was only performed indoors where the effects of direct sunlight can be neglected and that no other objects of such temperatures will be present. We could therefore detect the targets by simple value threshold. Their image centers were transformed to direction vectors based on the presumed thermal camera matrix, derived from the FOV and pixel resolution of the IR camera, assuming its pinhole model. This gave us the information on the direction of the target, which would be sufficient if the heating element was close enough to consider the water stream straight. \begin{comment} \todoi{Verify this section (Dinesh and Viktor)}\\ \todoi{We can get an estimate of the directional precision from the FOV of the Lepton, its resolution, the size of the heating elements and the shooting distance. From how far away did we shoot? Regardless, unless we had the relative transformation to the Lepton camera wrong, the estimated direction should always point to the heating element. The precision only starts mattering when the element is smaller than 1 pixel in the image, which I assume will not happen within the extinguishing distance with this camera.} \todoi{how thick were the fire mockups? we could use this to establish whether this effect or the precision of the Realsense defined the overall distance estimate precision. When we used the RpLIDAR for this on the drones we could just use local 2D convex hull of the points and ususally it pulled the estimate towards the front plate, since some points were on it. With Realsense depth maps I have seen this would probably not work.} \todoi{I don't know if the text about precision estimates will be possible to shift to the experimental section. Do you have some way to establish how precise it was in the competition?} \end{comment} To reach far targets, we acquire the information on their distance by an Intel RealSense D435 depth camera attached close to the thermal camera itself with known relative transformation between the two ($5$ cm offset). Assuming pinhole camera model for the thermal camera the relative distance between the robot and the target is estimated using this ray and the depth obtained from the depth camera by re-projecting the the direction vectors of the IR camera on the depth camera. The precision of the distance estimate varied based on the incidence angle with respect to the front plexiglass of the target. Since the plexiglass was transparent, sometimes the retrieved distance corresponded to the distance to the back plate instead of the front plate, or due to averaging over larger area, the distance estimate sometimes came out in between the two plates. However, this difference was not significant for this application, since the distance of the back plate to the front one was much smaller compared to the shooting distance. Additionally, having a line of sight to the heating element meant that we were also aiming inside of the front opening, since the plexiglass is opaque for the IR radiation band of our thermal camera. The final output of the heating element localization module is a 3D coordinate of the heating element in the coordinate frame of the camera mounted on the end effector along with the nozzle. This position was recalculated at the IR camera FPS, i.e. at $8$~Hz, which allowed to perform the final nozzle alignment in a closed-loop manner. To perform both horizontal and vertical alignment we implemented two separate feedback loops controlling concurrently the robot and arm motion. The movement of the mobile base was used to align the robot in horizontal plane. We used the laser measurements to align the robot with the furniture or wall with the artificial fire source and keep a distance of $1.5$~m. Once aligned to the wall, the robot can compensate the horizontal displacement of the fire source simply by moving forwards and backwards. In this way, the water spray faces the artificial fire source almost perpendicularly, which maximises the cross section of the aperture it has to pass through in order to extinguish the fire. The vertical alignment of the nozzle is performed simply by moving the third joint of the robot manipulator, which changes the nozzle pitch. Once the vertical and horizontal alignment is finished, the water pump is turned on. \begin{figure}[!t] \centering \includegraphics[width=0.4\linewidth]{sections/images/kitchenTarget.jpg} \includegraphics[width=0.55\linewidth]{sections/images/ArmMotionred.jpg} \caption{Image of the target utilised in the MBZIRC 2020 challenge (left) and image visualizing area covered by the water spray with the added movement (right).} \label{fig:target} \end{figure} In Fig.~\ref{fig:target} (left), it can be observed that the open area of the artificial fire is rather small. Thus, even a small misalignment or small pressure drop can cause the water stream to miss the target. Such a situation is difficult to detect, because the water stream can obstruct the view of the artificial fire. To avoid this, we increased the coverage of the water spray by introducing small, cyclic movements of two arm joints around the aligned position. This results in the final spray area to form a squared section which overlaps the fire aperture. This squared area is effectively the tolerance zone of our water spray aiming. The covered area obtained by adding this movement is visualized in Fig.~\ref{fig:target} (right). In a real system, it is worth to point out that these movements would correspond to a situation, where the water is spread not only on the fire, but also around it to prevent the fire spreading. The different steps of the heat source detection and localization process are handled by the system state machine described in Section~\ref{sec:state_machine} and depicted in Fig.~\ref{fig:highLevelSM}. \section{Experimental Results}\label{sec:experimental_results} \begin{figure*}[!b] \vspace{-10pt} \centering \includegraphics[width=0.32\textwidth]{sections/images/Picture1.jpg} \includegraphics[width=0.32\textwidth]{sections/images/Picture2.jpg} \includegraphics[width=0.32\textwidth]{sections/images/Picture3.jpg} \caption{UGV navigating towards the target (left), performing heat source detection (center), and abating the detected heat (right).} \label{fig:moving} \end{figure*} \begin{figure*}[!b] \centering \includegraphics[width=0.99\textwidth]{sections/images/system.pdf} \caption{Overview of the state machine. The top part of the pipeline regards navigation and the bottom part corresponds to the fire extinguishing activity.} \label{fig:highLevelSM} \end{figure*} In this section, we present results of the system based on the performance in the MBZIRC 2020 for Challenge No. 3 – Fire Fighting Inside a High-Rise Building shown in Fig.~\ref{fig:building_cad} (right). The key objective of this work is to navigate and localize the UGV, identify the heat source, and extinguish the heat source in the gound area of the building as shown in Fig.~\ref{fig:moving}. Since the test were performed on synthetic heat, by setting heat sources, the objective of this task was to shoot $1$ liter of water at the heat source target. We developed a high-level execution policy to manage all the tasks described in the previous sections, using ROS. The execution policy, from here on referred as state machine, was developed to progress from one function to another based on the outcome of the current function. The state machine was developed using behavior engine FlexBE~\cite{2016:ICRA_Schillinger-etal}. It provides an extensive user interface to combine different states and execute them. The autonomy level for the transitions can be set by the user to control the system. Data can also pass from one state to the other. Each state in FlexBE corresponds to an action executed by the robotic system and based on the outcome of the action, it can then move to the appropriate state. It is a good platform for navigating a robot by providing waypoints, as well as for controlling robotic manipulator. To comply the feature with our system, we developed appropriate functions and algorithms using ROS for tasks such as activating and deactivating the water pump system, detecting the heat source using the thermal camera, and for aligning the robot to the target. For our system, all the transitions were fully autonomous. The transition of the system is based on the current state and on the outcome of the current state. Based on the outcome, we progress from one state to another. Figure~\ref{fig:highLevelSM} represents the high-level state machine on which the entire system runs. \subsection{State Machine}~\label{sec:state_machine} The state machine, shown in Fig.~\ref{fig:highLevelSM}, combines waypoint-based navigation with a fire detection and suppression procedure. There are two sets of waypoints: outdoor and indoor waypoints. When navigating outdoors, the robot has its arm in a folded position, so it can accelerate and turn rapidly without the risk of slipping wheels or tripping over. Indoor navigation is performed slowly with the arm in a raised position, so that the camera can inspect the wall surfaces completely. During the competition the start location with respect to building was roughly known and the building was within scanning range of the LiDAR. To avoid lengthy exploration of the entire arena, we exploited this a--priori knowledge and set the navigation waypoints manually. In particular, we processed the 3D LiDAR scans and extracted the vertical planes of the building facade to obtain a 2D layout of the building. This 2D layout was subsequently used to determine the positions of the waypoints the robot navigated through. The projected 2D layout also allows doors/gaps to be extracted easily. Inside the building, the vertical planes were assumed as the most appropriate structure to help guiding the robot. In particular, the plane left on the robot was assumed and the waypoints were set so that the robot would move in clockwise fashion around the central piedestal of the building. To ensure that the robot would inspect all of the wall surfaces, we extended the arm to position the end effector as high as possible. The distance from the walls was determined so that considering the FOV of the thermal camera, all of the inspected surfaces would be seen at least once. Given the diagonal FOV of the thermal camera and distance from the wall we can assume that a fire will be easily visible if the camera height is kept fixed. This simplifies the search problem as the arm can be held in a fixed position and the robot just navigates alongside the wall. Hence we choose to set the waypoints to emulate a simple wall following strategy while searching the thermal source. The two likely candidates for fire location were known a-priori: the outer walls of the room and a central pedestal. This requires two possible loops inside the room, one with thermal camera pointing inwards while the other pointing thermal camera outwards. For the first loop inside the room we chose to point the camera inwards and follow the walls. \begin{comment} Once the system reaches there, it is made sure that the arm is upright, so that it can move to the corresponding poses without hindering with the water pump pipe. \end{comment} While following the wall, we monitor the thermal camera output and if a temperature spot above certain threshold is reported, we stop the navigation. As the heat source is detected, we execute the fire extinguish steps, which are shown in the bottom part of Fig.~\ref{fig:highLevelSM}. The arm is first set to fire abating position and the robot aligns itself to the wall. The final aiming is then realised by moving the robot forward and backward and the nozzle up and down as described in Section~\ref{sec:aim}. The pump is then set on and the nozzle yaw and pitch is perturbed in circular fashion to increase the water delivery area. After 20 seconds, the pump is switched off and we check if the fire is still present. If the heat source is detected, we run the fire extinguish steps again. If not, the robot proceeds to the next waypoint. \begin{figure*}[!t] \centering \includegraphics[width=0.40\textwidth]{sections/images/trajRob.png} \includegraphics[width=0.40\textwidth]{sections/images/trajRob2.png} \caption{Trajectory of the UGV represented from two angles.} \label{fig:robTraj} \end{figure*} \subsection{Results} Four experiments were performed as part of the MBZIRC 2020 Challenge No. 3 and the Grand Challenge. While one can argue that the number of experiments is not sufficient to obtain statistically significant results, their aim is not to measure precision or accuracy, but to demonstrate reliability and robustness of the solution when deployed in a near-real scenario. Moreover, the experiments are evaluated by an international jury, that does not allow to rule out cases, where the system failed for technical difficulties and of course numerous preliminary experiments of the system components as well as the entire system were done in the testing phase prior to the competition. The evaluation of the experiments is based purely on the ability to deliver water through the narrow aperture of the fire targets. The key questions of the experiments were: Is the proposed design made by off-the shelf components sufficient to accomplish the proposed task? More specifically, is the SLAM-based navigation and thermal source location pipeline precise enough to realize the fire abating by itself or do we need a--priori knowledge and specialized fire detection modules? In all of the experiments, we let the robot reach the target locations with the arm extended in a way that in a case of precise localization, it would hit the simulated fire. In the first run, we did not use an a--priori known map build by the robot 3D scanner and we simply set the waypoints using hand-measured positions. In the subsequent runs, the waypoints were set using the map created by the 3D scanning system. In the first and second experimental run, we did not use the final nozzle alignment specified in Section~\ref{sec:aim}. In the third and fourth run, we used the fire detection modules to perform the final nozzle alignments. \begin{figure}[!t] \centering \includegraphics[width=0.7\linewidth]{sections/images/shootingTarget2.png} \caption{RGBD camera feed showing water being ejected to the heat source.} \label{fig:waterShot} \end{figure} During first run, the hand-set waypoints were not precise enough to allow the path planning system to reliably pass through the door and the robot did not even enter the building. The second run used refined waypoints, and the robot passed through the door and navigated the building interiors without problems. However, the localization drift prevented the robot to deliver water to the a--priori known artificial fire spots. In the third and fourth runs, performed during the Grand Challenge round, the robot performed the final nozzle alignment using the methods specified in Section~\ref{sec:aim}. In both of these runs, the artificial fire was detected correctly and water was delivered to it with ease. The average time to accomplish the overall mission was around 3 minutes. The attached multimedia material\footnote{\url{https://youtu.be/HCqQMEmkiN8}} further shows the successful performance of our system. Figure~\ref{fig:robTraj} shows the trajectory of the UGV during the experiment. The trajectory is shown in two different views, to visualize the arena in which the tests were performed. The multicolored trail express the trajectory of the robot in the images. To avoid tipping over backwards while carrying the heavy water payload the UGV was operated at maximum velocity of $0.6$ m/s. Loop-closure was not performed during the competition, but during manual tests the localization was sufficiently precise. We empirically verified, due to the absence of ground truth, using the environment dimensions that similar localization errors are obtained compared to the one reported in original paper~\cite{8594299}. The localization and mapping algorithm runs at $10$ Hz and consumes an average of $40\%$ of the overall CPU. Figure~\ref{fig:thermal2} shows the feed from the thermal camera. The white blob in the image represents the heat source, which is successfully detected. The pixel location of the detected heat source in the thermal camera image is transformed to the RGB-D camera frame, using the approach explained in Section~\ref{sec:aim}. Once the transformation is performed, the heat source is localized, the UGV is aligned using the two step approach previously described, and the water is ejected on the heat source. Figure~\ref{fig:waterShot} shows the image acquired from the RGB-D camera while the water is dispensed by the system to the detected heat source. Once the heat source is detected by thermal camera, and localized by the RGB-D camera, the water pump is turned on. The added cyclic motion of the arm increases the likelihood to shoot the target, while also covering greater area, which is beneficial in actual scenarios. The aim of the competition was to shoot $1$ liter of water towards the heat source. This goal was achieved successfully, but due to the size of the UGV, the water carried was not sufficient to extinguish the fire in one trip. The water container was refilled to extinguish the fire completely. Upon the refill, the robot performed all the tasks again successfully, with full autonomy. \subsection{Lesson learned} We discuss the research and technological challenges related to our approach and how the proposed solution can be transitioned from the MBZIRC test--bed to more complex real world urban firefighting scenarios. First, the firefighting task definitely showed the importance to engage different researchers with cross-disciplinary competences in complementary research domains, such as localization, autonomous navigation, robotic arm control, fire detection, and hardware design to integrate the different robots parts and to obtain an end effector to house a thermal camera, stereo camera, and hose. The proposed solution can definitely inspire early roboticists to understand how the modules in the system are interconnected and work together to create an autonomous mobile robot solution for search and rescue scenarios. Second, the system is not a monolithic solution to the firefighting problem. Rather, it can be considered as a first step towards an efficient, rapid response system capable of early fire suppression. The main problem of such highly task specialized systems -- the cost is actually mitigated by the versatile and modular design of our robot. A mobile base with a manipulator could perform a variety of other tasks, such as delivery or facility inspection and the fire suppression could be achieved simply by exchanging the end effector~\cite{gripper}. The presented system demonstrated that an off-the-shelf robotic platform, employed with customized state-of-the-art navigation, image processing and control methods can perform the fire suppression task reliably and efficiently. Several customized parts needed were rapidly prototyped and 3D printed within few hours. These aspects indicate that the field of mobile robotics is mature enough to deploy robots capable of autonomous, targeted fire suppression. Thus, mobile robots might soon compete with traditional sprinkler systems. Finally, while the experiments indicate that the technology is ready to be deployed in buildings or small residential clusters, complex urban scenarios require more advanced, socially-aware navigation~\cite{social1,social2}, capable to deal with low visibility~\cite{fog}. These capabilities have not been addressed in the proposed approach and will require further future investigation. On the other hand, the proposed approach for robot localization provides direct feedback control to the robot event transitioning from outdoor to indoor settings. The water tank and automated water pump designs for fire abatement are simple, inexpensive, and effective. Similar mechanical and circuitry designs and concepts can be used by private or government organization as firefighting solution. To demonstrate the versatility of the approach, we open source our mechanical and electrical designs and navigation solution~\cite{github}. \begin{comment} Furthermore, integrating additional perception techniques, such as door detection, and heat source detection, would make the system more robust and better suited for search and rescue missions. Currently, based on the position of the landmarks, such as, doors, heat sources, and walls, goal location were provided before hand. By adding more features on the system to detect doors, walls, and heat sources, the system will be complete. \end{comment}
\section{Introduction}{\label{sec:intro}} Real-Time Applications (RTA) are steadily becoming an inherent part of our lives. RTA are present in such scenarios, as cloud gaming, video streaming, virtual and augmented reality, distance learning, and industrial automation. Devices that support RTA become more and more available, and their traffic grows every year. RTA have very strict quality of service (QoS) requirements: typical RTA demand very low latency ($\leq $\SI{10}{\ms}) and very high reliability of communications (packet loss rate, PLR $\leq 10^{-5}$)~\cite{discussion_target_presentation, usecases_presentation}. At the same time, in many scenarios, it is either inconvenient or impossible to use wired network technologies, which is a motivation to develop approaches for RTA service in wireless networks. The IEEE 802 LAN/MAN Working Group considers RTA as a very important use case for the next generation of Wi-Fi. In 2018 the RTA Topic Interest Group (TIG) was created, which classified the RTA-related scenarios and proposed methods to provide the QoS for RTA in Wi-Fi~\cite{rta_tig}. RTA support has become one of the major goals of the next main Wi-Fi standard amendment: the IEEE 802.11be, a.k.a. Wi-Fi 7 \cite{khorov2020current}. It is not easy to guarantee a low delay in Wi-Fi, mostly because Wi-Fi stations (STAs) use a variant of Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) to access the channel. CSMA/CA does not allow a STA to interrupt the transmission of another STA, so even a high-priority STA with an urgent frame has to wait until some other STA frees the channel, and the waiting time can reach $\approx \SI{5}{\ms}$. Additional delays can be caused by the frame collisions that occur when several STAs access the channel at the same time. A possible standard way to decrease the RTA frame delay in Wi-Fi networks is to limit the time by which the STAs can occupy the channel, and thus to decrease the time that a STA has to wait until the channel becomes idle. Still, the overhead induced by the channel access procedure and the frame headers decrease the channel usage efficiency for other STAs in the network. Another approach that we propose and study in this paper is the preliminary channel access (PCA). Its idea is that in case of periodic and/or predictable RTA traffic, the STA can obtain the channel access in advance and reserve the channel by sending a Request-to-Send (RTS) frame to have the transmission opportunity (TXOP) when the RTA frame is generated. Such an approach also decreases the channel usage efficiency for the other STAs. In the paper, we compare these approaches to determine their efficiency and to find out the conditions when one approach or the other one should be used for better performance. To achieve this goal, we develop mathematical models of networks using the considered approaches, state and solve the optimization problem to maximize the channel usage efficiency, provided that the delay quantile does not exceed a given constraint. The rest of the paper is organized as follows. In Section~\ref{sec:related}, we review the prior arts on RTA service in Wi-Fi. In Section~\ref{sec:methods}, we provide details on the Wi-Fi channel access and the studied approaches. Section~\ref{sec:problem} describes the scenario and the problem statement. In Section~\ref{sec:model}, we develop a mathematical model of the RTA service approaches. Section~\ref{sec:numerical} contains the numerical results. Conclusion is given in Section~\ref{sec:outro}. \section{Related Works}{\label{sec:related}} Solutions for RTA service in Wi-Fi are studied both in IEEE 802.11 task groups and in scientific papers. A promising approach for RTA service is based on orthogonal frequency division multiple access (OFDMA) and has been proposed in the RTA TIG and studied in~\cite{avdotin2019enabling, avdotin2020resource}. OFDMA was introduced in the 802.11ax amendment and will be further developed in 802.11be. With OFDMA, a Wi-Fi Access Point (AP) can divide the frequency band into resource units and allocate them to STAs so that they can transmit their data in parallel. By controlling the STA transmissions, the AP can improve the efficiency of channel usage, and several algorithms have been proposed to combine the deterministic and random channel access in order to provide low delays for RTA. Another way to prioritize the RTA traffic is to use an additional radio interface to signal about the RTA traffic presence~\cite{bankov2019enabling}. Having received such a signal with additional radio interface, all the devices that transmit the non-RTA frames must free the channel at once. The RTA QoS can be improved using the Multi-Link transmissions~\cite{rodriguezmulti}, an approach that is currently in the center of attention of the 802.11be task group. With Multi-Link, a STA can contend for the medium in several frequency channels at once and transmit its data in the first free channel. A similar approach based on double Wi-Fi interfaces has been considered \cite{cena2017experimental} outside the 802.11be amendment. The approaches described so far require significant changes to the Wi-Fi standard and additional PHY level functionality, which can hinder their introduction into real devices. However, much simpler and easy-to-implement solutions exist, e.g., \cite{genc2019wi} propose to introduce a new access category (AC) for RTA traffic and to set its channel access parameters to guarantee that the RTA traffic is served before the non-RTA one. Another solution is to allow the STA to start the channel access procedure in advance if it expects a forthcoming RTA frame~\cite{abouelseoudreducing}. In this paper, we develop the last two ideas. We consider a separate AC for RTA traffic, and in addition to~\cite{genc2019wi}, we set its channel access parameters in such a way that the channel usage efficiency by non-RTA traffic does not suffer too much. We also consider PCA, but in addition to~\cite{abouelseoudreducing}, we expand it with sending an RTS frame. The proposed methods are quite simple and can be easily implemented in real devices. \section{Channel Access for RTA}{\label{sec:methods}} \subsection{Channel Access in Wi-Fi}\label{ssec:edca} Modern Wi-Fi STAs access the channel according to the Enhanced Distributed Channel Access (EDCA). Every STA maintains a queue of frames waiting for transmission. If a STA generates a frame when its queue is empty, it listens to the channel and, if it is idle, transmits the frame at once. If the channel is busy, the STA initializes a backoff counter with an integer random number distributed uniformly in the $[0, CW_r - 1]$ interval, where $r$ is the retry counter (initially zero), and $CW_r$ is the contention window defined as \begin{equation} CW_r = \begin{cases} CW_{min}, & r=0;\\ \min\{2CW_{r-1}, CW_{max}\}, & r \in(0, RL]. \end{cases} \end{equation} Here $CW_{min}$ and $CW_{max}$ are the minimal and maximal contention window, respectively, and $RL$ is the retry limit. The backoff counter is frozen as long as the channel is busy, and is unfrozen if the channel is idle for the Arbitration Interframe Space ($AIFS$). An unfrozen backoff counter decrements by one every empty slot interval $T_e$. The STA transmits its frame when the backoff counter reaches zero. Short Interframe Space ($SIFS)$ after a successful frame reception, the receiving STA should reply with and acknowledgment frame (ACK). Having received an ACK, the STA sets its retry counter to zero and starts processing the next frame, if any. If the transmitter STA does not detect an ACK within the $AckTimeout$ interval, it considers the transmission as failed, increases the retry counter, and performs a new transmission attempt. The STA discards the frame if it makes $RL$ unsuccessful transmission attempts. To provide QoS for different types of traffic, EDCA distinguishes between several access categories (ACs). Every AC has its queue and backoff function. Different ACs have different AIFS values equal to $SIFS + T_e \cdot AIFSN$, where $AIFSN$ is an integer from 2 to 15. Moreover, when a STA wins the channel access, it gains the channel for a time interval, called the transmission opportunity (TXOP) and bounded by the TXOP limit. Every AC has its values of $CW_{min}$, $CW_{max}$, $AIFSN$, and TXOP limit, which are set by the AP and are the same for all STAs in the network. \subsection{RTS/CTS Procedure}\label{ssec:rts} To increase the channel usage efficiency for long frames, Wi-Fi networks use the RTS/CTS procedure (see Fig.~\ref{fig:rts}). With this procedure, a STA transmits an RTS frame, the receiving STA responds with a Clear-to-Send (CTS) frame, and only after receiving a CTS, the STA transmits the data frame. Even though the RTS and CTS transmission introduces additional overhead, this procedure improves the channel usage because the RTS and CTS are very short, and a collision of RTS frames lasts much less than a collision of long data frames. \begin{figure}[tb] \centering \includegraphics[width=0.9\linewidth]{rts} \caption{\label{fig:rts} The RTS/CTS Procedure} \end{figure} The RTS and CTS, as well as most Wi-Fi frames, contain a Duration/ID field, which specifies how long the channel will be busy after the end of the frame. Having received a frame with such a field, the STA sets up its network allocation vector (NAV): a counter of virtually busy channel time, and may not access the channel as long as NAV is non-zero. A STA can increase the NAV duration if the Duration/ID field of a received frame is higher than NAV, but may not decrease it. The only exception is the receipt of a CF-end frame, which means that the STA should zero its NAV. \subsection{RTA Service Approaches}\label{ssec:methods} The described above functionality can be used to provide reliable low latency service for RTA. First, we assign a separate AC for RTA traffic, and set $AIFSN_{RTA}$ value less than the $AIFSN$ for other ACs. Let $\Delta_{AC}$ be the difference between the smallest $AIFSN$ for non-RTA traffic and $AIFSN_{RTA}$. To ensure that RTA traffic has a priority over non-RTA traffic, we set its contention windows as follows: \begin{equation} CW_{RTA} \triangleq CW_{max}^{RTA} = CW_{min}^{RTA} \leqslant \Delta_{AC}. \end{equation} The RTA frames thus will always win the contention for channel access with non-RTA frames, but still the RTA frames may experience delay caused by waiting for ongoing transmissions to end. To decrease this delay, we consider two approaches. The first approach is to set a small TXOP limit for non-RTA ACs, and thus to restrict the waiting time for the RTA frames \cite{tsn_presentation}. An alternative approach is to capture the channel by sending RTA before the frame arrives in the transmission queue \cite{abouelseoudreducing}. With this approach, $T_b$ before the expected RTA frame arrival (see Fig.~\ref{fig:rts_delay}), the STA generates an RTS. If the RTS is successfully delivered, the STA can transmit an RTA frame without delay once the frame is generated. It should be noted that the 802.11 standard does not consider the RTS transmissions without a present data frame, so we need to add such a capability to the 802.11be amendment. Both approaches consume the channel resources, and it is a question, how to configure them to satisfy the RTA QoS requirements and to maximize the network performance. \section{Scenario and Problem Statement}{\label{sec:problem}} We consider a Wi-Fi network consisting of an AP, $N$ legacy (non-RTA) STAs, and one RTA STA. All legacy STAs generate a saturated stream of data frames with a non-RTA AC with parameters $CW_{min}$, $CW_{max}$, $AIFSN$ and TXOP limit $= T_s$ set by the AP. We assume that the application of RTA STA periodically generates single data frames, but due to the implementation issues, such as the unpredictable operation system delays or the clock drift, the real frame arrival time is random. The expected RTA frame generation time constitutes a periodic process with a period of $T_{period}$, but the real arrival time $t_a$ is distributed normally around the expected one with a standard deviation $\sigma$. The RTA AC has parameters $CW_{RTA}$ and $AIFSN_{RTA} = AIFSN - \Delta_{AC}$. The legacy STAs use the RTS/CTS procedure to transmit their frames, and the data frame size is such that the transmission duration equals the TXOP limit, including the inter-frame spaces, RTS, CTS, data frame and ACK transmission. The RTA frames have a fixed size and the following QoS requirements: the frame transmission delay should be less than $D_{max}$, and PLR should be less than $PLR_{QoS}$. We consider two approaches described in Section~\ref{ssec:methods}. In the first approach we configure the TXOP limit depending on $D_{max}$ to achieve the required $PLR_{QoS}$. In the second approach, we take into account $D_{max}$ and $\sigma$ and configure the time offset $T_b$ between the expected RTA frame generation and the RTS transmission start. We assume that after a successful RTS transmission, the STA can keep the channel until the data frame arrival using the NAV mechanism or by sending some busy channel signal. After a successful data frame transmission, the STA ends the transmission using a CF-end frame. If the data frame is generated before the RTS transmission start, the STA transmits the data frame instead. In the described scenario, we state the problem to find the optimal TXOP limit $= T_s$ and $T_b$ parameters for the two approaches and to determine which approach provides better performance depending on the traffic parameters and QoS requirements. We consider two utility functions. The first one is the average channel usage efficiency $E$: the portion of channel time occupied by successful non-RTA frame transmissions. The second one is the $1 - PLR_{QoS}$ quantile of delay $Q$, i.e., such a delay value, that with probability $1 - PLR_{QoS}$ an RTA frame is transmitted within this delay. We state the following optimization task for the approach without PCA: \begin{equation}\label{eq:opt_simple} \begin{split} \max_{T_s} \quad E_{simple}(T_s), \quad s.t. \quad Q_{simple}(T_s) \leqslant D_{max}, \end{split} \end{equation} and with PCA: \begin{equation}\label{eq:opt_reserve} \begin{split} \max_{T_b, T_s} E_{PCA}(T_b, T_s), \quad s.t. \ Q_{PCA}(T_b, T_s) \leqslant D_{max}. \end{split} \end{equation} \section{Mathematical Model}{\label{sec:model}} The mathematical model consists of two main parts. First, we consider a rarely-transmitting RTA STA as a small perturbation in comparison with several saturated legacy STAs, and describe the legacy STAs behavior as if there was no RTA STA. Second, we consider the RTA STA and find the delay distribution and its influence on the channel usage efficiency. \subsection{Legacy STAs} We describe the saturated legacy STAs similarly to~\cite{bianchi2000performance, vishnevsky2002802}. We assume that the STAs can hear each others' transmissions and therefore count their backoff synchronously. We divide the time into variable-duration slots, their bounds corresponding to the backoff countdowns by the STAs. Slots can be empty, successful, and collision. A slot is empty if no STAs try to transmit their frames during the slot. Its duration is $T_e$. A successful slot occurs when only one STA transmits its frame. The successful slot duration equals $T_s + AIFS$, where $T_s = T_{RTS} + SIFS + T_{CTS} + SIFS + T_{data} + SIFS + T_{ACK}$. Here $T_{RTS}$, $T_{CTS}$, $T_{data}$, and $T_{ACK}$ are the RTS, CTS, data frame and ACK durations, respectively. A collision slot is a slot during which more than one STAs try to transmit. Its duration equals $T_c + AIFS$, where $T_c = T_{RTS} + AckTimeout$. Let us choose a legacy STA. Let $\tau$ be the probability of the STA transmission in a slot, and let $p$ be the probability of STA transmission attempt resulting in a collision. If the STA tries to transmit in a slot, the probability of the remaining $N - 1$ STAs not to transmit in the slot equals $(1-\tau)^{N-1}$, so \begin{equation}\label{eq:p} p = 1 - (1-\tau)^{N-1}. \end{equation} As in \cite{vishnevsky2002802}, we find $\tau$ as the average number of transmissions divided by the average number of slots counted per frame: \begin{equation}\label{eq:tau} \tau = \left.\left(\sum\limits_{r=0}^{RL}p^r\right)\middle/ \left(\sum\limits_{r=0}^{RL}\frac{CW_r-1}{2}p^r\right)\right., \end{equation} where $p^r$ is the probability of STA making the transmission attempt $r+1$, and $\frac{CW_r-1}{2}$ is the average backoff. Solving the system of equations \eqref{eq:p} and \eqref{eq:tau}, we find $p$ and $\tau$, and use them to find the probabilities of an empty slot: $P_e = (1-\tau)^N$, successful slot: $P_s = N\tau(1-\tau)^{N-1}$, and collision slot: $P_c = 1 - P_e - P_s$. \subsection{RTA Frame Delay} The STA generates an RTS $T_b$ before the expected arrival of the RTA frame. If the channel is empty, which happens with probability $P_{te}$, the STA transmits the RTS at once. Otherwise, the STA waits for the channel to become idle and starts the backoff countdown before the RTS transmission. The channel is busy with a successful transmission with the probability $P_{ts}$ and with a collision with a probability $P_{tc}$. \begin{figure}[tb] \centering \includegraphics[width=0.6\linewidth]{slots} \caption{\label{fig:slots} Comparison of RTA and non-RTA Slots} \end{figure} We define the delay $D$ as the time from the data frame arrival until the end of its transmission. This value depends on the type of the slot, during which the RTA is generated. At the same time, due to the difference in $AIFS$ values, the RTA STA observes more empty slots and shorter successful and collision slots in comparison with the legacy STAs (see Fig. \ref{fig:slots}). The average number of empty slots for RTA STAs is bigger by $\Delta_{AC}\cdot(P_s+P_c)$, while the successful and collision slot durations consist of $T_s$, $T_c$ and $AIFS_{RTA}$. Taking these values into account, we find the portion of time, when the channel is empty, occupied by a successful transmission or a collision from the point of view of the RTA STA: \begin{equation*} \begin{aligned} P_{te} &= \frac{P_eT_e + (P_s+P_c)\cdot \Delta_{AC}\cdot T_e}{P_eT_e + P_s(T_s+AIFS) + P_c(T_c+AIFS)}, \\ P_{ts} &= \frac{P_s(T_s + AIFS_{RTA})}{P_eT_e + P_s(T_s+AIFS) + P_c(T_c+AIFS)}, \\ P_{tc} &= \frac{P_c(T_c + AIFS_{RTA})}{P_eT_e + P_s(T_s+AIFS) + P_c(T_c+AIFS)}. \end{aligned} \end{equation*} Thus, with probability $P_{te}$, the RTS is sent at once. Otherwise, the RTS frame experiences a random delay $D_{RTS}$, which includes the waiting time for the channel to become idle $D_w$ (including $AIFS_{RTA}$), and the backoff countdown $D_{b}$~(see Fig.~\ref{fig:rts_delay}): $D_{RTS} = D_w + D_b$. \begin{figure}[tb] \centering \includegraphics[width=\linewidth]{rts_delay} \caption{\label{fig:rts_delay} Components of RTS Delay} \end{figure} The RTS can arrive with equal probability in any time within a slot, so $D_w$ is distributed uniformly with a CDF: \begin{equation}\label{eq:D_w} F_{w,s/c}(t) = \begin{cases} 0, & t<AIFS_{RTA};\\ \frac{t}{T_{s/c}}, & AIFS_{RTA} \leqslant t < T_{s/c} + AIFS_{RTA};\\ 1, & t \geqslant T_{s/c} + AIFS_{RTA}, \end{cases} \end{equation} where $s / c$ denotes whether the random value describes a successful or a collision slot. We combine this CDF with $D_b$: an integer value distributed uniformly from 0 to $CW_{RTA} - 1$, and find the RTS delay CDF: \begin{equation*} \resizebox{\linewidth}{!}{$F_{RTS,s/c}(t)=\mathbb{P}(D_w + D_b \leqslant t) = \sum\limits_{i=0}^{CW_{RTA}-1}\frac{F_{w,s/c}(t - i\cdot T_e)}{CW_{RTA}}.$} \end{equation*} Taking into account three types of slots we obtain: \begin{equation}\label{eq:D_rts} F_{RTS}(t) = P_{te} + P_{ts}\cdot F_{RTS,s}(t) + P_{tc}\cdot F_{RTS,c}(t), \end{equation} if $t \geqslant 0$, and $0$ otherwise. Let the RTS be generated at time $0$. The data frame arrival time $t_a$ has the following PDF: \begin{equation}\label{eq:f_ta} f_{t_a}(t) = \frac{1}{\sigma\sqrt{2\pi}}\exp\left(-\frac{(t-T_b)^2}{2\sigma^2}\right). \end{equation} If an RTS is transmitted before the data frame arrival, the channel is reserved by the RTA STA, and the delay equals the transmission time $T_{SR}$, which includes the RTA frame, $SIFS$, and ACK. Otherwise, the frame can arrive before the RTS generation ($t_a < 0$). In this case, the RTA frame delay is distributed as $F_{RTS}(t - T_{SR})$. The RTA frame can arrive after the RTS generation but before its transmission ($0 < t_a < D_{RTS}$). In such a case, the delay consists of the rest of the $D_{RTS}$ and the RTA frame transmission time: $D = D_{RTS} - t_a + T_{SR}$ (see Fig.~\ref{fig:data_delay}). \begin{figure}[tb] \centering \includegraphics[width=\linewidth]{data_delay} \caption{\label{fig:data_delay} Components of Data Transmission Delay for $t_a>0$} \end{figure} Combining the described cases, we find the delay CDF for PCA: \begin{equation} \begin{split} F_{D,PCA}(x) &= F_{RTS}(x-T_{SR})\int\limits_{-\infty}^{0}f_{t_a}(t)dt +\\ +& \int\limits_{0}^{\infty}f_{t_a}(t)F_{RTS}(t+x-T_{SR})dt. \end{split} \end{equation} In the approach without PCA, the STA transmits the data frame instead of RTS, so the delay consists only of the channel access time, its CDF being \begin{equation} F_{D,simple}(x) = F_{RTS}(x-T_{SR}). \end{equation} \subsection{Channel Usage Efficiency} Without the RTA STA, we define the channel usage efficiency as the portion of time when the channel is occupied by a successful data transmission: \begin{equation}\label{eq:Eff_wo_rta} \resizebox{0.88\linewidth}{!}{$E_{\text{w/o RTA}} = \frac{P_s\cdot T_{payload}}{P_eT_e + P_s(T_s+AIFS) + P_c(T_c+AIFS)}$,} \end{equation} where $T_{payload}(T_s) = T_s - (T_{RTS} + SIFS + T_{CTS} + T_{header} + SIFS + T_{ACK})$ is the payload transmission time and $T_{header}$ is the frame header duration. If we add an RTA STA, we need to take into account that once in $T_{period}$ it occupies the channel for $T_{RTA}$ time: \begin{equation}\label{eq:Eff} E = \left(1-\frac{ T_{RTA} }{T_{period} }\right) \cdot E_{\text{w/o RTA}}. \end{equation} Without PCA, the RTA STA occupies the channel only for the data frame duration and $AIFS$: $T_{RTA} = T_{SR} + AIFS_{RTA}$. PCA increases $T_{RTA}$ value by $t_a - D_{RTS}$, and we find the average increase value using~(\ref{eq:f_ta}) and $f_{RTS} = \frac{dF_{RTS}(t)}{dt}$. \begin{equation*} \resizebox{\linewidth}{!}{$\int\limits_{0}^{\infty}\int\limits_{0}^{x}(x-t)\cdot f_{t_a}(x)\cdot f_{RTS}(t)dtdx = \int\limits_{0}^{\infty} f_{t_a}(x) \int\limits_{0}^{x} F_{RTS}(t)dtdx.$} \end{equation*} For PCA, we add the duration of RTS, CTS, and CF-end. In total, we obtain: \begin{equation*} \begin{split} &\resizebox{\linewidth}{!}{$T_{RTA} = T_{SR} + AIFS_{RTA} + \int\limits_{0}^{\infty} f_{t_a}(x) \int\limits_{0}^{x} F_{RTS}(t)dtdx+$} \\ &\resizebox{\linewidth}{!}{$+ (T_{RTS}+2 \cdot SIFS+T_{CTS}+T_{CFend}) \int\limits_{0}^{\infty} f_{t_a}(x)F_{RTS}(x)dx$.} \end{split} \end{equation*} Given $T_{RTA}$, we find $E$ with~\eqref{eq:Eff}. \subsection{Optimization Problem} \label{sec:optimization} To solve the optimization tasks \eqref{eq:opt_simple} and \eqref{eq:opt_reserve}, we find the delay quantile $Q$ that corresponds to the successful transmission probability $1 - PLR_{QoS}$. For that we solve the equations: \begin{equation*} \begin{split} F_{D,simple}(Q_{simple}(T_s)) &= 1-PLR_{QoS},\\ F_{D,PCA}(Q_{PCA}(T_b, T_s)) &= 1-PLR_{QoS}. \end{split} \end{equation*} These equations define the maximal delay $D_{max}$ as a function of the $T_s$ and $T_b$ parameters. Let us fix all the parameters except $T_b$ and $T_s$. Equation~\eqref{eq:Eff_wo_rta} can be reduced to the following form: \begin{equation*} \resizebox{\linewidth}{!}{$E_{\text{w/o RTA}}(T_s) = 1 - \frac{P_eT_e + P_s(AIFS+const) + P_c(T_c+AIFS)}{P_eT_e + P_s(T_s+AIFS) + P_c(T_c+AIFS)}.$} \end{equation*} Now we see that to solve the optimization task~\eqref{eq:opt_simple} for the approach without PCA, we should set $T_s$ to the highest value that does not break the limitation on the delay quantile. The maximal $T_s$ is found as a solution of the equation: \begin{equation} Q_{simple}(T_s) = D_{max}. \end{equation} For PCA, we also maximize $T_s$. At the same time, if we increase $T_b$, we decrease the delay quantile, but increase the channel time consumed by the RTA transmission. To solve the optimization task, we fix the maximal possible $T_s$ value and find the minimal $T_b$ which satisfies the delay constraint: $ Q_{PCA}(T_b) = D_{max}. $ \section{Numerical Results} \label{sec:numerical} We model a Wi-Fi network described in Section~\ref{sec:problem} with a simulation and the developed analytical model. The modeling parameters are listed in Table~\ref{tab:param}. We consider that all STAs use the modulation and coding scheme MCS0. Fig.~\ref{fig:plots} shows the dependency of the delay quantile $Q$ on the TXOP limit and the dependency of the average efficiency of channel usage $E$ on the RTA frame period $T_{period}$. The numerical results are obtained with simulation and analytical model for several values of $\sigma$ and maximal delay $D_{max}$. \begin{figure}[t] \centering \begin{subfigure}{\linewidth} \includegraphics[width=\textwidth]{legend} \end{subfigure} \begin{subfigure}{0.49\linewidth} \includegraphics[width=\textwidth]{Q_sigma=01ms_delay=1ms} \caption{\label{fig:Q_s1_d1}$\sigma=\SI{0.1}{\ms}$, $D_{max}=\SI{1}{\ms}$} \end{subfigure} \begin{subfigure}{0.49\linewidth} \includegraphics[width=\textwidth]{E_sigma=01ms_delay=1ms} \caption{\label{fig:E_s1_d1}$\sigma=\SI{0.1}{\ms}$, $D_{max}=\SI{1}{\ms}$} \end{subfigure} \begin{subfigure}{0.49\linewidth} \includegraphics[width=\textwidth]{Q_sigma=01ms_delay=3ms} \caption{\label{fig:Q_s1_d3}$\sigma=\SI{0.1}{\ms}$, $D_{max}=\SI{3}{\ms}$} \end{subfigure} \begin{subfigure}{0.49\linewidth} \includegraphics[width=\textwidth]{E_sigma=01ms_delay=3ms} \caption{\label{fig:E_s1_d3}$\sigma=\SI{0.1}{\ms}$, $D_{max}=\SI{3}{\ms}$} \end{subfigure} \begin{subfigure}{0.49\linewidth} \includegraphics[width=\textwidth]{Q_sigma=05ms_delay=3ms} \caption{\label{fig:Q_s5_d3}$\sigma=\SI{0.5}{\ms}$, $D_{max}=\SI{3}{\ms}$} \end{subfigure} \begin{subfigure}{0.49\linewidth} \includegraphics[width=\textwidth]{E_sigma=05ms_delay=3ms} \caption{\label{fig:E_s5_d3}$\sigma=\SI{0.5}{\ms}$, $D_{max}=\SI{3}{\ms}$} \end{subfigure} \begin{subfigure}{0.49\linewidth} \includegraphics[width=\textwidth]{Q_sigma=05ms_delay=5ms} \caption{\label{fig:Q_s5_d5}$\sigma=\SI{0.5}{\ms}$, $D_{max}=\SI{5}{\ms}$} \end{subfigure} \begin{subfigure}{0.49\linewidth} \includegraphics[width=\textwidth]{E_sigma=05ms_delay=5ms} \caption{\label{fig:E_s5_d5}$\sigma=\SI{0.5}{\ms}$, $D_{max}=\SI{5}{\ms}$} \end{subfigure} \caption{\label{fig:plots}Dependency of delay quantile on TXOP limit and dependency of the channel usage efficiency on $T_{period}$} \end{figure} For the reservation approach, we set the TXOP limit to \SI{5}{\ms} to achieve a high channel usage efficiency. As shown in Fig.~\ref{fig:plots}, the delay quantile does not exceed $D_{max}$ for smaller TXOP limit. Such a result is caused by the fact that the corresponding optimal $T_b$ value is found as $T_b = TXOP~limit - const$, where $const$ is optimized according to $\sigma$ and $D_{max}$. \begin{table}[t] \caption{Modeling Parameters}\label{tab:param} \begin{center} \begin{tabular}{c|c||c|c} \hline \textbf{Parameter} & \textbf{Value} & \textbf{Parameter} & \textbf{Value} \\ \hline $T_e$ & \SI{9}{\us} & $SIFS$ & \SI{16}{\us} \\ \hline $T_{SR}$ & \SI{191.2}{\us} & $T_{header}$ & \SI{40}{\us} \\ \hline $AckTimeout$ & \SI{53}{\us} & $PLR_{QoS}$ & $10^{-5}$ \\ \hline $AIFSN$ & 4 & $CW_{RTA} = \Delta_{AC}$ & 2 \\ \hline $CW_{min}$ & 16 & $CW_{max}$ & 1024 \\ \hline $RL$ & 7 & $N$ & 10 \\ \hline \end{tabular} \end{center} \end{table} From Fig.~\ref{fig:plots}, we see that for a very small RTA frame generation period, decreasing TXOP limit yields better channel usage than PCA while providing the required delay quantile. PCA becomes more efficient for the RTA frame periodicity above $T^{*}_{period}$, which can be found by solving the equation \begin{equation} E_{simple}(T^{*}_{period}) = E_{reserve}(T^{*}_{period}). \end{equation} Fig.~\ref{fig:E_s1_d1} and Fig.~\ref{fig:E_s1_d3} show that if we increase the maximal delay from \SI{1}{\ms} to \SI{3}{\ms}, the $T^{*}_{period}$ also grows from \SI{6}{\ms} to \SI{12.5}{\ms}. At the same time, according Fig.~\ref{fig:E_s1_d3} and Fig.~\ref{fig:E_s5_d3}, the increase in the standard deviation of RTA frame arrival time from \SI{0.1}{\ms} to \SI{0.5}{\ms} also increases the $T^{*}_{period}$ to \SI{28}{\ms}. Thus the range of RTA periodicity for which PCA is better decreases with the growth of $\sigma$ and $D_{max}$. The maximal gain in the channel usage efficiency also depends on $\sigma$ and $D_{max}$. For $\sigma=\SI{0.1}{\ms}$ and $D_{max}=\SI{1}{\ms}$ (Fig.~\ref{fig:E_s1_d1}) the gain is almost $60\%$. If we increase $D_{max}$ to \SI{3}{\ms} (Fig.~\ref{fig:E_s1_d3}), the gain drops to $\approx 6\%$, because for high $D_{max}$, the TXOP limit that can provide the necessary delay quantile becomes almost the same for the studied approaches. Also, if we increase $\sigma$ to \SI{0.5}{\ms} (Fig.~\ref{fig:E_s5_d3}), the gain drops almost to $5\%$, because we need to occupy the channel for a longer time to compensate the high variance of RTA frame arrival time. For a high delay budget: $D_{max}=\SI{5}{\ms}$ (Fig.~\ref{fig:Q_s5_d5}), there is no need to decrease the TXOP limit. As a result, the TXOP limit for two approaches becomes almost the same, and PCA does not provide better channel usage efficiency even for $T_{period}=\SI{100}{\ms}$ (Fig.~\ref{fig:E_s5_d5}). To sum up, PCA is more efficient when very low delay is required or when the RTA frame periodicity is below a specific value. The increase in the RTA frame arrival time variance reduces the gain from PCA and decreases the range of RTA frame periodicity for which this approach is profitable. \section{Conclusion}\label{sec:outro} We have studied two simple yet easy-to-implement approaches for RTA QoS provision. Both approaches rely on special EDCA parameters for the RTA traffic to allow the RTA frames to be served without the contention with non-RTA traffic. The first approach is to decrease the TXOP limit for non-RTA traffic so that the RTA traffic does not have to wait too long for the end of non-RTA transmissions. The second approach is based on PCA with RTS/CTS. To enable this approach, the 802.11be amendment shall allow a STA to generate an RTS without a present data frame. We have developed mathematical models of both approaches that can be used to find the optimal configuration of these approaches. We use the developed models to find the gain in channel usage efficiency from PCA and the RTA frame periodicity for which it is profitable to use this method. We have found out that for RTA traffic with not too strict delay requirements or with very high intensity, it is better to decrease the TXOP limit, while PCA is better for strict delay limitations or not too frequent traffic. At the same time, the high variance of RTA frame arrival time can decrease the efficiency of PCA. In our future research, we plan to evaluate the efficiency of the considered approaches in scenarios with several RTA STAs and with overlapping BSSs. \bibliographystyle{IEEEtran}
\section{Introduction} \label{sec:intro} Our understanding of vertical structure in the Milky Way has drastically evolved over the past decade. Discussions of the disk have traditionally been centered around equilibrium axisymmetric models --- planar and fully phase-mixed vertically and with simple periodic perturbations in azimuth. The emerging field of galactoseismology is shifting that focus towards the mild, but significant departures from equilibrium that are increasingly evident in observations. Vertical asymmetries were first pointed out in three distinct data sets by \citet{widrow2012discovery, carlin2013}, and \citet{ williams2013}. \cite{widrow2012discovery} found North-South asymmetry in SDSS DR-8 \citep{Aihara_sdss_dr8_2011} and SEGUE \citep{Yanny_segue_2009}. \cite{carlin2013} used PPMXL \citep{roeser2010ppmxl} and LAMOST \citep{cui2012lamost, zhao2012lamost} to conclude that stars above and below the midplane exhibit opposite radial motion. \citet{williams2013} found similar asymmetry around the solar neighborhood in RAVE \citep{steinmetz2006rave}. These local asymmetries in disk motions were shown to be matched by vertical asymmetries of the disk in space, which were traced to several kpc beyond the Sun by \citet{xu2015}. Coincidentally, \citet{price_whelan2015} were finding evidence that structures tens of degrees from the plane and at Galactocentric radii of 15-30 kpc, well beyond the traditional limits of the disk \citep[see][for discovery papers]{Newberg02} nevertheless had velocity trends and stellar population properties consistent with disk membership \citep[see also subsequent work that confirms this interpretation][]{Sheffield18,Li17,Bergemann18}. These discoveries suggested the local corrugations of the disk were likely part of a global pattern of bending and breathing modes, as first pointed out by \cite{widrow_barber2014,gomez2013}. Simulations of LMC and Sgr-like satellites interacting with a Milky-Way-scale galaxy could reproduce the scales of these perturbations, both locally and globally, supporting the plausibility of this interpretation of local and global-scale asymmetries being associated \citep{laporte2018b, laporte2018a}. The reach and high-dimensionality of the \textit{Gaia}\ data sets \citep{gaia_dr1_2016, gaia_dr2_2018,gaia_edr3_2020} allowed clear confirmation of what these earlier studies were hinting at --- the existence of global-scale, vertical ripples coursing through our Galactic disk \citep{gaia_dr2_disk_paper}. For the first time, \textit{Gaia}\ DR-2 enabled the local vertical asymmetries in position and velocity to be dramatically visualized as a clear $z$--$v_z$\ phase-spiral\footnote{\footnotesize{ We refer to the spiral structures as `snails' occasionally. Terms most commonly used for the spirals in a \textit{local} volume are `$z$--$v_z$\ spiral', `phase-space spiral', or `phase-spiral.' We will mostly use the term `phase-spiral.' Spirals that form \textit{globally} across the $x$--$y$\ plane of the disk are referred to as `$R$--$\phi$\ spirals' or `physical spirals' in this work.} } \citep{antoja2018}. The richness of the data have inspired analysis and comparison to simulations on both global \citep[e.g. see projections and visualizations in][]{schonrich_dehnen2018,kawata2018,Salomon2020,poggio2018a,poggio2018b,laporte2019footprints,poggio2020,Eilers+20,FS19} and local \citep{antoja2018,binney_schonrich2018,darling_widrow2019,laporte2019footprints,bland-hawthorn2019,li2020} scales. In particular, simulations of a Sgr-like satellite impacting a MW-like disk that were developed to fit the pre-\textit{Gaia}\ data were shown to contain analogous manifestation of both the local and global signatures of vertical disequilibrium with similar spatial and velocity scales \citep{laporte2019footprints}. Other works have reinforced these local-global connections with further views of the data, tailored simulations and analytic models \citep{xu_liu_tian2020,bland-hawthorn_tepper-garcia2020,widrow_darling_li2020,bennett_bovy2021}. While the impact of a satellite provides a natural explanation for the origin of oscillations perpendicular to the Galactic Plane, it is not the only one. Any vertical perturbation, such as bar buckling \citep{khoperskov2019}, can plausibly do the same \citep[although stellar ages of the phase-spiral suggest this is not the origin in the Milky Way, see][]{laporte2019footprints} . Moreover, once bending motions are excited in the disk, self-gravity can launch further disturbances \citep{darling_widrow2019,bland-hawthorn_tepper-garcia2020}. Luckily, the combination of local and global responses should provide multiple constraints on the origin of specific features. The coupled evolution of these spirals is largely driven by the simple process known as {\it phase-mixing} \citep[see][for some limitations of this interpretation]{darling_widrow2019}. Phase mixing can occur when stars which are initially at \textit{random} orbital phases are systematically offset by a perturbation to then be at the \textit{same} orbital phase. If these stars have a range of orbital properties (e.g. frequencies) they will subsequently spread along the orbit and {\it mix} in orbital phase. Figure~\ref{fig:freqs_and_time_periods} shows the different orbital frequencies as a function of guiding radius, $R_g$ (a proxy for distance from the Galactic center; see \S\ref{subsec: dissect-snail} for definition). In the disk $x$--$y$\ plane phase-mixing is driven by the $R_g$-dependence of azimuthal frequencies, $\Omega_\phi$, while in the $z$--$v_z$-plane, phase-mixing is driven by the range in vertical frequencies, $\Omega_z$, at any fixed $R_g$ (see Figure~\ref{fig:freqs_and_time_periods}b). Phase-mixing can lead to a well-defined spiral for some time, but ultimately this spiral will wind up to the extent that the population once again appears to have randomly distributed phases. Conceptually, rewinding and interpreting the $z$--$v_z$\ and $R$--$\phi$\ spirals \textit{simultaneously} should give us insight into the timing, strength and location of the perturbation that caused them, adding clarity to our understanding of the nature of that perturbation as well as the properties of orbits across the Galactic disk. This paper explores the feasibility of this ultimate goal. Our study uses both test particle and N-body simulations (described in \S 2) to explore how multiple signatures can be traced back to offer multiple views of a single event (described in \S 3). The results are used in a first application of the ongoing interaction between Sgr and the MW (described in \S 4) and future prospects are discussed in \S 5. \section{Simulations \& Data} \label{sec: simulations} In this section we describe the simulations and data that we analyze in subsequent sections. Although this paper is based on \textit{Gaia}\ eDR-3 data, we interpret those data in terms of simple simulations. After presenting relevant observations in \textit{Gaia}\ data, we primarily use test particle simulations which allow us to fully control the orbit of the satellite and the galactic potential. These are described in \S\ref{subsec: tp sim description}. We also show that our results are robust in the presence of self gravity by including a comparison to a self-consistent simulation (in \S\ref{sec: results-III_ongoing_interaction}), and the self-consistent model is described in \S\ref{subsec: bonsai sim description}. All the simulated MW-like disks that we use in this work generically exhibit orbital properties illustrated in Figure~\ref{fig:freqs_and_time_periods}. Figure~\ref{fig:freqs_and_time_periods}a shows how $\phi$-rotation frequency $\Omega_\phi$, vertical epicyclic frequency $\Omega_z$, and radial epicyclic frequency $\Omega_R$ vary with guiding radius, \ensuremath{R_g}\ (a proxy for distance from the Galactic center; see \S\ref{subsec: dissect-snail} for definition), in an unperturbed simulated disk with stars on near-circular orbits. \begin{figure} \centering \includegraphics[width=\textwidth]{figures/Figure01_freqs_vs_jphi.png} \caption{\textbf{(a)} Best-fit curves for epicyclic oscillation frequencies expressed as $\Omega/2\pi$(Gyr$^{-1}$) for simulated stars in an unperturbed disk in the $z$, $R$, and $\phi$ directions as a function of \ensuremath{R_g}=\ensuremath{J_\phi/v_0}. The $\Omega(\ensuremath{R_g})$ curves in this figure are fit to near-circular orbits, i.e., for which $\sqrt{J_R^2 + J_z^2}/J_\phi \ll 1$, where $J_R$ and $J_z$ are orbital actions in the \ensuremath{R}\ and $z$ directions respectively. \textbf{(b)} A 2D histogram showing the spread in $\Omega_z$ as a function of \ensuremath{R_g}\, not restricted to near-circular orbits anymore. The solid orange curve in this panel (different from the orange curve in panel (a)) is the median $\Omega_z$, and the dashed curves mark the $1\sigma$ dispersion about the median. The spread in $\Omega_z$ \textit{at a particular} \ensuremath{R_g}\ value, $R_{g\star}$, is what causes a phase-spiral to develop in the $z$-$v_z$ plane. Stars at the head of a $z$--$v_z$~spiral have high $\Omega_z(R_{g\star})$, whereas stars in the spiral tail have lower $\Omega_z(R_{g\star})$. The \textit{variation of $\Omega_z$\ with} \ensuremath{R_g}\ is what causes \textit{multiple} spiral morphologies to develop once the disk is perturbed.} \label{fig:freqs_and_time_periods} \end{figure} \subsection{Test Particle Simulations}\label{subsec: tp sim description} The test particle models are constructed and evolved as described in \citet{hunt2019signatures}, using the galactic dynamics library \texttt{galpy} \citep{Bovy2015}. The initial condition for the disc of massless particles is sampled from \texttt{galpy's}~\texttt{3D quasiisothermaldf}~ distribution function \citep[adapted from][]{binney2010}. The distribution function has an initial scale radius $R_s=R_0/3$, local radial velocity dispersion $\sigma_{v_R}= 0.15v_c(R_0)$, and local vertical velocity dispersion $\sigma_{v_z}=0.075v_c(R_0)$, where $R_0 = 8$ kpc and $v_c(R_0) = 220$ km s$^{-1}$. We evolve the disk in \texttt{galpy's} \texttt{MWPotential2014}\ for 7 Gyr allowing it to reach equilibrium. We present three test particle models with varying parameters for the satellite galaxy as summarised in Table \ref{TPparam}. In each model, the satellite galaxy is created with \texttt{galpy's}~\texttt{PlummerPotential}~as a Plummer sphere of mass $M_{sat}$ and scale parameter of 0.8. We calculate the orbit of the satellite by evolving its `present day' coordinates backwards in \texttt{MWPotential2014}~while using the \texttt{ChandrasekharDynamicalFrictionForce} routine to take into account dynamical friction. The satellite potential then follows this orbit forward in time with \texttt{MovingObjectPotential}. The three models differ in: (i) values of $M_{sat}$, (ii) initial phase-space coordinates for the satellite, (iii) time since present day for which the disk is evolved, and (iv) number of test particles in the disk. We do not include a bar or spiral arms in the model potentials, such that the satellite galaxy is the only perturbing influence on the disk. \hyperref[tab:I]{Model A} consists of a 200 million particle disk interacting with a satellite of mass $M_{sat}$$=2\times 10^{10}\ensuremath{M_\odot}$ initialized with Sagittarius-like phase-space coordinates from Simbad\footnote{http://simbad.u-strasbg.fr/simbad/sim-id?Ident=sdg} \citep{simbad, simbad_coords2004,simbad_pm1997,simbad_rv2012} using \texttt{galpy's}\ \texttt{orbit.from\_name} routine. We use this model in \S\ref{subsec: tracing_back_spirals}. Although the satellite is the sole perturber to the disk, our conclusions about vertical disequilibrium signatures in \S\ref{subsec: results_I_conc} will apply broadly to generic perturbations (e.g. bar buckling, spiral arms, etc). The mass of the satellite is chosen to be heavier than the remnant mass of Sagittarius \citep[e.g.][]{Vasiliev2020} in order to generate a strong response, and it is held constant throughout to simplify our model. \hyperref[tab:I]{Models B} and \hyperref[tab:I]{C} are used in \S\ref{subsec: current_interaction_sim_prediction}, and consist of a 1 billion test particle disk. The orbit of the satellite in both models is initialized with Sagittarius' present day phase-space coordinates which we set to be $(x, y, z) = (17.5,\ 2.5,\ -6.5)$ kpc, and $(v_x, v_y, v_z)=\ 237.9,\ -24.3,\ 209.0$) km s$^{-1}$, following \cite{Vasiliev2020}. Model B has a satellite of mass $M_{sat}$$=3\times 10^{9}\ensuremath{M_\odot}$ and the disk has evolved under the influence of the satellite for 150 Myr (ending at the present day), such that the disk experiences only the final passage of Sagittarius. Model C has $M_{sat}$$=10^{10}\ensuremath{M_\odot}$ and the disk has been evolved for 4 Gyr (ending at the present day). \begin{center} \begin{table}[h] \label{tab:I} \caption{The different models used for test particle simulations (see \S\ref{subsec: tp sim description} for discussion)} \begin{tabular}{ c|ccc } \toprule & \textbf{Model A}& \textbf{Model B} & \textbf{Model C} \\ \hline $M_{sat}$ & $2\times 10^{10}\ensuremath{M_\odot}$ & $3\times 10^{9}\ensuremath{M_\odot}$ & $10^{10}\ensuremath{M_\odot}$ \\ Satellite ICs & Simbad & \cite{Vasiliev2020} & \cite{Vasiliev2020} \\ \#disk stars & 2$\tenexp8$ & $10^9$ & $10^9$ \\ Disk evolution over the past & 4 Gyr & 150 Myr & 4 Gyr \\ used in \S&\ref{subsec: tracing_back_spirals} & \ref{subsec: current_interaction_sim_prediction} & \ref{subsec: current_interaction_sim_prediction} \\ \hline \end{tabular} \label{TPparam} \end{table} \end{center} \subsection{Self-Consistent Simulations}\label{subsec: bonsai sim description} We also present a self-consistent model for a qualitative comparison to the test particle Models B \& C in \S\ref{subsec: current_interaction_sim_prediction}. The initial conditions are generated using \texttt{galactics} \citep{kuijken1995}, using the parameters of Model MWb from Table 2 of \cite{widrow2005} which result in a disk which remains stable against bar formation over a period of several Gyr \citep[see][for a thorough analysis of the isolated MW-like disk galaxy]{widrow2005}. The model contains $\sim1.12\times10^9$ self gravitating particles, of which $\sim2.2\times10^8$ are in the disk, $\sim2.2\times10^7$ are in the bulge and $\sim8.8\times10^8$ are in the dark halo. The initial conditions for the satellite are the same as those for Sagittarius in the L2 model of \citet{laporte2018a}, which is composed of two Hernquist spheres \citep{H90}. The first represents the dark matter with $M_{200}=6\times10^{10}$ M$_{\odot}$, $c_{200}=28$, $M_h=8\times10^{10}$ M$_{\odot}$ and $a_h=8$ kpc, and the second the stellar component with $M_*=6.4\times10^8$ M$_{\odot}$ and $a_h=0.85$ kpc. The combined model is evolved using the \texttt{Bonsai} $N$-body tree code \citep{bedorf2012bonsai} for 8.3 Gyr with a smoothing length of 50 pc and an opening angle $\theta_0=0.4$ radians. The ``present day" snapshot in Figure~\ref{fig:xy_current_interaction_present_day_different_models}c is chosen based on when the satellite is closest to the current coordinates of Sagittarius~\citep{Vasiliev2020} with respect to the Sun, which happens to be at $t=6.88$ Gyr. The model will be released alongside a more detailed analysis in \cite{hunt2021}. \subsection{Data} We select stars from \textit{Gaia}\ eDR-3 for which 6-D phase space information (parallax, line-of-sight velocity, sky positions, and proper motions) is available. Following \cite{antoja2018}, we require that parallax $\omega$ be positive, and that parallax error $\sigma_\omega$ be less than 20\% ($\sigma_\omega/\omega < 0.2$). We use parallax as a proxy for distance ($d=1/\omega)$, and we limit our sample to stars within $7\leq R$(kpc)$\leq 9$. This selection contains $\sim4.6$ million stars. \section{Results I: Spirals Across Local and Global Scales} \label{sec: results-I} Our aim is to explore the origin and evolution of $z$--$v_z$\ spirals and understand how these local features relate to the macroscopic vertical ripples in the disk $x$--$y$\ plane. There are three factors to consider in the response to a disk perturbation: \textbf{(i)} phase-mixing around the disk in $x$--$y$\ following the perturbation creating $R$--$\phi$\ spirals (\S \ref{subsubsec: x-y phase mixing}), \textbf{(ii)} phase-mixing in $z$--$v_z$\ following the perturbation to form phase-spirals (\S \ref{subsubsec:z-vz phase mixing}), and \textbf{(iii)} the self-consistent disk response causing additional effects. We make the deliberate choice to focus on the combination of the first two phenomena --- phase-mixing across dimensions --- and defer the addition of the third to future work \citep[see][for some cautionary notes on the limitations of our work]{darling_widrow2019}. In the test particle simulations, the only perturbation which can cause the onset of spirals is the satellite galaxy crossing the disk. This allows us to isolate the time and spatial scales of phase-mixing without the confusion of multiple sources of perturbations. Hence, our conclusions will apply to phase-mixing following any generic vertical perturbation to the disk, but we are missing the effect of self-gravity which can complicate the picture. We dissect a local sample of \textit{Gaia}\ data and an analogous one in the test particle simulations and uncover multiple phase-spirals within each selection (\S \ref{subsec: dissect-snail}). We explore the global context of these phase-spirals in two ways-- first by following their evolution backwards through time in the test particle simulations (\S \ref{subsec: tracing_back_spirals}) to understand when and where they were excited, and subsequently by building a toy model to illustrate the spatial and time-scales of the interaction that excited them (\S \ref{subsec: toy_model}). We put together our findings in a combined picture of phase- and physical spirals in \S \ref{subsec: results_I_conc}. \begin{figure} \centering \includegraphics[width=\textwidth]{figures/Figure02_w_log_density_panel.png} \caption{\textbf{(a)} The phase-space spiral as seen in the \ensuremath{z}-\ensuremath{v_z}\ plane with data from \textit{Gaia}\ eDR-3. We select $\sim4.6$ million stars within $7<$\ensuremath{R}(kpc)$<9$ with parallax error $\sigma_\omega<20\%$. $v_z$ and $z$ have been rescaled by their respective dispersions, $(\sigma_{v_z},\sigma_z) = (25$ km$s^{-1}$,$0.37$ kpc). The color represents the log number density. \textbf{(b)} Same as panel (a) except the color shows the filtered number density of \textit{Gaia}\ eDR-3 stars, $\Delta\equiv (\rho-\overline{\rho})/\overline\rho$. Note that $\Delta$ is used specifically to highlight the spiral morphology, and it makes the spiral appear as a stream-like structure in phase-space. However, panel (a) is a more accurate representation of how the stars are actually distributed. \textbf{(c)} A histogram of \ensuremath{R}\ and $R_g\ (\approx J_\phi/220$ km$s^{-1}$) in our \textit{Gaia}\ eDR-3 selection demonstrates that the \ensuremath{R}-limited sample spans a much wider range in \ensuremath{R_g}.} \label{fig:gaia_all_data} \end{figure} \subsection{Dissecting One Phase-Spiral into Multiple} \label{subsec: dissect-snail} Figure~\ref{fig:gaia_all_data}a shows the $z$--$v_z$-plane for \textit{Gaia}\ eDR-3 stars in the solar neighborhood, colored by the log number density. A phase-space spiral is visible in this local sample. Figure~\ref{fig:gaia_all_data}b is the same as Figure~\ref{fig:gaia_all_data}a, except the color bar represents the fractional overdensity relative to the mean number density ($\overline{\rho}$) at each pixel, $\Delta\equiv (\rho-\overline{\rho})/\overline{\rho}$ \citep[following][]{laporte2019footprints}. We can dissect this sample further by exploiting the fact that stars which end up within the solar neighborhood today did not always travel together within the same enclosed volume. \cite{hunt2020} demonstrated how grouping stars around the disk by azimuthal action $J_\phi$ (equivalent to the $z$ component of the angular momentum $L_z$ in an axisymmetric potential) rather than radius \ensuremath{R}\ more clearly separates them into sets that have shared histories. (For global disk samples, further grouping by the angle, $\theta_\phi$ conjugate to $J_\phi$, rather than physical angle $\phi$ can add further clarity to this separation.) The orbits of stars with similar $J_\phi$ can be characterized by epicyclic oscillations around the same guiding radius, $R_g$, and are hence associated in space. Moreover, since they have the similar $R_g$, they also have similar azimuthal periods, and hence remain associated over time. The guiding radius of a star is calculated by solving $R_g=J_\phi/v_c(R)$, where $v_c($\ensuremath{R}) is the circular velocity as a function of \ensuremath{R}. Throughout the paper, we assume a perfectly flat rotation curve with $v_c(R)\equiv v_0 = 220$ km$s^{-1}$, and estimate $R_g \approx$ \ensuremath{J_\phi/v_0}. This approximation of a constant $v_0=220$ km$s^{-1}$ has been made for simplicity, and therefore the \ensuremath{R_g}\ values used in our work will not be exact. However, none of our results will be affected by this assumption. Figure~\ref{fig:gaia_all_data}c is a histogram of \ensuremath{R}~(orange) and \ensuremath{R_g}\ (navy blue, filled) of the selected \textit{Gaia}\ eDR-3 stars and clearly illustrates that although the local sample is limited by physical distance from the Sun, \ensuremath{R_g}\ allows us to probe a much wider radial range across the disk ($\sim$0--15 kpc, in this case). \begin{figure} \centering \subfloat[\textbf{Top panel:} $z$--$v_z$\ data of the local volume of stars taken from \textit{Gaia}\ eDR-3 ($7<R$(kpc)$<9$, same as Figure~\ref{fig:gaia_all_data}b). \textbf{Bottom row:} \textit{Gaia}\ eDR-3 stars in the top panel now split into 5 \ensuremath{R_g}\ groups ranging $4<$ \ensuremath{R_g} (kpc)$< 12$. In all panels, we have rescaled \ensuremath{z}\ and \ensuremath{v_z}\ by the respective dispersions $(\sigma_{v_z},\sigma_z)= (25$ km$s^{-1}$, $0.37 $kpc) to adjust the aspect ratio of the spirals. It becomes clear that a \ensuremath{R_g}\ categorization resolves distinct phase spirals (each panel in the bottom row shows a different spiral morphology) which otherwise get averaged out in the \ensuremath{R}\ selection (top panel).]{% \includegraphics[width=\textwidth]{figures/Figure03a_gaia_data_z-vz_spirals_5jphi_groups.png}% \label{fig:gaia-jphi-covers-more}% }\qquad \subfloat[\textbf{Top panel:} $z$--$v_z$\ data of a local sample of stars ($6<R$(kpc)$<8$) in Model A of our test particle simulation. \textbf{Bottom row:} Simulated stars in the top panel now split into 5 \ensuremath{R_g}\ groups ranging 3 kpc$< \ensuremath{R_g} < 11$ kpc. In all panels, we have rescaled \ensuremath{z}\ and \ensuremath{v_z}\ by the respective dispersions $(\sigma_{v_z},\sigma_z)= (27.6$ km$s^{-1}$, 0.36 kpc) to adjust the aspect ratio of the spirals. Once again, as is the case with the \textit{Gaia}\ phase-spiral, $\ensuremath{R_g}$ categorization (bottom row) resolves distinct phase spirals which are averaged out in the test particle simulation \ensuremath{R}\ selection (top panel). Colors outlining the \ensuremath{R_g}\ ranges specified in each panel (cyan, green, purple, magenta, red) and lower-case roman numerals (\textbf{(i)}--\textbf{(v)}) are identifiers used in figures throughout \S\ref{sec: results-I} to refer to the various \ensuremath{R_g}\ groups.]{% \includegraphics[width=\textwidth]{figures/Figure03b_sim_z-vz_spirals_5jphi_groups.png}% \label{fig:sim-jphi-covers-more}% } \caption{}\label{fig:jphi-covers-more} \end{figure} In the top panel of Figure~\ref{fig:gaia-jphi-covers-more}, we repeat the same $z$--$v_z$\ visualization of \textit{Gaia}\ data as Figure~\ref{fig:gaia_all_data}b, and split this sample into five \ensuremath{R_g}\ ranges in the bottom panels, between 4--6 kpc, 6--7 kpc, 7--9 kpc, 9--10 kpc, and 10--12 kpc. The vertical velocities and positions in each panel are scaled by their respective dispersions to adjust the aspect ratio of the phase spiral. We see from the bottom panels that \textit{distinct morphologies} of the spiral exist at different \ensuremath{R_g}~\textit{within the local sample} \citep[see also][]{li2020}. To perform an analogous split in test particle simulations, we select a 30$^\circ$ azimuthal wedge in the disk between $6<$\ensuremath{R}(kpc)$<8$ at a time chosen simply by virtue of the fact that it exhibits phase spirals with similar wrapping ($\lesssim2$ wraps), and significant variation across \ensuremath{R_g}, like in Figure~\ref{fig:gaia-jphi-covers-more}. This time happens to be $\sim$180 Myr after the second passage of the satellite galaxy through the disk, and we will refer to this as the ``sample" time. Figure~\ref{fig:sim-jphi-covers-more} shows rescaled $z$--$v_z$\ for simulated stars within the specified local volume in the top panel, and the bottom panels show rescaled $z$--$v_z$\ data for the \ensuremath{R}-limited simulation sample split into five \ensuremath{R_g}\ bins, between \textbf{(i)} 3--5 kpc, \textbf{(ii)} 5--6 kpc, \textbf{(iii)} 6--8 kpc, \textbf{(iv)} 8--9 kpc, and \textbf{(v)} 9--11 kpc. We use these five \ensuremath{R_g}\ bins throughout the remainder of \S\ref{sec: results-I}. As with the \textit{Gaia}\ data, each \ensuremath{R_g} bin in the test particle simulation also reveals a different phase-spiral morphology, which otherwise gets obscured in the $6<$\ensuremath{R}(kpc)$<8$ categorization. \subsection{Tracing the Evolution of the $R$--$\phi$ and $z$--$v_z$\ Spirals by Rewinding the Test Particle Simulations}\label{subsec: tracing_back_spirals} The fact that the morphology of the $z$--$v_z$\ phase spiral within the local volume depends on guiding radius raises the prospect of using this variation to study Galactic history. In order to explore the utility of the varied morphologies, we track particles in the five \ensuremath{R_g}\ bins introduced in Figure~\ref{fig:sim-jphi-covers-more} backwards over time. We analyze their projections first in the $x$--$y$\ plane (forming $R$--$\phi$\ spirals), and then in $z$--$v_z$\ (forming phase-spirals). \subsubsection{Physical Spirals: Global Phase-mixing in $R-\phi$} \label{subsubsec: x-y phase mixing} \begin{figure} \centering \includegraphics[width = \textwidth]{figures/Figure04_sim_x-y_plane_5snapshots.png} \caption{The 5 simulated \ensuremath{R_g}\ groups (shown in Figure \ref{fig:sim-jphi-covers-more}) are represented here by contours enclosing 50\% of the stars in each \ensuremath{R_g}\ bin, overplotted on the disk $x$--$y$ plane colored by $v_z$. Each panel shows the positions and velocities of simulated stars at a different time around the time of ``impact", $t=\ensuremath{t_{\text{imp}}}$ (i.e., the time when the satellite crosses the disk midplane). \textbf{(a)} The $x$--$y$\ plane 184 Myr before \ensuremath{t_{\text{imp}}}\ shows how different \ensuremath{R_g}\ groups are spread out across the disk. \textbf{(b)} 40 Myr before impact. \textbf{(c)} at the time of impact, $t=\ensuremath{t_{\text{imp}}}$. \textbf{(d)} 40 Myr after the impact. \textbf{(e)} The ``sample" snapshot, 184Myr after the impact when all 5 \ensuremath{R_g} groups merge into a local volume at $\phi\approx-170^\circ$. This figure makes the point that two physical spirals can be identified extending across the disk---one that winds up as we go forward in time, highlighted by the \ensuremath{v_z}\ color in panels \ref{fig:5-jphi-groups-xy-plane-at-5-snaps}(c--e), and another that winds up as we go backward in time, traced by the various simulated \ensuremath{R_g}\ groups progressing from panel \ref{fig:5-jphi-groups-xy-plane-at-5-snaps}d back through \ref{fig:5-jphi-groups-xy-plane-at-5-snaps}a. The time intervals between the panels were chosen to be non-uniform (although symmetric about $t-\ensuremath{t_{\text{imp}}} = 0$) so that the we can visualize the disk response long before/after the impact ($t-\ensuremath{t_{\text{imp}}} = \pm 184$ Myr), as well as when the satellite is close to the disk ($t-\ensuremath{t_{\text{imp}}} = \pm 40$ Myr). } \label{fig:5-jphi-groups-xy-plane-at-5-snaps} \end{figure} Figure~\ref{fig:5-jphi-groups-xy-plane-at-5-snaps} illustrates the evolution of two types of $R$--$\phi$ spirals, one that winds up as we go forward in time, and another that winds up as we go back in time. The figure shows snapshots starting at 184 Myr prior to the disk passage (panel \ref{fig:5-jphi-groups-xy-plane-at-5-snaps}a), through the time of the satellite impact, \ensuremath{t_{\text{imp}}}~ (panel \ref{fig:5-jphi-groups-xy-plane-at-5-snaps}c), to the sample time 184 Myr after the disk passage (panel \ref{fig:5-jphi-groups-xy-plane-at-5-snaps}e). The first $R$--$\phi$\ spiral is traced by the color across the face of the disk, which represents the mean \ensuremath{v_z}\ of all the particles. The influence of the satellite from under the disk pulling the particles downwards (blue color, $\ensuremath{v_z}<0$) and subsequently upward after crossing the midplane (red color, $\ensuremath{v_z}>0$) can be seen in the three middle panels (\ref{fig:5-jphi-groups-xy-plane-at-5-snaps}b--d). The global response eventually winds up (i.e. phase-mixes) into a clear spiral across the $x$--$y$\ plane by the ``sample" time. Note that this simple description of the satellite's impact followed by phase-mixing misses the additional effect present in reality and in the test particle simulation, that the disk particles are also oscillating vertically. We will return to this in the next section. The colored contours projected onto each panel trace the evolution of the second $R$--$\phi$ spiral. Each contour encloses 50\% of the stellar population in one of the five \ensuremath{R_g}\ groups shown in Figure~\ref{fig:jphi-covers-more}b. In panel \ref{fig:5-jphi-groups-xy-plane-at-5-snaps}a, the five groups (starting from the lowest \ensuremath{R_g}\ group in cyan, increasing through green, purple, magenta, and red), trace a tightly-wound physical spiral. The variation in azimuthal frequencies (see $\Omega_\phi$(\ensuremath{R_g}) in Figure~\ref{fig:freqs_and_time_periods}a) causes this spiral to unwind in each of the subsequent panels until all the groups coincide at the ``sample" time in the rightmost panel. It is striking to see in panel \ref{fig:5-jphi-groups-xy-plane-at-5-snaps}c that at the time of disk-crossing ($t=t_{\text{imp}})$, the different groups are spread widely across the disk in azimuth and radius. We conclude that, because the now-local stellar population was spread across the disk in the past, the $z$--$v_z$\ spiral in each local \ensuremath{R_g}\ group contains distinct information about any past perturbation. We further point out that \textit{any} local volume in the disk will contain multiple phase-spirals, and the physical spiral in \ensuremath{v_z} across the $x$--$y$-plane is a signature of these multiple viewpoints averaged together. \subsubsection{Phase-Spirals: Local Phase-mixing in $z$--$v_z$} \label{subsubsec:z-vz phase mixing} \begin{figure} \centering \includegraphics[width=\textwidth]{figures/Figure05_test_sim_z-vz_spirals_and_asym_param_5jphi_groups.png} \caption{Each row \textbf{(a)}--\textbf{(e)} corresponds to a specific time relative to \ensuremath{t_{\text{imp}}} (indicated in the leftmost panels), with the same time intervals as between the panels of Figure~\ref{fig:5-jphi-groups-xy-plane-at-5-snaps}. The leftmost panel in each row shows the $z$--$v_z$\ asymmetry parameter, $A_{z,v_z}$$\equiv \sqrt{A_z^2+A_{v_z}^2}$ (explained in the discussion around eq(\ref{eq: asym_param})) as a function of \ensuremath{R_g}. The five plots to the right (\textbf{(i)}--\textbf{(v)}) in each row show the five simulated \ensuremath{R_g}\ groups (introduced in Figure~\ref{fig:sim-jphi-covers-more}) in the $z$--$v_z$ plane. The colored contours in the $z$--$v_z$\ panels enclose 50\% of the stellar population in each \ensuremath{R_g}\ group, and the $z$--$v_z$\ asymmetry $A_{z,v_z}$ of each group is marked by a dot of the corresponding color and lower case roman numeral in the leftmost panel. \textbf{(a)} $A_{z,v_z}$ and the simulated \ensuremath{R_g}\ groups at $t-$\ensuremath{t_{\text{imp}}}$=-184$ Myr. $A_{z,v_z}$\ is minimal at this time. Most of the stars in all groups are symmetrically distributed in $z$--$v_z$, as is evident from the 50\% contours being circles centered on $(v_z=0,z=0)$. This row corresponds to Figure~\ref{fig:5-jphi-groups-xy-plane-at-5-snaps}a. \textbf{(b)} At $t-\ensuremath{t_{\text{imp}}}=-40$ Myr (corresponding to Figure~\ref{fig:5-jphi-groups-xy-plane-at-5-snaps}b), $A_{z,v_z}$ begins to grow. The 50\% contours are slightly distorted due to the disk's response to the approaching satellite. \textbf{(c)} $t=\ensuremath{t_{\text{imp}}}$: $A_{z,v_z}$\ grows significantly for group \textbf{(v)} (red) as it is the one nearest to the location where the satellite crosses the disk (see Figure~\ref{fig:5-jphi-groups-xy-plane-at-5-snaps}c). \textbf{(d)} $t-$\ensuremath{t_{\text{imp}}}$=40$ Myr (corresponding to Figure~\ref{fig:5-jphi-groups-xy-plane-at-5-snaps}d). \textbf{(e)} $t-$\ensuremath{t_{\text{imp}}}$=184$ Myr, the ``sample" snapshot (corresponding to Figure~\ref{fig:5-jphi-groups-xy-plane-at-5-snaps}e). In rows \textbf{(c)}--\textbf{(e)}, it is apparent that spirals develop at different rates for each \ensuremath{R_g}\ group. The asymmetry parameter $A_{z,v_z}$ oscillates over time, and is an important indicator of the amplitude of the response, which peaks even before any $z$--$v_z$\ spirals appear. $A_{z,v_z}$\ does not reflect how developed (or wound-up) a $z$--$v_z$\ spiral is, but rather is a metric for asymmetric distribution of stars about $(v_z=0,z=0)$. Note that \ensuremath{z}\ and \ensuremath{v_z}\ for all \ensuremath{R_g}\ groups have been rescaled by the dispersions at $t-$\ensuremath{t_{\text{imp}}}$=-184$ Myr. These are given by $\sigma_z=\{0.41,0.44,0.46,0.51,0.56\}$ kpc and $\sigma_{v_z}=\{44.5,37.4,34.3,29.8,23.4\}$ km$s^{-1}$ for the five \ensuremath{R_g}\ groups respectively.}\label{fig:5-jphi-groups-zvz-plane-and-asym-param} \end{figure} Having tracked the $x$--$y$\ location of the five \ensuremath{R_g}\ groups over time, we now explore the evolution of their morphologies in the $z$--$v_z$\ plane. As noted in \S\ref{sec:intro}, while the variation in $\Omega_z$\ with \ensuremath{J_\phi}\ (or \ensuremath{R_g}) causes a \textit{variety} of spiral morphologies to be apparent in the same local volume, it is the spread in $\Omega_z$~ at a certain \ensuremath{J_\phi}~ that leads to the phase spiral itself. Figure~\ref{fig:freqs_and_time_periods}b illustrates both of these points with a 2D histogram of $\Omega_z$\ as a function of \ensuremath{J_\phi}\ for the simulated disk stars. The median $\Omega_z$\ changes with \ensuremath{J_\phi}, and at any given \ensuremath{J_\phi} there is a range ($\Delta$$\Omega_z$ ) of values present. For instance, at $\sim 10$ kpc, the 1$\sigma$ dispersion about the median $\sigma_{\Omega z}\approx$ 2 epicyclic orbits per Gyr (marked by the dashed orange curves in Figure~\ref{fig:freqs_and_time_periods}b). Hence, over a few hundred Myrs we would expect particles with \ensuremath{R_g}$\sim$10 kpc that are displaced vertically by some perturbation to wind up, with the faster oscillating stars at the head of a $z$--$v_z$\ spiral, and the ones with lower $\Omega_z$~forming the tail. These spirals will fade when particles have had time to fully phase-mix. They will form more slowly in coordinates where stars have smaller spreads in frequencies In order to trace the onset and scale of responses in $z$--$v_z$\ in the simulated \ensuremath{R_g}\ groups, we adopt a simple \textit{asymmetry parameter} \citep[based on that used in][]{widrow2012, bennett_bovy2021}. The asymmetry ($A_X$) in a phase-space property $X$ of a group of stars is given by \begin{equation} \label{eq: asym_param} A_X = \frac{N(X\geq0)-N(X\leq0)}{N(X\geq0)+N(X\leq0)}, ~~~~~~~~~~~A_X\in \{-1,1\} \end{equation} where $N(X\geq0)$ ($N(X\leq0)$) is the number of stars which have property $X\geq0$ ($X\leq0$). For our purpose of detecting asymmetry specifically in the $z$--$v_z$~plane, we introduce a combined kinematic asymmetry parameter $A_{z,v_z} \equiv \sqrt{A_z^2 + A_{v_z}^2} ~\in \{0, \sqrt{2}\}$. Each row (\textbf{(a)}--\textbf{(e)}) in Figure~\ref{fig:5-jphi-groups-zvz-plane-and-asym-param} corresponds to a specific time relative to \ensuremath{t_{\text{imp}}}\ (same time instances as the panels in Figure~\ref{fig:5-jphi-groups-xy-plane-at-5-snaps}). In each row, the leftmost panel has the time marked, and shows $A_{z,v_z}$\ as a function of \ensuremath{R_g}; five panels to the right (\textbf{(i)}--\textbf{(v)}) show the $z$--$v_z$\ plane for each of the five simulated \ensuremath{R_g}\ groups at the respective time. Colored contours enclose 50\% of the stellar sample in each \ensuremath{R_g}\ group. Note that these contours do not necessarily enclose the \textit{same stars} as the contours in Figure~\ref{fig:5-jphi-groups-xy-plane-at-5-snaps}. Well before the disk crossing at $t-$\ensuremath{t_{\text{imp}}} $= 184$ Myr (row \ref{fig:5-jphi-groups-zvz-plane-and-asym-param}a), simulated stars in all \ensuremath{R_g}\ groups are unperturbed and almost symmetrically distributed in the $z$--$v_z$\ plane (i.e., the 50\% contours are circles centered on (\ensuremath{v_z}=0, \ensuremath{z}=0) and $A_{z,v_z}$(\ensuremath{R_g})$\approx0$). By $t=\ensuremath{t_{\text{imp}}}$ (Figure~\ref{fig:5-jphi-groups-zvz-plane-and-asym-param}c), the 50\% contours are distorted and $A_{z,v_z}$\ has become large (especially for group \textbf{(v)} (red) as it is the one closest to the point of impact; see Figure~\ref{fig:5-jphi-groups-xy-plane-at-5-snaps}c). We see in rows \ref{fig:5-jphi-groups-zvz-plane-and-asym-param}(c--e) that the phase-spirals develop at different rates for the various \ensuremath{R_g}\ groups. $A_{z,v_z}$ oscillates over the course of the disk crossing. We emphasize here that $A_{z,v_z}$\ is \textit{not} a measure of how developed (or wound) the phase spirals are, rather, it is a metric for how asymmetrical the distribution of stars is about (\ensuremath{v_z}=0,\ensuremath{z}=0) . \begin{figure} \centering \includegraphics[width = \textwidth]{figures/Figure06_sim_asym_params.png} \caption{Asymmetry parameters as a function of $t-$\ensuremath{t_{\text{imp}}}\ for the five simulated \ensuremath{R_g}\ groups. For details about the different asymmetry parameters shown, see discussion around eq(\ref{eq: asym_param}). \textbf{(a)} $A_{v_z}(t-$\ensuremath{t_{\text{imp}}}) (solid lines) and $A_z(t-$\ensuremath{t_{\text{imp}}}) (dashed lines). Asymmetry oscillates with longer time period for groups with larger \ensuremath{R_g}. \textbf{(b)} $A_{z,v_z}$$(t-$\ensuremath{t_{\text{imp}}}) for the simulated \ensuremath{R_g}\ groups. The colored vertical lines topped with a `$\star$' mark the time of maximum $A_{z,v_z}$\ for the \ensuremath{R_g}\ groups, and the maxima occur over a span of $\gtrsim 50$ Myr. These panels reiterate that stars in different regions of the disk experience the same perturbation (a satellite disk-crossing, in the case of our simulations) differently because the amplitude and oscillation frequency of asymmetry varies with \ensuremath{R_g}. The most important takeaway from this figure is that the effects of the disk-crossing begin to appear $\sim100$ Myr before \ensuremath{t_{\text{imp}}}, and last well after \ensuremath{t_{\text{imp}}}\ as well. Even though spirals don't appear until much later, the disk is differentially warped by the satellite's pull for $\gtrsim300$ Myr over the entirety of a single passage. } \label{fig:asymmetry_parameters} \end{figure} In Figure~\ref{fig:asymmetry_parameters}, we show $A_{v_z}$, $A_z$, and $A_{z,v_z}$ as a function of $t-$\ensuremath{t_{\text{imp}}}~for each of the five simulated \ensuremath{R_g}\ groups. The vertical oscillations of the different groups are captured in Figure~\ref{fig:asymmetry_parameters}a, with the period of oscillation being longer for larger \ensuremath{R_g}\ (as seen in Figure~\ref{fig:freqs_and_time_periods}c). Figure~\ref{fig:asymmetry_parameters}b attempts to capture the growth of the response over time by plotting the amplitude of $z$--$v_z$~ distortions overall. As expected, $A_{z,v_z}$$\approx0$ for all \ensuremath{R_g}\ at early times. We assume $A_{z,v_z}$$\sim \mathcal{O}(0.1)$ indicates the onset of the satellite's influence, which becomes apparent as early as $\sim100$ Myr before \ensuremath{t_{\text{imp}}}. The vertical lines with `$\star$' symbols mark the time of the maximum kinematic asymmetry for a particular \ensuremath{R_g}\ group, which corresponds to the time just before the spiral has wound up enough that the asymmetry starts to decline because of phase-mixing. This can occur up to $\sim50$ Myr after \ensuremath{t_{\text{imp}}}, demonstrating the fact that responses can vary significantly with \ensuremath{R_g}. A striking feature of Figure~\ref{fig:asymmetry_parameters} is the large asymmetry amplitude of the outermost \ensuremath{R_g}\ group ($\mathbf{(v)}\ 9<\ensuremath{R_g} \mathrm{(kpc)}<11$, red curves) compared to the other groups. There are two contributing factors which explain this effect: (1) this \ensuremath{R_g}\ group is the one closest to the disk crossing region (red, $\ensuremath{v_z}>0$) at $t=$\ensuremath{t_{\text{imp}}}\ (see Figure~\ref{fig:5-jphi-groups-xy-plane-at-5-snaps}c), and (2) the vertical oscillation period $T_z\approx 100$ Myr at $\ensuremath{R_g}\approx10$ kpc (see Figure \ref{fig:freqs_and_time_periods}; $\Omega_z$$/2\pi(\ensuremath{R_g}=10\text{ kpc}) = 10$ Gyr$^{-1}$ or = 10 epicycles per Gyr), is approximately a third of the timescale of the disk crossing ($\sim300$ Myr--- the time over which the satellite causes significant asymmetry, estimated from Figure~\ref{fig:asymmetry_parameters}), thus leading to an enhanced, resonant response. Overall, we conclude that not only does each \ensuremath{R_g}\ group experience the interactions from a different location in the disk, but the interactions for each group also occur at different times and with different durations. Moreover, the interaction is far from impulsive, but rather comparable to the orbital times. \subsection{Toy Model of the Influence of a Satellite During a Disk Crossing} \label{subsec: toy_model} In this section, we use a toy model of the influence of a satellite crossing the disk in order to place the results of prior sections in context --- how the experience of the same satellite perturbation can vary across \ensuremath{R_g}\ groups. For the purpose of isolating the scale of the influence in different regions of the disk, we assess the impact on toy model stars moving in the midplane (\ensuremath{z}$_\star$\ fixed to 0) on perfectly circular orbits ($\hat v_\star$ fixed to $\hat\phi$) throughout the encounter and ignore their vertical oscillations or any vertical displacement due to the satellite's pull. Figure~\ref{fig:impact_toy_model_schematic}a sketches the toy model: a galactic disk (shown face-on) comprises stars on clockwise circular orbits in the midplane, and a satellite on a vertical trajectory passing through it with \ensuremath{v_z}$>0$ (out of the page). We can get some intuition for our results by first considering the three toy model stars shown in Figure~\ref{fig:impact_toy_model_schematic}a, one with $\ensuremath{\phi_{\star}}(\ensuremath{t_{\text{imp}}}) = \ensuremath{\phi_{\text{sat}}}$ at the time of disk crossing (yellow star), a second with $\ensuremath{\phi_{\star}}(\ensuremath{t_{\text{imp}}}) < \ensuremath{\phi_{\text{sat}}}$ (blue star), and the third with $\ensuremath{\phi_{\star}}(\ensuremath{t_{\text{imp}}}) > \ensuremath{\phi_{\text{sat}}}$ (red star). Figure~\ref{fig:impact_toy_model_schematic}b demonstrates that the yellow star experiences exactly equal and opposite force from the satellite before and after \ensuremath{t_{\text{imp}}}, and thus experiences net $\Delta v_z =0$. The blue star is closer to the satellite when it is being pulled down (at $t<\ensuremath{t_{\text{imp}}}$), but farther when being pulled up (at $t>\ensuremath{t_{\text{imp}}})$ and thus has net $\ensuremath{\Delta v_z}<0$. Finally, the red star is farther from the satellite when it is being pulled down (at $t<t_{imp}$), and closer when being pulled up (at $t>t_{imp})$ and thus has net $\Delta$\ensuremath{v_z}$>0$. Figure~\ref{fig:impact_toy_model_schematic}c simply reiterates the asymmetric response by showing the cumulative \ensuremath{a_z}$(t-\ensuremath{t_{\text{imp}}})$ which is 0 at $t-\ensuremath{t_{\text{imp}}} = t_i\ (t_i\ll \ensuremath{t_{\text{imp}}})$ for the three sample toy model stars, and by $t-\ensuremath{t_{\text{imp}}} = t_f\ (t_f\gg \ensuremath{t_{\text{imp}}})$, cumulative \ensuremath{a_z}\ is positive for the red star ($\phisat-\phistar(\ensuremath{t_{\text{imp}}})>0$), $0$ for the yellow star ($\phisat-\phistar(\ensuremath{t_{\text{imp}}})=0$), and negative for the blue star ($\phisat-\phistar(\ensuremath{t_{\text{imp}}})<0$). \begin{figure}[h] \centering \subfloat{% \includegraphics[width=0.49\linewidth]{figures/Figure07a_mw-sgr_toy_model_schematic.png} } \subfloat{ \includegraphics[width = 0.49\linewidth]{figures/Figure07bc_toy_model_schematic_az_at_3_azimuths.png} } \caption{\textbf{(a)} The $x$-$y$ projection of a toy disk with a satellite (pink circle at $\vec{r}_{\text{sat} }= (R_{\text{sat}},\phi_{\text{sat}},v_{z,\text{sat}}t)$) passing through on a strictly vertical path with $v_{z,\text{sat}}>0$ (out of the page). The disk rotates clock-wise, with all stars remaining strictly in the midplane and at constant radius represented by $\vec{r}_\star = (R_\star,\phi_\star(t),z_\star=0)$. \textbf{(b)} Vertical acceleration caused \textit{solely} by the satellite, $a_z(t-\ensuremath{t_{\text{imp}}})$, where \ensuremath{t_{\text{imp}}}\ is the time the satellite crosses the midplane, for the 3 toy model stars marked in panel (a). \textbf{(c)} Cumulative \ensuremath{a_z}$(t-\ensuremath{t_{\text{imp}}}$) for the 3 sample toy model stars. Panels (b,c) together show that over an extended time $t_i< t< t_f$ such that the initial time $t_i\ll $\ensuremath{t_{\text{imp}}}\ and final time $t_f\gg\ensuremath{t_{\text{imp}}}$ , the red star ($\phi_\star(\ensuremath{t_{\text{imp}}}) > \phi_{sat}$) gets a net positive $\Delta v_z(t_f)$, the blue star ($\phi_\star(\ensuremath{t_{\text{imp}}}) < \phi_{sat}$) gets a net negative $\Delta v_z(t_f)$, and the yellow star ($\phi_\star(\ensuremath{t_{\text{imp}}}) = \phi_{sat}$) experiences a net zero change in $v_z$ at $t=t_f$. See discussion in \S\ref{subsec: toy_model} for further explanation. (\textit{Note:} The time axes in panels (b) and (c) are different; we have zoomed into a shorter time interval in panel (b) compared to (c) to show the $a_z(t)$ curves in better detail.)} \label{fig:impact_toy_model_schematic} \end{figure} We quantify the scales of the satellite influence across the disk by integrating the \ensuremath{z}-acceleration it exerts on some sample particles over the course of the encounter. Each test particle has a position vector in cylindrical coordinates, $\vec{r}_\star = (R_\star, \phi_\star(t), z_\star = 0)$, such that its galactocentric radius is constant and it remains in the midplane. The azimuth of a particle is given by $\phi_\star = \phi(\ensuremath{t_{\text{imp}}}) + v_\star t$. The satellite (pink circle) of mass $M_{sat}$ is on a vertical trajectory with constant galactocentric radius, azimuth, and upward vertical velocity, described by $\vec{r}_{\text{sat} }= (R_{\text{sat}},\phi_{\text{sat}},z_{\text{sat}} = v_{z,\text{sat}}t)$). The vertical acceleration $a_z(t)$ of a particle due to the gravitational pull of the satellite is given by, \begin{equation} \label{eq: az} a_z(t) = G M_{sat} \frac{z_{sat}(t) - z_\star}{|\vec{r}_\star(t)-\vec{r}_{sat}(t)|^3} = G M_{sat}\frac{v_{z,sat}t}{\left[R_{sat}^2+R_*^2 - 2R_{sat}R_*\cos{(\phi_*(t)-\phi_{sat})} + (v_{z,sat}t)^2\right]^{3/2}} \end{equation} Note that we are intentionally \textit{only} considering the acceleration due to the satellite (and not including the restoring force of the disk) because we want to isolate the response generated by the satellite. Thus in this paper, $a_z$ refers to the vertical acceleration defined in eq(\ref{eq: az}), and we neglect the evolution of orbits by forcing the toy model stars to remain on circular orbits. We calculate $a_z(t)$ for all particles in a toy disk where we set $M_{sat} = 2\times10^{10}\ M_\odot$, $z_{sat}(t) = v_{z,sat}t$, $v_{z,sat} = 339$ km$s^{-1}$, $\phi_\star(t) = \phi_\star(\ensuremath{t_{\text{imp}}})+v_\star t$, and $v_\star(R_\star)$ is obtained from the rotation curve of \texttt{MWPotential2014}\ in \texttt{galpy}. The satellite's mass, vertical velocity, and disk crossing coordinates are chosen to closely match the satellite in Model A of the test particle simulation at $t=$\ensuremath{t_{\text{imp}}}. Over a certain time period $t_i\leq t\leq t_f$, we can find the total change in a toy model star's vertical velocity, \begin{equation} \label{eq: delta_vz} \Delta v_z = \int_{t_i}^{t_f} a_z \, \textrm{d}t . \end{equation} Figure~\ref{fig:az-lag-lead-3stars}a shows a toy disk colored by $\Delta v_z$ integrated over $-0.5<t-\ensuremath{t_{\text{imp}}}\text{ (Gyr)}<0.5$. The $x$--$y$\ coordinates of stars in this panel are frozen at \ensuremath{t_{\text{imp}}}\ to show net $\Delta v_z$ at $t=t_f$ as a function of position at $t=\ensuremath{t_{\text{imp}}}$ with respect to the satellite at disk-crossing. Toy model stars with $\phisat-\phistar(\ensuremath{t_{\text{imp}}})<0$ experience net \ensuremath{\Delta v_z} $<0$ over the entire course of the disk crossing and lie in the blue region, whereas stars with $\phisat-\phistar(\ensuremath{t_{\text{imp}}})>0$ have the opposite response and lie in the red region. Only at $\phisat-\phistar(\ensuremath{t_{\text{imp}}})=(0,\pi)$ is \ensuremath{\Delta v_z}$=0$. Three sample radii of \ensuremath{R}$=(4, 8, 16)$ kpc with four sample toy model stars at each radius are chosen (shown with `$\star$' symbols on dashed circles in Figure~\ref{fig:az-lag-lead-3stars}a) to examine $a_z(t)$ for different radii and azimuths. Each of Figures \ref{fig:az-lag-lead-3stars}b-d shows $a_z(t-t_{imp})$ for each of the sample radii, and the colored curves corresponds to a `$\star$' in Figure~\ref{fig:az-lag-lead-3stars}a of the same color at that radius. The horizontal bars mark $T_\phi$ and $T_z$ for the corresponding \ensuremath{R}. Note that epicyclic oscillations are not included in the toy model; $T_z$ is simply taken from the simulated data in Figure~\ref{fig:freqs_and_time_periods}a to compare typical oscillation timescales with the disk crossing timescale. The toy model captures the qualitative diversity in the disk response to a satellite perturbation. It demonstrates the \ensuremath{R}-\ and \ensuremath{\phi_{\star}}-dependence of $a_z(t)$. It underscores the fact that the satellite's integrated influence on vertical motions: (i) can have opposite signs in different disk regions; (ii) reaches its peak at different times for different azimuths at the same radius; (ii) extends over timescales comparable to both the orbital and vertical oscillation times. Of course, these conclusions are a function of the particular passage we choose to examine --- these are the characteristics we expect for satellites with disk crossings at radii that are comparable to the disk size itself. Another caveat of this simple model is that it neglects $\Delta v_R$ and $\Delta v_\phi$ of stars, which will qualitatively alter the signatures of vertical disturbance we see in the toy disk. \subsection{Combined Implications of Our Results}\label{subsec: results_I_conc} We have explored the origin of the multiple $z$--$v_z$\ spiral morphologies apparent when local samples in the \textit{Gaia}\ data and test particle simulations are divided into \ensuremath{R_g}\ bins. In Section \ref{subsubsec: x-y phase mixing} we showed how the locations of these distinct samples, traced back in time, outline an $R$--$\phi$\ spiral across the disk (see distribution of colored contours in Figure~\ref{fig:5-jphi-groups-xy-plane-at-5-snaps}a). Furthermore, the various $z$--$v_z$\ spiral morphologies in \textit{any} local volume are \textit{local} signatures of a \textit{global} \ensuremath{v_z}\ spiral spanning the extent of the disk (see \ensuremath{v_z}\ structure in Figure~\ref{fig:5-jphi-groups-xy-plane-at-5-snaps}e). In Section \ref{subsec: toy_model} we used a toy model to examine the case of a $2\times 10^{10} M_\odot$ satellite crossing the Galactic disk plane and demonstrated how the overall influence is neither local nor impulsive. Stars at different \ensuremath{R_g}\ which form phase spirals ``today", started responding to a perturbation tens of Myrs before \ensuremath{t_{\text{imp}}}\ and well before coherent phase spiral structures developed. The combination of these results imply that the multiple local phase-spirals, even if associated with the same event, cannot be simply ``rewound" to a single time and location to learn about the impact. Rather, each \ensuremath{R_g}\ group represents distinct viewpoints of the same event which are widely spread out in space and time. We reiterate that although we present the example of a disk-and-satellite interaction as the cause of these phase-spirals, their subsequent phase-mixing in $z$--$v_z$~ and $R$--$\phi$\ depends only on the disk properties and not the nature of the interaction. Distinct morphologies in local $z$--$v_z$\ samples would occur with other types of perturbations as well, and contain multiple viewpoints on the cause, whether a buckling bar, rippling disk or an impacting satellite. Hence local spirals could be powerful diagnostic tools of global disk disturbances. \begin{figure}[ht] \centering \includegraphics[width=\textwidth]{figures/Figure08_toy_model_az_at_3_radii.png} \caption{\textbf{(a)} A toy disk rotating clockwise in the $x$-$y$ plane colored by vertical velocity $\Delta v_z$ over $-184 <t-\ensuremath{t_{\text{imp}}}$ (Myr)$<184$. The positions are frozen at $x_{imp},y_{imp}$ at $t=t_{imp}$. The white `$\times$' marks the point where the satellite crosses the midplane with \ensuremath{v_z}$_{\text{,sat}}>0$, coming out of the page. This panel demonstrates the point that toy model stars with $\phi_{\star}(\ensuremath{t_{\text{imp}}}) > \phi_{sat}$ get a net positive kick in $v_z$ (red region), the toy model stars with $\phi_{\star}(\ensuremath{t_{\text{imp}}}) < \phi_{sat}$ get a net negative kick (blue region), whereas toy model stars with $\phi_{\star}(\ensuremath{t_{\text{imp}}}) = \phi_{sat}$ or $\phi_{\star}(\ensuremath{t_{\text{imp}}}) = \phi_{sat}-\pi$ get a net $0$ change in $v_z$. For stars in this toy model, $\Delta v_z$ is calculated by only accounting for \ensuremath{a_z}\ caused by the satellite passing through the disk (see Eq.(\ref{eq: az})). That is, we neglect epicyclic oscillations and self gravity. Three sample radii are chosen (black dotted circles at 4, 8, and 16 kpc) with sample stars (marked with `$\star$' symbols) distributed in azimuth to analyze $a_z(t)$. \textbf{(b)--(d)} For each sample radius (\textbf{(b)} 4 kpc, \textbf{(c)} 8 kpc, and \textbf{(d)} 16 kpc), we show $a_z(t-t_{imp})$ for the sample stars selected at that radius. The color of each curve in these panels corresponds to a colored `$\star$' marked in panel \ref{fig:az-lag-lead-3stars}a. The red curves have a net positive $\Delta$\ensuremath{v_z}, yellow and green curves have net zero, and blue curves have net negative $\Delta$\ensuremath{v_z}. The black horizontal bars indicate time periods of oscillations at the sample radius (taken from Figure \ref{fig:freqs_and_time_periods}a): the longer bar is $T_\phi$ (period of $\phi$-rotation), the shorter one is $T_z$ (period of vertical epicyclic oscillation). The vertical acceleration of the toy disk stars last over a period comparable to orbital time scales. \textit{Note:} The stars in this toy model are \textit{not} oscillating, the horizontal bars are simply shown to indicate what the oscillation time periods are in a MW-like disk at particular \ensuremath{R}\ values, and how they compare to the time scale of the disk crossing.} \label{fig:az-lag-lead-3stars} \end{figure} \section{Results II: Application to the Ongoing MW-Sgr Interaction}\label{sec: results-III_ongoing_interaction} The results from previous sections show that a Sagittarius-like satellite passing through the midplane at \ensuremath{R} $\approx15$ kpc can influence the disk at times $\sim \pm 150$Myr around \ensuremath{t_{\text{imp}}}. Currently, Sagittarius~ is approaching the MW from $z\approx-6$ kpc with \ensuremath{v_z} $\approx200$ km$s^{-1}$ and is expected to hit the outer disk at $R\sim 18$ kpc in $\sim$30Myr. This suggests that, even though Sagittarius~has not yet crossed the midplane, there could be signatures of this encounter already developing in the disk. Figure~\ref{fig:sgr_galpy_orbit} shows the recent and near future path of Sagittarius's by tracing its orbit within \texttt{galpy}'s \texttt{MWPotential2014}~forwards and backwards from its present-day Galactocentric phase-space coordinates from \cite{Vasiliev2020} noted in \S\ref{subsec: tp sim description}. The geometry of Sagittarius's orbit causes it to travel quite close under the disk plane as it approaches its present location rather than simply passing vertically. To explore possible signatures of the current interaction, we now analyze global deviations from zero in \ensuremath{v_z}\ as well as local phase-space signatures which might be detectable in future surveys. On these short timescales ($\sim$150 Myr), we expect disk self-gravity to be least important and our toy and test particle models to capture much of the response. \subsection{Estimates of Scale from the Toy Model}\label{subsec:toy_model_current_interaction} \begin{figure} \centering \includegraphics[width=0.6\textwidth]{figures/Figure09_vasiliev_sgr_xz_orbit.png} \caption{The $x$--$z$ projection of Sagittarius's orbit with present day phase space information from \cite{Vasiliev2020}. The orbit has been integrated in \texttt{MWPotential2014}\ from \texttt{galpy}. The current position of Sgr is marked by the large red dot, the dashed curve is the the past orbit, and the dotted curve is the future orbit. The black dots are 50 Myr apart. The black horizontal line represents the MW disk, with the Sun marked by the orange `$\odot$'. The asymmetry of Sgr's past and future orbit indicates that soon after crossing the midplane, its distance from the disk will increase significantly compared to the past $\sim150$ Myr while it was sweeping under the disk. Its proximity to the disk in the recent past leads us to explore whether signatures of vertical disturbance have already developed.} \label{fig:sgr_galpy_orbit} \end{figure} We apply our toy model to explore the nature of Sagittarius's past, present, and future influence on the MW throughout the current disk passage. The toy disk once again comprises particles on strictly circular orbits rotating clockwise with constant circular velocity $v_{\star}$($R_\star$) and $z_\star =0$, but this time for a satellite travelling along the orbit whose $x--z$ projection is shown in Figure~\ref{fig:sgr_galpy_orbit}. We set \ensuremath{M_{\text{Sgr}}}\ to a constant $3\tenexp9\ \ensuremath{M_\odot}$ \citep[the initial Sagittarius\ mass in][]{Vasiliev2020}. Figure~\ref{fig: az_toy_model_Sgr_current_passage}a shows the disk $x$--$y$\ plane at present day $(t=t_0$, ``today"), colored by $\Delta v_z$ (see eq(\ref{eq: delta_vz})) integrated over $-0.5\leq t-t_0\text{\ (Gyr)}\leq 0$. The black dashed curve shows the $x$--$y$\ projection of Sagittarius's past orbit, with the black dots spaced at intervals of 50 Myr. The large red dot marks Sagittarius's current $x$--$y$\ position, the red dotted curve is its future orbit and the red cross is where it will cross $z=0$. The orange `$\odot$' at ($-8,0$) marks the Sun. The plot shows that particles across the disk receive a net velocity kick of up to several km$s^{-1}$\ from this portion of the passage alone. Again, remember that the toy model neglects epicyclic oscillations and thus is not a prediction for the mean \ensuremath{v_z}, but rather for the scale of Sagittarius's influence in different regions. Moreover, the mass of Sagittarius\ that we have used (\ensuremath{M_{\text{Sgr}}}$\approx3\times 10^{9}$\ensuremath{M_\odot}) is the initial and largest mass in \citet{Vasiliev2020} (see their Figure 9). The Sgr remnant loses significant mass by present day, which would mean that the strength of the \ensuremath{v_z}\ signal in reality will be much weaker than the \ensuremath{v_z}\ amplitude in our toy model. Figures \ref{fig: az_toy_model_Sgr_current_passage}b--d each show \ensuremath{a_z}$(t)$ for radii \ensuremath{R}=4, 8, and 16 kpc respectively and particles at four different azimuths (`$\star$' symbols in \ref{fig: az_toy_model_Sgr_current_passage}a). The asymmetry of \ensuremath{a_z}$(t)$ around $t_0$ emphasizes the fact that most of the vertical perturbation within $\ensuremath{R}\lesssim10$ kpc due to Sagittarius's ongoing interaction with the Milky Way \textit{has already happened} over the past $\lesssim200$Myr, as the satellite sweeps close under the disk. More specifically, the ratio between $|\Delta v_z|$ induced over the past 200 Myr and $|\Delta v_z|$ induced over $t_0 \pm 200$ Myr , averaged over the 4 sample toy model stars at each radius is 0.82, 0.79, and 0.69 for $R_\star = 4,\ 8,\ 16$ kpc respectively. \begin{figure} \includegraphics[width = 1\textwidth]{figures/Figure10_vasiliev_sgr_az_at_3_radii.png} \caption{This figure's panels and color schemes are the same as Figure \ref{fig:az-lag-lead-3stars}; $M_{Sgr} = 3\times10^9 M_{\odot}$. \textbf{(a)} The $x$-$y$ plane colored by $\Delta v_z$ integrated over the past 500 Myr up until present day. Since Sgr has been below the disk for the past $\sim200$Myr and is at $z\approx -6$ kpc at present, there is a net negative $\Delta v_z$ across the entire disk. The red dot shows the current $x$--$y$ position of Sgr, and the black dashed line tracks its past trajectory, with the black dots being 50Myr apart in time. The red dotted line tracks Sgr's future trajectory and the red cross marks the position where Sgr will cross $z = 0$ ($\sim$30 Myr in the future). The orange `$\odot$' at $(-8,0)$ kpc indicates the current position of the Sun. \textbf{(b)--(d) }$a_z(t)$ at different radii and azimuths, with $t=0$ at present day. The dotted vertical line marks the time in the future when Sgr will cross $z=0$. The extreme asymmetry of $a_z$ around $t=0$ in these three panels makes the point that a major fraction of the $\Delta v_z$ due to the imminent passage of Sgr \textit{has already been induced} by present day. Once again, this toy model does not account for epicyclic oscillations and self-gravity, therefore should not be interpreted as quantitatively accurate.} \label{fig: az_toy_model_Sgr_current_passage} \end{figure} \subsection{Morphological Predictions from Test Particle Simulations}\label{subsec: current_interaction_sim_prediction} Our qualitative conclusions from the toy model in \S\ref{subsec:toy_model_current_interaction} motivate searching for a signature of the vertical response to the ongoing MW-Sagittarius~interaction. We use test particle simulations of a disk galaxy perturbed by a Sgr-like satellite on the orbit prescribed by \texttt{MWPotential2014}~with present day Sgr phase-space coordinates from \citet{Vasiliev2020}. We analyze the simulations for two different cases--- \hyperref[tab:I]{Model B}: a MW-like disk which has only evolved under Sgr's influence over the past 150 Myr with \ensuremath{M_{\text{Sgr}}}$=3\tenexp9\ensuremath{M_\odot}$, and \hyperref[tab:I]{Model C}: a MW-like disk that has experienced multiple crossings of Sagittarius\ over the past 4 Gyr, with \ensuremath{M_{\text{Sgr}}}$=10^{10}\ensuremath{M_\odot}$. This helps us extricate the vertical response over the past 150 Myr from the remnant effects of past disk crossings. It also allows us to see how the amplitude of the response scales with \ensuremath{M_{\text{Sgr}}}. \subsubsection{Physical Spirals} \begin{figure} \centering \includegraphics[width=\textwidth]{figures/Figure11abc_high_res.pdf} \caption{\textbf{(a)} Model \hyperref[tab:I]{B}: a test particle disk $x$--$y$\ plane at present day ($t=t_0$) colored by vertical velocity scaled by \ensuremath{M_{\text{Sgr}}}\, $v_z \times 10^{10}M_\odot/M_{Sgr}$ (this rescaling helps enhance the \ensuremath{v_z}\ signal from a satellite with \ensuremath{M_{\text{Sgr}}}$<10^{10}\ensuremath{M_\odot}$). The test particle disk has evolved under the influence of Sagittarius\ \textit{only} over the past 150 Myr with $M_{\text{Sgr}} = 3\times 10^{9}\ M_\odot$. The outlined patches correspond to the panels of Figure~\ref{fig: zvz_present_day_model_b}. \textbf{(b)} the same plot as (a), but for Model \hyperref[tab:I]{C}. The test particle disk has evolved over the past 4 Gyr, and $M_{Sgr} = 10^{10}\ M_\odot$. The \ensuremath{v_z}\ pattern across the disk is largely the same between panels (a) and (b), and the \ensuremath{v_z}\ amplitudes are also similar once scaled by \ensuremath{M_{\text{Sgr}}}. The fact that the isolated disk in (a) shows the same \ensuremath{v_z}\ pattern as (b) implies that the current MW-Sgr interaction is largely what creates this \ensuremath{v_z}\ signature. \textbf{(c)} ``Present day" snapshot from a self-consistent simulation (described in \S\ref{subsec: bonsai sim description}) for purely illustrative purposes to show that a similar pattern in \ensuremath{v_z}\ emerges even when self-gravity of the disk is accounted for. Note that the $x$--$y$\ limits of this plot are different from panels (a) and (b), which means that the extent of the \ensuremath{v_z}\ pattern is not the same. However, this can be explained by the various differences between the Sagittarius\ orbit and disk potential between the test particle and self-consistent simulations. The main takeaway from this figure is that in \textit{all three panels,} a blue region with $v_z<0$ emerges around $\phi\sim0^\circ$, and a red region with $v_z>0$ is present around $\phi\sim-90^\circ$. This leads to a robust prediction that these signals in \ensuremath{v_z}\ are present in the MW disk today and might be detectable in future surveys. } \label{fig:xy_current_interaction_present_day_different_models} \end{figure} \begin{figure} \centering \includegraphics[width=0.7\textwidth]{figures/Figure12_no_spirals_due_to_MW_Sgr_current_interaction.png} \caption{The regions with largest $|\ensuremath{\Delta v_z}|$ in simulations of the ongoing MW-Sgr interaction do not exhibit phase-spirals. \textbf{(a)} Corresponds to $v_z<0$ patch outlined in Figure~\ref{fig:xy_current_interaction_present_day_different_models}a. The black contour here encloses 50\% of the simulated stellar population in the patch. The sample is clearly offset toward $v_z<0$, and we also see that a significant fraction of stars in that region have $z<0$. \textbf{(b)} Corresponds to the $v_z>0$ patch in Figure~\ref{fig:xy_current_interaction_present_day_different_models}a. Once again, 50\% of the simulated sample is enclosed by the black contour here, which is clearly shifted toward $v_z>0$ (as expected) and $z<0$. This figure additionally provides $z$ information which is not apparent from Figure~\ref{fig:xy_current_interaction_present_day_different_models}a. } \label{fig: zvz_present_day_model_b} \end{figure} In Figures \ref{fig:xy_current_interaction_present_day_different_models}(a,b), we show a comparison of the $x$--$y$\ plane at present day colored by \ensuremath{v_z}$\times 10^{10}M_\odot/$\ensuremath{M_{\text{Sgr}}}~for \hyperref[tab:I]{Models B} and \hyperref[tab:I]{C}. There is a distinct pattern in \ensuremath{v_z}~which appears to be more or less consistent between the two panels, indicating that it is largely a result of the ongoing MW-Sgr interaction, and not a remnant of past disk crossings. The maximum \ensuremath{v_z}\ amplitude induced in the disk is significantly lower than the toy model ($|\max$ \ensuremath{v_z}$_{,toy}|\times 10^{10}\ensuremath{M_\odot}/\ensuremath{M_{\text{Sgr}}}\approx7/0.3$ km$s^{-1}$$ \approx 23$ km$s^{-1}$) because epicyclic oscillations average out the signal. Moreover, the amplitude of \ensuremath{v_z}$\propto M_{Sgr}$, such that maximum $|v_z|\times 10^{10}M_\odot/$\ensuremath{M_{\text{Sgr}}}$\approx3$ km$s^{-1}$\ remains almost the same in both panels. Finally, Figure~\ref{fig:xy_current_interaction_present_day_different_models}c shows a self-consistent simulation snapshot (see \S\ref{subsec: bonsai sim description} for details of the model) at present day which has evolved over the past 6.88 Gyr, and the current Sgr remnant mass is $M_{Sgr, \text{rem}}\approx 8\times 10^{9}\ensuremath{M_\odot}$. Although the $x$--$y$\ extent of Figure~\ref{fig:xy_current_interaction_present_day_different_models}c is different from panels \ref{fig:xy_current_interaction_present_day_different_models}(a,b), in \textit{all three models}, a blue (\ensuremath{v_z}$<0$) patch is visible around $\phi\sim 0^{\circ}$ on the opposite side of the disk across from the Sun ($(x_\odot, y_\odot)=(-8,0)$), and a red ($v_z>0$) region emerges with the highest amplitude of positive \ensuremath{v_z}\ around $\phi\sim -90^\circ$. These two regions are roughly marked by black contours in panel \ref{fig:xy_current_interaction_present_day_different_models}a, and appear around the same azimuth in panels \ref{fig:xy_current_interaction_present_day_different_models}(b,c) as well (albeit in different $x$--$y$\ positions). The blue patch (labeled `(1)$v_z<0$' in panel \ref{fig:xy_current_interaction_present_day_different_models}a) is created by the downward pull of the Sgr-like satellite, it's present-day $x$--$y$\ location marked by a red dot in each panel. The red region (labeled `(2)$v_z>0$' in panel \ref{fig:xy_current_interaction_present_day_different_models}a) consists of simulated stars which were pulled downwards by Sgr $\sim 100$ Myrs ago, and are now traveling upwards as part of their vertical epicyclic motion. The reason why the coordinates and \ensuremath{v_z}\ amplitude of the blue and red patches differ between the panels \ref{fig:xy_current_interaction_present_day_different_models}(a,b) versus panel \ref{fig:xy_current_interaction_present_day_different_models}c is that the disk potential and satellite orbit in the self-consistent simulation are different from those in the test particle simulation, and there is little control over these in the self-consistent model. We emphasize that the existence of the $v_z<0$ and $v_z>0$ regions not just in the test particle models but also in a self-consistent MW-Sgr interaction is main point of Figure~\ref{fig:xy_current_interaction_present_day_different_models}. The fact that a self-consistent disk also exhibits a significant $v_z<0$ signal near the location of the dwarf is a strong indicator that this signature might exist in our own Galaxy. If detected in future surveys \citep[like the SDSS-V Milky Way Mapper;][]{sdssv_2019_mwm}, the amplitude could be used to infer Sagittarius's remnant mass precisely while the shape could be used to infer trends in disk frequencies (and hence the force field) in that region. There is the caveat that the remnant mass ($\ensuremath{M_{\text{Sgr}}} \approx 8\times 10^{9}\ensuremath{M_\odot}$) inducing the \ensuremath{v_z}\ signal in Figure~\ref{fig:xy_current_interaction_present_day_different_models}c is much larger than the present day \ensuremath{M_{\text{Sgr}}}\ quoted in \citet{Vasiliev2020}. Thus it is possible that Sgr's tidal effects are negligible at present compared to the self-sustained bending waves in the disk. \subsubsection{Phase-Spirals} We do not find phase spirals in the test particle disk models due to the ongoing Sagittarius-MW interaction, as might be anticipated since there is little time for these features to develop. However, there is significant vertical asymmetry in the simulated disk caused by the interaction, which we present in Figure~\ref{fig: zvz_present_day_model_b}. Panels \ref{fig: zvz_present_day_model_b}(a,b) respectively show the $z$--$v_z$\ plane for particles in the blue region (labeled `(1)$v_z<0$' in panel \ref{fig:xy_current_interaction_present_day_different_models}a) and the red region (labeled `(2)$v_z>0$' in panel \ref{fig:xy_current_interaction_present_day_different_models}a). The black contours in \ref{fig: zvz_present_day_model_b}(a,b) enclose 50\% of the simulated sample in each of the two regions. In panel \ref{fig: zvz_present_day_model_b}a, the sample is clearly offset toward $v_z<0$, and a significant fraction of simulated stars have $z<0$. Panel \ref{fig: zvz_present_day_model_b}b shows the black contour offset toward $v_z>0$ (as expected) and $z<0$, indicating that although stars in this patch have started to travel upward with positive \ensuremath{v_z}, they are still below the midplane. \section{Conclusions}\label{sec:conc} The main conclusions of this paper are the following: \begin{enumerate} \item As shown in \citet{li2020}, selection of stars based on their azimuthal action \ensuremath{J_\phi}\ (or equivalently, their guiding radius $R_g$) makes it possible to resolve multiple $z$--$v_z$\ spiral morphologies (Figure~\ref{fig:jphi-covers-more}). We make the case that each of these local phase-spirals probes \textit{distinct regions} of the disk and began developing at \textit{distinct times} (Figure~\ref{fig:5-jphi-groups-zvz-plane-and-asym-param}). These multiple $z$--$v_z$\ spirals can originate from the \textit{same perturbative event} (Figure~\ref{fig:5-jphi-groups-xy-plane-at-5-snaps}), and therefore each of them offers a different perspective on the same event. \end{enumerate} Multiple $z$--$v_z$\ spiral morphologies (over a wide range in \ensuremath{R_g}) exist in the local sample because the effects of a single satellite disk-crossing are long-lasting ($\sim300$ Myr) and affect the entire disk. The varied spirals are a reflection both of the fact that different regions of the disk experience the perturbation with different amplitudes (demonstrated with a toy model in Figure~\ref{fig:az-lag-lead-3stars}) and that different regions respond with different characteristic frequencies. Coincidence of the disk-crossing timescale and orbital time period can further amplify the distortions (Figures~\ref{fig:freqs_and_time_periods},\ref{fig:asymmetry_parameters}). Since a single perturbative event can have such an extended impact on disk dynamics, we investigate the ongoing MW-Sagittarius\ interaction. Our investigation leads to several insights about the current disk passage. \begin{enumerate} \item[2.] Even though Sgr is not expected to cross the midplane for another $\sim 30$ Myr, the bulk of the influence on the inner disk ($\ensuremath{R} \lesssim 10$ kpc) from this imminent passage has \textit{already happened} (Figure~\ref{fig: az_toy_model_Sgr_current_passage}). \item[3.] We do not find $z$--$v_z$\ spirals in test particle simulations of the ongoing interaction (Figure~\ref{fig: zvz_present_day_model_b}), but significant asymmetry is expected in \ensuremath{R}--$\phi$, leading to a disk-wide physical spiral (seen in Figure~\ref{fig:xy_current_interaction_present_day_different_models}). The amplitude of this \ensuremath{v_z}\ signature scales linearly with \ensuremath{M_{\text{Sgr}}}. \item[4.] The fact that there is a $\ensuremath{v_z}<0$ (blue) patch around Sgr's ``present-day" $x$--$y$\ position, and a similarly sized $v_z>0$ (red) patch around $\phi\approx-90^{\circ}$ in \textit{both} the test particle and self-consistent disk (Figure~\ref{fig:xy_current_interaction_present_day_different_models}), suggests it is likely that these signatures are present in our Galaxy as well. These patches might be detectable in future Milky Way surveys \citep[e.g. SDSS-V Milky Way Mapper;][]{sdssv_2019_mwm}. If the true mass and orbit of Sgr are indeed such that there is a coherent \ensuremath{v_z}\ offset, the amplitude can be used to infer \ensuremath{M_{\text{Sgr}}}, while the morphology and location will help constrain both the properties of the disk and Sgr's orbit. However, it is possible that the projection shown in Figure~\ref{fig:xy_current_interaction_present_day_different_models}c is in reality obscured by pre-existing or independent disk dynamics. \end{enumerate} We consider the above conclusions to be generic consequences of phase-mixing alone. A full interpretation of observed features will need to take account of the disk self-gravity, and signatures of the more recent interactions will need to be disentangled from prior perturbative events. Nevertheless, our results demonstrate intuitive starting points towards building methods that can tease apart these overlapping responses. \section*{Acknowledgements} The authors would like to thank {Chris Carr and Douglas Filho for their help}. SSG is funded by New York University through the MacCracken Fellowship. JASH and APW are supported by a Flatiron Research Fellowship at the Flatiron institute, which is supported by the Simons Foundation. This work was performed in part by JASH and APW at Aspen Center for Physics, which is supported by National Science Foundation grant PHY-1607611. KVJ was supported by NSF grant AST-1715582. CFPL acknowledges funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation program (grant agreement No. 852839). This work was supported in part by World Premier International Research Center Initiative (WPI Initiative), MEXT, Japan. This work was performed in part at Aspen Center for Physics, which is supported by National Science Foundation grant PHY-1607611. This work was partially supported by a grant from the Simons Foundation. \software{ Astropy \citep{astropy, astropy:2018}, galpy \citep{Bovy2015}, gala \citep{gala, gala-v1_3}, IPython \citep{ipython}, matplotlib \citep{mpl}, numpy \citep{numpy}, scipy \citep{scipy}, pandas \citep[][]{pandas}. }
\section{Introduction} \label{intro} Two important examples of $\mathcal{NP}$-Hard Combinatorial Optimisation Problems (COP) are the Travelling Salesman Problem (TSP) and Quadratic Assignment Problem (QAP). The TSP requires finding the shortest route to visit all enlisted locations \cite{TSPformulation}, while the QAP aims to find the minimum cost of allocating facilities to locations \cite{10.2307/1907742}. Both TSP and QAP can be translated to solve numerous industry challenges. Common TSP real-world applications found in the literature include X-ray crystallography \cite{BLAND1989125}, computer wiring \cite{lenstra1975some}, and various routing and scheduling problems \cite{dantzig1959truck,laporte1992traveling}. Similarly, some use cases of the QAP formulation include energy system problems \cite{ajagekar2019quantum}, backboard wiring \cite{burkard1998quadratic}, typewriter keyboard design \cite{burkard1977entwurf}, the hospital layout challenge \cite{elshafei1977hospital}, and campus building arrangement \cite{dickey1972campus}. Solutions to these combinatorial problems have been extensively studied using various optimisation techniques implemented on classical devices \cite{laporte1992traveling,burkard1998quadratic}. For example, recent classical literature points to advancement in selected TSP and QAP applications; such as Particle Swarm Optimisation (PSO) for the generation design of non-trivial flat-foldable origami tessellations with degree-4 vertices \cite{chen2021particle}; Ant Colony Optimisation (ACO) for optimal skeletal structures and novel form-finding of tensegrity structures \cite{chen2012novel}; graph theory and mixed-integer linear programming for assigning mountain-valley fold lines of flat-foldable origami patterns based \cite{chen2020assigning}. However, recent advances in Quantum technology have led to the investigation of these quantum devices' performance when applied to various COP instances. Specifically, through the use of Noisy Intermediate-Scale Quantum (NISQ) technology, preliminary findings for both the TSP \cite{warren2017small,srinivasan2018efficient} and QAP \cite{ajagekar2019quantum} have been reported. Furthermore, a detailed and comparative investigation into the performance of the Variational Quantum Eigensolver (VQE) algorithm run on these NISQ devices against classical devices \cite{chieza2020computational} showed the classical optimisation techniques significantly outperform the suite of IBM devices utilised. In this paper, we extend the state-of-the-art benchmarks reported in \cite{chieza2020computational} by including the newest and largest current IBM devices available. We further introduce preliminary findings for the Quantum Approximate Optimisation Algorithm (QAOA) on amenable tractable problem instances. Additionally, we present a feasibility metric and a new metric to determine the spectrum of the feasibility of quantum algorithms on the ensemble of IBM devices. Finally, we investigate the computational performance improvements by utilising the \textit{conditional reset} feature on the IBM systems over those used in \cite{chieza2020computational}. The remainder of the paper is organised as follows. Section~\ref{sec:background} presents the complexity classification and the formulation of the TSP and QAP. Section~\ref{sec:solution_techniques} discusses the techniques and algorithms used for both the classical and Quantum devices. Section~\ref{sec:methodology} details the experimental procedure and settings used in conducting the experiments. Results and analysis are presented in Section~\ref{sec:results}, with conclusions drawn in Section~\ref{sec:conclusion}. \section{Background}\label{sec:background} The TSP has been extensively studied and reviewed. Seminal research of the TSP occurred in 1959 with the Dantzig-Fulkerson-Johnson (DFJ) \cite{TSPformulation} formulation, detailing how the TSP problem instances of up to 52 locations could be solved using an exact algorithm. The DFJ formulates the TSP as an Integer Linear programming (ILP) and then utilises an exact cutting-plane algorithm to solve the LP relaxation of the ILP. The TSP forms the basis of many complex COP that model the intricacies of real-world scenarios. The complexity class of the TSP is $\mathcal{NP}$-Hard \cite{Korte2012}, which makes it intractable to exactly solve the problem using deterministic algorithms as the problem size scales. Therefore, research developments of the TSP have turned the focus on non-deterministic heuristic and meta-heuristic methods. One of the most effective heuristics in the literature is the Lin-Kerninghan (LK) algorithm \cite{lin1973effective}, which utilises an adaptive algorithm that consists of swapping the edges of sub-tours to create a new tour with an overall minimal distance. Other notable heuristics and meta-heuristic algorithms which have been applied to the TSP include; the Simulated Annealing (SA) algorithm \cite{kirkpatrick1983optimization}, Gene Expression Programming \cite{ferreira2001gene}, and the Ant Colony Optimisation algorithm \cite{dorigo2006ant}. These algorithms perform well in the literature, and ongoing research is often an extension, adaptation or combination of these fundamental and well-known algorithms \cite{zhou2019traveling}. The QAP was first formulated by Koopmans and Beckmann (1957)~\cite{10.2307/1907742}. It found importance due to the added relative cost of assignment with a quadratic objective function to solve assignment class problems, a phenomenon prevalent in industry \cite{10.2307/1907742}. Practically, the QAP is primarily solved via heuristics as similar to the TSP; the problem becomes intractable as the problem instances scale in size. The \href{http://anjos.mgi.polymtl.ca/qaplib/}{QAPLIB} documents a set of QAP benchmark problems and their best solutions as reported in the literature. \href{http://anjos.mgi.polymtl.ca/qaplib/}{QAPLIB} records the following methods as most effective on large instances of the QAP: Branch and Bound \cite{lawler1963quadratic}, Tabu Search \cite{taillard1991robust} and Ant Colony Optimisation \cite{dorigo2006ant,stutzle1997max}. Using quantum computing methods to solve the TSP and the QAP begins with Computational Complexity Theory. As previously mentioned, the TSP and the QAP are both $\mathcal{NP}$-hard problems \cite{Korte2012,sahni1976p}, which means that as the problem scales in size, it becomes difficult for a classical computer to find an optimal solution in polynomial time \cite{burkard1998quadratic}. Quantum Complexity Theory describes the computational complexity of quantum computers. Quantum Complexity Theory is necessary because there are problems too complex to solve with classical computing methods that quantum computers can theoretically solve \cite{bernstein1997quantum} and these problems computational complexity requires description. Between a classical probabilistic Turing machine and a Quantum Turing Machine (QTM), a polynomial-time QTM is more powerful in certain search algorithms \cite{bennett1997strengths,bernstein1997quantum,deutsch1985quantum}. A basic search algorithm for optimisation problems has complexity $\mathcal{O}(2^n)$ on a classical computer while a quantum search algorithm for an $\mathcal{NP}$-Complete problem reduces this to complexity $\mathcal{O}(\sqrt{n})$ \cite{grover1997quantum,montanaro2016quantum,ronnow2014defining}. Therefore, there is reason to believe that there may be a speed-up from quantum computing when applied to optimisation problems. \subsection{Mathematical Model} \subsubsection{Travelling Salesman Problem} The TSP has multiple mathematical formulations \cite{Korte2012}, however, the DFJ formulation \cite{TSPformulation} has the ability to form a strong LP relaxation which makes it the preferred formulation of the TSP. This formulation is given as follows: \begin{equation}\label{eq1} \min \sum_{i = 1}^{n} \sum_{j=1}^{n} d_{ij}x_{ij} \end{equation} Subject to: \begin{equation}\label{eq2} \sum_{j = 1}^{n}x_{ij} = 1 , \hspace{0.5cm}i = 1,...,n, \end{equation} \begin{equation}\label{eq3} \sum_{i = 1}^{n}x_{ij} = 1 , \hspace{0.5cm} j = 1,...,n, \end{equation} \begin{equation}\label{eq4} \sum_{i,j \in S}x_{ij} \leq \lvert S \rvert - 1, \end{equation} \begin{equation}\label{eq5} S \subset{V} , 2 \leq \lvert S \rvert \leq n - 2, \end{equation} \vspace{-0.35cm} \begin{equation}\label{eq6} x_{ij} \in \{0,1\} , \end{equation} \vspace{-0.35cm} \begin{equation}\label{eq7} i,j = 1,...,n \qquad i \neq j. \end{equation} Equation~\eqref{eq1} is the objective function that seeks to minimise the total travelled distance, subject to constraints~(\ref{eq2}-\ref{eq7}). The distance between city $i$ and city $j$ can be denoted in the form of a distance matrix by $d_{ij}$. The binary decision variable, $x_{ij}$, indicates whether a path between cities $i$ and $j$ exists. Constraint~(\ref{eq2}) and constraint~(\ref{eq3}) prevent any city from being visited more than once. The sub-tour elimination constraints~(\ref{eq4}) and constraint~(\ref{eq5}) ensure that all cities of a TSP problem are visited, where $S$ is a subset of the $n$ cities. Because the sub-tour-elimination constraints' variables grow exponentially, it is intractable to directly solve the DFJ formulation. For every value of $n$, there is $2^{n} -2n -2$ sub-tour-elimination constraints and $n(n-1)$ binary decision variables. \subsubsection{Quadratic Assignment Problem} To mathematically model the QAP, weights are defined for the cost associated with moving goods between location $k$ and $l$ ($b_{kl}$) and factories $k$ and $l$ ($c_{kl}$) \cite{10.2307/1907742}. The cost function is then calculated by finding the product of the associating costs of allocated factories to locations. This allocation is denoted by a permutation function $\pi$ that records which factories are allocated to which locations. The elements in $\pi$ are the factory number allocated to the location represented by its position in the vector. The QAP objective function is: \begin{equation} \mbox{min} \quad \sum_{k=1}^{n} \sum_{l=1}^{n} b_{kl}c_{\pi(k),\pi(l)}, \label{eq:prob} \end{equation} where $b$ and $c$ are matrices of dimensions $n \times n$ \cite{burkard1998quadratic}. The full form of the objective function is: \begin{equation} \sum_{k=1}^{n} \sum_{l=1}^{n} b_{kl}c_{\pi(k),\pi(l)} + \sum_{k = 0}^{n} a_{k,\pi(k)}, \end{equation} where the value $a_{kl}$ represents the cost of allocating factory $k$ to factory $l$ is known as the ``cost of assignment". This additional cost term is omitted in the benchmark formulations for ease of calculation \cite{burkard1998quadratic}. The QAP is a quadratic optimisation problem because of its quadratic objective function. The QAP is also a bijection of a finite set $\mathcal{N}$ because unique position values from set $\mathcal{N}$ are allocated as elements of $\pi$ \cite{burkard1998quadratic}. This characteristic means that the QAP can have a ``0-1" integer optimisation problem formulation \cite{burkard1998quadratic,lawler1963quadratic}. This ``0-1" integer formulation is the version used to solve the QAP with quantum computing. \subsubsection{Quantum formulations} To apply quantum algorithms to find solutions of COP problems using a quantum devices, the problems’ objective function first needs to be mapped to a Hamiltonian form \cite{QiskitTextbook:2020}. The respective Hamiltonian of Ising model formulation mappings of the TSP and QAP, described in Section~\ref{sec:background}, are presented in this section. The objective and constraints of the TSP can be described by: \begin{eqnarray}\label{eqn:TSP_quantumFormulation} &&\sum_{i,j}d_{ij}\sum_{p}x_{ip}x_{jp+1}\nonumber \\ &+& A\sum_{p}\left(1-\sum_{i}x_{ip}\right)^{2} +A\sum_{i}\left(1-\sum_{p}x_{ip}\right)^{2}. \end{eqnarray} Similarly, the QAP can be described by: \begin{eqnarray}\label{eqn:QAP_quantumFormulation} &&\sum_{m=1}^{n}\sum_{u=1}^{n}\sum_{k=1}^{n}\sum_{l=1}^{n} C_{lk}T_{um}x_{ul}x_{mk} \nonumber \\ &+&B\sum_{l}\left(1-\sum_{u}x_{ul}\right)^{2}+ B\sum_{u}\left(1-\sum_{l}x_{ul}\right)^{2}, \end{eqnarray} by assigning $$ x_{ip} \rightarrow (1 - Z_{ip})/2, $$ and $$ x_{ul} \rightarrow (1 - Z_{ul})/2, $$ where $Z_{ij}$ is a Pauli operator that maps the TSP to a Hamiltonian, and $Z_{ul}$ is a Pauli operator that maps the QAP to a Hamiltonian \cite{QiskitTextbook:2020,lucas2014ising,ajagekar2019quantum}. $A$ and $B$ are free parameters that satisfy the constraints. The VQE and QAOA algorithms are used to find the ground state of the respective Hamiltonian systems for the TSP and QAP, described by equation~(\ref{eqn:TSP_quantumFormulation}) and equation~(\ref{eqn:QAP_quantumFormulation}). The ground state is where the expectation value of the energy state is the lowest. Both quantum algorithms, VQE and QAOA, applied to the TSP and QAP use variational methods which consist of selecting a variational form. This method depends on finding one or more parameters to find approximations to the ground state. Simply, this describes an ansatz in the form of a parametrised circuit. The accuracy of solutions depends on the variational form \cite{moll2018quantum}. The depth of the variational form is the exponential to the number of qubits, hence the parameters of a variational form exponentially increase with the number of qubits. Due to the limited number of qubits currently available on NISQ devices, the size of the problem instances considered is restricted \cite{Rattew2019ADN}. The VQE algorithm was proposed by \cite{peruzzo2014variational} to approximate the ground state energy of a molecule \cite{QiskitTextbook:2020} and early applications of VQE to chemistry problems were predominantly studied. Recently, the literature on the VQE applications has been extended to solve COP \cite{moll2018quantum,verteletskyi2020measurement}. Preliminary results using NISQ technology to find solutions to the QAP are shown in \cite{ajagekar2019quantum}. The VQE algorithm’s performance is benchmarked against classical algorithms, SA and BNB, for the TSP and QAP in \cite{chieza2020computational}. The findings in \cite{chieza2020computational} show that the classical algorithms SA and BNB outperform the VQE algorithm with reference to both solution quality and computational time. This work aims to expand on \cite{chieza2020computational}, by introducing additional metrics to measure solution quality and comparing the results to the COPs obtained using the VQE algorithm to an additional quantum algorithm, QAOA. Recent developments on the QAOA are outlined in \cite{zhou2020quantum}, and applications of the QAOA to solve the Maxcut, a prominent COP, have been investigated \cite{crooks2018performance,farhi2017quantum,harrigan2021quantum}. The literature on the QAOA includes studies to improve the QAOA using graph theory to optimise the solving of the Hamiltonian \cite{verteletskyi2020measurement}, and the $p$-value approach \cite{farhi2020quantum}. \section{Solution Techniques}\label{sec:solution_techniques} This section discusses classical and quantum techniques used to obtain solutions to the TSP and QAP. \subsection{Branch and Bound}\label{sec:BNB} The Branch and Bound (BNB) algorithm is an exact algorithm that reduces the computational runtime of obtaining a solution as it indirectly computes all possible combinations of a given COP \cite{MORRISON201679}. The BNB first solved a discrete $\mathcal{NP}$-hard optimisation problem \cite{land2010automatic}, namely the British Petroleum TSP problem. The BNB represents optimal and sub-optimal solutions in the form of a tree data structure constructed with multiple levels of artificial nodes. Each node represents a calculated distance for the TSP \cite{gavett1966optimal}, and an allocation permutation vector $\pi$ and product of distance and flow for the QAP \cite{clausen1999branch}. At each level, the node with the lowest value is further explored and broken into sub-problems. This iterative process is terminated when a complete tour is formed for the TSP, and a suitable permutation matrix is formed for the QAP. Nodes are selected to explore using the best-first strategy, which entails comparing the rolling cost function values between levels to explore further which nodes to explore. The efficiency of the BNB algorithm depends on an appropriate estimation of the lower bound. As a result, a suitable bound should first be calculated before implementing the BNB algorithm. \subsection{Simulated Annealing}\label{sec:SA} SA is a stochastic optimisation technique for approximating the global optimum of a given objective function. This technique is based on the concept of annealing, which comes from metallurgy and statistical physics. Annealing is the idea of slowly cooling down a metal (initially at a high temperature) to ensure that the metal particles are orderly arranged to strengthen the metal \cite{burkard1998quadratic}. SA was designed to solve COP \cite{kirkpatrick1983optimization}. The algorithm commences with an initial random solution and a high temperature. A cooling schedule controls the decrease of the temperature \cite{kirkpatrick1983optimization}. SA is built on the Metropolis Algorithm \cite{hastings1970monte,metropolis1953equation} which is moderated by a decreasing temperature parameter. A slow decrease in the temperature allows SA to explore the search space irrespective of the quality of the solution. This decrease in the temperature helps to prevent local optimal solutions \cite{van1987simulated}. At each temperature, a neighbourhood search algorithm generates a solution. That updated solution's cost is compared to the rolling best solution. If the randomly generated solution is worse than the current best solution, the randomly generated solution becomes the new best solution. A Markov Chain is included in SA to moderate the temperature \cite{van1987simulated}. This process ends at ``the ground state'' (the lowest temperature value allowed), revealing the best solution found \cite{wilhelm1987solving}. \subsection{Variational Quantum Eigensolver}\label{sec:VQE} The VQE algorithm is a quantum-classical hybrid algorithm that has two components, a quantum sub-routine and a classical loop \cite{peruzzo2014variational}. The VQE algorithm's objective is to find the ground state, or the minimum eigenvalue of the Hermitian matrix \cite{QiskitTextbook:2020}. The Hermitian matrices are suitable for describing the Hamiltonian $H$ of quantum systems, which represents the total energy of a considered system. The Hamiltonian system of a given COP can be described by: \begin{equation} H = \Sigma_{\alpha}h_{\alpha}\otimes_{j = 1}^{N}\sigma_{\alpha_{j}}^{(j)}, \end{equation} where $\sigma_{\alpha}$ is the Pauli matrix acting in the Hilbert space, $\otimes$ is a tensor product of Pauli matrices and $h_{\alpha}$ is the Hamiltonian coefficient. The VQE is an iterative algorithm used to find the lowest eigenstate of the Hamiltonian system. The output of the quantum subroutine is used to update the ansatz. The ansatz of the VQE algorithm, which is classically prepared, are the parameterised trial states $\ket{\psi(\theta)}$. The quantum subroutine calculates and returns the expectations of the energy of the provided ansatz or the measured Hamiltonian. The expectation value is measured such that it satisfies the variational principle, which states that the expectation value is always greater than or equal to the ground state of the system \cite{peruzzo2014variational}. The Rayleigh-Ritz variational principle states: \begin{equation} \bra{\psi(\Vec{\theta)}}H\ket{\psi(\Vec{\theta)}} \leq \bra{\psi(\theta_0)}H\ket{\psi(\theta_0)} = E_0 \>, \label{eq:RRvar} \end{equation} where $\ket{\psi(\theta)}$ is any parametrised trial state and $E_0$ is the ground state. This principle ensures that VQE converges to the lowest possible eigenstate \cite{peruzzo2014variational}. The variational method is a robust method for quantum computing, as unlike modern classical computing or theoretical quantum computing, NISQ technology is susceptible to significant errors as a result of noise \cite{QiskitTextbook:2020}. This noise is due to the sensitivity of qubits to the environment and hardware limitations of hardware \cite{murali2019noise}. However, even with accounting for noise, the VQE algorithm's solutions will not overshoot the minimum, provided the ansatz of $\Vec{\theta}$ includes the ground state \cite{moll2018quantum}. This is an advantage that makes the black-box optimiser, VQE, robust to noise. Classical algorithms are applied to minimise the measured Hamiltonian state's expectation value by updating the parameter values. This occurs within the classical loop by finding the optimal set of $\theta$ parameters. Qiskit has an array of optimisers available, including COBYLA, LBRFGS and RBTOpt. The optimiser selected is based on the VQE circuit's depth, which is to be executed \cite{QiskitTextbook:2020}. The VQE is a variational algorithm that favours short-depth circuits, which can be executed on NISQ devices \cite{Rattew2019ADN}. However, the VQE's heuristic nature does not guarantee the global optimal solution \cite{moll2018quantum}. The VQE algorithm’s performance depends on the variational form, a classical optimiser and the number of shots for each experiment. The variational form is the initial circuit that approximately determines the ground state of the Hamiltonian system. The type of circuits options available, on Qiskit, to represent the variational form are: \textsc{TwoLocal} (TL) circuit (linearly entangled, with an RY-gate layer) and the \textsc{RealAmplitudes} (RA) circuit (linear entanglement). A disadvantage of variational algorithms implemented on gate-model quantum computers like IBM's, is that they are predisposed to barren plateaus. Barren plateaus are where the gradient of the objective function exponentially decreases as a function of the number of qubits \cite{grant2019initialization}. These occur when using classical gradient descent methods, and there is no change in objective value \cite{mcclean2018barren}. A large circuit's average value of the gradient of the objective function is zero in barren plateaus, which means a solution cannot be obtained \cite{grant2019initialization}. \subsection{Quantum Approximate Optimisation Algorithm} The Quantum Approximate on Algorithm (QAOA) was introduced by \cite{farhi2014quantum} and, like the VQE, is based on the Variational Principle but has a unique trial state selection. Where VQE chooses a generic trial function $\ket{\psi(\theta)}$, the QAOA uses a Hamiltonian to build the trial function \cite{willsch2020benchmarking}. A Hamiltonian is used to described a cost function $C(x)$. The QAOA begins by finding a trial state $\ket{\psi_{p}(\gamma,\beta)}$ with real parameters $\gamma$ and $\beta$ such that the expectation value of the Hamiltonian is satisfied, \begin{equation} \min F_{p}(\gamma,\beta) = \bra{\psi_{p}(\gamma,\beta)}H\ket{\psi_{p}(\alpha,\beta)} \end{equation} The trial state that depends on the parameters $\gamma$ and $\beta$, is prepared on a quantum computer and measured in the computational basis. Then a bit string $x^{n}$ is obtained. Continuous repetition of this process using the same value of $\gamma$ and $\beta$ will produce an optimal bit string $x^{*}$. This bit string, when measured in the computational basis, can be shown to have a high probability of minimising the cost function $C(x^{*})$. The integer, $p$, determines the circuit's depth level where each trial state is prepared. The depth level of the circuit is described by $p$ where $p \ge 1$ and the accuracy of the QAOA is said to improve as $p$ increases \cite{zhou2020quantum}. Unlike VQE, QAOA has no initial variational form \cite{QiskitTextbook:2020}. Therefore, QAOA is less configured, making it potentially more effective at converging. On the other hand, QAOA using quantum computers to prepare parameters means it uses more quantum functions and exposes the results to more error \cite{QiskitTextbook:2020,streif2020training}. \setlength\extrarowheight{1.05pt} \renewcommand{\arraystretch}{1.05} \begin{table*} \centering \caption{Description of the IBM Basis Gates}\label{tab:quantum_gates} \begin{tabular}{|c|l|} \toprule\hline \textbf{IBM Devices' Gates} & \textbf{Description}\\ \hline\hline Controlled NOT gate (CX) & Creates entanglement if target qubit is in superposition \\ Identity gate (ID) & No operation is performed on a qubit \\ RZ & Rotation of qubit state around z axis\\ Square Root of X gate (SX) & Creates superposition on qubit in downstate\\ X & Changes state of qubit from down state to up state and vice versa \\ \hline\bottomrule \end{tabular} \end{table*} \setlength\extrarowheight{1.0pt} \renewcommand{\arraystretch}{1.00} \subsection{New Set of Basis Gate on IBM Quantum Devices} Quantum algorithms are often graphically represented as quantum circuits in the literature \cite{harrigan2021quantum}. Logic gates are used to describe the computational operations which change a state of a qubit in a quantum circuit \cite{QiskitTextbook:2020,zahedinejad2017combinatorial}. Some of the most common and basic quantum gates are the Hadamard gate and the Controlled NOT (CX) gate. The new set of basis gates on the IBM quantum devices currently consists of the (CX, ID, RZ, SX, X); these recently changed from (CX, ID, U1, U2, U3) the original set of basis gates \cite{QiskitTextbook:2020}. The recent change to the IBM quantum gates is a conditional reset. The conditional reset feature initialises qubits in the $\ket{0}$ state through measuring, followed by a conditional NOT (CNOT) gate. Conditional reset allows faster circuit execution by reducing the initialisation time between shots - i.e. we would predict a decrease in computation time. Conditional reset also allows qubit reuse for circuits requiring a source of ``fresh ancillas". Ancillas moderate the interaction of qubits in a quantum register. Qubit reuse should make calculating circuits more efficient. IBM implemented state-discrimination logic in control systems to decode qubit states from received microwave pulses. Over 1 $\mu$s, the control identifies the qubit states and executes the qubit reuse. Enabling hardware state discrimination negates the necessity for discrimination calibration circuits (these were previously attached to each job). It, therefore, can be predicted that the conditional reset should improve the quality of results on the metrics investigated. \section{Methodology}\label{sec:methodology} \subsection{Experimental Settings}\label{sec:experimental} An Intel$^{\tiny\text{\textregistered}}$ Core\texttrademark\ i5-6200U CPU @ 2.30GHz 4GB 64 bit Microsoft Windows 10 operating system was used to obtain the classic results on Python 3.6.5. Quantum algorithms are from the Aqua library on the open-source Python framework - \href{https://qiskit.org/}{Qiskit}. The IBM Quantum Experience Cloud was used to run all quantum experiments across various IBM simulators and quantum devices. The latest Qiskit version (0.23.3) allows access to devices with improved operational gates; however, to compare the performance of IBM quantum hardware on COP, an older version of Qiskit (0.20.0), in addition to the new version, was used. The programme for all experiments can be found on \href{https://github.com/QuCO-CSAM}{Github}. \subsubsection{Algorithm Implementation} The Qiskit framework has a library called Qiskit Aqua that supports quantum algorithms like the VQE and QAOA. The parameters associated with the VQE and QAOA have different functions that affect their overall performance when applied to a COP. The variational form is one such parameter. This parameter approximates a circuit that determines the ground state of a Hamiltonian system. The \textsc{TwoLocal} and \textsc{RealAmplitude} circuits were used in this research for the VQE. Unlike the VQE, where a variational form can be configured, the QAOA develops its own variational form. The Qiskit variational form for the QAOA depends on a $p$-value, which determines the parametrised circuit's depth. To increase optimality, a $p$-value of 3 is set for the QAOA on both the TSP and QAP. The number of shots, which provides a distribution of the results, is another parameter that affects the VQE and QAOA performance. The default number of shots for the VQE and QAOA is set at 1024 and 8192 respectively. Considering that the expectation value of a quantum state is optimised through classical optimisers, the Simultaneous Perturbation Stochastic Algorithm (SPSA) is recommended for variational quantum algorithms \cite{QiskitTextbook:2020}. Because of the various states that occur with probability, the state with the most probable feasible solution is chosen as the final solution. For the quantum experiments, a simulator, using the Matrix Product State (MPS), was used to find a good enough initial point that was used on the actual quantum devices. The MPS method uses a compact form to formulate two-qubit gate operations which implement the VQE \cite{QiskitTextbook:2020}. The strength of the initial point results in an estimation of solutions that are in the neighbourhood of the optimal solution and provides a higher probability of converging to the optimal solution, this is especially true for the VQE \cite{moll2018quantum}. Classical simulators do not experience as much noise compared to actual quantum devices hence obtaining an initial point through the simulators will increase the performance of the quantum algorithms when applied to actual quantum devices. These quantum devices (seen in Table~\ref{tab:quantum_devices}) are limited to the number of qubits they support (i.e. $n$ cities/locations uses $n^2$ qubits) as well as the depth of a circuit. Using Discrete Optimisation CPLEX (DOcplex), the ``0-1" integer formulation of the QAP can be converted into a Quadratic Program. The Quadratic Program model can easily be mapped to a Hamiltonian using a Qiskit module. The ``0-1" integer formulation for the TSP is directly mapped to a Hamiltonian using a Qiskit module. The \textsc{BuildModel} function in Algorithms~\ref{al:VQE} and \ref{al:QAOA} represents these processes of building a Hamiltonian. The Variational Quantum Eigensolver (VQE) consists of three functions. The first is the fitness function using the ``0-1" formulation of the QAP. The following function is a feasibility verifier where the permutation matrix $x$ is checked against the constraints of the integer formulation of the QAP (a facility can only be assigned to one location and vice versa). Thirdly, the VQE has a function that returns all the feasible solution eigenstates and their accompanying probabilities. Since the VQE returns a distribution of probabilities for a suite of solutions, this function lists the returned eigenstates that are feasible along with their associated probability. This last function is called \textsc{FeasibleOutput} in Algorithm~\ref{al:VQE}. When using quantum computers as the backend, they are accessed through an IBM account, and the commands and results are sent via the internet. Algorithm~\ref{al:VQE} shows the implementation of VQE. Variational methods hold promise in solving optimisation problems given their potential to find the ground state of a Hamiltonian system, which encodes the optimisation problem. Therefore, the parameter selection for these methods is pertinent and should be further investigated in future work. For example, the impact of the employed $p$-value used in QAOA should be investigated. Furthermore, the emphasis placed on the initial solution used and its significance suggests that future work consider alternative techniques to find improved initial solutions. \begin{algorithm}[H] \begin{algorithmic}[1] \Require \State{\texttt{inputmatrix(ces)}, \texttt{circ}, \texttt{initialpoint}, \texttt{maxiter}} \Ensure \State{\texttt{$\pi^*$}, \texttt{$cost^*$} } \State{initialisation;} \State{\texttt{qubitOpdocplex} = \textsc{BuildModel}(\texttt{inputmatrix(ces)})} \State{\texttt{num} = number of qubits of \texttt{qubitOpdocplex}} \State{\texttt{spsa} = \textsc{SPSA}(\texttt{maxiter})} \If{\texttt{circ} = RA} \State{\texttt{ry} = \textsc{RealAmplitudes}(\texttt{um}, \texttt{entanglement=linear})} \ElsIf{\texttt{circ} = TL} \State{\texttt{ry} = \textsc{TwoLocal}(\texttt{num}, \texttt{entanglement=linear)}} \EndIf \State{\texttt{vqe} = \textsc{VQE}(\texttt{qubitOpdocplex}, \texttt{ry}, \texttt{spsa}, \texttt{initialpoint})} \State{\texttt{quantuminstance} = \textsc{Backend}(1024 shots)} \State{\texttt{result} = \textsc{Run}(\texttt{vqe},\texttt{quantuminstance})} \State{\texttt{$\pi^*$}, \texttt{$cost^*$} = \textsc{FeasibleOutput}(\texttt{result[eigenstate]})} \end{algorithmic} \caption{Variational Quantum Eigensolver (VQE)} \label{al:VQE} \end{algorithm} \begin{algorithm}[H] \begin{algorithmic}[1] \Require \State{\texttt{inputmatrix(ces)}, \texttt{initialpoint}, \texttt{maxiter}} \Ensure \State{\texttt{$\pi^*$}, \texttt{$cost^*$}} \State{initialisation;} \State{\texttt{qubitOpdocplex} = \textsc{BuildModel}(\texttt{inputmatrix(ces)})} \State{\texttt{num} = number of qubits of \texttt{qubitOpdocplex}} \State{\texttt{spsa} = \textsc{SPSA}(\texttt{maxiter})} \State{\texttt{qaoa} = \textsc{QAOA}(\texttt{qubitOpdocplex}, \texttt{spsa}, \texttt{initialpoint})} \State{\texttt{quantuminstance} = \textsc{Backend}(1024 shots)} \State{\texttt{result} = \textsc{Run}(\texttt{qaoa},\texttt{quantuminstance})} \State{\texttt{$\pi^*$}, \texttt{$cost^*$} = \textsc{FeasibleOutput}(\texttt{result[eigenstate]})} \end{algorithmic} \caption{Quantum Alternating Optimisation Ansatz (QAOA)} \label{al:QAOA} \end{algorithm} \setlength \extrarowheight{1.5pt} \renewcommand{\arraystretch}{1.05} \begin{table*}[htbp] \centering \caption{Specifications of the IBM Quantum Devices\label{tab:quantum_devices}} \resizebox{0.95\textwidth}{!}{ \begin{tabular}{|c|c|c|c|c|c|c|c|} \toprule\hline \textbf{Quantum Device} & \textbf{Version} & \textbf{Available Qubits} & \textbf{Max Shots} & \textbf{Max Circuits} & \textbf{Processor Type} & \textbf{Average Readout Error} & \textbf{Average CNOT Error} \\ \hline\hline ibmq\_johannesburg & 1.2.2 & 20 & 8192 & 900 & Penguin R3 & 8.412e-2 & - \\ \hline ibmq\_boeblingen & 1.2.9 & 20 & 8192 & 900 & Penguin R4 & 5.258e-2 & - \\ \hline ibmq\_montreal & 1.9.7 & 27 & 8192 & 900 & Falcon R4 & 2.067e-2 & 1.010e-2 \\ \hline ibmq\_cambridge & 1.2.0 & 27 & 8192 & 900 & Falcon R1.1 & 12.682e-2 & - \\ \hline ibmq\_sydney & 1.0.37 & 27 & 8192 & 900 & Falcon R4 & 3.876e-2 & 1.291e-2 \\ \hline ibmq\_toronto & 1.4.22 & 27 & 8192 & 900 & Falcon R4 & 4.253e-2&1.157e-2 \\ \hline ibmq\_rochester & 1.2.0 & 53 & 8192 & 75 & Hummingbird R1 & 14.448e-2& - \\ \hline ibmq\_manhattan & 1.19.1 & 65 & 8192 & 900 & Hummingbird R2 &3.843e-2&1.541e-2 \\ \hline\bottomrule \end{tabular} } \begin{tablenotes}\footnotesize \item [-] Omitted Average CNOT Error values of decommissioned IBM quantum devices. Further details of these devices can be found \href{https://github.com/Qiskit/qiskit-terra/tree/master/qiskit/test/mock/backends}{here}. \end{tablenotes} \end{table*} \subsection{Metrics} CPU time is used to measure the solution quality of the deterministic BNB algorithm used on the TSP and QAP. The stochastic nature of heuristic algorithms expands the number of performance measures that can test solution quality. In each experiment, 30 trials are executed, and two success rates (SR) and a feasibility percentage are recorded. The SR metric describes the percentage amount of the trials within 95\% and 99\% of the optimal global solution. The feasibility percentage details the percentage of trials that generate a feasible solution. This paper will also look into a metric that is specific to quantum results. As briefly mentioned in Section~\ref{sec:VQE}, the number of shots details the number of times a quantum algorithm is repeated. By default, the number of shots was set to 1024 for the VQE and QAOA. This implies that a quantum algorithm is repeated as many times as the shots for any particular instance. This leads to a distribution of all the results obtained for that specific instance. The optimal solution for a particular trial is the most probable feasible quantum eigenstate in that distribution. This paper expands that idea introduced in \cite{chieza2020computational} by considering a new metric called the \textit{uncertainty percentage}. This uncertainty percentage tests the quantum solution's quality by looking at how likely it is that solution can be obtained. An uncertainty percentage is calculated for each feasible solution in a set of 30 trials. This uncertainty percentage is based on the frequency of the quantum eigenstate. The uncertainty percentage analysis includes the average probability from the set, the maximum and minimum probability rates, and the standard deviation (note the headings in Table \ref{tab:newmetric}). In addition to the SR, feasibility rate and uncertainty percentage, the average CPU time is computed. IBM quantum devices are subject to calibration where a device is taken offline for performance testing. This does affect the CPU time on a device for any particular experiment. As a result, two types of CPU time performances are recorded: the average CPU time with outliers (AT) and the average CPU time without outliers (MT). \begin{figure*} \centering \begin{subfigure}[t]{0.475\textwidth} \raggedleft \begin{tikzpicture}[scale=.85] \begin{semilogyaxis}[ xtick={3,4,5}, xlabel=Input matrices dimensions, ylabel=Time taken to run (s), title=TSP on ibmq\_sydney, legend pos=north east, legend style={at={(0.5,-0.2)}, anchor=north,legend columns=2} ] \addplot[color=darkcyan,mark = square*] coordinates { (3,171.65) (4,202.40) (5,263.23) }; \addlegendentry{new basis gates MT} \addplot[color=darkcyan!50,mark = square*, dashed] coordinates { (3,5474.48) (4,817.91) (5,263.23) }; \addlegendentry{new basis gates AT} \addplot[color=darkred,mark = triangle*, ] coordinates { (3,255.25) (4,14007.94) (5,594.93) }; \addlegendentry{original basis gates MT} \addplot[color=darkred!50,mark = triangle*,dashed] coordinates { (3,4125.49) (4,341.72) (5,1982.69) }; \addlegendentry{original basis gates AT} \end{semilogyaxis} \end{tikzpicture} \label{fig:sydneyTSP} \end{subfigure} \begin{subfigure}[t]{0.475\textwidth} \raggedleft \begin{tikzpicture}[scale=.85] \begin{semilogyaxis}[ xtick={3,4,5}, xlabel=Input matrices dimensions, ylabel=Time taken to run (s), title=TSP on ibmq\_toronto, legend pos=north east, legend style={at={(0.5,-0.2)}, anchor=north,legend columns=2} ] \addplot[color=darkcyan,mark = square*] coordinates { (3,755.40) (4,456.22) (5,469.60) }; \addlegendentry{new basis gates MT} \addplot[color=darkcyan!50,mark = square*, dashed] coordinates { (3,8226.18) (4,715.83) (5,608.42) }; \addlegendentry{new basis gates AT} \addplot[color=darkred,mark = triangle*, ] coordinates { (3,477.47) (4,303.75) (5,473.06) }; \addlegendentry{original basis gates MT} \addplot[color=darkred!50,mark = triangle*,dashed] coordinates { (3,5401.14) (4,436.00) (5,1774.34) }; \addlegendentry{original basis gates AT} \end{semilogyaxis} \end{tikzpicture} \label{fig:torontoTSP} \end{subfigure} \begin{subfigure}[t]{0.475\textwidth} \raggedleft \begin{tikzpicture}[scale=.85] \begin{semilogyaxis}[ xtick={3,4,5}, xlabel=Input matrices dimensions, ylabel=Time taken to run (s), title=QAP on ibmq\_sydney, legend pos=north east, legend style={at={(0.5,-0.2)}, anchor=north,legend columns=2} ] \addplot[color=darkcyan,mark = square*] coordinates { (3,652.57) (4,510.72) (5,2636.32) }; \addlegendentry{new basis gates MT} \addplot[color=darkcyan!50,mark = square*, dashed] coordinates { (3,652.57) (4,768.95) (5,5659.09) }; \addlegendentry{new basis gates AT} \addplot[color=darkred,mark = triangle*, ] coordinates { (3,1360.91) (4,491.77) (5,476.22) }; \addlegendentry{original basis gates MT} \addplot[color=darkred!50,mark = triangle*,dashed] coordinates { (3,3994.68) (4,801.31) (5,845.03) }; \addlegendentry{original basis gates AT} \end{semilogyaxis} \end{tikzpicture} \label{fig:sydneyQAP} \end{subfigure} \begin{subfigure}[t]{0.475\textwidth} \raggedleft \begin{tikzpicture}[scale=.85] \begin{semilogyaxis}[ xtick={3,4,5}, xlabel=Input matrices dimensions, ylabel=Time taken to run (s), title=QAP on ibmq\_toronto, legend pos=north east, legend style={at={(0.5,-0.2)}, anchor=north,legend columns=2} ] \addplot[color=darkcyan,mark = square*] coordinates { (3,586.91) (4,582.44) (5,1014.09) }; \addlegendentry{new basis gates MT} \addplot[color=darkcyan!50,mark = square*, dashed] coordinates { (3,655.30) (4,768.95) (5,1014.09) }; \addlegendentry{new basis gates AT} \addplot[color=darkred,mark = triangle*, ] coordinates { (3,1692.50) (4,337.68) (5,566.01) }; \addlegendentry{original basis gates MT} \addplot[color=darkred!50,mark = triangle*,dashed] coordinates { (3,8586.37) (4,6133.34) (5,917.79) }; \addlegendentry{original basis gates AT} \end{semilogyaxis} \end{tikzpicture} \label{fig:torontoQAP} \end{subfigure} \caption{These plots aim to illustrate the impact on CPU time that the new set of basis gates (CX, ID, RZ, SX, X) have on ibmq\_sydney and ibmq\_toronto for both methods solved with VQE for problems of sizes 3, 4 and 5. The problem instances used are symmetric and are inputs given as $n \times n$ matrices. \label{fig:4gates}} \end{figure*} \begin{figure*} \resizebox{0.95\textwidth}{!}{ \begin{tikzpicture} \begin{semilogyaxis}[ ybar, title=TSP VQE MT with the original basis gates, enlarge x limits=0.125, legend style={at={(0.5,0.82)}, anchor=south, legend columns = 3}, ylabel={Time (s)}, xlabel={Problem Size ($n$)}, symbolic x coords={3,4,5,6,7}, xtick=data, nodes near coords align={vertical}, bar width = 5.0 pt, log origin y=infty, grid=major, width=\textwidth, height=\axisdefaultheight, cycle list/Paired-11, cycle list shift=-5, grid style = {dashed, gray!30}, legend style={at={(0.5,-0.25)}, anchor=north,legend columns=7} ] \addplot[draw=Paired-A,fill=Paired-A!70] coordinates {(3,0.01) (4,0.01) (5,0.01) (6, 0.01) (7, 0.03)};\addlegendentry{BNB}; \addplot[draw=Paired-B,fill=Paired-B!70] coordinates {(3,0.02) (4,0.02) (5,0.02) (6, 0.02) (7,0.02)}; \addlegendentry{SA}; \addplot[draw=Paired-C,fill=Paired-C!70] coordinates{(3,49.34) (4,103.42) (5,214.86) (6,0) (7,0)};\addlegendentry{ibmq\_qasm\_simulator}; \addplot[draw=Paired-D,fill=Paired-D!70] coordinates {(3,1254.48) (4,181.85) (5,0) (6,0) (7,0)};\addlegendentry{ibmq\_johannesburg}; \addplot[draw=Paired-E,fill=Paired-E!70] coordinates {(3,421.42) (4,358.26) (5,392.38) (6,0) (7,0)};\addlegendentry{ibmq\_cambridge}; \addplot[draw=Paired-F,fill=Paired-F!70] coordinates {(3,1442.34) (4,414.31) (5,917.83) (6,0) (7,0)};\addlegendentry{ibmq\_montreal}; \addlegendimage{empty legend}; \addlegendentry{}; \addplot[draw=Paired-G,fill=Paired-G!70] coordinates {(3,505.77) (4,2084.45) (5,1022.47) (6, 2176.15) (7,0)};\addlegendentry{ibmq\_rochester}; \addplot[draw=Paired-H,fill=Paired-H!70] coordinates {(3,143.84) (4,211.68) (5,0) (6,0) (7,0)};\addlegendentry{ibmq\_boeblingen}; \addplot[draw=Paired-I,fill=Paired-I!70] coordinates {(3,528.74) (4,303.75) (5,473.06) (6,0) (7,0)};\addlegendentry{ibmq\_toronto}; \addplot[draw=Paired-J,fill=Paired-J!70] coordinates {(3,255.25) (4,292.52) (5,594.93) (6,0) (7,0)};\addlegendentry{ibmq\_sydney}; \addplot[draw=Paired-L,fill=Paired-L!70] coordinates {(3,300.90) (4,670.67) (5,694.60) (6, 691.01) (7,881.23)};\addlegendentry{ibmq\_manhattan}; \end{semilogyaxis} \end{tikzpicture} } \caption{CPU times (s) for TSP (Log scale) \label{fig:TSPtime}} \end{figure*} \begin{figure*} \resizebox{.95\textwidth}{!}{ \begin{tikzpicture} \begin{semilogyaxis}[ ybar, title=QAP VQE MT with the original basis gates, enlarge x limits=0.125, legend style={at={(0.5,0.82)}, anchor=south, legend columns = 3}, ylabel={Time (s)}, xlabel={Problem Size ($n$)}, symbolic x coords={3,4,5,6,7}, xtick=data, nodes near coords align={vertical}, bar width = 5.0pt, log origin y=infty, width=\textwidth, height=\axisdefaultheight, cycle list/Paired-11, cycle list shift=-5, grid=major, grid style = {dashed, gray!30}, legend style={at={(0.5,-0.25)}, anchor=north,legend columns=7} ] \addplot[fill=Paired-A!70,draw=Paired-A] coordinates {(3,0.01) (4,0.01) (5,0.01) (6,0.03) (7,0.28)};\addlegendentry{BNB}; \addplot[fill=Paired-B!70,draw=Paired-B] coordinates {(3,0.05) (4,0.11) (5,0.14) (6,0.16) (7,0.25)};\addlegendentry{SA}; \addplot[fill=Paired-C!70,draw=Paired-C] coordinates {(3,45.65) (4,45.64) (5,64.05) (6,) (7,)};\addlegendentry{ibmq\_qasm\_simulator}; \addplot[fill=Paired-D!70,draw=Paired-D] coordinates {(3,151.78) (4,342.20) (5,) (6,) (7,)};\addlegendentry{ibmq\_johannesburg}; \addplot[fill=Spectral-E!70,draw=Paired-E] coordinates {(3,400.48) (4,373.68) (5,872.01) (6,) (7,)};\addlegendentry{ibmq\_cambridge}; \addplot[fill=Paired-F!70,draw=Paired-F] coordinates {(3,283.07) (4,367.47) (5,565.01) (6,) (7,)};\addlegendentry{ibmq\_montreal}; \addlegendimage{empty legend} \addlegendentry{} \addplot[fill=Paired-G!70,draw=Paired-G] coordinates {(3,1702.85) (4,1133.78) (5,958.51) (6,2796.73) (7,)};\addlegendentry{ibmq\_rochester}; \addplot[fill=Paired-H!70,draw=Paired-H] coordinates {(3,268.71) (4,873.04) (5,) (6,) (7,)};\addlegendentry{ibmq\_boeblingen}; \addplot[fill=Paired-I!70,draw=Paired-I] coordinates {(3,1692.50) (4,337.68) (5,566.01) (6,) (7,)};\addlegendentry{ibmq\_toronto}; \addplot[fill=Paired-J!70,draw=Paired-J] coordinates {(3,1360.91) (4,491.77) (5,476.22) (6,) (7,)};\addlegendentry{ibmq\_sydney}; \addplot[fill=Paired-L!70,draw=Paired-L] coordinates {(3,557.68) (4,267.96) (5,1318.44) (6, 2967.89) (7,7928.29)};\addlegendentry{ibmq\_manhattan}; \end{semilogyaxis} \end{tikzpicture} } \caption{CPU times (s) for QAP (Log scale)\label{fig:QAPtime}} \end{figure*} \section{Results}\label{sec:results} The performance of the quantum optimisation algorithms benchmarked against classical optimisation algorithms, presented in Table~\ref{tab:results}, \ref{tab:results2} and \ref{tab:newmetric}, and Figures~\ref{fig:TSPtime}, \ref{fig:QAPtime} and \ref{fig:4gates}, are analysed with respect to both solution quality and computational time performance in this section. The experimental results show that classical optimisation algorithms outperform quantum optimisation algorithms with respect to success rate, feasibility and computational time in finding solutions to the TSP and QAP. The solution quality metrics results reported for problem instances of sizes 3 and 4 on the TSP and QAP suggest that the VQE performs better when compared with the QAOA. The solution quality metric results obtained for conditionally reset devices do not have a noticeable difference compared to the metrics of IBM devices that were not conditionally reset. IBM has introduced the conditional reset feature in order to make the quantum device calculations more efficient. The results in Table~\ref{tab:results2} use the gates explained in Table~\ref{tab:quantum_gates} on the devices available with conditional reset on VQE and QAOA. Figure~\ref{fig:4gates} compares the impact of conditional reset on time and for both average times AT and MT on both devices. From Figure~\ref{fig:4gates}, no clear improvement in computational time can be observed between results with or without conditional reset. Furthermore, when comparing the success rates in Table~\ref{tab:results2} to those on the same devices without conditional reset in Table~\ref{tab:results}, there is no improvement in success rate or feasibility. We, therefore, conclude that the implementation of conditional reset did not impact the results obtained. Comparing the computational time taken to obtain a solution using classical algorithms compared to the VQE algorithm, it was found that the applied classical algorithms had a faster computational time performance than the VQE algorithm. Figures~\ref{fig:TSPtime} and \ref{fig:QAPtime} illustrate that the performance of the various employed quantum devices is consistent in terms of computational time, with the simulator performing the best. There is no distinct correlation between problem size and computational time for the quantum devices. However, this claim is made with a limited number of problem instances. Success rate and feasibility are higher in SA than in VQE for most instances of the TSP and QAP, indicating that the SA obtains better solution quality than the VQE. From Table~\ref{tab:results}, it is evident that the success rate and feasibility percentage decrease as the problem size increase. Instances of sizes 3 for the TSP applied to the VQE perform the best in terms of feasibility and success rate out of all the TSP instances. This is likely because the TSP has the least number of operations (Table~\ref{tab:formulations}). Instances of sizes 6 and 7 perform the worst with the most operations and largest parameters. ibmq\_qasm-simulator has a higher feasibility percentage than the quantum devices. Comparing success rate and feasibility between devices shows no device has a superior performance to the others. Comparing the results of the QAOA to those of VQE in Table~\ref{tab:results2}, the QAOA takes a longer computational time performance on the quantum devices than the VQE. This increased computational time is likely due to increased operations and depth (Table~\ref{tab:formulations}). Nevertheless, the success rate and feasibility of the QAOA are comparable to that of VQE. However, it is difficult to make inferences on the QAOA due to the size limitations of the instances and the lack of devices. Table~\ref{tab:newmetric} aims to describe the quality of the feasible trials obtained using the quantum heuristics. Quantum circuits do not return a single answer but a series of eigenstates with corresponding frequencies. The corresponding percentage describes the likelihood of the most probable feasible solution is to be in the result of a given trial. This is unique to the success rate, as it measures the uncertainty of the current trial and not the probability of success for the heuristic. This uncertainty percentage is low across all instances, indicating that most of the returned eigenstates are infeasible and highlight the detriment of noise to solution quality. This accentuates the gap in performance between simulators and the ideal solutions from theoretical quantum computers and the applied algorithms' performance on NISQ devices. There is a correlation between the size of an instance and the uncertainty percentage. Results for VQE and QAOA are comparable when comparing instances of the same size. The results obtained using the VQE algorithm with and without conditional reset are comparable when comparing instances of the same size. Conclusions about the uncertainty percentage cannot be drawn for larger problem instances, as the set of feasible solutions is empty or singular. The NISQ devices are limited by their specifications leading to a limit in the size of the problems that can be solved. Table~\ref{tab:quantum_devices} shows the limited access to qubits that prevents the larger instances from being tested. The other specifications impact error in the results and the computational time is taken to solve circuits. Table \ref{tab:formulations} shows how the size of parameters, number of operations and circuit depth grow with problem size. This phenomenon limits experiments to small instances. Therefore, for the QAOA on both the TSP and QAP, the experiments were run until size instance 4. Instances greater than size 4 cannot be simulated in polynomial time because of the circuit depth and the number of operations produced by those instances. Obtaining a good enough initial point for instances greater than size 4 is intractable on NISQ devices. QAOA uses more operations than VQE for problems of the same size, which may impact why it performs worse than VQE on all metrics. \begin{table*}[htbp] \centering \caption{Specifications of the circuits before transpiling on the quantum devices \label{tab:formulations}} \begin{threeparttable} \begin{tabular}{|c|c|c|c|c|c|c|c|c|} \toprule\hline \textbf{Size} & \textbf{Qubits} & \multicolumn{3}{|c|}{\textbf{TSP}} & \multicolumn{3}{|c|}{\textbf{QAP}} & \textbf{Method}\\ \hline & & \textbf{Par}.\tnote{$\dagger$} & \textbf{Operations} & \textbf{Depth} & \textbf{Par}.\tnote{$\dagger$} & \textbf{Operations} & \textbf{Depth} &\\ \hline\hline \multirow{2}{*}{3} & \multirow{2}{*}{9} & [100, ``TL"] & 103 & 23 & [1000, ``TL"] & 103 & 23 & VQE\\ \cline{3-9} & & [50] & 396 &116 & [100] & 396 & 149 & QAOA\\ \hline \multirow{2}{*}{4} & \multirow{2}{*}{16} & [1100, ``TL"] & 187 & 30 & [3000, ``TL"] & 187 & 30 & VQE\\ \cline{3-9} & & [100] &992 &182 & [50] & 992 & 218 & QAOA\\ \hline \multirow{2}{*}{5} & \multirow{2}{*}{25} & [5500, ``RA"] & 197 & 33& [5000, ``TL"] & 295 & 39 & VQE\\ \cline{3-9} & & - & 2000& 260 & - & 1820 & 227 & QAOA\\ \hline \multirow{2}{*}{6} & \multirow{2}{*}{36} & [5000, ``TL"] & 427 & 50 & [6000, ``TL"] & 427 & 50 & VQE\\ \cline{3-9} & & - & 3528 & 359 & - & 3528 & 312 & QAOA\\ \hline \multirow{2}{*}{7} & \multirow{2}{*}{49} & [10000, ``TL"] & 583 & 63 & [12000, ``TL"] & 583 & 63 & VQE\\ \cline{3-9} & & - & 5684 & 565 & - & 6818 & 540 & QAOA\\ \hline \multirow{2}{*}{8} & \multirow{2}{*}{64} & - & 763 & 78& - & 763 & 78 & VQE\\ \cline{3-9} & & - & 8576 & 590 & - & 10088 & 728 & QAOA\\ \hline \multirow{2}{*}{9} & \multirow{2}{*}{81} & - & 967 & 95 & - & 967 & 95 & VQE\\ \cline{3-9} & & - & 12312 & 722 & - & 15552 & 970 & QAOA\\ \hline\bottomrule \end{tabular} \begin{tablenotes}\footnotesize \item[$\dagger$] For VQE - [number of SPSA trials, variational form], \item [] For QAOA - [number of SPSA trials] \end{tablenotes} \end{threeparttable} \end{table*} \setlength\extrarowheight{1.5pt} \begin{table*}[htbp] \caption{Experimental Results: quantum results with the original basis gates and all classical results \label{tab:results}} \begin{threeparttable} \begin{center} \resizebox{.975\textwidth}{!}{ \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|} \toprule\hline \textbf{Size} & \multicolumn{6}{|c|}{\textbf{TSP}} & \multicolumn{6}{|c|}{\textbf{QAP}} & \textbf{Devices} & \textbf{Method} \\ \hline & \textbf{Par}.\tnote{$\dagger$} & \textbf{SR99} & \textbf{SR95} & \textbf{Feas}.\tnote{*} & \textbf{AT(s)}\tnote{*} & \textbf{MT(s)}\tnote{*} & \textbf{Par}.\tnote{$\dagger$} & \textbf{SR99} & \textbf{SR95} & \textbf{Feas}.\tnote{*} & \textbf{AT(s)}\tnote{*} & \textbf{MT(s)}\tnote{*}& &\\ \hline\hline \multirow{11}{*}{3} & \multirow{9}{*}{[100, ``TL"]}&100.0 &100.0 & 100.0 &43.33&43.33 & \multirow{9}{*}{[1000, ``TL"]}&100.0 & 100.0 & 100.0& 45.65 & 45.65 & ibmq\_qasm-simulator & \multirow{9}{*}{VQE} \\ \cline{3-7} \cline{9-14} & &100.0 &100.0 & 100.0 & 2909.70&1771.32 & & 86.67 & 86.67 & 100.0 & 1486.68 & 151.78 &ibmq\_johannesburg & \\ \cline{3-7} \cline{9-14} & & 100.0 & 100.0& 100.0&1981.35&1485.74 & & 43.33 & 43.33 & 100.0 & 479.18 & 415.05 & ibmq\_montreal & \\ \cline{3-7} \cline{9-14} & &100.0 &100.0& 100.0& 423.84& 423.84& & 96.67 & 96.67 & 100.0 & 414.38 & 520.24 & ibmq\_cambridge &\\ \cline{3-7} \cline{9-14} & &100.0 & 100.0&100.0&7271.66 &1494.03 & & 53.33 & 53.33 & 100.0 & 987.22 & 548.20 & ibmq\_rochester& \\ \cline{3-7} \cline{9-14} & & 100.0 &100.0 & 100.0& 201.78 & 143.84 & & 0.0 & 0.0 & 100.0 & 852.69 & 268.71 & ibmq\_boeblingen & \\ \cline{3-7} \cline{9-14} & & 100.0 &100.0 & 100.0&4125.49 & 255.25 & & 93.33 & 93.33 & 100.0 & 3994.88 & 1360.91 & ibmq\_sydney & \\ \cline{3-7} \cline{9-14} & &100.0 &100.0 &100.0 & 5401.14& 528.74& & 73.33 & 73.33 & 100.0 & 8586.37 & 1692.50 & ibmq\_toronto & \\ \cline{3-7} \cline{9-14} & &100.0 &100.0 &100.0 &530.38 &300.90 & & 96.67 & 96.67 & 100.0 & 3722.58 & 557.68 & ibmq\_manhattan & \\ \cline{2-15} &[0.01, 10, 0.8, 10] &100.0 &100.0& 100.0&0.02 &0.02 & [1.0, 20, 0.90, 20] & 100.0 & 100.0& 100.0 & 0.05 & 0.05& classical-device& SA \\ \cline{2-15} & -& -&-&- &0.01 & 0.01& - & -& -&- & 0.01 & 0.01 & classical-device& BNB \\ \hline \multirow{11}{*}{4} & \multirow{9}{*}{[1100, ``TL"]} &3.33 &3.33 & 73.33& 54.46&54.46 &\multirow{9}{*}{[3000, ``TL"]} & 0.0 & 100.0 & 100.0 & 45.64 & 45.64 &ibmq\_qasm-simulator & \multirow{9}{*}{VQE}\\ \cline{3-7} \cline{9-14} & & 23.33& 23.33&56.67 & 215.49& 215.49& & 3.33 & 16.67 & 56.67 & 495.10 & 342.20 &ibmq\_johannesburg &\\ \cline{3-7} \cline{9-14} & &13.33 &13.33&53.33 & 681.85& 445.32& & 3.33 & 6.67 & 56.67 & 827.51 & 369.81 &ibmq\_montreal &\\ \cline{3-7} \cline{9-14} & & 16.67&16.67&43.33 & 365.35& 365.35& & 6.67 & 13.33 & 63.33 & 562.17 & 367.47 &ibmq\_cambridge &\\ \cline{3-7} \cline{9-14} & & 23.33 & 0.0&43.33&2006.08& 1276.74& & 6.67 & 13.33 & 43.33 & 4803.45 & 3260.97 &ibmq\_rochester &\\ \cline{3-7} \cline{9-14} & & 6.67 & 6.67&30.0 &230.62 & 211.68 & & 0.0 & 10.0 & 46.67 & 1397.01 & 873.04 & ibmq\_boeblingen & \\ \cline{3-7} \cline{9-14} & & 3.33 &3.33 &6.67 &341.72 & 292.52 & & 0.0 & 3.33 & 36.67 & 801.31 & 491.77 & ibmq\_sydney & \\ \cline{3-7} \cline{9-14} & &16.67 & 16.67& 40.0&436.00 & 303.75 & & 0.0 & 6.67 & 40.0 & 6133.34 & 337.68 & ibmq\_toronto & \\ \cline{3-7} \cline{9-14} & &23.33 &0.0 &33.33 &2487.12 & 670.67 & & 0.0 & 10.0 & 40.0 & 298.94 & 267.96 & ibmq\_manhattan & \\ \cline{2-15} &[0.01, 10, 0.8, 10] & 100.0&100.0&100.0 &0.02& 0.02& [1.0, 20, 0.90, 20] & 100.0 & 100.0& 100.0 & 0.11 & 0.11 & classical-device& SA \\ \cline{2-15} & -& -&-& &0.01& 0.01& -& -& -&& 0.01 & 0.01 & classical-device& BNB \\ \hline \multirow{9}{*}{5} & \multirow{7}{*}{[5500, ``RA"]} &26.67 &26.67&26.67 & 99.51&92.17 & \multirow{7}{*}{[5000, ``TL"]} & 0.0 & 0.0 & 96.67 & 64.05 & 64.05 &ibmq\_qasm-simulator & \multirow{7}{*}{VQE}\\ \cline{3-7} \cline{9-14} & & 0.0 & 0.0& 0.0&562.13&388.65 & & 0.0 & 0.0 & 0.0 & 9986.32 & 872.01 &ibmq\_montreal& \\ \cline{3-7} \cline{9-14} & &0.0 &0.0&0.0 &1135.77& 439.38 & & 0.0 & 0.0 & 0.0 & 565.01 & 565.01 &ibmq\_cambridge& \\ \cline{3-7} \cline{9-14} & &3.33&3.33& 3.33& 13137.19 & 1228.91& & 0.0 & 0.0 & 0.0 & 2116.71 & 1801.51 &ibmq\_rochester &\\ \cline{3-7} \cline{9-14} & &0.0 &0.0 &3.33 & 1982.69& 594.93 & & 0.0 & 0.0 & 0.0 & 845.03 & 476.22 & ibmq\_sydney & \\ \cline{3-7} \cline{9-14} & & 0.0 &0.0 & 3.33&1774.34 & 473.06 & & 3.33 & 3.33 & 6.67 & 917.79 & 566.01 & ibmq\_toronto & \\ \cline{3-7} \cline{9-14} & & 0.0 &0.0 &3.33 & 1836.56&694.60 & & 0.0 & 0.0 & 3.33 & 3020.28 & 1318.44 & ibmq\_manhattan & \\ \cline{2-15} &[0.01, 10, 0.8, 10] &100.0 &100.0& 100.0 &0.02& 0.02& [1.0, 20, 0.90, 20] & 100.0 & 100.0& 100.0 & 0.14 & 0.14 & classical-device&SA \\ \cline{2-15} & -&- &-&- &0.01&0.01 & -& -& -&-& 0.01 & 0.01 & classical-device&BNB \\ \hline \multirow{4}{*}{6} & \multirow{2}{*}{[5000, ``TL"]} &0.0 &0.0&0.0 &2476.87& 2176.15&\multirow{2}{*}{[6000, ``TL"]} & 0.0 & 0.0 & 3.33 & 5017.53 & 2265.98 & ibmq\_rochester & \multirow{2}{*}{VQE}\\ \cline{3-7} \cline{9-14} & & 0.0 & 0.0&0.0 &752.17 & 691.01 & & 0.0 & 0.0 & 0.0 & 24373.16 & 2967.89 & ibmq\_manhattan & \\ \cline{2-15} &[0.01, 10, 0.8, 10] & 100.0& 100.0&100.0 &0.02&0.02 & [1.0, 20, 0.90, 20] & 60.0 & 100.0& 100.0 & 0.16 & 0.16 & classical-device& SA \\ \cline{2-15} & -& -&-&- & 0.01& 0.01& -& -& -&-&0.03 & 0.03 & classical-device&BNB \\ \hline \multirow{3}{*}{7} & [10000, ``TL"] &0.0 &0.0&0.0&2525.73 &881.23 & [12000, ``TL''] & 0.0 & 0.0 & 0.0 & 18429.26 & 7928.29 &ibmq\_manhattan & VQE \\ \cline{2-15} & [0.01, 10, 0.8, 10]& 66.67&66.67& 100.0&0.02&0.02 & [1.0, 20, 0.90, 740] & 93.3 & 93.3& 100.0 & 0.25 & 0.25 & classical-device&SA \\ \cline{2-15} &- &- &-&- &0.03& 0.03& -& -& -&-& 0.28 & 0.28 &classical-device &BNB \\ \hline\bottomrule \end{tabular} } \end{center} \begin{tablenotes}\footnotesize \item[*] Feas. - percentage feasible: AT - average time with outliers, MT - average time without outliers \item[$\dagger$] For VQE - [number of SPSA trials, variational form], \item [] For SA - [tolerance, Markov chain length, cooldown factor, starting temperature] \end{tablenotes} \end{threeparttable} \end{table*} \setlength\extrarowheight{1.5pt} \begin{table*}[htbp] \caption{Experimental quantum results with new basis gates \label{tab:results2}} \begin{threeparttable} \begin{center} \resizebox{\textwidth}{!}{ \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|} \toprule\hline \textbf{Size} & \multicolumn{6}{|c|}{\textbf{TSP}} & \multicolumn{6}{|c|}{\textbf{QAP}} & \textbf{Devices} & Method\\ \hline & \textbf{Par}.\tnote{$\dagger$} & \textbf{SR99} & \textbf{SR95} & \textbf{Feas}.\tnote{*} & \textbf{AT(s)}\tnote{*} & \textbf{MT(s)}\tnote{*} & \textbf{Par}.\tnote{$\dagger$} & \textbf{SR99} & \textbf{SR95} & \textbf{Feas}.\tnote{*} & \textbf{AT(s)}\tnote{*} & \textbf{MT(s)}\tnote{*}& &\\ \hline\hline \multirow{5}{*}{3} & \multirow{2}{*}{[100, ``TL"]} &100.0 & 100.0 & 100.0 &5474.48 & 171.65 & \multirow{2}{*}{[1000, ``TL"]} & 86.67 & 86.67 & 100.0 & 652.57 & 652.57 & ibmq\_sydney & \multirow{2}{*}{VQE} \\ \cline{3-7} \cline{9-14} & & 100.0 &100.0 &100.0 & 8226.18 & 477.47 & & 30.0 & 30.0 & 100.0 & 655.30 & 586.91 & ibmq\_toronto &\\ \cline{2-15} & \multirow{3}{*}{[50]}& 90.00 &90.0 &90.0 &124.59&124.59 & \multirow{3}{*}{[100]}& 30.0 & 30.0 & 100.0 & 62.57 & 62.57 & ibmq\_qasm-simulator & \multirow{3}{*}{QAOA} \\ \cline{3-7} \cline{9-14} & &100.0 & 100.0&100.0 & 3856.01& 730.30& -& -& - &- & -& - & ibmq\_sydney & \\ \cline{3-7} \cline{9-14} & &100.0 & 100.0& 100.0&10871.32 &755.40 & & 0.0 & 0.0 & 100.0 & 552.26 & 453.37 & ibmq\_toronto & \\ \hline \multirow{5}{*}{4} & \multirow{2}{*}{[1100, ``TL"]} & 10.0 & 10.0& 36.67& 817.91&202.40 & \multirow{2}{*}{[3000, ``TL"]} & 3.33 & 6.67 & 36.67 & 768.95 & 510.72 & ibmq\_sydney & \multirow{2}{*}{VQE} \\ \cline{3-7} \cline{9-14} & &6.67 &6.67 &33.33 &715.83 & 456.22 & & 0.0 & 3.33 & 30.0 & 720.66 & 582.44 & ibmq\_toronto & \\ \cline{2-15} & \multirow{3}{*}{[100]}& 0.0 & 0.0&0.0 & 164.05& 164.05 & \multirow{3}{*}{[50]}& 0.0 & 0.0 & 23.33 & 140.96 & 140.96 & ibmq\_qasm-simulator & \multirow{3}{*}{QAOA} \\ \cline{3-7} \cline{9-14} & &0.0 &20.0&43.33 &14007.94 & 901.45 & -& -& -& -& -& -& ibmq\_sydney & \\ \cline{3-7} \cline{9-14} & & 23.33 &23.33 &43.33 &2325.83 & 1055.58 & & 0.0 & 6.67 & 36.67 & 6979.90 & 1446.55 & ibmq\_toronto & \\ \hline \multirow{2}{*}{5} & \multirow{2}{*}{[5500, ``RA"]} &0.0 &0.0 &3.33 & 263.23& 263.23 & \multirow{2}{*}{[5000, ``TL"]} & 0.0 & 0.0 & 0.0 & 5659.09 & 2636.32 & ibmq\_sydney & \multirow{2}{*}{VQE} \\ \cline{3-7} \cline{9-14} & & 0.0 & 0.0& 0.0& 608.42& 469.60 & & 0.0 & 0.0 & 3.33 & 1014.09 & 1014.09 & ibmq\_toronto & \\ \hline\bottomrule \end{tabular} } \end{center} \begin{tablenotes}\footnotesize \item[*] Feas. - percentage feasible: AT - average time with outliers, MT - average time without outliers \item[$\dagger$] For VQE - [number of SPSA trials, variational form], \item [] For QAOA - [number of SPSA trials] \end{tablenotes} \end{threeparttable} \end{table*} \setlength\extrarowheight{1.5pt} \begin{table*}[htbp] \caption{Experimental Results: describing the uncertainty percentage metric \label{tab:newmetric}} \begin{threeparttable} \begin{center} \resizebox{.975\textwidth}{!}{ \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|} \toprule\hline \textbf{Size} & \multicolumn{5}{|c|}{\textbf{TSP}} & \multicolumn{5}{|c|}{\textbf{QAP}} & \textbf{Devices}& \textbf{CR}.\tnote{$\dagger$} & \textbf{Method} \\ \hline & \textbf{\# feas.}\tnote{$\dagger$} & \textbf{mean (\%)} & \textbf{max (\%)} & \textbf{min (\%)} & \textbf{std (\%)} & \textbf{\# feas.}\tnote{$\dagger$} & \textbf{mean (\%)} & \textbf{max (\%)}& \textbf{min (\%)} & \textbf{std (\%)}& & &\\ \hline\hline \multirow{14}{*}{3} &30 & 22.36& 99.41& 0.10 &35.35 & 30 & 95.65 & 98.93 & 0.68 & 17.64 & ibmq\_qasm-simulator& F & \multirow{11}{*}{VQE} \\ \cline{2-13} & 30& 0.70& 1.75& 0.29 &0.35 & 30 & 0.57 & 1.07 & 0.20 & 0.22 &ibmq\_johannesburg& F &\\ \cline{2-13} &30 & 0.52& 0.97& 0.19 &0.14 & 30 & 0.41 & 0.78 & 0.20 & 0.13 & ibmq\_montreal &F& \\ \cline{2-13} & 30& 1.14&3.03 &0.20 & 0.96& 30 & 2.79 & 4.69 & 0.59 & 1.22 & ibmq\_cambridge &F& \\ \cline{2-13} & 30&0.01 & 0.01& 0.01 &0.0 & 30 & 0.55 & 1.07 & 0.20 & 0.21 & ibmq\_rochester&F& \\ \cline{2-13} & 30&0.41 &0.59 & 0.20 &0.12 & 30 & 0.64 & 0.98 & 0.39 & 0.18 & ibmq\_boeblingen &F & \\ \cline{2-13} &30 & 0.52& 0.98& 0.20 & 0.20& 30 & 1.04 & 2.54 & 0.20 & 0.48 & ibmq\_sydney &F & \\ \cline{2-13} & 30& 0.52&0.88 & 0.20 &0.17 & 30 & 0.59 & 0.98 & 0.20 & 0.21 & ibmq\_toronto &F & \\ \cline{2-13} &30 &6.02 & 24.51& 0.20& 7.27& 30 & 28.62 & 35.25 & 0.29 & 5.96 & ibmq\_manhattan & F& \\ \cline{2-13} &30 &0.53 &1.17 &0.20 &0.22 & 30 & 0.77 & 2.05 & 0.20 & 0.43 & ibmq\_sydney &T& \\ \cline{2-13} &30 & 0.48& 0.78& 0.20 &0.13 & 30 & 0.49 & 0.88 & 0.20 & 0.16 & ibmq\_toronto &T& \\ \cline{2-14} & 27&0.33 &0.88 &0.10 & 0.21 & 30 & 0.47 & 1.07 & 0.10 & 0.25 & ibmq\_qasm-simulator& T & \multirow{3}{*}{QAOA} \\ \cline{2-13} &30 & 0.36& 0.68& 0.20 &0.11 & - & -& -& -& -& ibmq\_sydney & T& \\ \cline{2-13} &30 & 0.41&0.68 &0.20 &0.13 & 30 & 0.39 & 0.68 & 0.2 & 0.13 & ibmq\_toronto & T& \\ \hline \multirow{14}{*}{4} &22 &32.51 &98.63 &0.10 & 30.83& 30 & 96.68 & 98.34 & 48.63 & 8.92 & ibmq\_qasm-simulator & F& \multirow{11}{*}{VQE} \\ \cline{2-13} & 17& 0.10&0.20 &0.10 & 0.02& 17 & 0.10 & 0.20 & 0.10 & 0.02 & ibmq\_johannesburg & F& \\ \cline{2-13} &16 &0.10 & 0.10& 0.10&0.0 & 17 & 0.10 & 0.10 & 0.10 & 0.0 & ibmq\_montreal & F& \\ \cline{2-13} &13 &0.10 &0.10 & 0.10 &0.0 & 13 & 0.10 & 0.10 & 0.10 & 0.0 &ibmq\_cambridge & F& \\ \cline{2-13} &13 &0.11 & 0.20&0.10 &0.04& 19 & 0.10 & 0.20 & 0.10 & 0.02 & ibmq\_rochester & F& \\ \cline{2-13} &9 &0.10 &0.10 & 0.10 & 0.0& 14 & 0.10 & 0.10 & 0.10 & 0.0 & ibmq\_boeblingen & F& \\ \cline{2-13} &13 &0.10 &0.10 &0.10 & 0.0 & 11 & 0.10 & 0.10 & 0.10 & 0.0 & ibmq\_sydney& F & \\ \cline{2-13} &12 &0.10 &0.10 &0.10 &0.10 & 12 & 0.10 & 0.10 & 0.10 & 0.0 & ibmq\_toronto & F& \\ \cline{2-13} &10 &0.10 &0.10 & 0.10 &0.0 & 12 & 0.10 & 0.10 & 0.10 & 0.0 & ibmq\_manhattan & F& \\ \cline{2-13} &11 & 0.11& 0.20& 0.10 &0.03 & 11 & 0.11 & 0.20 & 0.10 & 0.03 & ibmq\_sydney& T & \\ \cline{2-13} & 10&0.10 & 0.10& 0.10 &0.0 & 9 & 0.10 & 0.10 & 0.10 & 0.0 & ibmq\_toronto & T& \\ \cline{2-14} &0 &- &- & - &- & 7 & 0.10 & 0.10 & 0.10 & 0.0 & ibmq\_qasm-simulator & T & \multirow{3}{*}{QAOA} \\ \cline{2-13} &13 &0.10& 0.10& 0.10 &0.0 & -&- &- & &- & ibmq\_sydney & T & \\ \cline{2-13} &13 &0.10 &0.10 &0.10 &0.0 & 11 & 0.10 & 0.10 & 0.10 & 0.0 & ibmq\_toronto & T & \\ \hline \multirow{9}{*}{5} &8 &28.05 & 48.63&0.10 &18.49 & 29 & 94.24 & 94.24 & 94.24 & 0.0 & ibmq\_qasm-simulator& F & \multirow{9}{*}{VQE}\\ \cline{2-13} &0 &- &- & - &- & 0 & - & - & - & - & ibmq\_montreal& F& \\ \cline{2-13} &0 &- &- & - & -& 0 & - & - & - & - & ibmq\_cambridge& F& \\ \cline{2-13} &1 &0.10 &0.10 & 0.10 &0.0 & 0 & - & - & - & - & ibmq\_rochester & F&\\ \cline{2-13} &1 & 0.10& 0.10&0.10 &0.0 & 0 & - & - & - & - & ibmq\_sydney & F&\\ \cline{2-13} & 1&0.10 & 0.10& 0.10 &0.0 & 2 & 0.10 & 0.10 & 0.10 & 0.0 & ibmq\_toronto & F& \\ \cline{2-13} &1 & 0.10& 0.10& 0.10 &0.0 & 1 & 0.10 & 0.10 & 0.10 & 0.0 & ibmq\_manhattan & F& \\ \cline{2-13} &1 &0.10 &0.10 &0.10 &0.0 & 0 & - & - & - & - & ibmq\_sydney & T & \\ \cline{2-13} & 0& -&- &- &-& 1 & 0.10 & 0.10 & 0.10 & 0.0 & ibmq\_toronto & T & \\ \hline \multirow{2}{*}{6} & 0& -& -& - &- & 1 & 0.10 & 0.10 & 0.10 & 0.0 & ibmq\_rochester & F & \multirow{2}{*}{VQE}\\ \cline{2-13} &0 &- &- & - & -& 0 & - & - & - & - & ibmq\_manhattan & F & \\ \hline 7 & 0& -& -& - &- & 0 & - & - & - & - &ibmq\_manhattan & F & VQE \\ \hline\bottomrule \end{tabular} } \end{center} \begin{tablenotes}\footnotesize \item[$\dagger$] \# feas. - number of the 30 trials that are feasible \item [] CR - conditional reset (T for True and F for False) \end{tablenotes} \end{threeparttable} \end{table*} \section{Conclusion}\label{sec:conclusion} Many important problems facing industry and academia alike often take form in the class of intractable combinatorial problems. Due to this intractability, significant research in developing classical optimisation approaches has been undertaken. However, with the emergence of quantum computing and its potential in removing this classical limitation, investigating available quantum devices' efficacy on well-posed COP is an important area of current and future research. With the access to IBM's NISQ devices becoming increasingly available, it is necessary to investigate how well they perform in solving instances of well-known COP problems and their comparative performance to well-accepted classical solutions in the literature. The results evidence the current limitations of NISQ devices. The selected classical optimisation techniques outperformed the NISQ devices in computational time, SR, feasibility and uncertainty percentage. Both the VQE and QAOA had similar performance with respect to accuracy; however, VQE yielded better computational performance and capacity in solving larger problem size instances. Furthermore, the recently added conditional reset feature was tested but showed no significant improvement in any reported metrics. Importantly, however, the computational results presented herein extend and agree with other findings in the literature \cite{srinivasan2018efficient,ajagekar2019quantum,chieza2020computational}. Quantum technology is still in its infancy, and these NISQ devices are no exception. Therefore, while the findings of this work show that existing classical devices significantly outperform the performance of current NISQ devices, their performance could prospectively improve as quantum technology evolves. For example, recent formulations, such as QUBO and ADMM, and the promise of IBM devices with higher-performing processors with more qubits provide hope for higher quality solutions for COP and should be pursued in future work. \section*{Acknowledgement} The authors of this research paper acknowledge the \href{http://www.wits.ac.za}{University of the Witwatersrand, Johannesburg} contribution through its support and Quantum Computing resources, which made this research possible. We acknowledge the use of IBM Quantum services for this work. The views expressed are those of the authors, and do not reflect the official policy or position of IBM or the IBM Quantum team. \section*{Declarations} \subsubsection*{Funding} Not applicable. \subsubsection*{Conflict of Interest/Competing interests} The authors declare that they have no conflict of interest. \subsubsection*{Availability of Data and Material} The open-source data libraries used are referenced in the paper. \subsubsection*{Code Availability} The code used to conduct this research has been made available on GitHub. Details to the repository are noted in the paper. \bibliographystyle{spbasic}
\section{Introduction} Human motion prediction aims to generate future skeleton sequences according to past observed ones. This technique can help machines anticipate human motion in the future and conjecture the intention of human action. Therefore, human motion prediction is essential to facilitate tasks such as human action analysis and human-robot interaction. Many works have been proposed to improve the accuracy of human motion prediction in recent years. They are mainly divided into two types: methods based on sequential networks (RNNs) and methods based on feedforward networks (CNNs and GCNs). As to those methods based on RNNs\cite{16,17,18,21,22}, they can exploit rich temporal correlation of given human motion sequences due to their superior ability in sequence modeling. However, it is hard for them to make use of the spatial structure of skeleton because sequential modeling is only utilized on the time dimension. Therefore, CNNs\cite{19,20} and GCNs\cite{23,34,33,32,38,35} are more widely used recently. They can model spatiotemporal features of human motion simultaneously and thus boost the performance significantly. However, there still exists one universe problem in most of the current methods. The evaluation of the quality of the predicted result, which is vital in actual scenarios, is neglected. In the test phase, they all rely on the pre-trained model to offer final prediction results. Thus, the predicted value is determinate and unique, which is far more enough in the real physical system involving human beings, like human-robot reactions. If the people can’t evaluate the predicted result, they can’t know how to interact with the machine. Besides, the wrong or unreliable prediction result may mislead the machine to harm the people. Therefore, it is vital to assess the quality of prediction. Therefore, in this paper, we present our uncertainty-aware framework for human motion prediction (UA-HMP). It mainly includes two core components. First, we design an uncertainty-aware predictor through Gaussian modeling, where the predicted joints’ coordinates of motion are modeled as the Gaussian parameters (i.e., the mean and variance). In this way, we can utilize determinative values to estimate the uncertainty of predicted joints coordinates. Second, we present an uncertainty-guided learning scheme to quantitate the uncertainty and achieve better model convergence. In particular, the noisy samples with high uncertainty are penalized during optimization to reduce their negative effect. Notably, our proposed framework can be easily combined with any current baselines to overcome their weakness in uncertainty modeling with slight parameters increment. As a result, our proposed framework has significant practical value for its great generalization on current baselines. The main contributions of this paper are summarized as follows. \begin{itemize} \item We first propose an end-to-end learning framework human motion prediction(UA-HMP) to model the uncertainty in human motion prediction. \item We present an uncertainty-aware predictor and uncertainty-guided learning scheme, where the former can get the value and the uncertainty of predicted motion through Gaussian modeling simultaneously, and the latter can quantitate the uncertainty and achieve better model convergence by penalizing the noisy samples during optimization. \item Our proposed framework has significant practical value due to its great generalization on current baselines with slight parameters increment. \end{itemize} \section{Related Work} \subsection{Human motion prediction} Skeleton-based motion prediction has attracted increasing attention recently. Recent works using neural networks \cite{08,16,17,18,19,20,21,22,23,34,33,32,38,35} have significantly outperformed traditional approaches \cite{12,13}. RNNs\cite{16,17,18} were first used to predict human motion for their ability on sequence modeling. The first attempt was made by Fragkiadaki et al. [3], who proposed an Encoder-Recurrent-Decoder (ERD) model to combine encoder and decoder with recurrent layers. They encoded the skeleton in each frame to a feature vector and built temporal correlation recursively. Julieta et al.\cite{17} introduced a residual architecture to predict velocities and achieved better performance. However, these works all suffer from discontinuities between the observed poses and the predicted future ones. Though Gui et al.\cite{18} proposed to generate a smooth and realistic sequence through adversarial training, it is hard to alleviate error-accumulation in a long-time horizon inherent to the RNNs scheme. Recently, feedforward networks were widely adopted to help alleviate those above questions because their prediction is not recursive and thus could avoid error accumulation. Li et al.\cite{19} introduced a convolutional sequence-to-sequence model that encodes the skeleton sequence as a matrix whose columns represent the pose at every temporal step. However, their spatiotemporal modeling is still limited by the convolutional filters’ size. Recently, \cite{08,20} were proposed to consider global spatial and temporal features simultaneously. They all transformed temporal space to trajectory space and take the global temporal information into account. It contributes to capturing richer temporal correlation and thus achieved state-of-the-art results. Besides, Cai et al. \cite{32} also introduced transformer structure into this domain. To test the effectiveness and generalization of our method, in this paper, we choose the \cite{08} as a baseline of methods based on GCNs and \cite{20} as a baseline of methods based on CNNs to combine with our proposed framework. \subsection{Uncertainty Measurement} Despite the heavy success in deep learning, practical methods for estimating uncertainties in the predictions with deep networks have only recently become actively studied. Ghahramani et al.\cite{41} first propose to estimate the predictive variance of a deep neural network by computing the mean and variance of the sample, which is later referred to as the Monte Carlo (MC) dropout. Different from \cite{41} using a standard neural network, \cite{43} used a density network whose output consists of both mean and variance of a prediction trained with a negative log-likelihood criterion. Kendall et al.\cite{40} decomposed the predictive uncertainty into two major types and used a slightly different cost function for numerical stability. Although the general uncertainty-aware methods have been widely concerned in the NN-based applications, such as medical image segmentation and video segmentation, there is little research on the uncertainty of motion prediction. In methods\cite{44,45}, online adaptation methods were utilized for uncertainty estimation of human motion. There are two main drawbacks of them. First, their frameworks are not end-to-end, which makes the whole process complicated in actual scenarios. Second, they are not trainable, which makes the predicted result unreliable because they can’t use the information of training samples. To our best knowledge, this paper is the first to introduce an end-to-end framework to measure the uncertainty of predicted motion. \section{Method} In this section, we first formulate human motion prediction(HMP) with a brief illustration. Next, we will demonstrate two core components of our uncertainty-aware framework for human motion prediction (UA-HMP): an uncertainty-aware predictor and an uncertainty-guided learning scheme. The former utilizes Gaussian modeling to generate the value and uncertainty of the prediction. The latter aims to quantitate the uncertainty and achieve better model convergence by penalizing the noisy samples during optimization. \begin{figure}[h] \centering \includegraphics[width=5in]{images/overall_26_1.pdf} \caption{Overview of previous HMP and our UA-HMP. The top is the overall process of previous methods of HMP and the bottom is our proposed UA-HMP. Given the historical motion sequence $S_{1:T}$, the main differences of these two frameworks are the predicted parameters of the output. In HMP, the output are the predicted joint coordinates while in UA-HMP the output are a group of Gaussian parameters of predicted joint.} \label{overall_framework} \end{figure} \subsection{Problem Formulation} As shown in Figure \ref{overall_framework}, we illustrate the overall process of previuos HMP. We denote the historical $3D$ skeleton-based poses as $S_{1:T}=\{s_t\}_{t=1}^T$ and future poses as $S_{T+1:T_f}=\{s_t\}_{t=T+1}^{T_f}$, where $s_t\in\mathbb{R}^{N\times D}$ represents the pose at frame $t$. For the task HMP, with the input of $S_{1:T}$, the goal is to generate predicted motion sequence ${\hat{S}}_{T+1:T_f}=\{\hat s_t\}_{t=T+1}^{T_f}$, where $\hat s_t\in\mathbb{R}^{N\times D}$ represents the predicted pose at frame $t$. Specifically, the groudtruth pose $s_t$ and predicted pose $\hat s_t$ at frame $t$ are composed of $N$ joint corrdinates. We here take $\hat s_t$ as an example: $\hat s_t=\{\hat p_t^i\}_{i=1}^N\in\mathbb{R}^{N\times D}$, where $\hat p_t^i=(\hat x_t^i,\hat y_t^i,\hat z_t^i)\in\mathbb{R}^{D}$ denotes the predicted $i$th joint coordinates in frame $t$ and the $D=3$ depicts the dimension of joint coordinates. \subsection{Uncertainty-aware predictor} In this section, we analyze the importance of uncertainty modeling firstly. Next, we explain why it is difficult for the previous HMP methods to model uncertainty. At last, we will demonstrate the overall process of the proposed UA-HMP. First, we emphasize the importance of uncertainty modeling of human motion. There exists a universal problem in current approaches that they ignore the evaluation of the quality of the predicted result. Concretely, the information provided by current models only contains the positions of the future pose, and then the prediction confidence is unknown. This phenomenon is not terrible in scenarios like recommendation systems; however, it is dangerous in human-robot interactions because the wrong prediction may mislead machines to harm people. In brief, the uncertainty of human motion is vital in terms of security. Then, we analyze the limitation of previous approaches to model uncertainty. There mainly exist two reasons. On the one hand, unlike the classification task, the predicted pose is output as deterministic coordinate values instead of a score. Thus, it can’t be used to measure the uncertainty of the predicted pose. On the other hand, because there is only a correct answer/label for the predicted pose, complex modeling is not required for predicting the uncertainty. In other words, if the correct answer/label is a distribution, the uncertainty of coordinates can be modeled by measuring the value of the variance of this distribution. In this way, we can utilize determinative values to estimate the uncertainty of predicted joints coordinates. Therefore, for the task of UA-HMP, we use the single Gaussian model to measure the uncertainty of predicted joint coordinates. As is shown in Fig \ref{overall_framework}, the output of uncertainty-aware predictor is not determinative joint coordinates but a group of Gaussian parameters. Specifically, we here take $\hat s_t$ as an example: $\hat s_t=\{\hat g_t^i\}_{i=1}^N\in\mathbb{R}^{N\times D}$, where $\hat g_t^i=(\hat\mu_{ x_t^i},\hat\sigma_{ x_t^i},\hat\mu_{ y_t^i},$ $\hat\sigma_{ y_t^i},\hat\mu_{ z_t^i},\hat\sigma_{ z_t^i})$ is the Gaussian parameters of $i$th joint coordinaties at frame $t$. Among these paramaters, the mean value of each coordinate($ie.$ $\hat\mu_{ x_t^i}$) denotes the predicted coordinate of skeleton and each variance value($ie.$ $\hat\sigma_{ x_t^i}$) represents the uncertainty of each coordinate. Notably, because only the final predictor layer needs to be modified, our proposed framework can be easily combined with any current baselines to overcome their weakness in uncertainty modeling with slight parameters increment. As a result, our proposed framework has significant practical value for its great generalization on current baselines. \subsection{Uncertainty-guided learning scheme} In this part, we illustrate the learning scheme of our proposed UA-HMP. First, considering the uncertainty has no labels to supervise the training phase, quantitating the uncertainty is tricky. Thus, we will explain how to treat and tackle this problem. Second, considering noisy samples can lead to model over-fitting and dramatically degrades the predictive performance, we propose to reduce the negative effect of those noisy samples for better performance. \subsubsection{Loss Function for uncertainty measurement} From the perspective of deterministic value, uncertainty measurement is tricky because the uncertainty has no labels in the training phase. However, it can be solved easily from the perspective of distribution. Considering that joint coordinates are output as Gaussian parameters, where the variance represents the uncertainty of each predicted value, we can combine the uncertainty with the predicted value through negative log-likelihood(NLL) loss. We take the Gaussian parameters of ${{ x_t^i}}$ as examples: \begin{equation} L_n({x_t^i,\hat \mu_{{x}_t^i},\hat \sigma_{{x}_t^i}})=-log(N(x_t^i|\hat \mu_{{x}_t^i},\hat \sigma_{{x}_t^i}))=-log( {\frac{1}{\sqrt{2\pi\hat\sigma_{{x}_t^i}}}\times exp({-\frac{({x_t^i-\hat\mu_{{x}_t^i}})^2}{2\hat\sigma_{{x}_t^i}}})} ) \label{eq_6} \end{equation} Ensentially, equation \ref{eq_6} has a equivalent form: \begin{equation} \begin{split} L_n({x_t^i,\hat \mu_{{x}_t^i},\hat\sigma_{{x}_t^i}})=\frac{1}{2}(log\hat\sigma_{{x}_t^i} +\frac{(x_t^i-\hat\mu_{{x}_t^i})^2}{\hat\sigma_{{x}_t^i}}) + \frac{1}{2}log2\pi \end{split} \label{eq_8} \end{equation} As stated in the equation \ref{eq_8}, $L_n({x_t^i,\hat \mu_{{x}_t^i},\hat\sigma_{{x}_t^i}})$ consists of two main components (except for the constant term): a regression term divided by the uncertainty and an uncertainty regularization term. During training, the regression term will force the variance $\hat\sigma_{{x}_t^i}$ to get closer to the MSE loss $(x_t^i-\hat\mu_{{x}_t^i})^2$. If the MSE loss gets larger, the variance will get larger. Considering the above situation also means the sample is more unreliable, the variance also represents the prediction uncertainty to some extent. As to the second regularization term, it prevents the network from predicting infinite uncertainty to keep training stability. In this way, we do not need 'uncertainty labels' to learn uncertainty. Instead, it is learned implicitly in the regression task. In brief, $L_n({x_t^i,\hat \mu_{{x}_t^i},\hat\sigma_{{x}_t^i}})$ can quantitate the uncertainty of predicted coordinate of $x_t^i$. Thus, the overall loss function for all predicted motion sequences ${\hat{S}}_{T+1:T_f}$ is as follows: \begin{equation} L_n^U= \frac{1}{N\times(T_f-T)}\sum_{t=T+1}^{T_f}\sum_{i=1}^{N} L_n({x_t^i,\hat \mu_{{x}_t^i},\hat\sigma_{{x}_t^i}}) + L_n({y_t^i,\hat \mu_{{y}_t^i},\hat\sigma_{{y}_t^i}})+ L_n({z_t^i,\hat \mu_{{z}_t^i},\hat\sigma_{{z}_t^i}}) \label{eq_4} \end{equation} \begin{table*}[!t] \caption{Short-term prediction on H$3.6$M. Where ``ms'' denotes ``milliseconds''.} \scriptsize \begin{center} \setlength{\tabcolsep}{1mm}{ \begin{tabular}{c|cccc|cccc|cccc|cccc \hline motion & \multicolumn{4}{c}{Walking} & \multicolumn{4}{c}{Eating}& \multicolumn{4}{c}{Smoking} & \multicolumn{4}{c}{Discussion}\\ \hline time(ms)&80&160&320&400&80&160&320&400&80&160&320&400&80&160&320&400 \\ \hline ResSup \cite{17} &23.8 &40.4& 62.9& 70.9& 17.6& 34.7& 71.9& 87.7& 19.7& 36.6& 61.8& 73.9&31.7& 61.3& 96.0& 103.5 \\ ConvS2S \cite{19} &17.1 &31.2&53.8&61.5&13.7&25.9&52.5&63.3&11.1&21.0&33.4&38.3&18.9&39.3&67.7&75.7\\ \hline LTD \cite{08}&8.9 &15.7&29.2& 33.4& 8.8& 18.9& 39.4& 47.2& 7.8& 14.9& 25.3&{28.7}& 9.8& 22.1&{\bf39.6} &{\bf44.1} \\ LTD+U &8.9 &16.8&29.1& {\bf33.4}& {\bf8.5}& {\bf17.8}& {\bf36.8}& {\bf44.4}& 7.8& 14.6& 25.2& 29.2& 10.6& 23.2&40.6 &{44.7} \\ \hline TrajCNN \cite{20} &{\bf8.2} &{\bf14.9}&30.0&35.4&{\bf8.5}&18.4&37.0&44.8&{\bf6.3}&{\bf12.8}&{\bf23.7}&{\bf27.8}&{\bf7.5}&{\bf20.0}&41.3&47.8\\ TrajCNN+U &8.9 &15.3&{\bf27.7}&{\bf33.4}&9.6&20.9&40.2&48.0&6.5&{13.0}&{24.3}&{29.2}&8.6&{21.9}&43.9&50.6\\ \hline \hline motion & \multicolumn{4}{c}{Direction} & \multicolumn{4}{c}{Greeting}& \multicolumn{4}{c}{Phoning} & \multicolumn{4}{c}{Posing}\\ \hline time(ms)&80&160&320&400&80&160&320&400&80&160&320&400&80&160&320&400 \\ \hline ResSup \cite{17} & 36.5 &56.4& 81.5& 97.3&37.9& 74.1& 139.0& 158.8 &25.6& 44.4& 74.0& 84.2& 27.9& 54.7& 131.3& 160.8 \\ ConvS2S \cite{19} & 22.0&37.2 &59.6& 73.4 &24.5 &46.2 &90.0& 103.1& 17.2& 29.7& 53.4 &61.3& 16.1& 35.6& 86.2& 105.6\\ \hline LTD \cite{08}& 12.6 & 24.4&{48.2}&{\bf58.4}& 14.5& 30.5& 74.2& 89.0 & 11.5& 20.2& 37.9& 43.2&9.4& 23.9& {66.2}&{ 82.9}\\ LTD+U &12.0 &{\bf22.3}&48.0 &59.2 & 14.1& 28.3& 69.1& 84.8& 11.6& 19.6& 37.2& {\bf41.6}& 9.2& 22.6& 63.8&80.4 \\ \hline TrajCNN \cite{20} &{\bf9.7} &{\bf22.3}&50.2&61.7&12.6&28.1&{\bf67.3}&{\bf80.1}&{\bf10.7}&{\bf18.8}&{\bf37.0}&43.1&{\bf6.9}&{\bf21.3}&{\bf62.9}&{\bf78.8}\\ TrajCNN+U &10.3 &22.4&{\bf47.8}&58.8&{\bf12.5}&{\bf27.5}&69.6&84.1&11.3&{19.6}&{37.9}&{45.1}&7.4&{21.8}&65.3&82.1\\ \hline \hline{} motion & \multicolumn{4}{c}{Purchasing} & \multicolumn{4}{c}{Sitting}& \multicolumn{4}{c}{Sitting down} & \multicolumn{4}{c}{Taking photo}\\ \hline time(ms)&80&160&320&400&80&160&320&400&80&160&320&400&80&160&320&400 \\ \hline ResSup \cite{17} & 40.8& 71.8& 104.2& 109.8 &34.5& 69.9& 126.3 &141.6& 28.6& 55.3& 101.6& 118.9 &23.6 &47.4& 94.0& 112.7\\ ConvS2S \cite{19} & 29.4& 54.9& 82.2& 93.0 &19.8 &42.4& 77.0& 88.4& 17.1& 34.9& 66.3& 77.7& 14.0& 27.2& 53.8& 66.2\\ \hline LTD \cite{08}& 19.6&38.5&{64.4}&{\bf72.2}&10.7& 24.6& 50.6&62.0&11.4 &{ 27.6}& 56.4& 67.6& 6.8& 15.2& {38.2}&{49.6} \\ LTD+U &19.4 &38.0&65.0 &74.8 & 10.3& 23.3& 49.5& 61.7& {\bf10.6}& {\bf26.3}& {\bf52.4}& 62.1& 7.1& 14.7& 36.7&48.0 \\ \hline TrajCNN \cite{20}& {\bf17.1} &{\bf 36.1}&{\bf64.3}&{75.1}& 9.0& 22.0& 49.4& 62.6 & 10.7& 28.8& 55.1& 62.9&{\bf5.4}& {13.4}& {\bf36.2}&{\bf47.0}\\ TrajCNN+U &18.4 &38.7&65.3&73.9&{\bf8.5}&{\bf20.4}&{\bf43.3}&{\bf54.0}&11.1&{\bf27.4}&{\bf52.9}&{\bf61.0}&5.6&{\bf12.9}&36.8&48.6\\ \hline \hline motion & \multicolumn{4}{c}{Waiting} & \multicolumn{4}{c}{Walking dog}& \multicolumn{4}{c}{Walking Together} & \multicolumn{4}{c}{Average}\\ \cline{1-17 time(ms)&80&160&320&400&80&160&320&400&80&160&320&400&80&160&320&400 \\ \hline ResSup \cite{17} & 29.5& 60.5& 119.9& 140.6& 60.5& 101.9& 160.8& 188.3& 23.5& 45.0& 71.3& 82.8& 30.8& 57.0& 99.8& 115.5\\ ConvS2S \cite{19} &17.9& 36.5& 74.9& 90.7& 40.6& 74.7& 116.6& 138.7& 15.0& 29.9& 54.3& 65.8& 19.6& 37.8& 68.1& 80.2\\ \hline LTD \cite{08}& 9.5& 22.0& 57.5& 73.9& 32.2& 58.0& 102.2& 122.7 & 8.9& { 18.4}& 35.3& 44.3& 12.1& 25.0& 51.0& 61.3\\ LTD+U & 9.5& 22.3& 58.9& 76.4& 32.8& 58.3& 100.0& 118.5 & 9.6& { 19.2}& 35.3& 44.5& 12.1& 24.5& 49.8& 60.2\\ \hline TrajCNN \cite{20}& 8.2 & 21.0&{53.4}&{68.9}& 23.6& 52.0& 98.1& 116.9 & 8.5& 18.5& 33.9& 43.4&{\bf10.2}& 23.2& {49.3}&{ 59.7}\\ TrajCNN+U &{\bf8.1} &{\bf19.4}&{\bf49.8}&{\bf65.7}&{\bf22.7}&{\bf50.0}&{\bf96.1}&{\bf115.8}&{\bf8.2}&{\bf17.4}&{\bf33.5}&{\bf42.5}&10.5&{\bf23.2}&{\bf49.0}&{\bf59.5}\\ \hline \end{tabular} } \end{center} \label{r_h36mshort} \vspace{-2.5em} \end{table*} \subsubsection{Loss Function for uncertainty guidance} It is necessary to reduce the negative effect of noisy samples because noisy samples can lead to model over-fitting and dramatically degrades the predictive performance. Considering the resulting uncertainty in Section 3.3.1 represents the reliability of prediction, this parameter can be used as a penalty coefficient to raw loss function MPJPE used in most current methods. In particular, for one training sample, the MPJPE loss $L_m$ is as follows: \begin{equation}{} \begin{split} L_m &= \frac{1}{N\times(T_f-T)}\sum_{t=T+1}^{T_f}\sum_{i=1}^{N} L_p({\hat{p}}_t^i,{p_t^i}) \end{split} \label{eq_4} \end{equation} where $L_p({\hat{p}}_t^i,{p_t^i})$ represents the 2 norm of predicted joint ${p_t^i}$${\hat{p}}_t^i$ and corresponding ground truth ${p_t^i}$. After combining the penalty coefficient to the $L_m$, the resulting loss function is as follows: \begin{equation} \begin{split} L_m^U &= \frac{1}{N\times(T_f-T)}\sum_{t=T+1}^{T_f}\sum_{i=1}^{N} L_p({\hat{p}}_t^i,{p_t^i}) * w(\hat\sigma_{{x}_t^i},\hat\sigma_{{y}_t^i},\hat\sigma_{{x}_t^i}) \end{split} \label{eq_4} \end{equation} where $w(\hat\sigma_{{x}_t^i},\hat\sigma_{{y}_t^i},\hat\sigma_{{x}_t^i})=\frac{1}3\times( (\hat\sigma_{{x}_t^i})^k+(\hat\sigma_{{y}_t^i})^k+(\hat\sigma_{{z}_t^i})^k)$ represents the averaged penalty weights of joint $i$ at time $t$. k is a temperature coefficient and is set as -0.2 in our experiments). More details can be found in supplementary materials. \subsubsection{Overall Loss Function} In brief, the final loss function of predicted motion sequences ${\hat{S}}_{T+1:T_f}$ is as follows: $L^U = L_m^U + L_n^U$, where $L_m^U$ is used to measure uncertainty and $L_n^U$ is proposed to eliminate the negative effect of noisy samples with high uncertainty for better optimization during training. \begin{table*}[!t] \caption{Short and long-term prediction on CMU-mocap.} \scriptsize \begin{center} \setlength{\tabcolsep}{1mm}{ \begin{tabular}{c|ccccc|ccccc|ccccc \hlin motion& \multicolumn{5}{c}{Basketball} & \multicolumn{5}{c}{Basketball Signal}& \multicolumn{5}{c}{Directing Traffic}\\ \hline time (ms) & 80 &160 & 320 &400 &1000& 80 &160 & 320 &400 &1000& 80 &160 & 320 &400 &1000\\ \hline LTD \cite{08}&14.0&25.4 & 49.6 &61.4&{104.79} &3.5 & 6.1 & 11.7 &15.2 & 45.1& 7.4 & 15.1 &31.7 & 42.2 &142.1\\ LTD+U &12.3&22.0 & 44.0 &657.0&{106.1} &2.5 & 4.4 & 10.7 &14.9 & 53.9& 5.7 & 11.1 &24.5 & 31.3 &152.4\\ \hline TrajCNN \cite{20}&11.1&19.7 &43.9& {\bf56.8}& {114.1}& {1.8} &3.5 &{9.1} &13.0 &{49.6} &{\bf5.5} & {\bf10.9} &{\bf23.7} &{\bf31.3}& {\bf105.9}\\ TrajCNN+U &{\bf10.4}&{\bf18.4} &{\bf43.5}& 57.1& {\bf110.7}& {\bf1.7} &{\bf3.3} &{\bf8.1} &{\bf11.7} &{\bf47.1} &{5.6} & {11.6} &{24.6} &{33.3}& {132.0}\\ \hlin motion& \multicolumn{5}{c}{Jumping} & \multicolumn{5}{c}{Running}& \multicolumn{5}{c}{Soccer}\\ \hline time (ms) & 80 &160 & 320 &400 &1000& 80 &160 & 320 &400 &1000& 80 &160 & 320 &400 &1000\\ \hline LTD \cite{08}&16.9& 34.4 & 76.3 &96.8 &{\bf164.6} &25.5 &36.7& 39.3 & 39.9 &58.2 &11.3 &21.5 &44.2& 55.8 & 117.5\\ LTD+U &14.2&30.0 & {\bf71.6} &{\bf92.9}&{175.6} &17.6 & 21.5 & 21.9 &27.8 & 69.5& 9.9 & 18.7 &38.8 & 49.4 &114.3\\ \hline TrajCNN \cite{20}&{\bf12.2} &28.8& {72.1}& 94.6& 166.0 &17.1& 24.4 &28.4& 32.8& {49.2} &{8.1} &{17.6}& 40.9 &51.3 &126.5\\ TrajCNN+U &{\bf12.2}&{\bf27.8} &73.8& 99.1& 173.2& {\bf17.0} &{\bf19.8} &{\bf19.8} &{\bf26.1} &{\bf42.9} &{\bf6.0} & {\bf7.8} &{\bf16.3} &{\bf35.8}& {\bf100.8}\\ \hline \end{tabular} } \begin{tabular}{c|ccccc|ccccc|ccccc \hlin motion& \multicolumn{5}{c}{Walking} & \multicolumn{5}{c}{Wash Window}& \multicolumn{5}{c}{Average}\\ \cline{1-16} time (ms) & 80 &160 & 320 &400 &1000& 80 &160 & 320 &400 &1000& 80 &160 & 320 &400 &1000\\ \hline LTD \cite{08}&7.7 & 11.8 & 19.4 & 23.1 & 40.2 &5.9 & 11.9 & 30.3 & 40.0 & 79.3 &11.5 & 20.4 & 37.8 & 46.8 & 96.5\\ LTD+U &{\bf5.9} & {\bf9.6} & {\bf17.3} & {\bf21.2} & {\bf37.4} &4.9 & 10.8 & 29.3 & 38.6 & {\bf76.6} &9.1 & 15.9 & 32.3 & 41.6 & 95.7\\ \hline TrajCNN \cite{20}&6.5 &10.3& 19.4& 23.7& 41.6 &{4.5}&{9.7} &29.9& 41.5& 89.9 &8.3 &15.6& 33.4 &43.1 &{92.8}\\ TrajCNN+U &6.7&10.9 &18.9& 23.1& 40.8& {\bf4.0} &{\bf8.3} &{\bf26.2} &{\bf37.4} &{\bf81.9} &{\bf8.1} & {\bf14.5} &{\bf31.3} &{\bf41.8}& {\bf91.2}\\ \hline \end{tabular} \end{center} \label{results_cmu} \vspace{-2.5em} \end{table*} \begin{table*}[!t] \vspace{0.5em} \caption{Long-term prediction on H$3.6$M.} \scriptsize \begin{center} \setlength{\tabcolsep}{1mm}{ \begin{tabular}{c|cc|cc|cc|cc|cc|cc|cc|cc \hline motion & \multicolumn{2}{c}{Walking} & \multicolumn{2}{c}{Eating}& \multicolumn{2}{c}{Smoking} & \multicolumn{2}{c}{Discussion} &\multicolumn{2}{c}{Directions} & \multicolumn{2}{c}{Greeting}& \multicolumn{2}{c}{Phoning} & \multicolumn{2}{c}{Posing}\\ \hline time(ms)&560 &1000&560 &1000&560 &1000&560 &1000&560 &1000&560 &1000&560 &1000&560 &1000\\ \hline LTD \cite{08}&42.2&51.3&{\bf56.5}&{\bf68.6}&{\bf32.3}&60.5&{70.4}&103.5&85.8&109.3&91.8&87.4&65.0&113.6&113.4&220.6\\ LTD+U &41.8&45.1&{59.2}&{70.1}&33.0&62.1&{\bf67.4}&102.4&80.6&102.0&97.7&90.9&64.2&113.8&105.4&{\bf207.8}\\ \hline TrajCNN \cite{20}&{\bf37.9}&46.4&59.2&71.5&32.7&{\bf58.7}&75.4&{103.0}&{84.7}&104.2&{\bf91.4}&{\bf84.3}&62.3&113.5&111.6&{210.9}\\ TrajCNN+U&39.4&{\bf45.1}&57.4&73.4&33.8&59.9&70.9&{\bf97.7}&{\bf72.9}&98.9&98.8&{89.3}&{\bf56.5}&{\bf107.1}&{\bf102.8}&{209.0}\\ \hline \hline \end{tabular} } \setlength{\tabcolsep}{1mm}{ \begin{tabular}{c|cc|cc|cc|cc|cc|cc|cc|cc} \hline motion & \multicolumn{2}{c}{Purchases} & \multicolumn{2}{c}{Sitting}& \multicolumn{2}{c}{Sitting down} & \multicolumn{2}{c}{Taking photo} &\multicolumn{2}{c}{Waiting} & \multicolumn{2}{c}{Walking Dog}& \multicolumn{2}{c}{Walking Tog} &\multicolumn{2}{c}{Average}\\ \cline{1-17} time(ms)&560 &1000&560 &1000&560 &1000&560 &1000&560 &1000&560 &1000&560 &1000&560 &1000\\ \hline LTD \cite{08}&94.3&130.4&79.6&114.9&82.6&140.1&68.9&87.1&100.9&167.6&136.6 &174.3&{\bf57.0}&85.0&78.5&{\bf114.3}\\ LTD+U &89.6&124.8&80.1&114.3&83.5&130.5&73.1&87.7&103.0&167.1&143.4 &177.1&{58.4}&81.1&78.7&111.8\\ \hline TrajCNN \cite{20}&84.5&{\bf115.5}&81.0&116.3&{\bf79.8}&{123.8}&{\bf73.0}&{\bf86.6}&{\bf92.9}&{\bf165.9}&141.1&181.3&57.6&{\bf77.3}&77.7&110.6\\ TrajCNN+U &{\bf82.5}&{123.9}&{\bf78.0}&116.9&81.6&{\bf117.9}&{74.9}&{87.9}&95.1&172.0&{\bf129.6}&{\bf172.5}&64.6&{83.8}&{\bf75.8}&{\bf110.4}\\ \hline \end{tabular} } \end{center} \label{r_h36mlong} \vspace{-2.0em} \end{table*} \section{Experiments} We evaluate our model on several benchmark motion capture (mocap) datasets, including Human3.6M (H3.6M) \cite{46} and the CMU mocap dataset. We first introduce some experimental details. Next, we will demonstrate the performance of our framework quantitatively and qualitatively. \subsection{Experimental details} \subsubsection{Datasets} \textbf{H3.6M.} \cite{46} is the most widely used benchmark for motion prediction. It involves 15 actions and each human pose involves a 32-joint skeleton. To remove the global rotation, translation, and constant 3D coordinates of each human pose, there remain 22 joints. \begin{figure}[h] \centering \includegraphics[width=3.5in]{images/Vis_de_26_3.pdf} \caption{Two visualizations of uncertainty. (a) The size of the point (the larger size represents the larger uncertainty). (b) The brightness of the uncertainty map (the brighter of the element, the large uncertainty of its corresponding joint). The red box and red line illustrate the corresponding relationships between the two visualizations. } \label{Vis_details} \end{figure} \textbf{CMU-Mocap.} The CMU mocap dataset mainly includes five categories. Be consistent with \cite{08,20}, we select 8 detailed actions: ``basketball'', ``basketball signal'', ``directing traffic'', ``jumping'', ``running'', ``soccer'', ``walking'' and ``washing window''. \subsubsection{Baselines and implementation details} We combine our framework with two types of baselines: LTD\cite{08} and TrajCNN\cite{20}. \textbf{LTD}\cite{08}: A GCN-based deep network for motion prediction, which takes into account both temporal smoothness and spatial dependencies among human body joints. \textbf{TrajCNN}\cite{20}: A CNN-based deep network designed for modeling motion dynamics of the input sequence with coupled spatio-temporal features, dynamic local-global features, and global temporal co-occurrence features in the new space. All the training settings of the experiments are following the raw baselines. \subsection{Qualitative results} Here we show the prediction performance for short-term and long-term motion prediction on H3.6M, CMU Mocap. We quantitatively evaluate various methods by the MPJPE between the generated motions and ground truths in 3D coordinates space. Limited by the pages, we will provide more ablation study in supplementary materials. ('+U' means combining the raw basslines with our UA-HMP.) \textbf{Short-term motion prediction on H3.6M.} Table \ref{r_h36mshort} provides the short-term predictions on H3.6M for the 15 activities and the average results. Note that those baselines combined with our UA-HMP outperform all raw baselines on average and almost all motions. It demonstrates the effectiveness of our processed uncertainty-guided learning scheme. By reducing the negative effect of the noisy samples, the performance gets better, especially on 320ms and 400ms. This shows our method is more robust faced with the varying of time. \textbf{Long-term motion prediction on H3.6M.} In Table \ref{r_h36mlong}, we compare our results with those of the baselines for long-term prediction on H3.6M. Our method outperforms almost the baselines on average. For long-term prediction, our method still obtains competitive performances on almost all motions with the uncertainly of motion increasing. \begin{figure}[h] \centering \includegraphics[width=4.5in]{images/vis_all_26_6.pdf} \caption{More Visualizations. The (a1),(b1) are predicted sequences of different motion sequences. They show the stacked motion sequences by stacking multiple skeletons together. The (a2),(b2) show the uncertainty map of the corresponding motion sequences, where the horizontal axis represents joints, and the vertical axis represents time. } \label{Vis_all} \end{figure} \textbf{Prediction on CMU-Mocap} Table \ref{results_cmu} reports the results on CMU-Mocap. Our framework combined with existing baselines outperforms the raw baselines for both short-term and long-term prediction. Notably, the degree of improvement in CMU-Mocap is larger than H3.6M, demonstrating that our proposed uncertainty-guided learning scheme is more beneficial for situations without large training samples. \subsection{Quantitative results} We show the uncertainty by two methods in Figure \ref{Vis_details}. In (a), the left part is the stacked motion sequences, and the right part is the details of the left one. Here, we use the size of the point to represent uncertainty. The larger size represents the larger uncertainty. We can easily see the uncertainty of every prediction by this illustration. From the horizontal change of the elements, we can see the uncertainty of the point is larger with the time duration increasing. In (b), the uncertainty map is used to illustrate uncertainty. The brighter the element in the map, the larger uncertainty of its corresponding joint. By this illustration, we can easily read the uncertainty evolution from the temporal dimension and the joint dimension separately. From the horizontal change of the elements, we can see different uncertainty of different joints. More visualizations are demonstrated in Figure \ref{Vis_all} and supplementary materials. \section{Conclusion} In this paper, we present our uncertainty-aware framework for human motion prediction (UA-HMP). It mainly includes two core components. First, we design an uncertainty-aware predictor through Gaussian modeling to get the value and the uncertainty of predicted motion. Second, we present an uncertainty-guided learning scheme to quantitate the uncertainty and improve prediction accuracy. In particular, those samples with high uncertainty are given low weight during optimization. In this way, the adverse effect of unreliable samples can be avoided for better optimization in the training phase. Our proposed framework is easily combined with current SOTA baselines to overcome their weakness in uncertainty modeling. As a result, our proposed framework has significant practical value.
\section{Introduction.}\label{intro} \section{Introduction} In this paper, we introduce a new Boosting Method to approximately solve a class of linear programs (LPs) or their corresponding integer LPs (ILPs) with linear time complexity. Specifically, we consider LPs with the following form \begin{align} \tag{LP} \max \ \ & \bm{r}^\top \bm{x} \label{eqn:LP} \\ \text{s.t. }\ & \bm{A} \bm{x} \le \bm{b} \nonumber \\ & x_j \in [0,M_j], \ \ j=1,...,n \nonumber, \end{align} where $\bm{r} = (r_1,...,r_n)^{\top} \in \mathbb{R}^n$, $\bm{A} = (\bm{a}_1,...,\bm{a}_n) \in \mathbb{R}^{m\times n}$, $\bm{b} = (b_1,...,b_m)^{\top} \in \mathbb{R}^m_{+}$ and $M_j\in\mathbb{R}_{++}$ for all $j=1,...,n$. Our algorithm is a combination of the idea of boosting (\cite{shalev2014understanding}) with recently developed first-order online algorithms (\cite{li2020simple}, \cite{balseiro2020dual}, \cite{jiang2020online}) to solve offline LPs. Since the first-order online algorithms pass through each column-coefficient pairs $(r_j,\bm{a}_j)$ for only once, they cannot fully utilize information of the LP's input data in offline setting. Thus, they can only find a solution with expected optimality gap on the order of $\sqrt{mn}$ (\cite{li2020simple}, \cite{balseiro2020dual}). In this paper, we take advantage of the efficiency of first order online algorithms and improve their optimality gap to $O(\sqrt{mn/K})$ by duplicating the data $K$ times to iteratively train the first-order algorithms where $K$ bears the same intuition as the boosting algorithm (\cite{friedman2001elements}, \cite{shalev2014understanding}). Remarkably, our algorithm can also be embedded in conventional LP solvers as a light-weighted pre-solver due to its efficiency. Moreover, our algorithm does not require that the LP's right-hand-side $\bm{b}$ is on the order of $n$, which is a key assumption in recently developed online first-order algorithms (\cite{li2020simple}, \cite{balseiro2020dual}). In the online setting, it is necessary because the decision maker needs enough resources to make mistakes when exploring the structure of data by first-order algorithm. However, in the offline setting, this assumption is too limited to be useful \citep{MIPLIB}. In this paper, we show that our algorithm can also obtain good solution regardless of whether the assumption does not hold. \subsection{Related Literature} Traditionally, since Karmarkar's breakthrough result in 1984, which proves that interior point methods can solve linear programs in polynomial time, the interior point methods have been an active area of research for both linear and nonlinear programming problems. Recently, \cite{lee2014path} proposed a weighted path finding algorithms that improves the iteration bound from $O(\sqrt{m}L)$ to $O(\sqrt{\text{rank}(A)}L)$, where $L$ stands for the bit-length of data. The idea is to introduce weights for the log-barrier functions and adaptively adjust the weights to make the interior-point method updates take larger steps. Then, \cite{cohen2021solving} further reduced the computational cost to current matrix multiplication time by a modified central path method. Meanwhile, in another recent paper, \cite{lamperski2019oblivious} developed an oblivious ellipsoid algorithm and this algorithm featured for its built-in mechanism for proving the infeasibility of an LP. This algorithm addresses the drawback of the traditional ellipsoid methods that the infeasibility certification of an LP cannot be provided. The above studies remain theoretical. Compared with them, our algorithm aims to find an approximate solution in linear time for the LPs when the number of variables is much larger than the number of constraints, which can have good practical performance. Moreover, many papers aim to solve large-scale LPs. \cite{vu2018random} introduced a random projection method to approximately solve large-scale LP by reducing the number of constraints. Aligned with the previous works on constraints reduction \citep{de2004constraint, lakshminarayanan2017linearly} that dealt the approximate LP associated with the MDP problem, \cite{vu2018random} employed the idea of random projection and developed a constraint reduction scheme for LP in its standard form. The paper utilized Johnson-Lindenstrauss lemma and discussed the preservation of LP's feasibility and optimality under certain random projection matrices. Moreover, inspired by \cite{lee2014path} and \cite{lee2019solving}, \cite{van2020solving} introduced an interior point method solving tall LPs in near linear time, where "tall" means that the number of constraints are much larger than the number of variables, or $m\gg n$. Complementarily, our algorithm works more on the LPs with $n\gg m$. Furthermore, there are also many works introducing first-order algorithms to solve LPs. \cite{wang2017new} developed a new alternating direction method of multiplier (ADMM) to solve linear programs. The algorithm separated the equality and inequality constraints of the standard LP and developed a 2-block ADMM scheme with convergence rate derived. \cite{lin2021admm} proposed an ADMM-based interior-point method for solving large-scale linear programs. The algorithm utilized ADMM to solve the log-barrier penalty subproblems for the interior-point method. \cite{yen2015sparse} considered solving sparse LPs (where the matrix $\bm{A}$ in \eqref{eqn:LP} is sparse). The algorithm was based on a combination of the Augmented Lagrangian and Coordinate Descent. Compared with them, our algorithm does not require any matrix inversion, which is inherited from the fast online algorithms (\cite{li2020simple}, \cite{balseiro2020dual}). \section{Problem and Setup} \label{sec:ps} In this section, we formally introduce the problem setup. Section \ref{sec:problem} states the problem and assumptions, and Section \ref{sec:perfmeas} defines the performance measures for algorithm analysis. \subsection{Linear Programming} \label{sec:problem} Consider a \textit{Linear Programming} problem that takes the following form \begin{align} \tag{LP} \max \ \ & \bm{r}^\top \bm{x} \\ \text{s.t. }\ & \bm{A} \bm{x} \le \bm{b} \nonumber \\ & 0 \le x_j \le M_j, \ \ j=1,...,n \nonumber, \end{align} where $\bm{r} = (r_1,...,r_n)^{\top} \in \mathbb{R}^n$, $\bm{A} = (\bm{a}_1,...,\bm{a}_n) \in \mathbb{R}^{m\times n}$, $\bm{b} = (b_1,...,b_m)^{\top} \in \mathbb{R}^m$ and $M_j\in\mathbb{R}_{++}$ for all $j=1,...,n$. To simplify the analysis, we make the following assumption: \begin{assumption} \label{ass:bdd} We assume that \begin{itemize} \item[(a)] Boundedness: The column-coefficient pairs $(r_j,\bm{a}_j)$'s satisfies $|r_j|\leq1$ and $\|\bm{a}_j\|_{\infty}\leq 1$ for all $j\in[n]$. \item[(b)] Positive Resources: The resources vector of all constraints are positive, i.e., $\underline{b}:=\frac{1}{n}\min\limits_{i=1,...,m} b_i>0$. \item[(c)] General Position: For any positive dual vector $\bm{p}\in\mathbb{R}^{m}_{+}$, there are no more than $m$ column pairs satisfying $r_j=\bm{a}_j^{\top}\bm{p}$. \end{itemize} \end{assumption} All LPs can meet Assumption \ref{ass:bdd} (a) through scaling the entries. Assumption \ref{ass:bdd} (b) is satisfied by a wide range of real problems, such as the routing problem (\cite{buchbinder2006improved}, \cite{pelletier2019electric}) and revenue management problem (\cite{huang2015linear}). Assumption \ref{ass:bdd} (c) is an auxiliary assumption to find the theoretical result, which is also applied in \cite{agrawal2014dynamic} and \cite{li2020simple}. Although it does not hold for all LPs, \cite{devanur2009adwords} pointed out that the assumption can be satisfied with arbitrary small perturbation of the reward vector $\bm{r}$. Then, the affect of the perturbation on the objective can also be arbitrarily small. \subsection{Performance Measure} \label{sec:perfmeas} As to algorithm analysis, we use a bi-objective performance measure: the optimality gap and the constraint violation. The optimality gap refers to the difference between the optimal objective and the objective achieved by the algorithm, and the constraint violation measures measures the maximum infeasibility across the whole set of constraints. Denote the optimal solution to the \ref{eqn:LP} as $\bm{x}^*$ and the approximate solution obtained by an algorithm as $\bm{x}$. We formally define the optimality gap $\Delta$ and constraints violation $v$ as below: \begin{align} \Delta(\bm{x})&:= \bm{r}^{\top}\bm{x}^*-\bm{r}^\top\mathbb{E}[\bm{x}], \nonumber \\ v(\bm{x})&:= \max\limits_{j=1,...,n} \mathbb{E} [\bm{A}\bm{x}-\bm{b}]_j\nonumber, \end{align} where the randomness may come from the algorithm. The main reason we introduce the second measure is that we allow algorithms to output infeasible solutions, and we hope that our infeasible solution does not violate constraints too much. Furthermore, we will show that our algorithm can also provide a feasible solution with a small optimality gap in expectation in section \ref{sec:optgap}. There are many ways to transfer an infeasible solution to feasible, and our approach may not be optimal. Second, an infeasible solution can also be useful in practice. For example, In the column-generation method, we can view the approximate solution as a proxy to guide the choice of the initial basis, which does not have to be feasible. Moreover, when solving a binary LP, we can also view an infeasible fractional solution as the approximate probability of each variable to be 1. In this case, we only require the binary solution to be feasible while the probability or the fractional solution does not necessarily need to be feasible. \section{Algorithms} \label{sec:Alg} In this section, we present the online algorithm with boosting as well as its variants and applications. Section \ref{sec:soa} revisits the Simple Online Algorithm (SOA) in \cite{li2020simple} and we use the SOA as a motivation for our boosting algorithm. In Section \ref{sec:boost}, we motivate our algorithm framework to solve linear programs (LPs) with online methods. Specifically, in this section, we first propose our algorithm to solve a simple LP and interpret its ``boosting'' structure. Then, we generalize our algorithm to solve the \eqref{eqn:LP} based on the SOA. In Section \ref{sec:optgap}, we derive the theoretical guarantees for the generalized boosting algorithm. In Section \ref{sec:gen}, we present the derivations of our algorithm and its variants. \subsection{Summary of SOA algorithm in \cite{li2020simple}} \label{sec:soa} Now, we briefly introduce the Simple Online Algorithm (SOA) proposed by \cite{li2020simple} to motivate our algorithms and analysis in later sections. Consider the following LP problem \eqref{eqn:sLP}, \eqref{eqn:LP}, \begin{align} \tag{sLP} \max \ \ & \bm{r}^\top \bm{x} \label{eqn:sLP} \\ \text{s.t. }\ & \bm{A} \bm{x} \le \bm{b} \nonumber \\ & \bm{x} \in [0,1]^{n}, \nonumber \end{align} and its dual problem \begin{align} \tag{D-sLP} \min \ \ & \bm{b}^\top \bm{p} + \bm{1}^\top \bm{s} \label{eqn:D-sLP} \\ \text{s.t. }\ & \bm{A}^\top \bm{p} + \bm{s} \ge \bm{r} \nonumber \\ & \bm{p} \ge \bm{0}, \bm{s}\ge \bm{0}, \nonumber \end{align} where the decision variables $x_j$ are in $[0,1]$ for all $j=1,...,n$, i.e., $M_j=1$ for all $j$ in the problem. Denote the optimal solution for the \eqref{eqn:sLP} and the \eqref{eqn:D-sLP} as $\bm{x}^*$ and $(\bm{p}^*,\bm{s}^*)$, respectively. Then, with the first order KKT condition, \cite{li2020simple} show that \begin{equation} \label{SOA_dec} x^*_j = \left\{ \begin{matrix} 1, r_j>\bm{a}_j\bm{p}^*& \\ 0, r_j<\bm{a}_j\bm{p}^*&. \end{matrix} \right. \end{equation} This KKT condition illustrates that the value of the optimal solution is largely determined by the optimal dual price $\bm{p}^*$. In other words, solving the \eqref{eqn:sLP} is roughly equivalent to finding the optimal dual solution. Furthermore, This optimal dual solution is also the optimal solution of the following equivalent convex optimization problem in the sample average form, \begin{align} \label{SA} \tag{SA} \min_{\bm{p}\geq\bm{0}}\ & f_n(\bm{p}) = \bm{d}^\top \bm{p} + \frac{1}{n} \sum_{j=1}^n \left(r_{j}-\bm{a}_{j}^\top \bm{p}\right)^+, \nonumber \end{align} where $\bm{d}=\frac{1}{n}\bm{b}$. Based on those equivalencies, \cite{li2020simple} present a new online algorithm to iteratively read one column coefficient pair $(r_t,\bm{a}_t)$ sampled without replacement, decide the value of its corresponding decision variable $x_t$, and update the estimation of the optimal dual solution. Specifically, the algorithm sets the initial estimation of the optimal dual price as $\bm{p}_1=\bm{0}$. When the algorithm receives a single coefficient pair $(r_t,\bm{a}_t)$ at $t$-th iteration, it sets \begin{equation} \label{SOA_dec_Alg} x_t = \left\{ \begin{matrix} 1, r_t>\bm{a}_t\bm{p}_t& \\ 0, r_t<\bm{a}_t\bm{p}_t&, \end{matrix} \right. \end{equation} where $\bm{p}_j$ is the current estimation of the optimal dual solution. Then, the algorithm updates the estimation of the dual solution by the Projected Stochastic Gradient Descent (PSGD) method on \eqref{SA}, namely, \begin{align*} \bm{p}_{t+1} &= \left(\bm{p}_t + \frac{1}{n}\left(\bm{a}_tI(r_t>\bm{a}_t^\top \bm{p}_t)-\bm{d}\right)\right)\vee \bm{0}, \end{align*} where $\bm{a}_tI(r_t>\bm{a}^\top_t \bm{p}_t)-\bm{d}$ is an approximation of \begin{equation*} \frac{ \partial f_n(\bm{p}) }{\partial \bm{p}} = \sum_{j=1}^{n}\left(\bm{d}-\bm{a}_jI(r_j>\bm{a}_j^\top \bm{p})\right) \end{equation*} using one single sample $(r_t,\bm{a}_t)$ and $\bm{u}\vee \bm{v}=\left(\max\{u_1,v_1\},...,\max\{u_m,v_m\}\right)$ for $\bm{u},\bm{v}\in\mathbb{R}^{m}$. \begin{algorithm}[ht!] \caption{Simple Online Algorithm (SOA)} \label{alg:SOA} \begin{algorithmic}[1] \State Input: $\bm{d}=\bm{b}/n$ \State Initialize $\bm{p}_0 = \bm{0}$ \For {$t=1,..., n$} \State Set $$x_t = \begin{cases} 1,& r_t >\bm{a}_t^\top \bm{p}_t \\ 0,& r_t \le \bm{a}_t^\top \bm{p}_t \end{cases}$$ \State Compute \begin{align*} \bm{p}_{t+1} & = \bm{p}_t + \frac{1}{\sqrt{n}} \left(\bm{a}_tx_t - \bm{d}\right) \\ \bm{p}_{t+1} & = \bm{p}_{t+1} \vee \bm{0} \end{align*} \EndFor \State Output: $\bm{x} = (x_1,...,x_n)$ \end{algorithmic} \end{algorithm} Equivalently, the goal of Algorithm \ref{alg:SOA} can also be interpreted as to find the saddle point of the following Lagrangian function \eqref{func:lagr} in the domain $\{\bm{0}\leq\bm{x}\leq\bm{1},\bm{p}\geq\bm{0}\}$, \begin{align} \label{func:lagr} L(\bm{x},\bm{p})= \left(\bm{r}-\bm{A}^{\top}\bm{p}\right)^{\top}\bm{x} + \bm{b}^{\top}\bm{p}. \end{align} When receiving a column-coefficient pair $(r_t,\bm{a}_t)$ at an iteration, the algorithm essentially maximizes the Lagrangian function with respect to the variable $x_t$ by formula \eqref{SOA_dec_Alg} with fixed $\bm{p}=\bm{p}_t$, and then updates $\bm{p}_t$ to reduce the value of Lagrangian function with respect to the variable $\bm{p}$ by one-step Projected Stochastic Gradient Descent. Further, if $\bm{b}$ is in the order of $O(n)$ and all column pairs $(\bm{a},\bm{r})$ are received in a uniformly random order, \cite{li2020simple} prove Theorem \ref{XSY_thm_PBD} under moderate boundedness conditions. In Section \ref{sec:optgap}, we derive a better bound following the idea of \cite{balseiro2020dual}. \begin{theorem}[Theorem 2 in \cite{li2020simple}] The regret and expected constraint violation of Algorithm \ref{alg:SOA} satisfy $$\Delta(\bm{x}) \le O\left((m+\log n)\sqrt{n}\right),$$ $$v(\bm{x}) \le O(\sqrt{mn}\log n),$$ for all $m, n \in \mathbb{N}^+$. \label{XSY_thm_PBD} \end{theorem} However, this algorithm is designed for online binary LP problems. If we use it to solve an offline LP directly -- although its computational complexity is $O(mn)$ -- it only uses each column-coefficient pair once to update the dual price and cannot fully utilize the information. Moreover, the theoretical result largely depends on the assumption that the minimal average resource in each step $\underline{b}$ is independent of $n$. However, for general $\underline{b}$, their result is in the order of $\frac{\sqrt{n}}{\underline{b}}$, which is large when $\underline{b}$ is small. In this paper, we aim to exploit the computational advantage of the SOA and reduce the impact $\underline{b}$ to solve more general offline LPs. \subsection{Boosting Algorithm with Simple Online Algorithm} \label{sec:boost} In this section, we first motivate our boosting algorithm to solve the \eqref{eqn:sLP}. The Boosting Algorithm uses Algorithm \ref{alg:SOA} in the previous section as a subroutine. Then, we generalize it to solve the \eqref{eqn:LP}. Recall that Algorithm \ref{alg:SOA} presents an $O\left(\frac{n}{\sqrt{\underline{b}}}\right)$ optimality gap based on \cite{li2020simple}, where $n$ and $\underline{b}$ are defined in \eqref{eqn:LP} and Assumption \ref{ass:bdd}, respectively. Based on this bound of the optimality gap, we can duplicate each column-coefficient pair vector $(r_j,\bm{a}_j)$ and its decision variable of \eqref{eqn:sLP} for $K$ times and obtain the following LP, \begin{align} \tag{dupLP} \max \ \ & \sum\limits_{l=1}^{K}\bm{r}^\top \bm{x}_{l} \label{eqn:dupLP} \\ \text{s.t. }\ & \sum\limits_{l=1}^{K} \bm{A} \bm{x}_{l} \le K\bm{b} \nonumber \\ & \bm{x}_{l} \in [0,1]^{n}, \ \ l=1,...,K \nonumber. \end{align} The optimal objective value of \eqref{eqn:dupLP} will be $K\cdot\text{OPT}$. Applying Algorithm \ref{alg:SOA} on this duplicated LP, we can find a set of solution $\{\tilde{\bm{x}}_{l}\}_{l=1}^{K}$, where $\tilde{\bm{x}}_l$ corresponds to the solution of all $l$-th arrival pairs, for $l=1,...,K$. This set of solutions satisfy $$ \mathbb{E}\left(\frac{1}{K}\sum\limits_{l=1}^{K}\bm{r}^{\top}\tilde{\bm{x}}_l\right) \geq \text{OPT} - O\left(\frac{Kn}{K\sqrt{KB}}\right) = \text{OPT} - O\left(\frac{n}{\sqrt{KB}}\right). $$ Hence, the average solution $\tilde{\bm{x}}^{(K)}=\frac{1}{K}\sum\limits_{l=1}^{K}\tilde{\bm{x}}_l$ is a solution to the \eqref{eqn:sLP} and the optimality gap is no more than $O\left(\frac{n}{\sqrt{KB}}\right)$ in expectation. In other words, this new average solution $\tilde{\bm{x}}^{(K)}$ can reduce the optimality gap with a factor $\frac{1}{\sqrt{K}}$ compared with the solution obtained from the online learning methods. Enlightened by this idea, we have our boosting version of SOA, Algorithm \ref{alg:bSOA}. Based on Algorithm \ref{alg:bSOA}, we combine the idea of ``boosting'' and present Algorithm \ref{alg:bBSA}, which is the the main algorithm in this paper. Compared with Algorithm \ref{alg:bSOA}, Algorithm \ref{alg:bBSA} does not directly apply SOA Algorithm on the duplicated problem. Instead, it apply SOA to solve $K$ \ref{eqn:sLP} problems with continuously updating the dual price. This difference enables Algorithm \ref{alg:bBSA} to have ``boosting'' structure, which will be discussed later. With this structure, the numerical performance can be improved by $1\% \sim 3\%$ in terms of the objective value and the theoretical order of the optimality gap of our algorithm is still $O(\frac{n}{\sqrt{KB}})$. \begin{algorithm}[ht!] \caption{Boosting Simple Online Algorithm} \label{alg:bSOA} \begin{algorithmic}[1] \State Input: $\bm{d}=\bm{b}/n$, $K$, $\gamma=1/\sqrt{Kn}$ \State Initialize $\bm{p} = \bm{0}$, $(\tilde{{x}}^{(K)}_1,...,\tilde{{x}}^{(K)}_n)=\bm{0}$ \State Set the duplicated index set $I=\{1,...,1,2,...,2,...,n,...,n\}$, which contains $K$ duplication of each number from 1 to $n$ \For {$t=1,...,Kn$} \State Uniformly select one element $s_t$ from $I$ without replacement \State Set $$\tilde{x}_{t} = \begin{cases} 1,& r_{s_t} >\bm{a}_{s_t}^\top \bm{p} \\ 0,& r_{s_t} \le \bm{a}_{s_t}^\top \bm{p} \end{cases}$$ \State Compute \begin{align*} \bm{p} & = \bm{p} + \gamma \left(\bm{a}_{s_t}\tilde{x}_{t} - \bm{d}\right) \\ \bm{p} & = \bm{p} \vee \bm{0} \end{align*} \State Set $\tilde{{x}}^{(K)}_{s_t}=\tilde{{x}}^{(K)}_{s_t}+\frac{1}{K}\tilde{{x}}_{t}$ \EndFor \For {$t=1,...,n$} \State $x_t = Ber(\tilde{x}_t^{(K)})$ \EndFor \State Output: the binary solution $\bm{x} = (x_1,...,x_n)$ \State ~~ ~~ ~~ ~~ the fractional solution $\tilde{\bm{x}}^{(K)}= (\tilde{x}_1^{(K)},...,\tilde{x}_n^{(K)})$ \end{algorithmic} \end{algorithm} \begin{algorithm}[ht!] \caption{Binary Boosting Simple Algorithm} \label{alg:bBSA} \begin{algorithmic}[1] \State Input: $\bm{d}=\bm{b}/n$, $K$, $\gamma=1/\sqrt{Kn}$ \State Initialize $\bm{p} = \bm{0}$, $(\tilde{{x}}^{(K)}_1,...,\tilde{{x}}^{(K)}_n)=\bm{0}$ \For {$l=1,...,K$} \State Generate random permutation $\sigma_l=(s_1,...,s_n)$ \For {$t=s_1,...,s_n$} \State Set $$\tilde{x}_{l,t} = \begin{cases} 1,& r_{t} >\bm{a}_{t}^\top \bm{p} \\ 0,& r_{t} \le \bm{a}_{t}^\top \bm{p} \end{cases}$$ \State Compute \begin{align*} \bm{p} & = \bm{p} + \gamma \left(\bm{a}_{t}\tilde{x}_{l,t} - \bm{d}\right) \\ \bm{p} & = \bm{p} \vee \bm{0} \end{align*} \State Set $\tilde{{x}}^{(K)}_t=\tilde{{x}}^{(K)}_t+\frac{1}{K}\tilde{{x}}_{l,t}$ \EndFor \EndFor \For {$t=1,...,n$} \State $x_t = Ber(\tilde{x}_t^{(K)})$ \EndFor \State Output: the binary solution $\bm{x} = (x_1,...,x_n)$ \State ~~ ~~ ~~ ~~ the fractional solution $\tilde{\bm{x}}^{(K)}= (\tilde{x}_1^{(K)},...,\tilde{x}_n^{(K)})$ \end{algorithmic} \end{algorithm} To explain the improvement achieved by duplication, we can view it as the benefit of variance reduction. As shown in Figure \ref{fig:dual_cov}, the dual price $\bm{p}_t$ updated by our algorithm tends to converge to the optimal dual price $\bm{p}^*$ when the number of duplication times $K$ is large. However, once $\bm{p}_t$ gets close to $\bm{p}^*$, $\bm{p}_t$ will fluctuate around $\bm{p}^*$. \begin{figure} \centering \includegraphics[width=.5\linewidth]{dualcov.png} \centering\caption{Dual convergence case} \label{fig:dual_cov} \end{figure} In this case, the dual price $\bm{p}$ updated by our algorithm can be viewed as a sample of the noised optimal dual price, i.e., $\bm{p}^*$ plus a noise. Similarly, the solution $\tilde{\bm{x}}_{l}$ can also be viewed as the noised optimal solution. Thus, the average solution $\tilde{\bm{x}}^{(K)}$ can reduce the variation of the noise and improves the performance. From a machine learning perspective, the improvement on the optimality gap can be explained by boosting structure. In some cases, even if the number of duplication times $K$ is small and the dual price $\bm{p}$ marginally moves towards to $\bm{p}^*$, the optimality gap can be reduced significantly, which is also illustrated in Section \ref{sec:exp}. According to \cite{friedman2001elements} and \cite{shalev2014understanding}, boosting was originally proposed as a technique for classification problem. Later, there is a line of papers (\cite{frossyniotis2004clustering},\cite{okabe2018clustering}) that extend the boosting technique to solve clustering problems. The essential idea of boosting is to combine a set of weak classifiers to produce a new learner whose performance is significantly better than each weak classifier. To see the structure of boosting in our algorithm, we first construct a cluster problem from \eqref{eqn:sLP}. From the KKT condition \eqref{SOA_dec} and the Assumption \ref{ass:bdd} (c), we know that at most $m$ entries in the optimal solution $\bm{x}^*$ is not 0 or 1. Thus, if $n\gg m$, we can assign a binary index $x^*_j$ for almost every column-coefficient pair $(r_j,\bm{a}_j)$, such that $x^*_j\in\{0,1\}$. With those binary indices, we can view each column-coefficient pair as a sample, each binary solution $\bm{x}\in\{0,1\}^{n}$ as a result of cluster, and each relaxed solution $\tilde{\bm{x}}\in[0,1]^{n}$ as the index score. That is, if its index score $x_j$ is close to 1, the $j$-th sample is deemed to be in the cluster corresponding to 1 with higher probability, which is shown in our algorithm that $\bm{x}$ is a binary solution constructed by rounding the index score vector $\bm{x}^{(K)}$. Thus, in this case, solving the \eqref{eqn:sLP} is equivalent to finding the index scores $\bm{x}$ for all samples to minimize the following function \begin{align*} L_{\text{OPT}}(\bm{x}) = \left\{ \begin{matrix} &\sum\limits_{j=1}^{n}r_j(x_j^*-x_j), & \text{ if $\bm{A}\bm{x}\leq\bm{b},\ \bm{0}\leq\bm{x}\leq\bm{1}$,}\\ &\infty, & \text{otherwise,} \end{matrix} \right. \end{align*} since this function is a equivalent form of \eqref{eqn:LP}. Thus, we can set the loss function for this clustering problem as \begin{align*} L(\bm{x}) = \left\{ \begin{matrix} &\sum\limits_{j=1}^{n}r_jx_j, & \text{ if $\bm{A}\bm{x}\leq\bm{b},\ \bm{0}\leq\bm{x}\leq\bm{1}$}\\ &\infty, & \text{otherwise,} \end{matrix} \right. \end{align*} which does not depend on the unknown true index $\bm{x}^*$ since $\text{OPT}=\sum\limits_{j=1}^{n}r_jx_j^*$ is a fixed value for \eqref{eqn:LP}. Moreover, if we view $\bm{x}_l$ as a "weak" clustering learner of this cluster problem, the average solution is one combination of weak learners, which is one essential idea of the boosting method as in \cite{friedman2001elements}. \begin{algorithm}[ht!] \caption{Boosting Simple Algorithm} \label{alg:BSA} \begin{algorithmic}[1] \State Input: $\bm{d}=\bm{b}/n$, $K$, $\gamma=1/\sqrt{Kn}$, $M=\sum\limits_{j=1}^{n}M_j$ \State Initialize $\bm{p} = \bm{0}$, $\left(\tilde{{x}}^{(K)}_1,...,\tilde{{x}}^{(K)}_n\right)=\bm{0}$ \For {$l=1,...,K$} \State Generate random permutation $\sigma_l=(s_1,...,s_M)$ \For {$t=s_1,...,s_M$} \State Set $$\tilde{x}_{l,t} = \begin{cases} 1,& r_{t} >\bm{a}_{t}^\top \bm{p} \\ 0,& r_{t} \le \bm{a}_{t}^\top \bm{p} \end{cases}$$ \State Compute \begin{align*} \bm{p} & = \bm{p} + \gamma \left(\bm{a}_{t}\tilde{x}_{l,t} - \bm{d}\right) \\ \bm{p} & = \bm{p} \vee \bm{0} \end{align*} \State Compute $j'=\min\left\{j: t<\sum\limits_{j_0=1}^{j}M_{j_0}\right\}$ \State Set $\tilde{{x}}^{(K)}_{j'}=\tilde{{x}}^{(K)}_{j'}+\frac{1}{K}\tilde{x}_{l,t}$ \EndFor \EndFor \For {$t=1,...,n$} \State $x_t = [\tilde{{x}}^{(K)}_{t}]+Bernoulli(\tilde{{x}}^{(K)}_{t}-[\tilde{{x}}^{(K)}_{t}])$ \EndFor \State Output: the binary solution $\bm{x} = (x_1,...,x_n)$ \State ~~ ~~ ~~ ~~ the fractional solution $\tilde{\bm{x}}^{(K)}= (\tilde{x}_1^{(K)},...,\tilde{x}_n^{(K)})$ \end{algorithmic} \end{algorithm} Now, we solve the \eqref{eqn:LP} by a generalization of Algorithm \ref{alg:bBSA}. To simplify our discussion, we assume $M_j\in\mathbb{N}$ for all $j=1,...,n$. This will not lose the generality because we can always scale the linear program and focus on an equivalent LP as following, \begin{align*} \max \ \ & \sum\limits_{j=1}^{n}\left(\frac{M_j}{[M_j]+1}r_j\right)x_{j} \\ \text{s.t. }\ & \sum\limits_{j=1}^{n}\left(\frac{M_j}{[M_j]+1}\bm{a}_j\right)x_{j} \le \bm{b} \nonumber \\ & x_{j} \in [0,[M_j]+1], \text{ for all } j=1,...,n\nonumber, \end{align*} where $[\cdot]$ is the floor function, and the new LP still satisfies Assumption \ref{ass:bdd}. In this case, solving the \eqref{eqn:LP} is equivalent to solving the extended LP \eqref{eqn:extLP}. \begin{align} \tag{extLP} \max \ \ & \sum\limits_{j=1}^{n}r_j\left(\sum\limits_{l=1}^{M_j}x_{j,l}\right) \label{eqn:extLP} \\ \text{s.t. }\ & \sum\limits_{j=1}^{n}\bm{a}_j\left(\sum\limits_{l=1}^{M_j}x_{j,l}\right) \le \bm{b} \nonumber \\ & x_{j,l} \in [0,1], \text{ for all } j=1,...,n \text{ and } l=1,...,M_j \nonumber, \end{align} We can find an approximate solution $\{\tilde{x}_{j,l},l=1,...,M_j\}_{j=1}^{n}$ to the \eqref{eqn:extLP}. Then, let $\tilde{x}_j^{(K)}=\sum\limits_{l=1}^{M_j}\tilde{x}_{j,l}$ and $$ x_j^{(K)} = [\tilde{x}_j^{(K)}]+Bernoulli(\tilde{x}_j^{(K)}-[x_j^{(K)}]), $$ for all $j=1,...,n$. for all $j=1,...,n$. We find a fractional solution $\tilde{x}_j^{(K)}$ and an integer solution $x_j^{(K)}$ of \eqref{eqn:LP}. Algorithm \ref{alg:BSA} summarizes the above discussion. \subsection{Optimality Gap Analysis} \label{sec:optgap} In this section, we present the bounds of optimality gap and constraint violation of the solution obtained by the Boosting Simple Algorithm (Algorithm \ref{alg:BSA}), and the optimality gap of one feasible version of that solution. With Assumption \ref{ass:bdd}, we show that the optimality gaps of both Algorithm \ref{alg:BSA} and Algorithm \ref{alg:bBSA} decrease in the order of $\frac{1}{\sqrt{K}}$ as discussed in Section \ref{sec:Alg}. The proof mainly follows the ideas in \cite{li2020simple}, \cite{balseiro2020dual} and \cite{balseiro2020best}. We leave the proof in the appendix. \begin{theorem} The regret and expected constraint violation of the fractional solution $\tilde{\bm{x}}$ obtained from Algorithm \ref{alg:bSOA} satisfy $$\Delta(\tilde{\bm{x}}) \le O\left(\frac{\sqrt{n}\log n}{\underline{b}\sqrt{K}} +\frac{m\log nK}{K}\right),$$ $$v(\tilde{\bm{x}}) \le O\left(\sqrt{\frac{m^3n}{\underline{b}^2K}}\right),$$ for all $m, n \in \mathbb{N}^+$. \label{thm_BSA_cv} \end{theorem} To transfer the solution $\tilde{\bm{x}}$ to a feasible solution, we can check the feasibility at each step and terminate the algorithm if one constraint is violated. Denote this feasible fractional solution found by Algorithm \ref{alg:bSOA} as $\bm{x}_{\text{feasible}}$. It satisfies the following theorem. \begin{theorem} The optimality gap of the feasible solution $\bm{x}_{\text{\rm{feasible}}}$ satisfies $$\Delta({\bm{x}}) \le O\left(\frac{\sqrt{n}\log n}{\underline{b}^2\sqrt{K}} +\frac{m\log nK}{K}\right),$$ for all $m, n \in \mathbb{N}^+$. \label{thm_BSA} \end{theorem} \subsection{Variants of Binary Boosting Simple Algorithm} \label{sec:gen} In this section, we introduce two variants of Algorithm \ref{alg:bBSA}. Recall the discussion in Section \ref{sec:soa} and \ref{sec:boost}, the boosting algorithm combines the ``boosting'' structure and Algorithm \ref{alg:SOA}, and the main idea of Algorithm \ref{alg:SOA} is to apply Projected Stochastic Gradient Descent on the optimization problem \eqref{SA}. To find more variants, one idea is to keep the whole framework same and apply other gradient descent methods. Specifically, we apply Online Mirror Descent and Mini Batch Gradient Descent to the framework. Moreover, in Section \ref{sec:gen}, we compares the numerical performance of those three boosting algorithms. First, we introduce Algorithm \ref{alg:bBMD} enlightened by \cite{balseiro2020dual}. This algorithm applies Online Mirror Descent instead of Stochastic Gradient Descent and, thus, have more flexibility to adapt the geometry of the objective function, which will be discussed later. Besides Algorithm \ref{alg:SOA} proposed by \cite{li2020simple}, \cite{balseiro2020dual} and \cite{balseiro2020best} introduce Dual Mirror Descent Algorithm to solve Online LP in linear time concurrently. The main idea of their algorithm is to apply Online Mirror Descent on the problem \eqref{SA}. To introduce the algorithm, we first briefly recall the Online Mirror Descent method (\cite{hazan2019introduction}, \cite{bubeck2011introduction}) when solving the problem \eqref{SA}. When applying Stochastic Gradient Descent, equivalently, we update the approximated solution as the formula below at each iteration to solve \eqref{SA}, \begin{align} \label{upt:sgd} \bm{p}_{t+1} = \arg\min\limits_{\bm{p}\in\mathbb{R}^{m}_{+}} \left\{ \left(\bm{d}-\bm{a}_jI(r_j>\bm{a}_j^{\top}\bm{p}_t)\right)^{\top}\left(\bm{p}-\bm{p}_t\right) + \frac{n}{2}\|\bm{p}-\bm{p}_{t}\|_2^2 \right\}. \end{align} The first part in the RHS of \eqref{upt:sgd} can be viewed as a first order approximation of the value $f_n(\bm{p})-f_n(\bm{p}_t)$. Specifically, since \begin{align*} f_n(\bm{p})-f_n(\bm{p}_t) = \left(\left.\frac{\partial f_n(\bm{p})}{\partial \bm{p}}\right\vert_{\bm{p}=\bm{p}_t}\right)^{\top}\left(\bm{p}-\bm{p}_t\right)+o(\|\bm{p}-\bm{p}_t\|_2), \end{align*} we can find the first term in \eqref{upt:sgd} by using $\bm{d}-\bm{a}_jI(r_j>\bm{a}_j^{\top}\bm{p}_t)$ to estimate $\frac{\partial f_n(\bm{p})}{\partial \bm{p}}|_{\bm{p}=\bm{p}_t}$. The second part in the RHS of \eqref{upt:sgd} can be viewed as penalty since the first order approximation has large error when $\bm{p}$ is far from $\bm{p}_t$. Thus, compared with $\bm{p}_t$, the updated dual price $\bm{p}_{t+1}$ reduces function value by roughly $\left(\left.\frac{\partial f_n(\bm{p})}{\partial \bm{p}}\right\vert_{\bm{p}=\bm{p}_t}\right)^{\top}\left(\bm{p}_{t+1}-\bm{p}_t\right)$. However, the approximation error depends on the local curvature of the target function and the two-norm might not be the best penalty for it. Thus, to adapt this local geometry, Online Mirror Descent replaces the two-norm penalty term in \eqref{upt:sgd} with Bregman divergence $V_h$, i.e. \begin{align} \label{upt:md} \bm{p}_{t+1} = \arg\min\limits_{\bm{p}\in\mathbb{R}^{m}_{+}} \left\{ \left(\bm{d}-\bm{a}_jI(r_j>\bm{a}_j^{\top}\bm{p}_t)\right)^{\top}\left(\bm{p}-\bm{p}_t\right) + \frac{n}{2}V_h(\bm{p},\bm{p}_t) \right\}, \end{align} where the reference function $h$ is an arbitrary strictly-convex function and \begin{align*} V_h(\bm{p},\bm{p}') = h(\bm{p})-h(\bm{p}')-(\bm{p}-\bm{p}')\nabla h(\bm{p'}). \end{align*} Then, applying the same boosting idea in Section \ref{sec:boost}, we have Algorithm \ref{alg:bBMD}, where $\bm{p}_0$ is the initial vector. When we choose $h(\bm{p})=\frac{1}{2}\|\bm{p}\|_2^2$ and $\bm{p}_0=\bm{0}$, the Algorithm \ref{alg:bBMD} is exact same as Algorithm \ref{alg:bBSA}. In Section \ref{sec:exp}, we will select the function $h$ to be the negative entropy function. In that case, if we still choose $\bm{p}_0=\bm{0}$, we will see that at all iterations, the dual price will always be the zero vector, which cannot provide good solution. Additionally, we can also extend it to solve \eqref{eqn:LP} by apply same process in Section \ref{sec:boost}. For the optimality gap, we can also apply the similar method in Theorem \ref{thm_BSA} and \ref{thm_BSA_cv} to find the similar result. \begin{algorithm}[ht!] \caption{Binary Boosting Mirror Descent Algorithm} \label{alg:bBMD} \begin{algorithmic}[1] \State Input: $\bm{d}=\bm{b}/n$, $K$, $\gamma=1/\sqrt{Kn}$ \State Initialize $\bm{p} = \bm{p}_0$, $(\tilde{{x}}^{(K)}_1,...,\tilde{{x}}^{(K)}_n)=\bm{0}$ \For {$l=1,...,K$} \State Generate random permutation $\sigma_l=(s_1,...,s_n)$ \For {$t=s_1,...,s_n$} \State Set $$\tilde{x}_{l,t} = \begin{cases} 1,& r_{t} >\bm{a}_{t}^\top \bm{p}_t \\ 0,& r_{t} \le \bm{a}_{t}^\top \bm{p}_t \end{cases}$$ \State Compute \begin{align*} \bm{p}_{t+1} & = \arg\min\limits_{\bm{p}\in\mathbb{R}^{m}_{+}} \left\{ \left(\bm{d}-\bm{a}_jI(r_j>\bm{a}_j^{\top}\bm{p}_t)\right)^{\top}\left(\bm{p}-\bm{p}_t\right) + nV_h(\bm{p},\bm{p}_t) \right\} \end{align*} \State Set $\tilde{{x}}^{(K)}_t=\tilde{{x}}^{(K)}_t+\frac{1}{K}\tilde{{x}}_{l,t}$ \EndFor \EndFor \For {$t=1,...,n$} \State $x_t = Ber(\tilde{x}_t^{(K)})$ \EndFor \State Output: the binary solution $\bm{x} = (x_1,...,x_n)$ \State ~~ ~~ ~~ ~~ the fractional solution $\tilde{\bm{x}}^{(K)}= (\tilde{x}_1^{(K)},...,\tilde{x}_n^{(K)})$ \end{algorithmic} \end{algorithm} Secondly, we propose Algorithm \ref{alg:bBMB} with Mini Batch Gradient Descent. Mini Batch Gradient Descent (\cite{bottou2010large}) is also one important part of gradient descent methods. Compared with Stochastic Gradient Descent, Mini Batch Descent collect several samples at each iteration to update the solution, which is more stable and has low variance at each step. To be specific, for Stochastic Gradient Descent, we iteratively update dual price with single sample by $$ \bm{p}_{t+1} = \bm{p}_t - \frac{1}{n}(\bm{d}-\bm{a}_t I(r_t>\bm{a}_t^{\top}\bm{p}_t)). $$ \begin{algorithm}[ht!] \caption{Binary Boosting Mini Batch Algorithm} \label{alg:bBMB} \begin{algorithmic}[1] \State Input: $\bm{d}=\bm{b}/n$, $K$, $\gamma=1/\sqrt{Kn}$ \State Input: batch size $s$ \State Initialize $\bm{p} = \bm{0}$, $(\tilde{{x}}^{(K)}_1,...,\tilde{{x}}^{(K)}_n)=\bm{0}$ \For {$l=1,...,K$} \State Generate random permutation $\sigma_l=(s_1,...,s_n)$ \For {$t=1,2,...,n$} \State Set $$\tilde{x}_{l,t} = \begin{cases} 1,& r_{t} >\bm{a}_{t}^\top \bm{p}_t \\ 0,& r_{t} \le \bm{a}_{t}^\top \bm{p}_t \end{cases}$$ \If {$t$ is dividable by $s$} \State Compute \begin{align*} \bm{p}_{t+1} & = \bm{p}_t - \frac{1}{ns}\sum\limits_{j'=0}^{s-1}(\bm{d}-\bm{a}_{t-j'} I(r_{t-j'}>\bm{a}_{t-j'}^{\top}\bm{p}_t)) \end{align*} \Else \State Set $\bm{p}_{t+1} = \bm{p}_t$ \EndIf \State Set $\tilde{{x}}^{(K)}_t=\tilde{{x}}^{(K)}_t+\frac{1}{K}\tilde{{x}}_{l,t}$ \EndFor \EndFor \For {$t=1,...,n$} \State $x_t = Ber(\tilde{x}_t^{(K)})$ \EndFor \State Output: the binary solution $\bm{x} = (x_1,...,x_n)$ \State ~~ ~~ ~~ ~~ the fractional solution $\tilde{\bm{x}}^{(K)}= (\tilde{x}_1^{(K)},...,\tilde{x}_n^{(K)})$ \end{algorithmic} \end{algorithm} Alternatively, for Mini Batch Descent, once the algorithm collect $s$ samples at an iteration, it updates the dual price by $$ \bm{p}_{t+s} = \bm{p}_t - \frac{1}{ns}\sum\limits_{j'=0}^{s-1}(\bm{d}-\bm{a}_{t+j'} I(r_{t+j'}>\bm{a}_{t+j'}^{\top}\bm{p}_t)), $$ where $s$ is a given integer. This basically describes Algorithm \ref{alg:bBMB}, another variant of the boosting algorithm. \subsection{Application in Column Generation} \label{sec:cg} In this section, the boosting algorithms are applied as the initialization of Column Generation methods and the Sifting Procedures to accelerate the process of solving large-scale LPs. Moreover, in this part, we no longer require the resources vector to be positive. First, let us briefly revisit the concept of Column Generation (\cite{lubbecke2005selected})and Sifting(\cite{bixby1992very}). Column Generation method is first proposed by \cite{ford1958suggested}. Assuming that most variables in an large-scale LP would be non-basic and take zero values in the optimal solution. Column Generation methods only consider variables likely to be in the basis instead of all variables. Specifically, In the Column Generation procedure, we call the LP below \eqref{eqn:MLP} as the Master Problem (MP), \begin{align*} \tag{MP} \max \ \ & \sum\limits_{j=1}^{n}r_j x_j \label{eqn:MLP} \\ \text{s.t. }\ & \sum\limits_{j=1}^{n}\bm{a}_j x_j \le \bm{b} \nonumber \\ & x_j \ge 0, \ \ j=1,...,n \nonumber, \end{align*} where $\bm{a}_i \in \mathbb{R}^{m}$ for all $i=1,...,n$ and $\bm{b} = (b_1,...,b_m)^{\top} \in \mathbb{R}^m$. Instead of solving the Master Problem directly, we only solve problems restricted to part of variables in the Master Problem, \begin{align*} \tag{RMP} \max \ \ & \sum\limits_{j\in J}r_j x_j \label{eqn:RLP} \\ \text{s.t. }\ & \sum\limits_{j\in J}\bm{a}_j x_j \le \bm{b} \nonumber \\ & x_j \ge 0, \ \ j\in J \nonumber, \end{align*} where the index set $J$ is a subset of $\{1,...,n\}$. We call this subproblem the Restricted Master Problem (RMP). Let $\bm{x}_{\text{RMP}}^*$, $\bm{p}_{\text{RMP}}^*$ be the optimal primal and dual price corresponding to the subproblem, respectively, and $c^*$ be the minimal reduced cost with respect to $\bm{p}_{\text{RMP}}^*$, namely, $$ c^* = \min_{j=1,..,n}\{ \bm{a}_j^{\top}\bm{p}_{\text{RMP}}^* - r_j \}. $$ After finding the RMP, the Column Generation oracle returns whether $c^*$ is non-negative. If $c^*\geq0$, all reduced costs are non-negative and, thus, the optimal solution of RMP \eqref{eqn:RLP} is also an optimal solution of MP \eqref{eqn:MLP}. We then finish the procedure and can solve RMP to obtain the optimal solution of MP. Otherwise, the oracle will also generate one or several columns whose corresponding reduced costs are strictly negative. We then add them to the index set $J$, and repeat the procedure until $c^*\geq0$. Sifting Procedure is one important Column Generation method. Specifically, during the procedure, Sifting method computes reduced costs for all columns, and select one or several columns with smallest reduced costs to put into the index set $J$. Although computing all reduced costs is computationally expensive, due to the development of current computing power, Sifting is often a powerful tool to solve LP and it is widely implemented in most state-of-the art LP solvers, such as COPT, Gurobi and CPLEX. Although it is useful, Column Generation Methods still suffers from several issues (\cite{vanderbeck2005implementing}), such as the heading-in effect, the tailing off effect, and the bang-bang effect. Specifically, the heading-in effect is the phenomenon that due to insufficient prior knowledge, the index set $J$ of the initial RMP has small overlap with the set of indices of non-zero variables in the optimal solution so that the algorithm spends long time to starting to increase the objective value at the beginning. The tailing off effect is the phenomenon that the convergence of the duality gap is very slow, where the duality gap is the difference between the primal optimal objective value of the RMP and the dual objective value of original problem with respect to the dual price $\bm{p}_{RMP}^*$. The bang-bang effect is the case that the dual solutions obtained by RMPs jump form one extreme point to another. In this section, we apply our boosting algorithm to moderate heading-in effect and the bang-bang effect to accelerate Column Generation Procedure. First, to moderate the heading-in effect, the boosting algorithms can be applied to better identify non-zero variables in the true optimal solution to formulate the initial RMP. Intuitively, given that our algorithm can find good approximate solution of LPs, it is reasonable to believe that the variables have large value in the solution obtained by our boosting algorithms tend to be more likely to have contribution in the true optimal solution. Thus, we can directly initialize the Column Generation procedure with with variables with large values in the solution obtained by the boosting algorithms. Specifically, we can set up any thresholds $\epsilon$ and the the duplication size $K$ in the beginning, apply our boosting algorithm to obtain a fraction solution $\tilde{\bm{x}}^{(K)}$, and set $$ J=\left\{j\in\{1,...,n\}: \tilde{x}_j^{(K)}>\epsilon\right\} $$ as the index set of the initial RMP. Moreover, to moderate the bang-bang effect, we combine the dual price with the dual stabilization technique to accelerate Sifting procedure. The stabilization technique is widely used in Column Generation (\cite{du1999stabilized}, \cite{amor2004stabilization}, \cite{lubbecke2005selected}, and \cite{2011Chebyshev}). This technique has two main ideas: finding a good stabilization center of the dual price and searching for new dual prices around the center. According to \cite{lubbecke2010column}, a good stabilization center is believed to be close to true dual optimal solution or at least an interior point of dual space. Recall that Algorithm \ref{alg:BSA} carries out stochastic descent in dual space and, thus, the dual price obtained by Algorithm \ref{alg:BSA} is probably a high-quality dual solution. Hence we may choose it as the stabilization center and denote this dual price by $\bm{p}_{\text{Online}}$. Once we have this center, at each step during the Sifting, we compute reduced cost by $$ \hat{\bm{p}} = \alpha \bm{p}^*_{\text{RMP}} + (1-\alpha) \bm{p}_{\text{Online}} $$ instead of $\bm{p}^*_{\text{RMP}}$, where $\alpha>0$ is a parameter chosen by the algorithm designer. In this case, once this dual price is close to dual optimal solution $\bm{p}^*$, we can expect good stabilization effect and acceleration. Then, we can combine the initialization part and this stabilization part together to have a boosting algorithm based Column Generation method. \section{Numerical Experiments} \label{sec:exp} In this section, we present some numerical results for our proposed algorithms. Section \ref{sec:solver} illustrates the performance of boosting algorithms as direct LP solvers. Section \ref{sec:cg} applies the boosting algorithms as the initialization and a of Column Generation methods for solving large scale LPs. \subsection{Approximate Solver} \label{sec:solver} In this section, we apply boosting algorithms as approximate algorithms to solve LPs/integer LPs. To this end, we only compare the performance of feasible solutions in this section. The first experiment compares the performance of the feasible fractional solution obtained by Algorithm \ref{alg:SOA}, Algorithm \ref{alg:bBSA} and Gurobi in terms of time (millisecond) and competitiveness ratio, where the competitiveness ratios are the ratio between the objective obtained by the given algorithms against the relaxed LP's optimal objective value solved by Gurobi. Here, Simple Online Algorithm \ref{alg:SOA} is a special case for the Algorithm \ref{alg:bBSA} when $K=1$. We test our algorithms on the linear relaxation of some Multi-knapsack benchmark problems \citep{chu1998genetic} with different duplication sizes $K=10,50,10^3$ and different orders of resources vectors $\bm{b}$, namely, $O(n)$, $O(n^{1/2})$ and $O(n^{1/3})$ in this experiment. According to \cite{chu1998genetic}, this binary knapsack problems are dense and the resources vectors $\bm{b}$ they generate are in the order of $n$. In our experiments, we modify the order of resources vector from $O(n)$ to $O(n^\alpha)$ by multiplying a factor $n^{\alpha-1}$ to their resources vectors for any $\alpha\in(0,1]$. For each choice of $m$ and $n$, we run $100$ simulation trials and present the average time and ratio. The results are shown in Table \ref{tab:sol_1}, \ref{tab:sol_1/2} and \ref{tab:sol_1/3}. From the tables, we observe that the ratio increases when the duplication size increases from $10$ to $10^3$ for all cases. Further, when $K=10$ or $50$, the ratio is roughly no less than than $90\%$ or $95\%$ respectively for different orders of resources vector and different sizes of problems, which is $10\%$ or even $40\%$ better than Algorithm \ref{alg:SOA}. We can conclude that the boosting algorithm can better utilize the data than Algorithm \ref{alg:SOA} and find a better solution even though the resources vector is sublinear. This phenomena is consistent with our theorem \ref{thm_BSA}. Moreover, our algorithm is also time-efficient for large problems. As shown in the tables, the running time of Algorithm \ref{alg:BSA} with $K=10$ is from one sixth to one thirtieth compared with Gurobi when $m=128,\ n=10^5$, although we did not apply any accelerating methods for vector computing, such as parallely computing vector multiplications. \begin{table}[ht!] \centering \small \begin{tabular}{cc|c|c|c|c|c} \toprule && Gurobi & Alg. \ref{alg:SOA} & Alg. \ref{alg:BSA} ($K=10$) & Alg. \ref{alg:BSA} ($K=50$) & Alg. \ref{alg:BSA} ($K=10^3$) \\ \midrule \multirow{2}{*}{\scriptsize $m=5, n=10^2$} & time & 1.00 & 0.02 & 0.08 & 0.35 & 6.72 \\ & Cmpt. Ratio &100.0\% & 80.2\% & 93.3 \% & 96.8\% & 99.5\% \\ \midrule \multirow{2}{*}{\scriptsize $m=8, n=10^3$} & time & 1.99 & 0.22 & 1.20 & 5.90 & 93.17 \\ &Cmpt. Ratio & 100.0\% & 86.4\% & 95.4\% & 98.1\% & 99.7\% \\ \midrule \multirow{2}{*}{\scriptsize $m=32, n=4\times10^3$} & time & 49.8 & 1.29 & 18.11 & 79.50 & 1250 \\ & Cmpt. Ratio & 100.0\% & 74.2\% & 89.1\% & 95.0\% & 99.2\% \\ \midrule \multirow{2}{*}{\scriptsize $m=64, n=10^4$} & time & 285.7 & 6.53 & 88.79 & 391.53 & 6420 \\ & Cmpt. Ratio & 100\% & 70.5\% & 86.1\% & 93.3\% & 98.7\% \\ \midrule \multirow{2}{*}{\scriptsize $m=128, n=10^5$} & time & 12600 & 150.52 & 1980 & 8610 & 143000 \\ & Cmpt. Ratio & 100\% & 76.4\% & 90.4\% & 95.6\% & 99.1\% \\ \bottomrule \end{tabular} \caption{Linear Relaxation of Multi-knapsack Benchmark Problem with $\bm{b}\sim O(n)$} \label{tab:sol_1} \end{table} \begin{table}[ht!] \centering \small \begin{tabular}{cc|c|c|c|c|c} \toprule && Gurobi & Alg. \ref{alg:SOA} & Alg. \ref{alg:BSA} ($K=10$) & Alg. \ref{alg:BSA} ($K=50$) & Alg. \ref{alg:BSA} ($K=10^3$) \\ \midrule \multirow{2}{*}{\scriptsize $m=5, n=10^2$} & time & 1.00 & 0.02 & 0.08 & 0.35 & 6.72 \\ & Cmpt. Ratio &100.0\% & 64.4\% & 90.3\% & 96.1\% & 99.5\% \\ \midrule \multirow{2}{*}{\scriptsize $m=8, n=10^3$} & time & 3.10 & 0.22 & 1.20 & 5.90 & 93.17 \\ &Cmpt. Ratio & 100.0\% & 80.2\% & 95.0\% & 98.1\% & 99.7\% \\ \midrule \multirow{2}{*}{\scriptsize $m=32, n=4\times10^3$} & time & 75.4 & 1.29 & 18.11 & 79.50 & 1250 \\ & Cmpt. Ratio & 100.0\% & 80.1\% & 93.2\% & 96.8\% & 99.2\% \\ \midrule \multirow{2}{*}{\scriptsize $m=64, n=10^4$} & time & 303.2 & 6.53 & 88.79 & 391.53 & 6420 \\ & Cmpt. Ratio & 100\% & 81.0\% & 92.3\% & 96.1\% & 98.7\% \\ \midrule \multirow{2}{*}{\scriptsize $m=128, n=10^5$} & time & 12600 & 150.52 & 1980 & 8610 & 143000 \\ & Cmpt. Ratio & 100\% & 87.6\% & 94.8\% & 97.2\% & 99.1\% \\ \bottomrule \end{tabular} \caption{Linear Relaxation of Multi-knapsack Benchmark Problem with $\bm{b}\sim O(n^{1/2})$} \label{tab:sol_1/2} \end{table} \begin{table}[ht!] \centering \small \begin{tabular}{cc|c|c|c|c|c} \toprule && Gurobi & Alg. \ref{alg:SOA} & Alg. \ref{alg:BSA} ($K=10$) & Alg. \ref{alg:BSA} ($K=50$) & Alg. \ref{alg:BSA} ($K=10^3$) \\ \midrule \multirow{2}{*}{\scriptsize $m=5, n=10^2$} & time & 0.51 & 0.02 & 0.08 & 0.35 & 6.72 \\ & Cmpt. Ratio &100.0\% & 41.3\% & 85.8\% & 96.3\% & 99.3\% \\ \midrule \multirow{2}{*}{\scriptsize $m=8, n=10^3$} & time & 3.4 & 0.22 & 1.20 & 5.90 & 93.17 \\ &Cmpt. Ratio & 100.0\% & 58.6\% & 92.2\% & 96.8\% & 99.2\% \\ \midrule \multirow{2}{*}{\scriptsize $m=32, n=4\times10^3$} & time & 76.1 & 1.29 & 18.11 & 79.50 & 1250 \\ & Cmpt. Ratio & 100.0\% & 65.1\% & 91.2\% & 96.7\% & 99.5\% \\ \midrule \multirow{2}{*}{\scriptsize $m=64, n=10^4$} & time & 355.1 & 6.53 & 88.79 & 391.53 & 6420 \\ & Cmpt. Ratio & 100\% & 67.1\% & 91.5\% & 97.4\% & 99.5\% \\ \midrule \multirow{2}{*}{\scriptsize $m=128, n=10^5$} & time & 70100 & 150.52 & 1980& 8610 & 143000 \\ & Cmpt. Ratio & 100\% & 78.7\% & 94.7\% & 98.0\% & 99.6\% \\ \bottomrule \end{tabular} \caption{Linear Relaxation of Multi-knapsack Benchmark Problem with $\bm{b}\sim O(n^{1/3})$} \label{tab:sol_1/3} \end{table} The second experiment compares the performance of Algorithm \ref{alg:BSA} with Gurobi when solving large-scale sparse LPs and also present the time (millisecond) and the competitive ratio. Again, the competitiveness ratios are the ratio between the objective obtained by given algorithms against the relaxed LP's optimal objective value solved by Gurobi. To generate the sparse problem, we first generated a dense problem according to \cite{chu1998genetic} and, then, randomly choose $0.01mn$ non-zero entry in the dense resources consumption matrix $\bm{A}$. Then, we test our algorithms on the data generated similarly as the benchmark data with different duplication sizes, namely, $K=10,\ 50,\ 10^3$, and order of resources vectors. Also, for each choice of $m$ and $n$, we run $100$ simulation trials and present the average time and ratio in Table \ref{tab:solsp_1}, \ref{tab:solsp_1/2} and \ref{tab:solsp_1/3}. As shown in those tables, when $K=10$, the computational time of our algorithm is around $2\times 10^3$ milliseconds, which is slightly better than Gurobi. In the case that the resources vector is in the order of $n$, the running time of our algorithm can be one fourth of Gurobi. Moreover, when $K=10$, the ratio of our algorithm is already better than $95\%$ in average, which approximately is the optimal solution. Thus, our algorithm could also be competitive with Gurobi even in some sparse problems. \begin{table}[ht!] \centering \small \begin{tabular}{cc|c|c|c|c} \toprule && Gurobi & Alg. \ref{alg:BSA} ($K=10$) & Alg. \ref{alg:BSA} ($K=50$) & Alg. \ref{alg:BSA} ($K=10^3$) \\ \midrule \multirow{2}{*}{\scriptsize $m=64, n=10^4$} & time & 12.2 & 3.36 & 12.13 & 250.78 \\ & Cmpt. Ratio &100.0\% & 99.0\% & 93.3\% & 99.9\% \\ \midrule \multirow{2}{*}{\scriptsize $m=128, n=10^5$} & time & 474 & 55.04 & 246.07 & 3800 \\ &Cmpt. Ratio & 100.0\% & 99.5\% & 95.6\% & 99.9\% \\ \midrule \multirow{2}{*}{\scriptsize $m=1024, n=10^6$} & time & 7980 & 2020 & 8320 & 15500 \\ & Cmpt. Ratio & 100.0\% & 96.5\% & 95.7\% & 99.5\% \\ \bottomrule \end{tabular} \caption{Sparse Linear Relaxation of Multi-knapsack Benchmark Problem with $\bm{b}\sim O(n)$} \label{tab:solsp_1} \end{table} \begin{table}[ht!] \centering \small \begin{tabular}{cc|c|c|c|c} \toprule && Gurobi & Alg. \ref{alg:BSA} ($K=10$) & Alg. \ref{alg:BSA} ($K=50$) & Alg. \ref{alg:BSA} ($K=10^3$) \\ \midrule \multirow{2}{*}{\scriptsize $m=64, n=10^4$} & time & 12.2 & 3.36 & 12.13 & 250.78 \\ & Cmpt. Ratio &100.0\% & 94.8\% & 96.0\% & 94.8\% \\ \midrule \multirow{2}{*}{\scriptsize $m=128, n=10^5$} & time & 474.4 & 55.04 & 246.07 & 3800 \\ &Cmpt. Ratio & 100.0\% & 91.2\% & 97.3\% & 91.6\% \\ \midrule \multirow{2}{*}{\scriptsize $m=1024, n=10^6$} & time & 3580 & 2020 & 8320 & 15500 \\ & Cmpt. Ratio & 100.0\% & 96.5\% & 98.8\% & 99.4\% \\ \bottomrule \end{tabular} \caption{Sparse Linear Relaxation of Multi-knapsack Benchmark Problem with $\bm{b}\sim O(n^{1/2})$} \label{tab:solsp_1/2} \end{table} \begin{table}[ht!] \centering \small \begin{tabular}{cc|c|c|c|c} \toprule && Gurobi & Alg. \ref{alg:BSA} ($K=10$) & Alg. \ref{alg:BSA} ($K=50$) & Alg. \ref{alg:BSA} ($K=10^3$) \\ \midrule \multirow{2}{*}{\scriptsize $m=64, n=10^4$} & time & 12.2 & 3.36 & 12.13 & 250.78 \\ & Cmpt. Ratio &100.0\% & 94.8\% & 97.0\% & 97.4\% \\ \midrule \multirow{2}{*}{\scriptsize $m=128, n=10^5$} & time & 130.3 & 55.04 & 246.07 & 3800 \\ &Cmpt. Ratio & 100.0\% & 91.2\% & 97.8\% & 96.7\% \\ \midrule \multirow{2}{*}{\scriptsize $m=1024, n=10^6$} & time & 2750 & 2020 & 8320 & 15500 \\ & Cmpt. Ratio & 100.0\% & 99.2\% & 91.3\% & 99.2\% \\ \bottomrule \end{tabular} \caption{Sparse Linear Relaxation of Multi-knapsack Benchmark Problem with $\bm{b}\sim O(n^{1/3})$} \label{tab:solsp_1/3} \end{table} The third experiment compares the performance of Algorithm \ref{alg:BSA}, \ref{alg:bBMD} and \ref{alg:bBMB} on the linear relaxation of knapsack benchmark problem. In this part, we only compares the competitiveness ratio since, theoretically, all of three algorithms share the same computational complexity. As previous experiments, we also test our algorithms with different duplication sizes, namely $K=10$ and $50$. In addition, we set $\bm{p}_0 = \bm{1}/\exp$ and select the reference function $h(\bm{p})$ of the Algorithm \ref{alg:bBMD} to be the negative entropy function $$ h(\bm{p}) = \sum\limits_{j=1}^{m}p_i\log p_i, $$ where $\bm{p}=(p_1,...,p_m)^{\top}\in\mathbb{R}^m$. In this case, the corresponding Bregman divergence coincides with the generalized KL divergence, and dual price updating also only costs constant time at iteration $t$, namely, \begin{align} \label{eqn:uptkl} \bm{p}_{t+1} = \exp\left\{-\gamma(\bm{d}-\bm{a}_{t} x_{t})\right\}\bm{p}_t, \end{align} where the multiplication and the exponential function is computed entry-wisely. Here, we can set $\bm{p}_0$ to be any strictly positive vector theoretically (\cite{balseiro2020best}). Moreover, for Algorithm \ref{alg:bBMB}, we set the batch size be 10. The results are listed in Table \ref{tab:bs10} and \ref{tab:bs50}. First, we observe that all algorithms perform better when the duplication size increase. This improvement along with the duplication size is consistent with our theoretical results. in this experiment, Algorithm \ref{alg:bBMD} can achieve better competitive ratio with lower duplication size than others when the resources vector is relatively large, especially when the vector is in the order of $O(n)$. However, when the order of the resources vector decreases to $1/3$ and the size of $n$ raises to $10^5$, Algorithm \ref{alg:bBMD} has poor performance and can only achieve no more than $40\%$ competitive ratio. One possible reason is that the updating process \eqref{eqn:uptkl} is very slow for Algorithm \ref{alg:bBMD} in this case since the vector $\bm{d}$ is very small. Then, all dual price obtained by this algorithm are close to the initialization price. Thus, if the initial estimation overestimates the dual price, this algorithm is likely to set 0 for all decision variables. This result suggests that one should be careful when choosing the reference function and the initialization for Algorithm \ref{alg:bBMD} based on the data. \begin{table}[H] \centering \small \begin{tabular}{c|c|c|c|c} \toprule $K=10$ & Order of $\bm{b}$ & Alg. \ref{alg:bBSA}& Alg. \ref{alg:bBMD} & Alg. \ref{alg:bBMB} \\ \midrule \multirow{3}{*}{\scriptsize $m=8, n=10^3$} & $O(n)$ & $95.4\%$ & $99.0\%$ & $99.2\%$\\ &$O(n^{1/2})$ & 95.0\% & 95.5\% & 85.7\% \\ &$O(n^{1/3})$ & 92.1\% & 89.9\% & 54.0\% \\ \midrule \multirow{3}{*}{\scriptsize $m=64, n=10^4$} & $O(n)$ & $86.1\%$ & $99.7\%$ & $98.2\%$ \\ &$O(n^{1/2})$ & 92.3\% & 69.4\% & 96.0\% \\ &$O(n^{1/3})$ & 92.1\% & 0.0\% & 84.8\% \\ \midrule \multirow{3}{*}{\scriptsize $m=128, n=10^5$} & $O(n)$ & $90.4\%$ & $99.9\%$ & $98.9\%$ \\ &$O(n^{1/2})$ & 94.8\% & 60.6\% & 97.6\% \\ &$O(n^{1/3})$ & 94.7\% & 0.0\% & 89.4\% \\ \bottomrule \end{tabular} \caption{Competitive Ratios of Boosting Algorithms with Duplication Size $K=10$} \label{tab:bs10} \end{table} \begin{table}[ht!] \centering \small \begin{tabular}{c|c|c|c|c} \toprule $K=50$ & Order of $\bm{b}$ & Alg. \ref{alg:bBSA}& Alg. \ref{alg:bBMD} & Alg. \ref{alg:bBMB} \\ \midrule \multirow{3}{*}{\scriptsize $m=8, n=10^3$} & $O(n)$ & $98.1\%$ & $99.6\%$ & $99.7\%$\\ &$O(n^{1/2})$ & 98.1\% & 98.2\% & 93.3\% \\ &$O(n^{1/3})$ & 96.5\% & 96.8\% & 77.1\% \\ \midrule \multirow{3}{*}{\scriptsize $m=64, n=10^4$} & $O(n)$ & $93.3\%$ & $99.8\%$ & $99.5\%$ \\ &$O(n^{1/2})$ & 96.1\% & 86.3\% & 98.1\% \\ &$O(n^{1/3})$ & 97.4\% & 37.5\% & 93.1\% \\ \midrule \multirow{3}{*}{\scriptsize $m=128, n=10^5$} & $O(n)$ & $95.6\%$ & $99.9\%$ & $99.7\%$ \\ &$O(n^{1/2})$ & 97.2\% & 82.4\% & 99.1\% \\ &$O(n^{1/3})$ & 98.0\% & 0.0\% & 94.5\% \\ \bottomrule \end{tabular} \caption{Competitive Ratios of Boosting Algorithms with Duplication Size $K=50$} \label{tab:bs50} \end{table} \subsection{Column Generation} \label{sec:expcg} In this section, we present performance the application of our boosting algorithm in Column Generation methods as discussed in Section \ref{sec:cg}. We select thirteen benchmark datasets from \textbf{MIPLIB} (\cite{MIPLIB}) and \textbf{Mittelmann Hans' LP Benchmark}. These problems feature $n \gg m$, high sparsity and cover type constraints. The first experiment presents the performance of our boosting algorithm for initializing Column Generation. Recall the first part in Section \ref{sec:cg} that to initialize the Column Generation, we can run Algorithm \ref{alg:BSA} or \ref{alg:bBMD} to find an approximate solution $\bm{x}^{(K)}$ and select columns $j$ into the initial index set of RMP if $x_j^{(k)}>\epsilon$, where $\epsilon$ is a threshold chosen by the user. Let $J$ denote the index set of selected columns, $\mathcal{B}^*$ denote the index set of non-zero optimal solutions and $n$ denote the total number of variables. In Table \ref{tab:varidy}, we compare the number of selected columns in the optimal solution $\vert J\cap \mathcal{B}^*\vert$ with the number of non-zero optimal solutions as the accuracy of the selection $\vert\mathcal{B}^*\vert$, and compare the number of selected columns $\vert J\vert$, i.e., the number of variables in the RMP, with the total number of variables $n$ as the size reduction of the original problem. We observe that our algorithm can detect $90$ percents of non-zero variables for first ten data sets and reduce the size of problem by one fifth to one fiftieth. Especially for sixth to tenth problems, our algorithm can find all non-zero variables and reduce the size to at most one fiftieth. This result illustrates that our boosting algorithm might be very useful to accelerate Column Generation and moderate the heading-in effect on some kind of set covering problems. \begin{table}[ht!] \label{tab:varidy} \small \centering \begin{tabular}{c|c|c|c} \hline ID & Dataset & Accuracy & Size Reduction\\ \hline 1 & rail507 & 271/301 & 11862/62171\\ 2 & rail516 & 121/138 & 8572/46978\\ 3 & rail582 & 325/347 & 12465/54315\\ 4 & rail2586 & 1536/1672 & 145373/909940\\ 5 & rail4284 & 1951/2042 & 348135/1090526\\ 6 & scpm1 & 2754/2754 & 10352/500000\\ 7 & scpn2 & 3411/3411 & 20860/1000000\\ 8 & scpl4 & 1149/1149 & 5718/200000\\ 9 & scpj4scip & 552/552 & 3635/99947\\ 10 & scpk4 & 930/930 & 4077/100000\\ 11 & s82 & 1992/3020 & 52383/1687859\\ 12 & s100 & 150/487 & 835/364203\\ 13 & s250r100 & 415/747 & 3080/270323\\ \hline \end{tabular} \caption{Basic variable identification} \end{table} The second experiment compares the performance of the CPLEX Sifting solver, the CPLEX concurrent solver, the CPLEX dual simplex solver and our boosting algorithm-based Sifting method discussed in the second part in Section \ref{sec:cg}. We use the latest stable build of CPLEX (12.1.0) and briefly explain the behavior of the above solvers. \begin{itemize} \item The CPLEX Sifting solver will use all available threads to run the Sifting (Column Generation) algorithm. \item The CPLEX concurrent solver spends most threads on the barrier method and three remaining threads (if available) on the primal simplex method, dual simplex method and sifting algorithm method mentioned above in parallel. Once one of the above algorithm successfully solves the problem, the solver whole routine finishes. \item The CPLEX dual simplex solver utilizes all available threads to run dual simplex method. \item Our boosting Sifting Method is implemented in Python using the CPLEX concurrent solver for the RMPs. Specially, we shut down sifting when solving the RMPs and implement some basic heuristics (e.g., dual stabilization) to accelerate our sifting method. \end{itemize} Here, we use the same data sets as the previous experiment, and show time (second) that listed algorithms take to find the optimal solution in table \ref{tab:sifting}. Also, to demonstrate the robustness of our method, we presolve the problems before running the boosting algorithm. From the table, we can see that our algorithm is roughly the fastest one in problem 6 to 10 in which all non-zero variables are detected by our boosting algorithm. Moreover, even if our algorithm cannot detect all non-zero optimal variables, our algorithm can still be faster than CPLEX Sifting among problem 12 and 13. This result illustrates that our algorithm has potential to accelerate Column Generation method. Furthermore, in those two experiments, the problems are set cover problems. In other words, the resources vectors can be negative in this case. Thus, the numerical results shows that our algorithm might be useful in solving more general LPs. Also, since our sifting implementation calls CPLEX as a subroutine and spends much time transferring data, we believe that there is still space for improvement if our boosting method can be directly embedded within the solver as a presolving heuristic. \begin{table}[ht!] \small \label{tab:sifting} \centering \begin{tabular}{c|c|c|c|c|c|c} \hline ID &Dataset & Accuracy & CPLEX Sift. & boosting based Sift. & CPLEX Con. & CPLEX Dual\\ \hline 1& rail507 & 271/301 & 0.49 & 0.72 & 0.63 & 0.58\\ 2& rail516 & 121/138 & 0.38 & 0.73 & 0.31 & 0.19\\ 3& rail582 & 325/347 &0.60 & 1.15 & 0.41 & 0.37\\ 4& rail2586 & 1536/1672 &5.44 & 10.65 & 8.83 & 25.16\\ 5& rail4284 & 1951/2042 &14.13 & 22.64 & 16.98 & 76.44 \\ 6& scpm1 & 2754/2754 &19.08 & 8.74 & 17.36 & 430.61\\ 7& scpn2 & 3411/3411 &51.38 & 12.99 & 27.62 & $>2000$\\ 8& scpl4 & 1149/1149 &0.94 & 0.78 & 2.67& 62.87\\ 9& scpj4scip & 552/552 &0.47 & 0.39 & 1.26& 1.70\\ 10& scpk4 & 930/930 &0.60 & 0.61 & 1.56& 12.92\\ 11& s82 & 1992/3020 & $>$3000 & $>$3000 & $>$3000 & $>$3000\\ 12& s100 & 150/487 &151.65 & 38.30 & 11.72& 505.81 \\ 13& s250r10 & 415/747 &23.07 & 21.55 & 5.16 & 27.53\\ \hline \end{tabular} \caption{Real-world Benchmark Numerical Result} \end{table} \section{Conclusion} In this paper, we introduce a new algorithm combining the idea of ``boosting'' and first order online Algorithms to solve Linear Programming Problems in two situations: solving LPs as direct solvers and solving LP as auxiliary to accelerate other solvers. For the direct solver part, we show that our algorithm can achieve $O(\sqrt{\frac{n}{K}})$ optimality gap for relaxed Knapsack problem, where $n$ is the number of variables and $K$ is the number of duplication size for the boosting. Numerical experiments illustrates our result. Moreover, numerical results shows that our algorithm performs well to accelerate Sifting method and might have potential to solve more general LPs. In this paper, we only utilize the idea of the combination of weak learners of boosting. However, one main feature of the boosting is to re-weight samples when choosing them. In the future, one might explore efficient ways to re-weight variables and only consider variables that are easily assigned to wrong class when solving LPs. Furthermore, we believe that our algorithm still has space for improvement by leveraging more efficient implementation such as parallelism. And as a presolving heuristic, our method will bring more improvement if directly embedded in the optimization solvers. \ACKNOWLEDGMENT{% We thank Xiaocheng Li, Qi Huangfu, Dongdong Ge and the seminar participants at Shanghai University of Finance and Economics for helpful discussions and comments. \begin{APPENDICES} \section{Analysis of Theorem \ref{thm_BSA_cv}} In this section, we analyze the performance of Alg. \ref{alg:bSOA} in terms of the optimality gap and the constraint violation if infeasible solution are acceptable. The idea of proof follows the idea in \cite{li2020simple}. \subsection{Preliminary} First, we present Lemma 1 and Proposition 1 in \cite{li2020simple}. Since the dual objective function \eqref{SA} is not strictly convex, the SGD method might be not able to generate a converging sequence of $\bm{p}_t$. Thus, it is important to apply Lemma \ref{iidBound} to have a provable bound for the dual price learned by the algorithm. Proposition \ref{importantLemma2} considers the relationship of average objective values of a partial LP and \eqref{eqn:sLP}. Specifically, consider a scaled partial version of the primal LP \eqref{eqn:sLP}, \begin{align} \label{eqn:S-LP} \tag{pLP} \max \ \ & \sum_{j=1}^s r_jx_j \\ \text{s.t. }\ & \sum_{j=1}^s a_{ij}x_j \le \frac{sb_i}{n} \nonumber \\ & 0 \le x_j \le 1\ \text{ for } j=1,...,s.\nonumber \end{align} for $s=1,...,n$. Denote its optimal objective value as $R_s^*$ and denote the optimal value of the primal LP as $R_n^*$, which is also the optimal objective value of the \eqref{eqn:S-LP} when $s=n$. Then, Proposition \ref{importantLemma2} relates $R_s^*$ with $R_n^*.$ \begin{lemma}[Lemma 1 in \cite{li2020simple}] \label{iidBound} Under Assumption \ref{ass:bdd}, if the step size $\gamma_t \le 1$ for $t=1,...,n$ in Algorithm \ref{alg:SOA}, then $$\|\bm{p}^*\|_2\leq\frac{1}{\underline{b}},$$ $$\|\bm{p}_t\|_2 \leq{\frac{2+4m}{\underline{b}}} + 2m.$$ with probability $1$ for $t=1,...,n$, where $\bm{p}_t$'s are specified by Algorithm \ref{alg:SOA}. \end{lemma} \begin{proposition}[Proposition 1 in \cite{li2020simple}] For $s>e^{16},$ the following inequality holds \begin{equation*} \frac{1}{s}\mathbb{E} \left[R_{s}^*\right] \geq \frac{1}{n} R_n^* - \frac{m }{n}-\frac{ \log s}{\underline{b}\sqrt{s}} - \frac{m }{s}. \end{equation*} for $n\in\mathbb{N}^+$. \label{importantLemma2} \end{proposition} Here, Lemma \ref{iidBound} can be applied directly to Algorithm \ref{alg:SOA} because the proof is independent of the number of variables and our algorithm only increases the number of variables. Proposition \ref{importantLemma2} is also applicable to our algorithm with slight modification. Now, we establish the derivation of the proposition above to apply in our analysis. In Algorithm \ref{alg:bSOA}, define the LP corresponds to the $t$-th step as \eqref{eqn:psLP}. \begin{align} \label{eqn:psLP} \tag{p-sLP} \max \ \ & \sum_{j=1}^{t} r_jx_{j} \\ \text{s.t. }\ & \sum_{j=1}^{t} a_{ij}x_{j} \leq\frac{tb_i}{n} \ \text{ for } i=1,...,m\nonumber\\ & 0 \le x_{j} \le 1\ \text{ for } j=1,...,t.\nonumber \end{align} Denote the optimal value of \eqref{eqn:psLP} as $R^*_{t}$ and apply Proposition \ref{importantLemma2}. We have the following deviated Proposition \ref{importantLemma}. \begin{proposition} \label{importantLemma} For $t>e^{16},$ the following inequality holds \begin{equation}\label{R_k_R_n} \frac{1}{t}\mathbb{E} \left[R_{t}^*\right] \geq \frac{1}{n} R_n^* - \frac{1}{Kn} - \frac{\log t}{\underline{b}\sqrt{t}} - \frac{m}{t}. \end{equation} for $n\in\mathbb{N}^+$. \end{proposition} Then, we present another important proposition for the mirror descent algorithm, which is also given in \cite{balseiro2020dual} \begin{proposition}[Proposition 5 in \cite{balseiro2020best}] \label{mdw} For every $\bm{p}\in\mathbb{R}^m$, we have \begin{align*} \sum\limits_{t=1}^{Kn}\left[(\bm{d}-\bm{a}_t)^T\bm{p}_t\right] \leq \sum\limits_{t=1}^{Kn}\left[(\bm{d}-\bm{a}_t)^T\bm{p}\right]+O\left(\sqrt{Kn}(1+\|\bm{p}\|_2^2)\right) \end{align*} \end{proposition} \subsection{Proof of Theorem \ref{thm_BSA_cv}} The proof and notations also mainly follow the Theorem 2 in \cite{li2020simple}. However, with a slight change, the optimality gap can be improved with respect to $m$. For the optimality gap, $$ R_n^*-\mathbb{E}\left[\frac{1}{K}\sum\limits_{t=1}^{Kn}r_{t}x_{t}\right], $$ where $x_{t}$ is the obtained by Algorithm \ref{alg:SOA} at the $t$-th step. We have \begin{align} R_n^*-\mathbb{E}\left[\frac{1}{K}\sum\limits_{t=1}^{Kn}r_{t}x_{t}\right]\nonumber =& R_n^*- \frac{1}{K}\sum\limits_{t=0}^{Kn-1}\frac{1}{t}\mathbb{E}[R_{t}^*] + \frac{1}{K}\sum\limits_{t=0}^{Kn-1}\frac{1}{t}\mathbb{E}[R_{t}^*] -\mathbb{E}\left[\frac{1}{K}\sum\limits_{t=1}^{Kn}r_{t}x_{t}\right]\nonumber \\ =& \frac{1}{K}\sum\limits_{t=1}^{nK}\left(\frac{1}{n}R_n^*-\frac{1}{t-1}\mathbb{E}[R_{t-1}^*]\right)\label{p1}\\ &+ \frac{1}{K}\sum\limits_{t=1}^{Kn}\mathbb{E}\left[\frac{1}{Kn-t}\tilde{R}_{t-1}^*-r_{t}x_{t}\label{p2} \right], \end{align} where $\tilde{R}_{t}^*$ denotes the optimal objective value of the following LP \begin{align*} \max \ \ & \sum_{j=t+1}^{Kn} r_jx_{j} \\ \text{s.t. }\ & \sum_{j=t+1}^{Kn} a_{ij}x_{j}\leq\frac{(Kn-t+1)b_i}{n} \ \text{ for } i=1,...,m\nonumber\\ & 0 \le x_{j} \le 1\ \text{ for } j=t+1,...,Kn.\nonumber \end{align*} For \eqref{p1}, we apply Proposition \ref{importantLemma} and obtain that \begin{align*} \frac{1}{K}\sum\limits_{t=1}^{nK}\left(\frac{1}{n}R_n^*-\frac{1}{t-1}\mathbb{E}[R_{t-1}^*]\right) \leq O\left(\frac{\sqrt{n}\log n}{\underline{b}\sqrt{K}} +\frac{m\log nK}{K}\right) \end{align*} Denote $\tilde{\bm{p}}_{t}^*$ as the dual optimal solution of the LP corresponding to $\tilde{R}^{*}_{t}$. Similar as \eqref{SA}, we can also define the sample average form of the dual objective of this LP as $\tilde{f}_{t}(\bm{p})$, where $$ \tilde{f}_{t}(\bm{p})=\bm{d}^T\bm{p}+\frac{1}{Kn-t+1}\mathbb{E}\left[\sum_{j=t+1}^{Kn} (r_j-\bm{a}_j^T\bm{p})^{+}\right]. $$ For each term in \eqref{p2}, \begin{align} \label{p2im} \mathbb{E}\left[\frac{1}{Kn-t+1}\tilde{R}_{t}^*-r_{t}x_{t}\right] &= \mathbb{E}\left[\tilde{f}_{t-1}(\tilde{\bm{p}}^*_{t}) - r_{t}\mathbb{I}(r_{t}>\bm{a}_{t}^T\bm{p}_t)\right]\nonumber\\ &\leq \mathbb{E}\left[\tilde{f}_{t-1}({\bm{p}}_{t}) - r_{t}\mathbb{I}(r_{t}>\bm{a}_{t}^T\bm{p}_t)\right]\nonumber\\ &= \mathbb{E}\left[(\bm{d}-\bm{a}_t)^T\bm{p}_t\right], \end{align} where the first line comes from the strong duality of the \eqref{eqn:sLP}, the second line comes from the optimality of $\tilde{\bm{p}}_t^*$ and the last line comes from the definition of $\tilde{f}_{t-1}$. Thus, for the \eqref{p2}, \begin{align*} \frac{1}{K}\sum\limits_{t=1}^{Kn}\mathbb{E}\left[\frac{1}{Kn-t}\tilde{R}_{t-1}^*-r_{t}x_{t}\right] &\leq \frac{1}{K}\sum\limits_{t=1}^{Kn}\mathbb{E}\left[(\bm{d}-\bm{a}_t)^T\bm{p}_t\right]\\ &\leq \frac{1}{K}\sum\limits_{t=1}^{Kn}\left[(\bm{d}-\bm{a}_t)^T\bm{p}\right]+O\left(\sqrt{\frac{n}{K}}(1+\|\bm{p}\|_2^2)\right) \end{align*} holds for all $\bm{p}\geq\bm{0}$. Here, the first line comes from \eqref{p2im}, the second line comes from Proposition \ref{mdw}. Set $\bm{p}=0$ and combine the upper bound of \eqref{p1} and \eqref{p2}. The optimality gap can be bounded by $$ O\left(\frac{\sqrt{n}\log n}{\underline{b}\sqrt{K}} +\frac{m\log nK}{K}\right). $$ For the constraint violation, the proof is same as the proof in \cite{li2020simple}. For completeness, we also show the proof here. Recall the updating formular, we have $$ \bm{p}_{t+1}\geq\bm{p}_t+\frac{1}{\sqrt{Kn}}(\bm{a}_tx_t-\bm{d}), $$ where the inequality is elementwise. Therefore, \begin{align*} \frac{1}{K}\sum_{t=1}^{Kn} \bm{a}_tx_t & \le n\bm{d} + \frac{1}{K}\sum_{t=1}^n \sqrt{Kn}(\bm{p}_{t+1}-\bm{p}_{t}) \\ & \le \bm{b} + \sqrt{\frac{n}{K}}\bm{p}_{n+1} \end{align*} Then, same as the proof in \cite{li2020simple}, with Lemma \ref{iidBound}, we have $$ \mathbb{E} \left[v(\bm{x})\right]= \mathbb{E} \left[\left \|\left(\frac{1}{K}\sum_{t=1}^{Kn} \bm{a}_tx_t-\bm{b}\right)^+\right\|_{\infty}\right] \le \sqrt{\frac{n}{K}}\mathbb{E} \|\bm{p}_{n+1}\|_2 \leq O\left(\sqrt{\frac{m^3n}{\underline{b}^2K}}\right).$$ \section{Proof of Theorem \ref{thm_BSA}} The proof combines the proof of Theorem \ref{thm_BSA_cv} and the proof of Theorem 1 in \cite{balseiro2020best}. With the similar method, we can also have similar terms in analogy to \eqref{p1} and \eqref{p2}. That is, \begin{align} R_n^*-\mathbb{E}\left[\frac{1}{K}\sum\limits_{t=1}^{\tau}r_{t}x_{t}\right]\nonumber =& R_n^*- \frac{1}{K}\mathbb{E}\left[\sum\limits_{t=0}^{\tau-1}\frac{1}{t}R_{t}^*\right] + \frac{1}{K}\mathbb{E}\left[\sum\limits_{t=0}^{\tau-1}\frac{1}{t}R_{t}^*\right] -\mathbb{E}\left[\frac{1}{K}\sum\limits_{t=1}^{\tau}r_{t}x_{t}\right]\nonumber \\ \leq& \frac{1}{K}(nK-\mathbb{E}[\tau])\label{2p3}\\ &+\frac{1}{K}\mathbb{E}\left[\sum\limits_{t=1}^{\tau-1}\left(\frac{1}{n}R_n^*-\frac{1}{t-1}R_{t-1}^*\right)\right]\label{2p1}\\ &+ \frac{1}{K}\mathbb{E}\left[\sum\limits_{t=1}^{\tau}\left(\frac{1}{Kn-t}\tilde{R}_{t-1}^*-r_{t}x_{t}\right) \right]\label{2p2}, \end{align} where $\tau$ denotes the stopping time that one of resources is depleted. For \eqref{2p1}, similar as the proof for \eqref{p1}, applying Proposition \ref{importantLemma}, we have \begin{align*} \frac{1}{K}\mathbb{E}\left[\sum\limits_{t=1}^{\tau-1}\left(\frac{1}{n}R_n^*-\frac{1}{t-1}R_{t-1}^*\right)\right] \leq O\left(\frac{\sqrt{n}\log n}{\underline{b}\sqrt{K}} +\frac{m\log nK}{K}\right). \end{align*} For \eqref{2p2}, we also apply Proposition \ref{mdw} and have \begin{align*} \frac{1}{K}\mathbb{E}\left[\sum\limits_{t=1}^{\tau}\left(\frac{1}{Kn-t}\tilde{R}_{t-1}^*-r_{t}x_{t}\right) \right] &\leq \frac{1}{K}\mathbb{E}\left[\sum\limits_{t=1}^{\tau}(\bm{d}-\bm{a}_t)^T\bm{p}_t\right]\\ &\leq \frac{1}{K}\mathbb{E}\left[\sum\limits_{t=1}^{\tau}(\bm{d}-\bm{a}_t)^T\bm{p}\right]+O\left(\sqrt{\frac{n}{K}}(1+\|\bm{p}\|_2^2)\right) \end{align*} holds for all $\bm{p}\geq \bm{0}$. Following the choice in the proof of Theorem 1 in \cite{balseiro2020best}, we set $\bm{p}=\frac{1}{d_i}\bm{e}_i$, where $\bm{e}_i$ is the vector with value 1 at $i$-th entry and 0 otherwise. It yields \begin{align*} \mathbb{E}\left[\sum\limits_{t=1}^{\tau}(\bm{d}-\bm{a}_t)^T\bm{p}\right] &= \frac{1}{d_i}\mathbb{E}\left[\tau d_i-\sum\limits_{t=1}^{\tau}a_{ti}\right]\\ &\leq \mathbb{E}[\tau]-Kn+\frac{1}{d_i}, \end{align*} where the first line comes from the choice of $\bm{p}$, the second line comes from the condition that $\tau$ is the first time that one of resources is depleted. In the end, combining \eqref{2p3}, \eqref{2p1} and \eqref{2p2}, we have \begin{align*} R_n^*-\mathbb{E}\left[\frac{1}{K}\sum\limits_{t=1}^{\tau}r_{t}x_{t}\right]\nonumber &\leq O\left(\frac{\sqrt{n}\log n}{\underline{b}^2\sqrt{K}} +\frac{m\log nK}{K}\right) \end{align*} \end{APPENDICES} \bibliographystyle{informs2014}
\section{Introduction } {\bf 1. INTRODUCTION \vspace{0.2cm}} \\ The Berry's seminal discovery \cite{ber} to the appearance of an additional phase evolution in eigenstates of the Hamiltonian during a slow variation of a quantum system in the parameter space had triggered extensive research for such extra phases in both theoretical and experimental spheres. The Berry phase is a geometrical character of quantum waves, which corresponds to a holonomy transformation in state space. It is impossible to gauge out the geometrical character in the phase because the Berry phase or, in general, the geometric phase is a gauge invariant. For this reason, the geometric phase is non-negligible and, especially, inevitable for analyzing the transmission of light waves in media with time-varying parameters since it reflects the geometry of a quantum wave evolution. It has been proved that the original concept of the Berry's geometric phase can be extended to more general cases which are nonadiabatic, non-cyclic and/or non-unitary evolutions of light waves \cite{aha,nmu}. The geometric phase is a promising research subject that has been widely investigated with the purpose of manipulating quantum phases of light waves and controlling their behaviors. The scientific fields that the geometric phase can be applicable are plentiful: they include a holonomic quantum computation with geometric gates \cite{cvg}, a stellar interferometry \cite{sti}, the testing of CPT (charge conjugation, parity, and time reversal) invariance in particle physics \cite{cpt}, entanglement of atoms \cite{gpr1} analysis of Aharonov-Bohm effect \cite{gpr2}, etc. Among them, a geometric quantum computation enables us to carry out quantum logic operations by means of multi-qubit gates, which is a main technique for realizing quantum computers \cite{cvg}. It is assumed that the geometric phase appears for nonstatic states of a quantum system, whereas it always vanishes for stationary states \cite{conn}. As is well known, the ordinary waves in the Fock state are static in time, resulting in no emergence of the geometric phase. However, if we prepare a quantum wave with time-varying eigenfunctions, there will appear geometric phases even for a simple situation where the parameters of the medium do not vary over time. For instance, the eigenfunctions in coherent and squeezed states are expressed in terms of time regardless that the parameters of the media depend on time or not \cite{igp}. This leads to the appearance of the geometric phase in such states \cite{snb,igp}. Meanwhile, it was reported from our recent work \cite{nwh} that nonstatic quantum light waves can also appear in the Fock state in a static environment associated with a transparent medium. During the time evolution of such wave packets, the waves exhibit a peculiar behavior as a manifestation of their nonstaticity, which is that they become narrow and broad in turn periodically in quadrature space. Subsequently, we also analyzed the mechanism underlain in such a phenomenon from a fundamental point of view \cite{gnb}. Even if the environment is static in that case, the periodical time variation of the waves is accompanied by the evolution of the geometric phases. This is due to the fact that the eigenfunctions also vary in time along the nonstaticity of the wave. We will investigate the characteristics of the geometric phases in the Fock state arisen in such a situation in this work. It will be focused on analyzing how the geometric phases evolve in time in relation with the wave nonstaticity. We will compare the behavior of the geometric phases with that of the dynamical phases. The Hannay angle \cite{hha} of the system, which is the classical analogues of the geometric phases, will also be investigated by utilizing the relation between them and its physical meanings will be addressed. Based on the Hannay angle, we can obtain an insight on the classical geometric structure of light and its connection with the quantum geometric-phase structure \cite{ilb,hs}. \\ \\ {\bf 2. DESCRIPTION OF NONSTATIC WAVES \vspace{0.2cm}} \\ To establish the geometric phases for a nonstatic wave, we first show how to describe nonstatic quantum light waves in a static environment. The Hamiltonian for a light is given by \begin{equation} \hat{H}= {\hat{p}^2}/{(2\epsilon)} + \epsilon\omega^2 \hat{q}^2 /2, \label{1} \end{equation} where $\hat{q}$ is the quadrature operator, $\hat{p} = -i\hbar \partial/\partial q$, and $\epsilon$ is the electric permittivity of the medium. The geometric phases are dependent on the preparation of the wave functions \cite{XX}. If we consider elementary static wave functions in the Fock state, of which eigenfunctions are given by $\langle q|\phi_n \rangle = ({\alpha }/{\pi })^{1/4}({\sqrt{2^{n} n!}})^{-1} H_{n} \left(\sqrt{\alpha } {q} \right)\exp \left[-{\alpha} {q}^2/{2} \right]$ where $\alpha = \epsilon \omega /{\hbar}$ and $H_n$ are Hermite polynomials, the geometric phases do not take place \cite{igp,amo}. However, for the case of the wave functions whose eigenfunctions are time-dependent, the geometric phases are nonzero because the geometric phases are given in terms of the time derivative of the eigenfunctions. Notice that, for a time-{\it in}dependent Hamiltonian, including the case regarded here, there are Schr\"{o}dinger solutions associated with wave nonstaticity as well as the ones that correspond to static waves. Instead of $\langle q|\phi_n \rangle$, nonstatic waves in this context can be described with generalized eigenfunctions of the form \cite{nwh} \begin{equation} \langle q |\Phi_n \rangle = \left({\frac{\beta(t)}{\pi}}\right)^{1/4} \frac{1}{\sqrt{2^n n!}} H_n \left( \sqrt{\beta(t)} q \right) \exp \left[ - \frac{\beta(t)}{2} \left(1-i\frac{\dot{f}(t)}{2\omega}\right)q^2 \right], \label{3} \end{equation} where $\beta(t) = {\epsilon\omega}/{[\hbar f(t)]}$ and $f(t)$ is a time function which is given by \begin{equation} f(t) = A \sin^2 \tilde{\varphi}(t)+ B \cos^2 \tilde{\varphi}(t) + C \sin [2\tilde{\varphi}(t)], \label{12} \end{equation} under an auxiliary condition, $ AB-C^2 = 1 \label{13} $ with $AB \geq 1$, while $\tilde{\varphi}(t)=\omega (t-t_0) +\varphi$ whereas $\varphi$ is a real constant. It is now possible to establish time-dependent wave functions associated with the nonstatic wave in terms of $\langle q |\Phi_n \rangle$, such that \cite{nwh} \begin{equation} \langle q |\Psi_n(t) \rangle = \langle q |\Phi_n(t) \rangle \exp \bigg[{-i\omega (n+1/2) \int_{t_0}^t f^{-1} (t') dt'} + i\gamma_n (t_0) \bigg], \label{2} \end{equation} where $\gamma_n (t_0)$ are phases at $t_0$. We note that the wave functions given above satisfy the Schr\"{o}dinger equation associated with the Hamiltonian represented in Eq. (\ref{1}), and $f(t)$ used here follows the nonlinear differential equation of the form $ \ddot{f} - {(\dot{f})^2}/({2f}) + 2\omega^2 \left(f- {1}/{f}\right) =0. \label{4} $ \begin{figure \centering \includegraphics[keepaspectratio=true]{Fig1.png} \caption{\label{Fig1} Comparison between probability densities for static ({\bf A}) and nonstatic ({\bf B}) wave packets. We have chosen the time function $f(t)$ for {\bf A} as 1 and for {\bf B} as Eq. (\ref{12}) with $A=2.5$ and $B=0.5$. We take only positive values for $C$ throughout all figures in this work for convenience. Then, the value of $C$ is automatically determined from $A$ and $B$ through the auxiliary condition given below Eq. (\ref{12}). Other values that we have chosen are $n=5$, $\omega=1$, $\epsilon=1$, $\hbar=1$, $t_0=0$, and $\varphi=0$. All variables are chosen to be dimensionless for convenience; this rule will also be applied to subsequent figures. For the nonstatic case, the probability density undergos cyclic evolution with time period $T=\pi/\omega$, i.e., the width of the wave packet becomes broad and narrow in turn over time.} \end{figure} We will restrict the classical angle within the range $-\pi/2 \leq \varphi < \pi/2$, because the research in this range is enough owing to the fact that Eq. (\ref{12}) is a periodic function with the angle period $\pi$. For $A=B=1$ and $C=0$, Eq. (\ref{12}) reduces to $f(t) =1$ which corresponds to the case that gives static wave functions; All other choices for the set of $A$ and $B$ give nonstatic wave functions. We have compared static and nonstatic wave packets in Fig. 1. The nonstatic wave packets shown in Fig. 1(B) vary periodically over time. The degree of such time variation caused by nonstaticity is determined by the quantitative measure of nonstaticity. For detailed expression of the nonstaticity measure, see Appendix A. The nonstatic-wave packets described up until now will be used in order to investigate the geometric phases in the subsequent subsection. \\ \\ {\bf 3. GEOMETRIC PHASE \vspace{0.2cm}} \\ The geometric phases are examples of holonomy which gives additional phase evolutions of the quantum wave over time. The development of the geometric phases for one-dimensional simple wave description offers essential ideas which enable us to demonstrate topological features in quantum mechanics. The geometric phases for the nonstatic waves can be evaluated from \cite{nc3,nc4} \begin{equation} \gamma_{G,n}(t) = \int_{t_0}^t \langle\Phi_n(t') |i\frac{\partial}{\partial t'}| \Phi_n(t') \rangle dt' +\gamma_{G,n}(t_0). \label{5} \\ \end{equation} These are parts of the phases of quantum wave functions at time $t$, which have geometric origin. On one hand, there is a concept of the geometric phase whose definition is a little different: it is the geometrical part of the phase acquired during only one cycle evolution of the eigenstate through a closed path in the circuit \cite{snb}. In what follow, we will use the former concept of the geometric phase associated with Eq. (\ref{5}) throughout this paper. We assume that the initial phases are zero for convenience from now on: $\gamma_{G,n}(t_0)=0$. It is possible to evaluate Eq. (\ref{5}) by using Eq. (\ref{3}) with the consideration of $f(t)$ given in Eq. (\ref{12}). Hence, we have (see METHODS section which is the last section) \begin{equation} \gamma_{G,n}(t) = \frac{1}{2} \left( n+\frac{1}{2} \right) \{(A+B)\omega (t-t_0) -2 [\tan^{-1} Z(t) - \tan^{-1} Z(t_0)+G(t) ]\}, \label{14-1} \end{equation} for $t\geq t_0$, where $Z(\tau)= C+A\tan[\omega (\tau-t_0) +\varphi]$, and $G(t)$ is a time function that is expressed in terms of the unit step function (Heaviside step function) $u[t]$ as $G(t)=\pi \sum_{m=0}^{\infty}u[t-t_0-(2m+1)\pi/(2\omega)+\varphi/\omega]$. If we regard the periodical discontinuities of tangent functions in Eq. (\ref{14-1}) with a period of $\pi$, $G(t)$ is necessary in order to compensate them in a way that $\gamma_{G,n}(t)$ become continuous functions. We note that Eq. (\ref{14-1}) holds within the considered range for $\varphi$, $-\pi/2 \leq \varphi < \pi/2$ (see the previous subsection for this range). Thus we have obtained the geometric phases for the nonstatic light waves. The formula of the geometric phases given above may provide a deeper insight for the understanding of the nature of the nonstatic waves. The dynamical phases can also be derived from their definition using the same wave functions and are given by $ \gamma_{D,n}(t) = -(1/2)( n+{1}/{2} )(A+B)\omega (t-t_0) $ (see METHODS section). If we regard that the measure of nonstaticity shown in Appendix A is nearly proportional to $A+B$ provided that $A+B \gg 4$, $\gamma_{D,n}(t)$ at a certain time is linearly proportional to the measure of nonstaticity for highly nonstatic waves. \begin{figure \centering \includegraphics[keepaspectratio=true]{Fig2.png} \caption{\label{Fig2} Time evolution of the geometric phase in addition to the dynamical phase for several different values of the parameters. The values of ($A$, $B$, $n$, $\omega$) are ($1$, $1$, $0$, $0.5$) for {\bf A}, ($0.5$, $2.5$, $5$, $0.5$) for {\bf B}, and ($0.1$, $10.0$, $10$, $1$) for {\bf C}. We have chosen other parameters as $t_0=0$, and $\varphi=0$. The pink-white graphics in the upper part of the panels are the time evolution of the corresponding probability density. The measure of nonstaticity is 0.00 for {\bf A}, 0.79 for {\bf B}, and 3.50 for {\bf C}.} \end{figure} Whereas the dynamical phases linearly decrease over time from their initial values, the time behavior of the geometric phases is not so simple. Let us divide the geometric phase in Eq. (\ref{14-1}) into two parts for the convenience of analyses. We call the term that involves $(A+B)$ as the first part and the remaining terms the second part. We readily confirm that the first part, which increases in a monotonic manner over time, exactly cancels the dynamical phase. Hence, the second part of the geometric phase is the same as the total phase of the wave. However, it may be not so easy to completely estimate the evolution of the geometric phases since the second part is somewhat intricate. To understand the overall time behavior of the geometric phases, we plotted the evolution of the geometric phase in Fig. 2 together with the dynamical phase for several different values of parameters. Let us first examine the effects of $A$ and $B$ on the geometric phase. For a trivial case where $A=B=1$ and $C=0$, which corresponds to Fig. 2(A), $f(t)$ becomes unity and the eigenfunctions, Eq. (\ref{3}), reduce to time-{\it in}dependent ones as have seen from the previous subsection. As a consequence, the geometric phases result in $ \gamma_{G,n}(t) = 0 \label{10} $ whereas the dynamical phases become $ \gamma_{D,n}(t) = -( n+{1}/{2} )\omega (t-t_0) . \label{11} $ Hence, the geometric phases do not appear in this case as it should be, while the dynamical parts are the well known formula. We confirm from Fig. 2(A), which is the case of the static wave, that the second part of the geometric phases linearly decreases over time, leading exact cancelling with the first part. In addition, the second part of the geometric phase is the same as the dynamical phase only when $A=B=1$. \begin{figure \centering \includegraphics[keepaspectratio=true]{Fig3.png} \caption{\label{Fig3} Behavior for the time derivative of the geometric phase $d\gamma_{G,n}(t)/dt$, the dynamical phase $d\gamma_{D,n}(t)/dt$, and the total phase $d\gamma_{n}(t)/dt$. All chosen parameters for {\bf A} and {\bf B} are the same as those for {\bf B} and {\bf C} in Fig. 2, respectively. } \end{figure} If at least one of $A$ and $B$ is not unity, it becomes the case of a nonstatic wave as shown in Figs. 2(B) and 2(C). Then, the width of the corresponding probability density periodically varies over time with the period of $T=\pi/\omega$. Hence, the frequency in its periodic change is large when $\omega$ is high. We can confirm from Figs. 2(B) and 2(C) that the second part of the geometric phase changes depending on the width of the wave packet. In a moment when the width is large, the second part nearly monotonically decreases over time. However, when the width is small, the second part somewhat abruptly decrease. Thus, the geometric phase, which is the addition of the first and the second parts in the figure, varies according to the evolution of the wave packet. We can more concretely demonstrate these situations from Fig. 3 which shows that the time derivative of the geometric phase abruptly drops when the width of the wave packet is narrow. By the way, the dynamical phases vary in a monotonic manner in all situations. In this way, the system will pick up a memory of its time evolution in the form of the geometric phase which will contribute to an observable shift of the phase in the wave function. \begin{figure \centering \includegraphics[keepaspectratio=true]{Fig4.png} \caption{\label{Fig4} The evolution of the second part of the geometric phase for several values of $A$ ({\bf A}) and $B$ ({\bf B}), where $B=1$ for {\bf A}, $A=1$ for {\bf B}, $n=5$, $\varphi=0$, and $t_0=0$. The conventions for colors designated for solid lines in the legends are also applied to the dashed and the short dashed lines within the figure panels. The measure of nonstaticities in turn from red to violet curve are 0.00, 0.79, 2.00, 3.82, 7.39, 14.48, and 35.70 for both {\bf A} and {\bf B}. } \end{figure} The evolution of the second part of the geometric phase is illustrated in Fig. 4. Although the first part of the geometric phase becomes large as the value of $A+B$ (or the measure of nonstaticity) increases, the envelope of the second part is not so significantly affected by the values of $A$ and $B$. Actually, the gradient of the envelope of the second part is irrelevant to the measure of nonstaticity; such a gradient is determined by $\omega$ instead. The envelope of the second part decreases more rapidly as $\omega$ grows, whereas the first part increases more rapidly at the same condition. Figure 4 shows that, when both $A$ and $B$ are unity, the second parts linearly decrease as time goes by. On the other hand, if $A$ and/or $B$ deviate from the unity, the gradient in the phase evolution is not constant over time. We can confirm from Fig 4(A) that the second parts abruptly drop when $\omega t$ is $\pi$, $2\pi$, $3\pi$, etc. provided that $A$ is very large while $B$ is unity; however, except for these moments, the second parts almost do not vary over time. As a consequence, the bottom envelope of the second parts is identical to the standard value which is $-( n+{1}/{2} )\omega (t-t_0)$. Similar behaviors in the phase evolution can also be seen from specific curves in Fig. 4(B), which correspond to the case where $B$ is very large while $A$ is unity; in this case, the second parts drop when $\omega t$ is $\pi/2$, $3\pi/2$, $5\pi/2$, etc. The dependence of the geometric-phase evolution on $\varphi$ within the considered region $-0.5\pi \leq \varphi < 0.5\pi$ is shown in Fig. 5. All geometric phases in the figure start from zero, but the interval of phase between the adjacent geometric phases is $\Delta \varphi = 0.15 \pi$. Because the geometric phase periodically varies over $\varphi$ where the period of such a variation is $\pi$, it is not difficult to know the pattern of the geometric phase outside the considered region for $\varphi$. More precisely speaking, the value of the Berry phase for $\varphi=\pi$ is exactly the same as that for $\varphi=0$; the value of the Berry phase for $\varphi=1.15\pi$ is exactly the same as that for $\varphi=0.15\pi$, etc. \begin{figure \centering \includegraphics[keepaspectratio=true]{Fig5.png} \caption{\label{Fig4} Time evolution of the geometric phase for various values of $\varphi$. We have chosen parameters as $A=2.5$, $B=0.5$, $n=0$, $\omega=0.5$, and $t_0=0$. } \end{figure} The overall phases of the waves are given as $ \gamma_n(t) = \gamma_{G,n}(t) + \gamma_{D,n}(t) . \label{7} $ Hence, by adding our two results for geometric and dynamical phases, we have the total phases such that $ \gamma_n(t) = -\omega ( n+ {1}/{2} )\int_{t_0}^t f^{-1}(t') dt' . \label{6-1} $ These formulae are exactly the same as the phases having appeared in the wave functions, Eq. (\ref{2}), under the condition that the initial phases are zero, $\gamma_n(t_0)=0$. Hannay confirmed that the phase similar to the geometric phase also appears in the classical domain as an analogy with the geometric phase \cite{hha}. This is a geometrical angle for a classical wave which allows to estimate its holonomy effect from the corresponding geometrical interpretation. This is an important theoretical concept and, hence, it may be instructive to see the Hannay angle of the system. For an integrable classical system, action-angle variables theory at the semiclassical level from torus quantization gives the fact that the Hannay angle $\Theta_H (t)$ is related to the geometric phase as $ \Theta_H (t)= - {\partial \gamma_{G,n}(t)}/{\partial n} \label{27} $ \cite{bjp,xbw}. From this, we can easily confirm that the Hannay angle in this case is of the form $ \Theta_H(t) = - 2\gamma_{G,0}(t). \label{28} $ This natural relation reveals that the evolution of the classical additional angle can be represented in terms of the geometric phase associated with the zero-point quantum wave packet. This simple clear picture provides a significant geometric meaning for unification of the gauge structure of the wave propagation for quantum and classical mechanics, leading in effect to Bohr's correspondence principle \cite{ggb}. If we develop a method to generate the generalized wave packet given by Eq. (\ref{2}) in the future, the demonstration of this consequence may be possible by measuring Hannay angle using an averaging technique introduced in Refs. \cite{gse,gse2,gse3}. The reason why the Hannay angle takes place in the classical system is that the structure of the quantum Hilbert space is quite the same as the classical phase space \cite{dch,yia}. \\ \\ \\ \\ {\bf 4. CONCLUSION \vspace{0.2cm}} \\ Ordinary quantum light waves, which propagate through a transparent medium in which electromagnetic parameters do not vary, are static in time, resulting in no appearance of the geometric phase in Fock states. However, if one or both of the parameters $A$ and $B$ deviates from unity, the waves in the Fock states in that medium become nonstatic and, as a consequence, the geometric phases emerge. Not only the appearance of such nonstatic waves but also the characteristics of the resultant geometric phases may be noteworthy \cite{nwh}. We have analyzed the influence of the wave nonstaticity on the evolution of the geometric phases in such a case. The geometric phases of the light waves exhibit periodical oscillatory behavior with the period of $\omega T = \pi$, where the center of such oscillation linearly increases over time. On the other hand, the dynamical phases always show linear decrease. Because the scale of the geometric phases is smaller than that of the dynamical phases, the total phases evolve toward opposite direction over time. If the measure of nonstaticity is high, both the geometric and the dynamical phases rapidly evolve in time. Although the geometric phases increase on the whole, they periodically drop with the angle period of $\pi$ provided that the measure of nonstaticity is sufficiently high. Such a variation of the geometric phases is quite significant when the measure of nonstaticity is extremely large. We have shown that Hannay angle, which is the classical analogue of the geometric phase, is represented in terms of the geometric phase associated to the zero-point wave function. This elegant outcome shows a unified picture of the interpretation of the geometric character of light waves in the quantum and the classical regime. This not only bridges the quantum and classical world, but can also be extended to more generalized quantum light waves, such as the light in a squeezed state and the Gaussian wave packet propagating in time-varying media \cite{jli,jli2}. The understanding of the evolution of the geometric phases for nonstatic quantum light waves in a static environment is necessary in quantum optics, especially in relation with wave modulations. Practical utilization of the geometric phases in diverse scientific areas may be available under the fundamental knowledge associated with the behavior of quantal phases. On one hand, the geometric phase of quantum systems which evolve in a non-unitary way \cite{nuw} and its relation with wave nonstaticity as well as accompanying non-unitary effects such as decoherence and dissipation may be worthwhile to be explored in a next research. Kinematic approach to the geometric phase of non-unitarily evolving systems is important in the pursuing of robustness of geometric quantum computation \cite{ka1,ka2,ka3}. \\ \\ {\bf 5. METHODS \vspace{0.2cm}} \\ Let us see how to evaluate the geometric and the dynamical phases. We first derive the geometric phases. From a minor computation in the configuration space after inserting Eq. (\ref{3}) into Eq. (\ref{5}), we have under the condition $\gamma_{G,n}(t_0)=0$: \begin{equation} \gamma_{G,n}(t) = \frac{1}{2} \left( n+\frac{1}{2} \right) \Gamma_{G}, \label{14} \\ \end{equation} where \begin{equation} \Gamma_{G} = \omega[g_1(t)-g_2(t)]+ \frac{g_3(t)}{4\omega}, \label{16} \\ \end{equation} with \begin{eqnarray} g_1(t) &=& \int_{t_0}^t f(t') dt' , \label{29} \\ g_2(t) &=& \int_{t_0}^t \frac{1}{f(t')} dt' , \label{30} \\ g_3(t) &=& \int_{t_0}^t \frac{[\dot{f}(t')]^2}{f(t')} dt' . \label{31} \end{eqnarray} Straightforward evaluations of $g_i(t)~(i=1,2,3)$ using Eq. (\ref{12}) yield \begin{equation} g_i(t) = G_i(t) - G_i(t_0), \label{18} \\ \end{equation} for $t_0 \leq t<t_0+\pi/(2\omega)-\varphi/\omega$, where \begin{eqnarray} G_1(\tau) &=& \frac{1}{4\omega} \{ 2 (A+B)\omega \tau -(A-B)\sin\{2[\omega(\tau-t_0)+\varphi]\} \nonumber \\ & &-2C \cos\{2[\omega(\tau-t_0)+\varphi]\} \}, \label{19} \\ G_2(\tau) &=& \frac{1}{\omega}\tan^{-1} \{ C+A\tan[\omega (\tau-t_0) +\varphi] \}, \label{20} \\ G_3(\tau) &=& \omega \{ 2(A+B)\omega \tau +(A-B)\sin\{ 2[\omega (\tau-t_0)+\varphi] \} \nonumber \\ & &+2C\cos\{ 2[\omega (\tau-t_0)+\varphi] \} - 4\tan^{-1}\{ C+A\tan[\omega (\tau-t_0) +\varphi] \} \}. \label{21} \end{eqnarray} By readjusting Eq. (\ref{16}) with Eqs. (\ref{18})-(\ref{21}), we have \begin{equation} \Gamma_{G} = F_G(t)-F_G(t_0), \label{22} \end{equation} where $F_G(\tau)$ is given by \begin{equation} F_G(\tau) = (A+B)\omega \tau -2 \tan^{-1} \{ C+A\tan[\omega (\tau-t_0) +\varphi] \}. \label{24-1} \end{equation} Equation (\ref{22}) hold for the region $t_0 \leq t<t_0+\pi/(2\omega)-\varphi/\omega$, because we have considered $t \geq t_0$ and there is the first discontinuity in the tangent function at $\pi/2$. If we want to extend the expression in this equation to the whole region ($t \geq t_0$) that we have considered, it is necessary to compensate Eq. (\ref{22}) by the unit step function $u[t]$ to be \begin{equation} \Gamma_{G} = F_G(t)-F_G(t_0)-2\pi \sum_{m=0}^{\infty}u[t-t_0-(2m+1)\pi/(2\omega)+\varphi/\omega]. \label{b22} \end{equation} By rearranging Eq. (\ref{14}) with Eqs. (\ref{b22}) and (\ref{24-1}), we can easily have the formula of geometric phases which are given in Eq. (\ref{14-1}) in the text. Now we evaluate the dynamical phases. The definition of the dynamical phases are given by \begin{equation} \gamma_{D,n}(t) = - \frac{1}{\hbar} \int_{t_0}^t \langle\Phi_n(t') | \hat{H}(\hat{q},\hat{p},t')| \Phi_n(t')\rangle dt' + \gamma_{D,n}(t_0). \label{6} \end{equation} We also assume that $\gamma_{D,n}(t_0)=0$ like the case of the geometrical part. Using the Hamiltonian of the simple harmonic oscillator and the Fock states given in Eq. (\ref{3}), we can evaluate Eq. (\ref{6}) and this results in \begin{equation} \gamma_{D,n}(t) = \frac{1}{2} \left( n+\frac{1}{2} \right) \Gamma_{D} , \label{15} \end{equation} where \begin{equation} \Gamma_{D} = -\omega[g_1(t)+g_2(t)]- \frac{g_3(t)}{4\omega}. \label{17} \end{equation} Using Eqs. (\ref{18})-(\ref{21}), we have \begin{equation} \Gamma_{D} = F_D(t)-F_D(t_0), \label{23} \end{equation} where \begin{equation} F_D(\tau) = -(A+B)\omega \tau . \label{25} \end{equation} A minor readjustment of the above equations gives \begin{equation} \gamma_{D,n}(t) = \frac{1}{2} \left( n+\frac{1}{2} \right) [F_D(t)-F_D(t_0)] . \label{15-1} \end{equation} We can easily show that this is the same formula of the dynamical phases given in the text.
\section{ Introduction} Cavity optomechanics has sparked extensive theoretical and experimental research interest in the last decade due to its various applications~\cite{RevModPhys.86.1391,Kippenberg1172,Naik2006,Sankey2010,Park2009,Rodgers2010,PhysRevX.1.021011,PhysRevX.8.011031,PhysRevX.5.041024,PhysRevLett.119.053601,Liu2018,Zhong2018}: detecting weak-force, mass, displacements, and orbital angular momentum~\cite{doi:10.1063/1.2012461,PhysRevX.6.021001,PhysRevLett.108.120801,Zhang2020}; creating macroscopic nonclassical states~\cite{PhysRevLett.116.163602,PhysRevA.89.014302}; achieving mechanical squeezing~\cite{Wollman952,Xiong2020151}; obtaining optical nonreciprocity \cite{Yan2019}. These advancements exhibit potential advantages of cavity optomechanics in quantum metrology~\cite{PhysRevLett.104.213603}, quantum information processing~\cite{Rabl2010,PhysRevA.91.053854,PhysRevA.100.043835,PhysRevA.101.013802,Jing2015,Jing2017,Zeng:20,doi:10.1063/5.0035498,L2013,PhysRevA.90.053833,Zhao2019,PhysRevA.89.023849,PhysRevA.91.033835}, and fundamental physics questions~\cite{PhysRevA.99.063811,doi:10.1002/andp.201900596,Xiong:18,PhysRevA.102.023707,PhysRevA.92.033806}. Though optomechanical systems have brought wide attention, the single-photon optomechanical coupling $g_0$ is small in experiment~\cite{Liao_2014,PhysRevA.101.063802}. People usually bring in classical driving lasers to improve the effective optomechanical coupling strength~\cite{PhysRevLett.110.153606,PhysRevA.91.033818,PhysRevA.94.053807,PhysRevA.95.063825,PhysRevA.98.053802}. However, the phase and amplitude of the driving laser have small fluctuation — the so-called laser phase and amplitude noise. Schliesser et al. firstly observed the laser phase noise in experiment~\cite{Schliesser2008}. Generally, laser amplitude noise can be approximately neglected by stabilizing the laser intensity~\cite{PhysRevA.83.063838,PhysRevA.94.063636}. Recently, many efforts have been devoted to study the influence of laser phase noise on quantum physics: ground-state cooling~\cite{PhysRevA.78.021801,PhysRevA.80.033821,Farman:13,PhysRevA.80.063819,PhysRevLett.123.153601,PhysRevLett.118.233604}; quantum state estimation~\cite{PhysRevLett.114.223601}; weak-force sensing~\cite{PhysRevA.98.053841,Mehmood_2019}; squeezing mechanical oscillators~\cite{Gu:20} and output light of an optical cavity~\cite{PhysRevA.89.033810}; quantum memory~\cite{PhysRevA.91.033828}; optomechanical entanglement~\cite{PhysRevA.84.032325,PhysRevA.84.063827,Ahmed_2019}. Many of these studies demonstrate that phase noise has destructive effects on quantum phenomena. Optomechanical entanglement is a macroscopic quantum phenomenon and is significant for quantum information processing\cite{PhysRevA.96.053831,Yan:19}. Some works have discussed the influence of the Kerr nonlinear medium on the stationary optomechanical entanglement in the presence of laser phase noise~\cite{Zhang_2013,Zhang_20131,Ahmed_2019}. Although they claim that Kerr nonlinearity can promote entanglement to some extent, they leave an unresolved contradiction: strong optical force coupling accompanied by huge laser phase noise. Specifically, the effect of laser phase noise is described by $\sqrt{2}\alpha\dot{\varphi}(t)$ where $\alpha$ and $\dot{\varphi}(t)$ are the mean value of intracavity field and time derivatives of phase noise, respectively. The effective optomechanical coupling is $\sqrt{2}g_0\alpha$ where the single-photon coupling $g_0$ is very weak in experiment. Therefore, people usually improve the effective optomechanical coupling $\sqrt{2}g_0\alpha$ by raising $\alpha$. However, the increase of $\alpha$ is unavoidable to enlarge the effect of phase noise. Naturally, we raise a novel and interesting idea: Can we simultaneously strengthen the effective optomechanical coupling and inhibit the effect of laser phase noise? In this paper, we present a scheme to improve the effective optomechanical coupling and inhibit laser phase noise at the same time. The system consists of an optical cavity, a mechanical oscillator, and a Kerr nonlinear medium. We obtain the effective Hamiltonian with optical and mechanical parametric amplification terms after linearizing the systemic Hamiltonian and then transform the system into the squeezing frame. According to the analytical results, we found that the effective optomechanical coupling is enhanced, and the laser phase noise decreases exponentially by adjusting the squeezing parameters. Generally, we can introduce a broadband-squeezed vacuum environment to suppress the increased thermal noise around the squeezed cavity field and mechanical oscillator. However, the enhanced thermal noise around the mechanical oscillator has little influence on the system due to its tiny decay, which means we only need to suppress the enlarged thermal noise around the squeezed cavity field by exploiting the vacuum environment. Our calculation shows that our proposal effectively solves the contradiction: improving effective optomechanical coupling leads to enlarging laser phase noise. To display our scheme, we exploit it to simulate quantum memory and stationary optomechanical entanglement as examples. Our numerical results show our strategy can significantly protect both the quantum memory and the stationary optomechanical entanglement. This paper is organized as follows: in Sec.~\ref{Physical Model}, We explain the theoretical model, derive the effective Hamiltonian, and obtain the dynamic equation of the additional mode describing the effect of phase noise. We demonstrate some actual physical phenomena (quantum memory and stationary optomechanical entanglement) in Sec.~\ref{Demonstrating some actual quantum phenomenon}. Finally, we give a conclusion in Sec.~\ref{Conclusion}. \section{Physical Model} \label{Physical Model} \begin{figure}[tbp] \centering {\includegraphics[width=0.9\columnwidth]{Figure1.eps}} \caption{Schematic illustration of an optomechanical system. The system includes cavity mode $\hat{a}$ and mechanical mode $\hat{b}$. A Kerr nonlinearity medium is located in the cavity that is driven by a classical laser. The system includes a Duffing nonlinearity related to the mechanical mode. $\omega_L$ and $\varphi(t)$ denote the frequency and the phase fluctuation of the optical driving laser, respectively.} \label{figure1} \end{figure} We consider an optomechanical system and its schematic diagram is illustrated in Fig.~\ref{figure1}. In this setup, a classical laser drives the optical cavity, and a Kerr medium is located in the cavity. Kumar et al. have shown that Kerr medium inside an optomechanical system can effectively inhibit the normal mode splitting~\cite{PhysRevA.81.013835}. In the rotating frame with frequency $\omega_L$, the Hamiltonian of the system can be written as ($\hbar=1$)~\cite{PhysRevA.101.023841,PhysRevA.99.013843} \begin{equation} \begin{split} \hat{H}_{\text{rot}}=&\Delta_0\hat{a}^{\dagger} \hat{a}+\omega_{m}\hat{b}^{\dagger}\hat{b}-g_{0} \hat{a}^{\dagger} \hat{a} (\hat{b}^{\dagger}+\hat{b})+u\hat{a}^{\dagger 2}\hat{a}^2 \\ &-\frac{\eta}{2}(\hat{b}+\hat{b}^{\dagger})^4+iE_{L}\left(e^{i \varphi(t)}\hat{a}^{\dagger}-e^{-i \varphi(t)}\hat{a}\right), \end{split} \label{eq1} \end{equation} where $\hat{a}$ ($\hat{a}^{\dagger}$) and $\hat{b}$ ($\hat{b}^{\dagger}$) are the annihilation (creation) operators of the cavity field and the mechanical oscillator, respectively. The optical cavity mode with resonance frequency $\omega_c$ contains a Kerr nonlinear medium with Kerr coefficient $u$. The mechanical oscillator with resonance frequency $\omega_m$ is accompanied by a Duffing nonlinear term with amplitude $\eta$ and coupled to the cavity field with coupling strength $g_0$. By coupling the mechanical mode to a qubit, a strong Duffing nonlinearity can be obtained, in which the nonlinear amplitude $\eta$ can reach $10^{-4}\omega_m$\cite{PhysRevA.91.013834}. $\omega_L$ is the frequency of the classical driving laser, $\varphi(t)$ describes the laser phase noise—a zero-mean stationary Gaussian stochastic process, and $E_L$ is the strength of the driving laser. Generally, one can adjust the driving strength $E_L=\sqrt{2\kappa P_s/\hbar \omega_L}$ by controlling the input power $P_s$ where $\kappa$ is the decay of the cavity through its input port. The amplitude noise of the driving laser is negligible compared to the phase noise via stabilizing laser source, so we can neglect the amplitude noise of the driving laser in this paper~\cite{PhysRevA.84.032325,PhysRevA.91.033828}. The optical Kerr effect has been studied theoretically and experimentally, and the corresponding nonlinear Kerr coefficient has the following form~\cite{Brasch357,PhysRevA.80.065801} \begin{equation} u=\frac{\hbar \omega_{c}^{2} c n_{2}}{n_{0}^{2} \mathrm{V}_{\mathrm{eff}}}, \label{eq2} \end{equation} with \begin{equation} \mathrm{V}_{\mathrm{eff}}=\int_{V} \varepsilon(r)|\Phi(r)|^{2} d V, \label{eq3} \end{equation} where $c$ represent the speed of light in vacuum, $n_{0}$ ($n_{2}$) are the linear (nonlinear) refractive index of the material with ranges $2 \leqslant n_{0} \leqslant 4$ and $10^{-13} \geq n_{2} \geq 10^{-17} \mathrm{cm}^{2} / \mathrm{W}$~\cite{bookjj}. $\mathrm{V}_{\text {eff }}$ is defined as the effective mode volume and describes the peak electric field strength within the cavity. $\varepsilon(r)$ and $\Phi(r)$ are the dielectric constant and the electric field strength, respectively. $\mathrm{V}_{\text {eff }}$ is located in between $10^{2} \sim 10^{4} \mu \mathrm{m}^{3}$ when the quality factor of the cavity $Q$ is limited in $\left(10^{6} \sim 10^{8}\right)$~\cite{Vahala2003}. For a near-infrared wavelength ($\lambda=1064 \mathrm{nm}$), the nonlinear Kerr coefficient $u$ is estimated on the order between $0.0006 \sim 2721\mathrm{Hz}$ in a silica microsphere by calculating Eq.~(\ref{eq3}) with experimentally accessible parameters. We consider the full description of the systemic dynamics including the fluctuation-dissipation processes of the optical and the mechanical modes. After transforming the cavity mode to a randomly rotating frame according to $\hat{a} \rightarrow \hat{a}_{\mathrm{p}} e^{i \varphi(t)}$, we derive a set of quantum Langevin equations governing the systemic dynamics \begin{equation} \begin{split} \dot{\hat{a}}_\text{p}=&-(i\Delta_0+\kappa)\hat{a}_\text{p}+ig_0\hat{a}_\text{p}(\hat{b}^{\dagger}+\hat{b})-i\dot{\varphi}(t)\hat{a}_\text{p}\\& +E_L-2iu\hat{a}^{\dagger}\hat{a}^2+\sqrt{2\kappa}\hat{a}_{\text{p,in}},\\ \dot{\hat{b}}=&-(i\omega_m+\gamma_m)\hat{b}+ig_0\hat{a}^{\dagger}_\text{p}\hat{a}_\text{p} +2i\eta (\!\hat{b}+\hat{b}^{\dagger})^3 \\&+\sqrt{2\gamma_m}\hat{b}_{\text{in}}, \end{split} \label{eq4} \end{equation} where $\gamma_m$ describes the damping rate of the mechanical mode, $\hat{b}_{\text{in}}$ is the thermal noise operator acting on the mechanical oscillator, and $\hat{a}_{\text{p,in}}$ is the squeezed input vacuum noise operator. The squeezed input optical field has been used to enhance sideband cooling and suppress Stokes scattering~\cite{PhysRevA.94.051801,Clark2017}. The corresponding noise correlations are written as \begin{equation} \begin{split} \left\langle \hat{a}_{\mathrm{p,in}}(t) \hat{a}_{\mathrm{p,in}}^{\dagger}\left(t^{\prime}\right)\right\rangle &=(N+1) \delta\left(t-t^{\prime}\right), \\ \left\langle \hat{a}_{\mathrm{p,in}}^{\dagger}(t) \hat{a}_{\mathrm{p,in}}\left(t^{\prime}\right)\right\rangle &=N \delta\left(t-t^{\prime}\right), \\ \left\langle \hat{a}_{\mathrm{p,in}}(t) \hat{a}_{\mathrm{p,in}}\left(t^{\prime}\right)\right\rangle &=M \delta\left(t-t^{\prime}\right), \\ \left\langle \hat{b}_{\text{in}}(t) \hat{b}^{\dagger}_{\text{in}}\left(t^{\prime}\right)\right\rangle &=(N_{\text{th}}+1) \delta\left(t-t^{\prime}\right), \\ \left\langle \hat{b}^{\dagger}_{\text{in}}(t) \hat{b}_{\text{in}}\left(t^{\prime}\right)\right\rangle &=N_{\text{th}} \delta\left(t-t^{\prime}\right) , \end{split} \label{eq5} \end{equation} where $N=\sinh ^{2}\left(r_{e}\right)$ is the mean photon number of the broadband-squeezed vacuum environment, $M=\sinh \left(r_{e}\right) \cosh \left(r_{e}\right) e^{-i \Phi_{e}}$ is the strength of the autocorrelation of the squeezed vacuum noise, and $N_{\text{th}}=1/\left(\exp \left\{\hbar \omega_{\mathrm{m}} / k_{\mathrm{B}} T\right\}-1\right)$ is the equilibrium mean thermal photon number. Here $r_{e}$ ($\Phi_{e}$) are the squeezing amplitude (angle) of the broadband-squeezed vacuum environment, $k_{\mathrm{B}}$ is the Boltzmann constant, and $T$ is the temperature of the mechanical oscillator. The system is linearized by substituting operators $\hat{a}_{\mathrm{p}}=\alpha+\delta \hat{a}_{\mathrm{p}}$ and $\hat{b}=\beta+\delta \hat{b}$ to Eq.~(\ref{eq4}) where $\alpha$ ($\beta$) and $\delta\hat{a}$ ($\delta\hat{b}$) describe the mean values and the fluctuations of the optical (mechanical) mode. Therefore, we can simplify the linearized Langevin equation as \begin{equation} \begin{split} \dot{\delta\hat{a}}_\text{p}=&-(i\Delta+\kappa)\delta\hat{a}_{\text{p}}+ig_0\alpha(\delta\hat{b}^{\dagger}+\delta\hat{b})-i\dot{\varphi}(t)\alpha\\ &-i\Omega\delta\hat{a}^{\dagger}_{\text{p}}+\sqrt{2\kappa}\hat{a}_{\text{p,in}}, \\ \dot{\delta\hat{b}}=&-(\gamma_m+i\omega^{\prime}_{m})\delta\hat{b}+ig_0(\alpha^*\delta\hat{a}_p+\alpha\delta\hat{a}^{\dagger}_p) \\&+i\Omega_m\hat{b}^{\dagger}+\sqrt{2\gamma}\hat{b}_{\text{in}}, \end{split} \label{eq6} \end{equation} where we have ignored the higher-order nonlinear terms, and the effective parameters are listed as: $\Delta=\Delta_0-2g_0\Re{(\beta)}+4u\vert\alpha\vert^2$; $\Omega=2u\alpha^2$; $\omega^{\prime}_m=\omega_m-\Omega_m$; $\Omega_m=6\eta(4\Re{(\beta)}^2+1)$. The mean values of the optical and the mechanical modes can be obtained by solving the steady Langevin equation \begin{equation} \begin{split} &-(i(\Delta-2u\vert\alpha\vert^2)+\kappa)\alpha+E_L=0, \\ &\!-(i\omega_{m}\!+\!\gamma_m)\beta\!+\!ig_0\vert\alpha\vert^2\!+\!i4\eta(4\Re{(\beta)}^3\!+\!3\Re{(\beta)})\!=0. \end{split} \label{eq7} \end{equation} We rewritten the strength of parametric amplification coefficient as $\Omega=\vert\Omega\vert e^{-2i\theta}$ (i.e., $\alpha=\vert\alpha\vert e^{-i\theta}$) with real angle $\theta$. The phase factors can be absorbed into the operators $\hat{a}_{\text{p}}$ (i.e., $\hat{a}_{\text{p}}\rightarrow\hat{a}_{\text{p}}e^{-i\theta}$). Therefore, we can obtain the linearized Hamiltonian \begin{equation} \begin{split} \hat{H}_{\text{lin}}=&\Delta\delta\hat{a}^{\dagger}_{\text{p}}\delta\hat{a}_{\text{p}}+\omega^{\prime}_{m}\delta\hat{b}^{\dagger}\delta\hat{b}-g(\delta\hat{a}_{\text{p}}\!+\!\delta\hat{a}^{\dagger}_{\text{p}})(\delta\hat{b}+\delta\hat{b}^{\dagger}) \\ &+\frac{\vert\Omega\vert}{2}(\delta\hat{a}^{\dagger 2}_{\text{p}}+\delta\hat{a}^2_{\text{p}}) -\frac{\Omega_m}{2}(\delta\hat{b}^{\dagger 2}+\delta\hat{b}^2), \end{split} \label{eq8} \end{equation} where we have defined the optomechanical coupling $g$ as $g=g_0\vert\alpha\vert$. It is obvious that the Kerr nonlinear medium and the Duffing nonlinearity lead to the optical and the mechanical parametric amplification terms with amplitudes $\vert\Omega\vert$ and $\Omega_m$, respectively. We exploit squeezing transformations $\delta\hat{a}_\text{p}=\cosh{(r)}\delta\hat{a}_\text{s}-\sinh{(r)}\delta\hat{a}^{\dagger}_\text{s}$ and $\delta\hat{b}=\cosh{(r_m)}\delta\hat{b}_\text{s}+\sinh{(r_m)}\delta\hat{b}^{\dagger}_\text{s}$ acting on the linearized Hamiltonian $\hat{H}_{\text{lin}}$ where the squeezing phase is fixed as $\pi$. Here we choose the squeezing strength $r=\frac{1}{4}\ln(\frac{1+\eta}{1-\eta})$ and $r_m=\frac{1}{4}\ln(\frac{1+\eta_1}{1-\eta_1})$ with $\eta=\vert\Omega\vert/\Delta$ and $\eta_1=\vert\Omega_m\vert/\omega^{\prime}_m$. Therefore, we can obtain the following effective Hamiltonian \begin{equation} \hat{H}_{\text{e}}=\Delta_{\text{e}}\delta\hat{a}^{\dagger}_{\text{s}}\delta\hat{a}_{\text{s}}+\Delta_{m}\delta\hat{b}^{\dagger}_s\delta\hat{b}_s-G(\delta\hat{a}_{\text{s}}+\delta\hat{a}^{\dagger}_{\text{s}})(\delta\hat{b}^{\dagger}_s+\delta\hat{b}_s), \label{eq9} \end{equation} where the effective coupling strength is $G=g\exp{(r^{\prime}})$ with $r^{\prime}=r_m-r$, and the effective detuning of the optical and mechanical modes are $\Delta_{\text{e}}=\Delta\sqrt{1-\eta^2}$ and $\Delta_{\text{m}}=\omega^{\prime}_m\sqrt{1-\eta^2_1}$. We adjust the squeezing amplitudes to satisfy $r_m\geq r$, and thus the effective $G$ can remain a large value. Then we discuss the statistical properties of laser phase noise. As shown in Eq.~(\ref{eq6}), we note that the laser phase noise affects the systemic dynamics by the additional noise term $-i\dot{\varphi}(t)\alpha$ and the influence of phase noise is mainly depended on the mean value of the cavity field $\alpha$. Generally, the single-photon coupling $g_0$ is very small and one need to improve the effective optomechanical coupling via a large $\alpha$. It is a terrible contradiction that the large mean value of cavity field $\alpha$ will lead to a sizeable effective optomechanical coupling and phase noise when $\alpha$ is huge. Therefore, it is significant to enhance the effective optomechanical coupling and suppress the influence of phase noise at the same time. If the phase noise correlation satisfies $\langle\dot{\varphi}(t) \dot{\varphi}(t)\rangle=2 \Gamma_{L} \delta(t-t^{\prime})$, the spectrum of the noise is flat and the cut-off frequency $\gamma_c\rightarrow\infty$ (i.e., $\mathcal{S}_{\dot{\varphi}}(\omega)=2 \Gamma_{L}$), where $\Gamma_{L}$ is the linewidth of the driving laser. However, the spectral density of the phase noise is not a flat spectrum due to the finite non-zero correlation time of phase noise. In other words, it is a finite bandwidth color noise. Generally, the noise spectrum is equivalent to a low pass filtered white noise with the following spectrum and correlation function ~\cite{PhysRevA.80.063819,PhysRevA.91.033828,PhysRevA.98.053841} \begin{equation} S_{\dot{\varphi}}(\omega)=\frac{2\Gamma_{L}}{1+\frac{\omega^{2}}{\gamma_{c}^{2}}}, ~ ~ \langle\dot{\varphi}(t) \dot{\varphi}(t^{\prime})\rangle=\Gamma_{L} \gamma_{c} e^{-\gamma_{c}|t-t^{\prime}|}, \label{eq10} \end{equation} where $1/\gamma_{c}$ is correlation time of the laser phase noise so that the phase noise is suppressed at frequencies $\omega>\gamma_{c} $. The correlation time decreases and the frequency noise starts reaching the white noise with the increasing of $\gamma_{c}$. Moreover, the frequency spectrum in (\ref{eq10}) is equivalent to the differential equation $\ddot{\varphi}(t)+\gamma_{c} \dot{\varphi}(t)=\varepsilon(t)$ where $\varepsilon(t)$ is a Gaussian random variable with the noise correlation function \begin{equation} \langle\varepsilon(t) \varepsilon(t^{\prime})\rangle=2 \gamma_{c}^{2} \Gamma_{L} \delta(t-t^{\prime}). \label{eq11} \end{equation} We redefine an additional noise operator $\psi=\dot{\varphi}$ where $\psi$ satisfies the following differential equation \begin{equation} \dot{\psi}(t)+\gamma_{c} \psi(t)=\varepsilon(t). \label{eq12} \end{equation} Therefore, we can rewrite the Langevin equation with the quadrature fluctuations of the optical field and the mechanical oscillator: $\hat{X}=(\delta\hat{a}_\text{s}+\delta\hat{a}^{\dagger}_{\text{s}})/\sqrt{2}$; $\hat{P}=(\delta\hat{a}_\text{s}-\delta\hat{a}^{\dagger}_{\text{s}})/{\sqrt{2}i}$; $\hat{X}_{m}=(\delta\hat{b}_s+\delta\hat{b}^{\dagger}_s)/\sqrt{2}$; $\hat{P}_m=(\delta\hat{b}_s-\delta\hat{b}^{\dagger}_s)/\sqrt{2}i$. Moreover, the corresponding input noise operators are amended as $\hat{X}^{\text{in}}=e^{r}(\hat{\tilde{a}}_{\text{p,in}}+\hat{\tilde{a}}^{\dagger}_{\text{p,in}})/\sqrt{2}$, $\hat{P}^{\text{in}}=e^{-r}(\hat{\tilde{a}}_{\text{p,in}}-\hat{\tilde{a}}^{\dagger}_{\text{p,in}})/\sqrt{2}i$, $\hat{X}^{\text{in}}_{m}=e^{-r_m}(\hat{b}_{\text{in}}+\hat{b}^{\dagger}_{\text{in}})/\sqrt{2}$ and $\hat{P}^{\text{in}}_m=e^{r_m}(\hat{b}_{\text{in}}-\hat{b}^{\dagger}_{\text{in}})/\sqrt{2}i$ with $\hat{\tilde{a}}_{\text{p,in}}=\hat{a}_{\text{p,in}}e^{i\theta}$. We note that noise $\hat{X}^{\text{in}}$ and $\hat{P}^{\text{in}}$ own exponential factors, which means decreasing laser phase noise is accomplished by increasing thermal noise. To suppress the increased thermal noise around the cavity field, we adjust the amplitude and phase of the squeezed vacuum environment. If the squeezing parameters satisfy the conditions $r=r_e$ and $\Phi_e-2\theta=\pi$, the effective input noise of the cavity is equivalent to a vacuum noise and we can obtain the following noise correlation function \begin{equation} \begin{split} \left\langle\hat{X}^{\mathrm{in}}(t) \hat{X}^{\mathrm{in}}\left(t^{\prime}\right)\right\rangle=\frac{1}{2}\delta(t-t^{\prime}), \\ \langle\hat{X}^{\text{in}}(t)\hat{Y}^{\text{in}}(t^{\prime})\rangle=-\frac{1}{2i}\delta(t-t^{\prime}), \\ \left\langle\hat{X}^{\mathrm{in}}(t) \hat{X}^{\mathrm{in}}\left(t^{\prime}\right)\right\rangle=\frac{1}{2}\delta(t-t^{\prime}), \\ \langle\hat{Y}^{\text{in}}(t)\hat{X}^{\text{in}}(t^{\prime})\rangle=\frac{1}{2i}\delta(t-t^{\prime}). \end{split} \label{eqrr} \end{equation} We derive these noise correlations in detail in the appendix \ref{Appendix1}. By combining Eqs. (\ref{eq9}), (\ref{eq12}) and (\ref{eqrr}), we can derive the Langevin equation to describe the dynamic evolution of the system. We rewrite the Langevin equation as a compact matrix form \begin{equation} \dot{\vec{u}}(t)=A\vec{u}(t)+\vec{n}(t), \label{eq13} \end{equation} where we have defined the vector of continuous variable fluctuation operators $\vec{u}(t)=[\delta\hat{X}, \delta\hat{P}, \delta\hat{X}_m, \delta\hat{P}_m, \psi]^{\top}$, and the corresponding input noise vector is $\vec{n}=[\sqrt{2\kappa}\hat{X}^{\text{in}}, \sqrt{2\kappa}\hat{P}^{\text{in}}, \sqrt{2\gamma_m}\hat{X}^{\text{in}}_{m}, \sqrt{2\gamma_m}\hat{P}^{\text{in}}_{m}, \varepsilon]^{T}$. Moreover, the drift matrix is the 5$\times$5 matrix \begin{equation} \begin{split} A = \left(\begin{array}{ccccc} -\kappa & \Delta_{\text{e}} & 0 & 0 & 0\\ -\Delta_{\text{e}} & -\kappa & 2ge^{r^{\prime}} & 0 & -\sqrt{2}\vert\alpha\vert e^{-r}\\ 0 & 0 & -\gamma_m & \Delta_{m} & 0\\ 2ge^{r^{\prime}} & 0 & -\Delta_{m} & -\gamma_m & 0 \\ 0 & 0 & 0 & 0 & -\gamma_{c} \end{array} \right), \end{split} \label{eq14} \end{equation} where the element $-\sqrt{2}\vert\alpha\vert e^{-r}$ in the drift matrix $A$ describes the coupling between the phase noise operator and the optical momentum operator. It is different from the standard cavity optomechanical system that the effective coupling and the phase noise term multiply exponential factors $e^{r^{\prime}}$ and $e^{-r}$, respectively. One can enlarge the squeezing strength $r$ to suppress the influence of phase noise and increase $r^{\prime}$ to improve the coupling $G$. Therefore, the parametric processes, induced by the Kerr medium and Duffing nonlinearity, can simultaneously increase the effective optomechanical coupling and reduce the coupling between the laser phase noise and the cavity field. According to the Eq.~(\ref{eq13}), we obtain the following dynamical equation of the covariance matrix \begin{equation} \frac{dV}{dt}=AV+VA^{T}+N, \label{eq15} \end{equation} where the matrix element of the covariance matrix $V$ can be expressed as \begin{equation} V_{ij}=\frac{1}{2}\left\langle \vec{u}_{i} \vec{u}_{j}+\vec{u}_{j} \vec{u}_{i}\right\rangle, \end{equation} and the corresponding noise matrix is \begin{equation} \!N\!=\!\begin{pmatrix} \kappa & 0 & 0 & 0 & 0\\ 0 & \kappa & 0 & 0 & 0\\ 0 & 0 & \gamma_m\lambda(2n_{\text{th}}+1) & 0 & 0\\ 0 & 0 & 0 & \frac{\gamma_m}{\lambda}(2n_{\text{th}}+1) & 0 \\ 0 & 0 & 0 & 0 & 2\gamma_{c}^{2} \Gamma_{L} \end{pmatrix}, \label{eq16} \end{equation} where we have defined the parameter $\lambda=e^{-2r_m}$. Generally, one exploits a squeezed vacuum bath to counteract the influence of the factor $\lambda=e^{-2r_m}$. However, the mechanical decay $\gamma_m$ is very small so that the factor $\lambda=e^{-2r_m}$ in Eq.~(\ref{eq16}) has a little affect on the systemic dynamics. Therefore, we retain this factor in the following calculations. \begin{figure}[tbp] \centering {\includegraphics[width=0.8\columnwidth]{Figure2.eps}} \caption{ Firstly, a writing pulse steers the initial state of the cavity mode to the mechanical oscillator, which is the so-called writing process. Then the state is stored in the mechanical oscillator for a while $\tau$. The state is stored in the mechanical oscillator with a high fidelity due to a small damping rate. Finally, a reading pulse is injected into the system with an opposite sign of the writing pulse for reading the stored state.} \label{figure2} \end{figure} \section{Demonstrating some actual quantum phenomenon} \label{Demonstrating some actual quantum phenomenon} In this section, we take two examples to test the efficiency of our scheme mentioned in the above section. Firstly, we theoretically investigate the performance of our proposal on improving the optomechanical quantum memories against the laser phase noise. Secondly, we exploit our design to demonstrate the stationary optomechanical entanglement. \subsection{Quantum memory} \label{Quantum memory} \begin{figure}[tbp] \centering {\includegraphics[width=0.9\columnwidth]{Figure3.eps}} \caption{(Color~online) The fidelity of quantum memory is calculated as a function of parameter $\eta$ for different parameters related to phase noise: (a) the linewidth of driving laser $\Gamma_L=5$kHz; (b) cut-off frequencies $\gamma_c=5$kHz. Other parameters are given in the text.} \label{figure3} \end{figure} \begin{figure}[tbp] \centering {\includegraphics[width=0.9\columnwidth]{Figure4.eps}} \caption{(Color~online) We simulate the mean value of the cavity field $\alpha$ as a function of $\eta$ by fixing $G=0.05\omega_m=3.14$MHz and $g=2\pi\times 100$Hz. $\eta$ is limited in $0\sim0.9999$. Other parameters are given in the text.} \label{figure4} \end{figure} \begin{figure*}[tbp] \centering {\includegraphics[width=2\columnwidth]{Figure5.eps}} \caption{(Color~online) The fidelity of quantum memory is simulated as a function of cut-off frequency $\gamma_c$ and laser linewidth $\Gamma_L$ for different $\eta$: (a) $\eta=0.9999$; (b) $\eta=0.999$; (c) $\eta=0.99$. Other parameters are given in the text.} \label{figure5} \end{figure*} \begin{figure}[tbp] \centering {\includegraphics[width=0.9\columnwidth]{Figure6.eps}} \caption{(Color~online) We simulate the fidelity as a function of the squeezing parameter $\chi$ for different $\eta$. Other parameters are given in the text. } \label{figure6} \end{figure} Quantum memory is indispensable for quantum information processing and has made enormous progress in optics and atoms~\cite{Felinto2006}. Let us briefly recall the quantum memory in optomechanical system~\cite{PhysRevLett.107.133601}. As shown in Fig.~\ref{figure2}, the state of the optical mode is transferred to the mechanical mode in the writing process with time $\frac{\pi}{2G}$. Then the state is stored in the mechanical membrane for a while $\tau$ by decoupling the mechanical and the optical modes. Finally, the optical mode obtains the storied state in the reading process, and the corresponding reading time is $\frac{\pi}{2G}$. One of the advantages of quantum memory in optomechanical systems is that the decay rate of the mechanical oscillator is much smaller than the optical cavity. Here we apply the model to achieve quantum memory. We suppose the effective detuning satisfies the resonate condition $\Delta_e\approx\Delta_m\gg G$ which can be achieved by controlling the frequency of the optical driving. This condition limits that $\eta$ cannot close to one infinitely. In other words, we cannot fully cancel the laser phase noise. In our paper, we limit $\eta$ in $0\sim 0.9999$. $F=\operatorname{Tr}\left(\hat{\rho}_{\mathrm{i}} \hat{\rho}_{\mathrm{f}}\right)$ is defined as the fidelity between the initial state $\hat{\rho}_{\mathrm{i}}$ and final state $\hat{\rho}_{\text{f}}$. In the phase space, one can rewrite the fidelity as $F=\pi \int_{-\infty}^{\infty} d \vec{\xi} W_{\text{i}}(\xi) W_{\text{f}}(\xi)$, where $\xi \in \Re^{2}$ is the vector of the optical quadratures $\xi=\left[\delta\hat{X}, \delta\hat{P}\right]^{T}$ and $W_{\text{i}}$ ($W_{\text{f}}$) are the Wigner functions of the optical initial (final) states. To simplify the calculation, we assume the state of the cavity staying in a pure Gaussian state—the Wigner function $W_{\text{i}}$ ($W_{\text{f}}$) are the Gaussian distribution. Under this assumption, one can obtain the fidelity between the initial and the final states of the optical mode at time \begin{equation} F=\frac{1}{1+\bar{n}_{\mathrm{h}}} \exp \left(-\frac{\Theta^{2}}{1+\bar{n}_{\mathrm{h}}}\right), \label{eq17} \end{equation} where the parameters $\bar{n}_{\mathrm{h}}$, $\Theta$ has the following forms \begin{equation} \begin{array}{l} \bar{n}_{\mathrm{h}}=2 \sqrt{\operatorname{det}(\frac{V_{\mathrm{i}}+V_{\mathrm{f}}}{2})}-1, \\ \Theta^{2}=(\langle\hat{\xi}_{\mathrm{i}}\rangle-\langle\hat{\xi}_{\mathrm{f}}\rangle) \cdot \frac{\sqrt{\operatorname{det}(\frac{V_{\mathrm{i}}+V_{\mathrm{f}}}{2})}}{V_{\mathrm{i}}+V_{\mathrm{f}}}(\langle\hat{\xi}_{\mathrm{i}}\rangle-\langle\hat{\xi}_{\mathrm{f}}\rangle), \end{array} \label{eq18} \end{equation} with the initial (final) covariance matrix $V_{\text{i}}$ ($V_{\text{f}}$) and the initial (final) optical mean quadratures $\xi_{\text{i}}$ ($\xi_{\text{f}}$). The detailed derivation of Eq.~(\ref{eq17}) have been proposed by Wang~\cite{Wang_2012}. To measure the fidelity $F$, we need to calculate the expectations of optical quadratures ($\xi_{\text{i}}$ and $\xi_{\text{f}}$) and the covariance matrix ($V_{\text{i}}$ and $V_{\text{f}}$) of the initial and final states. Here we consider the squeezed coherent state (a typical Gaussian state) as the initial state of the optical field in the squeezing frame (i.e. $|\mu, \chi\rangle=D(\mu) S(\chi)|0\rangle$), and thus the state in the original frame is $S(r)^{\dagger}D(\mu) S(\chi)|0\rangle$ where $D(\mu)=\exp{(\mu \hat{a}^{\dagger}-\mu^{*} \hat{a})}$ and $S(\chi)=\exp{(\frac{\chi^*}{2}\hat{a}^{2}-\frac{\chi}{2}\hat{a}^{\dagger 2})}$ are displacement and squeezing operators, respectively. Therefore, one can obtain the initial vector $\vec{u}(0)=[\sqrt{2}\operatorname{Re}(\mu), \sqrt{2}\operatorname{Im}(\mu), 0, 0, 0]^{T}$ and the corresponding initial covariance matrix is \begin{equation} \begin{split} V(0)=\frac{1}{2}\left(\begin{array}{ccccc} e^{-2\chi} & 0 & 0 & 0 & 0\\ 0 & e^{2\chi} & 0 & 0 & 0\\ 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 \end{array} \right), \end{split} \label{eq181} \end{equation} where we have assumed $\chi\in\Re$. To numerically analyze the quantum memory effect, we choose the parameters similar to those in Ref.~\cite{PhysRevA.84.032325,PhysRevA.84.063827}: length of the cavity $L=1$mm; wavelength of the cavity field $1064$ nm; mass of the mechanical oscillator $m\simeq$10ng; frequency of the mechanical oscillator $\omega_{m}=2\pi \times 10\mathrm{MHz}$; quality factor $Q_{m}=2\times 10^6$; the optical decay rate $\kappa=2\pi\times 100$kHz; single-photon coupling strength $g_0=2\pi\times 100$Hz; the linewidth of driving laser $\Gamma_L$ in range $1\sim 50$kHz; the cut-off frequency $\gamma_c$ in range $0.1\sim 50$kHz. Moreover, we assume the mean thermal phonon number $n_{\text{th}}=3$ and the parameter $r^{\prime}=0$. The storage time is $\tau=65\omega^{-1}_m=1.035\mu s$. We fix the effective coupling $G=0.05\omega_m$ which can be achieved by controlling the strength of driving laser. To demonstrate the advantage of our proposal, we simulate the fidelity $F$ as a function of parameter $\eta$ in Figs.~\ref{figure3}(a) and \ref{figure3}(b) for different cut-off frequency $\gamma_c$ and laser linewidth $\Gamma_L$, respectively, where we have limited the parameter $\eta$ in interval $[0, 0.9999]$. It is clear that the fidelity is improving with the increasing of parameter $\eta$ even the noise spectrum has large cut-off frequency $\gamma_c$ and laser linewidth $\Gamma_L$. In particular, the fidelity is approximately the same with ideal situation (i.e., without laser phase noise $\gamma_c=0$) for $\eta=0.9999$ though the cut-off frequency $\gamma_c$ takes the values $5$kHz, $8$kHz, $10$kHz, and $15$kHz. It indicates that the phase noise is extremely suppressed even can be approximately ignored, which is largely different from the case $\eta=0$ (the standard optomechanical system). We improve the parameter $\eta$ to increase the squeezing parameter $r$ (i.e., enhancing $e^r$) so that the noise term $-\sqrt{2}\vert\alpha\vert e^{-r}\dot{\varphi}(t)$ can be effectively suppressed. Moreover, we numerically simulate the variation of $\vert\alpha\vert$ with $\eta$ in Fig.~\ref{figure4}. It is obvious that $\vert\alpha\vert$ is monotonically decreasing with the increasing of parameter $\eta$ and the minimum value $\vert\alpha\vert e^{-r}$ is $420.45$ for $\eta=0.9999$. At this time, the effect of phase noise is reduced about an order of magnitude. To further clarify the promotion effect of large $\eta$ (i.e., large $r$), we simulate the fidelity as the function of cut-off frequency $\gamma_c$ and laser linewidth $\Gamma_L$ for different $\eta$ in Figs.~\ref{figure5}(a)-\ref{figure5}(c). The results show that the area of high fidelity shrinks with the decreasing of $\eta$, and the destructive effect of the cut-off frequency $\gamma_c$ on the fidelity $F$ is more larger than the laser linewidth $\Gamma_L$. Moreover, the fidelity can arrive at 0.955 for $\eta=0.9999$ even the parameters of the noise spectrum are very huge ($\gamma_c=0.01$MHz and $\Gamma_L=0.01$MHz). In Fig.~\ref{figure6}, we simulate the fidelity $F$ versus to the increasing of the squeezing amplitude of the initial state which is described by the squeezing parameters $\chi$. One can easily find the fidelity decreases by increasing parameter $\chi$, while the variation of the fidelity for $\eta=0.9$ is slower than $\eta=0.7$, $\eta=0.5$, and $\eta=0$. Therefore, our scheme can protect the fidelity and inhibit the phase noise for a small $\chi$. However, the advantage of the scheme slowly disappears and the initial state would be more sensitive to various noises when the initial state becomes more and more non-classical (i.e., with the increasing of $\chi$). \subsection{Entanglement} \label{entanglement} \begin{figure}[tbp] \centering {\includegraphics[width=0.9\columnwidth]{Figure7.eps}} \caption{(Color~online) The stationary optomechanical entanglement $E_N$ versus the decay of cavity mode for $\eta=0$, $\eta=0.4$, $\eta=0.9$, and $\eta=0.9999$. The effective coupling is $G/\omega_m=0.5$, the cut-off frequency is $\gamma_c=10$kHz, and the laser linewidth is $\Gamma_L=10$kHz. Other parameters are given in the text. } \label{figure7} \end{figure} \begin{figure}[tbph] \centering {\includegraphics[width=0.9\columnwidth]{Figure8.eps}} \caption{(Color~online) The stationary optomechanical entanglement $E_N$ versus to the decay $\kappa$ of the cavity mode. (a) the parameter $\eta$ is 0.9999 under various cut-off frequencies $\gamma_c$ and laser linewidth $\Gamma_L$ of the driving laser. (b) the parameter $\eta$ equals to 0 under various cut-off frequencies $\gamma_c$ and laser linewidth $\Gamma_L$ of the driving laser, which indicates the standard optomechanical model ($r=0$). Other parameters are the same with Fig.\ref{figure7}. } \label{figure8} \end{figure} \begin{figure*}[tbph] \centering {\includegraphics[width=2\columnwidth]{Figure9.eps}} \caption{(Color~online) Contour plot of the stationary optomechanical entanglement $E_N$ versus cut-off frequencies $\gamma_c$ and spectral widths of phase noise for (a) $\eta=0.9999$, (b) $\eta=0.999$, and (c) $\eta=99$. The decay of the cavity is $\kappa/2\pi=5$MHz. Other parameters are the same with Fig.\ref{figure7}. } \label{figure9} \end{figure*} Here we consider the stationary optomechanical entanglement as the second example to demonstrate the advantage of our scheme on suppressing the phase noise. The steady-state of the system is associated with Eq.~(\ref{eq15}). If and only if all the eigenvalues of the matrix $A$ have negative real parts, the system can arrive in the steady-state. We derive the stability conditions by using the Routh-Hurwitz criteria~\cite{PhysRevA.35.5288,Mahajan2019652,Bhatt2019,Mahajan2013}. According to the criteria, we get the following two non-trivial stability conditions: \begin{subequations} \begin{equation} \gamma _m^2 \Delta _e^2+\kappa ^2 \gamma _m^2+\kappa ^2 \Delta _m^2+(\Delta _e\Delta _m-4 G^2) \Delta _e \Delta _m >0, \label{eq21a} \end{equation} \begin{equation} \begin{split} &4 \kappa\gamma _m\left\lbrace \left((\Delta _e-\Delta _m)^2+(\kappa+\gamma _m)^2\right)\left((\Delta _e+\Delta _m)^2\right. \right.\\& \left.\left.+(\kappa+\gamma _m)^2\right)\right\rbrace+ 16 G^2 \Delta _e \left(\kappa +\gamma _m\right){}^2 \Delta _m>0. \end{split} \label{eq21b} \end{equation} \end{subequations} In the next calculation, we restrict all the parameters to satisfy the stable condition~(\ref{eq21a}) and (\ref{eq21b}). Here we consider the frequency condition $\Delta_e, \Delta_m>0$. It should be noticed that the critical condition (\ref{eq21a}) limits the exponential improvement of coupling and noise suppression (i.e, $0<r<r_{\text{max}}$) where \begin{equation} r_{\text{max}}=\frac{1}{2}\ln(\frac{\gamma_m^2 \Delta^2_e+\kappa^2 \gamma_m^2+\kappa^2 \Delta^2_m+\Delta^2 _e\Delta^2_m}{4g^2\Delta_e\Delta_m}). \label{eq22new} \end{equation} For our model, the steady-state is a zero-mean Gaussian state because we have linearized the dynamics of the fluctuations, and all noises are Gaussian; as a consequence, it is fully characterized by the $5 \times 5$ stationary covariance matrix $V(\infty)$ with matrix elements, \begin{equation} V_{\text{ij}}=\frac{\left\langle u_{\text{i}}(\infty) u_{\text{j}}(\infty)+u_{\text{j}}(\infty) u_{\text{i}}(\infty)\right\rangle}{2}. \label{eq20} \end{equation} The stationary covariance matrix $V(\infty)$ can be obtained by solving the following Lyapunov equation \begin{equation} AV+V A^{\top}=-N. \label{eq21} \end{equation} We find that the Lyapunov equation (\ref{eq21}) is linear for the covariance matrix $V$, which means the Lyapunov equation can be straightforwardly and analytically solved. One can identify all the quantum properties of the stationary state of the optomechanical system according to the stationary covariance matrix $V(\infty)$. Therefore, we can simulate the influence of laser phase noise on achieving quantum entanglement between the mechanical oscillator and optical mode. The stationary optomechanical entanglement relates to the mechanical and optical quadratures, and thus we concentrate on the reduced $4\times 4$ covariance matrix of $V(\infty)$. This reduced correlation matrix has the following form \begin{equation} V \equiv\left(\begin{array}{ll} V_{\mathrm{A}} & V_{\mathrm{C}} \\ V_{\mathrm{C}}^{\mathrm{T}} & V_{\mathrm{B}} \end{array}\right), \label{eq22} \end{equation} where $V_{\mathrm{A}}, V_{\mathrm{B}}$ and $V_{\mathrm{C}}$ are $2 \times 2$ matrix. The matrix $V_{\mathrm{A}}$ ($V_{\mathrm{B}}$) are associated with the optical mode (mechanical oscillator), while $V_{\mathrm{C}}$ describes the optomechanical correlations. The logarithmic negativity is the famous and convenient measure for predicting continuous variable (CV) entanglement \cite{PhysRevA.65.032314}, and its definition is \begin{equation} E_{N}=\max \left(0,-\ln 2 \eta^{-}\right) \label{eq23} \end{equation} where $\eta^{-}$ is the symplectic eigenvalue of the bipartite system, and it has the following form \begin{equation} \eta^{-} \equiv \frac{1}{\sqrt{2}}\left[\Sigma(V)-\sqrt{\Sigma(V)^{2}-4 \operatorname{det} V}\right]^{1 / 2} \label{eq24} \end{equation} with $\Sigma(V)=\operatorname{det} V_{\mathrm{A}}+\operatorname{det} V_{\mathrm{B}}-2 \operatorname{det} V_{\mathrm{C}}$. Then we study the advantage of our scheme on CV entanglement when the phase noise exists in the system. In Figs.~\ref{figure7}(a) and (b), we simulate $E_N$ versus to the optical decay $\kappa$ under different $\eta$. Obviously, laser phase noise has a prominent effect on the stationary optomechanical entanglement while the large parameter $\eta$ can improve the maximum value of $E_N$ and broaden the parameter region existing entanglement. By comparing with Figs.~\ref{figure7}(a) and (b), we find our proposal ($\eta=0.9999$) has a great advantage than the standard optomechanical coupling model ($\eta=0$). Therefore, our scheme extremely inhibits the negative effect of laser phase noise on the stationary optomechanical entanglement, which improve the conclusion in Ref. \cite{PhysRevA.84.032325}. Moreover, we simulate $E_N$ as a function of $\kappa$ for $\eta=0.9999$ and $\eta=0$ in Figs.~\ref{figure8}(a) and \ref{figure8}(b), respectively. According to the numerical results, we summarize the advantages of our scheme versus the standard optomechanical coupling model: the entanglement $E_N$ is more greater for huge $\gamma_c$ and $\Gamma_L$; $E_N$ can exist in a wide range of $\kappa$; the entanglement $E_N$ decays more slowly with the increasing of $\gamma_c$ and $\Gamma_L$; $E_N$ exists even for larger laser phase noise $(\gamma_c, \Gamma_L)=(20\text{kHz}, 20\text{kHz})$. However, the standard optomechanical coupling model ($\eta=0$) is sensitive to laser phase noise, and the stationary optomechanical entanglement $E_N$ is approximately close to zero for $(\gamma_c, \Gamma_L)=(15\text{kHz}, 15\text{kHz})$. In Fig.~\ref{figure9}, we simulate $E_N$ versus the cut-off frequency $\gamma_c$ and the laser linewidth $\Gamma_L$ for (a) $\eta=0.9999$, (b) $\eta=0.999$, and (c) $\eta=99$. The numerical results show that the destructive effect of phase noise is tiny when $\eta$ is closer to one. Although the maximum achievable entanglement decreases with the increasing of cut-off frequency $\gamma_c$ and laser linewidth $\Gamma_L$, we still obtain a large parameters range to maintain the entanglement for a large $\eta$. Moreover, we also notice that the destructive effect of $\gamma_c$ is more remarkable than $\Gamma_L$. Therefore, our method can suppress the laser phase noise, and thus protect the stationary entanglement. \section{Conclusion} \label{Conclusion} In summary, we studied a theoretical proposal to suppress the phase noise and improve the effective optomechanical coupling. The optomechanical system includes a mechanical Duffing nonlinearity and a Kerr medium that can create the mechanical and optical parametric amplification terms. Further calculation shows that we can enhance the effective optomechanical coupling and inhibit the laser phase noise at the same time. In this process, we use the squeezed vacuum environment to inhibit the increased thermal noise. To test the performance of our proposal, we simulate quantum memory and stationary optomechanical entanglement as examples. The numerical results show that our scheme effectively suppresses the destructive influence of laser phase noise on quantum memory and protects the storing fidelity at a high value. Moreover, our proposal can also protect stationary optomechanical entanglement. In particular, the maximal entanglement decreases very slowly with the increasing of the laser phase noise, and it exists in wide ranges of parameters. Our scheme provides a promising way for inhibiting the phase noise of optomechanical systems or other quantum systems driven by lasers and has potential applications for achieving quantum information processes and observing quantum phenomena. \section*{ACKNOWLEDGMENTS} The authors thank Wenlin Li, Feng-Yang Zhang, and Denghui Yu for the useful discussion. This research was supported by the National Natural Science Foundation of China (Grant No. 11574041 and 11375036) and the Excellent young and middle-aged Talents Project in scientific research of Hubei Provincial Department of Education (under Grant No. Q20202503)
\section{Introduction} A categorification of the cluster algebra structure on the homogeneous coordinate ring $\mathbb C[{\rm Gr}(k, n)]$ of the Grassmannian variety of $k$-dimensional subspaces in $\mathbb C^n$ has been given by Geiss, Leclerc, and Schroer \cite{GLS06, GLS08} in terms of a subcategory of the category of finite dimensional modules over the preprojective algebra of type $A_{n-1}$. Jensen, King, and Su \cite{JKS16} gave a new categorification of this cluster structure using the maximal Cohen-Macaulay modules over the completion of an algebra $B_{k,n}$ which is a quotient of the preprojective algebra of type $A_{n-1}$. Rank $1$ modules are the building blocks of the category ${\rm CM}(B_{k,n}) $ of Cohen-Macaulay modules over a quotient $B_{k,n}$ of a preprojective algebra of affine type $A_{n-1}$. Rank 1 modules are indecomposable, they are known to be in bijection with $k$-subsets of $[n]=\{1,2,\dots,n\}$, and their explicit construction has been given in \cite{JKS16}. These are the building blocks of the category as any module in ${\rm CM}(B_{k,n}) $ can be filtered by rank $1$ modules (the filtration is noted in the profile of a module, \cite[Corollary 6.7]{JKS16}). The number of rank 1 modules appearing in the filtration of a given module is called the rank of that module. In \cite{BBL}, we explicitly constructed all indecomposable rank 2 modules in tame cases. In this paper, we give necessary and sufficient conditions for indecomposability of an arbitrary rank 2 module in ${\rm CM}(B_{k,n})$ whose filtration layers are tightly interlacing. Moreover, we construct explicitly all rank 2 decomposable Cohen-Macaulay $B_{k,n}$-modules that appear as middle terms in the short exact sequences where the end terms are rank 1 modules corresponding to tightly interlacing subsets. The central combinatorial notion throughout this paper is that of $r$-interlacing (Definition~\ref{interlacing}). If $I$ and $J$ are $k$-subsets of $\{1,\ldots, n\}$, then $I$ and $J$ are said to be {\em $r$-interlacing} if there exist subsets $\{i_1,i_3,\dots,i_{2r-1}\}\subset I\setminus J$ and $\{i_2,i_4,\dots, i_{2r}\}\subset J\setminus I$ such that $i_1<i_2<i_3<\dots <i_{2r}<i_1$ (cyclically) and if there exist no larger subsets of $I$ and of $J$ with this property. Denote by $L_I$ the rank 1 indecomposable module corresponding to the $k$-subset $I$. By \cite[Proposition 5.6]{JKS16}, ${\rm Ext}_{B}^1(L_I,L_J)\neq 0$ if and only if $I$ and $J$ are $r$-interlacing, where $r\geq 2$. In particular, rank 1 modules are rigid, i.e.\ ${\rm Ext}_{B}^1(L_I,L_I)=0$ for every $I$. This means that if the sets $I$ and $J$ are $1$-interlacing, then the only module appearing as the middle term in short exact sequences with end terms $L_I$ and $L_J$ is the direct sum $L_I\oplus L_J$. For this reason, we will assume most of the time that $I $ and $J$ are $r$-interlacing with $r\geq 2$. Note also that, by Theorem 3.7 in \cite{BB}, ${\rm Ext}_{B}^1(L_I,L_J)\cong {\rm Ext}_{B}^1(L_J,L_I)$, so we have the same arguments for the short exact sequences with $L_I$ as the left term and $L_J$ as the right term, and for the short exact sequences with $L_J$ as the left term and $L_I$ as the right term. The paper is organized as follows. In Section 2, we recall the definitions and key results about Grassmannian cluster categories. In Section 3, we study the filtration $I\mid J$, where $I=\{1,3,\dots, 2r-1\}$ and $J=\{2,4, \ldots, 2r\},$ in the case $(r,2r)$. We explain how the general case of a module with tight $r$-interlacing filtration layers reduces to the case of the module with filtration $I\mid J$. For the filtration layers $I$ and $J$ of a module with profile $I\mid J$, we construct all decomposable rank 2 modules that are extensions of these rank 1 modules, i.e.\ we construct all decomposable modules that appear as middle terms in short exact sequences with $L_I$ and $L_J$ as end terms. In particular, we associate with every subset of peaks of the rim $I$ a decomposable rank 2 module that is extension of $L_{J}$ by $L_{I}$. Our main results are Theorem \ref{t6} in which we give necessary and sufficient conditions for a rank 2 module with filtration $I\mid J$ to be indecomposable, and Theorem \ref{paths} in which we give an explicit construction of all rank 2 decomposable modules that appear as extensions between rank 1 modules corresponding to the subsets $I$ and $J$. \section{Preliminaries} We follow closely the exposition from \cite{JKS16, BB, BBGE, BBL} in order to introduce notation and background results. Let $\Gamma_n$ be the quiver of the boundary algebra, with vertices $1,2,\dots, n$ on a cycle and arrows $x_i: i-1\to i$, $y_i:i\to i-1$ (see Figure \ref{quiv}). We write ${\rm CM}(B_{k,n})$ for the category of maximal Cohen-Macaulay modules for the completed path algebra $B_{k,n}$ of $\Gamma_n$, with relations $xy-yx$ and $x^k-y^{n-k}$ (at every vertex). The centre of $B_{k,n}$ is $Z:=\operatorname{\mathbb{C}}\nolimits[|t|]$, where $t=\sum_ix_iy_i$. \begin{center} \begin{figure}[H] \begin{center} \begin{tikzpicture}[scale=1] \newcommand{1.5cm}{1.5cm} \foreach \j in {1,...,5}{ \path (90-72*\j:1.5cm) node[black] (w\j) {$\bullet$}; \path (162-72*\j:1.5cm) node[black] (v\j) {}; \path[->,>=latex] (v\j) edge[black,bend left=30,thick] node[black,auto] {$x_{\j}$} (w\j); \path[->,>=latex] (w\j) edge[black,bend left=30,thick] node[black,auto] {$y_{\j}$}(v\j); } \draw (90:1.5cm) node[above=3pt] {$5$}; \draw (162:1.5cm) node[above left] {$4$}; \draw (234:1.5cm) node[below left] {$3$}; \draw (306:1.5cm) node[below right] {$2$}; \draw (18:1.5cm) node[above right] {$1$}; \end{tikzpicture} \end{center} \caption{The quiver $\Gamma_n$ for $n=5$.}\label{quiv} \end{figure} \end{center} The algebra $B_{k,n}$ coincides with the quotient of the completed path algebra of the graph $C$ (a circular graph with vertices $C_0=\mathbb Z_n$ set clockwise around a circle, and with the set of edges, $C_1$, also labeled by $\mathbb Z_n$, with edge $i$ joining vertices $i-1$ and $i$), i.e.\ the doubled quiver as above, by the closure of the ideal generated by the relations above (we view the completed path algebra of the graph $C$ as a topological algebra via the $m$-adic topology, where $m$ is the two-sided ideal generated by the arrows of the quiver, see \cite[Section 1]{DWZ08}). The algebra $B_{k,n}$, that we will often denote by $B$ when there is no ambiguity, was introduced in \cite[Section 3]{JKS16}. Observe that $B_{k,n}$ is isomorphic to $B_{n-k,n}$, so we will always assume that $k\le \frac n 2$. \smallskip The (maximal) Cohen-Macaulay $B$-modules are precisely those which are free as $Z$-modules. Such a module $M$ is given by a representation $\{M_i\,:\,i\in C_0\}$ of the quiver with each $M_i$ a free $Z$-module of the same rank (which is the rank of $M$). \begin{defn}[\cite{JKS16}, Definition 3.5] For any $B_{k,n}$-module $M$ and $K$ the field of fractions of $Z$, the {\bf rank} of $M$, denoted by ${\rm rk}(M)$, is defined to be ${\rm rk}(M) = {\rm len}(M \otimes_Z K)$. \end{defn} Note that $B\otimes_Z K\cong M_n ( K)$, which is a simple algebra. It is easy to check that the rank is additive on short exact sequences, that ${\rm rk} (M) = 0$ for any finite-dimensional $B$-module (because these are torsion over $Z$) and that, for any Cohen-Macaulay $B$-module $M$ and every idempotent $e_j$, $1\leq j\leq n$, ${\rm rk}_Z(e_j M) = {\rm rk}(M)$, so that, in particular, ${\rm rk}_Z(M) = n {\rm rk}(M)$. \begin{defn}[\cite{JKS16}, Definition 5.1] \label{d:moduleMI} For any $k$-subset $I$ of $C_1$, we define a rank $1$ $B$-module \[ L_I = (U_i,\ i\in C_0 \,;\, x_i,y_i,\, i\in C_1) \] as follows. For each vertex $i\in C_0$, set $U_i=\mathbb C[[t]]$, for each edge $i\in C_1$, set \begin{itemize} \item[] $x_i\colon U_{i-1}\to U_{i}$ to be multiplication by $1$ if $i\in I$, and by $t$ if $i\not\in I$, \item[] $y_i\colon U_{i}\to U_{i-1}$ to be multiplication by $t$ if $i\in I$, and by $1$ if $i\not\in I$. \end{itemize} \end{defn} The module $L_I$ can be represented by a lattice diagram $\mathcal{L}_I$ in which $U_0,U_1,U_2,\ldots, U_n$ are represented by columns of vertices (dots) from left to right (with $U_0$ and $U_n$ to be identified), going down infinitely. The vertices in each column correspond to the natural monomial $\mathbb C$-basis of $\mathbb C[t]$. The column corresponding to $U_{i+1}$ is displaced half a step vertically downwards (respectively, upwards) in relation to $U_i$ if $i+1\in I$ (respectively, $i+1\not \in I$), and the actions of $x_i$ and $y_i$ are shown as diagonal arrows. Note that the $k$-subset $I$ can then be read off as the set of labels on the arrows pointing down to the right which are exposed to the top of the diagram. For example, the lattice diagram $\mathcal{L}_{\{1,4,5\}}$ in the case $k=3$, $n=8$, is shown in Figure \ref{Lattice}. \begin{center} \begin{figure}[H] \center \begin{tikzpicture}[scale=1,baseline=(bb.base), quivarrow/.style={black, -latex, thin}] \newcommand{\seventh}{51.4} \newcommand{1.5cm}{1.5cm} \newcommand{1.2cm}{1.2cm} \newcommand{1.8cm}{1.8cm} \newcommand{\dotrad}{0.1cm} \newcommand{\bdrydotrad}{{0.8*\dotrad}} \path (0,0) node (bb) {}; \draw (0,0) circle(\bdrydotrad) [fill=black]; \draw (0,2) circle(\bdrydotrad) [fill=black]; \draw (1,1) circle(\bdrydotrad) [fill=black]; \draw (2,0) circle(\bdrydotrad) [fill=black]; \draw (2,2) circle(\bdrydotrad) [fill=black]; \draw (3,1) circle(\bdrydotrad) [fill=black]; \draw (3,3) circle(\bdrydotrad) [fill=black]; \draw (4,0) circle(\bdrydotrad) [fill=black]; \draw (4,2) circle(\bdrydotrad) [fill=black]; \draw (5,1) circle(\bdrydotrad) [fill=black]; \draw (6,0) circle(\bdrydotrad) [fill=black]; \draw (6,2) circle(\bdrydotrad) [fill=black]; \draw (7,1) circle(\bdrydotrad) [fill=black]; \draw (7,3) circle(\bdrydotrad) [fill=black]; \draw (8,2) circle(\bdrydotrad) [fill=black]; \draw (8,4) circle(\bdrydotrad) [fill=black]; \draw (8,0) circle(\bdrydotrad) [fill=black]; \draw [quivarrow,shorten <=5pt, shorten >=5pt, ultra thick] (0,2)-- node[above]{$1$} (1,1); \draw [quivarrow,shorten <=5pt, shorten >=5pt] (1,1) -- node[above]{$1$} (0,0); \draw [quivarrow,shorten <=5pt, shorten >=5pt, ultra thick] (2,2) -- node[above]{$2$} (1,1); \draw [quivarrow,shorten <=5pt, shorten >=5pt] (1,1) -- node[above]{$2$} (2,0); \draw [quivarrow,shorten <=5pt, shorten >=5pt, ultra thick] (3,3) -- node[above]{$3$} (2,2); \draw [quivarrow,shorten <=5pt, shorten >=5pt] (2,2) -- node[above]{$3$} (3,1); \draw [quivarrow,shorten <=5pt, shorten >=5pt] (3,1) -- node[above]{$3$} (2,0); \draw [quivarrow,shorten <=5pt, shorten >=5pt, ultra thick] (3,3) -- node[above]{$4$} (4,2); \draw [quivarrow,shorten <=5pt, shorten >=5pt] (4,2) -- node[above]{$4$} (3,1); \draw [quivarrow,shorten <=5pt, shorten >=5pt] (3,1) -- node[above]{$4$} (4,0); \draw [quivarrow,shorten <=5pt, shorten >=5pt, ultra thick] (4,2) -- node[above]{$5$} (5,1); \draw [quivarrow,shorten <=5pt, shorten >=5pt] (5,1) -- node[above]{$5$} (4,0); \draw [quivarrow,shorten <=5pt, shorten >=5pt, ultra thick] (6,2) -- node[above]{$6$} (5,1); \draw [quivarrow,shorten <=5pt, shorten >=5pt] (5,1) -- node[above]{$6$} (6,0); \draw [quivarrow,shorten <=5pt, shorten >=5pt] (6,2) -- node[above]{$7$} (7,1); \draw [quivarrow,shorten <=5pt, shorten >=5pt] (7,1) -- node[above]{$7$} (6,0); \draw [quivarrow,shorten <=5pt, shorten >=5pt, ultra thick] (7,3) -- node[above]{$7$} (6,2); \draw [quivarrow,shorten <=5pt, shorten >=5pt] (7,3) -- node[above]{$8$} (8,2); \draw [quivarrow,shorten <=5pt, shorten >=5pt] (8,2) -- node[above]{$8$} (7,1); \draw [quivarrow,shorten <=5pt, shorten >=5pt, ultra thick] (8,4) -- node[above]{$8$} (7,3); \draw [quivarrow,shorten <=5pt, shorten >=5pt] (7,1) -- node[above]{$8$} (8,0); \draw [dotted] (0,-2) -- (0,2); \draw [dotted] (8,-2) -- (8,4); \draw [dashed] (4,-2) -- (4,-1); \end{tikzpicture} \caption{Lattice diagram of the module $L_{\{1,4,5\}}$} \label{Lattice} \end{figure} \end{center} We see from Figure \ref{Lattice} that the module $L_I$ is determined by its upper boundary, denoted by the thick lines, which we refer to as the {\em rim} of the module $L_I$ (this is why we call the $k$-subset $I$ the rim of $L_I$). Throughout this paper we will identify a rank 1 module $L_I$ with its rim. Moreover, most of the time we will omit the arrows in the rim of $L_I$ and represent it as an undirected graph. We say that $i$ is a {\em peak} of the rim $I$ if $i\notin I$ and $i+1\in I$. In the above example, the peaks of $I=\{1,4,5\}$ are $3$ and $8$. We say that $i$ is a {\em valley} of the rim $I$ if $i\in I$ and $i+1\notin I$. In the above example, the valleys of $I=\{1,4,5\}$ are $1$ and $5$. \begin{prop}[\cite{JKS16}, Proposition 5.2] Every rank $1$ Cohen-Macaulay $B_{k,n}$-module is isomorphic to $L_I$ for some unique $k$-subset $I$ of $C_1$. \end{prop} Every $B$-module has a canonical endomorphism given by multiplication by $t\in Z$. For ${L}_I$ this corresponds to shifting $\mathcal{L}_I$ one step downwards. Since $Z$ is central, ${\rm Hom}_B(M,N)$ is a $Z$-module for arbitrary $B$-modules $M$ and $N$. If $M,N$ are free $Z$-modules, then so is ${\rm Hom}_B(M,N)$. In particular, for any two rank 1 Cohen-Macaulay $B$-modules $L_I$ and $L_J$, ${\rm Hom}_B(L_I,L_J)$ is a free module of rank 1 over $Z=\mathbb C[[t]]$, generated by the canonical map given by placing the lattice of $L_I$ inside the lattice of $L_J$ as far up as possible so that no part of the rim of $L_I$ is strictly above the rim of $L_J$ \cite[Section 6]{JKS16}. \begin{defn}[$r$-interlacing] \label{interlacing} Let $I$ and $J$ be two $k$-subsets of $\{1,\dots,n\}$. The sets $I$ and $J$ are said to be {\em $r$-interlacing} if there exist subsets \\ $\{i_1,i_3,\dots,i_{2r-1}\}\subset I\setminus J$ and $\{i_2,i_4,\dots, i_{2r}\}\subset J\setminus I$ such that $i_1<i_2<i_3<\dots <i_{2r}<i_1$ (cyclically) and if there exist no larger subsets of $I$ and of $J$ with this property. We say that $I$ and $J$ are {\em tightly $r$-interlacing} if they are $r$-interlacing and $|I\cap J|=k-r.$ \end{defn} \begin{defn}\label{def-rigid} A $B$-module is \emph{rigid} if ${\rm Ext}^1_B (M,M)=0$. \end{defn} If $I$ and $J$ are $r$-interlacing $k$-subsets, where $r<2$, then ${\rm Ext}_{B}^1(L_I,L_J)=0$, in particular, rank 1 modules are rigid (see \cite[Proposition 5.6]{JKS16}). Every indecomposable $M$ of rank $n$ in ${\rm CM}(B)$ has a filtration with factors $L_{I_1},L_{I_{2}},\dots, L_{I_n}$ of rank 1. This filtration is noted in its \emph{profile}, ${\rm pr} (M) = I_1 \mid I_2\mid\ldots \mid I_n$, \cite[Corollary 6.7]{JKS16}. In the case of a rank $2$ module $M$ with filtration $L_I\mid L_J$ (i.e.~with profile $I\mid J$), we picture this module by drawing the rim $J$ below the rim $I$, in such a way that $J$ is placed as far up as possible so that no part of the rim $J$ is strictly above the rim $I$. We refer to this picture of $M$ as its {\em lattice diagram.} Note that there is at least one point where the rims $I$ and $J$ meet (see Figure \ref{lat}). \begin{figure}[H] \begin{center} {\includegraphics[width = 8cm]{1357-2468.eps}} \caption{The lattice diagram of a module with filtration $ L_{\{1, 3, 5,7\}}\mid L_{\{2,4, 6,8\}}$.} \label{lat} \label{some example} \end{center} \end{figure} The two rims in the lattice diagram of a rank 2 module $M$ form a number of regions between the points where the two rims meet but differ in direction before and/or after meeting. We call these regions the {\em boxes} formed by the rims or by the profile. The term box is a combinatorial tool which is very useful in finding conditions for indecomposability. However, let us point out that the module $M$ might be a direct sum in which case the lattice diagram is really a pair of lattice diagrams of rank 1 modules. We still view the corresponding diagram as forming boxes. If $I$ and $J$ are $r$-interlacing, then they form exactly $r$-boxes if and only if they are tightly $r$-interlacing. A lattice diagram with three boxes is shown in Figure~\ref{fig:boxes-poset}. Moreover, the filtration layers of a module $M$ give a poset structure. If $M$ is a rank 2 module with $r_1$ boxes, with $r_1\le r$, the poset structure associated with $M$ is $1^{r_1}\mid 2$, see Figure~\ref{fig:boxes-poset}. The poset consists of a tree with one vertex of degree $r_1$ and $r_1$ leaves, it has dimension $1$ at the leaves and dimension 2 at central vertex (we also refer to this as a {\it dimension lattice}). For background on the poset associated with an indecomposable module or to its profile, we refer to~\cite[Section 6]{JKS16} and \cite[Section 2]{BBGEL20}. \begin{figure}[H] \begin{center} {\includegraphics[width = 9cm]{4-interlacing-3boxes-poset.eps}} \caption{The profile of a module with $4$-interlacing layers forming three boxes with poset $1^3\mid 2$. The dashed line shows the rim of $L_I$ with arrows $x_i$, $i\in I$, indicated. The solid line below is the rim of $L_J$, with arrows $x_i$, $i\in J$, indicated.} \label{fig:boxes-poset} \end{center} \end{figure} A partial answer to the question of indecomposability of a rank 2 module in terms of its poset is given in the following proposition. \begin{prop}[\cite{BBGE}, Remark 3.2] \label{poset} Let $M\in {\rm CM}(B_{k,n})$ be an indecomposable module with profile $I\mid J$. Then $I$ and $J$ are $r$-interlacing and their poset is $1^{r_1}\mid 2$, where $r\geq r_1\geq 3$. \end{prop} This proposition tells us that when dealing with rank 2 indecomposable modules, we can assume that the poset of such a module is of the form $1^{r_1}\mid 2$, for $r_1\geq 3$. Throughout the paper, our strategy to prove that a module is indecomposable is to show that its endomorphism ring does not have non-trivial idempotent elements. When we deal with a decomposable rank 2 module, in order to determine the summands of this module, we construct a non-trivial idempotent in its endomorphism ring, and then find corresponding eigenvectors at each vertex of the quiver and check the action of the morphisms $x_i$ on these eigenvectors. \section{Tight $r$-interlacing} In this section we construct all rank 2 decomposable modules with filtration $I\mid J$ in the case when $I$ and $J$ are tightly $r$-interlacing $k$-subsets, i.e., when $|I\setminus J|=|J\setminus I|=r$ and non-common elements of $I$ and $J$ interlace, that is, $|I\cap J|=k-r$. We are interested in the modules $M$ that are decomposable and appear as the middle term in a short exact sequence of the form: $$0\longrightarrow L_J\longrightarrow M \longrightarrow L_I\longrightarrow 0.$$ In \cite{BBL}, we defined a rank 2 module $\operatorname{\mathbb{M}}\nolimits(I,J)$ with filtration $L_I\mid L_J$ in a similar way as rank 1 modules are defined in ${\rm CM}(B_{k,n})$. We recall the construction here. Let $V_i:=\operatorname{\mathbb{C}}\nolimits[|t|]\oplus\operatorname{\mathbb{C}}\nolimits[|t|]$, $i=1,\dots, n$. The module $\operatorname{\mathbb{M}}\nolimits(I,J)$ has $V_i$ at each vertex $1,2,\dots, n$ of $\Gamma_n$. In order to have a module structure, for every $i$ we need to define $x_i\colon V_{i-1}\to V_{i}$ and $y_i\colon V_{i}\to V_{i-1}$ in such a way that $x_iy_i=t\cdot \operatorname{id}\nolimits$ and $x^k=y^{n-k}$. Since $L_J$ is a submodule of a rank 2 module $\operatorname{\mathbb{M}}\nolimits(I,J)$, and $L_I$ is the quotient, if we extend the basis of $L_J$ to the basis of the module $\operatorname{\mathbb{M}}\nolimits(I,J)$, then with respect to that basis all the matrices $x_i$, $y_i$ must be upper triangular with diagonal entries from the set $\{1,t\}$. More precisely, the diagonal of $x_i$ (resp.\ $y_i$) is $(1,t)$ (resp.\ $(t,1)$) if $i\in J\setminus I$, it is $(t,1)$ (resp.\ $(1,t)$) if $i\in I\setminus J$, $(t,t)$ (resp.\ $(1,1)$) if $i\in I^c\cap J^c$, and $(1,1)$ (resp.\ $(t,t)$) if $i\in I\cap J$. The only entries in all these matrices that are left to be determined are the ones in the upper right corner. Let us assume that we deal with the profile $\{1,3,\dots, 2r-1\}\mid \{2,4,\ldots, 2r\}$ in the case $(r,2r)$. In the general case, all arguments are the same. Denote by $b_i$ the upper right corner element of $x_i$. From $x_iy_i=t\cdot id$, we have that the upper right corner element of $y_i$ is $-b_i$. From the relation $x^k=y^{n-k}$ it follows that $\sum_{i=1}^{2r}b_i=0$. If $n=6$, $I=\{1,3,5\}$ and $J=\{2,4,6\}$, then our module $\operatorname{\mathbb{M}}\nolimits(I,J)$ is \begin{figure}[h] {\small \begin{center} \hfil \xymatrix@C=5.5em{ V_0\ar@<.8ex>[r]^{\begin{pmatrix} t & b_1 \\ 0 & 1 \end{pmatrix}} &V_1 \ar@<.8ex>[r]^{\begin{pmatrix} 1 & b_2 \\ 0 & t \end{pmatrix}} \ar@<.8ex>[l]^{\begin{pmatrix} 1 & -b_1 \\ 0 & t \end{pmatrix}} & V_2 \ar@<.8ex>[r]^{\begin{pmatrix} t & b_3 \\ 0 & 1 \end{pmatrix}}\ar@<.8ex>[l]^{\begin{pmatrix} t & -b_2 \\ 0 & 1 \end{pmatrix}} & V_3 \ar@<.8ex>[r]^{\begin{pmatrix} 1 & b_4 \\ 0 & t \end{pmatrix}} \ar@<.8ex>[l]^{\begin{pmatrix} 1 & -b_3 \\ 0 & t \end{pmatrix}} &V_4 \ar@<.8ex>[r]^{\begin{pmatrix} t & b_5 \\ 0 & 1 \end{pmatrix}} \ar@<.8ex>[l]^{\begin{pmatrix} t & -b_4 \\ 0 & 1 \end{pmatrix}} &V_5 \ar@<.8ex>[r]^{\begin{pmatrix} 1 & b_6 \\ 0 & t \end{pmatrix}} \ar@<.8ex>[l]^{\begin{pmatrix} 1 & -b_5 \\ 0 & t \end{pmatrix}} &V_0\,\,\,\ar@<.8ex>[l]^{\begin{pmatrix} t & -b_6 \\ 0 & 1 \end{pmatrix}} } \hfil \end{center} } \caption{A module with filtration $\{1,3,5\}\mid \{2,4,6\}$.} \end{figure} The question is how to determine the $b_i$'s so that the module $\mathbb M(I,J)$ is decomposable. In \cite{BBL}, we dealt with the tame cases $(3,9)$ and $(4,8)$, and more generally, the $3$-interlacing case, and we constructed all such modules and given criteria, in terms of divisibility by $t$ of the sums $b_i+b_{i+1}$ (where $i$ is odd), for the constructed module to be indecomposable. Moreover, in the case of a decomposable module, we determined the summands of such a module. In this paper we construct all decomposable modules in the general case of tight $r$-interlacing. We first consider the case $(r,2r)$ and show how the general case reduces to this case. Assume first that $\mathbb M(I,J)$ is decomposable and that $L_J$ is a direct summand of $\mathbb M(I,J)$. Then there exists a retraction $\mu=(\mu_i)_{i=1}^n$ such that $\mu_i\circ \theta_i=id$, where $(\theta_i)_{i=1}^n$ is the natural injection of $L_J$ into $\mathbb M(I,J)$. Using the same basis as before, we can assume that $\mu_i=[1\,\, \alpha_i ]$. From the commutativity relations we have $id\circ \mu_i=\mu_{i+1}\circ x_{i+1}$ for $i$ odd, and $t\cdot id\circ \mu_i=\mu_{i+1}\circ x_{i+1}$ for $i$ even. It follows that $\alpha_i=b_{i+1}+t\alpha_{i+1}$ for $i$ odd, and $t\alpha_i=b_{i+1}+\alpha_{i+1}$ for $i$ even. From this we have \begin{align*} t(\alpha_{2i}-\alpha_{2i+2})&=b_{2i+1}+b_{2i+2}, \end{align*} for $i=0,\dots,r-1$. Thus, if $L_J$ is a direct summand of $\mathbb M(I,J)$, then $t| b_{i}+b_{i+1}$, for $i$ odd, and we can easily find $\alpha_i$, $i=1,\dots,n$, satisfying previous equations. If only one of these divisibility conditions is not met, then $L_J$ is not a direct summand of $\operatorname{\mathbb{M}}\nolimits(I,J)$. Note that if $L_J$ is not a summand of $\operatorname{\mathbb{M}}\nolimits(I,J)$, it does not mean that $M$ is indecomposable (cf.\ Theorem 3.12 in \cite{BBGE}). We will study the structure of the module $\operatorname{\mathbb{M}}\nolimits(I,J)$ in terms of the divisibility conditions the sums $b_i+b_{i+1}$ satisfy. Let us now consider the general case, that is, let $\mathbb M(I,J)$ be the module as defined above, when $I$ and $J$ are tightly $r$-interlacing. Write $I\setminus J$ as $\{i_1,\dots,i_r\}$ and $J\setminus I$ as $\{j_1,\dots,j_r\}$ so that $1\le i_1<j_1<i_2<j_2<\dots<i_r<j_r\le n$. Define \begin{align*} &&&&&&x_{i_{l}}&=\begin{pmatrix} t& b_{2l-1} \\ 0 & 1 \end{pmatrix},& x_{j_{l}}&=\begin{pmatrix} 1& b_{2l} \\ 0 & t \end{pmatrix}, &&&&&\\ &&&&&&y_{i_{l}}&=\begin{pmatrix} 1& -b_{2l-1} \\ 0 & t \end{pmatrix}, &y_{j_{l}}&=\begin{pmatrix} t& -b_{2l} \\ 0 & 1 \end{pmatrix},&&&&& \end{align*} for $l=1,2,\dots, r$ (see previous figure for $n=6$). For $i\in I^c \cap J^c$, we set $x_i=\begin{pmatrix} t & 0 \\ 0 & t \end{pmatrix}$ and $y_i=\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}$. For $i\in I\cap J$, we set $x_i=\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}$ and $y_i=\begin{pmatrix} t & 0 \\ 0 & t \end{pmatrix}$. Also, we assume that $\sum_{l=1}^nb_l=0$. Note that for $i\in (I^c \cap J^c)\cup (I\cap J)$ we define the matrices $x_i$ and $y_i$ to be diagonal, i.e.\ we assume that the upper right corner of $x_i$ and $y_i$ is $0$ if $i\in (I^c \cap J^c)\cup (I\cap J)$. This is because if it were not $0$, then by a suitable base change of the $V_i$, by changing the second basis element, we obtain a scalar matrix. By construction, $xy=yx$ and $x^k=y^{n-k}$ at all vertices, and $\operatorname{\mathbb{M}}\nolimits(I,J)$ is free over the centre of $B_{k,n}$. Hence, the following proposition holds. \begin{prop} The module $\operatorname{\mathbb{M}}\nolimits(I,J)$ as constructed above is in ${\rm CM}(B_{k,n})$. \end{prop} As in the case of the profile $\{1,3,\dots, 2r-1\}\mid \{2,4,\ldots, 2r\}$, $L_J$ is a direct summand of $\operatorname{\mathbb{M}}\nolimits(I,J)$ if and only if $t\mid b_{i}+b_{i+1}$, for all odd $i$. In order to determine the structure of the module $\operatorname{\mathbb{M}}\nolimits(I,J)$ when these divisibility conditions are not fulfilled (i.e., at least one of the sums $b_i+b_{i+1}$ is not divisible by $t$), we determine the structure of an endomorphism of this module. The following proposition is a generalization of Proposition 3.3 in \cite{BBL}. For the rest of the paper, if $t^dv=w$, for a positive integer $d$, then $t^{-d}w$ denotes $v$. \begin{prop} \label{lm:n6-hom} For $n\geq 6$, let $I,J$ be tightly $r$-interlacing, $I\setminus J=\{i_1,\dots,i_r\}$, and $J\setminus I=\{j_1,\dots,j_r\}$, where $1\le i_1<j_1<i_2<j_2<\dots<i_r<j_r\le n$. If $\varphi=( \varphi_i)_{i=1}^n\in$ {\rm End}$(\operatorname{\mathbb{M}}\nolimits(I,J))$, then \begin{align}\label{end} \nonumber \varphi_{j_r}&=\begin{pmatrix}a & b \\ c & d \end{pmatrix},\\ \varphi_{i_{l}}&=\begin{pmatrix}a+(\sum_{g=1}^{2l-1}b_g)t^{-1}c & tb+(d-a)(\sum_{g=1}^{2l-1}b_g)-(\sum_{g=1}^{2l-1}b_g)^2t^{-1}c \\ t^{-1}c& d-(\sum_{g=1}^{2l-1}b_g)t^{-1}c \end{pmatrix},\\ \nonumber \varphi_{j_l}&=\begin{pmatrix}a+(\sum_{g=1}^{2l}b_g)t^{-1}c & b+t^{-1}((d-a)(\sum_{g=1}^{2l}b_g)-(\sum_{g=1}^{2l}b_g)^2t^{-1}c) \\ c& d-(\sum_{g=1}^{2l}b_g)t^{-1}c \end{pmatrix}, \\ \nonumber \varphi_{i}&=\varphi_{i-1}, \,\, \text{for } i\in (I^c \cap J^c)\cup (I\cap J), \end{align} where $l=1,2,\dots, r$, with $a,b,c,d\in \operatorname{\mathbb{C}}\nolimits[|t|]$, and \begin{align} \label{div} \nonumber t&\mid c,\\ t&\mid (d-a)(b_1+b_2)-(b_1+b_2)^2t^{-1}c,\nonumber \\ t&\mid (d-a)(b_1+b_2+b_3+b_4)-(b_1+b_2+b_3+b_4)^2t^{-1}c,\\ \nonumber &\vdots\\ \nonumber t&\mid (d-a)\sum_{i=1}^{r-1}(b_{2i-1}+b_{2i})-(\sum_{i=1}^{r-1}b_{2i-1}+b_{2i})^2t^{-1}c. \nonumber \end{align} \end{prop} \begin{proof} Let $\varphi=(\varphi_1,\dots, \varphi_n)$ be an endomorphism of $\operatorname{\mathbb{M}}\nolimits(I,J)$, where each $\varphi_i$ is an element of $M_2(\operatorname{\mathbb{C}}\nolimits[|t|])$ (matrices over the centre). We use commutativity relations $x_{i+1}\varphi_i = \varphi_{i+1}x_{i+1}$. From $x_{i_1}x_{i_1-1}\cdots x_{j_r+1}\varphi_{j_r} = \varphi_{i_1}x_{i_1}x_{i_1-1}\cdots x_{j_r+1}$, we obtain $x_{i_1}\varphi_{j_r} = \varphi_{i_1}x_{i_1}$. Recall that $x_{i_1-1}, \dots,x_{j_r+1} $ are scalar matrices so they cancel out. If $\varphi_{j_r}=\begin{pmatrix} a & b \\ c & d \end{pmatrix}$ and $\varphi_{i_1}=\begin{pmatrix} e & f \\ g & h \end{pmatrix}$, then $t\mid c$, $e=a+b_1t^{-1}c$, $f=tb+(d-a)b_1-b_1^2t^{-1}c$, $g= t^{-1}c$, and $h=d-b_1t^{-1}c$. The rest is shown in the same way. \begin{center} \xymatrix{ &&V_{j_r}\ar@<.8ex>[rr]^{x_{j_r+1}} \ar@<.1ex>[ddd]_{\varphi_{j_r}} &&V_{j_r+1}\ar@<.8ex>[rr]^{x_{j_r+2}} \ar@<.8ex>[ll]^{y_{j_r+1}} && \cdots \ar@<.8ex>[rr]^{x_{i_1-1}}\ar@<.8ex>[ll]^{y_{j_r+2}} && V_{i_1-1} \ar@<.8ex>[rr]^{\begin{pmatrix} t & b_1 \\ &&0 & 1 \end{pmatrix}} \ar@<.8ex>[ll]^{y_{i_1-1}} &&V_{i_1} \ar@<.8ex>[ll]^{\begin{pmatrix} 1 & -b_1 \\ &&0 & t \end{pmatrix}} \ar@<.1ex>[ddd]_{\varphi_{i_1}}\\ &&&&&&&&&&\\ &&&&&&&&&&\\ &&V_{j_r}\ar@<.8ex>[rr]^{x_{j_r+1}} &&V_{j_r+1} \ar@<.8ex>[rr]^{x_{j_r+2}} \ar@<.8ex>[ll]^{y_{j_r+1}} && \dots \ar@<.8ex>[rr]^{x_{i_1-1}}\ar@<.8ex>[ll]^{y_{j_r+2}} && V_{i_1-1} \ar@<.8ex>[rr]^{\begin{pmatrix} t & b_1 \\ 0 & 1 \end{pmatrix}} \ar@<.8ex>[ll]^{y_{i_1-1}} &&V_{i_1} \ar@<.8ex>[ll]^{\begin{pmatrix} 1 & -b_1 \\ 0 & t \end{pmatrix}}\\ } \end{center} The only thing left to note is that if $i\in (I^c \cap J^c)\cup (I\cap J)$, then $x_i$ is a scalar matrix (either identity or $t$ times identity), so from $x_{i}\varphi_{i-1}=\varphi_{i}x_{i}$, it follows immediately that $\varphi_{i-1}=\varphi_{i}$. \end{proof} By Remark 3.4 in \cite{BBL}, if $\varphi$ is the morphism from the previous proposition, then it is sufficient to prove for a single index $i$ that $\varphi_i$ is idempotent in order to prove that $\varphi$ is idempotent. Also, note that in our computations, for $i\in (I^c \cap J^c)\cup (I\cap J),$ $x_i$ is a scalar matrix, it commutes with every other matrix and it cancels out in $x_{i}\varphi_{i-1}=\varphi_{i}x_{i}$, so it can be left out. We now give necessary and sufficient conditions for the module $\mathbb M(I,J)$ to be indecomposable. \begin{theorem} \label{t6} Let $\operatorname{\mathbb{M}}\nolimits(I,J)$ be as in the previous proposition. The module $\operatorname{\mathbb{M}}\nolimits(I,J)$ is indecomposable if and only if there exist odd indices $i_{l_1}$ and $i_{l_2}$ such that $t\mid b_i+b_{i+1}$, for $i_{l_1}<i<i_{l_2}$, $i$ odd, $t\nmid b_{i_{l_1}}+b_{i_{l_1}+1}$, $t\nmid b_{i_{l_{2}}}+b_{i_{l_{2}}+1}$, and $t\nmid b_{i_{l_1}}+b_{i_{l_1}+1}+b_{i_{l_{2}}}+b_{i_{l_{2}}+1}$. \end{theorem} \begin{proof} As in the proof of the previous proposition, it is sufficient to consider the case of tight $r$-interlacing, where $I=\{1,3,5,\dots,2r-1\}$ and $J=\{2,4,6, \dots, 2r\}$. Let $i_{l_1}, i_{l_2}, \dots, i_{l_s}$ be all odd indices $i$ (in cyclic ordering) such that the sum $b_i+b_{i+1}$ is not divisible by $t$. We assume that there is at least one such index because if $t\mid b_i+b_{i+1}$ for all odd $i$, then $\operatorname{\mathbb{M}}\nolimits(I,J)$ is the direct sum $L_I\oplus L_J$. Let $\varphi=( \varphi_i)_{i=0}^{n-1}\in$ End$(\operatorname{\mathbb{M}}\nolimits(I,J))$ be an idempotent homomorphism and assume that $\varphi_{j_r}=\begin{pmatrix}a & b \\ c & d \end{pmatrix}$. The divisibility conditions (\ref{div}) from the previous proposition reduce to \begin{align} \label{div0} \nonumber t&\mid c, \\ \nonumber t&\mid (d-a)(b_{i_{l_1}}+b_{i_{l_1}+1})-(b_{i_{l_1}}+b_{i_{l_1}+1})^2t^{-1}c, \\ \nonumber t&\mid (d-a)(b_{i_{l_1}}+b_{i_{l_1}+1}+b_{i_{l_2}}+b_{i_{l_2}+1})-(b_{i_{l_1}}+b_{i_{l_1}+1}+b_{i_{l_2}}+b_{i_{l_2}+1})^2t^{-1}c. \\ &\vdots \\ \nonumber t&\mid (d-a)\sum_{g=1}^{s-1}(b_{i_{l_g}}+b_{i_{l_g}+1})-\left(\sum_{g=1}^{s-1}(b_{i_{l_g}}+b_{i_{l_g}+1})\right)^2t^{-1}c.\nonumber \end{align} Without loss of generality we assume that $t\nmid b_{i_{l_1}}+b_{i_{l_1}+1}+b_{i_{l_{2}}}+b_{i_{l_{2}}+1}$. Relations (\ref{div0}) are equivalent to \begin{align*}t&\mid d-a-(b_{l_1}+b_{{l_1}+1})t^{-1}c,\\ t&\mid d-a-(b_{l_1}+b_{{l_1}+1}+b_{l_2}+b_{{l_2}+1})t^{-1}c. \end{align*} Thus, it must hold that $$t\mid (b_{l_2}+b_{{l_2}+1})t^{-1}c,$$ and since $t\nmid b_{l_2}+b_{{l_2}+1}$, it must be that $t\mid t^{-1}c$, and subsequently that $t\mid d-a$. From the fact that $\varphi_{j_r}$ is idempotent and $t\mid c$ it follows that $t\mid a-a^2$ and $t\mid d-d^2$. Also, from $\varphi_{j_r}^2=\varphi_{j_r}$ it follows that either $a=d$ or $a+d=1$. If $a=d$, then $b=c=0$ (otherwise $a=d=\frac 12$ and $\frac 14=bc$, which is not possible as $c$ is divisible by $t$), and $a=d=1$ or $a=d=0$ giving us the trivial idempotents. If $a+d=1$, then $t\mid a$ or $t\mid d$. Taking into account that $t\mid d-a$, we conclude that $t\mid a$ and $t\mid d$. This implies that $1=a+d$ is divisible by $t$, which is not true. Thus, the only idempotent homomorphisms of $\operatorname{\mathbb{M}}\nolimits(I,J)$ are the trivial ones. Hence, $\operatorname{\mathbb{M}}\nolimits(I,J)$ is indecomposable. Assume now that $t\mid b_{i_{l_g}}+b_{i_{l_g}+1}+b_{i_{l_{g+1}}}+b_{i_{l_{g+1}}+1}$ for every $g<s$. Then the divisibility conditions (\ref{div0}) for the endomorphism $\varphi$ reduce to a single condition $$t\mid d-a-(b_{l_1}+b_{{l_1}+1})t^{-1}c.$$ In order to find a non-trivial idempotent $\varphi$, we only need to find elements $a$, $b$, $c$, and $d$ in such a way that $t\mid c$ and $t\mid d-a-(b_{l_1}+b_{{l_1}+1})t^{-1}c.$ Recall that if $a=d$, then we only obtain the trivial idempotents because $t\mid c$. So it must be $a+d=1$ if we want to find a non-trivial idempotent. If we choose $a=1$, $d=0$, then $t\mid 1+(b_{l_1}+b_{{l_1}+1})t^{-1}c$. Thus, we can define $c=t(b_{l_1}+b_{{l_1}+1})^{-1}$, and $b=0$ since $a-a^2=bc$ and $c\neq 0$, to get the idempotent: $$\varphi_{j_r}=\begin{pmatrix} 1& 0\\ -t(b_{l_1}+b_{{l_1}+1})^{-1}&0 \end{pmatrix}.$$ Since this is a non-trivial idempotent, it follows that the module $\operatorname{\mathbb{M}}\nolimits(I,J)$ is decomposable. \end{proof} \begin{rem} From the previous theorem it follows that if $\operatorname{\mathbb{M}}\nolimits(I,J)$ is a decomposable module, then since $\sum_{i=1}^nb_i=0$ there is an even number of odd $i$ such that $t\nmid b_{i}+b_{i+1}.$ If there were an odd number of odd $i$ such that $t\nmid b_{i}+b_{i+1}$, then for two consecutive $l_1$ and $l_2$, it would hold that $t\nmid b_{i_{l_1}}+b_{i_{l_1}+1}+b_{i_{l_{2}}}+b_{i_{l_{2}}+1}.$ Our aim is to determine all such decomposable modules, so for the rest of the paper we will assume that there is an even number of odd indices $i_{l_g}$ such that $t\nmid b_{i_{l_g}}+b_{i_{l_g}+1}$, and that $t\mid b_{i_{l_g}}+b_{i_{l_g}+1}+b_{i_{l_{g+1}}}+b_{i_{l_{g+1}}+1}$ for every $g$. \end{rem} \begin{corollary} If $n<6$, then there are no indecomposable rank $2$ modules in ${\rm CM}(B_{k,n})$. \end{corollary} The rest of the paper is dedicated to the determination of the summands of the module $\operatorname{\mathbb{M}}\nolimits(I,J)$ in the case when this module is decomposable. It is sufficient to study the case of the filtration $\{1,3,\dots, 2r-1\}\mid \{2,4,\dots,2r\}$ when $k=r$ and $n=2r$. Then the general case of tight $r$-interlacing follows because the scalar matrices can be ignored since they do not affect any of the computations we conduct. Denote $I=\{1,3,\dots, 2r-1\}$ and $J=\{2,4,\dots, 2r\}.$ As before, assume that $x_i=\begin{pmatrix} t& b_{i} \\ 0 & 1 \end{pmatrix}$ for odd $i$ and $x_{i}=\begin{pmatrix} 1& b_{i} \\ 0 & t \end{pmatrix}$ for even $i$, and that $\sum_{i=1}^{2r}b_i=0$ so that we have a module structure, which we again denote by $\operatorname{\mathbb{M}}\nolimits(I,J)$. The dimension lattice of a given module in ${\rm CM}(B_{k,n})$ is additive on short exact sequences. If $\operatorname{\mathbb{M}}\nolimits(I,J)$ is the direct sum $L_X\oplus L_Y$, then from the short exact sequence $$0\longrightarrow L_J\longrightarrow L_X\oplus L_Y \longrightarrow L_I \longrightarrow 0$$ follows that the dimension lattices of $L_X$ and $L_Y$ add up to the sum of the dimension lattice of $L_I$ and the dimension lattice of $L_J$. In terms of the rims, one way to combinatorially describe possible summands $L_X$ and $L_Y$ is by the fact that the rim of $X$ has to be ``taken out'' from the lattice diagram of $L_I\oplus L_J$, i.e., of the profile $I\mid J$, in such a way that the leftover part of the lattice diagram is the rim $Y$. In terms of the lattice diagram of the profile $I\mid J$ (recall that we picture the lattice diagram of $I\mid J$ by drawing the rim $J$ below the rim $I$, in such a way that $J$ is placed as far up as possible so that no part of the rim $J$ is strictly above the rim $I$), the rim $X$ corresponds to a subset of the set of the peaks of $I$, and the rim $Y$ corresponds to the complement of this set with respect to the set of peaks of $I$. To describe this in terms of the path we take in the lattice diagram of $I\mid J$ by travelling from left to right, we start from a peak of $I$ and move to the right (we either go up or down in each step). If we are at a peak of $I$ (resp.\ valley of $J$), then the next step has to be down (resp.\ up). If we are at a peak of $J$, which is also a valley of $I$, then we have a choice of going up or down. Eventually, to finish our trip, we have to return to the peak where we started off. The rim $X$ is determined by the set of peaks of $I$ that we passed through during our trip through the lattice diagram of $I\mid J$ (by abuse of notation we say that $X$ passes through this set of peaks), and the rim $Y$ is determined by the peaks of $I$ we did not pass through. The first four pictures in Figure \ref{r4} correspond to the case when $X$ passes through a single peak of $I$ (and $Y$ passes through three peaks) when we travel from left to right through the lattice diagram of $I\mid J$ (or more precisely, through the rims of $I$ and $J$, see the next example). The next three pictures correspond to the case when $X$ passes through two peaks of $I$ (and $Y$ passes through two peaks), and the last picture corresponds to the case when $X$ passes through all peaks of $I$ and $Y$ passes through none. Obviously, there is symmetry in the argument so the case when $X$ passes through one peak and $Y$ through three peaks is the same as the case when $X$ passes through three peaks and $Y$ passes through one peak. In total, there are $2^{r-1}$ different cases, so there are $2^{r-1}$ corresponding decomposable modules. \begin{ex}\label{48} In the case $r=4$, there are eight possible choices for $X$ and $Y$ in such a way that the sum of the dimension lattices of $X$ and $Y$ is equal to the dimension lattice of the profile $I\mid J$ . They are given in Figure \ref{r4}. Note that the set of peaks of $I$ (i.e., the set of valleys of $J$) is $\{0,2,4,6\}$ and the set of peaks of $J$ (i.e., the set of valleys of $I$) is $\{1,3,5,7\}$. \begin{figure}[H] \begin{center} \subfloat[$L_{\{1, 3, 5,6\}}\oplus L_{\{2,4, 7,8\}}$]{\includegraphics[width = 6cm]{1356-2478-2.eps}} \quad \quad\quad\quad \subfloat[$L_{\{1, 2, 4, 6\}}\oplus L_{\{3,5, 7,8 \}}$]{\includegraphics[width = 6cm ]{1246-3578.eps}}\\ \subfloat[$L_{\{1, 2, 5 , 7\}}\oplus L_{\{3,4, 6, 8\}}$]{\includegraphics[width = 6cm ]{1257-3468.eps}} \quad \quad \quad \quad \subfloat[$L_{\{1, 3, 4, 7\}}\oplus L_{\{2,5,6, 8\}}$]{\includegraphics[width = 6cm ]{1347-2568.eps}} \\ \subfloat[$L_{\{1, 3, 4,6\}}\oplus L_{\{2,5, 7,8\}}$]{\includegraphics[width = 6cm]{1346-2578.eps}} \quad \quad\quad\quad \subfloat[$L_{\{1, 2, 4, 7\}}\oplus L_{\{3,5, 6,8 \}}$]{\includegraphics[width = 6cm ]{1247-3568.eps}}\\ \subfloat[$L_{\{1,2,5,6\}}\oplus L_{\{3,4,7,8\}}$]{\includegraphics[width = 6cm]{1256-3478.eps}} \quad \quad \quad \quad \subfloat[$L_{\{1,3,5,7\}}\oplus L_{\{2,4,6,8\}}$]{\includegraphics[width = 5.5cm]{1357-2468.eps}} \caption{The pairs of profiles of decomposable extensions between $ L_{\{1, 3, 5,7\}}$ and $L_{\{2,4, 6,8\}}$.} \label{r4} \end{center} \end{figure} \end{ex} Note that we only classify decomposable modules that are extensions of $L_J$ by $L_I$, not all possible extensions (cf.\ Remark 3.9 in \cite{BBL}). For a given $X$, i.e., for a given subset of the set of peaks of $I$, and the corresponding $Y$, we give the divisibility conditions for the sums $b_i+b_{i+1}$ so that the module $\operatorname{\mathbb{M}}\nolimits(I,J)$ is isomorphic to $L_X\oplus L_Y$. We denote by $X'$ (resp.\ $Y'$) the set of peaks of $I$ that corresponds to $X$ (resp.\ $Y$). If $X$ passes through every peak of $I$, then this is the case when $X=I$ and $Y=J$, i.e., the case of the direct sum $L_I\oplus L_J$. In terms of the divisibility conditions, this is the case when $t\mid b_i+b_{i+1}$, for every odd $i$. Assume now that $X'$ does not contain all peaks of $I$. This means that there is a peak, say $2j$, that belongs to $X'$, such that the next peak $2j+2$ belongs to $Y'$. Then $b_{2j+1}+b_{2j+2}$ is not divisible by $t$. If it were divisible by $t$, then $2j+2$ would belong to $X'$ as we explain below. If the current peak, say $2j$, belongs to $X'$, i.e., we are at the peak $2j$, then if the next peak $2j+2$ belongs to $X'$, then $2j+1\in X$, $2j+1\notin Y$, $2j+2\notin X$, and $2j+2\in Y$. In this situation we are moving from a peak to another peak by going down and then up. Note that we pass through two vertices each time we move from one peak to another. If the current peak $2j$ does not belong to $X'$, i.e., we are at the valley $2j$, then if the next peak $2j+2$ belongs to $X'$, then $2j+1, 2j+2\notin X$, and $2j+1, 2j+2\in Y$. In this situation we are moving from a valley to a peak by going up and up. If the current peak $2j$ belongs to $X'$, i.e., we are at the peak $2j$, then if the next peak $2j+2$ does not belong to $X'$, then $2j+1, 2j+2\in X$, and $2j+1, 2j+2\notin Y$. In this situation we are moving from a peak to a valley by going down and down. If the current peak $2j$ does not belong to $X'$, i.e., we are at the valley $2j$, then if the next peak $2j+2$ does not belong to $X'$, then $2j+1\notin X$, $2j+1\in Y$, $2j+2\in X$, and $2j+2\notin Y$. In this situation we are moving from a valley to another valley by going up and then down. Recall that there has to be an even number of steps where we go from a valley to a peak or from a peak to a valley so that we can come back up to the point where we started. \begin{theorem} \label{paths} Let $X'$ be a subset of the set of peaks of $I$, $\{0,2,4,\dots,2r-2\}$, $Y'$ its complement, and $X$ and $Y$ corresponding $k$-subsets of $[n]$. Also, assume that $1\leq |X'|<r$. Starting from a peak in $X'\setminus Y'$, and moving to the right, define sums $b_i+b_{i+1}$ so that the following conditions hold: \begin{enumerate} \item if the current peak $2j$ belongs to $X'$, then if the next peak $2j+2$ belongs to $X'$, then $t\mid b_{2j+1}+b_{2j+2}$, \item if the current peak $2j$ does not belong to $X'$, then if the next peak $2j+2$ belongs to $X'$, then $t\nmid b_{2j+1}+b_{2j+2}$, \item if the current peak $2j$ belongs to $X'$, then if the next peak $2j+2$ does not belong to $X'$, then $t\nmid b_{2j+1}+b_{2j+2}$, \item if the current peak $2j$ does not belong to $X'$, then if the next peak $2j+2$ does not belong to $X'$, then $t\mid b_{2j+1}+b_{2j+2}$. \end{enumerate} Additionally, we assume that $t\mid b_{i_1}+b_{i_1+1}+b_{i_2}+b_{i_2+1}$ for every two consecutive odd indices $i_1$ and $i_2$ such that $t\nmid b_{i_l}+b_{i_{l+1}}$, $l=1,2$. Then the module $\mathbb{M}(I,J)$ is isomorphic to the direct sum $L_X\oplus L_Y$. \end{theorem} \begin{proof} By Theorem \ref{t6}, the module is decomposable. We start our path at a peak from $X'\setminus Y'$. Assume without loss of generality that this peak is 0 and that the next peak 2 does not belong to $X'$. This means that $t\nmid b_{1}+b_{2}$. Define an idempotent $\varphi_{0}=\begin{pmatrix} 1& 0\\ -t(b_{1}+b_{2})^{-1}&0 \end{pmatrix}.$ Its orthogonal complement is the idempotent $ \tilde{\varphi}_{0}=\begin{pmatrix} 0& 0\\ t(b_{1}+b_{2})^{-1}&1 \end{pmatrix}.$ From (\ref{end}) we easily compute other idempotents $\varphi_i$. If we denote by $B_l$ the sum $\sum_{i=1}^lb_i,$ then for odd indices we get $$ \varphi_{2j+1}=\begin{pmatrix}1-B_{2j+1}(b_1+b_{2})^{-1} & -B_{2j+1}+B_{2j+1}^2(b_1+b_{2})^{-1} \\ -(b_1+b_{2})^{-1}& -B_{2j+1}(b_1+b_{2})^{-1} \end{pmatrix},$$ $$\tilde{\varphi}_{2j+1}=\begin{pmatrix}B_{2j+1}(b_1+b_{2})^{-1} & B_{2j+1}(1-B_{2j+1}(b_1+b_{2})^{-1}) \\ (b_1+b_{2})^{-1}& 1-B_{2j+1}(b_1+b_{2})^{-1} \end{pmatrix}, $$ and for even indices $$ \varphi_{2j}=\begin{pmatrix}1-B_{2j}(b_1+b_{2})^{-1} & -t^{-1}B_{2j}(1-B_{2j}(b_1+b_{2})^{-1}) \\ -t(b_1+b_{2})^{-1}& B_{2j}(b_1+b_{2})^{-1} \end{pmatrix},$$ $$\tilde{\varphi}_{2j}=\begin{pmatrix}B_{2j}(b_1+b_{2})^{-1} & t^{-1}B_{2j}(1-B_{2j}(b_1+b_{2})^{-1}) \\ t(b_1+b_2)^{-1}& 1-B_{2j}(b_1+b_{2})^{-1}\end{pmatrix}. $$ Let $v_i$ (resp.\ $w_i$) be the eigenvector of $\varphi_{i}$ (resp.\ $\tilde{\varphi}_{i}$) corresponding to the eigenvalue $1$. The vectors $w_i$ (resp.\ $v_i$) form a basis for $L_X$ (resp.\ $L_Y$). We compute directly these eigenvectors. For an odd index we have $$ w_{2j+1}=\begin{pmatrix} B_{2j+1}\\ 1 \end{pmatrix}, \quad \quad \quad v_{2j+1}=\begin{pmatrix} 1-B_{2j+1}(b_1+b_2)^{-1}\\ -(b_1+b_2)^{-1} \end{pmatrix}. $$ Since $t\mid b_{i_1}+b_{i_1+1}+b_{i_2}+b_{i_2+1}$, for every two consecutive odd indices $i_1$ and $i_2$ such that $t\nmid b_{i_l}+b_{i_l+1}$, $l=1,2$, when computing $w_{2j}$ and $v_{2j}$ we have to distinguish between the following cases. Let $g$ be the number of indices in the set $[1,j]$ such that $t\nmid b_{2j-1}+b_{2j}$. If $g$ is even (resp.\ odd), then $t\mid B_{2j}$ (resp.\ $t\nmid B_{2j}$). Therefore, if $g$ is even, i.e., if $B_{2j}$ is divisible by $t$, then $$ w_{2j}=\begin{pmatrix} t^{-1}B_{2j}\\ 1 \end{pmatrix}, \quad \quad \quad v_{2j}=\begin{pmatrix} 1-B_{2j}(b_1+b_2)^{-1}\\ -t(b_1+b_2)^{-1} \end{pmatrix}. $$ If $g$ is odd, i.e., if $B_{2j}$ is not divisible by t (more precisely, $B_{2j}=b_1+b_2+tz$, for some $z$), then $$ w_{2j}=\begin{pmatrix} B_{2j}\\t \end{pmatrix}, \quad \quad \quad v_{2j}=\begin{pmatrix} t^{-1}(1-B_{2j}(b_1+b_2)^{-1})\\ -(b_1+b_2)^{-1} \end{pmatrix}. $$ Combinatorially, $g$ is even (resp.\ odd) if and only if we are positioned at a peak (resp.\ valley) $2j$ after $(2j)$th step. This follows from the fact that $t\nmid b_{2j-1}+b_{2j}$ means that we are moving either from a peak to a valley, or from a valley to a peak. Since we started from a peak, if we are currently at a peak $2j$, then this means that we had an even number of the moves that correspond to the sums $b_{2i-1}+b_{2i}$ that are not divisible by $t$. Consider the eigenvectors $v_0=[1\,\, ,\,\, -t(b_1+b_2)^{-1}]^t$, $w_0=[0\,\, ,\,\, 1]^t$ for $\varphi_0$ and its orthogonal complement. Then $x_1w_0=w_1$ and $x_2w_1=w_2$, so $1,2\in X$. Also, $x_1v_0=tv_1$ and $x_2v_1=tv_2$, so $1,2\notin Y$. We continue by moving to the right and consider the four cases from the statement of the theorem. Case 1: If the current peak $2j$ belongs to $X'$, then if the next peak $2j+2$ belongs to $X'$, then $t\mid b_{2j+1}+b_{2j+2}$. In this situation we are moving from a peak to another peak by going down and then up. Here, $t\mid B_{2j}$ and $t\mid B_{2j+2}$. Since $w_{2j}=\begin{pmatrix} t^{-1}B_{2j}\\1 \end{pmatrix},$ $w_{2j+1}=\begin{pmatrix} B_{2j+1}\\ 1 \end{pmatrix},$ and $w_{2j+2}=\begin{pmatrix} t^{-1}B_{2j+2}\\1 \end{pmatrix},$ it follows that $x_{2j+1}w_{2j}=w_{2j+1}$ and $x_{2j+2}w_{2j+1}=tw_{2j+2}$. Therefore, $2j+1\in X$ and $2j+2\notin X$. Analogously, $x_{2j+1}v_{2j}=tv_{2j+1}$ and $x_{2j+2}v_{2j+1}=v_{2j+2}$. Therefore, $2j+1\notin Y$ and $2j+2\in Y$. Case 2: If the current peak $2j$ does not belong to $X'$, then if the next peak $2j+2$ belongs to $X'$, then $t\nmid b_{2j+1}+b_{2j+2}$ and we are moving from a valley to a peak. Here, $t\nmid B_{2j}$ and $t\mid B_{2j+2}$. In this case $w_{2j}=\begin{pmatrix} B_{2j}\\t \end{pmatrix},$ $w_{2j+1}=\begin{pmatrix} B_{2j+1}\\ 1\end{pmatrix},$ and $w_{2j+2}=\begin{pmatrix} t^{-1}B_{2j+2}\\1 \end{pmatrix}.$ It follows that $x_{2j+1}w_{2j}=tw_{2j+1}$ and $x_{2j+2}w_{2j+1}=tw_{2j+2}$. Therefore, $2j+1\notin X$ and $2j+2\notin X$. Analogously, $x_{2j+1}v_{2j}=v_{2j+1}$ and $x_{2j+2}v_{2j+1}=v_{2j+2}$. Therefore, $2j+1\in Y$ and $2j+2\in Y$. Case 3: If the current peak $2j$ belongs to $X'$, then if the next peak $2j+2$ does not belong to $X'$, then $t\nmid b_{2j+1}+b_{2j+2}$ and we move from a peak to a valley. Here, $t\mid B_{2j}$ and $t\nmid B_{2j+2}$. In this case $w_{2j}=\begin{pmatrix} t^{-1}B_{2j}\\1 \end{pmatrix},$ $w_{2j+1}=\begin{pmatrix} B_{2j+1}\\ 1\end{pmatrix},$ and $w_{2j+2}=\begin{pmatrix} B_{2j+2}\\t \end{pmatrix}.$ It follows that $x_{2j+1}w_{2j}=w_{2j+1}$ and $x_{2j+2}w_{2j+1}=w_{2j+2}$. Therefore, $2j+1\in X$ and $2j+2\in X$. Analogously, $x_{2j+1}v_{2j}=tv_{2j+1}$ and $x_{2j+2}v_{2j+1}=tv_{2j+2}$. Therefore, $2j+1\notin Y$ and $2j+2\notin Y$. Case 4: If the current peak $2j$ does not belong to $X'$, then if the next peak $2j+2$ does not belong to $X'$, then $t\mid b_{2j+1}+b_{2j+2}$ and we move from a valley to a valley. Here, $t\nmid B_{2j}$ and $t\nmid B_{2j+2}$. In this case $w_{2j}=\begin{pmatrix} B_{2j}\\t \end{pmatrix},$ $w_{2j+1}=\begin{pmatrix} B_{2j+1}\\ 1\end{pmatrix},$ and $w_{2j+2}=\begin{pmatrix} B_{2j+2}\\t \end{pmatrix}.$ It follows that $x_{2j+1}w_{2j}=tw_{2j+1}$ and $x_{2j+2}w_{2j+1}=w_{2j+2}$. Therefore, $2j+1\notin X$ and $2j+2\in X$. Analogously, $x_{2j+1}v_{2j}=v_{2j+1}$ and $x_{2j+2}v_{2j+1}=tv_{2j+2}$. Therefore, $2j+1\in Y$ and $2j+2\notin Y$. \end{proof} \begin{ex} Consider Figure (f) from Example \ref{48} (see Figure \ref{48}). \begin{figure}[H] \begin{center} {\includegraphics[width = 8cm ]{1247-3568.eps}}\\ \caption{A pair of profiles for $L_{\{1, 2, 4, 7\}}\oplus L_{\{3,5, 6,8 \}}$} \label{48} \end{center} \end{figure} Here, $X=\{1,2,4,7\}$, $X'=\{0,6\}$, $Y=\{3,5,6,8\}$, and $Y'=\{2,4\}$. Define $b_i$, $i=1,\dots, 8$, as follows. We start at the peak 0, and we travel to the right by going through two points at each step. We first reach valley 2 by going down and down. Here, $t\nmid b_1+b_2$ because of the third condition from the previous theorem. Then we reach valley 4 by going up and down. Here, $t\mid b_3+b_4$ because of the fourth condition from the previous theorem. Next, we reach peak 6 by going up and up. By the second condition from the previous theorem, it must be $t\nmid b_5+b_6$. Finally, we come back to the starting peak 0 by going down and then up. As stated in the first condition of the previous theorem, we have that $t\mid b_7+b_8$. Therefore, if $t\nmid b_1+b_2$, $t\mid b_3+b_4$, $t\nmid b_5+b_6$, and $t\mid b_7+b_8$, then the module $\mathbb M(I,J)$ is isomorphic to $L_{\{1, 2, 4, 7\}}\oplus L_{\{3,5, 6,8 \}}$. Note that we also have to make sure that $\sum_{i=1}^8b_i=0$. For example, we can set $b_1+b_2=-(b_5+b_6)=1$ and $b_3+b_4=-(b_7+b_8)=t$. \end{ex} \begin{rem}It is not too difficult to generalize Theorem \ref{paths}, by taking analogous paths in the lattice diagram, to the general case when the layers of the profile $I\mid J$ are $r_1$-interlacing for some $r_1\ge 3$, and the profile $I\mid J$ has $r$ boxes, with poset $1^r\mid 2$ (we refer the reader to \cite{BBL} for details on the notion of a box, the poset of a profile, and a branching point of a profile). In the next example we demonstrate how the decomposable extensions look like for a rank 2 module in the tame case $(4,8)$. The path is analogous to the path in the tight interlacing case, at each branching point (a point where the rims meet) we have an option to either go up or down. This path uniquely determines the summands $L_X$ and $L_Y$. \end{rem} \begin{ex} \cite[Example 4.5]{BBL} To construct decomposable modules with the profile $\{2,4,7,8\}\mid \{1,3,5,6\}$ we define $x_i=\begin{pmatrix} t& b_{i} \\ 0 & 1 \end{pmatrix}$, $y_i=\begin{pmatrix} 1& -b_{i} \\ 0 & t \end{pmatrix},$ for $i=2,4,7,8$ and $x_{i}=\begin{pmatrix} 1& b_{i} \\ 0 & t \end{pmatrix},$ $y_i=\begin{pmatrix} t& -b_{i} \\ 0 & 1 \end{pmatrix},$ for $i=1,3,5,6$, and assume that $b_1+b_2+b_3+b_4+b_5+b_8+t(b_6+b_7)=0.$ Denote this module again by $\operatorname{\mathbb{M}}\nolimits(I,J)$. It is easily seen that $L_J$ is a summand of $\operatorname{\mathbb{M}}\nolimits(I,J)$ if and only if $t\mid b_8+b_1$, $t\mid b_2+b_3$, and $t\mid b_4+b_5$. The module $\operatorname{\mathbb{M}}\nolimits(I,J)$ is indecomposable if and only if $t\nmid b_2+b_3$, $t\nmid b_4+b_5$, $t\nmid b_8+b_1$. If $t\nmid b_2+b_3$, $t\mid b_4+b_5$, $t\nmid b_8+b_1$, then $\operatorname{\mathbb{M}}\nolimits(I,J)$ is isomorphic to $L_{\{2,3,5,6\}}\oplus L_{\{1,4,7,8\}}$. If $t\mid b_2+b_3$, $t\nmid b_4+b_5$, $t\nmid b_8+b_1$, then $\operatorname{\mathbb{M}}\nolimits(I,J)$ is isomorphic to $L_{\{2,4,5,6\}}\oplus L_{\{1,3,7,8\}}$. If $t\nmid b_2+b_3$, $t\nmid b_4+b_5$, $t\mid b_8+b_1$, then $\operatorname{\mathbb{M}}\nolimits(I,J)$ is isomorpic to $L_{\{2,3,7,8\}}\oplus L_{\{1,4,5,6\}}$. Thus, there are four different decomposable modules appearing as the middle term in a short exact sequence that has $L_I$ (as a quotient) and $L_J$ (as a submodule) as end terms. The {pairs of profiles} of the four modules that appear in the middle in these short exact sequences can be pictured as follows. \begin{figure}[H] \begin{center} \subfloat[$L_{\{1, 3, 5,6\}}\oplus L_{\{2,4, 7,8\}}$]{\includegraphics[width = 6cm]{1356-2478.eps}} \quad \quad \quad \quad \subfloat[$L_{\{1, 4, 7,8\}}\oplus L_{\{2,3,5, 6\}}$]{\includegraphics[width = 6cm ]{1478-2356.eps}}\\ \subfloat[$L_{\{1, 3, 7,8\}}\oplus L_{\{2,4, 5, 6\}}$]{\includegraphics[width = 6cm ]{1378-2456.eps}} \quad \quad \quad \quad \subfloat[$L_{\{2,3,7,8\}} \oplus L_{\{1, 4, 5,6\}} $]{\includegraphics[width = 6cm ]{1456-2378.eps}} \caption{{The pairs of} profiles of decomposable extensions between $ L_{\{1, 3, 5,6\}}$ and $L_{\{2,4, 7,8\}}$.} \end{center} \end{figure} \end{ex}
\section{Introduction} Let ${\mathbf{k}}$ be an algebraically closed field. In this paper, most of the time (from Section 2 to Section 4), we are mainly interested in the case ${\rm char}\, {\mathbf{k}}>0$. Many problems in arithmetic dynamics, such as Dynamical Mordell-Lang conjecture, Zariski dense orbit conjecture are proposed in characteristic $0$. Indeed, their original statements do not hold in positive characteristic. But their known counter-examples often involve some Frobenius actions or some group structures. We suspect that the original statement of these conjecture still valid for ``general" dynamical systems in positive characteristic. \medskip The $p$-adic interpolation lemma (\cite[Theorem 1]{Poonen2014} and \cite[Theorem 3.3]{Bell2010}) is a fundamental tool in arithmetic dynamics. It has important applications in Dynamical Mordell-Lang and Zariski dense orbit conjecture \cite{Bell2016, Bell2010, Amerik2008, E.Amerik2011, Xie2019}. But this lemma does not work in positive characteristic. Because this, some very basic cases of Dynamical Mordell-Lang and Zariski dense orbit conjecture are still open in positive characteristic. We hope that some corollaries of the $p$-adic interpolation lemma still survive in positive characteristic. For this, I propose the following conjecture. \begin{con}Set $K:=\overline{{\mathbb F}_p}((t))$ and $K^{\circ}=\overline{{\mathbb F}_p}[[t]]$ its valuation ring. Let $f: (K^{\circ})^r\to (K^{\circ})^r$ be an analytic automorphism satisfying $f={\rm id} \mod t.$ If there is no $n\geq 1$ such that $f^n={\rm id}$, then the $f$-periodic points are not dense in $(K^{\circ})^r$ w.r.t. $t$-adic topology. \end{con} On the other hand, we observed that, under certain assumption on the complexity of $f$, a global argument using height can be used to replace the local argument using the $p$-adic interpolation lemma. We generalise the notion of arithmetic degree and prove some basic properties of it in positive characteristic. In particular, we generalise Kawaguchi-Silverman-Matsuzawa's upper bound for arithmetic degree \cite[Theorem 1.4]{Matsuzawa2020a} in positive characteristic. With such notion, we apply our observation to dynamical system in positive characteristic. In particular, we prove the Dynamical Mordell-Lang and Zariski dense orbit conjecture in some cases (see Section \ref{subintrodml} and \ref{subintrozdo}). \medskip Another aim of this paper is to study the ergodic theory on algebraic variety w.r.t constructible topology. Using this, we get some equidistribution reults and apply them to get some weak verisons of Dynamical Mordell-Lang, Manin-Mumford conjecture in arbitrary characteristic. This also gives some applications for equidistributions on Berkovich spaces. \subsection{Dynamical Mordell-Lang conjecture}\label{subintrodml} Let $X$ be a variety over ${\mathbf{k}}$ and $f: X\dashrightarrow X$ be a rational self-map. \begin{defi} We say $(X,f)$ satisfies the \emph{DML} property if for every $x\in X({\mathbf{k}})$ whose $f$-orbit is well defined and every subvariety $V$ of $X$, the set $\{n\geq 0|\,\, f^n(x)\in V\}$ is a finite union of arithmetic progressions. \end{defi} Here an arithmetic progression is a set of the form $\{an + b|\,\, n\in {\mathbb N}\}$ with $a,b \in {\mathbb N}$ possibly with $a = 0$. \begin{dmlcon}If ${\rm char}\,{\mathbf{k}}=0$, then $(X,f)$ satisfies the DML property. \end{dmlcon} It was proved when $f$ is unramified \cite{Bell2010} and when $f$ is an endomorphism of ${\mathbb A}^2_{\overline{{\mathbb Q}}}$ \cite{Xie2017a}. See \cite{Bell2016, Ghioca2018} for other known results. In general, this conjecture does not hold in positive characteristic. An example is \cite[Example 3.4.5.1]{Bell2016} as follows (see \cite{Ghioca2019a,Corvaja2021} for more examples). \begin{exe}\label{exenotdml} Let ${\mathbf{k}}=\overline{{\mathbb F}_p(t)}$, $f: {\mathbb A}^2\to {\mathbb A}^2$ be the endomorphism defined by $(x,y)\mapsto (tx, (1-t)y).$ Set $V:=\{x-y=0\}$ and $e=(1,1).$ Then $\{n\geq 0|\,\, f^n(e)\in V\}=\{p^n|\,\, n\geq 0\}.$ \end{exe} In \cite[Conjecture 13.2.0.1]{Bell2016}, Ghioca and Scanlon proposed a variant of the Dynamical Mordell-Lang conjecture in positive characteristic (=$p$-DML), which asked $\{n\geq 0|\,\, f^n(x)\in V\}$ to be a finite union of arithmetic progressions along with finitely many sets taking form $$\{\sum_{i=1}^mc_ip^{l_in_i}|\,\, n_i\in {\mathbb Z}_{\geq 0}, i=1,\dots,m\}$$ where $m\in {\mathbb Z}_{>1}, k_i\in {\mathbb Z}_{\geq 0}, c_i\in {\mathbb Q}.$ See \cite{Ghioca2019a,Corvaja2021} for known results of $p$-DML. However, we suspect that for a ``general" dynamical system in positive characteristic still has the DML property. \begin{thm}\label{dmlsurface}Let $X$ be a projective surface over ${\mathbf{k}}.$ Let $f: X\to X$ be an automorphism. Assume that $\lambda_1(f)>1$. Then the pair $(X,f)$ satisfies the DML property. \end{thm} Here $\lambda_i(f)$ is the $i$-th dynamical degree of $f$ (see Section \ref{subsectiondydeg}). The following is a similar result for birational endomorphisms of ${\mathbb A}^2.$ In \cite[Theorem A]{Xie2014}, it is stated in characteristic $0$. But when $\lambda_1(f)>1$, its proof works in any characteristic. \begin{thm}\cite[Theorem A]{Xie2014}\label{thmdmlat} Let $f:{\mathbb A}^2\to {\mathbb A}^2$ be a birational endomorphism over ${\mathbf{k}}$. If $\lambda_1(f)>1$, $({\mathbb A}^2,f)$ satisfies the DML property. \end{thm} \subsection{Zariski dense orbit conjecture}\label{subintrozdo} Let $X$ be a variety over ${\mathbf{k}}$ and $f: X\dashrightarrow X$ be a dominant rational self-map. Denote by ${\mathbf{k}}(X)^f$ the field of $f$-invariant rational functions on $X.$ Let $X_f({\mathbf{k}})$ is the set of $X({\mathbf{k}})$ whose orbit is well-defined. For $x\in X_f({\mathbf{k}})$, $O_f(x)$ is the orbit of $x.$ \begin{defi} We say $(X,f)$ satisfies the \emph{SZDO} property if there is $x\in X_f({\mathbf{k}})$ such that $O_f(x)$ is Zariski dense in $X.$ We say $(X,f)$ satisfies the \emph{ZDO} property if either ${\mathbf{k}}(X)^f\neq {\mathbf{k}}$ or it satisfies SZDO property. \end{defi} The Zariski dense orbit conjecture was proposed by Medvedev and Scanlon \cite[Conjecture 5.10]{Medvdevv1}, by Amerik, Bogomolov and Rovinsky \cite{E.Amerik2011} and strengthens a conjecture of Zhang \cite{zhang}. \begin{zdocon}\label{conexistszdo}If ${\rm char}\,{\mathbf{k}}=0$, then $(X,f)$ satisfies the ZDO property. \end{zdocon} This conjecture was proved for endomorphisms of projective surfaces \cite{Jia2020, Xie2019}, endomorphisms of $(\P^1)^N$ \cite{Medvdev,Xie2019} and endomorphisms of ${\mathbb A}^2$ \cite{Xie2017}. See \cite{Amerik2008,Amerik,E.Amerik2011,Fakhruddin2014,Bell2017,Bell2017a,Ghioca2017a,Ghioca2018b,Ghioca2019, Bell, Jia2021} for other known results. \medskip The original statement of Zariski dense orbit conjecture is not true in characteristic $p>0$. It is completely wrong over ${\mathbf{k}}=\overline{{\mathbb F}_p}$ and has counter-examples even when $\text{tr.d.}_{\overline{F_p}} {\mathbf{k}}\geq 1$ (see \cite[Section 1.6]{Xie2019} and \cite[Remark 1.2]{Ghioca}). Concerning the variants of the Zariski dense orbit conjecture in positive characteristic proposed in \cite[Section 1.6]{Xie2019} and \cite[Conjecture 1.3]{Ghioca}, we get the following result. \begin{pro}\label{protautzdo}Let $K$ be an algebraically closed field extension of ${\mathbf{k}}$ with $\text{tr.d.}_{{\mathbf{k}}}K\geq \dim X$. Then $(f_K,X_K)$ satisfies the ZDO property. Here $X_{K}$ and $f_K$ are the base change by $K$ of $X$ and $f.$ \end{pro} The following example shows that the assumption $\text{tr.d.}_{{\mathbf{k}}}K\geq \dim X$ is sharp. \begin{exe}Let $X$ be a variety over ${\mathbf{k}}:=\overline{{\mathbb F}_p}$ of dimension $d\geq 1$. Assume that $X$ is defined over ${\mathbb F}_p$. Let $F: X\to X$ be the Frobenius endomorphism. It is clear that $\overline{{\mathbb F}_p}(X)^F=\overline{{\mathbb F}_p}$. For every algebraically closed field extension $K$ of ${\mathbf{k}}$ with $\text{tr.d.}_{{\mathbf{k}}}K\leq d-1$, and every $x\in X_K(K)$, $O_{F_K}(x)$ is not Zariski dense in $X_K.$ \end{exe} On the other hand, the known counter-examples often involve some Frobenius actions. See \cite[Theorem 1.5, Question 1.7]{Ghioca} for this phenomenon. We suspect that when $\text{tr.d.}_{\overline{{\mathbb F}_p}} {\mathbf{k}}\geq 1,$ a ``general" dynamical system in positive characteristic still have the ZDO property. Applying arguments using height, we get the following results. \begin{thm}\label{thmendononpre}Assume that ${\rm char}\, {\mathbf{k}}=p>0$ and $\text{tr.d.}_{\overline{F_p}} {\mathbf{k}}\geq 1.$ Let $f: X\to X$ be a dominant endomorphism of a projective variety. If $\lambda_1(f)>1$, then for every nonempty Zariski open subset $U$ of $X$, there is $x\in U({\mathbf{k}})$ with infinite orbit and $O_f(x)\subseteq U$. \end{thm} Theorem \ref{thmendononpre} can be viewed as a weak version of \cite[Corollary 9]{Amerik} in positive characteristic. \begin{thm}\label{thmzdosuraut}Assume that ${\rm char}\, {\mathbf{k}}=p>0$ and $\text{tr.d.}_{\overline{F_p}} {\mathbf{k}}\geq 1.$ Let $f: X\to X$ be an automorphism of a projective surface. Then $(X,f)$ satisfies the ZDO property. \end{thm} The following result is a generalization of \cite[Theorem 1.12 (iii)]{Jia2021} in positive characteristic. \begin{thm}\label{thmzdola}Assume that ${\rm char}\, {\mathbf{k}}=p>0$ and $\text{tr.d.}_{\overline{F_p}} {\mathbf{k}}\geq 1.$ Let $f: X\to X$ be a dominant endomorphism of a projective variety. Assume that $X$ is smooth of dimension $d\geq 2$, and $\lambda_1(f)>\max_{i=2}^d \{\lambda_{i}(f)\}$. Then $(X,f)$ satisfies the SZDO property. \end{thm} \subsection{Ergodic theory}\label{subsecergo} Let $X$ be a variety over ${\mathbf{k}}$. Denote by $|X|$ the underling set of $X$ with the constructible topology i.e. the topology on a $X$ generated by the constructible subsets (see~\cite[Section~(1.9) and in particular (1.9.13)]{EGA-IV-I}). In particular every constructible subset is open and closed. This topology is finer than the Zariski topology on $X.$ Moreover $|X|$ is (Hausdorff) compact. Denote by ${\mathcal M}(|X|)$ the space of Radon measures on $X$ endowed with the weak-$\ast$ topology. \begin{thm}\label{thmRadon}Every $\mu\in {\mathcal M}(|X|)$ takes form $$\mu=\sum_{i\geq 0}a_i\delta_{x_i}$$ where $\delta_{x_i}$ is the Dirac measure at $x_i\in X$, $a_i\geq 0$. \end{thm} \begin{rem}Theorem \ref{thmRadon} is inspired by \cite[Theorem A]{Gignac2014}. In \cite[Theorem A]{Gignac2014}, Gignac worked on the Zariski topology, which is not Hausdorff. Here, we use the constructible topology systematically. We think that the constructible topology is the right topology for studying ergodic theory in algebraic dynamics. For example, using constructible topology, we may avoid the conception of finite signed Borel measure used in \cite[Theorem A]{Gignac2014}. Instead of it, we use the more standard notion of Radon measure. \end{rem} A sequence $x_n\in X, n\geq 0$ is said to be \emph{generic}, if every subsequence $x_{n_i}, i\geq 0$ is Zariski dense in $X.$ \begin{cor}\label{corgenericseqence}A sequence $x_n\in X, n\geq 0$ is generic if and only if $$\lim_{n\to \infty}\delta_{x_n}=\delta_{\eta},$$ where $\eta$ is the generic point of $X.$ \end{cor} \medskip Let $f: X\dashrightarrow X$ be a dominant rational self-map. Set $|X|_f:=|X|\setminus (\cup_{i\geq 1}I(f^i)).$ Because every Zariski closed subset of $X$ is open and closed in the constructible topology, $|X|_f$ is a closed subset of $|X|.$ The restriction of $f$ to $|X|_f$ is continuous. We still denote by $f$ this restriction. \medskip \subsubsection{DML problems} Applying Corolary \ref{corgenericseqence}, the dynamical Moredell-Lang conjecture can be interpreted as the following equidistribution statement: \begin{dmlcon}[DML in form of equidistribution] For $x\in X_f({\mathbf{k}})$, if $O_f(x)$ is Zariski dense in $X$, then $$\lim_{n\to \infty}\delta_{f^n(x)}=\delta_{\eta}.$$ \end{dmlcon} \begin{rem} Here the assumption that $O_f(x)$ is Zariski dense in $X$ does not cause any problem. Because after replacing $x$ by some $f^m(x)$ and $f$ by a suitable iterate, we may assume that $\overline{O_f(x)}$ is irreducible. Then after replacing $X$ by $\overline{O_f(x)}$, we may assume that $O_f(x)$ is Zariski dense in $X$. \end{rem} \medskip Using Theorem \ref{thmRadon}, we give a fast proof of the weak dynamical Mordell-Lang. Same result was proved in \cite[Corollary 1.5]{Bell2015} (see also \cite[Theorem 2.5.8]{Favre2000a}, \cite[Theorem D, Theorem E]{Gignac2014}, \cite[Theorem 2]{Petsche2015}, \cite[Theorem 1.10]{Bell2020}). \begin{thm}[Weak DML]\label{thmdml} Let $x$ be a points $\in X_f({\mathbf{k}})$ with $\overline{O_f(x)}=X.$ Let $V$ be a proper subvariety of $X$. Then $\{n\geq 0|\,\, f^n(x)\in V\}$ is of Banach density zero in ${\mathbb Z}_{\geq 0}$ i.e. for every sequence of intervals $I_n, n\geq 0$ in ${\mathbb Z}_{\geq 0}$ with $\lim_{n\to \infty}\# I_n=+\infty$, we have $$\lim_{n\to \infty}\frac{\#(\{n\geq 0|\,\, f^n(x)\in V\}\cap I_n)}{\#I_n}=0.$$ \end{thm} We also prove the weak dynamical Mordell-Lang for coherent backward orbits. A slightly weaker version was proved in \cite[Theorem F]{Gignac2014}. This can be viewed as a weak version of \cite[Conjecture 1.5]{Xie2018}. \begin{thm}[Weak DML for coherent backward orbits]\label{thmdmlback} Let $x_n \in X_f({\mathbf{k}}), n\leq 0$ be a sequence of points such that $\overline{\{x_n, n\leq 0\}}=X$ and $f(x_n)=x_{n+1}$ for all $n\leq -1.$ Let $V$ be a proper subvariety of $X$. Then $\{n\leq 0|\,\, x_n\in V\}$ is of Banach density zero in ${\mathbb Z}_{\leq 0}$ \end{thm} \subsubsection{Backward orbits} Now assume that $f: X\to X$ is a flat and finite endomorphism. Let $d_f:=[{\mathbf{k}}(X)/f^*{\mathbf{k}}(X)]$ be topological degree of $f$. It is just the $(\dim X)$-th dynamical degree of $f$. \medskip Recall that for every $x\in X$, the multiplicity of $f$ at $x$ is $$m_f(x):=\dim_{\kappa(f(x))}(O_{X,x}/m_{f(x)}O_{X,x})\in {\mathbb Z}_{\geq 1}$$ where $O_{X,x}$ is viewed as an $O_{X,f(x)}$-module via $f$. For every $x\in X$, we have $\sum_{y\in f^{-1}(x)}m_f(y)=d_f$ (see \cite[Theorem 2.4]{Gignac2014a}). \medskip In Section \ref{subsecfunct}, we define a natural pullback $f^*: {\mathcal M}(X)\to {\mathcal M}(X)$ which is continuous and for every $x\in X$, $$f^*\delta_x=\sum_{y\in f^{-1}(x)}m_f(y)\delta_y.$$ We get the following equidistribution result. \begin{thm}\label{thmequpullback}Let $f: X\to X$ be a flat and finite endomorphism. Let $x\in X({\mathbf{k}})$ with $\overline{\cup_{i\geq 0}f^{-i}(x)}=X.$ Then for every sequence of intervals $I_n, n\geq 0$ in ${\mathbb Z}_{\geq 0}$ with $\lim_{n\to \infty}\# I_n=+\infty$, we have $$\lim_{n\to \infty}\frac{1}{\#I_n}(\sum_{i\in I_n}d_f^{-i}(f^i)^*\delta_{x})=\delta_{\eta}.$$ \end{thm} \begin{rem}The assumption $\overline{\cup_{i\geq 0}f^{-i}(x)}=X$ is necessary. Otherwise, $$\frac{1}{\#I_n}(\sum_{i\in I_n}d_f^{-i}(f^i)^*\delta_{x}), n\geq 0$$ are supported on the proper closed subset $\overline{\cup_{i\geq 0}f^{-i}(x)}$ of $X.$ \end{rem} \medskip Applying Theorem \ref{thmequpullback}, we count the preimages of a point without multiplicities. \begin{thm}\label{thmcountprestr}Let $f: X\to X$ be a flat and finite endomorphism. Assume that the field extension ${\mathbf{k}}(X)/f^*{\mathbf{k}}(X)$ is separable. Let $x\in X({\mathbf{k}})$ be a point with $\overline{\cup_{i\geq 0}f^{-i}(x)}=X.$ For $c\in (0,1]$, $n\geq 0,$ define $$S^n_c:=\min\{\#S|\,\, S\subseteq f^{-n}(x),\,\, \sum_{y\in S}m_{f^n}(y)\geq cd_f^n\}.$$ Then for every $c\in (0,1]$, we have $$\lim_{n\to \infty}(S^n_c)^{1/n}= d_f.$$ \end{thm} Taking $c=1$ in Theorem \ref{thmcountprestr}, we get the following corollary. \begin{cor}\label{corcountpre}Let $f: X\to X$ be a flat and finite endomorphism. If the field extension ${\mathbf{k}}(X)/f^*{\mathbf{k}}(X)$ is separable, then for every $x\in X({\mathbf{k}})$ with $\overline{\cup_{i\geq 0}f^{-i}(x)}=X,$ $$\lim_{n\to \infty}(\#f^{-n}(x))^{1/n}= d_f.$$ \end{cor} If the topological degree is large, we have the following stronger equidistribution result. \begin{thm}\label{thmseqd} Let $f: X\to X$ be a flat and finite endomorphism of a quasi-projective variety. Assume that \begin{equation}\label{equladdom}d_f:=\lambda_{\dim X}(f)>\max_{1\leq i\leq \dim X-1} \lambda_i. \end{equation} If the field extension ${\mathbf{k}}(X)/f^*{\mathbf{k}}(X)$ is separable, then for every $x\in X({\mathbf{k}})$ with $\overline{\cup_{i\geq 0}f^{-i}(x)}=X,$ $$\lim_{n\to \infty}d_f^{-n}(f^n)^*\delta_x=\delta_{\eta}.$$ Moreover, for every irreducible subvariety $V$ of $X$ of dimension $d_V\leq \dim X-1$, $$\limsup_{n\to \infty}\#(f^{-n}(x)\cap V)^{1/n}\leq \lambda_{d_V}<d_f.$$ \end{thm} Assumption \ref{equladdom} holds for polarized endomorphisms on projective varieties. A similar statement for polarized endomorphisms can be fund in \cite[Theorem 5.1]{Gignac2014a}. See \cite{Guedj2005,Dinh2015} for according result for complex topology. \medskip Theorem \ref{thmseqd} is not true without Assumption \ref{equladdom}. \begin{exe} Under the notation of Example \ref{exenotdml}. Set $g:=f^{-1}.$ Then $\lambda_i(g)=1, i=0,1,2.$ Denote by $1_{V}$ the characteristic function of $V$. Since $V$ is open and closed in $|{\mathbb A}^2|$, $1_{V}$ is continuous. We have $$\lim_{n\to \infty}\int 1_V(g^{-p^n})^*\delta_{e}=\lim_{n\to \infty}1_V(f^{p^n}(e))=1\neq 0=\int 1_V\delta_{\eta}.$$ \end{exe} \subsection{Relation to Berkovich spaces} We will see in Section \ref{subsecberko}, $|X|$ can be viewed as a closed subset of the Berkovich analytification $X^{{\rm an}}$ of $X$ w.r.t the trivial norm on ${\mathbf{k}}$. So the statements in ergodic theory on $|X|$ can be translated to statements on $X^{{\rm an}}.$ See the translation of Corollary \ref{corgenericseqence} and Theorem \ref{thmseqd} in Section \ref{subsecberko}. Using reduction map, we may also use ergodic theory w.r.t. the constructible topology to study endomorphisms on Berkovich spaces with good reduction. In Section \ref{subsectionreduction}, we apply Theorem \ref{thmseqd} to get an equidistribution result for endomorphisms of large topological degree with good reduction. \subsection{Notation and Terminology} \begin{points} \item[$\bullet$] For a set $S$, denote by $\# S$ the cardinality of $S.$ \item[$\bullet$] A \emph{variety} is an irreducible separated scheme of finite type over a field. A \emph{subvariety} of a variety $X$ is a closed subset of $X.$ \item[$\bullet$] For a variety $X$ (resp. a rational self-map $f: X\dashrightarrow Y$) over a field $k$ and a subfield $K$ of $k$, we say that $X$ (resp. $f$) is \emph{defined over $K$} if there is a variety $X_K$ (resp. a rational map $f_K$) over $K$ such that $X$ (resp. $f$) is the base change by $k$ of $X$ (resp. $f$). \item[$\bullet$]For a rational map $f: X\dashrightarrow Y$ between varieties. Denote by $I(f)$ the indeterminacy locus of $f$. \item[$\bullet$] For a dominant rational self-map $f: X\dashrightarrow X$ between varieties, a subvariety $V$ of $X$ is said to be \emph{$f$-invariant} if $I(f)$ does not contain any irreducible component of $V$ and $f(V)\subseteq V.$ \item[$\bullet$] For a projective variety $X$, $N^i(X)$ is the the group of numerical $i$-cycles of $X$ and $N^i(X)_{{\mathbb R}}:=N^i(X)\otimes {\mathbb R}.$ \item[$\bullet$] For two Cartier ${\mathbb R}$-divisors $D_1,D_2$, write $D_1\equiv D_2$ if $D_1,D_2$ are numerically equivalent. \item[$\bullet$] For a field extension $k/K$, $\text{tr.d.}_Kk$ is the transcendence degree of $k/K.$ \end{points} \subsection*{Acknowledgement} I would like to thank Xinyi Yuan. Section \ref{sectionergodictheory} of this paper is motivated by some interesting discussion with him. \section{Dynamical degree and arithmetic degree} \subsection{The dynamical degrees}\label{subsectiondydeg} In this section we recall the definition and some basic facts on the dynamical degree. Let $X$ be a variety over ${\mathbf{k}}$ and $f: X\dashrightarrow X$ a dominant rational self-map. Let $X'$ be a normal projective variety which is birational to $X$. Let $L$ be an ample (or just nef and big) divisor on $X'$. Denote by $f'$ the rational self-map of $X'$ induced by $f$. For $i=0,1,\dots,\dim X$, and $n\geq 0$, $(f'^n)^*(L^i)$ is the $(\dim X-i)$-cycle on $X'$ as follows: let $\Gamma$ be a normal projective variety with a birational morphism $\pi_1\colon\Gamma\to X'$ and a morphism $\pi_2\colon\Gamma\to X'$ such that $f'^n=\pi_2\circ\pi_1^{-1}$. Then $(f'^n)^*(L^i):= (\pi_1)_*\pi_2^*(L^i)$. The definition of $(f'^n)^*(L^i)$ does not depend on the choice of $\Gamma$, $\pi_1$ and $\pi_2$. The $i$-th \textit{dynamical degree} of $f$ is $$ \lambda_i(f):=\lim_{n\to\infty}((f'^n)^*(L^i)\cdot L^{\dim X-i})^{1/n}. $$ The limit converges and does not depend on the choice of $X'$ and $L$ \cite{Russakovskii1997, Dinh2005, Truong2020,Dang2020}. Moreover, if $\pi: X\dashrightarrow Y$ is a generically finite and dominant rational map between varieties and $g\colon Y\dashrightarrow Y$ is a rational self-map such that $g\circ\pi=\pi\circ f$, then $\lambda_i(f)=\lambda_i(g)$ for all $i$; for details, we refer to \cite[Theorem 1]{Dang2020} (and the projection formula), or Theorem 4 in its arXiv version \cite{Dang}. The following result is easy when ${\mathbf{k}}$ is of characteristic 0 and $Z\not\subseteq {\rm Sing} X$. \begin{pro}\cite[Proposition 3.2]{Jia2021}\label{p:dyn_sub_var} Let $X$ be a variety over ${\mathbf{k}}$ and $f\colon X\dashrightarrow X$ a dominant rational self-map. Let $Z$ be an irreducible subvariety in $X$ which is not contained in $I(f)$ such that $f|_Z$ induces a dominant rational self-map of $Z$. Then $\lambda_i(f|_Z)\leq \lambda_i(f)$ for $i=0,1,\dots,\dim Z$. \end{pro} \subsection{Arithmetic degree} The arithmetic degree was defined in \cite{Kawaguchi2016} over a number field or a function field of characteristic zero. In this section we extend this definition to the case over function field of positive characteristic and we prove some basic fact of it. Let ${\mathbf{k}}=\overline{K(B)}$, where $K$ is an algebraically closed field and $B$ is a smooth projective curve. \subsubsection{Weil height} Let $X$ be a normal and projective variety over ${\mathbf{k}}.$ For every $L\in {\rm Pic}(X)$, we denote by $h_L: X({\mathbf{k}})\to {\mathbb R}$ a Weil height associated to $L$ and the function field $K(B)$. It is unique up to adding a bounded function. \begin{exe}\label{exekbheight} Assume that $X$ is defined over $K(B)$ i.e. there is a projective morphism $\pi: X_B\to B$ where $X_B$ is normal, projective and geometric generic fiber of $\pi$ is $X$. Assume that there is a line bundle $L_B$ on $X_B$ whose restriction on $X$ is $L$. In this case, for every $x\in X({\mathbf{k}})$, we may take $h_L$ to be $$h_{(X_B, L_B)}(x)=[K(B)(x):K(B)]^{-1}(\overline{x}\cdot L),$$ where $\overline{x}$ is the Zariski closure of $x$ in $X_B.$ \end{exe} Keep the notations in Example \ref{exekbheight}. Let $b$ be a point in $B(K).$ It induces a norm $|\cdot|_b$ on $K(B)$. Denote by $K(B)_b$ the completion of $K(B)$ w.r.t. $|\cdot|_b$. Denote by ${\mathbb C}_b$ the completion of $\overline{K(B)_b}.$ Every field embedding $\tau: {\mathbf{k}}=\overline{K(B)}\hookrightarrow {\mathbb C}_b$ induces an embedding $\phi_{\tau}: X({\mathbf{k}})\hookrightarrow X({\mathbb C}_b).$ On $X({\mathbb C}_b)$, we have a natural $b$-adic topology induced by $|\cdot|_b$. \begin{rem}\label{remopenred}Let $x_b$ be a point in $X_b$. Then $x_b$ defines a nonempty open subset $U_{x_b}$ consisting of all points in $X({\mathbb C}_b)$ whose reduction is $x_b\in X_b(K).$ Then for every $x\in \phi_{\tau}^{-1}(U_{x_b})$, $x_0$ is contained in the Zariski closure of $x$ in $X_B.$ \end{rem} \begin{lem}\label{lemlocheig} There is $d\geq 1$ such that for every $b\in B(K),$ every nonempty $b$-adic open subset of $U\subseteq X({\mathbb C}_b),$ and every $l\geq 1$, there is $x\in X({\mathbf{k}})$ such that $\deg(x)\leq d$ and $h_L(x)\geq l$. \end{lem} \proof By Noether normalization lemma, we only need to prove the lemma when $X=\P^N$ and $L=O(1).$ After replace $K(B)$ by a finite extension, a changing of coordinates, we may assume that $0\in U.$ We may assume that $h_L$ is the naive height on $\P^N$ i.e. the height defined by the model $(\P^N_B, O_{\P^N(B)}(1)).$ Pick any rational function $g\in K(B)\setminus \{0\}$ with $g(b)=0.$ Then for $n\geq 1$, $x_n:=(g^n,\dots, g^n)\in {\mathbb A}^N(K(B)).$ We have $h_L(x_n)\to \infty$ as $n\to \infty$ and $\phi_{\tau}(x_n)\to 0$ in the $b$-adic topology. This concludes the proof. \endproof \subsubsection{Admissible triples.} As in \cite{Jia2021}, we define an \textit{admissible triple} to be $(X,f,x)$ where $X$ is a quasi-projective variety over ${\mathbf{k}}$, $f\colon X\dashrightarrow X$ is a dominant rational self-map and $x\in X_f({\mathbf{k}})$. We say that $(X,f,x)$ \textit{dominates} (resp.~\textit{generically finitely dominates}) $(Y,g,y)$ if there is a dominant rational map (resp.~generically finite and dominant rational map) $\pi\colon X\dashrightarrow Y$ such $\pi\circ f=g\circ\pi$, $\pi$ is well defined along $O_f(x)$ and $\pi(x)=y$. We say that $(X,f,x)$ is \textit{birational} to $(Y,g,y)$ if there is a birational map $\pi\colon X\dashrightarrow Y$ such $\pi\circ f=g\circ\pi$ and if there is a Zariski dense open subset $V$ of $Y$ containing $O_g(y)$ such that $\pi|_U: U:=\pi^{-1}(V)\to V$ is a well-defined isomorphism and $\pi(x)=y$. In particular, if $(X,f,x)$ is birational to $(Y,g,y)$, then $(X,f,x)$ generically finitely dominates $(Y,g,y)$. \begin{rem} \leavevmode \begin{enumerate} \item If $(X,f,x)$ dominates $(Y,g,y)$ and if $O_f(x)$ is Zariski dense in $X$, then $O_g(y)$ is Zariski dense in $Y$. Moreover, if $(X,f,x)$ generically finitely dominates $(Y,g,y)$, then $O_f(x)$ is Zariski dense in $X$ if and only if $O_g(y)$ is Zariski dense in $Y$. \item Every admissible triple $(X,f,x)$ is birational to an admissible triple $(X',f',x')$ where $X'$ is projective. Indeed, we may pick $X'$ to be any projective compactification of $X$, $f'$ the self-map of $X'$ induced from $f$, and $x'=x$. \end{enumerate} \end{rem} \subsubsection{The set $A_f(x)$.} As in \cite{Jia2021}, we will associate to an admissible triple $(X,f,x)$ a subset $$A_f(x)\subseteq [1,\infty].$$ \begin{rem} We will show in Proposition \ref{proupboundarth} that $A_f(x)\subseteq [1,\lambda_1(f)].$ \end{rem} We first define it when $X$ is projective. Let $L$ be an ample divisor on $X$, we define $$A_f(x)\subseteq [1,\infty]$$ to be the limit set of the sequence $(h_L^+(f^n(x)))^{1/n}$, $n\geq 0$, where $h_L^+(\cdot):=\max\{h_L(\cdot),1\}$. The following lemma was proved in \cite[Lemma 3.8]{Jia2021} when ${\mathbf{k}}=\overline{{\mathbb Q}}$, but its proof still works our case. It shows that the set $A_f(x)$ does not depend on the choice of $L$ and is invariant in the birational equivalence class of $(X,f,x)$. \begin{lemma}\cite[Lemma 3.8]{Jia2021}\label{lemsingwilldef} Let $\pi\colon X\dashrightarrow Y$ be a dominant rational map between projective varieties. Let $U$ be a Zariski dense open subset of $X$ such that $\pi|_U\colon U\to Y$ is well-defined. Let $L$ be an ample divisor on $X$ and $M$ an ample divisor on $Y$. Then there are constants $C\geq 1$ and $D>0$ such that for every $x\in U$, we have \begin{equation}\label{equationdomineq1} h_M(\pi(x))\leq Ch_L(x)+D. \end{equation} Moreover if $V:=\pi(U)$ is open in $Y$ and $\pi|_U\colon U\to V$ is an isomorphism, then there are constants $C\geq 1$ and $D>0$ such that for every $x\in U$, we have \begin{equation}\label{equationbirdomineq} C^{-1}h_L(x)-D\leq h_M(\pi(x))\leq Ch_L(x)+D. \end{equation} \end{lemma} Now for every admissible triple $(X,f,x)$, we define $A_f(x)$ to be $A_{f'}(x')$ where $(X',f',x')$ is an admissible triple which is birational to $(X,f,x)$ such that $X'$ is projective. By Lemma~\ref{lemsingwilldef}, this definition does not depend on the choice of $(X',f',x')$. \subsubsection{The arithmetic degree.}\label{subsec_arithdeg} We define (see also \cite{Kawaguchi2016}): \[ \overline{\alpha}_f(x):=\sup A_f(x),\qquad\underline{\alpha}_f(x):=\inf A_f(x). \] We say that $\alpha_f(x)$ is well-defined and call it the \textit{arithmetic degree} of $f$ at $x$, if $\overline{\alpha}_f(x)=\underline{\alpha}_f(x)$; and, in this case, we set \[ \alpha_f(x):=\overline{\alpha}_f(x)=\underline{\alpha}_f(x). \] By Lemma~\ref{lemsingwilldef}, if $(X,f,x)$ dominates $(Y,g,y)$, then $\overline{\alpha}_f(x)\geq \overline{\alpha}_g(y)$ and $\underline{\alpha}_f(x)\geq\underline{\alpha}_g(y)$. Applying Inequality~\eqref{equationdomineq1} of Lemma~\ref{lemsingwilldef} to the case where $Y=X$ and $M=L$, we get the following trivial upper bound: let $f\colon X\dashrightarrow X$ be a dominant rational self-map, $L$ any ample line bundle on $X$ and $h_L$ a Weil height function associated to $L$; then there is a constant $C\geq 1$ such that for every $x\in X\setminus I(f)$, we have \begin{equation}\label{equationtrivialupper} h_L^+(f(x))\leq Ch_L^+(x). \end{equation} For a subset $A\subseteq [1,\infty)$, define $A^{1/\ell}:= \{a^{1/\ell}\mid a\in A\}$. We have the following simple properties, where the second half of \ref{eq:alpha_pow} used Inequality~\eqref{equationtrivialupper}. \begin{pro}\label{probasicaf}We have: \begin{enumerate} \item $A_f(x)\subseteq [1,\infty)$. \item $A_f(x)=A_f(f^{\ell}(x))$, for any $\ell\geq 0$. \item \label{eq:alpha_pow} $A_{f}(x)=\bigcup_{i=0}^{\ell-1}(A_{f^{\ell}}(f^i(x)))^{1/\ell}$. In particular, $\overline{\alpha}_{f^{\ell}}(x)=\overline{\alpha}_{f}(x)^{\ell}$, $\underline{\alpha}_{f^{\ell}}(x)=\underline{\alpha}_{f}(x)^{\ell}$. \end{enumerate} \end{pro} The following lemma is easy. \begin{lemma} \label{lem_subvar} Let $f\colon X\dashrightarrow X$ be a dominant rational self-map of a projective variety $X$ and $W\subseteq X$ an $f$-invariant subvariety. Then $X_f({\mathbf{k}})\cap W({\mathbf{k}})\subseteq W_{f|_W}({\mathbf{k}})$ and for every $x\in X_f({\mathbf{k}})\cap W({\mathbf{k}})$, $\alpha_{f|_W}(x)=\alpha_f(x).$ \end{lemma} When ${\mathbf{k}}=\overline{{\mathbb Q}}$, the next result was proved in \cite[Theorem 1.4]{Matsuzawa2020a} in the smooth case and in \cite[Proposition 3.11]{Jia2021} in the singular case. The proof here in the function field case is much easier. \begin{pro}[Kawaguchi-Silverman-Matsuzawa's upper bound]\label{proupboundarth} For every admissible triple $(X,f,x_0)$, we have $\overline{\alpha}_f(x_0)\leq \lambda_1(f)$. \end{pro} \begin{proof} We may assume that $X$ is projective. Set $d:=\dim X.$ After replacing $f$ by a suitable iteration and $x_0$ by $f^n(x_0)$ for some $n\geq 0$ and noting that $\lambda_1(f^n)=\lambda_1(f)^n$ and by Proposition \ref{probasicaf}, we may assume that the Zariski closure $Z_f(x_0)$ of $O_f(x_0)$ is irreducible. By Proposition~\ref{p:dyn_sub_var} and Lemma~\ref{lem_subvar}, we may replace $X$ by $Z_f(x_0)$ and assume that $O_f(x_0)$ is Zariski dense in $X$. Assume that $X$ is defined over $K(B)$ i.e. there is a projective morphism $\pi: {\mathcal X}\to B$ where ${\mathcal X}$ is projective, normal and geometric generic fiber of $\pi$ is $X$. Pick an ample line bundle $L_B$ on ${\mathcal X}$ and let $L$ be its restriction to $X$. We take the Weil height $h_L: X({\mathbf{k}})\to {\mathbb R}$ as follows: for every $x\in X({\mathbf{k}})$, $$h_L(x):=h_{({\mathcal X}, L_B)}(x)=[K(B)(x):K(B)]^{-1}(\overline{x}\cdot {\mathcal L}).$$ We may assume that $x_0$ is defined over $K(B)$. Let $F: {\mathcal X}\dashrightarrow {\mathcal X}$ be the rational self-map over $B$ induced by $f.$ The relative dynamical degree formula \cite[Theorem 4]{Dang}, shows that $$\lambda_1(F)=\max\{1,\lambda_1(f)\}=\lambda_1(f).$$ So for every $r>0$, there is $C_r>0$ such that for every $n\geq 0$, \begin{equation}\label{equcnln}((F^n)^*L_B\cdot L_B^d)\leq C_r (\lambda_1(f)+r)^n. \end{equation} Let ${\mathcal I}$ be the ideal sheaf of $\overline{x_0}$ on ${\mathcal X}.$ After replacing $L_B$ be a suitable multiple, we may assume that ${\mathcal L}\otimes {\mathcal I}$ is globally generated. For every $n\geq 0$, there are divisors $H_i, i=0,\dots,d$ in $|L_B|$ such that $\dim H_1\cap \dots \cap H_d=1$ and containing $\overline{x_0}$ as an irreducible component. Set $V_n:=H_1\cdot \dots \cdot H_d$. Let $\Gamma$ be a normal projective variety with a birational morphism $\pi_1\colon\Gamma\to {\mathcal X}$ and a morphism $\pi_2:\Gamma\to {\mathcal X}$ such that $F^n=\pi_2\circ\pi_1^{-1}$. Write $(\pi_1)^{\#}\overline{x_0}$ the strict transform of $V^n$ $\overline{x_0}$ by $\pi_1^N.$ Then $(\pi_1)^{\#}\overline{x_0}$ is an irreducible component of $\cap_{i=1}^d(\pi_1^*H_i).$ In $N^1(\Gamma)$, we have $\pi_1^*V_n=\pi_1^*H_1\cdot\dots \cdot \pi^*H_d.$ By \cite[Lemma 3.3]{Jia2021}, $\pi_1^*V_n-(\pi_1)^{\#}\overline{x_0}$ is pseudo-effective. Then we have $$h_L(f^n(x_0))=(\overline{f^n(x_0)}\cdot L_B)=((\pi_1)^{\#}\overline{x_0}\cdot \pi_2^*L_B)$$ $$\leq (\pi_1^*H_1\cdot \dots \cdot \pi^*_1H_d\cdot \pi_2^*L_B)=((F^n)^*L_B\cdot L_B^d).$$ $$\leq C_r (\lambda_1(f)+r)^n.$$ It follows that $$\overline{\alpha}_f(x_0)=\limsup_{n\to \infty}h_L(f^n(x_0))^{1/n}\leq \lim_{n\to \infty}(C_r (\lambda_1(f)+r)^n)^{1/n}=\lambda_1(f)+r.$$ Letting $r\to \infty$, we conclude the proof. \end{proof} \subsection{Canonical height} Let $X$ be a normal projective variety and $f: X\to X$ a surjective endomorphism. Let $A$ be an ample divisor of $X$, denote by $h_A$ a Weil height on $X({\mathbf{k}})$ associated to $A$ with $h_A\geq 1.$ \begin{pro}\label{procanheight} Let $D$ be a nonzero Cartier ${\mathbb R}$-divisor such that $f^*D\equiv\beta D$ where $\beta> \lambda_1(f)^{1/2}.$ Let $[D]\in N^1(X)_{{\mathbb R}}$ be the numerical class of $D.$ Then for every $x\in X({\mathbf{k}})$, the limit $h_{[D]}^+(x):=\lim_{n\to \infty}h_{D}(f^n(x))/\beta^n$ exist, only depend on the numerical class $[D]$ and satisfies the following properties: \begin{points} \item $h_{[D]}^+=h_{D}+O(h_A^{1/2})$; \item $h_{[D]}^+\circ f=\beta h^+$. \end{points} \end{pro} \proof This result was proved in \cite[Theorem 5]{Kawaguchi2016} in characteristic zero. The proof presented here is the same as \cite[Theorem 5]{Kawaguchi2016}, but slightly shorter. By \cite[Proposition B.3]{Matsuzawa2020a}, there is $C>0$ such that for every $x\in X({\mathbf{k}})$, $$|h_D(f(x))-\beta h_D(x)|\leq Ch_A(x)^{1/2}.$$ Pick $\mu\in (\lambda_1(f)^{1/2}, \beta),$ by Proposition \ref{proupboundarth}, for every $x\in X({\mathbf{k}})$, there is $C_x>0$ such that , $$h_A(f^n(x))\leq C_x\mu^{2n}h_A(x).$$ Then we have $$|h_{D}(f^n(x))/\beta^n-h_{D}(f^{n-1}(x))/\beta^{n-1}|=\beta^{-n}|h_{D}(f^n(x))-\beta h_{D}(f^{n-1}(x))|$$ $$\leq \beta^{-n}Ch_A(f^{n-1}(x))^{1/2}\leq \beta^{-n}CC_x^{1/2}\mu^nh_A(x)^{1/2}=CC_x^{1/2}(\mu/\beta)^nh_A(x)^{1/2}.$$ Since $0<\mu/\beta<1$, $$h_{[D]}^+(x)=h_D(x)+\sum_{n\geq 1}(h_{D}(f^n(x))/\beta^n-h_{D}(f^{n-1}(x))/\beta^{n-1})$$ converges and $$|h_{[D]}^+(x)-h_D(x)|\leq \sum_{n\geq 1}|h_{D}(f^n(x))/\beta^n-h_{D}(f^{n-1}(x))/\beta^{n-1}|$$ $$\leq (\sum_{n\geq 1}CC_x^{1/2}(\mu/\beta)^n)h_A(x)^{1/2}=O(h_A(x)^{1/2}).$$ Then we get (i). The statement (ii) follows from the definition. For $D'\equiv D$, by \cite[Proposition B.3]{Matsuzawa2020a}, there is $B>0$ such that for every $x\in X({\mathbf{k}})$, $$|h_{D'}(x)-h_D(x)|\leq Bh_A(x)^{1/2}.$$ Then $$|h_{[D']}^+(x)-h_{[D]}^+(x)|:=\lim_{n\to \infty}|h_{D'}(f^n(x))-h_{D}(f^n(x))|/\beta^n$$ $$\leq \limsup_{n\to \infty}Bh_A(f^n(x))^{1/2}/\beta^n\leq \limsup_{n\to \infty}BC_xh_A(x)^{1/2}(\mu/\beta)^n=0,$$ which concludes the proof.\endproof The following was proved in \cite[Lemma 9.1]{Matsuzawa2018} when ${\mathbf{k}}=\overline{{\mathbb Q}}$ and $X$ is smooth. After replacing \cite[Theorem 5]{Kawaguchi2016} by Proposition \ref{procanheight}, \cite[Lemma 9.1]{Matsuzawa2018} is still valid when ${\mathbf{k}}=K(B)$ and $X$ is singular. \begin{pro}\label{proextarhitd} Assume that $\lambda_1(f)>1$. Let $D\not\equiv 0$ be a nef ${\mathbb R}$-Cartier divisor on $X$ such that $f^*D\equiv \lambda_1(f)D$. Let $V\subseteq X$ be a subvariety of positive dimension such that $(D^{\dim V}\cdot V)>0$. Then there exists a nonempty open subset $U\subseteq V$ and a set $S\subseteq U({\mathbf{k}})$ of bounded height such that for every $x\in U({\mathbf{k}})\setminus S$ we have $\alpha_f(x)=\lambda_1(f)$. \end{pro} \begin{cor}\label{cordenseal}Keep the notation in Proposition \ref{proextarhitd}. For every Zariski dense open subset $U$ of $X$, there is $x\in U({\mathbf{k}})$ such that $\alpha_f(x)=\lambda_1(f)$ and $O_f(x)\subseteq U$. \end{cor} \proof[Proof of Corollary \ref{cordenseal}] We may assume that $X$ is normal and $X,f,D$ and $U$ are defined over $K(B).$ There is a normal and projective $B$-scheme $\pi: X_B\to B$ and a rational self-map $f_B: X_B\dashrightarrow X_B$ over $B$ such that the geometric generic fiber of $(X_B,f_B)$ is $(X,f).$ Let $b$ be a general point of $B(K)$ and denote by $(X_b,f_b)$ the fiber of $(X_B,f_B)$ above $b$. Then $f_b$ is an endomorphism of $X_b.$ Set $Z:=X\setminus U$. Let $Z_B$ be the Zariski closure of $Z$ in $X_B.$ Then $U_b:=X_b\setminus Z_B$. By Proposition \ref{proxfnonempty} (see Section \ref{subsectionexweldef} for its proof), there is $x_b\in (U_b)_{f_b|_{U_b}}(K).$ Let $M$ be a very ample line bundle on $X_B.$ Taking $W_B$ to be the intersection of $\dim X-1$ general elements of $|10M|$ of $X_B$ passing through $x_b.$ By \cite[Theorem 0.4]{Benoist2011}, $W_B$ is irreducible. Let $W\subseteq X$ be the generic fiber of $W_B$. It is of pure dimension $1$. Then $(W\cap D)>0.$ Because $W_B$ is irreducible, for every irreducible component $W'$ of $W$, $(W'\cdot D)>0.$ By Lemma \ref{lemlocheig} and Remark \ref{remopenred}, there are $x_n\in W'({\mathbf{k}}), n\geq 0$ such that $x_b\in \overline{\{x_n\}}$ and the height of $x_n$ tends to $+\infty$. Because $O_{f_b}(x_b)\subseteq U$, $O_f(x_n)\subseteq U$ for all $n\geq 0.$ By Proposition \ref{proextarhitd}, for $n>>0$, we have $x_n\in V({\mathbf{k}})\cap U$ and $\alpha_f(x_n)=\lambda_1(f)$. \endproof \section{Proof of Theorem \ref{dmlsurface}} This proof mixes the ideas from \cite{Xie2014} and \cite{Lesieutre2021}. \subsection{Reduce to the smooth case} By \cite{Lipman1978}, there is a minimal desingularization $\pi:X'\to X$. Then one may lift $f$ to an automorphism $f'$ of $X'.$ The following lemma allows us to replace $(X,f)$ by $(X',f')$ and assume that $X$ is smooth. \begin{lem}\label{lemredudesing}If $(X',f')$ satisfies the DML property, then $(X,f)$ satisfies the DML property. \end{lem} \proof Assume that $(X',f')$ satisfies the DML property. We only need to prove the following statement: for every $x\in X({\mathbf{k}})$ and an irreducible curve $C\subseteq X({\mathbf{k}})$, if $O_f(x)\cap C$ is infinite, then $C$ is $f$-periodic. Pick $x'\in \pi^{-1}(x)({\mathbf{k}})$. There is an irreducible component $C'$ of $\pi^{-1}(C)$ such that $O_{f'}(x')\cap C'$ is infinite. We have $\dim C'\leq 1.$ If $\pi(C')\neq C$, then $\pi(C')$ is a point. Then $x=\pi(x')$ is periodic. So $\pi(C')= C$ and $\dim C'=1.$ Since $(X',f')$ satisfies the DML property, $C'$ is $f'$-periodic. So $C=\pi(C')$ is $f'$-periodic. \endproof \subsection{Numerical geometry}\label{subsectionnumgeo} Set $\lambda:=\lambda_1(f)>1$. There is a nef class $\theta^*\in N^1(X)_{{\mathbb R}}\setminus \{0\}$ such that $f^*\theta^*=\lambda\theta^*.$ By projection formula $\lambda_1(f^{-1})=\lambda.$ So there is a nef class $\theta^*\in N^1(X)_{{\mathbb R}}\setminus \{0\}$ such that $(f^{-1})^*\theta_*=\lambda\theta_*.$ Then $f^*\theta_*=\lambda^{-1}\theta_*.$ Since $\lambda^2({\theta^*}^2)=({f^*\theta^*}^2)=({\theta^*}^2),$ we get $({\theta^*}^2)=0.$ Similarly, $({\theta_*}^2)=0.$ By Hodge index theorem, $(\theta^*\cdot \theta_*)>0.$ It follows that $(\theta^*+\theta_*)^2>0.$ So $\theta^*+\theta_*$ is big and nef. Set $H:=\{\alpha\in {\mathbb N}^1(X)_{{\mathbb R}}|\,\, (\theta^*\cdot \alpha)=(\theta_*\cdot \alpha)=0\}.$ It is clear that ${\mathbb N}^1(X)_{{\mathbb R}}={\mathbb R}\theta^*\oplus {\mathbb R}\theta_*\oplus H$ and $f^*H=H.$ By Hodge index theorem, the intersection form on $H$ is negative define. Since $f^*$ preserves the intersection form, all eigenvalues of $f^*|_H$ are of norm $1$. Since $f^*$ is an automorphism of the lattes $N^1(X)\subseteq N^1(X)_{{\mathbb R}}$, all eigenvalues of $f^*: N^1(X)_{{\mathbb R}}\to N^1(X)_{{\mathbb R}}$ are algebraic integers. In particular both $\lambda$ and $\lambda^{-1}$ are algebraic integers. \begin{lem}\label{lemlaoneconj}There is $\sigma\in {\rm Gal}(\overline{{\mathbb Q}}/{\mathbb Q})$ such that $\sigma(\lambda)=\lambda^{-1}.$ \end{lem} \proof[Proof of Lemma \ref{lemlaoneconj}] Since $\lambda_1$ is an algebraic integer with $|\lambda|>1$, by product formula, there is $\sigma\in {\rm Gal}(\overline{{\mathbb Q}}/{\mathbb Q})$ such that $|\sigma(\lambda_1)|<1.$ Because $\sigma(\lambda_1)$ is an eigenvalue of $f^*$ and $\lambda_1^{-1}$ is the unique eigenvalue of $f^*$ with norm $<1,$ we have $\sigma(\lambda_1)=\lambda_1^{-1}$. \endproof Then $f^*\sigma(\theta^*)=\sigma(f^*\theta^*)=\sigma(\lambda)\sigma(\theta^*)=\lambda^{-1}\sigma(\theta^*).$ So there is $c>0$ such that $\theta_*=c\sigma(\theta^*).$ After replacing $\theta_*$ by $c^{-1}\theta_*$, we may assume that $\sigma(\theta^*)=\theta_*.$ \begin{cor}\label{corcurudst}For every curve $C$ of $X$, $(\theta^*\cdot C)=0$ if and only if $(\theta_*\cdot C)=0.$ \end{cor} \proof[Proof of Corollary \ref{corcurudst}] The subspace $P:=\{\alpha\in N^1(X)_{{\mathbb C}}|\,\, (\alpha\cdot C)=0\}$ is a hyperplane of $N^1(X)_{{\mathbb C}}$ defined over ${\mathbb Q}.$ We have $\sigma(P)=P.$ Embed $N^1(X)_{{\mathbb R}}$ in $N^1(X)_{{\mathbb C}}$. Then $\theta^*\in P$ if and only if $\theta_*=\sigma(\theta^*)\in \sigma(P)=P.$ \endproof \subsection{Canonical height} In this section, we assume \begin{points} \item either ${\mathbf{k}}=\overline{{\mathbb Q}}$; \item or there is an algebraically closed subfield $K\subseteq {\mathbf{k}}$, a curve $B$ over $K$, such that $X$ and $f$ are defined over $K(B)$ and ${\mathbf{k}}=\overline{K(B)}.$ \end{points} Let $A$ be an ample divisor of $X$, denote by $h_A$ a Weil height on $X({\mathbf{k}})$ associated to $A$ with $h_A\geq 1.$ Pick ${\mathbb R}$-divisors $D^{*}$ and $D_*$ with numerical classes $\theta^*, \theta_*$. By \cite[Theorem 5]{Kawaguchi2016} and \cite{Kawaguchi2020} in characteristic zero and Proposition \ref{procanheight} in positive characteristic, for every $y\in X({\mathbf{k}})$, the limits $$h^+(y):=\lim_{n\to \infty}h_{D^*}(f^n(y))/\lambda^n$$ and $$h^-(y):=\lim_{n\to \infty}h_{D_*}(f^{-n}(y))/\lambda^n$$ exist, do not depend on the choice of $D^{*}$, $D_*$, $h_{D^*}$ and $h_{D_*},$ and satisfies the following properties: \begin{points} \item $h^+=h_{D^*}+O(h_A^{1/2})$, $h^-=h_{D_*}+O(h_A^{1/2})$; \item $h^+\circ f=\lambda h^+$ and $h^-\circ f=\lambda^{-1}h^-.$ \end{points} \begin{lem}\label{lemcomheigonc}Let $C$ be an irreducible curve of $X$ such that $(C\cdot \theta_*)>0.$ Then for every $M\geq 0$, there is $M'\geq 0$, such that $$\{y\in C({\mathbf{k}})|\,\, h^-(y)\leq M\}\subseteq \{y\in C({\mathbf{k}})|\,\, h_A(y)\leq M'\}.$$ \end{lem} \proof[Proof of Lemma \ref{lemcomheigonc}] There is $d>0$, such that $$h^{-}\geq h_{D_*}-dh_A^{1/2}.$$ Pick $a>0$ such that $a(D_*\cdot C)>(A\cdot C).$ Then there is $b>0$ such that for every $y\in C$, $$ah_{D^*}(y)+b\geq h_{A}(y).$$ So for every $y\in C,$ $$h^{-}(y)\geq a^{-1}(h_{A}(y)-b)-dh_A^{1/2}(y).$$ If $h^-(y)\leq M$, we get $$M\geq a^{-1}(h_{A}(y)-b)-dh_A^{1/2}(y)=(a^{-1}h_A^{1/2}(y)-d)h_A^{1/2}(y)-a^{-1}b.$$ This implies that $$h_A^{1/2}(y)\leq \max\{ad, aM+b+ad\}=aM+b+ad.$$ Then we get $h_A(y)\leq (aM+b+ad)^2.$ \endproof \subsection{The case $(C\cdot \theta_*)>0$} \begin{lem}\label{lemcthqezerfinite}Let $C$ be an irreducible curve of $X$ such that $(C\cdot \theta_*)>0.$ For every $x\in X({\mathbf{k}})$, $O_f(x)\cap C$ is finite. \end{lem} \proof[Proof of Lemma \ref{lemcthqezerfinite}] Let ${\mathbb F}$ be the minimal algebraically closed subfield of ${\mathbf{k}}$. So ${\mathbb F}=\overline{{\mathbb Q}}$ if ${\rm char}\, {\mathbf{k}}=0$ and ${\mathbb F}=\overline{{\mathbb F}_p}$ when ${\rm char}\, {\mathbf{k}}=p>0.$ There is an algebraically closed subfield ${\mathbf{k}}'$ of ${\mathbf{k}}$ with $\text{tr.d.}_{{\mathbb F}}{\mathbf{k}}'<\infty$ such that $X,f,C$ and $x$ are defined over ${\mathbf{k}}'$. After replacing ${\mathbf{k}}$ by ${\mathbf{k}}'$, we may assume $\text{tr.d.}_{{\mathbb F}}{\mathbf{k}}<\infty$. Now we prove Lemma \ref{lemcthqezerfinite} by induction on $\text{tr.d.}_{{\mathbb F}}{\mathbf{k}}.$ \medskip When ${\mathbf{k}}=\overline{{\mathbb F}_p}$ for some prime $p>0,$ $O_f(x)$ is finite. Then Lemma \ref{lemcthqezerfinite} holds. \medskip Assume ${\mathbf{k}}=\overline{{\mathbb Q}}.$ Set $I:=\{i\geq 0|\,\, f^i(x)\in C\}.$ For every $i\geq I$, $h^-(f^i(x))=\lambda^{-i}h^-(x)\leq h^-(x).$ By Lemma \ref{lemcomheigonc}, there is $M>0$ such that $h_A(f^i(x))<M$ for every $i\in I.$ We conclude the proof by the Northcott property. \medskip Now we may assume that $\text{tr.d.}_{{\mathbb F}}{\mathbf{k}}\geq 1.$ There is an algebraically closed subfield $K\subseteq {\mathbf{k}}$, a smooth irreducible projective curve $B$ over $K$, such that $X$, $f$, $C$ and $x$ are defined over $K(B)$ and ${\mathbf{k}}=\overline{K(B)}.$ There is a projective morphism $\pi: {\mathcal X}\to B$ whose geometric generic fiber is $X$. The automorphism $f$ extends to a birational self-map $f_B: {\mathcal X}\dashrightarrow {\mathcal X}$ over $B$. Let $A_B$ be an ample divisor on ${\mathcal B}$. Let $C_B$ be the Zariski closure of $C$ in ${\mathcal X}$. Let $A$ be the restriction of $A_B$ on the generic fiber $X.$ There is a nonempty open subset $U$ of $B$, such that $\pi$ is smooth above $U$ and $f_B|_{\pi^{-1}(U)}$ is an automorphism. Assume that $(A\cdot \theta_*)=1.$ For every $b\in B$, let $X_b:=\pi^{-1}(b)$, $C_b:=C\cap X_b$, $f_b$ be the restriction of $f$ to $X_b$ and $A_b$ be the restriction of $L_B$ to $X_b.$ After shrinking $U$, we may assume that $C_b$ is irreducible for every $b\in U.$ For every $n\geq 0$ and $b\in U$, we have $((f^n)^*A\cdot A)=((f_b^n)^*A_b\cdot A_b)$. So $\lambda_1(f_b)=\lambda_1(f)=\lambda>1.$ For $b\in U$, set $$\theta_{*,b}':=\lim_{n\to \infty}((f_b^{-n})^*A_b\cdot A_b)/\lambda^n.$$ The discussion in Section \ref{subsectionnumgeo} shows that ${\mathbb R}\theta_{*,b}'$ the eigenspace of $(f_b^{-1})^*$ in $N^1(X_b)$ for eigenvalue $\lambda$. Set $\theta_{*,b}:=\theta_{*,b}'/(\theta_{*,b}'\cdot A).$ We have $$(\theta_{*,b}\cdot C_b)=(\theta_{*}\cdot C)>0.$$ \medskip Set $I:=\{i\geq 0|\,\, f^i(x)\in C\}.$ For every $i\geq I$, $h^-(f^i(x))=\lambda^{-i}h^-(x)\leq h^-(x).$ By Lemma \ref{lemcomheigonc}, there is $M>0$ such that $h_A(f^i(x))<M$ for every $i\in I.$ For every point $y\in X$ defined over $K(B)$, its closure $s_y$ in ${\mathcal X}$ is a section of $\pi.$ We may assume that for every $y\in X(K(B))$, $h_A(y)=(A_B\cdot s_y)$. Also, for every section $s$ of $\pi$, its generic fiber defines a point $y_s\in X(K(B)).$ For every $y\in X(K(B))$, $\pi$ induces an isomorphism from $s_y$ to the curve B. Consider the Hilbert polynomial $$\chi(s^*_y{\mathcal O}(nA_B))=1-g(B)+n(s_y\cdot A_B)=1-g(B)+nh_A(y).$$ So there is a quasi-projective $K$-variety ${\mathcal M}_M$ that parameterizes the sections $s$ of $\pi$ with $h_A(y_s)\leq M$ (see \cite{debarre}). For every $b\in U$, denote by $e_b: {\mathcal M}_M\to X_b$ the morphism $s\mapsto s(b).$ Pick a sequence $b_i, i\geq 1$ of distinct points in $U(K)$. For $s_1, s_2\in {\mathcal M}_M$, $s_1=s_2$ if and only if $e_{b_i}(s_1)=e_{b_i}(s_2)$ for every $i\geq 1.$ For $l\geq 1$, set $$e_l:=\prod_{i=1}^le_{b_i}: {\mathcal M}_M\to \prod_{i=1}^lX_{b_i}.$$ By \cite[Lemma 8.1]{Xie2014}, there is $L\geq 1$ such that $e_L$ is quasi-finite. For $j\in I$, $f^j(x)$ defines a point $s_{f^j(x)}\in {\mathcal M}_M.$ The induction hypothesis shows that, for $i=1,\dots,L$, $$e_{b_i}(\{f^j(x)|\,\, j\in I\})=\{f_{b_i}^j(x_{b_i})|\,\, j\in I\}\subseteq O_{f_{b_i}}(x_{b_i})\cap C_{b_i}$$ is finite. So $e_L(\{f^j(x)|\,\, j\in I\})$ is finite. Since $e_L$ is quasi-finite, $O_f(x)\cap C=\{f^j(x)|\,\, j\in I\}$ is finite. \endproof \subsection{Conclusion} Let $x\in X({\mathbf{k}})$ and $C$ be an irreducible curve of $X$. If $(C\cdot \theta_*)>0,$ we conclude the proof by Lemma \ref{lemcthqezerfinite}. Now assume that $(C\cdot \theta_*)=0.$ Let $B(f)$ be the set of curves $C'$ with $(C'\cdot \theta_*)=0.$ By Corollary \ref{corcurudst}, $C'\in B(f)$ if and only if $(C'\cdot \theta^*)=0$, if and only if $(C'\cdot (\theta^*+\theta_*))=0$. Since $\theta^*+\theta_*$ is big and nef, $B(f)$ is finite. Since $f^*\theta^*=\lambda_1\theta^*,$ $C'\in B(f)$ if and only if $f(C')\in B(f).$ So every curve in $B(f)$ is periodic. Since $C\in B(f),$ $C$ is periodic. $\square$ \section{Zariski dense orbit conjecture} Let $X$ be a variety over ${\mathbf{k}}$ of dimension $d_X.$ Let $f: X\dashrightarrow X$ be a dominant rational self-map. \subsection{Existence of well-defined orbits}\label{subsectionexweldef} In characteristic $0$, the following result is well know. In positive characteristic, the proof is similar. \begin{pro}\label{proxfnonempty}For every Zariski dense open subset $U$ of $X$, there is $x\in U({\mathbf{k}})$ whose $f$-orbit is well defined and contained in $U.$ \end{pro} \proof[Proof of Proposition \ref{proxfnonempty}] After replacing $X, f$ by $U, f|_U$, we may assume that $X=U.$ So we only need to show that $X_f({\mathbf{k}})\neq \emptyset.$ Let ${\mathbb F}$ be the smallest algebraically closed subfield of ${\mathbf{k}}.$ So ${\mathbb F}=\overline{{\mathbb Q}}$ or $\overline{{\mathbb F}_p}.$ We may replace ${\mathbf{k}}$ by an algebraically closed subfield ${\mathbf{k}}'$ of ${\mathbf{k}}$ with $\text{tr.d.}_{{\mathbb F}}{\mathbf{k}}'<\infty$ such that $X,f$ are defined over ${\mathbf{k}}'$. Now assume that $\text{tr.d.}_{{\mathbb F}}{\mathbf{k}}<\infty.$ If ${\rm char}\,{\mathbf{k}}=0$, we conclude the proof by \cite[Proposition 3.22]{Xie2019}. Now assume that ${\rm char}\,{\mathbf{k}}=p>0.$ The case ${\mathbf{k}}=\overline{{\mathbb F}_p}$ is essentially proved in \cite[Proposition 5.5]{fa}. On may also see \cite[Proposition 6.2]{Xie2015}. In \cite[Proposition 6.2]{Xie2015}, $f$ is assumed to be birational, but its proof works for arbitrary dominant rational self-map. Now assume that $\text{tr.d.}_{{\mathbb F}}{\mathbf{k}}\geq 1.$ There is a subfield $L$ of $K$ which is finitely generated over ${\mathbf{k}}$ such that $X,f$ are defined over $L.$ Let $B$ be a projective and normal variety over ${\mathbb F}$ such that $L={\mathbf{k}}.$ There is a $B$-scheme $\pi: X_B\to B$ and a rational self-map $f_B: X_B\dashrightarrow X_B$ over $B$ such that the geometric generic fiber of $(X_B,f_B)$ is $(X,f).$ Let $b$ be a general point of $B({\mathbb F})$ and denote by $(X_b,f_b)$ the fiber of $(X_B,f_B)$ above $b$. Then $V_b:=X_b\setminus I(f_B)$ and $f_b$ is dominant. Applying the case over $\overline{{\mathbb F}_p}$ to $(V_b, f_b|_{V_b})$, there is $x_b\in (V_b)_{f_b|_{V_b}}({\mathbb F}).$ Cutting by general hyperplanes of $X_B$, there is an irreducible subvariety $S$ of $X_B$ of dimension $\dim S=\dim B$ passing through $b$ with $\pi(S)=B.$ Then the generic point of $S$ defines a point $x\in X_f({\mathbf{k}})$, which concludes the proof. \endproof \subsection{Tautological upper bound} The following lemmas was proved in characteristic zero, but their proof works in any characteristic. \begin{lemma}\cite[Lemma 2.15]{Jia2021}\label{l_inv_fun_field} Let $K$ be an algebraically closed field extension of ${\mathbf{k}}$. Then ${\mathbf{k}}(X)^{f}= {\mathbf{k}}$ if and only if, $K(X_{K})^{f_{K}}= K$. \end{lemma} \begin{lem}\cite[Lemma 2.1]{Xie2019}\label{leminvratfunite}Let $X'$ be an irreducible variety over ${\mathbf{k}}$, $f': X'\dashrightarrow X'$ be a rational self-map and $\pi: X'\dashrightarrow X$ be a generically finite dominant rational map satisfying $f\circ \pi=\pi\circ f',$ then we have the following properties. \begin{points} \item If there exists $m\geq 1$, and $H\in {\mathbf{k}}(X)^{f^m}\setminus {\mathbf{k}}$, then there exists $G\in {\mathbf{k}}(X)^f\setminus {\mathbf{k}}$. \item There exists $H'\in {\mathbf{k}}(X')^{f'}\setminus {\mathbf{k}}$, if and only if there exists $H\in {\mathbf{k}}(X)^f\setminus {\mathbf{k}}$. \end{points} \end{lem} They show that the assumption ${\mathbf{k}}(X)^f={\mathbf{k}}$ is stable under base change, under positive iterate and under semiconjugacy by generaically finite dominant morphism. As an example of realization problems, the author asked the following question in \cite[Section 1.6]{Xie2019}. \begin{que}\label{querealzdo} What is the minimal transcendence degree $R({\mathbf{k}}, X, f)$ of an algebraically closed field extension $K$ of ${\mathbf{k}}$ such that $(X_K,f_K)$ satisfies the ZDO property? \end{que} Proposition \ref{protautzdo} gives a tautological upper bound of $R({\mathbf{k}}, X, f)$. \proof[Proof of Proposition \ref{protautzdo}] We may assume that ${\mathbf{k}}(X)^f= {\mathbf{k}}$. By Lemma \ref{l_inv_fun_field}, $K(X_{K})^{f_{K}}= K$. An irreducible $f_K$-invariant variety $V$ is said to be maximal, if the only irreducible $f_K$-invariant variety $W$ containing $V$ is $X_K.$ We note that $I(f_K)=I(f)\otimes_{{\mathbf{k}}}K$ is defined over ${\mathbf{k}}.$ \begin{lem}\label{leminvaroverk}Let $V$ be an irreducible $f_K$-invariant variety. Then $V$ is over defined over ${\mathbf{k}}.$ \end{lem} \proof[Proof of Lemma \ref{leminvaroverk}] Set $r:=\dim V<d_X.$ There is a subfield $L$ of $K$ which is finitely generated over ${\mathbf{k}}$ such that $V$ is defined over $L.$ Let $B$ be a projective and normal variety over ${\mathbf{k}}$ such that $L={\mathbf{k}}(B).$ Then there is a subvariety $V_B$ of $X\times B$ such that $\pi_2(V_B)=B$ where $\pi_2: X\times B\to B$ is the projection to the second coordinate and $V=V_{\eta}\times_{L}K$ where $\eta$ is the generic point of $B$ and $V_{\eta}$ is the generic fiber of $\pi_2|_{V_B}.$ We have $\dim V_B=\dim B+r.$ Since $V$ is $f_K$-invariant, $V_B\subseteq X\times B$ is $f_B:=f\times {\rm id}$ invariant. Consider $\pi_1: X\times B\to B$ the projection to the first coordinate. It is clear that $\pi_1(V)$ is irreducible and $f$-invariant. Since $V\subseteq \pi_1(V)_K$ and $V$ is maximal, we get either $V_B=\pi_1^{-1}(\pi_1(V_B))$ or $\pi_2(V_B)=X.$ In the former case $V=\pi_1(V_B)_{K}$ is defined over ${\mathbf{k}}.$ Now we assume that $\pi_2(V_B)=X.$ Then $\dim B= \dim V_B-r\geq d_X-r\geq 1$ and ${\mathbf{k}}\subsetneq \pi_2^*({\mathbf{k}}(B))\subseteq {\mathbf{k}}(V_B)^{f_B|_{V_B}}.$ If $\dim V_B=d_X$, we conclude the proof by Lemma \ref{leminvratfunite}. Now assume that $\dim V_B\geq d_X+1.$ So a general fiber of $\pi_1|_{V_B}$ has dimension $s\geq 1$. We have $\dim B=d_X+s-r>s.$ Let $H_1, \dots, H_2$ be very ample divisors on $B$ which are general in their linear system. Then the intersection of $\pi_2^{-1}(H_i), i=1,\dots,s$ and a general fiber of $\pi_1|_{V_B}$ is of dimension $0$ and $W':=V_B\cap H_1\dots \cap H_s$ is $f_B$-invariant. Because $\pi_1(W')=X,$ there is an irreducible component $W$ of $W'$ with $\pi_1(W)=X$ and there is $l\geq 1$ such that $W$ is $f^l$-invariant. Because $d_X=\dim W$ and $\dim\pi_2(W)=d_X-r>0.$ So ${\mathbf{k}}\subsetneq{\mathbf{k}}(W)^{(f_B|_W)^l},$ which is a contradiction by Lemma \ref{leminvratfunite}. \endproof We only need to treat the case $\text{tr.d.}_{{\mathbf{k}}}K=d.$ So we may assume that $K=\overline{{\mathbf{k}}(X)}.$ The diagonal $\Delta$ of $X\times X$ defines a point $o$ in $X_K(K).$ Here we view $X_K$ as the geometric generic fiber of the second projection $\pi_2: X\times X\to X.$ Because $\pi_1(\Delta)=X$ where $\pi_1: X\times X\to X$ is the first projection, $O_{f_K}(o)$ is well defined and for every $n\geq 0$, $f_K^n(o)$ is not contained in any proper subvariety of $X_K$ defined over ${\mathbf{k}}.$ An irreducible component $W$ of $\overline{O_{f_K}(o)}$ of maximal dimension is $f_K$-periodic and does not contained in any proper subvariety of $X_K$ defined over ${\mathbf{k}}.$ By Lemma \ref{leminvaroverk}, $W=X_K$ which concludes the proof. \endproof In fact, with a slight modification, we prove a stronger result related to the strong form of the Zariski dense orbit conjecture \cite[Conjecture 1.4]{Xie2019}. \begin{pro}\label{protautstzdo}Assume that ${\mathbf{k}}(X)^f={\mathbf{k}}.$ Let $K$ be an algebraically closed field extension of ${\mathbf{k}}$ with $\text{tr.d.}_{{\mathbf{k}}}K\geq \dim X$. Then for every nonempty Zariski open subset $U$ of $X_K$, there is a point $x\in U(K)$ whose $f_K$-orbit is well defined and contained in $U.$ \end{pro} \proof[Proof of Proposition \ref{protautstzdo}]Keep the notation in the proof of Proposition \ref{protautzdo}. Pick a general point $b\in X({\mathbf{k}}).$ Then $U_b:=X\setminus\overline{(X_K\cap U)}$ is not empty. By Proposition \ref{proxfnonempty}, there is $x_b\in U_b$, whose $f$ orbit is well defined and contained in $U_b.$ Cutting by general hyperplanes of $X\times X$, there is an irreducible subvariety $S$ of $X\times X$ of dimension $\dim S=\dim X$ passing through $(x_b,b)$ such that $\pi_1(S)=X$ and $\pi_2(S)=X.$ The generic point of $S$ defines a point in $x\in X_K(K).$ Then the $f_K$-orbit of $x$ is well defined and contained in $U.$ After replacing $o$ by $x$, the argument in the last paragraph of the proof of Proposition \ref{protautzdo} shows that $O_{f_K}(x)$ is Zariski dense in $X_K.$ \endproof \subsection{Height argument} The aim of this section is to prove Theorem \ref{thmendononpre}, \ref{thmzdosuraut} and \ref{thmzdola}. Assume that ${\rm char}\, {\mathbf{k}}=p>0$ and $\text{tr.d.}_{\overline{F_p}} {\mathbf{k}}\geq 1.$ Let $f: X\to X$ be a dominant endomorphism of a projective variety. There is a algebraically closed subfield $K$ of ${\mathbf{k}}$ such that $\text{tr.d.}_K{\mathbf{k}}=1.$ So there is smooth projective curve $B$ over $K$, such that $f,X$ are defined over $K(B).$ The Weil heights appeared in the section are associated to the function field $K(B).$ \proof[Proof of Theorem \ref{thmendononpre}] By Corollary \ref{cordenseal}, there exists a point $x\in U({\mathbf{k}})$ with $\alpha_f(x)=\lambda_1(f)>1$ and $O_f(x)\subseteq U$. So $x$ has infinite orbit. \endproof \proof[Proof of Theorem \ref{thmzdola}]The proof of \cite[Proposition 8.6]{Jia2021} shows that for every $f$-periodic proper subvariety $V$ of period $m\geq 1,$ $\lambda_1(f^m|_V)<\lambda_1(f^m).$ By Propositon \ref{proextarhitd}, there exists a point $x\in X({\mathbf{k}})$ with $\alpha_f(x)=\lambda_1(f)>1$. Let $W$ be an irreducible component of $\overline{O_f(x)}$ of maximal dimension. There is $m\geq 1$ with $f^m(W)=W.$ There is $l\geq 0$ such that $f^l(x)\in W$. If $W\neq X$, by Proposition \ref{proupboundarth} and Lemma \ref{lem_subvar}, we get $$\lambda_1(f)^m=\overline{\alpha}_{f}(x)^m=\overline{\alpha}_{f^m}(f^l(x))\leq \lambda_1(f^m|_W)<\lambda_1(f)^m.$$ We get a contradiction. So $W=X$, which concludes the proof. \endproof The following theorem was proved in \cite[Theorem 1]{Invarianthypersurfaces}, but when $f$ is an automorphism, its proof work in arbitrary characteristic. \begin{thm}\label{thminvhyper}If $f$ is an automorphism and it preserves infinitely many (not necessarily irreducible) hyperplanes, then ${\mathbf{k}}(X)^f\neq {\mathbf{k}}.$ \end{thm} \begin{pro}\label{proautbounded}Let $X$ be a projective variety over ${\mathbf{k}}$ of dimension $d_X$. Let $L$ be an ample line bundle on $X$. Let $f: X\to X$ be an automorphism such that $((f^n)^*L\cdot L^{d_X-1}),n\geq 0$ is bounded. Then $(X,f)$ satisfies the ZDO property. \end{pro} \proof[Proof of Proposition \ref{proautbounded}] Let ${\rm Aut}(X)$ be the scheme of automorphisms of $X.$ Every connected component of ${\rm Aut}(X)$ is a variety over ${\mathbf{k}}$, but ${\rm Aut}(X)$ may have infinite connected component. Because $((f^n)^*L\cdot L^{d_X-1}),n\geq 0$ is bounded, the Zariski closure $G$ of $f^n, n\geq 0$ in ${\rm Aut}(X)$ is a commutative algebraic group. After replacing $f$ by a suitable iterate, we may assume that $G$ is irreducible. We may assume that $f$ is of infinite order. So $\dim G\geq 1.$ For every $x\in X({\mathbf{k}})$, $\overline{O_f(x)}=\overline{G.x}$. Consider the morphism $\Phi: G\times X\to X\times X$ sending $(g,x)$ to $(g(x),x)$. Denote by $\pi_i: X\times X\to X$ the $i$-th projection. Consider the $G$-action on $X\times X$ by $g.(x,y)=(g(x),y).$ Set $F:=f\times {\rm id}: X\times X\to X\times X.$ The image $W$ of $\Phi$ is a constructible subset of $X\times X$. Let $Y$ be the Zariski closure of $W$ in $X\times X$. It is irreducible and $F$-invariant. Let $\Delta$ be the diagonal of $X\times X.$ Then $\Delta\subseteq W\subseteq Y.$ So $\pi_1(Y)=\pi_2(Y)=X.$ Because $\dim G\geq 1$ and the action of $G$ on $X$ is faithful, $Y\neq \Delta.$ So the general fiber of $\pi_2|_{Y}$ has dimension $r\geq 1.$ If $r=\dim X$, then for a general $x\in X({\mathbf{k}})$, $\overline{O_f(x)}=\overline{G.x}=X$ which concludes the proof. Now assume that $r<\dim X.$ We have $\dim Y=\dim X+r.$ The general fiber of $\pi_1|_{Y}$ also has dimension $r\geq 1.$ Let $H_1,\dots,H_r$ be very ample hyperplanes of $X$ which are general in their linear system. The intersection of $\pi_2^*H_1,\dots, \pi_2^*H_r$ and a general fiber of $\pi_1|_{Y}$ is proper. Set $Z:=\pi_2^{-1}(\cap_{i=1}^r H_i).$ We have $\pi_1(Z)=X$, $\dim Z=\dim X$ and $\dim\pi_2(Z)=\dim(H_1\cap \dots \cap H_r)=\dim X-r\geq 1.$ Because $G$ is connected, every irreducible component of $Z$ is $G$-invariant. In particular, let $T$ be an irreducible component of $Z$ with $\pi_1(T)=X$, then $T$ is $F$ invariant and we have $\dim T=\dim X$, $\dim\pi_2(T)=\dim X-r\geq 1.$ Because ${\mathbf{k}}\subsetneq {\mathbf{k}}(T)^{F|_T}$ and $\pi_1\circ F|_T=f\circ \pi_2,$ we conclude the proof by Lemma \ref{leminvratfunite}. \endproof \begin{thm}\label{thmzdosuraut}Assume that ${\rm char}\, {\mathbf{k}}=p>0$ and $\text{tr.d.}_{\overline{F_p}} {\mathbf{k}}\geq 1.$ Let $f: X\to X$ be an automorphism of a projective surface. Then $(X,f)$ satisfies the ZDO property. \end{thm} \proof[Proof of Theorem \ref{thmzdosuraut}] By \cite{Lipman1978}, there is a minimal desingularization $\pi:X'\to X$. Then one may lift $f$ to an automorphism $f'$ of $X'.$ Easy to see that $(X,f)$ satisfies the ZDO property if and only if $(X',f')$ satisfies the ZDO property. After replacing $(X,f)$ by $(X',f')$, we may assume that $X$ is smooth. By Theorem \ref{thmzdola}, we may assume that $\lambda_1(f)=1.$ Let $L$ be an ample line bundle on $X$. If $((f^n)^*L\cdot L), n\geq 0$ is unbounded, by Gizatullin \cite{Gizatullin1980}, there is a surjective morphism $\pi: X\dashrightarrow C$ to a smooth projective curve $C$ and an automorphism $f_C: C\to C$ such that $f_C\circ \pi=\pi\circ f.$ \footnote{In \cite{Gizatullin1980}, there is an assumption that ${\rm char}\, {\mathbf{k}}\neq 2,3.$ But, it is checked in \cite{Cantat2019a} that such assumption in \cite{Gizatullin1980} can be removed.} After replacing $\pi:X\dashrightarrow C$ by a minimal resolution of $\pi$, we may assume that $\pi$ is a morphism. There is $m\geq 1$ such that $f_C^m={\rm id}$, we have ${\mathbf{k}}\subsetneq \pi^*({\mathbf{k}}(C)^{f_C})\subseteq {\mathbf{k}}(X)^f$. Now we may assume that $((f^n)^*L\cdot L), n\geq 0$ is bounded. We conclude the proof by Proposition \ref{proautbounded}. \endproof \section{Ergodic theory}\label{sectionergodictheory} Let $X$ be a variety over ${\mathbf{k}}$. Denote by $|X|$ the underling set of $X$ with the constructible topology i.e. the topology on a $X$ generated by the constructible subsets. This topology is finer than the Zariski topology on $X.$ Moreover $|X|$ is (Hausdorff) compact. Denote by $\eta$ the generic point of $X$. \medskip Using the Zariski topology, on may define a partial ordering on $|X|$ by $x\geq y$ if and only if $y\in \overline{x}.$ The noetherianity of $X$ implies that this partial ordering satisfies the descending chain condition: for every chain in $|X|$, $$x_1\geq x_2\geq \dots$$ there is $N\geq 1$ such that $x_n=x_N$ for every $n\geq N.$ For every $x\in |X|$, the Zariski closure of $x$ in $X$ is $U_x:=\overline{\{x\}}=\{y\in |X||\,\, y\leq x\}$ which is open and closed in $|X|.$ \medskip Let ${\mathcal M}(X)$ be the space of Radon measure on $X$ endowed with the weak-$\ast$ topology and ${\mathcal M}^1(|X|)$ be the space of probability Radon measure on $|X|.$ Note that ${\mathcal M}^1(|X|)$ is compact. \proof[Proof of Theorem \ref{thmRadon}] We claim that for every Radon measure $\mu$ on $|X|$ with $\mu(|X|)>0$, there exists $x\in X$ such that $\mu(x)>0.$ \medskip Then for every Radon measure $\mu$ on $|X|$, set $S(\mu):=\{x\in |X||\,\, \mu(x)>0\}.$ Then $S(\mu)$ is at most countable and we have $c:=\sum_{x\in S(\mu)}\mu(x)\in (0,\mu(|X|)].$ If $c=\mu(|X|)$, then we have $\mu=\sum_{x\in S(\mu)}\mu(x)\delta_x$, which concludes the proof. Assume that $c<\mu(|X|)$, set $$\alpha:=\mu-\sum_{x\in S(\mu)}\mu(x)\delta_x.$$ Then $\alpha$ is a Radon measure with $\alpha(|X|)=\mu(|X|)-c>0$ and $S(\alpha)=\emptyset$. This contradicts our claim. \medskip Now we only need to prove the claim. \begin{lem}\label{lemfindnexp}For $x\in |X|$, if $\mu(U_x)>0$ and $\mu(x)=0$, then there exists $y\in U_x\setminus \{x\}$ such that $\mu(U_y)>0.$ \end{lem} Now assume that for every $x\in |X|$, $\mu(x)=0.$ Since $|X|=\cup_{x\in X}U_x$ and $|X|$ is compact, there exists a finite subset $F$ of $|X|$ such that $|X|=\cup_{x\in F}U_x.$ Then there exists $x_0\in F$ such that $\mu(U_{x_0})>0.$ Since $\mu(x_0)=0$ by the assumption, by Lemma \ref{lemfindnexp}, we get a sequence of points $x_i, i\geq 0$, $x_i> x_{i+1}$ such that $\mu(U_{x_i})>0, \mu(x_i)=0.$ This contradicts the descending chain condition. \endproof \proof[Proof of Lemma \ref{lemfindnexp}] Observe that $U_x\setminus \{x\}$ is open and $\mu(U_x\setminus \{x\})>0.$ Since $\mu$ is Radon, there exists a compact subset $K\subseteq U_x\setminus \{x\}$ such that $\mu(K)>0.$ Since $K\subseteq \cup_{z\in K}U_z$, there exists a finite set $x_1,\dots,x_m$ in $K$ such that $K\subseteq \cup_{i=1}^mU_{x_i}.$ Since $\sum_{i=1}^m\mu(U_{x_i})\geq \mu(K)>0,$ there exists some $1\leq i\leq m$ such that $\mu(U_{x_i})>0.$ Set $y:=x_i$, we concludes the proof. \endproof \proof[Proof of Corollary \ref{corgenericseqence}] Let $x_n\in X, n\geq 0$ be a sequence of points. We first assume that $x_n\in X, n\geq 0$ is generic. Because ${\mathcal M}^1(|X|)$ is compact, we only need to show that for every subsequence with $\lim_{i\to \infty}\delta_{x_{n_i}}=\mu$, we have $\mu=\delta_{\eta}.$ By Theorem \ref{thmRadon}, we may write $$\mu=\sum_{i\geq 0}^ma_i\delta_{x_i}$$ where $m\in {\mathbb Z}_{\geq 0}\cup \{\infty\}$, $x_i$ are distinct points, $a_i> 0$ and $\sum_{i\geq 0}a_i=1.$ If $\mu\neq \delta_{\eta},$ we may assume that $x_0\neq \eta.$ Then $V:=\overline{\{x_0\}}$ is a closed proper subvariety of $X.$ Then we have $$1_{V}(x_{n_i})=\int 1_V\delta_{x_{n_i}}\to \int 1_V\mu>a_0$$ as $n\to \infty.$ So $x_{n_i}\in V$ for all but finitely many $i$, which is a contradiction. Now assume that $\lim_{n\to \infty}\delta_{x_{n}}=\delta_{\eta}.$ For every subsequence $x_{n_i}, i\geq 0$ and every closed proper subvariety $V$ of $X,$ $$\lim_{i\to\infty}1_V(x_{n_i})=\lim_{i\to\infty}\int1_V\delta_{x_{n_i}}=\int 1_V\delta_{\eta}=0.$$ So $x_{n_i}\not\in V$ for all but finitely many $i$. So $x_{n_i}$ is Zariski dense in $X$. \endproof \subsection{DML problems} Let $f: X\dashrightarrow X$ be a dominant rational self-map. Set $|X|_f:=|X|\setminus (\cup_{i\geq 1}I(f^i)).$ Because every Zariski closed subset of $X$ is open and closed in the constructible topology, $|X|_f$ is a closed subset of $|X|.$ The restriction of $f$ to $|X|_f$ is continuous. We still denote by $f$ this restriction. \medskip Denote by ${\mathcal P}(X,f)$ the set of $f$-periodic points in $|X|_f.$ Theorem \ref{thmRadon} implies directly the following lemma. \begin{lem}\label{leminvm}If $\mu\in {\mathcal M}^1(|X|_f)$ with $f_*\mu=\mu$, then there are $x_i\in {\mathcal P}(X,f), i\geq 0$ and $a_i\geq 0, i\geq 0$ with $\sum_{i=0}a_i=1$ such that $$\mu=\sum_{i\geq 0}\frac{a_i}{\#O_f(y)}(\sum_{y\in O_f(x_i)}\delta_y)$$ \end{lem} Now we prove Theorem \ref{thmdml} and Theorem \ref{thmdmlback}. \proof[Proof of Theorem \ref{thmdml}] Let $x$ be a points $\in X_f({\mathbf{k}})$ with $\overline{O_f(x)}=X.$ Let $V$ be a proper subvariety of $X$. Consider a sequence of intervals $I_n, n\geq 0$ in ${\mathbb Z}_{\geq 0}$ with $\lim\limits_{n\to \infty}\# I_n=+\infty$. For every $n\geq 0$, set $\mu_n:=(\#I_n)^{-1}(\sum_{i\in I_n}\delta_{f^i(x)})\in {\mathcal M}^1(|X|_f).$ Because $$\frac{\#(\{n\geq 0|\,\, f^n(x)\in V\}\cap I_n)}{\#I_n}=\int 1_V\mu_n,$$ we only need to show that \begin{equation}\label{equlimmundml}\lim_{n\to \infty}\mu_n=\delta_{\eta}.\end{equation} Because ${\mathcal M}^1(|X|)$ is compact, we only need to show that for every convergence subsequence $\mu_{n_i}, i\geq 0$, $\mu_{n_i}\to \delta_{\eta}$ as $i\to \infty.$ Set $\mu:=\lim_{n\to \infty}\mu_{n_i}.$ We have $$f_*\mu=\lim_{n\to \infty}f_*\mu_{n_i}=\lim_{i\to \infty}\mu_{n_i}+\lim_{i\to \infty}(\#I_{n_i})^{-1}(\delta_{f^{\max I_{n_i}+1}(x)}-\delta_{f^{\min I_{n_i}}(x)})$$ $$=\lim_{i\to \infty}\mu_{n_i}=\mu.$$ For every $y\in {\mathcal P}(X,f)\setminus\{\eta\}$, $U_y$ is open and closed in $|X|_f.$ Then $$Y:=|X|_f\setminus (\cup_{y\in {\mathcal P}(X,f)}U_y)$$ is an $f$-invariant closed proper subset of $|X|_f.$ Because $\overline{O_f(x)}=X,$ $x\in Y$. So for every $n\geq 0$, ${\rm Supp}\, \mu_n\subseteq Y.$ Because $Y\cap {\mathcal P}(X,f)=\{\eta\},$ Lemma \ref{leminvm} shows that $\mu=\delta_{\eta}.$ \endproof \proof[Proof of Theorem \ref{thmdmlback}] Let $x_n \in X_f({\mathbf{k}}), n\leq 0$ be a sequence of points such that $\overline{\{x_n, n\leq 0\}}=X$ and $f(x_n)=x_{n+1}$ for all $n\leq -1.$ Consider a sequence of intervals $I_n, n\geq 0$ in ${\mathbb Z}_{\leq 0}$ with $\lim\limits_{n\to \infty}\# I_n=+\infty$. For $n\geq 1,$ define $x_n:=f^n(x_0).$ For every $n\geq 0$, set $\mu_n:=(\#I_n)^{-1}(\sum_{i\in I_n}\delta_{x_i})\in {\mathcal M}^1(|X|_f).$ As the proof of Theorem \ref{thmdml}, we only need to show \begin{equation}\label{equlimmunbackdml}\lim_{n\to \infty}\mu_n=\delta_{\eta}.\end{equation} Because ${\mathcal M}^1(|X|)$ is compact, we only need to show that for every convergence subsequence $\mu_{n_i}, i\geq 0$, $\mu_{n_i}\to \delta_{\eta}$ as $i\to \infty.$ Set $\mu:=\lim_{n\to \infty}\mu_{n_i}.$ We have $$f_*\mu=\lim_{n\to \infty}f_*\mu_{n_i}=\lim_{i\to \infty}\mu_{n_i}+\lim_{i\to \infty}(\#I_{n_i})^{-1}(\delta_{x_{\max I_{n+1}+1}}-\delta_{x_{\min I_{n+1}+1}})$$ $$=\lim_{i\to \infty}\mu_{n_i}=\mu.$$ For every $y\in {\mathcal P}(X,f)\setminus \{\eta\},$ $U_y\cap \{x_i, i\leq 0\}$ is finite. Otherwise $\{x_i, i\leq 0\}\subseteq \cup_{z\in O_f(y)}U_z$ is not Zariski dense in $X.$ This implies that $\mu(U_y)=\lim_{i\to \infty}\mu_{n_i}(U_y)=0.$ So ${\rm Supp}\, \mu\subseteq Y:=|X|_f\setminus (\cup_{y\in {\mathcal P}(X,f)}U_y).$ Because $Y\cap {\mathcal P}(X,f)=\{\eta\},$ Lemma \ref{leminvm} shows that $\mu=\delta_{\eta}.$ \endproof \subsection{Functoriality}\label{subsecfunct} Assume that $f: X\to X$ is a flat and finite endomorphism. Because the image by $f$ of every constructible subset is constructible, $f$ is open w.r.t the constructible topology. Moreover, for every $x\in X$, $f(U_x)=U_{f(x)}.$ \medskip Denote by $C(|X|)$ the space of continuous ${\mathbb R}$-valued functions on $|X|$ with the $L_{\infty}$ norm $\|\cdot\|.$ For every $\phi\in C(|X|)$, define $f_*\phi$ to be the function $$x\in |X| \mapsto f_*\phi:=\sum_{y\in f^{-1}(x)}m_f(y)\phi(y).$$ The following Lemma shows that $f_*$ is a bounded linear operator on $C(|X|).$ \begin{lem}\label{lempushffun}For every $\phi\in C(|X|)$, $f_*\phi$ is continuous and $\|f_*\phi\|\leq d_f\|\phi\|.$ \end{lem} \proof By \cite[Proposition 2.8]{Gignac2014a}, for every $x\in |X|$, there is an open subset $V_x\subseteq U_x$ containing $x$ such that $V_x=f^{-1}(f(V_x))\cap U_x$ and for every $y\in f(V_x)$, $$m_f(x)=\sum_{z\in f^{-1}(y)\cap V_x}m_f(z).$$ Because $\{x\}=f^{-1}(f(x))\cap U_x$, such $V_x$ can be taken arbritarily small. \medskip Because $\phi\in C(|X|),$ for every $x\in |X|$ and $r>0$, there is an open subset $V_x^r$ containing $x$ such that for every $y\in V_x^r$, $|\phi(y)-\phi(x)|<r.$ Let $w$ be a point in $|X|$. There are open neighborhoods $O_y$ of $y\in f^{-1}(w)$, such that for distinct $y_1,y_2\in f^{-1}(w),$ $O_{y_1} \cap O_{y_2}=\emptyset.$ For every $r>0$, and $y\in f^{-1}(w)$, we may take $V_y$ as in the first paragraph such that $V_y\subseteq O_y\cap V^{r/d_f}_y.$ Then $W^r_w:=\cap_{y\in f^{-1}(w)}f(V_y)$ is an open set containing $w.$ For every $x\in W^r_w$ and distinct $y_1,y_2\in f^{-1}(w)$, we have $$(f^{-1}(x)\cap V_{y_1})\cap (f^{-1}(x)\cap V_{y_2})=\emptyset.$$ Since $$d_f=\sum_{z\in f^{-1}(x)}m_f(z)\geq \sum_{y\in f^{-1}(w)}\sum_{z\in f^{-1}(x)\cap V_{y}}m_f(x)=\sum_{y\in f^{-1}(w)}m_f(y)=d_f,$$ we have $$f^{-1}(x)=\sqcup_{y\in f^{-1}(w)} (f^{-1}(x)\cap V_{y}).$$ Then we get $$|f_*\phi(x)-f_*\phi(w)|\leq \sum_{y\in f^{-1}(w)}|m_f(y)\phi(y)-\sum_{z\in V_y\cap f^{-1}(x)}m_f(z)\phi(z)|$$ $$\leq \sum_{y\in f^{-1}(w)}\sum_{z\in V_y\cap f^{-1}(x)}m_f(z)|\phi(y)-\phi(z)|< \sum_{y\in f^{-1}(w)}\sum_{z\in V_y\cap f^{-1}(x)}m_f(z)r/d_f=r.$$ So $f_*\phi$ is continuous. Moreover for every $x\in |X|$ $$f_*\phi(x)=|\sum_{y\in f^{-1}(x)}m_f(x)\phi(y)|\leq \sum_{y\in f^{-1}(x)}m_f(x)\|\phi\|=d_f\|\phi\|,$$ which concludes the proof.\endproof Now one may define the pullback $f^*:{\mathcal M}(|X|)\to {\mathcal M}(|X|)$ by the duality: for every $\mu\in {\mathcal M}(|X|)$ and $\phi\in C(|X|)$, $$\int \phi (f^*\mu)=\int (f_*\phi)\mu.$$ In particular, $f^*\mu(|X|)=d_f\mu(|X|).$ The pullback $f^*:{\mathcal M}(|X|)\to {\mathcal M}(|X|)$ is continuous w.r.t. the weak-$\ast$ topology on ${\mathcal M}(|X|)$ and one may check that for every $x\in |X|,$ $$f^*\delta_x=\sum_{y\in f^{-1}(x)}m_f(y)\delta(y).$$ \subsection{Backward orbits} Assume that $f: X\to X$ is a flat and finite endomorphism. In particular, $f$ is surjective. The aim of this section is to prove Theorem \ref{thmequpullback}, \ref{thmcountprestr} and \ref{thmseqd}. \medskip Let $TP(X,f)$ be the point $x\in |X|$ such that $\cup_{n\geq 0}f^{-n}(x)$ is finite. It is clear that $f^*TP(X,f)\subseteq TP(X,f).$ For $x\in TP(X,f)$, since $f:\cup_{n\geq 1}f^{-n}(x)\to \cup_{n\geq 0}f^{-n}(x)$ is surjective, it is bijective. So $x$ is periodic. Then $f^{-1}(TP(X,f))=TP(X,f)$ and for every $x\in TP(X,f)$, $f^{-1}(x)$ is a single point. For the simplicity, we still denote by $f^{-1}(x)$ the unique points in it. For every $x\in TP(X,f)$, $f^{-1}(U_x)=\cup_{y\in f^{-1}(x)}U_{f^{-1}(y)}.$ Then $$Y:=X\setminus \cup_{x\in TP(X,f)\setminus \{\eta\}}U_x$$ is a closed subset of $|X|$ such that $f^{-1}(Y)=f(Y)=Y.$ It is clear that $Y$ is exactly the subset of $x\in |X|$ such that $\overline{\cup_{i\geq 0}f^{-i}(x)}=X.$ \begin{lem}\label{lemtotinm}For $\mu\in {\mathcal M}(|X|)$ supported in $Y$, if $d_f^{-1}f^*\mu=\mu$, then $\mu=\delta_{\eta}.$ \end{lem} \proof Assume that $\mu\neq \delta_{\eta}.$ We may assume that $\mu(\eta)=0$. Otherwise, we may replace $\mu$ by $\mu-\mu(\eta)\delta_{\eta}.$ By Theorem \ref{thmRadon}, one may write $$\mu=\sum_{i= 0}^ma_i\delta_{x_i}$$ where $m\in {\mathbb Z}_{\geq 0}\cup \{\infty\}$, $x_i$ are distinct points in $Y\setminus \{\eta\}$, $a_i> 0$ and $\sum_{i\geq 0}a_i=1.$ We have $$\mu=d_f^{-1}f^*\mu=\sum_{i=0}^m\sum_{y\in f^{-1}(x)}\frac{a_im_f(y)}{d_f} \delta_y.$$ Terms in the right hand side have distinct supports. Assume that $a_i$ is decreasing. We claim that for every $i,$ $f^{-1}(x_i)$ is a single point. Otherwise, pick $l$ minimal such that $f^{-1}(x_l)$ is not a single point. Assume that $s\geq 0$ is maximal such that $a_{l+s}=a_l.$ Think $\mu$ as a function $\mu: |X|\to [0,1]$ sending $x$ to $\mu(x)$. We have $\mu^{-1}(a_l)=s+1.$ On the other hand $$(d_f^{-1}f^*\mu)^{-1}(a_l)=\{i=l,\dots,l+s|\,\, f^{-1}(x_i) \text{ is a single point}\}\leq s,$$ which is a contradiction. Then we get $\mu=\sum_{i=0}^ma_i\delta_{f^{-1}(x_i)}.$ Because for every $r>0$, $\{i=0,\dots,m|\,\, a_i\geq r\}$ is finite, all $x_i, i=0,\dots, m$ are contained in $TP(X,f)\cap (Y\setminus\{\eta\})=\emptyset.$ We get a contradiction. \endproof \medskip \proof[Proof of Theorem \ref{thmequpullback}] Let $x$ be a point in $X({\mathbf{k}})$ with $\overline{\cup_{i\geq 0}f^{-i}(x)}=X.$ Let $I_n, n\geq 0$ be a sequence of intervals in ${\mathbb Z}_{\geq 0}$ with $\lim_{n\to \infty}\# I_n=+\infty$. Set $$\mu_n:=\frac{1}{\#I_n}(\sum_{i\in I_n}d_f^{-i}(f^i)^*\delta_{x})\in {\mathcal M}^1(|X|).$$ Because ${\mathcal M}^1(|X|)$ is compact, only need to show that for every convergence subsequence $\mu_{n_i}, i\geq 0$, $\mu_{n_i}\to \delta_{\eta}$ as $i\to \infty.$ Set $\mu:=\lim_{n\to \infty}\mu_{n_i}.$ Then $$f^*\mu=\lim_{i\to \infty}f^*\mu_{n_i}=\lim_{i\to \infty}\frac{1}{\#I_n}(\sum_{j\in I_{n_i}}d_f^{-j}(f^{j+1})^*\delta_{x})$$ $$\lim_{i\to \infty}d_f\mu_{n_i}+\lim_{i\to \infty}\frac{d_f}{\#I_n}(d_f^{-\max I_{n_i}-1}(f^{\max I_{n_i}+1})^*\delta_{x}-d_f^{-\min I_{n_i}}(f^{\min I_{n_i}})^*\delta_{x})$$ Because $d_f^{-\max I_{n_i}-1}(f^{\max I_{n_i}+1})^*\delta_{x}(|X|)=d_f^{-\min I_{n_i}}(f^{\min I_{n_i}})^*\delta_{x}(|X|)=1,$ we get $$f^*\mu=\lim_{i\to \infty}d_f\mu_{n_i}=d_f\mu.$$ Because $x\in Y$, for every $n\geq 0$, ${\rm Supp}\, \mu_n\subseteq Y.$ So $\mu\subseteq Y.$ We conclude the proof by Lemma \ref{lemtotinm}. \endproof \proof[Proof of Theorem \ref{thmcountprestr}] Assume that ${\mathbf{k}}(X)/f^*{\mathbf{k}}(X)$ is separable. Let $x\in X({\mathbf{k}})$ be a point with $\overline{\cup_{i\geq 0}f^{-i}(x)}=X.$ Pick $c\in (0,1]$ Because $$\#f^n(x)\leq \sum_{y\in f^{-n}(x)}m_{f^n}(y)=d_f^n,$$ we have $$\limsup_{n\to \infty} (S^n_c)^{1/n}\leq \limsup_{n\to \infty} \#f^n(x)^{1/n}\leq d_f.$$ We now prove the inequality in the other direction. \medskip By \cite[Theorem 2.1]{Gignac2014a} and \cite[Proposition 2.3]{Gignac2014a}, there is a proper Zariski closed subset $R$ of $X$, such that for every $y\in X({\mathbf{k}})\setminus R,$ $m_f(y)=1.$ Set $$\mu_n:=\frac{1}{n}(\sum_{i=1}^{n}d_f^{-i}(f^i)^*\delta_{x})\in {\mathcal M}^1(|X|).$$ By Theorem \ref{thmequpullback}, \begin{equation}\label{equmutoz}\lim_{n\to \infty}\mu_n=\delta_{\eta}.\end{equation} \medskip Set $D:=\{1,\dots, d_f\}$. Let $\Omega:=\sqcup_{n\geq 0}D^n$ be the set of words in $D$ of finite length. In particular $D^{0}=\{\emptyset\}.$ By induction, one may define a map $$\phi: \Omega\to \sqcup_{n\geq 0} f^{-n}(x)\subseteq \sqcup_{n\geq 0} X$$ such that \begin{points} \item $\theta(D^n)=f^{-n}(x), $ in particular $\phi(\emptyset)=x.$ \item for every word $w_1\dots w_n\in D^n, n\geq 1,$ $$\theta(w_1\dots w_{n-1})=f(\theta(w_1\dots w_{n}));$$ \item for every $y\in f^{-n-1}(x)$ and $w_1\dots w_n\in D^n$ satisfying $\theta(w_1\dots w_{n})=f(y),$ $$\#\{w\in D|\,\, \theta(w_1\dots w_nw)=y\}=m_f(y).$$ \end{points} By \cite[Proposition 2.5]{Gignac2014a}, for every $y\in f^{-n-1}(x)$, $m_{f^{n+1}}(y)=m_{f^n}(f(y))m_f(y).$ This implies that for every $y\in f^{-n}(x),$ $$\#\{\omega\in D^n|\,\, \theta(\omega)=y\}=m_{f^n}(y).$$ Define a function $A:\Omega\to (0,1]$ by $$A: \omega\in D^n\mapsto m_{f^n}(\theta(\omega))^{-1}.$$ We have \begin{points} \item $\sum_{\omega\in D^n}A(\omega)=\#f^{-n}(x);$ \item for every $w_1\dots w_{n+1}\in D^{n+1}$, $$A(w_1\dots w_{n+1})=m_f(\theta(w_1\dots w_{n+1}))^{-1}A(w_1\dots w_{n}).$$ \end{points} We have $A(\emptyset)=1$ and $$A(w_1\dots w_{n+1})\geq d_f^{-1_R(\theta(w_1\dots w_{n+1}))}A(w_1\dots w_{n}).$$ Then we have $$\prod_{\omega\in D^{n+1}}A(\omega)=\prod_{\omega\in D^{n}}\prod_{w\in D}A(\omega w)\geq \prod_{\omega\in D^{n}}\prod_{w\in D}d_f^{-1_R(\theta(w_1\dots w_{n+1}))}A(\omega)$$ $$=(\prod_{\omega\in D^{n+1}}d_f^{-1_R(\theta(\omega))})(\prod_{\omega\in D^{n}}A(\omega))^{d_f}=d_f^{-\int1_R(f^{n+1})^*\delta_x}(\prod_{\omega\in D^{n}}A(\omega))^{d_f}.$$ Set $B_n:=\log_{d_f}\prod_{\omega\in D^{n}}A(\omega).$ We get $$B_{n+1}/d_f^{n+1}\geq -d_f^{-n-1}\int1_R(f^{n+1})^*\delta_x+B_{n}/d_f^n.$$ Then we get $$B_n/d_f^{n}\geq \sum_{i=1}^{n}-d_f^{-i}\int1_R(f^{i})^*\delta_x=-n\int 1_R\mu_n.$$ For every $n\geq 0$, pick $E_n\subseteq f^{-n}(x)$, such that $$\sum_{y\in E_n}m_{f^n}(y)\geq cd_f^n$$ and $\#E_n=S^n_c.$ So $$\#\theta^{-1}(E_n)=\sum_{y\in E_n}m_{f^n}(y)\geq cd_f^n.$$ By Inequality of arithmetic and geometric means, we have $$S^n_c=\sum_{\omega\in \theta^{-1}(E_n)}A(\omega)\geq \#\theta^{-1}(E_n)(\prod_{\omega\in \theta^{-1}(E_n)}A(\omega))^{\frac{1}{\#\theta^{-1}(E_n)}}$$ $$\geq cd_f^n(\prod_{\omega\in \theta^{-1}(E_n)}A(\omega))^{\frac{1}{cd_f^n}}\geq cd_f^n(\prod_{\omega\in D^n}A(\omega))^{\frac{1}{cd_f^n}}$$ $$=cd_f^{n+B_n/cd_f^{n}}\geq cd_f^{n(1-c^{-1}\int 1_R\mu_n)}.$$ So $(S^n_c)^{1/n}\geq c^{1/n}d_f^{1-\int 1_R\mu_n}.$ By Equality \ref{equmutoz}, $$\liminf_{n\geq 0}(S^n_c)^{1/n}\geq d_f,$$ whcih concludes the proof. \endproof \medskip \proof[Proof of Theorem \ref{thmseqd}] Set $d_X:=\dim X.$ Assume that ${\mathbf{k}}(X)/f^*{\mathbf{k}}(X)$ is separable and $$\lambda_{\dim X}(f)>\max_{1\leq i\leq \dim X-1} \lambda_i.$$ Let $x$ be a point in $X({\mathbf{k}})$ with $\overline{\cup_{i\geq 0}f^{-i}(x)}=X.$ \medskip We first show that for every irreducible subvariety $V$ of $X$ of $\dim V=d_V<d_X$, \begin{equation}\label{equintvnum}\limsup_{n\to \infty}\#(f^{-n}(x)\cap V)^{1/n}\leq \lambda_{d_V}. \end{equation} Let $Y$ be a normal and projective variety containing $X$ as an Zariski dense open subset. Let $Z$ be the Zariski closure of $V$ in $W.$ Let ${\mathcal I}_Z$ be the ideal sheaf associated to $Z.$ Let $H$ be a very ample divisor on $Y$ such that ${\mathcal O}(H)\otimes {\mathcal I}_Z$ is generated by global sections. For every $n\geq 0,$ consider the following commutative diagram \[ \xymatrixcolsep{3.5pc} \xymatrix{ \Gamma_n\ar[d]_{\pi_1^n}\ar[dr]^{\pi_2^n}\\ Y \ar@{-->}[r]_{f^n} & Y } \] where $\pi_1^n$ is birational and it is an isomorphism above $X.$ There are $H_1,\dots, H_{d_X-d_V}\in |H|$ such that the intersection of $H_1,\dots, H_{d_X-d_V}$ is proper, $V$ is an irreducible component of $\cap_{i=1}^{d_X-d_V}H_i$ and $V$ is the unique irreducible component meeting $f^{-n}(x)\cap V.$ Take $H_1',\dots, H_{d_V}'$ general in those elements of $|H|$ containing $x.$ Then the intersection of $H_1',\dots, H_{d_V}'$ and $f(V)$ at $x$ is proper. Since $f$ is finite, the intersection of $f^{*}(H_1'),\dots, f^*H_{d_V}'$ and $V$ is proper at every $y\in f^{-n}(x)\cap V.$ We have $$(\pi_1^n)^{-1}(f^{-n}(x)\cap V)\subseteq (\cap_{i=1}^{d_X-d_V}(\pi_1^n)^*H_i)\cap(\cap_{i=1}^{d_V}(\pi_2^n)^*H_i'),$$ and every point $y\in (\pi_1^n)^{-1}(f^{-n}(x)\cap V)$ is isolated in $(\cap_{i=1}^{d_X-d_V}(\pi_1^n)^*H_i)\cap(\cap_{i=1}^{d_V}(\pi_2^n)^*H_i').$ By \cite[Lemma 3.3]{Jia2021}, $$(H^{d_X-d_V}\cdot(f^{n})^*H^{d_V})=((\pi_1^{n})^*H_1\cdot \dots \cdot (\pi_1^{n})^*H_{d_X-d_V}\cdot (\pi_2^{n})^*H_1'\cdot \dots \cdot (\pi_2^{n})^*H_{d_V}')$$ $$\geq \#(\pi_1^n)^{-1}(f^{-n}(x)\cap V)=\#(f^{-n}(x)\cap V).$$ Then we get $$\limsup_{n\to \infty}\#(f^{-n}(x)\cap V)^{1/n}\leq \lim_{n\to \infty}(H^{d_X-d_V}\cdot(f^{n})^*H^{d_V})^{1/n}=\lambda_{d_V}.$$ \medskip Now we only need to show $$\lim_{n\to \infty}d_f^{-n}(f^n)^*\delta_x=\delta_{\eta}.$$ Because ${\mathcal M}^1(|X|)$ is compact, only need to show that for every convergence subsequence $d_f^{-n_i}(f^{n_i})^*\delta_{x}, i\geq 0$, $\lim_{i\to \infty}d_f^{-n_i}(f^{n_i})^*\delta_{x}=\delta_{\eta}.$ Set $\mu:=\lim_{i\to \infty}d_f^{-n_i}(f^{n_i})^*\delta_{x}.$ By Theorem \ref{thmRadon}, we may write $$\mu=\sum_{i\geq 0}^ma_i\delta_{x_i}$$ where $m\in {\mathbb Z}_{\geq 0}\cup \{\infty\}$, $x_i$ are distinct points, $a_i> 0$ and $\sum_{i\geq 0}a_i=1.$ Assume that $\mu\neq \delta_{\eta}$. Then we may assume that $a_0>0$ and $x_0\neq \eta.$ Set $r:=\overline{\{x_0\}}<d_X.$ Then $$\int 1_{U_{x_0}}\mu\geq \int 1_{U_{x_0}}a_0\delta_{x_0}=a_0.$$ Pick $c\in (0,a_0).$ Then there is $N\geq 0$ such that for every $i\geq N$, $$\frac{\sum_{y\in f^{-n_i}(x)\cap \overline{\{x_0\}}}m_{f^{n_i}}(y)}{d_f^{n_i}}=\int 1_{U_{x_0}}d_f^{-n_i}(f^{n_i})^*\delta_{x}\geq c.$$ So $\sum_{y\in f^{-n_i}(x)\cap \overline{\{x_0\}}}m_{f^{n_i}}(y)\geq cd_f^{n_i},$ then $\#(f^{-n_i}(x)\cap \overline{\{x_0\}})\geq S_c^{n_i}.$ By Theorem \ref{thmcountprestr} and Inequality \ref{equintvnum}, we get $$d_f>\lambda_{r}\geq \limsup_{i\to \infty}(\#(f^{-n_i}(x)\cap \overline{\{x_0\}}))^{1/n_i}\geq \liminf_{i\to \infty}(S_c^{n_i})^{1/n_i}=d_f,$$ which is a contradiction. \endproof \subsection{Berkovich spaces}\label{subsecberko} In this section, ${\mathbf{k}}$ is a complete nonarchimedean valued field with norm $|\cdot|$. See \cite{Berkovich1990} and \cite{Berkovich1993} for basic theory of Berkovich spaces. Let $X$ be a variety over ${\mathbf{k}}.$ Recall that, as a topological space, Berkovich's analytification of $X$ is $$X^{{\rm an}}:=\{(x,|\cdot|_x)|\,\, x\in X, |\cdot|_x \text{ is a norm on }\kappa(x) \text{ which extends } |\cdot| \text{ on }{\mathbf{k}}\},$$ endowed with the weakest topology such that \begin{points} \item $\tau: X^{{\rm an}}\to X$ by $(x,|\cdot|_x)\mapsto x$ is continuous; \item for every Zariski open $U\subseteq X$ and $\phi\in O(U)$, the map $|\phi|:\tau^{-1}(U)\to [0+\infty)$ sending $(x,|\cdot|_x)$ to $|\phi|_x$ is continuous. \end{points} Let ${\mathcal M}(X^{{\rm an}})$ be the space of Radon measures on $X^{{\rm an}}$ and let ${\mathcal M}^1(X^{{\rm an}})$ be the space of probability Radon measures on $X^{{\rm an}}.$ \subsection{Trivial norm case} Assume that $|\cdot|$ is the trivial norm. For every $x\in X$, let $|\cdot|_{x,0}$ be the trivial norm on $\kappa(x).$ Then we have an embedding $\sigma: X\to X^{{\rm an}}$ sending $x\in X$ to $(x,|\cdot|_{x,0}).$ We have $\tau\circ\sigma={\rm id}.$ One may check that the constructible topology on $X$ is exact the topology induced by the topology on $X^{{\rm an}}$ and the embedding $\sigma.$ Because $|X|$ is compact, $\sigma(X)$ is closed in $X^{{\rm an}}$ and $\sigma: |X|\to \sigma(|X|)$ is a homeomorphism. \begin{rem}We note that, if $X$ is endowed with the constructible topology, $\tau: X^{{\rm an}}\to |X|$ is no longer continuous. \end{rem} Using the embedding $\sigma$, Corollary \ref{corgenericseqence} can be translated to a statement on $X^{{\rm an}}.$ \begin{cor}[=Corollary \ref{corgenericseqence}]A sequence $x_n\in X, n\geq 0$ is generic if and only if in ${\mathcal M}(X^{{\rm an}})$ $$\lim_{n\to \infty}\delta_{\sigma(x_n)}=\delta_{\sigma(\eta)}.$$ \end{cor} \medskip Let $f: X\to X$ be a finite flat morphism. It induces a morphism $f^{{\rm an}}: X^{{\rm an}}\to X^{{\rm an}}.$ We have $$f^{{\rm an}}\circ \sigma=\sigma\circ f \text{ and } \tau\circ f^{{\rm an}}=f\circ \tau.$$ According to \cite[Lemma 6.7]{Gignac2014a}, there is a natural pullback ${f^{{\rm an}}}^*: {\mathcal M}(X^{{\rm an}})\to {\mathcal M}(X^{{\rm an}}).$ One may check that the following diagram is commutative. \[ \xymatrixcolsep{3.5pc} \xymatrix{ {\mathcal M}(|X|)\ar[d]^{\sigma_*}\ar[r]^{f^*}&{\mathcal M}(|X|)\ar[d]^{\sigma_*}\\ {\mathcal M}(X^{{\rm an}}) \ar[r]_{{f^{{\rm an}}}^*} & {\mathcal M}(X^{{\rm an}}) } \] Then we may translate Theorem \ref{thmseqd} to a statement on $X^{{\rm an}}.$ \begin{thm}[=Theorem \ref{thmseqd}] Let $f: X\to X$ be a flat and finite endomorphism of a quasi-projective variety. Assume that \begin{equation}\label{equladdom}d_f:=\lambda_{\dim X}(f)>\max_{1\leq i\leq \dim X-1} \lambda_i. \end{equation} If the field extension ${\mathbf{k}}(X)/f^*{\mathbf{k}}(X)$ is separable, then for every $x\in X({\mathbf{k}})$ with $\overline{\cup_{i\geq 0}f^{-i}(x)}=X,$ $$\lim_{n\to \infty}d_f^{-n}(f^n)^*\delta_{\sigma(x)}=\delta_{\sigma(\eta)}.$$ \end{thm} \subsection{Reduction}\label{subsectionreduction} Let ${\mathbf{k}}^{\circ}$ be the valuation ring of ${\mathbf{k}}$ and ${\mathbf{k}}^{\circ\circ}$ the maximal ideal of ${\mathbf{k}}^{\circ}.$ Set $\widetilde{{\mathbf{k}}}:={\mathbf{k}}^{\circ}/{\mathbf{k}}^{\circ\circ}$ the residue field of ${\mathbf{k}}.$ Let ${\mathcal X}$ be a flat projective scheme over ${\mathbf{k}}^{\circ}.$ Denote by $X_0$ its special fiber, it is a (maybe reducible) variety over $\widetilde{{\mathbf{k}}}.$ Let $X$ be the generic fiber of ${\mathcal X}.$ Let $Y_1,\dots, Y_m$ be the irreducible components of $X_0$ and $\eta_i,i=1,\dots,m$ the generic points of $Y_i.$ Set $\xi_i$ the unique point in ${\rm red}^{-1}(\eta_i).$ \medskip Denote by ${\rm red}: X^{{\rm an}}\to X_0$ the reduction map. It is anti-continuous i.e. for every Zariski open subset $U$ of $X_0$, ${\rm red}^{-1}(U)$ is closed. In particular, for constructible topology on $X_0$, ${\rm red}: X^{{\rm an}}\to |X_0|$ Borel measurable. \medskip For every $\mu\in {\mathcal M}(X^{{\rm an}})$, we may define its push forward ${\rm red}_*\mu\in {\mathcal M}(|X_0|)$ as follows: For every $\phi\in C(|X_0|)$, $$\int \phi\, {\rm red}_*\mu:=\int ({\rm red}^*\phi)\, \mu.$$ Because ${\rm red}^*\phi$ is Borel measurable and bounded, $\int ({\rm red}^*\phi) \mu$ is well defined and we have $|\int ({\rm red}^*\phi) \mu|\leq \|\phi\|_{\infty}\mu(X^{{\rm an}}).$ We note that, in general, ${\rm red}_*: {\mathcal M}(X^{{\rm an}})\to {\mathcal M}(|X_0|)$ is not continuous. \begin{exe}\label{exerednotmeacon} Let ${\mathcal X}=\P^N_{{\mathbf{k}}^{\circ}}.$ Let $x_n, n\geq 0$ be the Gauss point of the polydisc $\{|T_i|\leq 1-1/(n+2), i=1,\dots, N\}\subseteq ({\mathbb A}^N)^{{\rm an}}\subseteq (\P^N)^{{\rm an}}.$ We have $\delta_{x_n}\to \xi_1$ as $n\to \infty$, but for every $n\geq 0$, $${\rm red}_*\delta_{x_n}=\delta_{{\rm red}(x_n)}=\delta_{[1:0:\dots:0]}\neq \delta_{\eta_1}={\rm red}_*\delta_{\xi_1}.$$ \end{exe} \begin{pro}\label{prolimgen}Let $\mu_n\in {\mathcal M}^1(X^{{\rm an}}), n\geq 0$ be a sequence of probability Radon measures on $X^{{\rm an}}.$ Assume that there are $a_i\geq 0, i=1,\dots,m$ with $\sum_{i=1}^ma_i=1$ such that $${\rm red}_*(\mu_n)\to \sum_{i=1}^m a_i\delta_{\eta_i}$$ as $n\to \infty.$ Then we have $$\mu_n\to \sum_{i=1}^m a_i\delta_{\xi_i}$$ as $n\to \infty.$ \end{pro} \proof Because $X^{{\rm an}}$ is compact, ${\mathcal M}^1(X^{{\rm an}})$ is weak-$\ast$ compact. So we may assume that $$\lim_{n\to \infty}\mu_n=\mu$$ for some $\mu\in {\mathcal M}^1(X^{{\rm an}}).$ We first show that ${\rm Supp}\, \mu\subseteq \{\xi_1\dots,\xi_m\}.$ Otherwise $\mu(X^{{\rm an}}\setminus \{\xi_1\dots,\xi_m\})=1.$ Then there is a compact subset $K$ of $X^{{\rm an}}\setminus \{\xi_1\dots,\xi_m\}$ such that $\mu(K)>0.$ For every $x\in K$, set $V_x:={\rm red}^{-1}(\overline{{\rm red}(x)}).$ It is an open neighborhood of $x$ in $X^{{\rm an}}\setminus \{\xi_1\dots,\xi_m\}.$ Because $K$ is compact, there is one $x\in K$ such that $\mu(V_x)>0.$ Set $Z:=\overline{{\rm red}(x)}.$ There is a compact subset $S\subseteq V_x$ such that $\mu(S)>0.$ By Urysohn's Lemma, there is a continuous function $\chi: X^{{\rm an}}\to [0,1]$ such that $\chi|_S=1$ and $\chi|_{X^{{\rm an}}\setminus V_x}=0.$ Then we have $$0=\lim_{n\to \infty}\int 1_Z\,{\rm red}_*\mu_n=\lim_{n\to \infty}\int ({\rm red}^*1_Z)\,\mu_n=\lim_{n\to \infty}\int 1_{V_x}\,\mu_n$$ $$\geq \lim_{n\to \infty}\int \chi\,\mu_n=\int \chi \mu\geq \mu(S)>0,$$ which is a contradiction. Now we may write $\mu=\sum_{i=1}^m b_i\delta_{\xi_i}$ with $b_i\geq 0$ and $\sum_{i=1}^m b_i=1.$ For each $i=1,\dots,m$, set $U_i:=Z_i\setminus (\cup_{j\neq i}Z_j).$ Then ${\rm red}^{-1}(U_i)$ is a closed subset contained in the open subset ${\rm red}^{-1}(Z_i).$ By Urysohn's Lemma, there is a continuous function $\chi_i: X^{{\rm an}}\to [0,1]$ such that $\chi|_{{\rm red}^{-1}(U_i)}=1$ and $\chi|_{X^{{\rm an}}\setminus {\rm red}^{-1}(Z_i)}=0.$ Then we have $$b_i=\int\chi_i\mu=\lim_{n\to \infty}\int \chi_i\mu_n$$ $$\geq \lim_{n\to \infty}\mu_n({\rm red}^{-1}(U_i))=\lim_{n\to \infty}\int 1_{U_i}\,{\rm red}_*\mu_n$$ $$=\int 1_{U_i}\,(\sum_{j=1}^m a_j\delta_{\eta_j})=a_i.$$ Because $\sum_{i=1}^{m}b_i=\sum_{i=1}^m a_i=1$, we get $b_i=a_i$ for every $i=1,\dots,m.$ This concludes the proof. \endproof Now assume that $X_0$ is irreducible and smooth. Denote by $\eta$ the generic point of $X_0$ and $\xi$ the unique point in ${\rm red}^{-1}(\eta).$ Let $F:{\mathcal X}\to {\mathcal X}$ be a finite endomorphism. Denote by $f,f_0$ the restriction of $F$ to $X,X_0.$ We note that for $i=0,\dots, \dim X$, one has $\lambda_i(f)=\lambda_i(f_0).$ \medskip By Theorem \ref{thmseqd} and Proposition \ref{prolimgen}, we get the following equidistribution result for endomorphisms of good reductions. \begin{cor}\label{corseqdber} Assume that $$d_f:=\lambda_{\dim X}(f)>\max_{1\leq i\leq \dim X-1} \lambda_i.$$ If the field extension $\widetilde{{\mathbf{k}}}(X_0)/f_0^*\widetilde{{\mathbf{k}}}(X_0)$ is separable, then for every $x\in X({\mathbf{k}})$ with $\overline{\cup_{i\geq 0}f_0^{-i}({\rm red}{x})}=X_0,$ $$\lim_{n\to \infty}d_f^{-n}(f^n)^*\delta_x=\delta_{\xi}.$$ \end{cor} One may compare Corollary \ref{corseqdber} with \cite[Theorem A]{Gignac2014a} for polarized endomorphism. See \cite{Guedj2005,Dinh2015} for according result for complex topology. \newpage
\section{Introduction} \label{sec:I} The emerging Internet-of-Things (IoT) leads to the unprecedented growth of the connected IoT devices in the wireless networks and significant rise of several computation demanding applications, such as interactive gaming, virtual/augmented reality, image/video processing. Cloud computing provides an efficient computation platform for executing the aforementioned applications. However, cloud computing requires efficient offloading of computation intensive tasks from the energy-constrained mobile devices to the cloud server (CS) of enormous computation capability \cite{CC2}. In particular, the offloading of a task to a distant CS increases latency and security risk (e.g., important data should not be offloaded to CSs that are located outside a national territory) \cite{CC3}. Hence, the benefit of cloud computing is diminished for the latency-sensitive and security critical applications \cite{CC4}. Fog computing provides a complementary solution to the contemporary cloud computing by reducing the distance between the computing CS and mobile devices \cite{FC1}. In fog computing systems, fog access points (F-APs), with certain storage and computation capabilities, are deployed at the network edge \cite{FC2, 8,FC_Zoheb_1,FC_Zoheb_2}. As a result, mobile devices can offload the computation intensive tasks directly to the nearby F-APs instead of a distant CS, leading to the low-latency and fast access services. Moreover, an integration of fog and cloud computing provides a powerful computation and communication platform for the large number of IoT devices. Such an integrated architecture is referred as integrated fog-cloud computing (FCC)-enabled IoT system \cite{FCC_1}. The integrated FCC provides powerful computation architecture for the IoT device, and it benefits from the centralized signal processing at the CS. Thereby, the integrated FCC can efficiently provide the required quality-of-service (QoS) for the emerging IoT applications. Recently, the data driven decision making becomes an integral part of IoT networks, thanks to the availability of the enormous data and advancement of the devices' computing power. In particular, machine learning algorithms are extensively used to predict traffic congestion, user behavior, and QoS of users by analyzing large-scale data collected from the IoT devices. In conventional ML, the collected data from IoT devices (e.g., images, videos, and recorded audios) are offloaded to and processed in the centralized CSs, where the learning models are trained. Such a centralized ML approach is confronted by the huge traffic burden in the wireless links between IoT devices and core network. In addition, the privacy of users' sensitive data is impeded. Therefore, the conventional centralized learning method is inefficient for next generation IoT network \cite{Distributed_learning}. Federated learning (FL) has been emerged as an efficient decentralized learning mechanism that allows multiple network edge devices to collaboratively learn a shared model \cite{FL_0}. In FL, the network edge devices train learning models locally based on local data. In contrast to the centralized learning mechanism, the devices only share updated model parameters with the CS. Subsequently, the CS calculates the global model parameter by aggregating local model updates from edge network. The local and global parameters are updated iteratively until convergence. By distributing the learning tasks between the network edge and centralized CSs, FL not only reduces the huge traffic burden over wireless channel, but also protects privacy of IoT data \cite{FL_1}. Due to the availability of distributed computing resources, an integrated FCC system provides a convenient platform to implement FL in wireless networks. In fact, using FL in integrated FCC system, the QoS of users can be significantly improved \cite{FL_2}. However, the channel impairments and interference present the key challenges to implement FL over wireless networks. Specifically, the FL training loss and convergence time jointly depends on selection of the collaborating devices, spectrum resource allocation, power allocation, and computation capability of the collaborating devices \cite{FL_3}. It is also imperative to reduce the energy consumption of the IoT devices participating in FL process. Particularly, IoT devices consume both communication and computation energy when the local models are trained at the IoT devices. To save the computation energy consumption, fog computing resources can be leveraged for local learning. However, in such a scenario, the communication energy consumption can be increased as the IoT devices need to upload a large amount of data to nearby F-APs with a strict latency constraint. To this end, we consider two different scenarios where the local models are trained either at the IoT devices or F-APs. For both scenarios, we develop resource allocation mechanisms to reduce energy consumption of FL with strict delay constraints. \subsection{Related Works and Motivations} \textit{Related works on communication-efficient FL:} The performance of a decentralized ML depends on the optimization of wireless links between the network edge devices and parameter server (CS or fog computing nodes). Hence, it is imperative to optimally design the learning-centric resource allocation schemes \cite{FL1}. In the recent literature, the design of communication-efficient FL was extensively studied. Leveraging the grouping of network edge devices and a decentralized group alternating direction method of multipliers, a jointly communication efficient and fast converging FL algorithm was proposed in \cite{FL_Com_1}. To enhance the accuracy and convergence of FL, it is imperative to enhance the number of collaborating edge devices while using the available spectrum resources efficiently. To this end, a collaborative FL framework was proposed that allows resource constrained IoT devices to upload model parameters to the nearby devices instead of the distance CS \cite{FL_Com_2}. Moreover, a joint scheduling of network edge devices and radio resource blocks (RRBs) was studied to minimize the FL loss function via applying Lyapunov optimization framework \cite{FL_Com_3}. In a heterogeneous cellular network, a hierarchical FL framework can effectively enhance the number of devices participating in local learning \cite{FL_Com_4}. In such a hierarchical FL framework, at each round, the network edge devices upload their model parameters only to the nearest F-APs (therein called small base-stations), and F-APs periodically upload the average local model parameters to the CS (therein called macro base-station) for a global aggregation. Thus, a large number of devices can participate in local learning. Besides, interference among the network edge devices can induce error in FL and increase the convergence time. Accordingly, interference aware radio resource allocation is also imperative for communication-efficient FL framework. A joint optimization of user selection, RRB allocation, and transmit power allocation was presented to minimize the loss function in FL training process. The authors in \cite{FL_Com_5} proposed transmit power allocation of the IoT devices to enhance information freshness in FL system. Considering the presence of eavesdroppers in an Internet-of-drones network, the authors in \cite{7a} proposed a secured and delay-constrained FL scheme through transmit power allocations. \textit{Related works on energy-efficient FL:} Since the mobile devices are battery-driven, for a sustainable operation of an FL framework, it is imperative to reduce energy consumption of the edge devices. In particular, an energy-efficient or green FL should consider minimizing communication and computation energy. In \cite{EE_FL_1}, energy-efficient radio resource allocation was proposed for delay constrained FL. However, the authors in \cite{EE_FL_1} only minimized the communication energy and ignored the computation energy. In \cite{EE_FL_2}, the authors proposed an adaptive FL framework, where the devices can send quantized or compressed model parameters and thus, save energy. However, the radio resource optimization was not presented in \cite{EE_FL_2}. In \cite{EE_FL_3}, radio resource allocation was developed to minimize both communication and computation energy in an FL system subject to delay constraints. However, the authors in \cite{EE_FL_3} considered orthogonal multiple access (OMA) to connect edge devices with the base-station, which can limit the number of collaborating devices. Using OMA, the authors in \cite{FCR11} also proposed joint transmit power and computation frequency allocation to reduce overall energy consumption of FL in a fog-aided IoT network. The energy limitation of the collaborating edge devices can also be improved by energy-harvesting technique \cite{EE_FL_4}. Moreover, the work in \cite{EE_FL_5} considered a game theory framework to motivate the network edge devices to participate in local learning while reducing its energy consumption. \textit{Motivations and Challenges:} In contrast to the existing works \cite{EE_FL_1,EE_FL_2,EE_FL_3,FCR11,EE_FL_4,EE_FL_5}, our motivation is to develop resource allocation mechanisms to facilitate energy-efficient FL in an integrated FCC-enabled IoT network. The considered architecture has a number of F-APs along with an CS, and the IoT devices are connected with the CS through F-APs. To improve the number of connected devices with F-APs using limited RRBs, an uplink non-OMA (NOMA) scheme \cite{NOMA5} is considered. To the best of our knowledge, this is the first work that investigates efficient integration of joint cloud-fog computing and NOMA technique to reduce energy consumption of FL scheme. However, to take advantage of such an architecture for reducing energy consumption of FL, we need to develop a computationally efficient resource allocation scheme. Specifically, we need to address the following two challenges. \begin{itemize} \item \textbf{Challenge I:} In the first scenario, F-APs can work as relays where all the local learning is executed at the IoT devices. Alternatively, F-APs have the computation capability, and thus, they can participate in local learning along with the IoT devices. Therefore, in the second scenario, F-APs can work as local learning nodes to save the computation energy consumption of the connected IoT devices. Essentially, we need to investigate which of the aforementioned two scenarios has better energy-efficiency. \item \textbf{Challenge II:} There is an inherent trade-off between FL time and energy consumption. In particular, both computation and communication energy are increased to reduce the FL time. Accordingly, to satisfy a given FL time constraint and reduce energy consumption, it is imperative to jointly optimize the degrees-of-freedom, namely, power allocation, IoT device scheduling to the F-APs/RRBs, and computation frequency allocation. However, an interplay of the aforementioned factors leads to a high computational complexity. Essentially, we need to develop a computationally efficient resource allocation scheme to address the trade-off between FL time and energy consumption. \end{itemize} \subsection{Contributions} We investigate resource allocation for energy-efficient FL in an integrated FCC-enabled IoT network. Specifically, we propose a joint optimization of scheduling of IoT devices with the F-APs/RRBs, transmit power allocations, and computation frequency allocation at the IoT devices and F-APs. To this end, we introduce innovative graph-theoretical frameworks to develop computationally efficient solution. The main contributions of our work are as follows. \begin{enumerate} \item We consider two different scenarios for training the local model. In the first scenario, referred as \textit{IoT device local learning}, local models are trained at the IoT devices and the F-APs upload the collected local model parameters to the CS for aggregation. In the second scenario, referred as \textit{F-AP local learning}, the local models are trained at the F-APs based on the collected data from the IoT devices. For both scenarios, we aim at minimizing the overall energy consumption of IoT devices and F-APs subject to FL time constraint, IoT device-RRB/F-AP scheduling, transmit power allocations, and computation frequency allocation. Such a joint optimization problem is NP-hard and thus, computationally intractable. By analyzing the problem of each scenario, we decompose it into two subproblems namely, \textit{resource scheduling and power allocation} subproblem and \textit{computation frequency allocation} subproblem. \item To solve the first subproblem, using graph theory, we design a low-complexity algorithm to optimize the scheduling among the IoT devices, F-APs, and RRBs. and transmit power levels of the IoT devices. In contrast, we obtain closed-form computation frequency allocation solution that depends on the scheduling obtained in the first subproblem. For both scenarios, efficient solutions are obtained by solving the aforementioned two subproblems alternately. The computational complexities of the proposed schemes are analyzed as well. \item Extensive simulations are conducted to verify advantages of the proposed schemes over the benchmark schemes. Numerical results revealed that both proposed schemes offer improved energy consumption performances as compared to the benchmark schemes. The presented simulation results also interestingly reveal that for a large number of IoT devices and large data sizes, it is more energy efficient to train the local models at the IoT devices instead of the F-APs. \end{enumerate} The rest of this paper is organized as follows. The system model is described in \sref{SMMM}. The optimization problems for the considered scenarios are provided in \sref{PF}. In \sref{G} and \sref{MT}, we develop two graph theory schemes to facilitate local learning at the IoT devices and F-APs, respectively. Simulation results are presented in \sref{NR}, and in \sref{C}, we conclude the paper. \section{System Overview} \label{SMMM} \ignore{\begin{figure}[t!] \centering \includegraphics[width=0.55\linewidth]{fig_system_model_new.pdf} \caption{Illustration of integrated FCC-enabled IoT networks.} \label{fig1} \end{figure}} \subsection{System Model} We consider an integrated FCC-enabled IoT system, illustrated in Fig. \ref{fig1}, that consists of one cloud server (CS), $K$ F-APs, and $N$ IoT devices. The sets of IoT devices and F-APs are denoted by $\mathcal{N}=\{1,2,\cdots,N\}$ and $\mathcal{K}=\{1,2,\cdots,K\}$, respectively. The $N$ IoT devices (e.g., smartphones, laptops, and cameras) are connected to the F-APs which are connected to the CS using fronthaul links. We consider that each F-AP has a limited coverage range that represents the service area of the $k$-th F-AP within a circle of radius $\mathtt R$. The set of IoT devices in the $k$-th F-AP's coverage range is defined by $\mathcal N_{k}=\{n\in \mathcal{N}| d_{k,n}\leq \mathtt R$\}, where $d_{k,n}$ is the distance between the $k$-th F-AP and the $n$-th IoT device. Let $\mathbf A={a_{k,n}}$ be the F-AP allocation matrix, where element $a_{k,n}=1$ represents that the $n$-th IoT device is allocated to the $k$-th F-AP, and $a_{k,n}=0$ otherwise. \ignore{The IoT devices independently train local ML models based on their aggregated local data (e.g., images, videos, recorded audios), and upload model parameters to the nearest F-APs, and then, the F-APs receive all the model parameters and upload them to the CS for aggregation. } \ignore{\begin{figure}[t!] \centering \begin{subfigure}[t]{0.44\textwidth} \centerline{\includegraphics[width=.8501\linewidth]{fig_system_model_new.pdf}} \label{fig1} \end{subfigure}% ~ \begin{subfigure}[t]{0.44\textwidth} \centerline{\includegraphics[width=0.85703\linewidth]{FL.pdf}} \label{NCT} \end{subfigure} \caption{Illustration of integrated FCC-enabled IoT networks and FL process.} \label{fig1} \end{figure}} \begin{figure}[t!] \centering \includegraphics[width=0.85\linewidth]{fig_system_model_new.pdf} \caption{Illustration of integrated FCC-enabled IoT networks} \label{fig1} \end{figure} Let $\mathcal D_n$ denote the local data set of IoT device $n$, which is a set of data samples $\{x_i, y_i\}$, where $x_i$ is sample $i$’s input (e.g., image pixels) and $y_i$ is sample $i$’s output (e.g., label of the image). Similar to \cite{EE_FL_2, FCR11}, the local loss function on IoT device $n$’s data set can be calculated as $L_n(\omega)=\frac{1}{D_n}\sum_{i\in \mathcal D_n}l_i(\omega), \forall n\in \mathcal N,$ where $D_n=|\mathcal D_n|$ is the number of collected data samples by IoT device $n$ and $l_i(\omega)$ is the loss function that measures the local training model error of data sample $i$. Then, IoT device $n$ finds the optimum $\omega^*_n$ that minimizes $L_n(\omega)$ and uploads it to the suitable F-APs for aggregation by the CS. The IoT devices independently train local ML models based on their aggregated local data (e.g., images, videos, recorded audios). As shown in Fig. \ref{fig1}, the specific process of FL in the $t$-th iteration can be summarized as: 1) each IoT device downloads the global model parameters $\omega_n(t-1)$ from the CS through the nearest F-AP; 2) each IoT device updates the local model by its local training data and sends the updated local model parameter $\omega_n(t)$ back to the F-APs; and 3) the CS aggregates the information from the F-APs and calculates the new global model parameters. Each IoT device uploads the local information to the nearest F-AP via a wireless link. Similar to the resource setting in \cite{8a, 9}, we consider that each F-AP has $Z$ orthogonal RRBs that are denoted by the set $\mathcal{Z}=\{1,2,\cdots,Z\}$, where IoT devices can transmit their local information to the F-APs. These RRBs can be used practically as a generic term to denote time/frequency resource block of every F-AP, i.e., a group of orthogonal sub-carriers \cite{8}. Let $\mathbf S=\{s^n_{k,z}\}$ be the RRB allocation matrix, where element $s^n_{k,z}=1$ represents that the $n$-th IoT device is allocated to the $k$-th F-AP on the $z$-th RRB, and $s^n_{k,z}=0$ otherwise. In this work, we consider a simple and efficient system’s design where the scheduling-level coordination takes place, i.e., each user is only scheduled to a single RRB \cite{8, 8a, 9}. To schedule number of IoT devices to each RRB, we consider NOMA. Let $p_n$ denote the transmission power of the $n$-th IoT device and let $\bf p$ be a $1\times N$ matrix containing the power levels of all IoT devices, i.e., $\textbf p = [p_n]$. Hence, the instantaneous signal-to-interference-plus-noise (SINR) for the link between the $n$-th IoT device and the $z$-th RRB in the $k$-the F-AP is given by \begin{align} \label{SNR} \gamma^n_{k,z}=\frac{s^n_{k,z}p_n \left|G^n_{k,z}\right|^2}{\sum_{\substack{j \in \mathcal{N}_k\backslash n\\G^{j}_{k,z}<G^n_{k,z}}}s^{j}_{z,k}p_{j} \left|G^{j}_{k,z}\right|^2 +\sigma^2}, \forall (j,n) \in \mathcal N_k, \end{align} where $\sigma^{2}$ denotes the additive white Gaussian noise variance and $G^n_{k,z}$ denotes the channel gain for the link between the $n$-th IoT device and the $z$-th RRB in the $k$-th F-AP. Then, the transmit rate of the $n$-th IoT device to the $k$-th F-AP over the $z$-th RRB can be given by $R^n_{k,z}=W\log_{2}(1+\gamma^n_{k,z})$, where $W$ is the bandwidth of the $z$-th RRB. Consequently, the transmit rate of the $n$-th IoT device is $R_n=\sum_{k\in \mathcal K}\sum_{z\in \mathcal Z}W\log_{2}(1+\gamma^n_{k,z})$. At the F-APs, each F-AP uploads its collected local parameters to the CS through a fronthaul link of capacity $R_{fh}$. \begin{figure}[t!] \centering \includegraphics[width=0.85\linewidth]{FL.pdf} \caption{Illustration of federated learning process.} \label{fig2a} \end{figure} \ignore{\begin{figure}[t!] \centering \begin{subfigure}[t]{0.44\textwidth} \centerline{\includegraphics[width=.8501\linewidth]{fig_system_model_new.pdf}} \label{fig1} \end{subfigure}% ~ \begin{subfigure}[t]{0.44\textwidth} \centerline{\includegraphics[width=0.85703\linewidth]{FL.pdf}} \label{NCT} \end{subfigure} \caption{Illustration of integrated FCC-enabled IoT networks and FL process.} \label{fig1} \end{figure}} In this work, we consider two different scenarios for training the local models: i) IoT device local learning and ii) F-AP local learning that are explained as follows. \vspace*{-0.2cm} \subsection{IoT Device Local Learning Scenario} In this scenario, the role of IoT devices is to perform local training and upload the local parameters to the F-APs and to the CS. The F-APs is only responsible for forwarding the collected local parameters from the IoT devices to the CS. This scenario is illustrated in Fig. \ref{fig2a}-(a) and divided into FL time and energy consumption as follows. \textit{1) FL time:} In each iteration, the FL time consists of\ignore{the aggregation time for aggregating local data at IoT devices,} the computation time for local model training and the transmission time for uploading local model parameters to the F-APs as well as to the CS. In the local training process, IoT device $n$ trains the local model and updates its local parameter until a local accuracy $\epsilon_l$ is achieved \cite{EE_FL_2}. Let $C_n$ denote the number of CPU cycles to process one data sample of IoT device $n$, and accordingly, the number of CPU cycles required for one local iteration over all data samples is $C_nD_n$. Therefore, the computation time for one local iteration in IoT device $n$ can be calculated as $\frac{C_n D_n}{f_n}$, where $f_n$ is the computational speed of the CPU in IoT device $n$ (in cycles per second) \cite{10_new}. Let $\textbf f_\text{N}$ be a $1\times N$ matrix containing the computation frequency allocations of all IoT devices, i.e., $\textbf f_N = [f_n]$. The number of local iterations to reach the local accuracy $\epsilon_l$ in IoT device $n$ is $T_l=\frac{2}{(2-\delta \beta)\delta \vartheta}\ln(1/\epsilon_l)$, where $\delta, \vartheta, \beta$ are constant parameters \cite{7a}. Then, the computation time of IoT device $n$ is expressed as \begin{equation} T^c_n=T_l\frac{C_nD_n}{f_n}. \end{equation} After performing the local learning at IoT device $n$, suppose that the data size $d_n$ of each resulting local parameter $\omega_n$ is fixed over the learning process \cite{13}. Hence, the transmission time of IoT device $n$ for uploading its parameters to F-AP $k$ on RRB $z$ is $T^w_n=\frac{d_n}{R_{k,z}^n}$. Note that the global model parameters can only be updated by the CS after all local model parameters are received from the F-APs. Consequently, the FL time $\tau_1$ in each global iteration is determined by the longest duration time of receiving the parameters among all IoT devices and the longest duration time of forwarding the parameters from the F-APs to the CS. Moreover, the transmission duration of F-AP $k$ to upload its collected parameters to the CS is $T^w_k=\frac{\sum_{n\in \mathcal N_k}d_n}{R_{fh}}$. Hence, the learning time $\tau_1$ of one global iteration can be calculated as \begin{align} \label{FL_1} \tau_1&=\max_{n \in \mathcal N}\{T^c_n+T^w_n\}+\max_{k \in \mathcal K}\{T^w_k\}\nonumber \\& =\max_{n \in \mathcal N}\left\{T_l\frac{C_n D_n}{f_n}+\frac{d_n}{R_{k,z}^n}\right\}+\max_{k \in \mathcal K}\left\{\frac{\sum_{n\in \mathcal N_k}d_n}{R_{fh}}\right\}. \end{align} \ignore{and, the total FL time of all global iterations $T_g$ is $\tau_1=T_g \tau^l$.} The learning time $\tau_1$ should satisfy the QoS requirement. Specifically, $\tau_1$ should be no more than the maximum FL time $T_q$, i.e., $\tau_1\leq T_q$. Hence, the QoS requirement can be expressed as \begin{align} \max_{n \in \mathcal N}\left\{T_l\frac{C_nD_n}{f_n}+\frac{d_n}{R_{k,z}^n}\right\}+\max_{k \in \mathcal K}\left\{\frac{\sum_{n\in \mathcal N_k}d_n}{R_{fh}}\right\}\leq T_q, \end{align} and can be written as \begin{align} T_l\frac{C_n D_n}{f_n}+\frac{d_n}{R_{k,z}^n}+\frac{\sum_{n\in \mathcal N_k}d_n}{R_{fh}}\leq T_q, \forall n\in \mathcal N, \forall k\in \mathcal K. \end{align} \textit{2) Energy consumption model:} The IoT device's energy is consumed for both local model training and parameter transmission over wireless links that is explained as follows. \begin{itemize} \item \textit{Local computation:} We adopt the widely used energy consumption model which considers that the energy consumption of IoT device $n$ to process a single CPU cycle is $\alpha f^2_n$, where $\alpha$ is a constant related to the switched capacitance \cite{14,15}. Hence, the energy consumption of IoT device $n$ for local computation is $ E^c_n=T_lC_nD_n\alpha f^2_n$ \cite{7a}. \item \textit{Parameter transmission:} The energy consumption to upload local model parameters to the F-APs over wireless links can be denoted by $E^w_n$ and calculated as $p_nT^w_n$. Since the local parameters are forwarded from the F-APs to the CS over high transmission links, the energy consumption is negligible. Hence, we discard the F-APs' energy consumption. \end{itemize} By combining all the aforementioned terms of energy consumption, the total energy consumption of the system in the IoT device local learning scenario can be calculated as \begin{align} E=\sum_{n\in\mathcal N}\left(E^w_n+E^c_n\right)= \sum_{n\in\mathcal N}\left[ \frac{p_nd_n}{R^n_{k,z}}+T_lC_nD_n\alpha f^2_n \right]. \end{align} \ignore{At the F-APs, the energy consumption of F-AP $k$ for computation is $E^c_k=T\sum_{n\in \mathcal K_k}(C_nD_n)\alpha f^2_k$ and the energy consumption for uploading local model parameters is \begin{equation} E^u_k=\frac{p_k\sum_{n\in \mathcal K_k}s_n}{R_k}=\frac{p_k\sum_{n\in \mathcal K_k}s_n}{B\log_2 \left(1+\frac{p_sG^k}{N_0B}\right)}, \end{equation} where $G^k$ denotes the wireless channel gain between F-AP $k$ and the fog server. Consequently, the energy consumption of all F-APs can be calculated as $E_{F-APs}=\sum_{k\in\mathcal K}\left(E^c_k+E^u_k\right)$.} \subsection{F-AP Local Learning Scenario} The IoT devices, in this scenario, are solely responsible for uploading their data to the F-APs. The F-APs, then, train local models using these collected data and upload the resulting local parameters to the CS for global aggregation. This scenario is illustrated in Fig. \ref{fig2a}-(b). The FL time and energy consumption of this scenario are explained as follows. \textit{1) FL time:} In each iteration, the FL time consists of the transmission time for uploading the data from IoT devices to F-APs, the computation time for training local models at the F-APs, and the transmission time for uploading the resulting local model parameters to the CS. Consider that the data size $\mathtt D_n$ of the uploaded data $\mathcal D_n$ by IoT device $n \in \mathcal N_k$ is fixed over the learning process \cite{13}. The transmission time for uploading data from IoT devices $\mathcal N_k$ to F-AP $k$ is written as \begin{equation} T^w_k=\max_{n\in \mathcal N_k}\left\{\frac{\mathtt D_n}{R_{k,z}^n}\right\}, \forall z\in \mathcal Z. \end{equation} Each F-AP $k$ iteratively trains the local learning model on the collected data and updates its local parameter $\omega_k(t)$ until a local accuracy $\epsilon_l$ is achieved. Let $C_k$ denote the number of CPU cycles to process one data sample of F-AP $k$. Hence, the number of CPU cycles required for one local iteration is $C_kB_k$, where $B_k$ is the number of uploaded data samples $\mathcal B_k$ to F-AP $k$, i.e., $B_k=|\mathcal B_k|$ and $\mathcal B_k=\cup_{n\in \mathcal N_k}\mathcal D_n$. Therefore, the computation time for one local iteration at F-AP $k$ can be calculated as $\frac{C_k B_k}{f_k}$, where $f_k$ is the computational speed of the CPU in F-AP $k$ (in cycles per second). Let $\textbf f_\text{K}$ be a $1\times K$ matrix containing the computation frequency allocations of all F-APs, i.e., $\textbf f_K = [f_k]$. Consider that the number of local iterations of F-APs to reach the local accuracy $\epsilon_l$ is $T_l$. Then, the computation time of F-AP $k$ is expressed as \begin{equation} T^c_k=T_l\frac{C_kB_k}{f_k}. \end{equation} Since the global model parameters can only be updated after all local model parameters are received from the F-APs, the FL time $\tau_2$ in each global iteration is determined by the longest time for uploading data to F-APs, training local models at the F-APs, and the longest time for transmitting the parameters from the F-APs to the CS. Thus, the learning time $\tau_2$ of one global iteration can be calculated as \begin{align} \label{FL_2} \tau_2&=\max_{k \in \mathcal K}\{T_k^w+T_k^c+T_k\}\nonumber \\&=\max_{k \in \mathcal K}\left\{\max_{n\in \mathcal N_k}\left\{\frac{\mathtt D_n}{R_{k,z}^n}\right\}+T_l\frac{C_k B_k}{f_k}+\frac{d_k}{R_{fh}}\right\}, \end{align} where $d_k$ is the local parameter size of F-AP $k$. Similar to the first scenario, the learning time $\tau_2$ should satisfy the QoS requirement, i.e., $\tau_2\leq T_q$. Thus, the QoS requirement can be expressed as \begin{align} \max_{k \in \mathcal K}\left\{\max_{n\in \mathcal N_k}\left\{\frac{\mathtt D_n}{R_{k,z}^n}\right\}+T_l\frac{C_k B_k}{f_k}+\frac{d_k}{R_{fh}}\right\}\leq T_q, \end{align} and can be written per F-AP as \begin{align} \max_{n\in \mathcal N_k}\left\{\frac{\mathtt D_n}{R_{k,z}^n}\right\}+T_l\frac{C_k B_k}{f_k}+\frac{d_k}{R_{fh}}\leq T_{q}, \forall k\in \mathcal K. \end{align} \textit{2) Energy consumption model:} The IoT device's energy is consumed for data transmission over wireless links, which is $E_n^w=p_nT_n^w=\frac{p_n\mathtt D_n}{R_{k,z}^n}$. For the F-APs, the energy consumption is explained as follows. \begin{itemize} \item \textit{Local computation:} The energy consumption model of F-AP $k$ for processing a single CPU cycle is $\alpha f^2_k$. Thus, the energy consumption of F-AP $k$ for local computation is expressed as $ E^c_k=T_lC_kB_k\alpha f^2_k$ \cite{7a}. \item \textit{Parameter transmission:} The energy consumption for uploading local model parameters to the CS is $E^w_k=q_kT^w_k=\frac{q_kd_k}{R_{fh}}$, where $q_k$ is the transmit power of F-AP $k$. \end{itemize} By combining all the aforementioned terms of energy consumption, the total energy consumption of all IoT devices and F-APs in the second scenario can be calculated as \begin{align} E&=\sum_{n\in\mathcal N}E^w_n+\sum_{k\in \mathcal K}(E^w_k+E^c_k)\nonumber \\&=\sum_{n\in\mathcal N}\left[ \frac{p_n\mathtt D_n}{R^n_{k,z}}\right]+\sum_{k\in\mathcal K}\left[ T_lC_kB_k\alpha f^2_k +\frac{q_kd_k}{R_{fh}}\right]. \end{align} \section{Problem Formulation}\label{PF} \ignore{The role of each IoT device depends on its connectivity to the F-APs, and preference of the decision-maker to minimize the consumed energy. Consequently, the active IoT devices set should be intelligently selected and a suitable role should be assigned to each IoT active device.} We propose to minimize the total energy consumption for a delay-constrained FL. Specifically, our proposed framework intelligently selects the active IoT devices that perform local learning and assigns active IoT devices to the suitable F-APs. Considering IoT device local learning scenario, the energy minimization problem can be formulated as \begin{subequations} \begin{align} \nonumber & \mathcal{P}_1: \min_{\substack{\mathbf A, \mathbf S, \textbf{f}_N,\mathbf p}} \sum_{n\in\mathcal N}\left[ \frac{p_nd_n}{R^n_{k,z}}+T_lC_nD_n\alpha f^2_n \right]\\ &\rm s.t. \begin{cases} \nonumber \hspace{0.2cm} \text{C1:}\hspace{0.2cm} \sum_{k\in \mathcal K}a_{k,n} =1 ~\&~ \sum_{z\in \mathcal Z}s^n_{k,z} =1, \forall n \in \mathcal N, \\ \hspace{0.2cm} \text{C2:}\hspace{0.2cm} \sum_{n\in \mathcal N}s^n_{k,z} \leq 2, \forall k\in \mathcal K, z \in \mathcal Z; \hspace{0.2cm}\\ \hspace{0.2cm} \text{C3:}\hspace{0.2cm} f^{\min}_n\leq f_n \leq f^{\max}_n, ~\forall n\in \mathcal{N},\\ \hspace{0.2cm} \text{C4:}\hspace{0.2cm} \tau_1\leq T_q;\\ \hspace{0.2cm} \text{C5:}\hspace{0.2cm} 0 \leq p_n \leq p_{\max}, ~\forall n\in \mathcal{N}; \hspace{0.2cm}\\ \hspace{0.2cm} \text{C6:}\hspace{0.2cm} a_{i,j}\in \{0,1\}, s^k_{i,j}\in \{0,1\}. \end{cases} \end{align} \end{subequations} In $\mathcal P_1$, C1 indicates that each IoT device is scheduled to only one F-AP and to only one RRB in that F-AP; C2 indicates that maximum two IoT devices can be scheduled to each F-AP at the same time; C3 is the constraint on local computation resource allocations of IoT devices; C4 indicates the QoS requirement on the FL time; and C5 is the transmit power control constraint. The optimization problem of energy consumption minimization for FL integrated FCC-enabled IoT networks of the F-AP local learning scenario can be expressed as \begin{subequations} \begin{align} \nonumber & \mathcal{P}_2: \min_{\substack{\mathbf A, \mathbf S, \textbf{f}_K,\bf p}} \sum_{n\in\mathcal N}\left[ \frac{p_n\mathtt D_n}{R^n_{k,z}}\right]+\sum_{k\in\mathcal K}\left[ T_lC_kB_k\alpha f^2_k +\frac{q_kd_k}{R_{fh}}\right]\\ &\rm s.t. \begin{cases} \nonumber \hspace{0.2cm} \text{C1}, \text{C2}, \text{C5}, \text{C6},\\ \hspace{0.2cm} \text{C3:}\hspace{0.2cm} f^{\min}_k \leq f_k \leq f^{\max}_k, ~\forall k\in \mathcal{K},\\ \hspace{0.2cm} \text{C4:}\hspace{0.2cm} \mathtt N_k \leq U, ~\forall k\in \mathcal{K};\\ \hspace{0.2cm} \text{C7:}\hspace{0.2cm}\tau_2\leq T_q. \end{cases} \end{align} \end{subequations} In $\mathcal P_2$, C3 is the constraint on local computation resource allocations of F-APs; C4 represents that the number of scheduled IoT devices to F-AP $k$ $\mathtt N_k$ is less than or equal to the maximum number of scheduled IoT devices $U$. This is becasue each F-AP has certain computation frequency capability, and thus it can schedule only a limited number of IoT devices. Finally, C5 indicates the QoS requirement on the FL time. Note that both problems $\mathcal P_1$ and $\mathcal P_2$ are non-convex optimization problems. In addition, owing to the coupling of the optimization variables $f_n$, $f_k$ and $p_n$, it is challenging to solve problems $\mathcal P_1$ and $\mathcal P_2$. To this end, we divide both optimization problems into two subproblems and optimize them iteratively in order to achieve suboptimal yet practical solutions. \section{Energy Consumption Minimization: First Scenario}\label{G} \subsection{Problem $\mathcal P_1$ Transformation}\label{G-A} Solving problem $\mathcal P_1$ owing to its mixed combinatorial characteristics is challenging. Although exhaustive search and branch-and-bound approaches can obtain near-optimal solution to $\mathcal P_1$, such approaches are not suitable for the practical systems due to the significantly increased computational complexity. To strike a suitable balance between the required complexity and performance, we propose an iterative approach to solve problem $\text{P1}$ for large-scale IoT networks. To this end, we decompose $\mathcal P_1$ into the following two subproblems, namely, (i) IoT device scheduling and power allocation subproblem for a given IoT device' computation frequency allocation, and (ii) IoT device' computation frequency allocation subproblem for the determined power and IoT device scheduling. \textbf{IoT Device Scheduling and Power Allocation Subproblem:} For a fixed set of computation frequency allocation, $ f^*_n, \forall n\in \mathcal N$, the optimization problem $\mathcal P_1$ can be written as \begin{subequations} \begin{align} \nonumber & \mathcal{P}_3: \min_{\substack{\mathbf A, \mathbf S,\bf p}} \sum_{n\in\mathcal N} \frac{p_nd_n}{W\log_{2}(1+\gamma^n_{k,z})} \\ &\rm s.t. \begin{cases} \nonumber \hspace{0.2cm} \text{C1}, \text{C2}, \text{C5},\\ \hspace{0.2cm} \text{C4:}\hspace{0.2cm} T_l\frac{C_n D_n}{f^*_n}+\frac{d_n}{R_{k,z}^n}\leq T_{q,k}, \forall n\in \mathcal N, \end{cases} \end{align} \end{subequations} where $T_{q,k}=T_q- \frac{\sum_{n\in \mathcal N_k}d_n}{R_{fh}}$. In $\mathcal{P}_3$, the optimization is over the continuous variables $\bf p$, and the discrete variables $a_{k,n}$, and $s^n_{k,z}, \forall k\in \mathcal K, n\in \mathcal N, z\in \mathcal Z$. Nevertheless, it is still challenging to solve problem $\mathcal P_3$ because of the non-convexity. We hence design an efficient yet low-complexity graph theory algorithm to tackle this problem in Section IV. B. \textbf{Computation Frequency Allocation Subproblem:} For the given transmit power allocation and scheduling among the IoT devices, RRBs, and F-APs, problem $\mathcal P_1$ is reduced to the following subproblem \begin{subequations} \begin{align} \nonumber & \mathcal{P}_4: \min_{\substack{\textbf{f}_N}} \sum_{n\in\mathcal N} T_lC_nD_n\alpha f^2_n \\ &\rm s.t. \begin{cases} \nonumber \hspace{0.2cm} \text{C3:}\hspace{0.2cm} f^{\min}_n \leq f_n \leq f^{\max}_n, ~\forall n\in \mathcal{N},\\ \hspace{0.2cm} \text{C4:}\hspace{0.2cm} \max_{n \in \mathcal N}\left\{T_l\frac{C_n D_n}{f_n}+\frac{d_n}{R_{k,z}^{*n}}\right\}\leq T_{q,k}. \end{cases} \end{align} \end{subequations} C4 can be transformed into $T_l\frac{C_n D_n}{f_n}+\frac{d_n}{R_{k,z}^{*n}}\leq T_{q,k}, \forall n \in \mathcal N$. Hence, the lower bound of IoT device's computation frequency can be calculated as $f_n\geq \frac{T_lC_n D_n}{T_{q,k}-\frac{d_n}{R_{k,z}^{*n}}}$. For simplicity, we denote $\hat f_n = \frac{T_lC_n D_n}{T_{q,k}-\frac{d_n}{R_{k,z}^{*n}}}$. Then, $f_n$ satisfies $f_n\geq \max\left\{f^{\min}_n,\hat f_n\right\}$, and accordingly, C3 and C4 can be combined as $\max\left\{f^{\min}_n,\hat f_n\right\}\leq f_n\leq f^{\max}_n$. Therefore, $\mathcal{P}_4$ can be expressed as \begin{subequations} \begin{align} \nonumber & \mathcal{P}_5: \min_{\substack{f_n}} \sum_{n\in\mathcal N} T_lC_nD_n\alpha f^2_n\\ &\rm s.t. \hspace{0.2cm} \max\left\{f^{\min}_n,\hat f_n\right\} \leq f_n \leq f^{\max}_n, ~\forall n\in \mathcal{N}. \end{align} \end{subequations} \textit{\textbf{Lemma 1:}} \textit{The closed-form solution of subproblem $\mathcal P_5$ is obtained as} \begin{equation} \label{close_form_P5} \begin{split} f_n=\begin{cases} & f^{\min}_n, ~\text{if} ~\hat f_n \leq f^{\min}_n \\ & \hat f_n , ~\text{if} ~ f^{\min}_n< \hat f_n < f^{\max}_n\\ & f^{\max}_n, ~\text{if} ~ \hat f_n \geq f^{\max}_n \end{cases} \end{split} \end{equation} \proof The proof is omitted due to the space limitation. $\mathcal P_1$ is solved by iteratively solving both subproblems $\mathcal P_3$ and $\mathcal P_5$ until convergence. The overall algorithm to obtain a suitable solution to problem $\mathcal P_1$ is provided in \sref{G-C}. \vspace*{-0.4cm} \subsection{Subproblem $\mathcal P_3$ Solution }\label{G-B} In this subsection, we develop an effective and low complexity approach to solve the joint IoT device scheduling and power control subproblem $\mathcal P_3$. Our developed solution designs a graph for all IoT device-RRB-F-AP feasible schedules and efficiently allocates power levels for the IoT devices in each schedule. The two-stage solution is explained as follows. \textbf{Stage 1: IoT Device Feasible Scheduling:} In this stage, we design a graph that judiciously generates feasible NOMA clusters and jointly optimizes IoT devices-F-APs/RRBs assignments and transmit power of the IoT devices. This stage consists of graph design and maximum weight independent search (MWIS) method. \textit{1) \textbf{Graph design:}} Let $\mathcal G=(\mathcal V, \mathcal E, \mathcal W)$ represents an undirected graph. The graph $\mathcal G$ is constructed by generating a vertex $v$ for each 2-IoT devices, RRB, and F-AP in the network as follows. We start from RRB $z=1$, and assume that IoT device $n=1$ is allocated to it. Then, we find the available NOMA clusters according to the possible two scenarios: \begin{enumerate} \item If IoT device $n=1$ is not in the service area of the $k$-th F-AP, we check IoT device $n=2$ for possible association to RRB $z$ and F-AP $k$, and then continue finding the second IoT device. \item If IoT device $n=1$ is in the service area of the $k$-th F-AP, then we find the second UD $j=n+1$ (currently, $j = 2$), for the ($n = 1, z = 1$) pair. Afterwords, we find $p^*_n$, $p^*_j$ and calculate the rates, and then, we generate a vertex $v=\{(r^*_n, z,k), (r^*_j, z,k)\}$ that represents a feasible NOMA cluster. Given $r^*_n$, $r^*_j$, we then compute the weight of that vertex $w(v)= X_{n}+X_{j}$ and update $\mathcal G$. If adding $j=2$ is infeasible, we let $j=j+1=3$, and we verify the feasibility and repeat the aforementioned step. \end{enumerate} In order to obtain all the feasible NOMA clusters $((n,j)\in \mathcal N, z\in \mathcal Z, k \in \mathcal K), j > n$, we iteratively repeat the above process (1), (2). The vertices in the designed grpah $\mathcal G$ that represent NOMA feasible clusters are connected by a conflict edge according to the following connectivity conditions (CCs): \begin{itemize} \item \textbf{CC1:} The same IoT devices (any IoT device or both IoT devices) are associated with both vertices $v$ and $v'$. \item \textbf{CC2:} The same RRB in the same F-AP is associated with both vertices $v$ and $v'$. \end{itemize} In summary, two distinct vertices $v$ and $v'$ representing two different NOMA clusters are connecting by a conflict edge if and only if the associations of RRBs and IoT devices (one or both associations) they represent are appeared in both vertices. To select the IoT device-RRB-F-AP scheduling that provides a local minimum energy consumption, we design a proper weight $w(v)$ to each vertex $v \in \mathcal{G}$. For notation simplicity, we define the utility of IoT devices $n$ and $j$ as $X_n=T_lC_nD_n\alpha f^2_n+ \frac{p_nd_n}{R^n_{k,z}}$, $X_j=T_lC_jD_j\alpha f^2_j+ \frac{p_jd_j}{R^j_{k,z}}$, respectively. Therefore, the weight of vertex $v$ that reflects the minimum energy consumption of IoT devices $n, j$ can be given by \begin{equation}\label{W(v)} w(v)= X_{n^v}+X_{j^v}, \end{equation} where $X_{n^v}$ and $X_{j^v}$ are the utility of associated IoT devices $n$ and $j$ to vertex $v$, respectively. The weight of vertex $v$ in \eref{W(v)} is determined by the transmit powers $\{p^*_{n}$, $p^*_{j}\}$, computation frequency allocation $\{f^*_n$, $f^*_j\}$, RRB $z^v$, and F-AP $k^v$ allocated to them. \textit{2) \textbf{MWIS search method:}} In this step, the algorithm itratively and greedily selects the MWIS $\Gamma^*$ among all the minimal independent sets $\Gamma$ in the graph $\mathcal G$, where in each iteration we implement the following procedures. We compute the weight of all generated vertices using \eref{W(v)}. The vertex with the minimum weight $v^*$ is selected among all other corresponding vertices. The selected vertex $v^{*}$ is, then, added to $\Gamma^*$ that is initially empty. Afterwards, we update the $\mathcal{G}$ graph by removing the selected vertices $v^{*}$ and its connected vertices. As such, the next selected vertex is not in conflict connection with the already selected vertices in $\Gamma^*$. The process continues until no more vertices exist in $\mathcal{G}$. Since each RRB in each F-AP contributes by a single vertex, the number of vertices in $\Gamma^*$ is $ZK$. \textbf{Stage 2: Power Allocation:} From the designed $\mathcal G$, we obtain a set of vertices that represent NOMA clusters. Each NOMA cluster includes two IoT devices that simultaneously transmit to an F-AP over an RRB. For each vertex, we aim to determine transmit power allocations of the IoT devices such that (i) the overall uplink transmission rate is improved by suppressing the interference between the IoT devices and (ii) the energy consumption for wireless transmission is reduced. Without loss of generality, we consider a vertex where the $n$-th and the $j$-th IoT devices are clustered, and both IoT devices transmit to the $k$-th F-AP over the $z$-th RRB. For such a vertex, we formulate the transmit power allocation subproblem as $\mathcal{P}_3-1$ at the top of the next page. \begin{table*} \vspace*{-0.4cm} \begin{normalsize} \begin{equation} \label{P_3_2} \begin{split} \mathcal{P}_3-1: & \max_{\substack{0 \leq p_n\leq p_{\max},\\ 0\leq p_j \leq p_{\max}}} W\left(\log_{2}(1+\gamma^n_{k,z})+\log_{2}(1+\gamma^j_{k,z})\right)-V\left(p_n+p_j\right)\\ & \text{s.t.} \begin{cases} &\text{C8:}~W\log_{2}(1+\gamma^n_{k,z}) \geq R_{th,n}\\ & \text{C9:}~W\log_{2}(1+\gamma^j_{k,z}) \geq R_{th,j}. \end{cases} \nonumber \end{split} \end{equation} \end{normalsize} \vspace*{-0.2cm} \hrulefill \end{table*} In subproblem $\mathcal{P}_3-1$, $R_{th,n}$ and $R_{th,j}$ are the required uplink data rates for the $n$-th and $j$-th IoT devices, respectively; and $V$ is a given weight factor. In particular, $R_{th,n}=\frac{T_gd_n}{T_{q,k}-T_gT_l\frac{C_nD_n}{f_n^*}}$ and $R_{th,j}=\frac{T_gd_j}{T_{q,k}-T_gT_l\frac{C_jD_j}{f_j^*}}$. Essentially, the rate constraints C8 and C9 satisfy the FL delay constraint C4. On the other hand, the weight factor $V$ is selected to strike a suitable balance between capacity and energy consumption of the vertices. Note that the power allocation depends on the channel gain of the associated IoT devices. To this end, we first define $\Delta_n=\frac{\sigma^2}{p_{\max}}\left(2^{R_{th,n}/W}-1\right)$ and $\Delta_j=\frac{\sigma^2}{p_{\max}}\left(2^{R_{th,j}/W}-1\right)$. Thereafter, we consider the following four cases: \textbf{Case I:} $\left|G_{k,z}^n\right|^2 <\Delta_n$ and $\left|G_{k,z}^j\right|^2 <\Delta_j$, \textbf{Case II:} $\left|G_{k,z}^n\right|^2 \geq\Delta_n$ and $\left|G_{k,z}^j\right|^2 <\Delta_j$, \textbf{Case III:} $\left|G_{k,z}^n\right|^2 <\Delta_n$ and $\left|G_{k,z}^j\right|^2 \geq\Delta_j$, and \textbf{Case IV:} $\left|G_{k,z}^n\right|^2 \geq \Delta_n$ and $\left|G_{k,z}^j\right|^2 \geq\Delta_j$. The transmit power allocations, $(p_n^*, p_j^*)$, for each case are given as follows \textbf{Case I:} In this case, both IoT devices can not satisfy the rate constraints even using the maximum transmit power. Consequently, both IoT devices suspend their data transmission, and we obtain $p_n^*=0$ and $p_j^*=0$. \textbf{Case II:} In this case, only the $n$-th IoT device can satisfy the required rate constraint, and the transmission of the $j$-th IoT device is suspended. Therefore, we obtain $p_j^*=0$ and $p_n^*=\frac{\sigma^2}{|G_{k,z}^{n}|^2}\left(2^{R_{th,j}/W}-1\right)$. \textbf{Case III:} In this case, only the $j$-th IoT device can satisfy the required rate constraint, and the transmission of the $n$-th IoT device is suspended. Therefore, we obtain $p_n^*=0$ and $p_j^*=\frac{\sigma^2}{|G_{k,z}^{j}|^2}\left(2^{R_{th,j}/W}-1\right)$. \textbf{Case IV:} In this case, both IoT devices can simultaneously transmit. Without loss of generality, we assume that $|G_{k,z}^{j}|^2< |G_{k,z}^{n}|^2$, i.e., the $n$-th IoT device has a better channel gain compared to the $j$-th IoT device. According to the NOMA principle, the $k$-th F-AP first decodes the $n$-th IoT device's signal, and subsequently, decodes the $j$-th IoT device's signal after removing the interference from the $n$-th device via applying the SIC technique. We first introduce the following lemma to update the $j$-th IoT device's power allocation \textit{\textbf{Lemma 2:}} \textit{Assume that the given transmit power allocations for the $n$-th and the $j$-th IoT devices are $\tilde{p}_n$ and $\tilde{p}_j$, respectively. Therefore, the $j$-th IoT device's transmit power allocation to maximize subproblem $\mathcal P_3-1$ is obtained as \begin{equation} \label{p_j} p_j=\left[\frac{\frac{\gamma_{k,z}^{j}}{1+\gamma_{k,z}^{j}}}{V+\frac{(\gamma_{k,z}^{n})^2}{1+\gamma_{k,z}^{n}}\frac{|G_{k,z}^{j}|^2}{\tilde{p}_n |G_{k,z}^{n}|^2}}\right]_{p_{th}}^{p_{\max}} \end{equation} where $\gamma_{k,z}^{n}$ and $\gamma_{k,z}^{j}$ are calculated by plugging $\tilde{p}_n$ and $\tilde{p}_j$ to \eqref{SNR}, $p_{th}=\frac{\sigma^2}{|G_{k,z}^{j}|^2}\left(2^{R_{th,j}/W}-1\right)$, and $[\cdot]_{p_{th}}^{p_{\max}}$ denotes projection in the range of $[p_{th}, p_{\max}]$.} \proof The proof \ignore{is similar to \cite[Lemma 2]{Ahmed_Multi_level_EC}, and }is omitted due to the space limitation. We consider a suboptimal approach to iteratively update the transmit power allocation of both the $n$-th and the $j$-th IoT devices in inner and outer loop. Specifically, using a bi-section search method, the outer loop adjusts the power allocation of the $n$-th IoT device such that the rate constraint $\text{C8}$ is satisfied, and the inner loop adjusts the power allocation of the $j$-th IoT device according to \textit{Lemma 2}. Let us denote the minimum and maximum power level for the $n$-th IoT device as $p_{n,low}$ and $p_{n,high}$. The initial transmit power of the $n$-th IoT device is obtained as $p_n=\frac{p_{n,low}+p_{n,high}}{2}$. By plugging the transmit power of the $n$-th IoT device to \textit{Lemma 2}, the $j$-th IoT device's transmit power is determined. Thereafter, the achievable rate of the $n$-th IoT device is calculated. If $W \log_{2}(1+\gamma_{k,z}^{n})>R_{th,1}$, $p_{n,high} \leftarrow p_n$ is applied and if $W \log_{2}(1+\gamma_{k,z}^{n})<R_{th,1}$, $p_{n,low} \leftarrow p_n$ is applied. Then, the transmit power of the $n$-th IoT device is updated as $p_n=\frac{p_{n,low}+p_{n,high}}{2}$. The aforementioned procedures are repeated until $\left|W \log_{2}(1+\gamma_{k,z}^{n})-R_{th,1}\right|$ approaches a small value. The final values of $p_n$ and $p_j$ provide the required power allocations for the Case IV. The overall two-stage algorithm to the subproblem $\mathcal P_3$ is summarized in Algorithm \ref{alg1}. \begin{algorithm}[t!] \textbf{Data:} $\mathcal{N}, \mathcal{K}, \mathcal{Z}$, $G^n_{k,z}$, $p_\text{max}$, and $f^*_n$, $(n,k,z)\in\mathcal{N}\times\mathcal{K}\times\mathcal{Z}$.\; \textbf{Stage 1: IoT device feasible scheduling}\; \begin{itemize} \item Initialize $\mathcal G=\emptyset$. \\ \For{$k=1:K$}{ \For{$z=1:Z$}{ Set $n=1$\\ \eIf{the $n$-th IoT device in $\mathcal N_k$}{ Set $j=n+1$\\ \While{$j<N$}{ \If{the $j$-th IoT device in $\mathcal N_k$}{ Based on $p_n$ and $p_j$, calculate $r_n, r_j$\\ Generate vertex $v=\{(r^*_n, z,k), (r^*_j, z,k)\}$ and set $\mathcal G\longleftarrow \mathcal G\cup v$ } $j=j+1$ }} {$n=n+1$} } } \item For each $v \in \mathcal V$, finds its neighborhood $\mathcal N_{\mathcal G}(v)$ according to \textbf{CC1} and \textbf{CC2}. \item Calculate the weight of each vertex $w(v)$ as in \eref{W(v)}. \item Let $\Gamma^* = \emptyset, l=0, \mathcal G_l=\mathcal G$.\\ \item \textbf{MWIS Search Method:}\\ \While{$\mathcal V(\mathcal G_l)\neq \emptyset$}{ $v^*=\arg\min_{{v\in \mathcal G_l}(\Gamma)} \{w (v)\}$ and set $\Gamma \leftarrow \Gamma \cup v^*$ Let $\mathcal V(\mathcal G_{l+1})=\mathcal V(\mathcal G_l(\Gamma))$\\ $l=l+1$ } \item Output: The MWIS and its corresponding IoT device scheduling. \end{itemize} \textbf{Stage 2: Power allocation:} Allocate transmit power in the NOMA clusters according to the method described in \sref{G-B}. \caption{Low Complexity Graph Algorithm} \label{alg1} \end{algorithm} \begin{algorithm}[t!] \begin{algorithmic}[1] \STATE \textbf{Input:} $\mathcal{N}, \mathcal{K}, \mathcal{Z}$, $C_nD_n$, $T_l$, $W, \sigma^2$, $p_{\max}, T_q$, $f^{\min}_n$, and $f^{\max}_n$.\; \STATE \textbf{Output:} IoT device scheduling, $p_n$, and $f_n$.\; \STATE Initialize the number of iteration $t=1$, $f^{(0)}_n=f^{\min}_n$, $f^{(1)}_n=f^{\max}_n, \forall n\in \mathcal N$.\; \WHILE{$f^{(t)}_n \neq f^{(t-1)}_n ~and~ t< T_{\max}$} \STATE Solve $\mathcal P_3$ as in Algorithm \ref{alg1}.\; \STATE Calculate the solution $f^{(t)}_n$ of the problem $\mathcal P_5$ according to \textit{Lemma 1}.\; \STATE $t=t+1$. \ENDWHILE \STATE Return IoT device scheduling, $p^{(t)}_n$, and $f^{(t)}_n$. \; \end{algorithmic} \caption{Proposed Iterative Algorithm} \label{alg2} \end{algorithm} \vspace*{-0.5cm} \subsection{Proposed Algorithm}\label{G-C} Our proposed iterative scenario to the problem $\mathcal P_1$ is summarized in Algorithm \ref{alg2}. Line 4 initiates the computation frequency allocation. The loop in lines 5-9 alternatively obtains the solutions of subproblems $\mathcal P_3$ and $\mathcal P_5$ and terminates when $f^{(t)}_n$ does not change or the maximum number of iteration is reached. Specifically, line $6$ calculates $p^{(t)}_n$ with fixed $f^{(t-1)}_n$ from the previous iteration and line $7$ calculates $f^{(t)}_n$ with fixed $p^{(t)}_n$ from the current iteration. \vspace*{-0.4cm} \subsection{Complexity Analysis} The computational complexity of Algorithm \ref{alg2} is dominated by the required complexity of the graph construction stage of Algorithm \ref{alg1}. In order to generate all the vertices using the low-complexity graph punning method, a total of $\mathcal{O}(NKZ)$ computational complexity is required. The required complexity of connecting the generated vertices, i.e., the required complexity of finding neighborhood of the generated vertices is $\mathcal{O}((NKZ)^2)$. Therefore, the overall computational complexity of Algorithm \ref{alg2} is obtained as $\mathcal{O}\left(NKZ+(NKZ)^2\right)\approx \mathcal{O}(N^2K^2 Z^2)$. \section{Energy Consumption Minimization: Second Scenario}\label{MT} \subsection{Problem $\mathcal P_2$ Transformation}\label{MT-A} W decompose $\mathcal P_2$ into two subproblems, namely, (i) joint power allocation and IoT device-F-AP/RRB scheduling optimization subproblem for fixed F-APs' computation frequency allocation, and (ii) F-APs' computation frequency allocation that optimizes computation allocation. \textbf{IoT Device Scheduling and Power Allocation Subproblem:} For a fixed set of F-APs' computation frequency allocation, $f^*_k, \forall k\in \mathcal K$, the optimization problem $\mathcal P_2$ can be written as \begin{subequations} \begin{align} \nonumber & \mathcal{P}_6: \min_{\substack{\mathbf A, \mathbf S,\bf p}} \sum_{n\in\mathcal N} \frac{p_n\mathtt D_n}{W\log_{2}(1+\gamma^n_{k,z})} \\ &\rm s.t. \begin{cases} \nonumber \hspace{0.2cm} \text{C1}, \text{C2}, \text{C4}, \text{C5},\\ \hspace{0.2cm} \text{C7:}\hspace{0.2cm} \max_{n\in \mathcal N_k}\left\{\frac{\mathtt D_n}{R_{k,z}^n}\right\}+T_l\frac{C_k B_k}{f^*_k}+\frac{d_k}{R_{fh}}\leq T_{q}, \forall k\in \mathcal K. \end{cases} \end{align} \end{subequations} \ignore{Note that the transmission time for uploading local parameters from F-APs to the CS is ignored in C7 becasue it negligible.} In $\mathcal{P}_6$, the optimization is over the continuous variables $\bf p$, and the discrete variables $a_{k,n}$, and $s^n_{k,z}, \forall k\in \mathcal K, n\in \mathcal N, z\in \mathcal Z$. It is still difficult to solve problem $\mathcal P_6$ because of its non-convexity. To find a tractable solution to $\mathcal P_6$, we develop an efficient algorithm in \sref{MT-B}. \textbf{Computation Frequency Allocation Subproblem:} After obtaining $p_n, \forall n \in \mathcal N$ and IoT device-RRB-F-AP scheduling, problem $\mathcal P_2$ is reduced to \begin{subequations} \begin{align} \nonumber & \mathcal{P}_7: \min_{\substack{\textbf{f}_K}} \sum_{k\in\mathcal K}\left[ T_lC_kB_k\alpha f^2_k +\frac{q_kd_k}{R_{fh}}\right] \\ &\rm s.t. \begin{cases} \nonumber \hspace{0.2cm} \text{C3:}\hspace{0.2cm} f^{\min}_k \leq f_k \leq f^{\max}_k, ~\forall k\in \mathcal{K},\\ \hspace{0.2cm} \text{C7:}\hspace{0.2cm} \max_{k\in \mathcal K}\left\{\max_{n\in \mathcal N_k}\left\{\frac{\mathtt D_n}{R_{k,z}^{*n}}\right\}+T_l\frac{C_k B_k}{f_k}+\frac{d_k}{R_{fh}}\right\}\leq T_{q}. \end{cases} \end{align} \end{subequations} Subproblem $\mathcal{P}_7$ can be equivalently expressed as \begin{subequations} \begin{align} \nonumber & \mathcal{P}_8: \min_{\substack{f_k}} \sum_{k\in\mathcal K}\left[ T_lC_kB_k\alpha f^2_k +\frac{q_kd_k}{R_{fh}}\right]\\ &\rm s.t. \hspace{0.2cm} \max\left\{f^{\min}_k,\hat f_k\right\} \leq f_k \leq f^{\max}_k, ~\forall k\in \mathcal{K}, \end{align} \end{subequations} where $\hat f_k= \frac{T_lC_k B_k}{T_q-\max_{n\in \mathcal N_k}\left(\frac{\mathtt D_n}{R_{k,z}^{*n}}\right)-\frac{d_k}{R_{fh}}}$. \textit{\textbf{Lemma 3:}} \textit{The closed-form solution to $\mathcal P_8$ is obtained as} \begin{equation} \label{close_form_P} \begin{split} f_k=\begin{cases} & f^{\min}_k, ~\text{if} ~\hat f_k \leq f^{\min}_k \\ & \hat f_k , ~\text{if} ~ f^{\min}_k< \hat f_k < f^{\max}_k\\ & f^{\max}_k, ~\text{if} ~ \hat f_k \geq f^{\max}_k \end{cases} \end{split} \end{equation} \proof The proof is omitted due to the space limitation. \subsection{Subproblem $\mathcal P_6$ Solution}\label{MT-B} This subsection first addresses the optimization subproblem $\mathcal P_6$ as an IoT device coordinated scheduling problem only, and can be written as \begin{subequations} \begin{align} \nonumber & \mathcal{P}_{9}: \min_{\substack{\mathbf A, \mathbf S}} \sum_{n\in\mathcal N} \frac{p^*_{n}\mathtt D_n}{W\log_{2}(1+\gamma^n_{k,z})} \\ &\rm s.t. \begin{cases} \nonumber \hspace{0.2cm} \text{C1:}\hspace{0.2cm} \sum_{k\in \mathcal K}a_{k,n} =1 ~\&~ \sum_{z\in \mathcal Z}s^n_{k,z} =1, \forall n \in \mathcal N, \\ \hspace{0.2cm} \text{C2:}\hspace{0.2cm} \sum_{n\in \mathcal N}s^n_{k,z} \leq 2, \forall k\in \mathcal K, z \in \mathcal Z\\ \hspace{0.2cm} \text{C4:}\hspace{0.2cm} \mathtt N_k \leq U, ~\forall k\in \mathcal{K},\\ \hspace{0.2cm} \text{C7:}\hspace{0.2cm} \max_{n\in \mathcal N_k}\left\{\frac{\mathtt D_n}{R_{k,z}^n}\right\}\leq T_{q,k}, \forall n\in \mathcal N, \end{cases} \end{align} \end{subequations} where $T_{q,k}=T_q-\left(T_l\frac{C_k B_k}{f^*_k}+\frac{d_k}{R_{fh}}\right)$. The optimization is carried over the variables $\mathbf A$, $\mathbf S$. On the other hand, for the resulting IoT device-RRB/F-AP schedule, $\mathcal P_6$ can be considered as a power allocation step and simplifies per RRB basis. For each RRB $z$, the optimization problem $\mathcal P_6$ can be written as \begin{subequations} \begin{align} \nonumber & \mathcal{P}_{10}: \min_{\substack{\bf p}} \sum_{n\in\mathcal N} \frac{p_n\mathtt D_n}{W\log_{2}(1+\gamma^n_{k,z})} \\ &\rm s.t. \begin{cases} \nonumber \hspace{0.2cm} \text{C5:}\hspace{0.2cm} 0 \leq p_n \leq p_{\max}, ~\forall n\in \mathcal{N},\\ \hspace{0.2cm} \text{C7:}\hspace{0.2cm} \max_{n\in \mathcal N_k}\left\{\frac{\mathtt D_n}{R_{k,z}^n}\right\}\leq T_{q,k}, \forall n\in \mathcal N, \end{cases} \end{align} \end{subequations} where the optimization is over the set of powers $p_n$, $\forall n\in \mathcal N$. Note that solving the power allocation problem $\mathcal P_{10}$ for the resulting IoT device-RRB/F-AP schedule is omitted in this section becasue it can follow the solution of $\mathcal P_{3}-1$ in \sref{G-B}. The graph-based solution of the IoT coordinated scheduling problem $\mathcal P_9$ is explained as follows. \textit{1) \textbf{IoT Device Coordinated Scheduling:}} The NOMA-coordinated graph is introduced to jointly consider NOMA cluster per RRB, maximum number of IoT devices scheduled to F-AP, and transmission conflict. The NOMA-coordinated graph, denoted by $\mathcal{G}_\text{NOMA}(\mathcal{V},\mathcal{E})$, is designed by generating all vertices for the $k$-th F-AP. The vertex set $\mathcal V$ of the entire graph is the union of vertices of all F-APs. Consider, for now, generating the vertices of F-AP $k$. Therefore, each vertex $v_{k,z,n,j}$ is generated for each $z\in \mathcal{Z}$ and for every 2-IoT devices $(n,j)$ in the service area of F-AP $k$. Similarly, we generate all vertices for all F-APs in $\mathcal K$. The configuration of the set of edges in the NOMA-coordinated graph is divided into IoT devices' association and transmission conflict edges. Two vertices $v_{k,z,n,j}$ and $v_{k,z',n^\prime,j\prime}$ representing different RRB $z$ and the same F-AP $k$ are adjacent by a conflict link if the number of scheduled IoT devices $\mathtt N_k$ to F-AP $k$ is more than $U$. Similarly, two vertices $v_{k,z,n,j}$ and $v_{k^\prime,z^\prime,n^\prime,j^\prime}$ are adjacent by a transmission conflict link if one of these conditions is true: \begin{itemize} \item $n=n'$ and/or $j=j'$. This condition schedules different IoT devices to different RRBs/F-APs. \item $z=z'$ and $k = k'$. This condition insists that same RRB in the same F-AP is associated with both vertices $v_{k,z,n,j}$ and $v_{k^\prime,z^\prime,n^\prime,j^\prime}$. \end{itemize} Therefore, two vertices $v_{k,z,n,j}$ and $v_{k^\prime,z^\prime,n^\prime,j^\prime}$ are adjacent by a conflict edge in $\mathcal E$ if they satisfy one of the following \textbf{CCs}. \begin{itemize} \item \textbf{CC1:} ($n \neq n'$ and $j \neq j'$) and ($k = k'$ and $z \neq z'$), we have $\mathtt N_k > U$. \item \textbf{CC2:} $n=n'$ and/or $j=j'$. \item \textbf{CC3:} $z=z'$ and $k = k'$. \end{itemize} Consider the weight of each vertex $v_{k,z,n,j}$ is defined as $w(v)=T_lC_kD_n\alpha f^2_k+ \frac{p_n\mathtt D_n}{R^n_{k,z}}+T_lC_kD_j\alpha f^2_k+ \frac{p_j\mathtt D_j}{R^j_{k,z}}$. Thus, the vertex' weight becomes small when the data transmission time from the represented IoT devices is small as well as the local computation time at the represented F-AP is small. This yields to a smart scheduling of IoT devices representing the corresponding vertex with a smaller weight, which in turn minimizes the energy consumption. Therefore, any minimal independent set in NOMA-coordinated graph represents a set of NOMA clusters that satisfies the following criterion: 1) each IoT device in the set is scheduled to only one F-AP and one RRB, 2) each RRB identified by the vertices in a minimal independent set represents a NOMA cluster of two IoT devices, and 3) the total number of scheduled IoT devices at each F-AP is not larger than $U$. The following theorem characterizes the solution of allocating IoT devices to the RRBs across all F-APs such that the total energy consumption is minimized. \textit{\textbf{Theorem 1:}} \textit{ The IoT device coordinated scheduling problem $\mathcal P_{9}$ is equivalent to MWIS problem over the NOMA-coordinated graph, wherein the weight of a vertex $v_{k,z,n,j}$ is given by \begin{align} \label{eq39} w(v) = \alpha f^2_kT_lC_k\left(D_n+D_j\right)+ \frac{p_n\mathtt D_n}{R^n_{k,z}}+ \frac{p_j\mathtt D_j}{R^j_{k,z}}. \end{align} The set of scheduled IoT devices to the $z$-th RRB in the $k$-th F-AP is obtained by combining the vertices of the MWIS $\mathbf{I}$ in the NOMA-coordinated graph.} \begin{proof} This theorem can be proved by demonstrating the following facts. The first fact establishes the equivalency between $\mathcal P_{9}$ and MWIS problems. Specifically, using $\mathcal{G}_\text{NOMA}$, $\mathcal P_{9}$ is similar to MWIS problems. In MWIS problems, two vertices must be nonadjacent in the graph, and similarly, in problem $\mathcal P_{9}$, two NOMA clusters cannot be allocated with the same RRB or contain at least one IoT device. Afterward, the weight of each vertex is set to be the minimum energy consumption contribution of the corresponding NOMA cluster to the network. Therefore, the MWIS is a feasible solution with the minimum energy consumption, i.e., the MWIS is the feasible solution to $\mathcal P_{9}$. To finalize the proof, we now prove that the weight of the MWIS is the objective function in $\mathcal P_{9}$ to be minimized. Let $\mathbf{I}=\{v_1,v_2,\ \cdots, \, v_{|\mathbf{I}|}\}$, $v\in \mathcal{G}_\text{NOMA}$. Let a vertex $v \in \mathcal{V}$ is associated with 2-IoT devices NOMA cluster $(n,j)$. The weight of the MWIS over all the vertices that are representing the corresponding NOMA clusters over all RRBs/F-APs can be written as \begin{align} \begin {split} w(\mathbf{I})&= \sum\limits _{v\in \mathbf{I}}w(v)\\&= \sum\limits _{\mathbf{k}\in \mathcal{K}} \sum\limits _{z\in \mathcal{Z}}\left(\alpha f^2_kT_lC_k\left(D_n+D_j\right)+ \frac{p_n\mathtt D_n}{R^n_{k,z}}+ \frac{p_j\mathtt D_j}{R^j_{k,z}}\right). \end{split} \end{align} Therefore, the problem of minimizing the energy consumption $\mathcal P_{9}$ is equivalent to the MWIS problem among the minimal sets in the NOMA coordinated graph. \end{proof} \textit{2) \textbf{Heuristic Solution:}} MWIS problems are NP-hard problems, where the required complexity of solving these problems optimally requires an exhaustive search of $|\mathcal{V}|^2.2^{|\mathcal{V}|}$ complexity where $\mathcal{V}$ is the set of vertices of graph $\mathcal{G}_\text{NOMA}$. However, MWIS problems can be heuristically solved with a reduced complexity of $b^{|\mathcal{V}|}$ where $b$ is the complexity constant \cite{25, 26}. Thus, the MWIS problem can be solved effectively using a low-complexity heuristic solution. Let $w(v)$ be the raw weight of vertex $v$ in the NOMA coordinated graph as expressed in \eref{eq39}. The modified weight $\tilde{w}(v)$ of vertex $v$ can be defined as \begin{equation} \label{eq41} \tilde{w}(v)= w(v)\sum_{v^\prime\in\mathcal{V}_v}w({v^\prime}), \end{equation} where $\mathcal{V}_v$ is the set of vertices not connected to vertex $v$ by transmission conflict edges. The appropriate design of the weights shows that $\tilde{w}_v$ reflects the contribution of the vertex to the network as it has a small raw weight and non-adjacent to a large number of vertices induced by users with small raw weight. The two-phase scenario of IoT device coordinated scheduling and F-AP's computation frequency allocation is presented in Algorithm \ref{alg3}. \begin{algorithm}[t!] \textbf{Data:} $\mathcal{N}, \mathcal{K}, \mathcal{Z}$, $p_\text{max}$, $f_k^\text{min}$, $f_k^\text{max}$, $T_q$, $C_kD_k$, $d_k$, and $G^n_{k,z}$, $(n,k,z)\in\mathcal{N}\times\mathcal{K}\times\mathcal{Z}$.\; \textbf{Phase I: IoT device coordinated scheduling}\; \begin{itemize} \item Initialize $\mathcal G_\text{NOMA}=\emptyset$, $\mathbf I=\emptyset$.\; \item Construct $\mathcal G_\text{NOMA}$ using \sref{MT-B}.\; \item For each $v\in \mathcal G_\text{NOMA}$, calculate $w(v)$ and $\tilde{w}(v)$ using \eref{eq39}, \eref{eq41}, respectively\; \item Solve the MWIS problem in $\mathcal{G}_\text{NOMA}$ to find $\mathbf{I}$ as follows:\; \While{$\mathcal{G} \neq\ \emptyset$}{ $v^\ast = \min_{v\in\mathcal{G}_\text{NOMA}} \{{w(v)}\}$\; Set $\mathbf{I}$ = $\mathbf{I}\ \cup v^{\ast}$ and set $\mathcal{G}_\text{NOMA}=\mathcal{G}_\text{NOMA}(v^{\ast })$\; Continue only with vertices not linked to $v^{\ast}$ in $\mathcal{G}_\text{NOMA}$\;} \item Output: The MWIS $\mathbf I$.\; \item For the resulting $\mathbf I$, solve the power allocation problem $\mathcal P_{10}$. \item Continue iterating between finding $\mathbf I$ and solving $\mathcal P_{10}$ until convergence. \end{itemize} \textbf{Phase II: F-APs' computation frequency allocation}\; \begin{itemize} \item \textbf{Solve $\mathcal P_{8}$ for the resulting $\mathbf I$ and power allocation}.\; \For{$v=\{v_1,v_2,\ \cdots, |\mathbf I|\}$}{ Calculate $\hat f_k=\frac{T_lC_k B_k}{T_q-\max_{n\in \mathcal N_k}\left(\frac{\mathtt D_n}{R_{k,z}^{*n}}\right)-\frac{d_k}{R_{fh}}}$, $\forall (k,z,n)$ is associated with $v$\; Calculate $f_k$ according to \textit{Lemma 3} } \item Execute phases 1 and II until convergence or a maximum number of iteration is reached. \item Obtain $\mathbf I$ and $\mathbf f_K$. \end{itemize} \caption{Coordinated Scheduling Algorithm} \label{alg3} \end{algorithm} \subsection{Complexity Analysis} The computational complexity of Algorithm \ref{alg3} is dominated by the required complexity of generating feasible NOMA clusters and connecting the generated vertices. To generate all the vertices using the low-complexity graph method, a total of $\mathcal{O}\left(KZ\binom{|\mathcal N_k|}{2}\right)$ computational complexity is required. On the other hand, the required complexity of connecting the generating vertices, i.e., the required complexity of finding neighborhood of the generated vertices is $\mathcal{O}\left(\left(KZ\binom{|\mathcal N_k|}{2}\right)^2\right)$. Therefore, the overall computational complexity of Algorithm \ref{alg3} is obtained as $\mathcal{O}\left(NKZ+\left(KZ\binom{|\mathcal N_k|}{2}\right)^2\right)\approx \mathcal{O}\left(\left(KZ\binom{|\mathcal N_k|}{2}\right)^2\right)$.\ignore{ Accordingly, Algorithm \ref{alg2} requires polynomial computational complexity.} \section{Numerical Results}\label{NR} \ignore{This section presents selected simulation results that compare the energy consumption and FL times performances of our proposed two schemes with baseline algorithms.} \subsection{Simulation Setting and Schemes Under Consideration} In our simulations, we consider a hexagonal cell of radius $1500$ m where F-APs and CS have fixed locations and IoT devices are distributed randomly within the cell. The CS is located at the cell center. The channel model for IoT device-F-AP transmissions follows the standard path-loss model, which consists of three components: 1) path-loss of $128.1+37.6\log_{10}(\text{dis.[km]})$; 2) log-normal shadowing with $4$ dB standard deviation; and 3) Rayleigh channel fading with zero-mean and unit variance. The noise power, F-AP's power, and maximum' IoT device power are assumed to be $-174$ dBm/Hz and $q_k=p_\text{max}=3$ W, respectively \cite{FCR11}. The weighting factor $V$ is set to $0.3$. The total number of global and local FL iterations are calculated as $T_g=\frac{2\beta^2}{(2\vartheta-\beta \eta)\vartheta \eta}\ln(1/\epsilon_g)$, $T_l=\frac{2}{(2-\delta \beta)\delta \vartheta}\ln(1/\epsilon_l)$, respectively, with $\beta=4, \eta=1/3, \delta=1/4, \vartheta=2, \epsilon_g=\epsilon_l=10^{-3}$ \cite{7a}. The FL time threshold $T_q$ is $1$ second \cite{7a}. The bandwidth of each RRB is $20$ MHz. Unless otherwise stated, we set the numbers of F-APs and RRBs to $9$ and $4$, respectively. The fronthaul capacity $R_{fh}$ is set to 150 Mbit/s. For each IoT device and each F-AP, the number of data samples $D_n$ is randomly chosen from $800$ to $1000$. Other parameters are summarized in Table \ref{table_1}. To assess the performance of our proposed scenarios, we simulate various scenarios with different number of IoT devices $N$, data size $\mathtt D_n$, number of RRBs $Z$, number of data samples $D_n$, computation frequency allocation $f_n$, $f_k$, and parameter data size. For the sake of comparison, our proposed schemes are compared with the following baseline schemes. \begin{itemize} \item \textbf{Power-only:} This scheme minimizes the energy consumption by optimizing the power level of IoT devices and fixing the computation frequency allocation to its maximum value. \item \textbf{Computation frequency-only:} This scheme, denoted by \textit{CPU-only}, minimizes the energy consumption by optimizing the computation frequency allocation and fixing the power level to its maximum value. \item \textbf{Fixed}: This scheme employs random IoT device scheduling and fixes both the computation frequency allocation and transmission power to their maximum values. \end{itemize} \begin{table}[t!] \renewcommand{\arraystretch}{0.9} \caption{Simulation Parameters} \label{table_1} \centering \begin{tabular}{p{5.4cm}| p{4.3cm}} \hline \hline \textbf{Parameter} & \textbf{Value}\\ \hline Circle radius of F-AP’s service area $\mathtt R$ & $500$ m\\ \hline learning local parameter size, $d_n$, $d_k$ & $[5-10]$ Kbit \cite{7a}\\ \hline IoT device data size, $\mathtt D_n$ & $[0.5-1]$ Mbit\\ \hline IoT device processing density, $C_n$ & $[600-800]$ \cite{7a} \\ \hline F-AP processing density, $C_k$ & $[1000-1500]$ \\ \hline IoT device computation frequency, $f_{n}$ & $[0.0003-1]$ G cycles/s \cite{7a}\\ \hline F-AP computation frequency, $f_{k}$ & $[0.0005-5]$ G cycles/s \\ \hline CPU architecture based parameter, $\alpha$ & $10^{-28}$ \cite{14}\\ \hline \end{tabular} \end{table} \vspace*{-0.2cm} \subsection{Simulation Results and Discussions} We adopt two performance metrics as follows: (i) the \textit{energy consumption} that represents the objective in $\mathcal P_1$ for the IoT device local learning scenario and $\mathcal P_2$ for the F-AP local learning scenario, and (ii) the \textit{FL time} as expressed in \eref{FL_1}. \textit{1) Consumption energy performance:} In Figs. \ref{fig3}-a and \ref{fig3}-b, we plot the energy consumption versus the number of IoT devices for the first and second scenarios, respectively. Our proposed schemes have the following two attributes. First, they judiciously schedule IoT devices to F-APs/RRBs, adapt the transmission rate of each IoT device, and optimize the transmission power of each IoT device. Second, our proposed schemes efficiently optimize the computation frequency allocation of IoT devices and F-APs. Leveraging these two attributes, our proposed schemes significantly reduce the energy consumption compared to the benchmark schemes, as depicted from both Figs. \ref{fig3}-a and \ref{fig3}-b. In particular, the \textit{power-only} scheme selects the maximum computation frequency allocation for each IoT device and each F-AP. Consequently, the \textit{power-only} scheme results in higher energy consumption for local learning, and it increases the energy consumption of the system in both scenarios. The \textit{CPU-only} scheme ignores the power optimization that leads to more interference among the IoT devices and increased offloading transmission time. As a result, the \textit{CPU-only} scheme leads to a high energy consumption. Finally, the \textit{fixed} scheme has the most energy consumption because it chooses the maximum CPU frequency and transmission power. Accordingly, from an energy consumption perspective, it is inefficient to offload data to F-APs while ignoring the power allocation and employing random IoT device scheduling to F-APs/RRBs. \begin{figure}[t!] \centering \begin{minipage}{0.494\textwidth} \centering \includegraphics[width=0.75\textwidth]{fig1new.pdf} \caption{Energy consumption vs. number of IoT devices $N$ for $K = 9$ and $Z=4$.} \label{fig3} \end{minipage}\hfill \begin{minipage}{0.494\textwidth} \centering \includegraphics[width=0.75\textwidth]{fig2new.pdf} \caption{Energy consumption vs. data size for $N=50$, $K = 9$ and $Z=4$.} \label{fig4} \end{minipage}\hfill \end{figure} In Figs. \ref{fig4}-a and \ref{fig4}-b, we plot the energy consumption versus the data size $\mathtt D_n$ for the first and second scenarios, respectively. When the data size is small (around $1$ Kbit), both proposed schemes work superior in terms of minimizing the energy consumption. When the data size is nearly $10$ Mbit, the energy consumption performance of our proposed first scheme does not change much and has a performance of $3$ J. This is becasue the IoT devices perform local learning on the data and offload the local learning parameters only. However, when the data size changes from $1$ Kbit to $10$ Mbit, the energy consumption performance of the proposed second scheme changes form $1$ J to around $303$ J. Therefore, our proposed second scheme consumes more energy when the data size increases. Accordingly, from an energy consumption perspective, learning at the IoT devices as in the first proposed scenario is more efficient, especially for large numbers of IoT devices and large data sizes. In Figs. \ref{fig5}-a and \ref{fig5}-b, we show the energy consumption versus the number of data samples $D_n$ for the first and second scenarios, respectively. The number of data samples affects the CPU-related energy consumption. Similar to our discussions for Fig. \ref{fig3}, the \textit{CPU-only} and \textit{fixed} schemes severely degrades the energy consumption performance. Specifically, the energy consumption of the \textit{fixed} scheme is increased with the number of data samples. However, the energy consumption of the \textit{power-only} and our proposed schemes do not significantly change, e.g., see Fig. \ref{fig5}-(a). Since the energy consumption in the second scenario is dominated by data offloading to F-APs, both \textit{CPU-only} and \textit{fixed} schemes consume high energy as can be seen from Fig. \ref{fig5}-(b). Using the optimized resource allocations, our proposed schemes incur the least energy consumption for both small and large data samples. In Figs. \ref{fig6}-a and \ref{fig6}-b, we plot the energy consumption versus the number of RRBs $Z$ for the first and second scenarios, respectively. As can be seen, the consumed energy of all schemes are increased with the increase in the number of RRBs. This is due to the fact that as the number of RRBs increases, more IoT devices are scheduled, which in turn increases the energy consumption. Specifically, when $Z=1$, the maximum number of accommodated IoT devices by the F-APs is $2ZK=2\times 1\times 9=18$, thus the consumed energy of all schemes is low. As the number of RRBs is increased, the energy consumption of all the schemes is increased. This can be explained by the fact that when the number of RRBs goes beyond $2$, no more IoT devices can be accommodated. Thus, the consumed energy of all schemes do not change much. For a fair comparison, we consider that all the schemes serve the same set of IoT devices in the available RRBs of a given F-AP. The proposed schemes, however, benefit from optimizing the transmit power and computation frequency allocation. Essentially, the proposed schemes achieve reduced energy consumption compared to the benchmark schemes. \begin{figure}[t!] \centering \begin{minipage}{0.494\textwidth} \centering \includegraphics[width=0.75\textwidth]{fig3new.pdf} \caption{Energy consumption vs. number of data samples for $N=50$, $K = 9$ and $Z=4$.} \label{fig5} \end{minipage}\hfill \begin{minipage}{0.494\textwidth} \centering \includegraphics[width=0.75\textwidth]{fig4newnew1.pdf} \caption{Energy consumption vs. number of RRBs $Z$ for $N=50$ and $K = 9$.} \label{fig6} \end{minipage}\hfill \end{figure} \begin{figure}[t!] \centering \begin{minipage}{0.494\textwidth} \centering \includegraphics[width=0.75\textwidth]{fig5CPUnew.pdf} \caption{Energy consumption vs. computation frequency for $N=50$, $K = 9$ and $Z=4$.} \label{fig7} \end{minipage}\hfill \begin{minipage}{0.494\textwidth} \centering \includegraphics[width=0.75\textwidth]{fig1FLnew.pdf} \caption{Federated learning time vs. number of IoT devices $N$ for $K = 9$ and $Z=4$.} \label{fig8} \end{minipage}\hfill \end{figure} In Figs. \ref{fig7}-a and \ref{fig7}-a , we show the energy consumption versus the number of CPU cycles for the first and second scenarios, respectively. The number of CPU cycles ranges from $2\times10^7$ to $10\times10^7$ in Fig. \ref{fig7}-(a) and from $2\times10^9$ to $10\times10^9$ in Fig. \ref{fig7}-(b). The number of CPU cycles determines the energy consumption. Hence, the energy consumption of both \textit{fixed} and \textit{power-only} schemes, that fix the computation frequency allocation at the highest value, is considerably increased with the increasing number of computation cycles. On the other hand, the energy consumption of both \textit{CPU-only} and proposed schemes with adjustable CPU frequencies do not change much as shown in Figs. \ref{fig7}-a and \ref{fig7}-b. As expected, using both transmit power and computation frequency allocation, our proposed schemes incur the least energy consumption for both small and large numbers of CPU cycles. \begin{figure}[t!] \centering \begin{minipage}{0.494\textwidth} \centering \includegraphics[width=0.75\textwidth]{fig2FLnew.pdf} \caption{Federated learning time vs. number of data samples $D_n$ for $K = 9$ and $Z=4$.} \label{fig9} \end{minipage}\hfill \begin{minipage}{0.494\textwidth} \centering \includegraphics[width=0.75\textwidth]{fig3FL1.pdf} \caption{Federated learning time vs. parameter data size $d_n$ for $K = 9$ and $Z=4$.} \label{fig10} \end{minipage}\hfill \end{figure} \ignore{ \begin{figure}[t!] \centering \begin{subfigure}[t]{0.28\textwidth} \centerline{\includegraphics[width=1.11\linewidth]{fig1FL.eps}} \label{MCT} \end{subfigure}% ~ \begin{subfigure}[t]{0.28\textwidth} \centerline{\includegraphics[width=1.13\linewidth]{fig2FL.eps}} \label{NCT} \end{subfigure} ~ \begin{subfigure}[t]{0.28\textwidth} \centerline{\includegraphics[width=1.13\linewidth]{fig3FL1.eps}} \label{MCT} \end{subfigure}% \caption{FL time versus: (a) number of IoT devices $N$, (b) number of data samples $D_n$, and (c) parameter data size $d_n$.} \label{figFL} \end{figure}} \textit{2) FL time performance:} In Fig. \ref{fig8}, Fig. \ref{fig9}, and Fig. \ref{fig10}, we plot the federated learning time versus: (a) number of IoT devices $N$, (b) number of data samples $D_n$, and (c) parameter data size $d_n$, respectively. First, it is clear that the FL time depends on the transmission time and the computation learning time of IoT devices. Since the local learning parameters have small size, the transmission time for offloading such parameters to F-APs/CS requires smaller portion of the overall FL time compared with the computation training time. Consequently, the FL time is dominated by the computation training time. As can be seen from Figs. \ref{fig8}, \ref{fig9}, \ref{fig10}, \textit{fixed} scheme, that chooses the maximum CPU frequency, effectively minimizes the FL time at the cost of consuming the most energy as shown in Fig. \ref{fig3} to Fig. \ref{fig7}. Our proposed first scheme that considers IoT device local learning, denoted by \textit{proposed}, adjusts the CPU frequency and power transmissions so that it effectively minimizes the consumed energy within the FL time of $1$ second. In Figs. \ref{fig8}, \ref{fig10}, the FL time of all algorithms does not change much with the number of IoT devices and local parameter size. This is because the FL time is mainly controlled by the longest local training time of one IoT device, which does not significantly change when the number of IoT device and the local parameter size are increased. Finally, we provide some observations from our presented simulation results as follows. First, although the \textit{fixed} scheme performs fairly well in terms of reducing the FL time, it exhibits a poor energy consumption performance, which is impractical. Thus, it only serves as a benchmark scheme in this work. Second, it is advantageous to optimize the computation frequency allocation of the IoT devices and the F-APs as in the \textit{CPU-only} scheme. However, it is inefficient to ignore the power optimization that significantly impacts the energy consumption of the system. Third, the \textit{power-only} scheme works well in terms if reducing the energy consumption; however, its performance is degraded since it uses the maximum CPU of each IoT and each F-AP. Fourth, our proposed schemes strike a balance between the aforementioned aspects by judiciously scheduling IoT devices to F-APs/RRBs, adapting the transmission rate of each IoT device, and optimizing the transmission power of each IoT device. Furthermore, our proposed schemes efficiently optimize the computation frequency allocation of IoT devices and F-APs. Finally, as the data size increases, the energy consumption performance of the second proposed scheme degrades. This is because as the data size increases, the transmission time for offloading IoT devices' data to F-APs is significantly increased. Thus, the energy efficiency of our proposed first scheme becomes more pronounced compared to our second proposed scheme. \section{Conclusion} \label{C} In this paper, we investigated the resource allocation strategy to minimize the energy consumption for performing FL in an integrated FCC-enabled IoT network subject to FL time constraint. Specifically, we considered two scenarios for training the local models, and for both scenarios, we proposed joint optimization of computation frequency allocation, IoT device scheduling, and transmission power control of network edge devices. Leveraging graph theory, we proposed efficient iterative schemes. The presented numerical results revealed that the proposed schemes substantially reduce the energy consumption compared to the baseline solutions, at the cost of small increase of FL learning time. The presented simulation results interestingly revealed that for a large number of IoT devices and large data sizes, it is more energy efficient to train the local models at the IoT devices instead of the F-APs.
\section{Introduction} Isolated systems when left to themselves approach a state of thermodynamic equilibrium spontaneously. This state of equilibrium can be uniquely characterized by a set of thermodynamic variables also known as state variables. A driven macroscopic system that can self-organize itself tends to resist this state of universal attractor by locking itself in meta-stable states of dynamical equilibrium. These meta-stable states give rise to complex structures which adapt and self-organize in response to the effects of external perturbations in the form of thermodynamic forces, flows, and currents. Some examples of spatio-temporal pattern formation through self-organization include phase-transition in magnetic systems, critical phenomena in dynamical systems, fluid-phase instabilities in thermo-fluid systems, self-assembly in molecular systems, oscillatory reactions in chemical systems, and collective behavior in biological, active matter, and social systems~\cite{cross1993pattern,jaeger2010far,ashby1991principles,national2007condensed,chatterjee2016thermodynamics,georgiev2016road,chatterjee2017aging,georgiev2017exponential}. Although far-from-equilibrium systems are ubiquitous in nature, a serious thermodynamic treatment of their behavior remains largely an uncharted territory~\cite{jaeger2010far,van2020nonequilibrium,martyushev2006maximum, chatterjee2016thermodynamics,lucia2008probability,lucia2012maximum,cimmelli2014entropy,li2019entropic,dong2012general}. One of the several ways to extend equilibrium thermodynamics to out-of-equilibrium systems is through the assumption of local equilibrium in classical irreversible systems~\cite{glavatskiy2015local,vilar2001thermodynamics}. An approach based on the local equilibrium hypothesis formulates a macroscopic system as collection of `cells' (domains) in which rules of classical equilibrium thermodynamics are fulfilled to good approximation. This particular viewpoint dates back several decades when Milne, from an astrophysical perspective, defined local thermodynamic equilibrium in a local `cell'. He proposed the condition that the `cell' will continue to be at local thermodynamic equilibrium as long as it macroscopically absorbs and spontaneously emits radiation as if it were in radiative equilibrium in a cavity at the temperature of the matter of the `cell'~\cite{milne1928effect}. If these `cells' are well-defined, then they allow for transport of matter and energy in between them. This however has to follow under the strict constraint that the flows and currents between the `cells' do not disturb the respective individual local thermodynamic equilibria with respect to the intensive variables. Therefore, one can think of two `relaxation times' that are separated by orders of magnitude: the longer relaxation time responsible for the macroscopic evolution of the system ($\tau_M$) and the shorter relaxation time ($\tau_m$) responsible for local equilibration of a single cell. If these two relaxation times are not well separated, then the classical non-equilibrium thermodynamical concept of local thermodynamic equilibrium loses its meaning~\cite{glansdorff1971thermodynamic,vilar2001thermodynamics,gyarmati1970non,ai2010non,jou1999extended,de1962non,bodenschatz1992experiments}. The ratio between these two time scales is called the Deborah number, $De = \tau_m/\tau_M$. For $De<<1$, the local equilibrium hypothesis is fully justified because the relevant variables evolve on a large timescale and do not practically change over the time, but the hypothesis is not appropriate to describe situations characterized by $De>>1$~\cite{lebon2008understanding}. While the validity of local equilibrium provides a useful framework to extend our understanding of the thermodynamics of classical irreversible systems, the assumption of local equilibrium is usually taken for granted. As has been previously noted by Ben-Naim, that the assumption of ``local equilibrium" is ill-founded, and that it is not clear whether it is possible to define an entropy-density function in order to obtain the ``entropy production" of the entire system~\cite{ben2018validity,ben2020entropy}. We acknowledge that these are open problems in non-equilibrium thermodynamics that are of great fundamental importance. Therefore, it would be too ambitious of a task on our part to attempt to answer them in this paper. Rather, we use this paper as an avenue to present experimental evidence in support of the local-equilibrium assumption in a prototypical driven system, the non-turbulent Rayleigh-B{\'e}nard convection at steady-state. This work builds on our previous studies where we have performed extensive thermal analysis of these convective cells, and have shown that the temperature manifold bifurcates into regions of local sources and sinks as macroscopic order emerges~\cite{chatterjee2019coexisting,chatterjee2019many,chatterjee2019overview,yadati2019spatio,yadati2020experimental,chatterjee2020time}. In this paper, we first show that the temperature distribution profiles of these localized domains that coexist together at a non-equilibrium steady-state exhibit room temperature equilibrium-like statistics. Next, we investigate the nature of the emergent heat flux as a function of external driving force. Beyond a critical temperature it is observed that the emergent heat flux scales linearly with the mean top temperature and the external driving force. The linearity in the force-flux relationship is important in the context of non-equilibrium thermodynamics as it gives quantitative support to the local equilibrium hypothesis as the Rayleigh-B{\'e}nard system undergoes an order-disorder like phase-transition (or can be more aptly described as, order-disorder phase-separation), while also allowing us to develop a meaningful definition of one of the key thermodynamic variables - temperature - in out-of-equilibrium scenarios. We start with a discussion of the Rayleigh-B{\'e}nard convection and the Bousinessq approximation~\cite{koschmieder1993benard}. Next we present our experimental methodology in brief, and discuss the spatio-temporal analysis of the thermal statistics. Following which we discuss the emergent force-flux relationship as the Rayleigh-B{\'e}nard system approaches a steady-state. We argue that the thermal statistics thus obtained from the infrared thermometry of the top layer of the fluid film along with the linearity in the force-flux relationship provide a quantitative evidence for the local equilibrium hypothesis. Finally, we discuss the implications of this result in broad perspectives both from a theoretical and a conceptual point of view. \section{The Rayleigh-B{\'e}nard Convection} The Rayleigh-B{\'e}nard convection holds a place of special interest in the scientific community~\cite{cross1993pattern,behringer1985rayleigh,bodenschatz2000recent}. It is one of the oldest and most widely used canonical examples to study pattern formation, emergence, and self-organization~\cite{cross1993pattern,jaeger2010far,glansdorff1971thermodynamic,koschmieder1993benard,heylighen2001science}. Although Rayleigh–Benard convection had been known since the early twentieth century, extensive work by Prigogine and colleagues established a critical link between self-organization and entropy production. They claimed that the creation of ordered structures in open systems is accompanied by increased ‘dissipation,' thus coining the term `dissipative structure'~\cite{prigogine1977time,nicolis1977self,meysman2010ecosystem}. When a thin film of liquid is heated, the competing forces between viscosity and buoyancy give rise to convective instabilities. This convective instability creates a spatio-temporal non-uniform thermal distribution on the surface of the fluid film as shown in Figure~\ref{fig1}. The advantage of this system lies in its simplicity, wherein a dimensionless quantity, the Rayleigh number $(Ra)$, determines the onset of convective cell patterns, \begin{equation} Ra = \frac{g\beta l_z^3}{\nu\alpha}(T_{bottom} - T_{top}) \label{eqn1} \end{equation} Here, $l_z$ denotes fluid film thickness, $\nu$ kinematic viscosity, $\alpha$ thermal diffusivity, $\beta$ thermal expansion coefficient, and $g$ acceleration due to gravity. The critical Rayleigh number ($Ra_c$) of $1708$ marks the onset of convection for a no-slip boundary condition was obtained by Jeffreys in 1929~\cite{cross1993pattern,koschmieder1993benard,rayleigh1916lix}. Under the approximations of an ideal incompressible fluid that is thermally driven one can write the following set of equations also known as the Boussinesq approximations, \begin{equation} \begin{gathered} \frac{\partial\rho}{\partial t} + \nabla\cdot(\rho\overrightarrow{u}) = 0\\ \frac{\partial\overrightarrow{u}}{\partial t} + (\overrightarrow{u}\cdot\nabla)\overrightarrow{u} = -\frac{1}{\rho}\nabla p + \nu\nabla^2\overrightarrow{u} - \overrightarrow{g}\beta\Delta T\\ \frac{\partial T}{\partial t} + \overrightarrow{u}\cdot\nabla T = \alpha\nabla^2T + \frac{\dot{q}}{\rho c} \end{gathered} \label{eqn2} \end{equation} For a packet of fluid with local convective velocity, $\overrightarrow{u}$ incompressibility implies, $\nabla\cdot\overrightarrow{u} = 0$; the density, $\rho$ is assumed to vary linearly with temperature, $\rho = \rho_0 (1 - \beta\Delta T)$, and the specific heat of the incompressible fluid is denoted by $c$. The term, $\dot{q}$ in the last equation denotes the rate of internal heat production per unit volume. At steady-state, the time derivatives vanish and the convective motion is aligned along the direction of the vertical heat flux as the thermal gradient along film thickness is maintained constant. Hence, the spatio-temporal temperature dependence equation from the above reduces to a heat-diffusion equation with a source term. Based on the boundary conditions, the in-plane two-dimensional solutions are harmonic in nature, which explains the appearance of alternating regions of hot and cold domains. As discussed above, for a symmetric rigid-rigid boundary condition, $Ra_c = 1708$. In our experimental methodology, an asymmetric boundary condition (rigid-free) is maintained. Numerically, the $Ra_c$ in such a setting has been computed to be approximately $1100$~\cite{glomski2012precise}. \begin{figure}[t] \centering \includegraphics{fig1} \caption{An illustration of the Rayleigh-B{\'e}nard system and the top layer temperature profile at steady-state under asymmetrical semi-rigid boundary condition. A thin film of viscous liquid is heated from the bottom ($\dot{Q}$). For $Ra > Ra_c$ the thermal gradient between the base and the top gives rise to convection patterns. At steady-state real-time thermal imaging of the top layer is performed to extract the spatial distribution of $T_{top}$. The line cut denotes the `thermal landscape' of the top layer due to the presence of alternating hot and cold plumes, and the dotted line represents temporally averaged top film temperature, $\langle T\rangle_t$ at steady-state.} \label{fig1} \end{figure} \section{Methodology} An IR camera captures the thermal images of the top layer of the fluid-film as the Rayleigh-B{\'e}nard system is driven from a room temperature equilibrium state, maintained at $23^\circ C$, to an out-of-equilibrium steady-state and back. The fluid is placed in the copper pan and it is then heated by regulating the externally applied voltage. Once the power is switched on it takes $2$~hours for the system to reach a steady-state. After the system reaches a steady-state, the external driving is switched off and the system is allowed to cool for another $2$~hours such that the system relaxes back to room temperature. A high viscosity silicone oil is used for the purpose of the current study~\cite{chatterjee2019coexisting,shinetsu}. It is always ensured that a large pan diameter ($2R$) to fluid-film thickness ($l_z$) is maintained, $2R/l_z\simeq~225~mm/5~mm\sim45$, as the goal is to have convection cells over as wide as an area possible for the thermal imaging to yield significant temperature statistics. The thermal dataset thus obtained consists of high-resolution static images and movies that capture the dynamics of the convection cells as they emerge when the system is being driven, and as they dissipate when the system starts relaxing back to room temperature. These images are recorded in grey-scale where each pixel indicates an intensity value that can be later transformed into corresponding temperature values, $T_k$ through a linear interpolation. For lower magnitudes of the external driving field, the convection cells concentrate at the center of the copper pan. This results in an annular region that is devoid of patterns. \begin{figure}[t] \centering \includegraphics[scale=0.8]{room_temp_fig.pdf} \caption{Histogram plot with a Gaussian fit for the room temperature equilibrium state averaged over nine independent trials. The data is obtained after the Rayleigh-B{\'e}nard system relaxes back to room temperature equilibrium state.} \label{fig2} \end{figure} For the purpose of analysis, regions of interest (ROI) are selected over these images and statistical results are computed. In our previous work, the central region with dense accumulation of convective cells has been denoted by $P$, and the outer annular region by $R$, see for example Figure~5(b) in~\cite{yadati2019spatio}. Further, collection of `hot' and `cold' regions in the steady-state images are obtained by thresholding each image. The image threshold is obtained by spatially averaging the temperature in the annular region at steady-state. The spatially averaged mean temperature over the region of interest is denoted by $\langle T\rangle = \Sigma_k T_k/N$ and the deviation in temperature at each pixel coordinate from the mean is denoted by, $\delta T_k = T_k - \langle T\rangle$. Further, this deviation is scaled by the mean temperature of the region of interest and is denoted by, $t_k = (T_k - \langle T\rangle)/\langle T\rangle$. The statistics for the reference equilibrium state is obtained by analyzing the images which were recorded after the system relaxed back to room temperature equilibrium state. In Figure~\ref{fig2}, we present the data for the reference state from nine independent trial runs after the system relaxes back to room temperature equilibrium. The histogram data is averaged over nine independent trials and fit with a Gaussian distribution function. The mean obtained from the Gaussian fit, $\langle T\rangle = 22.905^\circ C$ is in agreement with the recorded room temperature ($23^\circ C$). Since the camera is essentially recording equilibrium fluctuations (random noise) the standard deviation from the fit is expected to be very low, $\sigma\sim 0.009^\circ C$ which is of the order of magnitude as the sensitivity of the camera. We consider this data as a reference and compare the distribution profiles with those that are obtained from the non-equilibrium steady-state due to external driving. The time-averaged data is obtained by observing the dynamics of the Rayleigh-B{\'e}nard convection after a steady-state has been reached. The data is collected by recording a movie for $15$ minutes at $30$ frames per second totaling $27,000$ frames, and statistical analysis is performed on this image dataset by selecting regions of interest as described earlier. In the following section, we discuss the spatial and temporal steady-state statistics in detail. \section{Results} \subsection{Steady-state temporal analysis} \begin{figure}[t] \centering \includegraphics[scale=0.45]{post_steady_state} \caption{Frequency distribution plots showing scaled thermal data of the top layer at steady-state ($Ra=1410$), temporally averaged over $27,000$ frames or $15$ minutes. In $(a)$ the region of interest is chosen over the hot spots (standard deviation = $5.35\times 10^{-3}$), $(b)$ over the entire top layer of the fluid-film (standard deviation = $4.25\times 10^{-3}$), and $(c)$ over the cold spots (standard deviation = $1.05\times 10^{-2}$) with respective Gaussian fits. The temporally averaged mean temperatures, $\langle T\rangle_t$ of the respective regions of interest are denoted in each panel~\cite{chatterjee2019coexisting}.} \label{fig3} \end{figure} In Figure~\ref{fig3}, we plot the time-averaged scaled thermal distribution of the top layer of the Rayleigh-B{\'e}nard system after it has reached a steady-state. Figure~\ref{fig3}a shows the frequency distribution histogram with a normal distribution function (in red) centered around the origin for the collection of all the hot spots inside our region of interest. Similarly, Figures~\ref{fig3}b and~\ref{fig3}c denote the frequency distribution histograms and normal distribution curves (also centered around the origin) for the entire region of interest (in black), and all the cold spots (in blue) inside our region of interest, respectively. The normality in the distribution plots is not unusual. The thermal data at steady-state behaves as an i.i.d (independent and identically distributed) random variable with a finite mean. Therefore, the time-averaged distribution at a non-equilibrium steady state bears resemblance with that of the temperature distribution profile at room temperature. While all of these states can be described by smooth Gaussian curves and their occurrence can be explained by the Central Limit Theorem, yet there does exist a key difference~\cite{aleksandr1949mathematical}. The standard deviation of the fit shown in Figure~\ref{fig2} differs at least by a scale of magnitude when compared to the fits in Figure~\ref{fig3} (note that the fits shown in Figure~\ref{fig3} are scaled by the mean temperatures). While the profiles of the distribution curves in both cases are qualitatively similar, a rather simple observation - absence of heat flux in the former - can explain this observation. However, the key takeaway from this result is that the thermal measurements sampled at steady-state (for individual domains and the whole region) bear statistical resemblance to the thermal measurements at equilibrium. Since, the thermal profile at steady-state converges to a Gaussian distribution function the thermal data sampled at every $15$ seconds for the whole region, and isolated domains represent independent random variable similar to i.i.ds for the room-temperature equilibrium case. This implies long-time stability of the convection cells. \subsection{Steady-state spatial analysis} \begin{figure}[t] \centering \includegraphics[scale=0.65]{bimodal_annular.pdf} \caption{a) Figure shows kernel density estimate plots for the scaled thermal data for the patterned region ($P$) for $Ra = 1410$ (dashed) and $Ra=1670$ (solid), and b) Gaussian fits for the scaled thermal data for the annular region devoid of patterns ($R$). The ROI for the above statistics spans approximately $2500$ pixels.} \label{fig4} \end{figure} In Figure~\ref{fig4} we plot the spatial distribution of the scaled thermal data for the steady-state images for two samples: $Ra = 1410$ and $1670$. The two regions, $R$ and $P$ are selected as described above. In Figure~\ref{fig4}a the region of interest is the patterned region $P$, and it is visibly evident that the spatial symmetry is broken due to the emergence of patterns/order. The histogram plots and kernel density estimates for the scaled thermal data are shown. The two peaks represent the spatially averaged temperatures of the hot and cold regions. We have also pointed out in our previous work that the asymmetric kernel density estimates shown in Figure~\ref{fig4}a can be characterized by two independent Gaussian fits, which signifies the coexistence of collections of locally equilibrated stable thermal domains in space~\cite{chatterjee2019coexisting,yadati2019spatio}. In the case of the annular region, $R$ the scaled thermal deviation can be characterized by normal distribution functions centered around the origin as shown in Figure~\ref{fig4}b (standard deviation = $1.25\times 10^{-3}$ for $Ra = 1410$, and $1.35\times 10^{-3}$ for $Ra = 1670$). The emergence of two peaks at steady-state opens up the avenue to investigate the role of emergent fluxes and the resultant thermodynamic forces. It is near equilibrium, that one can use the linear non-equilibrium thermodynamics postulates. Therefore, it is imperative to consider the functional relationship between them as patterns emerge due to external driving. \subsection{Force-flux relation and entropy production} \begin{figure}[t] \centering \includegraphics[scale=0.65]{fig-flux-calculation.pdf} \caption{An illustration of the top film IR image of the Rayleigh-B{\'e}nard system at steady-state. The bright regions are `hot' while the darker regions are `cold'. The separation between them is denoted by $l$. The emergent heat-flux is then given by, $j = -k\nabla T = k(\langle T_{hot}\rangle - \langle T_{cold}\rangle)/ \langle l\rangle$ where $k$ is the thermal conductivity of the working fluid. The averaging is performed spatially and the heat-flux is calculated for a sequence of images as the system is driven from room temperature to a non-equilibrium steady-state.} \label{fig} \end{figure} \begin{figure}[hb!] \centering \includegraphics[scale=0.7]{force_flux} \caption{Top panel plots show a linear relationship between thermodynamic force, $X=\nabla(1/T)$ and emergent heat-flux, $j$ in the transition regime. A linear relationship between thermodynamic force and heat-flux implies a quadratic in entropy production given by, $\sigma = jX$, shown in bottom panel. The pair of plots in the left (in red) is computed by coarse-graining the data while the plots on the right (in blue) is computed by performing a fine-grained analysis of the image data.} \label{fig5} \end{figure} Thermodynamic forces can be understood as the driving forces of transport and reaction phenomena. The steady-state spatial analysis posits that stable domains of high temperature and low temperature emerge as the Rayleigh-B{\'e}nard system is driven out of room-temperature equilibrium state. The gradient in the thermal manifold thus imply the emergence of a lateral heat-flux orthogonal to the direction of the convective motion. This emergent heat-flux, $j$ is computed by dividing the emergent heat differential by the mean separation between hot and cold domains, as shown in Figure~\ref{fig}. The emergent flux, the thermodynamic force, and the entropy production can be expressed by the following set of equations, \begin{equation} \begin{gathered} j =-k\nabla T =k\left(\frac{\langle T_{hot}\rangle - \langle T_{cold}\rangle}{\langle l\rangle}\right)\\ X=\nabla(1/T)\\ \sigma = jX \end{gathered} \label{eqn3} \end{equation} The associated thermodynamic force, $X$ is computed in two ways in order to justify the linearity in the flux-force relationship. In the first instance, the thermodynamic force is obtained by coarse graining the image data. Thus, the thermodynamic force can be expressed as, $X=\nabla(1/T) = -\nabla(T)/T^2$. As the emergent heat-flux is written as, $j =-k\nabla T$, the thermodynamic force therefore can be further expressed as, $X=-\nabla(T)/T^2=j/kT^2$. Since, the flux is calculated on the coarse-grained image and is equal to $k\left(\langle T_{hot}\rangle - \langle T_{cold}\rangle\right)/\langle l\rangle$ the thermodynamic force can thus be written as, $\left(\langle T_{hot}\rangle - \langle T_{cold}\rangle\right)/(\langle l\rangle\times T^2)$. The $T$ in the denominator is taken to be the mean temperature of the top film, $\langle T_{top}\rangle$ calculated for each frame at every time-step. As the system is driven from a room temperature equilibrium state to an out-of-equilibrium steady-state, the mean top film temperature is time-dependent in the transition regime. Therefore, the linearity in the flux-force relationship is not trivial in the coarse-grained analysis. The linear relationship between flux and force is shown in Figure~\ref{fig5}a for the coarse-grained scenario. The slope of the linear fit, $1/k\bar{T}^2$ after substituting appropriate numerical value of the heat transport coefficient, $k$ results into, $\bar{T}\sim 66^\circ C$ which is the mean top-film temperature at steady-state for the sample (see, Figure~\ref{fig3}b for reference). Combining the expressions for force and flux from Equation~\ref{eqn3} we obtain the rate of entropy production per unit volume, $\sigma = jX$. In Figure~\ref{fig5}c, we plot $\sigma$ as a function of the lateral heat-flux for the coarse-grained scenario. As expected, the entropy production follows a quadratic trend. \begin{figure}[t] \centering \includegraphics[scale=0.65]{mepp_fig.pdf} \caption{a) Lateral heat flux is plot as a function of the top film temperature. The red solid line depicts a linear fit of the form: $j = a(\langle T\rangle - \langle T_c\rangle)$, where $\langle T_c\rangle\sim 52.2^\circ C$ (shown as a vertical dotted line). Inset plot shows entropy production (per unit volume) as a function of mean top temperature, and b) Lateral heat flux is plot as a function of thermal driving, $(Ra/Ra_c - 1)$ where $Ra_c$ denotes the critical Rayleigh number which corresponds to $\langle T_c\rangle$ as the mean top temperature, signalling the onset of convection. The spatial thermal distribution plots in three different regimes are also shown - room-temperature equilibrium, transient regime, and steady-state.} \label{fig6} \end{figure} For a fine-grained estimation of the thermodynamic force, we calculate pixel-by-pixel gradient over the image ROI. This is done by choosing an appropriate averaging window, $\alpha$ and then calculating the directional derivatives, $\partial_yT = (T(i, j+\alpha) - T(i, j-\alpha))/(j + \alpha - (j - \alpha))$ and $\partial_xT = (T(i + \alpha, j) - T(i - \alpha, j))/(i + \alpha - (i - \alpha))$. The average of the magnitude of these derivatives over the ROI is then equal to $\nabla T$ for that image. As earlier, this value is then divided by square of the mean top-film temperature, ${\langle T_{top}\rangle}^2$ to obtain the magnitude of the thermodynamic force. In Figure~\ref{fig5}b, the above estimate of the thermodynamic force is plot against the emergent heat-flux which is obtained as described earlier. We can see that there exists a linear relationship between the two. The slope of the linear fit, $1/k\bar{T}^2$ in this case along with the heat transport coefficient is then used to estimate, $\bar{T}\sim 63^\circ C$ which is close to the mean top-film temperature at steady-state for the sample. As earlier, the entropy production is then computed and as expected it follows a quadratic trend as seen in Figure~\ref{fig5}d. The lateral heat-flux and the thermodynamic force emerge as patterns appear or convective instability sets in. Therefore, below critical temperature or critical Rayleigh number one should expect no lateral heat flux. In Figure~\ref{fig6}a, we plot the lateral heat-flux as a function of mean top temperature. We can clearly see that the emergent heat-flux is zero upto $\langle T\rangle\sim 52^\circ C$, and following which there is a steep increase till the system reaches a steady-state. The observed trend is fit with a linear function of the form, $j = a(\langle T\rangle - \langle T_c\rangle)$, such that $j=0~\forall~\langle T\rangle\leq\langle T_c\rangle$. The critical top-film temperature obtained from the optimal fit parameters is $\langle T_c\rangle\sim 52.3^\circ C$, shown in the figure as a vertical dotted line. In Figure~\ref{fig6}b, the lateral heat-flux is plot as a function of thermal driving, $\epsilon = \left(Ra/Ra_c - 1\right)$ where the Rayleigh number is computed at every instant in time. The observed relationship between the Rayleigh number and the emergent heat-flux thus obtained from the locally equilibrated domains is very similar to the relationship between the convective heat-flux and the reduced Rayleigh number, $\epsilon$ as previously shown by Meyer et. al.~\cite{meyer1988pattern}. Upon substituting $\langle T_c\rangle$ from the linear fit we obtain $Ra_c\sim 1128$ which is very close to the numerically computed critical Rayleigh number for an asymmetric boundary condition. While we acknowledge that the flux and temperature measurements are not independent, the linearity derived in Figures~\ref{fig5} and~\ref{fig6} cannot be considered strong results yet. Based on previously discussed studies, this work can therefore serve as a starting point for rigorous experimental and theoretical studies in this direction. \section{Discussion} In this section, we discuss the conceptual and theoretical implications of our results. But first, we want to emphasize why this result is important. The local equilibrium condition until now has either been assumed as an \textit{a priori} condition during the treatment of non-equilibrium steady-states, or it has been discussed in the literature entirely from either a pure theoretical or a phenomenological approach~\cite{vilar2001thermodynamics,goto2016local,lebon1980extension,serdyukov2018macroscopic}. Moreover, some have even questioned the validity of the local equilibrium assumption~\cite{ben2018validity,ben2020entropy}. This work establishes, for the first time, that the local equilibrium hypothesis is indeed valid and can be experimentally observed in a out-of-equilibrium thermodynamic system. We start by examining the conditions for the validity of the local equilibrium hypothesis. Based on extensive previous works, both numerical and analytical it has been suggested that a linear constitutive relationship between thermodynamic fluxes and thermodynamic forces justify the local equilibrium conjecture in non-equilibrium steady-states~\cite{bedeaux2003nonequilibrium,jou1996extended,glavatskiy2009numerical,bedeaux1986nonequilibrium}. Especially in binary mixtures, it has been verified numerically that the interface between the two components at stationary state evaporation and condensation is in local equilibrium~\cite{johannessen2003nonequilibrium}. In the Rayleigh-B{\'e}nard system the two phases - order and disorder emerge as convective instabilities. Therefore, the first criteria to consider is stability of the emergent structures and the nature of the spatio-temporal temperature distribution. Typically, stability and perturbation analysis are carried out numerically for different boundary conditions in order to obtain the critical values of the dimensionless numbers, heat transport, convective velocities etc. From our thermodynamic study, we intend to rather quantify the stability of the emergent phases based on first-order statistics as a preliminary development. Qualitatively, the distribution profiles for the reference equilibrium state in Figures~\ref{fig2} and non-equilibrium steady-states in Figures~\ref{fig3} and~\ref{fig4}b are Gaussian fits. The only quantitative difference being the standard deviation of the reference fit is atleast one order of magnitude less than the steady-state fits. As we discussed earlier this can be explained by the absence of an external heat flux in the former. Moreover, the convergence of the thermal data sampled at steady-state to Gaussian distributions imply that the data is independent and identically distributed in the respective samples. This is in contrast to the transient regime or the spatial ROI consisting of both hot and cold domains wherein the temperature data is neither independent nor identically distributed. Especially in the context of the local equilibrium, this allows one to derive phenomenological laws of non-equilibrium thermodynamics in the limit of small thermal fluctuations, and especially in the Gaussian limit where means and modes of the distribution coincide~\cite{lavenda2019nonequilibrium}. This observation ensures long-term temporal stability of the system and of the spatially distributed thermal patterns at steady-state. Indeed, this definition of stability does not conform with the conventional definitions of stability of a dynamical system but our preliminary results do indicate that the temperature of the system at steady-state converges to a stable limit-cycle. The next criterion is concerned with the time-scales that dictate the steady-state evolution of the system, and the emergence of spatio-temporal thermal patterns. A Rayleigh-B{\'e}nard system in the non-turbulent regime, exhibits atleast two prominent non-overlapping time-scales: a macroscopic timescale, $\tau_M$ responsible for the equilibration of locally stable spatio-temporal thermal patterns, and a microscopic time-scale, $\tau_m$ dictating the steady-state evolution of the system. The two time-scales are obtained by fitting the time evolution of the emergent (orthogonal) heat-flux and the convective (vertical) heat-flux by a generic function of the form: $j(t) = j_0(1-\exp(-(t-t^\prime)/\tau))$, where $\tau$ represents the characteristic time constants (relaxation time) for the two cases, and $t^\prime$ the delay. The relaxation time or the experiment time for the system to achieve a steady-state is much faster than the observed time responsible for the relaxation of the thermal patterns. Thus the ratio, $De=\tau_m/\tau_M = (\sim 500~\text{sec}/3600~\text{sec})$ is found to be $\sim 0.1$ for our experimental run. Note, $t^\prime=0$ for the convective heat-flux whereas, $t^\prime\neq 0$ for the emergent heat-flux as structures emerge once $Ra_c$ is achieved. As, noted earlier a $De<<1$ justifies the use of local equilibrium postulate as the two time-scales are well separated. Finally, a necessary condition for the local equilibrium hypothesis to hold true is the linearity in the force-flux relation. In Figure~\ref{fig5}, we show the linear relationship between the resultant thermodynamic force and the emergent heat-flux. We also calculate the rate of entropy production as stable spatio-temporal thermal patterns emerge. The quadratic nature of the curves in Figures~\ref{fig5}c and~\ref{fig5}d indicate that the system drifts to a state of higher entropy. Moreover, the Rayleigh-B{\'e}nard system gives us the control in tuning the system's response to external driving. This leads us to an important question: at what point does the local equilibrium hypothesis fail? Qualitatively, larger magnitudes of $\epsilon$ would drive the system to a state of instability wherein the linearity in the force-flux relation would be eventually broken. Currently, we lack sufficient experimental evidence to support this conjecture. The validity of the local equilibrium hypothesis has an important consequence. As a result of which thermodynamic state variables (in this case, temperature) can be defined and principles from equilibrium thermodynamics can be used to describe these states quantitatively~\cite{muschik2020discrete}. The idea is conceptually similar to a discrete system where the out-of-equilibrium system interacts with the environment at equilibrium, such that a measurable `contact temperature' can be defined. Indeed, there are numerous situations in thermal sciences where such situations arise. This does beg a philosophical question: if, sufficiently close to equilibrium, one can \textit{only} measure the standard thermodynamic state variables $P,V,T...$ then how can one tell whether the system is actually at equilibrium or it has been driven out-of-equilibrium to a meta-stable state with emergent complexity? As a~\textit{gedankenexperiment} consider an inertial frame of reference as an analogue for the room temperature equilibrium state. An inertial frame of reference describes time and space homogeneously, isotropically, and in a time-independent manner, identical to the characteristics that define an equilibrium thermodynamic state. Similarly, a non-inertial frame of reference that accelerates relative to an inertial frame finds an analogue in a thermodynamic state of a system that is being driven out-of-equilibrium. While a frame of reference in relativistic mechanics is described by the space-time coordinates, a thermodynamic state is represented by a set of intensive variables in the phase-space. A thermodynamic state that is being driven out-of-equilibrium then can be characterized not only by the set of thermodynamic state-variables but also by their spatio-temporal derivatives (or gradients). For a system at a non-equilibrium steady-state the time derivatives vanish, while the spatial derivatives (gradients) exist. The measured mean temperature of the system will indicate whether the system is at room temperature or has been driven out-of-equilibrium, and the width of the distribution will denote the presence (or absence) of an external energy flux. But none of the statistics would indicate the spontaneous emergence of spatio-temporal patterns. The spatial symmetry (isotropy) is broken \textit{only} when locally equilibrated domains emerge. Thus, for an uninformed observer (akin to the IR camera - an informed observer) it is impossible to make a distinction between an equilibrium state at room temperature and a non-equilibrium meta-stable state that consists of spatially distributed stable patterns solely on the basis of measurements made in local regions in space. Since these two `frames of reference' are governed by the same principle of statistical mechanics, for an uninformed observer they must be thermodynamically identical. However, when the observer can `see' the thermal landscape, they can clearly distinguish the two states (and perceive the notion of emergent forces and fluxes) - a viewpoint which is analogous to Einstein's weak principle of equivalence in relativity~\cite{einstein1905tragheit,einstein1935particle}. Thinking about a thermodynamic system from the point of view of a landscape (or a manifold) brings us closer to develop a theoretical approach in quantifying emergent order in non-equilibrium steady-states where local equilibrium is satisfied~\cite{chatterjee2019many,chatterjee2019coexisting,van2017guyer}. Being able to define a steady-state non-equilibrium state variable precisely, allows us the freedom to quantify entropy production due to heat fluxes and calculate thermodynamic forces~\cite{onsager1931reciprocal,lucia2020time,lucia2020time1,chatterjee2020time,riek2020entropy}. The validity of the current work also sets the stage to apply variational methods to describe the evolution of non-equilibrium steady-states, study bistability, bifurcation, and test the MEPP in Rayleigh-B{\'e}nard and other prototypical irreversible systems~\cite{martyushev2006maximum,de2019oscillatory,ban2019thermodynamic,ban2020thermodynamic}. This further opens up the avenue for the first time to define and measure extensive variables like, work, heat, and their inter-conversion in a non-equilibrium steady-state - a precursor to a first principles' generalized equation of state that takes into account emergent order~\cite{chatterjee2020studies}. \section{Concluding Remarks} In this paper, we study a classical irreversible system and examine the validity of the local equilibrium hypothesis. We discuss the role of thermodynamic forces as fluxes emerge with the onset of thermal convection. Based on the linear flux-force relation, well separated time-scales, and thermal statistics obtained from long-term spatio-temporal stability of the thermal patterns, we validate the local equilibrium conjecture. We discuss in detail the importance of this result in the study of non-equilibrium thermodynamics, and consider possible future directions. \section{Acknowledgments} The authors are extremely grateful to the reviewers and the editor for their invaluable feedback and constructive criticism which have greatly improved the paper.
\section{Introduction}\label{sec.intro} \begin{notan} Let $X$ be a topological space, $V,W$ be normed vector spaces, and $H$ be a complex Hilbert space. \begin{enumerate}[label=(\alph*),leftmargin=2\parindent] \item $\mathcal{B}_X$ is the Borel $\sigma$-algebra on $X$. \item $B(V;W)$ is the space of bounded linear maps $V \to W$ with operator norm $\|\cdot\| = \|\cdot\|_{V \to W}$. Also, $B(V) \coloneqq B(V;V)$. Finally, $B(H)_{\sa} \coloneqq \{A \in B(H) : A^*=A\}$. \item If $A$ is a (possibly unbounded) self-adjoint operator on $H$, then $P^A \colon \mathcal{B}_{\sigma(A)} \to B(H)$ is its projection-valued spectral measure. If $f \colon \mathbb{R} \to \mathbb{C}$ is Borel measurable, then we define \[ f(A) \coloneqq \int_{\sigma(A)} f(\lambda)\,P^A(d\lambda). \] (Please see Section \ref{sec.SpecTh}.) \end{enumerate} \end{notan} \subsection{Known Results}\label{sec.knownres} Let $H$ be a complex Hilbert space. Given an appropriately regular scalar function $f \colon \mathbb{R} \to \mathbb{C}$, one of the goals of perturbation theory is to ``Taylor expand" the \textit{operator function} that takes a self-adjoint operator $A$ on $H$ and maps it to the operator $f(A)$. This delicate problem has its beginnings in the work of Y.L. Daletskii and S.G. Krein. In their seminal paper \cite{daletskiikrein}, they proved that if $f \colon \mathbb{R} \to \mathbb{C}$ is $2k$-times continuously differentiable and $A,B \in B(H)_{\sa}$, then the curve $\mathbb{R} \ni t \mapsto f(A+tB) \in B(H)$ is $k$-times differentiable in the operator norm, and \[ \frac{d^k}{dt^k}\Big|_{t=0} f(A+tB) = k!\underbrace{\int_{\sigma(A)}\cdots\int_{\sigma(A)}}_{k+1 \text{ times}} f^{[k]}(\lambda_1,\ldots,\lambda_{k+1})\,P^A(d\lambda_1)\,B\cdots P^A(d\lambda_k)\,B\,P^A(d\lambda_{k+1}), \numberthis\label{eq.formalopder} \] where $f^{[k]} \colon \mathbb{R}^{k+1} \to \mathbb{C}$ is the $k^{\text{th}}$ \textit{divided difference} (Section \ref{sec.divdiffandpert}) of $f$, defined inductively as \[ f^{[0]} \coloneqq f \; \text{ and } \; f^{[k]}(\lambda_1,\ldots,\lambda_{k+1}) \coloneqq \frac{f^{[k-1]}(\lambda_1,\ldots,\lambda_k)-f^{[k-1]}(\lambda_1,\ldots,\lambda_{k-1},\lambda_{k+1})}{\lambda_k-\lambda_{k+1}} \numberthis\label{eq.divdiffintro} \] for $(\lambda_1,\ldots,\lambda_{k+1}) \in \mathbb{R}^{k+1}$. The reader might be (rightly) puzzled by the multiple integral in \eqref{eq.formalopder}, since standard projection-valued measure theory only allows for the integration of \textit{scalar-valued} functions. Indeed, while the innermost integral $\int_{\sigma(A)} f^{[k]}(\lambda_1,\cdots,\lambda_{k+1})\,P^A(d\lambda_1)$ makes sense using standard theory, it is already unclear how to integrate the map \[ \lambda_2 \mapsto \int_{\sigma(A)} f^{[k]}(\lambda_1,\lambda_2,\ldots,\lambda_{k+1})\,P^A(d\lambda_1)\,B \] with respect to $P^A$. Daletskii and Krein dealt with this by using a Riemann-Stieltjes-type construction to define $\int_{\sigma(A)} \Phi(r) \,P^A(dr)$ for certain \textit{operator-valued} functions $\Phi \colon [s,t] \to B(H)$, where $[s,t] \subseteq \sigma(A)$. This approach, which requires rather stringent regularity assumptions on $\Phi$, allows one to make sense of \eqref{eq.formalopder} as an iterated operator-valued integral -- in other words, a multiple operator integral. Now, for $j \in \{1,\ldots,k+1\}$, let $(\Om_j,\mathscr{F}_j)$ be a measurable space and $P_j \colon \mathscr{F}_j \to B(H)$ be a projection-valued measure. Emerging naturally from the formula \eqref{eq.formalopder} is the general problem of making sense of \[ \big(I^{P_1,\ldots,P_{k+1}} \varphi \big)(b_1,\ldots,b_k) = \int_{\Om_{k+1}}\cdots\int_{\Om_1} \varphi(\omega_1,\ldots,\omega_{k+1}) \, P_1(d\omega_1) \, b_1 \cdots P_k(d\omega_k) \, b_k \,P_{k+1}(d\omega_{k+1}) \numberthis\label{eq.formalMOI} \] for certain functions $\varphi \colon \Om_1 \times \cdots \times \Om_{k+1} \to \mathbb{C}$ and operators $b_1 , \ldots, b_k \in B(H)$. An object successfully doing so is also called a \textit{multiple operator integral} (MOI). Under the assumption that $H$ is separable, these have been studied and applied to various branches of noncommutative analysis extensively. Please see A. Skripka and A. Tomskova's book \cite{skripka} for an excellent survey of the MOI literature and its applications. In this paper, we shall make use of the ``separation of variables" approach to defining \eqref{eq.formalMOI}. For separable $H$, this approach was developed by V.V. Peller \cite{peller1} and N.A. Azamov, A.L. Carey, P.G. Dodds, and F.A. Sukochev \cite{azamovetal} in order to differentiate operator functions at unbounded operators. The present author extended the approach to the case of a non-separable Hilbert space in \cite{nikitopoulosMOI}. We review the relevant definitions and results in Sections \ref{sec.wstarint} and \ref{sec.MOIsinI}. Henceforth, any MOI expression we write or reference is to be interpreted in accordance with Section \ref{sec.MOIsinI} (specifically, Theorem \ref{thm.MOIsinM}). Now, we quote the best known general results on higher derivatives of operator functions. If $\dot{B}_q^{s,p}(\mathbb{R}^m)$ is the homogeneous Besov space (Definition \ref{def.Besov}), then we write \[ PB^k(\mathbb{R}) \coloneqq \dot{B}_1^{k,\infty}(\mathbb{R}) \cap \big\{f \in C^k(\mathbb{R}) : f^{(k)} \text{ is bounded}\big\} \numberthis\label{eq.PBspace} \] for the \textbf{$\boldsymbol{k^{\text{\textbf{th}}}}$ Peller-Besov space}. It turns out that $PB^1(\mathbb{R}) \cap PB^k(\mathbb{R}) = PB^1(\mathbb{R}) \cap \dot{B}_1^{k,\infty}(\mathbb{R})$. (Please see the paragraph containing equation \eqref{eq.f'series} at the end of Section \ref{sec.PellerII}.) \begin{thm}[\textbf{Peller}]\label{thm.pellerder} Let $H$ be a separable complex Hilbert space, $A$ be a self-adjoint operator on $H$, and $B \in B(H)_{\sa}$. If $f \in PB^1(\mathbb{R}) \cap PB^k(\mathbb{R})$, then the map $\mathbb{R} \ni t \mapsto f(A+tB)-f(A) \in B(H)$ is $k$-times differentiable in the operator norm, and the formula \eqref{eq.formalopder} holds. \end{thm} This is Theorem 5.6 in \cite{peller1}. To quote the relevant result from \cite{azamovetal}, we need some additional terminology. First, recall that if $H$ is a complex Hilbert space, then $\mathcal{M} \subseteq B(H)$ is a \textbf{von Neumann algebra} if it is a $\ast$-subalgebra that is closed in the weak operator topology (WOT). Second, suppose $\mathcal{I} \subseteq \mathcal{M}$ is a $\ast$-ideal with another norm $\|\cdot\|_{\mathcal{I}}$ on it. We call $\mathcal{I}$ an \textbf{invariant operator ideal} if $(\mathcal{I},\|\cdot\|_{\mathcal{I}})$ is a Banach space, $\|r\| \leq \|r\|_{\mathcal{I}} = \|r^*\|_{\mathcal{I}}$ for $r \in \mathcal{I}$, and $\mathcal{I}$ is \textbf{symmetrically normed}, i.e., $\|arb\|_{\mathcal{I}} \leq \|a\|\,\|r\|_{\mathcal{I}}\|b\|$ for $r \in \mathcal{I}$ and $a,b \in \mathcal{M}$. Third, an invariant operator ideal $\mathcal{I}$ has \textbf{property (F)} if whenever $(a_j)_{j \in J}$ is a net in $\mathcal{I}$ such that $\sup_{j \in J}\|a_j\|_{\mathcal{I}} < \infty$ and $a_j \to a \in \mathcal{M}$ in the strong$^*$ operator topology (S$^*$OT), we get $a \in \mathcal{I}$ and $\|a\|_{\mathcal{I}} \leq \sup_{j \in J}\|a_j\|_{\mathcal{I}}$. Finally, we write $W_k(\mathbb{R})$ for the $k^{\text{\textit{th}}}$ \textit{Wiener space} (Definition \ref{def.Wk}) of functions $f \colon \mathbb{R} \to \mathbb{C}$ that are Fourier transforms of complex measures with finite $k^{\text{th}}$ moment. \begin{thm}[\textbf{Azamov-Carey-Dodds-Sukochev}]\label{thm.azamovetalder} Let $H$ be a separable complex Hilbert space and $\mathcal{M} \subseteq B(H)$ be a von Neumann algebra. Suppose $\mathcal{I} \subseteq \mathcal{M}$ is an invariant operator ideal with property (F) and $a$ is a self-adjoint operator on $H$ affiliated with $\mathcal{M}$ (Definition \ref{def.aff}). If $f \in W_{k+1}(\mathbb{R})$, then the map \[ \mathcal{I}_{\sa} = \{r \in \mathcal{I} : r^*=r\} \ni b \mapsto f_a(b)\coloneqq f(a+b)-f(a) \in \mathcal{I} \] is $k$-times Fr\'{e}chet differentiable (Definition \ref{def.frechder}) in the $\mathcal{I}$-norm $\|\cdot\|_{\mathcal{I}}$, and \[ \partial_{b_1}\cdots\partial_{b_k}f_a(0) = \sum_{\gamma \in S_k}\underbrace{\int_{\sigma(a)}\cdots\int_{\sigma(a)}}_{k+1 \text{ times}} f^{[k]}(\lambda_1,\cdots,\lambda_{k+1})\,P^a(d\lambda_1)\,b_{\gamma(1)}\cdots P^a(d\lambda_k)\,b_{\gamma(k)}\,P^a(d\lambda_{k+1}), \] for all $b_1,\ldots,b_k \in \mathcal{I}_{\sa}$, where $S_k$ is the symmetric group on $k$ letters. \end{thm} This is Theorem 5.7 in \cite{azamovetal}. As is noted in \cite{azamovetal}, the motivating example of an invariant operator ideal with property (F) comes from the theory of \textit{symmetric operator spaces}. Indeed, if $(E,\|\cdot\|_E)$ is a symmetric Banach function space with the Fatou property, $(\mathcal{M},\tau)$ is a semifinite von Neumann algebra (Definition \ref{def.trace}), and $(E(\tau),\|\cdot\|_{E(\tau)})$ is the symmetric space of $\tau$-measurable operators induced by $E$, then \[ (\mathcal{I},\|\cdot\|_{\mathcal{I}}) \coloneqq (E(\tau) \cap \mathcal{M}, \|\cdot\|_{E(\tau) \cap \mathcal{M}}) = (E(\tau) \cap \mathcal{M}, \max\{\|\cdot\|_{E(\tau)},\|\cdot\|_{\mathcal{M}}\}) \numberthis\label{eq.symmopideal} \] is an invariant operator ideal with property (F). (Please see Section \ref{sec.symmopsp} for the meanings of the preceding terms.) Though Theorem \ref{thm.azamovetalder} applies to this interesting general setting, the result demands much more regularity of the scalar function $f$ than Theorem \ref{thm.pellerder}. (Indeed, $W_k(\mathbb{R}) \subseteq PB^1(\mathbb{R}) \cap PB^k(\mathbb{R})$.) It has remained an open problem (Problem 5.3.22 in \cite{skripka}) to find less restrictive conditions for higher Fr\'{e}chet differentiability of operator functions in the symmetric operator space ideals described above. The present paper resolves this problem: a corollary of our main results is that if $E$ is fully symmetric (a weaker condition than the Fatou property), then the result of Theorem \ref{thm.azamovetalder} holds for $(\mathcal{I},\|\cdot\|_{\mathcal{I}})$ as in \eqref{eq.symmopideal} with $f \in PB^1(\mathbb{R}) \cap PB^k(\mathbb{R})$. In other words, we are able to close the regularity gap between Theorems \ref{thm.pellerder} and \ref{thm.azamovetalder} in the (fully) symmetric operator space context. Moreover, we are able, for the first time in the literature on higher derivatives of operator functions, to remove the separability assumption on $H$ by using the MOI development from \cite{nikitopoulosMOI}. \subsection{Main Results}\label{sec.mainres} Let $H$ be a complex Hilbert space, $\mathcal{M} \subseteq B(H)$ be a von Neumann algebra, and $a$ be a self-adjoint operator affiliated with $\mathcal{M}$ (Definition \ref{def.aff}). We recall from the previous section that our goal is to differentiate the operator function \[ \mathcal{I}_{\sa} \ni b \mapsto f(a+b)-f(a) \in \mathcal{I}, \] where $(\mathcal{I},\|\cdot\|_{\mathcal{I}})$ is some normed ideal of $\mathcal{M}$ and $f \in PB^1(\mathbb{R}) \cap PB^k(\mathbb{R})$. (Please see \eqref{eq.PBspace}.) The ideals we consider are the \textit{integral symmetrically normed ideals} (ISNIs). The definition of integral symmetrically normed is an ``integrated" version of the symmetrically normed condition $\|arb\|_{\mathcal{I}} \leq \|a\|\,\|r\|_{\mathcal{I}}\|b\|$. Loosely speaking, $(\mathcal{I},\|\cdot\|_{\mathcal{I}})$ is integral symmetrically normed if \[ \Bigg\|\int_{\Sigma} A(\sigma) \, r \,B(\sigma) \,\rho(d\sigma)\Bigg\|_{\mathcal{I}} \leq \|r\|_{\mathcal{I}} \int_{\Sigma}\|A\|\,\|B\|\,d\rho, \; r \in \mathcal{I}. \] The precise definition (Definition \ref{def.idealproperties}.\ref{item.ISNI}) is slightly technical, so we omit it from this section. Our first main result comes in the form of a list of interesting examples of ISNIs. \begin{thm}[\textbf{Examples of ISNIs}]\label{thm.mainISNI} Let $H$ be an arbitrary (not-necessarily-separable) complex Hilbert space and $\mathcal{M} \subseteq B(H)$ be a von Neumann algebra. \begin{enumerate}[label=(\roman*),leftmargin=2\parindent] \item The ideal $(\mathcal{M},\|\cdot\|)$ is integral symmetrically normed.\label{item.triv} \item If $(\mathcal{I},\|\cdot\|_{\mathcal{I}})$ is a separable symmetrically normed ideal of $\mathcal{M}$, then $\mathcal{I}$ is integral symmetrically normed.\label{item.sep} \item The ideal $(\mathcal{K}(H),\|\cdot\|)$ of compact operators is an integral symmetrically normed ideal of $B(H)$.\label{item.compact} \item If $1 \leq p \leq \infty$, then the ideal of $(\mathcal{S}_p(H),\|\cdot\|_{\mathcal{S}_p(H)})$ of Schatten $p$-class operators (Definition 2.2.1 in \cite{nikitopoulosMOI}) is an integral symmetrically normed ideal of $B(H)$.\label{item.Sp} \item Suppose $(\mathcal{M},\tau)$ is semifinite (Definition \ref{def.trace}). If $(E,\|\cdot\|_E)$ is a fully symmetric space of $\tau$-measurable operators (Definition \ref{def.symmopsp}.\ref{item.fullysymm}) and $(\mathcal{I},\|\cdot\|_{\mathcal{I}}) \coloneqq (E \cap \mathcal{M}, \|\cdot\|_{E \cap \mathcal{M}}) = (E \cap \mathcal{M}, \max\{\|\cdot\|_E,\|\cdot\|\})$, then $\mathcal{I}$ is an integral symmetrically normed ideal of $\mathcal{M}$.\label{item.fs} \end{enumerate} \end{thm} \begin{proof} Item \ref{item.triv} is Example \ref{ex.M}, item \ref{item.sep} is Proposition \ref{prop.sep}, item \ref{item.compact} is Proposition \ref{prop.compact}, item \ref{item.Sp} is a special case of Example \ref{ex.Lp}, and item \ref{item.fs} is Theorem \ref{thm.FSISN}. \end{proof} With these in mind, we now state our second main result. Recall that $f^{[k]} \colon \mathbb{R}^{k+1} \to \mathbb{C}$ is the $k^{\text{th}}$ divided difference of $f \colon \mathbb{R} \to \mathbb{C}$ (please see \eqref{eq.divdiffintro}), $S_k$ is the symmetric group on $k$ letters, and all multiple operator integral (MOI) expressions as in \eqref{eq.formalMOI} are to be interpreted in accordance with Section \ref{sec.MOIsinI}. \begin{thm}[\textbf{Derivatives of Operator Functions in ISNIs}]\label{thm.mainopder} Let $H$ be an arbitrary (not-necessarily-separable) complex Hilbert space and $\mathcal{M} \subseteq B(H)$ be a von Neumann algebra. Suppose $(\mathcal{I},\|\cdot\|_{\mathcal{I}})$ is an integral symmetrically normed ideal of $\mathcal{M}$ and $a$ is a self-adjoint operator affiliated with $\mathcal{M}$. If $f \in PB^1(\mathbb{R}) \cap PB^k(\mathbb{R})$, then the operator function \[ \mathcal{I}_{\sa} \ni b \mapsto f_a(b)\coloneqq f(a+b)-f(a) \in \mathcal{I} \] is $k$-times continuously Fr\'{e}chet differentiable (Definition \ref{def.frechder}) in the $\mathcal{I}$-norm $\|\cdot\|_{\mathcal{I}}$, and \[ \partial_{b_1}\cdots\partial_{b_k}f_a(0) = \sum_{\gamma \in S_k}\underbrace{\int_{\sigma(a)}\cdots\int_{\sigma(a)}}_{k+1 \text{ times}} f^{[k]}(\lambda_1,\cdots,\lambda_{k+1})\,P^a(d\lambda_1)\,b_{\gamma(1)}\cdots P^a(d\lambda_k)\,b_{\gamma(k)}\,P^a(d\lambda_{k+1}), \] for all $b_1,\ldots,b_k \in \mathcal{I}_{\sa}$. \end{thm} \begin{proof} Combine Theorem \ref{thm.deropfunc} and Corollary \ref{cor.PBkinOCk}. \end{proof} The treatment in \cite{nikitopoulosMOI} of operator-valued integrals and MOIs on non-separable Hilbert spaces is what allows us to avoid separability assumptions in the results above. Also, as promised at the end of the previous section, Theorems \ref{thm.mainopder} and \ref{thm.mainISNI}.\ref{item.fs} (together with Fact \ref{fact.Etau}) resolve the open problem (Problem 5.3.22 in \cite{skripka}) of finding general conditions for higher Fr\'{e}chet differentiability of operator functions in ideals of semifinite von Neumann algebras induced by (fully) symmetric Banach function spaces. \section{Preliminaries}\label{sec.bg} For the duration of Section \ref{sec.bg}, fix a complex Hilbert space $(H,\langle \cdot, \cdot \rangle)$ and a von Neumann algebra $\mathcal{M} \subseteq B(H)$. Recall also that $S' \coloneqq \{b \in B(H) : ab=ba$, for all $a \in S\}$ is the \textbf{commutant} of a set $S \subseteq B(H)$ and that a $\ast$-subalgebra $\mathcal{N} \subseteq B(H)$ is a von Neumann alegbra if and only if $\mathcal{N} = \mathcal{N}'' \coloneqq (\mathcal{N}')'$. This is the well-known (von Neumann) Bicommutant Theorem. \subsection{\texorpdfstring{Weak$^*$}{} Integrals in von Neumann Algebras}\label{sec.wstarint} Following parts of Section 3.3 of \cite{nikitopoulosMOI}, we review some basics of operator-valued integrals. We shall write $H^{\infty} \coloneqq \{(h_n)_{n \in \mathbb{N}} \in H^{\mathbb{N}} : \sum_{n=1}^{\infty} \|h_n\|^2 < \infty\}$ with inner product $\langle (h_n)_{n \in \mathbb{N}},(k_n)_{n \in \mathbb{N}} \rangle_{H^{\infty}} \coloneqq \sum_{n=1}^{\infty}\langle h_n,k_n \rangle$. \begin{conv} For the duration of this section, fix a measure space $(\Sigma,\mathscr{H},\rho)$. \end{conv} \begin{defi}[\textbf{Weak$\boldsymbol{^*}$ Measurability and Integrability}]\label{def.wstarmeasint} A map $F \colon \Sigma \to \mathcal{M}$ is called \textbf{weak$\boldsymbol{^*}$ measurable} if $\langle F(\cdot)h,k \rangle \colon \Sigma \to \mathbb{C}$ is measurable, for all $h,k \in H$. Now, suppose in addition that \[ \int_{\Sigma} |\langle (F(\sigma)h_n)_{n \in \mathbb{N}},(k_n)_{n \in \mathbb{N}} \rangle_{H^{\infty}}|\,\rho(d\sigma) < \infty, \numberthis\label{eq.wstartintegcond} \] for all $(h_n)_{n \in \mathbb{N}},(k_n)_{n \in \mathbb{N}} \in H^{\infty}$. We say that $F$ is \textbf{weak$\boldsymbol{^*}$ integrable} if for all $S \in \mathscr{H}$, there exists (necessarily unique) $I_S \in \mathcal{M}$ such that \[ \langle (I_Sh_n)_{n \in \mathbb{N}},(k_n)_{n \in \mathbb{N}} \rangle_{H^{\infty}} = \int_S \langle (F(\sigma)h_n)_{n \in \mathbb{N}},(k_n)_{n \in \mathbb{N}} \rangle_{H^{\infty}}\,\rho(d\sigma), \] for all $(h_n)_{n \in \mathbb{N}},(k_n)_{n \in \mathbb{N}} \in H^{\infty}$. In this case, we call $I_S$ the \textbf{weak$\boldsymbol{^*}$ integral} (over $S$) of $F$ with respect to $\rho$, and we write $\int_S F\,d\rho = \int_S F(\sigma)\,\rho(d\sigma) \coloneqq I_S$. \end{defi} \begin{rem} Let $\mathcal{M}_* \coloneqq \{\sigma$-WOT-continuous linear functionals $\mathcal{M} \to \mathbb{C}\}$ be the predual of $\mathcal{M}$. Part of Theorem 3.3.6 in \cite{nikitopoulosMOI} says that $F$ is weak$^*$ measurable (respectively, integrable) in the sense of Definition \ref{def.wstarmeasint} if and only if $F$ is weakly measurable (respectively, integrable) in the weak$^*$ topology on $\mathcal{M}$ induced by the identification $\mathcal{M} \cong \mathcal{M}_*^{\;*}$. The above terminology is therefore justified. \end{rem} It turns out (Theorem 3.3.6.(iii) in \cite{nikitopoulosMOI}) that \eqref{eq.wstartintegcond} is actually already enough to guarantee that $F$ is weak$^*$ integrable. Since we do not need this level of generality, we shall prove a weaker statement from scratch. \begin{defi}[\textbf{Upper and Lower Integrals}]\label{def.nonmeasint} For an arbitrary (not necessarily measurable) function $h \colon \Sigma \to [0,\infty]$, we define \begin{align*} \overline{\int_{\Sigma}} h(\sigma) \, \rho(d\sigma) & = \overline{\int_{\Sigma}} h \, d\rho \coloneqq \inf\Bigg\{\int_{\Sigma} \tilde{h} \, d\rho : h \leq \tilde{h} \, \rho\text{-a.e.}, \, \tilde{h} \colon \Sigma \to [0,\infty] \text{ measurable}\Bigg\} \text{ and} \\ \underline{\int_{\Sigma}} h(\sigma) \, \rho(d\sigma) & = \underline{\int_{\Sigma}} h \, d\rho \coloneqq \sup\Bigg\{\int_{\Sigma} \tilde{h} \, d\rho : \tilde{h} \leq h \, \rho\text{-a.e.}, \, \tilde{h} \colon \Sigma \to [0,\infty] \text{ measurable}\Bigg\} \end{align*} to be, respectively, the \textbf{upper} and \textbf{lower integral} of $h$ with respect to $\rho$. (Please see Section 3.1 of \cite{nikitopoulosMOI}.) \end{defi} \begin{prop}[\textbf{Existence of Weak$\boldsymbol{^*}$ Integrals}]\label{prop.wstarintexist} Suppose that $F \colon \Sigma \to \mathcal{M}$ is weak$^*$ measurable. If $\underline{\int_{\Sigma}} \|F\| \,d\rho < \infty$, then $F$ is weak$^*$ integrable and \[ \Bigg\|\int_{\Sigma} F\,d\rho \Bigg\| \leq \underline{\int_{\Sigma}}\|F\|\,d\rho. \numberthis\label{eq.opnormtriangle} \] This is called the \textbf{(operator norm) integral triangle inequality}. \end{prop} \begin{rem} First, the operator norm of a weak$^*$ measurable map is not necessarily measurable when $H$ is not separable. This is why we need the lower integral above. Second, one can also prove that weak$^*$ integrals are independent of the representation of $\mathcal{M}$. Please see Theorem 3.3.6.(iv) in \cite{nikitopoulosMOI}. \end{rem} \begin{proof} Let $S \in \mathscr{H}$. Define $B_S \colon H \times H \to \mathbb{C}$ by $(h,k) \mapsto \int_S \langle F(\sigma)h,k \rangle \,\rho(d\sigma)$. Then $B_S$ is bilinear, and \[ |B_S(h,k)| \leq \int_S |\langle F(\sigma)h,k \rangle| \,\rho(d\sigma) \leq \int_{\Sigma}|\langle F(\sigma)h,k \rangle| \,\rho(d\sigma) \leq \underline{\int_{\Sigma}} \|F(\sigma)h\|\,\|k\|\,\rho(d\sigma) \leq \|h\|\,\|k\|\underline{\int_{\Sigma}} \|F\|\,d\rho, \] for all $h,k \in H$. In particular, $B_S$ is bounded. By the Riesz Representation Theorem, there exists unique $\rho_S(F) \in B(H)$ such that $\langle \rho_S(F)h,k \rangle = B_S(h,k)$, for all $h,k \in H$, and \[ \|\rho_S(F)\| = \sup\{|B_S(h,k)| : h,k \in H, \, \|h\|,\|k\| \leq 1\} \leq \underline{\int_{\Sigma}}\|F\|\,d\rho. \] If we can show $\rho_S(F) = \int_S F \,d\rho$, then we are done. To this end, let $a \in \mathcal{M}'$ and $h,k \in H$. Then $\langle F(\sigma)\,ah,k \rangle = \langle a\,F(\sigma)h,k \rangle = \langle F(\sigma)h,a^*k \rangle$, for $\sigma \in \Sigma$. Thus $B_S(ah,k) = B_S(h,a^*k)$. But then $\langle a\,\rho_S(F)h,k \rangle = \langle \rho_S(F)h,a^*k \rangle = B_S(h,a^*k) = B_S(ah,k) = \langle \rho_S(F)\,ah,k \rangle$. Since $h,k \in H$ were arbitrary, $a\,\rho_S(F) = \rho_S(F)\,a$. Since $a \in \mathcal{M}'$ was arbitrary, $\rho_S(F) \in \mathcal{M}'' = \mathcal{M}$ by the Bicommutant Theorem. Next, let $(h_n)_{n \in \mathbb{N}},(k_n)_{n \in \mathbb{N}} \in H^{\infty}$. Then \[ \int_{\Sigma} \sum_{n=1}^{\infty}|\langle F(\sigma)h_n,k_n\rangle|\,\rho(d\sigma) \leq \|(h_n)_{n \in \mathbb{N}}\|_{H^{\infty}}\|(k_n)_{n \in \mathbb{N}}\|_{H^{\infty}}\underline{\int_{\Sigma}}\|F\|\,d\rho < \infty \] by the Cauchy-Schwarz Inequality (twice). Therefore, by the Dominated Convergence Theorem, \[ \int_S \sum_{n=1}^{\infty}\langle F(\sigma)h_n,k_n \rangle\,\rho(d\sigma) = \sum_{n=1}^{\infty}\int_S \langle F(\sigma)h_n,k_n \rangle\,\rho(d\sigma) = \sum_{n=1}^{\infty}\langle \rho_S(F)h_n,k_n \rangle, \] as desired. \end{proof} Other than basic algebraic properties of the weak$^*$ integral, which are usually clear from the definition, the most important fact about weak$^*$ integrals that we shall use is the Dominated Convergence Theorem below, which we prove from scratch for the convenience of the reader. (But we remark that it follows from Proposition 3.2.3.(v) and Theorem 3.3.6 in \cite{nikitopoulosMOI}.) First, we note that the one can do better than the operator norm triangle inequality. Indeed, retaining the notation from the proof above, we have \begin{align*} \Bigg\|\Bigg(\int_{\Sigma} F\,d\rho\Bigg)h\Bigg\| & = \sup\{|B_{\Sigma}(h,k)| : \|k\| \leq 1\} \leq \sup\Bigg\{\int_{\Sigma}|\langle F(\sigma)h,k \rangle| \,\rho(d\sigma) : \|k\| \leq 1\Bigg\} \leq \underline{\int_{\Sigma}} \|F(\sigma)h\|\,\rho(d\sigma), \end{align*} for all $h \in H$. \begin{lem}[\textbf{Nonmeasurable Dominated Convergence Theorem}]\label{lem.poorDCT} Suppose $(g_n)_{n \in \mathbb{N}}$ is a sequence of functions $\Sigma \to [0,\infty]$ such that $g_n \to 0$ pointwise $\rho$-almost everywhere as $n \to \infty$. If \[ \overline{\int_{\Sigma}}\sup_{n \in \mathbb{N}} g_n \, d\rho < \infty, \] then $\underline{\int_{\Sigma}}g_n \, d\rho \to 0$ as $n \to \infty$. \end{lem} \begin{proof} By definition of the upper integral, there is some measurable $g \colon \Sigma \to [0,\infty]$ such that $\int_{\Sigma} g \, d\rho < \infty$ and $\sup_{n \in \mathbb{N}}g_n \leq g$ $\rho$-almost everywhere. Now, let $n \in \mathbb{N}$. By definition of the lower integral, there exists a measurable $\tilde{g}_n \colon \Sigma \to [0,\infty]$ such that $0 \leq \tilde{g}_n \leq g_n$ $\rho$-almost everywhere and \[ \underline{\int_{\Sigma}}g_n \, d\rho - \frac{1}{n} < \int_{\Sigma} \tilde{g}_n \, d\rho. \] Since $g_n \to 0$ $\rho$-almost everywhere, and $0 \leq \tilde{g}_n \leq g_n$ $\rho$-almost everywhere, we also have $\tilde{g}_n \to 0$ $\rho$-almost everywhere as $n \to \infty$. Also, $\tilde{g}_n \leq g_n \leq g$ $\rho$-almost everywhere, for all $n \in \mathbb{N}$. Therefore, by the Dominated Convergence Theorem, \[ 0 \leq \liminf_{n \to \infty}\underline{\int_{\Sigma}}g_n \, d\rho \leq \limsup_{n \to \infty}\underline{\int_{\Sigma}}g_n \, d\rho = \limsup_{n \to \infty}\Bigg(\underline{\int_{\Sigma}}g_n \, d\rho - \frac{1}{n}\Bigg) \leq \limsup_{n \to \infty}\int_{\Sigma} \tilde{g}_n \, d\rho = 0, \] as desired. \end{proof} \begin{prop}[\textbf{Operator-Valued Dominated Convergence Theorem}]\label{prop.opDCT} Let $(F_n)_{n \in \mathbb{N}}$ be a sequence of weak$^*$ integrable maps $\Sigma \to \mathcal{M}$ and suppose $F \colon \Sigma \to \mathcal{M}$ is such that $F_n \to F$ pointwise in the weak, strong, or strong$^*$ operator topology as $n \to \infty$. If \[ \overline{\int_{\Sigma}} \|F_n\|\,d\rho < \infty, \numberthis\label{eq.opnormbd} \] then $F \colon \Sigma \to \mathcal{M}$ is weak$^*$ integrable and $\int_{\Sigma} F_n\,d\rho \to \int_{\Sigma} F\, d\rho$ in, respectively, the weak, strong, or strong$^*$ operator topology as $n \to \infty$. \end{prop} \begin{proof} Let $h,k \in H$. In all cases, $F_n \to F$ pointwise in the WOT as $n \to \infty$. Therefore, $\langle F(\cdot)h,k \rangle$ is the pointwise limit of $(\langle F_n(\cdot)h,k \rangle)_{n \in \mathbb{N}}$. Consequently, $F$ is weak$^*$ measurable. Also, $\|F\| \leq \sup_{n \in \mathbb{N}} \|F_n\|$, so $F$ is weak$^*$ integrable by \eqref{eq.opnormbd} and Proposition \ref{prop.wstarintexist}. Now, \eqref{eq.opnormbd} also gives \[ \int_{\Sigma}\sup_{n \in \mathbb{N}}|\langle F_n(\sigma)h,k \rangle|\,\rho(d\sigma) \leq \|h\|\,\|k\|\underline{\int_{\Sigma}}\sup_{n \in \mathbb{N}}\|F_n\|\,d\rho < \infty. \] Therefore, by the Dominated Convergence Theorem, \[ \Bigg\langle \Bigg(\int_{\Sigma} F_n\,d\rho\Bigg)h,k \Bigg\rangle = \int_{\Sigma} \langle F_n(\sigma)h,k \rangle\,\rho(d\sigma) \to \int_{\Sigma} \langle F(\sigma)h,k \rangle\,\rho(d\sigma) = \Bigg\langle \Bigg(\int_{\Sigma} F\,d\rho\Bigg)h,k \Bigg\rangle \] as $n \to \infty$. Thus $\int_{\Sigma}F_n\,d\rho \to \int_{\Sigma} F\,d\rho$ in the WOT as $n \to \infty$. Assume now that $F_n \to F$ pointwise in the strong operator topology (SOT) as $n \to \infty$, and write $T_n \coloneqq \int_{\Sigma} F_n\,d\rho$ and $T \coloneqq \int_{\Sigma} F \,d\rho$. Then \[ \|T_nh-Th\| = \Bigg\|\Bigg(\int_{\Sigma}(F_n-F)\,d\rho\Bigg)h\Bigg\| \leq \underline{\int_{\Sigma}} \|(F_n(\sigma)-F(\sigma))h\|\,\rho(d\sigma) \to 0 \] as $n \to \infty$, by the integral triangle inequality observed above and Lemma \ref{lem.poorDCT}, which applies because of \eqref{eq.opnormbd} and $\sup_{n \in \mathbb{N}} \|(F_n-F)h\| \leq 2\|h\|\sup_{n \in \mathbb{N}}\|F_n\|$. Finally, the S$^*$OT case follows from the SOT case because $(F_n^*)_{n \in \mathbb{N}}$ and $F^*$ satisfy the same hypotheses as $(F_n)_{n \in \mathbb{N}}$ and $F$, and the adjoint is easily seen to commute with the weak$^*$ integral. \end{proof} We end this section by stating an additional property of weak$^*$ integrals when $\mathcal{M}$ is \textit{semifinite}. Before stating the result, we recall some notation and terminology. For $a,b \in B(H)$, then we write $a \leq b$ or $b \geq a$ to mean $\langle (b-a)h,h \rangle \geq 0$, for all $h \in H$. Also, we write \[ \mathcal{M}_+ \coloneqq \{a \in \mathcal{M} : a \geq 0\}. \] It is easy to see that $\mathcal{M}_+$ is closed in the WOT. Also, if $(a_j)_{j \in J}$ is a net in $\mathcal{M}_+$ that is bounded (there exists $b \in B(H)$ such that $a_j \leq b$, for all $j \in J$) and increasing ($j_1 \leq j_2 \Rightarrow a_{j_1} \leq a_{j_2}$), then $\sup_{j \in J} a_j$ exists in $B(H)_+$ and belongs to $\mathcal{M}_+$. (Please see Proposition 43.1 in \cite{conwayop}.) This is often known as Vigier's Theorem. \begin{defi}[\textbf{Trace}]\label{def.trace} A function $\tau \colon \mathcal{M}_+ \to [0,\infty]$ is called \textbf{trace} on $\mathcal{M}$ if for all $a,b \in \mathcal{M}_+$, $c \in \mathcal{M}$, and $\lambda \in \mathbb{R}_+$, we have \begin{enumerate}[label=(\alph*),leftmargin=2\parindent] \item $\tau(a+b) = \tau(a)+\tau(b)$,\label{item.add} \item $\tau(\lambda a) = \lambda\,\tau(a)$,\label{item.poshom} and \item $\tau(c^*c) = \tau(cc^*)$.\label{item.trace} \end{enumerate} A trace $\tau$ on $\mathcal{M}$ is called \begin{enumerate}[label=(\alph*),leftmargin=2\parindent] \item \textbf{normal} if $\tau(\sup_{j \in J}a_j) = \sup_{j \in J}\tau(a_j)$ whenever $(a_j)_{j \in J}$ is a bounded and increasing net in $\mathcal{M}_+$, \item \textbf{faithful} if $a \in \mathcal{M}_+$ and $\tau(a) = 0$ imply $a=0$, and \item \textbf{semifinite} if $\tau(a) = \sup\{\tau(b) : a \geq b \in \mathcal{M}_+, \, \tau(b) < \infty\}$, for all $a \in \mathcal{M}_+$. \end{enumerate} If $\tau$ is a normal, faithful, semifinite trace on $\mathcal{M}$, then $(\mathcal{M},\tau)$ is called a \textbf{semifinite von Neumann algebra}. \end{defi} \begin{rem} In the presence of \ref{item.add} and \ref{item.poshom}, condition \ref{item.trace} is equivalent to $\tau(u^*au) = \tau(a)$ for all $a \in \mathcal{M}_+$ and all unitaries $u$ belonging to $\mathcal{M}$. This is Corollary 1 in Section I.6.1 of \cite{dixmier}. \end{rem} \pagebreak For basic properties of traces on von Neumann algebras, please see Chapter I.6 of \cite{dixmier} or Section V.2 of \cite{takesaki}. Motivating examples of semifinite von Neumann algebras are $(B(H),\Tr)$ and $(L^{\infty}(\Om,\mu),\int_{\Om} \boldsymbol{\cdot}\,d\mu)$, where $(\Om,\mathscr{F},\mu)$ is a $\sigma$-finite measure space and $L^{\infty}(\Om,\mu)$ is represented as multiplication operators on $L^2(\Om,\mu)$. \begin{nota}\label{nota.ncLp} Let $(\mathcal{M},\tau)$ be a semifinite von Neumann algebra and $1 \leq p < \infty$. Write \[ \|a\|_{L^p(\tau)} \coloneqq \tau(|a|^p)^{\frac{1}{p}} \in [0,\infty], \] for all $a \in \mathcal{M}$, and \[ \mathcal{L}^p(\tau) \coloneqq \{a \in \mathcal{M} : \|a\|_{L^p(\tau)}^p = \tau(|a|^p) < \infty\}. \] For the $p=\infty$ case, we take $\mathcal{L}^{\infty}(\tau) \coloneqq \mathcal{M}$ with $\|\cdot\|_{L^{\infty}(\tau)} \coloneqq \|\cdot\|$. \end{nota} It turns out that if $1 \leq p \leq \infty$, then $\|\cdot\|_{L^p(\tau)}$ is a norm on $\mathcal{L}^p(\tau)$. (Please see \cite{dixmierLp} or \cite{dasilva}.) The completion $(L^p(\tau),\|\cdot\|_{L^p(\tau)})$ of $(\mathcal{L}^p(\tau),\|\cdot\|_{L^p(\tau)})$ is called the \textbf{noncommutative $\boldsymbol{L^p}$ space associated to $\boldsymbol{(\mathcal{M},\tau)}$}. We shall see another perspective on $L^p(\tau)$ in Section \ref{sec.idealex2}. \begin{thm}[\textbf{Noncommutative Minkowski Inequality for Integrals}]\label{thm.Lpinteg} Let $(\mathcal{M},\tau)$ be a semifinite von Neumann algebra. If $F \colon \Sigma \to \mathcal{M}$ is weak$^*$ integrable, then \[ \Bigg\|\int_{\Sigma} F \,d\rho \Bigg\|_{L^p(\tau)} \leq \underline{\int_{\Sigma}}\|F\|_{L^p(\tau)}\,d\rho, \] for all $p \in [1,\infty]$. In particular, if the right hand side is finite, then $\int_{\Sigma} F \,d\rho \in \mathcal{L}^p(\tau)$. \end{thm} This is Theorem 3.4.8 in \cite{nikitopoulosMOI}, and the motivation for its name is the classical Minkowski Inequality for Integrals (e.g., 6.19 in \cite{folland}). In view of the name of \eqref{eq.opnormtriangle}, an equally sensible name for Theorem \ref{thm.Lpinteg} is the ``noncommutative $L^p$-norm integral triangle inequality." \subsection{Unbounded Operators and Spectral Theory}\label{sec.SpecTh} In this section, we provide the information about unbounded operators, projection-valued measures, and the Spectral Theorem that is necessary for this paper. Please see Chapters 3-6 of \cite{birmansolomyak5} or Chapters IX and X of \cite{conwayfunc} for more information and proofs of the facts we state (without proof) in this section. An \textbf{(unbounded linear) operator} $A$ on $H$ is a linear subspace $\mathrm{dom}(A) \subseteq H$ (the \textbf{domain} of $A$) and a linear map $A \colon \mathrm{dom}(A) \to H$. We may identify $A$ with its graph $\Gamma(A) = \{(h,Ah) : h \in \mathrm{dom}(A)\} \subseteq H \times H$. We say $A$ is \textbf{densely defined} if $\mathrm{dom}(A) \subseteq H$ is dense, \textbf{closable} if the closure of $\Gamma(A)$ in $H \times H$ is the graph of some operator $\overline{A}$ (called the \textbf{closure} of $A$) on $H$, and \textbf{closed} if $\Gamma(A) \subseteq H \times H$ is closed (i.e., $\overline{A} = A$). If $B$ is another unbounded operator on $H$, then the sum $A+B$ has domain $\mathrm{dom}(A+B) \coloneqq \mathrm{dom}(A) \cap \mathrm{dom}(B)$, and the product $AB$ has domain $\mathrm{dom}(AB) \coloneqq \{h \in \mathrm{dom}(B) : B h \in \mathrm{dom}(A)\} = B^{-1}(\mathrm{dom}(A))$. In addition, we write $A \subseteq B$ if $\Gamma(A) \subseteq \Gamma(B)$, i.e., $\mathrm{dom}(A) \subseteq \mathrm{dom}(B)$ and $Ah=Bh$, for all $h \in \mathrm{dom}(A)$; and $A=B$ if $A \subseteq B$ and $B \subseteq A$, i.e., $\mathrm{dom}(A) = \mathrm{dom}(B)$ and $Ah=Bh$ for $h$ in this common domain. Given a densely defined operator $A$ on $H$, we may form the \textbf{adjoint} $A^*$ of $A$ as follows. First, let \[ \mathrm{dom}(A^*) \coloneqq \{k \in H : \mathrm{dom}(A) \ni h \mapsto \langle Ah,k \rangle \in \mathbb{C} \text{ is bounded}\}. \] Then, for $k \in \mathrm{dom}(A^*)$, let $A^*k \in H$ be the unique vector in $H$ such that $\langle Ah,k \rangle = \langle h,A^*k \rangle$, for all $h \in \mathrm{dom}(A)$. One can show that if $A$ is densely defined and closed, then so is $A^*$, and $A=(A^*)^*$. A closed, densely defined operator $A$ on $H$ is \textbf{normal} if $A^*A=AA^*$ and \textbf{self-adjoint} if $A^*=A$. Finally, a self-adjoint operator $A$ on $H$ is called \textbf{positive}, written $A \geq 0$, if $\langle Ah,h \rangle \geq 0$ whenever $h \in \mathrm{dom}(A)$. \begin{nota} Write $C(H)$ for the set of closed, densely defined linear operators on $H$. Also, write $C(H)_{\nu} \coloneqq \{A \in C(H) : A^*A=AA^*\}$, $C(H)_{\sa} \coloneqq \{A \in C(H) : A=A^*\}$, and $C(H)_+ \coloneqq \{A \in C(H) : A \geq 0\}$ for the set of normal, self-adjoint, and positive operators on $H$, respectively. \end{nota} Next, we recall basic definitions and facts about integration with respect to a projection-valued measure. \begin{defi}[\textbf{Projection-Valued Measure}] Let $(\Om,\mathscr{F})$ be a measurable space and $P \colon \mathscr{F} \to B(H)$. We call $P$ a \textbf{projection-valued measure} if $P(\Om) = \id_H$, $P(G)^2 = P(G) = P(G)^*$ whenever $G \in \mathscr{F}$, and \[ P\Bigg(\bigcup_{n \in \mathbb{N}}G_n\Bigg) = \text{WOT-}\sum_{n=1}^{\infty}P(G_n) \numberthis\label{eq.WOTcountadd} \] whenever $(G_n)_{n \in \mathbb{N}} \in \mathscr{F}^{\mathbb{N}}$ is a sequence of disjoint measurable sets. In this case, we call the quadruple $(\Om,\mathscr{F},H,P)$ a \textbf{projection-valued measure space}. \end{defi} \begin{rem} To be clear, it is implicitly required in \eqref{eq.WOTcountadd} that the series on the right hand side converges in the WOT. It actually follows from the above definition that $P(\emptyset) = 0$ and $P(G_1 \cap G_2) = P(G_1)\,P(G_2)$ whenever $G_1,G_2 \in \mathscr{F}$. (Please see Theorem 1 in Section 5.1.1 of \cite{birmansolomyak5}.) These are often added to the definition of a projection-valued measure because they guarantee the series in \eqref{eq.WOTcountadd} converges in the SOT. \end{rem} \begin{nota} If $\varphi \colon \Om \to \mathbb{C}$ is a function, then $\|\varphi\|_{\ell^{\infty}(\Om)} \coloneqq \sup_{\omega \in \Om} |\varphi(\omega)| \in [0,\infty]$. Also, we write $\ell^0(\Om,\mathscr{F}) \coloneqq \{(\mathscr{F},\mathcal{B}_{\mathbb{C}})$-measurable functions $\Om \to \mathbb{C}\}$ and $\ell^{\infty}(\Om,\mathscr{F}) \coloneqq \{\varphi \in \ell^0(\Om,\mathscr{F}) : \|\varphi\|_{\ell^{\infty}(\Om)} < \infty\}$. Finally, if $\mu$ is a complex measure on $(\Om,\mathscr{F})$, then we write $|\mu|$ for the total variation measure of $\mu$ and $\|\mu\|_{\text{var}} \coloneqq |\mu|(\Om)$ for the total variation norm of $\mu$. \end{nota} \begin{prop}[\textbf{Integration with Respect to a Projection-Valued Measure}]\label{prop.integP} Let $(\Om,\mathscr{F},H,P)$ be a projection-valued measure space and $\varphi,\psi \in \ell^0(\Om,\mathscr{F})$. \begin{enumerate}[label=(\roman*),leftmargin=2\parindent] \item Let $h,k \in H$. If $P_{h,k}(G) \coloneqq \langle P(G)h,k\rangle$, for all $G \in \mathscr{F}$, then $P_{h,k}$ is a complex measure such that $\|P_{h,k}\|_{\mathrm{var}} \leq \|h\|\,\|k\|$. Also, $P_{h,k} \ll P$ in the sense that if $P(G) = 0$, then $P_{h,k}(G_0) = 0$ whenever $\mathscr{F} \ni G_0 \subseteq G$, i.e., $|P_{h,k}|(G) = 0$. Finally, $P_{h,h}$ is a (finite) positive measure.\label{item.Phk} \item Let $\mathrm{dom}(P(\varphi)) \coloneqq \{h \in H : \int_{\Om}|\varphi|^2\,dP_{h,h} < \infty\}$ and $h \in \mathrm{dom}(P(\varphi))$. If $k \in H$, then $\varphi \in L^1(\Om,|P_{h,k}|)$, and there exists a unique $h_{\varphi} \in H$ such that $\langle h_{\varphi},k \rangle_H = \int_{\Om}\varphi \,dP_{h,k}$, for all $k \in K$. If we define $P(\varphi)h \coloneqq h_{\varphi}$, then $P(\varphi) \in C(H)_{\nu}$.\label{item.defofPint} \item We have $P(\varphi)^* = P(\overline{\varphi})$, $\mathrm{dom}(P(\varphi)P(\psi)) = \mathrm{dom}(P(\psi)) \cap \mathrm{dom}(P(\varphi\psi))$, and $P(\varphi)P(\psi) \subseteq P(\varphi\psi)$. In particular, $P(\varphi)^*P(\varphi) = P(|\varphi|^2)$, and if $\psi \in \ell^{\infty}(\Om,\mathscr{F})$, then $P(\varphi)P(\psi) = P(\varphi\psi)$.\label{item.algpropPint} \item The map $\ell^{\infty}(\Om,\mathscr{F}) \ni \varphi \mapsto P(\varphi) \in B(H)$ is a (contractive) $\ast$-homomorphism.\label{item.bddPint} \item Let $(\varphi_n)_{n \in \mathbb{N}} \in \ell^{\infty}(\Om,\mathscr{F})^{\mathbb{N}}$ be a sequence. If $\sup_{n \in \mathbb{N}}\|\varphi_n\|_{\ell^{\infty}(\Om)} < \infty$ and $\varphi_n \to \varphi \in \ell^{\infty}(\Om,\mathscr{F})$ pointwise (i.e., $\varphi_n \to \varphi$ \textbf{boundedly}), then $P(\varphi_n) \to P(\varphi)$ in the strong$^*$ operator topology as $n \to \infty$.\label{item.PintDCT} \end{enumerate} We shall often write $P(\varphi) = \int_{\Om} \varphi \, dP = \int_{\Om} \varphi(\omega)\,P(d\omega)$ and call this the \textbf{integral} of $\varphi$ with respect to $P$. \end{prop} The reason projection-valued measures are relevant for us is the Spectral Theorem, which we now recall. If $A \in C(H)$, then the \textbf{resolvent set} $\rho(A) \subseteq \mathbb{C}$ of $A$ is the set of $\lambda \in \mathbb{C}$ such that $A-\lambda \id_H : \mathrm{dom}(A) \to H$ is a bijection with bounded inverse. The \textbf{spectrum} $\sigma(A) \subseteq \mathbb{C}$ of $A$ is the complement of $\rho(A)$. The resolvent set $\rho(A)$ is open in $\mathbb{C}$, and the spectrum $\sigma(A)$ is closed in $\mathbb{C}$. Also, a normal operator $A \in C(H)_{\nu}$ is self-adjoint if and only if $\sigma(A) \subseteq \mathbb{R}$. Finally, $A \in C(H)_+$ if and only if $A \in C(H)_{\sa}$ and $\sigma(A) \subseteq [0,\infty)$. \begin{thm}[\textbf{Spectral Theorem for Normal Operators}]\label{thm.spec} If $A \in C(H)_{\nu}$, then there exists a unique projection-valued measure $P^A \colon \mathcal{B}_{\sigma(A)} \to B(H)$ such that \[ A = \int_{\sigma(A)} \lambda\,P^A(d\lambda). \] We call $P^A$ the \textbf{projection-valued spectral measure} of $A$. We shall frequently abuse notation and consider $P^A$ to be a projection-valued measure defined on $\mathcal{B}_{\mathbb{C}}$ or, when $A \in C(H)_{\sa}$, on $\mathcal{B}_{\mathbb{R}}$. \end{thm} The Spectral Theorem leads to the usual definition of functional calculus. If $A \in C(H)_{\nu}$ and $f \colon \sigma(A) \to \mathbb{C}$ is Borel measurable, then we define \[ f(A) \coloneqq P^A(f) = \int_{\sigma(A)}f\,dP^A \in C(H)_{\nu}. \] This definition enjoys the property that if $f,g \colon \mathbb{C} \to \mathbb{C}$ are Borel measurable, then $f(g(A)) = (f \circ g)(A)$. (Please see Corollary 5.6.29 of \cite{kadisonringrose1}.) \pagebreak Now, if $A \in C(H)$ is arbitrary, then $A^*A \in C(H)_+$. (This result is often called von Neumann's Theorem.) In particular, $\sigma(A^*A) \subseteq [0,\infty)$, so we may define the \textbf{absolute value} $|A| \coloneqq (A^*A)^{\frac{1}{2}} \in C(H)_+$ of $A$ via functional calculus. Also, there exists a unique partial isometry $U \in B(H)$ with initial space $\overline{\im |A|} = \overline{\im (A^*)}$ and final space $\overline{\im A}$ such that $A=U|A|$. (In particular, $\mathrm{dom} (A) = \mathrm{dom} (|A|)$.) This is called the \textbf{polar decomposition} of $A$. (Please see Section 8.1, particularly Theorems 2 and 3, of \cite{birmansolomyak5}.) We end this section with a review of the concept of an operator affiliated with a von Neumann algebra. \begin{defi}[\textbf{Affiliated Operators}]\label{def.aff} An operator $a \in C(H)$ is said to be \textbf{affiliated with $\boldsymbol{\mathcal{M}}$} if $u^*au = a$, for all unitaries $u$ belonging to $\mathcal{M}'$. In this case, we write $a \aff \mathcal{M}$. If in addition $a$ is normal (respectively, self-adjoint), then we write $a \aff \mathcal{M}_{\nu}$ (respectively, $a \aff \mathcal{M}_{\sa}$). \end{defi} Here are some properties of affiliated operators. We sketch the proofs for the reader's convenience. \begin{prop}\label{prop.aff} Let $(\Om,\mathscr{F},H,P)$ be a projection-valued measure space. \begin{enumerate}[label=(\roman*),leftmargin=2\parindent] \item If $a \in B(H)$, then $a \aff \mathcal{M}$ if and only if $a \in \mathcal{M}$.\label{item.bddaffinM} \item If $P(G) \in \mathcal{M}$, for all $G \in \mathscr{F}$, then $P(\varphi) \aff \mathcal{M}$, for all $\varphi \in \ell^0(\Om,\mathscr{F})$. In particular, by item \ref{item.bddaffinM}, if $\varphi \in \ell^{\infty}(\Om,\mathscr{F})$, then $P(\varphi) \in \mathcal{M}$.\label{item.intPaff} \item If $a \in C(H)_{\nu}$, then $a \aff \mathcal{M}$ if and only if $P^a(G) \in \mathcal{M}$, for all $G \in \mathcal{B}_{\sigma(a)} $; and in this case $f(a) \aff \mathcal{M}$, for all $f \in \ell^0(\sigma(a),\mathcal{B}_{\sigma(a)})$. In particular, $f(a) \in \mathcal{M}$, for all $f \in \ell^{\infty}(\sigma(a),\mathcal{B}_{\sigma(a)})$.\label{item.funcofaffisaff} \item If $a \in C(H)$ and $a=u|a|$ is its polar decomposition, then $a \aff \mathcal{M}$ if and only if $u \in \mathcal{M}$ and $P^{|a|}(G) \in \mathcal{M}$, for all $G \in \mathcal{B}_{\sigma(|a|)}$.\label{item.affandpolar} \end{enumerate} \end{prop} \begin{proof}[Sketch] We take each item in turn. \ref{item.bddaffinM} Let $a \in B(H)$ and $u \in \mathcal{M}'$ be a unitary. If $a \in \mathcal{M}$, then of course $u^*au = u^*ua = a$. Now, if $a \aff \mathcal{M}$, then $au = uu^*au=ua$. Since all $C^*$-algebra are spanned by their unitaries, we conclude $ab=ba$, for all $b \in \mathcal{M}'$. Thus $a \in \mathcal{M}'' = \mathcal{M}$ by the Bicommutant Theorem. \ref{item.intPaff} Suppose $P(G) \in \mathcal{M}$, for all $G \in \mathscr{F}$. If $h,k \in H$ and $u \in \mathcal{M}'$ is a unitary, then it is easy to see that $P_{uh,uk} = P_{h,k}$. Unraveling the definition of $P(\varphi)$ then gives $u^*P(\varphi)u = P(\varphi)$. Thus $P(\varphi) \aff \mathcal{M}$. \ref{item.funcofaffisaff} If $P^a(G) \in \mathcal{M}$, for all $G \in \mathcal{B}_{\sigma(a)}$, then $a = \int_{\sigma(a)} \lambda \, P^a(d\lambda) \aff \mathcal{M}$ by the previous item. Now, suppose $a \aff \mathcal{M}_{\nu}$, and let $u \in \mathcal{M}'$ be a unitary. Note that $Q^a \coloneqq u^*P^a(\cdot)u \colon \mathcal{B}_{\sigma(a)} \to B(H)$ is a projection-valued measure, and it is easy to see from the Spectral Theorem and definition of $Q^a$ that $u^*au = \int_{\sigma(a)}\lambda \, Q^a(d\lambda)$. But $u^*au = a$ by assumption, so the uniqueness part of the Spectral Theorem forces $P^a = Q^a = u^*P^a(\cdot)u$. In other words, $P^a(G) \aff \mathcal{M}$ and thus, by item \ref{item.bddaffinM}, $P^a(G) \in \mathcal{M}$, for all $G \in \mathcal{B}_{\sigma(a)}$. \ref{item.affandpolar} Let $a \in C(H)$, $a=u|a|$ be the polar decomposition of $a$, and $v \in \mathcal{M}'$ be a unitary. If $P^{|a|}(G) \in \mathcal{M}$ whenever $G \in \mathcal{B}_{\sigma(|a|)}$, then $|a| \aff \mathcal{M}$ by the previous item. If in addition $u \in \mathcal{M}$, then we have that $v^*av = v^*u|a|v = v^*uvv^*|a|v = u|a| = a$. Thus $a \aff \mathcal{M}$. Conversely, if $a \aff \mathcal{M}$, then one can show $a^*a \aff \mathcal{M}$ as well. By the previous item, $|a| = \sqrt{a^*a} \aff \mathcal{M}$ and thus $P^{|a|}(G) \in \mathcal{M}$ whenever $G \in \mathcal{B}_{\sigma(|a|)}$. Next, notice that $v^*uv$ is a partial isometry, and $a = v^*av = v^*u|a|v = v^*uv|a|$ by what we have just proven. Finally, $|a| \aff \mathcal{M}$ implies that $v^*uv$ has initial space $\overline{\im|a|}$, and $a \aff \mathcal{M}$ implies that $v^*uv$ has final space $\overline{\im a}$. We conclude $v^*uv = u$ by uniqueness of the polar decomposition. Thus $u \aff \mathcal{M}$ and so, by item \ref{item.bddaffinM}, $u \in \mathcal{M}$. \end{proof} \begin{rem} It is worth mentioning that one can prove much more directly -- without knowing anything about unbounded operators or the Bicommutant Theorem -- that if $P(G) \in \mathcal{M}$, for all $G \in \mathscr{F}$, then $P(\varphi) \in \mathcal{M}$, for all $\varphi \in \ell^{\infty}(\Om,\mathscr{F})$. Please see Lemma 4.2.16 in \cite{nikitopoulosMOI}. \end{rem} \subsection{Symmetric Operator Spaces}\label{sec.symmopsp} In Section \ref{sec.idealex2}, we shall make use of the theory of \textit{symmetric operator spaces}. In the present section, we review the notation, terminology, and results from this theory that are necessary for our purposes. We refer the reader to \cite{doddsNKS} for extra exposition, examples, and a thorough list of references. (The reader who is uninterested in Section \ref{sec.idealex2} may safely skip at this point to Section \ref{sec.idealprop}.) \begin{conv} For the duration of this section, suppose $(\mathcal{M},\tau)$ is a semifinite von Neumann algebra. \end{conv} Write $\mathrm{Proj}(\mathcal{M}) \coloneqq \{p \in \mathcal{M} : p^2=p=p^*\}$ for the lattice of (orthogonal) projections in $\mathcal{M}$. An operator $a \aff \mathcal{M}$ is called \textbf{$\boldsymbol{\tau}$-measurable} if there exists some $s \geq 0$ such that $\tau(P^{|a|}((s,\infty))) < \infty$. Write \[ S(\tau) \coloneqq \{a \aff \mathcal{M} : a \text{ is }\tau\text{-measurable}\}, \] and let $a,b \in S(\tau)$. Then $a+b$ is closable, and $\overline{a+b} \in S(\tau)$; $ab$ is closable, and $\overline{ab} \in S(\tau)$; and $a^*,|a| \in S(\tau)$. Moreover, $S(\tau)$ is a $\ast$-algebra under the adjoint, strong sum (closure of sum), and strong product (closure of product) operations; we shall therefore omit the closures from strong sums and products in the future. For the preceding facts (and more) about $\tau$-measurable operators, please see \cite{nelson,terp}. Let $a \in S(\tau)$. For $s \geq 0$, define \[ d_s(a) \coloneqq \tau\big(P^{|a|}((s,\infty))\big) \in [0,\infty]. \] By definition of $\tau$-measurable, $d_s(a) < \infty$ for sufficiently large $s$. The function $d(a) = d_{\boldsymbol{\cdot}}(a)$ is called the \textbf{(noncommutative) distribution function} of $a$. Now, for $t > 0$, define \[ \mu_t(a) \coloneqq \inf\{s \geq 0 : d_s(a) \leq t\} \in [0,\infty). \] The function $\mu(a) = \mu_{\boldsymbol{\cdot}}(a)$ is called the \textbf{(generalized) singular value function} or \textbf{(noncommutative) decreasing rearrangement} of $a$, and $\mu(a)$ is decreasing and right-continuous. For properties of $d(a)$ and $\mu(a)$, please see \cite{fackkosaki}. Now, let $S(\tau)_+ \coloneqq S(\tau) \cap C(H)_+$. If $a \in \mathcal{M}_+ = S(\tau)_+ \cap \mathcal{M}$, then \[ \tau(a) = \int_0^{\infty} \mu_t(a)\,dt. \] We therefore extend $\tau$ to $S(\tau)_+$ via the formula above; this extension is still notated as $\tau \colon S(\tau)_+ \to [0,\infty]$. Finally, if $a,b \in S(\tau)$, then we write \[ a \pprec b \; \text{ if } \; \int_0^t \mu_s(a)\,ds \leq \int_0^t \mu_s(b)\,ds, \text{ for all } t \geq 0. \] In this case, we say that $a$ is \textbf{submajorized by} $b$ or that $b$ \textbf{submarjorizes} $a$ (in the ``noncommutative" sense of Hardy-Littlewood-P\'{o}lya). We now define symmetric operator spaces. \begin{defi}[\textbf{Symmetric Operator Spaces}]\label{def.symmopsp} Let $E \subseteq S(\tau)$ be a linear subspace and $\|\cdot\|_E$ be a norm on $E$ such that $(E,\|\cdot\|_E)$ is a Banach space. We call $(E,\|\cdot\|_E)$ \begin{enumerate}[label=(\alph*),leftmargin=2\parindent] \item a \textbf{symmetric} (or \textbf{rearrangement-invariant}) \textbf{space of $\boldsymbol{\tau}$-measurable operators} -- a \textbf{symmetric space}\footnote{Beware: This has nothing to do with the notion of a (Riemannian) symmetric space from geometry.} for short -- if $a \in S(\tau)$, $b \in E$, and $\mu(a) \leq \mu(b)$ imply $a \in E$ and $\|a\|_E \leq \|b\|_E$; \item a \textbf{strongly symmetric space of $\boldsymbol{\tau}$-measurable operators} -- a \textbf{strongly symmetric space} for short -- if it is a symmetric space, and $a, b \in E$ and $a \pprec b$ imply $\|a\|_E \leq \|b\|_E$; and \item a \textbf{fully symmetric space of $\boldsymbol{\tau}$-measurable operators} -- a \textbf{fully symmetric space} for short -- if $a \in S(\tau)$, $b \in E$, and $a \pprec b$ imply $a \in E$ and $\|a\|_E \leq \|b\|_E$.\label{item.fullysymm} \end{enumerate} If $(E,\|\cdot\|_E)$ is a symmetric space, then we define \[ \mathrm{Proj}(E) \coloneqq E \cap \mathrm{Proj}(\mathcal{M}) \; \text{ and } \; c_E \coloneqq \sup \mathrm{Proj}(E) \in \mathrm{Proj}(\mathcal{M}) \] and call $c_E$ the \textbf{carrier projection} of $E$. \end{defi} Next, we describe a large class of examples of (strongly, fully) symmetric spaces. Let $m$ be the Lebesgue measure on the positive halfline $(0,\infty)$ and $(\mathcal{N},\eta) = (L^{\infty}((0,\infty),m),\int_0^{\infty} \boldsymbol{\cdot} \,dm)$, where $L^{\infty}((0,\infty),m)$ is represented as multiplication operators on $L^2((0,\infty),m)$. Then the set of densely defined, closed operators affiliated with $\mathcal{N}$ is precisely $L^0((0,\infty),m)$, i.e., the space of $m$-almost-everywhere equivalence classes of measurable functions $(0,\infty) \to \mathbb{C}$, viewed as (unbounded) multiplication operators on $L^2((0,\infty),m)$; and \[ S(\eta) = \{f \in L^0((0,\infty),m) : d_s(f) = m(\{x \in (0, \infty) : |f(x)| > s\}) < \infty \text{ for some } s \geq 0\}. \] For proofs of these facts, please see Section 2.3 of \cite{cz}. A (strongly, fully) symmetric space of $\eta$-measurable operators is called a (\textbf{strongly}, \textbf{fully}) \textbf{symmetric Banach function space}. For the classical theory of such spaces, please see Chapter II of \cite{kreininterp}. \begin{fact}\label{fact.Etau} Let $(E \subseteq L^0((0,\infty),m),\|\cdot\|_E)$ be a (strongly, fully) symmetric Banach function space. If \[ E(\tau) \coloneqq \{a \in S(\tau) : \mu(a) \in E\} \; \text{ and } \; \|a\|_{E(\tau)} \coloneqq \|\mu(a)\|_E \text{ for } a \in E(\tau), \] then $(E(\tau),\|\cdot\|_{E(\tau)})$ is a (strongly, fully) symmetric space of $\tau$-measurable operators. \end{fact} For the strongly/fully symmetric cases, please see Section 9.1 of \cite{doddsNKS}. For the (highly nontrivial) case of an arbitrary symmetric space, please see \cite{kaltonsukochev}. When $1 \leq p \leq \infty$ and $E = L^p \coloneqq L^p((0,\infty),m)$, then $L^p(\tau)$ as defined using the construction in Fact \ref{fact.Etau} is a concrete description of the abstract (completion-based) definition from Section \ref{sec.wstarint}. When $p=\infty$, this follows from Lemma 2.5.(i) in \cite{fackkosaki}; when $p < \infty$, it follows from Lemma 2.5.(iv) in \cite{fackkosaki} and Proposition 2.8 in \cite{doddsNKD}. Moreover, we have \[ (L^p(\tau),\|\cdot\|_{L^p(\tau)}) = \big(\{a \in S(\tau) : \tau(|a|^p) < \infty\},\tau(|\cdot|^p)^{\frac{1}{p}}\big) \] when $1 \leq p < \infty$. As a result, \[ (L^p \cap L^{\infty})(\tau) = L^p(\tau) \cap L^{\infty}(\tau) = L^p(\tau) \cap \mathcal{M} = \mathcal{L}^p(\tau) \] with equality of norms (if we give $\mathcal{L}^p(\tau)$ the norm $\max\{\|\cdot\|_{L^p(\tau)},\|\cdot\|\}$). It is also true that \[ (L^1+L^{\infty})(\tau) = L^1(\tau)+L^{\infty}(\tau) = L^1(\tau)+\mathcal{M} \] with equality of norms. (This follows from Proposition 2.5 in \cite{doddsNKD}.) To be clear, if $Z$ is a vector space and $X,Y \subseteq Z$ are normed linear subspaces with respective norms $\|\cdot\|_X$ and $\|\cdot\|_Y$, then the subspace $X \cap Y \subseteq Z$ is given the norm $\|\cdot\|_{X \cap Y} \coloneqq \max\{\|\cdot\|_X,\|\cdot\|_Y\}$, and the subspace $X+Y \subseteq Z$ is given the norm $\|z\|_{X+Y} \coloneqq \inf\{\|x\|_X+\|y\|_Y : x \in X, \, y \in Y, \, z=x+y\}$. In general, if $(E,\|\cdot\|_E)$ is a strongly symmetric space of $\tau$-measurable operators, then $E \subseteq L^1(\tau)+\mathcal{M}$ with continuous inclusion, and $c_E = 1 \iff L^1(\tau) \cap \mathcal{M} \subseteq E$ with continuous inclusion. This is Lemma 25 in \cite{doddsNKS} (combined with the last paragraph of the proof of Lemma 3.4.7 in \cite{nikitopoulosMOI}). By Theorem 4.1 in Section II.4.1 of \cite{kreininterp}, if $(\tilde{E},\|\cdot\|_{\tilde{E}})$ is a nonzero symmetric Banach function space, then $L^1 \cap L^{\infty} \subseteq \tilde{E} \subseteq L^1+L^{\infty}$ with continuous inclusions as well, i.e., $c_{\tilde{E}} = 1$. Finally, we discuss K\"{o}the duals. For a symmetric space $(E,\|\cdot\|_E)$, define \begin{align*} E^{\times} & \coloneqq \{a \in S(\tau) : ab \in L^1(\tau), \text{ for all } b \in E\} \, \text{ and} \\ \|a\|_{E^{\times}} & \coloneqq \sup\{\tau(|ab|) : b \in E, \, \|b\|_E \leq 1\} \, \text{ for } a \in S(\tau). \end{align*} Of course, $\|a\|_{E^{\times}}$ could be infinite. \begin{fact}[\textbf{K\"{o}the Dual}]\label{fact.Kothedual} Let $(E,\|\cdot\|_E)$ be a strongly symmetric space of $\tau$-measurable operators with $c_E = 1$. If $a \in S(\tau)$, then $\|a\|_{E^{\times}} = \sup\{\tau(|ab|) : b \in \mathcal{L}^1(\tau) = L^1(\tau) \cap \mathcal{M}, \, \|b\|_E \leq 1\}$. Moreover, $a \in E^{\times} \iff \|a\|_{E^{\times}} < \infty$. Finally, $\|\cdot\|_{E^{\times}}$ is a norm on $E^{\times}$ such that $(E^{\times},\|\cdot\|_{E^{\times}})$ is a fully symmetric space with $c_{E^{\times}} = 1$. We call $E^{\times}$ the \textbf{K\"{o}the dual} of $E$. \end{fact} \begin{rem} In the classical case of symmetric Banach function spaces, the K\"{o}the dual of $E$ is called the \textit{associate space of} $E$ or the \textit{space associated with} $E$. \end{rem} For a proof of this fact, please see Section 5 of \cite{doddsNKD} or Sections 5.2 and 6 of \cite{doddsNKS}. Now, let $(E,\|\cdot\|_E)$ be a strongly symmetric space of $\tau$-measurable operators with $c_E = 1$. Since $E^{\times}$ is fully symmetric and $c_{E^{\times}} = 1$, we can consider the \textbf{K\"{o}the bidual} $(E^{\times\times},\|\cdot\|_{E^{\times\times}}) = ((E^{\times})^{\times},\|\cdot\|_{(E^{\times})^{\times}})$ of $E$ as a (fully) symmetric space. It is always the case that $E \subseteq E^{\times \times}$ and $\|\cdot\|_{E^{\times\times}} \leq \|\cdot\|_E$ on $E$. If $E=E^{\times\times}$ and $\|\cdot\|_E = \|\cdot\|_{E^{\times\times}}$ on $E$, then we call $E$ \textbf{K\"{o}the reflexive}. (This term is not standard; a more common term is \textit{maximal}.) Note that, by Fact \ref{fact.Kothedual}, if $E$ is K\"{o}the reflexive, then $E$ is automatically fully symmetric. The following is a celebrated equivalent characterization of K\"{o}the reflexivity. It is stated and proven as Proposition 5.14 in \cite{doddsNKD} and Theorem 32 in \cite{doddsNKS}. \begin{thm}[\textbf{Noncommutative Lorentz-Luxemburg}]\label{thm.ncll} Let $(E,\|\cdot\|_E)$ be a strongly symmetric space of $\tau$-measurable operators with $c_E=1$. Then $E$ is K\"{o}the reflexive if and only if $E$ has the \textbf{Fatou property}: whenever $(a_j)_{j \in J}$ is an increasing net ($j_1 \leq j_2 \Rightarrow a_{j_2} - a_{j_1} \in S(\tau)_+$) in $E \cap S(\tau)_+$ with $\sup_{j \in J}\|a_j\|_E < \infty$, we have that $\sup_{j \in J}a_j$ exists in $E \cap S(\tau)_+$ and $\|\sup_{j \in J}a_j\|_E = \sup_{j \in J}\|a_j\|_E$. \end{thm} The definition of the Fatou property involves rather arbitrary nets. It is therefore reasonable to be concerned that verifying the Fatou property in classical situations might be quite difficult. However, as we explain shortly, the sequence formulation of the Fatou property is equivalent in classical situations. Let $(E \subseteq L^0((0,\infty),m),\|\cdot\|_E)$ be a symmetric Banach function space. We say that $E$ has the \textbf{classical Fatou property} if whenever $(f_n)_{n \in \mathbb{N}}$ is an increasing sequence of nonnegative functions in $E$ such that $\sup_{n \in \mathbb{N}} \|f_n\|_E < \infty$, we have $\sup_{n \in \mathbb{N}} f_n \in E$ and $\|\sup_{n \in \mathbb{N}} f_n\|_E = \sup_{n \in \mathbb{N}} \|f_n\|_E$. It turns out (Theorem 4.6 in Section 2.4 of \cite{bensharp}) that if $E$ has the classical Fatou property, then $E$ is fully symmetric, so we may speak of its K\"{o}the dual as a (fully) symmetric Banach function space when $E$ is nonzero. The classical Lorentz-Luxemburg Theorem (e.g., Theorem 1 in Section 71 of \cite{zaanen}) says that a nonzero symmetric Banach function space has the classical Fatou property if and only if it is (strongly symmetric and) K\"{o}the reflexive. In particular, by the Noncommutative Lorentz-Luxemburg Theorem, a symmetric Banach function space has the Fatou property if and only if it has the classical Fatou property. \begin{ex}\label{ex.Fatou} Let $(E,\|\cdot\|_E)$ be a nonzero strongly symmetric Banach function space (which implies $c_E = 1$ as noted above). By Theorem 5.6 in \cite{doddsNKD}, \[ \big(E(\tau)^{\times},\|\cdot\|_{E(\tau)^{\times}}\big) = \big(E^{\times}(\tau),\|\cdot\|_{E^{\times}(\tau)}\big). \] In particular, if $E$ is K\"{o}the reflexive (i.e., has the classical Fatou property), then $E(\tau)$ is K\"{o}the reflexive (i.e., has the Fatou property) as well. \end{ex} \begin{rem} Let $E$ be a symmetric Banach function space. By Theorem 3 in Section 65 of \cite{zaanen}, $E$ has the classical Fatou property if and only if whenever $(f_n)_{n \in \mathbb{N}}$ is a sequence of nonnegative functions in $E$ with $\liminf_{n \to \infty} \|f_n\|_E < \infty$, we have $\liminf_{n \to \infty} f_n \in E$ and $\big\|\liminf_{n \to \infty} f_n\big\|_E \leq \liminf_{n \to \infty} \|f_n\|_E$, i.e, Fatou's Lemma holds for $\|\cdot\|_E$. Hence the property's name. \end{rem} \section{Ideals of von Neumann Algebras}\label{sec.ideals} For the entirety of Section \ref{sec.ideals}, fix a complex Hilbert space $(H,\langle \cdot,\cdot \rangle)$ and a von Neumann algebra $\mathcal{M} \subseteq B(H)$. \subsection{Properties to Request of Ideals}\label{sec.idealprop} In this section, we introduce some abstract properties of ideals of $\mathcal{M}$ that are useful in the study of MOIs and their applications to the differentiation of operator functions. In Section \ref{sec.idealex1}, we give several classes of examples that do not require the theory of symmetric operator spaces to understand. In Section \ref{sec.idealex2}, we give a large class of additional examples using the theory of symmetric operator spaces. \begin{defi}[\textbf{Symmetrically Normed Ideals}]\label{def.sni} Let $\mathcal{A}$ be a Banach algebra and $\mathcal{J} \subseteq \mathcal{A}$ be an ideal, i.e., a linear subspace such that $arb \in \mathcal{J}$ whenever $a,b \in \mathcal{A}$ and $r \in \mathcal{J}$; in this case, we write $\mathcal{J} \unlhd \mathcal{A}$. Suppose we have another norm $\|\cdot\|_{\mathcal{J}}$ on $\mathcal{J}$. We call $(\mathcal{J},\|\cdot\|_{\mathcal{J}})$ a \textbf{Banach ideal} of $\mathcal{A}$ if $(\mathcal{J},\|\cdot\|_{\mathcal{J}})$ is a Banach space and the inclusion $\iota_{\mathcal{J}} \colon (\mathcal{J},\|\cdot\|_{\mathcal{J}}) \hookrightarrow (\mathcal{A},\|\cdot\|_{\mathcal{A}})$ is bounded; in this case, we write and \[ (\mathcal{J},\|\cdot\|_{\mathcal{J}}) \unlhd \mathcal{A} \; \text{ and } \; C_{\mathcal{J}} \coloneqq \|\iota_{\mathcal{J}}\|_{\mathcal{J} \to \mathcal{A}} \in [0,\infty). \] If in addition $a,b \in \mathcal{A}$ and $r \in \mathcal{J}$ imply \[ \|arb\|_{\mathcal{J}} \leq \|a\|_{\mathcal{A}}\|r\|_{\mathcal{J}}\|b\|_{\mathcal{A}}, \] then we call $(\mathcal{J},\|\cdot\|_{\mathcal{J}})$ a \textbf{symmetrically normed ideal} of $\mathcal{A}$ and write \[ (\mathcal{J},\|\cdot\|_{\mathcal{J}}) \unlhd_{\mathrm{s}} \mathcal{A} \] or $\mathcal{J} \unlhd_{\mathrm{s}} \mathcal{A}$ when confusion is unlikely. \end{defi} \begin{rem} Beware: Definitions of a symmetrically normed ideal vary in the literature. Sometimes it is required that $c_{\mathcal{J}} = 1$. Sometimes $\mathcal{A}$ is required to be a von Neumann or $C^*$-algebra and $\mathcal{J}$ is required to be a $\ast$-ideal with $\|r^*\|_{\mathcal{J}} = \|r\|_{\mathcal{J}}$, for all $r \in \mathcal{J}$. Sometimes even more requirements are imposed. We take the above minimal definition because it is all we need. \end{rem} We now define two additional properties one can demand of Banach or symmetrically normed ideals of a von Neumann algebra. Before doing so, however, we make an observation. Let $(\Sigma,\mathscr{H},\rho)$ be a measure space, $(\mathcal{I},\|\cdot\|_{\mathcal{I}}) \unlhd \mathcal{M}$, and $F \colon \Sigma \to \mathcal{I} \subseteq \mathcal{M}$ be weak$^*$ measurable. By definition, \[ \underline{\int_{\Sigma}} \|F\| \, d\rho \leq C_{\mathcal{I}}\underline{\int_{\Sigma}}\|F\|_{\mathcal{I}} \, d\rho. \] In particular, if $\underline{\int_{\Sigma}} \|F\|_{\mathcal{I}} \, d\rho < \infty$, then Proposition \ref{prop.wstarintexist} says that $F \colon \Sigma \to \mathcal{M}$ is weak$^*$ integrable. \begin{defi}[\textbf{Properties of Banach Ideals of $\boldsymbol{\mathcal{M}}$}]\label{def.idealproperties} Let $(\mathcal{I},\|\cdot\|_{\mathcal{I}}) \unlhd \mathcal{M}$. \begin{enumerate}[label=(\alph*),leftmargin=2\parindent] \item $\mathcal{I}$ has the \textbf{Minkowski integral inequality property} -- or \textbf{property (M)} for short -- if whenever $(\Sigma,\mathscr{H},\rho)$ is a measure space and $F \colon \Sigma \to \mathcal{I} \subseteq \mathcal{M}$ is weak$^*$ measurable with $\underline{\int_{\Sigma}} \|F\|_{\mathcal{I}} \, d\rho < \infty$, we have\label{item.Minkowski} \[ \int_{\Sigma} F \, d\rho \in \mathcal{I} \; \text{ and } \; \Bigg\|\int_{\Sigma} F \, d\rho \Bigg\|_{\mathcal{I}} \leq \underline{\int_{\Sigma}} \|F\|_{\mathcal{I}} \, d\rho. \] \item $\mathcal{I}$ is \textbf{integral symmetrically normed} if whenever $(\Sigma,\mathscr{H},\rho)$ is a measure space, $A,B \colon \Sigma \to \mathcal{M}$ are weak$^*$ measurable, $A(\cdot)\,c\,B(\cdot) \colon \Sigma \to \mathcal{M}$ is weak$^*$ measurable for all $c \in \mathcal{M}$, and $\underline{\int_{\Sigma}}\|A\|\,\|B\|\,d\rho < \infty$, it follows that \[ \int_{\Sigma}A(\sigma)\,r\,B(\sigma)\,\rho(d\sigma) \in \mathcal{I} \; \text{ and } \; \Bigg\|\int_{\Sigma}A(\sigma)\,r\,B(\sigma)\,\rho(d\sigma)\Bigg\|_{\mathcal{I}} \leq \|r\|_{\mathcal{I}}\underline{\int_{\Sigma}}\|A\|\,\|B\|\,d\rho, \] for all $r \in \mathcal{I}$.\label{item.ISNI} \end{enumerate} \end{defi} \begin{rem} First, the name for property (M) is inspired by Theorem \ref{thm.Lpinteg}. However, inequalities like the one required in \ref{item.Minkowski} are called triangle inequalities in the theory of vector-valued integrals. Therefore, it would also be appropriate to name \ref{item.Minkowski} the ``integral triangle inequality property." However, this would lead naturally to the abbreviation ``property (T)," which is already decidedly claimed. Second, if $H$ is separable, then one can show that the pointwise product of weak$^*$ measurable maps $\Sigma \to \mathcal{M}$ is itself weak$^*$ measurable. In particular, the requirement in \ref{item.ISNI} that ``$A(\cdot)\,c\,B(\cdot) \colon \Sigma \to \mathcal{M}$ is weak$^*$ measurable for all $c \in \mathcal{M}$" is redundant when $H$ is separable. \end{rem} By testing the definition on the one-point probability space, we see that an integral symmetrically normed ideal is symmetrically normed. We also have the following. \begin{prop}\label{prop.idealproperties} Let $(\mathcal{I},\|\cdot\|_{\mathcal{I}}) \unlhd_{\mathrm{s}} \mathcal{M}$. If $\mathcal{I}$ has property (M), then $\mathcal{I}$ is integral symmetrically normed. \end{prop} \begin{proof} Suppose that $\mathcal{I} \unlhd_{\mathrm{s}} \mathcal{M}$ has property (M). Let $A,B \colon \Sigma \to \mathcal{M}$ be as in \ref{def.idealproperties}.\ref{item.ISNI} and $r \in \mathcal{I}$. Since $\mathcal{I}$ is symmetrically normed, we have $\|A(\sigma)\,r\,B(\sigma)\|_{\mathcal{I}} \leq \|r\|_{\mathcal{I}}\|A(\sigma)\|\,\|B(\sigma)\|$, for all $\sigma \in \Sigma$. Applying the definition of property (M) to $F \coloneqq A(\cdot)\,r\,B(\cdot)$, we conclude $\int_{\Sigma}A(\sigma)\,r\,B(\sigma)\,\rho(d\sigma) \in \mathcal{I}$ and \[ \Bigg\|\int_{\Sigma}A(\sigma)\,r\,B(\sigma)\,\rho(d\sigma) \Bigg\|_{\mathcal{I}} \leq \underline{\int_{\Sigma}}\|A(\sigma)\,r\,B(\sigma)\|_{\mathcal{I}} \, \rho(d\sigma) \leq \|r\|_{\mathcal{I}} \underline{\int_{\Sigma}}\|A\|\,\|B\|\,d\rho. \] Thus $\mathcal{I}$ is integral symmetrically normed. \end{proof} \subsection{Examples of Ideals I}\label{sec.idealex1} In this section, we exhibit several examples of ideals with property (M), namely the trivial ideals, the noncommutative $L^p$-ideals, separable ideals, and the ideal of compact operators. \begin{ex}[\textbf{Trivial Ideals}]\label{ex.M} The trivial symmetrically normed ideals $\mathcal{I} = \{0\}$ and $\mathcal{I} = \mathcal{M}$ both have property (M). The latter follows, of course, from Proposition \ref{prop.wstarintexist}. \end{ex} \begin{ex}[\textbf{Noncommutative $\boldsymbol{L^p}$ Ideals}]\label{ex.Lp} Suppose $\mathcal{M}$ is semifinite with normal, faithful, semifinite trace $\tau$. If $1 \leq p \leq \infty$ and $\mathcal{L}^p(\tau)$ is given the norm \[ \|\cdot\|_{\mathcal{L}^p(\tau)} \coloneqq \max\{\|\cdot\|_{L^p(\tau)},\|\cdot\|\}, \] then $(\mathcal{L}^p(\tau),\|\cdot\|_{\mathcal{L}^p(\tau)}) \unlhd_{\mathrm{s}} \mathcal{M}$ by Noncommutative H\"{o}lder's Inequality (Th\'{e}or\`{e}me 6 in \cite{dixmierLp}) and the completeness of $(L^p(\tau),\|\cdot\|_{L^p(\tau)})$ and $(\mathcal{M},\|\cdot\|)$. If we combine Example \ref{ex.M} with Theorem \ref{thm.Lpinteg}, then we conclude $\mathcal{L}^p(\tau)$ has property (M) and is therefore integral symmetrically normed by Proposition \ref{prop.idealproperties}. Note that if $(\mathcal{M},\tau) = (B(H),\Tr)$, then \[ (\mathcal{L}^p(\Tr),\|\cdot\|_{\mathcal{L}^p(\Tr)}) = (\mathcal{S}_p(H),\|\cdot\|_{\mathcal{S}_p(H)}) \] is the ideal of Schatten $p$-class operators on $H$ (Definition 2.2.1 in \cite{nikitopoulosMOI}). \end{ex} Notice that the ideal of compact operators is left out of the above examples. To include it in the mix, we first prove that separable ideals have property (M). \begin{prop}[\textbf{Separable Ideals}]\label{prop.sep} Let $(\mathcal{I},\|\cdot\|_{\mathcal{I}}) \unlhd \mathcal{M}$. If $(\mathcal{I},\|\cdot\|_{\mathcal{I}})$ is separable, then $\mathcal{I}$ has property (M). In particular, if $(\mathcal{I},\|\cdot\|_{\mathcal{I}}) \unlhd_{\mathrm{s}} \mathcal{M}$ is separable, then $\mathcal{I}$ is integral symmetrically normed. \end{prop} \begin{proof} To prove this, we make use of the basic theory of the Bochner integral; please see, for instance, Appendix E of \cite{cohn} or Section II.2 of \cite{diesteluhl} for the relevant background. Let $(\Sigma,\mathscr{H},\rho)$ be a measure space, $F \colon \Sigma \to \mathcal{I} \subseteq \mathcal{M}$ be weak$^*$ measurable, and $h,k \in H$. Now, define $\ell_{h,k} \colon \mathcal{I} \to \mathbb{C}$ by $r \mapsto \langle rh,k \rangle$. Since the inclusion $\iota_{\mathcal{I}} \colon (\mathcal{I},\|\cdot\|_{\mathcal{I}}) \hookrightarrow (\mathcal{M},\|\cdot\|)$ is bounded, $\ell_{h,k}$ is a continuous function $\mathcal{I} \to \mathbb{C}$. Also, $\ell_{h,k} \circ F = \langle F(\cdot)h,k \rangle \colon \Sigma \to \mathbb{C}$ is measurable by assumption. Since the collection $\{\ell_{h,k} : h,k \in H\}$ clearly separates points, we conclude from the (completeness and) separability of $\mathcal{I}$ and Proposition 1.10 in Chapter I of \cite{vakhania} that $F \colon \Sigma \to (\mathcal{I},\|\cdot\|_{\mathcal{I}})$ is Borel measurable. Using again the separability of $\mathcal{I}$, this implies $F \colon \Sigma \to (\mathcal{I},\|\cdot\|_{\mathcal{I}})$ is Bochner (or ``strongly") measurable. Therefore, if in addition \[ \underline{\int_{\Sigma}} \|F\|_{\mathcal{I}} \, d\rho = \int_{\Sigma} \|F\|_{\mathcal{I}} \,d\rho < \infty, \] then $F \colon \Sigma \to (\mathcal{I},\|\cdot\|_{\mathcal{I}})$ is also Bochner integrable, and -- by applying $\ell_{h,k}$ to the Bochner integral -- the Bochner and weak$^*$ integrals of $F$ agree. Thus \[ \int_{\Sigma} F \, d\rho \in \mathcal{I} \; \text{ and } \; \Bigg\|\int_{\Sigma} F \, d\rho\Bigg\|_{\mathcal{I}} \leq \int_{\Sigma}\|F\|_{\mathcal{I}} \, d\rho, \] by the triangle inequality for Bochner integrals. We conclude that $\mathcal{I}$ has property (M). \end{proof} In particular, if $H$ is separable, then the ideal $\mathcal{K}(H) \unlhd_{\mathrm{s}} B(H)$ of compact operators $H \to H$ has property (M). Actually, this also implies the non-separable case by an argument suggested by Junekey Jeon. \begin{lem}\label{lem.compact} For a closed linear subspace $K \subseteq H$, write $\iota_K \colon K \to H$ and $\pi_K \colon H \to K$ for, respectively, the inclusion of and the orthogonal projection onto $K$. Let $A \in B(H)$. Then $A \in \mathcal{K}(H)$ if and only if $A_K \coloneqq \pi_K A \iota_K \in \mathcal{K}(K)$, for all closed, separable linear subspaces $K \subseteq H$. \end{lem} \begin{proof} The ``only if" direction is clear. For the ``if" direction, suppose that $A_K = \pi_K A \iota_K \in \mathcal{K}(K)$, for all closed, separable linear subspaces $K \subseteq H$. If $(h_n)_{n \in \mathbb{N}}$ is a bounded sequence in $H$, then set \[ K \coloneqq \overline{\spn}\{A^kh_n : k \in \mathbb{N}_0,\,n \in \mathbb{N}\}. \] Of course, $K$ is a separable, closed linear subspace of $H$ that contains $\{h_n : n \in \mathbb{N}\}$ and is invariant under $A$. Since $A_K$ is compact, there is a subsequence $(h_{n_k})_{k \in \mathbb{N}}$ such that $(A_Kh_{n_k})_{k \in \mathbb{N}}$ converges. But \[ A_Kh_{n_k} = \pi_KAh_{n_k} = Ah_{n_k}, \] for all $k \in \mathbb{N}$, since $K$ is $A$-invariant. We conclude $A \in \mathcal{K}(H)$. \end{proof} \begin{prop}[\textbf{Compact Operators}]\label{prop.compact} $(\mathcal{K}(H),\|\cdot\|) \unlhd_{\mathrm{s}} \mathcal{M}$ has property (M). In particular, $\mathcal{K}(H)$ is integral symmetrically normed. \end{prop} \begin{proof} Let $(\Sigma,\mathscr{H},\rho)$ be a measure space and $F \colon \Sigma \to \mathcal{K}(H) \subseteq B(H)$ be weak$^*$ measurable with \[ \underline{\int_{\Sigma}}\|F\|\,d\rho < \infty. \] Since we already know the triangle inequality for the operator norm, it suffices to prove $\int_{\Sigma} F \, d\rho \in \mathcal{K}(H)$. To this end, let $K \subseteq H$ be a closed, separable linear subspace. Then, in the notation of Lemma \ref{lem.compact}, $F_K = \pi_KF(\cdot) \iota_K \colon \Sigma \to \mathcal{K}(K) \subseteq B(K)$ is weak$^*$ measurable and \[ \underline{\int_{\Sigma}}\|F_K\|\,d\rho \leq \underline{\int_{\Sigma}}\|F\|\,d\rho < \infty. \] Since $\mathcal{K}(K)$ is separable, Proposition \ref{prop.sep} gives $\int_{\Sigma} F_K \, d\rho \in \mathcal{K}(K)$. Since \[ \Bigg(\int_{\Sigma} F\,d\rho \Bigg)_K = \pi_K\Bigg(\int_{\Sigma} F\,d\rho \Bigg) \iota_K = \int_{\Sigma} \pi_KF(\sigma)\,\iota_K \, \rho(d\sigma) = \int_{\Sigma} F_K\,d\rho \in \mathcal{K}(K), \] we conclude from Lemma \ref{lem.compact} that $\int_{\Sigma} F \, d\rho \in \mathcal{K}(H)$. \end{proof} \begin{rem} In case one only wants to know $\mathcal{K}(H)$ is integral symmetrically normed, there is a different proof available that does not go through the separable case first. Indeed, let $(\Sigma,\mathscr{H},\rho)$ be a measure space and $A,B \colon \Sigma \to B(H)$ be as in \ref{def.idealproperties}.\ref{item.ISNI}. To prove the claim, it suffices to show that if $c \in \mathcal{K}(H)$, then $\int_{\Sigma}A(\sigma)\,c\,B(\sigma)\,\rho(d\sigma) \in \mathcal{K}(H)$. First, suppose $c$ has finite rank. Then $c \in \mathcal{S}_1(H)$. Since $(\mathcal{S}_1(H),\|\cdot\|_{\mathcal{S}_1}) \unlhd B(H)$ is integral symmetrically normed, $\int_{\Sigma} A(\sigma)\,c\,B(\sigma) \,\rho(d\sigma) \in \mathcal{S}_1(H) \subseteq \mathcal{K}(H)$. Now, if $c \in \mathcal{K}(H)$ is arbitrary, then -- using, for instance, the singular value decomposition -- there is a sequence $(c_n)_{n \in \mathbb{N}}$ of finite-rank linear operators $H \to H$ such that $\|c_n - c\| \to 0$ as $n \to \infty$. But then, by the operator norm triangle inequality, $\int_{\Sigma} A(\sigma)\,c_n\,B(\sigma)\,\rho(d\sigma) \to \int_{\Sigma} A(\sigma)\,c\,B(\sigma) \,\rho(d\sigma)$ in the operator norm topology as $n \to \infty$. Since this exhibits $\int_{\Sigma}A(\sigma)\,c\,B(\sigma)\,\rho(d\sigma)$ as an operator norm limit of compact operators, we conclude it is compact, as desired. \end{rem} \subsection{Examples of Ideals II}\label{sec.idealex2} \begin{conv} For the duration of this section, suppose $(\mathcal{M},\tau)$ is semifinite. \end{conv} At this point, we shall make heavy use of the theory reviewed in Section \ref{sec.symmopsp}. To begin, we note that if $(E,\|\cdot\|_E)$ is a symmetric space of $\tau$-measurable operators, then \[ (\mathcal{E},\|\cdot\|_{\mathcal{E}}) \coloneqq (E \cap \mathcal{M} , \|\cdot\|_{E \cap \mathcal{M}}) = (E \cap \mathcal{M} , \max\{\|\cdot\|_E,\|\cdot\|\}) \unlhd_{\mathrm{s}} \mathcal{M}. \] This follows from Proposition 17 in \cite{doddsNKS}. We call $\mathcal{E}$ the \textbf{ideal induced by $\boldsymbol{E}$}. In this section, we prove that ideals induced by fully symmetric spaces are integral symmetrically normed and that ideals induced by symmetric spaces with the Fatou property have property (M). \begin{thm}[\textbf{Fully Symmetric $\boldsymbol{\Rightarrow}$ Integral Symmetrically Normed}]\label{thm.FSISN} If $(E,\|\cdot\|_E)$ is a fully symmetric space, then $(\mathcal{E},\|\cdot\|_{\mathcal{E}}) \coloneqq (E \cap \mathcal{M} , \|\cdot\|_{E \cap \mathcal{M}}) \unlhd_{\mathrm{s}} \mathcal{M}$ is integral symmetrically normed. \end{thm} \begin{proof} Let $(\Sigma,\mathscr{H},\rho)$ be a measure space and $A,B \colon \Sigma \to \mathcal{M}$ be as in \ref{def.idealproperties}.\ref{item.ISNI}. Define $T_{\infty} \colon \mathcal{M} \to \mathcal{M}$ by \[ \mathcal{M} \ni c \mapsto \int_{\Sigma} A(\sigma)\,c\,B(\sigma) \,\rho(d\sigma) \in \mathcal{M}. \] Then $\|T_{\infty}\|_{\mathcal{M} \to \mathcal{M}} \leq \underline{\int_{\Sigma}}\|A\|\,\|B\|\,d\rho$ by the operator norm triangle inequality. Also, if $c \in L^1(\tau) \cap \mathcal{M}$, then \[ \|T_{\infty}c\|_{L^1(\tau)} \leq \underline{\int_{\Sigma}}\|A(\sigma)\,c\,B(\sigma)\|_{L^1(\tau)} \, \rho(d\sigma) \leq \|c\|_{L^1(\tau)} \underline{\int_{\Sigma}}\|A\|\,\|B\|\,d\rho \] by Theorem \ref{thm.Lpinteg}. Since $L^1(\tau) \cap \mathcal{M}$ is dense in $L^1(\tau)$, we get that $T_{\infty}|_{L^1(\tau) \cap \mathcal{M}}$ extends uniquely to a bounded linear map $T_1 \colon L^1(\tau) \to L^1(\tau)$ with \[\pagebreak \|T_1\|_{L^1(\tau)\to L^1(\tau)} \leq \underline{\int_{\Sigma}}\|A\|\,\|B\|\,d\rho. \] Since $T_{\infty}$ and $T_1$ agree on $L^1(\tau) \cap \mathcal{M}$, we obtain a well-defined linear map $T \colon L^1(\tau) + \mathcal{M} \to L^1(\tau) + \mathcal{M}$ by setting $T(x+y) \coloneqq T_1x+T_{\infty}y$ for $x \in L^1(\tau)$ and $y \in \mathcal{M}$. Moreover, \[ \|T\|_{L^1(\tau)+\mathcal{M} \to L^1(\tau)+\mathcal{M}} \leq \max\{\|T_1\|_{L^1(\tau)\to L^1(\tau)},\|T_{\infty}\|_{\mathcal{M} \to \mathcal{M}}\} \leq \underline{\int_{\Sigma}}\|A\|\,\|B\|\,d\rho. \] By Proposition 4.1 in \cite{doddsNKD}, this implies \[ Tc \pprec \Bigg(\underline{\int_{\Sigma}}\|A\|\,\|B\|\,d\rho\Bigg)c, \, \text{ for all } c \in L^1(\tau)+\mathcal{M}. \] In particular, if $c \in E \subseteq L^1(\tau)+\mathcal{M}$, then $Tc \in E$ and \[ \|Tc\|_E \leq \|c\|_E\underline{\int_{\Sigma}}\|A\|\,\|B\|\,d\rho \] because $E$ is fully symmetric; in other words, $T$ restricts to a bounded linear map $T_E \colon E \to E$ with $\|T_E\|_{E \to E} \leq \underline{\int_{\Sigma}}\|A\|\,\|B\|\,d\rho$. We conclude that if $c \in \mathcal{E} = E \cap \mathcal{M}$, then \[ \int_{\Sigma} A(\sigma) \, c \, B(\sigma) \,\rho(d\sigma) = T_{\infty}c = T_Ec \in \mathcal{E} \; \text{ and } \; \Bigg\|\int_{\Sigma} A(\sigma) \, c \, B(\sigma) \, \rho(d\sigma) \Bigg\|_{\mathcal{E}} \leq \|c\|_{\mathcal{E}}\underline{\int_{\Sigma}}\|A\|\,\|B\|\,d\rho. \] Thus $\mathcal{E}$ is integral symmetrically normed. \end{proof} \begin{rem} The argument above is inspired in part by Section 4.4 of \cite{doddssub2}. \end{rem} The second main result of this section upgrades Theorem \ref{thm.FSISN} when the symmetric space in question is a K\"{o}the dual. (It also generalizes Theorem \ref{thm.Lpinteg}.) \begin{thm}[\textbf{K\"{o}the Duals and Property (M)}]\label{thm.KothePropM} Let $(E,\|\cdot\|_E)$ be a strongly symmetric space with $c_E = 1$. If $(\Sigma,\mathscr{H},\rho)$ is a measure space and $F \colon \Sigma \to \mathcal{M}$ is weak$^*$ integrable, then \[ \Bigg\|\int_{\Sigma} F\,d\rho \Bigg\|_{E^{\times}} \leq \underline{\int_{\Sigma}} \|F\|_{E^{\times}} \,d\rho. \] In particular, $(\mathcal{E}^{\times},\|\cdot\|_{\mathcal{E}^{\times}}) \coloneqq (E^{\times} \cap \mathcal{M},\|\cdot\|_{E^{\times}\cap \mathcal{M}}) \unlhd_{\mathrm{s}} \mathcal{M}$ has property (M). \end{thm} \begin{proof} Let $a \coloneqq \int_{\Sigma} F \,d\rho \in \mathcal{M}$. By Fact \ref{fact.Kothedual} (twice) and Theorem \ref{thm.Lpinteg}, we have \begin{align*} \Bigg\|\int_{\Sigma} F\,d\rho\Bigg\|_{E^{\times}} & = \|a\|_{E^{\times}} = \sup\{\tau(|ab|) : b \in \mathcal{L}^1(\tau), \, \|b\|_E \leq 1\} \\ & = \sup\Bigg\{\Bigg\|\int_{\Sigma} F(\sigma)\,b\,\rho(d\sigma) \Bigg\|_{L^1(\tau)} : b \in \mathcal{L}^1(\tau), \, \|b\|_E \leq 1\Bigg\} \\ & \leq \sup\Bigg\{\underline{\int_{\Sigma}} \|F(\sigma)\,b\|_{L^1(\tau)}\,\rho(d\sigma) : b \in \mathcal{L}^1(\tau), \, \|b\|_E \leq 1\Bigg\} \leq \underline{\int_{\Sigma}}\|F\|_{E^{\times}}\,d\rho, \end{align*} as desired. \end{proof} \begin{cor}\label{cor.KbidualMink} Let $(E,\|\cdot\|_E)$ be a strongly symmetric space with $c_E = 1$. If $(\Sigma,\mathscr{H},\rho)$ is a measure space, $F \colon \Sigma \to \mathcal{M}$ is weak$^*$ integrable, and $F(\Sigma) \subseteq E \cap \mathcal{M}$, then \[ \Bigg\|\int_{\Sigma} F\,d\rho \Bigg\|_{E^{\times \times}} \leq \underline{\int_{\Sigma}} \|F\|_E \,d\rho. \] In particular, by Fact \ref{fact.Kothedual}, if the right hand side is finite, then $\int_{\Sigma} F \,d\rho \in E^{\times\times}$. \end{cor} \begin{proof} Applying Theorem \ref{thm.KothePropM} to the space $E^{\times\times} = (E^{\times})^{\times}$ and using that $\|\cdot\|_{E^{\times\times}} \leq \|\cdot\|_E$ on $E$, we get \[ \Bigg\|\int_{\Sigma} F\,d\rho \Bigg\|_{E^{\times \times}} \leq \underline{\int_{\Sigma}} \|F\|_{E^{\times\times}}\,d\rho \leq \underline{\int_{\Sigma}} \|F\|_E \,d\rho, \] as desired. \end{proof} \begin{rem} Please see equation (0.5) in Section II.0.3 of \cite{kreininterp} for a classical analogue of this Minkowski-type integral inequality. \end{rem} Combining the Noncommutative Lorentz-Luxemburg Theorem with Corollary \ref{cor.KbidualMink}, we get the following. \begin{thm}[\textbf{Fatou Property $\boldsymbol{\implies}$ Property (M)}]\label{thm.KRpropM} Let $(E,\|\cdot\|_E)$ be a strongly symmetric space with $c_E = 1$. Suppose $(\Sigma,\mathscr{H},\rho)$ is a measure space, $F \colon \Sigma \to \mathcal{M}$ is weak$^*$ integrable, and $F(\Sigma) \subseteq E \cap \mathcal{M}$. If $E$ has the Fatou property and $\underline{\int_{\Sigma}} \|F\|_E \,d\rho < \infty$, then \[ \int_{\Sigma} F \,d\rho \in E \; \text{ and } \; \Bigg\|\int_{\Sigma} F\,d\rho \Bigg\|_E \leq \underline{\int_{\Sigma}} \|F\|_E \,d\rho. \] In particular, $(\mathcal{E},\|\cdot\|_{\mathcal{E}}) \coloneqq (E \cap \mathcal{M},\|\cdot\|_{E \cap \mathcal{M}}) \unlhd_{\mathrm{s}} \mathcal{M}$ has property (M). \end{thm} \begin{proof} By the Noncommutative Lorentz-Luxemburg Theorem (Theorem \ref{thm.ncll}), $(E,\|\cdot\|_E) = (E^{\times\times},\|\cdot\|_{E^{\times\times}})$. Therefore, by Corollary \ref{cor.KbidualMink}, we know $\int_{\Sigma} F \,d\rho \in E^{\times\times} = E$ and \[ \Bigg\|\int_{\Sigma} F\,d\rho \Bigg\|_E = \Bigg\|\int_{\Sigma} F\,d\rho \Bigg\|_{E^{\times \times}} \leq \underline{\int_{\Sigma}} \|F\|_E \,d\rho, \] as desired. \end{proof} \subsection{Comments about Property (F)}\label{sec.propF} A Banach ideal $(\mathcal{I},\|\cdot\|_{\mathcal{I}}) \unlhd \mathcal{M}$ has (the \textbf{sequential}) \textbf{property (F)} if whenever $a \in \mathcal{M}$ and $(a_j)_{j \in J}$ is a net (sequence) in $\mathcal{I}$ such that $\sup_{j \in J}\|a_j\|_{\mathcal{I}} < \infty$ and $a_j \to a$ in the S$^*$OT, we have $a \in \mathcal{I}$ and $\|a\|_{\mathcal{I}} \leq \sup_{j \in J}\|a_j\|_{\mathcal{I}}$. In \cite{azamovetal}, certain multiple operator integrals in invariant operator ideals with property (F) are considered. We now take some time to discuss the relationship between properties (M) and (F). First, there are certainly ideals with property (M) that do not have property (F), e.g., the ideal of compact operators (Proposition \ref{prop.compact}). Second, as mentioned in \cite{azamovetal}, the motivating example of an invariant operator ideal with property (F) is an ideal induced via Fact \ref{fact.Etau} by a (nonzero) symmertic Banach function space with the Fatou property. By Theorem \ref{thm.KRpropM} and Example \ref{ex.Fatou}, such ideals have property (M). Third, the author is unaware of an example of a symmetrically normed ideal with property (F) that does not have property (M). It would be interesting to know if such an ideal exists. In this context, it is worth discussing a technical issue in \cite{azamovetal} with the treatment of operator-valued integrals. For the rest of this section, assume $H$ is separable. It is implicitly assumed in the proof of (the second sentence of) Lemma 4.6 in \cite{azamovetal} that at least some form of the integral triangle inequality holds for the $\mathcal{I}$-norm $\|\cdot\|_{\mathcal{I}}$ when $\mathcal{I}$ has property (F). Specifically, it seems to be assumed that if $(\Sigma,\mathscr{H},\rho)$ is a finite measure space and $F \colon \Sigma \to \mathcal{I} \subseteq \mathcal{M}$ is $\|\cdot\|_{\mathcal{I}}$-bounded and weak$^*$ measurable, then \[ \int_{\Sigma} F\,d\rho \in \mathcal{I} \; \text{ and } \; \Bigg\|\int_{\Sigma} F\,d\rho\Bigg\|_{\mathcal{I}} \leq \int_{\Sigma}\|F\|_{\mathcal{I}}\,d\rho \] (ignoring that $\|F\|_{\mathcal{I}}$ may not be measurable). Let us call this the \textbf{finite property (M)}. Then we may rephrase the implicit claim as ``property (F) implies the finite property (M)." As far as the author can tell, the arguments in \cite{azamovetal} are only sufficient to prove \[ \int_{\Sigma} F\,d\rho \in \mathcal{I} \; \text{ and } \; \Bigg\|\int_{\Sigma} F\,d\rho\Bigg\|_{\mathcal{I}} \leq \rho(\Sigma)\,\sup_{\sigma \in \Sigma}\|F(\sigma)\|_{\mathcal{I}}. \] Indeed, the authors of \cite{azamovetal} prove that $\mathcal{I}$ has property (F) if and only if $\mathcal{I}_1 = \{r \in \mathcal{I} : \|r\|_{\mathcal{I}} \leq 1\}$ is a complete, separable metric space in the strong$^*$ operator topology and then apply Propositions 1.9-10 in Chapter I of \cite{vakhania} to approximate $F$ by simple functions in the strong$^*$ operator topology. Crucially, Propositions 1.9-10 in \cite{vakhania} only guarantee the existence of a sequence $(F_n)_{n \in \mathbb{N}}$ of simple functions $\Sigma \to \mathcal{I}$ such that $\sup_{\sigma \in \Sigma} \|F_n(\sigma)\|_{\mathcal{I}} \leq \sup_{\sigma \in \Sigma}\|F(\sigma)\|_{\mathcal{I}}$, for all $n \in \mathbb{N}$, and $F_n \to F$ pointwise in the strong$^*$ operator topology as $n \to \infty$. Now, by Proposition \ref{prop.opDCT}, \[ \int_{\Sigma} F_n \, d\rho \to \int_{\Sigma} F\,d\rho \] in the strong$^*$ operator topology as $n \to \infty$. Also, by the (obvious) triangle inequality for integrals of simple functions, if $k \in \mathbb{N}$, then \[ \sup_{n \geq k}\Bigg\|\int_{\Sigma} F_n\,d\rho\Bigg\|_{\mathcal{I}} \leq \sup_{n \geq k}\int_{\Sigma} \|F_n\|_{\mathcal{I}} \,d\rho \leq \int_{\Sigma} \sup_{n \geq k} \|F_n\|_{\mathcal{I}} \, d\rho \leq \rho(\Sigma) \,\sup_{\sigma \in \Sigma}\|F(\sigma)\|_{\mathcal{I}}. \] Thus (the sequential) property (F) and the Dominated Convergence Theorem give \[ \int_{\Sigma} F \, d\rho \in \mathcal{I} \; \text{ and } \; \Bigg\|\int_{\Sigma} F\,d\rho \Bigg\|_{\mathcal{I}} \leq \int_{\Sigma} \limsup_{n \to \infty} \|F_n\|_{\mathcal{I}} \,d\rho \leq \rho(\Sigma) \,\sup_{\sigma \in \Sigma}\|F(\sigma)\|_{\mathcal{I}}. \numberthis\label{eq.propFestim} \] The definition of property (F) does \textit{not} guarantee that $\|F_n(\sigma)\|_{\mathcal{I}} \to \|F(\sigma)\|_{\mathcal{I}}$ as $n \to \infty$, so we cannot evaluate the limit superior above much further without an upgraded version of property (F). (Interestingly, this does not damage the applications in \cite{azamovetal}, since it seems only the estimate \eqref{eq.propFestim} is used seriously.) It therefore seems that property (F) \textit{almost} implies some weaker form of property (M) -- but perhaps not quite. \begin{rem} Though we centered the discussion above on the ``finite property (M)," it is worth pointing out that in order to prove Lemma 4.6 in \cite{azamovetal}, it would actually be sufficient to know the following ``finite integral symmetrically normed" condition: for every finite measure space $(\Sigma,\mathscr{H},\rho)$ and $\|\cdot\|$-bounded, weak$^*$ measurable $A,B \colon \Sigma \to \mathcal{M}$, we have that \[ \int_{\Sigma}A(\sigma)\,r\,B(\sigma) \,\rho(d\sigma) \in \mathcal{I} \; \text{ and} \; \Bigg\|\int_{\Sigma}A(\sigma)\,r\,B(\sigma)\,\rho(d\sigma)\Bigg\|_{\mathcal{I}} \leq \|r\|_{\mathcal{I}}\underline{\int_{\Sigma}}\|A\|\,\|B\|\,d\rho, \] for all $r \in \mathcal{I}$. As mentioned, in the presence of property (F), we would already know $\int_{\Sigma} A(\sigma)\,r\,B(\sigma)\,\rho(d\sigma) \in \mathcal{I}$, so -- as was the case above -- it is really the integral triangle inequality that is potentially missing. \end{rem} \section{Differentiating Operator Functions}\label{sec.derivopfunc} \subsection{Multiple Operator Integrals (MOIs) in Ideals}\label{sec.MOIsinI} We begin with a review of some information from \cite{nikitopoulosMOI} about (a simplified version of) the ``separation of variables" approach to defining multiple operator integrals. \begin{conv} Fix $k \in \mathbb{N}$ and, for each $j \in \{1,\ldots,k+1\}$, a projection-valued measure space $(\Om_j,\mathscr{F}_j,H,P_j)$ such that $P_j(G) \in \mathcal{M}$ whenever $G \in \mathscr{F}_j$. Also, write \[ (\Om,\mathscr{F}) \coloneqq (\Om_1 \times \cdots \times \Om_{k+1},\mathscr{F}_1 \otimes \cdots \otimes \mathscr{F}_{k+1}) \] for the product measurable space. \end{conv} \begin{defi}[\textbf{Integral Projective Tensor Products I}]\label{def.babyIPTP} Let $\varphi \colon \Om \to \mathbb{C}$ be a function. A $\boldsymbol{\ell^{\infty}}$\textbf{-integral projective decomposition} ($\ell^{\infty}$-IPD) of $\varphi$ is a choice $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ of a $\sigma$-finite measure space $(\Sigma,\mathscr{H},\rho)$ and measurable functions $\varphi_1 \colon \Om_1 \times \Sigma \to \mathbb{C},\ldots,\varphi_{k+1} \colon \Om_{k+1} \times \Sigma \to \mathbb{C}$ such that \begin{enumerate}[label=(\alph*),leftmargin=2\parindent] \item $\varphi_j(\cdot,\sigma) \in \ell^{\infty}(\Om_j,\mathscr{F}_j)$, for all $j \in \{1,\ldots,k+1\}$ and $\sigma \in \Sigma$; \label{item.nullset} \item $\overline{\int_{\Sigma}} \,\|\varphi_1(\cdot,\sigma)\|_{\ell^{\infty}(\Om_1)} \cdots \|\varphi_{k+1}(\cdot,\sigma)\|_{\ell^{\infty}(\Om_{k+1})} \, \rho(d\sigma) < \infty$; and\label{item.upperintegofphis} \item for all $\boldsymbol{\omega} = (\omega_1,\ldots,\omega_{k+1}) \in \Om$, we have $\varphi(\boldsymbol{\omega}) = \int_{\Sigma} \varphi_1(\omega_1,\sigma) \cdots \varphi_{k+1}(\omega_{k+1},\sigma) \, \rho(d\sigma)$.\label{item.equality}\pagebreak \end{enumerate} Now, define \begin{align*} \|\varphi\|_{\ell^{\infty}(\Om_1,\mathscr{F}_1) \hat{\otimes}_i \cdots \hat{\otimes}_i \ell^{\infty}(\Om_{k\hspace{-0.1mm}+\hspace{-0.1mm}1},\mathscr{F}_{k\hspace{-0.1mm}+\hspace{-0.1mm}1})} &\hspace{-0.25mm} \coloneqq\hspace{-0.15mm} \inf\hspace{-0.75mm}\Bigg\{\overline{\int_{\Sigma}}\hspace{-0.5mm} \|\varphi_1(\cdot,\sigma)\|_{\ell^{\infty}(\Om_1)}\hspace{-0.5mm}\cdots\hspace{-0.5mm}\|\varphi_{k+1}(\cdot,\sigma)\|_{\ell^{\infty}(\Om_{k\hspace{-0.1mm}+\hspace{-0.1mm}1})} \rho(d\sigma) : (\Sigma,\rho,\varphi_1,\ldots,\varphi_{k\hspace{-0.1mm}+\hspace{-0.1mm}1}\hspace{-0.1mm})\\ & \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \text{ is a } \ell^{\infty}\text{-integral projective decomposition of } \varphi\Bigg\}, \end{align*} where $\inf \emptyset \coloneqq \infty$. Finally, we define \[ \ell^{\infty}(\Om_1,\mathscr{F}_1) \hat{\otimes}_i \cdots \hat{\otimes}_i \ell^{\infty}(\Om_{k+1},\mathscr{F}_{k+1}) \coloneqq \{\varphi \in \ell^{\infty}(\Om,\mathscr{F}) : \|\varphi\|_{\ell^{\infty}(\Om_1,\mathscr{F}_1) \hat{\otimes}_i \cdots \hat{\otimes}_i \ell^{\infty}(\Om_{k+1},\mathscr{F}_{k+1})} < \infty\} \] to be the \textbf{integral projective tensor product of} $\boldsymbol{\ell^{\infty}(\Om_1,\mathscr{F}_1),\ldots,\ell^{\infty}(\Om_{k+1},\mathscr{F}_{k+1})}$. \end{defi} It is easy to see that $\|\cdot\|_{\ell^{\infty}(\Om)} \leq \|\cdot\|_{\ell^{\infty}(\Om_1,\mathscr{F}_1) \hat{\otimes}_i \cdots \hat{\otimes}_i \ell^{\infty}(\Om_{k+1},\mathscr{F}_{k+1})}$. Also, \[ \big(\ell^{\infty}(\Om_1,\mathscr{F}_1) \hat{\otimes}_i \cdots \hat{\otimes}_i \ell^{\infty}(\Om_{k+1},\mathscr{F}_{k+1}), \|\cdot\|_{\ell^{\infty}(\Om_1,\mathscr{F}_1) \hat{\otimes}_i \cdots \hat{\otimes}_i \ell^{\infty}(\Om_{k+1},\mathscr{F}_{k+1})}\big) \] is a Banach $\ast$-algebra under pointwise operations by a special case of Proposition 4.1.4 in \cite{nikitopoulosMOI}. (Please see Example 4.1.5 in \cite{nikitopoulosMOI} as well.) \begin{thm}[\textbf{Definition of MOIs}]\label{thm.MOIsinM} If $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ is a $\ell^{\infty}$-integral projective decomposition of $\varphi\in \ell^{\infty}(\Om_1,\mathscr{F}_1) \hat{\otimes}_i \cdots \hat{\otimes}_i \ell^{\infty}(\Om_{k+1},\mathscr{F}_{k+1})$ and $b_1,\ldots,b_k \in \mathcal{M}$, then the map \[ \Sigma \ni \sigma \mapsto P_1(\varphi_1(\cdot,\sigma))\,b_1 \cdots P_k(\varphi_k(\cdot,\sigma))\,b_k \,P_{k+1}(\varphi_{k+1}(\cdot,\sigma)) \in \mathcal{M} \] is weak$^*$ integrable, and the weak$^*$ integral \[ \big(I^{P_1,\ldots,P_{k+1}}\varphi\big)(b_1,\ldots,b_k) \coloneqq \int_{\Sigma}P_1(\varphi_1(\cdot,\sigma))\,b_1 \cdots P_k(\varphi_k(\cdot,\sigma))\,b_k \,P_{k+1}(\varphi_{k+1}(\cdot,\sigma))\,\rho(d\sigma) \in \mathcal{M} \] is independent of the chosen decomposition $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ of $\varphi$. Moreover, \[ \big\|\big(I^{P_1,\ldots,P_{k+1}}\varphi\big)(b_1,\ldots,b_k)\big\| \leq \|\varphi\|_{\ell^{\infty}(\Om_1,\mathscr{F}_1) \hat{\otimes}_i \cdots \hat{\otimes}_i \ell^{\infty}(\Om_{k+1},\mathscr{F}_{k+1})}\|b_1\|\cdots\|b_k\|, \] for all $b_1,\ldots,b_k \in \mathcal{M}$. Writing $\boldsymbol{P} = (P_1,\ldots,P_{k+1})$, we call $I^{\boldsymbol{P}}\varphi \colon \mathcal{M}^k \to \mathcal{M}$ the \textbf{multiple operator integral} (MOI) of $\varphi$ with respect to $\boldsymbol{P}$. \end{thm} This follows from Theorem 1.1.3 (plus equation (28)) in \cite{nikitopoulosMOI}. We shall also need to know that, in general, if $\varphi_j \colon \Om_j \times \Sigma \to \mathbb{C}$ is measurable and $\varphi_j(\cdot,\sigma) \in \ell^{\infty}(\Om_j,\mathscr{F}_j)$ whenever $j \in \{1,\ldots,k+1\}$ and $\sigma \in \Sigma$, then \[ \Sigma \ni \sigma \mapsto P_1(\varphi_1(\cdot,\sigma))\,b_1\cdots P_k(\varphi_k(\cdot,\sigma))\,b_k\,P_{k+1}(\varphi_{k+1}(\cdot,\sigma)) \in \mathcal{M} \] is weak$^*$ measurable, for all $b_1,\ldots,b_k \in \mathcal{M}$. This follows from a repeated application of Proposition 4.2.3 in \cite{nikitopoulosMOI}, and we shall use it in the sequel without further comment. \begin{nota} If $a_1,\ldots,a_{k+1} \aff \mathcal{M}_{\nu}$, $\boldsymbol{a} \coloneqq (a_1,\ldots,a_{k+1})$, and \[ \varphi \in \ell^{\infty}(\sigma(a_1),\mathcal{B}_{\sigma(a_1)})\hat{\otimes}_i \cdots \hat{\otimes}_i \ell^{\infty}(\sigma(a_{k+1}),\mathcal{B}_{\sigma(a_{k+1})}), \] then we write \[ \varphi(a_1,\ldots,a_{k+1})\text{\smaller $\#$} (b_1,\ldots,b_k) = \varphi(\boldsymbol{a}) \text{\smaller $\#$} b = \big(I^{\boldsymbol{a}}\varphi\big)(b) \coloneqq \big(I^{P^{a_1},\ldots,P^{a_{k+1}}}\varphi\big)(b_1,\ldots,b_k) \in \mathcal{M}, \] for all $b = (b_1,\ldots,b_k) \in \mathcal{M}^k$. \end{nota} \begin{rem} Please see Remark 4.2.15 in \cite{nikitopoulosMOI} for an explanation of the use of the $\text{\smaller $\#$}$ symbol above. Also, please be aware that $T_{\varphi}^{a_1,\ldots,a_{k+1}}$ is a more common notation for $I^{a_1,\ldots,a_{k+1}}\varphi$. \end{rem} The following are two algebraic properties of MOIs that we shall use. They are proven as part of Proposition 4.3.1 in \cite{nikitopoulosMOI}. \pagebreak \begin{prop}[\textbf{Algebraic Properties of MOIs}]\label{prop.linandmult} Suppose $1 \leq m \leq k$. \begin{enumerate}[label=(\roman*),leftmargin=2\parindent] \item If $\varphi,\psi \in \ell^{\infty}(\Om_1,\mathscr{F}_1) \hat{\otimes}_i \cdots \hat{\otimes}_i \ell^{\infty}(\Om_{k+1},\mathscr{F}_{k+1})$ and $\alpha \in \mathbb{C}$, then $I^{\boldsymbol{P}}(\varphi+\alpha\,\psi) = I^{\boldsymbol{P}}\varphi+\alpha\,I^{\boldsymbol{P}}\psi$.\label{item.lin} \item If $\psi \in \ell^{\infty}(\Om_m,\mathscr{F}_m) \hat{\otimes}_i \ell^{\infty}(\Om_{m+1},\mathscr{F}_{m+1})$, \[ \tilde{\psi}(\omega_1,\ldots,\omega_{k+1}) \coloneqq \psi(\omega_m,\omega_{m+1}) \] for $(\omega_1,\ldots,\omega_{k+1}) \in \Om$, and $\varphi \in \ell^{\infty}(\Om_1,\mathscr{F}_1) \hat{\otimes}_i \cdots \hat{\otimes}_i \ell^{\infty}(\Om_{k+1},\mathscr{F}_{k+1})$, then \[ \big(I^{P_1,\ldots,P_{k+1}}(\varphi\tilde{\psi})\big)(b_1,\ldots,b_k) = \big(I^{P_1,\ldots,P_{k+1}}\varphi\big)\big(b_1,\ldots,b_{m-1},\big(I^{P_m,P_{m+1}}\psi\big)(b_m),b_{m+1},\ldots,b_k\big), \] for all $(b_1,\ldots,b_k) \in \mathcal{M}^k$.\label{item.mult2} \end{enumerate} \end{prop} Finally, we restrict the MOI in Theorem \ref{thm.MOIsinM} to certain ideals of $\mathcal{M}$. \begin{defi}[\textbf{MOI-Friendly Ideals}]\label{def.MOIfriendly} Let $(\mathcal{I},\|\cdot\|_{\mathcal{I}}) \unlhd \mathcal{M}$. We say that $\mathcal{I}$ is \textbf{MOI-friendly} if whenever we are in the setup of Theorem \ref{thm.MOIsinM} and $j \in \{1,\ldots,k\}$, the MOI $I^{\boldsymbol{P}}\varphi \colon \mathcal{M}^k \to \mathcal{M}$ restricts to a bounded $k$-linear map (Notation \ref{nota.bddmultilin}) \[ (\mathcal{M},\|\cdot\|)^{j-1} \times (\mathcal{I},\|\cdot\|_{\mathcal{I}}) \times (\mathcal{M},\|\cdot\|)^{k-j} \to (\mathcal{I},\|\cdot\|_{\mathcal{I}}) \] with operator norm at most $\|\varphi\|_{\ell^{\infty}(\Om_1,\mathscr{F}_1) \hat{\otimes}_i \cdots \hat{\otimes}_i \ell^{\infty}(\Om_{k+1},\mathscr{F}_{k+1})}$. In this case, $I^{\boldsymbol{P}}\varphi$ also restricts to a bounded $k$-linear map $(\mathcal{I},\|\cdot\|_{\mathcal{I}})^k \to (\mathcal{I},\|\cdot\|_{\mathcal{I}})$ with operator norm at most $C_{\mathcal{I}}^{k-1}\|\varphi\|_{\ell^{\infty}(\Om_1,\mathscr{F}_1) \hat{\otimes}_i \cdots \hat{\otimes}_i \ell^{\infty}(\Om_{k+1},\mathscr{F}_{k+1})}$. \end{defi} This definition may seem contrived, but the following shows that all the examples of ideals from Sections \ref{sec.idealex1} and \ref{sec.idealex2} are MOI-friendly. \begin{prop}\label{prop.MOIfriendly} If $(\mathcal{I},\|\cdot\|_{\mathcal{I}}) \unlhd \mathcal{M}$ is integral symmetrically normed, then $\mathcal{I}$ is MOI-friendly. \end{prop} \begin{proof} Suppose that $\mathcal{I}$ is integral symmetrically normed and that we are in the setup of Theorem \ref{thm.MOIsinM}. Let $j \in \{1,\ldots,k\}$, $b = (b_1,\ldots,b_k) \in \mathcal{M}^{j-1} \times \mathcal{I} \times \mathcal{M}^{k-j}$, and $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ be a $\ell^{\infty}$-integral projective decomposition of $\varphi \in \ell^{\infty}(\Om_1,\mathscr{F}_1) \hat{\otimes}_i \cdots \hat{\otimes}_i \ell^{\infty}(\Om_{k+1},\mathscr{F}_{k+1})$. Now, we apply the definition of integral symmetrically normed with \begin{align*} A(\sigma) & \coloneqq \Bigg(\prod_{j_1=1}^{j-1}P_{j_1}(\varphi_{j_1}(\cdot,\sigma))\,b_{j_1}\Bigg)P_j(\varphi_j(\cdot,\sigma)) \, \text{ and} \\ B(\sigma) & \coloneqq P_{j+1}(\varphi_{j+1}(\cdot,\sigma))\prod_{j_2=j+2}^{k+1}b_{j_2-1}P_{j_2}(\varphi_{j_2}(\cdot,\sigma)), \end{align*} where empty products are the identity. This yields $\big(I^{\boldsymbol{P}}\varphi\big)(b) = \int_{\Sigma} A(\sigma)\,b_j\,B(\sigma)\,\rho(d\sigma) \in \mathcal{I}$ and \[ \big\|\big(I^{\boldsymbol{P}}\varphi\big)(b)\big\|_{\mathcal{I}} \leq \|b_j\|_{\mathcal{I}}\underline{\int_{\Sigma}}\|A\|\,\|B\|\,d\rho \leq \|b_j\|_{\mathcal{I}}\prod_{p \neq j}\|b_p\|\underline{\int_{\Sigma}}\|\varphi_1(\cdot,\sigma)\|_{\ell^{\infty}(\Om_1)}\cdots\|\varphi_{k+1}(\cdot,\sigma)\|_{\ell^{\infty}(\Om_{k+1)}}\,\rho(d\sigma). \] Using $\underline{\int_{\Sigma}} \leq \overline{\int_{\Sigma}}$ and taking the infimum over all $\ell^{\infty}$-IPDs $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ of $\varphi$ gives the desired result. \end{proof} \subsection{Divided Differences and Perturbation Formulas}\label{sec.divdiffandpert} Our goal is to differentiate operator functions in integral symmetrically normed ideals. As is common practice, we begin by proving ``perturbation formulas." We shall use a generalization of the argument from the proof of Theorem 1.2.3 in \cite{peller2}. First, we review divided differences. \begin{defi}[\textbf{Divided Differences}]\label{def.divdiff} Let $f \colon \mathbb{R} \to \mathbb{C}$ be a function. Define $f^{[0]} \coloneqq f$ and for $k \in \mathbb{N}$ and distinct $\lambda_1,\ldots,\lambda_{k+1} \in \mathbb{R}$, inductively define \[ f^{[k]}(\lambda_1,\ldots,\lambda_{k+1}) \coloneqq \frac{f^{[k-1]}(\lambda_1,\ldots,\lambda_k) - f^{[k-1]}(\lambda_1,\ldots,\lambda_{k-1},\lambda_{k+1})}{\lambda_k-\lambda_{k+1}}. \] We call $f^{[k]}$ the $\boldsymbol{k^{\textbf{th}}}$ \textbf{divided difference} of $f$. \end{defi} For example, if $\lambda_1,\lambda_2 \in \mathbb{R}$ are distinct, then \[ f^{[1]}(\lambda_1,\lambda_2) = \frac{f(\lambda_1)-f(\lambda_2)}{\lambda_1-\lambda_2} = \frac{f(\lambda_1)}{\lambda_1 - \lambda_2}+\frac{f(\lambda_2)}{\lambda_2 - \lambda_1}. \] In general, if $\lambda_1,\ldots,\lambda_{k+1} \in \mathbb{R}$ are distinct, then \[ f^{[k]}(\lambda_1,\ldots,\lambda_{k+1}) = \sum_{j=1}^{k+1}\frac{f(\lambda_j)}{\prod_{\ell \neq j}(\lambda_j-\lambda_{\ell})}. \] Notice $f^{[k]}$ is symmetric in its arguments. As we shall see shortly, if in addition $f \in C^k(\mathbb{R})$, then $f^{[k]}$ extends uniquely to a continuous function defined on all of $\mathbb{R}^{k+1}$. \begin{nota} Let $m \in \mathbb{N}$, and define \begin{align*} \Sigma_m & \coloneqq \Bigg\{(s_1,\ldots,s_m) \in \mathbb{R}^m : s_j \geq 0 \text{ for } 1 \leq j \leq m \text{ and } \sum_{j=1}^m s_j \leq 1\Bigg\} \text{ and } \\ \Delta_m & \coloneqq \Bigg\{(t_1,\ldots,t_{m+1}) \in \mathbb{R}^{m+1} : t_j \geq 0 \text{ for } 1 \leq j \leq m+1 \text{ and } \sum_{j=1}^{m+1}t_j = 1\Bigg\}. \end{align*} Denote by $\rho_m$ the pushforward of the restriction to $\Sigma_m$ of the $m$-dimensional Lebesgue measure by the homeomorphism $\Sigma_m \ni (s_1,\ldots,s_m) \mapsto (s_1,\ldots,s_m,1-s_1-\cdots-s_m) \in \Delta_m$. \end{nota} Explicitly, $\rho_m$ is the finite Borel measure on $\Delta_m$ such that \[ \int_{\Delta_m} \varphi(\boldsymbol{t}) \, \rho_m(d\boldsymbol{t}) = \int_{\Sigma_m} \varphi(s_1,\ldots,s_m,1-s_1-\cdots-s_m) \, ds_1\cdots ds_m, \] for all $\varphi \in \ell^{\infty}(\Delta_m,\mathcal{B}_{\Delta_m})$. In particular, $\rho_m(\Delta_m) = \frac{1}{m!}$. The following is proven using Taylor's Theorem (or the Fundamental Theorem of Calculus) and induction. \begin{prop}\label{prop.divdiffCk} If $k \in \mathbb{N}$, $f \in C^k(\mathbb{R})$, and $\lambda_1,\ldots,\lambda_{k+1} \in \mathbb{R}$ are distinct, then \[ f^{[k]}(\boldsymbol{\lambda}) = \int_{\Delta_k}f^{(k)}(\boldsymbol{t} \cdot \boldsymbol{\lambda}) \, \rho_k(d\boldsymbol{t}), \] where $\boldsymbol{\lambda} \coloneqq (\lambda_1,\ldots,\lambda_{k+1})$ and $\cdot$ is the Euclidean dot product. In particular, $f^{[k]}$ extends uniquely to a symmetric continuous function on all of $\mathbb{R}^{k+1}$. We shall use the same notation for this extended function. \end{prop} With this under our belts, we move on to proving perturbation formulas. \begin{conv} For the rest of this section, fix a complex Hilbert space $(H,\langle \cdot,\cdot \rangle)$. \end{conv} \begin{lem}\label{lem.approxbybdd} Fix $k \in \mathbb{N}$ and $a_1,\ldots,a_{k+1} \in C(H)_{\sa}$. For $j \in \{1,\ldots,k+1\}$ and $n \in \mathbb{N}$, define \[ a_{j,n} \coloneqq a_jP^{a_j}([-n,n]) = \chi_n(a_j) \in B(H)_{\sa}, \] where $\chi_n(t) \coloneqq t\,1_{[-n,n]}(t)$ for $t \in \mathbb{R}$. If $\varphi \in \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}})^{\hat{\otimes}_i(k+1)}$ and $(b_{\cdot,n})_{n \in \mathbb{N}} = (b_{1,n},\ldots,b_{k,n})_{n \in \mathbb{N}}$ is a sequence in $B(H)^k$ converging in the (product) SOT to $b = (b_1,\ldots,b_k) \in B(H)^k$, then \[ \varphi(a_{1,n},\ldots,a_{k+1,n})\text{\smaller $\#$} b_{\cdot,n} \to \varphi(a_1,\ldots,a_{k+1}) \text{\smaller $\#$} b \] in the SOT as $n \to \infty$. \end{lem} \begin{proof} First, let $j \in \{1,\ldots,k+1\}$ and $n \in \mathbb{N}$. If $f \in \ell^0(\mathbb{R},\mathcal{B}_{\mathbb{R}})$, then \[ f(a_{j,n}) = f(\chi_n(a_j)) = (f \circ \chi_n)(a_j). \] Now, if $f$ is also bounded, then $\sup_{n \in \mathbb{N}} \|f\circ\chi_n\|_{\ell^{\infty}(\mathbb{R})} \leq \|f\|_{\ell^{\infty}(\mathbb{R})} < \infty$ and $f \circ \chi_n \to f \circ \id_{\mathbb{R}} = f$ pointwise as $n \to \infty$. Therefore, by Proposition \ref{prop.integP}.\ref{item.PintDCT}, $f(a_{j,n}) \to f(a_j)$ in the S$^*$OT as $n \to \infty$. \pagebreak Next, let $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ be a $\ell^{\infty}$-IPD of $\varphi$. By definition, \[ \varphi(a_{1,n},\ldots,a_{k+1,n})\text{\smaller $\#$} b_{\cdot,n} = \int_{\Sigma} \varphi_1(a_{1,n},\sigma)\,b_{1,n}\cdots\varphi_k(a_{k,n},\sigma)\,b_{k,n}\,\varphi_{k+1}(a_{k+1,n},\sigma)\, \rho(d\sigma) \] whenever $b = (b_1,\ldots,b_k) \in B(H)^k$. By the previous paragraph's observations, \[ \varphi_1(a_{1,n},\sigma)\,b_{1,n}\cdots\varphi_k(a_{k,n},\sigma)\,b_{k,n}\,\varphi_{k+1}(a_{k+1,n},\sigma) \to \varphi_1(a_1,\sigma)\,b_1\cdots\varphi_k(a_k,\sigma)\,b_k\,\varphi_{k+1}(a_{k+1},\sigma) \] in the SOT as $n \to \infty$, for all $\sigma \in \Sigma$. Since \begin{align*} & \overline{\int_{\Sigma}}\sup_{n \in \mathbb{N}} \|\varphi_1(a_{1,n},\sigma)\,b_{1,n}\cdots\varphi_k(a_{k,n},\sigma)\,b_{k,n}\,\varphi_{k+1}(a_{k+1,n},\sigma)\|\,\rho(d\sigma)\\ & \; \; \; \; \; \; \; \; \; \; \; \leq \sup_{n\in \mathbb{N}}(\|b_{1,n}\|\cdots\|b_{k,n}\|)\overline{\int_{\Sigma}}\|\varphi_1(\cdot,\sigma)\|_{\ell^{\infty}(\mathbb{R})}\cdots\|\varphi_{k+1}(\cdot,\sigma)\|_{\ell^{\infty}(\mathbb{R})}\,\rho(d\sigma) < \infty, \end{align*} the desired result follows from Proposition \ref{prop.opDCT} and the definition of $\varphi(a_1,\ldots,a_{k+1})\text{\smaller $\#$} b$. \end{proof} Before stating and proving our perturbation formulas, we make an observation that we shall use repeatedly. If $f \colon \mathbb{R} \to \mathbb{C}$ is Lipschitz, then there are constants $C_1,C_2 \geq 0$ such that $|f(\lambda)| \leq C_1|\lambda|+C_2$, for all $\lambda \in \mathbb{R}$. In particular, it follows from the definition of functional calculus and the Spectral Theorem that \[ \mathrm{dom}(a) \subseteq \mathrm{dom}(f(a)), \numberthis\label{eq.dom} \] for all $a \in C(H)_{\sa}$. \begin{nota}\label{nota.list} Let $S$ be a set, $m \in \mathbb{N}$, and $s = (s_1,\ldots,s_m) \in S^m$. If $j \in \{1,\ldots,m+1\}$, then \[ s_{j-} \coloneqq (s_1,\ldots,s_{j-1}) \in S^{j-1} \; \text{ and } \; s_{j+} \coloneqq (s_j,\ldots,s_m) \in S^{m+1-j}, \] where $s_{1-}$ and $s_{(m+1)+}$ are both the empty list. \end{nota} \begin{thm}[\textbf{Perturbation Formulas}]\label{thm.perturb} Fix $c \in B(H)_{\sa}$ and $a \in C(H)_{\sa}$. If $f \in C^1(\mathbb{R})$ is such that $f^{[1]} \in \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}}) \hat{\otimes}_i \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}})$, then \[ f(a+c)-f(a) = f^{[1]}(a+c,a)\text{\smaller $\#$} c \numberthis\label{eq.perturb0} \] More precisely, $f(a+c)-f(a)$ is densely defined and bounded, and $f^{[1]}(a+c,a)\text{\smaller $\#$} c$ is its unique bounded linear extension. Now, suppose $k \geq 2$, $b=(b_1,\ldots,b_{k-1}) \in B(H)_{\sa}^{k-1}$, and $\vec{a} = (a_1,\ldots,a_{k-1}) \in C(H)_{\sa}^{k-1}$. If $f \in C^k(\mathbb{R})$ is such that \[ f^{[k-1]} \in \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}})^{\hat{\otimes}_i k} \; \text{ and } \; f^{[k]} \in \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}})^{\hat{\otimes}_i (k+1)}, \] then \[ f^{[k-1]}(\vec{a}_{j-},a+c,\vec{a}_{j+})\text{\smaller $\#$} b - f^{[k-1]}(\vec{a}_{j-},a,\vec{a}_{j+})\text{\smaller $\#$} b = f^{[k]}(\vec{a}_{j-},a+c,a,\vec{a}_{j+})\text{\smaller $\#$}(b_{j-},c,b_{j+}) \numberthis\label{eq.perturbk} \] for all $j \in \{1,\ldots,k\}$. \end{thm} \begin{proof} We first make an important observation. Let $a \in C(H)_{\sa}$, $c \in B(H)_{\sa}$, and $n \in \mathbb{N}$. Now, define $p_n \coloneqq P^a([-n,n])$, $q_n \coloneqq P^{a+c}([-n,n])$, $a_n \coloneqq a\,p_n = \chi_n(a)$, and $d_n \coloneqq (a+c)\,q_n= \chi_n(a+c)$ in the notation of Lemma \ref{lem.approxbybdd}. If $\psi_1,\psi_2 \in \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}})$, then \begin{align*} q_n\,\psi_1(d_n)(d_n-a_n)\psi_2(a_n)\,p_n & = 1_{[-n,n]}(a+c)\,(\psi_1 \circ \chi_n)(a+c)\,(d_n-a_n)\,(\psi_2 \circ \chi_n)(a)\,1_{[-n,n]}(a) \\ & = ((\psi_1 \circ \chi_n)1_{[-n,n]})(a+c)\,(d_n-a_n)\,((\psi_2 \circ \chi_n)1_{[-n,n]})(a) \\ & = (\psi_1 \,1_{[-n,n]})(a+c)\,(d_n-a_n)\,(\psi_2 \,1_{[-n,n]})(a) \\ & = \psi_1(a+c)\,q_n\,(d_n-a_n)\,p_n\,\psi_2(a) = \psi_1(a+c)\,q_n\,c\,p_n\,\psi_2(a), \end{align*} where $q_n(d_n-a_n)p_n = q_nd_np_n - q_na_np_n = q_n(a+c)p_n - q_nap_n = q_ncp_n$ because $\im p_n \subseteq \mathrm{dom}(a) = \mathrm{dom}(a+c)$. We now begin in earnest. Let $f \in C^1(\mathbb{R})$ be such that $f^{[1]} \in \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}}) \hat{\otimes}_i \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}})$. Then \[ f(\lambda)-f(\mu) = f^{[1]}(\lambda,\mu)(\lambda-\mu), \numberthis\label{eq.keyperturbid1} \] for all $\lambda,\mu \in \mathbb{R}$. Now, let $a,c \in B(H)_{\sa}$. Since $\sigma(a)$ and $\sigma(a+c)$ are compact and $f \in C(\mathbb{R})$, the functions \begin{align*} \sigma(a+c)\times \sigma(a) \ni (\lambda,\mu) & \mapsto \psi(\lambda,\mu) = \lambda-\mu \in \mathbb{C} \, \text{ and} \\ \sigma(a+c)\times \sigma(a) \ni (\lambda,\mu) & \mapsto \varphi(\lambda,\mu) = f(\lambda)-f(\mu) \in \mathbb{C} \end{align*} belong to $\ell^{\infty}(\sigma(a+c),\mathcal{B}_{\sigma(a+c)}) \hat{\otimes}_i \ell^{\infty}(\sigma(a),\mathcal{B}_{\sigma(a)})$. By Proposition \ref{prop.linandmult}.\ref{item.mult2} and \eqref{eq.keyperturbid1}, we have \[ I^{a+c,a}\varphi = \big(I^{a+c,a}f^{[1]}\big)\circ \big(I^{a+c,a}\psi\big). \] Applying this to the identity $1 = \id_H \in B(H)$, we conclude \[ f(a+c) - f(a) = \big(I^{a+c,a}\varphi\big)(1) = \big(I^{a+c,a}f^{[1]}\big)\big( \big(I^{a+c,a}\psi\big)(1)\big) = \big(I^{a+c,a}f^{[1]}\big)(c) = f^{[1]}(a+c,a)\text{\smaller $\#$} c, \] as desired. For general $a \in C(H)_{\sa}$, we begin by showing $f(a+c)-f(a)$ is densely defined; specifically, we show $\mathrm{dom}(a) \subseteq \mathrm{dom}(f(a+c)-f(a))$. Indeed, since $f^{[1]} \in \ell^{\infty}(\mathbb{R}^2,\mathcal{B}_{\mathbb{R}^2})$, $f$ is Lipschitz on $\mathbb{R}$. By \eqref{eq.dom}, we have $\mathrm{dom}(a_0) \subseteq \mathrm{dom}(f(a_0))$, for all $a_0 \in C(H)_{\sa}$. In particular, since $\mathrm{dom}(a) = \mathrm{dom}(a+c)$, we get \[ \mathrm{dom}(a) = \mathrm{dom}(a) \cap \mathrm{dom}(a+c) \subseteq \mathrm{dom}(f(a+c))\cap \mathrm{dom}(f(a)) = \mathrm{dom}(f(a+c)-f(a)), \] as desired. Next, let $p_n$, $q_n$, $a_n$, and $d_n$ be as in the first paragraph. If $(\Sigma,\rho,\varphi_1,\varphi_2)$ is a $\ell^{\infty}$-IPD of $f^{[1]}$, then the results of the previous two paragraphs and Lemma \ref{lem.approxbybdd} give \begin{align*} q_n(f(d_n)-f(a_n))p_n & = q_n\,f^{[1]}(d_n,a_n)\text{\smaller $\#$} (d_n-a_n)\,p_n = \int_{\Sigma} q_n\,\varphi(d_n,\sigma)(d_n-a_n)\varphi_2(a_n,\sigma)\,p_n\,\rho(d\sigma) \\ & = \int_{\Sigma} \varphi(a+c,\sigma)\,q_n\,c\,p_n\,\varphi_2(a,\sigma)\,\rho(d\sigma) = f^{[1]}(a+c,c)\text{\smaller $\#$}(q_n\,c\,p_n) \to f^{[1]}(a+c,a)\text{\smaller $\#$} c \end{align*} in the SOT as $n \to \infty$, since $q_n \to 1$ and $p_n \to 1$ in the SOT as $n \to \infty$. But now, notice \[ f(a_n)p_n = (f \circ \chi_n)(a)\,1_{[-n,n]}(a) = ((f \circ \chi_n)\,1_{[-n,n]})(a) = (f\,1_{[-n,n]})(a) = f(a)\,p_n \] and similarly $q_nf(d_n)p_n = q_nf(a+c)p_n$. (For the latter, we use that $\im p_n \subseteq \mathrm{dom}(a) \subseteq \mathrm{dom}(f(a+c))$.) It follows that if $m \in \mathbb{N}$, $h \in \im p_m$, and $n \geq m$, then \begin{align*} q_n(f(d_n)-f(a_n))p_nh & = q_n(f(a+c)-f(a))p_nh \\ & = q_n(f(a+c)-f(a))p_np_mh \\ & = q_n(f(a+c)-f(a))p_mh \\ & \to (f(a+c)-f(a))p_mh = (f(a+c)-f(a))h \end{align*} in $H$ as $n \to \infty$. We have now proven that \[ (f(a+c)-f(a))h = (f^{[1]}(a+c,c)\text{\smaller $\#$} c)h \] for $h \in \im p_m$. Since $\bigcup_{m \in \mathbb{N}} \im p_m \subseteq H$ is a dense linear subspace, we are done with the first part. Next, let $k \geq 2$ and $f \in C^k(\mathbb{R})$ be such that $f^{[k-1]} \in \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}})^{\hat{\otimes}_i k}$ and $f^{[k]} \in \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}})^{\hat{\otimes}_i (k+1)}$. By definition and symmetry of divided differences, if $j \in \{1,\ldots,k\}$ and $\lambda,\mu \in \mathbb{R}$, then \[ f^{[k-1]}(\vec{\lambda}_{j-},\lambda,\vec{\lambda}_{j+}) - f^{[k-1]}(\vec{\lambda}_{j-},\mu,\vec{\lambda}_{j+}) = f^{[k]}(\vec{\lambda}_{j-},\lambda,\mu,\vec{\lambda}_{j+})(\lambda-\mu), \numberthis\label{eq.keyperturbid2} \] for $\vec{\lambda} = (\lambda_1,\ldots,\lambda_{k-1}) \in \mathbb{R}^{k-1}$. Now, suppose $a,c \in B(H)_{\sa}$ again, and fix $\vec{a} = (a_1,\ldots,a_{k-1}) \in C(H)_{\sa}^{k-1}$ and $b = (b_1,\ldots,b_{k-1}) \in B(H)^{k-1}$. Since $\sigma(a)$ and $\sigma(a+c)$ are compact and $f^{[k-1]} \in \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}})^{\hat{\otimes}_i k}$, we have that both of the functions \begin{align*} \mathbb{R}^{j-1} \times \sigma(a+c)\times \sigma(a) \times \mathbb{R}^{k-j} \ni (u,\lambda,\mu,v) & \overset{\psi}{\mapsto} \lambda-\mu \in \mathbb{C} \, \text{ and} \\ \mathbb{R}^{j-1} \times \sigma(a+c)\times \sigma(a) \times \mathbb{R}^{k-j} \ni (u,\lambda,\mu,v) & \overset{\varphi}{\mapsto} f^{[k-1]}(u,\lambda,v) - f^{[k-1]}(u,\mu,v) \in \mathbb{C} \end{align*} belong to \[ \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}})^{\hat{\otimes}_i(j-1)}\hat{\otimes}_i \ell^{\infty}(\sigma(a+c),\mathcal{B}_{\sigma(a+c)}) \hat{\otimes}_i \ell^{\infty}(\sigma(a),\mathcal{B}_{\sigma(a)}) \hat{\otimes}_i \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}})^{\hat{\otimes}_i(k-j)}. \] This allows us to apply $I^{\vec{a}_{j-},a+c,a,\vec{a}_{j+}}$ to \eqref{eq.keyperturbid2}, which may be rewritten \[ \varphi = f^{[k]}\psi. \] If we do so and then plug $(b_{j-},1,b_{j+})$ into the result, then we get \begin{align*} f^{[k-1]}(\vec{a}_{j-},a+c,\vec{a}_{j+})\text{\smaller $\#$} b - f^{[k-1]}(\vec{a}_{j-},a,\vec{a}_{j+})\text{\smaller $\#$} b & = \varphi(\vec{a}_{j-},a+c,a,\vec{a}_{j+})\text{\smaller $\#$}(b_{j-},1,b_{j+}) \\ & = \big(f^{[k]}\psi\big)(\vec{a}_{j-},a+c,a,\vec{a}_{j+})\text{\smaller $\#$}(b_{j-},1,b_{j+}) \\ & = f^{[k]}(\vec{a}_{j-},a+c,a,\vec{a}_{j+})\text{\smaller $\#$}(b_{j-},c,b_{j+}), \end{align*} where in the last line we used Proposition \ref{prop.linandmult}.\ref{item.mult2} and the definition of $\psi$. Finally, for general $a \in C(H)_{\sa}$ and $n \geq k$, let $p_n$, $q_n$, $a_n$, and $d_n$ be as in the first paragraph. If $1 < j < k$, then we also let \[ b_{\cdot,n} \coloneqq (b_{(j-1)-},b_{j-1}q_n,p_nb_j,b_{(j+1)+}). \] Since $p_n \to 1$ and $q_n \to 1$ in the SOT, Lemma \ref{lem.approxbybdd} gives \begin{align*} f^{[k-1]}(\vec{a}_{j-},d_n,\vec{a}_{j+})\text{\smaller $\#$} b_{\cdot,n} & \to f^{[k-1]}(\vec{a}_{j-},a+c,\vec{a}_{j+})\text{\smaller $\#$} b \, \text{ and} \\ f^{[k-1]}(\vec{a}_{j-},a_n,\vec{a}_{j+})\text{\smaller $\#$} b_{\cdot,n} & \to f^{[k-1]}(\vec{a}_{j-},a,\vec{a}_{j+})\text{\smaller $\#$} b \end{align*} in the SOT as $n \to \infty$. Now, let $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ be a $\ell^{\infty}$-IPD of $f^{[k]}$. Then \begin{align*} T_{j,n} & \coloneqq f^{[k]}(\vec{a}_{j-},d_n,a_n,\vec{a}_{j+})\text{\smaller $\#$}((b_{\cdot,n})_{j-},d_n-a_n,(b_{\cdot,n})_{j+}) \\ & = \int_{\Sigma} \Bigg(\prod_{j_1=1}^{j-1}\varphi(a_{j_1},\sigma)\,b_{j_1}\Bigg)q_n\,\varphi_j(d_n,\sigma)(d_n-a_n)\varphi_{j+1}(a_n,\sigma)\,p_n\Bigg(\prod_{j_2=j}^{k-1}b_{j_2}\varphi(a_{j_2+2},\sigma)\Bigg)\,\rho(d\sigma) \\ & = \int_{\Sigma} \Bigg(\prod_{j_1=1}^{j-1}\varphi(a_{j_1},\sigma)\,b_{j_1}\Bigg)\varphi_j(a+c,\sigma)\,q_n\,c\,p_n\,\varphi_{j+1}(a,\sigma)\Bigg(\prod_{j_2=j}^{k-1}b_{j_2}\varphi(a_{j_2+2},\sigma)\Bigg)\,\rho(d\sigma) \\ & = f^{[k]}(\vec{a}_{j-},a+c,a,\vec{a}_{j+})\text{\smaller $\#$}(b_{j-},q_n\,c\,p_n,b_{j+}) \\ & \to f^{[k]}(\vec{a}_{j-},a+c,a,\vec{a}_{j+})\text{\smaller $\#$}(b_{j-},c,b_{j+}) \end{align*} in the SOT as $n \to \infty$, by the observation from the first paragraph and Lemma \ref{lem.approxbybdd}. (Above, empty products are declared to be $1$.) Since we already know from the previous paragraph that \[ f^{[k-1]}(\vec{a}_{j-},d_n,\vec{a}_{j+})\text{\smaller $\#$} b_{\cdot,n} - f^{[k-1]}(\vec{a}_{j-},a_n,\vec{a}_{j+})\text{\smaller $\#$} b_{\cdot,n} = f^{[k]}(\vec{a}_{j-},d_n,a_n,\vec{a}_{j+})\text{\smaller $\#$}((b_{\cdot,n})_{j-},d_n-a_n,(b_{\cdot,n})_{j+}), \] for all $n \geq k$, this completes the proof when $1 < j < k$. For the cases $j \in \{1,k\}$, we redefine \[ b_{\cdot,n} \coloneqq (p_nb_1,b_{2+}) \; \text{ and } \; \tilde{b}_{\cdot,n} \coloneqq (b_{(k-1)-},b_{k-1}q_n). \] Then we use an argument similar to the one above to see that \begin{align*} q_n(f^{[k-1]}(d_n,\vec{a}) \text{\smaller $\#$} b_{\cdot,n} - f^{[k-1]}(a_n,\vec{a}) \text{\smaller $\#$} b_{\cdot,n}) & = q_n f^{[k]}(d_n,a_n,\vec{a})\text{\smaller $\#$} (d_n-a_n,b_{\cdot,n}) \\ & = f^{[k]}(a+c,a,\vec{a})\text{\smaller $\#$} (q_n\,c\,p_n,b) \end{align*} and \begin{align*} (f^{[k-1]}(\vec{a},d_n) \text{\smaller $\#$} \tilde{b}_{\cdot,n} - f^{[k-1]}(\vec{a},a_n) \text{\smaller $\#$} \tilde{b}_{\cdot,n})p_n & = (f^{[k]}(\vec{a},d_n,a_n)\text{\smaller $\#$} (\tilde{b}_{\cdot,n},d_n-a_n))p_n \\ & = f^{[k]}(\vec{a},a+c,a)\text{\smaller $\#$} (b,q_n\,c\,p_n). \end{align*} Then we use Lemma \ref{lem.approxbybdd} to take $n \to \infty$. This completes the proof. \end{proof} \begin{cor}\label{cor.Iperturb} Let $\mathcal{M} \subseteq B(H)$ be a von Neumann algebra and $a \aff \mathcal{M}_{\sa}$. Suppose $(\mathcal{I},\|\cdot\|_{\mathcal{I}}) \unlhd \mathcal{M}$ is MOI-friendly. If $f \in C^1(\mathbb{R})$ is such that $f^{[1]} \in \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}}) \hat{\otimes}_i \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}})$, then \[ f(a+c)-f(a) \in \mathcal{I} \; \text{ and } \; \|f(a+c)-f(a)\|_{\mathcal{I}} \leq \big\|f^{[1]}\big\|_{\ell^{\infty}(\sigma(a+c),\mathcal{B}_{\sigma(a+c)})\hat{\otimes}_i \ell^{\infty}(\sigma(a),\mathcal{B}_{\sigma(a)})}\|c\|_{\mathcal{I}} \] for all $c \in \mathcal{I}_{\sa} \coloneqq \mathcal{I} \cap \mathcal{M}_{\sa}$, where $\mathcal{M}_{\sa} = \{b \in \mathcal{M} : b^*=b\}$. \end{cor} \begin{proof} Since $a \aff \mathcal{M}_{\sa}$ and $c \in \mathcal{I}_{\sa} \subseteq \mathcal{M}_{\sa}$, it is easy to see $a+c \aff \mathcal{M}_{\sa}$ as well. In particular, the projection-valued measures $P^{a+c}$ and $P^a$ take values in $\mathcal{M}$. It then follows from \eqref{eq.perturb0} and the definition of MOI-friendly that $f(a+c)-f(a) \in \mathcal{I}$ and $\|f(a+c)-f(a)\|_{\mathcal{I}} \leq \|f^{[1]}\|_{\ell^{\infty}(\sigma(a+c),\mathcal{B}_{\sigma(a+c)})\hat{\otimes}_i \ell^{\infty}(\sigma(a),\mathcal{B}_{\sigma(a)})}\|c\|_{\mathcal{I}}$. \end{proof} \begin{rem}[\textbf{Quasicommutators}] Let $f \in C^1(\mathbb{R})$ be such that $f^{[1]} \in \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}}) \hat{\otimes}_i \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}})$. One can show using essentially the same proofs show that if $a,b \in C(H)_{\sa}$ and $q \in B(H)$ are such that $aq-qb \in B(H)$ (i.e., $aq-qb$ is densely defined and bounded), then $f(a)q-qf(b) \in B(H)$ and \[ f(a)q-qf(b) = f^{[1]}(a,b)\text{\smaller $\#$} (aq-qb). \] As a result, we get a quasicommutator estimate in MOI-friendly ideals. Let $\mathcal{M} \subseteq B(H)$ be a von Neumann algebra, and suppose $(\mathcal{I},\|\cdot\|_{\mathcal{I}}) \unlhd \mathcal{M}$ is MOI-friendly. If $a,b \aff \mathcal{M}_{\sa}$ and $q \in B(H)$ are such that $aq-qb \in \mathcal{I}$, then $f(a)q-qf(b) \in \mathcal{I}$ and \[ \|f(a)q-qf(b)\|_{\mathcal{I}} \leq \big\|f^{[1]}\big\|_{\ell^{\infty}(\sigma(a),\mathcal{B}_{\sigma(a)}) \hat{\otimes}_i \ell^{\infty}(\sigma(b),\mathcal{B}_{\sigma(b)})}\|aq-qb\|_{\mathcal{I}}. \] Such quasicommutator estimates are of interest in the study of \textit{operator Lipschitz functions}. Please see \cite{aleksandrovOL} or \cite{peller2} for more information. \end{rem} \subsection{The Spaces \texorpdfstring{$BOC(\mathbb{R})^{\hat{\otimes}_i(k+1)}$}{} and \texorpdfstring{$OC^{[k]}(\mathbb{R})$}{}}\label{sec.OCk} In the following section, we prove a general result about derivatives of operator functions. In this section, we introduce the functions whose operator functions we shall be differentiating. Then we use Peller's work, which we review in detail in Appendix \ref{sec.BesovPeller}, from \cite{peller1} to give a large class of examples of such functions. \begin{defi}[\textbf{Operator Continuity}]\label{def.opcont} Let $f \in \ell^0(\mathbb{R},\mathcal{B}_{\mathbb{R}})$. We say that $f$ is \textbf{operator continuous} if \begin{enumerate}[label=(\alph*),leftmargin=2\parindent] \item for every complex Hilbert space $H$, $a \in C(H)_{\sa}$, and $c \in B(H)_{\sa}$, the operator $f(a+c)-f(a)$ is densely defined and bounded; and \item for every complex Hilbert space $H$ and $a \in C(H)_{\sa}$, we have $f(a+c)-f(a) \to 0$ in $B(H)$ as $c \to 0$ in $B(H)_{\sa}$. (More precisely, for every $a \in C(H)_{\sa}$ and $\textepsilon} > 0$, there is some $\delta > 0$ such that $\|f(a+c)-f(a)\| < \textepsilon}$ whenever $c \in B(H)_{\sa}$ and $\|c\| < \delta$.) \end{enumerate} In this case, we write $f \in OC(\mathbb{R})$. If in addition $f$ is bounded, then we write $f \in BOC(\mathbb{R})$. \end{defi} Taking $H = \mathbb{C}$ in the definition, it is clear that operator continuous functions are continuous. Also, we observe that if $f,g \in BOC(\mathbb{R})$, $H$ is a complex Hilbert space, $a \in C(H)_{\sa}$, and $c \in B(H)_{\sa}$, then \[ (fg)(a+c)-(fg)(a) = (f(a+c)-f(a))g(a+c) + f(a)(g(a+c)-g(a)) \] with no domain issues because $f$ and $g$ are bounded. But then \[ \|(fg)(a+c)-(fg)(a)\| \leq \|g\|_{\ell^{\infty}(\mathbb{R})} \|f(a+c)-f(a)\| + \|f\|_{\ell^{\infty}(\mathbb{R})}\|g(a+c)-g(a)\| \to 0 \] as $c \to 0$ in $B(H)_{\sa}$. Thus $fg \in BOC(\mathbb{R})$. It is even easier to see $f+g \in BOC(\mathbb{R})$ and $\overline{f} \in BOC(\mathbb{R})$. Next, if $(\Sigma,\mathscr{H})$ is a measurable space, $\psi \colon \mathbb{R} \times \Sigma \to \mathbb{C}$ is measurable, $\psi(\cdot,\sigma) \in C(\mathbb{R})$ for $\sigma \in \Sigma$, then \[ \|\psi(\cdot,\sigma)\|_{\ell^{\infty}(\mathbb{R})} = \sup_{t \in \mathbb{Q}}|\psi(t,\sigma)|, \, \text{ for all } \sigma \in \Sigma. \] In particular, $\sigma \mapsto \|\psi(\cdot,\sigma)\|_{\ell^{\infty}(\mathbb{R})}$ is measurable. Thus the following definition makes sense (without needing to use upper or lower integrals). \begin{defi}[\textbf{Integral Projective Tensor Products II}]\label{def.BOCIPTP} Let $\varphi \colon \mathbb{R}^{k+1} \to \mathbb{C}$ be a function. A $\boldsymbol{BOC}$\textbf{-integral projective decomposition} (BOCIPD) of $\varphi$ is a choice $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ of a $\sigma$-finite measure space $(\Sigma,\mathscr{H},\rho)$ and measurable functions $\varphi_1, \ldots,\varphi_{k+1} \colon \mathbb{R} \times \Sigma \to \mathbb{C}$ such that \begin{enumerate}[label=(\alph*),leftmargin=2\parindent] \item $\varphi_j(\cdot,\sigma) \in BOC(\mathbb{R})$, for all $j \in \{1,\ldots,k+1\}$ and $\sigma \in \Sigma$; \label{item.BOCnullset} \item $\int_{\Sigma} \|\varphi_1(\cdot,\sigma)\|_{\ell^{\infty}(\mathbb{R})} \cdots \|\varphi_{k+1}(\cdot,\sigma)\|_{\ell^{\infty}(\mathbb{R})} \, \rho(d\sigma) < \infty$; and\label{item.BOICintegofphis} \item for all $\boldsymbol{\lambda} = (\lambda_1,\ldots,\lambda_{k+1}) \in \mathbb{R}^{k+1}$, we have $\varphi(\boldsymbol{\lambda}) = \int_{\Sigma} \varphi_1(\lambda_1,\sigma) \cdots \varphi_{k+1}(\lambda_{k+1},\sigma) \, \rho(d\sigma)$.\label{item.BOCequality} \end{enumerate} Now, define \begin{align*} \|\varphi\|_{BOC(\mathbb{R})^{\hat{\otimes}_i(k+1)}} &\coloneqq \inf\Bigg\{\int_{\Sigma} \|\varphi_1(\cdot,\sigma)\|_{\ell^{\infty}(\mathbb{R})} \cdots \|\varphi_{k+1}(\cdot,\sigma)\|_{\ell^{\infty}(\mathbb{R})} \, \rho(d\sigma) : (\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})\\ & \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \text{ is a } BOC\text{-integral projective decomposition of } \varphi\Bigg\}, \end{align*} where $\inf \emptyset \coloneqq \infty$. Finally, we define $BOC(\mathbb{R})^{\hat{\otimes}_i(k+1)} \coloneqq \big\{\varphi : \|\varphi\|_{BOC(\mathbb{R})^{\hat{\otimes}_i(k+1)}} < \infty\big\}$ to be the \textbf{$\boldsymbol{(k+1)}^{\text{\textbf{st}}}$ integral projective tensor power of $\boldsymbol{BOC(\mathbb{R})}$}. \end{defi} \begin{prop}\label{prop.BOCIPTP} $BOC(\mathbb{R})^{\hat{\otimes}_i(k+1)} \subseteq C(\mathbb{R}^{k+1}) \cap \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}})^{\hat{\otimes}_i(k+1)}$ is a $\ast$-subalgebra, and \[ \big(BOC(\mathbb{R})^{\hat{\otimes}_i(k+1)},\|\cdot\|_{BOC(\mathbb{R})^{\hat{\otimes}_i(k+1)}}\big) \] is a Banach $\ast$-algebra under pointwise operations. \end{prop} \begin{proof}[Sketch] The containment $BOC(\mathbb{R})^{\hat{\otimes}_i(k+1)} \subseteq C(\mathbb{R}^{k+1}) \cap \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}})^{\hat{\otimes}_i(k+1)}$ follows from the definitions and an application of the (standard) Dominated Convergence Theorem. The rest of the statement follows from the observation above that $BOC(\mathbb{R})$ is a $\ast$-algebra and arguments similar to (but easier than) those in the proof of Proposition 4.1.4 in \cite{nikitopoulosMOI}. \end{proof} We now introduce the space of functions to which the main result of the following section applies. \begin{nota}\label{nota.OCk} For $k \in \mathbb{N}$ and $f \in C^k(\mathbb{R}) = \{k$-times continuously differentiable functions $\mathbb{R} \to \mathbb{C}\}$, define \[ [f]_{OC^{[k]}(\mathbb{R})} \coloneqq \sum_{j=1}^k\big\|f^{[j]}\big\|_{BOC(\mathbb{R})^{\hat{\otimes}_i(j+1)}} \in [0,\infty], \] and let $OC^{[k]}(\mathbb{R}) \coloneqq \{f \in C^k(\mathbb{R}) : [f]_{OC^{[k]}(\mathbb{R})} < \infty\}$. \end{nota} Notice that if $f \in C^1(\mathbb{R})$ and $[f]_{OC^1(\mathbb{R})} = \|f^{[1]}\|_{BOC(\mathbb{R}) \hat{\otimes}_i BOC(\mathbb{R})}= 0$, then $f^{[1]} \equiv 0$, so $f$ must be a constant. In particular, $[\cdot]_{OC^{[k]}(\mathbb{R})}$ is a seminorm but not quite a norm. If we define \[ \|f\|_{OC^{[k]},r} \coloneqq \|f\|_{\ell^{\infty}([-r,r])}+[f]_{OC^{[k]}(\mathbb{R})} \] for $r > 0$, then it can be shown -- using standard arguments and Proposition \ref{prop.BOCIPTP} -- that $OC^{[k]}(\mathbb{R})$ is a Fr\'{e}chet space with the topology induced by the collection $\{\|\cdot\|_{OC^{[k]},r} : r > 0\}$ of seminorms. One can even show that $OC^{[k]}(\mathbb{R})$ is a $\ast$-algebra under pointwise operations, and that these operations are continuous. Since we shall not need these facts, we shall not dwell on them. Instead, we turn to examples. \begin{defi}[\textbf{Wiener Space}]\label{def.Wk} If $k \in \mathbb{N}$, then we define the \textbf{$\boldsymbol{k^{\text{\textbf{th}}}}$ Wiener space} to be the set of functions $f \colon \mathbb{R} \to \mathbb{C}$ such that there is a Borel complex measure $\mu$ on $\mathbb{R}$ satisfying $\int_{\mathbb{R}} |\xi|^k\,|\mu|(d\xi) < \infty$ and \[ f(\lambda) = \int_{\mathbb{R}} e^{i\lambda\xi} \,\mu(d\xi), \] for all $\lambda \in \mathbb{R}$. \end{defi} It is easy to see that if $1 \leq j \leq k$, then $W_k(\mathbb{R}) \subseteq W_j(\mathbb{R})$ and $W_k(\mathbb{R}) \subseteq C^k(\mathbb{R})$. We now prove by elementary means that $W_k(\mathbb{R}) \subseteq OC^{[k]}(\mathbb{R})$. Then we use Peller's work from \cite{peller1} to generalize this substantially. \pagebreak \begin{lem}\label{lem.expOC} If $\xi \in \mathbb{R}$ and $f(\lambda) \coloneqq e^{i\lambda\xi}$, for all $\lambda \in \mathbb{R}$, then $f \in BOC(\mathbb{R})$. \end{lem} \begin{proof} Of course, $f$ is bounded and continuous. Now, if $\lambda,\mu \in \mathbb{R}$, then \[ f^{[1]}(\lambda,\mu) = \int_0^1f'(t\lambda+(1-t)\mu)\,dt = i\xi\int_0^1e^{it\lambda\xi}e^{i(1-t)\xi\mu}\,dt \] by Proposition \ref{prop.divdiffCk}. This is clearly a $\ell^{\infty}$-integral projective decomposition of $f^{[1]}$ that yields \[ \big\|f^{[1]}\big\|_{\ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}}) \hat{\otimes}_i \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}})} \leq |\xi|. \] In particular, if $a \in C(H)_{\sa}$ and $c \in B(H)_{\sa}$, then $\|f(a+c)-f(a)\| \leq |\xi|\, \|c\|$ by Corollary \ref{cor.Iperturb}. It follows that $f$ is operator continuous. \end{proof} \begin{prop}\label{prop.WkinOCk} $W_k(\mathbb{R}) \subseteq OC^{[k]}(\mathbb{R})$, for all $k \in \mathbb{N}$. Specifically, if $f(\lambda) = \int_{\mathbb{R}} e^{i\lambda\xi}\,\mu(d\xi)$, where $\mu$ is a Borel complex measure on $\mathbb{R}$ with $\int_{\mathbb{R}}|\xi|^k\,|\mu|(d\xi) < \infty$, then \[ [f]_{OC^{[k]}(\mathbb{R})} \leq \sum_{j=1}^k\frac{1}{j!}\int_{\mathbb{R}}|\xi|^j\,|\mu|(d\xi). \] \end{prop} \begin{proof} Notice that if $f$ is as in the statement and $j \in \{1,\ldots,k\}$, then \[ f^{(j)}(\lambda) = \int_{\mathbb{R}} e^{i\lambda\xi}(i\xi)^j\,\mu(d\xi), \] for all $\lambda \in \mathbb{R}$. Therefore, by Proposition \ref{prop.divdiffCk}, \[ f^{[j]}(\boldsymbol{\lambda}) = \int_{\Delta_j} f^{(j)}(\boldsymbol{t} \cdot \boldsymbol{\lambda}) \, \rho_j(d\boldsymbol{t}) = \int_{\Delta_j}\int_{\mathbb{R}}e^{it_1\lambda_1\xi}\cdots e^{it_{j+1}\lambda_{j+1}\xi} \, (i\xi)^j\mu(d\xi) \, \rho_j(d \boldsymbol{t}). \] By Lemma \ref{lem.expOC}, this is (after writing $d\mu = \frac{d\mu}{d|\mu|}d|\mu|$ to match the definition) a BOCIPD of $f^{[j]}$ that yields \[ \big\|f^{[j]}\big\|_{BOC(\mathbb{R})^{\hat{\otimes}_i(j+1)}} \leq \int_{\Delta_j}\int_{\mathbb{R}} |\xi|^j\,|\mu|(d\xi)\,\rho_j(d\boldsymbol{t}) = \rho_j(\Delta_j)\int_{\mathbb{R}} |\xi|^j\,|\mu|(d\xi) = \frac{1}{j!}\int_{\mathbb{R}}|\xi|^j\,|\mu|(d\xi). \] Summing over $j \in \{1,\ldots,k\}$ gives the desired bound. \end{proof} Now, we use more serious harmonic analysis done by Peller \cite{peller1} to exhibit a large class -- containing $W_k(\mathbb{R})$ strictly -- of functions belonging to $OC^{[k]}(\mathbb{R})$. We begin by defining Besov spaces. \begin{nota}\label{nota.fourier} If $m \in \mathbb{N}$, then we write $\mathscr{S}(\mathbb{R}^m)$ for the Fr\'{e}chet space of Schwartz functions $\mathbb{R}^m \to \mathbb{C}$ and $\mathscr{S}'(\mathbb{R}^m) \coloneqq \mathscr{S}(\mathbb{R}^m)^*$ for the space of tempered distributions on $\mathbb{R}^m$. Also, the conventions we use for the Fourier transform and its inverse are, respectively, \[ \widehat{f}(\xi) = (\mathcal{F} f)(\xi) = \int_{\mathbb{R}^m} e^{-i\xi\cdot x}f(x)\,dx \; \text{ and } \; \wch{f}(x) = \frac{1}{(2\pi)^m}\int_{\mathbb{R}^m}e^{ix\cdot\xi}f(\xi)\,d\xi \] for $f \in L^1(\mathbb{R})$, with corresponding extensions to $\mathscr{S}'(\mathbb{R}^m)$. \end{nota} \begin{defi}[\textbf{Homogeneous Besov Spaces}]\label{def.Besov} Let $m \in \mathbb{N}$. Fix $\varphi \in C_c^{\infty}(\mathbb{R}^m)$ such that $0 \leq \varphi \leq 1$, $\supp \varphi \subseteq \{\xi \in \mathbb{R}^m : \|\xi\| \leq 2\}$, and $\varphi \equiv 1$ on $\{\xi \in \mathbb{R}^m : \|\xi\| \leq 1\}$. For $j \in \mathbb{Z}$, define \[ \varphi_j(\xi) \coloneqq \varphi(2^{-j}\xi) - \varphi(2^{-j+1}\xi), \] for all $\xi \in \mathbb{R}^m$. Now, for $s \in \mathbb{R}$, $p,q \in [1,\infty]$, and $f \in \mathscr{S}'(\mathbb{R}^m)$, write \[ \|f\|_{\dot{B}_q^{s,p}} \coloneqq \big\|\big(2^{js}\|\wch{\varphi}_j \ast f\|_{L^p}\big)_{j \in \mathbb{Z}} \big\|_{\ell^q(\mathbb{Z})} \in [0,\infty] \] We call $\dot{B}_q^{s,p}(\mathbb{R}^m) \coloneqq \{f \in \mathscr{S}'(\mathbb{R}^m) : \|f\|_{\dot{B}_q^{s,p}} < \infty\}$ the \textbf{homogeneous Besov space} $\boldsymbol{\dot{B}_q^{s,p}(\mathbb{R}^m)}$. \end{defi} \begin{rem} First, note that $\wch{\varphi} \ast f, \wch{\varphi}_j \ast f$ have compactly supported Fourier transforms and so are smooth by the Paley-Wiener Theorem; it therefore makes sense to apply the $L^p$-norm to them. Second, since it is easy to show that \[ \|f\|_{\dot{B}_q^{s,p}} = 0 \] if and only if $f$ is a polynomial, it is usually best to define $\dot{B}_q^{s,p}(\mathbb{R}^m)$ in terms of a quotient space in which all polynomials are zero. The definition above is given in Chapter 3 of \cite{peetre} and Sections 5.1.2 and 5.1.3 of \cite{triebel1}. The definition ``modulo polynomials" is given in Section 2.4 of \cite{sawano}. (Please see Section 1.2.5.3 of \cite{sawano} as well.) Finally, beware: the position of $p$ and $q$ in $B_q^{s,p}(\mathbb{R}^n)$ is far from consistent in the literature. \end{rem} The case of interest is $m=1$ and $(s,p,q) = (k,\infty,1)$ for $k \in \mathbb{N}$. As we show in Section \ref{sec.PellerII}, in this case it turns out $\dot{B}_1^{k,\infty}(\mathbb{R}) \subseteq C^k(\mathbb{R})$. Also, as mentioned above, if $f \in \mathbb{C}[\lambda]$ is a polynomial, then \[ \|f\|_{\dot{B}_1^{k,\infty}} = 0. \] Therefore, if we are to prove sensible results about differentiating the operator function $c \mapsto f(a+c)-f(a)$ when $a$ is \textit{unbounded} and $f \in \dot{B}_1^{k,\infty}(\mathbb{R})$, then it is necessary to put in place some restrictions that exclude (at least) polynomials of degree higher than two. We accomplish this with the following modified Besov spaces. \begin{defi}[\textbf{Peller-Besov Spaces}]\label{def.PellerBesov} Let $k \in \mathbb{N}$. We define \[ PB^k(\mathbb{R}) \coloneqq \dot{B}_1^{k,\infty}(\mathbb{R}) \cap \big\{f \in C^k(\mathbb{R}) : f^{(k)} \text{ is bounded}\big\} \] to be the $\boldsymbol{k^{\text{\textbf{th}}}}$ \textbf{Peller-Besov space}. \end{defi} The following result is a slight upgrade of Theorem 5.5 in \cite{peller1} or Theorem 2.2.1 in \cite{peller2}. \begin{thm}[\textbf{Peller}]\label{thm.Peller} If $k \in \mathbb{N}$, then there is a constant $c_k < \infty$ such that \[ \big\|f^{[k]}\big\|_{BOC(\mathbb{R})^{\hat{\otimes}_i(k+1)}} \leq \frac{1}{k!}\inf_{x \in \mathbb{R}}\big|f^{(k)}(x)\big| + c_k\|f\|_{\dot{B}_1^{k,\infty}}, \] for all $f \in PB^k(\mathbb{R})$; and if $k \geq 2$, then \[ \big\|f^{[k]}\big\|_{BOC(\mathbb{R})^{\hat{\otimes}_i(k+1)}} \leq c_k\|f\|_{\dot{B}_1^{k,\infty}}, \] for all $f \in PB^1(\mathbb{R}) \cap \dot{B}_1^{k,\infty}(\mathbb{R}) = PB^1(\mathbb{R}) \cap PB^k(\mathbb{R}) = \bigcap_{j=1}^kPB^j(\mathbb{R})$. \end{thm} The proof given in \cite{peller1} is not very detailed and is only explicit in the cases $k \in \{1,2\}$, so we present a full proof of this theorem in Appendix \ref{sec.BesovPeller}. As a result, we obtain the following. \begin{cor}\label{cor.PBkinOCk} $PB^1(\mathbb{R}) \cap PB^k(\mathbb{R}) = PB^1(\mathbb{R}) \cap \dot{B}_1^{k,\infty}(\mathbb{R}) \subseteq OC^{[k]}(\mathbb{R})$, for all $k \in \mathbb{N}$. Specifically, \[ [f]_{OC^{[k]}(\mathbb{R})} \leq \inf_{x \in \mathbb{R}}|f'(x)| + \sum_{j=1}^kc_j\|f\|_{\dot{B}^{j,\infty}}, \] for all $f \in PB^1(\mathbb{R}) \cap PB^k(\mathbb{R})$, where $c_1,\ldots,c_k$ are as in Theorem \ref{thm.Peller}. \qed \end{cor} Since it is easy to show that $W_k(\mathbb{R}) \subseteq PB^1(\mathbb{R}) \cap \dot{B}_1^{k,\infty}(\mathbb{R})$, for all $k \in \mathbb{N}$, Corollary \ref{cor.PBkinOCk} does in fact generalize Proposition \ref{prop.WkinOCk}. \subsection{Derivatives of Operator Functions in Ideals} In this section, we shall finally differentiate operator functions in integral symmetrically normed ideals. \begin{conv} For the duration of this section, fix a complex Hilbert space $(H,\langle \cdot,\cdot \rangle)$, a von Neumann algebra $\mathcal{M} \subseteq B(H)$, and $(\mathcal{I},\|\cdot\|_{\mathcal{I}}) \unlhd \mathcal{M}$. Also, write $\mathcal{I}_{\sa} \coloneqq \mathcal{I} \cap \mathcal{M}_{\sa} = \{r \in \mathcal{I} : r^*=r\}$. \end{conv} As a consequence of the definition of a Banach ideal, $\mathcal{I}_{\sa}$ is a real Banach space when it is given (the restriction of) the $\mathcal{I}$-norm $\|\cdot\|_{\mathcal{I}}$. Now, before setting up the main result of this section, we prove a key technical lemma that is the main reason \textit{integral} symmetrically normed ideals are considered in this paper. \pagebreak \begin{nota}[\textbf{Bounded Multilinear Maps}]\label{nota.bddmultilin} Let $(V_1,\|\cdot\|_{V_1}),\ldots,(V_k,\|\cdot\|_{V_k}),(W,\|\cdot\|_W)$ be normed vector spaces over $\mathbb{F} \in \{\mathbb{R},\mathbb{C}\}$ and $T \colon V_1 \times \cdots \times V_k \to W$ be a $k$-linear map. Then we write \[ \|T\|_{B_k(V_1 \times \cdots \times V_k;W)} \coloneqq \sup\{\|T(v_1,\ldots,v_k)\|_W : v_j \in V_j, \, \|v_j\|_{V_j}\leq 1, \, 1 \leq j \leq k\} \] for the operator norm of $T$ and $B_k(V_1 \times \cdots \times V_k;W)$ for the space of $k$-linear maps $V_1 \times \cdots \times V_k \to W$ with finite operator norm. \end{nota} \begin{lem}[\textbf{Continuous Perturbation}]\label{lem.Icont} If $\mathcal{I}$ is integral symmetrically normed, $a_1,\ldots,a_{k+1} \aff \mathcal{M}_{\sa}$, and $\varphi \in BOC(\mathbb{R})^{\hat{\otimes}_i(k+1)}$, then the map \[ \mathcal{I}_{\sa}^{k+1} \ni (c_1,\ldots,c_{k+1}) \mapsto I^{a_1+c_1,\ldots,a_{k+1}+c_{k+1}}\varphi \in B_k(\mathcal{I}^k;\mathcal{I}) \] is continuous. (To be clear, $\mathcal{I}$ and $\mathcal{I}_{\sa}$ are always endowed with the $\mathcal{I}$-norm $\|\cdot\|_{\mathcal{I}}$.) \end{lem} \begin{rem} Recall from Proposition \ref{prop.idealproperties} that integral symmetrically normed ideals are MOI-friendly. In particular, the map under consideration in Lemma \ref{lem.Icont} does actually make sense by definition of MOI-friendly and the fact that $a+c \aff \mathcal{M}_{\sa}$ whenever $a \aff \mathcal{M}_{\sa}$ and $c \in \mathcal{I}_{\sa}$. (As in the proof of Corollary \ref{cor.Iperturb}, the latter imply that $P^a$ and $P^{a+c}$ take values in $\mathcal{M}$.) \end{rem} \begin{proof} Write $\varphi_a \colon \mathcal{I}_{\sa}^{k+1} \to B_k(\mathcal{I}^k;\mathcal{I})$ for the map in question. Now, let $c = (c_1,\ldots,c_{k+1}) \in \mathcal{I}_{\sa}^{k+1}$ and $(c_{\cdot,n})_{n \in \mathbb{N}} = (c_{1,n},\ldots,c_{k+1,n})_{n \in \mathbb{N}}$ be a sequence in $\mathcal{I}_{\sa}^{k+1}$ converging to $c$. Then \[ \varphi_a(c_{\cdot,n}) - \varphi_a(c) = \sum_{j=1}^{k+1} (\underbrace{\varphi_a(c_{1,n},\ldots,c_{j,n},c_{j+1},\ldots,c_{k+1}) - \varphi_a(c_{1,n},\ldots,c_{j-1,n},c_j,\ldots,c_{k+1})}_{\coloneqq T_{j,n}}). \] Fix now a BOCIPD $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ of $\varphi$ and $b_1,\ldots,b_k \in \mathcal{I}$, and write $b_{k+1} \coloneqq 1$. By definition of the multiple operator integral, $T_{j,n}(b_1,\ldots,b_k)$ is precisely \[ \int_{\Sigma}\Bigg(\prod_{m=1}^{j-1}\varphi_m(a_m+c_{m,n},\sigma)\,b_m\Bigg)(\varphi_j(a_j+c_{j,n},\sigma) - \varphi_j(a_j+c_j,\sigma))\,b_j\Bigg(\prod_{m=j+1}^{k+1}\varphi_m(a_m+c_m,\sigma)\,b_m\Bigg)\,\rho(d\sigma), \] where empty products are the identity. Now, if $1 \leq j < k+1$ and \begin{align*} A_n(\sigma) & \coloneqq \Bigg(\prod_{m=1}^{j-1}\varphi_m(a_m+c_{m,n},\sigma)\,b_m\Bigg)(\varphi_j(a_j+c_{j,n},\sigma) - \varphi_j(a_j+c_j,\sigma)) \, \text{ and} \\ B(\sigma) & \coloneqq \varphi_{j+1}(a_{j+1}+c_{j+1},\sigma))\prod_{m=j+2}^{k+1}b_{m-1}\varphi_m(a_m+c_m,\sigma)), \end{align*} then \[ T_{j,n}(b_1,\ldots,b_k) = \int_{\Sigma}A_n(\sigma)\,b_j\,B(\sigma)\,\rho(d\sigma). \] But \begin{align*} \underline{\int_{\Sigma}} \|A_n\|\,\|B\|\,d\rho & \leq \prod_{p \neq j}\|b_p\|\underline{\int_{\Sigma}} \big\|\varphi_j(a_j+c_{j,n},\sigma) - \varphi_j(a_j+c_j,\sigma)\big\|\prod_{m \neq j}\|\varphi_m(\cdot,\sigma)\|_{\ell^{\infty}(\mathbb{R})}\,\rho(d\sigma) < \infty. \end{align*} Therefore, the definition of integral symmetrically normed gives $T_{j,n}(b_1,\ldots,b_k) \in \mathcal{I}$ and \begin{align*} \|T_{j,n}(b_1,\ldots,b_k)\|_{\mathcal{I}} & \leq \|b_j\|_{\mathcal{I}}\prod_{p \neq j}\|b_p\|\underline{\int_{\Sigma}} \big\|\varphi_j(a_j+c_{j,n},\sigma) - \varphi_j(a_j+c_j,\sigma)\big\|\prod_{m \neq j}\|\varphi_m(\cdot,\sigma)\|_{\ell^{\infty}(\mathbb{R})}\,\rho(d\sigma) \\ & \leq C_{\mathcal{I}}^{k-1}\|b_1\|_{\mathcal{I}}\cdots\|b_k\|_{\mathcal{I}}\underline{\int_{\Sigma}} \big\|\varphi_j(a_j+c_{j,n},\sigma) - \varphi_j(a_j+c_j,\sigma)\big\|\prod_{m \neq j}\|\varphi_m(\cdot,\sigma)\|_{\ell^{\infty}(\mathbb{R})}\,\rho(d\sigma). \end{align*} Thus \[ \|T_{j,n}\|_{B_k(\mathcal{I}^k;\mathcal{I})} \leq C_{\mathcal{I}}^{k-1}\underline{\int_{\Sigma}} \big\|\varphi_j(a_j+c_{j,n},\sigma) - \varphi_j(a_j+c_j,\sigma)\|\prod_{m \neq j}\|\varphi_m(\cdot,\sigma)\|_{\ell^{\infty}(\mathbb{R})}\,\rho(d\sigma). \numberthis\label{eq.Tjn} \] Next, fix $\sigma \in \Sigma$. Since $\|c_{j,n}-c_j\| \leq C_{\mathcal{I}}\|c_{j,n}-c_j\|_{\mathcal{I}} \to 0$ as $n \to \infty$, the operator continuity of $\varphi_j(\cdot,\sigma)$ gives \[ \|\varphi_j(a_j+c_{j,n},\sigma) - \varphi_j(a_j+c_j,\sigma)\| \to 0 \] as $n \to \infty$. Since \[ \overline{\int_{\Sigma}}\sup_{n \in \mathbb{N}} \Bigg(\big\|\varphi_j(a_j+c_{j,n},\sigma) - \varphi_j(a_j+c_j,\sigma)\big\|\prod_{m \neq j}\|\varphi_m(\cdot,\sigma)\|_{\ell^{\infty}(\mathbb{R})}\Bigg)\,\rho(d\sigma) \leq 2\int_{\Sigma}\prod_{m =1}^{k+1}\|\varphi_m(\cdot,\sigma)\|_{\ell^{\infty}(\mathbb{R})}\,\rho(d\sigma), \] which is finite, we conclude from \eqref{eq.Tjn} and Lemma \ref{lem.poorDCT} that $\|T_{j,n}\|_{B_k(\mathcal{I}^k;\mathcal{I})} \to 0$ as $n \to \infty$. If $j=k+1$, then we run the same argument with \begin{align*} A_n(\sigma) & \coloneqq \Bigg(\prod_{m=1}^{k-1}\varphi_m(a_m+c_{m,n},\sigma)\,b_m\Bigg)\,\varphi_k(a_k+c_{k,n},\sigma) \, \text{ and} \\ B_n(\sigma) & \coloneqq \varphi_{k+1}(a_{k+1}+c_{k+1,n},\sigma) - \varphi_{k+1}(a_{k+1}+c_{k+1},\sigma) \end{align*} to prove $\|T_{k+1,n}\|_{B_k(\mathcal{I}^k;\mathcal{I})} \to 0$ as $n \to \infty$. We conclude \[ \|\varphi_a(c_{\cdot,n}) - \varphi_a(c)\|_{B_k(\mathcal{I}^k;\mathcal{I})} \leq \sum_{j=1}^{k+1} \|T_{j,n}\|_{B_k(\mathcal{I}^k;\mathcal{I})} \to 0 \] as $n \to \infty$, as claimed. \end{proof} Next, we recall the notion of Fr\'{e}chet differentiability of maps between normed vector spaces and then define what it means for a scalar function to be $\mathcal{I}$\textit{-differentiable}. For these purposes, note that if $V_1,\ldots,V_k,W$ are normed vector spaces, then $B_k(V_1 \times \cdots \times V_k ; W) \cong B(V_1;B_{k-1}(V_2 \times \cdots \times V_k;W))$ isometrically via \[ T \mapsto (v_1 \mapsto ((v_2,\ldots,v_k) \mapsto T(v_1,\ldots,v_k))). \] We use this identification below. \begin{defi}[\textbf{Fr\'{e}chet Differentiability}]\label{def.frechder} Let $V$ and $W$ be normed vector spaces, $U \subseteq V$ be open, and $F \colon U \to W$ be a map. For $p \in U$, we say $F$ is \textbf{Fr\'{e}chet differentiable at} $\boldsymbol{p}$ if there exists (necessarily unique) $DF(p) \in B(V;W)$ such that \[ \lim_{h \to 0}\frac{\|F(p+h)-F(p)-DF(p)h\|_W}{\|h\|_V} = 0. \] as $h \to 0$ in $V$. If $F$ is Fr\'{e}chet differentiable at all $p \in U$, then we say $F$ is \textbf{Fr\'{e}chet differentiable in} $\boldsymbol{U}$ and write $DF \colon U \to B(V;W)$ for its \textbf{Fr\'{e}chet derivative} map $U \ni p \mapsto DF(p) \in B(V;W)$. Also, $D^1F \coloneqq DF$. For $k\geq 2$, we say $F$ is $\boldsymbol{k}$\textbf{-times Fr\'{e}chet differentiable at} $\boldsymbol{p}$ if it is $(k-1)$-times Fr\'{e}chet differentiable in $U$ and $D^{k-1}F \colon U \to B_{k-1}(V^{k-1};W)$ is Fr\'{e}chet differentiable at $p$. In this case, we write \[ D^kF(p) \coloneqq D(D^{k-1}F)(p) \in B(V;B_{k-1}(V^{k-1};W)) \cong B_k(V^k;W). \] If $F$ is $k$-times Fr\'{e}chet differentiable at all $p \in U$, then we say $F$ is $\boldsymbol{k}$\textbf{-times Fr\'{e}chet differentiable in} $\boldsymbol{U}$ and write $D^kF \colon U \to B_k(V^k;W)$ for its $\boldsymbol{k^{\text{\textbf{th}}}}$ \textbf{Fr\'{e}chet derivative} map $U \ni p \mapsto D^kF(p) \in B_k(V^k;W)$. Finally, if in addition $D^kF$ is continuous, then we say $F$ is $\boldsymbol{k}$\textbf{-times continuously differentiable in} $\boldsymbol{U}$ and write $F \in C^k(U;W)$. \end{defi} Concretely, if $F \colon U \to W$ is $k$-times Fr\'{e}chet differentiable (in $U$), then one can show by induction that \[ D^kF(p)(h_1,\ldots,h_k) = \partial_{h_1}\cdots \partial_{h_k}F(p) = \frac{d}{ds_1}\Big|_{s_1=0}\cdots \frac{d}{ds_k}\Big|_{s_k=0} F(p+s_1h_1+\cdots+s_kh_k), \] for all $p \in U$ and $h_1,\ldots,h_k \in V$. \begin{defi}[\textbf{$\boldsymbol{\mathcal{I}}$-differentiability}]\label{def.Idiff} Let $a \aff \mathcal{M}_{\sa}$. A Borel measurable function $f \colon \mathbb{R} \to \mathbb{C}$ is called \textbf{$\boldsymbol{k}$-times (Fr\'{e}chet) $\boldsymbol{\mathcal{I}}$-differentiable at $\boldsymbol{a}$} if there is an open set $U \subseteq \mathcal{I}_{\sa}$ with $0 \in U$ such that \begin{enumerate}[label=(\alph*),leftmargin=2\parindent] \item $f(a+b)-f(a) \in \mathcal{I}$ for all $b \in U$ (i.e., when $b \in U$, $f(a+b)-f(a)$ is densely defined and bounded, and its unique bounded linear extension belongs to $\mathcal{I}$), and \item the map \[ U \ni b \mapsto f_{a,\mathsmaller{\mathcal{I}}}(b) \coloneqq f(a+b)-f(a) \in \mathcal{I} \] is $k$-times Fr\'{e}chet differentiable (with respect to $\|\cdot\|_{\mathcal{I}}$) at $0 \in U \subseteq \mathcal{I}_{\sa}$. \end{enumerate} In this case, we write \[ D_{\mathsmaller{\mathcal{I}}}^kf(a) \coloneqq D^kf_{a,\mathsmaller{\mathcal{I}}}(0) \in B_k(\mathcal{I}_{\sa}^k;\mathcal{I}) \] for the $k^{\text{th}}$ Fr\'{e}chet derivative of $f_{a,\mathsmaller{\mathcal{I}}} \colon U \to \mathcal{I}$ at $0 \in U$. If $f$ is $k$-times $\mathcal{I}$-differentiable at $a$ for every $a \aff \mathcal{M}_{\sa}$, then we simply say $f$ is \textbf{$\boldsymbol{k}$-times $\boldsymbol{\mathcal{I}}$-differentiable}. \end{defi} Suppose that $f \colon \mathbb{R} \to \mathbb{C}$ is Lipschitz and $f(a+c)-f(a) \in \mathcal{I}$, for all $a \aff \mathcal{M}_{\sa}$ and $c \in \mathcal{I}_{\sa}$ (i.e., $f_{a,\mathsmaller{\mathcal{I}}} \colon \mathcal{I}_{\sa} \to \mathcal{I}$ is defined everywhere). We claim that if $f$ is $k$-times $\mathcal{I}$-differentiable, then $f_{a,\mathsmaller{\mathcal{I}}}$ is $k$-times Fr\'{e}chet differentiable everywhere -- not just at $0 \in \mathcal{I}_{\sa}$. Indeed, fix $b,c \in \mathcal{I}_{\sa}$, and note that \[ f_{a,\mathsmaller{\mathcal{I}}}(b+c)-f_{a,\mathsmaller{\mathcal{I}}}(b) = f(a+b+c)-f(a+b) = f_{a+b,\mathsmaller{\mathcal{I}}}(c). \numberthis\label{eq.domissues} \] This is the case because \eqref{eq.domissues} is immediate from the definition on \[ \mathrm{dom}(a) = \mathrm{dom}(a)\cap \mathrm{dom}(a+b+c)\cap \mathrm{dom}(a+b) \subseteq \mathrm{dom}(f(a)) \cap \mathrm{dom}(f(a+b+c)) \cap \mathrm{dom}(f(a+b)), \] which is dense in $H$. (Note that we used \eqref{eq.dom}.) In other words, \[ f_{a,\mathsmaller{\mathcal{I}}}(b+c) = f_{a+b,\mathsmaller{\mathcal{I}}}(c) + f_{a,\mathsmaller{\mathcal{I}}}(b), \] for all $c \in \mathcal{I}_{\sa}$. Since $c \mapsto f_{a+b,\mathsmaller{\mathcal{I}}}(c)$ is $k$-times differentiable at $0 \in \mathcal{I}_{\sa}$, we conclude that $f_{a,\mathsmaller{\mathcal{I}}}$ is $k$-times differentiable at $b$ with \[ D^kf_{a,\mathsmaller{\mathcal{I}}}(b) = D^kf_{a+b,\mathsmaller{\mathcal{I}}}(0) = D_{\mathsmaller{\mathcal{I}}}^kf(a+b). \] With this in mind, here is the main result of this section. \begin{thm}[\textbf{Derivatives of Operator Functions in ISNIs}]\label{thm.deropfunc} Suppose $(\mathcal{I},\|\cdot\|_{\mathcal{I}}) \unlhd \mathcal{M}$ is integral symmetrically normed, and let $a \aff \mathcal{M}_{\sa}$. If $f \in OC^{[k]}(\mathbb{R})$, then $f_{a,\mathsmaller{\mathcal{I}}} \colon \mathcal{I}_{\sa} \to \mathcal{I}$ is defined everywhere, and $f_{a,\mathsmaller{\mathcal{I}}} \in C^k(\mathcal{I}_{\sa};\mathcal{I})$. In particular, $f$ is $k$-times $\mathcal{I}$-differentiable. Moreover, \[ D_{\mathsmaller{\mathcal{I}}}^kf(a)(b_1,\ldots,b_k) = \sum_{\gamma \in S_k}f^{[k]}(\underbrace{a,\ldots,a}_{\mathsmaller{k+1 \text{ times}}})\text{\smaller $\#$} (b_{\gamma(1)},\ldots,b_{\gamma(k)}), \] for all $(b_1,\ldots,b_k) \in \mathcal{I}_{\sa}^k$. By the observation above, we therefore also have \[ D^kf_{a,\mathsmaller{\mathcal{I}}}(c)(b_1,\ldots,b_k) = D_{\mathsmaller{\mathcal{I}}}^kf(a+c)(b_1,\ldots,b_k) = \sum_{\gamma \in S_k}f^{[k]}(\underbrace{a+c,\ldots,a+c}_{k+1 \text{ times}})\text{\smaller $\#$} (b_{\gamma(1)},\ldots,b_{\gamma(k)}), \] for all $c,b_1,\ldots,b_k \in \mathcal{I}_{\sa}$. \end{thm} \begin{proof} Let $a \aff \mathcal{M}_{\sa}$. Notice that if $f \in OC^{[k]}(\mathbb{R})$, then $f \in C^1(\mathbb{R})$ and $f^{[1]} \in \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}}) \hat{\otimes}_i \ell^{\infty}(\mathbb{R},\mathcal{B}_{\mathbb{R}})$. In particular, by Corollary \ref{cor.Iperturb}, \[ f_{a,\mathsmaller{\mathcal{I}}}(c) = f(a+c)-f(a) \in \mathcal{I}, \] for all $c \in \mathcal{I}_{\sa}$. In addition, we observe that if $f \in OC^{[k]}(\mathbb{R})$, then the map \[ \mathcal{I}_{\sa} \ni c \mapsto I^{a+c,\ldots,a+c}f^{[k]} \in B_k(\mathcal{I}^k;\mathcal{I}) \] is continuous by Lemma \ref{lem.Icont}. Therefore, the claimed $k^{\text{th}}$ derivative map is, in fact, continuous. It therefore suffices to prove the claimed formula for $D_{\mathsmaller{\mathcal{I}}}^kf(a)$. We do so by induction on $k$. Fix $c \in \mathcal{I}_{\sa}$. By Theorem \ref{thm.perturb}, \begin{align*} f_{a,\mathsmaller{\mathcal{I}}}(c)-f_{a,\mathsmaller{\mathcal{I}}}(0)-f^{[1]}(a,a)\text{\smaller $\#$} h & = f(a+c)-f(a) - f^{[1]}(a,a)\text{\smaller $\#$} c \\ & = f^{[1]}(a+c,a)\text{\smaller $\#$} c - f^{[1]}(a,a)\text{\smaller $\#$} c \\ & = \big(I^{a+c,a}f^{[1]}-I^{a,a}f^{[1]}\big)(c). \end{align*} Therefore, by the Continuous Perturbation Lemma (Lemma \ref{lem.Icont}), \[ \frac{1}{\|c\|_{\mathcal{I}}}\big\|f_{a,\mathsmaller{\mathcal{I}}}(c)-f_{a,\mathsmaller{\mathcal{I}}}(0)-f^{[1]}(a,a)\text{\smaller $\#$} c\big\|_{\mathcal{I}} \leq \big\|I^{a+c,a}f^{[1]}-I^{a,a}f^{[1]}\big\|_{B(\mathcal{I})} \to 0 \] as $c \to 0$ in $\mathcal{I}_{\sa}$. This completes the proof when $k=1$. Next, let $k \geq 2$, and assume we have proven the claimed derivative formula when $f \in OC^{[k-1]}(\mathbb{R})$. To prove the formula for $f \in OC^{[k]}(\mathbb{R})$, we set some notation and make some preliminary observations. If $S$ is a set, $s \in S$, and $m \in \mathbb{N}_0$, then we write $s_{(m)} \coloneqq (s,\ldots,s) \in S^m$, where $s_{(0)}$ is the empty list. Now, fix $b = (b_1,\ldots,b_{k-1}) \in \mathcal{I}^{k-1}$ and $f \in OC^{[k]}(\mathbb{R}) \subseteq OC^{[k-1]}(\mathbb{R})$. By Theorem \ref{thm.perturb}, we have \begin{align*} \delta(b,c) & \coloneqq f^{[k-1]}\big((a+c)_{(k)}\big)\text{\smaller $\#$} b - f^{[k-1]}\big(a_{(k)}\big)\text{\smaller $\#$} b \\ & = \sum_{j=1}^k \big(f^{[k-1]}\big((a+c)_{(j)},a_{(k-j)}\big)\text{\smaller $\#$} b - f^{[k-1]}\big((a+c)_{(j-1)},a_{(k-j+1)}\big)\text{\smaller $\#$} b\big) \\ & = \sum_{j=1}^k f^{[k]}\big((a+c)_{(j)},a_{(k+1-j)}\big)\text{\smaller $\#$} (b_{j-},c,b_{j+}), \end{align*} using Notation \ref{nota.list}. Next, by the inductive hypothesis, \[ D^{k-1}f_{a,\mathsmaller{\mathcal{I}}}(c_0)(b) = \sum_{\alpha \in S_{k-1}} f^{[k-1]}\big((a+c_0)_{(k)}\big)\text{\smaller $\#$} b^{\alpha}, \] for all $c_0 \in \mathcal{I}_{\sa}$, where $b^{\alpha} = (b_{\alpha(1)},\ldots,b_{\alpha(k-1)})$. Combining this inductive hypothesis with the expression for $\delta(b,c)$ above gives \begin{align*} \textepsilon}(b,c) & \coloneqq D^{k-1}f_{a,\mathsmaller{\mathcal{I}}}(c)(b) - D^{k-1}f_{a,\mathsmaller{\mathcal{I}}}(0)(b) - \sum_{\alpha \in S_{k-1}}\sum_{j=1}^kf^{[k]}\big(a_{(k+1)}\big)\text{\smaller $\#$} (b_{j-}^{\alpha},c,b_{j+}^{\alpha}) \\ & = \sum_{\alpha \in S_{k-1}} \big(f^{[k-1]}\big((a+c)_{(k)}\big)\text{\smaller $\#$} b^{\alpha} - f^{[k-1]}\big(a_{(k)}\big)\text{\smaller $\#$} b^{\alpha}\big) - \sum_{\alpha \in S_{k-1}}\sum_{j=1}^kf^{[k]}\big(a_{(k+1)}\big)\text{\smaller $\#$} (b_{j-}^{\alpha},c,b_{j+}^{\alpha}) \\ & = \sum_{\alpha \in S_{k-1}}\Bigg(\delta(b^{\alpha},c) - \sum_{j=1}^kf^{[k]}\big(a_{(k+1)}\big)\text{\smaller $\#$} (b_{j-}^{\alpha},c,b_{j+}^{\alpha})\Bigg) \\ & = \sum_{\alpha \in S_{k-1}}\sum_{j=1}^k\big(f^{[k]}\big((a+c)_{(j)},a_{(k+1-j)}\big)\text{\smaller $\#$} (b_{j-}^{\alpha},c,b_{j+}^{\alpha})-f^{[k]}\big(a_{(k+1)}\big)\text{\smaller $\#$} (b_{j-}^{\alpha},c,b_{j+}^{\alpha})\big). \end{align*} It follows that \[ \frac{\|\textepsilon}(\cdot,c)\|_{B_{k-1}(\mathcal{I}_{\sa}^{k-1};\mathcal{I})}}{\|c\|_{\mathcal{I}}} \leq (k-1)!\sum_{j=1}^k\big\|I^{(a+c)_{(j)},a_{(k+1-j)}}f^{[k]}-I^{a_{(k+1)}}f^{[k]}\big\|_{B_k(\mathcal{I}^k;\mathcal{I})} \to 0 \] as $c \to 0$ in $\mathcal{I}_{\sa}$ by the Continuous Perturbation Lemma. Writing $\tilde{b} \coloneqq (b_0,b_1,\ldots,b_{k-1})$, this proves \[ D_{\mathsmaller{\mathcal{I}}}^kf(a)(\tilde{b}) = D^kf_{a,\mathsmaller{\mathcal{I}}}(0)(\tilde{b}) = \sum_{\alpha \in S_{k-1}}\sum_{j=1}^kf^{[k]}\big(a_{(k+1)}\big)\text{\smaller $\#$} (b_{j-}^{\alpha},b_0,b_{j+}^{\alpha}) = \sum_{\gamma \in S_k}f^{[k]}\big(a_{(k+1)}\big)\text{\smaller $\#$}\tilde{b}^{\gamma}, \] as claimed. This completes the proof. \end{proof}
\section*{Acknowledgments} \begin{abstract} In this paper, we propose a a machine learning approach via model-operator-data network (MOD-Net) for solving PDEs. A MOD-Net is driven by a model to solve PDEs based on operator representation with regularization from data. For linear PDEs, we use a DNN to parameterize the Green's function and obtain the neural operator to approximate the solution according to the Green's method. To train the DNN, the empirical risk consists of the mean squared loss with the least square formulation or the variational formulation of the governing equation and boundary conditions. For complicated problems, the empirical risk also includes a few labels, which are computed on coarse grid points with cheap computation cost and significantly improves the model accuracy. Intuitively, the labeled dataset works as a regularization in addition to the model constraints. The MOD-Net solves a family of PDEs rather than a specific one and is much more efficient than original neural operator because few expensive labels are required. We numerically show MOD-Net is very efficient in solving Poisson equation and one-dimensional radiative transfer equation. For nonlinear PDEs, the nonlinear MOD-Net can be similarly used as an ansatz for solving nonlinear PDEs, exemplified by solving several nonlinear PDE problems, such as the Burgers equation. \end{abstract} \ams{35C15; 35J05; 35Q20; 35Q49; 45K05} \keywords{Deep neural network; Radiative transfer equation; Green's Method; Neural operator.} \maketitle \section{Introduction} Nowadays, using deep neural networks (DNNs) to solve PDEs attracts more and more attention~\cite{weinan2020machine,E2020algorithms,weinan2017deep, weinan2018deep, he2020relu, liao2021deep, raissi2019physics, hamilton2019dnn, strofer2019data,liu2020multi,li2020multi,li2020neural,li2020fourier,lu2019deeponet,markidis2021physics}. Here we review three DNN approaches for solving PDEs. The first approach is to parameterize the solution by a DNN and use the mean square of the residual of the equation~\cite{dissanayake1994neural,raissi2019physics} or the variational forms~\cite{weinan2018deep,liao2021deep} as risk or loss, by minimizing which the DNN output satisfies PDE. A comprehensive overview can be found in~\cite{E2020algorithms}. This parameterization approach can solve very high-dimensional PDEs and does not require any labels. However, it only solves a specific PDE during each training trial, that is, if the PDE setup changes, such as the source terms, the boundary conditions or other parameters in the PDE, we have to train a new DNN. An important characteristic of the parameterization approach is slow learning of the high frequency part as indicated by the frequency principle~\cite{xu_training_2018,xu2019frequency,markidis2021physics}. To overcome the curse of high frequency, a series of multiscale approaches are proposed~\cite{cai2020phase,liu2020multi,li2020multi,Matthew2020Fourier,wang2021eigenvector}. The second approach uses DNN to learn the mapping from the source term to the solution~\cite{fan2019multiscale}. In this approach, the source function and the solution are sampled at fixed grid points as two vectors. Then the vector of the source function is fed into the DNN to predict the vector of the solution function. The advantage of this mapping approach is that the DNN solves the PDE for any source function, thus it can be very convenient in application. However, the mapping approach can only evaluate the solution at fixed points. DeepOnet~\cite{lu2019deeponet} is proposed that the source function is still fed into the network on fixed grid points but the output can be evaluated on any points by adding on extra inputs of the points to the network. Such approach requires very large sample points, which is often computational inefficient or intractable, especially when dealing with high-dimensional PDEs or complicated integro-differential equations, such as Boltzmann equation and radiative transfer equation (RTE). The third approach is called neural operator~\cite{li2020neural,li2020fourier}, which represents the solution based on the form similar to the idea of the Green's function and the DNN is used to parametrize the Green's function. The neural operator solves a type of PDEs but not a specific PDE and can be evaluated at any time or spatial points. Training of the neural operator is to minimize the difference between the learned solution and the true solution at randomly sampled points. Therefore, the neural operator is a data-driven method and requires a large amount of labels, a similar difficulty to the mapping approach. In this work, we propose a machine learning approach via model-operator-data network (MOD-Net) for solving PDEs. The MOD-Net has advantages including: (i) obtaining a functional representation of the solution which allows evaluating the solution at any points; (ii) requiring none or few labels numerically computed by a traditional scheme on coarse grid points with cheap computation; (iii) solving a family of PDEs but not a specific PDE. The three key components of MOD-Net are illustrated as follows. \textbf{Model driven.} MOD-Net is driven by the physical model to avoid using too much expensive labeled data. That is, the empirical risk, i.e., training loss requires the solution satisfying the constraints of the governing PDE or equivalent forms and boundary conditions. To realize the model constraint, one can use various methods, such as minimizing the mean square of the residual of the governing PDE and boundary conditions (e.g., physics-informed neural network~\cite{dissanayake1994neural,raissi2019physics}), or minimizing the variational form of the governing PDE and boundary conditions (e.g., Deep-Ritz method~\cite{weinan2018deep}). \textbf{Operator representation.} Similar to the neural operator~\cite{li2020neural,li2020fourier}, the MOD-Net represents the solution operator of a PDE, i.e, mapping from source terms, boundary conditions, or parameters to the solution. In this work, DNN is used to parameterize the Green's function, however, it is not restricted to use Green's function and can be generalized to other architectures. This operator representation utilizes the invariant characteristic of Green's function in solving PDE, thus, might be more efficient than an end-to-end representation by parameterizing solution with a DNN directly. \textbf{Data regularization.} In MOD-Net, we find that in complicated problems, with only the model constraints, the solution is often very inaccurate even when the empirical risk is reasonably small. For example, the radiative/linear transport equations only have a hypercoercive integro-differential operator instead of a nice coercive operator like common elliptic equations. This degeneracy property makes the velocity space may have bad regularity provided some singular coefficients in the equation thus leads to the existence of many ``weak solutions'' to choose from. To overcome this problem, we add a regularization term by minimizing the difference between the MOD-Net prediction and a few labels numerically computed by a traditional scheme on coarse grid points with cheap computation cost. Note that with only the small amount of labeled data, the MOD-Net cannot be well trained either. Therefore, the effect of the labeled data in MOD-Net is different from supervised learning, in which a DNN training often requires a large amount of accurate labeled data. Intuitively, the effect of data in MOD-Net works as an regularization similar to various regularization terms in traditional optimization problems. We first apply MOD-Net to solve simple Poisson equations, in which we show that without labels, MOD-Net with the mean square loss or the variational loss of PDE, i.e., governing equation and boundary conditions, can learn the Poisson equation well. We further apply MOD-Net to a class of equations controlled by parameters, which can be regarded as PDEs with uncertainty or a simplification of complicated control problem. For these equations, we can not train the MOD-Net well with only the physical information, however, with the model information and a few labels, we can well train MOD-Net. The data regularization also significantly improves the model accuracy for the RTE~\cite{chandrasekhar2013radiative,lenoble1985radiative}, which is important in real applications, such as simulation of nuclear reactor, optical tomography and radiation therapy. Besides for these linear PDEs, we also apply nonlinear MOD-Net to the one-dimensional Burgers equation and two-dimensional nonlinear equations. In these two cases, we use no labeled data and only utilize the information of the PDE and we can also well train the nonlinear MOD-Net. The rest of the paper is organized as follows. In section~\ref{sec:DNN}, we will give a brief introduction of DNNs. Section~\ref{sec:MOD-Net} will present MOD-Net structures. Section~\ref{sec:poi} will show the numerical results for Poisson equations. In section~\ref{sec:toyexample}, we show the numerical experiments for constructed toy equations. In section~\ref{sec:boltz}, we show numerical experiments for one-dimensional RTE. In section~\ref{sec:Burgers}, we show numerical results for one-dimensional Burgers equation. Section~\ref{sec:nonlinear} will show the numerical experiments for two-dimensional nonlinear equation. Finally, section~\ref{sec:con} gives a conclusion and some discussions for future work. \section{Preliminary: Deep neural networks} \label{sec:DNN} We introduce the following conventional notations for DNNs\footnote{BAAI.2020.\ Suggested Notation for Machine Learning.\ https://github.com/mazhengcn/suggested-notation-for-machine-learning.}. An $L$-layer neural network is defined recursively as, \begin{equation} \begin{aligned} & \vf_{\vtheta}^{[0]}(\vx)=\vx, \\ & \vf_{\vtheta}^{[l]}(\vx)=\sigma\circ(\mW^{[l-1]} \vf_{\vtheta}^{[l-1]}(\vx) + \vb^{[l-1]}), \quad 1\leq l\leq L-1, \\ & \vf_{\vtheta}(\vx)=\vf_{\vtheta}^{[L]}(\vx)=\mW^{[L-1]} \vf_{\vtheta}^{[L-1]}(\vx) + \vb^{[L-1]}, \end{aligned} \end{equation} where $\mW^{[l]} \in \sR^{m_{l+1}\times m_{l}}$, $\vb^{[l]}=\sR^{m_{l+1}}$, $m_0=d_{\rm in}=d$ is the input dimension, $m_{L}=d_{\rm o}$ is the output dimension, $\sigma$ is a scalar function and ``$\circ$'' means entry-wise operation. We denote the set of parameters by $\vtheta$. A loss function $\ell(f_{\vtheta}(\vx),\vy)$ measures the difference between a prediction and a true label. The empirical risk, also known as the training loss for a set $S=\{(\vx_i,\vy_i)\}_{i=1}^{n}$ is denoted by $\RS(\vtheta)$, \begin{equation} \RS(\vtheta) = \frac{1}{n}\sum_{i=1}^n\ell(f_{\vtheta}(\vx_i),\vy_i). \end{equation} More generally, the empirical risk can be defined without labels. Two common empirical risks used for solving PDEs are least square loss (e.g., physics-informed neural network~\cite{dissanayake1994neural,raissi2019physics}) and variational loss (e.g., Deep-Ritz method~\cite{weinan2018deep}). For example, if we want to use DNN $f_{\vtheta}$ to learn the solution $u(\vx)$ of an equation such as $\fL[u](\vx)=\vzero$ for $\vx\in\Omega$, the empirical risk with least square loss for this equation can be defined by \begin{equation} \RS(\vtheta) =\frac{1}{n}\sum_{i=1}^n\|\fL[f_{\vtheta}](\vx_i)\|_2^2, \end{equation} where the dataset $\{\vx_i\}_{i=1}^n$ is randomly sampled from $\Omega$ at each iteration step. For some problems, we can use the variational form of the equation to define the loss. More precisely if the solution is the minimizer of the functional $I[u](x)$ whose density denoted by $\ell[u](x)$, then the variational loss can be defined by \begin{equation} \RS(\vtheta) =\frac{1}{n}\sum_{i=1}^n \ell[f_{\vtheta}](\vx_i), \end{equation} where the dataset $\{\vx_i\}_{i=1}^n$ is randomly sampled from $\Omega$ at each iteration step. The empirical risk can also be defined by the weighted summation of the empirical risk of the labeled data and the empirical risk of the equation. If more constraints needed in the problem, such as boundary conditions, the empirical risk can be similarly adopted. \section{Model-operator-data network (MOD-Net)} \label{sec:MOD-Net} Our goal is to solve the following PDE efficiently and accurately, \begin{equation}\label{linearPDE} \left\{ \begin{aligned} & \fL [u](\vx) = g(\vx),\quad \vx \in \Omega, \\ & u(\vx) = \phi(\vx), \quad \vx \in \partial \Omega, \end{aligned} \right. \end{equation} where $\fL$ is the operator that can be a usual differential operator or even integro-differential operator. Our basic idea is to use a DNN to learn the operator $\fG: (\phi,g) \mapsto u$, i.e., for each given boundary condition $\phi$ and source term $g$, there is $\fG(\phi,g) = u$. For a linear PDE, Green's function can help us obtain the solution of PDE due to the superposition principle. With the Green's function method, we have the following representation of the solution of PDE~\eqref{linearPDE}, \begin{equation}\label{representation} u(\vx;\phi,g) = \int_{ \Omega }G_1(\vx,\vx') g(\vx') \diff{\vx'} + \int_{\partial \Omega} G_2(\vx,\vx') \phi(\vx') \diff{\vx'}. \end{equation} where for any fixed $\vx'\in \Omega$, $G_1(\vx,\vx')$ is the solution of the following equation, \begin{equation*} \left\{ \begin{aligned} & \fL [G_1](\vx) = \delta(\vx-\vx'),\quad \vx \in \Omega, \\ & G_1(\vx,\vx') = 0, \quad \vx \in \partial \Omega, \end{aligned} \right. \end{equation*} and for any fixed $\vx'\in \partial \Omega$, $G_2(\vx,\vx')$ is the solution of the following equation, \begin{equation*} \left\{ \begin{aligned} & \fL [G_2](\vx) = 0,\quad \vx \in \Omega, \\ & G_2(\vx,\vx') = \delta(\vx-\vx'), \quad \vx \in \partial \Omega. \end{aligned} \right. \end{equation*} For the nonlinear PDE, we can extend the Green's function method for the nonlinear case and use the following representation, \begin{equation*}\label{nonlinear_representation} \begin{aligned} u(\vx;\phi,g) = F\left(\int_{ \Omega } G_1(\vx,\vx') g(\vx') \diff{\vx'} + \int_{\partial \Omega } G_2(\vx,\vx') \phi(\vx') \diff{\vx'}\right), \end{aligned} \end{equation*} where $F(\vx)$ is a nonlinear function and is represented by DNN $F_{\vtheta}(\vx)$ in this work. However, it is difficult to obtain the analytical formula of the operators $G_1$ and $G_2$. In the following, we consider using DNN to represent operators $G_1$ and $G_2$, i.e., a DNN $G_{\vtheta_1}(\vx,\vx')$ is trained to represent $G_1(\vx,\vx')$, similarly, another DNN $G_{\vtheta_2}(\vx,\vx')$ is used for $G_2(\vx,\vx')$. By implementing $G_{\vtheta_1}(\vx,\vx')$ and $G_{\vtheta_2}(\vx,\vx')$ into Eq. (\ref{representation}) and Eq. (\ref{nonlinear_representation}), we obtain a DNN representation for $u(\vx;\phi,g)$ as $u_{\vtheta_1,\vtheta_2}(\vx;\phi,g)$. In application, the integration in Eq. (\ref{representation}) and Eq. (\ref{nonlinear_representation}) is realized by discrete numerical schemes. For example, we consider Monte-Carlo algorithm where we uniformly sample a set $S_{G,\Omega}$ from $\Omega$ and a set $S_{G,\partial\Omega}$ from $\partial\Omega$, then, for the linear PDE, \begin{equation} u_{\vtheta_1,\vtheta_2}(\vx;\phi,g) = \frac{|\Omega|}{|S_{G,\Omega}|}\sum_{\vx'\in S_{G,\Omega}} G_{\vtheta_1}(\vx,\vx') g(\vx') +\frac{|\partial\Omega|}{|S_{G,\partial\Omega}|} \sum_{\vx'\in S_{G,\partial\Omega}} G_{\vtheta_2}(\vx,\vx')\phi(\vx'), \end{equation} and for the nonlinear PDE, \begin{equation} u_{\vtheta_1,\vtheta_2}(\vx;\phi,g) = F_{\vtheta}\Big( \frac{|\Omega|}{|S_{G,\Omega}|}\sum_{\vx'\in S_{G,\Omega}} G_{\vtheta_1}(\vx,\vx') g(\vx') +\frac{|\partial\Omega|}{|S_{G,\partial\Omega}|} \sum_{\vx'\in S_{G,\partial\Omega}} G_{\vtheta_2}(\vx,\vx')\phi(\vx')\Big). \end{equation} \begin{figure}[H] \centering \includegraphics[scale=0.06]{MOD-Net-schematic.png} \caption{Schematic of MOD-Net approach. In MOD-Net approach, we use the DNN $G_{\vtheta_1}$ and $G_{\vtheta_2}$ to parameter the Green's function $G_1$ and $G_2$, respectively. And according to the Green's formula, we obtain $u_{\vtheta_1,\vtheta_2}$ which can approximate solution operator. Then we train these DNNs utilizing the information of PDE, i.e., governing equation and boundary conditions, and a few data. } \label{fig:schematic} \end{figure} To train the neural networks, we would utilize the information of PDE, i.e., governing equation and boundary conditions, and a few data $S^{u,k}=\{\vx_i,u^{k}(\vx_i)\}_{i\in [n_k]}$ for each $\{\phi^{k},g^k\}, k=1,2,\cdots,K$, where $K$ is the total number of examples/observations and $u^{k}(\cdot)=u(\cdot;\,\phi^{k},g^k)$. Note that $S^{u,k}$ can be numerically solved by traditional schemes on coarse grid points, which is not computationally expensive or even obtained from experiment observations. To utilize the constraint of governing PDE, for each $k$, we uniformly sample a set of data from $\Omega$, i.e., $S^{\Omega,k}$. To utilize the information of boundary constraint, for each $k$, we uniformly sample a set of data from $\partial\Omega$, i.e., $S^{\partial\Omega,k}$. Then, we train the neural networks by minimizing the empirical risk defined as follows, \begin{equation} \begin{aligned} \RS & = \frac{1}{K}\sum_{k\in[K]} \Big( \lambda_1 \frac{1}{|S^{\Omega,k}|} \sum_{\vx\in S^{\Omega,k}} \| \fL [u_{\vtheta_1,\vtheta_2}(\vx;\phi^{k},g^k)](\vx)-g^k(\vx) \|_2^2 \\ & ~~~~+\lambda_2 \frac{1}{|S^{\partial\Omega,k}|} \sum_{\vx\in S^{\partial\Omega,k}} \| u_{\vtheta_1,\vtheta_2}(\vx;\phi^{k},g^k) - \phi^k(\vx) \|_2^2 \\ & ~~~~+ \lambda_3 \frac{1}{n_k} \sum_{i\in [n_k]} \|u_{\vtheta_1,\vtheta_2}(\vx_i;\phi^{k},g^k)-u^{k}(\vx_i)\|_2^2 \Big), \label{lossfunctiondefinition} \end{aligned} \end{equation} where $\lambda_1,\lambda_2,\lambda_3$ are hyperparameters used to tune the weight of each part in the total risk. Here we remark that the least square loss is not crucial, we can use other loss such as variational loss, see example~2. Also the labeled data is not restricted the true solution, we can use other data as regularization term, such as the macroscopic quantities, e.g., the density function $\rho(x_i)$ in the RTE, which is a moment of the solution. An important advantage of our proposed MOD-Net method is that we take advantage of the PDE constraint and use cheap not-so-accurate labeled data. For convenience, the notations are listed in Table~\ref{table1}. In real applications, depending on the problems, if the boundary condition is zero, such as the Poisson case in section~\ref{sec:poi}, $G_2$ is ignored, and if the source term is zero, such as the RTE case in section~\ref{sec:boltz}, $G_1$ is ignored. For one-dimensional case, the integration over boundary is the summation at two points, therefore, we can use two DNNs to learn $G_2(\vx,\vx')|_{\vx^\prime = \vx_{L}}$ and $G_2(\vx,\vx')|_{\vx^\prime = \vx_{R}}$, respectively, where $\vx_{L}$ and $\vx_{R}$ are boundary points. The input of the two DNNs are lower dimensional due to the fixation of $\vx^\prime$. The amount of the labeled data required also depends on the problem. For simple problems, such as Poisson problem, we use no labeled data, but for complicated constructed toy example or RTE problem, we use a few labeled data. \begin{table}[htbp] \centering \caption{Notation} \label{table1} \begin{tabular}{|c|c|} \hline $\fL$ & PDE operator \\ \hline $g$ & source term in PDE \\ \hline $\phi$ & boundary value in PDE \\ \hline $\fG$ & operator to be learned, general definition is $\fG: (\phi,\sigma,g) \mapsto u$ \\ \hline $[n]$ & index set $\{1,2,...,n\}$ \\ \hline $S_{G_x},S_{G_y},S_{G_v}^+,S_{G_v}^-$ & the set of integration points in solution's representation \\ \hline $S_{v}$ & the set of integration points in $v$ direction \\ \hline $\omega$ & integration coefficients \\ \hline $S^{\Omega}$ & a set of data uniformly sampled from $\Omega$ \\ \hline $S^{\partial\Omega}$ & a set of data uniformly sampled from $\partial\Omega$ \\ \hline $S^{u,k}=\{\vx_i,u^k(\vx_i)\}_{i=1}^{n_k}$ & labeled data set for $k$th PDE, where $u^k(\cdot)$ is solution of $k$th PDE \\ \hline $F_{\vtheta}(\vx),G_{\vtheta}(\vx),u_{\vtheta}(\vx)$ & DNN \\ \hline \end{tabular} \end{table} \section{Numerical experiments: $2$D Poisson equation} \label{sec:poi} We consider the Poisson equations in $2$D, \begin{equation}\label{Poisson} \begin{aligned} -\Delta u(\vx) & =g(\vx), \quad \vx\in \Omega, \\ u(\vx) & =0, \quad \vx\in \partial \Omega. \end{aligned} \end{equation} where the source function $g(x,y)=-a(x^2-x+y^2-y)$, i.e., \begin{equation}\label{2D_Poisson_case} \begin{aligned} -(\partial_{xx}u+\partial_{yy}u) & =-a(x^2-x+y^2-y), \quad (x,y)\in \Omega, \\ u & = 0, \quad (x,y)\in \partial \Omega, \end{aligned} \end{equation} where $\Omega=[0,1]^2$ and the constant $a$ controls the source term. Obviously, the analytical solution is $u(x,y;g)=\frac{a}{2}x(x-1)y(y-1)$. \subsection{Use DNN to fit Green's function} For Poisson equation, which is a linear PDE, using the Green's function method, the solution of~\eqref{Poisson} can be represented by \begin{equation} u(\vx;g) =\int_{\Omega} G(\vx,\vx')g(\vx') \diff{\vx'}, \end{equation} where for any $x'\in \Omega$, the Green's function $G(\vx,\vx')$ is the solution of following problem, \begin{equation} \begin{aligned} & -\Delta G(\vx,\vx')=\delta(\vx-\vx') \quad \vx\in \Omega \\ & G(\vx,\vx')=0, \quad \vx\in \partial \Omega. \end{aligned} \end{equation} In the considered $2$D case, $\Omega=[0,1]^2$ and $g(x,y)=-a(x^2-x+y^2-y)$, we have \begin{equation} u(x,y;g) = \int_0^1\int_0^1 G(x,y,x',y')g(x',y') \diff{x'}\diff{y'}. \end{equation} For demonstration, although we can obtain the analytical form of the Green's function, we use a DNN of hidden layer size $128$-$128$-$128$-$128$ $G_{\vtheta}(x,y,x',y')$ to fit the Green's function $G(x,y,x',y')$. When we calculate the integral, it is impossible to integrate it analytically. In practice, we often use the numerical integration. We use the Gauss-Legendre quadrature. Then we can represent neural operator $u_{\vtheta}(x,y;g)$ with Green's function DNN $G_{\vtheta}(x,y,x',y')$, that is, \begin{equation} \begin{aligned} u_{\vtheta}(x,y;g) = \sum_{x^\prime \in S_{G_x}}\sum_{y^\prime \in S_{G_y}} \omega_{x^\prime} \omega_{y^\prime} G_{\vtheta}(x,y,x^\prime,y^\prime)g(x^\prime,y^\prime), \end{aligned} \label{Poiss_Gausianint} \end{equation} where $S_{G_x}\subset[0,1]$,$S_{G_y}\subset[0,1]$ consist fixed integration points, determined by $1$D Gauss-Legendre quadrature and $\omega_{x^\prime}$, $\omega_{y^\prime}$ are corresponding coefficients. \subsection{Empirical risk function} For this toy example, to train the neural networks, we use no labeled data and only utilize the information of PDE, i.e., governing equation and boundary condition, for each $g^k,k=1,2,\cdots,K$. To utilize the constraint of governing equation of PDE, we uniformly sample a set of data from $\Omega=[0,1] \times [0,1]$, i.e., $S^{\Omega,k}$. To utilize the information of boundary constraint, for each $k$, we uniformly sample a set of data from $\partial\Omega$. Since the boundary $\partial\Omega$ consists of four line segments, i.e., $\partial\Omega=\bigcup_{i=1}^{4}\partial\Omega_i$, where $\partial\Omega_1=\{(0,y)\}_{y\in[0,1]}$,$\partial\Omega_2= \{(1,y)\}_{y\in[0,1]}$,$\partial\Omega_3=\{(x,0)\}_{x\in[0,1]}$,$\partial\Omega_4=\{(x,1)\}_{x\in[0,1]}$, we uniformly sample a set of data from $\partial\Omega_i$ respectively, i.e., $S^{\partial\Omega_i,k}$, i=1,2,3,4. Since we use no labeled data, $\lambda_3$ in the general definition (\ref{lossfunctiondefinition}) is set as zero. The empirical risk for this example is as follows, \begin{equation} \begin{aligned} \RS & = \frac{1}{K}\sum_{k\in[K]} \bigg(\lambda_1 \frac{1}{|S^{\Omega,k}|}\sum_{(x,y) \in S^{\Omega,k}}\Big( -\big( \partial_{xx}u_{\vtheta}(x,y;g^k)+\partial_{yy}u_{\vtheta}(x,y;g^k)\big) -g^k(x,y) \Big)^{2} \\ & \quad + \lambda_2 \frac{1}{|S^{\partial\Omega_1,k}|}\sum_{(x,y) \in S^{\partial\Omega_1,k}} {u_{\vtheta}(x,y;g^k)}^{2} \\ & \quad + \lambda_2 \frac{1}{|S^{\partial\Omega_2,k}|}\sum_{(x,y) \in S^{\partial\Omega_2,k}} {u_{\vtheta}(x,y;g^k)}^{2} \\ & \quad + \lambda_2\frac{1}{|S^{\partial\Omega_3,k}|}\sum_{(x,y) \in S^{\partial\Omega_3,k}} {u_{\vtheta}(x,y;g^k)}^{2} \\ & \quad + \lambda_2\frac{1}{|S^{\partial\Omega_4,k}|}\sum_{(x,y) \in S^{\partial\Omega_4,k}} {u_{\vtheta}(x,y;g^k)}^{2} \bigg). \label{laplace_leastsquareloss} \end{aligned} \end{equation} Note that, the least square loss in (\ref{lossfunctiondefinition}) is not crucial. To support this point, we also use the variational loss used in Deep Ritz Method and the empirical risk is as follows, \begin{equation} \begin{aligned} \RS & = \frac{1}{K}\sum_{k\in[K]} \bigg(\lambda_1 \frac{1}{|S^{\Omega,k}|}\sum_{(x,y) \in S^{\Omega,k}}\Big(\frac{1}{2} \big( |\partial_{x}u_{\vtheta}(x,y;g^k)|^2+|\partial_{y}u_{\vtheta}(x,y;g^k)|^2\big) -g^k(x,y)u_{\vtheta}(x,y;g^k) \Big) \\ & \quad + \lambda_2 \frac{1}{|S^{\partial\Omega_1,k}|}\sum_{(x,y) \in S^{\partial\Omega_1,k}} {u_{\vtheta}(x,y;g^k)}^{2} \\ & \quad + \lambda_2 \frac{1}{|S^{\partial\Omega_2,k}|}\sum_{(x,y) \in S^{\partial\Omega_2,k}} {u_{\vtheta}(x,y;g^k)}^{2} \\ & \quad + \lambda_2\frac{1}{|S^{\partial\Omega_3,k}|}\sum_{(x,y) \in S^{\partial\Omega_3,k}} {u_{\vtheta}(x,y;g^k)}^{2} \\ & \quad + \lambda_2\frac{1}{|S^{\partial\Omega_4,k}|}\sum_{(x,y) \in S^{\partial\Omega_4,k}} {u_{\vtheta}(x,y;g^k)}^{2} \bigg). \label{laplace_deepritzloss} \end{aligned} \end{equation} \subsection{Learning process} For each training epoch, we first randomly choose source functions $\{g^k\}_{k=1}^{K}$ and calculate their values on fixed quadrature points$(x',y')$, where $x' \in S_{G_x}$ and $ y' \in S_{G_y}$. Second, we randomly sample data and obtain data set $S^{\Omega,k},S^{\partial \Omega_i,k},i=1,2,3,4$. We obtain the dataset $D= \{(x,y,x',y',g^k(x',y'))| (x,y)\in S^{\Omega,k} \cup (\bigcup_{i=1}^{4} S^{\partial\Omega_i,k}),x'\in S_{G_x},y' \in S_{G_y}\}$. In the following, we feed the data into the neural network $G_{\vtheta}(x,y,x',y')$ and calculate the total risk~\eqref{laplace_leastsquareloss} or~\eqref{laplace_deepritzloss} with neural operator $u_{\vtheta}(x,y;g)$, see Eq. (\ref{Poiss_Gausianint}). We train neural network $G_{\vtheta}$ with Adam to minimize the total risk, and finally we obtain a well-trained Green's function DNN $G_{\vtheta}$, furthermore, according to Eq.~\ref{Poiss_Gausianint}, we obtain a neural operator $u_{\vtheta}(x,y;g)$. \subsection{Results} The source function $g(x,y)=-a(x^2-x+y^2-y)$ is determined by $a$. We then denote source function $g(x,y)=-a(x^2-x+y^2-y)$ by $g_a$. To illustrate our approach, we train a neural operator mapping from $g$ to the solution of the Poisson equation~\eqref{2D_Poisson_case}. \paragraph{Example 1: MOD-Net for a family of Poisson equations using least square loss} For illustration, we would train the MOD-Net by various source functions and test the MOD-Net with several source functions that are not used for training. In this example, we calculate the empirical risk with least square loss. During training, for each epoch, we choose a family of source functions, for example, we sample $K=10$ source functions $g_a$ from selected region, that is, we sample control parameter $a$ uniformly from $\{10k\}_{k=1}^{20}$. We set the number of integration points $|S_{G_x}|=10$ and $|S_{G_y}|=10$, and for each epoch, we randomly sample $200$ points in $[0,1]^2$ and sample $200$ points in each line of boundary, respectively. We set $\lambda_1=1,\lambda_2=1$ in the empirical risk using least square loss~\eqref{laplace_leastsquareloss}. \begin{figure \centering \subfigure[$a=15$]{ \includegraphics[scale=0.11]{analytic_a_15.png} } \subfigure[$a=15$]{ \includegraphics[scale=0.11]{DNN_a_15.png} } \subfigure[$a=15$]{ \includegraphics[scale=0.11]{poisson_laplace_op_a_15_error.png} } \caption{Example 1. Comparison between analytic solution and MOD-Net solution on $101\times101$ grid points corresponding to source terms determined by $a=15$. (a) Analytic solution. (b) MOD-Net solution. (c) The difference between the analytic solution and MOD-Net solution. Since the error at most points are very small, here we reduce the upper limit of the Color bar to see more information. } \label{fig:Poisson_op_contrast_leastsquare_error} \end{figure} We test the performance of this well-trained MOD-Net on $a=15$. For each fixed $a$, the corresponding exact true solution is $u(x,y)=\frac{a}{2}x(x-1)y(y-1)$. For visualizing the performance of our well-trained MOD-Net, we show the analytic solution and MOD-Net solution on $101\times 101$ equidistributed isometric grid points by color in Fig. \ref{fig:Poisson_op_contrast_leastsquare_error}. To compare these two solutions more intuitively, we calculate the difference of the two solutions at each point and show the error by color ,i.e., as the error increases, the color changes from blue to red, in Fig. \ref{fig:Poisson_op_contrast_leastsquare_error}(c). The root of mean square error (RMSE) is $\sim 5.2\times 10^{-4}$. We also show the solution obtained by MOD-Net and the corresponding analytical solution on fixed $x=0,0.5,1$ for considered test source function. As shown in Fig. \ref{fig:Poisson_op_contrast_leastsquare_section}, the MOD-Net can well predict the analytic solutions. \begin{figure}[!htb] \centering \subfigure[$a=15,x=0.0$]{ \includegraphics[scale=0.11]{poisson_laplace_op_a_15_x_0.0.png} } \subfigure[$a=15,x=0.5$]{ \includegraphics[scale=0.11]{poisson_laplace_op_a_15_x_0.5.png} } \subfigure[$a=15,x=1.0$]{ \includegraphics[scale=0.11]{poisson_laplace_op_a_15_x_1.0.png} } \caption{Example 1. Comparison between analytic solution and MOD-Net solution on $x=0,0.5,1$ corresponding to source function determined by test $a=15$.} \label{fig:Poisson_op_contrast_leastsquare_section} \end{figure} \paragraph{Example 2: MOD-Net for a family of Poisson equations using variational loss} In this experiment, we also train the MOD-Net by various source functions. But, note that, in this example, we calculate the empirical risk with variational loss used in Deep Ritz Method. In training, for each epoch, similarly we set $K=10$ and we sample control parameter $a$ uniformly from $\{10k\}_{k=1}^{20}$. We set the number of integration points $|S_{G_x}|=10$ and $|S_{G_y}|=10$, and for each epoch, we randomly sample $600$ points in $[0,1]^2$ and sample $600$ points in each line of boundary, respectively. We set $\lambda_1=1,\lambda_2=250$ in the empirical risk using least square loss (\ref{laplace_deepritzloss}). \begin{figure} \centering \subfigure[$a=15$]{ \includegraphics[scale=0.11]{deepritz_laplace_op_a_15_analytic.png} } \subfigure[$a=15$]{ \includegraphics[scale=0.11]{deepritz_laplace_op_a_15_DNN.png} } \subfigure[$a=15$]{ \includegraphics[scale=0.11]{deepritz_laplace_op_a_15_error.png} } \caption{Example 2. Comparison between analytic solution and MOD-Net solution on $101\times101$ grid points corresponding to source terms determined by $a=15$. (a) Analytic solution. (b) MOD-Net solution. (c) The difference between the analytic solution and MOD-Net solution.} \label{fig:Poisson_op_contrast_variationalloss_error} \end{figure} We test the performance of this well-trained MOD-Net on $a=15$. For each fixed $a$, the corresponding exact true solution is $u(x,y)=\frac{a}{2}x(x-1)y(y-1)$. For visualizing the performance of our well-trained MOD-Net, similarly we show the analytic solution and MOD-Net solution on $101\times101$ equidistributed isometric grid points by color. To compare these two solutions more intuitively, similarly we calculate the difference of the two solutions at each point and show the error by color in Fig. \ref{fig:Poisson_op_contrast_variationalloss_error}. The root mean square error (RMSE) is $\sim1.6\times10^{-3}$. \begin{figure}[!htb] \centering \subfigure[$a=15,x=0.0$]{ \includegraphics[scale=0.11]{deepritz_laplace_op_a_15_x_0.0.png} } \subfigure[$a=15,x=0.5$]{ \includegraphics[scale=0.11]{deepritz_laplace_op_a_15_x_0.5.png} } \subfigure[$a=15,x=1.0$]{ \includegraphics[scale=0.11]{deepritz_laplace_op_a_15_x_1.0.png} } \caption{Example 2. Comparison between analytic solution and MOD-Net solution on $x=0,0.5,1$ corresponding to source function determined by test $a=15$.} \label{fig:Poisson_op_contrast_variationalloss_section} \end{figure} For visualizing the performance of our well-trained MOD-Net, we show the solution obtained by MOD-Net and the corresponding analytical solution on fixed $x=0,0.5,1$ for considered test source function. As shown in Fig. \ref{fig:Poisson_op_contrast_variationalloss_section}, the MOD-Net can well predict the analytic solutions. \section{Numerical experiments: equation with uncertainty or control variable} \label{sec:toyexample} In this section, we would use a toy model to show the positive effect of the regularization from a few labels. We consider the following equation, \begin{equation} \begin{aligned} & \partial_{x}u(x,y) + a(x,y)u(x,y) = g(x,y), \quad (x,y)\in \Omega, \\ & u(x,y)=0, \quad (x,y)\in \partial \Omega. \end{aligned} \label{constucted_equation} \end{equation} where $\Omega=[a,b]\times[c,d]$, the variable $y$ is the auxiliary variable that can be uncertainty variable or the control variable. $a(x,y)$ and $g(x,y)$ are coefficient functions that contain the randomness or the control functions in the control problem. This equation can be regarded as a simplified toy model of a linear ODE with uncertainty or a simplified version of the equation with degeneracy such as the kinetic equations. We use the toy model here to show that data regularization is a crucial ingredients when dealing with this kind of equations. \subsection{Use DNN to fit Green's function} Similarly to Poisson equation, using the Green's function method, the solution of (\ref{constucted_equation}) can be represented by \begin{equation} u(x,y;g) = \int_c^d\int_a^b G(x,y,x',y')g(x',y') \diff{x'}\diff{y'}. \end{equation} In this experiment, we use a DNN of hidden layer size $128$-$128$-$128$-$128$ $G_{\vtheta}(x,y,x',y')$ equipped with activation function tanh to fit the Green's function $G(x,y,x',y')$. When we calculate the integral, we use the Gauss-Legendre quadrature. Then we can represent neural operator $u_{\vtheta}(x,y;g)$ with Green's function DNN $G_{\vtheta}(x,y,x',y')$, that is, \begin{equation} \begin{aligned} u_{\vtheta}(x,y;g) = \sum_{x^\prime \in S_{G_x}}\sum_{y^\prime \in S_{G_y}} \omega_{x^\prime} \omega_{y^\prime} G_{\vtheta}(x,y,x^\prime,y^\prime)g(x^\prime,y^\prime), \end{aligned} \label{constructed_Gausianint} \end{equation} where $S_{G_x}\subset[a,b]$,$S_{G_y}\subset[c,d]$ consist fixed integration points, determined by $1$D Gauss-Legendre quadrature and $\omega_{x^\prime}$, $\omega_{y^\prime}$ are corresponding coefficients. \subsection{Empirical risk function} For this example, to train the neural networks, we utilize the information of PDE, i.e., governing equation and boundary condition and a few data , $S^{u,k}=\{x_i,y_i,$ $u^{k}(x_i,y_i)\}_{i\in [n_k]}$ for each $g^k,k=1,2,\cdots,K$, where $u^{k}(\cdot)=u(\cdot;g^k)$. Note that $S^{u,k}$ can be analytically solved on grid points. To utilize the constraint of governing equation of PDE, we uniformly sample a set of data from $\Omega=[a,b] \times [c,d]$, i.e., $S^{\Omega,k}$. To utilize the information of boundary constraint, for each $k$, we uniformly sample a set of data from $\partial\Omega$. Since the boundary $\partial\Omega$ consists of four line segments, i.e., $\partial\Omega=\bigcup_{i=1}^{4}\partial\Omega_i$, where $\partial\Omega_1=\{(a,y)\}_{y\in[c,d]}$,$\partial\Omega_2= \{(b,y)\}_{y\in[c,d]}$,$\partial\Omega_3=\{(x,c)\}_{x\in[a,b]}$,$\partial\Omega_4=\{(x,d)\}_{x\in[a,b]}$, we uniformly sample a set of data from $\partial\Omega_i$ respectively, i.e., $S^{\partial\Omega_i,k}$, i=1,2,3,4. The empirical risk for this example is as follows, \begin{equation} \begin{aligned} \RS & = \frac{1}{K}\sum_{k\in[K]} \bigg(\lambda_1 \frac{1}{|S^{\Omega,k}|}\sum_{(x,y) \in S^{\Omega,k}}\Big( \partial_{x}u_{\vtheta}(x,y;g^k) + a(x,y)u_{\vtheta}(x,y;g^k) -g^k(x,y) \Big)^{2} \\ & \quad + \lambda_2 \frac{1}{|S^{\partial\Omega_1,k}|}\sum_{(x,y) \in S^{\partial\Omega_1,k}} {u_{\vtheta}(x,y;g^k)}^{2} \\ & \quad + \lambda_2 \frac{1}{|S^{\partial\Omega_2,k}|}\sum_{(x,y) \in S^{\partial\Omega_2,k}} {u_{\vtheta}(x,y;g^k)}^{2} \\ & \quad + \lambda_2\frac{1}{|S^{\partial\Omega_3,k}|}\sum_{(x,y) \in S^{\partial\Omega_3,k}} {u_{\vtheta}(x,y;g^k)}^{2} \\ & \quad + \lambda_2\frac{1}{|S^{\partial\Omega_4,k}|}\sum_{(x,y) \in S^{\partial\Omega_4,k}} {u_{\vtheta}(x,y;g^k)}^{2} \\ & \quad + \lambda_3 \frac{1}{n_k} \sum_{i\in [n_k]} |u_{\vtheta}(x_i,y_i;g^k)-u^{k}(x_i,y_i)|^2 \bigg). \label{constructed_leastsquareloss} \end{aligned} \end{equation} \subsection{Learning process} Similarly to Poisson equation, for each training epoch, we first randomly choose source functions $\{g^k\}_{k=1}^{K}$ and calculate their values on fixed integration points$(x',y')$, where $x' \in S_{G_x}$ and $ y' \in S_{G_y}$. Second, we randomly sample data and obtain data set $S^{\Omega,k},S^{\partial \Omega_i,k},i=1,2,3,4$. We obtain the data set $D= \{(x,y,x',y',g^k(x',y'))| (x,y)\in S^{\Omega,k} \cup (\bigcup_{i=1}^{4} S^{\partial\Omega_i,k}),x'\in S_{G_x},y' \in S_{G_y}\}$. In the following, we feed the data into the neural network $G_{\vtheta}(x,y,x',y')$ and calculate the total risk (\ref{constructed_leastsquareloss}) with neural operator $u_{\vtheta}(x,y;g)$, see Eq. (\ref{Poiss_Gausianint}). Train neural network $G_{\vtheta}$ with Adam to minimize the total risk, and finally we obtain a well-trained Green's function DNN $G_{\vtheta}$, furthermore, according to Eq. (\ref{Poiss_Gausianint}), we obtain a neural operator $u_{\vtheta}(x,y;g)$. \subsection{Results} To demonstrate data regularization, we apply MOD-Net method in the following example. \paragraph{Example 3: MOD-Net for equation with auxiliary variable} \begin{figure}[!htb] \centering \includegraphics[scale=0.11]{source_term_fig.png} \caption{Example 3. Source term $g(x,y)$ on $x=0.5$, i.e., $g(0.5,y)$ vs. $y$. Remark that $\partial_{y} g$ is discontinuous.} \label{fig:example5_sourceterm} \end{figure} In this example, we consider the equation (\ref{constucted_equation}) in which $\Omega=[0,1] \times [1,2]$, $a(x,y)=\frac{\sin(4\pi xy)+2}{y}$ and the source term \begin{equation} g(x, y)=\left\{ \begin{aligned} (y^2-3y+2) \Bigg(x^2-x +\Big(2x-1 + \frac{x(x-1)(2+\sin(4\pi xy))}{y}\Big)(x+\cos(\pi y)) \Bigg), \quad 1\leq y<1.5, \\ (y^2-3y+2) \Bigg(x^2-x +\Big(2x-1 + \frac{x(x-1)(2+\sin(4\pi xy))}{y}\Big)(x+\sin(2\pi y)) \Bigg), \quad 1.5\leq x\leq 2. \end{aligned}\right. \end{equation} The graph of source term is shown in Fig. \ref{fig:example5_sourceterm}. For this equation, the analytical solution \begin{equation} u(x,y) = \left\{ \begin{aligned} x(x-1)(y-1)(y-2) \Big(x+\cos(\pi y)\Big), \quad 1\leq y<1.5, \\ x(x-1)(y-1)(y-2) \Big( x+\sin(2\pi y)\Big), \quad 1.5\leq x\leq 2. \end{aligned}\right. \end{equation} Note that the first derivative of solution $u(x,y)$ with respect to $x$, i.e., $\partial_{x}u$ is continuous, but $\partial_{y}u$ is discontinuous. For this example, we train the MOD-Net to approximate the solution of a specific equation with three different loss functions. \begin{figure}[!htb] \centering \subfigure[Training loss]{ \includegraphics[scale=0.11]{unsup_loglog_loss.png} } \subfigure[$x=0.5$]{ \includegraphics[scale=0.11]{unsup_laplace_solver_x_0.5.png} } \subfigure[$y=1.55$]{ \includegraphics[scale=0.11]{unsup_laplace_solver_y_1.55.png} } \subfigure[Analytic solution]{ \includegraphics[scale=0.11]{unsup_laplace_solver_analytic.png} } \subfigure[MOD-Net solution]{ \includegraphics[scale=0.11]{unsup_laplace_solver_DNN.png} } \subfigure[Difference between two solutions]{ \includegraphics[scale=0.11]{unsup_laplace_solver_error.png} } \caption{Example 3. Trained by only the PDE,i.e., the governing equation and boundary condition. (a) Training loss. The blue curve is the total risk Eq. (\ref{constructed_leastsquareloss}). The other five curves represent five terms in the total risk Eq. (\ref{constructed_leastsquareloss}) except the last term, respectively. (b,c) Comparison between analytic solution and MOD-Net solution on $x=0.5$ and $y=1.55$. (d,e,f) Comparison between analytic solution and MOD-Net solution on $101\times101$ grid points. } \label{fig:example5_constructed_onlyPDE} \end{figure} First, we set the $\lambda_3$ be zero in (\ref{constructed_leastsquareloss}), and train the MOD-Net only by the governing equation and boundary conditions. The empirical risk, i.e., training loss is shown in Fig. \ref{fig:example5_constructed_onlyPDE} (a). For visualizing the performance of our well-trained MOD-Net $u_{\vtheta}$ intuitively, we plot the MOD-Net solution and the corresponding analytic solution on $x=0.5$ and $y=1.55$. As shown in Fig. \ref{fig:example5_constructed_onlyPDE} (b,c), the MOD-Net solution is not matching with the analytic solution. We also show the analytic solution and MOD-Net solution on $101\times101$ equidistributed isometric grid points by color. To compare these two solutions more intuitively, we calculate the difference of the two solutions at each point and show the error by color ,i.e., as the error increases, the color changes from blue to red, in Fig. \ref{fig:example5_constructed_onlyPDE} (d,e,f). The root mean square error (RMSE) is $\sim 6.90\times 10^{-3}$ and relative error is $\sim 57.61\%$. \begin{figure}[!htb] \centering \subfigure[Training loss]{ \includegraphics[scale=0.11]{supervised_loglog_loss.png} } \subfigure[$x=0.5$]{ \includegraphics[scale=0.11]{supervised_laplace_solver_x_0.5.png} } \subfigure[$y=1.55$]{ \includegraphics[scale=0.11]{supervised_laplace_solver_y_1.55.png} } \subfigure[Analytic solution]{ \includegraphics[scale=0.11]{supervised_laplace_solver_analytic.png} } \subfigure[MOD-Net solution]{ \includegraphics[scale=0.11]{supervised_laplace_solver_DNN.png} } \subfigure[Difference between two solutions]{ \includegraphics[scale=0.11]{supervised_laplace_solver_error.png} } \caption{Example 3. Trained by only the $10 \times 10$ labeled data. (a) Training loss. The blue curve is the supervised risk Eq. (\ref{constructed_leastsquareloss}). (b,c) Comparison between analytic solution and MOD-Net solution on $x=0.5$ and $y=1.55$. (d,e,f) Comparison between analytic solution and MOD-Net solution on $101\times101$ grid points. } \label{fig:example5_constructed_onlydata} \end{figure} Then, we set the $\lambda_1$, $\lambda_2$ be zero and train the MOD-Net only by the $10 \times 10$ equidistributed isometric labeled data, i.e., $10$ equidistributed isometric points in $x$ direction and $10$ equidistributed isometric points in $y$ direction. The empirical risk, i.e., training loss is shown in Fig. \ref{fig:example5_constructed_onlydata} (a). Similarly, to visualize the performance of the obtained solution $u_{\vtheta}$, we plot the MOD-Net solution and the corresponding analytic solution on $x=0.5$ and $y=1.55$. As shown in Fig. \ref{fig:example5_constructed_onlydata} (b,c), the MOD-Net solution deviates from the analytic solution. We also show the analytic solution and MOD-Net solution on $101\times101$ equidistributed isometric grid points by color in Fig. \ref{fig:example5_constructed_onlydata} (d,e,f). The root mean square error (RMSE) is $\sim 1.01\times 10^{-2}$ and relative error is $\sim 84.24\%$. To sum up, with the information of only PDE or only a few labeled data, the MOD-Net cannot be trained well, however, combining these two information, we can train the MOD-Net very well. See results in Fig. \ref{fig:example5_constructed_PDEanddata}. The root mean square error (RMSE) is $\sim 3.22\times 10^{-4}$ and relative error is $\sim 2.68\%$. \begin{figure \centering \subfigure[Training loss]{ \includegraphics[scale=0.11]{semi_loglog_loss.png} } \subfigure[$x=0.5$]{ \includegraphics[scale=0.11]{semi_laplace_solver_x_0.5.png} } \subfigure[$y=1.55$]{ \includegraphics[scale=0.11]{semi_laplace_solver_y_1.55.png} } \subfigure[Analytic solution]{ \includegraphics[scale=0.11]{semi_laplace_solver_analytic.png} } \subfigure[MOD-Net solution]{ \includegraphics[scale=0.11]{semi_laplace_solver_DNN.png} } \subfigure[Difference between two solutions]{ \includegraphics[scale=0.11]{semi_laplace_solver_error.png} } \caption{Example 3. Trained by the governing PDE, boundary condition,and coarse grid data together. (a) Training loss. The blue curve is the total risk Eq. (\ref{constructed_leastsquareloss}). The other six curves represent six terms in the total risk Eq. (\ref{constructed_leastsquareloss}), respectively. (b,c) Comparison between analytic solution and MOD-Net solution on $x=0.5$ and $y=1.55$. (d,e,f) Comparison between analytic solution and MOD-Net solution on $101\times101$ grid points. } \label{fig:example5_constructed_PDEanddata} \end{figure} \section{Numerical experiments: One-dimensional radiative transfer equation} \label{sec:boltz} In this section, we would apply MOD-Net to solve one-dimensional steady radiative transfer equation (RTE). Consider the density of particles in a bounded domain that interact with a background through absorption and scattering processes. The density function $u(\vx, \vvv)$ follows the RTE \begin{equation} \begin{aligned} & \vvv \cdot \nabla u(\vx, \vvv)+\frac{\sigma_{T}(\vx)}{\varepsilon(\vx)} u(\vx, \vvv)=\frac{1}{|S|} \left(\frac{\sigma_{T}(\vx)}{\varepsilon(\vx)}-\varepsilon(\vx) \sigma_{a}(\vx)\right) \int_{S} u(\vx, \vxi) \diff{\vxi}, \\ & u(\vx, \vvv)=\phi(\vx, \vvv), \quad \vx \in \Gamma=\partial \Omega, \quad \vvv \in S, \quad \vvv \cdot \vn_{\vx}<0, \label{RTE} \end{aligned} \end{equation} where $\vx \in \Omega\subset\sR^{d}$ is the $d$-dimensional space variable, $\vvv$ is the angular variable on unit ball $S^{d-1}\subset\sR^{d}$, $\vn_{\vx}$ is the outward normal vector at $\vx$ on the boundary, $\sigma_{a}$ is the absorption coefficient, $\sigma_{T}$ is the total scattering coefficient and $\varepsilon$ is Knudsen number. For simplifying the PDE and well describing the real situation, we use the isotropic hypothesis, then $\sigma_{a}$ and $\sigma_{T}$ are only related to the space variable $\vx$. High-accuracy numerical methods are developed to solve RTE, e.g., Tailored Finite Point Method (TFPM). However, these numerical methods are usually based on discrete grids. To improve the accuracy, the mesh grid has to be finer and the solving time exponentially increases. Another disadvantage is that these numerical methods usually only solve one particular PDE, i.e., if we change anyone of $\sigma_{T}$, $\sigma_{a}$, $\varepsilon$ or $\phi$, we need to reuse this algorithm to solve it. To alleviate these problems, MOD-Net approach learns the operator $\fG: (\phi,\sigma_{T},\sigma_{a},\varepsilon) \mapsto u$. We consider one-dimensional RTEs. Set $\Omega=[x_L,x_R]$, $S=[-1,1]$, normal vector ${n_{x_L}}=-1$, ${n_{x_R}}=1$, we obtain \begin{equation} \begin{aligned} & v \partial_{x} u(x,v)+\frac{\sigma_{T}(x)}{\varepsilon(x)} u(x,v)=\left(\frac{\sigma_{T}(x)}{\varepsilon(x)}-\varepsilon(x) \sigma_{a}(x)\right) \frac{1}{2} \int_{-1}^{1} u\left(x, \xi \right) \, \diff{\xi}, \\ & u\left(x_{L}, v\right)=\phi_{L}(v), \quad v>0, \\ & u\left(x_{R}, v\right)=\phi_{R}(v), \quad v<0. \label{onedimensionRTE} \end{aligned} \end{equation} For convenience, in this paper, we fixed the $\sigma=(\sigma_T,\sigma_a,\varepsilon)$, and our goal is only to learn a operator mapping from $\phi_{L},\phi_{R}$ to the solution $u$ of the RTE. \subsection{Use DNN to fit Green's function} Denote $$\fL [u]=\vvv \cdot \nabla u(\vx, \vvv)+\frac{\sigma_{T}(\vx)}{\varepsilon(\vx)} u(\vx, \vvv)-\frac{1}{|S|} \left(\frac{\sigma_{T}(\vx)}{\varepsilon(\vx)}-\varepsilon(\vx) \sigma_{a}(\vx)\right) \int_{S} u(\vx, \vxi) \diff{\vxi},$$ the RTE (\ref{RTE}) can be rewritten as the following linear PDE, \begin{equation} \left\{ \begin{aligned} & \fL [u](\vx, \vvv) = 0,\quad \vx \in \Omega,\quad \vvv \in S, \\ & u(\vx, \vvv) = \phi(\vx, \vvv), \quad \vx \in \partial \Omega,\quad \vvv \cdot \vn_{\vx}<0, \end{aligned} \right. \label{LinearhomogeneousPDE} \end{equation} which is a special case of linear PDE (\ref{linearPDE}). With Green's function method, the solution of (\ref{LinearhomogeneousPDE}), can be represented by the following formula, \begin{equation} \begin{aligned} u(\vx,\vvv;\phi,\sigma) = \int_{\partial \Omega } \int_{S \cap \{\vvv'|\vvv' \cdot \vn_{\vx'}<0 \}} G(\vx,\vx',\vvv,\vvv') \phi(\vx, \vvv)\, \diff{\vvv'}\diff{\vx'}, \end{aligned} \label{GeneralRTErepr} \end{equation} where $G(\vx,\vx',\vvv,\vvv')$ is the solution of the following PDE, $$ \left\{ \begin{aligned} & \fL [G](\vx, \vvv) = 0,\quad \vx \in \Omega ,\quad \vvv \in S, \\ & G(\vx,\vx',\vvv,\vvv') = \delta(\vvv-\vvv')\delta(\vx-\vx'), \quad \vx,\vx' \in \partial \Omega ,\quad \vvv \cdot \vn_{\vx}<0,\quad \vvv' \cdot \vn_{\vx'}<0. \end{aligned} \right. $$ Since in the one-dimensional example (\ref{onedimensionRTE}), we consider $\Omega=[x_L,x_R]$, then $x'$ in $G(x,x',$ $v,v')$ only have two values. We can rewrite the integral in (\ref{GeneralRTErepr}) by the following formula, \begin{equation} \begin{aligned} u(x,v;\phi_L,\phi_{R}) = \int^1_0 G_L(x,v,v')\phi_L(v')\diff{v'} + \int^0_{-1} G_R(x,v,v')\phi_{R}(v')\diff{v'}, \end{aligned} \label{1D_repre} \end{equation} where $G_L$, $G_R$ are the solution of the following two PDEs respectively, $$ \left\{ \begin{aligned} v \partial_{x} G_L+\frac{\sigma_{T}}{\varepsilon} G_L & =\left(\frac{\sigma_{T}}{\varepsilon}-\varepsilon \sigma_{a}\right) \frac{1}{2} \int_{-1}^{1} G_L\left(x, \xi,v'\right)\diff{\xi}, \\ G_L\left(x_{L}, v, v'\right) & =\delta(v-v'), \quad v>0, \\ \quad G_L\left(x_{R}, v, v'\right)&=0, \quad v<0, \end{aligned} \right. $$ $$ \left\{ \begin{aligned} v \partial_{x} G_R+\frac{\sigma_{T}}{\varepsilon} G_R & =\left(\frac{\sigma_{T}}{\varepsilon}-\varepsilon \sigma_{a}\right) \frac{1}{2} \int_{-1}^{1} G_R\left(x, \xi,v';\sigma\right) \diff{\xi}, \\ G_R\left(x_{L}, v, v';\sigma\right) & =0, \quad v>0, \\ \quad G_R\left(x_{R}, v, v';\sigma\right)&=\delta(v-v'), \quad v<0. \end{aligned} \right. $$ With the help of Green's function method, to achieve our goal of fitting the operator $\fG: (\phi_{L},\phi_{R}) \mapsto u$, where $u$ is the solution of (\ref{onedimensionRTE}) with given $\phi_{L},\phi_{R}$, We fit $\fG_L$,$\fG_R$ with DNNs of hidden layer size $128$-$256$-$256$-$128$ equipped with activation function tanh, i.e., a DNN $G_{\vtheta_L}(x,v,v')$ is trained to represent $G_L(x,v,v')$, similarly, another DNN $G_{\vtheta_R}(x,v,v')$ is for $G_R(x,v,v')$. Since the solution reflects the distribution function, we use the exponential function to make sure that $G_L$ and $G_R$ are positive. In Eq. (\ref{1D_repre}), when we calculate the $1$D integral, similarly we use the Gauss-Legendre quadrature. Then we obtain the following representation of MOD-Net solution, \begin{equation} \begin{aligned} u_{\vtheta_1,\vtheta_2}(x,v;\phi_L,\phi_R) & = \sum_{v' \in S_{G_v}^+} \omega_{v_+'}G_{\vtheta_L}(x,v,v_+')\phi_L({v_+'}) \\ & + \sum_{v' \in S_{G_v}^-} \omega_{v_-'}G_{\vtheta_R}(x,v,v_-')\phi_R({v_-'}), \end{aligned} \label{RTE_Gausianint} \end{equation} where $S_{G_v}^+ \subset [0,1]$, $S_{G_v}^- \subset [-1,0]$ consist of fixed points determined by Gauss-Legendre quadrature and $\omega_{v_+'}$, $\omega_{v_-'}$ are corresponding coefficients. \subsection{Empirical risk function} For one-dimensional case, to train the neural networks, we would utilize the information of PDE, i.e., governing equation and boundary condition, and a few data $S^{u,k}=\{x_i,v_i,$ $u^{k}(x_i,v_i)\}_{i\in [n_k]}$ for each $\{\phi_{L}^k,\phi_{R}^k\},k=1,2,\cdots,K$, where $u^{k}(\cdot)=u(\cdot;\phi_{L}^k,\phi_{R}^k)$. Note that $S^{u,k}$ can be numerically solved by TFPM on coarse grid points, which is not computationally expensive. For each $k$, we uniformly sample a set of $(x,v)$ from $\Omega \times S=[x_L,x_R] \times [-1,1]$, i.e., $S^{\Omega,S,k}$ and uniformly sample a set of data from boundaries $\partial \Omega_L=\{(x_L,v)\}_{v\in[0,1]}$, $\partial \Omega_R=\{(x_R,v)\}_{v\in[-1,0]}$, respectively, i.e., $S^{\partial\Omega_L,k}$,$S^{\partial\Omega_R,k}$. We use the general definition of empirical risk (\ref{lossfunctiondefinition}) for one-dimensional RTE. The empirical risk of solving RTE is as follows, \begin{align*} \RS & = \frac{1}{K}\sum_{k\in[K]} \Big( \lambda_1 \frac{1}{|S^{\Omega,S,k}|} \sum_{(x,v)\in S^{\Omega,S,k}} \| v \partial_{x} u_{\vtheta_1,\vtheta_2}(x,v;\phi_{L}^k,\phi_{R}^k)+\frac{\sigma_{T}(x)}{\varepsilon(x)} u_{\vtheta_1,\vtheta_2}(x,v;\phi_{L}^k,\phi_{R}^k) \\ & \quad -\left(\frac{\sigma_{T}(x)}{\varepsilon}-\varepsilon \sigma_{a}(x)\right) \frac{1}{2} \int_{-1}^{1} u_{\vtheta_1,\vtheta_2}(x,\xi;\phi_{L}^k,\phi_{R}^k) \diff{\xi} \|_2^2 \\ & \quad +\lambda_{21} \frac{1}{|S^{\partial\Omega_L,k}|} \sum_{(x,v)\in S^{\partial\Omega_L,k}} \| u_{\vtheta_1,\vtheta_2}(x, v;\phi_{L}^k,\phi_{R}^k) -\phi_{L}^k(v) \|_2^2 \\ & \quad +\lambda_{22} \frac{1}{|S^{\partial\Omega,k}|} \sum_{(x,v)\in S^{\partial\Omega_R,k}} \| u_{\vtheta_1,\vtheta_2}(x, v;\phi_{L}^k,\phi_{R}^k) -\phi_{R}^k(v) \|_2^2 \\ & \quad + \lambda_3 \frac{1}{n_k} \sum_{i\in [n_k]} \|u_{\vtheta_1,\vtheta_2}(x_i,v_i;\phi_{L}^k,\phi_{R}^k)-u^{k}(x_i,v_i)\|_2^2 \Big). \end{align*} For integral term in the first risk term related to the governing equation of PDE, we use the Gauss-Legendre numerical integral method. We obtain \begin{align} \RS & = \frac{1}{K}\sum_{k\in[K]} \Big( \lambda_1 \frac{1}{|S^{\Omega,S,k}|} \sum_{(x,v)\in S^{\Omega,S,k}} \| v \partial_{x} u_{\vtheta_1,\vtheta_2}(x,v;\phi_{L}^k,\phi_{R}^k)+\frac{\sigma_{T}(x)}{\varepsilon(x)} u_{\vtheta_1,\vtheta_2}(x,v;\phi_{L}^k,\phi_{R}^k) \nonumber \\ & \quad -\left(\frac{\sigma_{T}(x)}{\varepsilon}-\varepsilon \sigma_{a}(x)\right) \frac{1}{2} \sum_{\xi\in S_v} \omega_{\xi} u_{\vtheta_1,\vtheta_2}(x, \xi;\phi_{L}^k,\phi_{R}^k) \|_2^2 \nonumber \\ & \quad +\lambda_{21} \frac{1}{|S^{\partial\Omega_L,k}|} \sum_{(x,v)\in S^{\partial\Omega_L,k}} \| u_{\vtheta_1,\vtheta_2}(x, v;\phi_{L}^k,\phi_{R}^k) -\phi_{L}^k(v) \|_2^2 \label{RTEloss} \\ & \quad +\lambda_{22} \frac{1}{|S^{\partial\Omega,k}|} \sum_{(x,v)\in S^{\partial\Omega_R,k}} \| u_{\vtheta_1,\vtheta_2}(x, v;\phi_{L}^k,\phi_{R}^k) -\phi_{R}^k(v) \|_2^2 \nonumber \\ & \quad + \lambda_3 \frac{1}{n_k} \sum_{i\in [n_k]} \|u_{\vtheta_1,\vtheta_2}(x_i,v_i;\phi_{L}^k,\phi_{R}^k)-u^{k}(x_i,v_i)\|_2^2 \Big), \nonumber \end{align} where $S_v \subset [-1,1]$ consists of fixed integration points, determined by Gauss-Legendre quadrature and $\omega_{\xi}$'s are corresponding coefficients. In practical applications, it is usually not easy to measure $u(x,v)$, but density function $\rho(x)=\frac{1}{2} \int_{-1}^{1} u\left(x, \xi \right) \diff{\xi} $ can be measured. Therefore, we would utilize the information of PDE and a few data $S^{\rho,k}=\{x_i,$ $\rho^{k}(x_i)\}_{i\in [n_k]}$ for each $\{\phi_{L}^k,\phi_{R}^k\},k=1,2,\cdots,K$, where $\rho^{k}(\cdot)=\frac{1}{2} \int_{-1}^{1} u\left(\cdot, \xi;\phi_{L}^k,\phi_{R}^k \right) \diff{\xi} $. And we obtain another empirical risk, \begin{align} \RS & = \frac{1}{K}\sum_{k\in[K]} \Big( \lambda_1 \frac{1}{|S^{\Omega,S,k}|} \sum_{(x,v)\in S^{\Omega,S,k}} \| v \partial_{x} u_{\vtheta_1,\vtheta_2}(x,v;\phi_{L}^k,\phi_{R}^k)+\frac{\sigma_{T}(x)}{\varepsilon(x)} u_{\vtheta_1,\vtheta_2}(x,v;\phi_{L}^k,\phi_{R}^k) \nonumber \\ & \quad -\left(\frac{\sigma_{T}(x)}{\varepsilon}-\varepsilon \sigma_{a}(x)\right) \frac{1}{2} \sum_{\xi\in S_v} \omega_{\xi} u_{\vtheta_1,\vtheta_2}(x, \xi;\phi_{L}^k,\phi_{R}^k) \|_2^2 \nonumber \\ & \quad +\lambda_{21} \frac{1}{|S^{\partial\Omega_L,k}|} \sum_{(x,v)\in S^{\partial\Omega_L,k}} \| u_{\vtheta_1,\vtheta_2}(x, v;\phi_{L}^k,\phi_{R}^k) -\phi_{L}^k(v) \|_2^2 \label{RTElossrho} \\ & \quad +\lambda_{22} \frac{1}{|S^{\partial\Omega,k}|} \sum_{(x,v)\in S^{\partial\Omega_R,k}} \| u_{\vtheta_1,\vtheta_2}(x, v;\phi_{L}^k,\phi_{R}^k) -\phi_{R}^k(v) \|_2^2 \nonumber \\ & \quad + \lambda_3 \frac{1}{n_k} \sum_{i\in [n_k]} \|\frac{1}{2} \sum_{\xi'\in S_v'} \omega_{\xi'} u_{\vtheta_1,\vtheta_2}(x_i, \xi';\phi_{L}^k,\phi_{R}^k)-\rho^{k}(x_i)\|_2^2 \Big), \nonumber \end{align} where $S_v,S_v' \subset [-1,1]$ consists of fixed integration points, determined by Gauss-Legendre quadrature and $\omega_{\xi},\omega_{\xi'}$'s are corresponding coefficients. \subsection{Learning process} During training, for each epoch, we first randomly choose $\{(\phi_{L}^k,\phi_{R}^k)\}_{k\in[K]}$ and calculate the values of boundary condition $\phi_{L}^k$, $\phi_{R}^k$ on fixed integration points $v_+'\in S_{G_v}^+$, $v_-' \in S_{G_v}^-$ respectively. Second, we randomly sample points and obtain the data set $S^{\Omega,S,k}$, $S^{\partial\Omega_L,k}$,$S^{\partial\Omega_R,k}$. We obtain the data set $D_L= \{(x,v,v_+',\phi_{L}^k(v_+'))| (x,v)\in S^{\Omega,S,k} \cup S^{\partial\Omega_L,k} \cup S^{\partial\Omega_R,k},$ $v_+'\in S_{G_v}^+\}$ and $D_R= \{(x,v,v_-',\phi_{R}^k(v_-'))| (x,v)\in S^{\Omega,S,k} \cup S^{\partial\Omega_L,k} \cup S^{\partial\Omega_R,k},v_-'\in S_{G_v}^-\}$. In the following, for each $k$, we feed the data $D_L$, $D_R$ into the neural network $G_{\vtheta_L}(x,v,v')$, $G_{\vtheta_R}(x,v,v')$ respectively, and calculate the empirical risk (\ref{RTEloss}) or (\ref{RTElossrho}) defined utilizing the governing equation of PDE, boundary condition and a few labeled data $S^{u,k}$. We train neural network $G_{\vtheta_L}$ and $G_{\vtheta_R}$ with Adam to minimize the empirical risk, and finally obtain well-trained Green's function DNNs $G_{\vtheta_L}$ and $G_{\vtheta_R}$, furthermore, according to (\ref{RTE_Gausianint}), we obtain a neural operator $u_{\vtheta_1,\vtheta_2}(x,v;\phi_{L},\phi_{R})$. \subsection{Results} To see the performance of obtained operator, we need the reference solution. Since it is difficult to obtain the analytical solution of RTE, we use the TFPM method to obtain the numerical solution as reference. \paragraph{Example 4. MOD-Net with data-regularization for radiative transfer equation with $\sigma$ varying with $x$} Only for illustration of data regularization in solving RTE, we consider a simple case, $x_L=0, x_R=2$, and \begin{equation} \sigma_T(x) = \left\{ \begin{aligned} x+1, \quad 0\leq x<1, \\ 2, \quad 1\leq x\leq2, \end{aligned}\right. \end{equation} and \begin{equation} \sigma_a(x) = \left\{ \begin{aligned} x, \quad 0\leq x<1, \\ 1, \quad 1\leq x\leq2. \end{aligned}\right. \end{equation} the graphs of which are shown in Fig. \ref{fig:bolzmann_continuous_op}(a). To avoid the multi-scale phenomenon, we take $\varepsilon(x)=1$. We set the boundary condition $\phi_{L}=\phi_{R}=a_1\cos(\omega v) + a_2\sin(\omega v) + 2$, which is determined by $a_1,a_2,\omega $. In fact, many boundary conditions can be represented with these basic functions. For convenience, we set $\omega =1$,$a_1=1$ and only change $a_2$. Then the boundary condition $\phi_{L}=\phi_{R}=\cos(v) + a_2\sin(v) + 2$. \begin{figure} [H] \centering \subfigure[Training loss]{ \includegraphics[scale=0.11]{only_PDE_loglog_loss.png} } \subfigure[Density function]{ \includegraphics[scale=0.11]{only_PDE_density_DNNvsnumerical.png} } \\ \subfigure[solution on $x=0$]{ \includegraphics[scale=0.11]{only_PDE_x_0.0.png} } \subfigure[ solution on $x=1$]{ \includegraphics[scale=0.11]{only_PDE_x_1.0.png} } \subfigure[ solution on $x=2$]{ \includegraphics[scale=0.11]{only_PDE_x_2.0.png} } \caption{Example 4. Trained by only the PDE,i.e., the governing equation and boundary condition. (a) Training loss. The blue curve is the total risk Eq. (\ref{RTEloss}). The other three curves represent three terms in the total risk Eq. (\ref{RTEloss}) except the last term, respectively. (b) Comparison between numerical solution and MOD-Net solution on density function. (c, d, e) Comparison between numerical solution and MOD-Net solution on $x=0,1,2$.} \label{fig:bolzmann_continuous_fixed_PDE} \end{figure} Fix $a_2=0.01$, by TFPM method, we obtain $20$ labeled data $S^{u,k}=\{x_i,v_i,u^k(x_i,v_i)\}_{i=1}^{20}$ on coarse grids, i.e., $5$ equidistributed isometric points in $x$ direction and $4$ equidistributed isometric points in $v$ direction and $10$ labeled data $S^{\rho,k}=\{x_i,\rho^k(x_i)\}_{i=1}^{10}$, where $\rho^k(x_i) = \frac{1}{2} \sum_{\xi'\in S_v'} \omega_{\xi'} u^k(x_i, \xi')$ and $S_v'$ consists of fixed Gauss-Legendre integration points, $|S_v'|=30$, and $\omega_{\xi'}$'s are corresponding coefficients. For this example, we train the solver of the RTE with four different loss functions. First, we set the $\lambda_3$ in (\ref{RTEloss}) be zero, i.e., training the MOD-Net only by the governing equation and boundary conditions, the empirical risk, i.e., training loss is shown in Fig. \ref{fig:bolzmann_continuous_fixed_PDE}(a). To test the performance of the obtained MOD-Net solution $u_{\vtheta}$, we calculate the density function $\rho(x)$ of $u$. The density function of the MOD-Net solution and numerical TFPM solution with equidistributed isometric grids $(x_i,v_j)_{i\in[101],j\in[60]}$ are significantly different, as shown in Fig. \ref{fig:bolzmann_continuous_fixed_PDE}(b). For visualization, we plot the MOD-Net solution and the corresponding numerical solution on $x=0,1,2$. As shown in Fig. \ref{fig:bolzmann_continuous_fixed_PDE}(c, d, e), the MOD-Net solution is far from the numerical solution. \begin{figure} \centering \subfigure[Training loss]{ \includegraphics[scale=0.11]{only_data_loglog_loss.png} } \subfigure[Density function]{ \includegraphics[scale=0.11]{only_data_density_DNNvsnumerical.png} } \\ \subfigure[solution on $x=0$]{ \includegraphics[scale=0.11]{only_data_x_0.0.png} } \subfigure[solution on $x=1$]{ \includegraphics[scale=0.11]{only_data_x_1.0.png} } \subfigure[solution on $x=2$]{ \includegraphics[scale=0.11]{only_data_x_2.0.png} } \caption{Example 4. Trained by only the labeled data. (a) Training loss. The blue curve is the last term in total risk Eq. (\ref{RTEloss}). The other three curves represent three terms in the total risk Eq. (\ref{RTEloss}) except the last term, respectively. (b) Comparison between numerical solution and MOD-Net solution on density function. (c, d, e) Comparison between numerical solution and MOD-Net solution on $x=0,1,2$.} \label{fig:bolzmann_continuous_fixed_data} \end{figure} Second, $\lambda_1,\lambda_{21},\lambda_{22}$ in (\ref{RTEloss}) are set as zero, i.e., training the MOD-Net by only the $20$ labeled data with the training loss shown in Fig. \ref{fig:bolzmann_continuous_fixed_data}(a). The training loss (indicated by blue curve) decays with training epoch except oscillation appears in the final stage. We use the trick of early stopping with tolerance $50$ to obtain a DNN with small loss. Similarly, to test the performance of the obtained MOD-Net solution $u_{\vtheta}$, we calculate the density function $\rho(x)$ of $u$. The density function of the MOD-Net solution and TFPM solution have clear difference as shown in Fig. \ref{fig:bolzmann_continuous_fixed_data}(b). For visualization, we plot the MOD-Net solution and the corresponding numerical solution on $x=0$. As shown in Fig. \ref{fig:bolzmann_continuous_fixed_data}(c), the MOD-Net solution significantly deviates from the numerical solution. Third, we train the MOD-Net by the governing equation, boundary condition and $20$ labeled data $S^{u,k}$ simultaneously, and $\lambda_1,\lambda_{21},\lambda_{22},\lambda_{3}$ in (\ref{RTEloss}) are set as one. The training total loss (\ref{RTEloss}) decays with training epoch as shown in Fig. \ref{fig:bolzmann_continuous_fixed_PDEanddata}(b). Similarly, we calculate the density function of MOD-Net solution and TFPM solution. They are very consistent as shown in Fig. \ref{fig:bolzmann_continuous_fixed_PDEanddata}(c). As shown in Fig. \ref{fig:bolzmann_continuous_fixed_PDEanddata}(d, e, f), the MOD-Net solution overlap with the numerical solution very well except for the discontinuous points. Four, we train the MOD-Net by the governing equation, boundary condition and $10$ labeled data $S^{\rho,k}$ simultaneously, and $\lambda_1,\lambda_{21},\lambda_{22},\lambda_{3}$ in (\ref{RTElossrho}) are set as one. The training total loss (\ref{RTElossrho}) decays with training epoch as shown in Fig. \ref{fig:bolzmann_continuous_fixed_PDEandrho}(b). To see the performance of the trained MOD-Net, we calculate the density function of MOD-Net solution and TFPM solution. They are very consistent as shown in Fig. \ref{fig:bolzmann_continuous_fixed_PDEandrho}(c). As shown in Fig. \ref{fig:bolzmann_continuous_fixed_PDEandrho}(d, e, f), the MOD-Net solution overlap with the numerical solution well except for the discontinuous points. \begin{figure} \centering \subfigure[Training loss]{ \includegraphics[scale=0.11]{PDE+data_loglog_loss.png} } \subfigure[Density function]{ \includegraphics[scale=0.11]{PDE+data_density_DNNvsnumerical.png} } \\ \subfigure[solution on $x=0$]{ \includegraphics[scale=0.11]{PDE+data_x_0.0.png} } \subfigure[solution on $x=1$]{ \includegraphics[scale=0.11]{PDE+data_x_1.0.png} } \subfigure[solution on $x=2$]{ \includegraphics[scale=0.11]{PDE+data_x_2.0.png} } \caption{Example 4. Trained by the governing PDE, boundary condition, and coarse grid data together. (a) Training loss. The blue curve is the total risk Eq. (\ref{RTEloss}). The other four curves represent four terms in the total risk Eq. (\ref{RTEloss}), respectively. (b) Comparison between numerical solution and MOD-Net solution on density function. (c, d, e) Comparison between numerical solution and MOD-Net solution on $x=0,1,2$.} \label{fig:bolzmann_continuous_fixed_PDEanddata} \end{figure} \begin{figure}[!htb] \centering \subfigure[Training loss]{ \includegraphics[scale=0.11]{PDE+rho_loglog_loss.png} } \subfigure[Density function]{ \includegraphics[scale=0.11]{PDE+rho_density_DNNvsnumerical.png} } \\ \subfigure[solution on $x=0$]{ \includegraphics[scale=0.11]{PDE+rho_x_0.0.png} } \subfigure[solution on $x=1$]{ \includegraphics[scale=0.11]{PDE+rho_x_1.0.png} } \subfigure[solution on $x=2$]{ \includegraphics[scale=0.11]{PDE+rho_x_2.0.png} } \caption{Example 4. Trained by the governing PDE, boundary condition, and coarse density function $\rho$ together. (a) Training loss. The blue curve is the total risk Eq. (\ref{RTElossrho}). The other four curves represent four terms in the total risk Eq. (\ref{RTElossrho}), respectively. (b) Comparison between numerical solution and MOD-Net solution on density function. (c, d, e) Comparison between numerical solution and MOD-Net solution on $x=0,1,2$.} \label{fig:bolzmann_continuous_fixed_PDEandrho} \end{figure} To sum up, with the information of only PDE or only a few labeled data, the MOD-Net cannot be trained well, however, combining these two information, we can train the MOD-Net very well. Note that the labeled data is not restricted in the solution, the information of the density function can also benefit the training of MOD-Net. To solve the PDE with various $a_2$ accurately and quickly, we use MOD-Net approach to learn a neural operator. For this case, we train MOD-Net with PDE and a few labeled data simultaneously. For each $a_2$ in $\{0.03k\}_{k=1}^{33}$ , by TFPM method, we calculate the corresponding numerical solution on $20$ fixed coarse grids , i.e., $5$ equidistributed isometric points in $x$ direction and $4$ equidistributed isometric points in $v$ direction, as labeled data and obtain $S^{u,k}=\{x_i,v_i,u^k(x_i,v_i)\}_{i=1}^{20}$. \begin{figure}[!htb] \centering \subfigure[$\sigma(x)$]{ \includegraphics[scale=0.11]{sigma_continuous.png} } \subfigure[Training loss]{ \includegraphics[scale=0.11]{op_loglog_loss.png} } \subfigure[$a_2=0.02$]{ \includegraphics[scale=0.11]{op_0.02_density_DNNvsnumerical.png} } \subfigure[$a_2=0.11$]{ \includegraphics[scale=0.11]{op_0.11_density_DNNvsnumerical.png} } \subfigure[$a_2=0.51$]{ \includegraphics[scale=0.11]{op_0.51_density_DNNvsnumerical.png} } \subfigure[$a_2=0.99$]{ \includegraphics[scale=0.11]{op_0.99_density_DNNvsnumerical.png} } \caption{Example 4. Training MOD-Net by the governing PDE, boundary condition, and coarse grid data together. (a) $\sigma_T(x)$ and $\sigma_a(x)$ vs. $x$. (b) Training loss vs. epoch for the learning of the operator of RTE with continuous $\sigma_T(x)$, $\sigma_a(x)$. The blue curve is the total risk Eq. (\ref{RTEloss}). The other four curves represent four terms in the total risk Eq. (\ref{RTEloss}), respectively. (c,d,e,f) Comparison between numerical solution and MOD-Net solution on density function corresponding to each of four boundary conditions $\phi_{L}=\phi_{R}=\cos(v) + a_2\sin(v) + 2$ determined by $a_2=0.02,0.11,0.51,0.99$.} \label{fig:bolzmann_continuous_op} \end{figure} We set $K=20$ and for each epoch, we sample $K$ different $a_2$'s uniformly from $\{0.03k\}_{k=1}^{33}$. In training, we set the number of integration points $|S_{G_v}^+|=30$,$|S_{G_v}^-|=30$,$|S_{v}|=30$, and for each epoch, for each $k$, we uniformly sample $500$ points in $[0,2]\times[-1,1]$ for $S^{\Omega,S,k}$, $500$ points $v_i$'s in $[0,1]$ for $S^{\partial \Omega_L,k}=\{(0,v_i)|i=1,\cdots,500\}$, another $500$ points $v_i$'s in $[-1,0]$ for $S^{\partial \Omega_R,k}=\{(2,v_i)|i=1,\cdots,500\}$ and use the $20$ labeled data in $S^{u,k}$ . The training loss is shown in Fig. \ref{fig:bolzmann_continuous_op}(b). The total risk (indicated by blue curve) decays with training epoch. For visualization of each part of the total risk, we also display the residual loss of the RTE (indicated by orange curve), the loss of two boundary lines (indicated by green and red curves) and the loss of supervised data (indicated by remaining curve), which decay with the training epoch overall. To test the performance of the trained MOD-Net on $a_2=0.02,0.11,0.51,0.99$. For each $a_2$, we calculate the density function $\rho(x)$ of the solution. For all $a_2$'s, the density function of MOD-Net solution and numerical solution by TFPM method with equidistributed isometric grids $(x_i,v_j)_{i\in[101],j\in[60]}$ are very consistent as shown in Fig. \ref{fig:bolzmann_continuous_op}. \section{Numerical experiments: $1$D Burgers equation} \label{sec:Burgers} To show the performance of the MOD-Net for a nonlinear PDE, first we consider the $1$D Burgers equation in the steady state, \begin{equation} \begin{aligned} & \partial_{x}(\frac{1}{2}{u^2(x)})=\nu\partial_{xx}u(x)+g(x), \quad x\in \Omega, \\ & u(x)= \phi(x), \quad x\in \partial\Omega, \end{aligned} \label{Burgers} \end{equation} For illustration, we take $\Omega=[-1,1]$,$\nu=1$,$g(x)=0$ and $\phi(x)=c_1\cos(k_1x) + c_2\sin(k_2x) $ for all $x\in \Omega$, \begin{equation} \begin{aligned} & \partial_{x}(\frac{1}{2}{u^2(x)})=\partial_{xx}u(x), \quad x\in \Omega, \\ & u(-1)=c_1\cos(-k_1) + c_2\sin(-k_2), \\ & u(1)=c_1\cos(k_1) + c_2\sin(k_2), \end{aligned} \label{Burgers example} \end{equation} in which $c_1, c_2, k_1, k_2$ control the boundary condition. For this problem , it is difficult to obtain the analytical solution, but a lot of traditional numerical schemes can be used to solve it. In this paper, we use the upwind scheme. \subsection{Use DNN to fit nonlinear operator} For a linear PDE, Green's function can help us obtain the solution of PDE due to the superposition principle. For a nonlinear PDE, similarly we use the following representation of the solution of PDE (\ref{Burgers}), \begin{equation} u(x;\phi,g) =F(\int_{\Omega} G_1(x,x')g(x') \diff{x'} +\int_{\partial \Omega} G_2(x,x')\phi(x') \diff{x'}), \end{equation} In the considered example, $\Omega=[-1,1]$ and $g(x)=0$, we have \begin{equation} \begin{aligned} u(x;\phi) & =F(\int_{\partial \Omega} G_2(x,x')\phi(x') \diff{x'}) \\ & =F( G_2(x,-1)\phi(-1)+G_2(x,1)\phi(1) ). \end{aligned} \end{equation} We use a DNN of hidden layer size $256$-$256$-$256$-$256$ equipped with sigmoid function as activation function $G_{\vtheta_L}(x)$ to fit $G_2(x,-1)$, a DNN with the same setting $G_{\vtheta_R}(x)$ to fit $G_2(x,1)$ and a DNN of one hidden layer, the size of which is $256$, equipped with sigmoid function as activation function $F_{\vtheta}(x)$ . Then we can represent neural operator $u_{\vtheta}(x;g)$ with DNN $G_{\vtheta_L}(x)$, $G_{\vtheta_R}(x)$ and $F_{\vtheta}(x)$, that is, \begin{equation} \begin{aligned} u_{\vtheta}(x;\phi) & =F_{\vtheta}( G_{\vtheta_L}(x)\phi(-1)+G_{\vtheta_R}(x)\phi(1)). \end{aligned} \label{burgers_op_rep} \end{equation} \subsection{Empirical risk function} For this simple example, to learn a neural operator, which can approximate the operator $\fG:\phi \mapsto u$, we use no labeled data and only utilize the information of PDE, i.e., governing equation and boundary condition, $\phi^k$, $k=1,2,\cdots,K$. To utilize the constraint of governing equation of PDE, we uniformly sample a set of data from $\Omega=[-1,1]$, i.e., $S^{\Omega,k}$. Since the boundary $\partial\Omega$ consists of two points, i.e. $-1$ and $1$, then we directly use the information of these two points. The empirical risk for this example is as follows, \begin{equation} \begin{aligned} \RS & = \frac{1}{K}\sum_{k\in[K]} \bigg(\lambda_1 \frac{1}{|S^{\Omega,k}|}\sum_{x \in S^{\Omega,k}}\Big( \partial_{x}(\frac{1}{2}{u^2_{\vtheta}(x;\phi^k)})-\partial_{xx}u_{\vtheta}(x;\phi^k) \Big)^{2} \\ & \quad + \lambda_2 \Big( u_{\vtheta}(-1;\phi^k)-\phi^k(-1)) \Big) \\ & \quad + \lambda_3 \Big( u_{\vtheta}(1;\phi^k)-\phi^k(1)) \Big) \bigg). \label{burgers_leastsquareloss} \end{aligned} \end{equation} \subsection{Learning process} For each training epoch, we first randomly choose source functions denoted by $\{\phi^k\}_{k=1}^{K}$. Second, we randomly sample data and obtain data set $S^{\Omega,k}$. In the following, we feed the data into the neural networks $G_{\vtheta_L}(x)$, $G_{\vtheta_R}(x)$ and calculate the total risk (\ref{burgers_leastsquareloss}) with neural operator $u_{\vtheta}(x;g)$, see Eq. (\ref{burgers_op_rep}). Train neural networks $G_{\vtheta_L}(x)$, $G_{\vtheta_R}(x)$, and $F_{\vtheta}(x)$ with Adam to minimize the total risk, and finally we obtain well-trained DNNs $G_{\vtheta_L}(x)$, $G_{\vtheta_R}(x)$ and $F_{\vtheta}(x)$, furthermore, according to Eq. (\ref{burgers_op_rep}), we obtain a neural operator $u_{\vtheta}(x;\phi)$. \subsection{Results} The boundary condition $\phi(x)=c_1\cos(k_1x) + c_2\sin(k_2x)$ is determined by $c_1,c_2,k_1,k_2$. To illustrate our approach, we train a neural operator mapping from $\phi(x)$ to the solution $u(x)$ of the Burgers equation (\ref{Burgers example}). \paragraph{Example 5: MOD-Net for Burgers equation} To solve the PDE with various $c_1,c_2,k_1,k_2$ accurately and quickly, we use MOD-Net approach to learn a neural operator. For simplicity, we fixed $c_1=4,k_1=2,k_2=10$ and only change $c_2$. \begin{figure}[!htb] \centering \includegraphics[scale=0.11]{loglog_loss.png} \caption{Example 5. Training loss vs. epoch for the learning of the operator of Burgers equation. The blue curve is the total risk Eq. (\ref{burgers_leastsquareloss}). The other three curves represent three terms in the total risk Eq. (\ref{burgers_leastsquareloss}), respectively.} \label{fig:burgers_op_loss} \end{figure} \begin{figure}[!htb] \centering \subfigure[$c_2$=3.1]{ \includegraphics[scale=0.11]{c1_4.000_c2_3.100_omega1_2.000_omega2_10.000.png} } \subfigure[$c_2$=4.1]{ \includegraphics[scale=0.11]{c1_4.000_c2_4.100_omega1_2.000_omega2_10.000.png} } \subfigure[$c_2$=5.1]{ \includegraphics[scale=0.11]{c1_4.000_c2_5.100_omega1_2.000_omega2_10.000.png} } \subfigure[$c_2$=6.1]{ \includegraphics[scale=0.11]{c1_4.000_c2_6.100_omega1_2.000_omega2_10.000.png} } \subfigure[$c_2$=6.9]{ \includegraphics[scale=0.11]{c1_4.000_c2_6.900_omega1_2.000_omega2_10.000.png} } \caption{Example 5. Comparison between numerical solution and MOD-Net solution on equidistributed isometric points in $\Omega=[-1,1]$ corresponding to each of boundary conditions determined by $\phi(x)=4\cos(2x) + c_2\sin(10x)$.} \label{fig:burgers_op} \end{figure} In training process, we set $K=21$ and for each epoch, we choose $c_2$'s, i.e., $\{3+0.2(k-1)\}_{k=1}^{21}$. For each $k$, we uniformly sample $500$ points in $[-1,1]$ for $S^{\Omega,S,k}$. The training loss is shown in Fig. \ref{fig:burgers_op_loss}. The total risk (indicated by blue curve) roughly decays with training epoch. For visualization of each part of the total risk, we also display the residual loss of the Burgers equation (indicated by orange curve) and the loss of two boundary loss (indicated by green and red curves), which roughly decay with the training epoch at the final stage. To test the performance of the trained MOD-Net on $c_2=3.1,4.1,5.1,6.1,6.9$. For each $c_2$, we plot the MOD-Net solution and the corresponding numerical solution on $500$ equidistributed isometric points sampled in $\Omega=[-1,1]$. As shown in Fig. \ref{fig:burgers_op}, the MOD-Net solutions overlap well with the numerical solutions for all cases. \section{Numerical experiments: $2$D nonlinear equation} \label{sec:nonlinear} We consider the following nonlinear equation, \begin{equation}\label{Poisson-nonlinear} \begin{aligned} & -\Delta u(\vx)+0.01u^3(\vx)=g(\vx), \quad \vx\in \Omega, \\ & u(\vx)=0, \quad \vx\in \partial \Omega. \end{aligned} \end{equation} Take a $2$D case as example, in which source function $g(x,y)=-a(x^2-x+y^2-y)+0.01(\frac{a}{2}x(x-1)y(y-1))^3$, \begin{equation} \begin{aligned} & -(\partial_{xx}u+\partial_{yy}u)+0.01u^3=-a(x^2-x+y^2-y)+0.01(\frac{a}{2}x(x-1)y(y-1))^3, \quad (x,y)\in \Omega, \\ & u=0, \quad (x,y)\in \partial \Omega, \end{aligned} \label{2D_nonlinear_case} \end{equation} where $\Omega=[0,1]^2$ and $a$ controls the source term $g(x,y)$. Obviously, the analytical solution is $u(x,y;g)=\frac{a}{2}x(x-1)y(y-1)$. \subsection{Use DNN to fit nonlinear operator} In the considered $2$D case, $g(x,y)=-a(x^2-x+y^2-y)+0.01(\frac{a}{2}x(x-1)y(y-1))^3$, we have \begin{equation} u(x,y;g) = F(\int_0^1\int_0^1 G(x,y,x',y')g(x',y') \diff{x'}\diff{y'}). \end{equation} We use a DNN of hidden layer size $128$-$128$-$128$-$128$ $G_{\vtheta}(x,y,x',y')$ to fit the function $G(x,y,x',y')$ and a DNN of one hidden layer, the size of which is $256$, equipped with sigmoid function as activation function $F_{\vtheta}(x,y)$. When we calculate the integral, We use the Gauss-Legendre numerical integral. Then we can represent neural operator $u_{\vtheta}(x,y;g)$ with DNN $G_{\vtheta}(x,y,x',y')$ and $F_{\vtheta}(x,y)$, that is, \begin{equation} \begin{aligned} u_{\vtheta}(x,y;g) = F_{\vtheta}(\sum_{x^\prime \in S_{G_x}}\sum_{y^\prime \in S_{G_y}} \omega_{x^\prime} \omega_{y^\prime} G_{\vtheta}(x,y,x^\prime,y^\prime)g(x^\prime,y^\prime)), \end{aligned} \label{nonlinear_Gausianint} \end{equation} where $S_{G_x}\subset[0,1]$,$S_{G_y}\subset[0,1]$ consist fixed integration points, determined by $1$D Gauss-Legendre quadrature and $\omega_{x^\prime}$, $\omega_{y^\prime}$ are corresponding coefficients. \subsection{Empirical risk function} For this example, to train the neural networks, we use no labeled data and only utilize the information of PDE, i.e., governing equation and boundary condition, for each $g^k,k=1,2,\cdots,K$. To utilize the constraint of governing equation of PDE, we uniformly sample a set of data from $\Omega=[0,1] \times [0,1]$, i.e., $S^{\Omega,k}$. To utilize the information of boundary constraint, for each $k$, we uniformly sample a set of data from $\partial\Omega$. Since the boundary $\partial\Omega$ consists of four line segments, i.e., $\partial\Omega=\bigcup_{i=1}^{4}\partial\Omega_i$, where $\partial\Omega_1=\{(0,y)\}_{y\in[0,1]}$,$\partial\Omega_2= \{(1,y)\}_{y\in[0,1]}$,$\partial\Omega_3=\{(x,0)\}_{x\in[0,1]}$,$\partial\Omega_4=\{(x,1)\}_{x\in[0,1]}$, we uniformly sample a set of data from $\partial\Omega_i$ respectively, i.e., $S^{\partial\Omega_i,k}$, i=1,2,3,4. Since we use no labeled data, $\lambda_3$ in the general definition is set as zero. The empirical risk for this example is as follows, \begin{equation} \begin{aligned} \RS & = \frac{1}{K}\sum_{k\in[K]} \bigg(\lambda_1 \frac{1}{|S^{\Omega,k}|}\sum_{(x,y) \in S^{\Omega,k}}\Big( \partial_{xx}u_{\vtheta}(x,y;g^k)+\partial_{yy}u_{\vtheta}(x,y;g^k)+u_{\vtheta}(x,y;g^k)^3 -g^k(x,y) \Big)^{2} \\ & \quad + \lambda_2 \frac{1}{|S^{\partial\Omega_1,k}|}\sum_{(x,y) \in S^{\partial\Omega_1,k}} {u_{\vtheta}(x,y;g^k)}^{2} \\ & \quad + \lambda_2 \frac{1}{|S^{\partial\Omega_2,k}|}\sum_{(x,y) \in S^{\partial\Omega_2,k}} {u_{\vtheta}(x,y;g^k)}^{2} \\ & \quad + \lambda_2\frac{1}{|S^{\partial\Omega_3,k}|}\sum_{(x,y) \in S^{\partial\Omega_3,k}} {u_{\vtheta}(x,y;g^k)}^{2} \\ & \quad + \lambda_2\frac{1}{|S^{\partial\Omega_4,k}|}\sum_{(x,y) \in S^{\partial\Omega_4,k}} {u_{\vtheta}(x,y;g^k)}^{2} \bigg). \label{nonlinearcase_leastsquareloss} \end{aligned} \end{equation} \subsection{Learning process} For each training epoch, we first randomly choose source functions $\{g^k\}_{k=1}^{K}$ and calculate their values on fixed integration points$(x',y')$, where $x' \in S_{G_x}$ and $ y' \in S_{G_y}$. Second, we randomly sample data and obtain data set $S^{\Omega,k},S^{\partial \Omega_i,k},i=1,2,3,4$. We obtain the data set $D= \{(x,y,x',y',g^k(x',y'))| (x,y)\in S^{\Omega,k} \cup \bigcup_{i=1}^{4} S^{\partial\Omega_i,k},x'\in S_{G_x},y' \in S_{G_y}\}$. In the following, we feed the data into the neural network $G_{\vtheta}(x,y,x',y')$ and calculate the total risk (\ref{nonlinearcase_leastsquareloss}) ) with neural operator $u_{\vtheta}(x,y;g)$, see Eq. (\ref{nonlinear_Gausianint}). Train neural networks $G_{\vtheta}$ and $F_{\vtheta}$ with Adam to minimize the total risk, and finally we obtain well-trained DNNs $G_{\vtheta}$ and $F_{\vtheta}$, furthermore, according to Eq. (\ref{nonlinear_Gausianint}), we obtain a neural operator $u_{\vtheta}(x,y;g)$. \subsection{Results} The source function $g(x,y)=-a(x^2-x+y^2-y)+0.01(\frac{a}{2}x(x-1)y(y-1))^3$ is determined by $a$. We then denote source function $g(x,y)$ by $g_a$. To illustrate our approach, we train a neural operator mapping from $g$ to the solution of the equation (\ref{2D_nonlinear_case}). \subsubsection{Example 6: MOD-Net for a family of nonlinear equations} For illustration, we would train the MOD-Net by various source functions and test the MOD-Net with several source functions that are not used for training. \begin{figure}[!htb] \centering \subfigure[$a=15$]{ \includegraphics[scale=0.11]{nonlinear_laplace_op_a_15_analytic.png} } \subfigure[$a=15$]{ \includegraphics[scale=0.11]{nonlinear_laplace_op_a_15_DNN.png} } \subfigure[$a=15$]{ \includegraphics[scale=0.11]{nonlinear_laplace_op_a_15_error.png} } \caption{Example 6. Comparison between analytic solution and MOD-Net solution on $101\times101$ grid points corresponding to source terms determined by $a=15$. (a) Analytic solution. (b) MOD-Net solution. (c) The difference between the analytic solution and MOD-Net solution. Since the error at most points are very small, here we reduce the upper limit of the Color bar to see more information. } \label{fig:nonlinear_op_contrast_leastsquare_error} \end{figure} \begin{figure}[!htb] \centering \subfigure[$a=15,x=0.0$]{ \includegraphics[scale=0.11]{nonlinear_laplace_op_a_15_x_0.0.png} } \subfigure[$a=15,x=0.5$]{ \includegraphics[scale=0.11]{nonlinear_laplace_op_a_15_x_0.5.png} } \subfigure[$a=15,x=1.0$]{ \includegraphics[scale=0.11]{nonlinear_laplace_op_a_15_x_1.0.png} } \caption{Example 6. Comparison between analytic solution and MOD-Net solution on $x=0,0.5,1$ corresponding to source function determined by test $a=15$.} \label{fig:nonlinear_op_contrast_leastsquare_section} \end{figure} In training, we set $K=10$ and for each epoch, we choose a family of source functions $g_a(x,y)=-a(x^2-x+y^2-y)+0.01(\frac{a}{2}x(x-1)y(y-1))^3$ , where the control parameter $a \in \{10k\}_{k=1}^{10}$. We set the number of integration points $|S_{G_x}|=10$ and $|S_{G_y}|=10$, and for each epoch, we randomly sample $200$ points in $[0,1]^2$ and sample $200$ points in each line of boundary, respectively. We set $\lambda_1=1,\lambda_2=1$ in the empirical risk using least square loss (\ref{nonlinearcase_leastsquareloss}). We test the performance of this well-trained MOD-Net on $a=15$. For each fixed $a$, the corresponding exact true solution is $u(x,y)=\frac{a}{2}x(x-1)y(y-1)$. For visualizing the performance of our well-trained MOD-Net, we show the analytic solution and MOD-Net solution on $101\times101$ equidistributed isometric grid points by color. To compare these two solutions more intuitively, we calculate the difference of the two solutions at each point and show the error by color ,i.e., as the error increases, the color changes from blue to red, in Fig. \ref{fig:nonlinear_op_contrast_leastsquare_error}. The root mean square error (RMSE) is $\sim 5.6 \times 10^{-4}$. We also show the solution obtained by MOD-Net and the corresponding analytical solution on fixed $x=0,0.5,1$ for considered test source function. As shown in Fig. \ref{fig:nonlinear_op_contrast_leastsquare_section}, the MOD-Net can well predict the analytic solutions. \section{Conclusion and discussion} \label{sec:con} In this work, we propose a model-operator-data network (MOD-Net) for solving PDEs. The advantage of the MOD-Net is that it solves a family of PDEs but not a specific one in a meshless way without expensive labeled data. For illustration, we use MOD-Net approach solving Poisson equation and a family of nonlinear PDEs, in which the empirical risk of MOD-Net only requires the physical information of the PDE and does not require any labeled data. And in some examples, such as constructed equation, which can be regarded as a simplification of RTE, and the real one-dimensional RTE, with only physical information and operator representation built into the empirical risk is not enough to guarantee the learning of correct solutions despite the small training loss. By adding \emph{few labeled data as regularization} which are calculated analytically or computed by traditional numerical schemes on the coarse grid points with cheap computational cost, we show that the MOD-Net can be well trained to approximate the correct solution. Though the good results are shown above, there are many important problems of efficiently using DNN to solve PDE for future works. One is that it remains unclear what are the appropriate weights of different components to use in the total loss. Second is to understand why the learned solver can be far away from the true solution even when residual loss and boundary loss are almost zero and why data regularization can rescue this phenomenon. And Third, the MOD-Net is a framework to guide us how to take advantage of DNN to solve the physical PDEs. The aforementioned three key components should be adapted to specific PDEs. For nonlinear operator it is still not clear what representations we should use, although many existing work propose their own representations~\cite{lu2019deeponet,wang2021learning,li2020fourier,li2020neural} . For the data part, how many labeled data should we use and whether noisy data will have the same good regularization effect are all very important work to be done. Other works need to be done including how we can use DNN to represent a Green's function related to variable coefficient, such as the $\sigma$ in RTE. Typically traditional DNN is not possible to parameterize an operator that is imposed on functions, so a careful design and build of the architecture is needed to feed information into the network of operator. We leave all this for future discussion. \section*{Acknowledgments} This work is sponsored by the National Key R\&D Program of China Grant No. 2019YFA0709503 (Z. X.) and No. 2020YFA0712000 (Z. M.), the Shanghai Sailing Program (Z. X.), the Natural Science Foundation of Shanghai Grant No. 20ZR1429000 (Z. X.), the National Natural Science Foundation of China Grant No. 62002221 (Z. X.), the National Natural Science Foundation of China Grant No. 12101401 (T. L.), the National Natural Science Foundation of China Grant No. 12101402 (Y. Z.), Shanghai Municipal of Science and Technology Project Grant No. 20JC1419500 (Y. Z.), the National Natural Science Foundation of China Grant No. 12031013 (Z. M.), Shanghai Municipal of Science and Technology Major Project No. 2021SHZDZX0102, and the HPC of School of Mathematical Sciences and the Student Innovation Center at Shanghai Jiao Tong University. \bibliographystyle{plain}
\section{Introduction} In recent years, the field of machine learning (ML) has matured to the point where it can provide real value to power system operations; for this reason, a large portion of research work focuses on applying ML to power system applications. Within this new paradigm, the availability of large amounts of real data is crucial. Unfortunately, while power system models of all kinds are readily available, data is a much more scarce resource and the research community must rely on the very few and limited datasets that are publicly available. The goal of our project is to develop a mechanism for the generation of synthetic time-series transmission-level load data. Leveraging a proprietary dataset of high resolution measurements from hundreds of phasor measurement units (PMUs) across many years of operation, we can model the behavior of real system loads and subsequently generate realistic-looking data on demand. The focus on bus-level load data is motivated by the fact that loads are one of the main external drivers of power system behaviors; loads depend on phenomena outside of the power system itself (consumer behaviors, weather, etc.). Thus, realistic load profiles can be used as an input to existing power system programs to accurately determine electric quantities such as voltages and currents via dynamic simulation. In this work, we use a ML technique called conditional generative adversarial network (cGAN) \cite{mirza2014conditional} which represents a powerful and flexible framework for the training of a generative model. Simple GANs \cite{goodfellow2014generative} and conditional GANs have been used in the literature for the generation of PMU voltage data \cite{xiangtian}, renewable energy profiles \cite{baosen}, and residential energy consumption \cite{WANG2020110299} but not for transmission-level load data. We train a cGAN to generate realistic, synthetic week-long time-series load profiles at a resolution of one sample per hour. The generation of synthetic data can be conditioned on labels indicating the season of the year or the type of load profile desired in order to meet the user's specific requirements. In the literature, the two main approaches to the generation of synthetic transmission-level load data are to: 1) use prototypical customer load curves and knowledge of the specific geography and demographics to combine them into aggregate loads \cite{Li2020}, or 2) use net or zonal demand and disaggregate it at the bus level based on fixed factors \cite{Grigg}. The main weakness of the first method is the fact that it can only be applied to grid models for which detailed information on the geography of the system and the population served by each load is available: this is required to determine the composition of each load. More importantly, since both methods rely on a limited number of prototypical curves (either zonal or customer level), the resulting synthetic data is limited in diversity and complexity. We follow a newer approach that involves training ML algorithms and generative models on real power system data; the resulting synthetic data can then be mapped to any power system model. Based on this concept, we have proposed in the past a method based on singular value decomposition \cite{pinceti}. The limitations of that work lie in the fact that the synthetic data length was limited to the length of the real dataset used and the generated data only captured main patterns. Using a non-linear model such as conditional generative adversarial networks, we are able to capture more diverse and nuanced load behaviors and overcome the limitations of the previous methods. \section{Generative Adversarial Networks}\label{GAN} \subsection{Basic GAN} Generative adversarial networks are a novel ML framework in which a generative model (or generator) is trained by making it compete against a discriminator. The goal of the generator $G$ is to capture the distribution of the real data $p_r$, while the discriminator $D$ is trained to distinguish the real data from the synthetic data produced by the generator. The generator is trained to learn a mapping $G(\bm{z};\theta_g)$ from a known noise distribution $p_z$ to $p_g$, where $G$ is a differentiable function represented by a multilayer neural network with parameters $\theta_g$ and $\bm{z}$ is a noise vector sampled from $p_z$. Given a data sample $\bm{x}$, the discriminator determines the probability $D(\bm{x}, \theta_d)$ that the sample came from the real data distribution $p_r$ rather than from the generator $p_g$. The training of $D$ and $G$ is represented by a two-player minimax game with the following objective function: \begin{equation} \min_G\max_D \mathbb{E}_{\bm{x}\sim p_r(\bm{x})}[\log D(\bm{x})]+\mathbb{E}_{\bm{z}\sim p_z(\bm{z})}[\log (1-\ D(G(\bm{z})))] \end{equation} Here, the discriminator is maximizing the likelihood of data $x$ when sampled from $p_r$ and minimizing it when sampled from $p_g$, while the generator has the opposite goal of maximizing the likelihood of the samples from $p_g$. The optimal solution is obtained when the discriminator assigns a probability of 0.5 to all samples, meaning that it cannot distinguish between real and generated data. \subsection{Conditional GAN} Conditional generative adversarial networks (cGAN) are an improvement on the basic GAN framework which allow for a more targeted generation of synthetic data. The conditioning is performed by labelling the real data and then providing this label $\bm{y}$ as a further input to both the generator and the discriminator. By doing this, the generator learns the conditional distribution $p_g$ over $\bm{x}|\bm{y}$ and the generation process can be guided by requesting synthetic data belonging to a specific class. The final structure of a generic cGAN can be seen in Fig.~\ref{condGAN}. \begin{figure}[h] \centering \includegraphics[width=9cm,height=4.5cm]{figs/condGAN.png} \caption{Structure of a conditional GAN.} \label{condGAN} \end{figure} \section{Dataset Description} The foundation of this project is a large dataset of real PMU data obtained from a utility in the USA. The data spans two years (2017 and 2018) and about 500 PMUs installed at the transmission level. Based on the system topology and the location of the measurement devices, we identified 12 load buses whose lines are entirely monitored by PMUs. The net injection at these buses represents the load demand and this allowed us to compute the active and reactive power of the 12 loads with a resolution of 30 samples per second. As discussed in the introduction, the focus of this work is the generation of week-long profiles at a resolution of 1 sample per hour for a total of 168 hours. The raw, PMU-speed load data is then downsampled by computing the hourly load average and broken into weeks. When combining all weekly profiles from all 12 loads, the final dataset is a 1158x168 matrix. Each week-long profile is normalized by dividing it by the average load over the week; the entire dataset is further normalized between 0 and 1 for the training of the cGAN. \section{Load Characteristics} Different factors influence the way system loads behave over time. To appropriately generate realistic synthetic load profiles for a given application, these elements need to be captured and modeled by the GAN. When looking at the week-long time-series data described in the previous section, two main driving factors can be identified: time of the year, and type of load. The differences between load profiles due to seasonal changes in energy consumption can be easily visualized. Figure~\ref{seasons} shows four week-long profiles for a load, across the four different seasons. In winter and fall, the load pattern presents two daily peaks, one in the morning and one in the afternoon. During spring and especially summer, the load is more regular, with a large spike during the day and dips at night. This type of behavior can be observed in a more or less pronounced manner across all the loads in our dataset. For this reason, the season of the year to which a profile belongs is an important indicator (label) of the expected profile. \begin{figure} \centering \includegraphics[width=9cm,height=5cm]{figs/seasons.pdf} \caption{Examples of real profiles; different seasons present different patterns.} \label{seasons} \end{figure} At the transmission level, each load represents the aggregate demand of one or more distribution feeders. Thus, the behavior of a load is given by the sum of all the customers at the distribution level that it serves. Because of this, the second main factor that determines the temporal profile of a load is its composition in terms of residential, commercial, and industrial portions since each of these types of loads tend to have very distinctive patterns. In our dataset, we have observed two classes of loads with very distinct behaviors: loads that are mainly residential and/or commercial and loads that are mainly industrial. Figure~\ref{types} shows some selected examples: on the top and bottom left are mainly residential loads from winter and summer respectively, while on the right are winter and summer profiles of a mainly industrial load. As we can see, loads that are mainly residential have very regular and predictable patterns, whereas industrial loads do not necessarily follow recognizable daily patterns. We used a $k$-means clustering algorithm to label each load as mainly residential or mainly industrial. When using 3 clusters, two main groups of loads are identified, each containing five and six loads, while one single load is grouped separately. We observed that the loads where the top two factors in terms of percentage composition are residential and commercial are clustered as one, while the loads in which the industrial component is first or second are grouped as another cluster. Thus, for training purposes, six loads are labeled as mainly residential and six as mainly industrial (for more details, we refer the reader to the Appendix found in \cite{Pincetigithub}). \begin{figure} \centering \includegraphics[width=9cm,height=4.7cm]{figs/types.pdf} \caption{Examples of real load profiles. Top row: mainly residential winter load (left) and mainly industrial winter load (right). Bottom row: mainly residential summer load (left) and mainly industrial summer load (right).} \label{types} \end{figure} \section{cGAN for Synthetic Load Profiles} \subsection{cGAN model} In this section, we will describe the implementation of the cGAN and its training process. Convolutional neural networks (CNNs) are chosen for the discriminator and the generator for their ability to learn multiple spectral properties of the data. While similar in size and complexity, the two models present some differences. The discriminator receives two inputs: first, the raw time-series is processed by two convolutional layers, then the flattened output is concatenated to its label and fed to three fully-connected layers. The output of the discriminator is a scalar indicating if a profile is real (1) or fake (0). In the generator, the two inputs are the load label and a 25-dimensional Gaussian noise vector\footnote{The dimension of the noise vector depends on the GAN architectures chosen and the desired output vector length.}. These are concatenated and fed to three fully connected layers and the output is up-sampled via three transposed convolution layers. The final output is a synthetic load profile whose characteristics match the input label. The overall architecture of the cGAN is illustrated in Fig.~\ref{weekGAN}. As we have seen in the previous section, two characteristics of loads are used as labels for the conditional GAN: the season and whether a load is mainly residential or industrial. The factors are represented as one-hot encoded vectors, i.e., the seasons are represented via the following four labels: (1 0 0 0) for winter, (0 1 0 0) for spring, (0 0 1 0) for summer, and (0 0 0 1) for fall. Similarly, the load type is encoded as: (0 1) for mainly residential and (1 0) for mainly industrial. The training process is performed by iteratively training the discriminator to distinguish between real and generated data and the generator to create realistic-looking profiles. The discriminator is trained twice at every iteration in order to give it an advantage against the generator; this forces the generator to produce better samples. Figure~\ref{trainconv} shows the training progresses as the epochs proceed. The three curves represent the average discriminator prediction at each epoch for three sample datasets: real data used during training (blue), real data never used during training (validation data, green), and fake data created by the generator (orange). We can see that at the beginning the discriminator easily distinguishes between real and fake data, assigning high values to both real datasets and low value to the generated data. As training progresses, the generator improves and the discriminator is unable to differentiate between the two data sources. At around 3000 epochs, the training converges: the discriminator assigns very similar values to all three datasets. It is interesting to notice that some overfitting is happening (the blue curve reaches 0.53) but it is not very significant. More importantly, the discriminator assigns the same values to both the generated data and the validation data; this means the output of the generator matches the real data. The training took approximately 3 hours on a computer with Nvidia RTX2080. Using the trained model to generate synthetic data is extremely fast: 1000 profiles can be generated in less than a second. \begin{figure} \centering \includegraphics[width=8cm,height=6cm]{figs/weekGAN.png} \caption{Structure of the cGAN used for the generation of week-long profiles.} \label{weekGAN} \end{figure} \begin{figure} \centering \includegraphics[width=9cm,height=4.3cm]{figs/trainconv.png} \caption{Training progress of the cGAN based on the predictions of the discriminator at each epoch. The blue curve shows the average prediction over a batch of real training profiles. The green curve represents real validation data and the orange one predictions on generated data.} \label{trainconv} \end{figure} \subsection{Data Generation}\label{datageneration} Once the training process is terminated, the generator can be used to create any number of synthetic profiles. Based on the required data type, the user only needs to define the appropriate label and generate a noise vector according to the predetermined distribution; feeding these to the generator will result in a synthetic load profile. As an example, in Fig.~\ref{001001} two synthetic summer profiles (right) are compared to two randomly selected real profiles (left) of the same label. The blue profiles (top) correspond to a mainly residential load and the green plots (bottom) to a mainly industrial load. It is important to notice that while the synthetic profiles present all the same characteristics as real data, they do not simply repeat real profiles. \begin{figure} \centering \includegraphics[width=9cm,height=5.5cm]{figs/syndata.pdf} \caption{Comparison between some real summer profiles (left) and generated profiles (right). Top: mainly residential load. Bottom: mainly industrial load.} \label{001001} \end{figure} \section{Evaluation of Synthetic Data} While visual inspection does not yield clear differences between real and synthetic profiles, a quantitative analysis is required to verify that the generator captures all of the characteristics and behaviors present in the real data. In this section, we present multiple tests to validate the quality of the synthetic data. \subsection{Wasserstein Distance} As explained in Section~\ref{GAN}, the goal of the generator is to learn a mapping function from the known noise distribution to the distribution of real data. Training is successful when the distribution of generated data matches that of the real data. Wasserstein distance is a measure of distance between two distributions and it can be used to quantitatively assess how close the distributions of generated and real data are. The center plot in Fig.~\ref{wd} shows the Wasserstein distance computed during training at each epoch between a batch of generated data and a batch of validation data. It can be seen that as the training progresses, the distance between the distributions tends to zero. This can be further seen by looking at the two smaller plots on either side. The plots to the left and right show the histograms (empirical distributions) of the real data (blue) and that of the generated data (orange), at epoch 0 (left plot) and at epoch 3000 (right plot), respectively. While initially the two distributions are very different, at the end of training the generated data almost perfectly matches the distribution of real data. \begin{figure} \centering \includegraphics[width=9cm,height=3.5cm]{figs/wd.pdf} \caption{Center plot: Wasserstein distance between real and generated data as a function of epochs. Side plots: comparison between the distribution of real (blue) and generated data (orange) at epoch 0 (left) and epoch 3000 (right).} \label{wd} \end{figure} \subsection{Power Spectral Density} An important characteristic of time-series load data is its periodicity. Because loads are tied to the routine and behavior of people, they present different recurring patterns. One way to identify these periodicities is by looking at the power spectral density of the time-series data. Figure~\ref{psd} shows the power spectral density for real data (blue) and generated data (orange). It can be seen that the two plots match very closely, confirming that the generated data captures the periodic behavior of real data. It is also interesting to look at the various peaks that appear in spectral density: in particular, the highest peak, which occurs at a frequency of 0.04/hour, corresponds to a time period of 24 hours, thus representing the daily load cycle. \begin{figure} \centering \includegraphics[width=9cm,height=5cm]{figs/psd.png} \caption{Comparison between the power spectral density of real data (blue) and generated data (orange).} \label{psd} \end{figure} \subsection{Forecasting Application} The main goal of this paper is to create a mechanism for the generation of realistic synthetic load data that can be used by researchers when real data is either not available or not rich enough. In the next two sections we present the results of two example applications that show that the synthetic data successfully captures the behavior of real data and that it can be used for downstream applications. One of the most common uses of time-series load data is the development of the forecasting algorithms needed for power system operations and markets. While many different techniques are used, often in combination, one of the latest advancements in ML-based forecasting is a class of recurrent neural networks called long short-term memory (LSTM). Because feedback loops are present, the LSTM architecture is able to process sequences of data (such as time-series data) maintaining a memory of the previous inputs. To verify the quality of our load data generator, we trained an LSTM on a batch of synthetic data and then tested the learnt model on the real data. An LSTM network with three layers and 48 units per layer is trained to predict the value of a load at one point in time, given the previous 48 hours (48 points). This model is trained on two separate datasets independently: synthetic mainly residential summer profiles and synthetic mainly residential fall profiles. Each of the datasets consists of 1200 week-long profiles generated using the trained cGAN according to their respective labels. To evaluate the performance of the LSTM, for each of the two load types, the trained models are used to predict the load values of two batches of profiles: new generated data and real data of the same class. The percentage error between the forecasted value and the actual value is computed for each profile in a batch and the first and second moments are computed. Table~\ref{forecastingtable} summarizes the results of the forecasting test for the two types of loads (summer and fall residential). In both cases we can see that even though the model was trained only on synthetic data, the error when applied to real data is very comparable. In general, this suggests that a user could train a ML model on our synthetic data and be confident that it would still capture the characteristics of real data. \begin{table} \centering \caption{Comparison of the forecasting error between generated and real load data, for summer and fall residential profiles.} \begin{tabular}{|l|c|c|c|} \hline \multirow{2}{*}{\textbf{Load label}} & \multicolumn{1}{l|}{\multirow{2}{*}{\textbf{Testing data}}} & \multicolumn{2}{c|}{\textbf{Percentage Error}} \\ \cline{3-4} & \multicolumn{1}{l|}{} & \multicolumn{1}{l|}{Mean} & \multicolumn{1}{l|}{Std. Dev.} \\ \hline \multirow{2}{*}{Summer - Residential} & Synthetic & 4.37 & 5.26 \\ \cline{2-4} & Real & 5.30 & 5.17 \\ \hline \multirow{2}{*}{Fall - Residential} & Synthetic & 5.82 & 7.10 \\ \cline{2-4} & Real & 5.92 & 5.17 \\ \hline \end{tabular} \label{forecastingtable} \end{table} \subsection{Optimal Power Flow} The synthetic data is also tested to verify that the generated profiles can be correctly mapped to a power system model. One way to check this is to ensure that all the resulting load cases form a feasible AC power flow. This test is performed by first generating individual, week-long profiles for each load in the Polish test case: this system model has 2383 buses and 1822 loads. Two datasets are generated: one corresponding to a winter week and one for a summer week. Each of these profiles is mapped to the Polish system loads: since the base case of the Polish system is a peak case, the profiles are matched so that the peak of each profile corresponds to the base case value. AC optimal power flow (OPF) is then run on each case corresponding to each of the 168 hours of the week. The results showed that OPF converged in every case to a solution with bus voltages and generator outputs within their predefined limits. \section{Conclusion} We have presented a method to generate synthetic transmission load data at a bus level leveraging conditional generative adversarial networks. A user can specify the time of the year and type of load for which to generate time-series load profiles. Extensive testing is performed and we have verified the validity of our method and quality of the generated data. Our trained generative model will be available to researchers to be used for any type of power system and ML application. Moreover, the proposed conditional learning framework can be leveraged for the generation of other datasets highlighting different characteristics, such as the level of penetration of renewables or electric vehicle charging. Finally, we are working on expanding the generative model to create a tool for the generation of synthetic datasets at any time resolution (from 30 samples/second to a few samples/week) and for any length of time (from a few minutes to multiple years). The trained generative model and an Appendix with extra figures and results can be found at \cite{Pincetigithub}. \section{Acknowledgments} The authors acknowledge Research Computing and Gil Speyer at ASU for providing HPC and storage resources. This material is based upon work supported by the National Science Foundation under Grant Nos. CNS-1449080 and OAC-1934766 and the Power System Engineering Research Center (PSERC) under projects S-72 and S-87.
\section{Introduction} The formation of Sun-like stars is set in motion by the collapse of a cold, dense cloud. Many different physical processes take place in the protostellar stage -- first few $10^5$ yrs that are critical to the subsequent evolution of the star and its planetary system \citep{Lada1987}. The mass of the star and that of its circumstellar disk are determined during this embedded phase \citep{Hueso2005} and the first steps of planet formation must take place then \citep{Greaves2010, Williams2012, ALMA2015,Manara2018,Harsono2018,Tobin2020,Tychoniec2018a,Tychoniec2020,SeguraCox2020}. At the same time, on larger scales, the collapsing envelope is dispersed by the energetic action of bipolar jets and winds emanating from the star-disk system which create outflows of entrained gas and dust \citep{Arce2006,Offner2014} Rotational transitions of molecules are a powerful tool to probe other components of the system and can be used to infer densities, temperatures, UV fields, chemical abundances and kinematics \citep{vanDishoeck1998,Evans1999}. Until recently, studies of low-mass protostars have suffered from insufficient spatial resolution to disentangle these different physical components. The advent of submillimeter interferometry opened the possibility to study protostellar systems at much smaller scales than with single-dish observations \citep[e.g.,][]{Chandler1996,Hogerheijde1999,Schilke1992, Wilner2000, Jorgensen2005b, Tobin2011}. With the Atacama Large Millimeter/submillimeter Array (ALMA), it is possible to image many molecular lines on the relevant physical scales with achievable observing times at sub-arcsecond resolution. Impressive ALMA studies of individual low-mass protostars have been presented, focusing both on simple species (< 6 atoms) and complex molecules (> 6 atoms) \citep[e.g.,][]{Sakai2014b, Jorgensen2016, LopezSepulcre2017,Lee2019, Codella2018, LeeJE2019, Manigand2020, vanGelder2020, Bianchi2020}. The first ALMA surveys of complex molecules on a larger sample are taking place \citep{Yang2021} and of Class I disks \citep{Podio2020, Garufi2020}. The CALYPSO survey with NOEMA studied a larger sample of protostars but at more limited resolution and sensitivity \citep{Belloche2020, Maret2020, Podio2021}. Here we present ALMA data of 16 protostellar sources covering rotational transitions of various molecules; we use these data to build a complete picture of what types of molecules trace which physical structures in protostars. This sample constitutes one of the largest combinations of high-resolution ALMA observations of Class 0/I protostars to date in ALMA Band 3, 5, and 6. Covering a broad range of protostellar properties within the low-mass regime, the aim is to identify and describe key molecular tracers of future Sun-like stars and what physical components of star-forming sources they correspond to. Parts of the ALMA datasets presented here have been already published, focusing on different aspects: complex organic molecules \citep{vanGelder2020,Nazari2021}; Class I disks temperature structure \citep{vantHoff2020b}; outflows and high-velocity jets in Serpens \citep{Hull2016, Tychoniec2019}, molecular emission associated with magnetic fields \citep{Hull2017, LeGouellec2019}. In this work we make a comprehensive overview of these different datasets, making full use of those observations, with uniform analysis methods. This allows to reveal and systematise the molecular tracers of Class 0/I protostars. Out of 16 presented sources 11 are included in upcoming {\it James Webb Space Telescope} (JWST) observations with the Mid-Infrared Instrument (MIRI; \citealt{Wright2015}) (\citeyear{JWST1290,JWST1257}) and Near-Infrared Spectrograph (NIRSpec) ( \citeyear{JWST1960,JWST1186,JWST1798,JWST2104}) \subsection{Physical components of a protostellar system} Class 0 sources are defined by their strong excess of submillimeter luminosity and very low bolometric temperatures \textless 70~K \citep{Andre1993, Chen1995}. These sources are associated with powerful outflows, and the envelope mass dominates the mass of the entire system. Class I sources are defined by having an infrared spectral index indicating strong reddening \citep{Lada1987} with bolometric temperatures of 70--650 K \citep{Chen1995}. Those systems have already converted most of their envelope mass into disk and protostar \citep{Crapsi2008, vanKempen2009a, Maury2011}. For the typical envelope masses of sources presented here and average disk masses found by \citet{Tychoniec2020}, the $M_{\rm disk}/M_{\rm env}\simeq$ 1\% for Class 0 and $\simeq$ 20\% for Class I, with values up to 75--98\% in cases of rotationally supported disks \citep{Jorgensen2009}. \begin{table*} \caption{Targeted protostellar systems} \label{table:targets} \centering \begin{tabular}{l l c c c c c c c} \hline\hline Source name & R.A. & Decl. & $d$ & Class & $L_{\rm bol}$ & $T_{\rm bol}$ & $M_{\rm env}$ & Ref. \\ & (J2000) & (J2000) & (pc) & & (L$_{\odot}$) & (K) & (M$_{\odot}$) & \\ \hline Serpens SMM1 & 18:29:49.8 & +01:15:20.5 & 439 & 0 & 109 & 39 & 58 & (1)\\ Serpens S68N & 18:29:48.1 & +01:16:43.3 & 439 & 0 & 6 & 58 & 10 & (2) \\ Ser-emb 8 (N) & 18:29:48.7 & +01:16:55.5 & 439 & 0 & --- & --- & --- & ---\\ Serpens SMM3 & 18:29:59.2 & +01:14:00.3 & 439 & 0 & 28 & 38 & 13 & (1) \\ BHR 71 & 12:01:36.3 & -65:08:53.0 & 200 & 0 & 15 & 44 & 2.7 & (1)\\ IRAS 4B & 03:29:12.0 & +31 13 08.1 & 293 & 0 & 7 & 28 & 4.7 & (1)\\ Per-emb-25 & 03:26:37.5 & +30:15:27.8 & 293 & 0/I & 1.9 & 61 & 2.0 & (2) \\ B1-c & 03:33:17.9 & +31:09:31.8 & 293 & 0 & 5 & 48 & 15 & (2) \\ HH211-mm & 03:43:56.8 & +32:00:50.2 & 293 & 0 & 2.8 & 27 & 19 & (2) \\ L1448-mm & 03:25:38.9 & +30:44:05.3 & 293 & 0 & 13 & 47 & 15 & (2) \\ L1527 IRS & 04:39:53.9 & +26:03:09.5 & 140 & 0/I & 1.6 & 79 & 0.12 & (3) \\ B5-IRS1 & 03:47:41.6 & +32:51:43.7 & 293 & I & 7 & 181 & 3.5 & (2) \\ TMC1 & 04:41:12.7 & +25:46:34.8 &140 & I & 0.9 & 101 & 0.14 & (1) \\ IRAS 04302 & 04:33:16.5 & +22:53:20.4 &140 & I & 0.7 & 300 & 0.05 & (1) \\ L1489 IRS & 04:04:43.0 & +26:18:57.0 &140 & I & 3.8 & 200 & 0.2 & (1)\\ TMC1A & 04:39:34.9 & +25:41:45.0 & 140 & I & 2.7 & 118 & 0.2 & (1)\\ \hline \end{tabular} \begin{tablenotes}\footnotesize \item{(1) \citealt{Kristensen2012}, (2) \citealt{Enoch2009}, (3) \citealt{Green2013} } \end{tablenotes} \end{table*} The different components of protostellar systems vary significantly in their physical conditions, such as density and temperature, molecular enrichment, and dynamics. Our current knowledge about them is described briefly below to set the scene for the interpretation of our data. {\it Envelope.} The envelope surrounding a protostar is the material that fuels the accretion process onto the star and disk. The physical conditions in the outer envelope on scales of a few 1000 au are reminiscent of those of starless cores with heavy freeze-out, and their chemical composition is directly inherited from the cloud out of which the star is being born \citep{Caselli2012}. Systematic motions such as infall or expansion can occur but otherwise they are characterized by low turbulence and narrow (FWHM < 0.5 - 1 km s$^{-1}$) line profiles indicative of quiescent gas \citep{Jorgensen2002}. {\it Warm inner envelope}. In the innermost part of the envelope on scales of the disk, temperatures rise above 100 K, so any water and complex organic molecules (COMs) contained in ices are released from the grains back into the gas where they are readily observed at submillimeter wavelengths. This region with its unique chemical richness is called the hot core, or to distinguish it from its high-mass counterpart, hot corino \citep{Herbst2009}. {\it Jets and outflows}. As the material is accreting from the envelope onto the disk, excess angular momentum has to be transported via a still elusive process to allow material to accrete on the growing protostar. Jets and outflows constitute compelling candidates to extract angular momentum via magnetic fields. In the earliest stages when the mass loss is at its peak, the densities are high enough to form molecules in the internal shocks in the jet \citep{Bachiller1992, Tafalla2010}. Much slower (\textless 20 km s$^{-1}$) and less collimated gas moving away from the protostar is called an outflow. Their origin remains debated. Large scale outflows reveal bow-shock shells and cavities possibly driven by the fast intermittent jet \citep{Gueth1996, Gueth1999, Tychoniec2019}. Temperatures in shocked regions are much higher than in the surrounding envelope, up to a few thousand K, and sputtering of grain cores and ice mantles can further result in unique chemical signatures \citep{Arce2008, Flower2013}. {\it Outflow cavity walls.} These are the narrow zones in between the cold dense quiescent envelope material and the lower-density warm cone where outflows are propagating at large velocities. Cavity walls are exposed to UV radiation from the accreting star-disk boundary layer, which can escape through the outflow cavity without being extincted \citep{Spaans1995}. This creates conditions similar to those found in Photon Dominated Regions (PDRs), which occur throughout the interstellar medium near sources of intense UV radiation \citep{Hollenbach1997}. In units of the interstellar radiation field (ISRF, \citealt{Draine1978}), typical values of 10$^2$--10$^3$ are found on scales of $\sim 1000$ au \citep{vanKempen2009c, Yildiz2012,Benz2016, Karska2018}. {\it Young disk.} In the inner envelope, a protoplanetary disk starts to form as the natural outcome of a rotating collapsing core \citep{Ulrich1976, Cassen1981,Terebey1984}. A young disk should be rotating in Keplerian motion. At early stages it is difficult to identify whether the so-called embedded disk is rotationally supported, since any molecular emission from the disk is entangled with that from the envelope. In recent years several embedded disks have been identified to have Keplerian rotational structure on scales of $\sim$100 au \citep{Tobin2012,Murillo2013,Ohashi2014, Yen2017}. Molecular tracers in young disks, apart from providing the kinematic information, can probe their temperature structure as well \citep{vantHoff2018a}. This work is organized as follows. In Section \ref{section:observations}, the observations used in this work are presented, Section \ref{section:results} presents the results of this work including detections and morphology of the targeted molecules. In Section \ref{section:discussion} the results are discussed. with special focus on which molecular tracers are corresponding to each of the physical components. The focus is on a qualitative description, rather than quantitative analyses for which source specific models and more rotational transitions of a given molecule would be needed. We summarize our work in Section \ref{section:conclusions}. \section{Observations} \label{section:observations} \subsection{Datasets} Six different ALMA 12m datasets at Band 3, 5, and 6 are used in this work to cover 14 out of 16 sources. The spatial resolution of all ALMA 12m datasets is comparable (0\farcs3--0\farcs6), except for 2017.1.01174.S, where Band 3 observations are obtained at 3\arcsec. Additionally for 6 out of 16 sources in Band 6, ACA observations with 7m antennas were obtained at 6\arcsec\ resolution. \begin{figure*}[h] \centering \includegraphics[width=1\linewidth,trim={0cm 0cm 0cm 0cm}] {plots/fig1.jpeg} \caption{ Continuum emission at 1.3 mm of four example protostellar systems obtained with ALMA at 0\farcs5 resolution. Symbols of stars point to confirmed protostellar sources, circles show condensations of continuum emission, without confirmed protostellar nature, dotted lines show outflow cavity walls, and dashed lines show streams of envelope material. Arrows indicate outflow directions.} \label{fig:continuum_showcase_v1} \end{figure*} The targeted protostars are well-known objects located in different star-forming regions. They span a range of properties within the low-mass regime; the probed range of $L_{\rm bol}$, $T_{\rm bol}$ and $M_{\rm env}$ is shown in Table \ref{table:targets}, and are provided by a suite of observations across the infrared and submillimeter spectrum \citep{Enoch2009,Kristensen2012,Green2013}. The details of the observations are summarized in Table \ref{table:observations}. The spatial resolution allows to observe protostellar systems at solar-system scales; Band 5 and 6 observations provide a resolution of $\sim$0\farcs5, which corresponds to a 70--220 au diameter for sources in our sample. Thus, regions down to 35-110 au radius in the inner envelope are probed. The Band 3 data achieve moderate resolution of $\sim$3\arcsec\ which provides information on intermediate envelope scales of 500--1500 au. The ACA observations of six sources at 6\arcsec\ resolution probe envelope scales of 800--2000 au. \subsection{Spectral setup of the observations} A collection of different datasets using different ALMA bands implies varying spectral and spatial resolution as well as spectral coverage across the analysis. This is the reason that throughout this paper the sources shown in the figures differ when presenting detections and maps of different molecules. In all cases, when the molecule is discussed, only those sources where the given transition has been targeted are discussed. All non-detections are explicitly stated. Table \ref{table:table_mols} provides a list of targeted molecular transitions, with sources that have a particular line covered and detected or not detected. \begin{figure*}[h] \centering \includegraphics[width=0.95\linewidth,trim={2cm 1cm 2cm 0cm}] {plots/fig2.jpeg} \caption{Maps of key envelope tracers toward B1-c (Class 0, top) and TMC1 (Class I, bottom) obtained with ACA. Contours represent continuum emission at 1.3 mm observed with ACA. Note different distances to B1-c and TMC1 resulting in different spatial resolutions of the maps. {\it Left:} C$^{18}$O 2 -- 1 {\it Middle:} N$_2$D$^+$ 3 -- 2. {\it Right:} DCO$^+$ 3 -- 2. All moment 0 maps are integrated from -2.5 to 2.5 km s$^{-1}$ w.r.t $\varv_{\rm sys} $.} \label{fig:envelope_plot_no1_v1} \end{figure*} The ALMA observations presented here target different spectral setups across Band 3, 5, and 6. This allows to probe the strongly varying physical scales and conditions. In particular, our Band 3 data grants access to lines at very low excitation levels that enable tracing more extended material. Dust is less optically thick in Band 3 compared with Band 6 which potentially allows to peek inside the densest inner regions. Band 6 offers a usual set of tracers of outflows: CO, SiO and SO. Cold outer envelopes with temperatures \textless~20~K are probed with low $E_{\rm up}$ transitions. Additionally, non-thermal processes such as sputtering of material from the grains in the outflow, will also be seen in low $E_{\rm up}$ due to their lower critical densities. On the other hand, thermal desorption from grains in the innermost regions are best probed with lines with high $E_{\rm up}$. With the large span of frequencies of the observations, different transitions of the same molecule can be detected and used to trace different components of the system (e.g., a HNCO line at $E_{\rm up}=$ 15 K is available in Band 3 and lines at 70 and 125 K are covered in Band 6). \section{Results} \label{section:results} \subsection{Continuum emission from protostars } Figure \ref{fig:continuum_showcase_v1} presents continuum emission maps toward four example protostars obtained with ALMA at $\sim$ 0\farcs5. The examples illustrate most characteristic features observed in the continuum maps. The continuum images for all sources are presented in Fig. \ref{fig:continuum_no1_v1}. The continuum emission observed at millimeter wavelengths (1.3 - 3 mm in our observations) traces thermal dust emission from the inner envelope and the embedded disk. In the Class 0 protostars, the central continuum source generally appears compact $R$ \textless 100 au (e.g., B1-c, Fig. \ref{fig:continuum_showcase_v1}). The example of SMM3 (Fig. \ref{fig:continuum_no1_v1}) shows a large resolved dust structure perpendicular to the outflow, but its classification as a disk is not certain. The fact that we observe primarily compact continuum emission towards Class 0 sources is consistent with observations of confirmed rotationally-supported disks \citep[e.g.,][]{Tobin2018, Maury2019, Tobin2020} and predictions of models \citep{Visser2010,Harsono2015b, Machida2016}. While we assume that this compact emission belongs to the young, embedded disk, we do not have spatial and kinematic resolution to confirm the presence of Class 0 Keplerian disks in our sample. The extended continuum emission in Class 0 sources is consistent with a significant amount of envelope material surrounding the protostar. In the case of the SMM1 system, presented in Fig. \ref{fig:continuum_showcase_v1} (left), the continuum clumps outside the central emission are components of multiple protostellar systems, marked with stars, confirmed by the presence of individual molecular outflows \citep{Hull2016, Hull2017}. Binary components are also seen in TMC1, BHR71, and IRAS 4B (Fig. \ref{fig:continuum_no1_v1}). In the case of S68N presented in Fig. \ref{fig:continuum_showcase_v1}, two emission peaks that stand out from the diffuse envelope emission are marked with circles, but their protostellar nature is not confirmed. \subsection{Protostellar envelope} We present molecules that trace the bulk of the protostellar envelope in Fig. \ref{fig:envelope_plot_no1_v1}. The protostellar envelope has a typical radius on the order of a few 1000 au \citep{Jorgensen2002,Kristensen2012}. Thus, the sub-arcsecond ALMA 12m array observations tend to resolve-out the envelope emission. For instance, the maximum recoverable scale (MRS) of ALMA Band 6 observations at 0\farcs4 presented here is 5\arcsec, which is between 600--2000 au diameter depending on distance to the source. For that reason, we discuss in this section mainly the ALMA-ACA observations obtained at lower spatial resolution (6\arcsec; 750--2500 au) for six sources in our datasets; Class 0 sources: B1-c, BHR71, Per-emb-25, SMM3, and IRAS 4B, and Class I source TMC1. The ACA can zoom-in on what was previously contained in a single-dish beam of 15--20\arcsec, while the MRS of ACA (30\arcsec) enables us to preserve sensitivity to large-scale emission. The MRS of all observations presented here are reported in Table \ref{table:observations}. In Fig. \ref{fig:envelope_plot_no1_v1} typical envelope tracers C$^{18}$O 2--1 ($E_{\rm up} = 16$ K), DCO$^+$ 3--2 ($E_{\rm up} = 21$ K), and N$_2$D$^+$ 3--2 ($E_{\rm up} = 22$ K), observed at 6\arcsec\ resolution with the ACA, are presented toward example Class 0 and Class I sources -- B1-c and TMC1, respectively. The emission from the presented molecules exhibits similar behaviour for all Class 0 sources, therefore B1-c serves as a representative case; TMC1 is the only Class I source in the sample with 7m observations available. The maps for all sources for which these molecules have been targeted can be found in Appendix \ref{AppendixD}. All envelope tracers presented here are characterized by narrow line profiles with FWHM $\sim 1$ km s$^{-1}$. The C$^{18}$O emission peak coincides with the continuum peak for our six sources and appears to be compact, less than 1000 au diameter for B1-c and TMC1. For B1-c and all Class 0 sources (Fig. {\ref{fig:envelope_co18_7m}), low-level extended C$^{18}$O emission is seen along the outflow direction. For the only Class I source targeted with the ACA, emission is marginally resolved in the direction perpendicular to the outflow. In our observations N$_2$D$^+$ is seen extended in the direction perpendicular to the core major axis toward B1-c (Fig. \ref{fig:envelope_plot_no1_v1}) and other Class 0 sources except IRAS 4B (Fig.{\ref{fig:envelope_n2d+_7m}). In the case of IRAS 4B the emission from this molecule appears dominated by large-scale emission from the filament detected toward this source, connecting it with IRAS 4A \citep{Sakai2012}. The peak of the N$_2$D$^+$ emission is significantly shifted from the continuum peak in all cases, with a significant decrease in the inner regions in some cases (see BHR 71 in Fig. {\ref{fig:envelope_n2d+_7m}). Similar extended N$_2$D$^+$ emission in other Class 0 sources was seen by \cite{Tobin2013} based on lower resolution SMA and IRAM-30m data. For TMC1 the N$_2$D$^+$ molecule is not detected. The DCO$^+$ emission is seen extended in a similar fashion to what is observed for N$_2$D$^+$. However, contrary to N$_2$D$^+$, DCO$^+$ is brightest on the continuum peak for all sources except TMC1 and Per-emb-25. For these two sources, the emission peak is offset by 1000--2000 au from the continuum source in the direction perpendicular to the outflow. In the Class I source TMC1, DCO$^{+}$ is present on much smaller scales ($< 2000$ au radius) than in Class 0 sources. \begin{figure*}[h] \centering \includegraphics[width=0.95\linewidth,trim={0cm 0cm 0cm 0cm}] {plots/fig3.jpeg} \caption{Maps of the EHV jets observed in SiO. Moment 0 maps are presented in color scale with continuum emission at 1.3 mm presented in black contours, both obtained with 12m observations. SiO 4--3 map of HH211 integrated from -20 to -10 and from 10 to 20 km s$^{-1}$ w.r.t $\varv_{\rm sys}$; B1-c ntegrated from -70 to -40 and from 40 to 70 km s$^{-1}$ w.r.t $\varv_{\rm sys} $; SMM3 integrated from -60 to -40 and from 20 to 35 km s$^{-1}$ w.r.t $\varv_{\rm sys}$. } \label{fig:ehv_no1} \end{figure*} \begin{figure*}[h] \centering \includegraphics[width=0.95\linewidth,trim={2cm 0cm 2cm 2cm}] {plots/fig4.jpeg} \caption{Zoom-in on molecular bullets from the SMM3 jet (see Fig. \ref{fig:ehv_no1}). CO, SiO, SO, and H$_2$CO molecular transitions are presented. {\it Top:} Norther/blueshifted bullet. Moment 0 maps are integrated from -60 to -40 km s$^{-1}$ w.r.t $\varv_{\rm sys}$. The map center is offset from the SMM3 continuum center by (--3\farcs7, +10\farcs3). {\it Bottom:} Southern/redshifted bullet. Moment 0 maps are integrated from 20 to 40 km s$^{-1}$. The map center is offset from the SMM3 continuum center by (+2\farcs7, --7\farcs).} \label{fig:ehv_no2} \end{figure*} \begin{figure*}[h] \centering \includegraphics[width=0.95\linewidth,trim={0cm 0cm 0cm 0cm}] {plots/fig5.jpeg} \caption{Low-velocity outflow in CO, SO, and SiO. Moment 0 maps of CO toward TMC1, SO and SiO map toward B1c are integrated from -10 to 10 km s$^{-1}$ w.r.t $\varv_{\rm sys}$.} \label{fig:lowvel} \end{figure*} \subsection{Outflows and jets} \label{section:results_outflows} Figure \ref{fig:ehv_no1} presents the extremely high-velocity (EHV) molecular jet component for HH211, B1c, and SMM3 observed in SiO with the ALMA 12m array; the L1448-mm EHV is shown in Fig. \ref{fig:outflow_showcase_no1}. The latter and HH211 are well-known EHV sources \citep{Guilloteau1992, Lee2007} while SMM3 and B1-c are new detections of the jet component. HH211 shows SiO emission at low-velocities because the outflow is almost in the plane of the sky, but the high velocities are evident from the large proper motion movements of the bullets ($\sim$115 km s$^{-1}$; \citealt{LeeCF2015}). CO, H$_2$CO, and SiO in the EHV jets of Emb8N and SMM1 are presented in detail in \cite{Hull2016} and \cite{Tychoniec2019}. These data are particularly interesting as still only few molecules tracing EHV jets have been identified to date (see \citealt{Lee2020} for review). Apart from those presented here -- CO, SiO, SO, and H$_2$CO-- molecules such as HCO$^+$ and H$_2$O have been seen in this high-velocity component \citep{Kristensen2012,LeeCF2014}. What is especially important to highlight is the third detection of a H$_2$CO bullet in SMM3 after IRAS 04166 \citep{Tafalla2010} and Emb8N \citep{Tychoniec2019}. These detections mean that either a significant fraction of ice-coated dust is released with the jet, or that the H$_2$CO is efficiently produced in the jet through gas-phase chemistry. In the case of L1448-mm and HH211, there are several molecular bullets along the jet axis with velocities up to 100 km~s$^{-1}$, while both B1-c and SMM3 show a much simpler structure with two bullets detected on one side in the former and a single pair of symmetrically placed bullets observed in the latter case. B1-c actually has a pair of bullets $\sim$~200 au from the continuum peak, with the other bullet at 2500 au only seen in the redshifted part of the jet. The emission in SiO and SO appears very similar (Fig. \ref{fig:sio_outflows_no2}, Fig. \ref{fig:so_outflow}). There are no other molecules tracing the high-velocity component toward this source. H$_2$CO and $^{12}$CO are not targeted with our ALMA 12m datasets toward B1-c. The SMM3 jet has two distinct high-velocity bullets at $\sim$~3200 au from the source which appear similar in CO, SiO and SO (see zoom-in on Fig \ref{fig:ehv_no2}). Additionally, the redshifted bullet shows faint, but significant emission from H$_2$CO. No traces of H$_2$CO are found in the blueshifted outflow. Figure \ref{fig:lowvel} presents low-velocity outflow tracers CO 2--1 ($E_{\rm up}=16$ K) for TMC1, SO 5$_6$--4$_5$ ($E_{\rm up}=35$ K), and SiO 4--3 ($E_{\rm up}=21$ K) for B1-c. In Fig. \ref{fig:co_outflows} we present an overview of CO 2--1 emission for five sources obtained with the ALMA 12 m array at 0\farcs4 resolution. The sources show a variety of emission structures in the low velocity gas (\textless 20 km s$^{-1}$). In all cases, we do not capture the entirety of the outflows as they extend beyond the primary beam of observations ($\sim$ 30\arcsec). SMM3 and Emb8N have very narrow outflow opening angles ($<$ 20 degrees), while SMM1, S68N and TMC1 present larger opening angles. CO emission is especially prominent in the cavity walls, which can be related to both the limb brightening effect as well as higher (column) density of the material in the outflow cavity walls. This is especially highlighted in the Class I source, TMC1, where CO emission is almost exclusively seen in the outflow cavity walls. Even though CO is piling up in this region, it is observed at velocities up to 15 km s$^{-1}$ so it is clearly tracing the entrained material and not the envelope. The lower envelope density in Class I results in less material to be entrained in the outflow. In SMM1, three CO outflows from SMM1-a, SMM1-b, and SMM1-d are overlapping \citep{Hull2016,Tychoniec2019}. In Fig. \ref{fig:sio_outflows_no2}, SiO maps are presented: Band 5 SiO 4--3 ($E_{\rm up}=21$ K) and Band 6 SiO 5--4 ($E_{\rm up}=31$ K) data are shown in velocity ranges corresponding to the low-velocity outflow. In contrast to CO emission, the low-velocity SiO is mostly observed in clumps of emission instead of tracing the entirety of the outflowing gas. Several such clumps can be seen in the S68N source. In some cases, the clumps are relatively symmetric (Emb8N, B1-c), while monopolar emission is seen in other examples (L1448-mm, SMM1-d). In the case of SMM1-a and SMM1-b, very weak SiO emission at low velocities is observed. SiO emission in outflows is exclusively present in the Class 0 sources, while absent in the Class I sources, TMC1 and B5-IRS1, covered in these data sets. Fig. \ref{fig:so_outflow} presents SO 5$_6$--4$_5$ ($E_{\rm up}=35$ K) and SO 6$_7$--5$_6$ ($E_{\rm up}=47$ K) observations in Band 6. The emitting regions of SO are comparable with those of SiO for the Class 0 sources. The cases of S68N and B1-c show that SO emission also peaks at the source position while SiO is absent there. Thus, SO and SiO do not always follow each other and some SO might be associated with hot core emission \citep{Drozdovskaya2018}. Important differences are observed for TMC1, where SO seems to be associated with the remainder of the envelope or the disk, while the SiO is not detected toward this source, as mentioned above. HCN 1--0 ($E_{\rm up}=4$ K) and H$^{13}$CN 2--1 ($E_{\rm up}=12$ K) maps are presented in Fig. \ref{fig:hcn_outflow} and \ref{fig:h13cn}, respectively. HCN is clearly seen in outflowing material enhanced in similar regions as low-velocity SiO. For Emb8N the HCN emission has been associated with intermediate velocity shock \citep{Tychoniec2019}. In B1-c and L1448-mm weak extended emission along the outflow direction is detected but H$^{13}$CN strongly peaks on source. In the case of HH211, H$^{13}$CN is seen only in the outflow, with a geometry consistent with the outflow cavity walls, but with velocity profiles that are consistent with the outflowing material. \begin{figure*}[h] \centering \includegraphics[width=0.95\linewidth,trim={2cm 1cm 2cm 0cm}] {plots/fig6.jpeg} \caption{Maps of the ice mantle tracers toward the S68N outflow, with the CO low-velocity outflow map for reference. {\it Top:} CO, H$_2$CO and CH$_3$OH moment 0 maps obtained in Band 6 at 0\farcs5 resolution. Circles show regions from which spectra were obtained for analysis in Section 7.1. {\it Bottom:} CH$_3$CHO, HNCO, and CH$_3$CN moment 0 maps obtained in Band 3 at 2\farcs5 resolution. The emission is integrated from -10 to -1 km s$^{-1}$ and from 1 to 10 km s$^{-1}$ w.r.t $\varv_{\rm sys} $.} \label{fig:icemantle_no1} \end{figure*} \begin{figure*}[h] \centering \includegraphics[width=0.95\linewidth,trim={2cm 0cm 2cm 0cm}] {plots/fig7.jpeg} \caption{Maps of the outflow cavity wall tracers toward SMM3 and B1c, with low-velocity outflow map for reference. {\it Top:} Moment 0 maps toward SMM3 of CO 2--1, c-C$_3$H$_2$ 6$_{1,6}$--5$_{0,5}$ , and $^{13}$CS 5--4 obtained in Band 6 at 0\farcs5 resolution and CN 1--0 in Band 3 at 3\arcsec with continuum emission at the same band and resolution in black contours. {\it Bottom:} Moment 0 maps toward B1c of SO 6$_{7}$--5$_{6}$, C$_2$H 3$_{2.5,3}$--2$_{1.5,1}$ and H$^{13}$CO$^+$ 3--2 obtained at 0\farcs5 and CN 1--0 at 3\arcsec with continuum emission at the same band and resolution in black contours. The emission is integrated from -5 to -1 km s$^{-1}$ and from 1 to 5 km s$^{-1}$ w.r.t $\varv_{lsr} $. Outflow directions and delineated cavity walls are shown in C$_2$H and C$_3$H$_2$ maps.} \label{fig:hydrocarbons_no1} \end{figure*} Ice-mantle tracers are a different class of molecules detected in low-velocity protostellar outflows. They are produced and entrained through interactions between the jet and the envelope. Here we present ALMA 12m array observations in Band 6 at 0\farcs5 resolution for CO 2 -- 1 ($E_{\rm up}=17$ K), CH$_3$OH 2$_{1,0}$ -- 1$_{0,0}$ ($E_{\rm up}=28$ K), and H$_2$CO 3$_{0,3}$ -- 2$_{0,2}$ ($E_{\rm up}=21$ K) , and in Band 3 at 3\arcsec\ for CH$_3$CN 6$_1$ -- 5$_1$ ($E_{\rm up}=26$ K), CH$_3$CHO 6$_{1,6,0}$ -- 5$_{1,5,0}$ ($E_{\rm up}=21$ K), and HNCO 5$_{0,5}$ -- 5$_{0,4}$ ($E_{\rm up}=16$ K). Fig. \ref{fig:icemantle_no1} compares maps of integrated emission from those molecules with those of CO for S68N. All ice-mantle tracers detected in the outflow are observed in their low-energy transitions. Additional maps for S68N are presented in the Appendix (Fig. \ref{fig:fig9_extra}): Band 6 0\farcs5 resolution image of CH$_3$CHO 14$_{0,14}$--13$_{0,13}$ ($E_{\rm up}=96$ K) and H$_2$CCO 13$_{1,13}$--12$_{1,12}$ ($E_{\rm up}=101$ K), which is overlapping with NH$_2$CHO 12$_{2,10}$--12$_{2,10}$ ($E_{\rm up}=92$ K), and the Band 3 image at 3\arcsec\ resolution of CH$_3$OCHO 10$_{0,10}$--9$_{0,9}$ ($E_{\rm up}=30$ K). Around the frequency of H$_2$CCO 3$_{1,13}$--12$_{1,12}$ ($E_{\rm up}=101$ K) line an extended emission can be seen in the outflow, this is however coincident with the NH$_2$CHO which is only 4 km s$^{-1}$ apart (Fig. \ref{fig:fig9_extra}). NH$_2$CHO is more commonly observed in the shocked regions than H$_2$CCO \citep{Ceccarelli2017, Codella2017}; it is possible that those lines are blended. More low-energy transitions would be required to confirm the identification of these lines. The velocities observed for ice-mantle tracers in the outflow are \textless 15 km s$^{-1}$ with respect to the systemic velocity. This is slower than the CO and SiO outflow line wings which have velocities up to 20--30 km s$^{-1}$. On the other hand, the lines are clearly broader than those of molecular tracers of UV-irradiated regions that trace passively heated gas (see Section \ref{section:outflow_cavity_walls}). Ice-mantle tracers are also detected in SMM3 and B1-c, two Class 0 protostars (Fig. \ref{fig:161} and \ref{fig:151}). For SMM3 only a lower $A_{ij}$ transition of CH$_3$OH with $E_{\rm up}=$ 61 K was targeted and not detected towards this source. B1-c has its methanol emission confused with the high-velocity SO emission, whereas emission from other COMs in the outflow is weak and appears only on the redshifted part of the outflow. Thus, S68N is the best case to study the composition of shock-released ice mantles. \subsection{Outflow cavity walls} In this section, we highlight key molecules detected in the outflow cavity walls. It is challenging to precisely distinguish cavity walls from the outflowing material. The velocity of the gas in the cavity walls should be lower than in the outflow, as the cavity wall contains envelope material at rest but which is passively heated by UV radiation. We first discuss maps of species associated with cavity walls and then their line profiles. \begin{figure*}[h] \centering \includegraphics[width=0.95\linewidth,trim={0cm 0cm 0cm 0cm},draft=False] {plots/fig8.jpeg} \caption{Spectra obtained at the cavity wall positions for hydrocarbons (red) and ice-mantle tracers (blue). {\it Left:} C$_2$H 3$_{2.5, 2}$--2$_{1.5, 1}$ ($E_{\rm up}=$ 25 K) and CH$_3$OH 2$_{1,0}$--1$_{0,1}$ ($E_{\rm up}=$ 28 K) spectra for S68N, {\it Middle:} C$_2$H 3$_{2.5, 2}$--2$_{1.5, 1}$ ($E_{\rm up}=$ 25 K ) and SO 6$_7$--5$_6$ ($E_{\rm up}=48$ K) spectra for B1-c, {\it Right:} c-C$_3$H$_2$ $4_{4,1}$--$3_{3,0}$ ($E_{\rm up}=32$ K), H$_2$CO 3$_{2,1}$--2$_{2,0}$ ($E_{\rm up}=68$ K), and $^{13}$CS 5--4 ($E_{\rm up}=33$ K) spectra for SMM3.} \label{fig:spectra_coms_outflow_no1} \end{figure*} \begin{figure}[h] \centering \includegraphics[width=0.95\linewidth,trim={0cm 0cm 0cm 0cm}] {plots/fig9.jpeg} \caption{Compact emission for B1-c and SMM3 for various molecules tracing the warm inner envelope (hot core). Moment 0 maps shown in colorscale integrated from -3 to 3 km s$^{-1}$ w.r.t $\varv_{\rm sys}$. 1.3 mm continuum presented in contours.} \label{fig:hotcore_v1} \end{figure} Figure \ref{fig:hydrocarbons_no1} presents integrated emission maps of key tracers discussed in this section for two examples: SMM3 and B1-c. Plots for the remaining sources (S68N, Emb8N, and TMC1) are presented in the Appendix in Fig. \ref{fig:hydrocarbons_no2}. Key tracers of the outflow cavity walls are simple unsaturated hydrocarbon molecules: c-C$_3$H$_2$ $4_{4,1}$--$3_{3,0}$ ($E_{\rm up}=32$ K) for SMM3 and TMC1, and C$_2$H $3_{2.5,3}$--$2_{1.5,2}$ ($E_{\rm up}=25$ K) for S68N, B1-c, and Emb8N, as seen in maps obtained with ALMA Band 6 at 0\farcs5 resolution. In Emb8N and SMM3 the emission from C$_2$H and c-C$_3$H$_2$, respectively, is symmetric; it appears similar in extent and shape on both sides of the continuum source. Comparison with CO emission, which traces the bulk of the outflowing gas, indicates that the hydrocarbons are located in the outflow cavity walls close to the source. A higher energy transition of c-C$_3$H$_2$ 7$_{2,6}$--7$_{1,7}$ $E_{\rm up}$=61 K is seen towards SMM3 closer to the protostar compared with the lower-energy transition. This reflects the increase of temperature of the cavity walls closer to the source. For B1-c, the emission from C$_2$H is U-shaped suggestive of a cavity wall, stronger on the blueshifted side of the outflow, which could be either a projection effect or an asymmetry in the envelope structure. For B1-c no ALMA CO observations exist to compare with the bulk of the outflow at comparable resolution; however, the other outflow tracer, SO, confirms the outflow direction and rough extent of the outflow cavity walls. Moreover, the shape of the cavity walls is consistent with the appearance of the CO 3--2 outflow observed with SMA toward this source at 4\arcsec\ resolution \citep{Stephens2018}. S68N presents a chaotic structure (Fig. \ref{fig:hydrocarbons_no2}, top), but C$_2$H is found elongated in the outflow direction. While it is difficult to identify the cavity wall, the C$_2$H emission surrounds the CO outflow emission. The C$_2$H emission toward this source is asymmetric, with stronger emission in the blueshifted part of the outflow. Emission of c-C$_3$H$_2$ toward the Class I source TMC1 (Fig. \ref{fig:hydrocarbons_no2}, bottom) is not directly related to the cavity walls, but is extended perpendicular to the outflow, which suggests that c-C$_3$H$_2$ traces the envelope or extended disk material. Figure \ref{fig:hydrocarbons_no1} also shows CN 1--0 ($E_{\rm up}$ = 5 K) observed at 3\arcsec\ resolution in Band 3 for SMM3 and B1-c. Compared with C$_2$H, CN is tracing similar regions. In S68N CN has a similar extent as C$_2$H but not over the full extent of the outflow traced by CO. In B1-c, the CN emission has a similar shape of the cavity wall cone as seen in C$_2$H, but also a significant contribution from larger scales is detected. In all cases the CN emission avoids the central region, which likely results from on-source absorption by the foreground CN molecules. In some cases, like SMM3, the extent of the CN is broader than hydrocarbons, more comparable with CO, but the narrow linewidths suggest that this emission is still associated with passively irradiated envelope rather than with the entrained outflow. TMC1 presents a high-resolution example of CN emission (Fig. \ref{fig:hydrocarbons_no2}). The offset between CO and CN reveals a physical structure of the inner regions of the protostellar system: the entrained outflow traced with CO appears closer to the jet axis, while CN highlights the border between the outflow cavity wall and quiescent envelope. CN is sensitive to UV radiation, as it can be produced with atomic C and N, whose abundances are enhanced in PDRs, with UV photodissociation of HCN contributing as well \citep{Fuente1993,Jansen1995a,Walsh2010,Visser2018}. H$^{13}$CO$^{+}$ emission is presented for B1c (Fig. \ref{fig:hydrocarbons_no1}), and S68N and Emb8N (Fig. \ref{fig:hydrocarbons_no2}) observed in Band 6 at 0\farcs4 resolution. The bulk of the emission from this molecule appears to be related to the cold envelope, however streams of material can be seen in B1-c and S68N. The streams of gas observed in H$^{13}$CO$^+$ are coincident with the cavity wall observed in C$_2$H. As H$^{13}$CO$^+$ is expected to probe the dense envelope, the similarity of the morphology of the traced material between H$^{13}$CO$^+$ and C$_2$H and CN shows that the envelope material is UV-irradiated. $^{13}$CS observed in Band 6 with the 12m array is detected for SMM3 (Fig. \ref{fig:hydrocarbons_no1}). The morphology of $^{13}$CS emission is very similar to that of c-C$_3$H$_2$. In Fig. \ref{fig:spectra_coms_outflow_no1} spectra of ice mantle tracers, CH$_3$OH and H$_2$CO, and the hydrocarbon molecules, C$_2$H and C$_3$H$_2$ are presented. All spectra are shifted by their source velocity to zero km s$^{-1}$. In case of S68N, it is seen that C$_2$H and CH$_3$OH have very similar line profiles indicating that they trace similar material. The width of $\sim 10$ km$^{-1}$ suggests that this material is entrained with the outflow. A narrow component appears to be superposed at systemic velocities. Note that fine splitting of C$_2$H blends the spectra although the other transition at +2 km s$^{-1}$ does not affect the blueshifted velocity component. In contrast, B1c shows only remarkably narrow C$_2$H line profiles with a FWHM of $\sim$ 2 km s$^{-1}$, and SMM3 has similarly narrow c-C$_3$H$_2$ and $^{13}$CS lines compared with broader H$_2$CO emission (Fig. \ref{fig:spectra_coms_outflow_no1}, right). \begin{figure*}[h] \centering \includegraphics[width=0.95\linewidth,trim={3cm 1cm 3cm 0cm}] {plots/fig10a.jpeg} \includegraphics[width=0.95\linewidth,trim={3cm 1cm 3cm 0cm}] {plots/fig10b.jpeg} \caption{Images of Class I disks observed with ALMA 12m in Band 6 \citep{vantHoff2020b}. {\it Top:} Moment 0 maps of C$^{17}$O at 0\farcs4 resolution integrated from -10 to 10 km s$^{-1}$ w.r.t $\varv_{\rm sys} $. {\it Bottom:} Moment 0 maps of CN integrated from -2 to 2 km s$^{-1}$ w.r.t $\varv_{\rm sys} $. Continuum contours in black.} \label{fig:disks_no1_v1} \end{figure*} \subsection{Inner envelope} \label{section:results_inner_env} Fig. \ref{fig:hotcore_v1} shows emission from H$_2$CCO, HNCO, t-HCOOH, SO, H$_2$CS, and H$^{13}$CN for the Class 0 protostar B1-c, and H$_2$S and OCS lines for SMM3; all observed with the ALMA 12m array at 0\farcs5. Several molecules tracing the inner hot envelope are detected in 7m data and are presented in Fig. \ref{fig:102}. CCS is detected for SMM3, BHR71, and IRAS 4B, while non-detected for B1-c, TMC1, and Per-emb-25. OCS and H$_2$S (Fig. \ref{fig:102}) for all targeted in 7m Class 0 sources while non-detected for Class I sources. The SO 6$_7$--5$_6$ $E_{\rm up}=48$ K line is seen to peak on the central source for B1-c and S68N (Fig. \ref{fig:so_outflow}). SO has already been discussed in the outflow (Section \ref{section:low-velocity_outflow}), but it is also prominent in the inner envelope. While the spatial resolution does not allow to disentangle the hot core emission from the small-scale outflow on a few hundred au scale, there is a difference between these two sources and SMM3 and Emb8N. The latter two sources show a substantial decrease in SO intensity towards the continuum peak, i.e., they have prominent SO emission in the outflow, but not from the hot core. This suggests that sources like B1-c and S68N, which are bright in SO toward the continuum emission peak, have an additional component responsible for SO emission. This is highlighted by the narrower lines of SO toward the continuum peak compared with the outflow in S68N (Fig. \ref{fig:so_spectra_v1}). The narrow component, visible in spectra taken on-source, has a width of $\sim$ 5 km s$^{-1}$. The main component of the spectrum taken in the blueshifted outflow has a similar width but has a more prominent line wing up to 20 km s$^{-1}$. TMC1 clearly shows SO emission toward both components of the binary system, slightly offset from their peak positions (Fig. \ref{fig:so_outflow}). There is also a molecular ridge present in SO close to the disk-envelope interface. HNCO and HN$^{13}$CO are detected toward B1-c and S68N peaking on source in higher $E_{\rm up}$ transitions \citep{Nazari2021}. For lines with $E_{\rm up} < $90 K an extended component is also detected in the outflow. SMM3 and Emb8N have no detections of HNCO on source, but for SMM3 this molecule appears in the outflow. For all Class I sources where the relatively strong HNCO 11$_{0,11}$--10$_{0,10}$ line ($A_{ij}=2\times10^{-4}$ s$^{-1}$, $E_{\rm up}$=70 K) was targeted, it was not detected. OCS is detected toward SMM3 peaking in the center; S68N and SMM1 show centrally peaked O$^{13}$CS detection, a minor isotopologue signalling a high abundance of OCS (Fig. \ref{fig:o13cs_appendix}). In all cases the emission is moderately resolved; of size $\sim$ 200 au in case of SMM3 and detected up to 500 au away from source for S68N and SMM1. H$_2$S shows strong emission toward SMM3 and is also weakly present in TMC1. For SMM3 the emission is resolved along the outflow direction and perpendicular to the expected disk axis. Those are the only two sources for which H$_2$S 12m array data were taken. Additionally, the 7m data presented in the Appendix (Fig. \ref{fig:102}) show prominent, centrally peaked H$_2$S emission for four more Class 0 sources. H$_2$CS is detected for B1-c, S68N and L1448-mm through a line with $E_{\rm up}=$ 38 K. Another transition with $E_{\rm up}=46 $ K is found in Class I disks: IRAS-04302, L1489, and TMC1A. In B1-c, the emission is marginally resolved, while in IRAS-04302 the molecule is clearly seen across the midplane, indicating sublimation from icy grains at temperatures of at least 20 K \citep{vantHoff2020b,Podio2020}. H$_2$CCO is detected for B1-c and S68N. For the lower $E_{\rm up}=100$~K transition, the molecule is also detected in the outflow. For Class I sources, the transition at comparable energy is not detected. HCOOH is detected for B1-c and S68N with low-energy transitions that are seen both on source and in the outflow, while the higher energy line ($E_{\rm up}=83$~K) is seen only on source. H$^{13}$CN is detected in B1-c and L1448-mm on source, additionally to the outflow component. Disks are commonly observed in Class I sources \citep{Harsono2014,Yen2017}, as the envelope clears out. Fig. \ref{fig:disks_no1_v1} presents maps of the C$^{17}$O 2--1 ($E_{\rm up}=$ 16 K) and CN 2--1 ($E_{\rm up}=$16 K) lines toward Class I disks and L1527-IRS, which is identified as a Class 0/I object, observed with ALMA 12m at 0\farcs3 resolution. The C$^{17}$O and H$_2$CO emission for disks in Taurus using these data are analyzed in detail by \cite{vantHoff2020b}. Here we discuss CN in comparison with C$^{17}$O. C$^{17}$O is observed concentrated towards the continuum emission for all disks, and is a much cleaner tracer of the disk than any other more abundant CO isotopologues, although even C$^{17}$O still shows some trace emission from the surrounding envelope. \begin{figure*}[h] \centering \includegraphics[width=0.95\linewidth,trim={0cm 0cm 0cm 0cm},draft=False] {plots/fig11.jpeg} \caption{Summary cartoon presenting key molecular tracers of different components, limited to molecules presented in this work except for NH$_3$ and N$_2$H$^{+}$ which are important large scale envelope tracers. CN molecule is shown on top of the disk as it traces the disk atmosphere and not the midplane. Protostar indicated in the center in yellow.} \label{fig:cartoon_summary} \end{figure*} \section{Discussion} \label{section:discussion} Figure \ref{fig:cartoon_summary} summarizes current understanding about which molecule traces which component in Class 0/I protostars. Table \ref{table:table_components_mols} lists all molecules discussed in this work with indication of the physical component that they trace. Below, we will address several implications of the results. We note that the discussion is confined to the molecules targeted and detected in our datasets, but is by no means complete. Other relevant tracers not discussed here are NH$_3$ and N$_2$H$^{+}$, which are tracing the envelope well \citep[e.g.,][]{Tobin2011, Chen2007}. PO and PN have been recently suggested as a cavity walls or outflow tracers, but have very low abundances \citep{Bergner2019}. SO$_2$ is an important tracer of the warm gas in the disk-envelope interface \citep{ArturV2019}. Finally, this work focuses on low-energy transitions observed with ALMA $E_{\rm up} <$100 K with the exception for hot core tracers. \input{table_components.tex} \subsection{Cold envelope} \subsubsection{C$^{18}$O} C$^{18}$O is a good tracer of high column density material because of its low critical density. However, it becomes less abundant as soon as the dust temperature drops below the CO freeze-out temperature ($\sim$ 20--25 K). There is also a density threshold: CO freeze-out only occurs at densities above $\sim 10^4$--$10^5$ cm$^{-3}$, because at lower densities the timescales for freeze-out are longer than the lifetime of the core \citep{Caselli1999,Jorgensen2005a}. For 4 out of 6 sources presented here at 6\arcsec\ resolution, \cite{Kristensen2012} performed modeling of the SED and sub-mm spatial extent using the DUSTY code \citep{Ivezic1997}. The results provide, among other properties, a temperature structure throughout the envelope and the radius at which the temperature drops below 10 K, which is considered as the border between envelope and the parent cloud. \cite{Kristensen2012} obtained radii of 3800, 5000, 6700, and 9900 au for IRAS4B, TMC1, SMM3, and BHR71, respectively. The compact C$^{18}$O emission observed on-source and its non-detection over the full expected extent of the protostellar envelope can be explained by CO freeze-out occurring already within the inner 1800 -- 2500 au radius, which is the spatial resolution of our observations for Class 0 sources. This upper limit on the CO snowline is consistent with CO snowlines typically observed and modeled toward other Class 0 protostars \citep{Jorgensen2004d, Anderl2016, Hsieh2019}. Equation 1 from \cite{Frimann2017} allows to calculate the expected CO snow line for the current luminosity of the example sources B1-c and TMC1 presented in Fig. \ref{fig:envelope_plot_no1_v1} in the absence of an outburst. For B1-c the snowline is expected to be at 200--400 au radius depending on the assumptions of the sublimation temperature (larger radii for 21 K and smaller for 28 K), while the TMC1 CO snowline is expected to be at 100--200 au. For the most luminous source with C$^{18}$O 7m observations available, the expected radius is at 400--750 au. Therefore clearly in all cases the expected CO snowline is well within the 7m beam. In high-resolution studies, the CO emission is often seen at greater distances than expected from the current luminosities of those protostars. This is attributed to accretion bursts of material which increase their luminosities resulting in a shift of the observed CO emission radius up to a few times its expected value (but usually still within a 1000 au radius) \citep{Jorgensen2015, Frimann2017,Hsieh2019}. \subsubsection{N$_2$D$^+$ and DCO$^{+}$} Both DCO$^{+}$ and N$_2$D$^+$ are considered cold gas tracers \citep[e.g.,][]{Qi2015}. N$_2$D$^{+}$ is efficiently destroyed by CO in the gas-phase, therefore freeze-out of CO results in N$_2$D$^+$ being retained in the gas-phase at larger radii of the envelope, where temperatures are lower. This behaviour has been demonstrated in several other protostellar sources by \cite{Tobin2011,Tobin2013,Tobin2019}. Both DCO$^+$ and N$_2$D$^+$ are produced through reactions with H$_2$D$^ +$. At cold temperatures the H$_2$D$^+$ abundance is enhanced through the H$_3^+$ + HD $\rightarrow$ H$_2$D$^+$ + H$_2$ reaction, which is exothermic by 230 K. As the reverse reaction is endothermic, low temperatures increase H$_2$D$^+$. Additionally, both H$_3^+$ and H$_2$D$^+$ are enhanced in gas where CO has been depleted. However, the CO molecule is still needed for the production of DCO$^+$ through the H$_2$D$^+$ + CO reaction. Therefore, DCO$^{+}$ is expected to be most abundant around the CO snowline \citep{Jorgensen2004d,Mathews2013}. Warmer production routes through CH$_2$D$^+$ + CO are also possible \citep{Wootten1987, Favre2015, Carney2018}. The difference between DCO$^{+}$ and N$_2$D$^{+}$ chemistry is reflected in morphology of both molecules in the dense regions close to the continuum peak. As DCO$^+$ requires gas-phase CO for its formation, it peaks close to the CO snowline, which is within the resolution of our observations ($\sim$1800--2500 au radius), while N$_2$D$^+$ is only located where CO is not present in the gas phase. Therefore we observe a significant decrease of N$_2$D$^+$ in the inner envelope. If the warm production of DCO$^+$ is triggered in the inner regions, this will additionally produce DCO$^+$ within the beam of our observations, hence DCO$^+$ does not decrease in the inner envelope. The extent of the DCO$^+$ and N$_2$D$^+$ emission in each source is comparable, ranging from $\sim$ 5000 au in B1-c and BHR71 to 1500 au in TMC1, suggesting that their outside radii trace the region where CO becomes present again in the gas phase due to the low density. The morphology of the emission from cold gas tracers such as DCO$^{+}$ and N$_2$D$^+$ is sensitive to the density and temperature profile of the system, which can be affected by system geometry (i.e., outflow opening angle, disk flaring angle, flattening of the envelope). DCO$^{+}$ has been shown to increase its abundance in the cold shadows of a large embedded disk \citep{Murillo2015}. Emission from DCO$^{+}$ and N$_2$D$+$ is consistent with a picture of a dissipating envelope in Class I sources, resulting in less dense, warmer gas surrounding the protostar. TMC1 has an order of magnitude lower envelope mass compared to the Class 0 sources (Table \ref{table:targets}; \citealt{Kristensen2012}). This causes the extent of the cold and dense region to shrink, preventing N$_2$D$^+$ from being detected, and limiting the extent of DCO$^+$ emission. The dense gas toward TMC1 is clearly present only in the flattened structure surrounding the binary system, likely forming a young, embedded disk. In fact this source is suggested to have a rotationally-supported circumbinary disk \citep{Harsono2014, vantHoff2020b}. The geometry of the disk can create favourable conditions for the DCO$^+$ enhancement in the cold shadows of the disk. Other relevant molecules that trace the quiescent envelope material but are not presented here are HCO$^+$ and H$^{13}$CO$^+$ (\citealt{Hogerheijde1997, Jorgensen2007, Hsieh2019}, van 't Hoff et al. in prep.). These molecules have been shown to probe the material outside of the water snowline \citep{Jorgensen2013,vantHoff2018}. As water sublimates at temperatures $\sim 100 $ K, much higher than CO, HCO$^+$ can be seen throughout the envelope, except for the warmest inner regions. N$_2$H$^+$ is tracing the envelope material and CO snowline and has been shown to peak closer to the central protostar than N$_2$D$^+$ \citep{Tobin2013}. Their ratio can potentially be used as an evolutionary tracer of protostars \citep{Emprechtinger2009}. NH$_3$ is also observed to map similar components as N$_2$H$^+$ \citep{Tobin2019}. In summary, the quiescent envelope material is traced by dense and/or cold gas tracers. Chemical interactions result in N$_2$D$^+$ tracing the outer envelope where CO is frozen-out, whereas DCO$^{+}$ is seen both in the outer envelope as well as in the inner regions, tracing the unresolved CO snowline. C$^{18}$O is a good tracer of dense ($n$ $> 10^5$ cm$^{-3}$) and warm ( $T$ $>$ 30 K) regions in the inner 2000 au radius of the protostellar systems. The evolution of the physical conditions from Class 0 to Class I is evident as the envelope becomes less dense and the protostellar luminosity can heat up dust and gas more easily. \subsection{Outflows and jets} Outflowing material from protostellar systems is best analyzed with kinematic information. In the following section, we will discuss three different componfents of protostellar outflows observed with the ALMA 12m array: 1) the high-velocity jet (\textgreater 30 km s$^{-1}$), 2) the low-velocity outflow (\textless 30 km s$^{-1}$), 3) the gas that results from the interaction with the outflow -- ice sputtering products at velocities close to that of ambient material, but with linewidths significantly broader (up to 15 km s$^{-1}$) than the quiescent envelope tracers. The three components are presented in Fig. \ref{fig:outflow_showcase_no1} with examples of S68N, a representative case of a prominent outflow and ice sputtering, and L1448-mm, a source with a prototypical high-velocity jet. \subsubsection{Extremely high-velocity (EHV) jet} \label{section:extremely_high} There are 6 out of 7 Class 0 sources targeted at high-resolution strengthen the conclusion that EHV jets are more common than previously thought in Class 0 sources \citep[][]{Podio2021}. It is argued that the molecular jet tracers have a very different physical origin than the protostellar outflows; contrary to the low-velocity outflow, which consists mostly of entrained envelope material, the EHV jet is expected to be directly launched from the innermost region of the system \citep{Tafalla2010, Lee2020}. The high-velocity jet is comprised of atomic material which readily forms molecules in the high-density clumps \citep[internal working surfaces;][]{Raga1990, Santiago-Garcia2009} that are resulting from shocks in the jet, which are produced by the velocity variations of the ejection. This in turn means that by observing the high-velocity bullets, one gains insight on the variability of the accretion process \citep{Raga1990,Stone1993}. The new EHV sources B1c and SMM3 show bullet spacings of 1200 au in B1c and 3200 au in SMM3, which can be converted using the terminal velocity of the jets (not corrected for inclination) to the dynamical ages of 80 and 250 years, respectively. If the central mass of the protostar can be estimated this can be used to provide the orbital period of the component causing the variability \citep{Lee2020}. The fact that the EHV jet tracers are dominated by O-bearing molecules has been associated with a low C/O ratio in the jet material \citep{Tafalla2010}. For high mass-loss rates, molecules are produced efficiently in the jet from the launched atomic material \citep{Glassgold1991, Raga2005, Tabone2020a}. Additionally the ratio of SiO-to-CO can indicate the presence of dust in the launched material, which can in turn inform about the jet launching radius, i.e., whether it is inside or outside the dust sublimation radius \citep{Tabone2020a}. The new detections of high-velocity jets suggest that this process may be occurring in every young Class 0 object. Studying large samples of objects with ALMA and combining with multi-transition observations can unveil the atomic abundances of the inner regions, which are difficult to measure otherwise directly \citep{McClure2019}. The presence of H$_2$CO in the jet could result from gas-phase production through the reaction of CH$_3$ with O. Alternatively, if the icy grains were launched with the jet, they could be sputtered in the internal working surfaces at high velocities \citep{Tychoniec2019}. In summary: O-bearing species such as CO, SiO, SO, and H$_2$CO observed at high velocities are excellent tracers of the chemistry within the protostellar jet. Those molecules most likely formed in the internal working surfaces from the material carried away from the launching region of the jet. \begin{figure*}[h] \centering \includegraphics[width=0.95\linewidth,trim={0cm 0cm 0cm 0cm}] {plots/fig12.jpeg} \caption{Maps of three different components of the outflow. Moment 0 maps are presented in color scale with continuum emission at 1.3 mm in black contours, both obtained with ALMA 12m observations. {\it Left:} An extremely high-velocity (EHV) molecular jet illustrated with the SiO (4--3) map for L1448-mm integrated from -70 to -50 and from 50 to 70 km s$^{-1}$ w.r.t $\varv_{\rm sys} $. {\it Middle:} Low-velocity outflow illustrated with the CO 2--1 map for S68N integrated from -15 to -3 and from 3 to 15 km s$^{-1}$ w.r.t $\varv_{\rm sys} $. {\it Right:} Ice mantle content released with shock sputtering presented with the CH$_3$OH (2$_{1,0}$ -- 1$_{0,0}$) map for S68N integrated from -8 to -1 and from 1 to 8 km s$^{-1}$ w.r.t $\varv_{\rm sys} $. The CO outflow from Ser-emb-8N is present at the edge of the map.} \label{fig:outflow_showcase_no1} \end{figure*} \subsubsection{Low-velocity outflow} \label{section:low-velocity_outflow} The CO molecule traces the bulk of the gas as it is the most abundant molecule detectable in the sub-mm regime. It serves as an indicator of the outflow extent and gas morphology, as it is not affected by chemical processing in shocks. It can also be used to quantify the total mass-loss rates, using the dense cloud abundance ratio of CO/H$_2$ $\sim$ 10$^{-4}$. A well-known correlation between molecular outflows and protostellar luminosities indicates a strong link between the accretion and ejection processes \citep{Cabrit1992, Bontemps1996, Mottram2017}. The decrease in accretion and total envelope mass with evolution of the system also results in fainter, less powerful outflows. The weak emission from the Class I source TMC1, which is an order of magnitude lower in intensity with respect to outflows from Class 0 protostars, is consistent with this trend. SiO is a molecule that is enhanced by several orders of magnitude in shocks compared with gas in cold and dense clouds where most of the Si is locked in the grains \citep[e.g.,][]{Guilloteau1992, Dutrey1997}. Shocks release Si atoms from the grains by means of sputtering and grain destruction, leading to subsequent reactions with OH, another product of shocks, forming SiO \citep{Caselli1997,Schilke1997,Gusdorf2008,Gusdorf2008a}. Thus, SiO is much more prominent in high-velocity gas, where grains are more efficiently destroyed (see Section \ref{section:extremely_high}), than in low-velocity shocks. SO is enhanced in shocks through reactions of atomic S released from the grains with OH, as well as through H$_2$S converted to SO with atomic oxygen and OH \citep{Hartquist1980,Millar1993}. Shocks could also explain the emission toward TMC1, where weak accretion shocks onto the disk could enhance the SO abundances \citep{Sakai2014a,Yen2014, Podio2015}. Overall, there is a clear decrease of both SiO and SO low-velocity emission from Class 0 to Class I. Either the less powerful jet cannot destroy the grains and create conditions for the production of SiO and SO and/or the much less dense envelope and outflow cavity walls do not provide enough dust grains for creating large column densities of those molecules; additionally, the excitation conditions might change significantly with evolution of the protostellar system, hampering the detection of even low-$J$ SO and SiO transitions with critical densities in the $10^5-10^6$ cm$^{-3}$ range. HCN is associated with the most energetic outflows \citep{Jorgensen2004, Walker-Smith2014} and is enhanced at high temperatures in shocks. H$^{13}$CN is likely associated with both the hot inner regions (not detected in HCN due to optical thickness of the line) and the low-velocity outflow \citep{Tychoniec2019, Yang2020}. The geometry of H$^{13}$CN emission seen in HH211 resembles a cavity wall: it could be a result of CN produced by UV-photodissociation and subsequent production of HCN via the H$_2$ + CN reaction, which requires high temperatures \citep{Bruderer2009,Visser2018}. The fact that H$^{13}$CN is seen at outflow velocities shows that shocks are required to produce HCN, which is likely released at the cavity walls and then dragged with the outflow. \subsubsection{Shock sputtering products} \label{section:shock_sputtering} Ice-mantle tracers are detected in outflows of SMM3, B1-c and S68N protostars. As indicated in Section \ref{section:results_outflows} S68N is the best test-case to study the composition of shock-released ice mantles. The morphology of the emission of ice-mantle tracers in S68N is somewhat uniform. CH$_3$CN and HNCO are clearly brighter on the redshifted part of the outflow (south-east) and CH$_3$CHO are brighter in the blueshifted (north-west) side. CH$_3$OH and H$_2$CO show an even distribution between the two lobes. The peak intensity for all species occurs at significant distances from the source ($\sim$ 5000 au) and in some cases the emission drops below the detection limit closer to the source. This is contrary to the CO emission, which can be traced all the way back to the central source. In all tracers the emission is also detected at the continuum position, however, this emission has a narrow profile and results from thermal sublimation of ices in the hot core of S68N \citep{vanGelder2020}. The velocities observed for CH$_3$OH and other ice-mantle tracers are high enough for these molecules to be material near the outflow cavity walls, where ice mantles could be sputtered. These molecules therefore most likely trace low-velocity entrained material with a considerable population of ice-coated grains that are sputtered in the shock \citep{Tielens1994,Buckle2002, Arce2008, JimenezSerra2008, Burkhardt2016}. Thermal desorption of molecules from grains is not likely as dust temperatures at distances of few times 10$^3$ au from the protostar are well below the desorption temperatures for most COMs. The fact that there is no enhancement of these tracers closer to the source also argues against emission being related to high temperature. \subsection{Outflow cavity walls} \label{section:outflow_cavity_walls} Emission from hydrocarbons and CN in the outflow cavity walls is directly related to the exposure of those regions to the UV radiation from the accreting protostar. Both c-C$_3$H$_2$ and C$_2$H have been prominently observed in PDRs such as the Horsehead Nebula and the Orion Bar tracing the layers of the cloud where UV-radiation photodissociates molecules, which helps to maintain high atomic carbon abundance in the gas-phase that is needed to build these molecules. C$_2$H is enhanced in the presence of UV radiation at cloud densities \citep{Fuente1993, Hogerheijde1995} and c-C$_3$H$_2$ usually shows a good correlation with C$_2$H \citep{Teyssier2004}. Both molecules have efficient formation routes involving C and C$^+$, although models with only PDR chemistry tend to underpredict their abundances, especially for c-C$_3$H$_2$. A proposed additional mechanism is the top-down destruction of PAHs \citep{Teyssier2004, Pety2005, Pety2012, Guzman2015}; the spatial coincidence of PAH emission bands with hydrocarbons in PDRs is consistent with that interpretation \citep{vanderWiel2009}. It is instructive to compare the conditions between classic PDRs and outflow cavity walls around low-mass protostars.The $G_0$ value for Orion Bar is estimated at 2.6 $\times$ 10$^4$ \citep {Marconi1998}, while the Horsehead Nebula has a much more moderate radiation field of $~ 10^2$ \citep{Abergel2003}. The UV radiation field around low-mass protostars measured by various tracers is 10$^2$--10$^3$ at $\sim$ 1000 au from the protostar \citep{Benz2016, Yildiz2015, Karska2018}, therefore the PDR origin of small hydrocarbons is plausible. The top-down production of hydrocarbons due to PAHs destruction does not appear to be an efficient route here, as PAHs are not commonly observed in low-mass protostellar systems \citep{Geers2009}, and the UV-fields required for this process are above 10$^3$ \citep{Abergel2003}. The difference in morphology of hydrocarbons between Class 0 and Class I systems -- outflow cavity walls in Class 0 versus rotating disk-like structure in Class I -- is most likely related to the evolution of the protostellar systems. Class 0 sources have a dense envelope and the UV radiation can only penetrate the exposed outflow cavity walls, while for Class I it is likely much easier for both the UV radiation from the accreting protostar and the interstellar radiation to reach deeper into the envelope or disk. This is consistent with emission from well-defined cavity walls seen toward those sources. The case of moderate $\sim 10$ km s$^{-1}$ velocity material observed toward S68N indicates that the C$_2$H line does not in all sources trace exclusively the quiescent cavity walls. The profile is consistent with the observed morphology of the line (see Fig. \ref{fig:hydrocarbons_no2}) -- emission is seen up to a few thousand au from the source and its shape does not resemble a cavity wall as clearly as in other sources. The narrow component centered at systemic velocity seen in Fig. \ref{fig:spectra_coms_outflow_no1} indicates that while the broad component might be dominating the emission, the UV-irradiated cavity wall also contributes to the emission observed for S68N. S68N could be a very young source, as the chaotic structure of its outflow and envelope indicates \citep{LeGouellec2019}. The high abundances of freshly released ice-mantle components described in Section \ref{section:shock_sputtering} are consistent with this interpretation. It is also possible that UV radiation produced locally in shocks is causing the enhancement of C$_2$H emission at higher velocities. The $^{13}$CS molecule, as a high-density tracer likely traces the material piling up on the cavity walls pushed by the outflow. This emission is usually slow ($\pm$ 2 km s$^{-1}$ ) indicating that this is not outflowing gas but rather envelope material on the outflowing cavity walls. The non-detection of $^{13}$CS in 12m data (Fig. \ref{fig:hydrocarbons_no2}) towards the Class I source TMC1 is consistent with the dissipating envelope as the source evolves, hence no high-density material is seen in the remnant cavity walls, even though they are still highlighted by the CO emission. In the remaining Class 0 sources with the $^{13}$CS detections -- Emb8N, SMM1 and S68N (Fig. \ref{fig:fig_E2}), -- emission also follows other cavity wall tracers. SMM1 is the only source that shows higher velocity structure (> 7 km s$^{-1}$) of the $^{13}$CS emission on one side of the cavity wall. As this is spatially coincident with the high-velocity jet observed in CO \citep{Hull2016}, this emission might be related to the material released with the jet from the envelope. To summarize, we observe the hydrocarbons C$_2$H and c-C$_3$H$_2$, as well as CN, H$^{13}$CO${^+}$ and $^{13}$CS in the outflow cavity walls of Class 0 protostars. C$_2$H, as the most abundant of the hydrocarbons presented here, is also seen prominently across the envelope at velocities comparable to the low-velocity outflow whereas c-C$_3$H$_2$ appears as a clean tracer of the quiescent, UV-irradiated gas in the cavity walls in the Class 0 sources. \subsection{Warm inner envelope} \subsubsection{Compact emission} \label{section:compact_emission} The inner regions of young protostellar systems are characterized by high temperatures which result in a rich chemistry as molecules that form efficiently in ices on grains in cold clouds sublimate into the gas phase. Complex organic molecules (COMs) detected in these datasets are discussed quantitatively in detail elsewhere, for both O-bearing by \cite{vanGelder2020} and for N-bearing species by \citep{Nazari2021} In this section we focus on smaller molecules that also trace the innermost hot core regions and therefore are likely abundant in ices. This includes several small S-bearing molecules. Both B1-c and S68N are sources characterized as hot cores \citep{Bergner2017, vanGelder2020}, which means that the conditions in their inner regions are favourable for release of molecules from the ice mantles. For the well-studied case of IRAS16293-2422, \cite{Drozdovskaya2018} have also identified a hot core component of SO based on isotopologue data, in addition to an SO component in the large scale outflow. Overall, SO observed in protostars appears to be related mostly to evaporation of grain mantle. The SO appearance close to the central protostar could be related to accretion shocks onto the disk, which are weaker than shocks that cause the SO emission seen in the outflows (Section 4); in accretion shocks, SO can be released from the icy mantles with the infalling material \citep{Sakai2014a}. However, narrow linewidths of SO toward TMC1 seem to rule out the accretion shock scenario, and points to emission along the cavity walls \citep{Harsono2020}. HNCO emission has been modeled by \cite{HernandezGomez2018} and suggested to be a superposition of both warm inner regions of the envelope as well as the colder, outer envelope. Its similar behaviour to sulphur-bearing species, also observed in our work, is proposed to be related to the fact that O$_2$ and OH are involved in formation of species like SO and HNCO \citep{RodriguezFernandez2010}. H$_2$S is expected to be the dominant sulphur carrier in ices \citep{Taquet2020}. However, it has not yet been detected in ice absorption spectra to date \citep{Boogert2015}. The weak emission from H$_2$S in dark clouds has been modeled as a result of the photodesorption of ices at the outside of the cloud (like in the case of H$_2$O, \citealt{Caselli2012b}), while chemical desorption is important for grains deeper inside the cloud but outside the water snowline \citep{NavarroAlmaida2020}. These models are consistent with H$_2$S ice containing most of the sulphur. Multiple lines of H$_2$CS are a powerful tool to probe the warm > 100 K, innermost regions of the protostellar systems \citep{vantHoff2020a}. While B1-c and S68N are characterized as hot cores with many COM lines detected \citep[][]{vanGelder2020}, and L1448-mm has warm water in the inner regions \citep{Codella2010}, SMM3 does not appear to have significant emission from COMs. Moreover, simple molecules associated with the hot cores for B1-c, such as SO and H$_2$CO, are only seen outside of the SMM3 central source. While it is possible that the optically thick continuum prevents a detection of COMs in its inner envelope \citep{DeSimone2020}, differences in chemistry or physical structure (e.g., a large cold disk, see Section \ref{section:results_inner_env}) between the SMM3 and the hot core sources are also possible. The fact that emission from OCS and H$_2$S is centrally peaked (Fig. \ref{fig:hotcore_v1}, bottom row) suggests that continuum optical depth is not an issue, although both those species could be a result of grain destruction or ices sputtering, therefore not necessarily coming from the midplane but rather from the surface of a disk-like structure. The additional detection of CCS in 7 data towards SMM3, which is on the other hand not detected in B1-c could hint at different chemical composition of the two protostellar systems. \subsubsection{Embedded disks} In the case of large edge-on disks like IRAS-04302 and L1527, the vertical structure of the emission can be probed, as well as the radius where CO freeze-out occurs. Overall, Class I disks are warmer than their Class II counterparts with CO freeze-out taking place only in the outermost regions \citep{Harsono2015,vantHoff2018,vantHoff2020b,Zhang2020}. We detect CN in all observed Class I disks, although it does not trace the midplane of the disk. In the near edge-on example of IRAS-04302, the CN emission originates from the upper layers of the disks, in the same direction as the outflow, which is perpendicular to the disk in this source. This opens a possibility that the emission is also related to the irradiated residual cavity walls in those sources. TMC1A is a clear example where CN is tracing the same material as probed by \cite{Bjerkeli2016} in CO, which is attributed to a disk wind. TMC1 and L1527 show CN oriented in the same direction as the disk; in TMC1 there is also a clear filament structure on larger scales irradiated by the UV from the protostar, seen also in other tracers. In comparison with the C$^{17}$O emission, which traces the midplane disk, CN thus appears in the upper layers and in the outflow, therefore in most cases the two molecules are mutually exclusive. This picture is consistent with the bulk density traced by CO and the irradiated layers of the disk and envelope exposed to UV traced by CN. Recent observations of a sample of Class I sources including IRAS-04302 by \cite{Garufi2020} is consistent with CN not tracing the disk midplane. In the younger Class 0 or borderline Class 0/I sources characterization of the disk is much more difficult because of the strong envelope emission. Nevertheless, several Keplerian disks have been identified with observations of CO isotopologues like C$^{18}$O and $^{13}$CO \citep{Tobin2012,Murillo2013}. Our data allow us to investigate this for the case of SMM3. Fig. \ref{fig:smm3_disk} shows the red and blue-shifted emission from C$^{18}$O toward SMM3. There is a clear rotational signature in the direction perpendicular to the outflow on scales of a few hundred au. However, to unambiguously identify the disk and its radius, higher spatial and spectral resolution data are necessary. \begin{figure*}[h] \centering \includegraphics[width=0.99\linewidth,trim={1cm 0cm 0cm 0cm}] {plots/fig13.jpeg} \caption{Ratio of complex organic molecules with respect to CH$_3$OH in S68N. The ratios are shown for a 3\arcsec\ region in both redshifted and blueshifted part of the outflow. The abundance ratios in the hot cores are taken from \cite{vanGelder2020} and \cite{Nazari2021}. The errorbars mark the lower and upper limit on the ratios, as calculated from the optically thick CH$_3$OH emission (lower limit) and $^{13}$CH$_3$OH (upper limit). All outflow abundances obtained from the Band 6 data at 0\farcs45 resolution except for CH$_3$OCHO and CH$_3$CN which were derived from Band 3 data at 3\arcsec. } \label{fig:barplot} \end{figure*} \subsection{COMs in outflow versus hot core} The complex organic molecules are already detected in the prestellar stage of star formation \citep{Bacmann2012, Scibelli2020}, where they are efficiently produced on the surfaces of icy grains \citep[e.g.,][]{Watanabe2004,Oberg2009}. COMs can be subsequently released back into the gas through various non-thermal desorption processes and/or be re-formed by gas-phase reactions. In the inner envelope, temperatures are high enough that thermal desorption of ices is enabled. In the outflow cavity walls, sputtering by shocks can release ices from the grains. In the hot core, COMs are detected through high excitation lines, while in the outflow, they are observed primarily through transitions with low $E_{\rm up}$. Therefore, comparing the observations of molecular complexity in outflows with hot cores can unveil if there is any warm temperature processing of the ices and whether some molecules also have a gas-phase production route. Therefore, we compare abundance ratios between different ice mantle species and methanol at three positions for S68N: one on the source, obtained from \cite{vanGelder2020} and \cite{Nazari2021}, and one each in the blueshifted and redshifted part of the outflow, which are calculated from the fluxes obtained in this work. We measure the abundance of the species in a 3\arcsec\ region centered on CH$_3$OH peak on the blueshifted and redshifted regions. The size of the region is based on the spatial resolution of the Band 3 data. The regions are indicated in Fig. \ref{fig:icemantle_no1}. From these regions, we extracted spectra and calculated column densities using the spectral analysis tool CASSIS \footnote{http://cassis.irap.omp.eu/}. For the CASSIS model, we assume $T_{\rm ex}$ = 20 K, typical of subthermally excited molecules with large dipole moments in outflow gas. The FWHM of the lines was fixed at 3 km s$^{-1}$, which is the width of the CH$_3$OH line. With those parameters, an LTE calculation provides column densities for the observed line intensities under the assumption of optically thin emission (see \cite{Tychoniec2019} for a discussion on uncertainties in this method.) Only a single CH$_3$OH line 2$_{1,0}$--1$_{0,1}$ ($E_{\rm up}$ = 28 K) is detected in the outflow of S68N. Escape probability calculations with RADEX \citep{Tak2007} show that even at the lower densities in outflows this CH$_3$OH line is likely optically thick. No optically thin CH$_3$OH isotopologue is detected in the outflow; therefore, we provide an upper limit for the $^{13}$CH$_3$OH 2$_{1,1}$-1$_{0,1}$ ($E_{\rm up}=$28 K). The upper limit on this $^{13}$CH$_3$OH line of $1\times 10^{14}$ cm$^{-2}$ translates to an upper limit on the CH$_3$OH column density of $7\times 10^{15}$ cm$^{-2}$ assuming $^{12}$C / $^{13}$C = 70 \citep{Milam2005}. The column density calculated from the flux measurement of the CH$_3$OH line gives of $2\times 10^{15}$ cm$^{-2}$; thus, the methanol abundance can be underestimated by a factor of 4. With the information available, we assume that the CH$_3$OH column density is between $2\times 10^{15}$ cm$^{-2}$ and $7\times 10^{15}$ cm$^{-2}$ and we compare abundances of other molecules with respect to CH$_3$OH using this range of values. The hot core methanol column density of S68N in \cite{vanGelder2020} is corrected for optical thickness with CH$_3^{18}$OH. Figure \ref{fig:barplot} compares the abundance ratios of various species with respect to methanol for S68N. First, it shows that the relative abundances are remarkably similar on both sides of the outflow, well within the uncertainties. Second, most abundances relative to CH$_3$OH are found to be comparable to the S68N hot core within our uncertainties and those of \cite{vanGelder2020} and \cite{Nazari2021}, noting that due to lack of optically thin CH$_3$OH line detected in the outflow, our uncertainties are larger. The greatest difference is seen for CH$_3$CHO and H$_2$CCO, which could be attributed to the additional gas-phase formation in shocks. While the difference is well beyond the conservative uncertainties assumed here, this result should be confirmed with a larger sample of sources with different properties. The jump in CH$_3$CHO abundance with respect to methanol in the outflow has been also reported for two other sources - L1157 and IRAS4A \citep{DeSimone2020b}. For the well-studied L1157 outflow, \cite{Codella2020} find CH$_3$CHO/CH$_3$OH is 0.5\%. which they find in agreement with ratios in hot cores toward different protostars, but not including L1157 itself. In the case of S68N we uniquely show a comparison between the emission from molecules in the outflows and hot core for the same source. While modeling by \cite{Codella2020} shows that the similar spatial origin of CH$_3$OH and CH$_3$CHO does not imply that they are both solely grain sputtering products, an agreement between hot cores and outflows could mean that similar processes are responsible for emission in both regions. It is interesting that the SMM3 outflow shows ice mantle tracers in the outflow but not on the source. Thus, the lack of hot core emission is likely due to the physical conditions in the inner regions such as a large disk (Section \ref{section:results_inner_env}) or continuum optical depth \citep{DeSimone2020} and not to the lack of complex molecules on the grains. Since methanol is not detected, we cannot provide abundance ratios for this outflow. B1-c - another source with an outflow containing ice mantle products, has methanol lines overlapping with the high-velocity SO outflow, therefore precise abundance measurements are not possible. {\it JWST} will be able to provide information on the ice content due to rich absorption spectra in the mid-IR. The abundances of COMs in the gas-phase provided by ALMA \citep{vanGelder2020,Nazari2021} can then be directly compared with the ice content. So far, the ice content observed on cloud scales with {\it Spitzer} does not show a correlation with the gas content but those data do not probe thermally desorbed ices \citep{Perotti2020}. \subsection{Carbon-chains and other hydrocarbons vs COMs} Early observations at low spatial resolution suggested that large carbon-chains such as C$_5$H, HC$_7$N, and HC$_9$N and complex organic molecules are mutually exclusive, and therefore the two were proposed to be tracers of two different categories of protostellar sources driven by different chemistry, namely warm carbon-chain chemistry (WCCC) and hot core chemistry \citep{Sakai2013}. Warm carbon-chain chemistry is thought to occur above the sublimation temperature of CH$_4$ $\sim$ at 30 K. The proposed difference then lies in the WCCC sources collapsing more rapidly than the hot core sources, which prevents CO to accumulate on the ices, leaving a higher CH$_4$ ice content. Thus, in WCCC sources, there would be less CO to form more complex organic molecules such as CH$_3$OH, and an underabundance of COMs is indeed observed. This scenario has been supported by the lower deuteration observed in WCCC sources \citep{Sakai2009a}. With ALMA observations at higher resolution and sensitivity, sources harboring both COMs and small hydrocarbons, c-C$_3$H$_2$, and C$_2$H, have now been observed \citep{Imai2016, Oya2017}. \begin{figure}[h] \centering \includegraphics[width=0.92\linewidth,trim={0cm 0cm 0cm 0cm}] {plots/fig14.jpeg} \caption{Emission maps of an example COM and hydrocarbon toward B1-c. {\it Left:} CH$_3$CHO moment 0 map, {\it Right:} C$_2$H moment 0 map; both integrated from -2 to 2 km s$^{-1}$ w.r.t $\varv_{\rm sys} $.} \label{fig:coms_vs_hydrocarbons} \end{figure} Our data also show detection of small hydrocarbons and COMs in the same sources (Fig. \ref{fig:coms_vs_hydrocarbons}). However, our high resolution maps now show those hydrocarbons to originate in the UV irradiated outflow cavity walls (Section 6). Both c-C$_3$H$_2$ and C$_2$H can be solely explained by PDR chemistry \citep{Guzman2015, Cuadrado2015} even in moderate UV fields of low-mass protostars and therefore WCCC chemistry does not need to be invoked for the sources presented in this work. The PDR origin is consistent with our observed geometry at the edges of the cavities, where lower extinction allows the UV radiation from the protostellar accretion to easily reach this region. It also explains the confinement of this emission to the inner 2000 au of the envelope as the UV radiation decreases with distance from the source. A deep search for larger hydrocarbons like HC$_5$N in cavity walls could help to understand their origin. \subsection{Class 0 vs Class I in different components} Many processes take place within the protostellar lifetime of a few $10^5$ yr that alter the chemical composition and physical conditions. First, the envelope is dissipating, and the radius where key molecules are in the gas-phase is becoming smaller \citep{Jorgensen2005a}. With high-resolution studies, it is possible to probe different snowlines in unprecedented detail now \citep{vantHoff2018,Hsieh2019}. There is a clear evolutionary trend observed in temperature -- Class 0 disks are generally warmer than Class II disks, with Class I sources in between, which has major impact on the richness of their spectra \citep{vantHoff2020b,vantHoff2020a}. This is also observed in our sample where all Class 0 show either complex organic molecules or small molecules related to grain evaporation but no evidence of those molecules is found in Class I sources (Section \ref{section:compact_emission}). Table \ref{table:evolution_summary} summarizes the evolution of the molecular composition of protostellar systems. Complex organic molecules are a key tracer of chemistry at the early stages. We see them in the outflows only in Class 0 sources, likely due to the decrease of the outflow force and mass and envelope density. In the inner regions, physical conditions such as temperature and density also favour the early stages for the abundances of COMs. In rare cases of rich chemistry in Class I disks, it is usually attributed to accretion outbursts heating up the disk \citep{vantHoff2018c,Lee2019}. Molecular EHV jets are only present in the Class 0 phase \citep{Nisini2015}. In our sample 6 out of 7 sources have high-velocity component and none is detected in Class I (Section \ref{section:extremely_high}), whereas the lower velocity outflows in these stages are rich in ice mantle tracers (Section \ref{section:shock_sputtering}). The Class I jets are invisible in molecular tracers, and their outflows show CO primarily, with much less contribution from shock tracers such as SO and SiO (Section \ref{section:low-velocity_outflow}). Cavity walls are seen prominently in the Class 0 sources in molecules whose abundances are sensitive to UV radiation. In Class I sources, a flared disk and weak outflow remain. While there is less envelope to attenuate the UV radiation, there is also less material to irradiate and accretion luminosity of older sources decrease, which results in less prominent emission from UV tracers on large scales in Class I (Section \ref{section:outflow_cavity_walls}). Another example of a transition of molecular appearance between Class 0 and I is SO: this molecule traces the outflow in Class 0 and the disk-envelope interface in Class I primarily. \begin{table*} \caption{Summary of evolution of chemical tracers} \label{table:evolution_summary} \centering \begin{tabular}{p{2cm} p{7cm} p{7cm}} \hline\hline Component & Class 0 & Class I \\ \hline Envelope & Cold, dense envelope results in cold tracers (DCO$^+$, N$_2$H$^+$, N$_2$D$^+$) & Envelope dissipates, extent of cold tracers is much smaller \\ \hline Jet & O-bearing molecules (CO, SiO, SO, H$_2$CO) are present in high-velocity bullets & Molecular jet disappears, seen only in atomic and ionised gas \\ \hline Outflow & Ice sputtering (CH$_3$OH, HNCO) and grain destruction (SO, SiO) tracers are present & Decreased outflow mass and less dense envelope result in no tracers of sputtering and grain destruction, only faint CO remains\\ \hline Cavity walls & Prominent signs of UV-irradiated cavity walls (CN, C$_2$H, c-C$_3$H$_2$) & No prominent signs of hydrocarbons in cavity walls, CN still present \\ \hline Hot core & COMs and simple tracers of ice sublimation and high-temperature chemistry (H$_2$S, OCS) & Small extent plus disk shadowing results in less complexity, except for outbursting sources\\ \hline Disk & Warm disk with COMs, dust obscuration & Colder disk molecules, Keplerian rotation seen in H$_2$CO, C$^{18}$O, CN in the disk surface.\\ \hline \end{tabular} \end{table*} \section{Conclusions} \label{section:conclusions} In this work, we have presented an overview of the molecular tracers of the physical components in protostellar Class 0 and Class I systems. Table \ref{table:table_components_mols} and Fig. \ref{fig:cartoon_summary} present an overview of the results, which are summarized below. \begin{itemize} \item Protostellar envelopes are primarily traced with the dense gas tracers such as C$^{18}$O and CO, and snowline tracers such as DCO$^{+}$, N$_2$D$^+$, H$^{13}$CO$^+$. For this component, it is essential to use observations that are sensitive to large scales of $\sim$ 5000 au. \item Protostellar outflows are separated into different components. High-velocity molecular jets are traced by O-bearing molecules CO, SiO, SO, and H$_2$CO. Entrained outflow material can be probed by low-velocity CO, SiO, SO, H$_2$CO, HCN as well as molecules released from ices by sputtering, such as CH$_3$OH, CH$_3$CHO, HNCO, CH$_3$CN, and CH$_3$OCHO. \item Outflow cavity walls are pronounced in UV irradiation tracers: C$_2$H, c-C$_3$H$_2$, and CN, and high-density tracers such as $^{13}$CS. \item Hot cores, the inner warm envelopes, are probed predominantly by COMs and simple molecules released from ice mantles and produced by high-temperature chemistry such as SO, H$_2$S, H$_2$CS, OCS, H$^{13}$CN, HCOOH, and HNCO. \item Embedded disks, which are most clearly seen in Class I sources, can be seen in C$^{17}$O and H$_2$CO while CN traces their upper layers. CO isotopologues can be used to probe disks in Class 0 sources. However, the confusion with the envelope emission requires a detailed analysis of the kinematics to confirm that a Keplerian disk is present. \end{itemize} Hydrocarbons and COMs are found to co-exist routinely in protostellar sources: the former are present in the UV-irradiated cavity walls and the latter in the hot core and in the outflows. It is plausible that PDR chemistry for the formation of hydrocarbons is sufficient to explain the presence of molecules such as C$_2$H and c-C$_3$H$_2$, and that no warm carbon-chain chemistry is required, which relies on abundant CH$_4$ in ices. Observations of more complex carbon chains in cavity walls and envelopes are necessary to understand whether the WCCC plays a role there. {\it JWST} will be able to probe the CH$_4$ ice content at spatial scales comparable to ALMA, which will show if there are any differences in the ice composition between sources. Throughout this study, the availability of both low-lying molecular lines to probe the cold extended envelope and outflow, as well as high-excitation lines to trace compact hot cores has been a key for the analysis. The occurrence of the same molecules in different physical components provides an opportunity to study the processes involved in their formation and excitation. For example, ice mantle tracers sputtered from the grains in outflows give useful insight on the ice composition, whereas comparison with abundances of thermally released COMs in the inner region is a powerful tool to probe whether gas-phase formation routes contribute to complex molecules formation. {\it JWST}-MIRI will provide unprecedented resolution and sensitivity in mid-IR that will allow probing the emission from hot gas in shocks as well as ice absorption features. {\it JWST} observations can then be combined with our understanding of the kinematics and spatial origin of molecules revealed by ALMA. {\it Acknowledgements. }The authors are grateful to the anonymous referee for comments that improved the quality of the paper. This paper makes use of the following ALMA data: ADS/JAO.ALMA\# 2017.1.01174.S, ADS/JAO.ALMA\# 2017.1.01350.S, ADS/JAO.ALMA\# 2017.1.01371.S, ADS/JAO.ALMA\# 2017.1.01413.S, ADS/JAO.ALMA\# 2013.1.00726.S, ADS/JAO.ALMA\# 2016.1.00710.S. ALMA is a partnership of ESO (representing its member states), NSF (USA) and NINS (Japan), together with NRC (Canada), MOST and ASIAA (Taiwan), and KASI (Republic of Korea), in co-operation with the Republic of Chile. The Joint ALMA Observatory is operated by ESO, AUI/NRAO and NAOJ. Astrochemistry in Leiden is supported by the Netherlands Research School for Astronomy (NOVA). Ł.T. acknowledges the ESO Fellowship Programme. M.L.vG. acknowledges support from the Dutch Research Council (NWO) with project number NWO TOP-1 614.001.751. C.L.H.H. acknowledges the support of the NAOJ Fellowship and JSPS KAKENHI grants 18K13586 and 20K14527. The National Radio Astronomy Observatory is a facility of the National Science Foundation operated under cooperative agreement by Associated Universities, Inc. This research has made use of NASA's Astrophysics Data System Bibliographic Services. This research made use of NumPy \citep{harris2020array}; Astroquery \citep{2019AJ....157...98G}; Astropy, a community-developed core Python package for Astronomy \citep{2018AJ....156..123A, 2013A&A...558A..33A}; Pandas \citep{McKinney_2010, McKinney_2011}; and Matplotlib \citep{Hunter2007}.
\section{Introduction} The goal of this paper is twofold. First of all, we are interested in the so-called \emph{advection-diffusion equation} \begin{equation*} \partial_t v + \mathop{\mathrm {div}}(v\b) = \Delta v \end{equation*} under general, low regularity assumptions on the (divergence-free) vector field $\b$. Furthermore, we want to exploit the advection-diffusion equation to set up the \emph{vanishing viscosity scheme} for the linear transport/continuity equation \begin{equation*} \partial_t u + \mathop{\mathrm {div}}(u\b) = 0 \end{equation*} under Sobolev regularity assumptions on $\b$, in a framework of low integrability for the solution which does not guarantee uniqueness. More precisely, we construct a family $(v_\e)_\e$ of solutions to \begin{equation*} \partial_t v_\e + \mathop{\mathrm {div}}(v_\e\b) = \e \Delta v_\e \end{equation*} and establish the rigourous convergence $v_\e \to u^{\sf L}$ as $\e \downarrow 0$, where $u^{\sf L}$ is the Lagrangian solution of the transport equation, that is the solution transported by the flow of $\b$. Such a result fits into a well understood physical mechanism (the zero diffusivity/viscosity limit) and has also its own, mathematical interest: similar schemes have been proposed over the years for different equations (e.g. for hyperbolic conservation laws \cite{BB, KR}). Since the Lagrangian solution preserves all the $L^q$-norms (if finite at the initial time), this also rules out the possibility of anomalous dissipation in the vanishing viscosity limit. \subsection{Part I. The advection-diffusion equation} Given a vector field $\b \colon [0,T] \times \mathbb{T}^d \to \mathbb{R}^d$ on the $d$-dimensional torus $\mathbb{T}^d:= \mathbb{R}^d/\mathbb{Z}^d$, we study the initial value problem for the advection-diffusion equation associated with $\b$, i.e. \begin{equation}\label{eq:ad-intro}\tag{ADE} \begin{cases} \partial_t v + \mathop{\mathrm {div}}(v\b) = \Delta v \\ v |_{t=0} = v_0, \end{cases} \end{equation} where $v_0 \colon \mathbb{T}^d \to \mathbb{R}$ is a given initial datum. Due to the presence of the Laplacian, \eqref{eq:ad-intro} is a second-order parabolic partial differential equation. If the vector field $\b$ is smooth, classical existence and uniqueness results are available and can be found in standard PDEs textbooks (see e.g. \cite{EV}). The problem \eqref{eq:ad-intro} has been also studied outside the smooth framework in many classical references (besides quoting again \cite{EV}, we mention the monograph \cite{LA2}). \\ Nevertheless, our approach is closer to the one developed in the more recent book \cite{LBL_book}, which is intimately related to a fluid dynamics context. Typically, existence results are obtained by a simple approximation argument: under global bounds on the vector field, one easily establishes energy estimates for the solutions of suitable approximate problems. Such estimates allow to apply standard weak compactness results and the linearity of the equation ensures that the weak limit is a solution to \eqref{eq:ad-intro}. At a closer look, however, an interesting feature of \eqref{eq:ad-intro} arises: it is possible to give several, a priori different, notions of ``weak'' solutions. This opens a wide spectrum of possibilities and taming this complicated scenario, understanding the relationships among different notions of solutions, is one of the aims of the present work. \subsubsection*{Distributional solutions} We first deal with divergence-free vector fields $\b$, satisfying a general $L^1_t L_x^p$ integrability condition in space-time, for some $1 \le p\le \infty$. Correspondingly, we assume that the initial datum $\overline{v} \in L^q(\mathbb{T}^d)$, for some $1 \le q\le \infty$, with $\sfrac{1}{p}+\sfrac{1}{q} \le 1$. This allows to introduce distributional solutions to \eqref{eq:ad-intro}, i.e. functions $v \in L^\infty_t L^q_x$ solving the equation in the sense of distributions. Notice that a mild regularity in time of solutions is always granted for evolutionary PDEs, which allows to give a meaning to the initial condition in the Cauchy problem \eqref{eq:ad-intro}. It is then easily seen that distributional solutions always exist; yet, such a notion seems too vague and uniqueness is, in general, false. \subsubsection*{Parabolic solutions} The general lack of uniqueness for distributional solutions motivates the introduction of another notion of solution. Hopefully, such alternative notion will share the same existence results as the distributional ones, offering at the same time some uniqueness results. It turns out that such a notion can be found for fields having enough integrability in the space variable, $\b \in L^1_t L_x^2$. If this is the case, exploiting the divergence-free constraint one can show the basic available energy estimate for smooth solutions \begin{equation*} \frac{1}{2}\int_{\mathbb{T}^d} |v(t,x)|^2 \,\mathrm{d} x + \int_0^t \int_{\mathbb{T}^d} |\nabla v(\tau,x)|^2 \, \mathrm{d}\tau\, \mathrm{d} x = \frac{1}{2}\int_{\mathbb{T}^d} |v_0(x)|^2 \,\mathrm{d} x, \end{equation*} for every $t \in [0,T]$. The energy estimate entices one to look for solutions possessing $L^2$ gradient, i.e. solutions that are $H^1$ in the space variable. We therefore say that a distributional solution $v \in L^\infty_t L^q_x$ to \eqref{eq:ad-intro} is \emph{parabolic} if it holds $v \in L^2_t H^1_x$. The energy estimate suggests that we could look for solutions possessing $L^2$ gradient, i.e. solutions that are $H^1$ in the space variable: we say that a distributional solution $v \in L^\infty_t L^q_x$ to \eqref{eq:ad-intro} is \emph{parabolic} if it holds $v \in L^2_t H^1_x$. Crucially, parabolic solutions carry the exact regularity needed to establish their uniqueness (under a suitable integrability assumption of the field $\b$ w.r.t. the time variable as well). This uniqueness result is proven via a well-known technique, i.e. resorting to commutators' estimates. The $L^2_tH^1_x$ regularity of the solution allows to obtain a better control on the error one commits when considering smooth approximations of the solution. Such error (which is commonly known as \emph{commutator}) always goes to $0$ in the sense of distributions; however, in order to prove uniqueness, a better control is needed. In particular, in \cite{LBL} it is shown that the commutator for parabolic solutions converges strongly to $0$ in $L^1_{t,x}$. This is made possible by the fact that, asymptotically, the commutator is related to the quantity $\b \cdot \nabla v$ and bounds for this product can be established (for parabolic solutions $v \in L_t^2H_x^1$) if $\b \in L^2_t L^2_x$. \subsubsection*{A new regularity result for distributional solutions} Besides existence and uniqueness results for distributional and for parabolic solutions, a legitimate question concerns the mutual relationship between these two notions; according to our definitions, parabolic solutions cannot always be defined, but if they can, then they are always distributional. The converse implication is, in general, not true: in \cite{MS3} it is shown that there exist infinitely many distributional solutions $v\in L^\infty_t L^2_x$ to \eqref{eq:ad-intro} with a vector field $\b \in L^\infty_t L^2_x$, while the parabolic one is unique. This motivates our search for a condition that guarantees \emph{parabolic regularity} of a distributional solution. Our first main result shows that, in the regime $\sfrac{1}{p} + \sfrac{1}{q} \le \sfrac 12$ (and under a $L^2$ integrability assumption of $\b$ w.r.t. time), every distributional solution is parabolic (hence, a fortiori, unique). The precise statement is the following: \begin{mainthmdue*} Let $p,q \in [1, \infty)$ such that $\sfrac{1}{p}+\sfrac{1}{q}\leq \sfrac{1}{2}$. If $\b\in L_t^2L_x^p$ is a divergence-free vector field and $u\in L_t^\infty L^q_x$ is a distributional solution to \eqref{eq:ad-intro}, then $u\in L_t^2 H_x^1$. \end{mainthmdue*} \noindent Such a regularity result is, to our knowledge, new and it is obtained using a refined commutator estimate: we show that, in the current regime, the convergence to zero of the commutators takes place in $L^2_tH^{-1}_x$ and this is enough to obtain our regularity result (see Lemma \ref{lem:conv_comm2} for the precise commutator estimate). We remark, en passant, that the $L^2$ integrability seems critical in our argument. Recent, groundbreaking works (which will be discussed more thoroughly later on in this introduction) have shown that, at lower integrability, a severe phenomenon of non-uniqueness may arise. In particular, using convex integration techniques, in \cite{MS, MS2, MS3} the authors constructed divergence-free vector fields $\b \in C^0_tL^p_x$, with $1 \le p < \gamma(d) < 2$, such that \eqref{eq:ad-intro} admits infinitely many solutions in the class $C^0_t H^1_x$. Here $\gamma(d) = \sfrac{2d}{d+2}$ denotes a dimensional constant, which is indeed strictly smaller than the critical exponent $2$. The situation in the intermediate regime $\gamma(d) \le p < 2$ is still open and it is the object of one question we formulate. See also \cite{BV}, where nonuniqueness of weak solutions (not necessarily in the Leray class) of the Navier-Stokes equations is shown via convex integration with a beautiful argument exploiting time-intermittency, and \cite{CL21}, in which it is shown that the integrability of weak solutions plays an essential role for weak-strong uniqueness results for the Navier-Stokes equations. Finally, we observe that also the integrability in time could play a non trivial role (in a similar spirit to e.g. \cite{CL}): it seems conceivable that non-uniqueness of parabolic solutions arises when $\b \in L^2_tL^p_x$ (instead of $\b \in C^0_tL^p_x$) for a larger class of exponents $p$. We refer the reader to Figure \ref{fig:2d} and Figure \ref{fig:3d} for a visual summary of the results concerning advection-diffusion equations. \subsubsection*{A comparison with LeBris-Lions' theory of renormalized solutions} Yet another approach to \eqref{eq:ad-intro} builds on the notion of \emph{renormalized solution}. In a nutshell, such a concept allows one to define the transport term $v\b$ in a completely general framework (i.e. for any choice of exponents $p,q$) and this is achieved by prescribing that the equation in \eqref{eq:ad-intro} holds not for $u$ but for a (non-linear) function of $u$ (together with some additional assumptions on the regularity of $u$). We have opted not to pursue this direction here and we refer the reader to the monograph \cite{LBL_book} where one can find, besides the theory of bounded parabolic solutions, an extensive and comprehensive study of renormalized solutions (see in particular, \cite[Chapter 2, Remark 16]{LBL_book} for an interesting comparison between distributional and renormalized solutions). \begin{figure}[H] \centering \begin{tikzpicture}[scale=1.8] \draw[fill opacity=0.3, fill=black!20!green] (0,0) -- (3,0) -- (3,1.5) -- (0,1.5); \draw[pattern=horizontal lines, pattern color=black] (0,0) -- (3,0) -- (0,3); \draw[pattern=vertical lines, pattern color=blue!50] (0,0) rectangle (1.5,1.5); \draw[blue!50, thick] (0,0) rectangle (1.5,1.5); \draw[<-,black] (.5,2.1) -- (1.4,3) node[anchor=west]{{\footnotesize $\frac{1}{p} + \frac{1}{q} \le 1$: the product $v\b$ is well defined and distributional solutions exist (Prop. \ref{prop:existence_weak_sol})}}; \draw[<-,blue] (.75,.75) -- (2.5,2.5) node[anchor=west]{{\footnotesize $\min\{p, q\} \ge 2$: existence of parabolic solution (Prop. \ref{prop:existence_parabolic_class})}}; \draw[<-,black!60!green] (2.5,.75) -- (3,2) node[anchor=west]{{\footnotesize $q \ge 2$: a-priori estimates in $L^2_t H^{1}_x$ (Rmk. \ref{rmk:ultimo})}}; \draw[thick,black] (0,3) -- (3,0); \draw[thick, ->] (0,0) -- (4,0) node[anchor=north] { $\frac{1}{p}$}; \draw[thick, ->] (0,0) -- (0,4) node[anchor=south ] {$\frac{1}{q}$}; \filldraw (3,0) circle (.8pt) node[anchor=north] {\footnotesize 1}; \filldraw (0,3) circle (.8pt) node[anchor=east] {\footnotesize 1}; \filldraw (1.5,0) circle (.8pt) node[anchor=north] {\footnotesize $\frac{1}{2}$}; \filldraw (0,1.5) circle (.8pt) node[anchor=east]{\footnotesize $\frac{1}{2}$}; \end{tikzpicture} \caption{Visual depiction of the \emph{existence} results for distributional and parabolic solutions for vector fields $\b \in L^1_t L^p_x$ and initial datum $v_0 \in L^q$.}\label{fig:2d} \end{figure} \begin{figure}[H] \centering \tdplotsetmaincoords{70}{90} \begin{tikzpicture}[scale=4.5,tdplot_main_coords,>=latex, x={(1,-0.5,0)}] % \fill[fill opacity=0.3, fill=blue!99, loosely dashed] (0,0,.5) -- (0,.5,.5)--(.5,.5,.5)--(.5,0,.5); \fill[fill opacity=0.3, fill=blue!99] (.5,0,0) -- (.5,.5,0)--(.5,.5,.5)--(.5,0,.5); \fill[fill opacity=0.3, fill=blue!99] (0,.5,0) -- (.5,.5,0)--(.5,.5,.5)--(0,.5,.5); \fill[fill opacity=0.4, fill=red] (0,0,.5) -- (0,.5,0)--(.5,.5,0)--(.5,0,.5); \fill[fill opacity=0.4, fill=red] (.5,0,0) -- (.5,0,.5)--(.5,.5,0); \draw[thick, blue] (0,0,.5) -- (0,.5,.5)--(.5,.5,.5)--(.5,0,.5)--cycle; \draw[thick, blue] (0,.5,0) -- (.5,.5,0)--(.5,.5,.5)--(0,.5,.5)--cycle; \draw[thick, blue] (0,0,.5) -- (0,.5,0); \draw[thick, red] (0,0,.5) -- (0,.5,0)--(.5,.5,0)--(.5,0,.5)--cycle; \draw[thick, red] (.5,0,0) -- (.5,.5,0)--(.5,0,.5)--cycle; \draw[thick, black] (0,0,1) -- (0,1,0)--(1,1,0)--(1,0,1)--cycle; \draw[thick, black] (1,0,0) -- (1,1,0)--(1,0,1)--cycle; \draw[thick, blue] (0,0,.5) -- (.5,0,.5) -- (.5,0,0) -- (.5,.5,0) -- (0,.5,0); \filldraw[black] (0,0,1) circle (.2pt) node[anchor=west] {\footnotesize 1}; \filldraw[black] (1,0,0) circle (.2pt) node[anchor=north] {\footnotesize 1}; \filldraw[black] (0,1,0) circle (.2pt) node[anchor=south] {\footnotesize 1}; \filldraw[black] (0,0,.5) circle (.2pt) node[anchor=west] {\footnotesize $\frac{1}{2}$}; \filldraw[black] (.5,0,0) circle (.2pt) node[anchor=north] {\footnotesize $\frac{1}{2}$}; \filldraw[black] (0,.5,0) circle (.2pt) node[anchor=north] {\footnotesize $\frac{1}{2}$}; \draw[<-,black] (0,.2,.7) -- (0,.3,1.1) node[anchor=south]{{\footnotesize $\frac{1}{p} +\frac{1}{q} \le 1$}}; \draw[<-,red] (0,.15,.1) -- (0,.35,.9) node[anchor=west]{{\footnotesize $\frac{1}{p} +\frac{1}{q} \le \frac{1}{2}, \alpha\geq 2$: every distributional solution is parabolic (Thm. \ref{thm:regolarita})}}; \draw[<-,blue] (0,.4,.2) -- (0,.5,.7) node[anchor=west]{{\footnotesize $\min\{\alpha,p,q\} \ge 2$: parabolic solutions are unique (Thm. \ref{thm:uniqueness_weak_parabolic}) }}; \draw[-,dashed] (0,0,0)--(1,0,0); \draw[-,dashed] (0,0,0)--(0,1,0); \draw[-,dashed] (0,0,0)--(0,0,1); \draw[->] (0,1,0)--(0,1.5,0) node[anchor=north east]{$\frac{1}{p}$}; \draw[->] (0,0,1)--(0,0,1.5) node[anchor=north east]{$\frac{1}{q}$}; \draw[->] (1,0,0)--(1.5,0,0) node[anchor=north east]{$\frac{1}{\alpha}$}; \end{tikzpicture} \caption{Visual depiction of the \emph{uniqueness} and \emph{regularity} results for distributional and parabolic solutions for fields $\b \in L^\alpha_t L^p_x$ and initial datum $v_0 \in L^q$. Distributional solutions $v \in L^{\infty}_tL^q_x$ are well defined in the black wedge. In the blue cube parabolic solutions are unique and in the red wedge every distributional solution is parabolic.}\label{fig:3d} \end{figure} \subsection{Part II. Vanishing viscosity scheme and rates of convergence} The second part of the paper deals instead with a different, though closely related, problem. The focus now becomes the linear transport equation associated with a Sobolev vector field $\b$, i.e. \begin{equation}\label{eq:te-intro}\tag{TE} \begin{cases} \partial_t u + \mathop{\mathrm {div}}(u\b) = 0 \\ u |_{t=0} = u_0, \end{cases} \end{equation} for a given initial datum $u_0 \colon \mathbb{R}^d \to \mathbb{R}$. It is by now well known that \eqref{eq:te-intro} is deeply connected with the ordinary differential equation associated to $\b$ and more precisely with the \emph{regular Lagrangian flow} of $\b$ (see Definition \ref{def:rlf} below). This concept has proven to be the right generalization of the classical notion of flow in connection with such problems (see e.g. \cite{A04, BC}). On the torus, if $\b \in L^1_t W^{1,p}_x$, existence and uniqueness of the regular Lagrangian flow $\bm X$ of $\b$ hold \cite{DPL}: in turn, a straightforward computation allows to check that the transport of the initial datum along the characteristics selected by the regular Lagrangian flow always defines a solution to \eqref{eq:te-intro}. More precisely, the function $u^{\mathsf L}(t,x) := u_0(\bm X^{-1}(t,\cdot)(x))$ is a distributional solution to \eqref{eq:te-intro}, whenever $u_0 \in L^q$ for some $q \ge 1$ with $\sfrac{1}{p} + \sfrac{1}{q} \le 1$. We will refer to $u^{\mathsf L}$ as the \emph{Lagrangian solution}. Remarkably, $u^{\mathsf L}$ turns out to be the \emph{unique} distributional solution within the aforementioned range of integrability. \subsubsection*{The need for a selection criterion for \eqref{eq:te-intro}} A few years ago, in a series of innovative contributions, Modena and Sz\'ekelyhidi constructed a plethora of counterexamples, showing ill-posedness of the problem \eqref{eq:te-intro}. More precisely, in \cite{MS, MS2} the authors have produced divergence-free, Sobolev vector fields $\b \in C_t W^{1,p}_x$ such that \eqref{eq:te-intro} admits infinitely many distributional solutions $u \in C_t L^q_x$, with $\sfrac{1}{p}+\sfrac{1}{q}>1+\sigma(d)$ and $u\b \in L^1$. Here $\sigma(d)$ is a dimensional constant, which has been refined in \cite{MS3} to $\sigma(d) := \sfrac{1}{d}$. Yet the situation in the intermediate regime $1< \sfrac{1}{p}+\sfrac{1}{q} \le 1+\sigma(d)$ is an open problem (see, however, \cite{CL}). Remarkably, in the works just mentioned, the authors build distributional solutions that do \emph{not} enjoy typical properties of smooth solutions, such as the conservation of the $L^p$ norms. It is therefore natural to ask whether such solutions can be obtained as limit of (physically or numerically) significant approximation procedures, as for instance the vanishing viscosity method. The second part of the present paper is devoted to establishing the following theorem, together with some related results. \begin{mainthm*}[Vanishing viscosity for linear transport] Let $\b \in L^1_t W^{1,1}_x$ be a divergence-free vector field on the torus $\mathbb{T}^d$ and let $u_0 \in L^1$ be a given initial datum. Let $(v_0^\e)_\e \subset L^\infty_x $ be \emph{any} sequence of functions such that $v_0^\e \to u_0$ strongly in $L^1_x$. Consider the \emph{vanishing viscosity solutions}, i.e. the sequence $(v_\e)_{\e>0} \subseteq L^\infty((0,T); L^\infty(\mathbb{T}^d)) \cap L^2((0,T); H^1(\mathbb{T}^d))$ of parabolic solutions to \begin{equation}\label{eq:vv-intro}\tag{VV} \begin{cases} \partial_t v_\e + \b \cdot \nabla v_\e = \e\Delta v_\e & \text{ in } (0,T) \times \mathbb{T}^d \\ v_\e\vert_{t=0}=v_0^\e& \text{ in } \mathbb{T}^d. \end{cases} \end{equation} Then $(v_\e)_{\e>0}$ converges in $C([0,T];L^1(\mathbb{T}^d))$ to the Lagrangian solution $u^{\sf L}$ to \eqref{eq:te-intro}. \end{mainthm*} We highlight the applicability range of our result, which is completely general: dealing with the (extreme) case of a $W^{1,1}$ field and an $L^1$ solution (in space), we prove that the vanishing viscosity scheme \emph{always} acts as a selection principle (even in an integrability regime where the product $u \b$ cannot be defined distributionally) and that the family $(v_\e)_\e$ always selects, in the limit, the Lagrangian solution $u^{\sf L}$. Observe that, for the Lagrangian solution, all its $L^q$-norms are conserved (recall that we assume the vector field to be divergence-free). In particular, for $u_0 \in L^2$, our result rules out the possibility of anomalous dissipation in the vanishing viscosity limit, that is, it implies that \begin{equation*} \e \int_0^T \Vert \nabla v_\e \Vert^2_{L^2} \, \mathrm{d} t \to 0 \quad \text{as $\e \to 0$.} \end{equation*} As in the case of the advection-diffusion equation \eqref{eq:ad-intro}, distributional solutions of \eqref{eq:te-intro} exist even if we require only integrability assumptions on $\b$. However, in contrast to the case of \eqref{eq:ad-intro}, for vector fields outside the Sobolev class there is a wide literature of counterexamples to the uniqueness for \eqref{eq:te-intro}, see for example \cite{Ai, ABC14, DPL, Dep}. There are many contexts in PDEs (conservation laws, fluid dynamics, etc...) in which the notion of distributional solution is too general to ensure uniqueness and therefore selection criteria are needed to characterize particularly meaningful solutions. The selection problem for the transport equation has already been posed in \cite{CCS2} (see also \cite{DLG}) where the authors considered as a (non) selection criterion the smooth approximation of the vector field. In particular, it is shown that a smooth approximation may produce different (Lagrangian) solutions in the limit. Moreover, results of Lagrangianity for weak solutions of the 2D Euler equations obtained via vanishing viscosity have been established in \cite{CNSS, CS}, see also \cite{CCS3} for the Lagrangianity of solutions obtained via vortex-blob approximations. We present two proofs of the Selection Theorem. The first one is more Eulerian in spirit and is a slightly expanded version of the one contained in DiPerna-Lions' original contribution \cite{DPL}, which is based on a duality argument. We offer a comprehensive, detailed proof which ultimately reveals the complete generality of the vanishing viscosity scheme, which is able to bypass the distributional regime. In particular, we cover also the case $p=1$ which was left somehow implicit in \cite{DPL}. The second proof we provide, instead, has a more Lagrangian nature and is based on the use of stochastic flows (\cite{CJ,CCS4}). At the price of a technical, additional integrability assumption (which is not needed in the Eulerian proof), this alternative proof of the Selection Theorem yields \emph{quantitative} rates of convergence of $v^\e$ to $u^{\sf L}$ and also quantitative (in the viscosity) stability estimates for solutions of the advection-diffusion equation. Such rates are compared with the ones obtained in the recent works \cite{BN} and \cite{S21}. \subsection*{Acknowledgements} Most of this work was developed while the first and second authors were Post-Doc at the Departement Mathematik und Informatik of the University of Basel supported by the ERC Starting Grant 676675 FLIRT. During the final preparation of the manuscript, P.B. has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme, grant agreement No 757254 (SINGULARITY). G. Ciampa is supported by the Basque Government under program BCAM- BERC 2018-2021, by the Spanish Ministry of Science, Innovation and Universities under the BCAM Severo Ochoa accreditation SEV-2017-0718. The authors acknowledge useful discussions with S. Spirito and S. Modena and they are grateful to M. Sorella for some comments on the first version of this work. \section{Preliminaries and notations} We begin by fixing the notation and recalling some basic facts we will need in the following. \subsection{Notation} Throughout the paper, $d \ge 1$ will be a fixed integer. We will denote by $\mathbb{T}^d := \mathbb{R}^d/\mathbb{Z}^d$ the $d$-dimensional flat torus and by $\mathscr L^d$ the Lebesgue measure on it. We identify the $d$-dimensional flat torus with the cube $[0,1)^d$ and we denote with $\mathsf{d}$ the geodesic distance on $\mathbb{T}^d$, which is given by \begin{equation*} \mathsf{d}(x,y)=\min\{|x-y-k|:k\in\mathbb{Z}^d\,\,\mbox{such that }|k|\leq 2\}. \end{equation*} We will use the letters $p,q$ to denote real numbers in $[1,+\infty]$ and $p'$ will be the (H\"older) conjugate to $p$. We will adopt the customary notation for Lebesgue spaces $L^p(\mathbb{T}^d)$ and for Sobolev spaces $W^{k,p}(\mathbb{T}^d)$; in particular, $H^k(\mathbb{T}^d) := W^{k,2}(\mathbb{T}^d)$. We will denote with $\|\cdot\|_{L^p}$ (respectively $\|\cdot\|_{W^{k,p}}$,$\|\cdot\|_{H^k}$) the norms of the aforementioned functional spaces, omitting the domain dependence when not necessary. Every definition below can be adapted in a standard way to the case of spaces involving time, like e.g. $L^1([0,T];L^p(\mathbb{T}^d))$. \subsubsection*{Equi-integrability} We recall the definition of equi-integrability for a family of functions in $L^1$: \begin{defn}[Equi-integrability]\label{def:equii} A family $\{ \varphi_i\}_{i\in I}\subset L^1(\mathbb{T}^d)$ is {\em equi-integrable} if for every $\e>0$ there exists $\delta>0$ such that for every Borel set $E\subset\mathbb{T}^d$ with $\mathscr{L}^d(E)\leq\delta$ it holds \begin{equation*} \int_E|\varphi_i|\mathrm{d} x\leq\e \qquad \text{ for every $i \in I$.} \end{equation*} \end{defn} The following well-known results offer useful criteria to check the equi-integrability of a family of functions in $L^1$: \begin{thm}[Dunford-Pettis, de la Vall\'ee-Poussin]\label{thm:equiintegrability} Let $\{ \varphi_i\}_{i\in I}\subset L^1(\mathbb{T}^d)$ be a bounded family. Then the following are equivalent: \begin{enumerate} \item[\rm (i)] $\{ \varphi_i\}_{i\in I}$ is equi-integrable; \item[\rm (ii)] $\{ \varphi_i\}_{i\in I}$ is weakly sequentially pre-compact in $L^1(\mathbb{T}^d)$; \item[\rm (iii)] there exists a non-negative, increasing, convex function $\Psi \colon [0,+\infty) \to [0,+\infty)$ such that \begin{equation*} \lim_{t\to+\infty}\frac{\Psi(t)}{t}=+\infty \quad \text{ and } \quad \sup_{i\in I}\int_{\mathbb{T}^d}\Psi(|\varphi_i|)\mathrm{d} x<+\infty. \end{equation*} \end{enumerate} \end{thm} We finish this subsection with the following useful lemma. \begin{lem}\label{lem:decomposition-equi} Let $\{ \varphi_i\}_{i\in I}\subset L^1(\mathbb{T}^d)$ be a bounded family. Then, $\{ \varphi_i\}_{i\in I}$ is equi-integrable if and only if for any $r\in[1,\infty]$ and $\e>0$ there exist $\{g_i^1\}_{i\in I}\subset L^1(\mathbb{T}^d)$, $\{ g_i^2 \}\subset L^r(\mathbb{T}^d)$, and a constant $C_\e>0$ such that \begin{equation*} f_i=g_i^1+g_i^2,\hspace{0.5cm}\sup_{i\in I}\|g_i^1\|_{L^1}\leq \e,\hspace{0.5cm}\sup_{i\in I}\|g_i^2\|_{L^r}\leq C_\e. \end{equation*} \end{lem} \begin{proof} Let $\{ \varphi_i\}_{i\in I}\subset L^1(\mathbb{T}^d)$ be an equi-integrable sequence such that $\sup_{i\in I}\|\varphi_i\|_{L^1}\leq C$. Let $\e>0$ be fixed and let $\delta>0$ as in Definition \ref{def:equii}. Then, we define the set $$ A_\delta^i:=\left\{x\in\mathbb{T}^d: |\varphi_i(x)|>\frac{C}{\delta} \right\}, $$ and by Chebishev inequality we know that $$ \sup_{i\in I}\mathscr{L}^d(A_\delta^i)\leq \frac{\delta}{C}\|\varphi_i\|_{L^1}\leq \delta. $$ So, by the equi-integrability $$ \sup_{i\in I}\int_{A_\delta^i}|\varphi_i|\mathrm{d} x\leq \e, $$ and it is now clear that, by defining $g_i^1=\varphi_i\chi_{A_\delta^i}$ and $g_i^2=\varphi_i(1-\chi_{A_\delta^i})$, we have that $$ \sup_{i\in I}\|g_i\|_{L^1}\leq \e,\hspace{0.5cm}\sup_{i\in I}\|g_i^2\|_{L^r}\leq C_\e, $$ since $\mathbb{T}^d$ has finite measure. We now prove the opposite implication. Let $r\in[1,\infty]$ and $\e>0$ be fixed, we consider a decomposition such that $$ \|g_i^1\|_{L^1}\leq \e/2, \hspace{0.5cm}\|g_i^2\|_{L^r}\leq C_\e. $$ Let us check that we can take $\delta=\left(\frac{\e}{2C_\e}\right)^{r/(r-1)}$ in the definition of equi-integrability. Indeed, if $A\subset\mathbb{T}^d$ is such that $\mathscr{L}^d(A)\leq \delta$, we have that \begin{equation*} \int_A|\varphi_i|\mathrm{d} x\leq \int_A|g_i^1|\mathrm{d} x+\int_A|g_i^2|\mathrm{d} x \leq \|g_i^1\|_{L^1}+\|g_i^2\|_{L^r}\mathscr{L}^d(A)^{(r-1)/r} \leq \e/2+\e/2 = \e. \qedhere \end{equation*} \end{proof} \subsubsection*{Some Harmonic Analysis tools} We will need to work with weak Lebesgue spaces, denoted by $M^p(\mathbb{T}^d)$: for the sake of completeness, we recall here their definition and some useful lemmata. \begin{defn} Let $u:\mathbb{T}^d\to\mathbb{R}$ be a measurable function. For any $1\leq p<\infty$ we define \begin{equation*} |||u|||_{M^p}^p=\sup_{\lambda>0}\left\{\lambda^p\mathscr{L}^d\left(\{x\in\mathbb{T}^d: |u(x)|>\lambda\}\right)\right\}, \end{equation*} and we define the weak Lebesgue space $M^p(\mathbb{T}^d)$ as the set of the functions $u:\mathbb{T}^d\to\mathbb{R}$ with $|||u|||_{M^p}<\infty$. By convention, for $p=\infty$ we set $M^\infty(\mathbb{T}^d)=L^\infty(\mathbb{T}^d)$. \end{defn} Note that $|||\cdot|||_{M^p}$ is not subadditive, hence it is \emph{not} a norm. As a consequence, $M^p(\mathbb{T}^d)$ is not a Banach space. Moreover, since for every $\lambda>0$ $$ \lambda^p\mathscr{L}^d\left(\{x\in\mathbb{T}^d: |u(x)|>\lambda\}\right)=\int_{|u|>\lambda}\lambda^p\mathrm{d} x\leq\int_{|u|>\lambda}|u(x)|^p\mathrm{d} x\leq \|u\|_{L^p}^p, $$ we have the inclusion $L^p(\mathbb{T}^d)\subset M^p(\mathbb{T}^d)$ and in particular $|||u|||_{M^p}\leq \|u\|_{L^p}$. The following lemma shows that we can interpolate the spaces $M^1$ and $M^p$, with $p>1$, obtaining a bound on the $L^1$ norm. \begin{lem}\label{lem:interp} Let $u:\mathbb{T}^d\to[0,\infty)$ be a non-negative measurable function. Then for every $p\in(1,\infty)$ we have the interpolation estimate \begin{equation*} \|u\|_{L^1}\leq \frac{p}{p-1}|||u|||_{M^1}\left[1+\log\left( \frac{|||u|||_{M^p}}{|||u|||_{M^1}} \right)\right], \end{equation*} while for $p=\infty$ we have \begin{equation*} \|u\|_{L^1}\leq |||u|||_{M^1}\left[1+\log\left( \frac{\|u\|_{L^\infty}}{|||u|||_{M^1}} \right)\right]. \end{equation*} \end{lem} We recall the definition of the Hardy-Littlewood maximal function. \begin{defn}\label{def:maxfunc} Let $f\in L^1(\mathbb{T}^d)$, we define $Mf$ the maximal function of $f$ as $$ Mf(x)=\sup_{r>0}\frac{1}{\mathscr{L}^d(B_r)}\int_{B_r(x)}|f(y)|\mathrm{d} y \hspace{1cm}\mbox{for every }x\in\mathbb{T}^d. $$ \end{defn} The following estimates hold. \begin{lem}\label{lem:maximal-function} For every $1<p\leq\infty$ we have the strong estimate $$ \|Mf\|_{L^p}\leq C_{d,p}\|f\|_{L^p}, $$ while for $p=1$ only the weak estimate $$ |||Mf|||_{M^1}\leq C_d\|f\|_{L^1} $$ holds. \end{lem} Finally, we recall the following estimate on the different quotients of a $W^{1,1}$ function. \begin{lem}\label{lem:diff-quotients} Let $f\in W^{1,1}(\mathbb{T}^d)$. Then there exists a negligible set $\mathcal{N}\subset\mathbb{T}^d$ such that \begin{equation*} |f(x)-f(y)|\leq C(d) \mathsf{d}(x,y)\left( M Df(x)+M Df(y) \right), \end{equation*} for every $x,y\in\mathbb{T}^d\setminus \mathcal{N}$, where $Du$ is the distributional derivative of $u$. \end{lem} \section{On the advection-diffusion equation: $L^p$ theory} In this section, we are interested in the Cauchy problem for the advection-diffusion equation, namely \begin{equation}\label{eq:ad} \begin{cases} \partial_t u + \mathop{\mathrm {div}}(\b u) = \Delta u & \text{ in } (0,T) \times \mathbb{T}^d \\ u\vert_{t=0}=u_0 & \text{ in } \mathbb{T}^d \end{cases} \end{equation} where the data of the problem are $T>0$, the vector field $\b$ and the initial datum $u_0$. More precisely, we want first to present some different notions of solutions (distributional and parabolic) and then discuss existence, uniqueness and mutual relationship under general integrability assumptions on $\b$ and $u_0$. For the sake of completeness, we decided to include a self-contained proof of every result, citing the respective references whenever appropriate. \subsection{Distributional solutions} We start by giving the following definition. \begin{defn}[Distributional solution]\label{def:weak_sol_ad} Let $\b\in L^1((0,T); L^p(\mathbb{T}^d))$ be a divergence-free vector field and $u_0\in L^q(\mathbb{T}^d)$ for $p,q$ such that $\sfrac{1}{p} +\sfrac{1}{q} \leq 1$. A function $u\in L^{\infty}((0,T);L^q(\mathbb{T}^d))$ is a {\em distributional solution} to \eqref{eq:ad} if for any $\varphi\in C^\infty_c([0,T)\times\mathbb{T}^d)$ the following equality holds: $$ \int_0^T\int_{\mathbb{T}^d} u(\partial_t\varphi+\b\cdot\nabla\varphi+ \Delta\varphi) \mathrm{d} x \mathrm{d} t+\int_{\mathbb{T}^d} u_0\varphi(0,\cdot) \mathrm{d} x=0. $$ \end{defn} Notice that in the definition of distributional solutions the assumption that $p,q$ satisfy $\sfrac{1}{p} +\sfrac{1}{q} \leq 1$ is the minimum requirement we need in order to have $u \b\in L^1$ so that the definition makes sense. The proof of existence of distributional solutions is well-known and immediately follows from a classical a priori estimate. \begin{proposition}\label{prop:existence_weak_sol} Let $\b\in L^1((0,T); L^p(\mathbb{T}^d))$ be a divergence-free vector field and $u_0\in L^q(\mathbb{T}^d)$ for $p,q$ such that $\sfrac{1}{p} +\sfrac{1}{q} \leq 1$. Then there exists a distributional solution $u\in L^{\infty}((0,T);L^q(\mathbb{T}^d))$ to \eqref{eq:ad}. \end{proposition} \begin{proof} Let $(\rho^\delta)_\delta$ be a standard family of mollifiers and let us define $\b^\delta=\b*\rho^\delta$, $u_0^\delta=u_0*\rho^\delta$. Then, we consider the approximating problem \begin{equation}\label{eq:ad_be} \begin{cases} \partial_t u^\delta+\mathop{\mathrm {div}}(\b^\delta u^\delta) =\Delta u^\delta\\ u^\delta(0,\cdot)=u_0^\delta. \end{cases} \end{equation} Being $\b^\delta$ and $u_0^\delta$ smooth, there exists a unique smooth solution $u^\delta$ to \eqref{eq:ad_be} (see \cite{EV}). It is readily checked that the sequence $u^\delta$ is equi-bounded in $L^\infty((0,T);L^q(\mathbb{T}^d))$. Indeed, we can multiply the equation in \eqref{eq:ad_be} by $\beta'(u^\delta)$, where $\beta \colon \mathbb{R} \to \mathbb{R}$ is a smooth, convex function: by an easy application of the chain rule and integrating in space, we get \begin{equation*} \frac{d}{dt} \int_{\mathbb{T}^d} \beta(u^\delta(t, x)) \, \mathrm{d} x = - \int_{\mathbb{T}^d} \beta''(u^\delta(t, x)) |\nabla \beta (u^\delta(t, x))|^2 \, \mathrm{d} x \le 0. \end{equation*} In particular, fixing $t>0$ and integrating in time on $(0,t)$ we obtain \begin{equation}\label{eq:estimate_beta} \int_{\mathbb{T}^d} \beta(u^\delta(t, x)) \, \mathrm{d} x \le \int_{\mathbb{T}^d} \beta(u_0^\delta(x)) \, \mathrm{d} x. \end{equation} By considering a sequence of smooth, convex functions, uniformly convergent to $\beta(s) = |s|^q$, for $1 < q < \infty$, we obtain the following uniform bounds on the $L^q$-norm of the solutions $u^\delta$: \begin{equation}\label{eq:diss_norm} \|u^\delta(t,\cdot)\|_{L^q(\mathbb{T}^d)}\leq\|u_0^\delta\|_{L^q(\mathbb{T}^d)}\leq\|u_0\|_{L^q(\mathbb{T}^d)}. \end{equation} For $q>1$ by standard compactness arguments, we can extract a sub-sequence which converges weakly-star to a function $u\in L^\infty((0,T);L^q(\mathbb{T}^d))$ and it is immediate to deduce that $u$ is a distributional solution of \eqref{eq:ad} because of the linearity of the equation. For $q=\infty$, the estimate \eqref{eq:diss_norm} still holds for every $\delta>0$: we send $q\to \infty$ in \eqref{eq:diss_norm} and then we can conclude as in the previous case. For the case $q=1$, the compactness in $L^\infty((0,T);L^1(\mathbb{T}^d))$ can be obtained as a consequence of equi-integrability of the family $(u^\delta)_\delta$ which follows from \eqref{eq:estimate_beta} and (iii) in Theorem \ref{thm:equiintegrability}: we do not present here the full details of this equi-integrability argument and we refer the reader to the proof of Theorem \ref{thm:main} where the same idea is exploited and described in full details in a slightly more complicated case. \end{proof} \subsection{Parabolic solutions} A special sub-class of distributional solutions is given by the so-called \emph{parabolic solutions}, whose peculiar property is the Sobolev regularity in the space variable. As we are going to see, this notion of solution is natural for vector fields possessing enough integrability in the space variable. \begin{definition} Let $\b\in L^1((0,T); L^2(\mathbb{T}^d))$ a divergence-free vector field and $u_0\in L^2(\mathbb{T}^d)$. A function $u\in L^{\infty}((0,T);L^2(\mathbb{T}^d))$ is a {\em parabolic solution} to \eqref{eq:ad} if it is a distributional solution to \eqref{eq:ad} and furthermore $u\in L^2((0,T);H^1(\mathbb{T}^d))$. \end{definition} We will sometimes refer to the space $L^2((0,T);H^1(\mathbb{T}^d))$ as the \emph{parabolic class}. \subsubsection{Existence} We now prove that, under the assumptions above, there exists at least one solution in the parabolic class: \begin{proposition}\label{prop:existence_parabolic_class} Let $\b\in L^1((0,T); L^2(\mathbb{T}^d))$ be a divergence-free vector field and $u_0\in L^2(\mathbb{T}^d)$. Then there exists at least one parabolic solution. \end{proposition} \begin{proof} The proof follows the same idea of the one of Proposition \ref{prop:existence_weak_sol}. We consider the approximating problems \eqref{eq:ad_be} and their unique smooth solutions $u^\delta$. Choosing $\beta(s)=s^2/2$ and integrating in time on $(0,t)$, we get the following energy balance \begin{equation}\label{eq:energy_estimate} \frac{1}{2}\int_{\mathbb{T}^d}|u^\delta(t,x)|^2\mathrm{d} x+\int_0^t\int_{\mathbb{T}^d}|\nabla u^\delta(s,x)|^2\mathrm{d} x \mathrm{d} s=\frac{1}{2}\int_{\mathbb{T}^d}|u_0^\delta(x)|^2\mathrm{d} x. \end{equation} Standard weak compactness arguments yield the conclusion. \end{proof} \begin{rem}\label{rmk:ultimo} In the proofs of Proposition \ref{prop:existence_weak_sol} and Proposition \ref{prop:existence_parabolic_class}, we have constructed solutions as limit of solutions $(u^\delta)_{\delta}$ associated with a regularization $(\b^\delta)_{\delta}$ of the vector field and $(u_0^\delta)_{\delta}$ of the initial datum. This strategy will be used once more later in the paper and we explicitly remark here that the family $(u^\delta)_{\delta}$ satisfies two a-priori estimates: \begin{itemize} \item[(E1)] $\sup_{t \in (0,T)} \| u^\delta \|_{L^q} \le C\| u_0 \|_{L^q}$ if $u_0 \in L^q(\mathbb{T}^d)$; \item[(E2)] $\int_0^T \| \nabla u^\delta(t,\cdot) \|_{L^2} \, \mathrm{d} t \le C\| u_0 \|_{L^2}$ if $u_0 \in L^2(\mathbb{T}^d)$. \end{itemize} These bounds follow integrating by parts and exploiting the divergence-free assumption on the vector field, in particular they are independent of the integrability of $\b$. However, we need the assumption $\b\in L^1((0,T);L^2(\mathbb{T}^d))$ in Proposition \ref{prop:existence_parabolic_class} to give a distributional meaning to the product $u\b$. \end{rem} \subsubsection{Uniqueness of solutions in the parabolic class} The uniqueness of solutions in the parabolic class is a consequence of the following lemma, which is a straightforward modification of \cite[Lemma 5.1]{LBL}. \begin{lem}[Commutator estimates I]\label{lem:conv_comm} Consider a vector field $\b \in L^2([0,T]; L^p(\mathbb{T}^d))$ and a function $w \in L^\infty([0,T]; L^q(\mathbb{T}^d))$, where $p,q$ are positive real numbers with $\sfrac{1}{p}+\sfrac{1}{q}\leq 1$. Let $(\rho^\delta)_\delta$ be a family of smooth convoutions kernels. Define the \emph{commutator of $w$ and $\b$} as follows: \begin{equation}\label{eq:comm_def} r^\delta:=\b\cdot\nabla (w*\rho^\delta)-\left(\b\cdot\nabla w\right)*\rho^\delta. \end{equation} If $\nabla w\in L^2([0,T];L^q(\mathbb{T}^d))$, then $r^\delta$ converges to $0$ in $L^1([0,T] \times \mathbb{T}^d)$. \end{lem} \begin{proof} Observe that, for a.e. $t \in [0,T]$ and a.e. $x \in \mathbb{T}^d$, we can explicitly write the commutator in the following form: \begin{align*} r^\delta(t,x)& =[\b\cdot\nabla (w*\rho^\delta)](t,x)-[(\b\cdot\nabla w)*\rho^\delta](t,x)\\ &=\b(t,x)\cdot\nabla \int_{\mathbb{T}^d}w(t,x-y)\rho^\delta(y)\mathrm{d} y-\int_{\mathbb{T}^d} \b(t,x-y)\cdot \nabla w(t,x-y) \rho^\delta(y)\mathrm{d} y \\ &=\int_{\mathbb{T}^d}\rho^\delta(y) \left(\b(t,x)-\b(t,x-y)\right)\cdot\nabla w(t,x-y) \mathrm{d} y\\ &=\int_{\mathbb{T}^d}\rho(z)\left(\b(t,x)-\b(t,x-\delta z)\right)\cdot\nabla w(t,x-\delta z) \mathrm{d} z. \end{align*} We thus have that \begin{equation} \label{eq:a} \begin{split} \iint_{[0,T] \times \mathbb{T}^d}|r^\delta(t,x)|\mathrm{d} t \mathrm{d} x & =\iint_{[0,T] \times \mathbb{T}^d}\left| \int_{\mathbb{T}^d}\rho(z)\left(\b(t,x)-\b(t,x-\delta z)\right)\cdot\nabla w(t,x-\delta z) \mathrm{d} z\right|\mathrm{d} t \mathrm{d} x \\ &\leq \int_{\mathbb{T}^d} \rho(z)\int_0^T \int_{\mathbb{T}^d}|\b(t,x)-\b(t,x-\delta z)||\nabla w(t,x-\delta z)|\mathrm{d} x \mathrm{d} t \mathrm{d} z. \end{split} \end{equation} Since $(t,x) \mapsto \b(t,x)-\b(t,x-\delta z)$ converges to $0$ in measure (for every fixed $z$), the conclusion follows by the Dominated Convergence Theorem. \end{proof} Having at our disposal the previous lemma, we can now show the uniqueness of solutions in the parabolic class, arguing as in \cite{LBL}. \begin{thm}[Uniqueness of parabolic solutions]\label{thm:uniqueness_weak_parabolic} Consider a divergence-free vector field $\b\in L^2([0,T]; L^2(\mathbb{T}^d))$. Then there exists at most one parabolic solution to \eqref{eq:ad}. \end{thm} \begin{proof} The uniqueness is a rather straightforward consequence of the strong convergence of commutators established in Lemma \ref{lem:conv_comm}. More precisely, since the problem is linear, it suffices to show that, if $u$ is a parabolic solution to \eqref{eq:ad} with $u_0 = 0$, then $u = 0$. Consider again a standard family of mollifiers $(\rho^\delta)_\delta$ and set $u^\delta:=u*\rho^\delta$. Then, a direct computation shows that $u^\delta$ solves the following equation \begin{equation}\label{eq:ade} \begin{cases} \partial_t u^\delta+\mathop{\mathrm {div}}(\b u^\delta)=\Delta u^\delta+r^\delta\\ u^\delta(0,\cdot)=0 \end{cases} \end{equation} where $r^\delta$ is the commutator between $u$ and $\b$, defined as in \eqref{eq:comm_def}. Consider now a smooth function $\beta\in C^2(\mathbb{R})$, with the following properties: $\beta(s) \ge 0$, $|\beta'(s)|\le C$ for some $C>0$ and $\beta''(s) \ge 0$ for any $s\in \mathbb{R}$ with $\beta(s) = 0$ if, and only if, $s = 0$ (e.g. one could easily verify that the function which satisfies $\beta'(s) = \arctan(s)$ with $\beta(0)=0$ is an admissible choice). Multiplying the equation by $\beta'(u^\delta)$ and integrating on $[0,t]\times\mathbb{T}^d$ we obtain \begin{align*} & \int_{\mathbb{T}^d}\beta(u^\delta) \mathrm{d} x+\int_0^t\int_{\mathbb{T}^d}\beta''(u^\delta)|\nabla u^\delta|^2\mathrm{d} x \mathrm{d} s = \int_0^t\int_{\mathbb{T}^d}\beta'(u^\delta)r^\delta\mathrm{d} x\mathrm{d} s. \end{align*} We now let $\delta \to 0$: using the uniform bound on $\beta'$ and Lemma \ref{lem:conv_comm} we deduce that the right-hand side converges to $0$ and thus \begin{equation*} \int_{\mathbb{R}^d}\beta(u(t,x))\mathrm{d} x = - \int_0^t\int_{\mathbb{R}^d}\beta''(u) |\nabla u|^2\mathrm{d} x \mathrm{d} s \le 0. \end{equation*} Since $t \in [0,T]$ is arbitrary, the conclusion $u=0$ easily follows. \end{proof} If the vector field is less integrable than $L^2(\mathbb{T}^d)$, then a severe phenomenon of non-uniqueness may arise. In particular, in \cite{MS3} counter-examples are constructed via convex integration techniques: it is shown that there exist infinitely many solutions to \eqref{eq:ad} in the class $C([0,T];H^1(\mathbb{T}^d))$ with a divergence-free vector field $\b\in C([0,T];L^p(\mathbb{T}^d))$ with $1\leq p<\sfrac{2d}{d+2}$, for which it additionally holds $u\b\in L^1((0,T)\times\mathbb{T}^d)$. This, however, leaves open the following questions. \begin{itemize} \item[(Q1)] \emph{What happens in the case $\sfrac{2d}{d+2}\leq p<2$?} \item[(Q2)] \emph{If uniqueness holds for $p$ as in (Q1), is it possible to show non-uniqueness of solutions in the larger class $L^2((0,T);H^1(\mathbb{T}^d))$ for vector fields which are merely $L^2$ in time (instead than continuous)?} \item[(Q3)] \emph{For a vector field $\b\in L^r((0,T);L^2(\mathbb{T}^d))$ with $1\leq r<2$, are parabolic solutions unique?} \end{itemize} A strategy to tackle (Q2) could be to exploit ``time-intermettency'' as in \cite{BV, CL}, which allows to increase the space integrability at the expense of the time integrability. \subsection{The regularity result} At this point, a natural question is under which conditions a distributional solution is a parabolic solution. In order to address this question, we will need the following version of the commutator lemma which, to the best of our knowledge, is not present in the literature: \begin{lem}[Commutator estimates II]\label{lem:conv_comm2} Consider a vector field $\b \in L^2([0,T]; L^p(\mathbb{T}^d))$ and a function $w \in L^\infty([0,T]; L^q(\mathbb{T}^d))$, where $p,q$ are positive real numbers with $\sfrac{1}{p}+\sfrac{1}{q}\leq \sfrac{1}{2}$. Let $(\rho^\delta)_\delta$ be a family of smooth convoutions kernels and define $r^\delta$ as in \eqref{eq:comm_def}. Then $r^\delta$ converges to $0$ in $L^2([0,T]; H^{-1}(\mathbb{T}^d))$. \end{lem} \begin{proof} We write the commutator as \begin{equation*} \begin{split} r^\delta & =[\b\cdot\nabla (w*\rho^\delta)]-[(\b\cdot\nabla w)*\rho^\delta] =\mathop{\mathrm {div}} [\b (w*\rho^\delta)]-[\mathop{\mathrm {div}} (\b w)*\rho^\delta] = \mathop{\mathrm {div}} [\b (w*\rho^\delta) - (\b w)*\rho^\delta], \end{split} \end{equation*} in the sense of distributions on $[0,T] \times \mathbb{T}^d$. We can thus write \begin{equation*} r^\delta(t,x) = \mathop{\mathrm {div}}_x \left( \int_{\mathbb{T}^d} [\b(t,x) - \b(t,x-y)] w(t,x-y)\rho^\delta(y)\mathrm{d} y \right) \end{equation*} and we can estimate \begin{equation*} \begin{split} \|r^\delta \|_{L^2(H^{-1})}&=\sup_{\|\varphi\|_{L^2 H^1}\leq 1}\left|\iint_{[0,T] \times \mathbb{T}^d}r^\delta(t,x)\varphi(t,x)\mathrm{d} t\mathrm{d} x\right|\\ & = \sup_{\|\varphi\|_{L^2 H^1}\leq 1} \left \vert \iint_{[0,T] \times \mathbb{T}^d} \left( \int_{\mathbb{T}^d} [\b(t,x) - \b(t,x-y)] w(t,x-y)\rho^\delta(y)\mathrm{d} y \right) \nabla \varphi(t,x) \mathrm{d} t\mathrm{d} x \right \vert \\ & \le \sup_{\|\varphi\|_{L^2 H^1}\leq 1} \int_{\mathbb{T}^d} \rho(z) \int_0^T \int_{\mathbb{T}^d}|\b(t,x)-\b(t,x-\delta z)||w(t,x-\delta z)| |\nabla\varphi(t,x)|\mathrm{d} x \mathrm{d} t \mathrm{d} z. \end{split} \end{equation*} Notice now that, as in the proof of Lemma \ref{lem:conv_comm}, the map $(t,x) \mapsto \b(t,x)-\b(t,x-\delta z)$ converges to $0$ in measure (for every fixed $z$). H\"older inequality on the product space $[0,T] \times \mathbb{T}^d$ with exponents $(p,q,2)$ (in space) and $(2,\infty, 2)$ (in time) allows to apply Lebesgue Dominated Convergence Theorem and we can therefore conclude that $r^\delta \to 0$ in $L^2(H^{-1})$. \end{proof} We can now present a regularity result which guarantees that a distributional solution in the class $L^\infty((0,T);L^q(\mathbb{T}^d))$ is actually in $L^2((0,T);H^1(\mathbb{T}^d))$ whenever $\sfrac{1}{p}+\sfrac{1}{q}\leq \sfrac{1}{2}$. \begin{thm}\label{thm:regolarita} Let $p,q \ge 1$ such that $\sfrac{1}{p}+\sfrac{1}{q}\leq \sfrac{1}{2}$. If $\b\in L^2([0,T]; L^p(\mathbb{T}^d))$ is a divergence-free vector field and $u\in L^\infty((0,T);L^q(\mathbb{T}^d))$ is a distributional solution to \eqref{eq:ad}, then $u\in L^2((0,T);H^1(\mathbb{T}^d))$ and satisfies \begin{equation}\label{eq:energy_balance} \frac{1}{2}\int_{\mathbb{T}^d}|u|^2\mathrm{d} x+\int_0^T\int_{\mathbb{T}^d}|\nabla u|^2\mathrm{d} x\mathrm{d} t = \frac{1}{2}\int_{\mathbb{T}^d}|u_0|^2\mathrm{d} x . \end{equation} \end{thm} \begin{proof} To commence, we observe that $\sfrac{1}{p}+\sfrac{1}{q}\leq \sfrac{1}{2}$ clearly implies that both $p,q \ge 2$ and, since we are on the torus, any $u\in L^\infty((0,T);L^q(\mathbb{T}^d))$ lies also in $L^\infty((0,T);L^2(\mathbb{T}^d))$. We thus need to prove $\nabla u\in L^2((0,T); L^2(\mathbb{T}^d))$ and this will be achieved exhibiting an approximating sequence $(u^\delta)_{\delta}$ enjoying uniform bounds on $\nabla u^\delta$: in turn, this estimate will be obtained as a consequence of Lemma \ref{lem:conv_comm2}. Let $(\rho^\delta)_{\delta}$ be a standard family of mollifiers. As in the proof of Theorem \ref{thm:uniqueness_weak_parabolic}, the function $u^\delta:=u*\rho^\delta$ solves \eqref{eq:ade}. Let us now prove an estimate on the $H^1$-norm of $u^\delta$ which is independent of $\delta$: multiply the equation \eqref{eq:ade} by $u^\delta$ and integrate by parts to obtain \begin{equation}\label{eq:stima_energia} \frac{1}{2}\int_{\mathbb{T}^d}|u^\delta|^2\mathrm{d} x+\int_0^T\int_{\mathbb{T}^d}|\nabla u^\delta|^2\mathrm{d} x\mathrm{d} t = \frac{1}{2}\int_{\mathbb{T}^d}|u_0^\delta|^2\mathrm{d} x +\int_0^T\int_{\mathbb{T}^d}r^\delta u^\delta \mathrm{d} x \mathrm{d} t. \end{equation} On the one hand, by standard properties of convolutions, we can estimate the first term in the right-hand side of \eqref{eq:stima_energia} as \begin{equation}\label{eq:stima_rhs1} \int_{\mathbb{T}^d}|u_0^\delta|^2\mathrm{d} x = \Vert u_0^\delta \Vert_{L^2}^2 \leq C_d \Vert u_0^\delta\Vert_{L^q}^2 \le C_d\|u_0\|_{L^q}^2 \end{equation} On the other hand, for the second term in the right-hand side of \eqref{eq:stima_energia} we can apply Young's inequality to obtain \begin{equation}\label{eq:stima_rhs2} \begin{split} \int_0^T\int_{\mathbb{T}^d}r^\delta(t,x) u^\delta(t,x) \mathrm{d} x \mathrm{d} t&\leq \|r^\delta\|_{L^2 H^{-1}} \|u^\delta\|_{L^2H^1}\\ & \le C(T) \|r^\delta\|_{L^2 H^{-1}}^2 + \frac{1}{4(1+T)} \|u^\delta\|^2_{L^2H^1} \\ & = C(T) \|r^\delta\|_{L^2 H^{-1}}^2 + \frac{1}{4(1+T)}\left( \|u^\delta\|^2_{L^2 L^2}+\|\nabla u^\delta\|^2_{L^2L^2}\right)\\ & \le C(T) \|r^\delta\|_{L^2 H^{-1}}^2 + \frac{1}{4(1+T)}\left( T\|u^\delta\|^2_{L^\infty L^2}+\|\nabla u^\delta\|^2_{L^2L^2}\right)\\ & \le C(T) \|r^\delta\|_{L^2 H^{-1}}^2 + \frac{1}{4} \left( \|u^\delta\|^2_{L^\infty L^2}+\|\nabla u^\delta\|^2_{L^2L^2}\right). \end{split} \end{equation} Since $r^\delta$ goes to $0$ in $L^2(H^{-1})$, the term $\|r^\delta\|_{L^2 H^{-1}}$ is equi-bounded. Combining \eqref{eq:stima_rhs1}, \eqref{eq:stima_rhs2} and plugging them into \eqref{eq:stima_energia} we can conclude \begin{equation*} \|u^\delta\|^2_{L^\infty L^2}+\|\nabla u^\delta\|^2_{L^2L^2}\leq C(d,\Vert u_0\Vert_{L^q}), \end{equation*} for some constant $C$ which does not depend on $\delta$: this shows that the distributional solution $u$ is parabolic and thus unique thanks to Theorem \ref{thm:uniqueness_weak_parabolic}. Finally, \eqref{eq:energy_balance} immediately follows from \eqref{eq:stima_energia} sending $\delta \to 0$. \end{proof} The assumption on the time-integrability of the vector field in the above theorem suggests the following question. \begin{itemize} \item[(Q4)] \emph{Let $u\in L^\infty((0,T);L^q(\mathbb{T}^d))$ be a distributional solution associated to a divergence-free vector field $\b\in L^r((0,T);L^p(\mathbb{T}^d))$ with $1\leq r <2$, and assume that $\sfrac{1}{p}+\sfrac{1}{q}\leq \sfrac{1}{2}$. Is $u$ a parabolic solution?} \end{itemize} Combining Theorem \ref{thm:regolarita} and Theorem \ref{thm:uniqueness_weak_parabolic}, we obtain the following corollary. \begin{cor} Let $p,q \ge 1$ such that $\sfrac{1}{p}+\sfrac{1}{q}\leq \sfrac{1}{2}$. If $\b\in L^2([0,T]; L^p(\mathbb{T}^d))$ is a divergence-free vector field, then there exists at most one distributional solution $u\in L^\infty((0,T);L^q(\mathbb{T}^d))$. \end{cor} At this point, it is natural to wonder whether in the regime $\sfrac{1}{2} < \sfrac{1}{p}+\sfrac{1}{q}\leq 1$ there exist distributional solutions that are not parabolic and, therefore, whether uniqueness of parabolic solutions holds but uniqueness of distributional solutions does not. A partial answer to this, in dimension $d >2$, can be obtained using \cite[Theorem 1.4]{MS3}, which gives non uniqueness of distributional solutions in the regime $\sfrac{1}{p}+\sfrac{1}{q}=1$ and $p<d$ (notice that in those examples the vector field and the solution are bounded in time). A particular case of interest (somewhat reminiscent of the case of the Navier-Stokes equations in \cite{BV}) is when $p=q=2$: with such a choice, one obtains an example where there exist infinitely many distributional solutions, despite the parabolic one is unique in view of Theorem \ref{thm:uniqueness_weak_parabolic}. However, the convex integration schemes of \cite{MS3} are not able to cover the case $d=2$. We therefore formulate the following question. \begin{itemize} \item[(Q5)]\emph{Does it exist a divergence-free vector field $\b\in L^2((0,T);L^2(\mathbb{T}^2))$ and a distributional solution $u\in L^\infty((0,T);L^2(\mathbb{T}^2))$ which is not parabolic, i.e. $u\notin L^2((0,T);H^1(\mathbb{T}^2))$? What if the vector field $\b\in L^2(\mathbb{T}^2)$ is autonomous?} \end{itemize} As a last point, we observe that the situation in the intermediate regime $\sfrac{1}{2} < \sfrac{1}{p}+\sfrac{1}{q}<1$ is completely open: \begin{itemize} \item[(Q6)]\emph{Let $\sfrac{1}{2} < \sfrac{1}{p}+\sfrac{1}{q}<1$. Does it exist a divergence-free vector field $\b\in L^2((0,T);L^p(\mathbb{T}^d))$ and a distributional solution $u\in L^\infty((0,T);L^q(\mathbb{T}^d))$ which is not parabolic, i.e. $u\notin L^2((0,T);H^1(\mathbb{T}^d))$?} \end{itemize} It is worth noticing that a partial answer to (Q6) is given in \cite[pag. 70]{LBL}: when $1\le q<2$ we cannot expect $\nabla u \in L^2_tL^2_x$ since this does not hold for the heat equation. \section{The vanishing viscosity scheme I: setup and Eulerian proof} Starting from this section onwards, we slightly change the focus of our investigation and we move towards the transport equation side. Our overarching goal is indeed the study of the well-posedeness of the transport equation in the regime of Sobolev vector fields: we plan to tackle such question by setting up a vanishing viscosity scheme and establishing its convergence towards a \emph{unique} limit, also ruling out the possibility of anomalous dissipation in this setting. In order to achieve such a result, we need first to collect and formulate in our notations some (mostly known) results on the advection-diffusion equation drifted by Sobolev vector fields. This is indeed the content of the next paragraph. \subsection{On the advection-diffusion equation drifted by a Sobolev vector field} We recall the following proposition. \begin{proposition}[{\cite[Proposition 5.3]{LBL}}]\label{prop:parabolic_wp} Let $\bm b \in L^1((0,T); W^{1,1}(\mathbb{T}^d))$ be a divergence-free vector field and let $v_0 \in L^\infty(\mathbb{T}^d)$ be given. Then the problem \begin{equation}\label{eq:VV} \begin{cases} \partial_t v + \mathop{\mathrm {div}}(\b v) = \Delta v & \text{ in } (0,T) \times \mathbb{T}^d \\ v\vert_{t=0}=v_0 & \text{ in } \mathbb{T}^d \end{cases} \end{equation} admits a unique parabolic solution $v \in L^\infty((0,T); L^2(\mathbb{T}^d)) \cap L^2((0,T),H^1(\mathbb{T}^d))$. Furthermore, it holds $v \in L^\infty((0,T); L^\infty(\mathbb{T}^d))$ and \begin{equation}\label{eq:enunciato_stima_for_all_s} \|v \|_{L^\infty((0,T); L^s(\mathbb{T}^d))} \le \|v_0 \|_{L^s(\mathbb{T}^d)} \end{equation} for any real number $s \in [1,+\infty]$. \end{proposition} \begin{remark}[Equation with a forcing term]\label{rem:forcing} For future use, we explicitly observe that the same conclusions of Proposition \ref{prop:parabolic_wp} apply as well to the equation with a forcing term. More precisely, if $\chi \in C^\infty((0,T) \times \mathbb{T}^d)$ is a smooth function and $v_0 \in L^\infty(\mathbb{T}^d)$, then the problem \begin{equation*} \begin{cases} \partial_t v + \b \cdot \nabla v = \Delta v + \chi & \text{ in } (0,T) \times \mathbb{T}^d \\ v\vert_{t=0}=v_0 & \text{ in } \mathbb{T}^d \end{cases} \end{equation*} has a unique parabolic solution. Observe also that via the transformation $v(t,x) \mapsto v(T-t,- x)$ we deduce well-posedness results also for the backward equation \begin{equation}\label{eq:AD_dual} \begin{cases} -\partial_t v - \b \cdot \nabla v = \Delta v + \chi & \text{ in } (0,T) \times \mathbb{T}^d \\ v\vert_{t=T}=v_T & \text{ in } \mathbb{T}^d. \end{cases} \end{equation} For future use, notice that if $v_T = 0$ then the problem \eqref{eq:AD_dual} admits a unique solution in $L^\infty((0,T); L^\infty(\mathbb{T}^d))$ and that it holds \begin{equation*} \| v \|_{L^\infty((0,T); L^\infty(\mathbb{T}^d))} \le C(\Vert \chi\Vert_{C^0(\mathbb{T}^d)}) < +\infty. \end{equation*} \end{remark} \subsection{The transport equation} In the following, we will consider the initial value problem for the tranport/continuity equation \begin{equation}\label{eq:transport} \begin{cases} \partial_t u + \mathop{\mathrm {div}}(\b u) = 0 & \qquad \text{ in } (0,T) \times \mathbb{T}^d \\ u\vert_{t=0}=u_0 & \qquad \text{ in } \mathbb{T}^d \end{cases} \end{equation} where $T>0$, $\bm b \colon [0,T] \times \mathbb{T}^d \to \mathbb{R}^d$ is a given divergence-free vector field and $u_0 \colon \mathbb{T}^d \to \mathbb{R}$ is the initial datum. As already done in Section 4, we will work in Sobolev classes for the velocity field and the equation \eqref{eq:transport} will be understood in the sense of distributions. We explicitly observe that, since we are working on the torus, the integrability of $\b$ is sufficient to prevent the blow up of its trajectories and thus we can work with the \emph{regular Lagrangian flow} of $\b$: \begin{defn}[Regular Lagrangian flow]\label{def:rlf} Let $\b\in L^1((0,T);L^1(\mathbb{T}^d))$ be a divergence-free vector field. A map $\bm X \colon (0,T)\times(0,T)\times\mathbb{T}^d \to \mathbb{T}^d$ is a {\em regular Lagrangian flow} of $\b$ if the following conditions hold: \begin{itemize} \item for a.e. $x\in \mathbb{T}^d$ and for any $t\in[0,T]$ the map $s\in[0,T]\mapsto \bm X(t,s,x)= \bm X_{t,s}(x)\in\mathbb{T}^d$ is an absolutely continuous solution of \begin{equation*} \begin{cases} \partial_s \bm X_{t,s}(x)=\b(s,\bm X_{t,s}(x)) & s\in[0,T],\\ \bm X_{t,t}(x)=x. \end{cases} \end{equation*} \item For any $t\in[0,T]$ and $s\in[0,T]$ the map $x\in\mathbb{T}^d\mapsto \bm X_{t,s}(x)\in\mathbb{T}^d$ is measure-preserving. \end{itemize} \end{defn} Existence and uniqueness of the regular Lagrangian flow of a Sobolev, divergence-free vector field $\b$ are ensured by \cite{DPL} and therefore we can give the following definition: \begin{definition} Let $\b \in L^1((0,T);W^{1,1}(\mathbb{T}^d))$ be a divergence-free vector field and let $\bm X \colon (0,T) \times (0,T) \times \mathbb{T}^d \to \mathbb{T}^d$ be its regular Lagrangian flow. If $u_0 \in L^1(\mathbb{T}^d)$, then the map \begin{equation*} u^{\mathsf L}(t,x) := u_0(\bm X_{t,0}(x)) \end{equation*} is called \emph{Lagrangian solution} to \eqref{eq:transport}. \end{definition} Observe that, under the assumption that $\b$ is divergence-free, if $u_0\b \in L^1(\mathbb{T}^d)$ then the Lagrangian solution is also a distributional solution to \eqref{eq:transport}. \subsection{Setup of the vanishing viscosity scheme} We consider the problem \begin{equation}\label{eq:transport_in_vv} \begin{cases} \partial_t u + \b \cdot \nabla u = 0 & \qquad \text{ in } (0,T) \times \mathbb{T}^d \\ u\vert_{t=0}=u_0 & \qquad \text{ in } \mathbb{T}^d \end{cases} \end{equation} with a Sobolev, divergence-free vector field $\b$ and an initial datum $u_0 \in L^1(\mathbb{T}^d)$. For each $\e>0$ we introduce the parabolic problem \begin{equation}\label{eq:VV_2} \begin{cases} \partial_t v_\e + \b \cdot \nabla v_\e = \e\Delta v_\e & \text{ in } (0,T) \times \mathbb{T}^d \\ v_\e\vert_{t=0}=v_0^\e& \text{ in } \mathbb{T}^d \end{cases} \end{equation} being $v_0^\e$ a suitable bounded approximation of the initial datum $u_0$. In view of Proposition \ref{prop:parabolic_wp}, the problem \eqref{eq:VV_2} is well-posed within parabolic solutions, namely the family $(v_\e)_{\e>0}$ is well-defined. Our goal is to establish (weak) compactness bounds on the family $(v_\e)_{\e>0}$ and characterize its limit points: we show that a ``selection principle'' holds: the sequence $(v_\e)_\e$ always converges as $\e\to 0$ to the Lagrangian solution to \eqref{eq:transport_in_vv}. The precise statement of the main result of this section is a refinement of \cite[Theorem IV.1]{DPL} and reads as follows: \begin{thm}\label{thm:main} Let $\b \in L^1((0,T); W^{1,1}(\mathbb{T}^d))$ be a divergence-free vector field and let $u_0 \in L^1(\mathbb{T}^d)$ be a given initial datum. Let $(v_0^\e)_\e \subset L^\infty(\mathbb{T}^d)$ be \emph{any} sequence of functions such that $v_0^\e \to u_0$ strongly in $L^1(\mathbb{T}^d)$. Then the sequence $(v_\e)_{\e>0} \subseteq L^\infty((0,T); L^\infty(\mathbb{T}^d)) \cap L^2((0,T); H^1(\mathbb{T}^d))$ of solutions to \eqref{eq:VV_2} converges in $C([0,T];L^1(\mathbb{T}^d))$ to the (unique) Lagrangian solution to \eqref{eq:transport}. \end{thm} \begin{proof} We split the proof in several steps. {\bf \emph{Step 1. Parabolic well-posedness and compactness (equi-integrability).}} We begin with the study of the problem \eqref{eq:VV_2}. From Proposition \ref{prop:parabolic_wp}, we deduce that for every fixed $\e>0$ there exists a unique function $v_\e \in L^\infty((0,T); L^\infty(\mathbb{T}^d)) \cap L^2((0,T); H^1(\mathbb{T}^d))$ solving \eqref{eq:VV_2}, which moreover satisfies \begin{equation*} \| v_\e \|_{L^\infty((0,T); L^s(\mathbb{T}^d))} \le \| v_0^\e \|_{L^s(\mathbb{T}^d)}, \end{equation*} for any $s \in [1,+\infty]$. Since $u_0 \in L^1$, the family $(v_\e)_{\e}$ is in general not equi-bounded neither in $L^\infty((0,T); L^\infty(\mathbb{T}^d))$ nor in $L^2((0,T);H^1(\mathbb{R}^d))$. However, since $v_0^\e \to u_0$ strongly in $L^1(\mathbb{R}^d)$, we get for $s=1$ \begin{equation}\label{eq:bound_L^q} \| v_\e \|_{L^\infty((0,T); L^1(\mathbb{T}^d))} \le \| v_0^\e \|_{L^1(\mathbb{T}^d)} \le C < + \infty \end{equation} for some constant $C>0$ independent of $\e$. This is, however, still not sufficient to obtain weak compactness in $L^1$, as we need to show the equi-integrability of the family $(v_\e)_{\e>0}$. To do so, we argue in the following way: since $v_0^\e \to u_0$ strongly in $L^1(\mathbb{T}^d)$, by Theorem \ref{thm:equiintegrability}, there exists a convex, increasing function $\Psi \colon [0,+\infty] \to [0,+\infty]$ such that $\Psi(0)=0$ and \begin{equation}\label{eq:const_def} \lim_{s \to \infty} \frac{\Psi(s)}{s} = \infty \qquad \text{and} \qquad \sup_{\e>0} \int_{\mathbb{R}^d} \Psi(|v_0^\e(x)|) \, dx =: C < \infty. \end{equation} Without loss of generality, we can assume that $\Psi$ is smooth. By an easy approximation argument (as already done several times before), we can multiply the equation \eqref{eq:VV_2} by $\Psi'(|v_\e|)$ and we obtain \begin{equation*} \frac{d}{dt} \int_{\mathbb{T}^d} \Psi(|v_\e(\tau,x)|) \, dx + \e \int_{\mathbb{T}^d} \Psi^{\prime\prime}(|v_\e(\tau,x)|) |\nabla(|v_\e|)|^2 \, dx = 0. \end{equation*} The convexity of $\Psi$ and an integration in time on $(0,t)$ give \begin{equation*} \int_{\mathbb{T}^d} \Psi(|v_\e(t,x)|) \, dx \le C, \end{equation*} where $C$ is the same constant as in \eqref{eq:const_def}. Since $t$ is arbitrary, \begin{equation}\label{eq:bound_equi_integrability} \sup_{t \in (0,T)} \int_{\mathbb{T}^d} \Psi(|v_\e(t,x)|) \, dx \le C. \end{equation} Since the constant $C$ is independent of $\varepsilon$, we can resort to Point {\rm (iii)} of Theorem \ref{thm:equiintegrability} and we infer that the family $(v_\e)_{\e>0}$ is weakly-precompact in $L^\infty((0,T); L^1(\mathbb{T}^d))$. Therefore, there exists a function $u^{\mathsf {V}} \in L^\infty((0,T); L^1(\mathbb{T}^d))$ such that $v_\e \rightharpoonup u^{\mathsf V}$ in $L^\infty((0,T); L^1(\mathbb{T}^d))$ (up to a non-relabelled subsequence). { \bf \emph{Step 2. Identification of the limit via duality I.}} We now want to exploit a duality argument. Let $\chi \in C^\infty((0,T) \times \mathbb{T}^d)$ be arbitrary. By Remark \ref{rem:forcing}, for every $\e>0$, there exists a unique function $\vartheta_\e \in L^\infty((0,T); L^\infty(\mathbb{T}^d)) \cap L^2((0,T); H^1(\mathbb{T}^d))$ solving \begin{equation}\label{eq:AD_forcing} \begin{cases} -\partial_t \vartheta_\e - \b \cdot \nabla \vartheta_\e = \e \Delta \vartheta_\e + \chi & \text{ in } (0,T) \times \mathbb{T}^d \\ \vartheta_\e\vert_{t=T} = 0 & \text{ in } \mathbb{T}^d. \end{cases} \end{equation} The family $(\vartheta_\e)_{\e>0}$ is uniformly bounded in $L^\infty((0,T); L^\infty(\mathbb{T}^d))$ so, up to a subsequence, the family $(\vartheta_\e)_{\e>0}$ converges in $C([0,T]; w^*-L^{\infty}(\mathbb{T}^d))$ to a function $\vartheta\in C([0,T]; w^*-L^{\infty}(\mathbb{T}^d))$ solving the backward, inhomogenous transport equation \begin{equation}\label{eq:transport_buono} \begin{cases} -\partial_t \vartheta - \b \cdot \nabla \vartheta = \chi & \text{ in } (0,T) \times \mathbb{T}^d \\ \vartheta\vert_{t=T} = 0 & \text{ in } \mathbb{T}^d. \end{cases} \end{equation} By \cite{DPL}, the problem \eqref{eq:transport_buono} is well-posed in $L^\infty((0,T);L^\infty(\mathbb{T}^d))$ and thus $\vartheta$ coincides with \emph{the} unique solution to \eqref{eq:transport_buono} which lies in $C([0,T]; L^{\infty}(\mathbb{T}^d))$. In addition, this implies that the whole sequence $(\vartheta_\e)_{\e>0}$ converges to $\vartheta$ (in other words, the passage to a subsequence is not needed). For future use, observe that it also holds that \begin{equation}\label{eq:initial_datum_weak_continous} \vartheta_{\e}(0, \cdot ) \rightharpoonup \vartheta(0,\cdot ) \qquad \text{ in $L^{\infty}(\mathbb{T}^d)$} \end{equation} and via a straightforward computation one also obtains the Duhamel representation formula \begin{equation}\label{eq:duhamel} \vartheta(t,\bm X_{0,t}(x)) = \int_t^T \chi(s, \bm X_{0,s}(x)) \, \mathrm{d} s, \qquad \forall x \in \mathbb{T}^d, \, t \in [0,T]. \end{equation} { \bf \emph{Step 3. Identification of the limit via duality II.}} We now consider the regularized versions of problem \eqref{eq:VV_2} and \eqref{eq:AD_forcing}. Let $\rho$ be a non-negative, radially symmetric convolution kernel and set for $\e, \delta>0$ \begin{equation*} v_{\e}^{\delta} := v_\e \ast \rho^\delta, \qquad \vartheta_{\e}^{\delta} := \vartheta_\e \ast \rho^\delta. \end{equation*} The smooth functions $v^{\e,\delta}$ and $\vartheta^{\e,\delta}$ solve respectively the problems \begin{equation}\label{eq:VV_con_commutatore} \begin{cases} \partial_t v_{\e}^{\delta}+ \b \cdot \nabla v_{\e}^{\delta} = r_v^{\e,\delta} + \e\Delta v_{\e}^{\delta} & \text{ in } (0,T) \times \mathbb{T}^d \\ v_{\e}^{\delta}\vert_{t=0}=v_0^{\e,\delta} & \text{ in } \mathbb{T}^d \end{cases} \end{equation} and \begin{equation}\label{eq:VV_duale_forzante_con_commutatore} \begin{cases} -\partial_t \vartheta_{\e}^{\delta} - \b \cdot \nabla \vartheta_{\e}^{\delta} = r_\vartheta^{\e,\delta} + \e\Delta \vartheta_{\e}^{\delta} + \chi^\delta & \text{ in } (0,T) \times \mathbb{T}^d \\ \vartheta_{\e}^{\delta} \vert_{t=T}=0, & \text{ in } \mathbb{T}^d \end{cases} \end{equation} where \begin{equation*} \chi^\delta := \chi \ast \rho^\delta \end{equation*} and the commutators are defined as \begin{equation*} r_v^{\e,\delta} :=\b \cdot \nabla v_{\e}^{\delta} - (\b\cdot \nabla v_\e) \ast \rho^\delta \qquad \text { and } \qquad r_\vartheta^{\e,\delta} :=\b \cdot \nabla \vartheta_{\e}^{\delta} - (\b\cdot \nabla \vartheta_\e) \ast \rho^\delta. \end{equation*} Multiplying \eqref{eq:VV_con_commutatore} times $\vartheta_{\e}^{\delta}$, applying Fubini's Theorem and integrating by parts in time and space we obtain \begin{equation*} \begin{split} 0 & = \iint_{(0,T) \times \mathbb{T}^d} \left[ (\partial_t v_{\e}^{\delta})\vartheta_{\e}^{\delta}+ \b \cdot (\nabla v_{\e}^{\delta} )\vartheta_{\e}^{\delta} - r_v^{\e,\delta}\vartheta_{\e}^{\delta} - \e(\Delta v_\e)\vartheta_{\e}^{\delta} \right] \, \mathrm{d} t \mathrm{d} x \\ & = \iint_{(0,T) \times \mathbb{T}^d} v_{\e}^{\delta} \left[ - \partial_t \vartheta_{\e}^{\delta} - \b \cdot \nabla \vartheta_{\e}^{\delta} - \e \Delta \vartheta_{\e}^{\delta} \right] \, \mathrm{d} t\, \mathrm{d} x - \int_{\mathbb{T}^d} v^{\e,\delta}(0,x)\vartheta_{\e}^{\delta}(0,x)\, \mathrm{d} x\\ & \qquad -\iint_{(0,T) \times \mathbb{T}^d} r_v^{\e,\delta}\vartheta_{\e}^{\delta} \, \mathrm{d} t \mathrm{d} x\\ & \hspace{-.25cm}\overset{\eqref{eq:VV_duale_forzante_con_commutatore}}{=} \iint_{(0,T) \times \mathbb{T}^d} v_{\e}^{\delta} ( r_\vartheta^{\e,\delta} + \chi^\delta )\, \mathrm{d} t\, \mathrm{d} x - \int_{\mathbb{T}^d} v^{\e,\delta}(0,x)\vartheta_{\e}^{\delta}(0,x)\, \mathrm{d} x - \iint_{(0,T) \times \mathbb{T}^d} r_v^{\e,\delta}\vartheta_{\e}^{\delta} \, \mathrm{d} t \mathrm{d} x \\ & = \iint_{(0,T) \times \mathbb{T}^d} v_{\e}^{\delta} \chi^\delta\, \mathrm{d} t \mathrm{d} x + \iint_{(0,T) \times \mathbb{T}^d} (v_{\e}^{\delta} r_\vartheta^{\e,\delta} - r_v^{\e,\delta}\vartheta_{\e}^{\delta}) \, \mathrm{d} t\mathrm{d} x - \int_{\mathbb{T}^d} v^{\e,\delta}(0,x)\vartheta_{\e}^{\delta}(0,x)\, \mathrm{d} x \\ & =: \textrm{(I) + (II) + (III)}. \end{split} \end{equation*} Keeping $\e>0$ fixed, we now send $\delta \to 0$. The two commutators can be written in the form \begin{equation*} r_v^{\e, \delta}(t,x) = \int_{\mathbb{T}^d} v_\e(t,x+\delta y) \left[ \frac{\b(t,x+\delta y) - \b(t,x)}{\delta}\right] \cdot \nabla \rho(y) \,\mathrm{d} y \end{equation*} and \begin{equation*} r_\vartheta^{\e, \delta}(t,x) = \int_{\mathbb{T}^d} \vartheta_\e(t,x+\delta y) \left[ \frac{\b(t,x+\delta y) - \b(t,x)}{\delta}\right] \cdot \nabla \rho(y) \,\mathrm{d} y. \end{equation*} Since $v_\e,\vartheta_\e \in L^\infty((0,T); L^\infty(\mathbb{T}^d))$, arguing as in the proof of Proposition \ref{prop:parabolic_wp}, we can conclude that both $ r_v^{\e, \delta}$ and $r_\vartheta^{\e, \delta}$ converge to $0$ strongly in $L^1((0,T) \times \mathbb{T}^d)$ as $\delta \to 0$. This observation, combined with the uniform $L^\infty$ bounds on $v_{\e}^{\delta}$ and $\vartheta_{\e}^{\delta}$, shows that $\textrm{(II)} \to 0$ as $\delta \to 0$. For the term $\textrm{(I)}$, instead, we can use the strong convergence of $v_{\e}^{\delta} \to v_\e$ and the uniform convergence of $\chi^\delta \to \chi$. Finally, for $\textrm{(III)}$, by standard results about convolutions \begin{equation*} v^{\e,\delta}(0, \cdot ) \to v^{\e}_0 \end{equation*} strongly in $L^1(\mathbb{T}^d)$ as $\delta \to 0$; furthermore, we have \begin{equation*} \vartheta_{\e}^{\delta}(0,\cdot) \to \vartheta_{\e}(0,\cdot) \end{equation*} weakly$^*$ in $L^{\infty}(\mathbb{T}^d)$ as $\delta \to 0$. Such convergence follows from a standard argument in the framework of evolutionary PDEs (see e.g. \cite[Lemma 3.7]{DeLellisNote}) which establishes the weak continuity in time of the solutions to advection-diffusion or transport equations. Thus, for any $\e>0$, it holds \begin{equation*} \iint_{(0,T) \times \mathbb{T}^d} v_{\e}(t,x) \chi(t,x)\, \mathrm{d} t \mathrm{d} x = \int_{\mathbb{T}^d} v_0^\e(x)\vartheta_{\e}(0,x)\, \mathrm{d} x . \end{equation*} We now send $\e \to 0$, getting \begin{equation}\label{eq:one} \iint_{(0,T)\times \mathbb{T}^d} u^{\mathsf V} (t,x)\chi(t,x)\, \mathrm{d} t \mathrm{d} x = \int_{\mathbb{T}^d} u_0(x)\vartheta(0,x)\, \mathrm{d} x. \end{equation} In the last passage, we have used: \begin{itemize} \item $v^\e \rightharpoonup u^{\mathsf V}$ weakly in $L^\infty ((0,T); L^1(\mathbb{T}^d))$; \item $v^\e_0 \to u_0$ strongly in $L^1(\mathbb{T}^d)$; \item $\vartheta_{\e}(0,\cdot) \rightharpoonup \vartheta(0,\cdot)$ weakly$^*$ in $L^{\infty}(\mathbb{T}^d)$ by \eqref{eq:initial_datum_weak_continous}. \end{itemize} { \bf \emph{Step 4. Duality of the Lagrangian solution.}} A direct computation shows that the Lagrangian solution $u^{\mathsf L}$ satisfies \begin{equation}\label{eq:two} \begin{split} \iint_{(0,T) \times \mathbb{T}^d} u^{\mathsf L}(t,x) \chi(t,x)\, \mathrm{d} t \mathrm{d} x & = \iint_{(0,T) \times \mathbb{T}^d} u_0(\bm X_{t,0}(x)) \chi(t,x)\, \mathrm{d} t\mathrm{d} x \\ & =\int_0^T \int_{\mathbb{T}^d} u_0(y) \chi(t,\bm X_{0,t}(y))\, \mathrm{d} t \, \mathrm{d} y \\ & =\int_{\mathbb{T}^d} u_0(y) \int_0^T \chi(t,\bm X_{0,t}(y))\, \mathrm{d} t \, \mathrm{d} y \\ & \hspace{-.15cm} \overset{\eqref{eq:duhamel}}{=} \int_{\mathbb{T}^d} u_0(x)\vartheta(0,x)\, \mathrm{d} x . \end{split} \end{equation} Hence, comparing \eqref{eq:one} and \eqref{eq:two}, we obtain \begin{equation*} \iint_{(0,T) \times \mathbb{T}^d} (u^{\mathsf V}(t,x) - u^{\mathsf L}(t,x)) \chi(t,x)\, \mathrm{d} t\mathrm{d} x = 0. \end{equation*} Being $\chi\in C^\infty((0,T) \times \mathbb{T}^d)$ arbitrary, we have thus obtained $u^{\mathsf V} = u^{\mathsf L}$ a.e. and this concludes the proof. { \bf \emph{Step 5. Upgrade to strong convergence.}} The convergence of $(v^\e)_{\e>0}$ to the Lagrangian solution is strong in $C([0,T]; L^1(\mathbb{T}^d))$. This follows from \cite[Lemma 3.3]{CCS4}: indeed, the regularity assumption (H1') of \cite[Lemma 3.3]{CCS4} includes the case $\b\in L^1((0,T);W^{1,1}(\mathbb{T}^d))$, and the growth assumption (H2) is trivially satisfied as already remarked in Section 2. \end{proof} \begin{remark} If $u_0 \in L^2(\mathbb{T}^d)$, the same argument as in the proof of Theorem \ref{thm:main} gives that $(v_\e)_{\e}$ converges in $C([0,T]; L^2(\mathbb{T}^d))$ to the Lagrangian solution of \eqref{eq:transport}. In particular, from the identity \begin{equation*} \frac{1}{2}\Vert v_\e(t,\cdot) \Vert_{L^2}^2 + \e \int_0^t \Vert \nabla v_\e(s,\cdot)\Vert_{L^2}^2\mathrm{d} s = \frac{1}{2}\Vert v_\e(0,\cdot) \Vert_{L^2}^2 \end{equation*} valid for every $\e>0$ we deduce that \begin{equation*} \e \int_0^t \Vert \nabla v_\e(s,\cdot)\Vert_{L^2}^2\mathrm{d} s \to 0 \quad \text{as $\e \to 0$} \end{equation*} for every $t>0$. This means that \emph{no anomalous dissipation is possible} for the vanishing viscosity limit in the case $\b \in L^1((0,T);W^{1,1}(\mathbb{T}^d))$ and $u \in L^\infty((0,T); L^2(\mathbb{T}^d))$, even though the solution lacks the integrability required for the DiPerna-Lions' theory to apply. In a similar spirit, if $u_0 \in L^q(\mathbb{T}^d)$, we obtain that \begin{equation*} \Vert u(t,\cdot) \Vert_{L^q(\mathbb{T}^d)} = \Vert u_0 \Vert_{L^q(\mathbb{T}^d)}, \end{equation*} and more generally all Casimirs of the solution obtained as vanishing viscosity limit are conserved, that is for every $f$ and for every $t>0$ it holds \begin{equation*} \int_{\mathbb{T}^d} f(u(t,x))\, \mathrm{d} x = \int_{\mathbb{T}^d} f(u_0(x))\, \mathrm{d} x. \end{equation*} On the other hand, vector fields in the class $L^1((0,T);C^\alpha(\mathbb{T}^d))$, with $d\geq 2$ and $\alpha\in[0,1)$, may exhibit anomalous dissipation as shown in \cite{DEIJ}. \end{remark} \section{The vanishing viscosity scheme II: Stochastic flows and Lagrangian proof} \label{sec:lagrangian_proof} \subsection{Preliminaries on stochastic flows} We introduce the {\em stochastic Lagrangian} formulation of the system \eqref{eq:VV_2}. Let $(\Omega, (\mathcal{F}_t)_{t\geq 0}, \mathbb{P})$ be a given filtered probability space, and let $\bm W_t$ be a $\mathbb{T}^d$-valued Brownian motion adapted to the backward filtration, i.e. for any fixed $t\in[0,T]$ and any $s\in[0,t]$, the Brownian motion $\bm W_{s}$ is such that $\bm W_t=0$. We have the following definition. \begin{defn}[Stochastic flows]\label{def:sf} Let $\e>0$ and let $\b\in L^1((0,T);L^1(\mathbb{T}^d))$ be a divergence-free vector field. A map $\bm X^\e\colon (0,T)\times(0,T)\times\mathbb{T}^d\times\Omega\to \mathbb{T}^d$ is a {\em stochastic flow} of $\b$ if \begin{itemize} \item for any $t\in[0,T]$, for any $x\in \mathbb{T}^d$ and for a.e. $\omega\in\Omega$, the map $s \in [0,t] \mapsto \bm X^\e(t,s,x,\omega) = \bm X^\e_{t,s}(x,\omega)\in\mathbb{T}^d$ is a continuous solution to \begin{equation} \begin{cases} \mathrm{d} \bm X^\e_{t,s}(x,\omega)=\b(s,\bm X^\e_{t,s}(x,\omega))\mathrm{d} s + \sqrt{2\e}\, \mathrm{d} \bm W_s(\omega),\hspace{0.5cm}s\in[0,t),\\ \bm X^\e_{t,t}=x, \end{cases}\label{eq:sde} \end{equation} \item for any $t\in[0,T]$ and $s\in[0,t]$ and a.e. $\omega\in\Omega$ the map $x \in \mathbb{T}^d \mapsto \bm X^\e_{t,s}(x,\omega)\in\mathbb{T}^d$ is measure preserving. \end{itemize} \end{defn} The celebrated Feynman-Kac formula, see \cite{K}, gives an explicit representation of the solution $v_\e$ of \eqref{eq:VV_2} in terms of the stochastic flow of $\b$, that is \begin{equation*} v_\e(t,x)=\mathbb{E}[v_0^\e(\bm X^\e_{t,0}(x))], \end{equation*} where we have used the standard notation $\mathbb{E}[f]$ to denote the average with respect to $\mathbb{P}$, that is \begin{equation*} \mathbb{E}[f]:=\int_\Omega f(\omega)\mathrm{d} \mathbb{P}(\omega). \end{equation*} We remark that by considering a divergence-free vector field $\b\in L^1((0,T); W^{1,1}(\mathbb{T}^d))$ we have \emph{strong} existence and pathwise uniqueness for \eqref{eq:sde}: this means that we can construct a solution $\bm X^\e$ to \eqref{eq:sde} on any given filtered probability space equipped with any given adapted Brownian motion, see \cite{CJ}. We remark that, since we are working on the torus, the boundedness assumption in \cite{CJ} can be dropped. \subsection{The Lagrangian proof} In this subsection, we aim at giving another proof (exploiting Lagrangian tecnhiques) of the convergence of the vanishing viscosity scheme. In order to do that, we first establish some stability estimates between the stochastic and the deterministic flows. \begin{lem}\label{lem:stability-flows} Let $\b\in L^1((0,T);W^{1,p}(\mathbb{T}^d))$ be a divergence-free vector field, where $p\geq 1$. Let $\bm X, \bm X^\e$ be, respectively, the regular Lagrangian flow and the stochastic flow of $\b$. Then, \begin{itemize} \item[$(i)$] if $p=1$ and $\b\in L^q((0,T)\times\mathbb{T}^d)$ for some $q>1$, then for every $\gamma>0$ there exists a constant $C_\gamma$ such that for a.e. $t\in [0,T]$ and $s\in [0,t]$ \begin{equation} \label{est:p=1} \int_{\mathbb{T}^d}\mathbb{E}[\mathsf{d}(\bm X^\e_{t,s}(x),\bm X_{t,s}(x))]\mathrm{d} x\leq C(T,p)\left(\sqrt[4]{\e}+\frac{C_\gamma}{|\ln\e|}+\frac{1}{|\ln\sqrt{\e}|}\gamma\left[ 1+\ln^+ \left(\frac{\|\b\|_{L^q}}{\sqrt{\e}\gamma}\right) \right]\right). \end{equation} \item[$(ii)$] If $p>1$, there exists a constant $C(T,p)$ such that for a.e. $t\in [0,T]$ and $s\in [0,t]$ \begin{equation} \label{est:p>1} \int_{\mathbb{T}^d}\mathbb{E}[\mathsf{d}(\bm X^\e_{t,s}(x),\bm X_{t,s}(x))]\mathrm{d} x\leq C(T,p)\left(\sqrt[4]{\e}+\frac{\|\nabla \b\|_{L^1L^p}}{|\ln\e|} \right). \end{equation} \end{itemize} Moreover, the estimates \eqref{est:p=1}, \eqref{est:p>1} give the $L^1$-convengence of $\bm X^\e_{t,s}$ towards $\bm X_{t,s}$ as $\e\to 0$. \end{lem} \begin{proof} We divide the proof in several steps. {\bf \emph{Step 1. The case $p=1$. } }For any $t\in(0,T)$, a.e. $\omega\in\Omega$ and a.e. $x\in\mathbb{T}^d$, the difference of the flows $\bm X^\e-\bm X$ satisfies the following S.D.E. for $s\in[0,t]$ \begin{equation}\label{eq:difference} \begin{cases} \mathrm{d}(\bm X^\e_{t,s}(x,\omega)-\bm X_{t,s}(x))=(\b(s, \bm X^\e_{t,s}(x,\omega))-\b(s,\bm X_{t,s}(x)))\,\mathrm{d} s+\sqrt{2\e}\mathrm{d} \bm W_{s}(\omega),\\ \bm X^\e_{t,t}(x,\omega)-\bm X_{t,t}(x)=0. \end{cases} \end{equation} We define the function the function $q_{\delta}(y)=\ln\left(1+\frac{|y|^2}{\delta^2}\right)$ and the related functional $Q^\delta_\e$ as \begin{equation}\label{def:Qdelta} Q^\delta_\e(t,s,x,\omega):=q_{\delta}(\bm X^\e_{t,s}(x,\omega)-\bm X_{t,s}(x))=\ln\left(1+\frac{|\bm X^\e_{t,s}(x,\omega)-\bm X_{t,s}(x)|^2}{\delta^2}\right), \end{equation} where $\delta>0$ is a fixed parameter that will be chosen later. An application of It\^{o}'s formula gives that \begin{align*} \int_{\mathbb{T}^d} \mathbb{E}\left[Q^\delta_\e(t,s,x)\right]\mathrm{d} x&=\int_s^t\int_{\mathbb{T}^d} \mathbb{E}\left[\nabla_{y} q_\delta(t,\tau,\bm X^\e_{t,\tau}(x)-\bm X_{t,\tau}(x))\cdot\left(\b(\tau,\bm X^\e_{t,\tau}(x))-\b(\tau,\bm X_{t,\tau}(x)) \right)\right]\mathrm{d} x\mathrm{d} \tau\\ &+\e\int_s^t\int_{\mathbb{T}^d} \mathbb{E}\left[\nabla_{y}^2 q_\delta(t,\tau,\bm X^\e_{t,\tau}(x)-\bm X_{t,\tau}(x))\right]\mathrm{d} x\mathrm{d} \tau, \end{align*} and from the inequalities $$ \left| \nabla \ln\left(1+\frac{|y|^2}{\delta^2} \right)\right|\leq\frac{C}{\delta+|y|}, \hspace{0.7cm}\left| \nabla^2 \ln\left(1+\frac{|y|^2}{\delta^2}\right)\right|\leq\frac{C}{\delta^2+|y|^2}, $$ we obtain the following bound \begin{equation}\label{est:q} \int_{\mathbb{T}^d} \mathbb{E}\left[Q^\delta_\e(t,s,x)\right]\mathrm{d} x\leq \frac{\e (t-s)}{\delta^2}+C\int_s^t\int_{\mathbb{T}^d} \mathbb{E}\left[\frac{\left| \b(\tau,\bm X^\e_{t,\tau}(x))-\b(\tau,\bm X_{t,\tau}(x)) \right|}{\delta+\left| \bm X^\e_{t,\tau}(x)-\bm X_{t,\tau}(x)\right|}\right]\mathrm{d} x\mathrm{d} \tau. \end{equation} We now use the characterization of the equi-integrability as in Lemma \ref{lem:decomposition-equi}. We fix $r>1$ and let $\gamma>0$ a parameter that will be chosen later. Then, using Lemma \ref{lem:decomposition-equi} we decompose $\nabla\b$ as $$ |\nabla \b|=g_1^\gamma+g_2^\gamma, $$ with \begin{equation*} \|g_1^\gamma\|_{L^1}\leq \gamma,\hspace{0.5cm}\|g_2^\gamma\|_{L^r}\leq C_\gamma, \end{equation*} where the constant $C_\gamma$ is increasing as $\gamma\to 0$. Finally, we introduce the function \begin{equation*} \varphi(t,s,x,\omega):=\min\left\{ \frac{|\b(s,\bm X^\e_{t,s}(x,\omega))|+|\b(s,\bm X_{t,s}(x))|}{\delta}; g_1^\gamma(s,\bm X^\e_{t,s}(x,\omega))+ g_1^\gamma(s,\bm X_{t,s}(x))\right\}. \end{equation*} Going back to \eqref{est:q}, using the definition of $\varphi$, we get that \begin{align*} & \int_s^t\int_{\mathbb{T}^d}\mathbb{E}\left[\frac{\left| \b(\tau,\bm X^\e_{t,\tau}(x))-\b(\tau,\bm X_{t,\tau}(x)) \right|}{\delta+\left| \bm X^\e_{t,\tau}(x)-\bm X_{t,\tau}(x)\right|}\right]\mathrm{d} x\mathrm{d} \tau \\ \leq & \int_s^t\int_{\mathbb{T}^d} \mathbb{E}\left[ \varphi(t,\tau,x)\right] \mathrm{d} x \mathrm{d} \tau \\ & +\int_s^t\int_{\mathbb{T}^d} \mathbb{E} \left[g_2^\gamma(\tau,\bm X^\e_{t,\tau}(x))+ g_2^\gamma(\tau,\bm X_{t,\tau}(x))\right] \mathrm{d} x \mathrm{d} \tau. \end{align*} Since $g_2^\gamma\in L^r((0,T)\times\mathbb{T}^d)$, by Holder inequality we have that \begin{equation}\label{g2} \int_s^t\int_{\mathbb{T}^d}\mathbb{E}\left[g_2^\gamma(\tau,\bm X^\e_{t,\tau}(x))+ g_2^\gamma(\tau,\bm X_{t,\tau}(x))\right] \mathrm{d} x \mathrm{d} \tau\leq 2T^{(r-1)/r}C_\gamma. \end{equation} We now want to apply the interpolation inequality of Lemma \ref{lem:interp} to $\varphi$: first, by using the measure preserving property of $\bm X$ and $\bm X^\e$, we have that \begin{equation}\label{est:phi1} \|\varphi\|_{L^q}\leq \frac{C}{\delta}\|\b\|_{L^q}. \end{equation} Secondly, by Chebishev inequality \begin{equation}\label{est:phi2} ||| \varphi |||_{M^1((0,T)\times(0,T)\times\mathbb{T}^d\times\Omega)}\leq C |||g_1^\gamma|||_{M^1((0,T)\times \mathbb{T}^d)}\leq C \|g_1^\gamma\|_{L^1((0,T)\times \mathbb{T}^d)}. \end{equation} We apply Lemma \ref{lem:interp} to $\varphi$. The fact that the function $z\in[0,\infty)\mapsto z\left[1+\ln^+\left(\frac{C}{z}\right)\right]\in[0,\infty)$ is non-decreasing (where $\ln^+(w) := \max\{0,\ln(w)\}$ for every $w \ge 0$) and the bounds \eqref{est:phi1} and \eqref{est:phi2}, give \begin{equation}\label{phi} \|\varphi\|_{L^1((0,T)\times(0,T)\times\mathbb{T}^d\times\Omega)}\leq C\frac{q}{q-1} \|g_1^\gamma\|_{L^1}\left[ 1+\ln^+\left(\frac{\|\b\|_{L^q}}{\|g_1^\gamma\|_{L^1}}\frac{T^{1-\frac{1}{q}}}{\delta}\right) \right]. \end{equation} Substituting \eqref{g2} and \eqref{phi} in \eqref{est:q} we finally obtain \begin{equation*} \int_{\mathbb{T}^d} \mathbb{E}\left[Q^\delta_\e(t,s,x)\right]\mathrm{d} x\leq \frac{\e T}{\delta^2}+2T^{(r-1)/r}C_\gamma+\frac{Cq}{q-1}\gamma\left[ 1+\ln^+\left(\frac{\|\b\|_{L^q}T^{1-\frac{1}{q}}}{\delta\gamma}\right) \right]. \end{equation*} Next, by defining \begin{equation}\label{def:Adelta} A_\delta(t,s):=\left\{(x,\omega)\in \mathbb{T}^d\times\Omega:\mathsf{d}(\bm X^\e_{t,s}(x,\omega),\bm X_{t,s}(x))> \sqrt{\delta}\right\}, \end{equation} we obtain that \begin{align} \label{est:stab} \sup_{t,s\in(0,T)}\left(\mathscr{L}^d\otimes\mathbb{P}\right)\left(A_\delta(t,s)\right)&\leq \frac{C}{|\ln\delta|}\int_{\mathbb{T}^d} \mathbb{E}\left[\ln\left(1+\frac{(\mathsf{d}(\bm X^\e_{t,s}(x),\bm X_{t,s}(x)))^2}{\delta^2}\right)\right]\mathrm{d} x\\ \nonumber&\leq \frac{C}{|\ln\delta|}\int_{\mathbb{T}^d} \mathbb{E}\left[Q^\delta_\e(t,s)\right]\mathrm{d} x\\ \nonumber&\leq C(T,q,r)\left( \frac{\e }{\delta^2|\ln\delta|}+\frac{C_\gamma}{|\ln\delta|}+\frac{1}{|\ln\delta|}\gamma\left[ 1+\ln^+\left(\frac{\|\b\|_{L^q}}{\delta \gamma}\right) \right]\right), \end{align} where we have used that $\mathsf{d}(x,y)\leq |x-y|$ for any $x,y\in\mathbb{T}^d$. Therefore, \begin{equation} \label{eq:split} \begin{split} \int_{\mathbb{T}^d}\mathbb{E}[\mathsf{d}(\bm X^\e_{t,s}(x),\bm X_{t,s}(x))]\mathrm{d} x\ = &\int_{(\mathbb{T}^d\times\Omega)\setminus A_\delta(t,s)}\mathsf{d}(\bm X^\e_{t,s}(x,\omega),\bm X_{t,s}(x))\mathrm{d} \mathbb{P}(\omega)\mathrm{d} x\\ & + \int_{A_\delta(t,s)}\mathsf{d}(\bm X^\e_{t,s}(x,\omega),\bm X_{t,s}(x))\mathrm{d} \mathbb{P}(\omega)\mathrm{d} x\\ \leq & \sqrt{\delta}+\left(\mathscr{L}^d\otimes\mathbb{P}\right)\left(A_\delta(t,s)\right) \end{split} \end{equation} where we have used that $\mathscr{L}^d \otimes\mathbb{P}$ is a probability measure on $\mathbb{T}^d\times\Omega$ and the distance $\mathsf{d}$ on the torus is bounded. Finally, we choose $\delta=\sqrt{\e}$ and plugging \eqref{est:stab} in \eqref{eq:split}, we get that \begin{equation*} \label{eq:exp_dist} \int_{\mathbb{T}^d}\mathbb{E}[\mathsf{d}(\bm X^\e_{t,s}(x),\bm X_{t,s}(x))]\mathrm{d} x\leq C(T,q,r)\left(\sqrt[4]{\e}+\frac{C_\gamma}{|\ln\e|}+\frac{1}{|\ln\sqrt{\e}|}\gamma\left[ 1+\ln^+ \left(\frac{\|\b\|_{L^q}}{\sqrt{\e}\gamma}\right) \right]\right), \end{equation*} and this concludes the proof of the estimate \eqref{est:p=1}. { \bf \emph{Step 2. The case $p>1$.}} The proof easily follows from the arguments of Step 1. Since $\nabla\b(t,\cdot)\in L^p(\mathbb{T}^d)$ for a.e. $t\in(0,T)$, we apply Lemma \ref{lem:decomposition-equi} pointwise in time choosing $r=p$, $g_1^\gamma=0$, $\gamma=0$, $g_2^\gamma(t,\cdot)=|\nabla\b(t,\cdot)|$ and $C_\gamma(t)=\|\nabla\b(t,\cdot)\|_{L^p}$. In particular, note that the bound in \eqref{g2} changes into \begin{equation*} \int_s^t\int_{\mathbb{T}^d}\mathbb{E}\left[g_2^\gamma(\tau,\bm X^\e_{t,\tau}(x))+ g_2^\gamma(\tau,\bm X_{t,\tau}(x))\right] \mathrm{d} x \mathrm{d} \tau\leq 2\|C_\gamma\|_{L^1}=2\|\nabla\b\|_{L^1L^p}, \end{equation*} and by substituting in \eqref{est:p=1} we get \eqref{est:p>1}. {\bf \emph{Step 3. Convergence of the flows.}} We now prove the convergence of $X^\e_{t,s}$ towards $X_{t,s}$ as $\e\to 0$. If $p>1$ it follows directly by \eqref{est:p>1} by letting $\e\to 0$. Then we analyze the case $(i)$: the strategy is to choose properly the parameter $\gamma$ in \eqref{est:p=1} independently from $\e$. In this regards, note that the last term on the right hand side of \eqref{est:p=1} is uniformly bounded in $\gamma$ for $\e$ small and converges to $0$ as $\gamma\to 0$. Hence, for any given $\eta>0$ there exists $\gamma_0$ independent from $\e$ such that for all $\gamma\leq \gamma_0$ \begin{equation*} \frac{C(T,q,r)}{|\ln\sqrt{\e}|}\gamma\left[ 1+\ln^+ \left(\frac{\|\b\|_{L^q}}{\sqrt{\e}\gamma}\right)\right]< \frac{\eta}{3}. \end{equation*} Now that the constant $\gamma$ is fixed, and so is $C_\gamma$, we can infer that there exists $\e_0(M)>0$ such that for all $\e\leq \e_0(\gamma)$ \begin{equation*} C(T,q)\left(\sqrt[4]{\e}+\frac{C_\gamma}{|\ln\e|}\right)<\frac{2}{3}\eta, \end{equation*} and this concludes the proof of the convergence of the flows. \end{proof} The convergence result for $\e\to 0$ to the Lagrangian solution reads as follows: \begin{thm}\label{thm:main2} Let $\b \in L^1((0,T); W^{1,1}(\mathbb{T}^d))\cap L^q((0,T)\times\mathbb{R}^d)$ be a divergence-free vector field for some $q>1$ and let $u_0 \in L^1(\mathbb{T}^d)$ be a given initial datum. Let $(v_0^\e)_\e \subset L^\infty(\mathbb{T}^d)$ be \emph{any} sequence of functions such that $v_0^\e \to u_0$ strongly in $L^1(\mathbb{T}^d)$. Then the sequence $(v_\e)_{\e>0} \subset L^\infty((0,T); L^\infty(\mathbb{T}^d)) \cap L^2((0,T); H^1(\mathbb{T}^d))$ of solutions to \eqref{eq:VV_2} converges in $C([0,T];L^1(\mathbb{T}^d))$ to the (unique) Lagrangian solution to \eqref{eq:transport_in_vv}. \end{thm} \begin{proof} First of all, from Proposition \ref{prop:parabolic_wp} we deduce that for every fixed $\e>0$ there exists a unique function $v_\e \in L^\infty((0,T); L^\infty(\mathbb{T}^d)) \cap L^2((0,T); H^1(\mathbb{T}^d))$ solving \eqref{eq:VV_2}. Moreover, by the Feynman-Kac formula we know that $v_\e$ satisfies $$ v_\e(t,x)=\mathbb{E}[v_0^\e(\bm X^\e_{t,0}(x))]. $$ On the other hand, the Lagrangian solution to \eqref{eq:transport_in_vv} is given by $$ u^{\mathsf L}(t,x)=u_0(\bm X_{t,0}(x)). $$ Having both $v_\e$ and $u^{\mathsf L}$ a representation formula in terms of the flow, we use the stability of the flows to prove the convergence in the inviscid limit. We consider a sequence $u_0^n$ of Lipschitz approximations of $u_0$, then for any $t\in(0,T)$ we have that \begin{equation*} \begin{aligned} \|v_\e(t,\cdot)-u^{\mathsf L}(t,\cdot)\|_{L^1}&=\|\mathbb{E}[v_0^\e(\bm X^\e_{t,0})]-u_0(\bm X_{t,0})\|_{L^1}\\ &\leq\int_{\mathbb{T}^d}\int_\Omega |v_0^\e(\bm X^\e_{t,0}(x,\omega))-u_0(\bm X^\e_{t,0}(x,\omega))|\mathrm{d}\mathbb{P}(\omega)\mathrm{d} x\\ &+\int_{\mathbb{T}^d}\int_\Omega |u_0^n(\bm X^\e_{t,0}(x,\omega))-u_0(\bm X^\e_{t,0}(x,\omega))|\mathrm{d}\mathbb{P}(\omega)\mathrm{d} x\\ &+\int_{\mathbb{T}^d}|u_0^n(\bm X_{t,0}(x))-u_0(\bm X_{t,0}(x))|\mathrm{d} x\\ &+\int_{\mathbb{T}^d}\int_\Omega |u_0^n(\bm X^\e_{t,0}(x,\omega))-u_0^n(\bm X_{t,0}(x))|\mathrm{d}\mathbb{P}(\omega)\mathrm{d} x. \end{aligned} \end{equation*} In particular, by using that $u_0^n$ is Lipschitz and the measure preserving property of the flows, we get that \begin{equation}\label{est:final-main2} \|v_\e(t,\cdot)-u^{\mathsf L}(t,\cdot)\|_{L^1}\leq\|v_0^\e-u_0\|_{L^1}+2\|u_0^n-u_0\|_{L^1}+C_n\|\mathbb{E}[\mathsf{d}(\bm X^\e_{t,0},\bm X_{t,0})]\|_{L^1}. \end{equation} We first fix $n$ big enough, independently from $t$ and $\e$, in order to make the second term in \eqref{est:final-main2} as small as we want. Then the conclusion follows from Lemma \ref{lem:stability-flows}. \end{proof} \section{Rates of convergence} The goal of this section is to show that Lagrangian techniques are particularly useful in order to obtain explicit rates of convergence for the vanishing viscosity limit. To find such rates, we need slightly stronger integrability/regularity assumptions on the data. The first result deals with bounded initial data. \begin{prop}\label{thm:rate} Let $\b\in L^1((0,T);W^{1,p}(\mathbb{T}^d))$ be a divergence-free vector field with $p>1$ and $u_0\in L^\infty(\mathbb{T}^d)$ be a given initial datum. Let $(v_0^\e)_\e \subset L^\infty(\mathbb{T}^d)$ be \emph{any} sequence of functions such that $v_0^\e \to u_0$ strongly in $L^1(\mathbb{T}^d)$ and consider $v^\e$ and $u$ be, respectively, the unique solutions of \eqref{eq:VV_2} and \eqref{eq:transport_in_vv} with initial datum $v_0^\e$ and $u_0$. Then, there exist $\bar{\e}$ and a continuous function $\phi_{u_0}:\mathbb{R}^+\to\mathbb{R}^+$ with $\phi_{u_0}(0)=0$, such that for any $1\leq q<\infty$ \begin{equation}\label{rate-modulo} \sup_{t\in(0,T)}\|v_\e(t,\cdot)-u(t,\cdot)\|_{L^q}\leq C(T,p,q,\|u_0\|_{L^\infty},\|\nabla\b\|_{L^1L^p})\left( \delta(\e)+\frac{1}{|\ln \delta(\e)|} +\phi_{u_0}(\delta(\e))\right)^{1/q}, \end{equation} for any $\e\leq \bar{\e}$, where \begin{equation}\label{def:delta} \delta(\e):=\max\{\sqrt{\e},\|v_0^\e-u_0 \|_{L^1}\}. \end{equation} \end{prop} \begin{proof} We show the estimate \eqref{rate-modulo} in the case $q=1$, the general case will follow by a straightforward interpolation of the spaces $L^1(\mathbb{T}^d)$ and $L^\infty(\mathbb{T}^d)$. Since $u_0\in L^\infty(\mathbb{T}^d)\subset L^1(\mathbb{T}^d)$, using the continuity of translations in $L^1$ we can infer that there exists a continuous function $\phi_{u_0}$ as in the statement of the theorem and $h_0>0$ such that \begin{equation*} \|u_0(\cdot+h)-u_0\|_{L^1}\leq \phi_{u_0}(h),\hspace{0.5cm}\mbox{for all }h\leq h_0. \end{equation*} Then, for any $\delta\leq h_0$, we can compute \begin{equation*} \begin{aligned} \|v_\e(t,\cdot)-u(t,\cdot)\|_{L^1}&=\|\mathbb{E}[v_0^\e(\bm X^\e_{t,0})]-u_0(\bm X_{t,0})\|_{L^1}\\ &\leq \|\mathbb{E}[v_0^\e(\bm X^\e_{t,0})]-u_0(\bm X^\e_{t,0})\|_{L^1}\\ &+\iint_{A_\delta(t,0)} |u_0(\bm X^\e_{t,0}(x,\omega))-u_0(\bm X_{t,0}(x))|\mathrm{d}\mathbb{P}(\omega)\mathrm{d} x\\ &+\iint_{(\mathbb{T}^d\times\Omega)\setminus A_\delta(t,0)} |v_0^\e(\bm X^\e_{t,0}(x,\omega))-u_0(\bm X_{t,0}(x))|\mathrm{d}\mathbb{P}(\omega)\mathrm{d} x\\ &\leq \|v_0^\e-u_0 \|_{L^1}+2\|u_0\|_{L^\infty}\mathscr{L}^d\otimes\mathbb{P}(A_\delta(t,0))+\phi_{u_0}(\delta)\\ &\leq \|v_0^\e-u_0 \|_{L^1}+2C(T,p)\|u_0\|_{L^\infty} \left( \frac{\e}{\delta^2|\ln\delta|}+\frac{\|\nabla \b\|_{L^1L^p}}{|\ln\delta|}\right)+\phi_{u_0}(\delta), \end{aligned} \end{equation*} where the set $A_\delta$ is defined as in \eqref{def:Adelta} and in the last line we have used the estimate in Lemma \ref{lem:stability-flows}. The proof follows by choosing $\delta(\e)$ as in \eqref{def:delta} and $\delta(\bar{\e})=h_0$. \end{proof} It is clear that the rate provided by Proposition \ref{thm:rate} is not completely explicit for two reasons: on the one hand, the convergence of the initial datum depends upon the choice of the approximation $v^\e_0$; on the other hand, the function $\phi_{u_0}$ is implicitly related to the regularity of the initial datum. For the former issue, since we deal with bounded initial datum, existence and uniqueness of solutions of \eqref{eq:ad} and \eqref{eq:transport} are guaranteed by Proposition \ref{prop:parabolic_wp} and \cite{DPL}, thus we do not need the approximating sequence $v_0^\e$. Concerning the latter issue, the function $\phi_{u_0}$ can be explicitly constructed once the regularity of $u_0$ is known. Motivated by the results in \cite{BN}, we provide the following example. \begin{cor}\label{cor:rate} Let $u_0\in H^1(\mathbb{T}^d)$. Assume that the hypothesis of Theorem \ref{thm:rate} hold with $v_0^\e=u_0$. Then, \begin{equation}\label{rate_bn} \sup_{t\in(0,T)}\|v_\e(t,\cdot)-u(t,\cdot)\|_{L^2}\leq \frac{C}{\sqrt{|\ln\e|}}, \end{equation} where the constant $C>0$ depends on $T,p,\|u_0\|_{L^\infty},\|\nabla u_0\|_{L^2},\|\nabla \b\|_{L^1L^p}$. \end{cor} \begin{proof} It is enough to compute the function $\phi_{u_0}$. We have that \begin{align*} \|u_0(\cdot+h)-u_0\|_{L^2}\leq h \|\nabla u_0\|_{L^2}, \end{align*} and then we conclude by applying Proposition \ref{thm:rate} with $\delta=\sqrt{\e}$ and $\phi_{u_0}(\delta)=\delta \|\nabla u_0\|_{L^2}$. \end{proof} It is interesting to compare the rate given by Corollary \ref{cor:rate} and the one in \cite[Theorem 3.3]{BN}. Under the same assumption on the initial datum, Corollary \ref{cor:rate} provides a rate of convergence for a more general class of vector fields, namely $\b\in L^1((0,T);W^{1,p}(\mathbb{T}^d))$ with $p>1$ instead of $\b\in L^\infty((0,T);W^{1,p}(\mathbb{T}^d))$ with $p>2$. On the other hand, we do not improve completely the rate in \cite{BN}: the rate in \eqref{rate_bn} is better if $2\leq p\leq 3$, while it is worst for $p>3$. We also observe that a key tool in \cite{BN} is a propagation-of-regularity result, which is not needed in our argument.\\ We finally show how with these techniques it is possible to give a quantitative stability estimate for advection-diffusion equations. We address this issue motivated by the recent results in \cite{S21}: \begin{lem}\label{lem:stability-stoc-flows} Let $\b\in L^1((0,T);W^{1,p}(\mathbb{T}^d))$ be a divergence-free vector field, where $p>1$. Let $\bm X^{\e_1}_{t,s},\bm X^{\e_2}_{t,s}$ be the stochastic flows of $\b$ associated respectively to $\e_1,\e_2>0$. Then, \begin{equation} \int_{\mathbb{T}^d}\mathbb{E}[\mathsf{d}(\bm X^{\e_1}_{t,s}(x),\bm X^{\e_2}_{t,s}(x))]\mathrm{d} x\leq C(T,p)\left( \sqrt[4]{|\e_1-\e_2|}+\frac{\|\nabla \b\|_{L^1L^p}}{|\ln|\e_1-\e_2||} \right). \end{equation} \end{lem} \begin{proof} We just sketch the proof since it follows the same computations of Step 2 in Lemma \ref{lem:stability-flows}. Notice that the S.D.E. solved by the difference $\bm X^{\e_1}_{t,s}-\bm X^{\e_2}_{t,s}$ is \begin{equation*} \begin{cases} \mathrm{d}(\bm X^{\e_1}_{t,s}(x,\omega)-\bm X^{\e_2}_{t,s}(x,\omega))=(\b(s, \bm X^{\e_1}_{t,s}(x,\omega))-\b(s,\bm X^{\e_2}_{t,s}(x,\omega)))\,\mathrm{d} s+(\sqrt{2\e_1}-\sqrt{2\e_2})\mathrm{d} \bm W_{s}(\omega),\\ \bm X^{\e_1}_{t,t}(x,\omega)-\bm X^{\e_2}_{t,t}(x,\omega)=0. \end{cases} \end{equation*} Then, by defining the function $q_{\delta}(y)=\ln\left(1+\frac{|y|^2}{\delta^2}\right)$ and the related $Q^\delta_{\e_1,\e_2}$ as \begin{equation*} Q^\delta_{\e_1,\e_2}(t,s,x,\omega):=q_\delta(\bm X^{\e_1}_{t,s}(x,\omega)-\bm X^{\e_2}_{t,s}(x,\omega))=\ln\left(1+\frac{|\bm X^{\e_1}_{t,s}(x,\omega)-\bm X^{\e_2}_{t,s}(x,\omega)|^2}{\delta^2}\right), \end{equation*} when we apply It\^{o}'s formula the contribution of the stochastic part is different, namely \begin{equation*} \int_{\mathbb{T}^d} \mathbb{E}\left[Q^\delta_{\e_1,\e_2}(t,s,x)\right]\mathrm{d} x\leq \frac{|\e_1-\e_2| (t-s)}{\delta^2}+C\int_s^t\int_{\mathbb{T}^d} \mathbb{E}\left[\frac{\left| \b(\tau,\bm X^{\e_1}_{t,\tau}(x))-\b(\tau,\bm X^{\e_2}_{t,\tau}(x)) \right|}{\delta+\left| \bm X^{\e_1}_{t,\tau}(x)-\bm X^{\e_2}_{t,\tau}(x)\right|}\right]\mathrm{d} x\mathrm{d} \tau. \end{equation*} The conclusion follows by defining the set $A_\delta$ as \begin{equation*} A_\delta(t,s):=\left\{(x,\omega)\in \mathbb{T}^d\times\Omega:\mathsf{d}(\bm X^{\e_1}_{t,s}(x,\omega),\bm X^{\e_2}_{t,s}(x,\omega))> \sqrt{\delta}\right\}, \end{equation*} and doing the same computations as in Step 2 of Lemma \ref{lem:stability-flows}. \end{proof} Then, the estimate on the flows yields the following rate of convergence for the solutions of \eqref{eq:ad}. \begin{prop}\label{prop:rate-ad} Let $\b\in L^1((0,T);W^{1,p}(\mathbb{T}^d))$ be a divergence-free vector field with $p>1$ and $u_0\in L^\infty(\mathbb{T}^d)$. Let $\e_n$ be a sequence such that $\e_n\to\e>0$ and let $v_{\e_n},v_\e$ the unique solutions of \eqref{eq:VV_2} with initial datum $u_0$ and viscosity $\e_n,\e$ , respectively. Then, there exist $N(u_0,T)$ and a continuous function $\phi_{u_0}:\mathbb{R}^+\to\mathbb{R}^+$ with $\phi_{u_0}(0)=0$, such that \begin{equation}\label{def:rate-stab-ad} \sup_{t\in(0,T)}\|v_{\e_n}(t,\cdot)-v_\e(t,\cdot)\|_{L^1}\leq C\left(\frac{1}{|\ln |\e_n-\e||} +\phi_{u_0}\left(\sqrt{|\e_n-\e|}\right)\right), \end{equation} for any $n\geq N(u_0,T)$, where the constant $C$ depends upon $T,p,\|u_0\|_{L^\infty},$ and $\|\nabla\b\|_{L^1L^p}$. \end{prop} \begin{proof} The proof follows by arguing exactly as in the one of Proposition \ref{prop:rate-ad} and using Lemma \ref{lem:stability-stoc-flows}. \end{proof} One can compare the rate given by Proposition \ref{prop:rate-ad} with the ones in \cite{LiLuo} and \cite{S21}. The rate in \eqref{def:rate-stab-ad} depends upon $\phi_{u_0}$ and cannot be better than $O\left( \frac{1}{|\ln|\e_n-\e||} \right)$, but provides convergence in the {\em strong} norm $C([0,T];L^1(\mathbb{T}^d))$. On the other hand, the rates of \cite{LiLuo} and \cite{S21} are of order $\sqrt{|\e_n-\e|}$ and $|\e_n-\e|$, respectively, but they are given for a logarithmic distance which instead metrizes {\em weak} convergence.
\section{Introduction} Turbulence remains one of the oldest and most challenging research problems in both pure and applied science; the high Reynolds number limit of the Navier-Stokes equations is of particular interest and developments in scientific computing are useful in advancing the frontiers of our understanding of fluid dynamics in a highly nonlinear regime. Efficient and precise numerical schemes for simulating incompressible inviscid fluids in three-dimensional space are an essential component, however the multiscale nature of turbulent flows along with the computationally demanding high dimensionality requires the development of specialized algorithms. Different directions have been pursued so far. Among the Eulerian ansatz using a fixed computational grid, Fourier pseudo-spectral methods are certainly very attractive discretizations \cite{ishihara2009}, requiring nevertheless some viscous or hyperviscous regularization, see e.g. the discussion in \cite{farge2017euler}. However one drawback of Eulerian schemes is the Courant-Friedrichs-Lewy (CFL) condition which constraints the size of time steps in relation to the spatial discretization scales. This implies that the complexity of the simulations with $N$ grid points in each spatial direction is proportional to $N^4$ or even worse \cite{schneider2013cfl}. The progress of high-resolution numerical simulation using Fast Fourier Transforms is hence limited and directly linked to the development of supercomputers following Moore’s law. Furthermore, Eulerian methods are also prone to artificial dissipation and special care needs to be taken in the spatial resolution of the solution and when using spectral dealiasing, a comparative study of spatial discretization methods for the Euler equations can be found in \cite{grafke2008numerical}. Generally, high-resolution computational grids are needed to reduce the effects of dissipation, currently pseudo-spectral simulations with up to $12288^3$ grid points can be performed \cite{ishihara2020second}. The Lagrangian ansatz, and in particular the semi-Lagrangian approach which combines Lagrangian time integration with Eulerian grids, does not suffer from a time-step restriction due to the CFL condition, see e.g. Staniforth and C\^ot\'e \cite{staniforth1991semi} (1991) and references therein. Hence they are well suited for advection-dominated problems. Purely Lagrangian approaches include the vortex blobs methods \cite{chorin1973numerical, beale1982vortex, hou1990convergence, pelz1997locally, cottet2000vortex, oliver2001vortex}, and the vortex particle and filament methods \cite{rosenhead1932point, hou1990convergence, cottet1991convergence, winckelmans1993contributions, rossinelli2010gpu}. These methods are characterized by a particle-based discretization of the vorticity field; the motion of the fluid is idealized as the transport of a collection of point vortices or compactly supported vortex blobs and the velocity of each particle can be computed from vortices using the Biot-Savart law. These methods are inherently spatially adaptive since the representation of the vorticity field is reduced to a collection of point vortices concentrated where the vorticity is important. Furthermore, they are more effective in avoiding artificial viscous dissipation compared to their Eulerian counterparts. Some drawbacks include the difficulty in the representation and controlled resolution of Eulerian quantities. Methods for transferring Lagrangian quantities to fixed Eulerian grids include the vortex-in-cell methods \cite{christiansen1973numerical, couet1981simulation, cottet2004advances, sbalzarini2006ppm} and the Cauchy-Lagrangian frameworks \cite{frisch}. Various Eulerian or semi-Lagrangian methods have been used to provide evidence of singularity for the 3D Euler equations \cite{ashurst1987numerical, grauer1998adaptive, bustamante20083d, hou2018potential} or nonsingular super-exponential growth in the maximum vorticity \cite{pumir1990collapsing, brachet1992numerical, hou2006dynamic}. For instance a pseudospectral computation of an axisymmetric solution suggesting finite-time blow-up was performed by Kerr in 1993 \cite{kerr1993evidence}. Some recent computations including new test cases for potential singularities in 3D Euler have been proposed in \cite{moffatt2020towards, yao2020physical}. The work in this paper can be seen as a proof of concept for a novel semi-Lagrangian numerical method, which allows a very detailed investigation of singularities in 3D Euler. To this end we propose a geometric method for the 3D incompressible Euler equations in its vorticity form. The method uses the numerical framework of the Gradient-Augmented Level-Set methods \cite{nave2010gradient} and Reference Map methods \cite{kohno2013new} and consists in a semi-Lagrangian discretization of the backward flow map, called the characteristic map, generated by the velocity field. This is based on a previous work on the 2D incompressible Euler equations using the Characteristic Mapping method \cite{CME}, which we extend and generalize here to the three-dimensional case. Compared to the 2D equations, the 3D Euler equations present several significant challenges. Firstly, the presence of an additional vortex stretching term requires a more geometric formulation of the CM method in order to be seamlessly incorporated in the framework: a direct treatment of the vortex stretching as a source term would not conform to the characteristic structure of the method, nullifying its numerical qualities. Secondly, due to the vortex stretching term, we no longer have conservation of any $L^p$ norms, including the $L^\infty$ norm. Indeed, in the 2D case, the scalar vorticity is an advected quantity with infinitely many Casimir invariants, which can be preserved numerically \cite{bowman2015fully}, and small scale features appear only from rapid growth in vorticity gradient. In the 3D case, the question of finite-time blow-up in the solutions of incompressible Euler equations with smooth initial data is a notoriously difficult open problem in the theory of PDEs and is related to the Clay institute Millenium problem on the Navier-Stokes equations \cite{fefferman2006}. From a numerical point of view, the rapid growth in both the magnitude of the vorticity and its gradient further increases the difficulty in providing sufficient spatial resolution of the solution. For the CM method, the dependency of vorticity on the spatial deformations or rate of strain tensor would then involve the Jacobian of the characteristic map in the computation of the vorticity, thus increasing the regularity requirements on the method. Lastly, the higher dimensionality further emphasizes on the computational efficiency of the method and on high order accuracy. The rest of the paper is organized as follows: in section \ref{sec:mathForm} we recall the CM framework presented in \cite{CME} and generalize it through a geometric reformulation in the context of the 3D incompressible Euler equations. In section \ref{sec:numImpl}, we provide some details on the numerical implementation of the method together with formal error estimates supported by convergence tests. Section \ref{sec:numTests} contains numerical tests and discussions; In particular we simulate the anti-parallel axisymmetric perturbed vortex tubes tests similar to those appearing in \cite{kerr1993evidence} and \cite{hou2006dynamic}. Finally, in section \ref{sec:conclu} we make some concluding remarks and propose future directions of work. \pagebreak \section{Mathematical Formulation} \label{sec:mathForm} We present here the Characteristic Mapping method for the incompressible Euler equations in three-dimensional space. This work is the natural continuation of the framework presented in \cite{kohno2013new, CM, CME} and extends the Characteristic Mapping method for the 2D Euler equations in \cite{CME} to the 3D case. The main challenge in the 3D case is the inclusion of the vortex stretching term in a way that is compatible with the CM method and preserves its arbitrary resolution and low-dissipation properties. For this, we expand on the CM framework by including a more geometric formulation of the problem in terms of differential forms. \subsection{Characteristic Mapping Method} \label{sec:CMM} The Characteristic Mapping (CM) method consists in computing the diffeomorphic transformations of the domain generated by a given velocity field. For a given smooth and divergence-free velocity field ${\bm u}$ on a three-dimensional domain $U \in {\mathbb{R}}^3$, we consider the family of characteristic curves ${\bm \gamma}(t)$ parametrized by their initial condition ${\bm \gamma}_0$: \begin{subequations} \label{eqs:charCurves} \begin{gather} \frac{d}{dt} {\bm \gamma}(t) = {\bm u} ({\bm \gamma}(t), t) , \\ {\bm \gamma}(0) = {\bm \gamma}_0 . \end{gather} \end{subequations} We define the characteristic map ${\bm X}_{[t_1, t_2]}$ associated with the velocity ${\bm u}$ to be the solution operator for the characteristic curves, that is, \begin{gather} {\bm X}_{[t_1, t_2]} ({\bm \gamma}(t_1)) = {\bm \gamma}(t_2) \end{gather} for all times $t_1, t_2$ and for all characteristic curves ${\bm \gamma}$. One can check that, keeping $t_0$ fixed, the characteristic map satisfies the following equations \begin{subequations} \label{eqs:charEqns} \begin{gather} \partial_t {\bm X}_{[t_0, t]} = {\bm u}( {\bm X}_{[t_0, t]}, t) , \label{eq:CMfwd} \\ (\partial_t + {\bm u} \cdot \nabla) {\bm X}_{[t, t_0]} = 0 . \label{eq:CMbkw} \end{gather} \end{subequations} The map ${\bm X}_{[t_1, t_2]}$ can be thought of as a transformation the space from time $t_1$ to $t_2$ following the flow, i.e. vortex lines are transported. There is no requirement that $t_1 < t_2$, if $t_1 <t_2$, the map is forward in time and we will call it the forward map, if $t_1 > t_2$, we call it the backward map. It is straightforward to check the following properties of the characteristic maps: \begin{subequations} \label{eqs:CMGroup} \begin{gather} {\bm X}_{[t_1, t_2]} \circ {\bm X}_{[t_0, t_1]} = {\bm X}_{[t_0, t_2]} , \label{eq:groupCompose} \\ {\bm X}_{[t_0, t_1]}^{-1} = {\bm X}_{[t_1, t_0]} , \label{eq:groupInverse} \\ {\bm X}_{[t_0, t_0]} = {\bm x} , \end{gather} \end{subequations} for arbitrary $t_0, t_1, t_2$. Indeed, for a given divergence-free velocity field ${\bm u}$, the characteristic maps ${\bm X}$ are elements of $\textit{SDiff}(U)$, the Lie group of volume-preserving diffeomorphisms of the domain $U$, with the space of divergence-free vector fields as its Lie algebra. The underlying theory for the characterization of the Euler equations as geodesic flow in the space of volume preserving diffeomorphisms can be found in the works of Arnold \cite{arnold1966geometrie}. For simplicity of notation, we will denote the forward map ${\bm X}_{[0, t]} ({\bm x})$ as ${\bm X}_F({\bm x}, t)$ and the backward map ${\bm X}_{[t, 0]} ({\bm x})$ as ${\bm X}_B({\bm x}, t)$ when the time-interval of mapping is not emphasized. As a function of $t$, we can formally see ${\bm X}_F$ as the integral curve of the time-dependent velocity field ${\bm u}$ on $\textit{SDiff}(U)$ starting from identity; ${\bm X}_B$ is the corresponding inverse element of the group for each time $t$. The characteristic maps act as solution operators to the transport equations. Consider the advection equation for a scalar $\phi$ under the velocity field ${\bm u}$: \begin{gather} (\partial_t + {\bm u} \cdot \nabla) \phi = 0 , \\ \phi({\bm x}, 0) = \phi_0({\bm x}) . \end{gather} From the method of characteristics, we know that $\frac{d}{dt} \phi({\bm \gamma}(t), t) = 0$ for any characteristic ${\bm \gamma}$ given by \eqref{eqs:charCurves}. It follows that \begin{gather} \phi({\bm x}, t) = \phi_0 ({\bm X}_B({\bm x}, t)) . \end{gather} In geometric terms, since $\phi$ is Lie advected by ${\bm u}$, i.e. $(\partial_t + \mathcal{L}_{\bm u} ) \phi = 0$, we have that $\phi$ is given by the pullback ${{\bm X}_B}^* \phi_0$. This is also called the relabelling symmetry or back-to-label map. Indeed, ${\bm X}_B$ allows us to switch between Lagrangian and Eulerian frames. One can think of ${\bm X}_B$ as identifying the characteristic curve passing through ${\bm x}$ at time $t$ and returning the location of the corresponding particle in $U$ at time $0$ which, by convention, we use as the Lagrangian reference space. Here, $\phi_0$, the initial condition of the scalar, is a 0-form, however this is true for higher degree forms and will be our main tool for solving the Euler equations in vorticity form. \subsection{The Euler Equations} We consider the incompressible Euler equations on a three-dimensional domain $U$, for simplicity, we take $U$ to be the periodic cube $\mathbb{T}^3$. \begin{subequations} \begin{gather} \partial_t {\bm u} + ({\bm u} \cdot \nabla) {\bm u} = \frac{1}{\rho} \nabla p , \\ \partial_t \rho + \div (\rho {\bm u}) = 0 \label{eq:rhoCont} , \end{gather} \end{subequations} where $\rho$ is the scalar density and $p$ is the pressure. For the incompressible equations, the density is assumed to be constant, in which case the continuity equation \eqref{eq:rhoCont} reduces to the divergence-free condition \begin{gather} \div {\bm u} = 0 . \end{gather} We let ${\bm w} = \nabla \times {\bm u}$ be the vorticity vector field, which is divergence free by construction. The vorticity equation can be expressed as follows \begin{subequations} \begin{gather} \partial_t {\bm w} + ({\bm u} \cdot \nabla) {\bm w} = ({\bm w} \cdot \nabla){\bm u} - {\bm w} (\div {\bm u}), \label{eq:vtxEqn} \\ \div {\bm u} = 0 . \end{gather} \end{subequations} Since we take a geometric approach, it is more convenient to express the vorticity equation in terms of differential forms. Define the vorticity 2-form ${\omega} = \star({\bm w}^\flat)$, where $\flat$ is the lowering of the tensor index and $\star$ is the Hodge-star operator (see Lang \cite{lang2012fundamentals} page 418). Formally, the 2-form ${\omega}$ performs linear measurements on infinitesimal 2D surfaces by dot product of ${\bm w}$ with the surface normal; by definition of curl, this measurement yields the total circulation of ${\bm u}$ along the surface boundary. The vorticity equation \eqref{eq:vtxEqn} is equivalent to the Lie-transport equation of the vorticity 2-form ${\omega}$: \begin{subequations} \label{eqs:LieAdvVtx} \begin{gather} \partial_t {\omega} + \mathcal{L}_{\bm u} {\omega} = 0 , \\ \partial_t \rho + \div(\rho {\bm u}) = 0 . \end{gather} \end{subequations} The Cartan formula for the Lie derivative: $\mathcal{L}_{\bm v} \phi = d (\iota_{\bm v} \phi) + \iota_{\bm v} d\phi$, where $\iota_{\bm v}$ is the interior product, is used to recuperate the original vorticity vector equation\footnotemark: \footnotetext{Using the following identities: \begin{align*} &( \iota_{\bm v} \phi )^\sharp = {\bm v} \cdot \phi^\sharp \quad \text{when $\phi$ is a 1-form} , \quad \quad &&( \iota_{\bm v} \phi )^\sharp = (\star\phi)^\sharp \times {\bm v} \quad \text{when $\phi$ is a 2-form} , \\ &(d \phi )^\sharp = \nabla \phi \quad \text{when $\phi$ is a 0-form, and} \quad \quad &&(d \phi )^\sharp = \nabla \times \phi^\sharp \quad \text{when $\phi$ is a 1-form} . \end{align*} } \begin{gather} \label{eq:deriveLieAdv} \left(\star \left( \partial_t {\omega} + \mathcal{L}_{\bm u} {\omega} \right) \right)^\sharp = \partial_t {\bm w} + \left( \star d (\iota_{\bm u} {\omega}) \right)^\sharp + \left( \star \iota_{\bm u} d {\omega} \right)^\sharp = \partial_t {\bm w} + \nabla \times \left( {\bm w} \times {\bm u} \right) \nonumber \\ = \partial_t {\bm w} + {\bm w} (\div {\bm u}) - ({\bm w} \cdot \nabla ) {\bm u} + ({\bm u} \cdot \nabla) {\bm w} = 0 , \end{gather} where ${\bm w} \times {\bm u}$ is the Lamb vector. This means that the vorticity 2-form is conserved, i.e. it is Lie-advected or ``frozen into'' the flow. We note that this uses the general barotropic compressible version of the vorticity equation. In principle, in the incompressible case, the compression term ${\bm w} (\div {\bm u})$ vanishes, however, this would mean that the Lie-advected vorticity would be allowed to intensify due to numerical errors on the divergence-free condition. \begin{remark} One can alternatively check that with ${\bm w}$ evolving strictly under the incompressible equations, the 2-form $\rho {\omega}$ is Lie-advected, that is\footnotemark[\value{footnote}], \[\left(\star \left( \partial_t \rho {\omega} + \mathcal{L}_{\bm u} \rho {\omega} \right) \right)^\sharp = \rho ( \partial_t {\bm w} + ({\bm u} \cdot \nabla) {\bm w} - ({\bm w} \cdot \nabla){\bm u}) = 0,\] where $\rho$ is still assumed to satisfy the continuity equation \eqref{eq:rhoCont} (in case the discretized ${\bm u}$ is not exactly divergence-free). Then the vorticity field can be obtained from the Lie-advected $\rho {\omega}$ by scaling by $\rho^{-1}$, this cancels any stretching of vortices due to artificial volume compression from numerical errors in $(\div {\bm u})$. \end{remark} In the context of incompressible fluids, the above simply reduces to the statement that the vorticity 2-form is Lie-advected by the velocity field. This gives us an expression of the vorticity as the pullback of the initial condition by the characteristic map: \begin{gather} \label{eq:vtxPB} {\omega} (\cdot, t) = {{\bm X}_{[t, 0]}}^*{\omega}_0 , \end{gather} where the superscript asterisk denotes pullback. For a mapping $F : U \to U$ the pullback $F^*$ it is the dual operator to the pushforward operator denoted by the subscript asterisk $F_*$. The pullback of a $k$-form $\eta$ is defined by $(F^*\eta) ({\bm v}) = \eta \left(F_*{\bm v} \right)$ where ${\bm v}$ is an arbitrary $k$-vector representing an infinitessimal $k$-dimensional oriented parallelogram and the pushforward $F_*{\bm v} $ is its image under the mapping $F$. Hence, for the 2-form ${\omega}$, by the generalized Stokes' theorem, equation \eqref{eq:vtxPB} is equivalent to the conservation of circulation along all closed curves transported by the forward flow map. Equation \eqref{eq:vtxPB} provides many simplifications both numerically and in the analysis mainly due to the fact that pullback commutes with exterior derivatives. For instance, in the study of the Euler equations through Clebsch variables, one makes the simplifying assumption that the initial velocity 1-form is given by $f dg + d \psi$ for some scalar functions $f$, $g$ and $\psi$. The initial vorticity is then given by $df \wedge dg$. Applying \eqref{eq:vtxPB} to this initial condition and commuting pullback and $d$, we get that the vorticity 2-form at time $t$ is given by \begin{gather} {\omega}(\cdot, t) = d \left( f \circ {\bm X}_{[t, 0]} \right) \wedge d \left( g \circ {\bm X}_{[t, 0]} \right) , \end{gather} that is, it is sufficient to solve the advection equations for $f$ and $g$ and reconstruct the vorticity by a cross product of their gradients. We note that the helicity scalar field is defined as $h = {\bm u} \cdot {\bm w}$ which corresponds to the volume form ${\bm u}^\flat \wedge {\omega}$. This implies that the Clebsch variable representation is limited to cases where $h$ is exact, i.e. $h = d \phi$ for some 2-form $\phi$. It follows that total helicity is 0 for flows admitting Clebsch variables, i.e. non-helical flows. A generalized version of the Clebsch approach has been studied in \cite{deng2005level}, these Generalized Clebsch variables can be used to represent any initial condition, including helical flows. In fact, the initial velocity expansion \eqref{eq:initVeloExpansion} used in this paper can be seen as a special case of these variables. For the numerical method described here, we proceed in the following general setting. We assume that there exists closed 1-forms denoted (by abuse of notation) $d\theta_1, d\theta_2, \ldots, d\theta_n$ and scalar functions $u_1, u_2, \ldots, u_n$ such that the initial velocity 1-form ${\bm u}^\flat$ can be expressed as \begin{gather} {\bm u}^\flat = \sum_{k=1}^n u^k d \theta_k . \end{gather} Then, the initial vorticity form is given by \begin{gather} {\omega}_0 = \sum_{k=1}^n d u^k \wedge d \theta_k . \end{gather} This gives us a closed expression for the vorticity depending only on ${\bm X}_{[t, 0]}$: \begin{gather} \label{eq:vtxFormPB} {\omega}(\cdot, t) = \sum_{k=1}^n d \left( u^k \circ {\bm X}_{[t, 0]} \right) \wedge {{\bm X}_{[t, 0]}}^* d \theta_k . \end{gather} We do not require that the $d \theta_k$ 1-forms be exact, as long as the pullback is easy to compute. In fact, for the algorithm implemented in this work, on the 3D torus, the $d \theta_k$ forms, with $n=3$, are simply the coordinate covectors $(1,0,0)$, $(0,1,0)$ and $(0,0,1)$, $u_k$ are the corresponding coordinate values of ${\bm u}_0$ and the pullback ${{\bm X}_{[t, 0]}}^* d \theta_k$ is given by $\partial_k {\bm X}_{[t, 0]}$. Using the following expansion for the initial velocity \begin{gather} \label{eq:initVeloExpansion} {\bm u}_0^\flat = u^1 (1,0,0) + u^2 (0,1,0) + u^3(0,0,1) , \end{gather} we get that the vorticity vector at time $t$ is given by \begin{gather} \label{eq:vtxVeloPB} {\bm w} (\cdot, t) = \sum_{k=1}^3 \left( \nabla u^k \cdot \nabla {\bm X}_{[t, 0]} \right) \times \nabla {\bm X}_{[t, 0]}, \end{gather} which further simplifies to \begin{gather} w^i (\cdot, t) = \epsilon_{ijk} \epsilon_{abc} w^a_0 \partial_j {\bm X}_{[t,0]}^b \partial_k {\bm X}_{[t,0]}^c . \end{gather} in summation notation, where $\epsilon$ are the Levi-Civita symbols. Upon further inspection, the above expression is Cramer's rule expansion of \begin{gather} \label{eq:vtxVecPB} {\bm w} (\cdot, t) = \det \left( \nabla {\bm X}_{[t,0]} \right) \left( \nabla {\bm X}_{[t,0]} \right)^{-1} {\bm w}_0 ({\bm X}_{[t,0]}) = \left( \nabla {\bm X}_{[t,0]} \right)^{-1} {\bm w}_0 ({\bm X}_{[t,0]}) , \end{gather} where the determinant factor can be omitted since the maps are volume preserving. \begin{remark} The basis 1-forms $d \theta_k$ are chosen here to express general initial conditions on the torus. In specific cases, for instance in the presence of Clebsch variables, the number of basis 1-forms can be reduced to improve computational performance. That is, the computation of the characteristic map allows for a flexible framework where the vorticity at time $t$ can be constructed by a pullback formula \eqref{eq:vtxFormPB}, not limited to the formula in \eqref{eq:vtxVecPB}. \end{remark} \begin{remark} An equivalent formulation can be obtained from a Lagrangian perspective by considering the forward map. Following characteristic curves ${\bm \gamma}$, we see that the vorticity field satisfies \begin{gather} \frac{d}{dt} {\bm w}({\bm \gamma}(t), t) = \nabla {\bm u} \cdot {\bm w}({\bm \gamma}(t), t). \end{gather} Noticing that the gradient of the forward map evolves according to $\partial_t \nabla {\bm X}_F = \nabla {\bm u} \cdot \nabla {\bm X}_F$, one can show that the vorticity field at ${\bm X}_F$ is given by \begin{gather} {\bm w}({\bm X}_F, t) = \nabla {\bm X}_F \cdot {\bm w}_0({\bm x}) . \end{gather} This is Cauchy's Lagrangian formula used in many Lagrangian particle approaches \cite{beale1982vortex, constantin2001eulerian}. Composing the above equation with ${\bm X}_B$ to return to Eulerian frame and applying the inverse function theorem we get \begin{gather} {\bm w} (\cdot, t) = \left( \nabla {\bm X}_B \right)^{-1} {\bm w}_0 ({\bm X}_B) . \end{gather} The factor $\det \left( \nabla {\bm X}_B \right)$ discrepancy with \eqref{eq:vtxVecPB} does not show up in the incompressible case since the transformations are volume preserving. In fact, using that $\rho {\omega}$ is Lie-advected and $\rho({\bm x}, t) = \rho_0 ({\bm X}_B) \det \left( \nabla {\bm X}_B \right)$, isolating ${\omega}$ from $\rho {\omega}$ would remove the determinant factor. The CM method for a compressible flow has been studied in \cite{CMdiff} in the context of diffusion-driven density transport. \end{remark} \begin{remark} The evolution of the vorticity 2-form through pullback by ${\bm X}_B$ is the infinitessimal expression of the Kelvin circulation theorem which states that the total circulation along a closed curve passively carried by the fluid flow is constant. As a matter of fact, equation \eqref{eq:vtxVeloPB} can be obtained directly by applying the Kelvin circulation theorem to the definition of the curl operator. Formally, considering that ${\bm w} \cdot {\bm n} = \lim_{|S| \to 0} \frac{1}{|S|} \int_{\partial S} {\bm u} \cdot \d {\bm s} $ for some infinitessimal surface $S$ with unit normal ${\bm n}$, we apply the Kelvin circulation theorem to $\partial S$, moving it to its position and shape at time $t=0$, to obtain ${\bm w} \cdot {\bm n} = \lim_{|S| \to 0} \frac{1}{|S|} \int_{{\bm X}_B(\partial S)} {\bm u}_0 \cdot \d {\bm s} = \lim_{|S| \to 0} \frac{1}{|S|} \int_{\partial S} {\bm u}_0({\bm X}_B) \cdot \d {\bm X}_B({\bm s})$ which yields equation \eqref{eq:vtxVeloPB} after taking the limit. This also relates the CM method to the Kelvin-filtered turbulence models which can roughly be summarized by the vorticity equation \begin{gather} \partial {\bm w} + ({\bm v} \cdot \nabla){\bm w} = ({\bm w} \cdot \nabla) {\bm v} \end{gather} where ${\bm v}$ is a filtered version of the velocity field ${\bm u}$, for instance ${\bm v} = (I - \alpha^2 \Delta)^{-1} {\bm u}$. We refer to \cite{foias2001navier} for a review on the theory of these nonlinearly dispersive equations. In the inviscid case, the vorticity is given through pullback by a modified flow map; for the Kelvin filtered equations, the modified flow map is obtained from the filtered velocity field ${\bm v}$, in the CM framework, the modification on the flow map is a result of a combination of filtering and numerical errors. \end{remark} \begin{remark} The pullback formulation allows us to quickly check the conservation of total helicity. Indeed, given that the vorticity is the curl of the velocity, i.e. $d {\bm u}^\flat = {\omega}$, we have that by Helmholtz, there exists a 1-form $\eta$ and a scalar $\psi$ such that ${\bm u}^\flat = \eta + d \psi$ and consequently, the vorticity can be written as ${\omega} = d \eta$. Furthermore, since ${\omega} = {{\bm X}_B}^* {\omega}_0$, we also have that there exists some $\eta_0$ such that $\eta = {{\bm X}_B}^* \eta_0$ and $d\eta_0 = {\omega}_0$. The local helicity is given by ${\bm u} \cdot {\bm w}$ which corresponds to the 3-form ${\bm u}^\flat \wedge {\omega} = \eta \wedge d \eta + d \psi \wedge d \eta$. Noting that $d \psi \wedge d \eta = d(\psi d \eta)$ is exact and so has vanishing total integral, we have \begin{gather} \int_U {\bm u}^\flat \wedge {\omega} = \int_U \eta \wedge d \eta = \int_U {{\bm X}_B}^* (\eta_0 \wedge d\eta_0) = \int_{{\bm X}_B(U)}\eta_0 \wedge d\eta_0 = \int_U {\bm u}_0^\flat \wedge {\omega}_0 . \end{gather} This property relies only on the fact that both $\eta$ and ${\omega}$ evolve through pullback by the same ${\bm X}_B$. \end{remark} The derivations in this section allow us to express the evolution of the vorticity field using the characteristic map. The evolution of the characteristic maps is in turn given by the velocity field, which we compute from the vorticity field using the Biot-Savart law ${\bm u} = - \Laplace^{-1} \nabla \times {\bm w}$. The fully coupled vorticity-characteristic map equations are as follows \begin{subequations} \label{eqs:CMsummary} \begin{gather} (\partial_t + {\bm u} \cdot \nabla) {\bm X}_B = 0 \\ {\bm w} (\cdot, t) = \left( \nabla {\bm X}_B \right)^{-1} {\bm w}_0 ({\bm X}_B) \\ {\bm u} = - \Laplace^{-1} \nabla \times {\bm w} . \end{gather} \end{subequations} \section{Numerical Implementation} \label{sec:numImpl} The numerical approach of the CM method for the 3D Euler equations largely follows the framework of the Gradient-Augmented Level-Set \cite{nave2010gradient} and Jet-Scheme methods \cite{seibold2011jet}. In this section, we will first present the general numerical framework for the CM method. We will then discuss the specific implementation details used for the numerical experiments in this work. The computational method is mainly based on the three equations in \eqref{eqs:CMsummary}. Numerically, this corresponds to evolving a characteristic map ${\bm \chi}_{[t_n, 0]}$ in a finite dimensional discretization space $\mathcal{V} $ approximating \textit{Diff}($U$), the space of diffeomorphisms on $U$. Then at every time step, the discretized vorticity $\tilde{\bm w}^n$ and velocity $\tilde{\bm u}^n$ will be reconstructed by pullback using ${\bm \chi}_{[t_n, 0]}$. For the rest of this paper, we will denote by the script letter ${\bm \chi}$ the approximation of the characteristic map ${\bm X}$ in $\mathcal{V}$, the superscript $n$ on a variable will denote the evaluation of said variable at time $t_n$ and the tilda indicates an approximation or modified equation. The numerical method comprises the three following parts: \begin{enumerate} \item[1.] A discretized velocity field $\tilde{\bm u}^n$ at time $t_n$, (assuming the characteristic map ${\bm \chi}_{[t_n, 0]}$ is known). This is given by the Biot-Savart law \begin{gather} \tilde{\bm u}^n = - \Laplace^{-1} \nabla \times \left( (\nabla {\bm \chi}_{[t_n,0]})^{-1} {\bm w}_0({\bm \chi}_{[t_n, 0]} ) \right) \end{gather} computed using spectral Fast-Fourier transform methods. \item[2.] A numerical approximation $\tilde{\bm X}_{[t_{n+1}, t_n]}$ of the one-step map ${\bm X}_{[t_{n+1}, t_n]}$. For instance, a first order approximation would give \begin{gather} \label{eq:egOSmap} \tilde{\bm X}_{[t_{n+1}, t_n]}({\bm x}) \approx {\bm x} - \Delta{t} \tilde{\bm u}^n({\bm x}). \end{gather} In the current implementation, we use a third-order Runge-Kutta backward in time integrator with a Hermite cubic time-interpolation of the velocity field. A Hermite in time interpolation is used instead of the Lagrange interpolation in \cite{CME} to improve accuracy. \item[3.] A time update for the characteristic map based on the group property \eqref{eq:groupCompose}. The map ${\bm \chi}_{[t_{n+1}, 0]}$ at time $t_{n+1}$ is given by \begin{gather} \label{eq:egMapUpdate} {\bm \chi}_{[t_{n+1}, 0]} = \mathcal{H} \left[{\bm \chi}_{[t_n, 0]} \circ \tilde{\bm X}_{[t_{n+1}, t_n]} \right] , \end{gather} for some interpolation operator $\mathcal{H} : \textit{Diff}(U) \to \mathcal{V}$. \end{enumerate} In the following sections, we will examine each component of the algorithm in detail. \subsection{Spatial Discretization} In the method presented here, the domain $U = \mathbb{T}^3$ is discretized using a Cartesian meshgrid denoted ${\bm G}$. In 3D, we label the grid points of ${\bm G}$ by ${\bm x}_{i,j,k}$, with each ${\bm x}_{i,j,k}$ located at the lower corner of the cell $C_{i,j,k}$. Given a grid ${\bm G}$, we define the Hermite cubic interpolation operator (for details see e.g. \cite{kolomenskiy2016adaptive, nave2010gradient}) using piecewise smooth basis functions which are tricubic in each cell $C_{i,j,k}$. These basis functions are constructed by tensor product of the 1D Hermite cubic basis functions $Q_i$, with $Q_0$ interpolating function value, and $Q_1$, the derivative: \begin{subequations} \label{eqs:HermiteBasis1D} \begin{align} & q_0 (s) = (1 + 2|s|)(1 - |s|)^2 , \\ & q_1 (s) = s(1 - |s|)^2 , \\ & Q_i(s) = q_i(s) \mathbf{1}_{[-1, 1]}(s) , \end{align} \end{subequations} where $\mathbf{1}$ denotes the indicator function. The $Q_0$ and $Q_1$ functions form the shape functions corresponding to the function value and derivative interpolation on a 1D grid. They have the property that $\partial^a Q_b (s) = \delta^a_b \delta^0_s$ for $a, b \in \{0,1\}$ and $s \in \{-1, 0, 1\}$. The 3D shape functions on the grid ${\bm G}$ are then defined by \begin{gather} H_{{\bm a}}^{{\bm i}} ({\bm x}) = \prod_{m=1}^3 Q_{a_m} \left( \frac{x^m - x^m_{{\bm i}}}{ \Delta{x}^m} \right) ( \Delta{x}^m)^{a_m} \end{gather} where ${\bm x} = (x^1, x^2, x^3)$, ${\bm i} = (i_1, i_2, i_3)$ and ${\bm a} = (a_1, a_2, a_3)$. On grid points ${\bm x}_{\bm r}$ of ${\bm G}$, these basis functions satisfy \begin{gather} \partial^{{\bm b}} H_{{\bm a}}^{{\bm i}} ({\bm x}_{\bm r}) = \delta_{\bm a}^{\bm b} \delta_{\bm r}^{\bm i} . \end{gather} The $H_{{\bm a}}^{{\bm i}}$ functions are supported on the 8 cells surrounding the grid point ${\bm x}_{\bm i}$, are tricubic in each cell and are globally $\mathcal{C}^1$ with continuous mixed derivatives of the form $\partial^{\bm b}$ with $b_m \leq 1$ for $m=1,2,3$. We define the Hermite cubic interpolation operator for a smooth function $f$ to be \begin{gather} \mathcal{H}_{\bm G} [ f ] ({\bm x}) = \sum_{{\bm a} \in \{0,1\}^3} \sum_{{\bm s} \in {\bm G}} \partial^{\bm a} f ({\bm x}_{\bm i}) H_{{\bm a}}^{{\bm i}} ({\bm x}) . \end{gather} The minimum regularity requirement for this to be well-defined is that $\partial^{\bm b} f$ is continuous for all mixed partial derivatives involving at most one derivative in each Cartesian coordinate. We denote $\mathcal{K}^1(U) = \left\{ f \in \mathcal{C}^1(U) \: | \: \partial^{\bm b} f \in \mathcal{C}^0(U) \text{ for } {\bm b} \in \{0,1\}^3 \right\}$. Then $\mathcal{H}_{\bm G} : \mathcal{C}^1(U) \to \mathcal{K}^1(U)$ is a projection operator. Furthermore, for $f \in \mathcal{C}^4(U)$, it is known that \begin{gather} \| \partial^{\bm a} f - \partial^{\bm a} \mathcal{H}_{\bm G} [f] \|_\infty \lesssim \Delta{x}^{4 - | {\bm a} |} | f |_{\mathcal{C}^4} , \end{gather} where $| {\bm a} | = a_1 + a_2 + a_3$ and $| f |_{\mathcal{C}^4} = \sum_{| {\bm b} | = 4 } \| \partial^{\bm b} f \|_{\infty}$ is the $\mathcal{C}^4$ seminorm; more detailed error bounds can be found in \cite{birkhoff1968piecewise}. For the characteristic maps, ${\bm \chi}$ is given by three coordinate functions. We defined the discretization subspace $\mathcal{V} = \left( \mathcal{K}^1 (U) \right)^3$ and use coordinate-wise Hermite cubic interpolation as interpolation operator for the evolution of the characteristic maps. Here we note that $\mathcal{V}$ is not necessarily contained in $\textit{SDiff}(U)$ or even $\textit{Diff}(U)$ as there is no \emph{a priori} constraint on the determinant or the invertibility of the interpolated map. However, when interpolating a volume-preserving diffeomorphism, the error on the Jacobian determinant is $\mathcal{O}( \Delta{x}^3)$ and therefore, for sufficiently well-behaved maps, the interpolant will be a diffeomorphism. For longer time simulations, the characteristic map will develop strong small scale features which cannot be resolved using a fixed grid, in those cases, a remapping method will be employed to decompose the transformation; we will examine this in later sections. \subsection{Velocity Interpolation} Using the Hermite cubic interpolation in the previous section, the numerical characteristic map ${\bm \chi}_{[t_n, 0]}$ is defined as a diffeomorphism of the domain $U$. We define the numerical vorticity $\tilde{\bm w}^n$ through pullback by ${\bm \chi}_{[t_n, 0]}$: \begin{gather} \label{eq:defNumVort} \tilde{\bm w}^n ({\bm x}) = \left(\nabla {\bm \chi}_{[t_n, 0]} \right)^{-1} {\bm w}_0 ({\bm \chi}_{[t_n, 0]}({\bm x}) ) , \end{gather} where the gradient of ${\bm \chi}_{[t_n,0]}$ is directly evaluated from the interpolant. This defines $\tilde{\bm w}^n$ as a $\mathcal{C}^0$ vector field on $U$. The numerical velocity $\tilde{\bm u}^n$ is in turn computed from the convolution of the Biot-Savart kernel with $\tilde{\bm w}^n$; we will do this using Fourier spectral methods. We will discretize the velocity field on a grid ${\bm V}$ and denote by $\mathcal{F}_{\bm V}$ the discrete Fourier transform computed by FFT on the grid ${\bm V}$. Sampling $\tilde{\bm w}^n$ on ${\bm V}$ using \eqref{eq:defNumVort} and applying a forward Fourier transform yields a truncated Fourier series for the vorticity field. Computing the Biot-Savart kernel in frequency space then gives us a Fourier series representation for the velocity. Finally, we define the numerical velocity $\tilde{\bm u}^n$ as the Hermite interpolant of this truncated Fourier series; this allows us to evaluate the velocity at arbitrary locations in the domain without having to compute the inverse Fourier transform at non-uniform grid points. The definition of the numerical velocity at $t_n$ can be summarized as follows: \begin{gather} \label{eq:defNumVelo} \tilde{\bm u}^n({\bm x}) = \mathcal{H}_{\bm V} \left[ \mathcal{F}^{-1}_{\bm V} \left[ - \Laplace^{-1} \nabla \times \mathcal{F}_{\bm V} [ \tilde{\bm w}^n ] \right] \right] ({\bm x}) . \end{gather} In the above equation, it is understood that in order to define the Hermite cubic interpolant for the velocity, the required mixed partial spatial derivatives are computed directly from the Fourier series. Similarly, from $\partial_t {\bm w} = ({\bm w} \cdot \nabla) {\bm u} - ({\bm u} \cdot \nabla){\bm w}$, we can also discretize the time derivative of ${\bm u}$ at $t_n$: \begin{gather} \label{eq:defNumdVelodt} \partial_t \tilde{\bm u}^n({\bm x}) = \mathcal{H}_{\bm V} \left[ \mathcal{F}^{-1}_{\bm V} \left[ - \Laplace^{-1} \nabla \times \mathcal{F}_{\bm V} [ (\tilde{\bm w}^n \cdot \nabla) \tilde{\bm u}^n - (\tilde{\bm u}^n \cdot \nabla)\tilde{\bm w}^n ] \right] \right] ({\bm x}) . \end{gather} The data $\tilde{\bm u}^n$ and $\partial_t \tilde{\bm u}^n$ at time steps $t_n$ allow us to locally approximate the velocity using a 4-dimensional time-space Hermite cubic interpolant. For the one-step map \eqref{eq:egOSmap}, we will define an approximate $\tilde{\bm u}$ in the interval $[t_n, t_{n+1}]$ by extending the interpolant obtained from the velocity data ${\bm u}^{n-1}$ and ${\bm u}^n$ in the interval $[t_{n-1}, t_n]$. This gives the following definition for the numerical velocity field: \begin{align} \label{eq:defNumFullVelo} \tilde{\bm u} ({\bm x}, t) = & \left( q_0(t-t_{n-1}) \tilde{\bm u}^{n-1}({\bm x}) + q_0(t-t_{n}) \tilde{\bm u}^n({\bm x}) \right) \nonumber \\ & + \Delta{t} \left( q_1(t-t_{n-1}) \partial_t \tilde{\bm u}^{n-1}({\bm x}) + q_1(t-t_{n}) \partial_t \tilde{\bm u}^n({\bm x}) \right) \quad \text{for} \quad t \in [t_n, t_{n+1}), \end{align} using the Hermite basis functions given in \eqref{eqs:HermiteBasis1D}. We note that since for each $n$, $\tilde{\bm u}^n$ and $\partial_t \tilde{\bm u}^n$ are Hermite interpolants of divergence-free vector fields, the modified velocity field $\tilde{\bm u} ({\bm x}, t)$ is a linear combination of divergence-free velocity fields and is also divergence-free at all time up to interpolation error. This error can be reduced by refining the velocity interpolation grid which can be achieved by a zero-padding in frequency space before taking the inverse Fourier transform. The one-step map in the interval $[t_n, t_{n+1}]$ is then obtained from the backward in time flow of the approximate velocity field $\tilde{\bm u}$. We define the numerical one-step map $\tilde{\bm X}_{[t_{n+1}, t_n]}$ pointwise using a third order Runge-Kutta integration of $\tilde{\bm u}$: \begin{gather} \label{eq:defNumOSmap} \tilde{\bm X}_{[t_{n+1}, t_n]} = \int_{t_{n+1}}^{t_n} \tilde{\bm u} \left(\tilde{\bm X}_{[\tau, t_n]} , \tau \right) \d \tau . \end{gather} The one-step map is used in the time update of the characteristic map \eqref{eq:egMapUpdate}; it is therefore only evaluated at grid points. However, in order to compute the chain rules for the derivatives required to define the Hermite interpolant, we also need the mixed partial derivatives of $\tilde{\bm X}_{[t_{n+1}, t_n]}$ at grid points. This is done using a $4^{th}$ order version of the $\epsilon$-difference scheme described in \cite{chidyagwai2011comparative}. The $\epsilon$-difference schemes introduce an $L^\infty$ error of order $\epsilon^4 + \delta \sum_{k=0}^3 \Delta{x}^k \epsilon^{-k}$ where $\delta$ is the machine precision. For all computations presented in this paper, we used $\epsilon = 2.5 \times 10^{-3}$ which corresponds to an error term of at most $10^{-8}$ and effectively less than $10^{-11}$, if $ \Delta{x}<0.1$. \begin{remark} Evaluating the extrapolation formula \eqref{eq:defNumFullVelo} at $t = t_{n+1}$ would generally not give the same velocity as $\tilde{\bm u}^{n+1}$ which is obtained by vorticity pullback followed by the Biot-Savart law. Indeed, the extrapolation of the velocity in the interval $[t_n, t_{n+1})$ is used only to evolve the characteristic map to time $t_{n+1}$. The velocity at $t_{n+1}$ is then reconstructed using \eqref{eq:defNumVort} and \eqref{eq:defNumVelo}, similar to a predictor-corrector approach. This also implies that numerical errors in the extrapolation are not directly carried and amplified in the next time step. \end{remark} \subsection{Error Estimates} \label{sec:ErrorEst} We will examine in this section the numerical error on the characteristic map and its relation to the error on the vorticity field. We will try to characterize the nature of the numerical error and provide some estimates. We use as starting assumption that the numerical map ${\bm \chi}_B$ is consistent with the exact map ${\bm X}_B$ in the $\mathcal{C}^{1, \alpha}$ norm for some $\alpha \in (0,1)$, that is the error is $o(1)$. This will allow us to estimate the global $\mathcal{C}^{1, \alpha}$ error to third-order in time and space by omitting higher order terms in the error. The consistency assumption is then implied for short-time since the initial numerical map ${\bm \chi}_{[0,0]}= {\bm x}$ is exact. In order to preserve the advective structure of the error, we define the following error map: \begin{gather} {\bm E}_{[0, t_n]} := {\bm \chi}_{[t_n, 0]} \circ {\bm X}_{[t_n, 0]}^{-1} = {\bm \chi}_{[t_n, 0]} \circ {\bm X}_{[0, t_n]} = {\bm \chi}_B \circ {\bm X}_F, \end{gather} which measures by how much the diffeomorphism ${\bm \chi}_{[t_n, 0]}$ differs from the inverse of the exact forward flow map ${\bm X}_{[0, t_n]}$. Indeed, since the composition of the forward and backward maps ${\bm X}_{[t_n,0]} \circ {\bm X}_{[0, t_n]} = {\bm x}$ gives the identity map, we have that \begin{gather} {\bm E}_{[0, t_n]} = {\bm x} + \left({\bm \chi}_{[t_n, 0]} - {\bm X}_{[t_n, 0]} \right) \circ {\bm X}_{[0, t_n]}, \end{gather} that is, the deviation of ${\bm E}_{[0, t_n]}$ from the identity map is the numerical error of the map evaluated at the pushforward location. This is a Lagrangian representation of the error since ${\bm x} - {\bm E}_{[0, t_n]}({\bm x})$ essentially gives the time $t_n$ map error for a particle starting at ${\bm x}$ at time $0$. We also note that since ${\bm \chi}_B$ is a $\mathcal{C}^1$ diffeomorphism by construction, it follows that all maps considered here are also $\mathcal{C}^1$ diffeomorphisms. Thus left and right inverses exist, are equal and are also diffeomorphisms. We also define the auxiliary ``modified map'' \begin{gather} \tilde{\bm X}_{[t_n, 0]} := \tilde{\bm X}_{[t_1, 0]} \circ \tilde{\bm X}_{[t_2 , t_1]} \circ \dots \circ \tilde{\bm X}_{[t_n, t_{n-1}]}, \end{gather} where $\tilde{\bm X}_{[t_k, t_{k-1}]}$ is the one-step map given in \eqref{eq:defNumOSmap} obtained from RK3 integration on the numerical interpolated velocity field. The full error map is decomposed as follows: \begin{gather} {\bm E}_{[0, t_n]} = {\bm \chi}_{[t_n, 0]} \circ \tilde{\bm X}_{[t_n, 0]}^{-1} \circ \tilde{\bm X}_{[t_n, 0]} \circ {\bm X}_{[t_n, 0]}^{-1} . \end{gather} We let ${\bm \Phi}_{[0, t_n]} = {\bm \chi}_{[t_n, 0]} \circ \tilde{\bm X}_{[t_n, 0]}^{-1}$ and ${\bm \Psi}_{[0, t_n]} = \tilde{\bm X}_{[t_n, 0]} \circ {\bm X}_{[t_n, 0]}^{-1}$ and compute their time-evolution as follows: \begin{gather} {\bm \Phi}_{[0, t_n]} = \mathcal{H}_{\bm M} \left[ {\bm \chi}_{[t_{n-1}, 0]} \circ \tilde{\bm X}_{[t_n, t_{n-1}]} \right] \circ \left( \tilde{\bm X}_{[t_{n-1}, 0]} \circ \tilde{\bm X}_{[t_n, t_{n-1}]} \right)^{-1} \nonumber \\ = \mathcal{H}_{\bm M} \left[ {\bm \chi}_{[t_{n-1}, 0]} \circ \tilde{\bm X}_{[t_n, t_{n-1}]} \right] \circ \left( {\bm \chi}_{[t_{n-1}, 0]} \circ \tilde{\bm X}_{[t_n, t_{n-1}]} \right)^{-1} \circ {\bm \chi}_{[t_{n-1}, 0]} \circ \tilde{\bm X}_{[t_{n-1}, 0]}^{-1} \nonumber \\ = {\bm \xi}_n \circ {\bm \Phi}_{[0, t_{n-1}]} , \end{gather} where we defined a one-step error ${\bm \xi}_n := \mathcal{H}_{\bm M} \left[ {\bm \chi}_{[t_{n-1}, 0]} \circ \tilde{\bm X}_{[t_n, t_{n-1}]} \right] \circ \left( {\bm \chi}_{[t_{n-1}, 0]} \circ \tilde{\bm X}_{[t_n, t_{n-1}]} \right)^{-1} $. We note that ${\bm \xi}_n$ is the error due to Hermite interpolation since \begin{gather} {\bm \xi}_n - {\bm x} = \left( \mathcal{H}_{\bm M} \left[ {\bm \chi}_{[t_{n-1}, 0]} \circ \tilde{\bm X}_{[t_{n}, t_{n-1}]} \right] - {\bm \chi}_{[t_{n-1}, 0]} \circ \tilde{\bm X}_{[t_{n}, t_{n-1}]} \right) \circ \tilde{\bm X}_{[t_{n}, t_{n-1}]}^{-1} \circ {\bm \chi}_{[t_{n-1}, 0]}^{-1} \nonumber \\ = \left( \mathcal{H}_{\bm M} \left[ {\bm \chi}_{[t_{n-1}, 0]} \circ \tilde{\bm X}_{[t_{n}, t_{n-1}]} \right] - {\bm \chi}_{[t_{n-1}, 0]} \circ \tilde{\bm X}_{[t_{n}, t_{n-1}]} \right) \circ \tilde{\bm X}_{[t_{n}, 0]}^{-1} \circ {\bm \Phi}_{[0, t_{n-1}]}^{-1}. \end{gather} We define the following interpolation error \begin{gather} {\bm \varphi}_n :=\mathcal{H}_{\bm M} \left[ {\bm \chi}_{[t_{n-1}, 0]} \circ \tilde{\bm X}_{[t_{n}, t_{n-1}]} \right] - {\bm \chi}_{[t_{n-1}, 0]} \circ \tilde{\bm X}_{[t_{n}, t_{n-1}]} , \end{gather} we then obtain that \begin{gather} {\bm \Phi}_{[0, t_n]} = ({\bm x} + ({\bm \xi}_n - {\bm x}) ) \circ {\bm \Phi}_{[0, t_{n-1}]} = {\bm \Phi}_{[0, t_{n-1}]} + {\bm \varphi}_n \circ \tilde{\bm X}_{[t_{n}, 0]}^{-1} = {\bm x} + \sum_{k=1}^n {\bm \varphi}_k \circ \tilde{\bm X}_{[t_{k}, 0]}^{-1} . \end{gather} A similar derivation gives us \begin{gather} {\bm \Psi}_{[0, t_n]} = {\bm \eta}_n \circ {\bm \Psi}_{[0, t_{n-1}]} , \end{gather} where ${\bm \eta}_n := \left( \tilde{\bm X}_{[t_{n-1}, 0]} \circ \tilde{\bm X}_{[t_n, t_{n-1}]} \right) \circ \left( \tilde{\bm X}_{[t_{n-1}, 0]} \circ {\bm X}_{[t_n, t_{n-1}]} \right)^{-1}$. We note that ${\bm \eta}$ is the velocity approximation error which gives the discrepancy between the true flow and the flow obtained from the modified velocity $\tilde{\bm u}$. \begin{gather} {\bm \eta}_n - {\bm x} = \left( \tilde{\bm X}_{[t_{n-1}, 0]} \circ \tilde{\bm X}_{[t_n, t_{n-1}]} - \tilde{\bm X}_{[t_{n-1}, 0]} \circ {\bm X}_{[t_n, t_{n-1}]} \right) \circ {\bm X}_{[t_n, 0]}^{-1} \circ {\bm \Psi}_{[0, t_{n-1}]}^{-1} . \end{gather} We define the following modified flow error \begin{gather} {\bm \psi}_n = \tilde{\bm X}_{[t_{n-1}, 0]} \circ \tilde{\bm X}_{[t_n, t_{n-1}]} - \tilde{\bm X}_{[t_{n-1}, 0]} \circ {\bm X}_{[t_n, t_{n-1}]} , \end{gather} i.e. the map evolution error due to errors in the approximated velocity field; we note that this term is approximately $ \Delta{t} \nabla \tilde{\bm X}_{[t_{n-1}, 0]} \cdot (\tilde{\bm u} - {\bm u})$. This gives us \begin{gather} {\bm \Psi}_{[0, t_n]} = ({\bm x} + ({\bm \eta}_n - {\bm x}) ) \circ {\bm \Psi}_{[0, t_{n-1}]} = {\bm \Psi}_{[0, t_{n-1}]} + {\bm \psi}_n \circ {\bm X}_{[t_n, 0]}^{-1} = {\bm x} + \sum_{k=1}^n {\bm \psi}_k \circ {\bm X}_{[t_{k}, 0]}^{-1}. \end{gather} This allows us to write the error map as \begin{gather} {\bm E}_{[0, t_n]} = \left( {\bm x} + \sum_{k=1}^n {\bm \varphi}_k \circ \tilde{\bm X}_{[t_{k}, 0]}^{-1} \right) \circ \left( {\bm x} + \sum_{k=1}^n {\bm \psi}_k \circ {\bm X}_{[t_{k}, 0]}^{-1} \right) . \end{gather} We use the fact that for two $\mathcal{C}^{1, \alpha}$ diffeomorphisms, $\bm{f}$ and $\bm{g}$, the composition $\bm{f} \circ \bm{g}$ is also $\mathcal{C}^{1, \alpha}$ with $\| \bm{f} \circ \bm{g} \|_{\mathcal{C}^{1, \alpha} } \leq C \| \bm{f} \|_{\mathcal{C}^{1, \alpha} } \| \bm{g} \|_{\mathcal{C}^{1, \alpha} }^{1+\alpha}$, to estimate the norm of the Lagrangian displacement error ${\bm \epsilon}_{[0, t_n]} := {\bm x} - {\bm E}_{[0, t_n]}$: \begin{gather} \label{eq:LErrorEst} \| {\bm \epsilon}_{[0, t_n]} \|_{\mathcal{C}^{1, \alpha}} \lesssim \sum_{k=1}^n \left\| {\bm \psi}_k \right\|_{\mathcal{C}^{1, \alpha}} + \left( 1 + \sum_{k=1}^n \left\| {\bm \psi}_k\right\|_{\mathcal{C}^{1, \alpha}} \right)^{1+\alpha} \sum_{k=1}^n \left\| {\bm \varphi}_k\right\|_{\mathcal{C}^{1, \alpha}} , \end{gather} where the terms dependent on ${\bm X}_{[t_n, 0]}$ have been absorbed in the constants of the inequality; $\tilde{\bm X}_{[t_n, 0]}$ is also approximated with ${\bm X}_{[t_n, 0]}$ using the consistency assumption. Here we use the notation $A \lesssim B$ to denote that there exists some constant $c$ such that $A < cB$. In this section, the constant will depend on the dimension, the domain, the constants involved in the norms, and the solution ${\bm u}$ as well as ${\bm X}_B$. The ${\bm \varphi}_n$ error is an error pertaining the numerical resolution of ${\bm \chi}_B$, it can be controlled as long as we can control the higher derivatives of ${\bm \chi}_{[t_{n-1}, 0]} \circ \tilde{\bm X}_{[t_{n}, t_{n-1}]}$. The stability analysis of a similar methods has been studied in \cite{goodrich2006hermite}. The ${\bm \psi}_n$ error is a feedback between the map error and the velocity error (and also numerical integration), with ${\bm \psi}_n \approx \nabla \tilde{\bm X}_{[t_{n-1}, 0]} \Delta{t} (\tilde{\bm u} - {\bm u})$ and $\| {\bm \psi}_n \|_{\mathcal{C}^{1,\alpha}} \lesssim \Delta{t} \| \tilde{\bm u}^{n-1} - {\bm u}^{n-1} \|_{\mathcal{C}^{1,\alpha}}^{1 + \alpha}$. We first bound the error on the vorticity which will require the Eulerian version of the error map. Define \begin{gather} \label{eq:EEerror} {\bm E}_{[t_n, 0]} := {\bm X}_{[t_n,0]}^{-1} \circ {\bm \chi}_{[t_n,0]} = {\bm X}_{[0, t_n]} \circ {\bm E}_{[0,t_n]} \circ {\bm X}_{[t_n,0]}, \end{gather} here the conjugation exactly serves the purpose of changing the error from a Lagrangian frame to an Eulerian frame. We note that \begin{gather} \label{eq:compareVort} {\bm w}({\bm x},t_n) = (\nabla {\bm X}_B)^{-1} {\bm w}_0 ({\bm X}_B) \quad \text{and} \quad \tilde{\bm w}^n({\bm x}) = (\nabla {\bm \chi}_B)^{-1} {\bm w}_0 ({\bm \chi}_B), \end{gather} So we have that, using ${\bm \chi}_B = {\bm X}_B \circ {\bm E}_B$ and $(\nabla {\bm \chi}_B)^{-1} = \left( \nabla {\bm E}_B \right)^{-1} (\nabla {\bm X}_B)^{-1} |_{{\bm E}_B^{-1}} $ \begin{gather} \tilde{\bm w}^n = \left( \nabla {\bm E}_B \right)^{-1} {\bm w}^n ( {\bm E}_B ) \quad \text{i.e.} \quad \tilde{{\omega}}^n = {{\bm E}_B}^* {\omega}^n. \end{gather} The numerical vorticity is the pullback of the exact vorticity by the error map. This was expected since the exact map was decomposed into the composition of the numerical map and the error map. A first look at the velocity error, letting ${\bm \epsilon}_B = {\bm x} - {\bm E}_B$ assuming ${\bm \epsilon}_B$ small, we have to leading order terms \begin{gather} {\bm w}^n - \tilde{\bm w}^n \approx ( {\bm I} - (\nabla {\bm E}_B)^{-1} ){\bm w}^n ({\bm E}_B) + \nabla{\bm w}^n \cdot ({\bm x} - {\bm E}_B) \nonumber \\ \approx \nabla {\bm \epsilon}_B {\bm w}^n + \nabla {\bm w}^n {\bm \epsilon}_B . \end{gather} up to second order terms of $\mathcal{O}(\| {\bm \epsilon}_B \|^2)$. This gives us $\| {\bm w}^n - \tilde{\bm w}^n \|_{\mathcal{C}^{0,\alpha}} \lesssim \| {\bm \epsilon}_B \|_{\mathcal{C}^{1, \alpha}}$ for some $\alpha \in (0,1)$, which after Biot-Savart, yields \begin{gather} \| {\bm u}^n - \tilde{\bm u}^n \|_{\mathcal{C}^{1,\alpha}} \lesssim \| {\bm \epsilon}_B \|_{\mathcal{C}^{1, \alpha}} \end{gather} We use this to control the ${\bm \psi}_n$ error which is due to the difference between the numerical and the exact velocities as well as the interpolation and integration schemes both of which have $4^{th}$ order local truncation error. \begin{gather} \| {\bm \psi}_n \|_{\mathcal{C}^{1,\alpha}} \lesssim \Delta{t} \| {\bm \epsilon}_{[t_{n-1}, 0]} \|_{\mathcal{C}^{1,\alpha}}^{1+\alpha} + \mathcal{O}( \Delta{t}^4). \end{gather} Since the Lagrangian and Eulerian error maps are related by conjugation by the map ${\bm X}_{[t_n, 0]}$, we have that $\| {\bm \epsilon}_{[t_n, 0]} \|_{\mathcal{C}^{1,\alpha}} \lesssim \| {\bm \epsilon}_{[0, t_n]} \|_{\mathcal{C}^{1,\alpha}}^{1+\alpha}$ and vice-versa. Therefore, we can write the following estimate for the Eulerian error, up to leading order terms, using \eqref{eq:LErrorEst}: \begin{gather} \| {\bm \epsilon}_{[t_n, 0]} \|_{\mathcal{C}^{1,\alpha}}^{1/(1+\alpha)} \lesssim \sum_{k=1}^n \Delta{t} \| {\bm \epsilon}_{[t_{k-1}, 0]} \|_{\mathcal{C}^{1,\alpha}}^{1+\alpha} + \sum_{k=1}^n \left\| {\bm \varphi}_k\right\|_{\mathcal{C}^{1, \alpha}} . \end{gather} This can be majorized by the ODE by approximating the discrete sum of order $ \Delta{t}$ terms with the integral from 0 to $t = n \Delta{t}$ and taking a time derivative. \begin{gather} \label{eq:errorODE} \dot{{\bm \epsilon}}_B = (1 + \alpha){\bm \epsilon}_B^{\alpha/(1+\alpha)} ( {\bm \epsilon}_B^{1+\alpha} + A), \end{gather} where $A = \mathcal{O}( \Delta{t}^3) + \frac{1}{ \Delta{t}} \left\| {\bm \varphi}_k\right\|_{\mathcal{C}^{1, \alpha}}$, which is the CM advection error and is $\mathcal{O}( \Delta{t}^3+ \Delta{x}^3)$. We note that the H\"older-$\alpha$ norm was introduced artificially to gain the full 2 degrees of regularity from the Poisson equation in the Biot-Savart law. We can therefore pick $\alpha > 0$ arbitrarily small, in which case, the map error estimate ${\bm \epsilon}_B$ in \eqref{eq:errorODE} solves a regularly perturbed $1^{st}$ order linear ODE with a source term of $\mathcal{O}( \Delta{t}^3 + \Delta{x}^3)$. We recall that this is built on the assumption that the modified flow map $\tilde{\bm X}_{[t_{n}, 0]}$ is consistent with ${\bm X}_{[t_{n}, 0]}$ so that higher order error terms can be omitted; this is true since the initial $\tilde{\bm X}_{[t_{0}, 0]}$ is exact and the time-evolution of the error is third-order in $ \Delta{x}$ and $ \Delta{t}$ according to the above derivations. It is also assumed that ${\bm \chi}_{[t_n,0]} \circ \tilde{\bm X}_{[t_{n+1}, t_n]}$ is well represented by Hermite interpolation, i.e. that the spatial resolution is high enough and that the grid data of ${\bm \chi}_{[t_i,0]}$ do not oscillate unboundedly. This can be in part controlled by having high enough resolution and also by a remapping method discussed in the following section. The stability of the CM method was also discussed in \cite{nave2010gradient, CM, CME} and convergence of similar methods using Hermite interpolation was proven in \cite{goodrich2006hermite}. Overall, the CM method should have $\mathcal{O}( \Delta{x}^3 + \Delta{t}^3)$ error for the map in $\mathcal{C}^1$ norm which would translate to a $3^{rd}$ order global error. We provide here two numerical tests for the error estimates derived above. As a sanity check, we test the method on the stationary Arnold-Beltrami-Childress (ABC) flow so that the numerical solution can be compared against a known exact solution. We will also perform a second test using a standard Taylor-Green vortex initial condition, numerical results will be compared against a high-resolution reference test. Both tests are performed on a periodic domain $[-2\pi, 2\pi]^3$. The ABC flow initial condition is given by \begin{gather} {\bm w}_0(x,y,z) = \frac12 \left( \begin{matrix} \cos(y) + \sin(z) \\ \cos(z) + \sin(x) \\ \cos(x) + \sin(y) \end{matrix} \right), \end{gather} and the Taylor-Green initial condition is given by \begin{gather} {\bm w}_0 (x,y,z) = \left( \begin{matrix} \cos \left( \frac{x}{2} \right) \sin \left( \frac{y}{2} \right) \sin \left( z \right) \\ \sin \left( \frac{x}{2} \right) \cos \left( \frac{y}{2} \right) \sin \left( z \right) \\ -\sin \left( \frac{x}{2} \right) \sin \left( \frac{y}{2} \right) \cos \left( z \right) \end{matrix} \right) . \end{gather} We run each test on increasingly finer grids of $N$ cells per dimension for both ${\bm M}$ and ${\bm V}$ and using $N/12$ time steps to reach the final time. In both cases, the final time is $T_f = 2$, so that $ \Delta{x} = \frac{4 \pi}{N}$ and $ \Delta{t} = \frac{24}{N}$. For the ABC test, we measure the vorticity error using the exact solution ${\bm w}^n = {\bm w}_0$ and for the Taylor-Green vortex test, we measure the ${\bm w}$, ${\bm \chi}_B$ and $\nabla {\bm \chi}_B$ errors at grid points by comparing against a reference higher resolution test with $N = 216$. We note that for both tests the maximum velocity throughout the simulation is greater than 0.9 at all times so that $ \Delta{t}$ exceeds the CFL condition. The maximum vorticity for the ABC test is constant in time, for the Taylor-Green test, a $20\%$ growth is observed over the $[0, 2]$ time interval. Figures \ref{fig:convPlot1} and \ref{fig:convPlot2} show the $L^\infty$ errors for both tests at $T_f= 2$; the errors are computed directly from grid values and confirm the expected $3^{rd}$ order error. \begin{figure} \centering \includegraphics[width = 0.425\linewidth]{abcConv-eps-converted-to.pdf} \caption{$L^\infty$ vorticity error for the ABC test at $T_f=2$. Numerical solution is directly compared to the exact solution ${\bm w}({\bm x}, t) = {\bm w}_0({\bm x})$.} \label{fig:convPlot1} \end{figure} \begin{figure} \centering \includegraphics[width = 0.425\linewidth]{tgConv-eps-converted-to.pdf} \caption{$L^\infty$ map, Jacobian and vorticity errors for the Taylor-Green Vortex test at $T_f=2$. Error is calculated by comparing results against a $N=216$ test.} \label{fig:convPlot2} \end{figure} \subsection{Submap Decomposition} \label{sec:submapDecomp} The error estimates in section \ref{sec:ErrorEst} show that the error is advective in nature since the numerical solution can be written as the pullback of the exact solution by an error map; therefore, viscous and hyper-viscous type dissipation in the solution are avoided. Indeed, by computing the characteristic map, the vorticity field is provided functionally and can be evaluated anywhere on the domain by interpolating ${\bm \chi}_B$. Instead of directly evolving the vorticity on some grid, in which case $\tilde{\bm w}^n$ depends on the grid values of $\tilde{\bm w}^{n-1}$, the vorticity in the CM method is in principle ``reconstructed'' at every step using $\tilde{{\omega}}^n = {{\bm \chi}_{[t_n, 0]}}^* {\omega}_0$. For traditional grid-based methods, $\tilde{\bm w}^n$ is obtained from grid values of $\tilde{\bm w}^{n-1}$ and typically carries a viscous or hyper-viscous error of the form $\epsilon \Delta^p \tilde{\bm w}^{n-1}$, in the CM method, the error is instead advective with $\tilde{\bm w}^n = {{\bm E}_B}^* {\bm w}^n$, thus preventing the loss of subgrid scales due to artificial viscosity. One implication is that the CM method can better avoid artificial merging of vortices at the subgrid scale in particular in the study of vortex tube reconnection problems. The error in this case is of elastic type. Indeed, since ${\bm \chi}_B$ is evolved using the GALS method, the leading order spatial errors on the map are of the form $\epsilon \Delta^p {\bm \chi}_B$. This can be seen as an elasticity term which dampens extensive deformation of the domain under the ${\bm \chi}_B$ mapping. The evolution of the elasticity error is governed by the ${\bm \varphi}$ term in the error map. The ${\bm \varphi}$ map representation error depends on the ${\bm M}$ grid and the regularity of the characteristic map ${\bm X}_B$. For Hermite cubic interpolation, this error roughly scales with the $4^{th}$ spatial derivative of ${\bm X}_B$. At time $t=0$, this error is $0$ since ${\bm X}_{[0,0]}$ is the identity map, then the error increases with time as the characteristic map develops more complicated spatial features. We limit the growth of this error by periodically reinitializing the characteristic map using the group property of the flow maps. Indeed, a time $t$ characteristic map can be decomposed as follows using \eqref{eq:groupCompose}: \begin{gather} {\bm X}_{[t,0]} = {\bm X}_{[T_1, 0]} \circ {\bm X}_{[T_2, T_1]} \circ \cdots \circ {\bm X}_{[T_{m-1}, T_{m-2}]} \circ {\bm X}_{[t, T_{m-1}]} , \end{gather} for $0 = T_0 < T_1 < \cdots < T_{m-1} < T_m = t$. The $T_i$ are remapping times, in each interval $[T_{i}, T_{i+1}]$, the evolution of the characteristic map is given by the $T_{i+1}-T_i$ time flow of equations \eqref{eqs:CMsummary} with ${\bm w}({\bm x}, T_{i})$ as initial condition. \begin{remark} Note that the $T_i$ refer to the remapping times and $t_n$ are the time steps of the scheme with $t_n-t_{n-1} = \Delta{t}$ small, approximating the limit to 0. On the other hand $T_i - T_{i-1}$ is $\mathcal{O}(1)$, its purpose is to subdivide the time interval $[0, T_{final}]$ into shorter subintervals where the characteristic maps are better behaved. \end{remark} At any $t$, the vorticity is given by the following pullback using submap decomposition: \begin{gather} {\bm w}({\bm x}, t) = \left(\nabla {\bm X}_{[t, T_{m-1}]} \right)^{-1}\cdots \left(\nabla {\bm X}_{[T_{2}, T_{1}]} \right)^{-1} \left(\nabla {\bm X}_{[T_1, 0]} \right)^{-1} \left( {\bm w}_0 \circ {\bm X}_{[T_1, 0]} \circ \cdots \circ {\bm X}_{[t, T_{m-1}]} \right) . \end{gather} Numerically, this means that we can compute each submap individually and use \begin{gather} \label{eq:submapCompNum} \tilde{\bm w}(\cdot, t) = \left( \prod_{i=0}^{m-1} \left(\nabla {\bm \chi}_{[T_{m-i}, T_{m-i-1}]} \right)^{-1} \right) {\bm w}_0 \left( {\bm \chi}_{[T_1, 0]} \circ \cdots \circ {\bm \chi}_{[t, T_{m-1}]} \right) \end{gather} to compute the pullback. Each submap will only perform the mapping in the time subinterval $[T_i, T_{i+1}]$ and remapping times can be either fixed or chosen dynamically so that each submap can be well represented using the grid ${\bm M}$. Indeed, after each remapping, we essentially solve a separate Euler equation in the time interval $[T_i, T_{i+1}]$, the characteristic map is reinitialized with the identity map. This means that the spatial representation of the current submap is again exact and will accumulate error over $[T_i, T_{i+1}]$, until an error threshold is exceeded and remapping is triggered. In terms of the error estimates in section \ref{sec:ErrorEst}, the remapping resets the ${\bm \varphi}$ error of the $i^{th}$ submap to 0, which prevents further accumulation of spatial interpolation errors due to the fixed resolution of the ${\bm M}$ grid. One can therefore control the accumulation of the elasticity type error by changing the frequency of the remapping. More frequent remapping reduces the effect that the ${\bm M}$ grid has on the spatial features of the map; in the extreme case where remapping is done at every time step, the ${\bm \varphi}$ error can no longer accumulate and numerical error is reduced to ${\bm \psi}$ only. For the numerical experiments presented in this paper, we use the volume-preservation error of the ${\bm \chi}_B$ map as remapping criterion, that is, the remapping time $T_i$ is chosen to be the first time $t$ such that the error $|\det \nabla {\bm \chi}_{[t, T_{i-1}]} - 1|$ is greater than some chosen tolerance. On one hand, this serves as an \emph{a posteriori} estimate of the $\mathcal{C}^1$ error of the map and on the other hand, this allows us to guarantee that the composition of all submaps yields a diffeomorphism and provides some control on the overall volume-preserving property of the characteristic map. \subsection{Implementation Summary} The previous subsections contain the numerical tools for implementing the CM method for the 3D incompressible Euler equations, we give here a short summary of the method in pseudocode format. We note that the method uses two discretization grids, a grid ${\bm M}$ for representing the numerical map ${\bm \chi}_{[t_n, 0]}$ and a grid ${\bm V}$ for sampling the numerical vorticity ${\bm w}^n$ and computing the Biot-Savart law using Fourier spectral methods. These two grids do not need to have the same resolution, in fact, using the submap decomposition method described in the previous subsection, a short time characteristic map can be represented on a coarse grid ${\bm M}$. The ${\bm V}$ grid used to represent the vorticity needs to be fine enough to avoid sampling errors. Indeed, as the flow evolves, the vorticity can develop small scale features and high gradients. If ${\bm V}$ is not fine enough to resolve ${\bm w}^n$, this can cause aliasing errors in the Fourier transform. One way to reduce the effect of undersampling is to mollify ${\bm w}^n$ in Fourier space which was studied in \cite{CME}, however this also reduces the accuracy of the scheme. Other possibilities for future investigation include the use adaptive mesh for the vorticity sampling and wavelet methods for the computation of the Biot-Savart law \cite{schneider1997comparison, schneider2010wavelet}. The CM method for 3D incompressible Euler equations can be summarized with the following pseudocode algorithm. \begin{algorithm} \caption{CM method 3D incompressible Euler equations. \label{alg:CME3D}} \begin{algorithmic}[1] \Require{Initial vorticity ${\bm w}_0$, grids ${\bm M}$ and ${\bm V}$, time step $ \Delta{t}$, final time $T_f$} \State Initialize $n \gets 0$, $t_n \gets 0$, $m \gets 0$, $T_m \gets 0$. \While{$T_m < T_f$} \State ${\bm \chi}_{[t_n, T_m]} \gets {\bm x}$ (identity map) \While{$\| \det \nabla {\bm \chi}_{[t_n, T_m]} -1 \|_\infty < TOL $} \State Sample ${\bm w}^n$ on grid points of ${\bm V}$. \Comment{using \eqref{eq:submapCompNum}} \State $\mathcal{F}_{\bm V} [\tilde{\bm u}^n] = - \Laplace^{-1} \nabla \times \mathcal{F}_{\bm V} [ \tilde{\bm w}^n ]$. \State Compute $\partial^{\bm b} \tilde{\bm u}^n$ for ${\bm b} \in \{0,1\}^3$ in Fourier space. Define $\tilde{\bm u}^n({\bm x})$.\Comment{using \eqref{eq:defNumVelo}} \State Compute $(\tilde{\bm w}^n \cdot \nabla) \tilde{\bm u}^n - (\tilde{\bm u}^n \cdot \nabla)\tilde{\bm w}^n$ on ${\bm V}$ and define $\partial_t \tilde{\bm u}^n({\bm x})$. \Comment{using \eqref{eq:defNumdVelodt}} \State Define $\tilde{\bm u}({\bm x}, t)$, by linear combination of spatial interpolants. \Comment{using \eqref{eq:defNumFullVelo}} \State Compute $\partial^{\bm b} \tilde{\bm X}_{[t_n + \Delta{t}, t_n]}$ on ${\bm M}$ using RK3 integration of $\tilde{\bm u}$. \Comment{using \eqref{eq:defNumOSmap}} \State Update characteristic map ${\bm \chi}_{[t_{n+1}, T_m]} \gets \mathcal{H}_{{\bm M}} \left[ {\bm \chi}_{[t_{n}, T_m]} \circ \tilde{\bm X}_{[t_n + \Delta{t}, t_n]} \right]$. \State $t_{n+1} \gets t_n + \Delta{t}$, $n \gets n+1$. \EndWhile \State $T_{m+1} \gets t_n$, $m \gets m+1$. \EndWhile \end{algorithmic} \end{algorithm} \begin{remark} Since the discrete vorticity evaluation at line 5 in algorithm \ref{alg:CME3D} will eventually produce aliasing errors from undersampling, we will usually introduce a low-pass filter or a Fourier truncation at lines 6 and 8. This is the effective scale cut-off of the velocity field governing the discrete flow. As a rule of thumb, we pick this low-pass filter to be the coarsest scale in the discretization and the grid ${\bm V}$ to be the finest scale with ${\bm M}$ at an intermediate scale. This is to ensure that the map grid has enough resolution to represent a short-time deformation generated by the filtered velocity field, and also that the ${\bm V}$ grid is fine enough so that the Hermite interpolation of the filtered velocity is accurate and preserves the divergence-free property. \end{remark} \section{Numerical Tests} \label{sec:numTests} In this section, we present several numerical tests computed using the CM method for the 3D incompressible Euler equations. The algorithm is implemented in C using OpenMP parallelization and Discrete Fourier transforms are performed using the FFTW library \cite{FFTW05}. The tests in this section are performed on a laptop computer with an AMD Ryzen 7 4800H CPU with 8 cores (16 threads) and 16GB of RAM; for these tests, a wallclock computation time is recorded. The larger FFT computations for the spectrum plots are performed on a cluster computer. The application of spatial adaptivity was not studied in this work, however, the general formulation allows for the use of adaptive grids; this has been studied for the Gradient-Augmented Level-Set methods in \cite{kolomenskiy2016adaptive} which should be straightforwardly extendable to the CM methods. \subsection{Perturbed Antiparallel Vortex Tubes} \label{sec:numTestKerr} The question of finite-time blow-up in the solution of the 3D incompressible Euler equations is an important open problem in mathematics. One extensively studied initial condition for potentially generating a finite-time blow-up are the perturbed antiparallel vortex tubes studied by Kerr in 1993 \cite{kerr1993evidence}. In the viscous case, for the Navier-Stokes equations, this initial condition evolves into a vortex reconnection in the process of which a topological change of the vortex cores occurs. The initial condition can be constructed as the pullback of two antiparallel vortex tubes by a shear-deformation of the $[-2\pi, 2\pi]^3$ periodic domain. The initial vorticity field is antisymmetric across the $z = 0$ plane with each half-space containing a vortex tube of opposite orientation. We construct the initial condition ${\bm w}_0$ as follows. Consider the unperturbed vortex tube in the $z>0$ half given by \begin{gather} \label{eq:vortexTubeIC} {\bm \varphi}_+ (x,y,z) = \exp \left( \frac{-r^2}{1-r^2} + r^4(1+ r^2 + r^4) \right) \left( \begin{matrix} 0 \\ 1 \\ 0 \end{matrix} \right) \quad \text{ if } \quad r < 1 , \end{gather} and is the zero vector if $r \geq 1$. Here, $r$ is the scaled distance from the vortex core given by \begin{gather} r(x,y,z) = R^{-1}\sqrt{(x-x_0)^2 + (z-z_0)^2}. \end{gather} This forms a vortex tube oriented in the $y$-direction centered at $x=x_0$, $z=z_0$ and supported in a tube of radius $R$. One can check that this initial condition is divergence-free and therefore a valid vorticity field on the flat 3-torus. The pair of antiparallel vortex tubes is given by \begin{gather} {\bm \varphi} (x,y,z) = {\bm \varphi}_+ (x,y,z) - {\bm \varphi}_+(x,y,-z). \end{gather} The vortex tubes are perturbed by the following domain deformation: \begin{gather} {\bm T} : \left( \begin{matrix} x \\ y \\ z \end{matrix} \right) \mapsto \left( \begin{matrix} x + \delta_x \cos \left( \frac{\pi}{L_x} s(y) \right) \\ y \\ z + \delta_z \cos \left( \frac{\pi}{L_z} s(y) \right) \end{matrix} \right), \end{gather} where \begin{gather} s(y) = y + L_y \delta_{y2} \sin\left( \pi y /L_y \right) + L_y \delta_{y1} \sin \left( y + L_y \delta_{y2} \sin\left( \pi y /L_y \right) \right) . \end{gather} The perturbed vortex tubes are then defined as the pullback $({\bm T}^{-1})^* {\bm \varphi} $. A closed form expression can be obtained using $({\bm T}^{-1})^* {\bm \varphi} = \nabla {\bm T} |_{{\bm T}^{-1}} {\bm \varphi} ({\bm T}^{-1})$ and the fact that ${\bm T}$ is a shear-deformation, and for a fixed $y$, ${\bm T}$ is simply a translation on the $x$-$z$ plane. The initial vorticity ${\bm w}_0$ used in \cite{kerr1993evidence, hou2006dynamic, yao2020physical} is defined as a filtered and rescaled version of the above perturbed vortex tubes given by \begin{gather} {\bm w}_0 = 8 K * ({\bm T}^{-1})^* {\bm \varphi} . \end{gather} The exact expression for the filter $K$ might have been slightly different in references \cite{kerr1993evidence} and \cite{hou2006dynamic}, here we use the filter $K$ defined in Fourier space by $\hat{K} ({\bm \xi}) = \exp (-0.05(\xi_1^4 + \xi_2^4 + \xi_3^4))$ where $\xi_i$ are the integer wave numbers. The specific parameters for the initial condition, taken from \cite{hou2006dynamic}, are $R = 0.75, \, \delta_{y1} = 0.5, \, \delta_{y2} = 0.4, \, \delta_x = -1.6, \, \delta_z = 0, \, x_0 = 0, \, z_0 = 1.57, \, L_x = L_y = 4 \pi, \, L_z = 2 \pi$. Figure \ref{fig:kerrInit} shows a level-set surface of the initial condition. \begin{figure} \centering \includegraphics[width = 0.35\linewidth]{kerrvtx000.png} \caption{Initial vortex tubes for the Kerr initial condition \cite{kerr1993evidence}. The figure shows the level-set surface of $|{\bm w}_0|$ at 0.4015 which is $60\%$ of the maximum value.} \label{fig:kerrInit} \end{figure} We first perform a low-resolution simulation using a laptop computer. The simulation is carried out on a ${\bm M}$ grid of $64 \times 48 \times 32$ points and vorticity sampling is computed on a ${\bm V}$ grid of $96 \times 72 \times 48$ points; here the $z$-direction is most finely sampled as important higher frequencies are expected to be produced in that direction, similarly, the $y$-direction has the coarsest representation. The resulting Fourier series is truncated at a radius of $32$, the time steps are fixed at $1/50$ and the Jacobian determinant error tolerance $| \det \nabla {\bm \chi}_B -1|$ for the remapping is set at $10^{-3}$. The initial condition is defined on a $128^3$ grid, we then compute its mixed-partial derivatives in Fourier space in order to define a Hermite cubic interpolant. The simulation is run until time $t=17$ requiring a total of $79$ submaps, taking under an hour of wallclock computation time. Figure \ref{fig:vtxKerrEvolve} shows the evolution of the vortex cores throughout the simulation and table \ref{tab:kerrSim} contains the energy and helicity conservation errors as well as total enstrophy and maximum vorticity and velocity evaluated at regular time intervals. The energy is defined as the squared $L^2$ norm of the velocity in the $[-2 \pi, 2\pi]^3$ domain $\| {\bm u} \|_{L^2}^2$, the total enstrophy is $\| {\bm w} \|_{L^2}^2$ and the helicity is defined as the $L^2$ inner-product of the velocity and the vorticity, $H := ({\bm u}, {\bm w})_{L^2}$. \begin{remark} We note here that the Fourier truncation or filtering used in the computation of the velocity field from the sampled vorticity is not related to the 2/3 rule typically used in Fourier pseudo-spectral methods, whose purpose is to dealias spurious modes generated by the frequency convolutions when computing the nonlinear term in physical space in each time step. In the CM method, there is no direct time-stepping of the velocity and vorticity fields, at each step, the vorticity is reconstructed by direct sampling of the functional expression in equation \eqref{eq:submapCompNum}. Since all map computations are carried out on a coarse grid ${\bm M}$, the purpose of the filtering is to ensure that the velocity field defined from the sampled vorticity is sufficiently band-limited so that the backward flow map it generates is regular enough to be accurately represented on ${\bm M}$. In the extreme cases where the vorticity field exhibits important subgrid scales, essentially discontinuous from a numerical point of view, this filtering can help prevent the Gibbs phenomenon from generating spurious oscillations in the entire domain. Ultimately, the size of the truncation would scale with the resolution of ${\bm M}$ to maintain consistency. This filtering is not always necessary, without filtering, the effective truncation of the Fourier series for the velocity will be the grid size of ${\bm M}$ as higher frequencies in the flow cannot be represented on ${\bm M}$. However, our numerical experiments suggest that a small amount of smoothing generates better results with more accurate energy and helicity conservation. \end{remark} \begin{figure} \centering \begin{subfigure}{0.32\linewidth} \centering \includegraphics[width = \linewidth]{kerrvtx003.png} \caption{$t=3$} \end{subfigure} \begin{subfigure}{0.32\linewidth} \centering \includegraphics[width = \linewidth]{kerrvtx006.png} \caption{$t=6$} \end{subfigure} \begin{subfigure}{0.32\linewidth} \centering \includegraphics[width = \linewidth]{kerrvtx009.png} \caption{$t=9$} \end{subfigure} \caption{Evolution of the vortex cores for the Kerr initial condition. We show level-set surfaces of $|{\bm w}|$ at 0.4105, 0.5435 at 0.7519 for times 3, 6 and 9 respectively, which is $60\%$ of the maximum value. Figures are generated using a $128^3$ grid.} \label{fig:vtxKerrEvolve} \end{figure} \begin{table}[h] \centering \begin{tabular}{| r || c | c | c | c | c | r | r |} \hline & & & & & & & \\[-1em] $t$ & $\| {\bm w} \|_{L^2}^2$ & $\| {\bm u} \|_{L^2}^2 / \| {\bm u}_0 \|_{L^2}^{2} -1 $ & $H - H_0$ & $ \| {\bm w} \|_{L^{\infty}} $ & $ \| {\bm u} \|_{L^{\infty}} $ & $n_{maps}$ & time (s) \\[0.2em] \hline \hline 0 & 67.2181 & $0.000\times 10^{0}$ & $0.000\times 10^{0}$ & 0.6691 & 0.7393 & 1 & 0 \\ 1 & 67.0990 & $1.341\times 10^{-6}$ & $-5.619\times 10^{-14}$ & 0.6666 & 0.7272 & 1 & 102 \\ 2 & 67.3909 & $1.744\times 10^{-6}$ & $-1.717\times 10^{-13}$ & 0.6715 & 0.7131 & 1 & 206 \\ 3 & 68.0925 & $1.989\times 10^{-7}$ & $-2.849\times 10^{-13}$ & 0.6841 & 0.7019 & 1 & 310 \\ 4 & 69.1954 & $-1.406\times 10^{-6}$ & $3.333\times 10^{-13}$ & 0.7387 & 0.7171 & 2 & 416 \\ 5 & 70.6844 & $-1.663\times 10^{-6}$ & $5.680\times 10^{-13}$ & 0.8181 & 0.7350 & 2 & 524 \\ 6 & 72.5405 & $-2.369\times 10^{-6}$ & $8.913\times 10^{-13}$ & 0.9059 & 0.7501 & 3 & 633 \\ 7 & 74.7460 & $-3.141\times 10^{-6}$ & $1.129\times 10^{-12}$ & 1.0046 & 0.7622 & 4 & 746 \\ 8 & 77.2912 & $-4.061\times 10^{-6}$ & $1.218\times 10^{-12}$ & 1.1179 & 0.7715 & 5 & 861 \\ 9 & 80.1845 & $-5.020\times 10^{-6}$ & $-2.656\times 10^{-12}$ & 1.2532 & 0.7785 & 6 & 981 \\ 10 & 83.4644 & $-6.245\times 10^{-6}$ & $-7.347\times 10^{-12}$ & 1.4181 & 0.7833 & 8 & 1108 \\ 11 & 87.2154 & $-7.793\times 10^{-6}$ & $-4.307\times 10^{-12}$ & 1.6296 & 0.7864 & 10 & 1240 \\ 12 & 91.5883 & $-1.012\times 10^{-5}$ & $-3.304\times 10^{-12}$ & 1.9121 & 0.7885 & 13 & 1382 \\ 13 & 96.8361 & $-1.246\times 10^{-5}$ & $8.511\times 10^{-12}$ & 2.2935 & 0.7920 & 18 & 1538 \\ 14 & 103.3978 & $-8.680\times 10^{-6}$ & $3.923\times 10^{-11}$ & 2.8495 & 0.8013 & 25 & 1719 \\ 15 & 112.1115 & $1.893\times 10^{-5}$ & $4.295\times 10^{-11}$ & 3.8549 & 0.8223 & 37 & 1935 \\ 16 & 124.5780 & $9.829\times 10^{-5}$ & $-2.643\times 10^{-11}$ & 5.6541 & 0.8545 & 56 & 2208 \\ 17 & 143.8254 & $2.633\times 10^{-4}$ & $1.910\times 10^{-10}$ & 9.1819 & 0.9052 & 79 & 2558 \\ \hline \end{tabular} \caption{Evolution of total enstrophy, energy conservation relative error (divided by initial energy), helicity conservation error (initial helicity is 0), maximum vorticity and velocity, number of remaps and wallclock computation time of the Kerr initial condition using CM method for 3D Euler. Grid resolutions: $64 \times 48 \times 32$ for ${\bm M}$, $96 \times 72 \times 48$ for ${\bm V}$, $ \Delta{t} = 1/50$, Fourier truncation at radius $32$, remapping Jacobian determinant tolerance at $10^{-3}$. All data in this table are evaluated using a grid of resolution $256^3$.} \label{tab:kerrSim} \end{table} \begin{remark} \label{rmk:locatemax} We note that the vorticity maxima $\| {\bm w} \|_{L^{\infty}}$ shown in table \ref{tab:kerrSim} are lower bounds since they are evaluated using a $256^3$ grid. The actual maximum vorticity of the numerical solution is higher. Using the arbitrary resolution property of the method, we can refine this computation by recursively refining the vorticity sampling around the maxima. For instance, on a grid of $N^3$ points, we can locate the vorticity maximum on the grid and resample the vorticity in a region of size $3 \Delta{x}$, again using a grid of $N^3$ points. With $N = 256$, 3 iterations of the above procedure allows us to estimate the vorticity maximum to 3.8618, 5.7674 and 9.5185 for times 15, 16 and 17 respectively. This shows reasonable agreement with the high resolution reference computations performed in \cite{hou2006dynamic}. \end{remark} The functional definition of the vorticity field through the pullback by ${\bm \chi}_B$ provides arbitrary resolution of the solution independently of the discretization grids. This allows us to zoom in on the solution, in particular for larger times $t$ where the vorticity starts developing significant small scale features. Figure \ref{fig:vtxKerrZoom} shows zoomed views of the vortex tubes and contour plots of the vorticity intensity across the symmetry plane $y=0$. We note that the vertical length of the viewed domain is $0.25$, a bit more than the width of a single cell of the map grid ${\bm M}$. The domain deformation at time $t=17$ cannot be represented properly using a single map on the ${\bm M}$ grid, however, through the dynamic remapping method, the full deformation at time $t=17$ can be represented using the composition of $79$ short-time submaps defined on a coarse $64 \times 48 \times 32$ grid. The vorticity field $\tilde{\bm w}$ defined by pullback through the $79$ submaps is therefore able to exhibit small scale features and high gradients as shown in figure \ref{fig:vtxKerrZoom}. \begin{figure} \centering \begin{subfigure}{0.485\linewidth} \centering \includegraphics[width = 0.45 \linewidth]{kerrvtxZoom014.png} \hspace*{5pt} \includegraphics[width = 0.45 \linewidth]{kerrvtxContour014colorbar.png} \caption{$t=14$} \end{subfigure} \begin{subfigure}{0.485\linewidth} \centering \includegraphics[width = 0.45 \linewidth]{kerrvtxZoom015.png} \hspace*{5pt} \includegraphics[width = 0.45 \linewidth]{kerrvtxContour015colorbar.png} \caption{$t=15$} \end{subfigure} \begin{subfigure}{0.485\linewidth} \centering \includegraphics[width = 0.45 \linewidth]{kerrvtxZoom016.png} \hspace*{5pt} \includegraphics[width = 0.45 \linewidth]{kerrvtxContour016colorbar.png} \caption{$t=16$} \end{subfigure} \begin{subfigure}{0.485\linewidth} \centering \includegraphics[width = 0.45 \linewidth]{kerrvtxZoom017.png} \hspace*{5pt} \includegraphics[width = 0.45 \linewidth]{kerrvtxContour017colorbar.png} \caption{$t=17$} \end{subfigure} \caption{Zoomed view of the vortex core from $t=14$ to $17$ and contour plot of the vorticity strength $|{\bm w}|$ across the symmetry plane $y=0$; 10 isoline values evenly distributed from 0 to 2.8929, 3.8618, 5.7677 and 10.0798 are shown for times 14, 15, 16, and 17, respectively. Viewed domain: $[-5.5, 0] \times [0, 1] \times [0, 0.25]$. Contour plots are generated using $512^2$ 2D grids. We note that this is a much finer local sampling of the vorticity field compared to the data in table \ref{tab:kerrSim} and thus able to resolve a higher vorticity maximum (see remark \ref{rmk:locatemax}).} \label{fig:vtxKerrZoom} \end{figure} As seen from table \ref{tab:kerrSim}, the remapping routine is triggered more frequently as the simulation approaches $t=17$, meaning that the Jacobian determinant error accumulates at an increasing rate in part due to a lack of spatial resolution. One often used measurement of the smoothness of the solution is the isotropic spectrum of the Fourier series given by \begin{subequations} \begin{gather} E(k) = \frac12 \sum_{|{\bm \xi}| \in [k-\frac12, k+\frac12)} \left| \mathcal{F}[\tilde{\bm w}]({\bm \xi}) \right|^2 \\ Z(k) = \frac12 \sum_{|{\bm \xi}| \in [k-\frac12, k+\frac12)} \left| \mathcal{F}[\tilde{\bm u}]({\bm \xi}) \right|^2 \end{gather} \end{subequations} We plot the enstrophy and energy spectra of the solution at times $t=14$ to $17$ in figure \ref{fig:spectra_c}. \begin{figure} \centering \begin{subfigure}{0.485\linewidth} \centering \includegraphics[width = \linewidth]{kerr_ens-eps-converted-to.pdf} \caption{Enstrophy} \end{subfigure} \begin{subfigure}{0.485\linewidth} \centering \includegraphics[width = \linewidth]{kerr_enr-eps-converted-to.pdf} \caption{Energy} \end{subfigure} \caption{Enstrophy and energy spectra at times $t= 14, 15, 16$ and $17$. Dotted black lines are the $k^{-1}$ and $k^{-3}$ curves, respectively. Successive finer sampling are shown, red curves are obtained from $256^3$ sampling, blue curves from $1024^3$ and black curves from $1536^3$ sampling. The highest resolution sampling for each time $t$ is drawn in full-line, coarser samplings for the same $t$ are shown as dotted-lines.} \label{fig:spectra_c} \end{figure} The spectrum plots in figure \ref{fig:spectra_c} demonstrate a key property of the CM method: that the resolution scale of the map is not the dissipation scale of the vorticity solution, the vorticity field itself is not being dissipated in a viscous manner, and therefore can be resolved to arbitrary resolution. Indeed, although all computations were carried out on coarse grids and the Fourier support of the velocity field evolving the map is only a ball of radius 32, we can reconstruct the vorticity field by computing a fine grid pullback by evaluating the maps and applying equation \eqref{eq:submapCompNum}. Figure \ref{fig:spectra_c} shows that the vorticity and velocity fields obtained this way have the expected decay in their Fourier transforms. These can be compared with Figs. 17 and 18 in \cite{hou2006dynamic} and general agreement is found. The vorticity field ${\bm w}^n = \left(\nabla {\bm \chi}_{[t_n, 0]} \right)^{-1} {\bm w}_0 ({\bm \chi}_{[t_n, 0]}({\bm x}) )$, defined functionally (i.e. ${\bm \chi}_B$ evaluated by interpolation and ${\bm w}_0$ by direct function evaluation), contains arbitrary fine scales until round-off errors dominate. The reason for this arbitrary resolution is twofold: Firstly, since the discretized quantity is the characteristic map, the pointwise definition of the vorticity field can in fact be viewed as Lagrangian. Indeed, consider a particle starting at position ${\bm y}$ at time $t=0$, its position at time $t$ is given by the forward map ${\bm X}_F({\bm y}, t)$ and the vorticity field at the particle location is given by ${\bm w}({\bm X}_F({\bm y}, t), t) = \nabla {\bm X}_F({\bm y}, t) \cdot {\bm w}_0({\bm y})$. In order to obtain the vorticity at an Eulerian point ${\bm x}$ at time $t$, we plug in ${\bm y} = {\bm X}_B({\bm x}, t)$ and use the inverse property \eqref{eq:groupInverse} to get ${\bm w}({\bm x}, t) = (\nabla {\bm X}_B)^{-1} {\bm w}_0 ({\bm X}_B)$. This means that by interpolating the discrete map ${\bm \chi}_B$ at an Eulerian point ${\bm x}$, we are approximating a particle path and the associated local material deformation of a Lagrangian particle whose time $t$ position is ${\bm x}$; the time $t$ vorticity is then directly constructed from the initial condition by applying the material deformation. This can also be expressed using the error map studied in \ref{sec:ErrorEst}, where the numerical vorticity field can be written as the pullback of the exact vorticity by an error map ${\bm E}_B$: $\tilde{\bm w}^n = {{\bm E}_B}^* {\bm w}^n$. Therefore, since ${\bm E}_B$ is a $C^1$ diffeomorphism, as long as the error is controlled, the pullback ${{\bm E}_B}^* {\bm w}^n$ will not destroy small scales. The functional definition of $\tilde{\bm w}^n$ by pullback therefore allows us to oversample the vorticity on a $1536^3$ grid even though all computations were carried out on much coarser grids. For traditional Eulerian methods, in order to preserve these small scales and prevent large artificial dissipation, the vorticity field will have to be discretized and evolved on a $1536^3$ grid throughout the entire computation. With the CM method, these scales are not lost to dissipation and can be obtained by a fine grid sampling. Secondly, the map error can be controlled using the submap decomposition method made possible by the group structure of the characteristic maps. Indeed, the map error ${\bm E}_B$ arises in part from the error in approximating \textit{SDiff}$(U)$ by a finite-dimensional interpolation space $\mathcal{V}$. As the flow develops, the small scale features in ${\bm X}_B$ not resolved in $\mathcal{V}$ increase, adding to the ${\bm E}_B$ error. Through the remapping method, this representation error is reset to 0 for each submap since the initial condition for each new submap is the identity map, which is represented exactly in $\mathcal{V}$. Appropriate remapping therefore guarantees that each submap ${\bm X}_{[T_{i+1}, T_i]}$ can be well represented in $\mathcal{V}$ and that its numerical error remains in the asymptotic regime, i.e. the omitted small scales are not significant enough to pollute the large scale, lower frequency features which carry most of the energy. The resulting global-time map ${\bm \chi}_B$ is obtained as the composition of $n_{maps}$ submaps; ${\bm \chi}_B$ can be seen as an element of $\mathcal{V}^{n_{maps}}$ and therefore is able to represent the small scales features generated by the long-time flow through the composition of coarse grid maps. Another feature of the CM method is that we have access to the solution operator ${\bm X}_B$ of the advection under the velocity field ${\bm u}$, this means that we can evolve passively advected quantities at no additional computational cost. This has several applications such as tracking passively transported fluid quantities or solute densities or visualization of the fluid flow. As example we solve the following scalar advection problem using the initial vorticity strength $| {\bm w}_0 |$ as initial condition: \begin{subequations} \label{eqs:vtxAdv} \begin{gather} (\partial_t + {\bm u} \cdot \nabla) \phi = 0 \\ \phi({\bm x}, 0) = | {\bm w}_0({\bm x}) | . \end{gather} \end{subequations} From \ref{sec:CMM}, the solution to this advection equation is given by $\phi({\bm x}, t) = | {\bm w}_0 \circ {\bm X}_{[t, 0]} |$. This gives us the evolution of the initial vortex strength as a passively advected quantity. In figure \ref{fig:advKerrEvolve}, we show a level-set surface of $\phi$ at $60\%$ the maximum value; this allows us the track the motion of the initial vortex core transported under the fluid flow. We note that this does not correspond to the evolution of the actual vortex core as the vortex stretching can play an important role in moving the location of the vortex core. \begin{figure} \centering \begin{subfigure}{0.24\linewidth} \centering \includegraphics[width = \linewidth]{kerrAdv004.png} \caption{$t=4$} \end{subfigure} \begin{subfigure}{0.24\linewidth} \centering \includegraphics[width = \linewidth]{kerrAdv008.png} \caption{$t=8$} \end{subfigure} \begin{subfigure}{0.24\linewidth} \centering \includegraphics[width = \linewidth]{kerrAdv012.png} \caption{$t=12$} \end{subfigure} \begin{subfigure}{0.24\linewidth} \centering \includegraphics[width = \linewidth]{kerrAdv016.png} \caption{$t=16$} \end{subfigure} \caption{Transport of the initial vortex core. We show level-set surfaces of $\phi$ at 0.4015, which is $60\%$ of the maximum value. Figures are generated using a $128^3$ grid.} \label{fig:advKerrEvolve} \end{figure} \subsection{Perturbed Perpendicular Vortex Tubes} \label{sec:numTestCross} Another test we performed is the merging of two perturbed perpendicular vortex tubes inspired by the tests in \cite{pelz1997locally}. The initial condition is constructed in a similar fashion as in section \ref{sec:numTestKerr}. The unperturbed vortex tube is given by \eqref{eq:vortexTubeIC} with $R = 0.5, \, x_0 = 0, \, z_0 = -1$. We apply the perturbation transformations ${\bm T} : [-2\pi, 2\pi]^3 \to [-2\pi, 2\pi]^3$ given by a sinusoidal shear deformation ${\bm T} : x \mapsto x -0.5 \sin(0.5 y)$ and a reflection and translation map ${\bm R} : (x,y,z) \mapsto (y, x, z+2)$. The two vortex tubes are then defined as \begin{gather} {\bm \varphi} = ({\bm T}^{-1})^* {\bm \varphi}_+ + ({\bm R}^{-1})^*({\bm T}^{-1})^* {\bm \varphi}_+ , \end{gather} which corresponds to a sinusoidal vortex tube in the $y$-direction through $(x,z) = (0, -1)$ combined with a reflected tube in the $x$-direction through $(y,z) = (0, 1)$. The initial vorticity field is given as a scaled and filtered version of ${\bm \varphi}$ where the filter is the same as the one used in section \ref{sec:numTestKerr}, \begin{gather} {\bm w}_0 = 24K*{\bm \varphi} . \end{gather} Figure \ref{fig:crossInit} shows a level-set surface of this initial condition. \begin{figure} \centering \includegraphics[width = 0.45\linewidth]{crossvtx000.png} \caption{Initial condition for the perpendicular vortex tubes test. The figure shows the level-set surface of $|{\bm w}_0|$ at 0.5402, which is $60\%$ of the maximum value.} \label{fig:crossInit} \end{figure} These two vortex tubes will start rotating around each other, creating high vorticity gradients and significant small scale features. In the viscous case, the vortices are expected to collide at the intersection. Figure \ref{fig:vtxCrossEvolve} shows the evolution of the vortex tubes computed from a simulation using a $48^3$ grid for both ${\bm M}$ and ${\bm V}$, the Hermite cubic interpolation of the velocity field uses a $96^3$ grid to ensure sufficient smoothness. The time step $ \Delta{t}$ is fixed at $1/50$, Fourier truncation radius at $32$ and the Jacobian determinant error tolerance at $10^{-3}$. Due to the significant localized small scale features, the vorticity computation uses the adaptive sampling described in the appendix \ref{append:vtxSmp}. The mollifier $\mu_h$ is given by a tensor product of a 1D function $\cos^2 \left(\frac{\pi s}{2 h} \right)$ in each cell. The cell integral \eqref{eq:mollIntCell} is computed by numerical quadrature using equidistributed sample points in each cell. The number of sample points per cell is at minimum 2 points per dimension and for each cell, this number is allowed to increases adaptively depending on the range and total variation of ${\bm w}$ in each cell. The total number of sample points is capped at $192^3$ at which point all cells have their sample number rescaled down proportionally. The results of this test until time $t=12$ are presented in table \ref{tab:crossSim}. Figure \ref{fig:vtxCrossEvolve} shows the evolution of the vortex cores until time $t=9$. To better visualize the flow, we also include in figure \ref{fig:advCrossEvolve} the scalar advection of the initial vorticity strength $\phi_0 = | {\bm w}_0 |$ as given by equation \eqref{eqs:vtxAdv}. \begin{figure} \centering \begin{subfigure}{0.32\linewidth} \centering \includegraphics[width = \linewidth]{crossvtx003.png} \caption{$t=3$} \end{subfigure} \begin{subfigure}{0.32\linewidth} \centering \includegraphics[width = \linewidth]{crossvtx006.png} \caption{$t=6$} \end{subfigure} \begin{subfigure}{0.32\linewidth} \centering \includegraphics[width = \linewidth]{crossvtx009.png} \caption{$t=9$} \end{subfigure} \caption{Evolution of the vortex cores for the perpendicular vortex tubes test. We show the level-set surfaces of $|{\bm w}|$ at 0.6817, 0.8192 and 1.2450 for times 3, 6 and 9 respectively which is $60\%$ of the maximum value. Figures are generated using a $324^3$ grid.} \label{fig:vtxCrossEvolve} \end{figure} \begin{figure} \centering \begin{subfigure}{0.32\linewidth} \centering \includegraphics[width = \linewidth]{crossAdv003.png} \caption{$t=3$} \end{subfigure} \begin{subfigure}{0.32\linewidth} \centering \includegraphics[width = \linewidth]{crossAdv006.png} \caption{$t=6$} \end{subfigure} \begin{subfigure}{0.32\linewidth} \centering \includegraphics[width = \linewidth]{crossAdv009.png} \caption{$t=9$} \end{subfigure} \caption{Transport of the initial vortex core. We show level-set surfaces of $\phi$ at 0.5402, which is $60\%$ of the maximum value. Figures are generated using a $324^3$ grid.} \label{fig:advCrossEvolve} \end{figure} \begin{table}[h] \centering \begin{tabular}{| r || c | c | c | c | c | r | r |} \hline & & & & & & & \\[-1em] $t$ & $\| {\bm w} \|_{L^2}^2$ & $\| {\bm u} \|_{L^2}^2 / \| {\bm u}_0 \|_{L^2}^{2} -1 $ & $H /H_0 - 1$ & $ \| {\bm w} \|_{L^{\infty}} $ & $ \| {\bm u} \|_{L^{\infty}} $ & $n_{maps}$ & time (s) \\[0.2em] \hline \hline 0 & 125.7910 & $0.000\times 10^{0}$ & $0.000\times 10^{0}$ & 0.9004 & 0.9684 & 1 & 0 \\ 1 & 126.9290 & $-7.816\times 10^{-4}$ & $2.296\times 10^{-3}$ & 0.9183 & 0.9644 & 1 & 187 \\ 2 & 130.3522 & $-3.043\times 10^{-3}$ & $8.889\times 10^{-3}$ & 1.0317 & 0.9478 & 1 & 381 \\ 3 & 136.0808 & $-6.604\times 10^{-3}$ & $1.901\times 10^{-2}$ & 1.1361 & 0.9331 & 2 & 586 \\ 4 & 144.1831 & $-1.117\times 10^{-2}$ & $3.160\times 10^{-2}$ & 1.2187 & 0.9431 & 3 & 801 \\ 5 & 154.8535 & $-1.636\times 10^{-2}$ & $4.557\times 10^{-2}$ & 1.2885 & 0.9794 & 4 & 1027 \\ 6 & 168.4914 & $-2.178\times 10^{-2}$ & $5.988\times 10^{-2}$ & 1.3653 & 1.0208 & 8 & 1568 \\ 7 & 185.7193 & $-2.707\times 10^{-2}$ & $7.354\times 10^{-2}$ & 1.4806 & 1.0495 & 14 & 2386 \\ 8 & 207.4032 & $-3.201\times 10^{-2}$ & $8.561\times 10^{-2}$ & 1.6472 & 1.0636 & 22 & 3380 \\ 9 & 234.9474 & $-3.648\times 10^{-2}$ & $9.518\times 10^{-2}$ & 2.0750 & 1.0697 & 30 & 4691 \\ 10 & 271.2813 & $-4.048\times 10^{-2}$ & $1.015\times 10^{-1}$ & 3.3802 & 1.0602 & 40 & 6442 \\ 11 & 322.7244 & $-4.403\times 10^{-2}$ & $1.038\times 10^{-1}$ & 6.7721 & 1.0433 & 51 & 8489 \\ 12 & 400.7262 & $-4.733\times 10^{-2}$ & $1.024\times 10^{-1}$ & 14.1254 & 1.0929 & 64 & 10391 \\ \hline \end{tabular} \caption{Evolution of total enstrophy, energy conservation relative error (divided by initial energy), helicity conservation relative error (divided by initial helicity), maximum vorticity and velocity, number of remaps and wallclock computation time of the perturbed perpendicular vortex tubes initial condition using CM method for 3D Euler. Grid resolutions: $48^3$ for ${\bm M}$, $48^3$ for ${\bm V}$, $ \Delta{t} = 1/50$, adaptive sampling with mollifier convolution is used for the vorticity, Fourier truncation at radius $32$, remapping Jacobian determinant tolerance at $10^{-3}$. All data in this table are evaluated using a grid of resolution $256^3$.} \label{tab:crossSim} \end{table} \begin{figure} \centering \begin{subfigure}{0.8\linewidth} \centering \includegraphics[width = 0.32 \linewidth]{zoom1zCV012colorbar.png} \includegraphics[width = 0.32 \linewidth]{zoom1yCV012colorbar.png} \includegraphics[width = 0.32 \linewidth]{zoom1xCV012colorbar.png} \caption{Box width $ = \pi$.} \end{subfigure} \begin{subfigure}{0.8\linewidth} \centering \includegraphics[width = 0.32 \linewidth]{zoom2zCV012colorbar.png} \includegraphics[width = 0.32 \linewidth]{zoom2yCV012colorbar.png} \includegraphics[width = 0.32 \linewidth]{zoom2xCV012colorbar.png} \caption{Box width $ = \frac{\pi}{16}$.} \end{subfigure} \caption{Contour plot of vorticity strength $|{\bm w}|$ at time $t=12$, centered at $(x,y,z) = (2.15, 1.5, 1.425)$; 10 isoline values evenly distributed in the range of each frame are shown. From left to right, contours on: $xy$- plane, $xz$-plane and $yz$-plane. The isoline ranges are $[0.0047, 12.7748]$, $[0.0075, 4.2412]$, $[0.0351, 14.3722]$, $[0.4072, 3.9227]$, $[0.4049, 3.6989]$ and $[0.4049, 3.5640]$. Figures are produced using a $1024^2$ 2D grid. We note that this is a much finer local sampling of the vorticity field compared to the data in table \ref{tab:crossSim} and thus able to resolve a higher vorticity maximum. } \label{fig:vtxCrossZoom} \end{figure} \begin{figure} \centering \begin{subfigure}{0.8\linewidth} \centering \includegraphics[width = 0.32 \linewidth]{zoom1zCA012colorbar.png} \includegraphics[width = 0.32 \linewidth]{zoom1yCA012colorbar.png} \includegraphics[width = 0.32 \linewidth]{zoom1xCA012colorbar.png} \caption{Box width $ = \pi$.} \end{subfigure} \begin{subfigure}{0.8\linewidth} \centering \includegraphics[width = 0.32 \linewidth]{zoom2zCA012colorbar.png} \includegraphics[width = 0.32 \linewidth]{zoom2yCA012colorbar.png} \includegraphics[width = 0.32 \linewidth]{zoom2xCA012colorbar.png} \caption{Box width $ = \frac{\pi}{16}$.}\label{fig:advCrossZoom2} \end{subfigure} \caption{Contour plot of the transported initial vorticity $\phi$ at time $t=12$, centered at $(x,y,z) = (2.15, 1.5, 1.42)$, 10 isoline values evenly distributed in the range of each frame are shown. From left to right, contours on: $xy$- plane, $xz$-plane and $yz$-plane. The isoline ranges are $[0.0007, 0.7435]$, $[0.0013, 0.7435]$, $[0.0102, 0.7220]$, $[0.1049, 0.6729]$, $[0.0977, 0.6729]$ and $[0.1117, 0.6729]$. Figures are produced using a $1024^2$ 2D grid.} \label{fig:advCrossZoom} \end{figure} The small scale features that develop in the flow after $t=9$ become very fine and make 3D visualization difficult. We present instead three 2D contour plots on the $xy$-, $xz$- and $yz$- planes, respectively. Figures \ref{fig:vtxCrossZoom} and \ref{fig:advCrossZoom} show zoomed views on the lateral cuts of the vorticity magnitude and the advected initial vorticity strength. The highest zoom shows a domain of width $\pi/16$ corresponding to $1/64$ of the computational domain, i.e. smaller than a single cell of the advection grid. In figure \ref{fig:vtxCrossZoom}, we can see a presence of a high vorticity gradient at time $t=12$ and the formation of a vortex sheet. Figure \ref{fig:advCrossZoom} shows more clearly the material deformations which lead to this high gradient. Indeed, the advected initial vorticity shows that two separate level-sets of the vorticity were pushed close together by the flow. The yellow region squeezed between the blue curves in \ref{fig:advCrossZoom2} was formed from the flattening of the initial vortex tubes. However, the absence of a highly concentrated vorticity peak in \ref{fig:vtxCrossZoom} in contrast to \ref{fig:advCrossZoom} suggests that the vorticity direction was not fully aligned with the strain tensor eigenvector of the largest eigenvalue indicating that the vortex streching term attenuated the vorticity gradient in this region. This nicely illustrates that vortex streching can be quantified locally. \section{Conclusion} \label{sec:conclu} In this paper, we presented a novel numerical method for solving the 3D incompressible Euler equations. This method is based on the Gradient-Augmented Level-Set and Jet-Scheme frameworks and extends the previous work on the CM method for the 2D Euler equations, studied in \cite{CME}. Taking a more geometric approach, we proposed a reformulation of the CM framework which allows for the vortex stretching term in 3D to be seamlessly incorporated. The approach in this paper can be summarized as follows: we evolve numerically the backward characteristic map, i.e. the backward-in-time flow map generated by the fluid velocity. This map is in fact the transition map between the Eulerian and Lagrangian coordinate charts. From the Kelvin circulation theorem, the time $t$ vorticity field, expressed as a differential 2-form, can be computed from the pullback of the initial vorticity by the characteristic map, thereby allowing for vortex line deformation and stretching. The Biot-Savart law of the vorticity is then computed using Fourier spectral methods to provide the velocity field needed to further evolve the map. This reformulation was motivated by the fact that direct integration of the vortex stretching term as a generic source term does not preserve the characteristic structure of the method and nullifies some of its numerical advantages. The geometric approach we proposed here allows us to retain all numerical properties of the CM method previously shown in \cite{CME}. Firstly, the functional representation of the vorticity field through pullback by the characteristic map preserves the fine scales generated by the inviscid flow. This is demonstrated by the tests in section \ref{sec:numTests}, notably, the energy and enstrophy spectra plots in section \ref{sec:numTestKerr} show that by oversampling the vorticity on a fine grid, high frequency features of the solution can be accurately reconstructed. Secondly, the rapid growth in the solution gradient can be efficiently resolved using the group structure of the characteristic map; the submap decomposition allows us to achieve multiplicative growth in the spatial resolution using only fast coarse grid map computations. As seen in section \ref{sec:numTestKerr}, the flow of the vortex reconnection test can be evolved up to time $t=17$ using 79 coarse grid maps of size $64\times 48\times 32 $, whereas purely Eulerian pseudospectral methods would require computations on grid sizes of order $1024^3$ to achieve comparable results. Lastly, by defining the vorticity 2-form as the pullback of the initial condition by the map, we preserve the non-dissipative property of the CM method, this was shown theoretically in the error estimates in section \ref{sec:ErrorEst} where we found that the error is in fact advective and that the numerical vorticity is related to the exact vorticity by pullback by an error map. Similar to the Lagrangian-Averaged Euler-$\alpha$ equations and the Kelvin-filtered turbulence models \cite{foias2001navier}, the solution is obtained from a nonlinear dispersive perturbation of the equation. This was also supported by the numerical tests which showed that subgrid structures are preserved and that the spectrum plots of the solutions do not exhibit the exponential decay associated to artificial viscous dissipation; as a matter of fact, higher frequency modes can be reconstructed by finer samplings of the solution. This work constitutes a first investigation of the CM method for the 3D incompressible Euler equations, we demonstrated here the key properties of the method and studied its numerical accuracy. This opens numerous directions for future research. For instance, the inclusion of forcing terms which conform to the characteristic structure of the method could be of interest. Extensions to the framework to take into account different geometries and domain boundaries is also an important subject of further investigation. Furthermore, the numerical tests in section \ref{sec:numTestKerr} suggest that, with additional extensions in terms of spatial and temporal adaptivity or improvements in the discretization spaces and basis functions, more efficient higher resolution simulations using the CM method could produce new insights into the blow-up question for the Euler equations. We believe that the CM method provides a novel and unique approach for the simulation of inviscid flows, and offers a suitable framework for the numerical study of fluid dynamics. \section*{Acknowledgements} The authors acknowledge partial funding from the Agence Nationale de la Recherche (ANR), grant ANR-20-CE46-0010-01. Additionally, JCN acknowledges partial support from the NSERC Discovery Grant program.
\section{Introduction} Compliant mechanisms (CMs) are established concepts in industry and academia offering various advantages over traditional linkage-based counterparts, e.g., less wear and tear, low manufacturing and assembly cost, repeatability and high precision, lack of frictional losses, to name a few. Due to such promising advantages, their usage is continuously rising in a wide variety of applications \cite{frecker1997topological,howell2001compliant,kumar2019compliant,kumar2021topology,ananthasuresh2021art}. These mechanisms characterized via monolithic designs are termed CMs, since their functionality arises from the elastic deformations of their flexible (compliant) members in response to the input forces. Finding the optimum balance between output deformation and stiffness when designing CMs is a nontrivial task. Topology optimization (TO) has been shown to be an effective approach for designing such mechanisms \cite{zhu2020design}. TO is a computational design technique able to achieve the optimized material distribution within a given design domain by extremizing the conceptualized (desired) objectives under a known set of physical and geometrical constraints \cite{sigmund2013topology}. In a general structural setting, the design domain is parameterized using finite elements (FEs). Each FE is assigned a material density design variable $\rho_i\in[0,\,1]$. Here, $\rho_i=1$ and $\rho_i=0$ represent solid and void states of the $i^\text{th}$ FE, respectively. Ideally, FEs with $\rho=1$ should constitute the optimized CMs. Actuating forces of CMs can be recognized as either \textit{design-dependent}, e.g., pneumatic, hydraulic pressure loads, or \textit{design-independent}, e.g., constant forces. Design-dependent pressure loads\footnote{We henceforth for brevity write pressure loads instead of design-dependent pressure loads.} alter their magnitude, location and/or direction as the design boundary on which they act evolves during the TO process. Consequently, such loads pose many challenges for the TO formulation, e.g., locating a valid surface to apply the loads, relating pressure field to the design vector, and evaluating consistent nodal forces and their sensitivities with respect to the design vector \cite{kumar2020topology}. \textit{Pressure-actuated CMs (P-CMs)} constitute a relatively novel category of mechanisms that find application in e.g. pneumatically or hydraulically actuated soft robots (mechanisms) \cite{chen2018topology,luo2020topology}. Note however that, in order to attain maximum flexibility, CMs designed via classical TO are prone to exhibit single-node-connected hinges and gray density FEs (0<$\rho$<1) in the optimized designs \cite{sigmund1997design,yin2003design}. Such features cannot be realized, and in order to render the design manufacturable, post-processing of the optimized geometry is necessary which can severely affect the optimized performance. This challenge is found in P-CMs designed by TO as well, where it can be even more detrimental given the close relation between boundary shape and loading. A schematic figure of a P-CM is depicted in Fig.~\ref{fig:Schematic} wherein the pressure loading boundary moves from its initial surface $\Gamma_{\text{p}}$ to the final (optimized) surface $\Gamma_{\text{p}_{b}}$. Furthermore, Fig.~\ref{fig:Schematic} depicts a single-node hinge and region with gray FEs. Given the negative effect such features have on the manufacturability and performance of P-CMs, it is important to control and avoid them. The need to generate P-CM designs whose actual performance closely matches the simulated optimized performance forms the motivation for the present study. \begin{figure} \centering \includegraphics[scale=1]{Schematic2-eps-converted-to} \caption{Schematic diagram of a pressure-actuated compliant mechanism. $\Gamma_{\text{p}_{0}}$ and $\Gamma_\text{p}$ are the boundaries with zero and finite pressure loading, respectively. $\Gamma_{\text{p}_{b}}$ is the final pressure boundary for the optimized CM. A single-node hinge and a region with gray FEs are also depicted.} \label{fig:Schematic} \end{figure} First we discuss existing approaches in TO of pressure-loaded structures and introduce the method used in this work. Hammer and Olhoff \cite{Hammer2000} were first to present an approach to design pressure-loaded structures. A fictitious thermal loading setting was exploited to solve pressure-loaded design problems by Chen and Kikuchi \cite{Chen2001}. Sigmund and Clausen \cite{Sigmund2007} used the mixed-finite element method \cite{zienkiewicz2005finite} with a three-phase material (solid, void, fluid) formulation in their approach. The mixed-finite element approaches require satisfaction of the BB condition for the stability in the FE analysis \cite{zienkiewicz2005finite}. Chen et al. \cite{chen2001advances} employed the approach presented in \cite{Chen2001} to design P-CMs. Panganiban et~al. \cite{Panganiban2010} used a nonconforming FE method which is not a standard FE method. Vasista and Tong \cite{vasista2012design} used the solid isotropic material with penalization (SIMP) and the moving isosurface threshold methods in their approach. de Souza and Silva \cite{de2020topology} also employed the method proposed in \cite{Sigmund2007}. In our previous study \cite{kumar2020topology}, the authors presented a design method using Darcy's law in conjunction with a drainage term. In that work we also demonstrated the importance of load sensitivities in designing of the P-CMs. The method proposed in \cite{kumar2020topology} uses the standard FE formulation, provides consistent sensitivities and was found to work well in generating P-CMs for two- and three-dimensional as well \cite{kumar2020topology3Dpressure}. Therefore, it will also be used in the present study. For the design optimization process to be useful and reliable, it is important that as-fabricated P-CMs perform similar to the prediction made by the numerical simulation used in the optimization process. However, with existing methods a significant decline in actual performance can arise compared to the numerical predictions, as noted above. This is primarily due to three factors: (A) inaccurate and/or approximate conversion of one-node-connected hinges to thin-flexible regions (Fig.~\ref{fig:pointconnection}) and inaccuracies introduced by unrealistic representation of thin, flexible regions in FE models used in TO, (B) CMs being overly sensitive to manufacturing inaccuracies or arbitrariness in design extraction (Fig.~\ref{fig:thresolding}), and (C) the use of small displacement analysis and linear elasticity assumptions for the P-CM designs. Firstly, one-node-connected hinges (Fig.~\ref{fig:pointconnection}), artificially stiff locations, appear due to deficiencies in the FE analysis with quadrilateral FEs that permit load transfer with zero rotational stiffness \cite{sigmund1997design,yin2003design}. Such hinges pose challenges in accurate design interpretation of the optimized mechanisms, since real compliant hinges will always have a finite rotational stiffness \cite{sigmund1997design,yin2003design}. One of the methods for approximating a one-node-connected location for fabrication may be as depicted in Fig.~\ref{fig:pointconnection}, which results in a thin-flexible region and thus, the performance of the numerical design (Fig.~\ref{fig:pointconnection}-a$_1$) will differ from that of the fabricated one (Fig.~\ref{fig:pointconnection}-a$_2$). Various ways have been proposed to prevent formation of single-node-connected hinges in CMs \cite{poulsen2003new,yin2003design,saxena2007honeycomb,wang2011projection}, but these have not yet been applied to and evaluated for P-CM TO. \begin{figure} \begin{subfigure}[t]{0.48\textwidth} \centering \includegraphics[scale=0.5]{nodeconnection-eps-converted-to} \caption{} \label{fig:pointconnection} \end{subfigure} \begin{subfigure}[t]{0.48\textwidth} \centering \includegraphics[scale=0.50]{shifting2-eps-converted-to} \caption{} \label{fig:thresolding} \end{subfigure} \caption{ Schematic diagrams for a single-node connection and design thresholding are depicted in (\subref{fig:pointconnection}) and (\subref{fig:thresolding}), respectively. (\subref{fig:pointconnection}) shows one of the ways to approximate the design around a single-node connection into a thin-flexible region and therefore, the fabricated mechanisms may have lower performance than the corresponding numerical results. (\subref{fig:thresolding}) depicts how the different threshold material densities result in different material layouts for manufacturing and thus, performance of the fabricated P-CM depends upon the threshold density one chooses during design extraction.} \label{fig:Schematicdiagram} \end{figure} Secondly, in a standard density-based TO setting with a gradient-based optimizer, it is difficult to obtain pure 0-1 solutions (Fig.~\ref{fig:Schematic}). Therefore, extraction of the optimized designs based on the considered density threshold (Fig.~\ref{fig:thresolding}) is required, which invariably alters the final designs and thus, the performances with respect to the numerical predictions. Fig.~\ref{fig:thresolding} illustrates a scenario to indicate how the different threshold material densities lead to different material (contour) layouts (Fig.~\ref{fig:thresolding}-b$_1$ and Fig.~\ref{fig:thresolding}-b$_2$) and thus, the corresponding fabricated P-CM and potentially also its loading (significantly) differs from that obtained via TO. Thirdly, a typical P-CM or CM may experience large deflection and also, contact between branches, i.e., self-contact \cite{kumar2017implementation,kumar2019computational} and external/mutual contact \cite{kumar2016synthesis,kumar2019computational} thus, TO design approaches must include nonlinear mechanics (with contact formulation) to predict mechanism performance \cite{kumar2016synthesis,kumar2019computational}. However, nonlinear structural analysis poses various challenges in TO \cite{van2014element,kumar2021topology}, which can even get more pronounced in combination with pressure loads whose magnitude, direction and/or location vary and follow the surfaces/facets where they are applied. To model the characteristics of pressure loads, one needs to include the follower force concepts in the design approach, which demands a dedicated and in-depth investigation within a TO setting, which is out of the scope of this paper. Therefore, instead of addressing this point at the TO stage, we choose to investigate and assess its influence based on the P-CM designs generated using linear modeling. To address the outlined challenges, in this study we take the following approaches: \begin{enumerate} \item The robust or three-field formulation \cite{wang2011projection} is adopted to address problems A and B, by its ability to impose a minimum length scale and to reduce the sensitivity of the final design to post-processing or manufacturing errors. \item Nonlinear FEA is used to analyze optimized P-CM designs with a neo-Hookean hyperelastic material model and increased pressure loads to investigate the large deformation behavior and to determine the limitations of the linear elastic assumptions. \end{enumerate} While the robust formulation \cite{wang2011projection} is expected to solve factors A and B given results reported in literature \cite{wang2011projection}, this has as of yet not been investigated or confirmed for P-CM, which is the specific interest of this study. Next to this, the nonlinear FEA study is not intended as a solution to the lack of large-displacement analysis during P-CM TO, but our aim is to provide a quantitative assessment of the severity of the error introduced by this simplification, in representative design cases. In addition, nonlinear finite element analyses are used to assess the sensitivity of standard and robust P-CMs to design extraction choices/ manufacturing errors. Due to computational limitations and for clarity of presentation this study has been carried out in a 2D setting. Its findings nonetheless are expected to apply to general 3D cases as well. This paper is organized as follows. Sec.~\ref{Sec:Desingdependentpressureloads} presents modeling of the pressure loads as a function of the design vector using the Darcy law with a drainage term, in line with \cite{kumar2020topology}. Using a transformation matrix, the consistent nodal loads are evaluated. The TO formulation with the robust approach together with the corresponding sensitivity analysis is described in Sec.~\ref{Sec:TOformulation}. Next, in Sec.~\ref{Sec:Numericalexamples} numerical examples of designing robust pressure-actuated inverter and gripper mechanisms are presented. The optimized P-CM designs are extracted, and nonlinear FE analyses are performed in ABAQUS with high pressure loads to investigate large deformation behavior of the CMs. Lastly, conclusions are drawn in Sec.~\ref{Sec:Closure}. \section{Design-dependent pressure load modeling and consistent nodal forces}\label{Sec:Desingdependentpressureloads} In this section, modeling of the pressure field as a function of the design variables, finite element formulation and consistent nodal loads evaluation are summarized. For a detailed description, we refer to our previous paper \cite{kumar2020topology}. As per the Darcy law, one evaluates flux $\bm{q}$ in terms of the pressure gradient $\nabla p$, the permeability $\kappa$ of the medium and the fluid viscosity $\mu$ as \begin{equation}\label{eq:Darcyflux} \bm{q} = -\frac{\kappa}{\mu}\nabla p = -K(\bar{\rho}) \nabla p, \end{equation} where $\bar{\rho}$ and $K(\bar{\rho})$ represent the physical density (see Sec.~\ref{Sec:TOformulation}) and the flow coefficient of an FE, respectively. In a typical density-based TO setting, an FE displays two states, therefore the actual flow coefficient $K(\bar{\rho_e})$ of an FE is determined using the flow coefficients associated to its solid and void phases interpolated by a smooth Heaviside projection function $\mathcal{H}(\bar{{\rho_e}},\,\beta_\kappa,\,\eta_\kappa)$ as \begin{equation}\label{Eq:Flowcoefficient} K(\bar{\rho_e}) = K_v\left(1-(1-\epsilon) \mathcal{H}(\bar{{\rho_e}},\,\beta_\kappa,\,\eta_\kappa)\right), \end{equation} where $\mathcal{H}(\bar{{\rho_e}},\,\beta_\kappa,\,\eta_\kappa) = \frac{\tanh{\left(\beta_\kappa\eta_\kappa\right)}+\tanh{\left(\beta_\kappa(\bar{\rho_e} - \eta_\kappa)\right)}}{\tanh{\left(\beta_\kappa \eta_\kappa\right)}+\tanh{\left(\beta_\kappa(1 - \eta_\kappa)\right)}}$, and $\epsilon=\frac{K_s}{K_v}$ is the flow contrast \cite{kumar2020topology3Dpressure}. $K_s$ and $K_v$ indicate the flow coefficients of the solid and void states, respectively. Further, $\eta_\kappa$ and $\beta_\kappa$ control the step position and the slope of $K(\bar{\rho_e})$, respectively. In addition, a drainage term $Q_\text{drain}$ conceptualized in \cite{kumar2020topology} and numerically qualified in \cite{kumar2020topology3Dpressure} is employed that helps achieve a localized pressure gradient at solid-void interfaces. It is defined in terms of a drainage coefficient $D(\bar{\rho_e})$, instantaneous pressure field $p$ and output pressure $p_{\text{ext}}$ as \begin{equation} {Q}_\text{drain} = -D(\bar{\rho_e}) (p - p_{\text{ext}}), \end{equation} where the drainage coefficient $D(\bar{\rho_e}) = D_{\text{s}}\mathcal{H}(\bar{{\rho_e}},\,\beta_d,\,\eta_d)$. $\beta_\text{d}$ and $\eta_\text{d}$ are two parameters that control the values of $D(\bar{\rho_e})$. $D_\text{s}$ is the drainage coefficient of a solid FE, which is equal to \cite{kumar2020topology} \begin{equation}\label{Eq:hsrelation} D_\text{s} =\left(\frac{\ln{r}}{\Delta s}\right)^2 K_\text{s}, \end{equation} where $r$ is the ratio of input pressure at depth $\Delta$s, i.e., $p|_{\Delta s} = rp_\text{in}$ and the penetration depth $\Delta s$ can be set equal to the width or height of a few FEs. Using $Q_\text{drain}$, Eq.~\ref{eq:Darcyflux} transpires per \cite{kumar2020topology} as \begin{equation}\label{Eq:stateequation} \nabla.\bm{q} -Q_\text{drain} = 0. \end{equation} In a discrete FE setting, one writes the weak form of Eq.~\ref{Eq:stateequation} for an FE with domain $\Omega_e$ as \cite{kumar2020topology} \begin{equation} \label{Eq:PDEsolutionpressure} \begin{aligned} \underbrace{\int_{\Omega_e}\left( K~ \trr{\matr{B}}_p \matr{B}_p + D ~\trr{\matr{N}_p} \matr{N}_p \right)d {\Omega_e}}_{\matr{A}_e}~\matr{p}_e = \underbrace{\int_{\Omega_e}~D~\trr{\matr{N}}_p p_\text{ext} ~~d {\Omega_e} - \int_{\Gamma_e}~ \trr{\matr{N}}_p \matr{q}_\Gamma \cdot \matr{n}_e~~d {\Gamma_e}}_{\matr{f}_e}, \end{aligned} \end{equation} where $\matr{p}_e$ is the pressure field to be evaluated, $\matr{B}_p =\nabla\matr{N}_p$ with $\mathbf{N}_\text{p} = [N_1,\, N_2,\,N_3,\,N_4]$ are the bi-linear shape functions for a quadrilateral FE. $\matr{Ap} = \matr{f}$ is the global form of Eq.~\ref{Eq:PDEsolutionpressure} with $\matr{p}$ is the global pressure load vector. In this work, $p_\text{ext}$ and $\matr{q}_\Gamma$ are set to zero, therefore $\matr{f}=\matr{0}$, i.e., $\matr{Ap}=\matr{0}$. Using the obtained global pressure field $\matr{p}$, the consistent global nodal forces $\matr{F} = -\matr{T}\matr{p}$ are determined using a transformation matrix $\matr{T}$ whose elemental form $\matr{T}_e$ is related to that of nodal force $\matr{F}_e$ as \cite{kumar2020topology} \begin{equation}\label{Eq:Forcepressureconversion} \matr{F}^e = \matr{T}_e\,\matr{p}_e = -\int_{\mathrm{\Omega}_e} \trr{\matr{N}}_\matr{u} \matr{B}_p d {\mathrm{\Omega}_e}\, \matr{p}_e, \end{equation} where $\mathbf{N}_\mathbf{u} = [N_1\mathbf{I},\, N_2\mathbf{I},\,N_3\mathbf{I},\,N_4\mathbf{I}]$ with $\mathbf{I}$ the identity matrix in $\mathcal{R}^2$. In summary, one employs Eq.~\ref{Eq:PDEsolutionpressure} for determining the pressure field, whereas the corresponding consistent nodal force vector for an FE is evaluated using Eq.~\ref{Eq:Forcepressureconversion}. Note that through the use of smooth Heaviside functions the loads are a differentiable function of the density variables. This allows performing load sensitivity analysis readily, as detailed in \cite{kumar2020topology} and further elaborated in Sec.~\ref{Subsec:Sensitivityanalysis}. \section{Robust P-CM topology optimization formulation}\label{Sec:TOformulation} The three-field ($\bm{\rho},\,\tilde{\bm{{\rho}}},\,\bar{\bm{\rho}}$) representation of the design domain is considered \cite{lazarov2016length}. The filtered design variable $\tilde{\rho_j}$ of element~$j$ is determined using weighted average of the design variables $\rho$ pertaining to neighboring FEs lying within a circular region of radius $r_\text{fill}$ \cite{bruns2001topology}. Mathematically, \begin{equation}\label{Eq:densityfilter} \tilde{\rho_j} = \frac{\sum_{k=1}^{N_e} v_k \rho_k w(\matr{x}_k)}{\sum_{k=1}^{N_e} v_k w(\matr{x}_k)} \end{equation} where $N_e$ is the total number of neighboring elements of the $j^\text{th}$ FE, and $v_k$ is the volume of neighboring element~$k$. The weight function $w(\matr{x}_k)= \max\left(0,\,1-\frac{d}{r_\text{fill}}\right)$, wherein $d = ||\matr{x}_j -\matr{x}_k||$ is a Euclidean distance between centroids $\matr{x}_j$ and $\matr{x}_k$ of elements $j$ and $k$, respectively. $r_\text{fill}$ is called filter radius for the considered design problems. The derivative of $\tilde{\rho_j}$ (Eq.~\ref{Eq:densityfilter}) with respect to $\rho_k$ is \begin{equation}\label{Eq:derivativefilteractual} \pd{\tilde{\rho_j}}{\rho_k} = \frac{v_k w(\matr{x}_k)}{\sum_{i=1}^{N_e}v_i w(\matr{x}_i)}. \end{equation} The physical design variable $\bar{\rho}_j$ is defined as \cite{wang2011projection} \begin{equation}\label{Eq:projectionfilter} \bar{\rho_j}(\tilde{\rho_j},\,\beta,\,\eta) = \frac{\tanh{\left(\beta \eta\right)} + \tanh{\left(\beta (\tilde{\rho_j}-\eta)\right)}}{\tanh{\left(\beta \eta\right)} + \tanh{\left(\beta (1-\eta)\right)}}, \end{equation} where $\beta\in[0,\,\infty)$ and $\eta\in[0,\,1]$ control the steepness and the threshold of the projection function, respectively. To achieve the optimized solutions close to black and white designs, typically $\beta$ is increased from an initial value~$\beta_\text{int}=1$ to a maximum value $\beta_{\max}$ using a continuation strategy. $\eta=0$ ensures the minimum length scale on the solid phase \cite{wang2011projection}, whereas that of solid phase is obtained using $\eta=1$. Note that when using $\eta=0$ and $\eta= 1$, Eq.~\ref{Eq:projectionfilter} yields the Heaviside step approximation function given in \cite{guest2004achieving} and the modified Heaviside step approximation function mentioned in \cite{sigmund2007morphology}, respectively. The derivative of $\bar{\rho_j}$ with respect to $\tilde{\rho_j}$ is \begin{equation}\label{Eq:derivativeprojectionfilter} \pd{\bar{\rho_j}}{\tilde{\rho_j}} = \beta\frac{1-\tanh(\beta(\tilde{\rho_j} -\eta))^2}{\tanh{\left(\beta \eta\right)} + \tanh{\left(\beta (1-\eta)\right)}}. \end{equation} Having noted the derivatives in Eqs.~\ref{Eq:derivativefilteractual} and \ref{Eq:derivativeprojectionfilter}, the chain rule is used to determine the derivatives of a function $f$ with respect to $\rho_k$ as \begin{equation}\label{Eq:ChainRule} \pd{f}{\rho_k} = \sum_{j= 1}^{Ne}\pd{f}{\bar{\rho_j}}\pd{\bar{\rho_j}}{\tilde{\rho_j}}\pd{\tilde{\rho_j}}{\rho_k}, \end{equation} where $\pd{f}{\bar{\rho_j}}$ is evaluated using the adjoint-variable method (see Sec.~\ref{Subsec:Sensitivityanalysis}). We use the modified SIMP (Simplified Isotropic Material with Penalization) method to interpolate the Young's modulus of each FE using its physical design variable $\bar{\rho_j}$ as \begin{equation}\label{Eq:SIMPModel} E_1(\bar{\rho_j}) = E_0 + (\bar{\rho_j})^\zeta(E_1 -E_0), \qquad \bar{\rho_j}\in [0,\,1] \end{equation} where $E_1$ and $E_0$ are Young's moduli of the solid and void phases of an FE, respectively. The material contrast, i.e., $\frac{E_0}{E_1} = 10^{-6}$ is set, and the penalty factor $\zeta=3$ is used in order to steer the topology optimization towards a \textquoteleft0-1' solution. \subsection{Robust formulation} The robust formulation is employed wherein three physical density fields, i.e., dilated $\bm{\bar{\rho}}^d$, intermediate (blueprint) $\bm{\bar{\rho}}^i$ and eroded $\bm{\bar{\rho}}^e$, are considered for the design domain \cite{wang2011projection}. Erosion and dilation are morphological image operators, which can be used in TO for e.g. robustness and feature size control \cite{sigmund2007morphology}. Assuming uniform manufacturing errors, maximum and minimum manufacturing limits are indicated by the dilated and eroded designs respectively, whereas the intermediate (blueprint) ones denote the desired manufacturing limit. Here, 0.5$+\Delta\eta$, 0.5 and 0.5$-\Delta\eta$ in Eq.~\ref{Eq:projectionfilter} are used in place of $\eta$ to evaluate $\bm{\bar{\rho}}^e$, $\bm{\bar{\rho}}^i$ and $\bm{\bar{\rho}}^d$, respectively. The deviation $\Delta\eta \in[0,\,0.5]$ is a user defined parameter, which in combination with the filter radius $r_\text{fil}$ determines the minimum length scale on the solid and void phases \cite{trillet2021analytical}. The optimization problem is formulated as a min-max problem \cite{wang2011projection} \begin{equation}\label{Eq:actualoptimization} \small \begin{rcases} & \underset{\bm{\rho}}{\text{min}}:\text{max} & &: \left(f_0(\bar{\bm{\rho}}^d(\bm{\rho})),\,f_0(\bar{\bm{\rho}}^i(\bm{\rho})),\,f_0(\bar{\bm{\rho}}^e(\bm{\rho}))\right) \\ & \textit{s.t.} & &:\mathbf{A(\bm{\rho}}^l)\mathbf{p}(\bm{\rho}^l) = \mathbf{0},\,\qquad l = d,\,i,\,e \\ & & &\quad\mathbf{K(\bm{\rho}}^l)\mathbf{u}(\bm{\rho}^l) = \mathbf{F} = -\mathbf{D} \mathbf{p}(\bm{\rho}^l)\\ & & &\quad\mathbf{K(\bm{\rho}}^l)\mathbf{v}(\bm{\rho}^l) = \mathbf{F}_\mathrm{d}\\ & &&\quad V(\bar{\bm{\rho}}^d(\bm{\rho}))-V_d^*\le 0 \\ & &&\quad\matr{0}\le\bm{\rho}\le\matr{1} \end{rcases}, \end{equation} where $f_0$ is a multi-criteria objective aimed at obtaining effective compliant mechanisms \cite{saxena2000optimal} defined by $-\mu\frac{MSE}{SE}$, with $MSE = \trr{\mathbf{v}}\matr{Ku}$ and $SE = \frac{1}{2}\trr{\matr{u}}\matr{Ku}$. $MSE$ and $SE$ represent the mutual strain energy and strain energy of the mechanism, respectively. $\mu$ is the scaling factor used to scale the objective for optimizer compatibility. Note that the multi-criteria objective proposed in \cite{frecker1997topological} finds an optimum trade-off between the flexibility and strength of the mechanisms. $V(\bar{\bm{\rho}}^d(\bm{\rho})) =\sum_{m=1}^{n_e} V_m\bar{{\rho}}^d_m$, where $V_m$ is the volume of $m^\text{th}$ element whose dilated density is $\bar{{\rho}}^d_m$. The volume constraint is imposed using the dilated design wherein the actual volume of the dilated design is updated after a specific number of optimization iterations such that the volume of the intermediate design becomes equal to the permitted one at the end of the optimization when the volume constraint becomes active~\cite{wang2011projection}. Further, $V_d^* = \frac{V_i^*}{{V(\bar{\bm{\rho}}^i(\bm{\rho}))}}V(\bar{\bm{\rho}}^d(\bm{\rho}))$, where $V_d^*$ denotes upper limit of the volume fraction of the dilated design, $V_i^*$ and $V(\bar{\bm{\rho}}^i(\bm{\rho}))=\sum_{m=1}^{n_e} V_m\bar{{\rho}}^i_m(\bm{\rho})$ are the prescribed and actual volumes of the intermediate design, respectively. The robust formulation (Eq.~\ref{Eq:actualoptimization}) requires solutions to three state equations pertaining to $\mathbf{u,\,p,\,v}$ fields and also furnishes three optimized designs with only one design vector $\bm{\rho}$. The discreteness of the optimized solutions is measured using a gray scale indicator $M_\text{nd}$ defined as \cite{sigmund2007morphology} \begin{equation} M_\text{nd} = \frac{\displaystyle\sum_{e=1}^{n_{e}}4(\bar{\rho_e})(1-\bar{\rho_e})}{n_{e}}, \end{equation} where $n_{e}$ is the total number of elements employed to discretize the design domain. \begin{figure} \begin{subfigure}[t]{0.45\textwidth} \centering \includegraphics[scale=1]{InverterDesign-eps-converted-to} \caption{} \label{fig:inverter} \end{subfigure} \begin{subfigure}[t]{0.45\textwidth} \centering \includegraphics[scale=1]{GripperDesign-eps-converted-to} \caption{} \label{fig:gripper} \end{subfigure} \caption{Symmetric half design domains of the mechanisms. (\subref{fig:inverter}) Inverter design domain and (\subref{fig:gripper}) Gripper design domain. The dimensions of the design domains are $L_x =\SI{0.02}{\meter}$ and $L_y = \SI{0.01}{\meter}$, where $L_x$ and $L_y$ indicate dimensions in $x-$ and $y-$directions, respectively. In both mechanisms, the input pressure load is applied on the left edge, and zero pressure is applied at the other edges except the symmetric boundary. Symmetric boundaries and fixed boundaries are also depicted. Workpiece stiffnesses are represented via the output springs with stiffnesses $k_\text{ss}$. In gripper mechanism domain, a non-design void region having area $\frac{L_x}{5}\times\frac{L_x}{5}$ and a solid region having area $\frac{L_x}{5}\times\frac{L_x}{40}$ are used at the right lower part.} \label{fig:DesignDomain} \end{figure} \begin{table} \centering \begin{tabular}{ l c c } \hline \hline \textbf{Parameter} & \textbf{Notation} & \textbf{Value} \\ \hline Young's modulus of actual material & $E_1$ & $\SI{3e9}{\newton\per\square\meter}$ \rule{0pt}{3ex}\\ Poisson's ratio & $\nu$ & $0.40$\\ Out-of-plane thickness & $t$ & $\SI{0.01}{\meter}$\\ Penalization &$\zeta$ &$3$ \rule{0pt}{3ex} \\ Young's modulus of a void FE ($\rho=0$) & $E_0$ &$E_1 \times 10^{-6} \si{\newton\per\square\meter}$ \\ External move limit & $\Delta \bm{\rho}$ & 0.1 per iteration\\ Input pressure load &$p_\mathrm{in}$ & $\SI{1e5}{\newton\per\square\meter}$ \rule{0pt}{3ex}\\ $K(\bm{\rho})$ step location & $\eta_k$ & 0.3 \rule{0pt}{3ex}\\ $K(\bm{\rho})$ slope at step & $\beta_k$ & 10\\ $H(\bm{\rho})$ step location & $\eta_h$ & 0.2\\ $H(\bm{\rho})$ slope at step & $\beta_h$ & 10\\ Flow coefficient of a void FE & $k_\mathrm{v}$ & $\SI{1}{\meter\tothe{4}\per\newton\per\second}$\\ Flow coefficient of a solid FE & $k_\mathrm{s} $ & $k_\mathrm{v}\times\SI{e-7}{\meter\tothe{4}\per\newton\per\second}$\\ Drainage from solid & $h_\mathrm{s} $ & $\left(\frac{\ln{r}}{\Delta s}\right)^2 k_\mathrm{s}$ \\ Remainder of input pressure at $\Delta s$ &r& 0.1\\\hline\hline \end{tabular} \caption{Various parameters used in this paper.}\label{Table:T1} \end{table} \subsection{Sensitivity analysis}\label{Subsec:Sensitivityanalysis} We use the Method of Moving Asymptotes (MMA)~\cite{svanberg1987method}, a gradient-based optimizer, for solving the optimization problem~(Eq.~\ref{Eq:actualoptimization}). A standard setting available in the MMA optimizer is used to solve the min-max optimization problem. The Lagrangian $\mathcal{L}$ using the objective function and constraints can be written as \begin{equation}\label{Eq:augmentedperformance} \mathcal{L} = f_0(\bar{\bm{\rho}}) + \trr{\bm{\lambda}}_1 \left(\mathbf{Ku +{H p}}\right) + \trr{\bm{\lambda}}_2 ( \mathbf{Ap}) + \trr{\bm{\lambda}}_3 (\mathbf{Kv-F_\mathrm{d}}) + \Lambda \left(V(\bar{\bm{\rho}}^d(\bm{\rho}))-V_d^*\right), \end{equation} where $\bm{\lambda}_i|_{i= 1,\,2,\,3}$ and $\Lambda$ are the Lagrange multipliers. Using the adjoint equations corresponding to Eq.~\ref{Eq:augmentedperformance}, i.e., $\frac{\partial\mathcal{L}}{\partial \mathbf{u}} = 0,\,\frac{\partial\mathcal{L}}{\partial \mathbf{p}} = 0,\,\text{and}\,\frac{\partial\mathcal{L}}{\partial \mathbf{v}} = 0$, one finds the Lagrange multipliers $\bm{\lambda}_1,\,\bm{\lambda}_2$ and $\bm{\lambda_3}$ as \cite{kumar2020topology} \begin{equation}\label{Eq:lagrangemultipliers} \begin{rcases} \trr{\bm{\lambda}}_1 &= -\pd{f_0(\mathbf{u},\, \mathbf{v},\,\bm{\rho})}{\mathbf{u}} \inv{\mathbf{K}}\\ \trr{\bm{\lambda}}_2 & = -\trr{\bm{\lambda}}_1 \mathbf{H}\inv{\mathbf{A}}\\ \trr{\bm{\lambda}}_3 &= -\pd{f_0(\mathbf{u},\, \mathbf{v},\,\bm{\rho})}{\mathbf{v}} \inv{\mathbf{K}} \end{rcases}. \end{equation} \begin{figure} \centering \includegraphics[scale=1]{inverter-erode-dilate-eps-converted-to} \caption{An optimized pressure-actuated inverter mechanism obtained using the method presented in \cite{kumar2020topology} is displayed in (a). FEs with $\rho>0.49$ are used to show the result in (a). The optimized design contains one-node-connected hinges and thin flexure regions surrounded by gray elements that are depicted in insets. Using the two different thresholds, the approximated designs are displayed in (a$_1$) and (a$_2$).} \label{fig:Inverterwithoutrobust} \end{figure} \begin{figure} \centering \begin{tikzpicture} \pgfplotsset{compat = 1.3} \begin{axis}[ width = 1\textwidth, xtick={0,0.2,0.3,0.4, 0.5,0.6,0.7,0.8,0.9,1.0}, ytick={-3.5e-2, -2.5e-2, -1.5e-2, -0.5e-2, 0.25e-2}, width=10cm,height=10cm, xlabel= Thresholds, ylabel= $x-$displacements (\si{\milli \meter})] \pgfplotstableread{IVout.txt}\mydata; \addplot[black,mark = o,mark size=3pt,style={thick}] table {\mydata}; \end{axis} \end{tikzpicture} \caption{The output displacements of the traditionally designed pressure-actuated inverter mechanisms at different threshold material densities $\rho_\text{th}$.} \label{fig:InverterOut} \end{figure} \begin{figure}[h!] \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=.5]{a1e} \caption{Eroded design, $\Delta = \SI{0.097}{\milli \meter}$} $\Delta\eta=0.15$: $M_\text{nd}=0.65\%$,\,$V_f=0.15$ \label{fig:ricase1e} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=.5]{a1i} \caption{Intermediate design, $\Delta = \SI{0.071}{\milli \meter}$} $M_\text{nd}=0.36\%$,\,$V_f=0.20$ \label{fig:ricase1i} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=.5]{a1d} \caption{Dilated design, $\Delta = \SI{0.046}{\milli \meter}$} $M_\text{nd}=0.16\%$,\,$V_f=0.243$ \label{fig:ricase1d} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=.5]{a2e} \caption{Eroded design, $\Delta = \SI{0.091}{\milli \meter}$} $\Delta\eta=0.05$: $M_\text{nd}=0.38\%$,\,$V_f=0.186$ \label{fig:ricase2e} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=.5]{a2i} \caption{Intermediate design, $\Delta = \SI{0.080}{\milli \meter}$} $M_\text{nd}=0.58\%$,\,$V_f=0.20$ \label{fig:ricase2i} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=.5]{a2d} \caption{Dilated design, $\Delta = \SI{0.069}{\milli \meter}$} $M_\text{nd}=0.11\%$,\,$V_f=0.212$ \label{fig:ricase2d} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=0.5]{a3e} \caption{Eroded design, $\Delta = \SI{0.142}{\milli \meter}$} $\Delta\eta=0.15$: $M_\text{nd}=1.19\%$,\,$V_f=0.13$ \label{fig:ricase3e} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=.5]{a3i} \caption{Intermediate design, $\Delta = \SI{0.076}{\milli \meter}$} $M_\text{nd}=0.59\%$,\,$V_f=0.020$ \label{fig:ricase3i} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=.5]{a3d} \caption{Dilated design, $\Delta = \SI{0.040}{\milli \meter}$} $M_\text{nd}=0.43\%$,\,$V_f=0.25$ \label{fig:ricase3d} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=0.5]{a4e} \caption{Eroded design, $\Delta = \SI{0.110}{\milli \meter}$} $\Delta\eta=0.05$: $M_\text{nd}=0.88\%$,\,$V_f=0.175$ \label{fig:ricase4e} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=.5]{a4i} \caption{Intermediate design, $\Delta = \SI{0.086}{\milli \meter}$} $M_\text{nd}=0.81\%$,\,$V_f=0.20$ \label{fig:ricase4i} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=.5]{a4d} \caption{Dilated design, $\Delta = \SI{0.066}{\milli \meter}$} $M_\text{nd}=0.42\%$,\,$V_f=0.22$ \label{fig:ricase4d} \end{subfigure} \caption{The robust pressure-actuated inverter mechanisms. Filter radius $5.4h$ is used for the optimized results shown in rows 1 and 2, whereas for the results displayed in rows 3 and 4, it is set to $8.4h$. Note $h =\min(\frac{L_x}{N_\text{ex}},\,\frac{L_y}{N_\text{ey}})$.} \label{fig:robustinverters} \end{figure} The design equation corresponding to Eq.~\ref{Eq:augmentedperformance} is \begin{equation}\label{Eq:sensitivityofobjective1} \begin{aligned} \frac{\partial \mathcal{L}}{\partial \bar{\bm{\rho}}} = &\pd{f_0}{\bar{\bm{\rho}}} + \trr{\bm{\lambda}}_1\pd{\mathbf{K}}{\bar{\bm{\rho}}}\mathbf{u} + \trr{\bm{\lambda}}_2\pd{\mathbf{A}}{\bar{\bm{\rho}}}\mathbf{p} + \trr{\bm{\lambda}}_3\pd{\mathbf{K}}{\bar{\bm{\rho}}}\mathbf{v} + \Lambda \frac{\partial \left(V(\bar{\bm{\rho}}^d(\bm{\rho}))-V_d^*\right)}{\partial \bar{\bm{\rho}}}\\ =&\underbrace{\pd{f_0}{\bar{\bm{\rho}}} + \trr{\bm{\lambda}}_1\pd{\mathbf{K}}{\bar{\bm{\rho}}}\mathbf{u} + \trr{\bm{\lambda}}_2\pd{\mathbf{A}}{\bar{\bm{\rho}}}\mathbf{p} + \trr{\bm{\lambda}}_3\pd{\mathbf{K}}{\bar{\bm{\rho}}}\mathbf{v}}_{\Theta} + \Lambda \frac{\partial \left(V(\bar{\bm{\rho}}^d(\bm{\rho}))\right)}{\partial \bar{\bm{\rho}}}, \end{aligned} \end{equation} with complementarity condition $\Lambda \left(V(\bar{\bm{\rho}}^d(\bm{\rho}))-V_d^*\right) = 0,\,\Lambda\ge0$. Using $f_0 = -\mu\frac{MSE}{SE}$ and in view of Eq.~\ref{Eq:lagrangemultipliers}, $\Theta$ transpires as \begin{equation}\label{Eq:sensitivityofobjective2} \begin{aligned} \Theta = &\mu\left[\frac{MSE}{(SE)^2}\left(-\frac{1}{2}\trr{\mathbf{u}}\pd{\mathbf{K}}{\bar{\bm{\rho}}}\mathbf{u}\right) + \frac{1}{SE}\left(\trr{\mathbf{u}}\pd{\mathbf{K}}{\bar{\bm{\rho}}}\mathbf{v}\right)+\underbrace{\frac{MSE}{(SE)^2}\left(\trr{\mathbf{u}} \mathbf{H}\inv{\mathbf{A}}\pd{\mathbf{A}}{\bar{\bm{\rho}}}\mathbf{p}\right) + \frac{1}{SE}\left(-\trr{\mathbf{v}} \mathbf{H}\inv{\mathbf{A}}\pd{\mathbf{A}}{\bar{\bm{\rho}}}\mathbf{p}\right)}_{\text{Load sensitivities}}\right]. \end{aligned} \end{equation} Now, using Eq.~\ref{Eq:sensitivityofobjective1} in association with the chain rule given in Eq.~\ref{Eq:ChainRule}, one can find the sensitivity of $\mathcal{L}$ with respect to the design vector, i.e., $\frac{d\mathcal{L}}{d{\bm{\rho}}}$. This formulation facilitates straightforward evaluation of the load sensitivities (Eq.~\ref{Eq:sensitivityofobjective2}) that affect the optimized designs of P-CMs \cite{kumar2020topology} and therefore, are important to consider while designing such mechanisms. \section{Numerical examples and discussions}\label{Sec:Numericalexamples} This section evaluates the presented approach by designing pressure-actuated robust inverter and gripper CMs. The symmetric half design domains for designing these mechanisms are displayed in Fig.~\ref{fig:DesignDomain}. $L_x=\SI{0.02}{\meter}$ and $L_y=\SI{0.01}{\meter}$ are set, where $L_x$ and $L_y$ represent the dimension in $x-$ and $y-$directions, respectively. $\SI{1}{\bar}$ pressure load is applied on the left edge of the domains, whereas remaining edges excluding the symmetric ones experience zero pressure loading. The fixed parts of the domains and their symmetry boundaries are also depicted. Springs with spring stiffnesses $k_\text{ss}=\SI{1e4}{\newton\per\meter}$ represent the workpiece at mechanism output locations (Fig.~\ref{fig:DesignDomain}). Table~\ref{Table:T1} summarizes the design parameters used in the optimization. We use $N_\text{ex}\times N_\text{ey} = 200 \times 100$ bi-linear quadrilateral FEs to parameterize the symmetric half design domains (Fig.~\ref{fig:DesignDomain}), where $N_\text{ex}$ and $N_\text{ey}$ indicate FEs in $x-$ and $y-$directions, respectively. A density-based TO approach with one design variable for each FE is employed with plane stress conditions. The design variable is considered constant within each FE. The external move limit of the MMA optimizer is set to $0.1$. \begin{figure}[h!] \begin{subfigure}[t]{0.33\columnwidth} \centering \includegraphics[scale=.5]{b1e} \caption{Eroded design, $\Delta = \SI{0.095}{\milli \meter}$} $\Delta\eta=0.15$: $M_\text{nd}=0.26\%$,\,$V_f=0.166$ \label{} \end{subfigure} \begin{subfigure}[t]{0.33\columnwidth} \centering \includegraphics[scale=.5]{b1i} \caption{Intermediate design, $\Delta = \SI{0.074}{\milli \meter}$} $M_\text{nd}=0.22\%$,\,$V_f=0.20$ \label{} \end{subfigure} \begin{subfigure}[t]{0.33\columnwidth} \centering \includegraphics[scale=.5]{b1d} \caption{Dilated design, $\Delta = \SI{0.052}{\milli \meter}$} $M_\text{nd}=0.11\%$,\,$V_f=0.234$ \label{} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=.5]{b2e} \caption{Eroded design, $\Delta = \SI{0.084}{\milli \meter}$} $\Delta\eta=0.05$: $M_\text{nd}=0.23\%$,\,$V_f=0.19$ \label{} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=.5]{b2i} \caption{Intermediate design, $\Delta = \SI{0.068}{\milli \meter}$} $M_\text{nd}=0.38\%$,\,$V_f=0.20$ \label{} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=.5]{b2d} \caption{Dilated design, $\Delta = \SI{0.062}{\milli \meter}$} $M_\text{nd}=0.21\%$,\,$V_f=0.21$ \label{} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=0.5]{b3e} \caption{Eroded design, $\Delta = \SI{0.108}{\milli \meter}$} $\Delta\eta=0.15$: $M_\text{nd}=0.45\%$,\,$V_f=0.15$ \label{} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=.5]{b3i} \caption{Intermediate design, $\Delta = \SI{0.064}{\milli \meter}$} $M_\text{nd}=0.36\%$,\,$V_f=0.20$ \label{} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=.5]{b3d} \caption{Dilated design, $\Delta = \SI{0.039}{\milli \meter}$} $M_\text{nd}=0.33\%$,\,$V_f=0.24$ \label{} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=0.5]{b4e} \caption{Eroded design, $\Delta = \SI{0.087}{\milli \meter}$} $\Delta\eta=0.05$: $M_\text{nd}=0.68\%$,\,$V_f=0.18$ \label{} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=.5]{b4i} \caption{Intermediate design, $\Delta = \SI{0.068}{\milli \meter}$} $M_\text{nd}=0.76\%$,\,$V_f=0.20$ \label{} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[scale=.5]{b4d} \caption{Dilated design, $\Delta = \SI{0.054}{\milli \meter}$} $M_\text{nd}=0.39\%$,\,$V_f=0.22$ \label{} \end{subfigure} \caption{The robust pressure-actuated gripper mechanisms. Filter radius $5.4h$ is used for the optimized results displayed in rows 1 and 2, whereas for the results shown in rows 3 and 4 are obtained with filter radius $8.4h$. Note $h =\min(\frac{L_x}{N_\text{ex}},\,\frac{L_y}{N_\text{ey}})$.} \label{fig:robustgripper} \end{figure} \subsection{Traditional pressure-actuated inverter mechanism} The symmetric half design domain displayed in Fig.~\ref{fig:inverter} is considered, and the optimization formulation presented in \cite{kumar2020topology} is employed for designing the inverter mechanism. The filter radius $r_\text{fill}$ is set to $3\times\max(\frac{L_x}{N_\text{ex}},\,\frac{L_y}{N_\text{ey}})$. 20$\%$ material volume is permitted. The maximum number of the optimization iterations is fixed to 200. Fig.~\ref{fig:Inverterwithoutrobust}a depicts the optimized inverter mechanism with final pressure field. $M_\text{nd}=13.43\%$ and $\Delta = \SI{0.072}{\milli\meter}$ are found. Insets in Fig.~\ref{fig:Inverterwithoutrobust}a display the localized single-node-connected hinges and thin flexure regions constituted via gray elements. These geometrical anomalies pose challenges in manufacturing and thus, they are undesirable. When the optimized design is approximated using: (i) $\rho\in [0.75,\,1] \to 1$ and $\rho\in [0,\,0.75) \to 0$ as shown in Fig.~\ref{fig:Inverterwithoutrobust}a$_1$, a non-realizable design is obtained with $\Delta = \SI{5.48e-4}{\milli\meter}$ and (ii) $\rho\in[0.25,\,1]\to 1$ and $\rho\in[0,\,0.25)\to 0$ as displayed in Fig.~\ref{fig:Inverterwithoutrobust}a$_2$, though a realizable design is found, $\Delta = \SI{0.026}{\milli \meter}$ is obtained that is approximately three times lower than that obtained for the actual design (Fig.~\ref{fig:Inverterwithoutrobust}a). Figure~\ref{fig:InverterOut} displays the output displacements of the inverter mechanism at different threshold densities $\rho_\text{th}$. It can be noted that when $\rho_\text{th}>0.5$, the corresponding output displacements are negligible as the output port gets disconnected from the input port (Fig.~\ref{fig:Inverterwithoutrobust}a$_1$). Therefore, to circumvent these issues and also, to obtain the optimized solutions close to 0-1 such that contours of the designs can be extracted without performing any approximation for fabrication purpose, as mentioned before, the robust formulation is employed \cite{wang2011projection}. \subsection{Robust compliant mechanisms} The various optimized designs of the pressure-actuated inverter and gripper CMs are presented using the robust formulation (Eq.~\ref{Eq:actualoptimization}). In each case, we get three optimized designs, i.e., the dilated, intermediate and eroded continua, and in those, the intermediate designs are intended for fabrication. The permitted volume fraction for the intermediate design is set to 0.20 for all the cases. The maximum number of MMA iterations is fixed to 400. In the projection filter (Eq.~\ref{Eq:projectionfilter}), $\beta$ is altered from 1 to $128$ using a continuation scheme wherein $\beta$ is doubled after each $50$ MMA iteration and once it reaches to 128, it remains so for the remaining optimization iterations. The volume update for the dilated design is performed at each 25$^\text{th}$ MMA iteration. \begin{figure}[h!] \begin{subfigure}[t]{0.5\textwidth} \centering \begin{tikzpicture} \pgfplotsset{compat = 1.3} \begin{axis}[ width = 1\textwidth, xlabel=MMA iteration, ylabel= -$1000\times\frac{MSE}{SE}$] \pgfplotstableread{InveterdilatedObj.txt}\mydata; \addplot[smooth,black,,mark size=1pt,style={thick}] table {\mydata}; \addlegendentry{Dilated design} \pgfplotstableread{InverterintermObj.txt}\mydata; \addplot[smooth,blue,mark size=1pt,style={thick}] table {\mydata}; \addlegendentry{Intermediate design} \pgfplotstableread{InvertererodedObj.txt}\mydata; \addplot[smooth,red,mark size=1pt,style={thick}] table {\mydata}; \addlegendentry{Eroded design} \end{axis} \end{tikzpicture} \caption{} \label{fig:AllInverterObjectiveplot} \end{subfigure} \quad \begin{subfigure}[t]{0.5\textwidth} \centering \begin{tikzpicture} \pgfplotsset{compat = 1.3} \begin{axis}[ width = 1\textwidth, xlabel=MMA iteration, ylabel= Volume fraction, ytick ={0.05,0.1,0.15,0.18,0.20,0.22},legend pos=south east] \pgfplotstableread{InverterdilatedVol.txt}\mydata; \addplot[smooth,black,,mark size=1pt,style={thick}] table {\mydata}; \addlegendentry{Dilated design} \pgfplotstableread{InverterintermVol.txt}\mydata; \addplot[smooth,blue,mark size=1pt,style={thick}] table {\mydata}; \addlegendentry{Intermediate design} \pgfplotstableread{InvertererodedVol.txt}\mydata; \addplot[smooth,red,mark size=1pt,style={thick}] table {\mydata}; \addlegendentry{Eroded design} \end{axis} \end{tikzpicture} \caption{} \label{fig:AllInverterVolumeplot} \end{subfigure} \caption{Objective and volume fraction convergence plots for inverter CMs displayed in the first row of Fig.~\ref{fig:robustinverters}. (\subref{fig:AllInverterObjectiveplot}) Objective history, and (\subref{fig:AllInverterVolumeplot}) Volume fraction history} \label{fig:InverterConvergence} \end{figure} \begin{figure}[h!] \begin{subfigure}[t]{0.5\textwidth} \centering \begin{tikzpicture} \pgfplotsset{compat = 1.3} \begin{axis}[ width = 1\textwidth, xlabel=MMA iteration, ylabel= -$1000\times\frac{MSE}{SE}$] \pgfplotstableread{GripperdilatedObj.txt}\mydata; \addplot[smooth,black,,mark size=1pt, style={thick}] table {\mydata}; \addlegendentry{Dilated design} \pgfplotstableread{GripperintermObj.txt}\mydata; \addplot[smooth,blue,mark size=1pt, style={thick}] table {\mydata}; \addlegendentry{Intermediate design} \pgfplotstableread{GrippererodedObj.txt}\mydata; \addplot[smooth,red,mark size=1pt,style={thick}] table {\mydata}; \addlegendentry{Eroded design} \end{axis} \end{tikzpicture} \caption{} \label{fig:AllGripperObjectiveplot} \end{subfigure} \quad \begin{subfigure}[t]{0.5\textwidth} \centering \begin{tikzpicture} \pgfplotsset{compat = 1.3} \begin{axis}[ width = 1\textwidth, xlabel=MMA iteration, ylabel= Volume fraction, ytick ={0,0.1,0.15,0.20,0.24, 0.25}, legend style={at={(1.0,0.45)},anchor=east}] \pgfplotstableread{GripperdilatedVol.txt}\mydata; \addplot[smooth,black,,mark size=1pt, style={thick}] table {\mydata}; \addlegendentry{Dilated design} \pgfplotstableread{GripperintermVol.txt}\mydata; \addplot[smooth,blue,mark size=1pt, style={thick}] table {\mydata}; \addlegendentry{Intermediate design} \pgfplotstableread{GrippererodedVol.txt}\mydata; \addplot[smooth,red,mark size=1pt,style={thick}] table {\mydata}; \addlegendentry{Eroded design} \end{axis} \end{tikzpicture} \caption{} \label{fig:AllGripperVolumeplot} \end{subfigure} \caption{Objective and volume fraction convergence plots for gripper CMs displayed in the third row of Fig.~\ref{fig:robustinverters}. (\subref{fig:AllGripperObjectiveplot}) Objective history, and (\subref{fig:AllInverterVolumeplot}) Volume fraction history} \label{fig:GripperConvergence} \end{figure} \begin{figure}[h!] \begin{subfigure}[t]{0.475\textwidth} \centering \includegraphics[scale = 0.6200]{INDP} \caption{} \label{fig:deformedinverter} \end{subfigure} \begin{subfigure}[t]{0.475\textwidth} \centering \includegraphics[scale = 0.620]{GPDP} \caption{} \label{fig:deformedgripper} \end{subfigure} \caption{Deformed profiles of the optimized inverter and gripper CMs are displayed with 50 times magnified displacement obtained from linear analysis. Red and blue indicate the maximum and minimum displacements, respectively.} \label{fig:deformedprofiles} \end{figure} In case of the inverter CMs, it is desired that the mechanisms provide deformation in the opposite direction of the pressure loading direction, whereas gripping motions are desired in response to the pressure load for the gripper CMs. At the output location of the gripper mechanism, a void area of size $\frac{L_x}{5}\times \frac{L_x}{5}$ and a solid region of area $\frac{L_x}{5}\times \frac{L_x}{40}$ are considered to facilitate gripping of a workpiece. We solve the problems using different filter radii and $\Delta\eta$. The full final inverter and gripper mechanisms are obtained by suitably transforming the symmetric half optimized results, and they are depicted in Fig.~\ref{fig:robustinverters} and Fig.~\ref{fig:robustgripper}, respectively. Note the absence of one-node hinges--these would lead to disconnected structures in the eroded design with very poor performance, and hence the optimizer avoids such problematic features entirely. The topology for the dilated, intermediate and eroded is the same for all the presented cases. The eroded designs feature thin members, whereas the dilated designs consist of thicker branches, which is expected. Thicknesses of the members of the intermediate designs are between those of the respective eroded and dilated designs. $M_\text{nd}$ and final volume fraction for each optimized design are also mentioned. The obtained solutions in Fig.~\ref{fig:robustinverters} and Fig.~\ref{fig:robustgripper} are very close to 0-1 designs as their $M_\text{nd}$ values are low. This is a very desirable result, since now the design interpretation no longer significantly changes the geometry of the design and its performance. In all cases, the final volume fractions of the optimized intermediate designs are observed to be equal to the permitted volume fraction, i.e., 0.20. It is noticed that the optimized mechanisms obtained with $\Delta\eta=0.15$ have larger minimum length scale than those obtained with $\Delta\eta=0.05$ at the same filter radius. In addition, the optimized mechanisms with same $\Delta\eta$ but higher filter radius have larger minimum length scale. Therefore, the minimum feature size increases with increase in $\Delta\eta$ and is also a function of the filter radius, which are known properties of the robust formulation \cite{wang2011projection}. The layout of the optimized inverter mechanisms is more or less same as their traditional counterparts. In case of the gripper mechanisms, we obtain designs having a large space for fluid to inflate. This is reminiscent of designs of pneumatically-actuated soft robots. The obtained output deformations of the optimized eroded mechanisms are higher than the intermediate designs in each case (Fig.~\ref{fig:robustinverters} and Fig.~\ref{fig:robustgripper}), however, as mentioned before, such designs have lower manufacturing limits and as-fabricated designs may be fragile. Figures~\ref{fig:InverterConvergence} and \ref{fig:GripperConvergence} indicate the convergence history of the objective and volume constraints for the optimized inverter mechanisms depicted in the first row of Fig.~\ref{fig:robustinverters} and the optimized gripper CMs displayed in the third row of Fig.~\ref{fig:robustgripper}, respectively. One notices a smooth convergence, and the volume constraint is active for the intermediate design at the end of the optimization for both the mechanisms (Figs.~\ref{fig:InverterConvergence} and \ref{fig:GripperConvergence}). The objective values of the intermediate designs are lower than those of the corresponding eroded and dilated designs (Figs.~\ref{fig:InverterConvergence}~and~ \ref{fig:GripperConvergence}), indicating that intermediate designs are the best performing ones in the view of the considered multi-criteria objective that determines a balance between the output displacement and strength of the mechanism. The objectives of respective eroded and dilated designs are close to each other at the end of the optimization (Figs.~\ref{fig:InverterConvergence} and \ref{fig:GripperConvergence}). The deformed profiles for the full intermediate inverter and gripper mechanisms at 50 times magnified linear deformation are displayed in Fig.~\ref{fig:deformedinverter} and Fig.~\ref{fig:deformedgripper}, respectively. These P-CMs perform as expected, however the deformation profiles are far from those obtained when using nonlinear mechanics with high pressure loads, as studied next. \begin{figure}[h!] \begin{subfigure}[t]{0.320\textwidth} \centering \includegraphics[scale = 0.45]{Inverterf50bar} \caption{} \label{fig:Inverter50bar} \end{subfigure} \begin{subfigure}[t]{0.320\textwidth} \centering \includegraphics[scale = 0.45]{Inverterf100bar} \caption{} \label{fig:Inverter100bar} \end{subfigure} \begin{subfigure}[t]{0.320\textwidth} \centering \includegraphics[scale = 0.45]{Inverterf150bar} \caption{} \label{fig:Inverter150bar} \end{subfigure} \caption{Deformed profiles of the inverter CM at different pressure loads. (\subref{fig:Inverter50bar}) $\SI{50}{\bar}$, (\subref{fig:Inverter100bar}) $\SI{100}{\bar}$, and (\subref{fig:Inverter150bar}) $\SI{150}{\bar}$. At $\SI{150}{\bar}$ pressure loading, branches of the inverter mechanism come in contact with each other. Blue and red color indicate minimum and maximum deformation locations, respectively.} \label{fig:InverterPressure} \end{figure} \subsection{Large deformation analyses} In this section, the optimized compliant mechanisms are tested with high pressure loadings to investigate their behaviors under large deformation cases. In the FE analysis, geometric nonlinearity will now be considered. In addition, instead of the linear material model, a neo-Hookean material model with the following strain energy function $W$ \cite{zienkiewicz2005finite} is employed \begin{equation}\label{Eq:Strainenergyfunction} W = \frac{G}{2}[\text{tr}\,(\bm{F}\trr{\bm{F}}) -3 -2\ln J] + \frac{\lambda}{2}(\ln J)^2, \end{equation} where $\bm{F} = \nabla_0\,\bm{u} + \bm{I}$ is the deformation gradient and $G = \frac{E_1}{2(1+\nu)}$ and $\lambda = \frac{2G\nu}{1-2\nu}$ are Lame's constants. $\nabla_0\,\bm{u}$ denotes gradient of the displacement field $\bm{u}$ with respect to reference coordinates $\bm{X}$, and $\nu$ is Poisson's ratio. $J = \det(\bm{F})$, and $\bm{I}$ is the unit tensor. Typically, rubber-like materials are used for pneumatically-actuated mechanisms \cite{schmitt2018soft} and to numerically model such materials, a neo-Hookean material description can be employed \cite{zienkiewicz2005finite}. Using the fundamentals of the continuum mechanics, the Cauchy stress tensor $\bm{\sigma}$ can be determined from the strain energy function noted in Eq.~\ref{Eq:Strainenergyfunction} as \begin{equation}\label{Eq:CauchyStress} \bm{\sigma} = \frac{G}{J}(\bm{F}\bm{F}^\mathrm{T}-\bm{I})+\frac{\Lambda}{J}(\ln J)\bm{I}. \end{equation} Following the nonlinear FE formulation, the displacement vector $\mathbf{u}$ is determined by solving \begin{equation}\label{Eq:residualform} \mathbf{R}(\mathbf{u}) = \mathbf{F}_{\mathrm{int}}(\mathbf{u})-\mathbf{F}_{\mathrm{ext}}(\mathbf{u}) = \mathbf{0}, \end{equation} where $\mathbf{R}(\mathbf{u})$ is the residual force and $\mathbf{F}_{\mathrm{ext}}(\mathbf{u})$ is the external force arises due to the pressure loading. The internal force vector $\mathbf{F}_{\mathrm{int}}^e(\mathbf{u})$ at the element level is determined as \begin{equation}\label{eq:internalforce} \mathbf{F}^e_\text{int} = \int_{\Omega^e}\trr{\mathbf{B}}_\text{UL}(\mathbf{u})\bm{\sigma}_e(\mathbf{u})\,d \Omega^e, \end{equation} where $\mathbf{B}_\text{UL}(\mathbf{u})$ and $\bm{\sigma}_e$ are the updated Lagrangian strain-displacement matrix and the Cauchy stress tensor of an FE $\Omega^e$, respectively. Eq.~\ref{Eq:residualform} can be solved using a Newton-Raphson (N-R) iterative process. Note also that, $\mathbf{F}_{\mathrm{ext}}(\mathbf{u})$ varies as it arises from pressure loading which follows the surface where it is applied upon, i.e., it is a follower force and thus, contributes in the tangent stiffness of the nonlinear equations. Herein, we use ABAQUS for the nonlinear finite element analyses. The intermediate optimized designs of the inverter and gripper mechanisms displayed in the first row of Fig.~\ref{fig:robustinverters} and third row of Fig.~\ref{fig:robustgripper} are selected for the nonlinear analyses in ABAQUS. First, the boundaries of the optimized designs are extracted, and corresponding 2D CAD models are generated. Thereafter, using these CAD models, nonlinear FE analyses while considering follower force characteristics of the pressure loads are performed with input pressure 50 bar, 100 bar and 150 bar in ABAQUS. Figure~\ref{fig:InverterPressure} and Fig.~\ref{fig:GripperPressure} display the deformed profiles of the CMs with high pressure loadings. As pressure loads increase the deformation of the P-CMs also increase, which is expected and natural. At $\SI{150}{\bar}$, inverter mechanisms experience self-contact (Fig.~\ref{fig:Inverter150bar}) that indicates that one may have to include self-contact conditions \cite{kumar2019computational} between the branches of the mechanisms when dealing with high pressure loadings for the large deformation cases. For the inverter mechanisms, the deformation profiles in Fig.~\ref{fig:deformedinverter} and Fig.~\ref{fig:Inverter50bar} are different, and the output displacement has reduced by 78 \%. Likewise, the deformed continua in Fig.~\ref{fig:deformedgripper} and Fig.~\ref{fig:Gripper50bar} are not the same. Although the gripper still exhibits the intended functionality, the magnitude of the jaw displacement has reduced by 82 \%. Figure~\ref{fig:NL_L_IV_GP} shows the output displacements obtained with the linear and nonlinear analyses at different pressure loads for the inverter and gripper mechanisms. The displacements obtained with linear analyses are far from the full nonlinear analyses for both the mechanisms (Figs.~\ref{fig:NL_L_IV} and~\ref{fig:NL_L_GP}). These indicate limitations and shortcomings of the P-CMs obtained assuming linear elasticity concepts. Therefore, ideally, one has to include full nonlinear mechanics (with contact) within the design approach for high pressure loadings wherein P-CMs can experience large deformations and even self and/or mutual contact. \begin{figure}[h!] \begin{subfigure}[t]{0.32\textwidth} \centering \includegraphics[scale = 0.350]{Gripperf50bar} \caption{} \label{fig:Gripper50bar} \end{subfigure} \begin{subfigure}[t]{0.32\textwidth} \centering \includegraphics[scale = 0.350]{Gripperf100bar} \caption{} \label{fig:Gripper100bar} \end{subfigure} \begin{subfigure}[t]{0.32\textwidth} \centering \includegraphics[scale = 0.350]{Gripperf150bar} \caption{} \label{fig:Gripper150bar} \end{subfigure} \caption{Deformed profiles of the gripper CM at different pressure loads. (\subref{fig:Gripper50bar}) $\SI{50}{\bar}$, (\subref{fig:Gripper100bar}) $\SI{100}{\bar}$, and (\subref{fig:Gripper150bar}) $\SI{150}{\bar}$. Blue and red color indicate minimum and maximum deformation locations, respectively.} \label{fig:GripperPressure} \end{figure} \begin{figure}[h!] \begin{subfigure}[t]{0.5\textwidth} \centering \begin{tikzpicture} \pgfplotsset{compat = 1.3} \begin{axis}[ width = 1\textwidth, xlabel=Presure load ($\si{\bar}$), ylabel= $x$-displacement ($\si{\milli \meter}$), legend style={at={(0.650,0.10)},anchor=east}] \pgfplotstableread{LIV.txt}\mydata; \addplot[smooth,black,mark=*,mark options={scale=3, fill=red},text mark as node=true,,mark size=1pt, style={thick}] table {\mydata}; \addlegendentry{Linear analysis} \pgfplotstableread{NLIV.txt}\mydata; \addplot[smooth,mark=*,mark options={scale=3, fill=white},text mark as node=true,blue,mark size=1pt, style={thick}] table {\mydata}; \addlegendentry{Nonlinear analysis} \end{axis} \end{tikzpicture} \caption{Inverter mechanism} \label{fig:NL_L_IV} \end{subfigure} \quad \begin{subfigure}[t]{0.5\textwidth} \centering \begin{tikzpicture} \pgfplotsset{compat = 1.3} \begin{axis}[ width = 1\textwidth, xlabel=Presure load ($\si{\bar}$), ylabel= $y$-displacement ($\si{\milli \meter}$), legend style={at={(0.650,0.900)},anchor=east}] \pgfplotstableread{LGP.txt}\mydata; \addplot[smooth,black,mark=*,mark options={scale=3, fill=red},text mark as node=true,,mark size=1pt, style={thick}] table {\mydata}; \addlegendentry{Linear analysis} \pgfplotstableread{NLGP.txt}\mydata; \addplot[smooth,mark=*,mark options={scale=3, fill=white},text mark as node=true,blue,mark size=1pt, style={thick}] table {\mydata}; \addlegendentry{Nonlinear analysis} \end{axis} \end{tikzpicture} \caption{Gripper mechanism.} \label{fig:NL_L_GP} \end{subfigure} \caption{The output displacements obtained from the linear and nonlinear analyses using different pressure loads. For the gripper mechanism, the displacements corresponding to the lower jaw are indicated.} \label{fig:NL_L_IV_GP} \end{figure} \section{Closure}\label{Sec:Closure} With the aim to bridge the gap between optimized and as-fabricated designs, this paper presents a density-based topology optimization approach to generate pressure-actuated robust compliant mechanisms. The robust formulation, i.e., the eroded, intermediate (blueprint) and dilated projections for the design description is employed for the first time to this problem class, in combination with a representation of the pressure loads using the Darcy law in combination with a drainage term. Well-functioning pressure-actuated robust inverter and gripper mechanisms are obtained with different robustness levels and filter radii to illustrate different minimum length scales of the mechanisms. Single-node hinges, that cannot be fabricated but frequently appear when using the traditional topology optimization approach, are no longer found in the obtained designs. The approach solves three sets of equilibrium equations and uses a continuation approach for the projection parameter $\beta$ that requires a large number of the optimization iterations and thus, computational cost increases. The approach provides three physical material density vectors with one design variable vector. Intermediate designs can be used for manufacturing purposes. The obtained optimized designs are close to binary. This eliminates the loss of performance observed when grayscale topology optimization results are post-processed into CAD geometries for fabrication. The intermediate designs are used to study behavior of the mechanisms with high pressure loads while accounting for geometric and material nonlinearity. It is found that the scaled linear deformation profiles and those obtained with full nonlinear analyses do not match well. Moreover, at high pressures self-contact of mechanism branches occurs. These observations indicate that for further development of topology optimization for pressure-actuated compliant mechanisms, next to the robust formulation, considering nonlinear mechanics and self-contact may be indispensable. \section*{Acknowledgments} P. Kumar acknowledges financial support from the Science \& Engineering research board, Department of Science and Technology, Government of India under the project file number RJF/2020/000023. The authors acknowledge Prof. Krister Svanberg for providing MATLAB codes of the MMA optimizer.
\section{Introduction}\label{sec1} Current wireless communication systems are omni-directional and so are easy to eavesdrop upon (see Fig.~\ref{QKD}(a)). Public-key cryptography can be used to secure such transmissions, offering security via assumptions about the computational power of malicious eavesdroppers. These assumptions are called into question by possible future advances in computational power, in particular the advent of large-scale quantum computation \cite{QCQI}. Given this, the security of current communications cannot be guaranteed indefinitely as they might be stored and decrypted in the future when the required level of quantum processing becomes available. Laser communications (lasercomm) can improve security in certain circumstances via its greater directionality. Nevertheless eavesdropping is still possible due to beam diffraction (see Fig.~\ref{QKD}(b)). Here we propose a simple extension to lasercomm using techniques from quantum key distribution \cite{Scarani.et.al.RVP.09, Pirandola.et.al.arxiv.19} and recent observations about information leakage \cite{leakage-elimination}, which eliminates these eavesdroppers (see Fig.~\ref{QKD}(c)). Quantum key distribution (QKD) allows two trusted parties, Alice and Bob, to share a secure key, unknown to a potential eavesdropper, Eve. In contrast to current classical cryptography, QKD provides information-theoretic security \cite{Scarani.et.al.RVP.09,Xu.et.al.arxiv.19,Pirandola.et.al.arxiv.19}. Although QKD started with discrete-variable quantum systems \cite{Bennett.Brassard.IEEE.84,Ekert.PRL.91}, it has been extended to continuous-variable (CV) systems \cite{Ralph.PRA.99,Hillery.PRA.00,Reid.PRA.00,RR2003}. In the former, information is encoded in discrete degrees of freedom of a single photon, with the detection realised by single-photon detectors. While, in the latter, information is encoded in continuous degrees of freedom of light, and detection is realised by off-the-shelf homodyne detectors, offering greater compatibility with current optical telecommunication networks. \begin{figure {\includegraphics[width=2.4 in]{QKD_figure_3_paper.eps}} \caption{A schematic representation of communication scenarios between Alice and Bob in the presence of an eavesdropper, Eve: (a) current wireless communication, which is only secure given computational limitations of Eve; (b) communication using lasercomm; and (c) the QKD protocol we consider in this paper using a squeezed laser, which can completely eliminate information leakage to Eve.}\label{QKD} \end{figure} In a typical lasercomm protocol information is encoded via amplitude modulation of the laser beam and read out via direct detection, also known as self-homodyne. Similarly, in this work we propose a CV QKD protocol based on amplitude modulation of a {\it squeezed} laser with read out also via direct detection. In contrast, in a typical CV QKD protocol information is encoded in both amplitude and phase quadratures of the light while the detection is performed by either homodyne or heterodyne detectors, requiring the use of a separate local oscillator \cite{Garcia-Patron.PhD.07,Weedbrook.et.al.RVP.12,Diamanti.Leverrier.Entropy.15,Pirandola.et.al.arxiv.19}. Our simplification comes by specifically considering free-space channels and hence limiting the eavesdropper to only gathering the lost light - i.e. a passive attack. Whilst this is not the most general attack, we argue it is a reasonable restriction given plausible technical capabilities of Eve. Given this restriction we make a full, composable finite-key security analysis of our system and find it is robust to loss, turbulence and excess noise of the source laser. Free-space channels are flexible in terms of infrastructure establishment and feasibility of communication with moving objects. They also provide the possibility of long-distance quantum communication via orbiting satellites. The key disadvantage of free-space quantum communications is, however, atmospheric attenuation and turbulence noise \cite{Hosseini.et.al.IEEE.19, satellite-2017-1, satellite-2017-2}. Atmospheric turbulence causes a random variation of channel transmissivity in time \cite{Semenov.Vogel.PRA.09, Vasylyev.et.al.PRL.12, Vasylyev.et.al.PRL.16, Vasylyev.et.al.PRA.17, Vasylyev.et.al.PRA.18}. This transmissivity fluctuation introduces extra noise on CV QKD systems, which reduces the secret key rate, and even renders the communication insecure in the presence of strong turbulence \cite{Hosseini.Malaney.PRA1.15, Dong-PRA-10, Usenko-NJP-12, Hosseini.Malaney.ICC.15, Hosseini.Malaney.PRA2.15, Hosseini.Malaney.GLOBECOM.16, Hosseini.Malaney.QIC.17, fast-fading, NJP-2018, cluster-2019, Neda-Nathan-Tim-freespace}. It is thus of considerable significance that reasonable restrictions on Eve can lead to a far simpler and more robust system. \section{The model} We analyse a CV QKD protocol using a squeezed laser over a free-space channel using modulation in only the amplitude quadrature and direct, self-homodyne detection (see Fig.~\ref{QKD}(c)). A proper modulation of the squeezed states leads to zero turbulence-induced noise of the free-space channel in the amplitude quadrature as well as zero information leakage to the eavesdropper. The protocol does not require estimation of the eavesdropper's information, as information leakage is zero. It is also highly robust against modulation imperfections (i.e. modulation noise), and can tolerate high values of channel loss. Firstly, in our QKD protocol we assume the trusted parties, Alice and Bob, are able to classically monitor the line of sight, so that any active presence of an eavesdropper (Eve) in the line of sight can be detected, and if there is any, the protocol will be aborted. Whilst an omnipotent eavesdropper might deceive Alice and Bob, the technologies required seem well beyond current capabilities. As a result, any active eavesdropping attacks in the line of sight will be prevented, and Eve will be limited to only passive attacks. Secondly, in our QKD protocol we will exploit squeezed quantum states for information carriers, similar to the CV protocol of \cite{leakage-elimination}, where by properly encoding information into a Gaussian modulation of squeezed states (squeezed in a single quadrature and modulated in the squeezing direction), one can completely and deterministically eliminate information leakage to Eve in a reverse reconciliation (RR) scenario \cite{RR2003}, if the channel is pure loss. The necessary condition for leakage elimination is that the variance of the average input state in the modulation direction has to be the shot-noise variance. Unlike \cite{leakage-elimination}, we consider bright squeezed states such that the modulation can be read out via direct detection of the light. Since a pure-loss channel can be considered as a passive eavesdropping attack, by the Gaussian modulation of the squeezed laser to the shot-noise level and limiting Eve to only passive attacks, we will completely and deterministically eliminate information leakage to Eve in a RR scenario (i.e., obtain zero Holevo information) over free-space channels. As a result, estimation (or upper bounding) of Eve's information is no longer required in this protocol. Such a shot-noise modulation can also eliminate the channel-fluctuation noise in the information-carrying quadrature. Because the protocol uses squeezed bright beams, where the information is only encoded in the amplitude quadrature, self-homodyne detection at Bob's station with no need for a separate local oscillator will suffice to measure the amplitude quadrature. This will significantly simplify the experimental realisation of the protocol. We further investigate the effect of modulation imperfections. We consider the case where the variance of the average input state in the squeezing direction is not exactly the shot noise. In fact, we consider some amount of trusted preparation noise on top of the shot noise in Alice's side. We show that this type of practical imperfection leads to some information leakage to Eve, where we do the security analysis in the composable finite-size regime. However, the amount of leakage is sufficiently small, so that its effect on the secret key rate is negligible. \section{Gaussian-modulation squeezed-state protocol} In a prepare-and-measure scheme, Alice generates a random real variable $a_q$, drawn from a Gaussian distribution of variance $V_{\rm sig}$ and zero mean. Alice prepares bright squeezed states with the squeezing in the amplitude $\hat q$ quadrature, where the variance of the squeezed quadrature is $V_{\rm sqz}$. The squeezed states are then modulated (displaced) by an amount $a_q$ in the direction of the $\hat q$ quadrature. The variance of the average Gaussian state after the modulator is $V_{\rm sqz}+V_{\rm sig}$ in the amplitude $\hat q$ quadrature and $1/V_{\rm sqz}$ in the phase $\hat p$ quadrature. We consider the case where the variance of the squeezed quadrature after the modulation is equal to the shot-noise variance, i.e., $V_{\rm sqz}+V_{\rm sig}=1$ \cite{leakage-elimination}. The squeezed states are then sent through a free-space channel to Bob, who directly measures the amplitude $\hat q$ quadrature with self-homodyne detection. In contrast to a fiber link with a fixed transmissivity, the transmissivity, $\eta$, of a free-space channel fluctuates in time due to atmospheric turbulence. Such fading channels can be characterized by a probability distribution $p(\eta)$ \cite{Semenov.Vogel.PRA.09,Vasylyev.et.al.PRL.12,Vasylyev.et.al.PRL.16,Vasylyev.et.al.PRA.17,Vasylyev.et.al.PRA.18}. A fading channel can be decomposed into a set of sub-channels, for which the transmissivity is relatively stable. Each sub-channel ${\eta_i}$ occurs with probability $p_i$ so that $\sum\nolimits_{i} {p_i} = 1 $ or $\int_{0}^{\eta_{\rm max}} { p(\eta )} d\eta = 1$ for a continuous probability distribution, where $\eta_{\rm max}$ is the maximum realisable transmissivity. In order to analyse the security of the CV QKD protocol, we consider the equivalent entanglement-based scheme. Alice first prepares a symmetric two-mode squeezed vacuum state of quadrature variance $V$. One mode is kept by Alice (to be later measured via homodyne detection in the $\hat q$ quadrature), while the second mode is squeezed (in Alice's side) in the $\hat q$ quadrature with the squeezing parameter $r_e$. The initial entangled state, prepared on Alice's side, is given by the following covariance matrix, \begin{equation}\label{sqz-initial-state-Gaussian} \begin{array}{l} {{\bf{M}}_{\rm AB_0}} {=} \left[ {\begin{array}{*{20}{c}} a_q&0&{c_q }&0\\ 0&a_p&0&{c_p }\\ {c_q }&0&{b_q}&0\\ 0&{c_p }&0&{b_p} \end{array}} \right], \left\{ {\begin{array}{*{20}{c}} {{a_q} = {a_p} = V},\\ {{b_{q}} = V e^{ - 2r_e}, \,\,\, {b_p} = {V e^{2r_e}}},\\ {{c_q} = {e^{ - r_e}}\sqrt {{V^2} {-} 1}},\\ {{c_p} = {- {e^{ r_e}}\sqrt {{V^2} {-} 1}}}. \end{array}} \right. \end{array} \end{equation} Note that in order for the prepare-and-measure scheme to be equivalent with the entanglement-based scheme we need to have $V_{\rm sqz}+V_{\rm sig} = {V{e^{ - 2r_e}}}$ and $1/V_{\rm sqz} = {V{e^{ 2r_e}}}$. \subsection{Eavesdropping assumptions} In practice, it would be very challenging for Eve to make an active attack (for instance an entangling cloner attack \cite{Entangling-cloner-2008}) over a free-space channel. This is because Alice and Bob can classically monitor the line of sight for any active presence of Eve, and abort the protocol if they find anything. Alternatively, Eve could perform a shine-on attack, by using an entangled state and passively adding extra noise onto Bob's detector. Again, this attack will be very challenging for Eve in a self-homodyne detection scenario with the phase of the local oscillator being random, and also the line-of-sight being monitored. However, even if Eve can invisibly add extra noise, it will be identified by Alice and Bob in unexpected deviations from shot-noise at Bob's station and when they estimate a signal-to-noise ratio (SNR) lower than that they expect from the light-collection attack. Thus, with no reduction in practical security, Eve's attack over free-space channels can be restricted to a passive attack, which is the same as a beam-splitter attack. In a passive collective attack, Eve collects the light lost in the transmission, and stores the quantum states in her quantum memory to be collectively measured later. \section{Finite-size security analysis} The Wigner function of Alice and Bob's ensemble-average state (over all sub-channels) at the output of a free-space channel with fluctuating transmissivity $\eta$ is the sum of the Wigner functions of the states after individual sub-channels weighted by sub-channel probabilities \cite{Neda-Nathan-Tim-freespace}. Alice and Bob's state is Gaussian after the realisation of each sub-channel, however, Alice and Bob's ensemble-average state is a non-Gaussian mixture of Gaussian states obtained from individual sub-channels. In an RR scenario, Eve's information, upper bounded by the Holevo information in a collective attack, is given by $\chi(b{:}E)=\mathcal{S}(\rho_{E})-\mathcal{S}(\rho_{E|b})$, where $\mathcal{S}(\rho)$ is the von Neumann entropy of the quantum state $\rho$. The security is analysed based on the purification assumption, i.e., the assumption that Alice and Bob's quantum state $\rho_{AB}$ is purified by Eve's quantum state $\rho_E$. This results in $\mathcal{S}(\rho_E)=\mathcal{S}(\rho_{AB})$, and $\mathcal{S}(\rho_{E|b})=\mathcal{S}(\rho_{A|b})$. Thus, Eve's Holevo information is given by $\chi(b{:}E)=\mathcal{S}(\rho_{AB})-\mathcal{S}(\rho_{A|b})$. Note that $\rho_{AB}$ is non-Gaussian for a free-space channel, however, according to the optimality of Gaussian attacks \cite{Wolf.Giedke.Cirac.PRL.06, Navascues.Grosshans.PRL.06, Garcia-Patron.Cerf.PRL.06}, $\chi(b{:}E)$ can be maximised if calculated based on the covariance matrix of $\rho_{AB}$. The covariance matrix of Alice and Bob's ensemble-average state is given by \begin{equation}\label{effective-AliceBob} \begin{array}{l} {{\bf{M}}_{A{B}}} {=} \left[ {\begin{array}{*{20}{c}} a_q&0&{c'_q }&0\\ 0&a_p&0&{c'_p }\\ {c'_q }&0&{b'_q}&0\\ 0&{c'_p }&0&{b'_p} \end{array}} \right], {\rm{where}} \\ \\ b'_q = \eta_f b_q + 1 - \eta_f + {\rm{Var}}(\sqrt \eta )(b_q - 1) \\ b'_p = \eta_f b_p + 1 - \eta_f + {\rm{Var}}(\sqrt \eta )(b_p - 1) \\ c'_q = \sqrt{\eta_f} \, c_q , \,\,\, c'_p = \sqrt{\eta_f} \, c_p, {\rm{where}}\\ \\ \eta_f = {\left\langle {\sqrt{\eta}} \right\rangle}^2, \,\,\, \rm{Var}(\sqrt \eta ) = \left\langle \eta \right\rangle - {\left\langle {\sqrt \eta } \right\rangle ^2}, \end{array} \end{equation} where $ \langle \eta \rangle = \int_{0}^{\eta_{\rm max}} { \eta p(\eta )} d\eta $, and $ \langle \sqrt{\eta} \rangle = \int_{0}^{\eta_{\rm max}} { \sqrt{\eta} p(\eta )} d\eta $. Thus, Eve's effective passive attack can be considered as a beam-splitter attack with the beam-splitter transmissivity $\eta_f$. According to Eq.~(\ref{effective-AliceBob}), a fading channel is equivalent with a fixed-transmissivity channel with transmissivity $\eta_f $ and an extra non-Gaussian noise of ${\rm{Var}}(\sqrt{\eta}) (b_{q(p)}-1)$ \cite{Usenko-NJP-12, cluster-2019, Neda-Nathan-Tim-freespace}. This noise depends on the channel fluctuation variance ${\rm{Var}}(\sqrt{\eta})$ and the input variance to the channel $b_{q(p)}$. When Eve's attack is considered passive, it means that the channel fluctuation is not under Eve's control. This means that the fluctuation noise ${\rm{Var}}(\sqrt{\eta}) (b_{q(p)}-1)$ is not accessible to Eve for the purification, and hence the fluctuation noise should be considered as a trusted noise in Bob's side. On the other hand, having a trusted noise in Bob's side in a RR scenario decreases Eve's information \cite{trustednoise}. Hence, in calculating Eve's information from the passive attack we consider the (trusted) fluctuation noise to be zero as this can only overestimate Eve's information. Note that we can also use Eve and Bob's covariance matrix to calculate Eve's Holevo information from the passive attack, and obtain the same result as that from the purification assumption as discussed above (see Appendix~\ref{AppendixA} for more details on the purification assumption). As a result of Eve's passive attack, the covariance matrix of Eve's ensemble-average state is given by \begin{equation}\label{E-CM-channel-sqz} \begin{array}{l} {{\bf{M}}_E} = \left[ {\begin{array}{*{20}{c}} {(1 {-} \eta_f )b_q {+} \eta_f }&0\\ 0&{(1 {-} \eta_f )b_p {+} \eta_f } \end{array}} \right], \end{array} \end{equation} The covariance matrix of Eve's system conditioned on Bob's homodyne detection (with efficiency $\eta_B$ and electronic noise $\nu_B$) is given by ${{\bf{M}}_{E\left| {B'} \right.}} {=} {{\bf{M}}_E} {-} {{\bf{M}}_{E{B'}}}{\left( {{\bf{X}}} {{\bf{M}}_{B'}} {{\bf{X}}} \right)^{ \rm MP}} {\bf{M}} _{E{B'}}^T$, where ${{\bf{X}}} = {\rm diag}(1,0)$, MP stands for the Moore-Penrose pseudoinverse of a matrix, and we have \begin{equation}\label{EB-CM-channel-sqz} \begin{array}{l} {{\bf{M}}_{B'}} = {\rm diag}(V_{Bq},V_{Bp}),\,\, {\rm where} \,\, \\ \\ V_{Bq} = {{\eta _B}\left[ { \eta_f b_q {+} 1 {-} \eta_f } \right] {+} (1 {-} {\eta _B})\upsilon },\\ V_{Bp} = {{\eta _B}\left[ { \eta_f b_p {+} 1 {-} \eta_f } \right] {+} (1 {-} {\eta _B})\upsilon },\,\, {\rm where} \,\, \\ \\ \upsilon = 1+\frac{ \nu_B}{1-\eta_B},\,\, {\rm and} \\ \\ {{\bf{M}}_{E{B'}}} = {\rm diag}(C_{EBq},C_{EBp}) ,\,\, {\rm where} \,\, \\ \\ C_{EBq} = {\sqrt {{\eta _B}} {\sqrt {\eta_f (1 - \eta_f )} } \left[ {1 - b_q } \right]},\\ C_{EBp} = {\sqrt {{\eta _B}} {\sqrt {\eta_f (1 - \eta_f )} } \left[ {1 - b_p } \right]}. \end{array} \end{equation} Note that in reality for Bob's quadrature variance (after the detection) we have $V_{Bq} = {{\eta _B} b'_q {+} (1 {-} {\eta _B})\upsilon } $ and $V_{Bp} = {{\eta _B} b'_p {+} (1 {-} {\eta _B})\upsilon } $. But, since as noted earlier, the (trusted) fluctuation noise ${\rm{Var}}(\sqrt{\eta}) (b_{q(p)}-1)$ in Bob's side decreases Eve's information, we assume the fluctuation noise is zero in $V_{Bq}$ and $V_{Bp}$ of Eq.~(\ref{EB-CM-channel-sqz}) for the security analysis. According to the protocol, Alice has to make sure that the beam leaving her lab in the prepare-and-measure scheme has exactly the shot-noise variance in the $\hat q$ quadrature. It means that the beam leaving Alice's lab in the entanglement-based scheme also needs to have the shot-noise variance in the $\hat q$ quadrature, i.e., $b_q = 1 $. As a result, according to ${{\bf{M}}_{EB}}$ in Eq.~(\ref{EB-CM-channel-sqz}), there is no correlation between Eve and Bob in the $\hat q$ quadrature ($C_{EBq} = 0 $), i.e, the quadrature that contains the key information. Hence, there is no information leakage to Eve during the quantum communication part in a RR scenario, i.e., we have the Holevo information $\chi({b{:}E})= \mathcal{S}({\bf{M}}_{E}){-}\mathcal{S}({{\bf{M}}_{E\left| {B'} \right.}}) = 0$. The shot-noise modulation in the $\hat q$ quadrature has another advantage of eliminating the fluctuation-induced noise of a free-space channel. Bob's variance in the $\hat q$ quadrature (before the detection) is given by $b'_q {=} \eta_f b_q + 1 - \eta_f + {\rm{Var}}(\sqrt \eta )(b_q - 1) $. When we have $b_q = 1 $, the fluctuation-induced noise of the channel in the $\hat q$ quadrature, i.e. ${\rm{Var}}(\sqrt \eta )(b_q - 1)$, will become zero, and Bob's variance will also be the shot noise, i.e., $b'_q {=} 1$. Since having $b_q = 1 $ results in no information leakage to Eve during the quantum communication, i.e. $\chi({b{:}E}){=}0$, we do not need to estimate (or upper bound) Eve's information. However, the transmissivity of the channel needs to be estimated in order to estimate the SNR of the channel, which will be used to choose the most efficient error-correcting code rate for the error-correction step. This means we are still required to reveal a subset of data for SNR estimation. Note that in this protocol, $\chi(b{:}E)=0$ does not mean that Eve and Bob's quantum systems are not correlated because Eve and Bob still remain correlated in the phase $\hat p$ quadrature ($C_{EBq} \neq 0$). However, this correlation is irrelevant to the security of the protocol because the key information is only encoded in the $\hat q$ quadrature. In fact, $\chi(b{:}E)=0$ means that Bob's measurement outcomes are uncorrelated with Eve's quantum system $E$ before the error correction. However, in the error-correction procedure, classical information $C$ of size $l_{\rm EC}$ (i.e., the size of the syndrome of Bob's string sent to Alice in a RR scenario) will be revealed by the trusted parties. In the privacy amplification step, Alice and Bob have to discard the leakage during the error correction. Based on the leftover hash lemma \cite{lemma1,lemma2}, the number of approximately secure bits, $\ell$, that can be extracted from the raw key should be slightly smaller than the smooth min-entropy of Bob's string $b$ conditioned on Eve's system $E'$ (which characterizes Eve's quantum state $E$, as well as the public classical variable $C$ leaked during the QKD protocol), denoted by $H_{\min}^{\epsilon_{\rm sm}}(b^{N'}|E')$ \cite{lemma1}, i.e., we have $\ell \le H_{\min}^{\epsilon_{\rm sm}}(b^{N'}|E') {-} 2\log_2 (\frac{1}{{2\bar \epsilon }}) $, where $\bar \epsilon$ comes from the leftover hash lemma. Note that $N'$ indicates the length of Bob's string $b$ after the SNR estimation. The chain rule for the smooth min-entropy \cite{Finite-size-Leverrier-2015} gives $H_{\min}^{\epsilon_{\rm sm}}(b^{N'}|E')=H_{\min}^{\epsilon_{\rm sm}}(b^{N'}|EC) \ge H_{\min}^{\epsilon_{\rm sm}}(b^{N'}|E) - \log_2|C|$, where $\log_2|C|=l_{\rm EC}$, with $l_{\rm EC}$ the size of data leakage during the error correction, which can be given by $l_{\rm EC} = N' [H(b) - \beta I(a{:}b)]$ \cite{Finite-size-Leverrier-2015,Finite-size-Furrer,Finite-size-Lupo-MDI}, where $H(b)$ is Bob's Shannon entropy and $\beta$ is the reconciliation efficiency. In order to calculate the length $\ell$ of the final key which is $\epsilon$-secure ($\epsilon {=} 2\epsilon_{\rm sm}{+}\bar \epsilon {+}\epsilon_{\rm PE}{+}\epsilon_{\rm cor}$ \cite{Finite-size-Leverrier-2015,Finite-size-Lupo-MDI}), the conditional smooth min-entropy $H_{\min}^{\epsilon_{\rm sm}}(b^{N'}|E)$ has to be lower bounded when the protocol did not abort. Under the assumption of independent and identically distributed (i.i.d) attacks such as collective attacks (which we consider here), the asymptotic equipartition property \cite{Finite-size-Leverrier-2015, Marco-thesis, Marco} can be utilized to lower bound the conditional smooth min-entropy with the conditional von Neumann entropy. Explicitly, we have $ H_{\min }^{\epsilon_{\rm sm}} (b^{N'}\left| E \right.) \ge N' \mathcal{S}(b\left| E \right.) - \sqrt{ N'} \Delta_{\rm AEP}$ \cite{Finite-size-Leverrier-2015,Finite-size-Lupo-MDI}, where $\Delta_{\rm AEP} = (d{+}1)^2{+}4(d{+}1)\sqrt{\log_2({2{/}\epsilon_{\rm sm}^2})} + 2\log_2({2}{/}({\epsilon^2 \epsilon_{\rm sm}})) {+} 4{\epsilon_{\rm sm}d}{/}{(\epsilon \sqrt{ N'}) }$ with $d$ the discretization parameter, and $\mathcal{S}(b\left| E \right)$ the conditional von Neumann entropy, which is given by $\mathcal{S}(b|E)=H(b)- \chi^{\epsilon_{\rm PE}}(b{:}E)$. Eve's information on Bob's string $b$ is upper bounded by Holevo information $\chi^{\epsilon_{\rm PE}}(b{:}E)$, except with probability $\epsilon_{\rm PE}$. Recall again that having $b_q = 1 $, we do not need to estimate $\chi^{\epsilon_{\rm PE}}(b{:}E)$, as it is exactly zero. Therefore, the secret key length is given by $\ell {=} N' \beta I(a{:}b) {-} \sqrt{ N'} \Delta_{\rm AEP} {-} 2\log_2 (\frac{1}{{2\bar \epsilon }}) $, and the secret key rate is given by $K = \ell/N $. Note that the mutual information is given by $I(a{:}b) = \frac{1}{2} {\rm log_2} \frac{a_q}{a_q-{[\eta_B \, c'^2_q]}/[{{\eta _B} b'_q {+} (1 {-} {\eta _B})\upsilon }]}$. \subsection{Modulation noise} Now we investigate the discrepancies between the ideal protocol and its practical implementations in terms of the modulation. We consider the case where the prepared state on Alice's side does not have the exact shot-noise variance in the modulation direction. More precisely, we assume some preparation noise $\xi$ in Alice's side, which is assumed to be trusted in the case of a passive eavesdropper. For the aim of numerical simulation, we assume $b_q=1$ and $\xi = 0.02$. Eve's information can still be calculated using Eve and Bob's covariance matrices in Eqs.~(\ref{E-CM-channel-sqz}) and (\ref{EB-CM-channel-sqz}), where the term $b_{q(p)}$ in Eqs.~(\ref{E-CM-channel-sqz}) and (\ref{EB-CM-channel-sqz}) should now be replaced by $b_{q(p)}+\xi$. In this non-ideal modulation case, we have $C_{EBq} \neq 0$ in Eq.~(\ref{EB-CM-channel-sqz}) due to $b_q + \xi > 1 $, which means the preparation noise on top of the shot noise leads to information leakage (i.e. $\chi^{\epsilon_{\rm PE}}(b{:}E) \neq 0$), and the secret key length is given by $\ell {=} N' \beta I(a{:}b) {-} N' \chi^{\epsilon_{\rm PE}}(b{:}E) {-} \sqrt{ N'} \Delta_{\rm AEP} {-} 2\log_2 (\frac{1}{{2\bar \epsilon }})$. Note that in the presence of modulation noise, Eve's information can also be calculated from the purification assumption, i.e., using Alice and Bob's covariance matrix while assuming the (trusted) fluctuation noise is zero (see Appendix~\ref{AppendixA}). In Fig.~\ref{keyrate}, the finite-size key rate of the squeezed-state protocol is shown as a function of channel loss under the assumption of passive collective attacks. For the sake of comparison, we also show the finite-size key rate of a CV QKD protocol using coherent states, under the assumption of passive attacks. Similar to the squeezed-state protocol, it uses Gaussian modulation in only the amplitude quadrature, and direct detection of the amplitude quadrature \cite{UniDcoherent}. For this protocol, the Holevo information can still be calculated using the same method as discussed for the squeezed-state protocol, where now we should set $r_e=-{\rm{ln}}( \sqrt{V})$ and $V_{\rm{sqz}}=1$. As can be seen from Fig.~\ref{keyrate}, for losses above 4 dB, the squeezed-state protocol outperforms the coherent-state protocol under the assumption of passive collective attacks. The squeezed-state protocol can achieve reasonable key rates for losses more than 4 times that of the coherent-state protocol. As can be seen from Fig.~\ref{Holevo} (showing Holevo information $\chi^{\epsilon_{\rm PE}}(b{:}E)$ as a function of channel loss for the squeezed state protocol of Fig.~\ref{keyrate}), the amount of leakage due to the preparation noise is sufficiently small such that it only has a negligible effect on the secret key rate shown in Fig.~\ref{keyrate}. For instance, even for a large preparation noise of $\xi = 0.02$, we have $\chi^{\epsilon_{\rm PE}}({b{:}E}) < 5 \times 10^{-5}$ for the given values of squeezing (very small compared to the secret key rate shown in Fig.~\ref{keyrate}). Also, Fig.~\ref{Holevo} shows that Eve's information is maximised for the channel loss of around 3 dB and then reduced with increasing loss. Note that in the case of modulation noise, where there is some information leakage to Eve, parameter estimation of channel transmissivity and preparation noise is required to upper bound Eve's information $\chi^{\epsilon_{\rm PE}}({b{:}E})$ (see Appendix~\ref{AppendixB} for more details). Note that the squeezed-state protocol is very robust to error bars of estimators, such that the difference between $\chi^{\epsilon_{\rm PE}}({b{:}E})$ (i.e., Holevo information considering the error bars due to the finite-size effects) and Holevo information given the perfect estimation of channel parameters (i.e, the asymptotic case) is negligible. Note that this is not the case for the coherent-state protocol shown in Fig.~\ref{keyrate}. \begin{figure}[t] \begin{center} {\includegraphics[width=3.4 in, height=2.7 in]{correct_figure_plusUniDcoherent.eps}} \caption{Finite-size key rate as a function of channel loss (dB), where ${\rm Loss (dB)} = -10 \log_{10}{\eta_f }$, for the coherent-state protocol (blue dot-dashed line) and the squeezed-state protocol secure against passive collective attacks, with 6 dB (black line) and 10 dB (magenta line) squeezing, where ${\rm Squeezing (dB)} = -10 \log_{10}{V_{\rm sqz} }$. The numerical values for the finite-size regime are the security parameter $\epsilon=10^{-9}$, and the discretization parameter $d=5$. The other parameters are Bob's detector efficiency $\eta_B = 0.61$, electronic noise $\nu_{B} = 0.12$, reconciliation efficiency $\beta=0.98$, and the excess noise $\xi=0.02$ (note that in a passive attack this noise is assumed to be a trusted preparation noise). The block size is chosen to be $N=10^{10}$, half of which is used in total for the parameter estimation. The modulation variance in the coherent-state protocol is optimized to maximise the key rate. We consider a probability distribution for the free-space channel given by the elliptic-beam model \cite{Vasylyev.et.al.PRL.16}, where the model parameters have been chosen according to \cite{Neda-Nathan-Tim-freespace}. }\label{keyrate} \end{center} \end{figure} \begin{figure}[h] \begin{center} {\includegraphics[width=3.4 in, height=2.7 in] {Holevo.eps}} \caption{Holevo information $\chi^{\epsilon_{\rm PE}}(b{:}E)$ resulting from the passive collective attack as a function of channel loss (dB) for the non-ideal squeezed-state protocol with preparation noise $\xi$ (on top of the shot-noise variance) for 6 dB (black line) and 10 dB (magenta line) squeezing. The other parameters are the same as Fig.~\ref{keyrate}. }\label{Holevo} \end{center} \end{figure} \section{Conclusions} We performed composable finite-size security analysis for a CV QKD protocol using an amplitude squeezed laser for free-space channels. Amplitude squeezing can be produced by compact semi-conductor lasers \cite{sqzlaser}. The information is encoded into the amplitude quadrature such that the Gaussian-modulated beam has the shot-noise variance, and detection is performed by the self-homodyne detection of the amplitude quadrature. Under the realistic assumption of classical monitoring of the line of sight, we limited the eavesdropper (Eve) to only passive attacks, where she can only collect the light lost in the communication. Under such an assumption, the shot-noise modulation eliminates information leakage to Eve (and also eliminates the channel-fluctuation noise in the amplitude quadrature). As a result, the parameter estimation of Eve's information is no longer required. We investigated non-ideal modulation with some extra noise on top of the shot noise, which results in sufficiently small information leakage having negligible effect on the finite key rate. The protocol is highly robust to modulation noise, and can tolerate high values of channel loss. While our analysis shows the effectiveness of the protocol for losses up to 18 dB (given practical squeezing) for the block size of $10^{10}$, the performance can be improved by increasing the block size. For instance, for the block size of $10^{11}$, the protocol can tolerate losses up to 23 dB, expected in downlink channels from low-earth-orbit satellites. While our analysis focuses on Gaussian modulation, a remaining question would be how the performance is affected by (non-Gaussian) discrete modulation of squeezed states to the shot-noise level. \section{Acknowledgments} The authors gratefully acknowledge valuable discussions with Nathan Walk, Andrew Lance, and Thomas Symul. This research was supported by funding from the Australian Department of Defence. This research is also supported by the Australian Research Council (ARC) under the Centre of Excellence for Quantum Computation and Communication Technology (Project No. CE170100012).
\section{Introduction} \label{sec:intro} There is a great deal of interest in optimization algorithms that can be run on today's noisy intermediate scale quantum (NISQ) information processors~\cite{Preskill:2018aa}. Two prime examples are quantum annealing (QA)~\cite{kadowaki_quantum_1998} and the quantum approximate optimization algorithm (QAOA)~\cite{farhi2014quantum}. Both algorithms switch between two non-commuting Hamiltonians: a ``driver'' (or ``mixer'') $B$ and a ``target'' (or ``problem'') $C$. The latter encodes the solution to the optimization problem as its ground state. The two algorithms can be viewed as complementary: QA switches continuously while QAOA switches discretely; hence they are particularly well suited for analog and gate-model devices, respectively. In addition, both algorithms are related to the quantum adiabatic algorithm~\cite{Farhi:00}, which is guaranteed by the adiabatic theorem~\cite{Kato:50} to converge to the optimal solution in the limit of arbitrarily long evolution times~\cite{Jansen:07,lidar:102106,Ge:2015wo}. QA relaxes the strict adiabaticity condition while retaining continuity~\cite{kadowaki_quantum_1998}, and the adiabatic algorithm becomes an instance of QAOA when the continuous evolution is ``Trotterized'' (replaced by pulsed segments)~\cite[Sec.~VI]{farhi2014quantum}. There have been numerous studies of the two algorithms, including some that have compared them, with mixed results~\cite{bapat2018bang,zhou2018quantum,streif2019comparison,Pagano:2020wp}. In essence, the question of which algorithm performs best -- QA or QAOA -- boils down to an optimization of the switching schedule. Various results have already been established within the framework of the adiabatic algorithm, QA, or QAOA. For example, it is well known that the adiabatic algorithm can benefit from schedule optimization, even to an extent that can affect whether it provides a quantum speedup or not, as in the case of the Grover search problem~\cite{Roland:2002ul,RPL:10}. It has also been established that a variational approach can optimize the adiabatic switching schedule~\cite{PhysRevLett.103.080502}. Likewise, optimality results are known for QA~\cite{morita:125210,Galindo:2020ti} and QAOA~\cite{szegedy2019qaoa}. A natural question is whether one can jointly treat QA and QAOA under a single schedule optimization framework. The first such attempt was made by Yang \textit{et al.}~\cite{Yang:2017aa} using the framework of the Pontryagin Maximum Principle (PMP) of optimal control~\cite{kipka_pontryagin_2015} (see also Refs.~\cite{Lin:2019wt,mbeng2019optimal,mbeng2019quantum}), whose conclusions favoring a strict QAOA-type schedule were later shown to be overly restrictive by Brady \textit{et al.}~\cite{brady_optimal_2021}, who showed that in general a hybrid discrete-continuous schedule is optimal. The results of Brady \textit{et al.} were obtained in a closed system setting of purely unitary dynamics. Here, we generalize the theory to the open system setting, and obtain their closed system results as a special case. We proceed to first provide the general background for the problem, after which we outline the structure of the rest of the paper. \section{Background} \label{sec:background} The closed system setting involves a system evolving unitarily in a $d$-dimensional Hilbert space $\mathcal{H}$ subject to the Schr\"odinger equation: \begin{equation} \label{eq:Ham_sys} \frac{d}{dt}|\psi(t)\rangle =-iH(t)|\psi(t)\rangle,\qquad|\psi(0)\rangle=|\psi_{0}\rangle\ . \end{equation} The protoypical quantum annealing problem concerns finding the optimal schedule $s(t)\in[0,1]$ for the time-dependent Hamiltonian given by\footnote{In the control literature the notation $u$ or $u(t)$ is used to denote the control function, rather than $s$ or $s(t)$. Here we choose to use the notation that is more familiar in the quantum computing community.} \begin{subequations} \label{eq:Ham_sys2} \begin{align} H(t) &= s(t) B + (1-s(t)) C \ , \quad t\in\mathcal{I} \\ &= C +s(t)(B-C)\ . \label{eq:Ham_sys2-b} \end{align} \end{subequations} The \emph{control interval} is $\mathcal{I} = [0,t_f]$. Often the Hermitian operator $C$ is an Ising-type Hamiltonian of the form $\sum_{i=1}^n h_i \sigma^z_i + \sum_{i<j}^n J_{ij}\sigma^z_i\sigma^z_j$ (where $h_i$ and $J_{ij}$ are local longitudinal fields and couplings, respectively, and $\sigma^z_i$ is the Pauli matrix acting on the $i$'th qubit), and the Hermitian operator $B$ is a transverse field of the form $\sum_{i=1}^n \sigma^x_i$~\cite{kadowaki_quantum_1998}. For our purposes it only matters that $[B,C]\neq 0$. The initial state $|\psi_{0}\rangle$ is assumed to be the ground state of $B$, and in both QA and QAOA the target state is the ground state of $C$. A relaxation of this, which we consider as the objective in the present work, is to minimize the expectation value of $C$ at a given final time $t_f$, i.e., \begin{equation} J:=\langle\psi(t_f)|C|\psi(t_f)\rangle\ . \label{eq:Brady-J} \end{equation} Minimizing $J$ is equivalent to minimizing the energy of the $C$ Hamiltonian, and if the global minimum is found then this corresponds to finding the ground state of $C$ (i.e., solving the optimization problem defined by $\{h_i,J_{ij}\}$ when $C$ is in Ising form). It is known in quantum control theory (see, e.g., Ref.~\cite{dalessandro_introduction_2007}) that if $\hat{\mathfrak{L}}$ is the Lie algebra generated by $B$ and $C$ and $e^{\hat{\mathfrak{L}}}$ the corresponding Lie group, assumed to be compact, the set of states reachable from $|\psi_{0}\rangle$ with free final time $t_f$ is \begin{equation} \mathfrak{R}:=\{X|\psi_{0}\rangle\,|\,X\in e^{\hat{\mathfrak{L}}}\}, \label{eq:reach} \end{equation} so that the absolute minimum of the cost $J$ is \begin{equation} J_{\min}=\min_{|\psi\rangle\in\mathfrak{R}}\langle\psi|C|\psi\rangle\ . \label{absmin} \end{equation} If the dynamical Lie algebra $\hat{\mathfrak{L}}$ is the whole $su(d)$ then any state in the Hilbert space can be reached (starting from any other state), in particular the ground state of $C$, in which case the system is said to be \emph{controllable}~\cite{jurdjevic_control_1972}. However, requiring full controllability may be overly restrictive, as we only need to reach a particular state. The following is a simple generalization that provides a sufficient condition for reaching the ground state. \begin{myproposition} \label{prop:0} Suppose $[B,P_0]=[C,P_0]=0$ where $P_0$ is an orthogonal projector. The Hilbert space decomposes according to the block structure $\mathcal{H} = \mathrm{Ran}(P_0) \oplus \mathrm{Ker}(P_0)$. The Lie algebra generated by $B$ and $C$, $\hat{\mathfrak{L}}$, must have the same block structure. Suppose that, according to this structure, $\hat{\mathfrak{L}} = su(d_0)\oplus \hat{\mathfrak{L}}_1$ with unspecified $\hat{\mathfrak{L}}_1$ and $d_0=\dim(\mathrm{Ran}(P_0))$; then, if the initial state belongs to $\mathrm{Ran}(P_0)$, any state in $\mathrm{Ran}(P_0)$ can be reached (in finite time). \end{myproposition} The proof is self-evident, since the full controllability result~\cite{jurdjevic_control_1972} is now applicable in $\mathrm{Ran}(P_0)$. This generalization can be applied, for example, in case both $B$ and $C$ commute with a third operator, say $M$, and one knows to which sector of $M$ the ground state of $C$ belongs; see Appendix \ref{app:reachability} for an example. In any case, it is clear that something must be assumed in order to guarantee the reachability of the ground state of $C$. Clearly, a necessary condition is $[B,C]\neq 0$, but even when $[B,C]\neq 0$ it is easy to come up with examples where the ground state of $C$ cannot be reached; see Appendix \ref{app:reachability}. In the following we will tacitly assume that conditions are such that the ground state of $C$ can be reached. Brady \textit{et al.}~\cite{brady_optimal_2021} used optimal control methods to prove that for the cost as defined as in Eq.~\eqref{eq:Brady-J}, the optimal schedule is one where at the beginning and end of the control interval $s \equiv 0$ and $s \equiv 1$, respectively.\footnote{We use the notation $f \equiv c$ to mean that the function f is ``identically'' equal to $c$ in some interval $\Theta$, i.e., $f \equiv c$ is equivalent to $f(t) = c$ for $t\in\Theta$.} From a quantum annealing perspective this might appear as a counterintuitive result, since it means that rather than the usual ``forward'' formulation of quantum annealing~\cite{Albash-Lidar:RMP,Hauke:2019aa}, where one interpolates smoothly from $H(0) = B$ to $H(t_f) = C$, the optimal protocol starts from the system being in the ground state of $B$ but the initial Hamiltonian is $C$, and the final Hamiltonian is not $C$ but rather $B$. The result, however, can be understood by noting that in the adiabatic approach, one interpolates so slowly from $H(0) = B$ to $H(t_f) = C$ that the system always remains in the ground state. Instead, in optimal control, we optimize over the set of possible states obtained by applying either $C$ or $B$ to the initial state, in a continuous fashion. In this sense, applying $B$ at the beginning is a waste of time as it does not change the initial state. Applying $C$ at the end, when the system is supposed to be close to the ground state of $C$, is similarly wasteful. This relaxation of the approach of strict adiabaticity is in line with other alternatives, such as shortcuts to adiabaticity~\cite{Campo:2013ix,PhysRevA.95.012309} and diabatic quantum annealing~\cite{crosson2020prospects}. More precisely, Ref.~\cite{brady_optimal_2021} showed, provided that a certain condition holds (see below), that the optimal control function starts (ends) with $s\equiv 0 $ ($ s\equiv1$) in an interval of positive measure after $t=0$ (before $t_f$). Elsewhere the optimal control $s(t)$ is ``singular'', except for possible interruptions by a sequence of ``bang'' controls, where $s\equiv0$ or $s\equiv1$. In control theory a ``singular'' interval or arc, is an interval of time where the PMP control Hamiltonian in Eq.~\eqref{HamilP} below does not depend on the control $s$. The remaining ``nonsingular'' arcs give rise to the ``bang'' controls. In the numerical simulations of Ref.~\cite{brady_optimal_2021}, the control appeared to be continuous (even smooth) on such singular arcs. Hence the term ``anneal'' was used in lieu of ``singular'', with the intention of stressing the continuous (or possibly even smooth) nature of the control on the singular arcs. They suggestively called the resulting optimal control a ``bang-anneal-bang'' protocol. At present, a rigorous proof that the control function is continuous (let alone smooth) on singular arcs is lacking, and there is some risk of confusion in interpreting the singular arcs as always being continuous, or even differentiable as is typically assumed in QA and adiabatic quantum computing~\cite{Jansen:07,Albash-Lidar:RMP}. Nonetheless, while keeping these caveats in mind, we shall adopt the same (numerically supported) terminology as Ref.~\cite{brady_optimal_2021}, and use ``continuous (or anneal) $=$ singular'' as well as ``bang $=$ nonsingular'' interchangeably. Here, we consider the \emph{open system} version of the same optimal control problem. We reformulate the problem in terms of the density matrix $\rho$, whose dynamics is described by the following, rather general master equation:\footnote{The form we have assumed is called a time-convolutionless master equation. The most general master equation is in Nakajima-Zwanzig form and includes a memory kernel superoperator $\mathcal{K}(t,t')$ acting jointly on the system and the environment $E$, such that (for a factorized initial condition) $\dot{\rho} = \Tr_E \int_0^t \mathcal{K}(t,t')\rho(t')\otimes\rho_E dt'$, with $\rho_E$ a fixed environment state and $\Tr_E$ denoting the partial trace over the environment~\cite{Breuer:book}.} \begin{equation} \dot{\rho}=\mathcal{L}\rho,\qquad\rho(0)=\rho_{0}\ , \label{eq:general_ME} \end{equation} where the Liouvillian $\mathcal{L}$ depends linearly on the control $s$ (and the controlled operators $B,C$). Note that the Liouvillian is not explicitly time-dependent (i.e.~$\partial_t \mathcal{L}=0, \ \forall t\in \mathcal{I}$) and depends on time only through the control schedule $s(t)$. This is an important requirement that will play a crucial role in our ability to apply the Pontryagin principle in the form we need, as we discuss in more detail below. Furthermore, to be physically meaningful, $\mathcal{L}$ must preserve hermiticity, i.e., $[\mathcal{L}(X)]^\dagger = \mathcal{L}(X^\dagger), \ \forall X$. Instead of Eq.~\eqref{eq:Brady-J}, the cost $J$ takes the form \begin{equation} J:=\Tr\left[C\rho(t_f)\right] =\langle C,\rho(t_f)\rangle\ , \label{nuovocosto} \end{equation} where we used the Hilbert-Schmidt scalar product $\langle X,Y\rangle := \Tr(X^\dagger Y)$ for operators $X, Y$. We shall see that a description and treatment of the optimal control problem in the setting of the density matrix is not only more general but also more elegant since the cost $J$ is linear in the state rather than quadratic, as in Eq.~\eqref{eq:Brady-J}. Moreover, we obtain the closed system result as a special case. Unlike Ref.~\cite{brady_optimal_2021}, which used a mixture of the PMP and a variational (Lagrange multiplier type of) argument, we use only the PMP, which significantly simplifies the proof. The rest of this paper is organized as follows. In Sec.~\ref{sec:generalME}, we apply general results from optimal control theory and the necessary conditions of the PMP to the problem of minimizing $J$ [Eq.~\eqref{nuovocosto}] for a given final time $t_f$ and the general dynamical system of the form of Eq.~\eqref{eq:general_ME}. In Sec.~\ref{OCP} we specialize to the case of closed systems, which are described by the von Neumann equation. In particular, we confirm but also sharpen the results of Ref.~\cite{brady_optimal_2021}. We also analyze in depth the optimal control problem of a single spin-$1/2$, and prove that the optimal schedule is of the bang-bang type. In Sec.~\ref{OSC} we consider the case of open systems. This includes both the most general case of a reduced description of quantum system obtained by tracing out the environment it is coupled to, and the case where the open quantum system is described by adiabatic master equations, both non-Markovian and Markovian. In Sec.~\ref{Switchings} we derive a ``switching equation,'' which allows us to provide a general characterization of the switches between non-singular and singular arcs, and derive conditions for the presence or absence of singular arcs. We also give a heuristic derivation of the shortening of the length of the arcs between two switches with increasing system size. We conclude in Sec.~\ref{sec:conc}. In a series of appendices we provide additional background on optimal control theory and technical details and proofs of various results from the main text. \section{Statement of the Pontryagin Maximum Principle} \label{sec:generalME} We state the PMP as it applies to our problem of interest (see Appendices~\ref{app:A} and~\ref{app:real}): \begin{thm} \label{adapt0} Assume that $\rho^*$ and $s^*$ are, respectively, an optimal state and control pair for the problem defined by Eqs.~\eqref{eq:general_ME} and~\eqref{nuovocosto} for a fixed final time $t_f$.\footnote{We also use an asterisk to denote complex conjugation; the meaning will always be clear by context.} Then there exists a nonzero $n\times n$ Hermitian time-dependent matrix $p=p(t)$ called the {\em co-state} that satisfies\footnote{$\mathcal{L}^{\dag}$ in Eq.~\eqref{LiouvK1} indicates the Hilbert-Schmidt adjoint of $\mathcal{L}$, defined via $\langle \mathcal{L}^\dag(A),B\rangle := \langle A,\mathcal{L}(B)\rangle = \Tr[A^\dag \mathcal{L}(B)], \ \forall A,B$; see Appendix~\ref{app:real}.} \begin{equation} \dot{p}=-\mathcal{L}^{\dag}p\ , \label{LiouvK1} \end{equation} with the final condition \begin{equation} p(t_f)=-C\ . \label{3plusB} \end{equation} Furthermore, define the \emph{PMP control Hamiltonian} function \begin{equation} \mathbb{H}\left(p,\rho,s\right) :=\langle p,\mathcal{L}\rho\rangle\ . \label{HamilP} \end{equation} We then have the \emph{maximum principle}: \begin{equation} \mathbb{H}\left(p(t),\rho^*(t),s^*(t)\right)=\max_{v\in[0,1]}\mathbb{H}\left(p(t),\rho^*(t),v\right)\ , \label{MaxCon} \end{equation} and there exists a real constant $\lambda$ such that \begin{equation} \mathbb{H}\left(p(t),\rho^*(t),s^*(t)\right)\equiv \lambda\ . \label{forlanda} \end{equation} \end{thm} A few remarks are in order. \begin{itemize} \item The PMP control Hamiltonian \emph{function}~\eqref{HamilP} is, of course, different from the Hamiltonian \emph{operator}~\eqref{eq:Ham_sys2} generating the dynamics. \item Since $p$ and $\rho$ are Hermitian and $\mathcal{L}$ is Hermiticity-preserving [$\left[\mathcal{L}\left(X\right)\right]^{\dagger}=\mathcal{L}\left(X^{\dagger}\right)$ $\forall X$], ``expectation values'' of the form $\langle p,\mathcal{L}\rho\rangle$ are real, and hence so is the PMP control Hamiltonian~\eqref{HamilP}. \item The condition $\partial_t\mathcal{L}=0$ $\forall t \in \mathcal{I}$ must be satisfied and is implicit in Eq.~\eqref{eq:general_ME}. In other words, $\mathcal{L}$ may not depend explicitly on time. Without this condition Eq.~\eqref{forlanda} does not hold with a constant $\lambda$. \item It is worth highlighting that at the final time the co-state becomes the (negative of the) target Hamiltonian [Eq.~\eqref{3plusB}], a fact we use repeatedly in our applications of the Theorem~\ref{adapt0} below. \item As discussed after Theorem~\ref{case1} in Appendix~\ref{app:A}, if the optimal trajectory is such that the constraint of the final time $t_f$ is ``active'', i.e., a small perturbation $t_f+\delta$ allows us to decrease the cost, then $\lambda>0$ in Eq.~\eqref{forlanda}. This is an important point that will be further discussed in the next section. \item Given that the PMP is formulated in terms of real-valued quantities in the optimal control literature (see Appendix~\ref{app:A}), one must first transform the relevant equations into real-valued ones. This can easily be done since the space of $n\times n$ Hermitian matrices is isomorphic to the space of $n^2$ real variables via coordinatization. We discuss this in Appendix~\ref{app:real}. \item Since $p(t)$ and $\rho(t)$ are solution of differential equations, they are continuous function of time. This implies that expressions of the form $\langle p, \mathcal{K}\rho\rangle$ with the superoperator $\mathcal{K}$ independent of time (both explicitly and implicitly), are continuous functions of $t$, a fact which we repeatedly and implicitly use below. \end{itemize} \section{The closed system case} \label{OCP} We first consider the closed system case. Let us define the superoperator \begin{equation} \mathcal{K}_{X}:=-i\left[X,\bullet\right]\ . \label{eq:K_X} \end{equation} Note that $\mathcal{K}_{X}$ is linear with respect to $X$. For Hermitian $X$, $\mathcal{K}_{X}$ is anti-Hermitian (see Appendix~\ref{app:calcs}): \begin{equation} \mathcal{K}_{X}^{\dag}=-\mathcal{K}_{X^{\dagger}}=-\mathcal{K}_{X}\ . \label{eq:KXanti} \end{equation} The von Neumann equation corresponding to Eq.~\eqref{eq:Ham_sys} is \begin{equation} \dot{\rho}=\mathcal{K}_{C}\rho+s(t)\left(\mathcal{K}_{B}\rho-\mathcal{K}_{C}\rho\right),\quad\rho(0)=\rho_{0} \ , \label{eq:vonNeum} \end{equation} where henceforth we denote the initial and final conditions of operators $X$ by $X(0):=X_0$ and $X(t_f):=X_f$, respectively. I.e., one has Eq.~\eqref{eq:general_ME} with \begin{equation} \mathcal{L}=\mathcal{K}_{C}+s(t)\mathcal{K}_{B-C}\ . \label{eq:L-closed} \end{equation} Since in this case $\mathcal{L}^{\dag}=-\mathcal{L}$, Eq.~\eqref{LiouvK1} tells us that the co-state matrix $p$ satisfies the same equation as $\rho$: \begin{equation} \dot{p}=\mathcal{K}_{C}p+s(t)\mathcal{K}_{B-C}p\ , \label{Eq:co_vonNeum} \end{equation} but with the final condition~\eqref{3plusB}. The PMP control Hamiltonian reads \begin{equation} \mathbb{H}=\langle p,\mathcal{K}_{C}\rho\rangle+s(t)\langle p,\mathcal{K}_{B-C}\rho\rangle\ . \label{HamilP-1} \end{equation} \subsection{The ``bang-anneal-bang'' protocol is optimal} Applying Theorem~\ref{adapt0} to the anti-Hermitian superoperator $\mathcal{L}$ of Eq.~\eqref{eq:L-closed}, we obtain the following extension of the result of Ref.~\cite{brady_optimal_2021} to the density matrix setting: \begin{thm} \label{Bradygen} (i) Assume $s^*\in[0,1]$ is the optimal control in an interval $[0,t_f]$ minimizing the cost~\eqref{nuovocosto} for Eq.~\eqref{eq:vonNeum}. Then there exists a nonzero Hermitian matrix solution of Eq.~\eqref{Eq:co_vonNeum} with terminal condition~\eqref{3plusB} such that $s^*\equiv0$ on intervals where $\langle p,\mathcal{K}_{B-C}\rho\rangle < 0$, and $s^*\equiv1$ on intervals where $\langle p,\mathcal{K}_{B-C}\rho\rangle > 0$. On all other intervals $\langle p,\mathcal{K}_{B-C}\rho\rangle\equiv0$ (these are called singular arcs). (ii) Assume furthermore that the constraint on the final time $t_f$ is active (so that $\lambda>0$). Then $s^*(t)=1$ for $t\in(t_f-\epsilon,t_f]$ for some $\epsilon>0$. Moreover, if the initial condition $\rho_0$ commutes with the driver Hamiltonian $B$, i.e., $\mathcal{K}_{B}\rho_0=0$, one also has $s^*(t)=0$ for $t\in[0,\epsilon')$ for some $\epsilon'>0$. \end{thm} Before proving this theorem we offer a few remarks. \begin{itemize} \item Part (i) implies that the optimal control is, in general, an alternation of ``bang'' (nonsingular) arcs and ``anneal'' (singular) arcs where $\langle p,\mathcal{K}_{B}\rho\rangle=\langle p,\mathcal{K}_{C}\rho\rangle$. Using the PMP, this is an immediate consequence of the fact that the control enters linearly in the equation and it is coupled to the superoperator $\mathcal{K}_{B-C}$. \emph{The latter is what is ``special'' about the quantum annealing problem.} \item Part (ii) implies that under the assumption of an active time constraint and for a particular initial condition, the optimal control starts and ends with nonsingular arcs. In particular, it starts with an arc $s\equiv0$ and ends with an arc $s\equiv1$. \item In practice, whether there are additional nonsingular arcs in the middle is problem dependent, and there is numerical evidence that such optimal scenarios do indeed exist~\cite{brady_optimal_2021}, but such nonsingular arcs do not exist in the single qubit example discussed in Subsection \ref{esempio}. \item Assuming that $\mathcal{K}_{B}\rho_0=0$ one can prove $\lambda \ge0$ (see also Appendix~\ref{app:A}, Proposition~\ref{landamagz}), but the condition $\lambda >0$ is more subtle and it must be assumed independently. We return to this point in the next subsection. \end{itemize} \begin{proof} Part (i): Eq.~\eqref{HamilP-1} states that the PMP control Hamiltonian $\mathbb{H}$ depends on the control only via the term $s(t)\langle p,\mathcal{K}_{B-C}\rho\rangle$. If $\langle p,\mathcal{K}_{B-C}\rho\rangle <0$, then to maximize this term as per Eq.~\eqref{MaxCon} subject to the constraint that $s(t)\in [0,1]$, clearly we must set $s^\ast\equiv 0$. Likewise, if $\langle p,\mathcal{K}_{B-C}\rho\rangle > 0$, then to maximize this term subject to the same constraint requires $s^\ast\equiv 1$. This is the case of nonsingular arcs. Conversely, if $\langle p,\mathcal{K}_{B-C}\rho\rangle \equiv 0$ (a singular arc), then we cannot conclude anything about the control from the PMP. Part (ii): To investigate the form of the control at the end of the control interval $[0,t_f]$, consider Eq.~\eqref{forlanda} with $\lambda>0$. Using Eq.~\eqref{3plusB} we have $\langle p_f,\mathcal{K}_{C}\rho_f\rangle=\langle\mathcal{K}_{C}^{\dag}p_f,\rho_f\rangle=\langle\mathcal{K}_{C}C,\rho_f\rangle=0$. This means that $\mathbb{H}(t_f)=s(t_f) \langle p_f,\mathcal{K}_{B}\rho_f\rangle=\lambda>0$, which in turn, since $s\in[0,1]$, implies that $\langle p_f,\mathcal{K}_{B}\rho_f\rangle>0$. By continuity there must exist an interval $(t_f-\epsilon,t_f]$ (for some $\epsilon>0$) such that $\langle p (t),\mathcal{K}_{B-C}\rho (t)\rangle>0$ for $t\in(t_f-\epsilon,t_f]$, and in this interval we must have $s^\ast(t)=1$ by (i). The argument for the initial time is similar but instead of Eq.~\eqref{3plusB} it uses the extra assumption $\mathcal{K}_{B}\rho_{0}=0$. Let us evaluate the control Hamiltonian at $t=0$. Because of the assumption $\mathcal{K}_{B}\rho_0=0$ we have $\mathbb{H}(t=0)=(1-s(0))\langle p_0,\mathcal{K}_{C}\rho_0\rangle=\lambda>0$. Since $s\in[0,1]$ this implies that $\langle p_0,\mathcal{K}_{C}\rho_0\rangle>0$ and $\langle p_0,\mathcal{K}_{-C}\rho_0\rangle<0$. By continuity there must exist an $\epsilon'>0$ such that, for $t\in[0,\epsilon')$, $\langle p(t),\mathcal{K}_{B-C}\rho(t)\rangle <0$ and in this interval we must have $s^\ast(t)=0$ by (i). \end{proof} \subsection{The active constraint assumption and a sharpening of the results of Ref.~\cite{brady_optimal_2021}} \label{sec:active-constraint} The condition $\lambda>0$ (that is, an active constraint on the final time $t_f$) requires some extra discussion. It is a known fact in the geometric theory of quantum control systems, and it follows as an application of general results on control systems on Lie groups (see, e.g., Ref.~\cite[Th.~7.2]{jurdjevic_control_1972}), that there exists a \emph{critical time} $t_{c}$ such that, the set of states reachable at time $t$, coincides for every $t\geq t_{c}$. In other words, the reachable set does not grow past a certain time $t_{c}$. Therefore, for every $t_f\geq t_{c}$ the time constraint is never active. The minimum time $t_{\min}$ to reach the ground state of $C$ is $\leq t_c$. If the final time $t_f$ is greater than or equal to $t_{\min}$, then again the time constraint can never be active. In order to avoid this situation, it was claimed in Ref.~\cite{brady_optimal_2021} that having $t_f<t_{\min}$, is sufficient for having $\lambda>0$ in Eq.~\eqref{forlanda}. Their argument only uses $[\rho_0,B]=0$. However, in Sec.~\ref{esempio} below we give an example satisfying this assumption for which $\lambda =0$ for arbitrarily small $t_f$. Thus, the assumption $t_f<t_{\min}$ is certainly necessary for $\lambda>0$ but is in fact not sufficient. Rather, $\lambda>0$ is a feature of the optimal trajectory rather than of the problem itself. This can be explained more easily geometrically, as we now do. The optimal cost at time $t_f$ is the minimum of a continuous function on the reachable set of states $\mathfrak{R}_{t_f}$ (see Appendix~\ref{app:A}). It is also known, under conditions that apply in our case, that the reachable set $\mathfrak{R}_{t_f}$ varies continuously with $t_f$~\cite{ayala_about_2017}. We can map the space of Hermitian matrices $\rho$ diffeomorphically to $\mathbb{R}^{n^{2}}$ (see Appendix~\ref{app:real}) and consider its reachable set there. Since the cost function~\eqref{nuovocosto} is linear on this set, the minimum occurs on the boundary. Therefore, the optimal trajectory is a curve starting from the initial condition $\rho_{0}$ and ending on the boundary of $\mathfrak{R}_{t_f}$. At the endpoint, the trajectory will have a tangent vector which indicates its future direction. Now $\lambda>0$ if, going (infinitesimally) in that direction combined with an increase in the size of the reachable set $\mathfrak{R}_{t_f+\epsilon}$ for some small $\epsilon$, will result in a reduced cost, and this is what we mean by the time constraint being active. If $t_f$ is such that the reachable set does not increase at $t_f$, for instance if $t_f\geq t_{c}$, then clearly this is not possible and we must have $\lambda=0$. However, it is also possible that the reachable set increases but not in a way to (strictly) decrease the cost, in particular the portion of the boundary where we landed might not move at all, or it might move but not in a direction that decreases the cost. This geometric discussion is illustrated with figures in Appendix~\ref{app:geomfig}. The phenomenon that the optimal cost does not decrease with an increasing final time $t_f$ may occur even though $t_f$ is arbitrarily small. Let us denote by $J_{\min}(t_f)$ the minimum cost~\eqref{nuovocosto} as a function of $t_f$. The example we provide below (Sec.~\ref{esempio}) shows that, even assuming $[\rho_{0},B]=0$, we can have $J_{\min}(t_f)=J_{\min}(0)$ for $t_f\in[0,\epsilon)$ and some $\epsilon>0$, that is, the cost cannot be lowered for some time, independently of the control. However, under the additional assumption that $\rho_{0}$ is the \emph{nondegenerate ground state of $B$} this does not happen, and we have the following theorem which we prove in Appendix~\ref{sec:proof-thm3}: \begin{thm} \label{Active} Assume that $\rho_{0}$ in Eq.~\eqref{eq:general_ME} is the nondegenerate ground state of $B$. Then there exists an $\epsilon>0$ such that, for every $t_f\in(0,\epsilon)$, $J_{\min}(t_f)<J_{\min}(0)=\Tr(C\rho_{0})$. \end{thm} In other words, if we start from the nondegenerate ground state of $B$ we can always decrease the cost for sufficiently small $t_f$. Note that this, however, does not prove that $\lambda >0$. As we have explained, the condition $\lambda>0$ is a condition about the optimal trajectory, and it is an open problem to find sufficient conditions such that every optimal trajectory satisfies the $\lambda > 0$ requirement for sufficiently small $t_f$. \subsection{Example: optimal control of a spin-$1/2$ particle} \label{esempio} We now give an example showing that without the assumption that $\rho_{0}$ is the nondegenerate ground state of $B$, the cost~\eqref{nuovocosto} cannot be lowered even for arbitrarily small $t_f$'s. Consider a spin-$1/2$ particle (qubit) in a magnetic field. The model is given by Eq.~\eqref{eq:vonNeum} with $C=\frac{1}{2}\sigma^z$ and $B=\frac{1}{2}\sigma^x$. As an orthonormal, Hermitian operator basis we choose $F_i = \frac{1}{\sqrt{2}}\sigma_i$, where we denote the standard Pauli matrices $\sigma^x\equiv\sigma_1$ etc., i.e.: \begin{equation} \sigma_{1}=\left(\begin{array}{cc} 0 & 1\\ 1 & 0 \end{array}\right),\quad\sigma_{2}=\left(\begin{array}{cc} 0 & -i\\ i & 0 \end{array}\right),\quad\sigma_{3}=\left(\begin{array}{cc} 1 & 0\\ 0 & -1 \end{array}\right)\ . \label{PauliMat} \end{equation} They satisfy the su$(2)$ commutation relations \begin{equation} \left[\sigma_1,\sigma_2\right]=2i\sigma_3,\quad\left[\sigma_3,\sigma_1\right]=2i\sigma_2,\quad\left[\sigma_2,\sigma_3\right]=2i\sigma_1\ . \label{commurel} \end{equation} We parametrize the density matrix as $\rho=\frac{1}{2}\left(\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}+\boldsymbol{v}\cdot\boldsymbol{\sigma}\right)$, where $\boldsymbol{v}\in \mathbb{R}^{3}$ is the Bloch vector ($\|\boldsymbol{v}\|\leq 1$) and $\boldsymbol{\sigma} = (\sigma_1,\sigma_2,\sigma_3)^T$. The Bloch vector satisfies Eq.~\eqref{eq:vonNeum} where, using $\boldsymbol{\mathcal{K}}_{ij} = \Tr[F_i \boldsymbol{\mathcal{K}}(F_j)]$ (see Appendix~\ref{app:real}), we have \begin{equation} \label{adcadb} \boldsymbol{\mathcal{K}}_{B}=\left(\begin{array}{ccc} 0 & 0 & 0\\ 0 & 0 & -1\\ 0 & 1 & 0 \end{array}\right),\quad\boldsymbol{\mathcal{K}}_{C}=\left(\begin{array}{ccc} 0 & -1 & 0\\ 1 & 0 & 0\\ 0 & 0 & 0 \end{array}\right)\ . \end{equation} Equivalently, the dynamics are given by the Bloch equation \begin{subequations} \begin{align} \label{eq:Bloch-eq} \dot{\boldsymbol{v}} & =\boldsymbol{\mathcal{M}}(s)\boldsymbol{v} \\ \boldsymbol{\mathcal{M}}(s) & =\left(\begin{array}{ccc} 0 & -(1-s) & 0\\ 1-s & 0 & -s\\ 0 & s & 0 \end{array}\right)\ . \label{eq:M_Bloch} \end{align} \end{subequations} Geometrically, $\boldsymbol{\mathcal{K}}_{C}$ is the infinitesimal generator of a counterclockwise rotation about the $v_{3}$ axis, while $\boldsymbol{\mathcal{K}}_{B}$ is the infinitesimal generator of a counterclockwise rotation about the $v_{1}$ axis. For $s\in(0,1)$, $\boldsymbol{\mathcal{M}}(s)=(1-s)\boldsymbol{\mathcal{K}}_{C}+s\boldsymbol{\mathcal{K}}_{B}$ generates a counterclockwise rotation about an intermediate axis in the $(v_{1},v_{3})$ plane. The cost~\eqref{nuovocosto} in this case becomes $J = \frac{1}{2}v_3$, i.e., it corresponds to the minimization of the $v_{3}$ component. Furthermore, let us assume for simplicity that the initial state $\rho_{0}$ is pure ($\|\boldsymbol{v}\| = 1$). There are only two such states compatible with the condition $[B,\rho_{0}]=0$ (equivalently: $\boldsymbol{\mathcal{K}}_{B}\boldsymbol{v}_0=\boldsymbol{0}$): the $\sigma_1$ eigenstates, i.e., $\boldsymbol{v}_{0}=(\pm1,0,0)^{T}$. Now, if the initial state is $\boldsymbol{v}_{0}=(1,0,0)^{T}$, i.e., the excited state of $B$, then for sufficiently small $t$ we have $v_{3}(t)\geq0$ independently of the control $s\in[0,1]$ (see Appendix~\ref{app:calcs}). Therefore, an optimal control in $[0,t_f]$ for $t_f$ small will be $s\equiv0$ (which will keep the value of $v_{3}$ at zero). The value of the minimum cost $J_{\min}(t_f)$ is equal to $J(0)$ for any arbitrarily small $t_f$. The constraint on the final time is not active here, \emph{even for arbitrarily small $t_f$}. As a consequence, in this case we cannot draw the conclusions of Theorem \ref{Bradygen} following from the assumption $\lambda>0$. On the other hand, for $\boldsymbol{v}_{0}=(-1,0,0)^{T}$, which corresponds to the (nondegenerate) \emph{ground state}, with sufficiently small $t_f$ we can lower the cost according to Theorem~\ref{Active}. We prove in Appendix~\ref{low} that the optimal control in this case is a simple bang-bang protocol: \begin{thm} \label{conclusione} The optimal control for the system of one spin-$1/2$ particle considered above, starting from the ground state and minimizing the cost $\Tr(\sigma_{3}\rho)$ in time $t_f<\pi$, is the sequence $s^\ast\equiv0$ for time $\frac{t_f}{2}$ followed by $s^\ast\equiv1$ for time $\frac{t_f}{2}$ (see Fig.~\ref{fig:optimal}). \end{thm} Here $t_c=\pi$, i.e., if $t_f \ge \pi$ one trivially finds the ground state exactly (by a $\pi/2$ rotation from the $-1$ eigenstate of $\sigma^x$ to the $-1$ eigenstate of $\sigma^y$, followed by another $\pi/2$ rotation to the $-1$ eigenstate of $\sigma^z$) and one cannot do better by increasing $t_f$. This optimal bang-bang schedule result for a single spin-$1/2$ joins previous such results for systems as diverse as pairs of one-dimensional quasicondensates~\cite{Rahmani:2013vq} or ``gmon'' qubits~\cite{Bao:2018uh}, as well as braiding of Majorana zero modes~\cite{Karzig:2015un}. \begin{figure} \begin{centering} \includegraphics[width=7cm]{optimal1.pdf} \par\end{centering} \caption{(Color online) Single qubit case. Optimal trajectory on the Bloch sphere with initial condition $\boldsymbol{v}_0 = (-1,0,0)^T$. Here $t_f=0.95\pi$ so the ground state of $C$, corresponding to the point $(0,0,-1)$, is not reached exactly.} \label{fig:optimal} \end{figure} \section{The open system case} \label{OSC} In this section we generalize the results for closed systems to the open system setting. We consider two different approaches: an approximation-free treatment of a system + environment where both are finite-dimensional, and a master equation approach subject to a Markovian approximation, which applies for infinite-dimensional environments~\cite{Davies:76,alicki_quantum_2007,Breuer:book,rivas_open_2012,Lidar:2019aa}. We show that under a number of additional assumptions, we can (partially) recover the results from the closed system setting, but that the bangs characterizing the latter are not a particularly robust feature in the open system setting. \subsection{Optimal control for the Liouville-von Neumann equation} \label{OCLVN} One approach for extending the closed system results of the previous section to open systems is to consider the \emph{full dynamics} of a jointly evolving system + environment. In this case $\rho$ in Eq.~\eqref{eq:general_ME} is the density matrix of the system and the environment, with an initial condition which is usually taken to be of the factorized form $\rho(0):=\rho_{0}\otimes\rho_{E}$, where now $\r_0$ refers to the initial state of the system only. The Liouville-von Neumann equation is [extending Eq.~\eqref{eq:vonNeum}]: \begin{equation} \dot{\rho}=\mathcal{K}_{H_{\mathrm{tot}}}\rho\ , \quad \rho(0)=\rho_{0}\otimes\rho_{E}\ , \label{eq:open} \end{equation} where $\mathcal{K}$ is defined in Eq.~\eqref{eq:K_X}, with the total Hamiltonian \begin{equation} H_{\mathrm{tot}}=H_S\otimes \leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E+H_{I}+\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_S\otimes H_{E}\ . \label{eq:H_tot} \end{equation} Here $H_{I}$ is the interaction between the system and environment, $H_{E}$ generates the dynamics of the environment, while the system Hamiltonian, as before, contains the controllable part: \begin{equation} H_S(t)=C+s(t)\left(B-C\right)\ . \label{eq:H_S} \end{equation} Finally the cost is given by \begin{equation} J=\Tr[\left(C\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_{E}\right)\rho]\ . \label{eq:cost_open} \end{equation} Theorem~\ref{adapt0} holds with $\mathcal{L}=\mathcal{K}_{H_{\mathrm{tot}}}$ and the PMP control Hamiltonian has the form \begin{equation} \mathbb{H}=\langle p,\mathcal{K}_{H_S\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E}\rho\rangle+\langle p,\mathcal{K}_{H_{I}}\rho\rangle+\langle p,\mathcal{K}_{\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_S\otimes H_{\mathrm{E}}}\rho\rangle\ . \label{eq:Ham_open} \end{equation} The treatment of Sec.~\ref{OCP} applies, \textit{mutatis mutandis}. In particular, condition~\eqref{3plusB} is replaced by \begin{equation} p(t_f)=-C\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E\ . \label{eq:pt_H_open} \end{equation} Remarkably, no additional modifications of the statement of the PMP Theorem~\ref{adapt0} are needed. Moreover, it is clear from Eqs.~\eqref{eq:H_S} and~\eqref{eq:pt_H_open} that once again the control enters $\mathbb{H}$ only via the term $s(t)\langle p,\mathcal{K}_{(B-C)\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E}\rho\rangle$, so that the proof of Part (i) of Theorem~\ref{Bradygen} applies without any change. This shows that: \begin{cor} In the general open system setting of Eq.~\eqref{eq:open} with the cost~\eqref{eq:cost_open}, the optimal control $s(t)$ is an alternation of bang arcs where $s\equiv0$ (when $\langle p,\mathcal{K}_{(B-C)\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}}\rho\rangle<0$) or $s\equiv1$ (when $\langle p,\mathcal{K}_{(B-C)\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}}\rho\rangle>0$), and singular arcs where $\langle p,\mathcal{K}_{C\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}}\rho\rangle\equiv\langle p,\mathcal{K}_{B\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}}\rho\rangle$. \label{control_general_open} \end{cor} Let us consider the generalization of Part (ii) of Theorem~\ref{Bradygen}, which addresses the characterization of the control function at the beginning and at the end. We first consider the final arc. We have the following: \begin{thm} \label{thm:open_end} Assume $s^*\in[0,1]$ is the optimal control in an interval $[0,t_f]$ minimizing the cost~\eqref{eq:cost_open} for Eq.~\eqref{eq:open}. Assume furthermore that $\left[H_{I},C\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_{E}\right]=0$ and that the final time constraint is active, i.e., $\lambda>0$. Then $s^*(t)=1$ for $t\in(t_f-\epsilon,t_f]$ for some $\epsilon>0$. \end{thm} Note that the assumption $\left[H_{I},C\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_{E}\right]=0$ implies that the choice of control $s\equiv0$ leaves the cost $J=\langle C\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I},\rho\rangle$ unchanged since in this case $H_\mathrm{tot}$ commutes with $C\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E$. \begin{proof} Let us compute the PMP Hamiltonian at $t=t_f$. Note first that it follows from Eq.~\eqref{eq:pt_H_open} that \begin{align} \langle p_f,\mathcal{K}_{C\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E}\rho_f\rangle &=\langle\mathcal{K}_{C\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E}^{\dag}p_f,\rho_f\rangle\notag\\ &=\langle\mathcal{K}_{C\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E}C\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E,\rho_f\rangle =0\ . \label{eq:opencalc1} \end{align} The other two terms of the PMP control Hamiltonian Eq.~\eqref{eq:Ham_open} also vanish at $t=t_f$: using the same calculation as in Eq.~\eqref{eq:opencalc1} the second term vanishes because of the assumption $\left[H_{I},C\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E\right]=0$, and the third term does as well because $[\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_S\otimes H_{E},C\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E]=0$. So we obtain $\mathbb{H}=s(t_f)\langle p_f,\mathcal{K}_{B\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E}\rho_f\rangle = \lambda >0$. This implies that $\langle p_f,\mathcal{K}_{B\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E}\rho_f\rangle >0$ and by continuity there must exist an interval $(t_f-\epsilon,t_f]$ for some $\epsilon>0$ such that $\langle p(t),\mathcal{K}_{(B-C)\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E}\rho(t)\rangle>0$ for $t\in(t_f-\epsilon,t_f]$. Finally we must have $s^\ast\equiv1$ in this interval by Corollary \ref{control_general_open}. \end{proof} Regarding the arc at the beginning we have instead: \begin{thm} \label{thm:open_beginning} Assume $s\in[0,1]$ is the optimal control in an interval $[0,t_f]$ minimizing the cost Eq.~\eqref{eq:cost_open} for Eq.~\eqref{eq:open}. Assume that $\left[\rho_{E},{H}_{E}\right]=0$ and that $\left[H_{I},\rho_{0}\otimes\rho_{E}\right]=0$. Assume furthermore that $\left[B,\rho_{0}\right]=0$ and that the final time constraint is active $\lambda>0$. Then the control satisfies $s^\ast(t)=0$ for $t\in[0,\epsilon)$ for some $\epsilon>0$. \end{thm} Note that the assumption $\left[H_{I},\rho_{0}\otimes\rho_{E}\right]=0$ implies that the interaction alone does not modify the initial state of the system. \begin{proof} We abbreviate the proof since it is very similar to the ones we presented above in more detail. Using the assumption $\left[H_{I},\rho_{0}\otimes\rho_{E}\right]=0$ and $\left[B,\rho_{0}\right]=0$, evaluating $\mathbb{H}(t=0)$ we obtain $\mathbb{H}(0)=\left(1-s(0)\right)\langle p(0),\mathcal{K}_{C\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E}\rho(0)\rangle=\lambda>0$. This implies that $\langle p(0),\mathcal{K}_{C\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E}\rho(0)\rangle>0$ or equivalently that $\langle p(0),\mathcal{K}_{-C\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E}\rho(0)\rangle<0$. By continuity this in turn implies that there exist an interval $[0,\epsilon)$ for some $\epsilon>0$ such that $\langle p(t),\mathcal{K}_{(B-C)\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_E}\rho(t)\rangle <0$ for $t\in [0,\epsilon)$. Finally we must have $s^\ast\equiv0$ in this interval by Corollary \ref{control_general_open}. \end{proof} We comment on the implications of the additional assumptions used in these theorems in Sec.~\ref{sec:conc}. \subsection{Optimal control for quantum master equation dynamics} \label{QME} The treatment of the open system case in the previous subsection did not involve any approximations. On the other hand, we tacitly assumed that the environment is \emph{finite dimensional}. This was helpful since all the results on optimal control which we have elaborated upon in Sec.~\ref{OCP} and used so far, are classically stated and proved for finite dimensional systems. Extending such results, in particular concerning the PMP and the topology and continuity of the reachable sets for infinite dimensional systems, is possible and is a current area of research in control theory (see, e.g., Refs.~\cite{fiacca_existence_1998,kipka_pontryagin_2015}), although the results in this area become considerably more technical. An alternative we discuss in this subsection is to replace the Liouville-von Neumann equation~\eqref{eq:open} with an approximate quantum master equation. This can be viewed as an investigation of the result of Sec.~\ref{OCLVN} when the environment dimension is sent to infinity. Without loss of generality we write $H_{I}=\sum_{\alpha}S_{\alpha}\otimes E_{\alpha}$, where $S_{\alpha}=S_{\alpha}^\dag$ and $E_{\alpha}=E_{\alpha}^\dag$ $\forall\alpha$. The goal is now to find a master equation for the dynamics of the system density matrix in the case of a time-dependent system Hamiltonian. After the Born approximation and tracing out the environment, one arrives at a time dependent Redfield master equation (see, e.g., the Schr\"odinger picture Redfield master equation (SPRME) derived in Ref.~\cite{campos_venuti_error_2018}). From this point there are multiple ways to proceed, e.g., by introducing an additional adiabatic approximation or an additional Markovian approximation, or both. These different paths, and exactly how they are taken, lead to a plethora of different master equations~\cite{childs_robustness_2001,PhysRevA.73.052311,albash_quantum_2012,campos_venuti_error_2018,Mozgunov:2019aa,Yamaguchi:2017vu,Dann:2018aa,nathan2020universal,Davidovic2020completelypositive,winczewski2021bypassing}. We next focus on two representative cases of master equations derived from first principles. \subsubsection{Adiabatic Redfield Master Equation} The Adiabatic Redfield Master Equation (ARME) is derived in Ref.~\cite{campos_venuti_error_2018}. It results from assuming that $t_f\gg\tau_B$, where $\tau_{B}$ is the environment time scale, and the adiabatic approximation $\mathcal{T}\exp\left[-i\int_{t-r}^t H_S(t')dt'\right] \approx e^{-i r H_S(t)}$, dropping a correction of $O\left((r/t_f)^2\right)$. The ARME has the form of Eq.~\eqref{eq:general_ME} with a time-dependent Redfield generator $\mathcal{L}$ given by \begin{subequations} \label{eq:Redfield} \begin{align} \mathcal{L} & =\mathcal{K}_{H_S}+\mathcal{D}\label{eq:Redfield-a}\\ \mathcal{D}\rho & =\sum_{\alpha\beta}\int_{0}^{t_{\max}}dr\ G_{\alpha\beta}(r)\,\left[S_{\beta}(-r)\rho,S_{\alpha}\right]+\mathrm{h.c.}, \label{eq:Redfield-b} \end{align} \end{subequations} where the system Hamiltonian is as in Eq.~\eqref{eq:H_S}. $G_{\alpha\beta}(t)$ is the environment correlation function \begin{equation} G_{\alpha\beta}(t)=\langle E_{\alpha}(t)E_{\beta}(0)\rangle = \Tr[E_{\alpha}(t)E_{\beta}(0)\rho_E]\ , \label{eq:environment_corr} \end{equation} where $\left\langle X\right\rangle $ denotes the environmental thermal average of $X$. When $G_{\alpha\beta}(r)$ decays exponentially, the relative error of the resulting dynamics due to the adiabatic approximation above is $O\left((\tau_{B}/t_f)^{2}\right)$. Finally, \begin{equation} S_{\beta}(-r)=e^{-irH_S(s)}S_{\beta}e^{irH_{S}(s)}\ . \label{eq:A_r} \end{equation} The parameter $t_{\max}$ can either be set to $t_f$ or infinity on account of the fact that the environment correlation function decays very rapidly. The ARME is not in Gorini-Kossakowski-Sudarshan-Lindblad (GKSL) form~\cite{Gorini:1976uq,Lindblad:76,Chruscinski:2017ab}, hence does not generate a completely positive map. However, it generates non-Markovian dynamics, hence has a wider range of applicability than Markovian master equations, within its range of applicability~\cite{Mozgunov:2019aa}. Crucially, the generator in Eq.~\eqref{eq:Redfield} with Eqs.~\eqref{eq:H_S}, \eqref{eq:environment_corr} and~\eqref{eq:A_r} \emph{depends on time only through the control function $s(t)$}. This implies that the PMP control Hamiltonian $\mathbb{H}=\langle p,\mathcal{L}\rho\rangle$ is constant and hence the PMP in the form of Theorem~\ref{adapt0} is directly applicable.\footnote{It can be shown that the conditions of Filippov's theorem (see Ref.~\cite[Th.~2.1]{fleming_deterministic_1975}) for the existence of the optimal control solution are satisfied also in this case.} However, the control now enters nonlinearly in $\mathcal{D}$, in particular in an exponential through Eq.~\eqref{eq:A_r}. As a consequence it is not possible to derive the form of the control on the nonsingular arcs, or even to determine simple equations for the appearance of singular arcs. One can ask, however, what remains of the results of the previous subsection. We do not have an analog of Theorem~\ref{thm:open_beginning} for the initial arc. However, if we again make the assumption of Theorem~\ref{thm:open_end} that $\left[S_{\alpha},C\right]=0$ $\forall\alpha$, then the analog of this theorem for the final arc holds, even when the environment is infinite-dimensional, and under the approximations used to derive Eq.~\eqref{eq:Redfield}. However, instead of an arc, we obtain a bang only at a point: \begin{thm} \label{thm:Redfield} Assume $s^*\in[0,1]$ is the optimal control in an interval $[0,t_f]$ minimizing the cost Eq.~\eqref{nuovocosto} for Eq.~\eqref{eq:general_ME} with $\mathcal{L}$ given by Eq.~\eqref{eq:Redfield}. Assume further that $\left[S_{\alpha},C\right]=0$ $\forall\alpha$ and that the final time constraint is active ($\lambda>0$). Then the optimal control satisfies $s^*(t_f)=1$. \end{thm} \begin{proof} It is convenient to write the Redfield dissipator as \begin{subequations} \begin{align} \mathcal{D}\rho & =\sum_{\alpha\beta}\left(\big[W_{\alpha\beta}\rho,S_{\alpha}\big]+\big[S_{\alpha},\rho W_{\alpha\beta}^{\dagger}\big]\right)\label{eq:Redfield_dissi}\\ W_{\alpha\beta}(t) & =\int_{0}^{t_{\max}}dr\ G_{\alpha\beta}(r)\,S_{\beta}(-r)\ . \end{align} \end{subequations} Using Eq.~\eqref{eq:Redfield_dissi} one obtains, for the adjoint of $\mathcal{D}$: \begin{equation} \mathcal{D}^{\dag}X=\sum_{\alpha\beta}\left(W_{\alpha\beta}^{\dagger}\left[X,S_{\alpha}\right]+\left[S_{\alpha},X\right]W_{\alpha\beta}\right) \label{eq:Ddag-Red} \end{equation} (see Appendix~\ref{app:calcs}). From the above expression and the assumption $\left[S_{\alpha},C\right]=0,\,\forall\alpha$ we obtain $\mathcal{D}^{\dag}C=0$. Using $p_f=-C$ we have $\langle p_f,\mathcal{D} \rho_f\rangle=-\langle\mathcal{D}^{\dag}C,\rho_f\rangle=0$. Evaluating the PMP control Hamiltonian at the final time we obtain $\mathbb{H}(t_f)=s(t_f)\langle p_f,\mathcal{K}_{B}\rho_f\rangle = \lambda>0$. This implies that $\langle p_f,\mathcal{K}_{B}\rho_f\rangle>0$, and so $s(t_f)=1$ from the maximum principle. \end{proof} Since, as argued in Sec.~\ref{shortening}, the size of the bang intervals is generically expected to shrink when the total system size increases, this result can be seen as a generalization of Theorem \ref{thm:open_end} when the environment dimension is sent to infinity and the bang interval at the end shrinks to a point. The implications of the additional assumptions used in Theorem~\ref{thm:Redfield} are discussed in Sec.~\ref{sec:conc}. \subsubsection{Markovian, completely positive master equations} The most significant drawback of the ARME is the violation of complete positivity, which means that the density matrix can develop unphysical, negative eigenvalues. Hence we also consider Markovian, completely positive master equations. There are a variety of such master equations derived from first principles under different assumptions. However, in most cases the generator $\mathcal{L}$ is explicitly time-dependent (e.g., the coarse-grained master equation (CGME)~\cite[Eq.~(22)]{Mozgunov:2019aa}, the master equation of Ref.~\cite[Eq.~(21)]{Yamaguchi:2017vu}, the non-adiabatic master equation (NAME)~\cite[Eq.~(16)]{Dann:2018aa}, and the universal Lindblad equation (ULE)~\cite[Eq.~(27)]{nathan2020universal}) and hence we cannot apply Theorem~\ref{adapt0}. In this subsection we give an example of a Markovian master equation derived from first principles where, like in the ARME case, the generator $\mathcal{L}$ depends on time only through the schedule $s(t)$. In this case the PMP can be applied in the simplified form described in Theorem~\ref{adapt0}. Consider the ``geometric-arithmetic master equation'' (GAME)~\cite[Eq.~(46)]{Davidovic2020completelypositive}, which is claimed there to have a higher degree of accuracy than all the previous Markovian master equations. In the adiabatic limit it has the Schr\"odinger picture form \begin{subequations} \begin{align} \mathcal{L} &= \mathcal{K}_{H_S} + \mathcal{D}\\ \mathcal{D}\r &= \sum_j \left( [L_\alpha(s)\r,L_\alpha^\dag(s)] + [L_\alpha(s),\r L_\alpha^\dag(s)] \right)\ , \label{eq:Drho-GAME} \end{align} \end{subequations} where $L_\alpha(s) = S_\alpha \circ \sqrt{\gamma(s)}$, the circle denotes the Hadamard (element-wise) product, $\gamma$ is the spectral density matrix [Fourier transform of the environment correlation function~\eqref{eq:environment_corr}] whose elements $\gamma_{nm}:=\gamma(\omega_{nm}(s))$ depend on the instantaneous Bohr frequencies $\omega_{nm}(s)=E_n(s)-E_m(s)$, where $H_S(s)|n(s)\>=E_n(s)|n(s)\>$, and the dependence on time is only through the schedule $s(t)$.\footnote{In writing these expressions we have adapted the results of Ref.~\cite{Davidovic2020completelypositive} to the adiabatic limit by using the instantaneous eigenbasis of $H_S$, and also performed the ``$\int^t \to \int^\infty$ approximation'' (otherwise $\gamma$ would have a $t$ dependence, which would prevent us from being able to apply Theorem~\ref{adapt0}); see Ref.~\cite{Davidovic2020completelypositive} for complete details.} The adjoint dissipator is now: \begin{align} \mathcal{D}^{\dag}X&=\sum_{\alpha}\big((S_\alpha \circ \sqrt{\gamma})^\dag\left[X,S_\alpha \circ \sqrt{\gamma}\right]\notag\\ &\qquad +[(S_\alpha \circ \sqrt{\gamma})^\dag,X]S_\alpha \circ \sqrt{\gamma}\big)\ . \label{eq:Ddag-GAME} \end{align} Unfortunately, since $[S_\alpha,C]=0 \not\Rightarrow [S_\alpha \circ \sqrt{\gamma},C]=0$, this means that even if $[S_\alpha,C]=0$, we do \emph{not} obtain $\mathcal{D}^\dag C=0$ as in the ARME case, and hence the proof of Theorem~\ref{thm:Redfield} does not carry through.\footnote{Of course $[S_\alpha,C]=0\ \Rightarrow [S_\alpha \circ \sqrt{\gamma},C]=0$ when $\gamma_{nm}=c$ $\forall n,m$, but this is a highly nongeneric scenario.} While these arguments are not a proof that in general Markovian dynamics do not admit $s(t_f)=1$ as an optimal control solution, we conjecture that in fact, they do not. It thus appears that the ``counterintuitive'' appearance of the driver Hamiltonian at the end of the control interval is not a feature of the optimal schedule in the Markovian limit of open quantum systems. We revisit this point in Sec.~\ref{sec:conc}. \section{Switching operator and analysis of the optimal control} \label{Switchings} In order to study the qualitative behavior of the optimal control law, in particular its switching properties and the existence and nature of the singular arcs, it is convenient to introduce one more operator, besides the state $\rho$ and the co-state $p$, which we call the \emph{switching operator}. The switching operator determines the behavior of the optimal control, i.e., the points where there is a switch between $s=0$ and $s=1$, and where there is a singular arc. For clarity we focus on the closed system case of Sec.~\ref{OCP} but our definitions and treatment naturally extend with a change of notation to the open system case of Sec.~\ref{OCLVN}. \subsection{Switching equation} \label{sec:switch-eq} The switching operator $S$ is the Hermitian operator defined as \begin{equation} S:=i\left[p,\rho\right]\ . \label{sw} \end{equation} In the closed system case the Liouvillian has the form $\mathcal{L}=\mathcal{K}_{H}$, with the system Hamiltonian of Eq.~\eqref{eq:Ham_sys2}. One has the following property: \begin{equation} \mathcal{K}_{H}\left(\left[X,Y\right]\right)=\left[\mathcal{K}_{H}(X),Y\right]+\left[X,\mathcal{K}_{H}(Y)\right]\label{eq:autom_property} \end{equation} valid for any operators $X,Y,H$. Now, differentiating Eq.~\eqref{sw}, we obtain \begin{subequations} \label{eq:S_ODE} \begin{align} \dot{S} & =i\left[\dot{p},\rho\right]+i\left[p,\dot{\rho}\right]\\ & =i\left[\mathcal{K}_{H}p,\rho\right]+i\left[p,\mathcal{K}_{H}\rho\right]\\ & =i\mathcal{K}_{H}\left(\left[p,\rho\right]\right)=\mathcal{K}_{H}S\ , \end{align} \end{subequations} where in the third equality we used Eq.~\eqref{eq:autom_property}. Thus, $S$ satisfies the same equation as $\rho$ and $p$. To understand why $S$ determines the optimal control switching times, let us define \begin{subequations} \label{eq:x_C} \begin{align} x_{C} & :=\langle p,\mathcal{K}_{C}\rho\rangle =-i\Tr\left(p\left[C,\rho\right]\right) \\ & =-i\Tr\left(C\left[\rho,p\right]\right) =\Tr\left(CS\right)=\langle C,S\rangle\ , \label{eq:x_C-b} \end{align} \end{subequations} and similarly \begin{equation} x_{B}:=\langle p,\mathcal{K}_{B}\rho\rangle=\langle B,S\rangle\ , \label{eq:x_B} \end{equation} so that the PMP control Hamiltonian Eq.~\eqref{HamilP-1} can be written in a form closely resembling the Hamiltonian~\eqref{eq:Ham_sys2-b}: \begin{equation} \mathbb{H}=x_{C}+s\left(x_{B}-x_{C}\right)\ . \label{eq:new_controlH} \end{equation} The quantity $x_{B}-x_{C}=\langle B-C,S\rangle$, that is, the orthogonal component of $S$ along $B-C$, regulates the switches of the candidate optimal control. By the same PMP argument we have used repeatedly in our proofs, when $x_{B}-x_{C}<0$ we have $s\equiv0$, and when $x_{B}-x_{C}>0$ we have $s\equiv1$. The switch occurs when $x_{B}-x_{C}=0$, while a singular arc occurs when $x_{B}-x_{C}\equiv0$ for an interval of positive measure. The initial condition $S_{0}$ of the switching operator determines the optimal control candidate $s$ uniquely. This initial condition is not completely arbitrary. In particular, under the assumptions of Theorem~\ref{Bradygen} the following holds. Since $s(0)=0$, we have $x_{C}(0)=\langle C,S_{0}\rangle=\lambda$. Furthermore, since $[B,\rho_{0}]=0$, we have \begin{align} x_{B}(0)&=\langle B,S_{0}\rangle=i\Tr(B[p_0,\rho_{0}])\notag\\ &=i\Tr\left(p_0[\rho_{0},B]\right)=0\ . \label{eq:xB0} \end{align} At the final time $t_f$, since $s(t_f)=1$, we have from Eq.~\eqref{eq:new_controlH} $x_{B}(t_f)=\lambda$, while using Eq.~\eqref{3plusB} we have \begin{align} x_{C}(t_f)&= \<C,S_f\> = i\Tr\left(C[p_f,\r_f]\right) \notag \\ &= i\Tr\left(\r_f[C,p_f]\right)=0\ . \label{eq:xCf} \end{align} Thus, at $t=0$ we have $x_B(0)=0$ and in the initial arc $s\equiv0$ and $x_C\equiv \lambda$ by Eq.~\eqref{eq:new_controlH}. The next arc can be either nonsingular with $s\equiv1$ ($x_B>x_C$) or a singular arc with $x_B \equiv x_C$. Either way, at the switching point we must have $x_B=\lambda$, hence we reach the point $(x_{C},x_{B})=(\lambda,\lambda)$ at the end of the first arc. When $(x_{C},x_{B})=(\lambda,\lambda)$ there is either a switch to an arc with $s\equiv1$, or a return to $s\equiv0$, or a singular arc where $(x_{C},x_{B})\equiv(\lambda,\lambda)$. On this arc $s$ is unspecified, but nonetheless certain equations need to be satisfied and they can be used to obtain information on the dynamics on such singular arcs (see Appendix \ref{app:SA}). Note that every switching event, whether from a bang arc to a singular arc or \textit{v.v.}., or from a bang arc to another bang arc, happens at $(x_{C},x_{B})=(\lambda,\lambda)$. When $s\equiv1$, from Eq.~\eqref{eq:new_controlH} we have that $x_{B}$ is constant, while $x_{C}$ is allowed to change. Therefore the optimal control can be described schematically as in Fig.~\ref{switchfig} in the $(x_{C},x_{B})$ plane. \begin{figure}[h] \hspace{-1cm} \includegraphics[width=\columnwidth]{SWD-1.pdf} \caption{Switching diagram for optimal control candidates. Starting from the point $(\lambda,0)$ the dynamics stay on the line $x_C=\lambda$. In principle even negative values of $x_B$ can be attained, but eventually the point $(\lambda,\lambda)$ must be reached, followed by an alternation of vertical and horizontal lines (where in principle one can also extend to negative values of $x_C$) through $(\lambda,\lambda)$ with time intervals where the dynamics do not move from $(\lambda,\lambda)$, representing the singular arcs. In the last interval, the dynamics follow a horizontal line (with $s\equiv1$) reaching the point $(x_{C},x_{B})=(0,\lambda)$.} \label{switchfig} \end{figure} In the case where the final time is not active, i.e., when we do not have the guarantee $\lambda>0$ in Eq.~\eqref{eq:new_controlH}, the above reasoning can still be applied to conclude $x_{B}(0)=0$ and $x_{C}(t_f)=0$. Furthermore, if $\lambda=0$, from Eq.~\eqref{eq:new_controlH}, we obtain $(1-s(0))x_{C}(0)=0$ and $s(t_f)x_{B}(t_f)=0$, in addition to the maximization condition Eq.~\eqref{MaxCon}. \subsection{Shortening of nonsingular arcs} \label{shortening} \subsubsection{Dependence on $n$} Here we give a heuristic argument that explains why the terminal arcs ($s\equiv0$ and $s\equiv1$) for the optimal control become shorter as the number $n$ of spins (or qubits) increases. In fact the heuristic holds also for intermediate arcs taking place anywhere along the optimal trajectory. Consider a bang arc where $s(t)= 0$ for $t\in\left[t_{0},t_{1}\right]$. Equation~\eqref{eq:S_ODE} for the switching operator in this region is $\dot{S}=\mathcal{K}_{C}S$ with the initial condition $S(t_{0})=S_{0}$ for some $S_{0}$. The solution in this interval is $S(t)=e^{-i(t-t_{0})C}S_{0}e^{i(t-t_{0})C}.$ The coordinate $x_{C}$ equals $\lambda$ in the interval: $x_{C}=\lambda=\langle C,S(t)\rangle=\langle C,S_{0}\rangle$. The switching happens when $x_{B}=\lambda$, i.e., at the first solution $t_{1}$ of $\langle B,S(t_{1})\rangle=\langle C,S_{0}\rangle$. More explicitly, the interval of the bang arc $\Delta t:=t_{1}-t_{0}$ is given by the first solution of \begin{equation} x_{B}(\Delta t):=\Tr\left(Be^{-i\Delta tC}S_{0}e^{i\Delta tC}\right)=\Tr\left(CS_{0}\right)\ .\label{eq:switching_time} \end{equation} Using the spectral resolution $C=\sum_{k}E_{k}\Pi_{k}$ (with eigenvalues $E_k$ and eigenprojectors $\Pi_k$), the left-hand hand side of Eq.~\eqref{eq:switching_time} can be written as \begin{equation} x_{B}(\Delta t)=\sum_{kl}M_{kl}e^{-i\Delta t\omega_{kl}}\ , \label{eq:trigon_pol} \end{equation} with amplitudes $M_{kl}:=\Tr\left(B\Pi_{k}S_{0}\Pi_{l}\right)$ and Bohr frequencies $\omega_{kl}=E_{k}-E_{l}$. The function $x_{B}( \Delta t)$ is a real trigonometric polynomial with $O(d^{2})$ terms (where $d$ is the Hilbert space dimension) starting from $\Tr(B S_0)$ at $\Delta t=0$, and reaching $\lambda>0$ at $\Delta t$. Now, as the number of qubits $n$ increases, both $d=2^{n}$ and the frequencies increase. Both of these facts contribute to making $x_{B}(t)$ oscillate faster. As a consequence, the solution $\Delta t$ of Eq.~\eqref{eq:switching_time} tends to decrease with $n$. The same considerations hold for the case of an $s\equiv1$ arc with $B$ and $C$ interchanged. See Appendix~\ref{app:shortening} for additional comments. Note that this heuristic applies both to the initial and final bang arcs, as well as to possible intermediate bang arcs if they are present. \subsubsection{Dependence on $t_f$} It was concluded in Ref.~\cite[Sec.~S3]{brady_optimal_2021} that ``these bangs should become smaller and smaller as $t_f$ is increased. Eventually in the true $t_f\to \infty$ adiabatic limit, these bangs disappear recovering the standard form expected for quantum adiabatic computing.'' However, there is in fact no guarantee that the optimal control coincides with the adiabatic path even in this limit, since the adiabatic theorem provides a sufficient, but not a necessary condition for convergence to the minimum of the cost function. Indeed, it is easy to construct a counterexample, as we now do. First note that, as we have seen, when $t_f<t_c$, the optimal schedule always starts with a bang $s\equiv 0$ and ends with a bang $s\equiv 1$ (provided the initial state commutes with $B$). We have not addressed the question of uniqueness of this optimal schedule, which we leave for future work. However, when $t_f>t_c$, the optimal schedule is certainly not unique, as one has the possibility of ``wasting time'' by adding a bang $s\equiv 0$ at the end (thus applying $C$ there), or by adding a bang $s\equiv 1$ at the beginning (thus applying $B$ there), or both. The resulting schedules do not resemble the smooth adiabatic schedule interpolating slowly from $s(0)=1$ to $s(t_f)=0$. \section{Summary and Discussion} \label{sec:conc} The quest to discover the optimal schedule for quantum optimization algorithms such as QA and QAOA naturally leads to the use of optimal control theory via Pontryagin's principle. Previous work concluded that QAOA is optimal~\cite{Yang:2017aa}, but a more careful analysis showed that in fact a hybrid bang-anneal-bang protocol is generally optimal for closed systems when not enough time is allowed for the desired state to be reached perfectly~\cite{brady_optimal_2021}. Here we confirmed this result using a density matrix approach, which both generalizes the analysis to mixed states and simplifies it since it makes the cost-function linear in the state. We also showed that the assumption that $t_f$ is smaller than the critical time $t_c$ needed to reach the ground state of $C$ exactly, is necessary but not sufficient for the result of Ref.~\cite{brady_optimal_2021}, by giving a counterexample to the latter. We introduced a switching operator and found its equation of motion, which characterizes the points at which the optimal schedule switches between the two different types of bang arcs and the anneal arc. In Theorem~\ref{conclusione} we gave the explicit optimal schedule for the example of a single spin-$1/2$ particle, which consists of two bangs of equal duration. Using the density matrix formulation we extended the theory to the open system setting, both for the exact reduced system dynamics in the case of a finite-dimensional environment, and under the approximation of dynamics governed by a master equation due to coupling to an infinite-dimensional environment. We proved that in the first setting, depending on additional assumptions concerning the initial states of the system and the environment and their interaction, either an anneal-bang (Theorem~\ref{thm:open_end}) or bang-anneal (Theorem~\ref{thm:open_beginning}) schedule is optimal. In the second setting (infinite-dimensional environment) we considered both an adiabatic Redfield equation accounting for non-Markovian dynamics but without a complete positivity guarantee, and a completely positive Markovian master equation. In the former (Redfield) case we could only prove that the optimal schedule terminates with the driver Hamiltonian, i.e., $s(t_f)=1$ (Theorem~\ref{thm:Redfield}). One could interpret this result as a manifestation of the phenomenon of the shortening of the nonsingular arcs as the \emph{total} system (i.e., the subsystem plus its environment) size increases. Indeed, in the Redfield case the environment Hilbert space dimension is infinite, which is consistent with the bang arc having shrunk down to a point. In the fully Markovian case, even this last remnant of the bang-arc was not recovered, as we found no evidence of natural conditions under which $s(t_f)=1$ holds. Let us now comment on the differences between these theorems and their closed system counterpart, Part (ii) of Theorem~\ref{Bradygen}. Regarding Theorem~\ref{thm:open_end} concerning the final arc, the main change is the addition of the assumption that the interaction Hamiltonian commutes with the cost function, i.e., $\left[H_{I},C\otimes\leavevmode{\rm 1\ifmmode\mkern -4.8mu\else\kern -.3em\fi I}_{E}\right]=0$. Writing the interaction in the general form $H_I = \sum_\alpha S_\alpha\otimes E_\alpha$, where $S_\alpha$ and $E_\alpha$ are system and environment operators, respectively, the assumption is equivalent to $[S_\alpha,C]=0$ $\forall \alpha$, which is the same assumption as in Theorem~\ref{thm:Redfield}. Thus $C$ must belong to the commutant of the algebra generated by the set $\{S_\alpha\}$, i.e., $C\in\text{Alg}\{S_\alpha\}'$.\footnote{The commutant of an algebra $\mathcal{A}=\text{Alg}\{A\}$ is defined as the set $\mathcal{A}':=\{X | [X,A]=0 \ \forall A\in \mathcal{A}\}$.} For example, if $S_\alpha = \sum_{i=1}^n \sigma_{i}^{\alpha}$ for a system of $n$ qubits, where $\alpha\in\{x,y,z\}$, i.e., the collective decoherence case~\cite{Zanardi:98a,Lidar:1998fk}, then, if $C$ is at most a two-body interaction, it follows that it must be of the Heisenberg interaction form: $C = \sum_{ij} J_{ij} \boldsymbol{\sigma}_i\cdot\boldsymbol{\sigma}_j$, where $J_{ij}$ are constants~\cite{Bacon:2000qf}. Or, for a classical target Hamiltonian arising in optimization such as the Ising-type Hamiltonian mentioned in Sec.~\ref{sec:background}, this means that the interaction must be of the pure-dephasing type, i.e., $S_\alpha \propto \sigma^z$ (or products of $\sigma^z$ over different qubits). This is a realistic model, e.g., for superconducting qubits undergoing flux noise~\cite{Kjaergaard_2020}. Regarding Theorem~\ref{thm:open_beginning} concerning the initial arc, the main change is the addition of the two assumptions that (i) the environment Hamiltonian commutes with the environment's initial state ($\left[{H}_{E},\rho_{E}\right]=0$), and (ii) the interaction Hamiltonian commutes with the joint system-environment initial state ($\left[H_{I},\rho_{0}\otimes\rho_{E}\right]=0$). The first of these is natural and is known as the stationary environment assumption~\cite{Breuer:book}. It is satisfied, e.g., if the environment is in thermal equilibrium, i.e., in the Gibbs state: $\rho_E \propto e^{-\beta H_E}$, where $\beta$ is the inverse temperature. The second assumption means that $\rho_{0}\in\text{Alg}\{S_\alpha\}'$ and $\rho_E\in\text{Alg}\{E_\alpha\}'$. This assumption is the least natural of the ones we have encountered so far. E.g., it is clearly violated in the standard quantum annealing setting where $\rho_0$ is the ground state of a transverse field $-\sum_i\sigma_i^x$ and $S_\alpha \propto \sigma^z$. Even the condition $\rho_E\in\text{Alg}\{E_\alpha\}'$ is not very natural. For example, for a bosonic environment one typically has $E_\alpha$ as the position operator of an oscillator, while $H_E$ might be the number operator, in which case the Gibbs state $\rho_E$ would not commute with $E_\alpha$. We note that while the conditions given in Theorem~\ref{thm:open_beginning} are sufficient, we do not know if they are necessary, which we thus leave as an open problem. We conjecture that the initial bang does not appear as a feature of optimal schedules for open systems coupled to an infinite-dimensional environment. This state of affairs would be reminiscent of the existence of an arrow of time for open systems, which breaks the symmetry between the initial and final times (see, e.g., Ref.~\cite{campos_venuti_error_2018} for a similar effect in the pure QA setting). On the other hand, given the naturalness of the sufficient conditions under which a final bang arc (Theorem~\ref{thm:open_end}) or a schedule terminating with the driver Hamiltonian (Theorem~\ref{thm:Redfield}) are optimal, such schedules may find utility in the design of quantum algorithms for optimization problems in the setting of open quantum systems. This is true in particular for systems that are well described by the adiabatic Redfield master equation, e.g., superconducting flux qubits used for quantum annealing~\cite{Harris:2010kx,Yan:2016aa,smirnovTheory18,khezri2020annealpath}. However, the conditions under which the adiabatic Redfield master equations hold need not apply in general, e.g., for Hamiltonians that arise naturally in systems such as Rydberg atoms or transmons, which have been used to demonstrate QAOA~\cite{zhou2018quantum,Harrigan:2021we}. Especially for quantum optical systems such as Rydberg atoms, the Markovian limit may be more appropriate, and we have not found evidence of the optimality of an initial or final bang arc in this limit, or even the optimality of $s(t_f)=1$. While our analysis does not strictly rule out bang-type schedules for open systems coupled to infinite-dimensional environments, we conjecture that they are indeed not a feature of optimal schedules in this case, primarily due to the shortening of arcs in the open system setting. If this could be confirmed, it would mean that after all, continuous annealing-type schedules are optimal for optimization purposes when using open quantum systems, which would have implications for all NISQ-era optimization algorithms. Finally, we remark that throughout this work we have used a simplified form of the PMP as described in Theorem~\ref{adapt0}. A more general PMP for time-dependent dynamics is described in Ref.~\cite{fleming_deterministic_1975}. The main difference is that $\mathbb{H}\equiv \lambda$ [Eq.~\eqref{forlanda}] is no longer valid in the given form. This equation is, in fact, a special case of another one which contains the derivative of the dynamics with respect to $t$, and this term vanishes when the dynamics are not explicitly time-dependent, as in our case, where we considered adiabatic time-dependent master equations. The time-dependence of the dynamics in typical quantum master equations~\cite{childs_robustness_2001,PhysRevA.73.052311,albash_quantum_2012,campos_venuti_error_2018,Mozgunov:2019aa,Yamaguchi:2017vu,Dann:2018aa,nathan2020universal,Davidovic2020completelypositive,winczewski2021bypassing} is, however, different from the one of models usually encountered in classical control theory, and therefore further study is required before the PMP can be applied to a broader class of quantum master equations. \begin{acknowledgments} LCV's and DL's research is based upon work (partially) supported by the Office of the Director of National Intelligence (ODNI), Intelligence Advanced Research Projects Activity (IARPA) and the Defense Advanced Research Projects Agency (DARPA), via the U.S. Army Research Office contract W911NF-17-C-0050. DD's research was supported by the NSF under Grant ECCS 1710558. DL's research was also sponsored by the Army Research Office and was accomplished under Grant Number W911NF-20-1-0075. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of the ODNI, IARPA, DARPA, or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright annotation thereon. \end{acknowledgments}
\section{Introduction}\label{sec.intro} Let $(\Om,\mathscr{F})$ be a measurable space and $H$ be a complex Hilbert space. We write $B(H)$ for the space of bounded linear operators $H \to H$. A function $P \colon \mathscr{F} \to B(H)$ is called a \textbf{projection-valued measure} if $P(\Om)=1 = \id_H$, $P(G)^2= P(G) = P(G)^*$ whenever $G \in \mathscr{F}$, and $P$ is countably additive in the weak operator topology. When $P \colon \mathscr{F} \to B(H)$ is a projection-valued measure, the quadruple $(\Om,\mathscr{F},H,P)$ is called a \textbf{projection-valued measure space}. Fix such a space $(\Om,\mathscr{F},H,P)$. If $h,k \in H$, then the assignment $\mathscr{F} \ni G \mapsto P_{h,k}(G) \coloneqq \langle P(G)h,k \rangle \in \mathbb{C}$ is a complex measure with total variation norm at most $\|h\|\,\|k\|$. Now, if $\varphi \colon \Om \to \mathbb{C}$ is bounded and measurable, then there exists unique $P(\varphi) = \int_{\Om} \varphi\,dP = \int_{\Om} \varphi(\omega)\,P(d\omega) \in B(H)$ such that $\langle P(\varphi)h,k \rangle = \int_{\Om} \varphi \,dP_{h,k}$, for all $h,k \in H$. Unsurprisingly, $P(\varphi)$ is called the \textbf{integral} of $\varphi$ with respect to $P$. It has the property that the assignment $\varphi \mapsto P(\varphi)$ is an algebra homomorphism that converts complex conjugation into the adjoint operation, i.e., it is a $\ast$-homomorphism from the space of bounded measurable functions $\Om \to \mathbb{C}$ to $B(H)$. (Please see Chapter 5 of \cite{birmansolomyakBook} or Sections IX.1 and X.4 of \cite{conwayfunc} for projection-valued measure and integration theory.) We have just described the standard way to integrate \textit{scalar-valued} functions with respect to $P$. However, there are instances where it seems necessary to define some notion of $\int_{\Om} \Phi \,dP$ for \textit{operator-valued} functions $\Phi \colon \Om \to B(H)$. For example, when one studies Lipschitz/differentiability properties of scalar functions of operators \cite{daletskiikrein,depagtersukochev,pellerMOIOpDer,azamovetal,pellerMOIPert,aleksandrovOL,lemerdyskripka,nikitopoulosDiff} or spectral shift \cite{aleksandrovSmTrForm,dykemaskripka,potapovetal,skripkaTaylor}, one must consider integrals of the form \[ \big(I^{P_1,\ldots,P_{k+1}}\varphi\big)[b_1,\ldots,b_k] = \int_{\Om_{k+1}}\cdots\int_{\Om_1} \varphi(\omega_1,\ldots,\omega_{k+1}) \, P_1(d\omega_1) \, b_1 \cdots P_k(d\omega_k) \, b_k \,P_{k+1}(d\omega_{k+1}), \numberthis\label{eq.formalMOI} \] where $(\Om_j,\mathscr{F}_j,H,P_j)$ is a projection-valued measure space, $\varphi \colon \Om_1 \times \cdots \times \Om_{k+1} \to \mathbb{C}$ is a scalar function, and $b_1, \ldots, b_k \in B(H)$ are bounded operators. The innermost integral $\int_{\Om_1}\varphi(\cdot,\omega_2,\ldots,\omega_{k+1})\,dP_1$ makes sense using the standard theory described in the previous paragraph, but it is already unclear how to integrate the map $\omega_2 \mapsto \int_{\Om_1}\varphi(\cdot,\omega_2,\ldots,\omega_{k+1})\,dP_1 \,b_1$ with respect to $P_2$. Yu.L. Daletskii and S.G. Krein made the first attempt at doing so in their seminal paper \cite{daletskiikrein}, wherein they used a Riemann-Stieltjes-type construction to define $\int_s^t \Phi(r)\,P(dr)$ for certain Borel projection-valued measures on intervals $[s,t] \subseteq \mathbb{R}$ and maps $\Phi \colon [s,t] \to B(H)$. This approach, which requires rather stringent regularity assumptions on $\Phi$, allows one to make sense of \eqref{eq.formalMOI} as an iterated integral for certain (highly regular) $\varphi$. In general, an object that gives a rigorous meaning to \eqref{eq.formalMOI} is called a \textit{multiple operator integral} (MOI). Under the assumption that $H$ is separable, these have been studied and applied to various branches of noncommutative analysis extensively. Please see A. Skripka and A. Tomskova's book \cite{skripka} for a comprehensive and well-organized survey of the MOI literature and its applications. In this paper, we shall concern ourselves with the ``separation of variables" approach to defining MOIs that is useful for differentiating operator functions (e.g., \cite{pellerMOIOpDer,azamovetal,nikitopoulosDiff}). Loosely speaking, this means that one assumes $\varphi$ admits a decomposition \[ \varphi(\omega_1,\ldots,\omega_{k+1}) = \int_{\Sigma} \varphi_1(\omega_1,\sigma)\cdots \varphi_{k+1}(\omega_{k+1},\sigma)\,\rho(d\sigma), \numberthis\label{eq.formalIPD} \] where $(\Sigma,\mathscr{H},\rho)$ is a measure space and $\varphi_j \colon \Om_j \times \Sigma \to \mathbb{C}$ is a (product) measurable function, and then one defines \eqref{eq.formalMOI} to be the ``weak" operator-valued intergal \[ \int_{\Sigma} \Bigg(\int_{\Om_1} \varphi_1(\cdot,\sigma)\,dP_1\,b_1\cdots \int_{\Om_k} \varphi_k(\cdot,\sigma)\,dP_k\,b_k \int_{\Om_{k+1}} \varphi_{k+1}(\cdot,\sigma)\,dP_{k+1}\Bigg)\,\rho(d\sigma). \numberthis\label{eq.formalopint} \] When taking this approach, there are at least three questions to be addressed. \begin{enumerate}[label=Q.\arabic*, leftmargin=2\parindent] \item Exactly which decompositions \eqref{eq.formalIPD} does one allow?\label{q.IPD} \item Exactly what kind of operator-valued integral is \eqref{eq.formalopint}?\label{q.opint} \item Assuming satisfactory answers to \ref{q.IPD} and \ref{q.opint}, does \eqref{eq.formalopint} depend on the chosen decomposition \eqref{eq.formalIPD}?\label{q.welldef} \end{enumerate} There are various answers to these questions available in the literature, but existing answers are inadequate to cover the case when $H$ is not separable, and some of them have issues even when $H$ is separable. (Please see, for instance, the comments in Section 4.6 of \cite{doddssub2} and Section 3.4 of \cite{nikitopoulosDiff}.) In this paper, we provide detailed, very general answers to all three of the questions above without assuming that $H$ is separable. \begin{enumerate}[label=A.\arabic*, leftmargin=2\parindent] \item We consider \textit{integral projective decompositions} (Definition \ref{def.IPTPspecial}) of $\varphi$. In other words, we take $\varphi$ in the so-called \textit{integral projective tensor product} $L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$, the idea for which is due to V.V. Peller \cite{pellerMOIOpDer}. There are substantial ``measurability issues," discussed in Remark \ref{rem.measissue}, with existing definitions of this object. We resolve these in Section \ref{sec.IPTP}.\label{a.IPD} \item Let $K$ be another complex Hilbert space, $B(H;K)$ be the space of bounded linear maps $H \to K$, and $V \subseteq B(H;K)$ be a linear subspace. In Theorem \ref{thm.wintBHK}, we characterize weak integrability (Definition \ref{def.GPint}) of maps $\Sigma \to V$ in the weak, strong, strong$^*$, $\sigma$-weak, $\sigma$-strong, and $\sigma$-strong$^*$ operator topologies (Section \ref{sec.optop}) on $V$. As an application of this (independently interesting) characterization, we prove in Section \ref{sec.welldef} that if $V=\mathcal{M} \subseteq B(H)$ is a von Neumann algebra and $P_j(G) \in \mathcal{M}$, for all $j \in \{1,\ldots,k+1\}$ and $G \in \mathscr{F}_j$, then the integrand in \eqref{eq.formalopint} is weakly integrable in the $\sigma$-weak operator topology (also called the weak$^*$ topology) on $\mathcal{M}$ whenever $b_1,\ldots,b_k \in \mathcal{M}$.\label{a.opint} \item The independence of \eqref{eq.formalopint} of the chosen integral projective decomposition \eqref{eq.formalIPD} of $\varphi$ is highly nontrivial and has not yet been proven for non-separable $H$. In Section \ref{sec.welldef}, we present a robust new argument that proves this fact for general $H$. The two key ingredients to the argument, which we discuss in Section \ref{sec.keying}, are the Mulitiplicative System Theorem (Theorem \ref{thm.MST}, a basic fact from measure theory) and a Minkowski-type integral inequality (Theorem \ref{thm.Spinteg}) for Schatten $p$-norms of operator-valued integrals that seems to be new in the non-separable case and is of independent interest.\label{a.welldef} \end{enumerate} We also prove in Section \ref{sec.otherdefs} that the above-described approach to defining \eqref{eq.formalMOI} agrees with another commonly used approach, due to B.S. Pavlov \cite{pavlov}, when both apply. Finally, even with all of \ref{q.IPD}-\ref{q.welldef} answered, applications often demand answers to an additional question. \begin{enumerate}[label=Q.\arabic*, leftmargin=2\parindent] \setcounter{enumi}{3} \item What kinds of quantitative norm estimates for \eqref{eq.formalMOI} are available?\label{q.estim} \end{enumerate} Our methods give us some answers to this question as well. \begin{enumerate}[label=A.\arabic*, leftmargin=2\parindent] \setcounter{enumi}{3} \item The aforementioned Minkowski-type integral inequality has a generalization (Theorem \ref{thm.Lpinteg}) to noncommutative $L^p$-norms of semifinite von Neumann algebras that allows us to prove noncommutative $L^p$-norm estimates (Proposition \ref{prop.MOILpestim}) for \eqref{eq.formalMOI}. \end{enumerate} Actually, Theorem \ref{thm.Lpinteg} can be combined with the theory of symmetric operator spaces to give a \textit{much} more general answer to \ref{q.estim}. We carry this out in \cite{nikitopoulosDiff} and use it to prove new results about higher derivatives of operator functions in ideals of von Neumann algebras. \subsection{Main Results on Multiple Operator Integrals} In this section, we summarize our main results on MOIs. \begin{nota} Let $X$ be a topological space, $S$ and $T$ be sets, $(\Om,\mathscr{F})$ be a measurable space, $H$ be a complex Hilbert space, and $P \colon \mathscr{F} \to B(H)$ be a projection-valued measure on $(\Om,\mathscr{F})$. \begin{enumerate}[label=(\alph*),leftmargin=2\parindent] \item $\mathcal{B}_X$ is the Borel $\sigma$-algebra on $X$. \item $T^S$ is the set of functions $S \to T$. If $\varphi \in \mathbb{C}^S$, then $\|\varphi\|_{\ell^{\infty}(S)} \coloneqq \sup_{s \in S}|\varphi(s)| \in [0,\infty]$. Also, we write $\ell^{\infty}(S) \coloneqq \{\varphi \in \mathbb{C}^S : \|\varphi\|_{\ell^{\infty}(S)} < \infty\}$ and $\ell^{\infty}(\Om,\mathscr{F}) \coloneqq \{\varphi \in \ell^{\infty}(\Om) : \varphi$ is $(\mathscr{F},\mathcal{B}_{\mathbb{C}})$-measurable$\}$. \item $L^{\infty}(\Om,P) \coloneqq \ell^{\infty}(\Om,\mathscr{F})/{\sim_P}$, where $\sim_P$ denotes the $P$-almost-everywhere equivalence relation. With the norm $\|\varphi\|_{L^{\infty}(P)} \coloneqq P\text{-}\esssup|\varphi| = \inf\{c \geq 0 : P(\{\omega \in \Om : |\varphi(\omega)| > c\}) = 0\}$, this space is a $C^*$-algebra under pointwise $P$-almost everywhere addition, multiplication, and complex conjugation. \end{enumerate} \end{nota} If $\varphi \in \ell^{\infty}(\Om,\mathscr{F})$, then the operator norm of $P(\varphi) \in B(H)$ is equal to $\|\varphi\|_{L^{\infty}(P)}$. Thus $P$-integration descends to a well-defined $\ast$-homomorphism $L^{\infty}(\Om,P) \to B(H)$, which we notate the same way. For reasons explained in Remarks \ref{rem.normmeas} and \ref{rem.measissue}, we shall be forced to integrate non-measurable functions. For this purpose, we use upper (and lower) integrals. If $(\Sigma,\mathscr{H},\rho)$ is a measure space and $h \in [0,\infty]^{\Sigma}$, then \[ \overline{\int_{\Sigma}} h(\sigma) \, \rho(d\sigma) = \overline{\int_{\Sigma}} h \, d\rho \coloneqq \inf\Bigg\{\int_{\Sigma} \tilde{h} \, d\rho : h \leq \tilde{h} \, \rho\text{-a.e.}, \, \tilde{h} \colon \Sigma \to [0,\infty] \text{ measurable}\Bigg\} \] is the \textbf{upper integral} of $h$. Of course, if $h$ is measurable, then $\overline{\int_{\Sigma}} h \, d\rho = \int_{\Sigma} h \,d\rho$. In Section \ref{sec.nonmeasint}, we prove the properties of this upper integral (and its lower counterpart) that are needed in this paper. \pagebreak Next, we state the precise definition of $L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$. To do so, we need the notion, due to M.S. Birman and M.Z. Solomyak \cite{birmansolomyakTensProd}, of the tensor product of projection-valued measures. (Please see Section \ref{sec.tensprod} for background about the Hilbert space tensor product $\otimes_2$.) \begin{thm}[\textbf{Birman-Solomyak}]\label{thm.tensprodPVM} Let $(\Om_1,\mathscr{F}_1,H_1,P_1),\ldots,(\Om_{k+1},\mathscr{F}_{k+1},H_{k+1},P_{k+1})$ be projection-valued measure spaces, and write $(\Om,\mathscr{F}) \coloneqq (\Om_1 \times \cdots \times \Om_{k+1},\mathscr{F}_1 \otimes \cdots \otimes \mathscr{F}_{k+1})$. There exists unique projection-valued measure $P \colon \mathscr{F} \to B(H_1 \otimes_2 \cdots \otimes_2 H_{k+1})$ such that for all $G_1 \in \mathscr{F}_1,\ldots,G_{k+1} \in \mathscr{F}_{k+1}$, \[ P(G_1 \times \cdots \times G_{k+1}) = P_1(G_1) \otimes \cdots \otimes P_{k+1}(G_{k+1}). \] We call $P$ the \textbf{tensor product} of $P_1,\ldots,P_{k+1}$ and write $P_1 \otimes \cdots \otimes P_{k+1} = P$. \end{thm} For completeness, we supply a proof in Section \ref{sec.tensprodPVM}. Now, retain the setup of Theorem \ref{thm.tensprodPVM}, write $P \coloneqq P_1 \otimes \cdots \otimes P_{k+1}$, and let $\varphi \colon \Om \to \mathbb{C}$ be a function. A \textbf{$\boldsymbol{L_P^{\infty}}$-integral projective decomposition} of $\varphi$ is a choice $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ of a $\sigma$-finite measure space $(\Sigma,\mathscr{H},\rho)$ and measurable functions $\varphi_j \colon \Om_j \times \Sigma \to \mathbb{C}$ such that $\varphi_j(\cdot,\sigma) \in L^{\infty}(\Om_j,P_j)$ for $\sigma \in \Sigma$, \[ \overline{\int_{\Sigma}} \,\|\varphi_1(\cdot,\sigma)\|_{L^{\infty}(P_1)} \cdots \|\varphi_{k+1}(\cdot,\sigma)\|_{L^{\infty}(P_{k+1})} \, \rho(d\sigma) < \infty, \numberthis\label{eq.IPDint} \] and \eqref{eq.formalIPD} holds for $P$-almost every $(\omega_1,\ldots,\omega_{k+1}) \in \Om$. (The integral on the right hand side of \eqref{eq.formalIPD} makes sense $P$-almost everywhere by Lemma \ref{lem.PVMink}.) Now, we define $\|\varphi\|_{L^{\infty}(P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(P_{k+1})}$ to be the infimum of the set of numbers \eqref{eq.IPDint} as $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ ranges over all $L_P^{\infty}$-integral projective decompositions of $\varphi$. In Section \ref{sec.IPTP}, we prove that if $L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$ is the space of $P$-almost-everywhere equivalence classes of functions $\varphi$ admitting $L_P^{\infty}$-integral projective decompositions, then this space is a Banach $\ast$-algebra under $P$-almost everywhere operations and the norm $\|\cdot\|_{L^{\infty}(P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(P_{k+1})}$. Now, let $V$ be a Hausdorff locally convex topological vector space with topological dual $V^*$. We call $F \colon \Sigma \to V$ \textbf{weakly measurable} if $\ell \circ F \colon \Sigma \to \mathbb{C}$ is $(\mathscr{H},\mathcal{B}_{\mathbb{C}})$-measurable whenever $\ell \in V^*$. Suppose in addition that $\int_{\Sigma}|\ell \circ F|\,d\rho < \infty$, for all $\ell \in V^*$. If for all $S \in \mathscr{H}$, there exists (necessarily unique) $\int_S F(\sigma)\,\rho(d\sigma) \in V$ such that $\ell\big(\int_S F(\sigma)\,\rho(d\sigma) \big) = \int_S (\ell \circ F) \, d\rho$ whenever $\ell \in V^*$, then $F$ is called \textbf{weakly} or \textbf{Gel'fand-Pettis integrable}. In this case, $\int_S F(\sigma)\,\rho(d\sigma)$ is called the \textbf{weak} or \textbf{Gel'fand-Pettis integral} (over $S$) of $F$ with respect to $\rho$. Finally, recall that a \textbf{von Neumann algebra} is a weak-operator-topology-closed $\ast$-subalgebra of $B(H)$. \begin{thm}[\textbf{Well-Definition of MOIs}]\label{thm.MOI} Let $H$ be a complex Hilbert space and $\mathcal{M} \subseteq B(H)$ be a von Neumann algebra. Suppose, for $j \in \{1,\ldots,k+1\}$, that $(\Om_j,\mathscr{F}_j,H,P_j)$ is a projection-valued measure space such that $P_j(G) \in \mathcal{M}$ whenever $G \in \mathscr{F}_j$. If $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ is a $L_P^{\infty}$-integral projective decomposition of $\varphi\in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$ and $b = (b_1,\ldots,b_k) \in \mathcal{M}^k$, then the map \[ \Sigma \ni \sigma \mapsto P_1(\varphi_1(\cdot,\sigma))\,b_1 \cdots P_k(\varphi_k(\cdot,\sigma))\,b_k \,P_{k+1}(\varphi_{k+1}(\cdot,\sigma)) \in \mathcal{M} \] is Gel'fand-Pettis integrable in the $\sigma$-weak operator topology on $\mathcal{M}$, and the weak integral \[ \big(I^{P_1,\ldots,P_{k+1}}\varphi\big)[b] \coloneqq \int_{\Sigma}P_1(\varphi_1(\cdot,\sigma))\,b_1 \cdots P_k(\varphi_k(\cdot,\sigma))\,b_k \,P_{k+1}(\varphi_{k+1}(\cdot,\sigma))\,\rho(d\sigma) \in \mathcal{M} \] is independent of both the chosen decomposition $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ and the representation of $\mathcal{M}$. \end{thm} \begin{proof} Combine Corollary \ref{cor.MOIintgood}, Theorem \ref{thm.MOIwelldef}, and Theorem \ref{thm.MOIsinM}. \end{proof} We also prove in Proposition \ref{prop.linandmult} that the assignment $\varphi \mapsto I^{P_1,\ldots,P_{k+1}}\varphi$ is linear and multiplicative in a certain sense. Finally, when $(\mathcal{M},\tau)$ is a semifinite von Neumann algebra (Definition \ref{def.trace}), we also prove (Proposition \ref{prop.MOILpestim}) that if $p,p_1,\ldots,p_k \in [1,\infty]$ are such that $\frac{1}{p_1}+\cdots +\frac{1}{p_k} = \frac{1}{p}$, then \[ \big\|\big(I^{P_1,\ldots,P_{k+1}}\varphi\big)[b_1,\ldots,b_k]\big\|_{L^p(\tau)} \leq \|\varphi\|_{L^{\infty}(P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(P_{k+1})}\|b_1\|_{L^{p_1}(\tau)}\cdots\|b_k\|_{L^{p_k}(\tau)}, \] for all $b_1,\ldots,b_k \in \mathcal{M}$, where $\|\cdot\|_{L^p(\tau)}$ is the noncommutative $L^p$-norm (Notation \ref{nota.ncLp}). This allows for an ``extension" of the MOI $I^{P_1,\ldots,P_{k+1}}\varphi \colon \mathcal{M}^k \to \mathcal{M}$ to a bounded $k$-linear map $L^{p_1}(\tau) \times \cdots \times L^{p_k}(\tau) \to L^p(\tau)$. \subsection{Discussion of the Well-Definition Argument}\label{sec.keying} Retain the setup of Theorem \ref{thm.MOI} with $\mathcal{M} = B(H)$. In this section, we discuss the key ingredients of the proof that the integral \eqref{eq.formalopint}, defined as described in the previous section, is independent of the chosen $L_P^{\infty}$-integral projective decomposition of $\varphi$ and why this argument is delicate when $H$ is not separable. To maximize readability, we stick to the case of a \textit{double operator integral} (DOI), i.e., the case $k=1$. Fix $b \in B(H)$. The goal is to show that if $(\Sigma,\rho,\varphi_1,\varphi_2)$ is a $L_{P_1 \otimes P_2}^{\infty}$-integral projective decomposition of $\varphi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i L^{\infty}(\Om_2,P_2)$, then \[ \int_{\Sigma} P_1(\varphi_1(\cdot,\sigma))\,b\,P_2(\varphi_2(\cdot,\sigma)) \, \rho(d\sigma) \] does not depend on $(\Sigma,\rho,\varphi_1,\varphi_2)$. This is actually not very difficult to prove -- as in \cite{azamovetal,pellerMOIPert} -- when $b$ has finite rank, so the proof is complete if we can somehow reduce to this case. In \cite{pellerMOIPert}, it is stated that this reduction is ``easy to see." This is certainly not the case when $H$ is not separable. Indeed, when $H$ is separable (as is assumed in \cite{azamovetal}), every $b \in B(H)$ is actually a strong operator limit of a \textit{sequence} of finite-rank operators. One can then use a vector-valued Dominated Convergence Theorem to finish the proof. But this argument does not work when $H$ is not separable because, for instance, $\id_H$ is not a strong operator limit of a sequence of finite-rank operators. We opt instead to work with a different topology on $B(H)$ with respect to which finite-rank operators are dense: the ultraweak topology. (This is another description of the $\sigma$-weak operator topology; please see \ref{thm.Schatten}.\ref{item.finrk} and \ref{thm.optop}.\ref{item.WOTsigmaWOT}.) If we can show $b \mapsto \int_{\Sigma} P_1(\varphi_1(\cdot,\sigma))\,b\,P_2(\varphi_2(\cdot,\sigma))\,\rho(d\sigma)$ is ultraweakly continuous, then the proof will be complete. This ultraweak continuity is asserted in \cite{potapovsukochev} without proof or reference. When $H$ is not separable, it is not at all obvious and, to the author's knowledge, has remained unproven until now. To prove it, we must show that for all $a \in \mathcal{S}_1(H)$ (trace class operators, Definition \ref{def.Schatten}), there exists $Ta \in \mathcal{S}_1(H)$ such that \[ \Tr\Bigg(\int_{\Sigma} P_1(\varphi_1(\cdot,\sigma))\,b\,P_2(\varphi_2(\cdot,\sigma)) \, \rho(d\sigma)\,a\Bigg) = \Tr(b\,Ta), \, \text{ for all } b \in B(H). \numberthis\label{eq.uwcontgoal} \] To motivate what $Ta$ should be, fix $a,b \in \mathcal{S}_1(H)$. Then the maps $c \mapsto \Tr(ca)$ and $c \mapsto \Tr(bc)$ are $\sigma$-weakly/ultraweakly continuous. Therefore, by definition of the Gel'fand-Pettis integral and basic properties (Theorem \ref{thm.Schatten}.\ref{item.Trflip}) of $\Tr$, we have \begin{align*} \Tr\Bigg(\int_{\Sigma} P_1(\varphi_1(\cdot,\sigma))\,b\,P_2(\varphi_2(\cdot,\sigma)) \, \rho(d\sigma)\,a\Bigg) & = \int_{\Sigma} \underbrace{\Tr( P_1(\varphi_1(\cdot,\sigma))\,b\,P_2(\varphi_2(\cdot,\sigma))\,a)}_{=\Tr( b\,P_2(\varphi_2(\cdot,\sigma))\,a \, P_1(\varphi_1(\cdot,\sigma)))} \, \rho(d\sigma) \\ & = \Tr\Bigg(b\int_{\Sigma} P_2(\varphi_2(\cdot,\sigma))\,a\,P_1(\varphi_1(\cdot,\sigma))\,\rho(d\sigma)\Bigg). \numberthis\label{eq.weakS1integ} \end{align*} We should therefore take $Ta = \int_{\Sigma} P_2(\varphi_2(\cdot,\sigma))\,a\,P_1(\varphi_1(\cdot,\sigma))\,\rho(d\sigma)$ in \eqref{eq.uwcontgoal}. (Those familiar with the subject will recognize this as related to the Birman-Solomyak \cite{birmansolomyakDSOI1} definition of a DOI. We elaborate on this in Section \ref{sec.otherdefs}.) For this to have any chance at making sense, we need to know at the very least that \[ a \in \mathcal{S}_1(H) \implies \int_{\Sigma} P_2(\varphi_2(\cdot,\sigma))\,a\,P_1(\varphi_1(\cdot,\sigma)) \,\rho(d\sigma) \in \mathcal{S}_1(H). \numberthis\label{eq.DOIinS1} \] Even \textit{this} is not obvious when $H$ is not separable! It follows, however, from our first key ingredient: Theorem \ref{thm.Spinteg}. Assuming we know \eqref{eq.DOIinS1}, we must still verify \eqref{eq.weakS1integ} for \textit{all} $b \in B(H)$, not just for $b \in \mathcal{S}_1(H)$. If $b \in B(H)$ is arbitrary, then the map $\mathcal{S}_1(H) \ni c \mapsto \Tr(bc) \in \mathbb{C}$ is bounded with respect to $\|\cdot\|_{\mathcal{S}_1(H)}$. Therefore, we could reverse the calculation that led to \eqref{eq.weakS1integ} if we knew that $\Sigma \ni \sigma \mapsto P_2(\varphi_2(\cdot,\sigma))\,a\,P_1(\varphi_1(\cdot,\sigma)) \in \mathcal{S}_1(H)$ were Gel'fand-Pettis integrable as a map $\Sigma \to (\mathcal{S}_1(H),\|\cdot\|_{\mathcal{S}_1(H)})$, not just as a map $\Sigma \to (B(H),\sigma$-WOT$)$, whenever $a \in \mathcal{S}_1(H)$. This is not automatic. Moreover, if $H$ is not separable, then $\mathcal{S}_1(H)$ is not separable, so Bochner integral techniques do not automatically apply either. We tiptoe around these difficulties using the second key ingredient: the Multiplicative System Theorem, which is a ``functional form" of the Dynkin System Theorem. To state it, we recall some additional notation and terminology. \begin{nota}\label{nota.sigmaalggen} Let $S$ be a set, $2^S$ be the power set of $S$, $(T,\mathscr{T})$ be a measurable space, and $\mathscr{S} \subseteq T^S$. We write $\sigma_{\mathscr{T}}(\mathscr{S}) \subseteq 2^S$ for the smallest $\sigma$-algebra on $S$ with respect to which all members of $\mathscr{S}$ are measurable. When $(T,\mathscr{T}) = (\mathbb{C},\mathcal{B}_{\mathbb{C}}))$, we shall write $\sigma_{\mathscr{T}}(\mathscr{S}) = \sigma(\mathscr{S})$. \end{nota} Retain the above setting, and let $(\Xi,\mathscr{G})$ be an additional measurable space. Note that a function $g \colon \Xi \to S$ is $(\mathscr{G},\sigma_{\mathscr{T}}(\mathscr{S}))$-measurable if and only if $s \circ g \colon \Xi \to T$ is $(\mathscr{G},\mathscr{T})$-measurable, for all $s \in \mathscr{S}$. Finally, we recall the definition of \textit{bounded convergence}. A sequence $(\varphi_n)_{n \in \mathbb{N}}$ of functions $S \to \mathbb{C}$ is said to \textbf{converge boundedly} to $\varphi \in \mathbb{C}^S$ if $\varphi_n \to \varphi$ pointwise as $n \to \infty$ and $\sup_{n \in \mathbb{N}}\|\varphi_n\|_{\ell^{\infty}(S)} < \infty$. \begin{thm}[\textbf{Multiplicative System}]\label{thm.MST} Let $S$ be a set. Suppose $\mathbb{H} \subseteq \mathbb{C}^S$ is a linear subspace containing the constant function $1$ that is closed under complex conjugation and sequential bounded convergence. If $\mathbb{M} \subseteq \mathbb{H}$ is closed under multiplication and complex conjugation, then $\ell^{\infty}(S,\sigma(\mathbb{M})) \subseteq \mathbb{H}$. \end{thm} For a proof, please see Section 12.1 of \cite{driver} or Appendix A of \cite{janson}. The corollary most relevant to the argument presently under discussion is as follows. \begin{cor}\label{cor.MST} Let $(\Om,\mathscr{F})$ and $(\Sigma,\mathscr{H})$ be measurable spaces and $\mathbb{H} \subseteq \ell^{\infty}(\Om \times \Sigma)$ be a linear subspace that is closed under complex conjugation and sequential bounded convergence. If $\{1_{G \times S} : G \in\mathscr{F}, S \in \mathscr{H}\} \subseteq \mathbb{H}$, then $\ell^{\infty}(\Om \times \Sigma,\mathscr{F} \otimes \mathscr{H}) \subseteq \mathbb{H}$. \end{cor} \begin{proof} If $\mathbb{M} \coloneqq \{1_{G \times S} : G \in \mathscr{F}, S \in \mathscr{H}\}$, then $\mathbb{M}$ is closed under complex conjugation and pointwise multiplication (because $\{G \times S : G \in \mathscr{F}, S \in \mathscr{H}\}$ is a $\pi$-system). Since $1 \in \mathbb{M} \subseteq \mathbb{H}$ and $\sigma(\mathbb{M}) = \mathscr{F} \otimes \mathscr{H}$, the conclusion follows from the Multiplicative System Theorem. \end{proof} Using this consequence of the Multiplicative System Theorem and our operator-valued integral development, we are able to prove (in Section \ref{sec.welldef}) the following key result. \begin{thm}[\textbf{Trace of Integral of a Product}]\label{thm.traceofinteg} Let $(\Xi,\mathscr{G},K,Q)$ be a projection-valued measure space, $(\Sigma,\mathscr{H},\rho)$ be a finite measure space, and $\varphi \in \ell^{\infty}(\Xi \times \Sigma,\mathscr{G} \otimes \mathscr{H})$. If $A \colon \Sigma \to B(K)$ is pointwise weakly measurable (Definition \ref{def.Pettint}) and $\sup_{\sigma \in \Sigma}\|A(\sigma)\|_{\mathcal{S}_1} < \infty$, then \[ \int_{\Sigma} A(\sigma) \, Q(\varphi(\cdot,\sigma)) \,\rho(d\sigma),\; \int_{\Sigma} Q(\varphi(\cdot,\sigma)) \,A(\sigma) \,\rho(d\sigma) \in \mathcal{S}_1(K) \] and \[ \Tr\Bigg(\int_{\Sigma} A(\sigma) \, Q(\varphi(\cdot,\sigma)) \,\rho(d\sigma)\Bigg) = \Tr\Bigg( \int_{\Sigma} Q(\varphi(\cdot,\sigma)) \,A(\sigma) \,\rho(d\sigma)\Bigg). \numberthis\label{eq.traceofinteg} \] \end{thm} By combining the formula \eqref{eq.traceofinteg} with truncation arguments on $\varphi_1$ and $\varphi_2$, we are able to prove the desired $\mathcal{S}_1(H)$-valued weak integrability of $\Sigma \ni \sigma \mapsto P_2(\varphi_2(\cdot,\sigma))\,a\,P_1(\varphi_1(\cdot,\sigma)) \in \mathcal{S}_1(H)$ when $a \in \mathcal{S}_1(H)$. The relevant results are Theorem \ref{thm.S1integrability} and Corollary \ref{cor.uwcont}. Please see Remark \ref{rem.semifinitecase} as well. \section{Background}\label{sec.bg} For the duration of Section \ref{sec.bg}, fix complex Hilbert spaces $(H,\langle \cdot, \cdot \rangle_H)$ and $(K,\langle \cdot,\cdot \rangle_K)$. \subsection{Operator Topologies}\label{sec.optop} In this section, we record facts that we shall need about some standard locally convex topologies on $B(H;K)$. We assume the reader is quite familiar with these in the case $H=K$, which is covered in Chapter II of \cite{takesaki} and Chapter I.3 of \cite{dixmier}. When $H \neq K$, all the basic properties still hold with essentially the same proofs. The \textbf{weak operator topology} (WOT for short) on $B(H;K)$ is the one generated by the seminorms $B(H;K) \ni A \mapsto |\langle Ah,k \rangle_K| \in \mathbb{R}_+ \coloneqq [0,\infty)$, where $h \in H$ and $k \in K$. The \textbf{strong operator topology} (SOT) is generated by the seminorms $B(H;K) \ni A \mapsto \|Ah\|_K \in \mathbb{R}_+$, where $h \in H$. The \textbf{strong$\boldsymbol{^*}$ operator topology} (S$^*$OT) is generated by the seminorms $B(H;K) \ni A \mapsto \|Ah\|_K+\|A^*k\|_H \in \mathbb{R}_+$, where $h \in H$ and $k \in K$. Next, write \[ \ell^2(\mathbb{N};H) \coloneqq \Bigg\{(h_n)_{n \in \mathbb{N}} \in H^{\mathbb{N}} : \sum_{n=1}^{\infty}\|h_n\|_H^2 < \infty\Bigg\} \] with inner product \[ \langle (h_n)_{n \in \mathbb{N}},(k_n)_{n \in \mathbb{N}} \rangle_{\ell^2(\mathbb{N};H)} \coloneqq \sum_{n=1}^{\infty} \langle h_n,k_n \rangle_H. \] The \textbf{$\boldsymbol{\sigma}$-weak operator topology} ($\sigma$-WOT) is generated by the seminorms \[ B(H;K) \ni A \mapsto |\langle (Ah_n)_{n \in \mathbb{N}},(k_n)_{n \in \mathbb{N}} \rangle_{\ell^2(\mathbb{N};K)}| \in \mathbb{R}_+, \] where $(h_n)_{n \in \mathbb{N}} \in \ell^2(\mathbb{N};H)$ and $(k_n)_{n \in \mathbb{N}} \in \ell^2(\mathbb{N};K)$. The \textbf{$\boldsymbol{\sigma}$-strong operator topology} ($\sigma$-SOT) is generated by the seminorms $B(H;K) \ni A \mapsto \|(Ah_n)_{n \in \mathbb{N}}\|_{\ell^2(\mathbb{N};K)} \in \mathbb{R}_+$, where $(h_n)_{n \in \mathbb{N}} \in \ell^2(\mathbb{N};H)$. Finally, the \textbf{$\boldsymbol{\sigma}$-strong$\boldsymbol{^*}$ operator topology} ($\sigma$-S$^*$OT) is generated by the seminorms \[ B(H;K) \ni A \mapsto \|(Ah_n)_{n \in \mathbb{N}}\|_{\ell^2(\mathbb{N};K)}+\|(A^*k_n)_{n \in \mathbb{N}}\|_{\ell^2(\mathbb{N};H)} \in \mathbb{R}_+, \] where $(h_n)_{n \in \mathbb{N}} \in \ell^2(\mathbb{N};H)$ and $(k_n)_{n \in \mathbb{N}} \in \ell^2(\mathbb{N};K)$. When referring to these topologies, we shall often omit the term ``operator." Also, if $V \subseteq B(H;K)$, then the subspace topologies inherited by $V$ from the aforementioned topologies on $B(H;K)$ are given the same names as above. For example, the $\sigma$-weak topology ($\sigma$-WOT) on $V$ is the subspace topology $V$ inherits from the $\sigma$-WOT on $B(H;K)$. Here are all the facts we shall need about these topologies. \begin{thm}[\textbf{Properties of Operator Topologies}]\label{thm.optop} Let $V \subseteq B(H;K)$ be a linear subspace, $\ell \colon V \to \mathbb{C}$ be a linear functional, and $\mathcal{T} \in \{\mathrm{WOT}, \,\mathrm{SOT}, \,\mathrm{S^*OT}\}$. \begin{enumerate}[label=(\roman*),leftmargin=2\parindent] \item $\mathcal{T}$ agrees with the $\sigma$-$\mathcal{T}$ on norm-bounded subsets of $B(H;K)$. In particular -- since the net of finite-rank orthogonal projections on $K$ converges in the WOT to the identity on $K$ -- finite-rank linear operators $H \to K$ are $\sigma$-weakly dense in $B(H;K)$. \label{item.WOTsigmaWOT} \item $\ell$ is $\mathcal{T}$-continuous if and only if there exist $h_1,\ldots,h_n \in H$ and $k_1,\ldots,k_n \in K$ such that \[ \ell(A) = \sum_{j=1}^n\langle Ah_j,k_j \rangle_K, \] for all $A \in V$.\label{item.contchar} \item $\ell$ is $\sigma$-$\mathcal{T}$-continuous if and only if there exist $(h_n)_{n \in \mathbb{N}} \in \ell^2(\mathbb{N};H)$ and $(k_n)_{n \in \mathbb{N}} \in \ell^2(\mathbb{N};K)$ such that \[ \ell(A) = \langle (Ah_n)_{n \in \mathbb{N}},(k_n)_{n \in \mathbb{N}} \rangle _{\ell^2(\mathbb{N};K)} = \sum_{n=1}^{\infty}\langle Ah_n,k_n \rangle_K, \] for all $A \in V$.\label{item.sigmacontchar} \end{enumerate} Suppose now that $V \subseteq B(H;K)$ is also $\sigma$-weakly closed. \begin{enumerate}[label=(\roman*),leftmargin=2\parindent] \setcounter{enumi}{3} \item If $V_* \coloneqq \{\sigma$-weakly continuous linear functionals $V \to \mathbb{C}\} = (V,\sigma\text{-}\mathrm{WOT})^*$, then $V_* \subseteq V^*$ is a (norm) closed linear subspace, and the map $\ev_V \colon V \to V_*^{\;*}$ defined by $V \ni A \mapsto (\ell \mapsto \ell(A)) \in V_*^{\;*}$ is an isometric isomorphism. We therefore call $V_*$ the \textbf{predual} of $V$.\label{item.predual} \item The map $\ev_V$ from the previous part is a homeomorphism with respect to the $\sigma$-weak topology on $V$ and the weak$^*$ topology on $V_*^{\;*}$. The $\sigma$-weak topology on $V$ is therefore also called the \textbf{weak$\boldsymbol{^*}$ topology}.\label{item.weakstar} \end{enumerate} Finally, suppose $\mathcal{M} \subseteq B(H)$ and $\mathcal{N} \subseteq B(K)$ are von Neumann algebras. \begin{enumerate}[label=(\roman*),leftmargin=2\parindent] \setcounter{enumi}{5} \item If $\pi \colon \mathcal{M} \to \mathcal{N}$ is a $\ast$-isomorphism in the algebraic sense, then $\pi$ is a homeomorphism with respect to the $\sigma$-weak topologies on $\mathcal{M}$ and $\mathcal{N}$.\label{item.starisom} \end{enumerate} \end{thm} \begin{rem} If $H = K$, then Theorem \ref{thm.optop}.\ref{item.WOTsigmaWOT}-\ref{item.weakstar} is contained in Section I.3.1 of \cite{dixmier} and Section II.2 of \cite{takesaki}. The proofs of these statements when $H \neq K$ are slight notational modifications of the proofs in the aforementioned references. Item \ref{item.starisom} is part of Corollary 1 in Section I.4.3 of \cite{dixmier}. \end{rem} \subsection{Schatten Classes and Noncommutative \texorpdfstring{$L^p$}{}-spaces}\label{sec.Schatten} We now record some standard facts about Schatten $p$-class operators $H \to K$ that will be of use to us. Please see Chapter 2 of \cite{ringrose} for the proofs of these basics (and more) in the case $H=K$. For just the cases $p \in \{1,2,\infty\}$, please see also Sections 18-20 of \cite{conwayop}. As with the material in Section \ref{sec.optop}, all the basic properties in the case $H \neq K$ have essentially the same proofs; the main tools this time are the singular value and polar decompositions. \begin{defi}[\textbf{Schatten Classes}]\label{def.Schatten} If $p \in [1,\infty)$, $\mathcal{E} \subseteq H$ is an orthonormal basis, and $A \in B(H;K)$, then we define \[ \|A\|_{\mathcal{S}_p(H;K)} = \|A\|_{\mathcal{S}_p} \coloneqq \Bigg(\sum_{e \in \mathcal{E}} \langle |A|^pe,e\rangle_H\Bigg)^{\frac{1}{p}} \in [0,\infty], \] where $|A|^p \coloneqq (A^*A)^{\frac{p}{2}} \in B(H)$, and $\mathcal{S}_p(H;K) \coloneqq \{A \in B(H;K) : \|A\|_{\mathcal{S}_p} < \infty\}$. Also, we define $\mathcal{S}_{\infty}(H;K) \coloneqq B(H;K)$ with the operator norm \[ \|A\|_{\mathcal{S}_{\infty}(H;K)} = \|A\|_{\mathcal{S}_{\infty}} \coloneqq \|A\| = \|A\|_{H\to K}. \] For $p \in [1,\infty]$, $\mathcal{S}_p(H;K)$ is called the set of \textbf{Schatten} (or \textbf{Schatten-von Neumann}) $\boldsymbol{p}$\textbf{-class operators} from $H$ to $K$. Finally, we write \[ \mathcal{K}(H;K) \coloneqq\{\text{compact linear operators } H \to K\}, \] $\mathcal{K}(H) \coloneqq \mathcal{K}(H;H)$, and $\mathcal{S}_p(H) \coloneqq \mathcal{S}_p(H;H)$. \end{defi} \begin{rem} The operator $(A^*A)^{\frac{p}{2}}$ above is defined via continuous functional calculus (Section VIII.2 of \cite{conwayfunc}). Also, we caution the reader that sometimes $\mathcal{S}_{\infty}(H;K)$ is taken to be the space of compact operators $H \to K$, and often the letter $\mathcal{C}$ is used instead of $\mathcal{S}$. \end{rem} \begin{thm}[\textbf{Properties of Schatten Classes}]\label{thm.Schatten} Let $p \in [1,\infty]$. \begin{enumerate}[label=(\roman*),leftmargin=2\parindent] \item $(\mathcal{S}_p(H;K),\|\cdot\|_{\mathcal{S}_p})$ is a Banach space, $\|\cdot\|_{\mathcal{S}_p}$ is independent of the chosen orthonormal basis, and, when $p < \infty$, the set of finite-rank linear operators $H \to K$ is dense in $\mathcal{S}_p(H;K)$. Also, $(\mathcal{K}(H;K),\|\cdot\|)$ is a Banach space with the set of finite-rank linear operators $H \to K$ as a dense linear subspace. Finally, if $1 \leq p \leq q < \infty$, then $\mathcal{S}_p(H;K) \subseteq \mathcal{S}_q(H;K) \subseteq \mathcal{K}(H;K)$, and the inclusions $\mathcal{S}_p \hookrightarrow \mathcal{S}_q \hookrightarrow \mathcal{K}$ each have operator norm at most one. \item If $A \in B(H)$ and $\mathcal{E} \subseteq H$ is an orthonormal basis, then \[ \sum_{e \in \mathcal{E}} |\langle Ae,e\rangle_H| \leq \|A\|_{\mathcal{S}_1}. \] If $A \in \mathcal{S}_1(H)$, then $\Tr(A) \coloneqq \sum_{e \in \mathcal{E}} \langle Ae,e \rangle_H \in \mathbb{C}$ is called the \textbf{trace} of $A$ and is independent of the choice of $\mathcal{E}$. Moreover, $\|A^*\|_{\mathcal{S}_1} = \|A\|_{\mathcal{S}_1}$ and $\Tr(A^*) = \overline{\Tr(A)}$, for all $A \in \mathcal{S}_1(H)$. \item (\textbf{H\"{o}lder's Inequality}) Let $H_1,\ldots,H_{k+1}$ be complex Hilbert spaces. Suppose $p_1,\ldots,p_k \in [1,\infty]$ are such that $\frac{1}{p_1}+\cdots+\frac{1}{p_k} = \frac{1}{p}$. Then \[ \|A_1\cdots A_k\|_{\mathcal{S}_p(H_{k+1};H_1)} \leq \|A_1\|_{\mathcal{S}_{p_1}(H_2;H_1)} \cdots \|A_k\|_{\mathcal{S}_{p_k}(H_{k+1};H_k)}, \] for all $A_1 \in B(H_2;H_1),\ldots, A_k \in B(H_{k+1};H_k)$. (As usual, $0\cdot \infty \coloneqq 0$.)\label{item.SchattenHolder} \item If $q \in [1,\infty]$ is such that $\frac{1}{p}+\frac{1}{q} = 1$ and $A \in \mathcal{S}_p(H;K)$, $B \in \mathcal{S}_q(K;H)$, then $\Tr(AB) = \Tr(BA)$.\label{item.Trflip} \item If $p \in [1,\infty),q \in (1,\infty]$ are such that $\frac{1}{p}+\frac{1}{q}=1$, then $\mathcal{S}_q(H;K) \cong \mathcal{S}_p(K;H)^*$ isometrically via the map $A \mapsto (B \mapsto \Tr(AB))$. Also, $\mathcal{S}_1(H;K) \cong \mathcal{K}(K;H)^*$ isometrically via the same map.\label{item.Schattendual} \item The weak$^*$ topology on $B(H;K)$ induced by the identification \[ B(H;K) = \mathcal{S}_{\infty}(H;K) \cong \mathcal{S}_1(K;H)^* \] is called the \textbf{ultraweak topology}, and it agrees with the $\sigma$-WOT. In particular, finite-rank linear operators $H \to K$ are ultraweakly dense in $B(H;K)$.\label{item.finrk} \end{enumerate} \end{thm} \pagebreak Next, we review some basics of semifinite von Neumann algebras and noncommutative $L^p$-spaces. (The reader who is uninterested in semifinite von Neumann algebras may skip at this time to the next section.) If $a,b \in B(H)$, then we write $a \leq b$ or $b \geq a$ to mean that $b-a$ is a positive operator, i.e., $\langle (b-a)h,h \rangle_H \geq 0$ for $h \in H$. If $\mathcal{M} \subseteq B(H)$ is a von Neumann algebra, then we write \[ \mathcal{M}_+ \coloneqq \{a \in \mathcal{M} : a \geq 0\}. \] It is easy to see that $\mathcal{M}_+$ is closed in the WOT. Also, if $(a_j)_{j \in J}$ is a net in $\mathcal{M}_+$ that is bounded (there exists $b \in B(H)$ such that $a_j \leq b$, for all $j \in J$) and increasing ($j_1 \leq j_2 \Rightarrow a_{j_1}\leq a_{j_2}$), then $\sup_{j \in J} a_j$ exists in $B(H)_+$ and belongs to $\mathcal{M}_+$. (Please see Proposition 43.1 in \cite{conwayop}.) This is often known as Vigier's Theorem. \begin{defi}[\textbf{Trace}]\label{def.trace} Let $\mathcal{M} \subseteq B(H)$ be a von Neumann algebra and $\tau \colon \mathcal{M}_+ \to [0,\infty]$. We call $\tau$ a \textbf{trace} if for all $a,b \in \mathcal{M}_+$, $c \in \mathcal{M}$, and $\lambda \in \mathbb{R}_+$, we have \begin{enumerate}[label=(\alph*),leftmargin=2\parindent] \item $\tau(a+b) = \tau(a)+\tau(b)$,\label{item.add} \item $\tau(\lambda a) = \lambda\,\tau(a)$,\label{item.poshom} and \item $\tau(c^*c) = \tau(cc^*)$.\label{item.trace} \end{enumerate} A trace $\tau$ on $\mathcal{M}$ is called \begin{enumerate}[label=(\alph*),leftmargin=2\parindent] \item \textbf{normal} if $\tau(\sup_{j \in J}a_j) = \sup_{j \in J}\tau(a_j)$ whenever $(a_j)_{j \in J}$ is a bounded and increasing net in $\mathcal{M}_+$, \item \textbf{faithful} if $a \in \mathcal{M}_+$ and $\tau(a) = 0$ imply $a=0$, and \item \textbf{semifinite} if $\tau(a) = \sup\{\tau(b) : a \geq b \in \mathcal{M}_+, \, \tau(b) < \infty\}$, for all $a \in \mathcal{M}_+$. \end{enumerate} If $\tau$ is a normal, faithful, semifinite trace on $\mathcal{M}$, then $(\mathcal{M},\tau)$ is called a \textbf{semifinite von Neumann algebra}. \end{defi} \begin{rem} In the presence of \ref{item.add} and \ref{item.poshom}, condition \ref{item.trace} is equivalent to $\tau(u^*au) = \tau(a)$ for all $a \in \mathcal{M}_+$ and all unitaries $u$ belonging to $\mathcal{M}$. This is Corollary 1 in Section I.6.1 of \cite{dixmier}. \end{rem} For basic properties of traces on von Neumann algebras, please see Chapter I.6 of \cite{dixmier} or Section V.2 of \cite{takesaki}. Motivating examples of semifinite von Neumann algebras are $(B(H),\Tr)$ and $(L^{\infty}(\Om,\mu),\int_{\Om} \boldsymbol{\cdot}\,d\mu)$, where $(\Om,\mathscr{F},\mu)$ is a $\sigma$-finite measure space and $L^{\infty}(\Om,\mu)$ is represented as multiplication operators on $L^2(\Om,\mu)$. We now record some basics of $L^p$-spaces associated to a normal, faithul, semifinite trace. We shall mostly draw results from \cite{dixmierLp,dasilva}. For more information and/or different perspectives, please see \cite{nelson,yeadon,terp,fackkosaki}. \begin{nota}\label{nota.ncLp} Let $(\mathcal{M},\tau)$ be a semifinite von Neumann algebra, and fix $p \in [1,\infty)$. Write \[ \|a\|_{L^p(\tau)} \coloneqq \tau(|a|^p)^{\frac{1}{p}} \in [0,\infty], \] for all $a \in \mathcal{M}$, and \[ \mathcal{L}^p(\tau) \coloneqq \{a \in \mathcal{M} : \|a\|_{L^p(\tau)}^p = \tau(|a|^p) < \infty\}. \] For the $p=\infty$ case, we take $\mathcal{L}^{\infty}(\tau) \coloneqq \mathcal{M}$ with $\|\cdot\|_{L^{\infty}(\tau)} \coloneqq \|\cdot\|$. \end{nota} It turns out that $\mathcal{L}^1(\tau) \subseteq \mathcal{M}$ is a two-sided ideal of $\mathcal{M}$ that is spanned by $\mathcal{L}^1(\tau)_+ = \mathcal{L}^1(\tau) \cap \mathcal{M}_+$. Moreover, there exists a unique linear extension of $\tau|_{\mathcal{L}_1(\tau)_+} \colon \mathcal{L}_1(\tau)_+ \to \mathbb{C}$ to $\mathcal{L}^1(\tau)$, which we notate the same way, and this extension satisfies \[ \tau(ab) = \tau(ba) \, \text{ for } a \in \mathcal{M}, \, b \in \mathcal{L}^1(\tau). \] Finally, if $b \in \mathcal{L}^1(\tau)$, then the map $\mathcal{M} \ni a \mapsto \tau(ab) \in \mathbb{C}$ is $\sigma$-weakly continuous. (These facts are proven as Proposition 1 in Section I.6.1, together with the sentence before Proposition 9 in Section I.1.6, of \cite{dixmier}.) \begin{thm}[\textbf{Properties of $\boldsymbol{\mathcal{L}^p(\tau)}$}]\label{thm.Lp} Let $(\mathcal{M},\tau)$ be a semifinite von Neumann algebra and $p \in [1,\infty]$. \begin{enumerate}[label=(\roman*),leftmargin=2\parindent] \item $(\mathcal{L}^p(\tau),\|\cdot\|_{L^p(\tau)})$ is a normed vector space. Its completion is denoted $(L^p(\tau),\|\cdot\|_{L^p(\tau)})$ and is called the \textbf{noncommutative $\boldsymbol{L^p}$-space} associated to $\boldsymbol{(\mathcal{M},\tau)}$. We therefore also write $\mathcal{L}^p(\tau) = L^p(\tau) \cap \mathcal{M}$. \item If $a \in \mathcal{L}^1(\tau)$, then $|\tau(a)| \leq \tau(|a|) = \|a\|_{L^1(\tau)}$. Thus $\tau \colon \mathcal{L}^1(\tau) \to \mathbb{C}$ extends uniquely to a bounded linear map, notated the same way, $L^1(\tau) \to \mathbb{C}$.\label{item.tauext}\pagebreak \item (\textbf{Nonommutative H\"{o}lder's Inequality}) If $p_1,\ldots,p_k \in [1,\infty]$ are such that $\frac{1}{p_1}+\cdots+\frac{1}{p_k} = \frac{1}{p}$, then \[ \|a_1\cdots a_k\|_{L^p(\tau)} \leq \|a_1\|_{L^{p_1}(\tau)} \cdots \|a_k\|_{L^{p_k}(\tau)}, \] for all $a_1,\ldots,a_k \in \mathcal{M}$. (As usual, $0\cdot \infty \coloneqq 0$.)\label{item.LpHolder} \item If $q \in [1,\infty]$ is such that $\frac{1}{p}+\frac{1}{q}=1$, then \[ \|a\|_{L^p(\tau)} = \sup\{\|ab\|_{L^1(\tau)} : b \in \mathcal{L}^q(\tau),\,\|b\|_{L^q(\tau)} \leq 1\}, \] for all $a \in \mathcal{M}$.\label{item.Lpdual} \end{enumerate} \end{thm} When $(\mathcal{M},\tau) = (B(H),\Tr)$, we have that $\mathcal{L}^p(\tau) = L^p(\tau) = \mathcal{S}_p(H)$ and $\|\cdot\|_{L^p(\tau)} = \|\cdot\|_{\mathcal{S}_p}$. Therefore, Theorem \ref{thm.Lp} generalizes parts of Theorem \ref{thm.Schatten} in the case $H=K$. \subsection{Tensor Products}\label{sec.tensprod} \begin{nota} Write $\otimes$ for the algebraic tensor product, $\otimes_2$ for the Hilbert space tensor product, and $\hat{\otimes}_{\pi}$ for the Banach space projective tensor product. \end{nota} Please see Section 3.2 of \cite{brownozawa} or Section 2.6 of \cite{kadisonringrose1} for information about $\otimes_2$ and Chapter 2 of \cite{ryan} for information about $\hat{\otimes}_{\pi}$. We assume the reader has some familiarity with these tensor products; nevertheless, we recall the definitions/constructions thereof (at least when there are only two tensorands). First of all, there is a unique inner product $\langle \cdot, \cdot \rangle_{H \otimes K}$ on $H \otimes K$ such that \[ \langle h_1 \otimes k_1, h_2 \otimes k_2 \rangle_{H \otimes K} = \langle h_1,h_2 \rangle_H\langle k_1,k_2 \rangle_K, \] for all $h_1,h_2 \in H$, $k_1,k_2 \in K$. The Hilbert space tensor product $H \otimes_2 K$ is defined to be the completion of $H \otimes K$ with respect to $\langle \cdot, \cdot \rangle_{H \otimes K}$. Also, if $A \in B(H)$ and $B \in B(K)$, then there exists a unique bounded linear map $A \otimes_2 B \in B(H \otimes_2 K)$ such that $(A \otimes_2 B)(h \otimes k) = Ah \otimes Bk$, for all $h \in H$ and $k \in K$. Moreover, $\|A \otimes_2 B\|_{B(H \otimes_2 K)} = \|A\|_{B(H)}\|B\|_{B(K)}$, and the linear map \[ B(H) \otimes B(K) \to B(H \otimes_2 K) \] determined by \[ A \otimes B \mapsto A \otimes_2 B \] is an injective $\ast$-homomorphism when $B(H) \otimes B(K)$ is given the tensor product $\ast$-algebra structure. This allows us to view $B(H) \otimes B(K)$ as a $\ast$-subalgebra of $B(H \otimes_2 K)$ and justifies writing, as we shall, $A \otimes B$ instead of $A \otimes_2 B$. We shall only use the projective tensor product to motivate the \textit{integral projective tensor products} described in Section \ref{sec.IPTP}. Here is what is useful to know for this purpose. For Banach spaces $V$ and $W$ and $u \in V \otimes W$, define \[ \pi(u) \coloneqq \inf\Bigg\{\sum_{j=1}^n\|v_j\|_V\|w_j\|_W : u = \sum_{j=1}^n v_j\otimes w_j\Bigg\}. \] The projective tensor product $V \hat{\otimes}_{\pi} W$ is defined to be the completion of $V \otimes W$ with respect to the norm $\pi$, and it satisfies the type of universal property that the algeraic tensor product satisfies: it bounded-linearizes bounded bilinear maps. As for a more concrete description of $V \hat{\otimes}_{\pi} W$, it can be shown that every element $u \in V \hat{\otimes}_{\pi} W$ admits a decomposition \[ u = \sum_{n=1}^{\infty} v_n \otimes w_n \;\text{ with }\; \sum_{n=1}^{\infty}\underbrace{\|v_n\|_V\|w_n\|_W}_{\pi(v_n \otimes w_n)} < \infty \numberthis\label{eq.projdecomp} \] and that \[ \pi(u) = \inf\Bigg\{\sum_{n=1}^{\infty}\|v_n\|_V\|w_n\|_W : u = \sum_{n=1}^{\infty} v_n \otimes w_n \text{ as in \eqref{eq.projdecomp}}\Bigg\}. \] Please see Chapter 2 of \cite{ryan} for a proper development. \section{Vector- and Operator-Valued Integrals}\label{sec.vopinteg} For the duration of Section \ref{sec.vopinteg}, fix a measure space $(\Sigma,\mathscr{H},\rho)$. \subsection{Upper and Lower Integrals}\label{sec.nonmeasint} \begin{defi}[\textbf{Upper and Lower Integrals}]\label{def.nonmeasint} For an arbitrary (not necessarily measurable) function $h \colon \Sigma \to [0,\infty]$, we define \begin{align*} \overline{\int_{\Sigma}} h(\sigma) \, \rho(d\sigma) & = \overline{\int_{\Sigma}} h \, d\rho \coloneqq \inf\Bigg\{\int_{\Sigma} \tilde{h} \, d\rho : h \leq \tilde{h} \, \rho\text{-a.e.}, \, \tilde{h} \colon \Sigma \to [0,\infty] \text{ measurable}\Bigg\} \text{ and} \\ \underline{\int_{\Sigma}} h(\sigma) \, \rho(d\sigma) & = \underline{\int_{\Sigma}} h \, d\rho \coloneqq \sup\Bigg\{\int_{\Sigma} \tilde{h} \, d\rho : \tilde{h} \leq h \, \rho\text{-a.e.}, \, \tilde{h} \colon \Sigma \to [0,\infty] \text{ measurable}\Bigg\} \end{align*} to be, respectively, the \textbf{upper} and \textbf{lower integral} of $h$ with respect to $\rho$. \end{defi} Of course, if $h$ is $\big(\overline{\mathscr{H}}^{\rho},\mathcal{B}_{[0,\infty]}\big)$-measurable, where $\overline{\mathscr{H}}^{\rho}$ is the $\rho$-completion of $\mathscr{H}$, then $\underline{\int_{\Sigma}} h \, d\rho = \overline{\int_{\Sigma}} h \,d\rho$. Here are the properties of upper and lower integrals relevant to this paper. \begin{prop}[\textbf{Properties of Upper and Lower Integrals}]\label{prop.nonmeasinteg} Let $h,h_1,h_2 \colon \Sigma \to [0,\infty]$ be arbitrary functions and $c \geq 0$. \begin{enumerate}[label=(\roman*),leftmargin=2\parindent] \item $\underline{\int_{\Sigma}} h \, d\rho \leq \overline{\int_{\Sigma}} h \, d\rho$. Also, if $S \in \mathscr{H}$, then $\underline{\int_S}h|_S\,d\rho = \underline{\int_{\Sigma}}1_Sh\,d\rho$ and $\overline{\int_S}h|_S\,d\rho = \overline{\int_{\Sigma}}1_Sh\,d\rho$. \item If $h_1 \leq h_2$ $\rho$-almost everywhere, then $\underline{\int_{\Sigma}} h_1 \, d\rho \leq \underline{\int_{\Sigma}} h_2 \, d\rho$ and $\overline{\int_{\Sigma}} h_1 \, d\rho \leq \overline{\int_{\Sigma}} h_2 \, d\rho$. \item $\overline{\int_{\Sigma}}c\, h \, d\rho = c \overline{\int_{\Sigma}} h \, d\rho$ and $\overline{\int_{\Sigma}} (h_1+h_2) \, d\rho \leq \overline{\int_{\Sigma}} h_1 \, d\rho + \overline{\int_{\Sigma}} h_2 \, d\rho$.\label{item.sublin} \item (\textbf{Dominated Convergence Theorem}) Suppose $(h_n)_{n \in \mathbb{N}}$ is a sequence of functions $\Sigma \to [0,\infty]$ such that $h_n \to 0$ pointwise $\rho$-almost everywhere as $n \to \infty$. If $\overline{\int_{\Sigma}}(\sup_{n \in \mathbb{N}} h_n) \, d\rho < \infty$, then $\underline{\int_{\Sigma}}h_n \, d\rho \to 0$ as $n \to \infty$. \label{item.poorDCT} \item If $(\Sigma_n,\mathscr{H}_n,\rho_n)_{n \in \mathbb{N}}$ is a sequence of measure spaces and \[ (\Sigma,\mathscr{H},\rho) = \Bigg(\coprod_{n \in \mathbb{N}} \Sigma_n,\coprod_{n \in \mathbb{N}} \mathscr{H}_n, \sum_{n =1}^{\infty}\rho_n\Bigg) \] is their disjoint union, then\label{item.disjunupint} \[ \underline{\int_{\Sigma}} h \, d\rho = \sum_{n = 1}^{\infty}\underline{\int_{\Sigma_n}} h|_{\Sigma_n} \, d\rho_n \; \text{ and } \; \overline{\int_{\Sigma}} h \, d\rho = \sum_{n = 1}^{\infty}\overline{\int_{\Sigma_n}} h|_{\Sigma_n} \, d\rho_n. \] \end{enumerate} \end{prop} \begin{proof} The first three items are easy consequences of the definitions. We take the remaining items in turn. \ref{item.poorDCT} By definition of the upper integral, there is some measurable $h \colon \Sigma \to [0,\infty]$ such that $\int_{\Sigma} h \, d\rho < \infty$ and $\sup_{n \in \mathbb{N}}h_n \leq h$ $\rho$-almost everywhere. Now, let $n \in \mathbb{N}$. By definition of the lower integral, there exists a measurable $\tilde{h}_n \colon \Sigma \to [0,\infty]$ such that $0 \leq \tilde{h}_n \leq h_n$ $\rho$-almost everywhere and \[ \underline{\int_{\Sigma}}h_n \, d\rho - \frac{1}{n} < \int_{\Sigma} \tilde{h}_n \, d\rho. \] Since $h_n \to 0$ $\rho$-almost everywhere, and $0 \leq \tilde{h}_n \leq h_n$ $\rho$-almost everywhere, we also have $\tilde{h}_n \to 0$ $\rho$-almost everywhere as $n \to \infty$. Also, $\tilde{h}_n \leq h_n \leq h$ $\rho$-almost everywhere, for all $n \in \mathbb{N}$. Therefore, by the Dominated Convergence Theorem, \[ 0 \leq \liminf_{n \to \infty}\underline{\int_{\Sigma}}h_n \, d\rho \leq \limsup_{n \to \infty}\underline{\int_{\Sigma}}h_n \, d\rho = \limsup_{n \to \infty}\Bigg(\underline{\int_{\Sigma}}h_n \, d\rho - \frac{1}{n}\Bigg) \leq \limsup_{n \to \infty}\int_{\Sigma} \tilde{h}_n \, d\rho = 0, \] as desired. \pagebreak \ref{item.disjunupint} We prove the claimed identity for lower integrals and leave the proof of the identity for upper integrals to the reader. First, the definition of the disjoint union measure space and a standard application of the Monotone Convergence Theorem give the desired identity when $h$ is measurable. Next, let $\tilde{h} \colon \Sigma \to [0,\infty]$ be measurable and $\tilde{h} \leq h$ $\rho$-almost everywhere. Then $\tilde{h}|_{\Sigma_n} \colon \Sigma_n \to [0,\infty]$ is measurable and $\tilde{h}|_{\Sigma_n} \leq h|_{\Sigma_n}$ $\rho_n$-almost everywhere, for all $n \in \mathbb{N}$. Therefore, by definition of the lower integral and our initial observation, \[ \int_{\Sigma} \tilde{h} \, d\rho = \sum_{n = 1}^{\infty}\int_{\Sigma_n} \tilde{h}|_{\Sigma_n} \, d\rho_n \leq \sum_{n = 1}^{\infty}\underline{\int_{\Sigma_n}} h|_{\Sigma_n} \, d\rho_n. \] Taking the supremum over $\tilde{h}$ then yields \[ \underline{\int_{\Sigma}}h \,d\rho \leq \sum_{n = 1}^{\infty}\underline{\int_{\Sigma_n}} h|_{\Sigma_n} \, d\rho_n. \] Finally, let $\textepsilon} > 0$. If $n \in \mathbb{N}$, then by definition of the lower integral, there exists a measurable $\tilde{h}_n \colon \Sigma_n \to [0,\infty]$ such that $\tilde{h}_n \leq h|_{\Sigma_n}$ $\rho_n$-almost everywhere and \[ \underline{\int_{\Sigma_n}} h|_{\Sigma_n} \, d\rho_n \leq \int_{\Sigma_n} \tilde{h}_n \, d\rho_n + \frac{\textepsilon}}{2^n}. \] Letting $\tilde{h} \colon \Sigma \to [0,\infty]$ be the unique measurable function such that $\tilde{h}|_{\Sigma_n} = \tilde{h}_n$, for all $n \in \mathbb{N}$, we have that $\tilde{h} \leq h$ $\rho$-almost everywhere and \[ \sum_{n=1}^{\infty}\underline{\int_{\Sigma_n}} h|_{\Sigma_n} \, d\rho_n \leq \sum_{n=1}^{\infty}\int_{\Sigma_n} \tilde{h}_n \, d\rho_n + \textepsilon} = \int_{\Sigma} \tilde{h} \, d\rho + \textepsilon} \leq \underline{\int_{\Sigma}} h \, d\rho + \textepsilon}. \] Since $\textepsilon} > 0$ was arbitrary, we get that $\sum_{n = 1}^{\infty}\underline{\int_{\Sigma_n}} h|_{\Sigma_n} \, d\rho_n \leq \underline{\int_{\Sigma}}h \,d\rho$ as well. \end{proof} \subsection{Gel'fand-Pettis Integrals}\label{sec.winteg} In this section, we discuss a ``weak" notion of vector-valued integration that -- in the next section -- we shall apply to maps $\Sigma \to V$, where $V \subseteq B(H;K)$ is a linear subspace. \begin{defi}[\textbf{Weak Measurability and Integrability}]\label{def.GPint} Let $V$ be a Hausdorff locally convex topological vector space (HLCTVS) with topological dual $V^*$, and let $f \colon \Sigma \to V$ be a map. We say that $f$ is \textbf{weakly measurable} if it is $(\mathscr{H},\sigma(V^*))$-measurable. We say that $f$ is \textbf{weakly} or \textbf{Gel'fand-Pettis integrable} if it is weakly measurable, $\int_{\Sigma} |\ell \circ f|\,d\rho < \infty$ whenever $\ell \in V^*$, and for every $S \in \mathscr{H}$ there exists (necessarily unique) $\int_S f \, d\rho \in V$ such that \[ \ell \Bigg(\int_S f \, d\rho \Bigg) = \int_S (\ell \circ f) \,d\rho, \numberthis\label{eq.wint} \] for all $\ell \in V^*$. In this case, we call $\int_S f \,d\rho = \int_S f(\sigma) \, \rho(d\sigma) \in V$ the \textbf{weak} or \textbf{Gel'fand-Pettis integral} (over $S$) of $f$ with respect to $\rho$. \end{defi} \begin{rem} The uniqueness of $\int_S f \, d\rho$ is a consequence of the fact that $V^*$ separates points when $V$ is Hausdorff and locally convex, i.e., $\ell(v) = 0$ for all $\ell \in V^*$ implies $v = 0$. \end{rem} By the comments after Notation \ref{nota.sigmaalggen}, $f \colon \Sigma \to V$ is weakly measurable if and only if $\ell \circ f \colon \Sigma \to \mathbb{C}$ is $(\mathscr{H},\mathcal{B}_{\mathbb{C}})$-measurable for all $\ell \in V^*$. \begin{prop}[\textbf{Basic Properties of Weak Integrals}]\label{prop.GelfPetint} Let $V$ and $W$ be HLCTVSs. \begin{enumerate}[label=(\roman*),leftmargin=2\parindent] \item If $f \colon \Sigma \to V$ is weakly integrable and $S \in \mathscr{H}$, then $1_Sf$ is weakly integrable and $\int_{\Sigma} 1_Sf\,d\rho = \int_S f\, d\rho$.\label{item.wintrest} \item If $f,g \colon \Sigma \to V$ are weakly measurable (respectively, integrable) and $c \in \mathbb{C}$, then $f+c\,g$ is weakly measurable (respectively, integrable with $\int_S(f+c\,g)\,d\rho = \int_Sf\,d\rho + c\int_Sg \,d\rho$ whenever $S \in \mathscr{H}$).\label{item.wintlin} \item If $T \colon V \to W$ is linear and continuous and $f \colon \Sigma \to V$ is weakly measurable (respectively, integrable), then $Tf = T(f(\cdot)) \colon \Sigma \to W$ is weakly measurable (respectively, integrable with $T\int_S f \, d\rho = \int_S Tf\,d\rho$ whenever $S \in \mathscr{H}$).\label{item.wintcontlin}\pagebreak \item (\textbf{Triangle Inequality}) If $f \colon \Sigma \to V$ is weakly integrable and $\alpha$ is a continuous seminorm on $V$, then \[ \alpha\Bigg(\int_{\Sigma} f \, d\rho \Bigg) \leq \underline{\int_{\Sigma}} \alpha(f) \,d\rho. \] In particular, if $V$ is normed, then $\big\|\int_{\Sigma} f \,d\rho \big\|_V \leq \underline{\int_{\Sigma}} \|f\|_V \, d\rho$.\label{item.winttriangle} \item (\textbf{Dominated Convergence Theorem}) Suppose $V$ is sequentially complete and $\mathscr{S} \subseteq \mathbb{R}_+^V$ is a collection of seminorms generating the topology of $V$. If $(f_n)_{n \in \mathbb{N}}$ is a sequence of weakly measurable maps $\Sigma \to V$ converging pointwise to $f \colon \Sigma \to V$, then $f$ is weakly measurable. If $f_n \colon \Sigma \to V$ is weakly integrable, for all $n \in \mathbb{N}$, and \[ \overline{\int_{\Sigma}} \sup_{n \in \mathbb{N}}\alpha (f_n) \,d\rho < \infty, \] for all $\alpha \in \mathscr{S}$, then $f$ is weakly integrable and \[ \int_{\Sigma} f_n \, d\rho \to \int_{\Sigma} f \,d\rho \] in $V$ as $n \to \infty$.\label{item.wDCT} \end{enumerate} \end{prop} \begin{proof} The first three items are easy consequences of the definitions and the fact that \eqref{eq.wint} (for all $\ell \in V^*$) uniquely characterizes $\int_S f \,d\rho$. We take the remaining items one at a time. \ref{item.winttriangle} Let $v \coloneqq \int_{\Sigma} f \, d\rho$. By the Hahn-Banach Theorem, there is some linear $\ell \colon V \to \mathbb{C}$ such that $\ell(v) = \alpha(v)$ and $|\ell(w)| \leq \alpha(w)$, for all $w \in V$. Since $\alpha$ is continuous, the latter inequality implies $\ell \in V^*$. Therefore, \[ \alpha\Bigg(\int_{\Sigma} f\,d\rho\Bigg) = \ell\Bigg(\int_{\Sigma}f \,d\rho\Bigg) = \int_{\Sigma} (\ell \circ f) \, d\rho \leq \int_{\Sigma} |\ell \circ f| \, d\rho \leq \underline{\int_{\Sigma}} \alpha(f) \,d\rho \] by definition of the Gel'fand-Pettis and lower integrals. \ref{item.wDCT} The first statement is clear. For the second, let $S \in \mathscr{H}$ and $\alpha \in \mathscr{S}$. Then \[ \alpha\Bigg(\int_S f_n\,d\rho - \int_S f_m \, d\rho\Bigg) = \alpha\Bigg(\int_S(f_n-f_m) \, d\rho\Bigg) \leq \underline{\int_S}\alpha(f_n-f_m)\,d\rho \leq \underline{\int_{\Sigma}}\alpha(f_n-f_m) \,d\rho \to 0 \] as $n,m \to \infty$ by the triangle inequality and Proposition \ref{prop.nonmeasinteg}.\ref{item.poorDCT}, which applies because $\alpha(f_n-f_m) \to 0$ pointwise as $n,m \to \infty$ and \[ \overline{\int_{\Sigma}} \sup_{n,m \in \mathbb{N}}\alpha(f_n-f_m) \,d\rho \leq 2\overline{\int_{\Sigma}}\sup_{n \in \mathbb{N}}\alpha(f_n)\,d\rho < \infty. \] In particular, the sequence $\big(\int_Sf_n\,d\rho\big)_{n \in \mathbb{N}}$ is Cauchy in $V$. Letting $v_S\in V$ be its limit, which exists because $V$ is assumed to be sequentially complete, we claim $v_S = \int_S f \, d\rho$. Indeed, if $\ell \in V^*$, then there exist $\alpha_1,\ldots,\alpha_m \in \mathscr{S}$ and $C \geq 0$ such that $|\ell(v)| \leq C\sum_{j=1}^m\alpha_j(v)$, for all $v \in V$. Therefore, \[ \ell(v_S) = \lim_{n \to \infty}\ell\Bigg(\int_S f_n\,d\rho\Bigg) = \lim_{n \to \infty}\int_S (\ell \circ f_n)\,d\rho = \int_S (\ell \circ f)\,d\rho \] by the standard Dominated Convergence Theorem, which applies because \[ \int_{\Sigma} \sup_{n \in \mathbb{N}}|\ell \circ f_n|\,d\rho \leq C \overline{\int_{\Sigma}}\sum_{j=1}^m\sup_{n \in \mathbb{N}}\alpha_j(f_n) \,d\rho \leq C \sum_{j=1}^m\overline{\int_{\Sigma}}\sup_{n \in \mathbb{N}}\alpha_j(f_n) \,d\rho < \infty. \] Thus $f$ is weakly integrable, and the above shows at least that $\int_S f_n\,d\rho \to \int_S f\,d\rho$ weakly as $n \to \infty$. Finally, whenever $\alpha \in \mathscr{S}$, we have \[ \alpha\Bigg(\int_S f_n\,d\rho - \int_S f \, d\rho\Bigg) = \alpha\Bigg(\int_S(f_n-f) \, d\rho\Bigg) \leq \underline{\int_S}\alpha(f_n-f) \,d\rho \leq \underline{\int_{\Sigma}}\alpha(f_n-f) \,d\rho \to 0 \] as $n \to \infty$ again by the triangle inequality and Proposition \ref{prop.nonmeasinteg}.\ref{item.poorDCT}, which applies because $\alpha(f_n-f) \to 0$ pointwise as $n \to \infty$ and $\sup_{n \in \mathbb{N}}\alpha(f_n-f) \leq 2\sup_{n \in \mathbb{N}}\alpha(f_n)$, which has finite upper integral. \end{proof} \pagebreak \begin{rem}\label{rem.normmeas} If $\alpha \colon V \to \mathbb{R}_+$ is a continuous seminorm, then weak measurability of $f \colon \Sigma \to V$ does not necessarily imply measurability of $\alpha(f) \colon \Sigma \to \mathbb{R}_+$ (even when $\alpha$ is a norm). This is one reason we need upper and lower integrals above. In a certain sense, this is what complicates the study of MOIs -- or, really, vector-valued integrals -- in a general (not-necessarily-separable) setting. \end{rem} Here now are two situations in which the existence of weak integrals is always guaranteed. We prove the following well-known result using arguments from Section II.3 of \cite{diesteluhl}. \begin{prop}[\textbf{Existence of Weak Integrals}]\label{prop.wintext} Let $V$ be a Banach space. \begin{enumerate}[label=(\roman*),leftmargin=2\parindent] \item If $g \colon \Sigma \to V^*$ is such that $g(\cdot)(v) \colon \Sigma \to \mathbb{C}$ is measurable and $\int_{\Sigma} |g(\sigma)(v)|\,\rho(d\sigma) < \infty$, for all $v \in V$, then $g$ is Gel'fand-Pettis integrable in the weak$^*$ topology on $V^*$ and \[ \Bigg\|\int_{\Sigma} g \, d\rho \Bigg\|_{V^*} \leq \underline{\int_{\Sigma}}\|g\|_{V^*}\,d\rho. \] In this case, we say $g$ is \textbf{weak$\boldsymbol{^*}$ integrable} and $\int_{\Sigma} g \,d\rho$ is the \textbf{weak$\boldsymbol{^*}$ integral} of $g$. \label{item.weakstarintexist} \item Suppose $V$ is reflexive. If $f \colon \Sigma \to V$ is weakly measurable and $\int_{\Sigma} |\ell \circ f| \,d \rho < \infty$, for all $\ell \in V^*$, then $f$ is weakly integrable.\label{item.triangleconverse} \end{enumerate} \end{prop} \begin{proof} We take each item in turn. \ref{item.weakstarintexist} First, we recall the evaluation map $V \ni v \mapsto (\ell \mapsto \ell(v)) \in (V^*,\,$weak$^*)^*$ is a linear isomorphism. Therefore, we know $g \colon \Sigma \to V^*$ is weakly measurable in the weak$^*$ topology. Second, define $T \colon V \to L^1(\Sigma,\rho)$ by $v \mapsto g(\cdot)(v)$. Certainly, $T$ is linear. Also, if $(v_n)_{n \in \mathbb{N}} \in V^{\mathbb{N}}$ converges to $v \in V$, then, for all $\sigma \in \Sigma$, \[ (Tv_n)(\sigma) = g(\sigma)(v_n) \to g(\sigma)(v) = (Tv)(\sigma) \] as $n \to \infty$. Therefore, if $(Tv_n)_{n \in \mathbb{N}}$ converges in $L^1(\Sigma,\rho)$, then $Tv_n \to Tv$ in $L^1(\Sigma,\rho)$ as $n \to \infty$. In other words, $T$ is closed. By the Closed Graph Theorem, $T$ is bounded. Finally, let $S \in \mathscr{H}$, and define $I_S \colon V \to \mathbb{C}$ by $v \mapsto \int_S g(\sigma)(v)\,\rho(d\sigma) = \int_S (Tv)(\sigma)\,\rho(d\sigma)$. Then \[ \|I_S\|_{V^*} \leq \|T\|_{V \to L^1} < \infty, \] i.e., $I_S \in V^*$. Unraveling the definitions and using the first sentence of this paragraph again, we conclude that $g$ is Gel'fand-Pettis integrable in the weak$^*$ topology and that $I_S = \int_S g\,d\rho$. For the triangle inequality, we have \begin{align*} \Bigg\|\int_{\Sigma}g\,d\rho \Bigg\|_{V^*} & = \sup\Bigg\{\Bigg|\Bigg(\int_{\Sigma} g\,d\rho \Bigg)(v)\Bigg| : v \in V,\,\|v\|_V \leq 1\Bigg\} = \sup\Bigg\{\Bigg|\int_{\Sigma} g(\sigma)(v)\,\rho(d\sigma)\Bigg| : v \in V, \, \|v\|_V \leq 1\Bigg\} \\ & \leq \sup\Bigg\{\int_{\Sigma} |g(\sigma)(v)|\,\rho(d\sigma) : v \in V, \, \|v\|_V \leq 1\Bigg\} \leq \underline{\int_{\Sigma}} \|g\|_{V^*}\,d\rho \end{align*} by the Hahn-Banach Theorem. \ref{item.triangleconverse} Suppose first that $V$ is a general Banach space, $\ev \colon V \hookrightarrow V^{**}$ is the natural inclusion, and we retain the same assumptions on $f$. Since $((\ev \circ f)(\sigma))(\ell) = (\ell \circ f)(\sigma)$, for all $\ell \in V^*$ and $\sigma \in \Sigma$, the assumptions on $f$ and the previous part imply that $\ev \circ f \colon \Sigma \to V^{**} = (V^*)^*$ is weak$^*$ integrable. (The weak$^*$ integrals of $\ev \circ f$ are called the \textit{Dunford integrals} of $f$.) Now, if $V$ is reflexive and $S \in \mathscr{H}$, then there exists unique $v_S \in V$ such that $\ev(v_S) = \int_S (\ev \circ f)\,d\rho$, where the latter is the weak$^*$ integral of $f$ over $S$. Unraveling the definitions yields that $v_S = \int_S f \, d\rho$ and therefore that $f$ is weakly integrable. \end{proof} We end this section with a characterization of weak measurability and integrability in a Hilbert space, as this will be important for developing the ``operator-valued" case in the following section. \begin{ex}[\textbf{Hilbert Spaces}]\label{ex.wmeasHilb} Let $(H,\langle\cdot,\cdot \rangle_H)$ be a Hilbert space. The Riesz Representation Theorem says that $\ell \in H^*$ if and only if there is some $k \in H$ such that $\ell(h) = \langle h, k \rangle_H$, for all $h \in H$. Therefore, $f \colon \Sigma \to H$ is weakly measurable if and only if $\langle f(\cdot), k \rangle_H \colon \Sigma \to \mathbb{C}$ is $(\mathscr{H},\mathcal{B}_{\mathbb{C}})$-measurable, for all $k \in H$. Also, since $H$ is reflexive, $f \colon \Sigma \to H$ is weakly integrable if and only if $\langle f(\cdot),k \rangle_H \in L^1(\Sigma,\rho)$ for all $k \in H$ (for example, if $f$ is weakly measurable and $\underline{\int_{\Sigma}}\|f\|_H\,d\rho < \infty$) by Proposition \ref{prop.wintext}.\ref{item.triangleconverse}. \end{ex} \subsection{Pointwise Pettis Integrals}\label{sec.pwpetwstarint} At this time, we shall begin to use material -- reviewed in Section \ref{sec.optop} -- about various topologies on spaces of bounded operators. \begin{conv} For the duration of this and the following section, fix complex Hilbert spaces $(H,\langle \cdot,\cdot \rangle_H)$ and $(K,\langle \cdot,\cdot\rangle_K)$. Also, write $\|\cdot\| = \|\cdot\|_{H \to K}$ for the operator norm on $B(H;K)$. \end{conv} In this paper, we shall need to integrate maps $\Sigma \to V$, where $V \subseteq B(H;K)$ is a linear subspace. Given the number of topologies on $B(H;K)$ one might consider, there are possibly many notions of Gel'fand-Pettis integrability of a map $\Sigma \to V$. It turns out that in most reasonable circumstances, the choice of topology (from Section \ref{sec.optop}) does not matter. Indeed, we now introduce a notion of integrability -- \textit{pointwise Pettis integrability} -- in this setting that is, in practice, quite easy to check. Then we describe the relationship between pointwise Pettis integrability and Gel'fand-Pettis integrability in various operator topologies. \begin{lem}\label{lem.pwPetexist} Suppose $F \colon \Sigma \to B(H;K)$ is such that $\langle F(\cdot)h,k\rangle_K \colon \Sigma \to \mathbb{C}$ is $(\mathscr{H},\mathcal{B}_{\mathbb{C}})$-measurable and $\int_{\Sigma}|\langle F(\sigma)h,k \rangle_K| \,\rho(d\sigma) < \infty$, for all $h \in H$ and $k \in K$. Then $F(\cdot)h \colon \Sigma \to K$ is weakly integrable, for all $h \in H$, and the map $\rho_S(F) \colon H \to K$ defined by $h \mapsto \int_S F(\sigma)h\, \rho(d\sigma)$ is linear and bounded, for all $S \in \mathscr{H}$. \end{lem} \begin{proof} Let $h \in H$ and $k \in K$. Then the characterization given in Example \ref{ex.wmeasHilb} implies that $F(\cdot)h \colon \Sigma \to K$ and $F(\cdot)^*k \colon \Sigma \to H$ are both weakly integrable. In particular, if $S \in \mathscr{H}$ and $B_S \colon H \times K \to \mathbb{C}$ is defined by \[ (h,k) \mapsto \int_S \langle F(\sigma)h,k \rangle_K \, \rho(d\sigma), \] then the identities \[ \Bigg\langle \int_S F(\sigma)h \, \rho(d\sigma), k \Bigg\rangle_K = \int_S \langle F(\sigma)h,k\rangle_K \, \rho(d\sigma) = \int_S \langle h,F(\sigma)^*k\rangle_H \, \rho(d\sigma) = \Bigg\langle h,\int_S F(\sigma)^*k \, \rho(d\sigma)\Bigg\rangle_H \] imply that $B_S$ is a sesquilinear map that is bounded in each argument separately. By the Principle of Uniform Boundedness, $B_S$ is bounded. Since $\langle \rho_S(F)h,k \rangle_K = B_S(h,k)$, we get $\rho_S(F) \in B(H;K)$. \end{proof} \begin{defi}[\textbf{Pointwise Pettis Integrability}]\label{def.Pettint} A map $F \colon \Sigma \to B(H;K)$ is called \textbf{pointwise weakly measurable} if $\langle F(\cdot)h,k \rangle_K \colon \Sigma \to \mathbb{C}$ is $(\mathscr{H},\mathcal{B}_{\mathbb{C}})$-measurable, for all $h \in H$ and $k \in K$. If in addition $\int_{\Sigma} |\langle F(\sigma)h,k\rangle_K|\,\rho(d\sigma) < \infty$, for all $h \in H$ and $k \in K$, then we call $F$ \textbf{pointwise Pettis integrable}. In this case, the operator $\rho_S(F) \in B(H;K)$ from Lemma \ref{lem.pwPetexist} is called the \textbf{pointwise Pettis integral} (over $\boldsymbol{S}$) of $F$ with respect to $\rho$. Finally, if in addition $V \subseteq B(H;K)$ is a linear subspace, $F(\Sigma) \subseteq V$, and $\rho_S(F) \in V$ whenever $S \in \mathscr{H}$, then we call $F$ \textbf{pointwise Pettis integrable in $\boldsymbol{V}$}. \end{defi} \begin{rem} The use of the term ``pointwise" is not at all standard; we have chosen it in order to avoid overusing or abusing the terms ``weak" and ``strong." The pointwise Pettis integral above is often called a ``weak integral" in contrast to the ``stronger" Bochner integral. However, we shall see in Theorem \ref{thm.wintBHK} that the notion of pointwise Pettis integrability of $F \colon \Sigma \to B(H;K)$ is precisely the notion of Gel'fand-Pettis integrability of $F$ as a map with values in $(B(H;K),\,$WOT$)$ \textit{or} $(B(H;K),\,$SOT$)$. It is therefore arguably just as appropriate to apply the term ``strong" to the pointwise Pettis integral. \end{rem} \begin{rem}\label{rem.pwPetinM} Note that if $H=K$ and $V = \mathcal{M} \subseteq B(H)$ is a von Neumann algebra, then any pointwise Pettis integrable map $F \colon \Sigma \to \mathcal{M} \subseteq B(H)$ is actually pointwise Pettis integrable in $\mathcal{M}$. Indeed, suppose $a \in \mathcal{M}'$. If $S \in \mathscr{H}$, then it is easy to see from the definition that $a\,\rho_S(F) = \rho_S(a\,F) = \rho_S(F\,a) = \rho_S(F)\,a$, i.e., $\rho_S(F) \in \mathcal{M}'' = \mathcal{M}$ by the Bicommutant Theorem. \end{rem} We now compare the notion of pointwise Pettis integrability to various notions of Gel'fand-Pettis integrability. To this end, we recall (Theorem \ref{thm.optop}.\ref{item.predual}-\ref{item.weakstar}) that if $V \subseteq B(H;K)$ is a $\sigma$-weakly closed linear subspace -- e.g., a von Neumann algebra -- then $V_* \coloneqq (V,\sigma$-WOT$)^*$ is the predual of $V$. More precisely, $V_*$ is a Banach space with the operator norm and the map $V \ni A \mapsto (\ell \mapsto \ell(A)) \in V_*^{\;*}$ is an isometric isomorphism that is also a homeomorphism with respect to the $\sigma$-WOT on $V$ and weak$^*$ topology on $V_*^{\;*}$. \begin{thm}[\textbf{Integrals in $\boldsymbol{V \subseteq B(H;K)}$}]\label{thm.wintBHK} Let $V \subseteq B(H;K)$ be a linear subspace, $F \colon \Sigma \to V$ be a map, and $\mathcal{T} \in \{\mathrm{WOT}, \,\mathrm{SOT}, \,\mathrm{S^*OT}\}$. (To be clear, we consider $\mathcal{T}$ to be a topology on $V$.) \begin{enumerate}[label=(\roman*),leftmargin=2\parindent] \item If \begin{align*} \mathscr{F} & \coloneqq \sigma(\{V \ni A \mapsto \Tr(AB) \in \mathbb{C} : B \in \mathcal{S}_1(K;H)\}) \subseteq 2^V \, \text{ and} \\ \mathscr{G} & \coloneqq \sigma(\{V \ni A \mapsto \langle Ah,k \rangle_K \in \mathbb{C} : h \in H, \, k \in K\}) \subseteq 2^V, \end{align*} then $\mathscr{F} = \mathscr{G} = \sigma\big((V,\,\sigma\text{-}\mathcal{T})^*\big) = \sigma\big((V,\mathcal{T})^*\big)$. In particular, $F \colon \Sigma \to V$ is pointwise weakly measurable if and only if it is weakly measurable in $\mathcal{T}$, if and only if it is weakly measurable in $\sigma$-$\mathcal{T}$.\label{item.wmeaschar} \item $F \colon \Sigma \to V$ is pointwise Pettis integrable in $V$ if and only if it is Gel'fand-Pettis integrable in $\mathcal{T}$, and the pointwise Pettis and Gel'fand-Pettis integrals of $F$ agree in this case. In particular, we may write $\rho_S(F) = \int_S F \, d\rho$, for all $S \in \mathscr{H}$, with no chance of confusion. Also, the triangle inequality \[ \Bigg\|\int_{\Sigma} F \, d\rho \Bigg\| \leq \underline{\int_{\Sigma}} \|F\| \, d\rho \] holds in this case.\label{item.wintchar} \item Suppose $V \subseteq B(H;K)$ is $\sigma$-weakly closed. Then $F \colon \Sigma \to V$ is Gel'fand-Pettis integrable in $\sigma$-$\mathcal{T}$ if and only if it is weak$^*$ integrable under the usual identification $V \cong V_*^{\;*}$, if and only if $F$ is pointwise weakly measurable and \[ \int_{\Sigma}|\langle (F(\sigma)h_n)_{n \in \mathbb{N}},(k_n)_{n \in \mathbb{N}} \rangle_{\ell^2(\mathbb{N};K)}|\,\rho(d\sigma) < \infty \numberthis\label{eq.sigmaWOTint} \] whenever $(h_n)_{n \in \mathbb{N}} \in \ell^2(\mathbb{N};H)$ and $(k_n)_{n \in \mathbb{N}} \in \ell^2(\mathbb{N};K)$. In this case, the Gel'fand-Pettis, weak$^*$, and pointwise Pettis integrals of $F$ all agree.\label{item.wintexist} \item If $H=K$ and $V = \mathcal{M} \subseteq B(H)$ is a von Neumann algebra, then the notions of pointwise weak measurability and Gel'fand-Pettis integrability in $\sigma$-$\mathcal{T}$ are independent of the representation of $\mathcal{M}$. More precisely, if $\mathcal{N}$ is another von Neumann algebra and $\pi \colon \mathcal{M} \to \mathcal{N}$ is a $\ast$-isomorphism in the algebraic sense, then $F$ is pointwise weakly measurable (respectively, Gel'fand-Pettis integrable in $\sigma$-$\mathcal{T}$) if and only if $\pi \circ F$ is pointwise weakly measurable (respectively, Gel'fand-Pettis integrable in $\sigma$-$\mathcal{T}$ with $\int_S (\pi \circ F) \, d\rho = \pi\big(\int_S F \, d\rho\big)$ whenever $S \in \mathscr{H}$).\label{item.indepofrep} \end{enumerate} \end{thm} \begin{proof} We take each item in turn. \ref{item.wmeaschar} By Theorem \ref{thm.optop}.\ref{item.contchar}, \[ (V,\mathcal{T})^* = \spn\{V \ni A \mapsto \langle Ah,k\rangle_K \in \mathbb{C} : h \in H,\, k \in K\}. \numberthis\label{eq.taudual} \] Thus $\mathscr{G} = \sigma\big((V,\mathcal{T})^*\big)$. By Theorem \ref{thm.optop}.\ref{item.sigmacontchar}, $(V,\sigma\text{-}\mathcal{T})^* = (V,\sigma\text{-}\mathrm{WOT})^*$. By the Hahn-Banach Theorem and Theorem \ref{thm.Schatten}.\ref{item.finrk}, we have \[ (V,\sigma\text{-}\mathrm{WOT})^* = \{V \ni A \mapsto \Tr(AB) \in \mathbb{C} : B \in \mathcal{S}_1(K;H)\}. \numberthis\label{eq.sigmataudual} \] Thus $\mathscr{F} = \sigma\big((V,\sigma$-$\mathcal{T})^*\big)$. Since $(V,\mathcal{T})^* \subseteq (V,\sigma$-$\mathcal{T})^*$, we have \[ \mathscr{F} = \sigma\big((V,\sigma\text{-}\mathcal{T})^*\big) \subseteq \sigma\big((V,\mathcal{T})^*\big) = \mathscr{G}. \] It therefore suffices to prove that any element of $(V,\sigma$-$\mathcal{T})^*$ is $\mathscr{G}$-measurable. To this end, let $\ell \in (V,\sigma$-$\mathcal{T})^*$. By Theorem \ref{thm.optop}.\ref{item.sigmacontchar}, there are $(h_n)_{n \in \mathbb{N}} \in \ell^2(\mathbb{N};H)$ and $(k_n)_{n \in \mathbb{N}} \in \ell^2(\mathbb{N};K)$ such that \[ \ell(A) = \langle (Ah_n)_{n \in \mathbb{N}},(k_n)_{n \in \mathbb{N}} \rangle _{\ell^2(\mathbb{N};K)}= \sum_{n=1}^{\infty}\langle Ah_n,k_n\rangle_K, \] for all $A \in V$. This exhibits $\ell$ a pointwise limit of elements of \[ \{V \ni A \mapsto \langle Ah,k \rangle_K \in \mathbb{C} : h \in H, k \in K\}. \] Thus $\ell$ is $\mathscr{G}$-measurable. \pagebreak \ref{item.wintchar} The equivalence of Gel'fand-Pettis integrability in $\mathcal{T}$ and pointwise Pettis integrability in $V$ (with agreement of Gel'fand-Pettis and pointwise Pettis integrals) follows directly from the definitions and \eqref{eq.taudual}. For the triangle inequality, note that if $F \colon \Sigma \to B(H;K)$ is pointwise Pettis integrable and $h \in H$, then the $K$-valued triangle inequality gives \[ \Bigg\|\int_{\Sigma} F(\sigma)h\,\rho(d\sigma)\Bigg\|_K \leq \underline{\int_{\Sigma}}\|F(\sigma)h\|_K\,\rho(d\sigma) \leq \|h\|_H\underline{\int_{\Sigma}}\|F\| \, d\rho. \] Taking the supremum over $h \in H$ with $\|h\|_H \leq 1$ gives the desired result. \ref{item.wintexist} Since $(V,\sigma$-$\mathcal{T})^* = (V,\sigma$-WOT$)^* = V_*$, we may assume $\mathcal{T} = \mathrm{WOT}$. Under the usual identification $V_*^{\;*} \cong V$, the weak$^*$ topology on $V_*^{\;*}$ corresponds to the $\sigma$-WOT on $V$. This implies the first equivalence. By item \ref{item.wmeaschar}, pointwise weak measurability of $F$ is equivalent to weak measurability of $F$ in the $\sigma$-WOT on $V$ and therefore to weak measurability of $F$ in the weak$^*$ topology on $V_*^{\;*}$. By Theorem \ref{thm.optop}.\ref{item.sigmacontchar}, the requirement \eqref{eq.sigmaWOTint} is precisely the requirement that $\int_{\Sigma} |\ell \circ F|\,d\rho < \infty$, for all $\ell \in V_* = (V,\sigma$-WOT$)^*$. Proposition \ref{prop.wintext}.\ref{item.weakstarintexist} and the form of the identification $V \cong V_*^{\;*}$ then give the second equivalence. \ref{item.indepofrep} Again, we may assume $\mathcal{T} = \mathrm{WOT}$. This item follows from the fact that $\ast$-isomorphisms are automatically $\sigma$-WOT-homeomorphisms (Theorem \ref{thm.optop}.\ref{item.starisom}), pointwise weak measurability is equivalent to weak measurability in the $\sigma$-WOT (item \ref{item.wmeaschar}), and Proposition \ref{prop.GelfPetint}.\ref{item.wintcontlin} applied to $\pi$ and $\pi^{-1}$. \end{proof} Let $V \subseteq B(H;K)$ be a $\sigma$-weakly closed linear subspace and $F \colon \Sigma \to V$ be a map. In view of Theorem \ref{thm.wintBHK}.\ref{item.wintexist} and its proof, we have the following. First, weak measurability of $F$ in the $\sigma$-WOT is equivalent to weak measurability of $F$ in the weak$^*$ topology when we identify $V \cong V_*^{\;*}$ in the usual way, which in turn is equivalent to pointwise weak measurability of $F$. We are therefore justified in using the term \textbf{weak$\boldsymbol{^*}$ measurable} in place of pointwise weakly measurable. Second, Gel'fand-Pettis integrability of $F$ in the $\sigma$-WOT is equivalent to weak$^*$ integrability of $F$ when we identify $V \cong V_*^{\;*}$ in the usual way, which in turn is equivalent to weak$^*$ measurability of $F$ and the requirement \eqref{eq.sigmaWOTint}. We are therefore justified in using the term \textbf{weak$\boldsymbol{^*}$ integrable} in place of (any of) the terms in the previous sentence. We end this section by isolating an important takeaway from this possibly confusing development. \begin{cor}[\textbf{Criterion for Weak$\boldsymbol{^*}$ Integrability}]\label{cor.wstarint} Let $V \subseteq B(H;K)$ be a $\sigma$-weakly closed linear subspace and $F \colon \Sigma \to V$ be a map. If $F$ is pointwise weakly measurable and $\underline{\int_{\Sigma}}\|F\|\,d\rho < \infty$, then $F$ is weak$^*$ integrable, and, for $S \in \mathscr{H}$, the weak$^*$ integral $\int_S F \,d\rho \in V$ is uniquely determined by \[ \Bigg\langle \Bigg(\int_S F \,d\rho \Bigg)h,k \Bigg\rangle_K = \int_{\Sigma}\langle F(\sigma)h,k \rangle_K\,\rho(d\sigma), \text{ for all } h \in H \text{ and } k \in K, \] i.e., $\int_S F\,d\rho = \rho_S(F)$. \end{cor} \begin{proof} If $F$ is pointwise weakly measurable, $(h_n)_{n \in \mathbb{N}} \in \ell^2(\mathbb{N};H)$, and $(k_n)_{n \in \mathbb{N}} \in \ell^2(\mathbb{N};K)$, then \begin{align*} \int_{\Sigma}|\langle (F(\sigma)h_n)_{n \in \mathbb{N}},(k_n)_{n \in \mathbb{N}} \rangle _{\ell^2(\mathbb{N};K)}|\,\rho(d\sigma) & \leq \underline{\int_{\Sigma}}\|(F(\sigma)h_n)_{n \in \mathbb{N}}\|_{\ell^2(\mathbb{N};K)}\|(k_n)_{n \in \mathbb{N}}\|_{\ell^2(\mathbb{N};K)}\,\rho(d\sigma) \\ & \leq \|(h_n)_{n \in \mathbb{N}}\|_{\ell^2(\mathbb{N};H)}\|(k_n)_{n \in \mathbb{N}}\|_{\ell^2(\mathbb{N};K)}\underline{\int_{\Sigma}}\|F\|\,d\rho \end{align*} by the Cauchy-Schwarz Inequality. Therefore, if the right hand side is finite, then we conclude from Theorem \ref{thm.wintBHK}.\ref{item.wintexist} that $F$ is weak$^*$ integrable with agreement of weak$^*$ and pointwise Pettis integrals of $F$. \end{proof} \subsection{Minkowski's Inequality for Operator-Valued Integrals}\label{sec.SchattenLpestim} Our last order of business concerning operator-valued integrals is to prove a Schatten $p$-norm Minkowski inequality for pointwise Pettis integrals. This will be absolutely crucial, at least in the case $p=1$, for our development of MOIs. After doing so, we use a similar technique to prove a noncommutative $L^p$-norm Minkowski inequality for weak$^*$ integrals in a semifinite von Neumann algebra. We begin by proving a useful recharacterization of $\|\cdot\|_{\mathcal{S}_1} = \|\cdot\|_{\mathcal{S}_1(H;K)}$. Recall the polar decomposition of $A \in B(H;K)$ is the (unique) product decomposition $A = U|A|$, where $U \in B(H;K)$ is a partial isometry with initial space $(\ker A)^{\perp} = (\ker |A|)^{\perp}$ and final space $\overline{\im A}$. Note in this case that $|A| = U^*A$. \begin{defi}[\textbf{Orthonormal Frames}]\label{def.onframe} For $n \in \mathbb{N}_0$, write \[ O_n(H) \coloneqq \{\boldsymbol{e} = (e_1,\ldots,e_n) \in H^n : e_1,\ldots,e_n \text{ is orthonormal}\} \] for the set of \textbf{orthonormal frames of length} $\boldsymbol{n}$. Note $O_0(H) = \emptyset$. \end{defi} \begin{lem}\label{lem.S1rechar} If $A \in B(H;K)$, then \[ \|A\|_{\mathcal{S}_1} = \sup \Bigg\{ \sum_{j=1}^n |\langle A e_j,f_j \rangle_K| : n \in \mathbb{N}_0, \,\boldsymbol{e} \in O_n(H), \, \boldsymbol{f} \in O_n(K)\Bigg\}, \] where empty sums are zero. In particular, $A \in \mathcal{S}_1(H;K)$ if and only if the right hand side is finite. \end{lem} We note that when $H=K$, this recharacterization is the $p=1$ case of Lemma 2.3.4 in \cite{ringrose}. \begin{proof} Let $A = U|A|$ be the polar decomposition of $A$ and $\mathcal{E}_1$ be an orthonormal basis of $\ker |A| = \ker A$. First, by definition, if $e \in \mathcal{E}_1$, then $|A|e = 0$ and therefore $\langle |A|e,e \rangle_H = 0$. Next, complete $\mathcal{E}_1$ to an orthonormal basis $\mathcal{E} \supseteq \mathcal{E}_1$ of $H$. Then \[ \|A\|_{\mathcal{S}_1} = \sum_{e \in \mathcal{E}} \langle |A|e,e \rangle_H = \sum_{e \in \mathcal{E} \setminus \mathcal{E}_1} \langle |A|e,e\rangle_H = \sum_{e \in \mathcal{E} \setminus \mathcal{E}_1} \langle U^*Ae,e \rangle_H = \sum_{e \in \mathcal{E} \setminus \mathcal{E}_1} \langle Ae,Ue\rangle_K. \] Of course, $\mathcal{E} \setminus \mathcal{E}_1$ is an orthonormal basis of $(\ker |A|)^{\perp}$, the initial space of $U$, on which $U$ is an isometry by definition. Therefore, defining \[ f_e \coloneqq Ue \text{ for } e \in \mathcal{E} \setminus \mathcal{E}_1, \] we see that \[ \langle f_e, f_{\tilde{e}} \rangle_K = \langle Ue,U\tilde{e} \rangle_K = \langle e,\tilde{e} \rangle_H = \delta_{e \tilde{e}} \] whenever $e,\tilde{e} \in \mathcal{E} \setminus \mathcal{E}_1$, i.e., $(f_e)_{e \in \mathcal{E} \setminus \mathcal{E}_1}$ is orthonormal. It follows (by taking finite subsets $E \subseteq \mathcal{E} \setminus \mathcal{E}_1$) that \[ \|A\|_{\mathcal{S}_1} \leq \sup \Bigg\{ \sum_{j=1}^n |\langle A e_j,f_j \rangle_K| : n \in \mathbb{N}_0, \boldsymbol{e} \in O_n(H), \boldsymbol{f} \in O_n(K)\Bigg\}. \] For the other inequality, suppose $\|A\|_{\mathcal{S}_1} < \infty$, and fix $n \in \mathbb{N}$, $\boldsymbol{e} \in O_n(H)$, and $\boldsymbol{f} \in O_n(K)$. Let $V \colon H \to K$ be the unique partial isometry such that $Ve_j = f_j$ for $1 \leq j \leq n$ and $V \equiv 0$ on $(\spn\{e_1,\ldots,e_n\})^{\perp}$. If we complete $\{e_1,\ldots,e_n\}$ to an orthonormal basis $\mathcal{E}$ of $H$, then \[ \sum_{j=1}^n|\langle Ae_j,f_j \rangle_K| = \sum_{j=1}^n|\langle Ae_j,Ve_j \rangle_K | = \sum_{j=1}^n|\langle V^*Ae_j,e_j \rangle_H | \leq \sum_{e \in \mathcal{E}} |\langle V^*Ae,e \rangle_H| \leq \|V^*A\|_{\mathcal{S}_1} \leq \|A\|_{\mathcal{S}_1} \] because $\|V^*\|_{K \to H} = \|V\|_{H \to K} = 1$. Thus \[ \sup \Bigg\{ \sum_{j=1}^n |\langle A e_j,f_j \rangle_K| : n \in \mathbb{N}_0, \, \boldsymbol{e} \in O_n(H), \,\boldsymbol{f} \in O_n(K)\Bigg\} \leq \|A\|_{\mathcal{S}_1}, \] as desired. \end{proof} \begin{thm}[\textbf{Schatten Norm Minkowski Integral Inequality}]\label{thm.Spinteg} Suppose that $F \colon \Sigma \to B(H;K)$ is pointwise Pettis integrable Then \[ \Bigg\|\int_{\Sigma} F \, d \rho \Bigg\|_{\mathcal{S}_p} \leq \underline{\int_{\Sigma}}\|F\|_{\mathcal{S}_p} \, d\rho, \] for all $p \in [1,\infty]$. In particular, if the right hand side is finite, then $\int_{\Sigma} F \,d\rho \in \mathcal{S}_p(H;K)$. \end{thm} \begin{proof} The case $p=\infty$ is contained in Theorem \ref{thm.wintBHK}.\ref{item.wintchar}. We first prove the case $p=1$, from which the rest of the cases will follow. Define \[ A \coloneqq \int_{\Sigma} F \, d\rho \in B(H;K), \] and fix $\boldsymbol{e} = (e_1,\ldots,e_n) \in O_n(H)$ and $\boldsymbol{f} = (f_1,\ldots,f_n) \in O_n(K)$. By definition of the pointwise Pettis integral and Lemma \ref{lem.S1rechar}, we have \begin{align*} \sum_{j=1}^n|\langle Ae_j, f_j \rangle_K| &= \sum_{j=1}^n\Bigg|\int_{\Sigma}\langle F(\sigma)e_j, f_j \rangle_K \, \rho(d\sigma) \Bigg| \leq \int_{\Sigma}\underbrace{\sum_{j=1}^n|\langle F(\sigma)e_j, f_j \rangle_K|}_{\leq \|F(\sigma)\|_{\mathcal{S}_1}}\, \rho(d\sigma) \leq \underline{\int_{\Sigma}} \|F\|_{\mathcal{S}_1} \, d\rho. \end{align*} Taking a supremum over $n \in \mathbb{N}_0$, $\boldsymbol{e}$, and $\boldsymbol{f}$ gives, again by Lemma \ref{lem.S1rechar}, $\|A\|_{\mathcal{S}_1} \leq \underline{\int_{\Sigma}} \|F\|_{\mathcal{S}_1} \, d\rho$. Next, let $p,q \in (1,\infty)$ be such that $\frac{1}{p}+\frac{1}{q}=1$. If $B \in B(K;H)$, then, by what we have just proven and H\"{o}lder's Inequality for the Schatten norms, \[ \|AB\|_{\mathcal{S}_1} = \Bigg\|\int_{\Sigma} F(\sigma)B \, d\rho \Bigg\|_{\mathcal{S}_1} \leq \underline{\int_{\Sigma}} \|F(\sigma)B\|_{\mathcal{S}_1} \, \rho(d\sigma) \leq \|B\|_{\mathcal{S}_q}\underline{\int_{\Sigma}}\|F\|_{\mathcal{S}_p} \, d\rho. \] Therefore, if $\underline{\int_{\Sigma}}\|F\|_{\mathcal{S}_p} \, d\rho < \infty$, then $A \in \mathcal{S}_p(H;K)$ and \[ \Bigg\|\int_{\Sigma} F\,d\rho\Bigg\|_{\mathcal{S}_p} = \|A\|_{\mathcal{S}_p} = \sup\{\underbrace{|\Tr(AB)|}_{\leq \|AB\|_{\mathcal{S}_1}} : B \in B(K;H), \,\|B\|_{\mathcal{S}_q} \leq 1\} \leq \underline{\int_{\Sigma}} \|F\|_{\mathcal{S}_p} \, d \rho \] by duality for the Schatten classes (Theorem \ref{thm.Schatten}.\ref{item.Schattendual}). \end{proof} As we just saw, the case $p=1$ is really the key to Theorem \ref{thm.Spinteg}. Since this case is also the most important for our application of interest, we offer a few more words about it. The proof we have just presented is ``from first principles" in the sense that we did not use any technology from the theory of vector-valued integrals; we only used Lemma \ref{lem.S1rechar} and the definition of the pointwise Pettis integral. There is, however, an interesting alternative proof that uses Proposition \ref{prop.wintext}.\ref{item.weakstarintexist} instead of Lemma \ref{lem.S1rechar}. \begin{proof}[Second proof of Theorem \ref{thm.Spinteg} when $p=1$] Since the conclusion is clear when $\underline{\int_{\Sigma}} \|F\|_{\mathcal{S}_1}\,d\rho = \infty$, we assume $\underline{\int_{\Sigma}} \|F\|_{\mathcal{S}_1}\,d\rho < \infty$. In this case, $\|F\|_{\mathcal{S}_1} < \infty$ almost everywhere (exercise). Since neither $\int_{\Sigma} F \, d\rho$ nor $\underline{\int_{\Sigma}} \|F\|_{\mathcal{S}_1}\,d\rho$ changes if we modify $F$ on a set of measure zero, we may assume $\|F(\sigma)\|_{\mathcal{S}_1} < \infty$, for all $\sigma \in \Sigma$; i.e., $F(\Sigma) \subseteq \mathcal{S}_1(H;K)$. We claim in this case that $F \colon \Sigma \to \mathcal{S}_1(H;K)$ is weak$^*$ integrable when we identify $\mathcal{S}_1(H;K) \cong \mathcal{K}(K;H)^*$ as in Theorem \ref{thm.Schatten}.\ref{item.Schattendual}. Indeed, if $B \colon K \to H$ is a finite-rank linear operator, then $\Tr(F(\cdot)B) \colon \Sigma \to \mathbb{C}$ is measurable by Theorem \ref{thm.wintBHK}.\ref{item.wmeaschar}. Now, if $B \in \mathcal{K}(K;H)$ is arbitrary, then there is a sequence $(B_n)_{n \in \mathbb{N}}$ of finite-rank linear operators $K \to H$ such that $\|B-B_n\|_{K \to H} \to 0$ as $n \to \infty$. If $\sigma \in \Sigma$, then this gives \[ |\Tr(F(\sigma)B) - \Tr(F(\sigma)B_n)| = |\Tr(F(\sigma)(B-B_n))| \leq \|F(\sigma)\|_{\mathcal{S}_1}\|B-B_n\|_{K \to H} \to 0 \] as $n \to \infty$. Thus $\Tr(F(\cdot)B) \colon \Sigma \to \mathbb{C}$ is measurable. Also, \[ \int_{\Sigma}|\Tr(F(\sigma)B)|\,\rho(d\sigma) \leq \underline{\int_{\Sigma}}\|F(\sigma)B\|_{\mathcal{S}_1}\,\rho(d\sigma) \leq \|B\|_{K \to H}\underline{\int_{\Sigma}}\|F\|_{\mathcal{S}_1}\,d\rho < \infty. \] Therefore, by Proposition \ref{prop.wintext}.\ref{item.weakstarintexist}, $F \colon \Sigma \to \mathcal{K}(K;H)^*$ is weak$^*$ integrable and \[ \Bigg\|\int_{\Sigma} F\,d\rho \Bigg\|_{\mathcal{S}_1} = \Bigg\|\int_{\Sigma} F \,d\rho \Bigg\|_{\mathcal{K}(K;H)^*} \leq \underline{\int_{\Sigma}}\|F\|_{\mathcal{K}(K;H)^*}\,d\rho = \underline{\int_{\Sigma}}\|F\|_{\mathcal{S}_1}\,d\rho. \] Modulo the detail, which we leave to the reader, that the weak$^*$ integral of $F$ agrees with its pointwise Pettis integral, this completes the proof. \end{proof} \begin{rem} It is worth mentioning that when $H$ and $K$ are separable, it is possible to prove Theorem \ref{thm.Spinteg} using the basic theory of the Bochner integral because in this case $\mathcal{S}_p(H;K)$ is separable (when $p < \infty$). Since we dealt with the general case, additional care -- in the form of either Lemma \ref{lem.S1rechar} or Proposition \ref{prop.wintext}.\ref{item.weakstarintexist} -- was required. \end{rem} \begin{cor}[\textbf{Schatten Dominated Convergence Theorem}]\label{cor.SchattenDCT} Fix some $p \in [1,\infty]$. Let $(F_n)_{n \in \mathbb{N}}$ be a sequence of pointwise Pettis integrable maps $\Sigma \to B(H;K)$ such that $F_n(\Sigma) \subseteq \mathcal{S}_p(H;K)$, for all $n \in \mathbb{N}$. Suppose $F \colon \Sigma \to \mathcal{S}_p(H;K) \subseteq B(H;K)$ is such that $F_n \to F$ pointwise in $\mathcal{S}_p(H;K)$ as $n \to \infty$. If \[ \overline{\int_{\Sigma}}\sup_{n \in \mathbb{N}}\|F_n\|_{\mathcal{S}_p} \, d\rho < \infty, \numberthis\label{eq.Schattenbounded} \] then $F$ is pointwise Pettis (in fact, weak$^*$) integrable and \[ \int_{\Sigma} F_n \, d\rho \to \int_{\Sigma} F \, d\rho \numberthis\label{eq.Schattenconv} \] in $\mathcal{S}_p(H;K)$ as $n \to \infty$. \end{cor} \begin{proof} By a standard exercise using the Principle of Uniform Boundedness, $(B(H;K),\sigma$-WOT$)$ is sequentially complete. Since $\|\cdot\| \leq \|\cdot\|_{\mathcal{S}_p}$, it follows from Proposition \ref{prop.GelfPetint}.\ref{item.wDCT} (applied to the collection of seminorms from Section \ref{sec.optop} defining the $\sigma$-WOT) that $F \colon \Sigma \to B(H;K)$ is weak$^*$ integrable and the convergence \eqref{eq.Schattenconv} occurs in the $\sigma$-WOT. But if $n \in \mathbb{N}$, then \eqref{eq.Schattenbounded} and Theorem \ref{thm.Spinteg} imply that $\int_{\Sigma} F_n \,d\rho \in \mathcal{S}_p(H;K)$. Finally, \[ \Bigg\|\int_{\Sigma} F_n \, d\rho - \int_{\Sigma}F \, d\rho \Bigg\|_{\mathcal{S}_p} = \Bigg\|\int_{\Sigma} (F_n-F) \,d\rho \Bigg\|_{\mathcal{S}_p} \leq \underline{\int_{\Sigma}} \|F_n-F\|_{\mathcal{S}_p} \, d\rho \to 0 \] as $n \to \infty$ by Theorem \ref{thm.Spinteg} and Proposition \ref{prop.nonmeasinteg}.\ref{item.poorDCT}, which applies because of \eqref{eq.Schattenbounded}. \end{proof} Finally, we generalize Theorem \ref{thm.Spinteg} (with $H=K$) to noncommutative $L^p$-norms of a semifinite von Neumann algebra. (The reader who is uninterested in semifinite von Neumann algebras may skip at this time to Section \ref{sec.MOI}.) For this purpose, we first prove a version of Lemma \ref{lem.S1rechar} appropriate for this setting; this is rather standard, but we supply a transparent proof for the reader's convenience. \begin{lem}\label{lem.L1rechar} Let $(\mathcal{M},\tau)$ be a semifinite von Neumann algebra. If $a \in \mathcal{M}$, then \[ \|a\|_{L^1(\tau)} = \tau(|a|) = \sup\{|\tau(ab)| : b \in \mathcal{L}^1(\tau), \,\|b\| \leq 1\}. \] \end{lem} \begin{proof} Let $a \in \mathcal{M}$. If $b \in \mathcal{L}^1(\tau)$, then, by Theorem \ref{thm.Lp}.\ref{item.tauext}-\ref{item.LpHolder}, \[ |\tau(ab)| \leq \|ab\|_{L^1(\tau)} \leq \|a\|_{L^1(\tau)} \|b\|_{L^{\infty}(\tau)}= \tau(|a|)\,\|b\|. \] Thus $\tau(|a|) \geq \sup\{|\tau(ab)| : b \in \mathcal{L}^1(\tau), \|b\| \leq 1\}$. Now, let $a = u|a|$ be the polar decomposition of $a$. Suppose $p \in \mathcal{M}$ is a $\tau$-finite projection, i.e., $p \in \mathrm{Proj}(\mathcal{M}) \coloneqq \{q \in \mathcal{M} : q^2=q=q^*\}$ and $\tau(p) < \infty$. If $b \coloneqq pu^*$, then $b \in \mathcal{L}^1(\tau)$, $\|b\| \leq 1$, and \[ \tau(ab) = \tau(apu^*) = \tau(u^*ap) = \tau(|a|p) = \tau\big(|a|^{\frac{1}{2}}|a|^{\frac{1}{2}}p\big) = \tau\big(|a|^{\frac{1}{2}}p|a|^{\frac{1}{2}}\big). \] If we can show that the net of $\tau$-finite projections (directed by $\leq$) increases to the identity, then the normality of $\tau$ would give \[ \tau(|a|) = \sup\{\tau\big(|a|^{\frac{1}{2}}p|a|^{\frac{1}{2}}\big) : p \in L^1(\tau) \cap \mathrm{Proj}(\mathcal{M})\}. \] Combining this with the identity above, we would conclude \[ \tau(|a|) \leq \sup\{|\tau(ab)| : b \in \mathcal{L}^1(\tau), \,\|b\| \leq 1\}, \] as desired. To complete the proof, we show $\mathrm{Proj}(L^1(\tau)) \coloneqq L^1(\tau) \cap \mathrm{Proj}(\mathcal{M})$ increases to the identity -- in other words, $\sup \mathrm{Proj}(L^1(\tau)) = 1$. (\textit{A priori}, this supremum is a projection in $\mathcal{M}$ by Proposition 1.1 in Chapter V of \cite{takesaki}.) To this end, suppose $0 \neq q \in \mathrm{Proj}(\mathcal{M})$ is arbitrary. We claim that there exists $0 \neq p \in \mathrm{Proj}(L^1(\tau))$ such that $p \leq q$. Indeed, by faithfulness and semifiniteness of $\tau$, there is some $0 \leq x \in \mathcal{M}$ such that $0 \neq x \leq p$ and $\tau(x) < \infty$. Since $x$ is positive, it is self-adjoint and $\sigma(x) \subseteq [0,\infty)$. Letting $P^x \colon \mathcal{B}_{\sigma(x)} \to \mathcal{M}$ be its projection-valued spectral measure, we have that if $\textepsilon} > 0$ and $G_{\textepsilon}} \coloneqq \sigma(x) \cap [\textepsilon},\infty)$, then \[ \textepsilon}\,P^x(G_{\textepsilon}}) = \int_{\sigma(x)}\textepsilon}\,1_{G_{\textepsilon}}} \,dP^x \leq \int_{\sigma(x)}\lambda\,P^x(d\lambda) = x. \] Since $x \neq 0$ and $x$ is normal, $\sigma(x) \neq \{0\}$. Therefore, there is some $\textepsilon} > 0$ such that $P^x(G_{\textepsilon}}) \neq 0$. For this choice of $\textepsilon}$, let $p \coloneqq P^x(G_{\textepsilon}})$. Then $0 \neq \textepsilon}\,p \leq x$, so that $\tau(p) \leq \textepsilon}^{-1}\tau(x) < \infty$, i.e., $p \in \mathrm{Proj}(L^1(\tau))$. But also, $\textepsilon}\,p \leq x \leq q$. Since $p$ and $q$ are both projections, this implies $p \leq q$. This proves the claim. But now, by definition of $\sup \mathrm{Proj}(L^1(\tau))$, there can be no nonzero $\tau$-finite projection $\leq 1-\sup \mathrm{Proj}(L^1(\tau))$, so $1-\sup \mathrm{Proj}(L^1(\tau)) = 0$ by what we have just proven. \end{proof} \begin{thm}[\textbf{Noncommutative Minkowski Inequality for Integrals}]\label{thm.Lpinteg} Let $(\mathcal{M},\tau)$ be a semifinite von Neumann algebra. If $F \colon \Sigma \to \mathcal{M}$ is weak$^*$ integrable, then \[ \Bigg\|\int_{\Sigma} F \,d\rho \Bigg\|_{L^p(\tau)} \leq \underline{\int_{\Sigma}}\|F\|_{L^p(\tau)}\,d\rho, \] for all $p \in [1,\infty]$. In particular, if the right hand side is finite, then $\int_{\Sigma} F \,d\rho \in \mathcal{L}^p(\tau)$. \end{thm} \begin{proof} Write $a \coloneqq \int_{\Sigma} F \,d\rho$. The case $p=\infty$ is contained in Theorem \ref{thm.wintBHK}.\ref{item.wintchar}. We first prove the case $p=1$, from which the rest of the cases will follow. Let $b \in \mathcal{L}^1(\tau)$. Since the map $\mathcal{M} \ni c \mapsto \tau(cb) \in \mathbb{C}$ is $\sigma$-weakly continuous and $F$ is weak$^*$ integrable (i.e., weakly integrable in the $\sigma$-weak topology), we have \[ \tau(ab) = \int_{\Sigma}\tau(F(\sigma)\,b)\,\rho(d\sigma) \] by definition. Then, by Lemma \ref{lem.L1rechar} (twice), \begin{align*} \|a\|_{L^1(\tau)} & = \sup\Bigg\{|\tau(ab)| = \Bigg|\int_{\Sigma} \tau(F(\sigma)\,b)\,\rho(d\sigma)\Bigg| : b \in \mathcal{L}^1(\tau), \, \|b\| \leq 1\Bigg\} \\ & \leq \sup\Bigg\{\int_{\Sigma}|\tau(F(\sigma)\,b)|\,\rho(d\sigma) : b \in \mathcal{L}^1(\tau), \, \|b\| \leq 1\Bigg\} \leq \underline{\int_{\Sigma}}\|F\|_{L^1(\tau)}\,d\rho, \end{align*} as desired. Now, let $p,q \in (1,\infty)$ be such that $\frac{1}{p}+\frac{1}{q} = 1$. If $b \in \mathcal{L}^q(\tau)$, then, by what we have just proven and Noncommutative H\"{o}lder's Inequality, \[ \Bigg\|\underbrace{\int_{\Sigma} F(\sigma)\,b \, \rho(d\sigma)}_{ab} \Bigg\|_{L^1(\tau)} \leq \underline{\int_{\Sigma}} \|F(\sigma)\,b\|_{L^1(\tau)} \, \rho(d\sigma) \leq \|b\|_{L^q(\tau)}\underline{\int_{\Sigma}}\|F\|_{L^p(\tau)} \, d\rho. \] Therefore, if $\underline{\int_{\Sigma}}\|F\|_{L^p(\tau)} \, d\rho < \infty$, then $\int_{\Sigma} F \, d\rho = a \in \mathcal{L}^p(\tau)$ and \[ \Bigg\|\int_{\Sigma} F \, d\rho\Bigg\|_{L^p(\tau)} = \sup\{\|ab\|_{L^1(\tau)} : b \in \mathcal{M}, \,\|b\|_{L^q(\tau)} \leq 1\} \leq \underline{\int_{\Sigma}} \|F\|_{L^p(\tau)} \, d \rho \] by the dual characterization of the noncommutative $L^p$-norm (Theorem \ref{thm.Lp}.\ref{item.Lpdual}). \end{proof} The motivation for the name is, of course, the classical Minkowski Inequality for Integrals (e.g., 6.19 in \cite{folland}). In view of \ref{prop.GelfPetint}.\ref{item.winttriangle}, it would be just as reasonable to call Theorems \ref{thm.Spinteg} and \ref{thm.Lpinteg}, respectively, the Schatten $p$-norm and noncommutative $L^p$-norm ``(integral) triangle inequalities." \section{Multiple Operator Integrals (MOIs)}\label{sec.MOI} For the duration of Section \ref{sec.MOI}, fix $k \in \mathbb{N}$ and, for each $j \in \{1,\ldots,k+1\}$, a projection-valued measure space $(\Om_j,\mathscr{F}_j,H_j,P_j)$. Also, write \[ (\Om,\mathscr{F},H,P) \coloneqq (\Om_1 \times \cdots \times \Om_{k+1},\mathscr{F}_1 \otimes \cdots \otimes \mathscr{F}_{k+1},H_1 \otimes_2 \cdots \otimes_2 H_{k+1}, P_1 \otimes \cdots \otimes P_{k+1}) \] for their (tensor) product. Please see Theorem \ref{thm.tensprodPVM} for the definition of $P$. \subsection{Integral Projective Tensor Products of \texorpdfstring{$L^{\infty}$}{}-spaces}\label{sec.IPTP} We now discuss integral projective tensor products of $L^{\infty}$-spaces. Formally, the idea is to replace the countable sum in the decomposition \eqref{eq.projdecomp} of elements of the classical projective tensor product with an integral over a $\sigma$-finite measure space. To make this rigorous, we first observe that Minkowski's Inequality for Integrals with $p=\infty$ holds for projection-valued measures. \begin{lem}\label{lem.PVMink} Fix a projectin-valued measure space $(\Xi,\mathscr{G},K,Q)$ and a $\sigma$-finite measure space $(\Sigma,\mathscr{H},\rho)$. If $\Phi \colon \Xi \times \Sigma \to [0,\infty]$ is measurable, then \[ \Bigg\|\int_{\Sigma} \Phi(\cdot,\sigma) \, \rho(d\sigma)\Bigg\|_{L^{\infty}(Q)} \leq \underline{\int_{\Sigma}}\|\Phi(\cdot,\sigma)\|_{L^{\infty}(Q)} \, \rho(d\sigma), \numberthis\label{eq.PVMink} \] i.e., $\int_{\Sigma} \Phi(\xi,\sigma) \, \rho(d\sigma) \leq \underline{\int_{\Sigma}}\|\Phi(\cdot,\sigma)\|_{L^{\infty}(Q)} \, \rho(d\sigma)$ for $Q$-almost every $\xi \in \Xi$. \end{lem} \begin{proof} If $\underline{\int_{\Sigma}}\|\Phi(\cdot,\sigma)\|_{L^{\infty}(Q)} \, \rho(d\sigma) = \infty$, then the conclusion is obvious. We therefore suppose \[ c \coloneqq \underline{\int_{\Sigma}}\|\Phi(\cdot,\sigma)\|_{L^{\infty}(Q)} \, \rho(d\sigma) < \infty. \] Next, note that by (the proof of) Tonelli's Theorem, the function \[ \Xi \ni \xi \mapsto \int_{\Sigma} \Phi(\xi,\sigma) \, \rho(d\sigma) \in [0,\infty] \] is measurable. Thus \[ G \coloneqq \Big\{\xi \in \Xi : \int_{\Sigma} \Phi(\xi,\sigma) \, \rho(d\sigma) > c \Big\} \in \mathscr{G}. \] Now, let $h \in K$. Since $Q_{h,h} = \langle Q(\cdot)h,h \rangle_K$ is a finite measure, the classical Minkowski Inequality for Integrals (e.g., 6.19 in \cite{folland}) gives \[ \Bigg\|\int_{\Sigma} \Phi(\cdot,\sigma) \, \rho(d\sigma) \Bigg\|_{L^{\infty}(Q_{h,h})} \leq \int_{\Sigma}\|\Phi(\cdot,\sigma)\|_{L^{\infty}(Q_{h,h})} \, \rho(d\sigma) \leq \underline{\int_{\Sigma}}\|\Phi(\cdot,\sigma)\|_{L^{\infty}(Q)} \, \rho(d\sigma) = c. \] (Part of what we are using from Minkowski's Inequality for Integrals is that $\sigma \mapsto \|\Phi(\cdot,\sigma)\|_{L^{\infty}(Q_{h,h})}$ is measurable.) In particular, $\langle Q(G)h,h \rangle_K = Q_{h,h}(G) = 0$. Since $h$ was arbitrary, we conclude $Q(G) = 0$. \end{proof} \begin{defi}[\textbf{Integral Projective Tensor Products}]\label{def.IPTPspecial} Let $\varphi \colon \Om \to \mathbb{C}$ be a function. A $\boldsymbol{L_P^{\infty}}$\textbf{-integral projective decomposition} ($L_P^{\infty}$-IPD) of $\varphi$ is a choice $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ of a $\sigma$-finite measure space $(\Sigma,\mathscr{H},\rho)$ and measurable functions $\varphi_1 \colon \Om_1 \times \Sigma \to \mathbb{C},\ldots,\varphi_{k+1} \colon \Om_{k+1} \times \Sigma \to \mathbb{C}$ such that \begin{enumerate}[label=(\alph*),leftmargin=2\parindent] \item $\varphi_j(\cdot,\sigma) \in L^{\infty}(\Om_j,P_j)$, for all $j \in \{1,\ldots,k+1\}$ and $\sigma \in \Sigma$; \label{item.nullset} \item $\overline{\int_{\Sigma}} \,\|\varphi_1(\cdot,\sigma)\|_{L^{\infty}(P_1)} \cdots \|\varphi_{k+1}(\cdot,\sigma)\|_{L^{\infty}(P_{k+1})} \, \rho(d\sigma) < \infty$; and\label{item.upperintegofphis} \item for $P$-almost every $\boldsymbol{\omega} = (\omega_1,\ldots,\omega_{k+1}) \in \Om$, we have\label{item.equality} \[ \varphi(\boldsymbol{\omega}) = \int_{\Sigma} \varphi_1(\omega_1,\sigma) \cdots \varphi_{k+1}(\omega_{k+1},\sigma) \, \rho(d\sigma). \] Note that the integral on the right hand side is defined for $P$-almost every $\boldsymbol{\omega} = (\omega_1,\ldots,\omega_{k+1}) \in \Om$ by Lemma \ref{lem.PVMink} and requirement \ref{item.upperintegofphis}. \end{enumerate} \pagebreak Now, define \begin{align*} \|\varphi\|_{L^{\infty}(P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(P_{k+1})} &\coloneqq \inf\Bigg\{\overline{\int_{\Sigma}} \|\varphi_1(\cdot,\sigma)\|_{L^{\infty}(P_1)} \cdots \|\varphi_{k+1}(\cdot,\sigma)\|_{L^{\infty}(P_{k+1})} \, \rho(d\sigma) : (\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})\\ & \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \text{ is a } L_P^{\infty}\text{-integral projective decomposition of } \varphi\Bigg\}, \end{align*} where $\inf \emptyset \coloneqq \infty$. Noting that $\|\varphi\|_{L^{\infty}(P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(P_{k+1})} = \|\psi\|_{L^{\infty}(P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(P_{k+1})}$ if $\varphi=\psi$ $P$-a.e., so that $\|\cdot\|_{L^{\infty}(P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(P_{k+1})}$ is well-defined on $L^{\infty}(\Om,P)$, we define \[ L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1}) \coloneqq \big\{\varphi \in L^{\infty}(\Om,P) : \|\varphi\|_{L^{\infty}(P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(P_{k+1})} < \infty\big\} \] to be the \textbf{integral projective tensor product (IPTP) of} $\boldsymbol{L^{\infty}(\Om_1,P_1),\ldots,L^{\infty}(\Om_{k+1},P_{k+1})}$. \end{defi} \begin{rem}[\textbf{Measurability Issues}]\label{rem.measissue} The literature is rather cavalier with the definition of the IPTP above. Indeed, if $(\Xi,\mathscr{G},K,Q)$ is a projection-valued measure space, $(\Sigma,\mathscr{H},\rho)$ is a $\sigma$-finite measure space, and $\Phi \colon \Xi \times \Sigma \to \mathbb{C}$ is measurable, then the function $\Sigma \ni \sigma \mapsto \|\Phi(\cdot,\sigma)\|_{L^{\infty}(Q)} \in [0,\infty]$ is \textit{not} necessarily measurable. In particular, it is important to specify in \eqref{eq.PVMink} and \ref{item.upperintegofphis} which integral (upper or lower) is being used. This detail, which is important in arguments to come, has been side-stepped in the existing literature. It is worth discussing ``how non-measurable" $\sigma \mapsto \Phi_Q(\sigma) \coloneqq \|\Phi(\cdot,\sigma)\|_{L^{\infty}(Q)}$ can be in various circumstances. We proceed from least to most pathological. First, if $Q$ is equivalent to a $\sigma$-finite scalar measure -- as is always the case when $K$ is separable -- then $\Phi_Q$ is actually measurable. In the next two examples, suppose $Q(G) = 0 \Leftrightarrow G = \emptyset$. (Please see Example \ref{ex.countingPVM}.) For the second example, suppose $X$ is a complete, separable metric space and $(\Xi,\mathscr{G}) = (X,\mathcal{B}_X)$. Then $\Phi_Q$ is ``almost measurable," i.e., $\Phi_Q$ is measurable with respect to the $\rho$-completion of $\mathscr{H}$. This highly non-obvious fact follows from Corollary 2.13 in \cite{crauel}, which relies on the nontrivial ``Measurable Projection Theorem" (Theorem III.23 in \cite{castaing}). Because in this case $\Phi_Q$ is ``almost measurable," the upper and lower integrals of $\Phi_Q$ agree. This is used implicitly -- and perhaps unknowingly -- in the literature (e.g., \cite{depagtersukochev,azamovetal,doddssub2}) but is never proven or cited as it should be. Third, let $Y \subseteq [0,1]$ be a non-Lebesgue-measurable set, $(\Xi,\mathscr{G}) = (Y,\mathcal{B}_Y)$, and $(\Sigma,\mathscr{H},\rho) = ([0,1],\mathcal{B}_{[0,1]},\,$Lebesgue$)$. If $\Phi \coloneqq 1_{\Delta \cap (Y \times [0,1])}$, where $\Delta \coloneqq \{(x,x) : x \in [0,1]\}$ is the diagonal, then we have $\Phi_Q(\sigma) = \|\Phi(\cdot,\sigma)\|_{\ell^{\infty}(Y)} = 1_Y(\sigma)$, for all $\sigma \in [0,1]$. Thus $\Phi_Q$ is not even Lebesgue measurable in this case. \end{rem} Here are the basic properties of $L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$. Special cases of the following proposition have been stated in the literature (e.g., Lemma 4.6 in \cite{depagtersukochev}), but no proofs are written down. For the sake of completeness -- especially in view of the measurability issues discussed in Remark \ref{rem.measissue} -- we provide a full proof here. In the statement below, a \textbf{Banach $\boldsymbol{\ast}$-algebra} is a unital Banach algebra endowed with an isometric $\ast$-operation. \begin{prop}[\textbf{Basic Properties of IPTPs}]\label{prop.IPTPspecial} If $\varphi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$, then \[ \|\varphi\|_{L^{\infty}(P)} \leq \|\varphi\|_{L^{\infty}(P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(P_{k+1})}. \] Also, $L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1}) \subseteq L^{\infty}(\Om,P)$ is a $\ast$-subalgebra, and \[ \big(L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1}), \|\cdot\|_{L^{\infty}(P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(P_{k+1})}\big) \] is a Banach $\ast$-algebra. \end{prop} \begin{proof} Let $\mathscr{B} \coloneqq L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$ and $\|\cdot\|_{\mathscr{B}} \coloneqq \|\cdot\|_{L^{\infty}(P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(P_{k+1})}$. If $\varphi \in \mathscr{B}$ has $L_P^{\infty}$-IPD $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ and $\Phi(\boldsymbol{\omega},\sigma) \coloneqq \varphi_1(\omega_1,\sigma)\cdots\varphi_{k+1}(\omega_{k+1},\sigma)$, then \[ \|\varphi\|_{L^{\infty}(P)} \leq \Bigg\|\int_{\Sigma}|\Phi(\cdot,\sigma)|\,\rho(d\sigma) \Bigg\|_{L^{\infty}(P)} \leq \underline{\int_{\Sigma}} \|\Phi(\cdot,\sigma)\|_{L^{\infty}(P)} \, \rho(d\sigma) \leq \underline{\int_{\Sigma}} \prod_{j=1}^{k+1}\|\varphi_j(\cdot,\sigma)\|_{L^{\infty}(P_j)} \, \rho(d\sigma) \] by definition of $\Phi$, requirement \ref{item.equality}, and Lemma \ref{lem.PVMink}. Using the fact that $\underline{\int_{\Sigma}} \leq \overline{\int_{\Sigma}}$ and taking the infimum over the decompositions $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ gives the first result. In particular, $\|\varphi\|_{\mathscr{B}} = 0 \Leftrightarrow \varphi \equiv 0$ $P$-a.e. Now, we begin the proof that $\mathscr{B} \subseteq L^{\infty}(\Om,P)$ is a $\ast$-subalgebra and that $(\mathscr{B},\|\cdot\|_{\mathscr{B}})$ is a Banach $\ast$-algebra. First, it is clear from the definition that $\mathscr{B} \subseteq L^{\infty}(\Om,P)$ is closed under scalar multiplication and complex conjugation and that $\|\alpha \varphi\|_{\mathscr{B}} = |\alpha| \, \|\varphi\|_{\mathscr{B}} = |\alpha| \, \|\overline{\varphi}\|_{\mathscr{B}}$, for all $\alpha \in \mathbb{C}$ and $\varphi \in \mathscr{B}$. Second, let $(\varphi_n)_{n \in \mathbb{N}}$ be a sequence in $\mathscr{B}$ such that $\sum_{n=1}^{\infty}\|\varphi_n\|_{\mathscr{B}} < \infty$. Then \[ \sum_{n=1}^{\infty}\|\varphi_n\|_{L^{\infty}(P)} \leq \sum_{n=1}^{\infty}\|\varphi_n\|_{\mathscr{B}} < \infty, \] so that $\varphi \coloneqq \sum_{n=1}^{\infty}\varphi_n$ converges in $L^{\infty}(\Om,P)$. We claim that $\|\varphi\|_{\mathscr{B}} \leq \sum_{n=1}^{\infty}\|\varphi_n\|_{\mathscr{B}}$, from which it follows that $\mathscr{B} \subseteq L^{\infty}(\Om,P)$ is a linear subspace and $(\mathscr{B},\|\cdot\|_{\mathscr{B}})$ is a Banach space. To see this, fix $\textepsilon} > 0$ and $n \in \mathbb{N}$. By definition of $\|\cdot\|_{\mathscr{B}}$, there exists a $L_P^{\infty}$-IPD $(\Sigma_n,\rho_n,\varphi_{1,n},\ldots,\varphi_{k+1,n})$ of $\varphi_n$ such that \[ \overline{\int_{\Sigma_n}}\prod_{j=1}^{k+1} \|\varphi_{j,n}(\cdot,\sigma_n)\|_{L^{\infty}(P_j)} \, \rho_n(d\sigma_n) < \|\varphi_n\|_{\mathscr{B}} + \frac{\textepsilon}}{2^n}. \] This gives \[ \sum_{n=1}^{\infty}\overline{\int_{\Sigma_n}} \prod_{j=1}^{k+1}\|\varphi_{j,n}(\cdot,\sigma_n)\|_{L^{\infty}(P_j)} \, \rho_n(d\sigma_n) \leq \sum_{n=1}^{\infty} \|\varphi_n\|_{\mathscr{B}} + \textepsilon} < \infty. \] If we redefine $(\Sigma,\mathscr{H},\rho)$ to be the disjoint union of the set of measure spaces $\{(\Sigma_n,\mathscr{H}_n,\rho_n) : n \in \mathbb{N}\}$ and \[ \chi_j(\omega_j,\sigma) \coloneqq \varphi_{j,n}(\omega_j,\sigma), \; \omega_j \in \Om_j, \,\sigma \in \Sigma_n \subseteq \coprod_{\ell \in \mathbb{N}} \Sigma_{\ell} = \Sigma, \] for $j \in \{1,\ldots,k+1\}$, then we claim $(\Sigma,\rho,\chi_1,\ldots,\chi_{k+1})$ is a $L_P^{\infty}$-IPD of $\varphi$. Indeed, item \ref{item.nullset} is easy to check. Next, by Proposition \ref{prop.nonmeasinteg}.\ref{item.disjunupint}, \[ \overline{\int_{\Sigma}}\prod_{j=1}^{k+1}\|\chi_j(\cdot,\sigma)\|_{L^{\infty}(P_j)}\,\rho(d\sigma) = \sum_{n=1}^{\infty}\overline{\int_{\Sigma_n}} \prod_{j=1}^{k+1}\|\varphi_{j,n}(\cdot,\sigma_n)\|_{L^{\infty}(P_j)} \, \rho_n(d\sigma_n) < \infty. \] Finally, for $P$-almost every $\boldsymbol{\omega} = (\omega_1,\ldots,\omega_{k+1}) \in \Om$, \[ \int_{\Sigma}\prod_{j=1}^{k+1}\chi_j(\omega_j,\sigma) \, \rho(d\sigma) = \sum_{n=1}^{\infty}\int_{\Sigma_n} \prod_{j=1}^{k+1}\varphi_{j,n}(\omega_j,\sigma_n) \, \rho_n(d\sigma_n) = \sum_{n=1}^{\infty}\varphi_n(\boldsymbol{\omega}) = \varphi(\boldsymbol{\omega}). \] From this, we conclude that $\varphi \in \mathscr{B}$ and \[ \|\varphi\|_{\mathscr{B}} \leq \sum_{n=1}^{\infty}\overline{\int_{\Sigma_n}} \prod_{j=1}^{k+1}\|\varphi_{j,n}(\cdot,\sigma_n)\|_{L^{\infty}(P_j)} \, \rho_n(d\sigma_n) \leq \sum_{n=1}^{\infty} \|\varphi_n\|_{\mathscr{B}} + \textepsilon}. \] Taking $\textepsilon} \searrow 0$ completes the proof of the claim. Third, we show that if $\varphi,\psi \in \mathscr{B}$, then $\|\varphi\psi\|_{\mathscr{B}} \leq \|\varphi\|_{\mathscr{B}}\|\psi\|_{\mathscr{B}}$, which will complete the proof of the proposition. To this end, suppose $(\Sigma_1,\rho_1,\varphi_1,\ldots,\varphi_{k+1})$ and $(\Sigma_2,\rho_2,\psi_1,\ldots,\psi_{k+1})$ are $L_P^{\infty}$-IPDs of $\varphi$ and $\psi$, respectively. Redefine \begin{align*} (\Sigma,\mathscr{H},\rho) & \coloneqq (\Sigma_1\times \Sigma_2,\mathscr{H}_1\otimes \mathscr{H}_2,\rho_1 \otimes \rho_2) \, \text{ and} \\ \chi_j(\omega_j,\sigma) & \coloneqq \varphi_j(\omega_j,\sigma_1) \, \psi_j(\omega_j,\sigma_2), \; (\omega_j,\sigma) = (\omega_j,\sigma_1,\sigma_2) \in \Om_j \times \Sigma, \end{align*} for all $j \in \{1,\ldots,k+1\}$. We claim $(\Sigma,\rho,\chi_1,\ldots,\chi_{k+1})$ is a $L_P^{\infty}$-IPD of (any representative of) $\varphi\psi$. Once again, item \ref{item.nullset} is clear. Now, by Fubini's Theorem and the definition of the upper integral, \begin{align*} \overline{\int_{\Sigma}}\prod_{j=1}^{k+1}\|\chi_j(\cdot,\sigma)\|_{L^{\infty}(P_j)}\, \rho(d\sigma) & \leq \overline{\int_{\Sigma_1}}\prod_{j=1}^{k+1}\|\varphi_j(\cdot,\sigma_1)\|_{L^{\infty}(P_j)} \,\rho_1(d\sigma_1) \overline{\int_{\Sigma_2}}\prod_{j=1}^{k+1}\|\psi_j(\cdot,\sigma_2)\|_{L^{\infty}(P_j)}\, \rho_2(d\sigma_2) < \infty. \end{align*} Finally, for $P$-almost every $\boldsymbol{\omega} = (\omega_1,\ldots,\omega_{k+1}) \in \Om$, we have \[ \varphi(\boldsymbol{\omega})\, \psi(\boldsymbol{\omega}) = \int_{\Sigma_1}\prod_{j=1}^{k+1}\varphi_j(\omega_j,\sigma_1)\, \rho_1(d\sigma_1) \int_{\Sigma_2}\prod_{j=1}^{k+1}\psi_j(\omega_j,\sigma_2) \, \rho_2(d\sigma_2) = \int_{\Sigma}\prod_{j=1}^{k+1}\chi_j(\omega_j,\sigma)\, \rho(d\sigma) \] again by Fubini's Theorem. This proves $\varphi\psi \in \mathscr{B}$ and, after taking infima, $\|\varphi\psi\|_{\mathscr{B}} \leq \|\varphi\|_{\mathscr{B}}\|\psi\|_{\mathscr{B}}$ as well. \end{proof} \pagebreak \begin{ex}[\textbf{$\boldsymbol{\ell^{\infty}}$-IPTPs}]\label{ex.countingPVM} Let $(\Xi,\mathscr{G})$ be a measurable space, and write $\ell^2(\Xi) \coloneqq L^2(\Xi,2^{\Xi},\kappa)$, where $\kappa$ is the counting measure on $\Xi$. For $G \in \mathscr{G}$, let $Q(G) \in B(\ell^2(\Xi))$ be multiplication by $1_G$. Then we call $Q \colon \mathscr{G} \to B(\ell^2(\Xi))$ the \textbf{projection-valued counting measure on} $\boldsymbol{(\Xi,\mathscr{G})}$. Note that $L^{\infty}(\Xi,Q) = \ell^{\infty}(\Xi,\mathscr{G})$ with norm $\|\cdot\|_{L^{\infty}(Q)} = \|\cdot\|_{\ell^{\infty}(\Xi)}$ because $Q(G) = 0$ if and only if $G=\emptyset$. We define \[ \ell^{\infty}(\Om_1,\mathscr{F}_1) \hat{\otimes}_i \cdots \hat{\otimes}_i \ell^{\infty}(\Om_{k+1},\mathscr{F}_{k+1}) \coloneqq L^{\infty}(\Om_1,Q_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},Q_{k+1}), \] where $Q_j$ is the projection-valued counting measure on $(\Om_j,\mathscr{F}_j)$ for $j \in \{1,\ldots,k+1\}$, and \[ \|\cdot\|_{\ell^{\infty}(\Om_1,\mathscr{F}_1) \hat{\otimes}_i \cdots \hat{\otimes}_i \ell^{\infty}(\Om_{k+1},\mathscr{F}_{k+1})} \coloneqq \|\cdot\|_{L^{\infty}(Q_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(Q_{k+1})}. \] It is easy to see that $Q \coloneqq Q_1 \otimes \cdots \otimes Q_{k+1}$ is the projection-valued counting measure on $(\Om,\mathscr{F})$ when we identify $\ell^2(\Om_1) \otimes_2 \cdots \otimes_2 \ell^2(\Om_{k+1}) \cong \ell^2(\Om_1 \times \cdots \times \Om_{k+1}) = \ell^2(\Om)$. Thus \[ \ell^{\infty}(\Om_1,\mathscr{F}_1) \hat{\otimes}_i \cdots \hat{\otimes}_i \ell^{\infty}(\Om_{k+1},\mathscr{F}_{k+1}) \subseteq L^{\infty}(\Om,Q) = \ell^{\infty}(\Om,\mathscr{F}). \] We call this space the \textbf{integral projective tensor product of} $\boldsymbol{\ell^{\infty}(\Om_1,\mathscr{F}_1), \cdots , \ell^{\infty}(\Om_{k+1},\mathscr{F}_{k+1})}$ and refer to $\boldsymbol{\ell^{\infty}}$\textbf{-integral projective decompositions} rather than $L^{\infty}_Q$-integral projective decompositions. \end{ex} Variants of the $\ell^{\infty}$-integral projective tensor product are often used in the literature (e.g., \cite{depagtersukochev,azamovetal,doddssub2}). As the above example shows, $\ell^{\infty}$-integral projective tensor products are special cases of $L^{\infty}$-integral projective tensor products if one allows non-separable Hilbert spaces. \subsection{(Well-)Definition of MOIs}\label{sec.welldef} The goal of this section is to show that if $\varphi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$ and $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ is a $L_P^{\infty}$-IPD of $\varphi$, then \[ \int_{\Sigma} P_1(\varphi_1(\cdot,\sigma)) \, b_1 \cdots P_k(\varphi_k(\cdot,\sigma))\, b_k\,P_{k+1}(\varphi_{k+1}(\cdot,\sigma))\,\rho(d\sigma) \in B(H_{k+1};H_1) \] makes sense as a pointwise Pettis (in fact, weak$^*$) integral that is independent of the chosen decomposition $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ of $\varphi$ whenever $b_j \in B(H_{j+1};H_j)$, for all $j \in \{1,\ldots,k\}$. \begin{defi}[\textbf{Complex Markov Kernel}]\label{def.randcompmeas} Let $(\Xi,\mathscr{G})$ and $(\Sigma,\mathscr{H})$ be measurable spaces. A \textbf{complex Markov kernel} (with source $\Sigma$ and target $\Xi$) is a map $\nu \colon \Sigma \to M(\Xi,\mathscr{G}) = \{$complex measures on $(\Xi,\mathscr{G})\}$ such that the function $\Sigma \ni \sigma \mapsto \nu_{\sigma}(G) \coloneqq \nu(\sigma)(G) \in \mathbb{C}$ is $(\mathscr{H},\mathcal{B}_{\mathbb{C}})$-measurable, for every $G \in \mathscr{G}$. \end{defi} \begin{lem}\label{lem.randcompmeas} Fix measurable spaces $(\Xi,\mathscr{G})$ and $(\Sigma,\mathscr{H})$ and a complex Markov kernel $\nu \colon \Sigma \to M(\Xi,\mathscr{G})$. If $\varphi \colon \Xi \times \Sigma \to \mathbb{C}$ is measurable and $\varphi(\cdot,\sigma) \in L^1(\Xi,|\nu_{\sigma}|)$, for all $\sigma \in \Sigma$, then \[ \Sigma \ni \sigma \mapsto \int_{\Xi}\varphi(\xi,\sigma) \, \nu_{\sigma}(d\xi) \in \mathbb{C} \] is $(\mathscr{H},\mathcal{B}_{\mathbb{C}})$-measurable. \end{lem} \begin{proof}[Sketch] By a truncation argument, it suffices to prove the claim when $\varphi$ is bounded. To this end, let \[ \mathbb{H} \coloneqq \Big\{\varphi \in \ell^{\infty}(\Xi \times \Sigma,\mathscr{G} \otimes \mathscr{H}) : \sigma \mapsto \int_{\Xi} \varphi(\xi,\sigma) \, \nu_{\sigma}(d\xi) \text{ is measurable}\Big\}. \] Clearly, $\mathbb{H}$ is a vector space that is closed under complex conjugation. It is closed under sequential bounded convergence by the Dominated Convergence Theorem. Now, if $G \in \mathscr{G}$ and $S \in \mathscr{H}$, then \[ \int_{\Xi} 1_{G \times S}(\xi,\sigma) \, \nu_{\sigma}(d\xi) = 1_S(\sigma) \, \nu_{\sigma}(G), \] for all $\sigma \in \Sigma$. Thus $1_{G \times S} \in \mathbb{H}$ by definition of a complex Markov kernel. By the Multiplicative System Theorem (in the form of Corollary \ref{cor.MST}), we conclude that $\ell^{\infty}(\Xi \times \Sigma,\mathscr{F} \otimes \mathscr{H}) \subseteq \mathbb{H}$, as desired. \end{proof} \begin{prop}\label{prop.opinteggood} Fix a projection-valued measure space $(\Xi,\mathscr{G},K,Q)$, another complex Hilbert space $(L,\langle \cdot,\cdot\rangle_L)$, a measure space $(\Sigma,\mathscr{H},\rho)$, and a measurable function $\varphi \colon \Xi \times \Sigma \to \mathbb{C}$. If $\varphi(\cdot,\sigma) \in L^{\infty}(\Xi,Q)$, for all $\sigma \in \Sigma$, and $A \colon \Sigma \to B(K;L)$ and $B \colon \Sigma \to B(L;K)$ are pointwise weakly measurable, then the maps \[ \Sigma \ni \sigma \mapsto A(\sigma)\,Q(\varphi(\cdot,\sigma)) \in B(K;L) \; \text{ and } \; \Sigma \ni \sigma \mapsto Q(\varphi(\cdot,\sigma))\,B(\sigma) \in B(L;K) \] are pointwise weakly measurable as well. If in addition \[ \underline{\int_{\Sigma}} \|A(\sigma)\|_{B(K;L)} \|\varphi(\cdot,\sigma)\|_{L^{\infty}(Q)} \, \rho(d\sigma) + \underline{\int_{\Sigma}} \|\varphi(\cdot,\sigma)\|_{L^{\infty}(Q)}\|B(\sigma)\|_{B(L;K)} \, \rho(d\sigma) < \infty, \] then the aforementioned maps are pointwise Pettis (in fact, weak$^*$) integrable. \end{prop} \begin{proof} Fix $\sigma \in \Sigma$, $k \in K$, and $l \in L$. Then \[ \big\langle A(\sigma)\,Q(\varphi(\cdot,\sigma))\,k,l \big\rangle_L = \big\langle Q(\varphi(\cdot,\sigma))\,k,A(\sigma)^*l \big\rangle_K = \int_{\Xi}\varphi(\xi,\sigma) \, Q_{k,A(\sigma)^*l}(d\xi). \] But \[ \nu_{\sigma}^A(G) \coloneqq Q_{k,A(\sigma)^*l}(G) = \langle Q(G)k,A(\sigma)^*l \rangle_K = \langle A(\sigma)Q(G)k,l \rangle_L \] defines a complex Markov kernel $\nu^A \colon \Sigma \to M(\Xi,\mathscr{G})$ by the pointwise weak measurability of $A$. We conclude from Lemma \ref{lem.randcompmeas} that $A(\cdot) \int_{\Xi}\varphi(\xi,\cdot) \, Q(d\xi)$ is pointwise weakly measurable. A similar argument proves that $\int_{\Xi}\varphi(\xi,\cdot) \, Q(d\xi) \, B(\cdot)$ is pointwise weakly measurable. The second part follows from Corollary \ref{cor.wstarint} because \begin{align*} \big\|A(\sigma)\,Q(\varphi(\cdot,\sigma))\big\|_{B(K;L)} & \leq \|A(\sigma)\|_{B(K;L)}\|Q(\varphi(\cdot,\sigma))\|_{B(K)} = \|A(\sigma)\|_{B(K;L)}\|\varphi(\cdot,\sigma)\|_{L^{\infty}(Q)} \, \text{ and}\\ \big\|Q(\varphi(\cdot,\sigma))\, B(\sigma)\big\|_{B(L;K)} & \leq \|Q(\varphi(\cdot,\sigma))\|_{B(K)}\|B(\sigma)\|_{B(L;K)} = \|\varphi(\cdot,\sigma)\|_{L^{\infty}(Q)}\|B(\sigma)\|_{B(L;K)}, \end{align*} for all $\sigma \in \Sigma$. \end{proof} \begin{cor}\label{cor.MOIintgood} Fix $\varphi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$, a $L_P^{\infty}$-IPD $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ of $\varphi$, and $(b_1,\ldots,b_k) \in B(H_2;H_1) \times \cdots \times B(H_{k+1};H_k)$. If \begin{align*} F(\sigma) & \coloneqq P_1(\varphi_1(\cdot,\sigma))\,b_1 \cdots P_k(\varphi_k(\cdot,\sigma)) \, b_k \, P_{k+1}(\varphi_{k+1}(\cdot,\sigma)) \in B(H_{k+1};H_1) \\ & = \int_{\Om_1}\varphi_1(\cdot,\sigma) \, dP_1\, b_1 \cdots \int_{\Om_k}\varphi_k(\cdot,\sigma) \, dP_k \,b_k \int_{\Om_{k+1}}\varphi_{k+1}(\cdot,\sigma)\,dP_{k+1} \end{align*} for $\sigma \in \Sigma$, then $F \colon \Sigma \to B(H_{k+1};H_1)$ is pointwise Pettis (in fact, weak$^*$) integrable and \[ \Bigg\|\int_{\Sigma}F \,d\rho\Bigg\|_{B(H_{k+1};H_1)} \leq \Bigg(\prod_{j=1}^k\|b_j\|_{B(H_{j+1};H_j)}\Bigg)\underline{\int_{\Sigma}}\prod_{m=1}^{k+1}\|\varphi_m(\cdot,\sigma)\|_{L^{\infty}(P_m)}\,\rho(d\sigma). \numberthis\label{eq.firstbound} \] \end{cor} \begin{proof} An inductive application of the first part of Proposition \ref{prop.opinteggood} implies that $F$ is pointwise weakly measurable. The fact that \[ \|F(\sigma)\|_{B(H_{k+1};H_1)} \leq \Bigg(\prod_{j=1}^k\|b_j\|_{B(H_{j+1};H_j)}\Bigg)\prod_{m=1}^{k+1}\|\varphi_m(\cdot,\sigma)\|_{L^{\infty}(P_m)} \] allows us to conclude from Corollary \ref{cor.wstarint} that $F$ is pointwise Pettis (in fact, weak$^*$) integrable. The bound \eqref{eq.firstbound} then follows from the triangle inequality in Theorem \ref{thm.wintBHK}.\ref{item.wintchar}. \end{proof} \begin{nota}[\textbf{MOI, Take I}]\label{nota.MOIdepondecomp} Let $\varphi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$ and $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ be a $L_P^{\infty}$-IPD of $\varphi$. Write $\boldsymbol{P} = (P_1,\ldots,P_{k+1})$ and, for $b = (b_1,\ldots,b_k) \in B(H_2;H_1) \times \cdots \times B(H_{k+1};H_k)$, define \[ I^{\boldsymbol{P}}(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})[b] \coloneqq \int_{\Sigma} P_1(\varphi_1(\cdot,\sigma))\,b_1 \cdots P_k(\varphi_k(\cdot,\sigma)) \, b_k \, P_{k+1}(\varphi_{k+1}(\cdot,\sigma)) \, \rho(d\sigma) \in B(H_{k+1};H_1) \] to be the pointwise Pettis (weak$^*$) integral from Corollary \ref{cor.MOIintgood}. \end{nota} By linearity of the integral and \eqref{eq.firstbound}, the map \[ I^{\boldsymbol{P}}(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1}) \colon B(H_2;H_1) \times \cdots \times B(H_{k+1};H_k) \to B(H_{k+1};H_1) \] is $k$-linear and bounded. Our next -- and most important -- task is to prove this map is ultraweakly continuous in each argument. As described in Section \ref{sec.keying}, this is quite technical when $H_1,\ldots,H_{k+1}$ are not separable. \begin{lem}\label{lem.Pintcont} Suppose that $(\Xi,\mathscr{G},K,Q)$ is a projection-valued measure space. If $(\varphi_n)_{n \in \mathbb{N}} \in L^{\infty}(\Xi,Q)^{\mathbb{N}}$ is such that $\sup_{n \in \mathbb{N}}\|\varphi_n\|_{L^{\infty}(Q)} < \infty$ and $\varphi_n \to \varphi \in L^{\infty}(\Xi,Q)$ pointwise $Q$-almost everywhere as $n \to \infty$, then $Q(\varphi_n) \to Q(\varphi)$ in the S$^*$OT as $n \to \infty$. \end{lem} \begin{proof} Since $Q$ is linear and $Q(\psi)^* = Q(\overline{\psi})$, for all $\psi \in L^{\infty}(\Xi,Q)$, it suffices to assume $\varphi \equiv 0$ and, in this case, to prove $Q(\varphi_n) \to 0$ in the SOT as $n \to \infty$. To this end, let $h \in K$. Then \[ \|Q(\varphi_n)h\|_K^2 = \langle Q(\varphi_n)^*Q(\varphi_n)h,h\rangle_K = \langle Q(|\varphi_n|^2)h,h \rangle_K = \int_{\Xi} |\varphi_n|^2 \, dQ_{h,h} \to 0 \] as $n \to \infty$ by the Dominated Convergence Theorem. \end{proof} \begin{lem}\label{lem.SOTS1} Let $K$ and $L$ be Hilbert spaces, $(Q_n)_{n \in \mathbb{N}} \in B(K;L)^{\mathbb{N}}$, $Q \in B(K;L)$, and $C \in \mathcal{S}_1(L;K)$. If $Q_n \to Q$ in the SOT, then $Q_nC \to QC$ in $\mathcal{S}_1(L)$ as $n \to \infty$. If $Q_n^* \to Q^*$ in the SOT, then $CQ_n \to CQ$ in $\mathcal{S}_1(K)$ as $n \to \infty$. In particular, if $Q_n \to Q$ in the S$^*$OT, then $Q_nC \to QC$ in $\mathcal{S}_1(L)$ and $CQ_n \to CQ$ in $\mathcal{S}_1(K)$ as $n \to \infty$. \end{lem} \begin{proof} Without loss of generality, we can take $Q=0$. Assume $Q_n \to 0$ in the SOT as $n \to \infty$, and let $D \in \mathcal{S}_2(L;K)$ and $\mathcal{E} \subseteq L$ be an orthonormal basis. Then $\|Q_nD\|_{\mathcal{S}_2}^2 = \sum_{e \in \mathcal{E}} \|Q_nDe\|_L^2 \to 0$ as $n \to \infty$ by the Dominated Convergence Theorem. More explicitly, $\|Q_nDe\|_L \to 0$ as $n \to \infty$, for all $e \in \mathcal{E}$; and $\|Q_nDe\|_L^2 \leq \|De\|_K^2 \sup_{j \in \mathbb{N}} \|Q_j\|_{B(K;L)}^2 \in L^1(\mathcal{E},$ counting$)$ because $D \in \mathcal{S}_2(L;K)$. Next, assume $Q_n^* \to 0$ in the SOT as $n \to \infty$. Then $\|DQ_n\|_{\mathcal{S}_2} = \|Q_n^*D^*\|_{\mathcal{S}_2} \to 0$ as $n \to \infty$ by the previous argument because $D^* \in \mathcal{S}_2(K;L)$. Finally, let $C = U|C|$ be the polar decomposition of $C \in \mathcal{S}_1(L;K)$. Then $|C|^{\frac{1}{2}} \in \mathcal{S}_2(L)$ and $U|C|^{\frac{1}{2}} \in \mathcal{S}_2(L;K)$, so \begin{align*} \|Q_nC\|_{\mathcal{S}_1} & = \big\|Q_nU|C|^{\frac{1}{2}}|C|^{\frac{1}{2}}\big\|_{\mathcal{S}_1} \leq \big\|Q_nU|C|^{\frac{1}{2}}\big\|_{\mathcal{S}_2}\big\||C|^{\frac{1}{2}}\big\|_{\mathcal{S}_2} \to 0 \, \text{ or} \\ \|CQ_n\|_{\mathcal{S}_1} & = \big\|U|C|^{\frac{1}{2}}|C|^{\frac{1}{2}}Q_n\big\|_{\mathcal{S}_1} \leq \big\|U|C|^{\frac{1}{2}}\big\|_{\mathcal{S}_2} \big\||C|^{\frac{1}{2}}Q_n\big\|_{\mathcal{S}_2} \to 0 \end{align*} if $Q_n \to 0$ or $Q_n^* \to 0$ in the SOT as $n \to \infty$, respectively, by H\"{o}lder's Inequality for the Schatten norms and what we just proved. \end{proof} We are now finally prepared to prove Theorem \ref{thm.traceofinteg}. \begin{proof}[Proof of Theorem \ref{thm.traceofinteg}] The first conclusion is clear from Proposition \ref{prop.opinteggood} (to see that $A(\cdot)\,\int_{\Xi} \varphi(\xi,\cdot)\,Q(d\xi)$ and $\int_{\Xi} \varphi(\xi,\cdot)\,Q(d\xi)\,A(\cdot)$ are pointwise Pettis integrable) and Theorem \ref{thm.Spinteg} (to see that their pointwise Pettis integrals belong to $\mathcal{S}_1(K)$). For the second, we use the Multiplicative System Theorem. Let \[ \mathbb{H} \coloneqq \{\varphi \in \ell^{\infty}(\Xi \times \Sigma, \mathscr{G} \otimes \mathscr{H}) : \eqref{eq.traceofinteg} \text{ holds for } A \text{ and } A^*\}. \] (Note $A^*$ and $A$ satisfy the same hypotheses.) Clearly $\mathbb{H}$ is a vector space. To show $\mathbb{H}$ is closed under complex conjugation, note that if $\varphi \in \mathbb{H}$ and $B \in \{A,A^*\}$, then \begin{align*} \Tr\Bigg(\int_{\Sigma} B(\sigma) \, Q\Big(\overline{\varphi(\cdot,\sigma)}\Big) \,\rho(d\sigma)\Bigg) & = \Tr\Bigg(\int_{\Sigma} B(\sigma) \, Q(\varphi(\cdot,\sigma))^* \,\rho(d\sigma)\Bigg) = \Tr\Bigg(\Bigg(\int_{\Sigma} Q(\varphi(\cdot,\sigma)) \, B(\sigma)^* \,\rho(d\sigma)\Bigg)^*\Bigg)\\ & = \overline{\Tr\Bigg(\int_{\Sigma} Q(\varphi(\cdot,\sigma)) \, B(\sigma)^* \,\rho(d\sigma)\Bigg)} = \overline{\Tr\Bigg(\int_{\Sigma} B(\sigma)^* \, Q(\varphi(\cdot,\sigma)) \, \rho(d\sigma)\Bigg)} \\ & = \Tr\Bigg(\Bigg(\int_{\Sigma} B(\sigma)^* \, Q(\varphi(\cdot,\sigma)) \, \rho(d\sigma)\Bigg)^*\Bigg) = \Tr\Bigg(\int_{\Sigma} Q(\varphi(\cdot,\sigma))^* \, B(\sigma) \, \rho(d\sigma)\Bigg)\\ & = \Tr\Bigg(\int_{\Sigma} Q\Big(\overline{\varphi(\cdot,\sigma)}\Big)\,B(\sigma)\,\rho(d\sigma) \Bigg). \end{align*} Therefore, $\overline{\varphi} \in \mathbb{H}$. \pagebreak Next, we show $\mathbb{H}$ is closed under sequential bounded convergence. Suppose $(\varphi_n)_{n \in \mathbb{N}} \in \mathbb{H}^{\mathbb{N}}$ converges boundedly to $\varphi \in \ell^{\infty}(\Xi \times \Sigma, \mathscr{F} \otimes \mathscr{H})$. We claim that \begin{align*} & \int_{\Sigma} B(\sigma) \, Q(\varphi_n(\cdot,\sigma)) \,\rho(d\sigma) \to \int_{\Sigma} B(\sigma) \, Q(\varphi(\cdot,\sigma)) \,\rho(d\sigma) \, \text{ and}\\ & \int_{\Sigma} Q(\varphi_n(\cdot,\sigma)) \, B(\sigma) \,\rho(d\sigma) \to \int_{\Sigma} Q(\varphi(\cdot,\sigma)) \, B(\sigma) \,\rho(d\sigma) \end{align*} in $\mathcal{S}_1(K)$ as $n \to \infty$ for $B \in \{A,A^*\}$. Indeed, let $\sigma \in \Sigma$. By Lemma \ref{lem.Pintcont}, $Q(\varphi_n(\cdot,\sigma)) \to Q(\varphi(\cdot,\sigma))$ in the S$^*$OT as $n \to \infty$. By Lemma \ref{lem.SOTS1}, \begin{align*} & B(\sigma) \,Q(\varphi_n(\cdot,\sigma)) \to B(\sigma) \,Q(\varphi(\cdot,\sigma)) \; \text{ and } \; Q(\varphi_n(\cdot,\sigma)) \, B(\sigma) \to Q(\varphi(\cdot,\sigma)) \, B(\sigma) \end{align*} in $\mathcal{S}_1(K)$ as $n \to \infty$. Finally, note that \[ \overline{\int_{\Sigma}}\sup_{n \in \mathbb{N}}\big\|B(\sigma) \,Q(\varphi_n(\cdot,\sigma)) \big\|_{\mathcal{S}_1}\,\rho(d\sigma)+\overline{\int_{\Sigma}}\sup_{n \in \mathbb{N}}\big\| Q(\varphi_n(\cdot,\sigma)) \,B(\sigma)\big\|_{\mathcal{S}_1} \,\rho(d\sigma) \] is bounded above by $2\rho(\Sigma)\sup_{\sigma \in \Sigma}\|B(\sigma)\|_{\mathcal{S}_1}\,\sup_{n \in \mathbb{N}}\|\varphi_n\|_{\ell^{\infty}(\Xi \times \Sigma)} < \infty$. The claim then follows from Corollary \ref{cor.SchattenDCT}. This establishes \eqref{eq.traceofinteg} for $\varphi$ and $B$ by allowing us to take $n \to \infty$ in \eqref{eq.traceofinteg} for $\varphi_n$ and $B$. Thus $\varphi \in \mathbb{H}$, as desired. Finally, if $G \in \mathscr{G}$, $S \in \mathscr{H}$, $\varphi \coloneqq 1_{G \times S}$, and $B \in \{A,A^*\}$, then \begin{align*} \Tr\Bigg(\int_{\Sigma} B(\sigma)\, Q(\varphi(\cdot,\sigma))\,\rho(d\sigma)\Bigg) & = \Tr\Bigg(\int_{\Sigma} B(\sigma) \,1_S(\sigma) \,Q(G) \,\rho(d\sigma)\Bigg) = \Tr\Bigg(\int_{\Sigma} 1_S(\sigma) \,B(\sigma) \, \rho(d\sigma) \,Q(G) \Bigg) \\ & = \Tr\Bigg(Q(G)\int_{\Sigma} 1_S(\sigma) \,B(\sigma) \, \rho(d\sigma) \Bigg) = \Tr\Bigg(\int_{\Sigma} Q(G)\,1_S(\sigma) \,B(\sigma) \, \rho(d\sigma) \Bigg) \\ & = \Tr\Bigg( \int_{\Sigma} Q(\varphi(\cdot,\sigma)) \,B(\sigma) \,\rho(d\sigma)\Bigg) \end{align*} by Theorem \ref{thm.Schatten}.\ref{item.Trflip}. Thus $\varphi \in \mathbb{H}$. We conclude from the Multiplicative System Theorem (Corollary \ref{cor.MST}) that $\ell^{\infty}(\Xi \times \Sigma, \mathscr{F} \otimes \mathscr{H}) \subseteq \mathbb{H}$, as desired. \end{proof} \begin{rem}\label{rem.easyTrsep} There is an easy argument available when $K$ is separable. Indeed, since any orthonormal basis is countable, one can show that if $(\Sigma,\mathscr{H},\rho)$ is any measure space and $A \colon \Sigma \to \mathcal{S}_1(K) \subseteq B(K)$ is pointwise weakly measurable with $\underline{\int_{\Sigma}} \|A(\sigma)\|_{\mathcal{S}_1}\,d\rho < \infty$, then $\Tr\big(\int_{\Sigma}A(\sigma) \, \rho(d\sigma)\big) = \int_{\Sigma}\Tr(A(\sigma)) \, \rho(d\sigma)$. The result (actually, a more general result) therefore follows from pointwise application of Theorem \ref{thm.Schatten}.\ref{item.Trflip}. \end{rem} \begin{thm}\label{thm.S1integrability} Fix $\varphi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$, a $L_P^{\infty}$-integral projective decomposition $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ of $\varphi$, and \[ b = (b_1,\ldots,b_k) \in B(H_2;H_1) \times \cdots \times B(H_{k+1};H_k). \] If $b_j \in \mathcal{S}_1(H_{j+1};H_j)$ for some $j \in \{1,\ldots,k\}$, then \[ \Sigma \ni \sigma \mapsto P_1(\varphi_1(\cdot,\sigma))\,b_1\cdots P_k(\varphi_k(\cdot,\sigma))\,b_k\,P_{k+1}(\varphi_{k+1}(\cdot,\sigma)) \in \mathcal{S}_1(H_{k+1};H_1) \] is Gel'fand-Pettis integrable as a map $\Sigma \to (\mathcal{S}_1(H_{k+1};H_1),\|\cdot\|_{\mathcal{S}_1})$, and its Gel'fand-Pettis integral (over $\Sigma$) is $I^{\boldsymbol{P}}(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})[b] \in \mathcal{S}_1(H_{k+1};H_1)$. \end{thm} \begin{proof} First, notice that $I^{\boldsymbol{P}}(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})[b] \in \mathcal{S}_1(H_{k+1};H_1)$ by Theorem \ref{thm.Spinteg}. Now, for $\sigma \in \Sigma$, write \[ F(\sigma) \coloneqq P_1(\varphi_1(\cdot,\sigma))\,b_1\cdots P_k(\varphi_k(\cdot,\sigma))\,b_k\,P_{k+1}(\varphi_{k+1}(\cdot,\sigma)) \in \mathcal{S}_1(H_{k+1};H_1). \] By definition of the Gel'fand-Pettis integral and the identification (Theorem \ref{thm.Schatten}.\ref{item.Schattendual}) of $B(H_1;H_{k+1})$ as $\mathcal{S}_1(H_{k+1};H_1)^*$, we must show that if $b_{k+1} \in B(H_1;H_{k+1})$, then \begin{enumerate}[label=\arabic*., leftmargin=2\parindent] \item $\Sigma \ni \sigma \mapsto \Tr(F(\sigma)\,b_{k+1}) \in \mathbb{C}$ is measurable,\label{item.Trmeas} \item $\int_{\Sigma}|\Tr(F(\sigma)\,b_{k+1})|\,\rho(d\sigma) < \infty$, and\label{item.Trint} \item $\Tr\big(I^{\boldsymbol{P}}(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})[b]\,b_{k+1}\big) = \int_{\Sigma} \Tr(F(\sigma)\,b_{k+1})\,\rho(d\sigma)$.\label{item.Trwint} \end{enumerate} This suffices because if $S \in \mathscr{H}$, then we can apply the above to $(S,\rho|_S,\varphi_1|_{\Om_1 \times S},\ldots,\varphi_{k+1}|_{\Om_{k+1} \times S})$ to conclude that the $\mathcal{S}_1$-weak integral over $S$ of $F$ is $I^{\boldsymbol{P}}(S,\rho|_S,\varphi_1|_{\Om_1 \times S},\ldots,\varphi_{k+1}|_{\Om_{k+1} \times S})[b]$. We take each item in turn. \ref{item.Trmeas} If $\sigma \in \Sigma$, then \begin{align*} \Tr(F(\sigma)\,b_{k+1}) & = \Tr(P_1(\varphi_1(\cdot,\sigma))\,b_1\cdots P_k(\varphi_k(\cdot,\sigma))\,b_k\,P_{k+1}(\varphi_{k+1}(\cdot,\sigma))\,b_{k+1}) \\ & = \Tr(\underbrace{P_{j+1}(\varphi_{j+1}(\cdot,\sigma))\,b_{j+1}\cdots P_{k+1}(\varphi_{k+1}(\cdot,\sigma))\,b_{k+1}\,P_1(\varphi_1(\cdot,\sigma))b_1\cdots P_j(\varphi_j(\cdot,\sigma))}_{\coloneqq F_j(\sigma)}\,b_j) \end{align*} by Theorem \ref{thm.Schatten}.\ref{item.Trflip}. But $F_j \colon \Sigma \to B(H_{j+1};H_j)$ is pointwise Pettis integrable by Corollary \ref{cor.MOIintgood}, and $b_j \in \mathcal{S}_1(H_{j+1};H_j)$. Thus $\Tr(F(\cdot)\,b_{k+1}) = \Tr(F_j(\cdot)\,b_j)$ is measurable by Theorem \ref{thm.wintBHK}.\ref{item.wmeaschar}. \ref{item.Trint} We have \begin{align*} \int_{\Sigma} |\Tr(F(\sigma)\,b_{k+1})|\,\rho(d\sigma) & \leq \underline{\int_{\Sigma}} \|F(\sigma)\,b_{k+1}\|_{\mathcal{S}_1}\,\rho(d\sigma) \leq \|b_{k+1}\|\underline{\int_{\Sigma}} \|F\|_{\mathcal{S}_1}\,d\rho \\ & \leq \|b_j\|_{\mathcal{S}_1}\prod_{p \neq j}\|b_p\| \underline{\int_{\Sigma}}\prod_{j_0=1}^{k+1} \|\varphi_{j_0}(\cdot,\sigma)\|_{L^{\infty}(P_{j_0})}\,\rho(d\sigma) < \infty, \end{align*} as desired. (Note that we have been sloppy with our notation for different operator norms above.) \ref{item.Trwint} This step is the most involved; we reduce it to the result of Theorem \ref{thm.traceofinteg}. First, let $(\Sigma_n)_{n \in \mathbb{N}} \in \mathscr{H}^{\mathbb{N}}$ be a disjoint sequence of sets of finite $\rho$-measure. Then \[ \int_{\Sigma} \Tr(F(\sigma)\,b_{k+1})\,\rho(d\sigma) = \sum_{n=1}^{\infty}\int_{\Sigma_n} \Tr(F(\sigma)\,b_{k+1})\,\rho(d\sigma) \] by the previous step. Now, if $F_0 \colon \Sigma \to B(H_{k+1};H_1)$ is pointwise Pettis integrable, then \[ \int_{\Sigma} F_0 \, d\rho = \text{WOT-}\sum_{n=1}^{\infty}\int_{\Sigma_n}F_0 \, d\rho \; \text{ and } \; \sum_{n=1}^{\infty} \Bigg\|\int_{\Sigma_n}F_0 \, d\rho\Bigg\|_{\mathcal{S}_1} \leq \sum_{n=1}^{\infty} \underline{\int_{\Sigma_n}} \|F_0\|_{\mathcal{S}_1} \, d\rho = \underline{\int_{\Sigma}}\|F_0\|_{\mathcal{S}_1}\,d\rho \] by definition of the pointwise Pettis integral, Theorem \ref{thm.Spinteg}, and Proposition \ref{prop.nonmeasinteg}.\ref{item.disjunupint}. This implies \[ \Tr\big(I^{\boldsymbol{P}}(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})[b]\,b_{k+1}\big) = \sum_{n=1}^{\infty} \Tr\big(I^{\boldsymbol{P}}(\Sigma_n,\rho|_{\Sigma_n},\varphi_1|_{\Om_1 \times \Sigma_n},\ldots,\varphi_{k+1}|_{\Om_{k+1} \times \Sigma_n})[b]\,b_{k+1}\big). \] It therefore suffices to assume $\rho(\Sigma) < \infty$. Second, let $m \in \{1,\ldots,k+1\}$, $n \in \mathbb{N}$, \[ \varphi_{m,n} \coloneqq \varphi_m \,1_{\{(\omega_m,\sigma)\in\Om_m \times \Sigma : |\varphi_m(\omega_m,\sigma)| \leq n\}}, \] and $\sigma \in \Sigma$. Then $\varphi_{m,n}$ is bounded, $\varphi_{m,n}(\cdot,\sigma) \to \varphi_m(\cdot,\sigma)$ $P_m$-almost everywhere as $n \to \infty$, and \[ \sup_{n \in \mathbb{N}}\|\varphi_{m,n}(\cdot,\sigma)\|_{L^{\infty}(P_m)} \leq \|\varphi_m(\cdot,\sigma)\|_{L^{\infty}(P_m)} < \infty. \] Thus $P_m(\varphi_{m,n}(\cdot,\sigma)) \to P_m(\varphi_m(\cdot,\sigma))$ in the S$^*$OT as $n \to \infty$ by Lemma \ref{lem.Pintcont}. Now, let \begin{align*} & (\psi_{1,n},\ldots,\psi_{k+1,n}) \coloneqq (\varphi_1,\ldots,\varphi_{m-1},\varphi_{m,n},\varphi_{m+1},\ldots,\varphi_{k+1}) \, \text{ and} \\ & F_{m,n}(\sigma) \coloneqq P_1(\psi_{1,n}(\cdot,\sigma))\,b_1\cdots P_k(\psi_{k,n}(\cdot,\sigma))\,b_k\,P_{k+1}(\psi_{k+1,n}(\cdot,\sigma)) \in B(H_{k+1};H_k) \end{align*} Since $b_j \in \mathcal{S}_1(H_{j+1};H_j)$, Lemma \ref{lem.SOTS1} gives that $F_{m,n}(\sigma) \to F(\sigma)$ in $\mathcal{S}_1(H_{k+1};H_1)$ as $n \to \infty$. But \[ \overline{\int_{\Sigma}}\sup_{n \in \mathbb{N}}\|F_{m,n}\|_{\mathcal{S}_1}\,d\rho \leq \|b_j\|_{\mathcal{S}_1}\prod_{p \not\in\{j,k+1\}}\|b_p\|\overline{\int_{\Sigma}}\prod_{j_0=1}^{k+1}\|\varphi_{j_0}(\cdot,\sigma)\|_{L^{\infty}(P_{j_0})}\,\rho(d\sigma) < \infty.\pagebreak \] Therefore, by Corollary \ref{cor.SchattenDCT}, \[ I^{\boldsymbol{P}}(\Sigma,\rho,\psi_{1,n},\ldots,\psi_{k+1,n})[b] = \int_{\Sigma} F_{m,n}\,d\rho \to \int_{\Sigma} F\,d\rho = I^{\boldsymbol{P}}(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})[b] \numberthis\label{eq.DCTapp} \] in $\mathcal{S}_1(H_{k+1};H_1)$ as $n \to \infty$, and, by the Dominated Convergence Theorem, \[ \int_{\Sigma} \Tr(F_{m,n}(\sigma)\,b_{k+1})\,\rho(d\sigma) \to \int_{\Sigma}\Tr(F(\sigma)\,b_{k+1})\,\rho(d\sigma) \] as $n \to \infty$. It therefore suffices to assume $\varphi_m$ is bounded. Finally, assume $\rho(\Sigma) < \infty$ and $\varphi_1,\ldots,\varphi_{k+1}$ are all bounded. Also, retain the definition of the map $F_j \colon \Sigma \to B(H_{j+1};H_j)$ from the first step of the proof. Then \begin{align*} \Tr\big(I^{\boldsymbol{P}}(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})[b]\, b_{k+1}\big) & = \Tr\Bigg(\int_{\Sigma}\prod_{j_0=1}^{k+1}P_{j_0}(\varphi_{j_0}(\cdot,\sigma))\,b_{j_0}\, \rho(d\sigma)\Bigg)\\ & = \Tr\Bigg(\int_{\Sigma}\prod_{j_1=1}^j P_{j_1}(\varphi_{j_1}(\cdot,\sigma)) \, b_{j_1}\prod_{j_2=j+1}^{k+1} P_{j_2}(\varphi_{j_2}(\cdot,\sigma)) \, b_{j_2} \, \rho(d\sigma)\Bigg) \\ & = \Tr\Bigg(\int_{\Sigma}\prod_{j_2=j+1}^{k+1} P_{j_2}(\varphi_{j_2}(\cdot,\sigma)) \,b_{j_2} \prod_{j_1=1}^j P_{j_1}(\varphi_{j_1}(\cdot,\sigma)) \, b_{j_1}\, \rho(d\sigma)\Bigg) \numberthis\label{eq.manip1} \\ & = \Tr\Bigg(\Bigg(\int_{\Sigma}F_j\,d\rho\Bigg)\, b_j\Bigg) = \int_{\Sigma} \underbrace{\Tr(F_j(\sigma)\,b_j)}_{=\Tr(F(\sigma)\,b_{k+1})}\,\rho(d\sigma), \numberthis\label{eq.manip2} \end{align*} where \eqref{eq.manip1} follows from repeated, alternating applications of Theorem \ref{thm.traceofinteg} and Theorem \ref{thm.Schatten}.\ref{item.Trflip}; and \eqref{eq.manip2} follows from the $\sigma$-weak continuity of $c \mapsto \Tr(cb_j)$ and the calculation from the first step. \end{proof} \begin{rem} By inspection of the proof, justifying \eqref{eq.manip1} is where essentially all the difficulty lies. Using the generalization of Theorem \ref{thm.traceofinteg} for separable $K$ alluded to in Remark \ref{rem.easyTrsep}, \eqref{eq.manip1} can be justified much more easily and directly (i.e., without going through all the reductions from the third step of the proof) when $H_1,\ldots,H_{k+1}$ are separable. \end{rem} It is interesting to note that the ``truncation argument" from the third step of the proof above is the only place in this section where we have actually used that the \textit{upper} (as opposed to the lower) $\rho$-integral of $\sigma \mapsto \|\varphi_1(\cdot,\sigma)\|_{L^{\infty}(P_1)}\cdots\|\varphi_{k+1}(\cdot,\sigma)\|_{L^{\infty}(P_{k+1})}$ is finite. Specifically, we only used it to prove \eqref{eq.DCTapp}. In all other arguments, finiteness of the lower integral sufficed. \begin{cor}[\textbf{Ultraweak Continuity of MOI}]\label{cor.uwcont} Let $\varphi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$ and $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ be a $L_P^{\infty}$-IPD of $\varphi$. If \[ b = (b_1,\ldots,b_k) \in B(H_2;H_1) \times \cdots \times B(H_{k+1};H_k), \] $b_{k+1} \in \mathcal{S}_1(H_1;H_{k+1})$, and $\gamma \in S_{k+1}$ is a cyclic permutation of $\{1,\ldots,k+1\}$, then \[ \Tr\big(I^{\boldsymbol{P}}(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})[b]\,b_{k+1}\big) = \Tr\big(I^{\boldsymbol{P}_{\gamma}}(\Sigma,\rho,\varphi_{\gamma(1)},\ldots,\varphi_{\gamma(k+1)})[b_{\gamma}]\,b_{\gamma(k+1)}\big), \] where $\boldsymbol{P}_{\gamma} = (P_{\gamma(1)},\ldots,P_{\gamma(k+1)})$ and $b_{\gamma} = (b_{\gamma(1)},\ldots,b_{\gamma(k)})$. In particular, the map \[ I^{\boldsymbol{P}}(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1}) \colon B(H_2;H_1) \times \cdots \times B(H_{k+1};H_k) \to B(H_{k+1};H_1) \] is ($k$-linear and) ultraweakly continuous in each argument. \end{cor} \begin{proof} Fix $b = (b_1,\ldots,b_k) \in B(H_2;H_1) \times \cdots \times B(H_{k+1};H_k)$, $b_{k+1} \in \mathcal{S}_1(H_1;H_{k+1})$, and $j \in \{1,\ldots,k\}$. Let $\gamma \in S_{k+1}$ be the cyclic permutation $j_0 \mapsto j_0+j$ mod $k+1$, and define \begin{align*} F(\sigma) & \coloneqq P_1(\varphi_1(\cdot,\sigma))\,b_1\cdots P_k(\varphi_k(\cdot,\sigma))\,b_k\,P_{k+1}(\varphi_{k+1}(\cdot,\sigma)) \in B(H_{k+1};H_1) \, \text{ and} \\ F_j(\sigma) & \coloneqq P_{j+1}(\varphi_{j+1}(\cdot,\sigma))\,b_{j+1}\cdots P_{k+1}(\varphi_{k+1}(\cdot,\sigma))\,b_{k+1}\,P_1(\varphi_1(\cdot,\sigma))b_1\cdots P_{j-1}(\varphi_{j-1}(\cdot,\sigma))\,b_{j-1}\,P_j(\varphi_j(\cdot,\sigma)) \\ & = P_{\gamma(1)}(\varphi_{\gamma(1)}(\cdot,\sigma))\,b_{\gamma(1)}\cdots P_{\gamma(k)}(\varphi_{\gamma(k)}(\cdot,\sigma))\,b_{\gamma(k)}P_{\gamma(k+1)}(\varphi_{\gamma(k+1)}(\cdot,\sigma)) \in B(H_j;H_{j+1}), \end{align*} for all $\sigma \in \Sigma$. Then $I^{\boldsymbol{P}}(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})[b] = \int_{\Sigma} F\,d\rho$ and \begin{align*} \Tr\Bigg(\Bigg(\int_{\Sigma} F\,d\rho\Bigg)b_{k+1}\Bigg) & = \int_{\Sigma} \Tr(F(\sigma)\,b_{k+1})\,\rho(d\sigma) \numberthis\label{eq.uwint} \\ & = \int_{\Sigma} \Tr(F_j(\sigma)\,b_j)\,\rho(d\sigma) \numberthis\label{eq.symmobs} \\ & = \Tr\Bigg(\Bigg(\int_{\Sigma} F_j\,d\rho\Bigg)b_j\Bigg) \numberthis\label{eq.S1wint} \\ & = \Tr\big(I^{\boldsymbol{P}_{\gamma}}(\Sigma,\rho,\varphi_{\gamma(1)},\ldots,\varphi_{\gamma(k+1)})[b_{\gamma}]\,b_{\gamma(k+1)}\big), \end{align*} where \eqref{eq.uwint} holds because $c \mapsto \Tr(cb_{k+1})$ is $\sigma$-weakly continuous, \eqref{eq.symmobs} holds by Theorem \ref{thm.Schatten}.\ref{item.Trflip}, and \eqref{eq.S1wint} holds by Theorem \ref{thm.S1integrability} (plus the fact that the map $\mathcal{S}_1 \ni c \mapsto \Tr(cb_j) \in \mathbb{C}$ is bounded-linear). This completes the proof for the cyclic permutation $\gamma$. Since $j \in \{1,\ldots,k\}$ was arbitrary, we are done. \end{proof} We now reap the benefits of this technical work: the ultraweak continuity we have just proven will allow us to show that $I^{\boldsymbol{P}}(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ as defined in Notation \ref{nota.MOIdepondecomp} does not depend on the chosen $L^{\infty}_P$-IPD of $\varphi$ and is therefore a reasonable definition of \eqref{eq.formalMOI}. \begin{thm}[\textbf{Well-Definition of MOI}]\label{thm.MOIwelldef} If $\varphi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$, then \[ I^{\boldsymbol{P}}(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1}) = I^{\boldsymbol{P}}(\tilde{\Sigma},\tilde{\rho},\tilde{\varphi}_1,\ldots,\tilde{\varphi}_{k+1}) \] whenever $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ and $(\tilde{\Sigma},\tilde{\rho},\tilde{\varphi}_1,\ldots,\tilde{\varphi}_{k+1})$ are $L_P^{\infty}$-IPDs of $\varphi$. \end{thm} \begin{proof} By the argumentwise ultraweak continuity of $I^{\boldsymbol{P}}(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ and $I^{\boldsymbol{P}}(\tilde{\Sigma},\tilde{\rho},\tilde{\varphi}_1,\ldots,\tilde{\varphi}_{k+1})$ (i.e., Corollary \ref{cor.uwcont}) and the ultraweak density of finite-rank operators, it suffices to prove \[ I^{\boldsymbol{P}}(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})[b] = I^{\boldsymbol{P}}(\tilde{\Sigma},\tilde{\rho},\tilde{\varphi}_1,\ldots,\tilde{\varphi}_{k+1})[b] \numberthis\label{eq.welldef} \] whenever $b = (b_1,\ldots,b_k) \in B(H_2;H_1) \times \cdots \times B(H_{k+1};H_k)$ is such that $b_j$ has finite rank for all $j \in \{1,\ldots,k\}$. By $k$-linearity, it therefore also suffices to prove \eqref{eq.welldef} when $b_j$ has rank at most one for all $j \in \{1,\ldots,k\}$. To this end, write $m \coloneqq k+1$ and, for $1 \leq j \leq m-1$, let $b_j = \langle \cdot , h_j \rangle_{H_{j+1}} k_j$, where $k_j \in H_j$ and $h_j \in H_{j+1}$. Then $P_j(\varphi_j(\cdot,\sigma)) \, b_j = \langle \cdot, h_j \rangle_{H_{j+1}} P_j(\varphi_j(\cdot,\sigma))\, k_j$, for all $\sigma \in \Sigma$ and $j \in \{1,\ldots,m-1\}$. If also $k_m \in H_m$, then \begin{align*} F(\sigma)k_m & \coloneqq P_1(\varphi_1(\cdot,\sigma)) \, b_1 \cdots P_{m-1}(\varphi_{m-1}(\cdot,\sigma)) \, b_{m-1} \, P_m(\varphi_m(\cdot,\sigma))k_m \\ & = \prod_{j=2}^m \big\langle P_j(\varphi_j(\cdot,\sigma)) k_j,h_{j-1} \big\rangle_{H_j} P_1(\varphi_1(\cdot,\sigma)) k_1 \\ & = \Bigg(\prod_{j=2}^m \int_{\Om_j}\varphi_j(\cdot,\sigma) \, d\big(P_j\big)_{k_j,h_{j-1}}\Bigg) P_1(\varphi_1(\cdot,\sigma)) k_1. \numberthis\label{eq.firstexp} \end{align*} Next, if $h_0 \in H_1$ and \begin{align*} \nu & \coloneqq (P_1 \otimes \cdots \otimes P_m)_{k_1 \otimes \cdots \otimes k_m, h_0 \otimes \cdots \otimes h_{m-1}} \in M(\Om,\mathscr{F}) \\ & = (P_1)_{k_1,h_0} \otimes (P_2)_{k_2,h_1} \otimes \cdots \otimes (P_m)_{k_m,h_{m-1}}, \end{align*} then \[ \int_{\Om} |\varphi_1(\omega_1,\sigma)|\cdots |\varphi_m(\omega_m,\sigma)| \, |\nu|(d\boldsymbol{\omega}) \leq \prod_{j=1}^m\|\varphi_j(\cdot,\sigma)\|_{L^{\infty}(P_j)}\|k_j\|_{H_j} \|h_{j-1}\|_{H_j} < \infty, \numberthis\label{eq.bound1} \] for all $\sigma \in \Sigma$. Therefore, by \eqref{eq.firstexp} and Fubini's Theorem, \begin{align*} \langle F(\sigma)k_m, h_0 \rangle_{H_1} & = \Bigg(\prod_{j=2}^m \int_{\Om_j}\varphi_j(\cdot,\sigma) \, d\big(P_j\big)_{k_j,h_{j-1}}\Bigg) \big\langle P_1(\varphi_1(\cdot,\sigma)) k_1, h_0 \big\rangle_{H_1} \\ & = \prod_{j=1}^m \int_{\Om_j}\varphi_j(\cdot,\sigma) \, d\big(P_j\big)_{k_j,h_{j-1}} = \int_{\Om} \varphi_1(\omega_1,\sigma)\cdots \varphi_m(\omega_m,\sigma) \, \nu(d\boldsymbol{\omega}), \numberthis\label{eq.secondexp} \end{align*} for all $\sigma \in \Sigma$. Now, by \eqref{eq.bound1}, \[ \int_{\Sigma}\int_{\Om} |\varphi_1(\omega_1,\sigma)|\cdots |\varphi_m(\omega_m,\sigma)| \, |\nu|(d\boldsymbol{\omega}) \, \rho(d\sigma) \leq \prod_{j=1}^m\|k_j\|_{H_j} \|h_{j-1}\|_{H_j} \underline{\int_{\Sigma}}\prod_{j=1}^m\|\varphi_j(\cdot,\sigma)\|_{L^{\infty}(P_j)} \, \rho(d\sigma) < \infty. \] Thus, by definition of pointwise Pettis integrals, \eqref{eq.secondexp}, and Fubini's Theorem, \begin{align*} \big\langle I^{\boldsymbol{P}}(\Sigma,\rho,\varphi_1,\ldots,\varphi_m)[b]k_m,h_0 \big\rangle_{H_1} & = \int_{\Sigma}\int_{\Om} \varphi_1(\omega_1,\sigma)\cdots \varphi_m(\omega_m,\sigma) \, \nu(d\boldsymbol{\omega}) \, \rho(d\sigma) \\ & = \int_{\Om}\int_{\Sigma} \varphi_1(\omega_1,\sigma)\cdots \varphi_m(\omega_m,\sigma) \, \rho(d\sigma)\, \nu(d\boldsymbol{\omega}) \numberthis\label{eq.thirdexp} \end{align*} Finally, note that $\nu \ll P = P_1 \otimes \cdots \otimes P_m$ in the sense that \[ \{G \in \mathscr{F} : P(G) = 0\} \subseteq \{G \in \mathscr{F} : \nu(\tilde{G}) = 0 \text{ when }\mathscr{F} \ni \tilde{G} \subseteq G\}. \] Therefore, the definition of $L^{\infty}_P$-IPD implies \[ \varphi(\boldsymbol{\omega}) = \int_{\Sigma} \varphi_1(\omega_1,\sigma)\cdots \varphi_m(\omega_m,\sigma) \, \rho(d\sigma) \] for $\nu$-almost every (i.e., $|\nu|$-almost every) $\boldsymbol{\omega} = (\omega_1,\ldots,\omega_m) \in \Om$. Thus \eqref{eq.thirdexp} becomes \[ \big\langle I^{\boldsymbol{P}}(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})[b]k_m,h_0 \big\rangle_{H_1} = \int_{\Om} \varphi \, d\nu = \big\langle P(\varphi)(k_1 \otimes \cdots \otimes k_m), h_0 \otimes \cdots \otimes h_{m-1} \big\rangle_{H_1 \otimes_2 \cdots \otimes_2 H_m}. \] Since the right hand side is independent of the chosen $L^{\infty}_P$-IPD, we are done. \end{proof} We are finally allowed to make the following long-awaited definition. \begin{defi}[\textbf{MOI, Take II}]\label{def.MOI} If $\varphi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$, then we define \begin{align*} \big(I^{\boldsymbol{P}}\varphi\big)[b] & = \int_{\Om_{k+1}}\cdots\int_{\Om_1} \varphi(\omega_1,\ldots,\omega_{k+1}) \, P_1(d\omega_1) \, b_1 \cdots P_k(d\omega_k) \, b_k \,P_{k+1}(d\omega_{k+1}) \\ & \coloneqq \int_{\Sigma}P_1(\varphi_1(\cdot,\sigma))\, b_1 \cdots P_k(\varphi_k(\cdot,\sigma))\, b_k \,P_{k+1}(\varphi_{k+1}(\cdot,\sigma))\, \rho(d\sigma), \end{align*} for all $b = (b_1,\ldots,b_k) \in B(H_2;H_1) \times \cdots \times B(H_{k+1};H_k)$ and any $L^{\infty}_P$-IPD $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ of $\varphi$. We call $I^{\boldsymbol{P}}\varphi$ the \textbf{multiple operator integral} (MOI) of $\varphi$ with respect to $\boldsymbol{P} = (P_1,\ldots,P_{k+1})$. We also write \[ (P_1 \otimes \cdots \otimes P_{k+1})(\varphi)\text{\smaller $\#$}[b_1,\ldots,b_k] = P(\varphi) \text{\smaller $\#$} b \coloneqq \big(I^{\boldsymbol{P}}\varphi\big)[b]. \] \end{defi} \begin{rem}[\textbf{$\boldsymbol{\#}$ Operation}]\label{rem.hash} The $\text{\smaller $\#$}$ in the definition above \textit{formally} stands for the algebraic action \[ \# \colon B(H_1) \otimes \cdots \otimes B(H_{k+1}) \to \Hom(B(H_2;H_1) \otimes \cdots \otimes B(H_{k+1};H_k); B(H_{k+1};H_1)) \] determined (linearly) by \[ (a_1 \otimes \cdots \otimes a_{k+1})\text{\smaller $\#$} [b_1 \otimes \cdots \otimes b_k] \coloneqq a_1b_1\cdots a_1b_ka_{k+1} \] for $a_1 \in B(H_1),\ldots,a_{k+1} \in B(H_{k+1})$ and $b_1 \in B(H_2;H_1),\ldots,b_k \in B(H_{k+1};H_k)$. Now, the von Neumann algbra tensor product $B(H_1) \bar{\otimes} \cdots \bar{\otimes} B(H_{k+1})$ is naturally isomorphic to $B(H) = B(H_1 \otimes_2 \cdots \otimes_2 H_{k+1})$. Therefore, morally speaking, ``the multiple operator integral $(I^{P_1,\ldots,P_{k+1}}\varphi)[b_1,\ldots,b_k]$ is \[ P(\varphi) = \int_{\Om_1 \times \cdots \times \Om_{k+1}} \varphi \, d(P_1 \otimes \cdots \otimes P_{k+1}) \in B(H_1 \otimes_2 \cdots \otimes_2 H_{k+1}) = B(H_1) \bar{\otimes} \cdots \bar{\otimes} B(H_{k+1}) \] acting on $b_1 \otimes \cdots \otimes b_k$ via $\#$," even though this does not actually make sense (i.e., $\#$ may not extend to the von Neumann algebra tensor product). We continue this discussion in Remark \ref{rem.morehash}. \end{rem} We end this section by restricting the MOI we have just defined to a von Neumann algebra. Notice first that it follows from Theorem \ref{thm.MOIwelldef} and Corollary \ref{cor.MOIintgood} that \[ \big\|\big(I^{\boldsymbol{P}}\varphi\big)[b]\big\|_{B(H_{k+1};H_1)} \leq \|\varphi\|_{L^{\infty}(P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(P_{k+1})}\|b_1\|_{B(H_2;H_1)}\cdots\|b_k\|_{B(H_{k+1};H_k)}, \numberthis\label{eq.opnormestim} \] for all $b = (b_1,\ldots,b_k) \in B(H_2;H_1) \times \cdots \times B(H_{k+1};H_k)$. \begin{lem}\label{lem.PintinM} Let $(\Xi,\mathscr{G},K,Q)$ be a projection-valued measure space and $\mathcal{M} \subseteq B(K)$ be a von Neumann algebra. If $Q(G) \in \mathcal{M}$, for all $G \in \mathscr{G}$, then $Q(f) \in \mathcal{M}$, for all $f \in L^{\infty}(\Xi,Q)$. \end{lem} \begin{proof} Of course, it suffices to prove $Q(f) \in \mathcal{M}$, for all $f \in \ell^{\infty}(\Xi,\mathscr{G})$. To this end, let \[ \mathbb{H} \coloneqq \{f \in \ell^{\infty}(\Xi,\mathscr{G}) : Q(f) \in \mathcal{M}\}. \] Since $\mathcal{M}$ is a linear subspace closed under taking adjoints, $\mathbb{H}$ is a vector space that is closed under complex conjugation. Since $\mathcal{M}$ is closed in the SOT, Lemma \ref{lem.Pintcont} implies that $\mathbb{H}$ is closed under sequential bounded convergence. By assumption $\mathbb{M} \coloneqq \{1_G : G \in \mathscr{G}\} \subseteq \mathbb{H}$. Since $\mathbb{M}$ is closed under multiplication and complex conjugation, the Multiplicative System Theorem gives $\ell^{\infty}(\Xi,\mathscr{G}) = \ell^{\infty}(\Xi,\sigma(\mathbb{M})) \subseteq \mathbb{H}$, as desired. \end{proof} \begin{thm}[\textbf{MOIs in $\boldsymbol{\mathcal{M}}$}]\label{thm.MOIsinM} Suppose $H_1 = \cdots = H_{k+1} = K$, $\mathcal{M} \subseteq B(K)$ is a von Neumann algebra, and $P_j$ takes values in $\mathcal{M}$ for all $j \in \{1,\ldots,k+1\}$. If $\varphi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$ and $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ is a $L_P^{\infty}$-IPD of $\varphi$ (where $P \coloneqq P_1 \otimes \cdots \otimes P_{k+1}$), then \[ \big(I^{\boldsymbol{P}}\varphi\big)[b] = \int_{\Sigma} P_1(\varphi_1(\cdot,\sigma))\,b_1\cdots P_k(\varphi_k(\cdot,\sigma))\,b_k \, P_{k+1}(\varphi_{k+1}(\cdot,\sigma)) \, \rho(d\sigma) \in \mathcal{M} \numberthis\label{eq.wstarintMOI} \] is a weak$^*$ integral in $\mathcal{M}$ whenever $b = (b_1,\ldots,b_k) \in \mathcal{M}^k$. Moreover, $I^{\boldsymbol{P}}\varphi \colon B(K)^k \to B(K)$ restricts to a bounded $k$-linear map $\mathcal{M}^k \to \mathcal{M}$ with operator norm at most $\|\varphi\|_{L^{\infty}(P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(P_{k+1})}$ that is $\sigma$-weakly continuous in each argument. Finally, $I^{\boldsymbol{P}}\varphi$ is independent of the representation of $\mathcal{M}$ in the sense that if $\mathcal{N}$ is another von Neumann algebra, and $\pi \colon \mathcal{M} \to \mathcal{N}$ is an algebraic $\ast$-isomomorphism, then \[ \pi\big(\big(I^{P_1,\ldots,P_{k+1}}\varphi\big)[b_1,\ldots,b_k]\big) = \big(I^{\pi \circ P_1,\ldots,\pi \circ P_{k+1}}\varphi\big)[\pi(b_1),\ldots,\pi(b_k)], \] for all $b_1,\ldots,b_k \in \mathcal{M}$. \end{thm} \begin{proof} By Lemma \ref{lem.PintinM}, the definition of $I^{\boldsymbol{P}}\varphi$, and Corollary \ref{cor.wstarint}, the expression \eqref{eq.wstarintMOI} defining $\big(I^{\boldsymbol{P}}\varphi\big)[b]$ is a weak$^*$ integral in $\mathcal{M}$ whenever $b \in \mathcal{M}^k$. We know from \eqref{eq.opnormestim} that the restriction $I^{\boldsymbol{P}}\varphi \colon \mathcal{M}^k \to \mathcal{M}$ has the claimed operator norm bound. Corollary \ref{cor.uwcont} implies the restriction $I^{\boldsymbol{P}}\varphi \colon \mathcal{M}^k \to \mathcal{M}$ is $\sigma$-weakly continuous in each argument because the $\sigma$-weak topology on $\mathcal{M}$ is the subspace topology induced by the $\sigma$-weak topology on $B(K)$, and the latter is the same as the ultraweak topology. The final claim follows from Theorem \ref{thm.wintBHK}.\ref{item.indepofrep} and the fact that $\pi(P_j(f)) = (\pi \circ P_j)(f)$, for all $f \in L^{\infty}(\Om_j,P_j)$, by another Multiplicative System Theorem argument, which we leave to the reader. \end{proof} \begin{rem}[\textbf{The General Semifinite Case}]\label{rem.semifinitecase} Let $(\mathcal{M},\tau)$ be a semifinite von Neumann algebra. The arguments in this section are robust in the sense that they can be used to prove the following generalizations (in the case $H_1=\cdots=H_{k+1}=K$) of Theorems \ref{thm.traceofinteg} and \ref{thm.S1integrability}: \begin{enumerate}[label=(\roman*),leftmargin=2\parindent] \item Let $(\Sigma,\mathscr{H},\rho)$ be a finite measure space, $(\Xi,\mathscr{G},K,Q)$ be a projection-valued measure space such that $Q$ takes values in $\mathcal{M}$, $A \colon \Sigma \to \mathcal{M}$ be weak$^*$ measurable, and $\varphi \in \ell^{\infty}(\Xi \times \Sigma, \mathscr{G} \otimes \mathscr{H})$. If \[ \sup_{\sigma \in \Sigma}\max\big\{\|A(\sigma)\|_{L^1(\tau)},\|A(\sigma)\|_{L^{\infty}(\tau)}\big\} < \infty, \] then \[ \int_{\Sigma} A(\sigma)\,Q(\varphi(\cdot,\sigma))\,\rho(d\sigma),\int_{\Sigma} Q(\varphi(\cdot,\sigma))\,A(\sigma)\,\rho(d\sigma) \in \mathcal{L}^1(\tau) \] and \[ \tau\Bigg(\int_{\Sigma} A(\sigma)\,Q(\varphi(\cdot,\sigma))\,\rho(d\sigma)\Bigg) = \tau\Bigg(\int_{\Sigma} A(\sigma)\,Q(\varphi(\cdot,\sigma))\,\rho(d\sigma)\Bigg). \] \item Suppose we are in the setup of Theorem \ref{thm.MOIsinM}. If $j \in \{1,\ldots,k\}$ and $b_j \in \mathcal{L}^1(\tau)$, then the map \[ \Sigma \ni \sigma \mapsto P_1(\varphi_1(\cdot,\sigma))\,b_1\cdots P_k(\varphi_k(\cdot,\sigma))\,b_k\,P_{k+1}(\varphi_{k+1}(\cdot,\sigma)) \in L^1(\tau) \] is Gel'fand-Pettis integrable as a map $\Sigma \to (L^1(\tau),\|\cdot\|_{L^1(\tau)})$, and its Gel'fand-Pettis integral is the multiple operator integral \eqref{eq.wstarintMOI}. \end{enumerate} To prove these, one uses the same arguments but with Theorem \ref{thm.Lpinteg} in place of Theorem \ref{thm.Spinteg}, a replacement for Lemma \ref{lem.SOTS1} (e.g., Lemma 2.5 in \cite{azamovetal}), and duality/basic properties of $L^1$ instead of $\mathcal{S}_1$. Facts such as the two above are of use when proving trace formulas; please see Section 5.5 of \cite{skripka} for a survey of some existing results on trace formulas. \end{rem} \subsection{Algebraic Properties and Noncommutative \texorpdfstring{$L^p$}{} Estimates}\label{sec.genprop} In this section, we prove linearity and multiplicativity properties of the MOI defined in the previous section. Then we prove Schatten $p$-norm and -- in the case of a semifinite von Neumann algebra -- noncommutative $L^p$-norm estimates for MOIs. \begin{prop}[\textbf{Algebraic Properties of MOIs}]\label{prop.linandmult} Suppose $1 \leq m \leq k$. \begin{enumerate}[label=(\roman*),leftmargin=2\parindent] \item If $\varphi,\psi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$ and $\alpha \in \mathbb{C}$, then $I^{\boldsymbol{P}}(\varphi+\alpha\,\psi) = I^{\boldsymbol{P}}\varphi+\alpha\,I^{\boldsymbol{P}}\psi$.\label{item.lin} \item If \[ \psi_1 \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_m,P_m) \; \text{ and } \; \psi_2 \in L^{\infty}(\Om_{m+1},P_{m+1}) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1}), \] then (the $P$-almost everywhere equivalence class of) the function \[ (\psi_1 \otimes \psi_2)(\omega_1,\ldots,\omega_{k+1}) \coloneqq \psi_1(\omega_1,\ldots,\omega_m)\,\psi_2(\omega_{m+1},\ldots,\omega_{k+1}) \] belongs to $L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$ and \[ \big(I^{\boldsymbol{P}}(\psi_1 \otimes \psi_2)\big)[b] = \big(I^{P_1,\ldots,P_m}\psi_1\big)[b_1,\ldots,b_{m-1}]\,b_m\,\big(I^{P_{m+1},\ldots,P_{k+1}}\psi_2\big)[b_{m+1},\ldots,b_k], \] for all $b = (b_1,\ldots,b_k) \in B(H_2;H_1) \times \cdots \times B(H_{k+1};H_k)$.\label{item.mult1} \item If $\psi \in L^{\infty}(\Om_m,P_m) \hat{\otimes}_i L^{\infty}(\Om_{m+1},P_{m+1})$, \[ \tilde{\psi}(\boldsymbol{\omega}) \coloneqq \psi(\omega_m,\omega_{m+1}) \text{ for } \boldsymbol{\omega} = (\omega_1,\ldots,\omega_{k+1}) \in \Om, \] and $\varphi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$, then \[ \big(I^{\boldsymbol{P}}(\varphi\tilde{\psi})\big)[b] = \big(I^{\boldsymbol{P}}\varphi\big)\big[b_1,\ldots,b_{m-1},\big(I^{P_m,P_{m+1}}\psi\big)[b_m],b_{m+1},\ldots,b_k\big], \] for all $b = (b_1,\ldots,b_k) \in B(H_2;H_1) \times \cdots \times B(H_{k+1};H_k)$.\label{item.mult2} \end{enumerate} \end{prop} \begin{proof} We take each item in turn. \ref{item.lin} Let $\varphi, \psi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$ and $\alpha \in \mathbb{C}$. It is easy to see that $I^{\boldsymbol{P}}(\alpha\varphi) = \alpha \, I^{\boldsymbol{P}}\varphi$. To prove additivity, let $(\Sigma_1,\rho_1,\varphi_1,\ldots,\varphi_{k+1})$ and $(\Sigma_2,\rho_2,\psi_1,\ldots,\psi_{k+1})$ be $L_P^{\infty}$-IPDs of $\varphi$ and $\psi$, respectively. Then we take $(\Sigma,\mathscr{H},\rho)$ to be the disjoint union of the measure spaces $(\Sigma_1,\mathscr{H}_1,\rho_1)$ and $(\Sigma_2,\mathscr{H}_2,\rho_2)$ and, for $j \in \{1,\ldots,k+1\}$, define $\chi_j \colon \Om_j \times \Sigma \to \mathbb{C}$ by \[ \chi_j(\omega_j,\sigma) \coloneqq \begin{cases} \varphi_j(\omega_j,\sigma), & \text{if } \sigma \in \Sigma_1 \subseteq \Sigma\\ \psi_j(\omega_j,\sigma), & \text{if } \sigma \in \Sigma_2 \subseteq \Sigma, \end{cases} \] for all $(\omega_j,\sigma) \in \Om_j \times \Sigma$. Then, as is argued in the proof of Proposition \ref{prop.IPTPspecial}, $(\Sigma,\rho,\chi_1,\ldots,\chi_{k+1})$ is a $L^{\infty}_P$-IPD of $\varphi+\psi$. Thus, by the definitions of the disjoint union measure space and pointwise Pettis integrals, \[ I^{\boldsymbol{P}}(\varphi+\psi) = I^{\boldsymbol{P}}(\Sigma,\rho,\chi_1,\ldots,\chi_{k+1}) = I^{\boldsymbol{P}}(\Sigma_1,\rho_1,\varphi_1,\ldots,\varphi_{k+1}) + I^{\boldsymbol{P}}(\Sigma_2,\rho_2,\psi_1,\ldots,\psi_{k+1}) = I^{\boldsymbol{P}}\varphi + I^{\boldsymbol{P}}\psi. \] Thus $\varphi \mapsto I^{\boldsymbol{P}}\varphi$ is linear. \pagebreak \ref{item.mult1} Let $\psi_1 \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_m,P_m)$ and $\psi_2 \in L^{\infty}(\Om_{m+1},P_{m+1}) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$. If $(\Sigma_1,\rho_1,\varphi_1,\ldots,\varphi_m)$ and $(\Sigma_2,\rho_2,\varphi_{m+1},\ldots,\varphi_{k+1})$ are $L^{\infty}_{P_1 \otimes \cdots \otimes P_m}$- and $L^{\infty}_{P_{m+1}\otimes \cdots \otimes P_{k+1}}$-IPDs of $\psi_1$ and $\psi_2$, respectively, then \[ (\Sigma_1,\rho_1,\varphi_1,\ldots,\varphi_m,\underbrace{1,\cdots, 1}_{k+1-m}) \; \text{ and } \; (\Sigma_2,\rho_2,\underbrace{1,\ldots,1}_{m},\varphi_{m+1},\ldots,\varphi_{k+1}) \] are $L^{\infty}_P$-IPDs of $\psi_1 \otimes 1$ and $1 \otimes \psi_2$, respectively. But then \[ \psi_1 \otimes \psi_2 = (\psi_1 \otimes 1)(1 \otimes \psi_2) \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1}) \] because $L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$ is an algebra. And actually, by the argument from the proof of Proposition \ref{prop.IPTPspecial}, if we redefine \begin{align*} (\Sigma,\mathscr{H},\rho) & \coloneqq (\Sigma_1 \times \Sigma_2,\mathscr{H}_1 \otimes \mathscr{H}_2,\rho_1 \otimes \rho_2) \, \text{ and} \\ \chi_j(\omega_j,\sigma) & \coloneqq \begin{cases} \varphi_j(\omega_j, \sigma_1), & \text{if } 1 \leq j \leq m \\ \varphi_j(\omega_j, \sigma_2), & \text{if } m+1 \leq j \leq k+1 \end{cases} \end{align*} for $\omega_j \in \Om_j$ and $\sigma = (\sigma_1,\sigma_2) \in \Sigma_1 \times \Sigma_2 = \Sigma$, then $(\Sigma,\rho,\chi_1,\ldots,\chi_{k+1})$ is a $L^{\infty}_P$-IPD of $\psi_1 \otimes \psi_2$. This observation implies the result. Indeed, let $h_1 \in H_{k+1}$, $h_2 \in H_1$, \begin{align*} h_3 & \coloneqq (I^{P_{m+1},\ldots,P_{k+1}}\psi_2)[b_{m+1},\ldots,b_k]h_1, \, \text{ and} \\ T & \coloneqq \big(I^{P_1,\ldots,P_m}\psi_1\big)[b_1,\ldots,b_{m-1}]\,b_m\,\big(I^{P_{m+1},\ldots,P_{k+1}}\psi_2\big)[b_{m+1},\ldots,b_k]. \end{align*} Then \begin{align*} \langle Th_1,h_2 \rangle_{H_1} & = \big\langle \big(I^{P_1,\ldots,P_m}\psi_1\big)[b_1,\ldots,b_{m-1}]b_mh_3,h_2 \big\rangle_{H_1} \\ & = \int_{\Sigma_1}\Bigg\langle\Bigg( \prod_{j=1}^m P_j(\varphi_j(\cdot,\sigma_1)) \, b_j\Bigg)h_3,h_2 \Bigg\rangle_{H_1} \, \rho_1(d\sigma_1) \\ & = \int_{\Sigma_1}\int_{\Sigma_2}\Bigg\langle \Bigg( \prod_{j_1=1}^m P_{j_1}(\varphi_{j_1}(\cdot,\sigma_1)) \, b_{j_1}\Bigg)\Bigg( \prod_{j_2=m+1}^k P_{j_2}(\varphi_{j_2}(\cdot,\sigma_2)) \, b_{j_2}\Bigg) \\ & \hspace{50mm} \times P_{k+1}(\varphi_{k+1}(\cdot,\sigma_2))\,h_1,h_2\Bigg\rangle_{H_1}\rho_2(d\sigma_2) \,\rho_1(d\sigma_1) \\ & = \int_{\Sigma} \big\langle P_1(\chi_1(\cdot,\sigma)) \,b_1 \cdots P_k(\chi_k(\cdot,\sigma))\,b_k\,P_{k+1}(\chi_{k+1}(\cdot,\sigma))\,h_1,h_2 \big\rangle_{H_1} \, \rho(d\sigma) \\ & = \big\langle \big(I^{\boldsymbol{P}}(\psi_1 \otimes \psi_2)\big)[b]\,h_1,h_2 \big\rangle_{H_1} \end{align*} by definition and Fubini's Theorem. This completes the proof of the first multiplicativity claim. \ref{item.mult2} Let $(\Sigma_1,\rho_1,\varphi_1,\ldots,\varphi_{k+1})$ be a $L_P^{\infty}$-IPD of $\varphi$ and $(\Sigma_2,\rho_2,\psi_m,\varphi_{m+1})$ be a $L_{P_m \otimes P_{m+1}}^{\infty}$-IPD of $\psi$. Then \[ (\Sigma_2,\rho_2,\underbrace{1,\ldots,1}_{m-1},\psi_m,\psi_{m+1},\underbrace{1,\cdots, 1}_{k-m}) \] is a $L_P^{\infty}$-IPD of $\tilde{\psi}$ (as defined in the statement of this item). Once again, by the argument from the proof of Proposition \ref{prop.IPTPspecial}, if we redefine \begin{align*} (\Sigma,\mathscr{H},\rho) & \coloneqq (\Sigma_1 \times \Sigma_2,\mathscr{H}_1 \otimes \mathscr{H}_2, \rho_1 \otimes \rho_2) \, \text{ and} \\ \chi_j(\omega_j,\sigma) & \coloneqq \begin{cases} \varphi_j(\omega_j, \sigma_1), & \text{if } 1 \leq j \leq m-1 \\ \varphi_j(\omega_j, \sigma_1)\,\psi_j(\omega_j,\sigma_2), & \text{if } m \leq j \leq m+1 \\ \varphi_j(\omega_j, \sigma_1), & \text{if } m+2 \leq j \leq k+1 \end{cases} \end{align*} for $\omega_j \in \Om_j$ and $\sigma = (\sigma_1,\sigma_2) \in \Sigma_1 \times \Sigma_2 = \Sigma$, then $(\Sigma,\rho,\chi_1,\ldots,\chi_{k+1})$ is a $L_P^{\infty}$-IPD of $\varphi \tilde{\psi}$. Now, if $h_1 \in H_{k+1}$, $h_2 \in H_1$, $b_m^{\psi} \coloneqq \big(I^{P_m,P_{m+1}}\psi\big)[b_m]$, and \[ T \coloneqq \big(I^{P_1,\ldots,P_{k+1}}\varphi\big)\big[b_1,\ldots,b_{m-1},b_m^{\psi},b_{m+1},\ldots,b_k\big], \] then \begin{align*} \langle Th_1,h_2 \rangle_{H_1} & = \big\langle \big(I^{\boldsymbol{P}}\varphi\big)\big[b_1,\ldots,b_{m-1},b_m^{\psi},b_{m+1},\ldots,b_k\big]h_1,h_2 \big\rangle_{H_1} \\ & = \int_{\Sigma_1}\Bigg\langle\Bigg( \prod_{j_1=1}^{m-1}P_{j_1}(\varphi_{j_1}(\cdot,\sigma_1)) \, b_{j_1}\Bigg) P_m(\varphi_m(\cdot,\sigma_1)\,b_m^{\psi} \\ & \hspace{15mm} \times \Bigg(\prod_{j_2=m+1}^k P_{j_2}(\varphi_{j_2}(\cdot,\sigma_1)) \, b_{j_2}\Bigg) P_{k+1}(\varphi_{k+1}(\cdot,\sigma_1))\,h_1,h_2 \Bigg\rangle_{H_1} \,\rho_1(d\sigma_1) \\ & = \int_{\Sigma_1}\int_{\Sigma_2}\Bigg\langle\Bigg(\prod_{j_1=1}^{m-1} P_{j_1}(\varphi_{j_1}(\cdot,\sigma_1))\, b_{j_1}\Bigg)P_m(\varphi_m(\cdot,\sigma_1))\,P_m(\psi_m(\cdot,\sigma_2))\,b_m \\ & \hspace{22mm} \times P_{m+1}(\psi_{m+1}(\cdot,\sigma_2))\, P_{m+1}(\varphi_{m+1}(\cdot,\sigma_1)) \,b_{m+1} \\ & \hspace{22mm} \times\Bigg(\prod_{j_2=m+2}^kP_{j_2}(\varphi_{j_2}(\cdot,\sigma_1))\, b_{j_2}\Bigg) P_{k+1}(\varphi_{k+1}(\cdot,\sigma_1))\,h_1,h_2 \Bigg\rangle_{H_1} \rho_2(d\sigma_2)\rho_1(d\sigma_1) \\ & = \int_{\Sigma} \big\langle P_1(\chi_1(\cdot,\sigma)) \,b_1 \cdots P_k(\chi_k(\cdot,\sigma))\,b_k\,P_{k+1}(\chi_{k+1}(\cdot,\sigma))\,h_1,h_2 \big\rangle_{H_1} \rho(d\sigma) \\ & = \big\langle \big(I^{\boldsymbol{P}}(\psi_1 \otimes \psi_2)\big)[b]\,h_1,h_2 \big\rangle_{H_1} \end{align*} by definition, multiplicativity of integration with respect to a projection-valued measure, and Fubini's Theorem. This completes the proof of the second multiplicativity claim. \end{proof} \begin{prop}[\textbf{Schatten Estimates on MOIs}]\label{prop.MOISchattenestim} If $\varphi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$ and $p,p_1,\ldots,p_k \in [1,\infty]$ are such that $\frac{1}{p} = \frac{1}{p_1}+\cdots+\frac{1}{p_k}$, then \[ \big\|(I^{\boldsymbol{P}}\varphi)[b]\big\|_{\mathcal{S}_p} \leq \|\varphi\|_{L^{\infty}(P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(P_{k+1})}\|b_1\|_{\mathcal{S}_{p_1}}\cdots\|b_k\|_{\mathcal{S}_{p_k}}, \] for all $b = (b_1,\ldots,b_k) \in B(H_2;H_1) \times \cdots \times B(H_{k+1};H_k)$. (As usual, $0 \cdot \infty \coloneqq 0$.) In particular, $I^{\boldsymbol{P}}\varphi$ restricts to a bounded $k$-linear map $\mathcal{S}_{p_1}(H_2;H_1) \times \cdots \times \mathcal{S}_{p_k}(H_{k+1};H_k) \to \mathcal{S}_p(H_{k+1};H_1)$. \end{prop} \begin{proof} Let $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ be a $L^{\infty}_P$-IPD of $\varphi$. By definition, Theorem \ref{thm.Spinteg}, and H\"{o}lder's Inequality, \begin{align*} \big\|(I^{\boldsymbol{P}}\varphi)[b]\big\|_{\mathcal{S}_p} & = \Bigg\|\int_{\Sigma}P_1(\varphi_1(\cdot,\sigma))\,b_1 \cdots P_k(\varphi_k(\cdot,\sigma)) \, b_k \, P_{k+1}(\varphi_{k+1}(\cdot,\sigma)) \, \rho(d\sigma)\Bigg\|_{\mathcal{S}_p} \\ & \leq \underline{\int_{\Sigma}}\big\|P_1(\varphi_1(\cdot,\sigma))\,b_1 \cdots P_k(\varphi_k(\cdot,\sigma)) \, b_k \, P_{k+1}(\varphi_{k+1}(\cdot,\sigma))\big\|_{\mathcal{S}_p} \, \rho(d\sigma) \\ & \leq \|b_1\|_{\mathcal{S}_{p_1}}\cdots\|b_k\|_{\mathcal{S}_{p_k}}\underline{\int_{\Sigma}}\|\varphi_1(\cdot,\sigma)\|_{L^{\infty}(P_1)}\cdots\|\varphi_{k+1}(\cdot,\sigma)\|_{L^{\infty}(P_{k+1})}\,\rho(d\sigma). \end{align*} Using $\underline{\int_{\Sigma}} \leq \overline{\int_{\Sigma}}$ and then taking the infimum over all $L_P^{\infty}$-IPDs $(\Sigma,\rho,\varphi_1,\ldots,\varphi_{k+1})$ gives the desired result. \end{proof} By the same proof, using Theorem \ref{thm.Lpinteg} in place of Theorem \ref{thm.Spinteg} and Noncommutative H\"{o}lder's Inequality in place of H\"{o}lder's Inequality for the Schatten norms, we get the following. \begin{prop}[\textbf{Noncommutative $\boldsymbol{L^p}$ Estimates on MOIs}]\label{prop.MOILpestim} Suppose $H_1 = \cdots = H_{k+1} = K$, $(\mathcal{M} \subseteq B(K),\tau)$ is a semifinite von Neumann algebra, and $P_j$ takes values in $\mathcal{M}$ for all $j \in \{1,\ldots,k+1\}$. If $\varphi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$ and $p,p_1,\ldots,p_k \in [1,\infty]$ are such that $\frac{1}{p} = \frac{1}{p_1}+\cdots+\frac{1}{p_k}$, then \[ \big\|(I^{\boldsymbol{P}}\varphi)[b]\big\|_{L^p(\tau)} \leq \|\varphi\|_{L^{\infty}(P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(P_{k+1})}\|b_1\|_{L^{p_1}(\tau)}\cdots\|b_k\|_{L^{p_k}(\tau)}, \] for all $b = (b_1,\ldots,b_k) \in \mathcal{M}^k$. (As usual, $0 \cdot \infty \coloneqq 0$.) In particular, $I^{\boldsymbol{P}}\varphi$ extends to a bounded $k$-linear map $L^{p_1}(\tau) \times \cdots \times L^{p_k}(\tau) \to L^p(\tau)$ with operator norm at most $\|\varphi\|_{L^{\infty}(P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(P_{k+1})}$. \qed \end{prop} \subsection{Relation to Other Definitions}\label{sec.otherdefs} For completeness, we now review one frequently-used alternative definition -- due to Pavlov \cite{pavlov} and Birman-Solomyak \cite{birmansolomyakTensProd} -- of \eqref{eq.formalMOI} and prove that it agrees with our definition from the previous section when both definitions apply. This alternative definition requires the construction of a certain vector measure. (Please see Section \ref{sec.proofofPavlov} for the terminology in the following statement.) \begin{thm}[\textbf{Pavlov, Birman-Solomyak}]\label{thm.Pavlov} If $b=(b_1,\ldots,b_k) \in \mathcal{S}_2(H_2;H_1) \times \cdots \times \mathcal{S}_2(H_{k+1};H_k)$, then there exists a unique vector measure $P \text{\smaller $\#$} b \colon \mathscr{F} \to \mathcal{S}_2(H_{k+1};H_1)$ with bounded semivariation such that \[ (P\text{\smaller $\#$} b)(G_1 \times \cdots \times G_{k+1}) = P_1(G_1)\,b_1\cdots P_k(G_k)\,b_k\,P_{k+1}(G_{k+1}) \] for all $G_1 \in \mathscr{F}_1,\ldots,G_{k+1} \in \mathscr{F}_{k+1}$. The semivariation $\|P \text{\smaller $\#$} b\|_{\operatorname{svar}}$ of $P\text{\smaller $\#$} b$ is at most $\|b_1\|_{\mathcal{S}_2}\cdots\|b_k\|_{\mathcal{S}_2}$, and $P \text{\smaller $\#$} b \ll P$ in the sense that $\{G \in \mathscr{F} : P(G) = 0\} \subseteq \{G \in \mathscr{F} : (P\text{\smaller $\#$} b)(\tilde{G}) = 0$ when $\mathscr{F} \ni \tilde{G} \subseteq G\}$. \end{thm} \begin{rem}\label{rem.morehash} The notation for the vector measure in Theorem \ref{thm.Pavlov} is not standard. It is inspired by the $\#$ operation discussed in Remark \ref{rem.hash}. As the notation suggests, morally speaking, ``$P \text{\smaller $\#$} b$ is the projection-valued measure $P = P_1 \otimes \cdots \otimes P_{k+1}$ acting on $b = b_1 \otimes \cdots \otimes b_k$ via $\#$." Indeed, the condition uniquely characterizing $P \text{\smaller $\#$} b$ can be rewritten genuinely as $(P \text{\smaller $\#$} b)(G) = P(G) \text{\smaller $\#$} b$ for all $G = G_1\times \cdots \times G_{k+1}$ with $G_1 \in \mathscr{F}_1,\ldots,G_{k+1} \in \mathscr{F}_{k+1}$ because in this case $P(G) \in B(H_1) \otimes \cdots \otimes B(H_{k+1}) \subseteq B(H)$. Therefore, morally speaking, integrating a function $\varphi$ with respect to this vector measure may also be viewed as ``$\int_{\Om} \varphi \, dP$ acting on $b$ via $\#$," which also matches the interpretation discussed in Remark \ref{rem.hash}. \end{rem} The proof Pavlov originally provided in \cite{pavlov} that this construction is possible has an error. Birman-Solomyak pointed out and sketched a correction of this error in \cite{birmansolomyakTensProd}. For the benefit of the reader, we provide a complete proof, including the necessary background in vector measure theory in Section \ref{sec.proofofPavlov}. In any case, following Pavlov, Theorem \ref{thm.Pavlov} allows us to define \eqref{eq.formalMOI} as \[ \int_{\Om} \varphi \, d(P \text{\smaller $\#$} b) \in \mathcal{S}_2(H_{k+1};H_1) \] for \textit{all} $\varphi \in L^{\infty}(\Om,P)$, where $\Om = \Om_1 \times \cdots \times \Om_{k+1}$, but only $b \in \mathcal{S}_2(H_2;H_1) \times \cdots \times \mathcal{S}_2(H_{k+1};H_k)$. (Please see pages 5-6 in \cite{diesteluhl} for the definition of the integral above.) In this case, we have \[ \Bigg\|\int_{\Om}\varphi \, d(P\text{\smaller $\#$} b)\Bigg\|_{\mathcal{S}_2} \leq \|\varphi\|_{L^{\infty}(P\text{\smaller $\#$} b)}\|P\text{\smaller $\#$} b\|_{\mathrm{svar}} \leq \|\varphi\|_{L^{\infty}(P)}\|b_1\|_{\mathcal{S}_2}\cdots\|b_k\|_{\mathcal{S}_2}. \numberthis\label{eq.Pavlovbound} \] We now show this definition agrees with the one we developed in Section \ref{sec.welldef} when they both apply. \begin{thm}[\textbf{Agreement with Pavlov MOI}]\label{thm.pavlovMOIagree} If $\varphi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(\Om_{k+1},P_{k+1})$, then \[ \big(I^{\boldsymbol{P}}\varphi\big)[b] = \int_{\Om}\varphi \, d(P \text{\smaller $\#$} b), \] for all $b \in \mathcal{S}_2(H_2;H_1) \times \cdots \times \mathcal{S}_2(H_{k+1};H_k)$. \end{thm} \begin{proof} First, note that \[ \mathcal{S}_2(H_2;H_1) \times \cdots \times \mathcal{S}_2(H_{k+1};H_k) \ni b \mapsto \int_{\Om} \varphi \, d(P\text{\smaller $\#$} b) \in \mathcal{S}_2(H_{k+1};H_1) \] is a bounded $k$-linear map with operator norm at most $\|\varphi\|_{L^{\infty}(P)}$ by \eqref{eq.Pavlovbound} and the $k$-linearity of the condition uniquely characterizing $P \text{\smaller $\#$} b$. By Proposition \ref{prop.MOISchattenestim}, \[ \mathcal{S}_2(H_2;H_1) \times \cdots \times \mathcal{S}_2(H_{k+1};H_k) \ni b \mapsto \big(I^{\boldsymbol{P}}\varphi\big)[b] \in \mathcal{S}_2(H_{k+1};H_1) \] is also a bounded $k$-linear map with operator norm at most $\|\varphi\|_{L^{\infty}(P_1) \hat{\otimes}_i \cdots \hat{\otimes}_i L^{\infty}(P_{k+1})}$. Since finite-rank operators are dense in $\mathcal{S}_2$, it therefore suffices to prove \[ \big(I^{\boldsymbol{P}}\varphi\big)[b] = \int_{\Om}\varphi \, d(P \text{\smaller $\#$} b), \] for all $b = (b_1,\ldots,b_k) \in \mathcal{S}_2(H_2;H_1) \times \cdots \times \mathcal{S}_2(H_{k+1};H_k)$ such that $b_1,\ldots,b_k$ all have rank at most one. \pagebreak Now, recall $\mathcal{S}_2(H_1;H_{k+1}) \cong \mathcal{S}_2(H_{k+1};H_1)^*$ via the map $B \mapsto (A \mapsto \Tr(AB))$. Therefore, $\int_{\Om}\varphi \, d(P\text{\smaller $\#$} b)$ is determined by the requirement that \[ \Tr\Bigg(\int_{\Om}\varphi \, d(P\text{\smaller $\#$} b)\,b_{k+1}\Bigg) = \int_{\Om} \varphi(\boldsymbol{\omega}) \, \Tr((P \text{\smaller $\#$} b)(d\boldsymbol{\omega})\,b_{k+1}), \numberthis\label{eq.Pavlovdet} \] for all $b_{k+1} \in \mathcal{S}_2(H_1;H_{k+1})$. Once again, since finite-rank operators are dense in $\mathcal{S}_2$ and the above equation is bounded linear in $b_{k+1}$, $\int_{\Om} \varphi \, d(P \text{\smaller $\#$} b)$ is determined by \eqref{eq.Pavlovdet} or all $b_{k+1} \colon H_1 \to H_{k+1}$ with rank at most one. It therefore suffices to prove that \[ \Tr\Big(\big(I^{\boldsymbol{P}}\varphi\big)[b]\,b_{k+1}\Big) = \int_{\Om} \varphi \, \Tr((P \text{\smaller $\#$} b)(d\boldsymbol{\omega})\,b_{k+1}) \] for all $b = (b_1,\ldots,b_k) \in \mathcal{S}_2(H_2;H_1) \times \cdots \times \mathcal{S}_2(H_{k+1};H_k)$ and $b_{k+1} \in \mathcal{S}_2(H_1;H_{k+1})$ such that $b_1,\ldots,b_{k+1}$ all have rank at most one. Now, write $m \coloneqq k+1$, $T \coloneqq (I^{\boldsymbol{P}}\varphi)[b]$, $b_j \coloneqq \langle \cdot, h_j \rangle_{H_{j+1}}k_j$ for $1 \leq j \leq m-1$, and $b_m \coloneqq \langle \cdot , h_0\rangle_{H_1}k_m$. Then, by the calculation done in the proof of Theorem \ref{thm.MOIwelldef}, \[ \Tr\Big(\big(I^{\boldsymbol{P}}\varphi\big)[b]\,b_m\Big) = \Tr(T \circ (\langle \cdot, h_0 \rangle_{H_1}k_m)) = \langle Tk_m,h_0 \rangle_{H_1} = \int_{\Om}\varphi \, d\nu, \] where $\nu = P_{k_1 \otimes \cdots \otimes k_m, h_0 \otimes \cdots \otimes h_{m-1}} = (P_1)_{k_1,h_0} \otimes (P_2)_{k_2,h_1} \otimes \cdots \otimes (P_m)_{k_m,h_{m-1}}$. But now, by definition of the vector measure $P \text{\smaller $\#$} b$, if $G = G_1 \times \cdots \times G_m \in \mathscr{F}$ with $G_1 \in \mathscr{F}_1,\ldots,G_m \in \mathscr{F}_m$, then \begin{align*} \Tr((P \text{\smaller $\#$} b)(G)\,b_m) & = \Tr(P_1(G_1)\,b_1\cdots P_m(G_m)\,b_m) \\ & = \prod_{j=1}^m \big\langle P_j(G_j)k_j, h_{j-1} \big\rangle_{H_j} = \prod_{j=1}^m ( P_j)_{k_j,h_{j-1}}(G_j) \\ & = ((P_1)_{k_1,h_0} \otimes (P_2)_{k_2,h_1} \otimes \cdots \otimes (P_m)_{k_m,h_{m-1}})(G) = \nu(G). \end{align*} (This is a special case of the calculation resulting in \eqref{eq.firstexp} and \eqref{eq.secondexp} from the proof of Theorem \ref{thm.MOIwelldef}.) It follows that $\Tr((P \text{\smaller $\#$} b)(\cdot)\,b_m) = \nu$ as complex measures on $(\Om,\mathscr{F})$. This completes the proof. \end{proof} We end this section by relating this to Birman-Solomyak's original definition of DOIs, i.e., the case $k=1$. Before doing so, however, we make an observation. Redefine $H \coloneqq H_1$ and $K \coloneqq H_2$. It is well-known that $H \otimes_2 K^* \cong \mathcal{S}_2(K;H)$ isometrically via the bounded linear map determined by $h \otimes \ell \mapsto \ell(\cdot) h$. This identification gives us a natural isometric isomorphism $\# \colon B(H \otimes_2 K^*) \to B(\mathcal{S}_2(K;H))$ that is a homeomorphism with respect to all the usual topologies -- in particular, the WOT. Viewing $B(H) \otimes B(K^*)$ as a subset of $B(H \otimes_2 K^*)$, one can show this map is the unique WOT-continuous linear extension of the linear map determined by \[ B(H) \otimes B(K^*) \ni a \otimes b^{\operatorname{t}} \mapsto (c \mapsto acb) \in B(\mathcal{S}_2(K;H)), \] where for $b \in B(K)$, the \textbf{transpose} $b^{\operatorname{t}} \in B(K^*)$ is defined by $\ell \mapsto \ell \circ b$, i.e., the adjoint of $b$ without identifying $K^*$ with $K$ via the Riesz Representation Theorem.\footnote{What is being said here is that the operation $\#$ from Remark \ref{rem.hash} \textit{does} extend to the von Neumann algebra tensor product $B(H) \bar{\otimes} B(K^*) = B(H \otimes_2 K^*)$ when the codomain is taken to be $B(\mathcal{S}_2(K;H))$.} Noting that both the transpose $P_2^{\operatorname{t}} \colon \mathscr{F}_2 \to B(K^*)$ and the composition $\tilde{P} \coloneqq \#(P_1 \otimes P_2^{\operatorname{t}}) \colon \mathscr{F}_1 \otimes \mathscr{F}_2 \to B(\mathcal{S}_2(K;H))$ are still projection-valued measures, we can therefore define, following Birman-Solomyak \cite{birmansolomyakDSOI1}, \[ T_{\varphi}^{P_1,P_2}(b) \coloneqq \#\Bigg(\int_{\Om_1 \times \Om_2} \varphi \, d(P_1 \otimes P_2^{\operatorname{t}})\Bigg)b = \tilde{P}(\varphi) b \in \mathcal{S}_2(K;H), \] for all $\varphi \in L^{\infty}(\Om_1 \times \Om_1,P_1 \otimes P_2) = L^{\infty}(\Om_1 \times \Om_2,P_1 \otimes P_2^{\operatorname{t}}) = L^{\infty}(\Om_1 \times \Om_2, \tilde{P})$ and $b \in \mathcal{S}_2(K;H)$. One can show (e.g., starting with finite-rank $b$ and then approximating in $\mathcal{S}_2$) that \[ T_{\varphi}^{P_1,P_2}(b) = \int_{\Om_1 \times \Om_2} \varphi \, d((P_1 \otimes P_2)\text{\smaller $\#$} b), \] i.e., this agrees with Pavlov's definition. \pagebreak Now, Birman-Solomyak \cite{birmansolomyakDSOI1} defined $T_{\varphi}^{P_1,P_2}(b)$ for $b \in B(K;H)$ as follows. Recall $B(H;K) \cong \mathcal{S}_1(K;H)^*$ isometrically via the map $B \mapsto (A \mapsto \Tr(AB))$. Thus $B(K;H)$ is isometrically conjugate isomorphic to $\mathcal{S}_1(K;H)^*$ via the map $C \mapsto (A \mapsto \Tr(AC^*))$. Therefore, if $T \colon \mathcal{S}_1(K;H) \to \mathcal{S}_1(K;H)$ is a bounded linear map, then we may speak of its adjoint $T^* \colon B(K;H) \to B(K;H)$, which is characterized by \[ \Tr(T(A)\,C^*) = \Tr(A\,T^*(C)^*), \] for all $A \in \mathcal{S}_1(K;H)$ and $C \in B(K;H)$. Now, if $\varphi \in L^{\infty}(\Om_1 \times \Om_2, P_1 \otimes P_2)$ is such that \[ T_{\varphi}^{P_1,P_2}(\mathcal{S}_1(K;H)) \subseteq \mathcal{S}_1(K;H) \subseteq \mathcal{S}_2(K;H) \] and $T_{\varphi}^{P_1,P_2}|_{\mathcal{S}_1(K;H)} \colon \mathcal{S}_1(K;H) \to \mathcal{S}_1(K;H)$ is bounded -- as is the case when $\varphi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i L^{\infty}(\Om_2,P_2)$ by Theorem \ref{thm.pavlovMOIagree} and Proposition \ref{prop.MOISchattenestim} -- then it is easy to show that \[ T_{\overline{\varphi}}^{P_1,P_2}(\mathcal{S}_1(K;H)) \subseteq \mathcal{S}_1(K;H) \; \text{ and } \; \big\|T_{\overline{\varphi}}^{P_1,P_2}\big\|_{B(\mathcal{S}_1(K;H))} = \big\|T_{\varphi}^{P_1,P_2}\big\|_{B(\mathcal{S}_1(K;H))} < \infty. \] In this situation, Birman-Solomyak define \[ T_{\varphi}^{P_1,P_2}(b) \coloneqq \big(T_{\overline{\varphi}}^{P_1,P_2}\big|_{\mathcal{S}_1(K;H)}\big)^*(b) \in B(K;H), \] for all $b \in B(K;H)$. Now, let $\varphi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i L^{\infty}(\Om_2,P_2)$. By Corollary \ref{cor.uwcont}, if $b_1 \in B(K;H)$ and $b_2 \in \mathcal{S}_1(K;H)$, then \begin{align*} \Tr\Bigg(\int_{\Om_2}\int_{\Om_1}\varphi(\omega_1,\omega_2)\,P_1(d\omega_1) \, b_1 \, P_2(d\omega_2)\, b_2^*\Bigg) & = \Tr\Bigg(\int_{\Om_1}\int_{\Om_2}\varphi(\omega_1,\omega_2)\,P_2(d\omega_2) \, b_2^* \, P_1(d\omega_1) \,b_1\Bigg) \\ & = \Tr\Bigg(b_1\Bigg(\int_{\Om_2}\int_{\Om_1}\overline{\varphi(\omega_1,\omega_2)}\,P_1(d\omega_1) \, b_2 \, P_2(d\omega_2)\Bigg)^* \Bigg). \end{align*} This says precisely that \[ \big(I^{P_1,P_2}\overline{\varphi}|_{\mathcal{S}_1(K;H)}\big)^* = I^{P_1,P_2}\varphi. \] Since we already know our definition of MOIs agrees with that of Pavlov when they both apply, and therefore $(I^{P_1,P_2}\varphi)[b] = T_{\varphi}^{P_1,P_2}(b)$ when $b \in \mathcal{S}_2(K;H)$, we obtain the following. \begin{thm}[\textbf{Agreement with Birman-Solomyak DOI}]\label{thm.BSagree} If $\varphi \in L^{\infty}(\Om_1,P_1) \hat{\otimes}_i L^{\infty}(\Om_2,P_2)$, then $I^{P_1,P_2}\varphi = T_{\varphi}^{P_1,P_2}$ on all of $B(K;H)$. \qed \end{thm}
\section{Introduction} Hamilton cycles is a fundamental object in graph theory and it has been studied in both the deterministic and the stochastic setting. One of the first stochastic settings in which the threshold for Hamiltonicity was determined is the random graph process $\{G_t\}_{t\geq 0}$. $\{G_t\}_{t\geq 0}$ is generated by starting with $G_0$ being the empty graph. Thereafter for $i\geq 1$, given $G_{i-1}$, $G_i$ is formed by adding to $G_{i-1}$ an edge that is chosen uniformly at random from $\binom{[n]}{2}\setminus E(G_{i-1})$. Let $$\tau_2=\min\{t:\delta(G_t)=2\}.$$ $t\geq \tau_2$ is definitely a necessary condition for $G_t$ to be Hamiltonian. Ajtai, Koml\'{o}s and Szemer\'{e}di \cite{AKS} and Bollob\'{a}s \cite{Bol}, building upon work of Korshunov \cite{Kor}, P\'{o}sa \cite{Posa} and Koml\'{o}s and Szemer\'{e}di \cite{Komlos}, proved that w.h.p.\@ $G_{\tau_2}$ is Hamiltonian. W.h.p. $\tau_2=(1+o(1))n \log n/2$. Thus to achieve Hamiltonicity in the random graph process one has to wait until the average degree becomes $(1+o(1))\log n$. In order to ``speed up" the appearance of a Hamilton cycle it is natural to consider models of random graphs that ensure that the minimum degree is at least 2. Such a model of random graphs is $G_{n,m}^{\delta\geq k}$, a graph that is chosen uniformly at random from all the graphs on $n$ vertices with $m\geq kn/2$ edges and minimum degree $k$. Taking $k=2$ does not suffices for $G_{n,m}^{\delta\geq k}$ to be Hamiltonian when $m=o(n\log n)$. Indeed for $\epsilon>0$ and $m \leq (\frac{1}{6}-\epsilon)n \log n$ w.h.p.\@ $G_{n,m}^{\delta \geq 2}$ contains a 3-spider i.e. a vertex of degree 3 that is incident to 3 vertices of degree 2. Inherently w.h.p.\@ $G_{n,m}^{\delta \geq 2}$ is not Hamiltonian. On the other hand Anastos and Frieze prove that taking $k=3$ and $m\geq 2.67n$ suffices \cite{AF}. For a graph $G$ we say that $G\in {\mathcal A}_k$ if $G$ spans $\lfloor\frac{k-1}{2}\rfloor$ edge disjoint Hamilton cycles plus, when $k$ is even, a perfect matching. Bollob\'{a}s, Cooper, Fenner and Frieze \cite{BCFF} considered $G_{n,m}^{\delta \geq k}$ for $k\geq 3$ and proved the following Theorem. \begin{theorem}\label{thm:BCFF} Let $k\geq 3$. There exists a constant $C_k\leq 2(k+1)^3$ such that if $2m\geq C_kn$ then w.h.p.\@ $G_{n,m}^{\delta\geq k}\in {\mathcal A}_k$. \end{theorem} For $c = O(1)$, w.h.p. in $G_{n,cn}^{\delta\geq k}$ there exist vertices whose neighborhood contains $(k+1)$ vertices of degree $k$. Hence the number of edge disjoint Hamilton cycles in the above Theorem is optimal. A graph that is known to be distributed as $G_{n,m}^{\delta\geq k}$ is the $k$-core of an element of the random graph process. For $k\geq 3$ and a graph $G$ denote by $G^{(k)}$ the $k$-core of $G $ i.e. the maximal subgraph of $G$ of minimum degree $k$. {\L}uczak showed that the size of $G_t^{(k)}$ goes through a phase transition similar to that of the size of the giant component \cite{l}. Specifically he showed that $G_{\tau_k}^{(k)}$ spans either 0 or a constant proportion of the vertices of $G_{\tau_k}$. Later, Pittel, Spencer and Wormald \cite{PSW} established the threshold of $V(G_t^{(k)})\neq \emptyset$ to be at $t= (c_k/2) n$ where $c_k=k+\sqrt{k\log k}+o(\sqrt{k})$. In \cite{BCFF}, Bollob\'{a}s, Cooper, Fenner and Frieze conjecture that Theorem \ref{thm:BCFF} should extend to every $G_{t}^{ (k)}$ for $t\geq \tau_k$. The first result towards this direction was given by Krivelevich, Lubetzky and Sudakov (see \cite{KLS}). They proved that for $k\geq 15$ w.h.p. $G_{\tau_k}^{(k)}$ is Hamiltonian for $t\geq \tau_k$. In addition they prove that there exists $k_0$, such that if $k\geq k_0$ then w.h.p.\@ $G_{t}^{(k)}$ spans $\lfloor \frac{k-3}{2} \rfloor$ edge disjoint Hamilton cycles for $k\geq k_0$ and $t\geq \tau_k$. A 2-factor of a graph $G$ is a 2-regular spanning subgraph of $G$. In this paper we study a very closely related to ${\mathcal A}_k$ property which we call ${\mathcal A}_k'$. We say that a graph $G$ has the property ${\mathcal A}_k'$ if \begin{itemize} \item[(i)] when $k$ is odd, it spans $\frac{k-3}{2}$ pairwise edge-disjoint Hamilton cycles plus a 2-factor, \item[(ii)] when $k$ is even, it spans $\lfloor \frac{k-1}{2} \rfloor$ pairwise edge-disjoint Hamilton cycles plus a matching of size $n/2-o(n)$. \end{itemize} Hence, ${\mathcal A}_k'$ is a relaxation of ${\mathcal A}_k$ where when $k$ is odd we substitute the last Hamilton cycle with a 2-factor while when $k$ is even we allow for a slightly smaller matching. The main Theorems of this paper are the following: \begin{theorem}\label{thm:ham} Let $4\leq k=O(1)$ and $k/2< c =O(1)$. Then, $$\mathbb{P}\big(G_{n,cn}^{\delta\geq k} \in {\mathcal A}_k'\big)=1-o(n^{-1}).$$ \end{theorem} \begin{theorem}\label{thm:hamCores} Let $4\leq k=O(1)$. Then w.h.p. $G_{t}^{(k)} \in {\mathcal A}_k'$ for $t\geq \tau_k$. \end{theorem} In particular Theorem \ref{thm:hamCores} implies that w.h.p. if the 4-core of $G_{t}$ is non-empty then it is Hamiltonian. To construct the Hamilton cycles in $G\sim G^{\delta \geq k}_{n,m}$ we start by applying Theorem 6.1 from \cite{A} in order to (i) decompose $G$ into $G'\subset G$ and $R=E(G)\setminus E(G')$ where the distribution of $R$ is fairly close to uniform and (ii) extract from $G'$ a $(k-1)$-matching $M$ of size $(k-1)n/2-o(n)$. Here by ``a $(k-1)$-matching" we refer to a set of edges that spans a graph of maximum degree $k-1$ as opposed to a matching of size $k-1$. \begin{theorem}[Theorem 6.1 of \cite{A}]\label{thm:kGreedy2} Let $k\geq 3$, $k/2< c=O(1)$, $n^{-0.49}\leq p =o(1)$ and $G\sim G_{n,cn}^{\delta \geq k}$. Then, with probability $1-o(n^{-9})$, there exists $V_0\subset V(G)$ of size at most $3cnp$ and $E_p\subset E(G)$ of size at least $\frac{(2cn-kn)p}{4}$ such that \begin{itemize} \item[(i)] Given the set $E(G)\setminus E_p$ the edge set $E_p$ is distributed uniformly at random among all sets of size $|E_p| $ that are disjoint from $E(G)\setminus E_p$ and not incident to $V_0$ and \item[(ii)] $E(G)\setminus E_p$ spans a $(k-1)$-matching $M$ of size at least $kn/2-n^{0.401}$. \end{itemize} In addition with probability $1-o(n^{-9})$ the sets $V_0,E_p$ and $M$ described above can be generated in $O(n)$ time. \end{theorem} Now given $G',M$ and $R$, promised by the above Theorem, we repeatedly apply the Tutte-Berge formula in order to peel from $M$, $(k-1)$ matchings of size $n/2-o(n)$, say $M_1,M_2,...,$ $M_{k-1}$. We then, iteratively, convert pairs of matchings into Hamilton cycles as follows. We first take the union of 2 matchings and remove an edge from each cycle created to create a \textbf{VDPC} (vertex disjoint path covering) of $V$. A VDPC is a set of vertex disjoint path that covers $V$. Here single vertices are considered to be paths of length zero. Thereafter we introduce ``fake edges" and glue the paths given by the VDPC into a Hamilton path. Thereafter, using P\'osa rotations along with few edges from $R$ we close this path into a Hamilton cycle. This new Hamilton cycle either is entirely spanned by $G$ or, by removing a fake edge, it defines a Hamiltonian path with fewer ``fake edges". We repeat this process until we get a Hamilton cycle no ``fake edges" hence a Hamilton cycle that is entirely spanned by $G'\cup R = G$. We slightly abuse the notion of a VDPC and call a Hamilton cycle a VDPC of size 0. When applying the above process, after we have constructed Hamilton cycles $H_1,H_2,...,H_i$, to turn $\big(M_{2i}\cup M_{2i+1}\big)\setminus \big(\bigcup_{j=1}^i E(H)\big)$ into a Hamilton cycle $H_{i+1}$ we work in $G'\setminus \big(\cup_{j=1}^i E(H)\big)$. Thus potentially, $E(H_{i+1})$ contains edges from the matchings that have not been processed yet i.e. from $M_j$, $j\geq 2i+2$. We will ensure that at each iteration $o(n)$ such edges may be used hence at the beginning of each iteration we will have a pair of matching, each of size $n/2-o(n)$. The rest of the paper is organized as follows. At Section \ref{sec:structural} we introduce the model which we use to analyse $G_{n,m}^{\delta \geq k}$, prove some typical structural properties of $G_{n,m}^{\delta \geq k}$ and then derive a desired decomposition of it. At Section \ref{sec:gnm} we prove Theorem \ref{thm:ham}. Finally we give a sketch of the proof of Theorem \ref{thm:hamCores} at Section \ref{sec:gnp} which is primarily based on the proof of Theorem \ref{thm:hamCores}. \section{Structural Properties of $G_{n,m}^{\delta \geq k}$}\label{sec:structural} \subsection{Generating $G_{n,m}^{\delta \geq k}$}\label{model} To analyse $G_{n,m}^{\delta \geq k}$ we use a variation of Bollob\'{a}s configuration model \cite{BolCM}. Given $n,m \in \mathbb{N}$ and a sequence of size $2m$, ${\bf x} =(x_1,x_2,...,x_{2m})\in [n]^{2m}$ we define the multigraph $G_{\bf x} $ by $V(G_{\bf x} ):=[n]$, $E(G_{\bf x} ):=\{\{x_{2j-1},x_{2j}\}:j\in [m]\}$. Thus $G_{\bf x} $ is a graph on $n$ vertices with $m$ edges. The degree of some vertex $v\in [n]$ with respect to the sequence ${\bf x} $ is equal to the number of times it appears in ${\bf x} $, i.e. $d_{\bf x} (v)=|\{i: x_i=v, 1\leq i\leq 2m\}|$. We let $\mathcal{S}_{n,2m}^{\delta \geq k}$ be the set of sequences ${\bf x} =(x_1,x_2,...,x_{2m})$ such that $d_{{\bf x} }(i)\geq k$ for $i \in [n]$. If ${\bf x} $ is chosen uniformly at random from $\mathcal{S}_{n,2m}^{\delta \geq k}$ then $G_{\bf x} $ is close in distribution to $G_{n,m}^{\delta \geq k}$. Indeed, conditioned on $G_{\bf x} $ being simple, the distributions of $G_{\bf x} $ and $G_{n,m}^{\delta \geq k}$ are identical. Both are uniform over the simple graphs on $n$ vertices with $m$ edges and minimum degree $k$. Each such graph will correspond to $m!2^m$ sequences in $\mathcal{S}_{n,2m}^{\delta \geq k}$. For $\lambda>0$ let \begin{equation}\label{eq:fk} f_k(\lambda)=e^{\lambda}-\sum_{i=0}^{k-1} \frac{\lambda^i}{i!}. \end{equation} In addition, let $\mathcal{P}_{\geq k}(\lambda)$ be the {\em truncated at $k$ Poisson($\lambda$}) random variable, i.e. $$\mathbb{P}(\mathcal{P}_{\geq k}=t)=\frac{{\lambda}^t}{t!f_k({\lambda})},\hspace{1in}\text{ for }t\geq k.$$ The next Lemma describes a typical element of $\mathcal{S}_{n,2m}^{\delta \geq k}$. Let ${\bf x} $ be an element of $\mathcal{S}_{n,2m}^{\delta \geq k}$ chosen uniformly at random. Lemma \ref{lem:equiv} states that the joint distribution of $d_1,d_2,...,d_{n}$ is the same as the joint distribution of $\mathcal{P}_1,\mathcal{P}_2,...,\mathcal{P}_{n}$ conditioned on $\sum_{i=1}^n \mathcal{P}_i=2m$, where $\mathcal{P}_i\sim \mathcal{P}_{\geq k}(\lambda)$ for $i\in[n]$. \begin{lemma}\label{lem:equiv} Let $k,n,m \in \mathbb{N}$ be such that $2m\geq kn$ and let ${\bf x} $ an element of $\mathcal{S}_{n,2m}^{\delta \geq k}$ chosen uniformly at random. Let $\lambda > 0$ and let $\{Z_i:i \in [n]\}$ be a set of independent $\mathcal{P}_{\geq k}(\lambda)$ random variables. Then for every $d_1,d_2,...,d_n\geq k$, $$ \mathbb{P}\big(d_{\bf x} (i)=d_i \text{ for } i\in [n]\big)= \mathbb{P}\bigg(Z_i=d_i \text{ for } i\in [n]\bigg| \sum_{i=1}^n Z_i=2m\bigg).$$ \end{lemma} \begin{proof} For ${\bf x} \in \mathcal{S}_{n,2m}^{\delta \geq k}$ let ${\mathcal D}({\bf x} )$ be the degree sequence of ${\bf x} $. Define ${\mathcal D}=\set{{\mathcal D}(x):x\in \mathcal{S}_{n,2m}^{\delta \geq k}}$. For a fixed degree sequence ${\bf d} \in {\mathcal D}$ there exists $(2m)!/\prod_{i\in[n]} {\bf d} _i$ many elements in $\mathcal{S}_{n,2m}^{\delta \geq k}$ with that degree sequence. Thus, for ${\bf d} \in {\mathcal D}$, \begin{align*} \Pr({\mathcal D}({\bf x} )={\bf d} )&= \bfrac{(2m)!}{\underset{i\in [n]}{\prod}{\bf d} _i!} \bigg/ \left( \sum_{{\bf x} \in \mathcal{S}_{n,2m}^{\delta \geq k} } 1\right) =\left( \frac{(2m)!}{\underset{i\in [n]}{\prod}{\bf d} _i!}\right) \bigg/ \left( \sum_{{\bf d} ' \in {\mathcal D} }\frac{(2m)!}{\underset{v\in [n]}{\prod}{\bf d} _i'!} \right). \end{align*} On the other hand, \begin{align*} \Pr \bigg( (Z_1,Z_2,...,Z_n)={\bf d} \bigg|\sum_{i=1}^n Z_i = 2m \bigg) &= \left( \underset{i\in [n]}{\prod}\frac{ e^{-\lambda}\lambda^{{\bf d} _i} }{{\bf d} _i! f_{k}(\lambda)} \right) \bigg/ \left( \sum_{{\bf d} ' \in {\mathcal D}} \underset{i\in [n]}{\prod} \frac{ e^{-\lambda}\lambda^{{\bf d} _i'}}{{\bf d} _i'! f_{k}(\lambda) }\right) \\& = \left( \lambda^{2m} \underset{i\in [n]}{\prod} \frac{1}{{\bf d} _i!} \right) \bigg/ \left( \lambda^{2m} \sum_{{\bf d} ' \in {\mathcal D}} \underset{i\in [n]}{\prod} \frac{1}{{\bf d} _i'!} \right) \\&=\Pr({\mathcal D}({\bf x} )={\bf d} ). \end{align*} \end{proof} It can be shown, see for example \cite{McK} that for a random $x\in \mathcal{S}_{n,2m}^{\delta\geq k}$ if $m=O(n)$ then, \begin{equation*} \Pr(G_{\bf x} \text{ is simple})=\Omega(1). \end{equation*} Hence, choosing a random element of ${\bf x} \in \mathcal{S}_{n,2m}^{\delta\geq k}$ and then generating $G_{\bf x} $ is a good model for generating $G_{n,m}^{\delta \geq k}$ and for any function $f(\cdot)$ such that $f(n)\to 0$ as $n\to \infty$ any properties that hold with probability $1-o(f(n))$ for $G_{\bf x} $ also hold with probability $1-o(f(n))$ for $G_{n,m}^{\delta \geq k}$. \subsection{Expansion Properties of $G_{n,m}^{\delta\geq k}$} Let $k/2<c=O(1)$ and $m=cn =O(n)$. Let $\lambda$ be the unique positive real number that satisfies \begin{equation}\label{eq:lambda} \frac{{\lambda}f_{k-1}({\lambda})}{f_k({\lambda})}=2m. \end{equation} Let ${\mathcal E}$ be an occupancy event in $G_{n,m}^{\delta\geq k}$. Denote by $G_{n,m}^{\delta\geq k,seq}$ the random graph that is generated from the random sequence model (i.e. from choosing a random element of $\mathcal{S}_{n,2m}^{\delta\geq k}$ and then generating the corresponding graph) and $G_{n,m}^{\delta\geq k,Po(\lambda)}$ the random graph that is generated by first generating $n$ independent, $ \mathcal{P}_{k}(\lambda)$ random variables $P_1,P_2,...,P_n$, then choosing a random sequence in $[n]^{\sum_{i\in [n]} P_i}$ with degree sequence $P_1,P_2,...,P_n$ and finally generating he corresponding graph if $\sum_{i\in [n]} P_i$ is even. Then, \begin{align}\label{eq:models} \Pr\big(G_{n,m}^{\delta\geq k} \in {\mathcal E}\big) &\leq O(1) \Pr\big(G_{n,m}^{\delta\geq k,seq} \in {\mathcal E}\big)= O(1) \Pr\bigg(G_{n,m}^{\delta\geq k,Po(\lambda)} \in {\mathcal E}\bigg| \sum_{i\in [n]}{P_i}=2m\bigg) \nonumber \\&\leq O(n^{0.5}) \Pr\big(G_{n,m}^{\delta\geq k,Po(\lambda)} \in {\mathcal E}\big), \end{align} where the last inequality in \eqref{eq:models} follows by the choice of $\lambda$. We summarize the expansion properties of $ G_{n,m}^{\delta \geq k}$ at the next lemma. Its proof is given in Appendix \ref{app:lemmas}. \begin{lemma}\label{lem:expansion} Let $G\sim G_{n,m}^{\delta \geq k}$, where $m=cn$ with $k/2<c=O(1)$ and let $\lambda$ be given by \eqref{eq:lambda}. Let $\beta_1,\gamma_1\in (0,0.1)$ be such that $\bfrac{9e^{1+\lambda} \lambda^2}{cf_k(\lambda)} \bfrac{\gamma_1 \lambda}{c}^{0.1}<\frac{1}{2}$ and $[2(k+\lambda) + \log_2(\beta_1\gamma_1)+ 3]\beta_1 < 2(1-\beta_1)$. Then with probability $1-o(n^{-1})$, \begin{itemize} \item[(i)] every set $S\subset V(G)$ of size $ |S| \leq \gamma_1n$ spans less than $1.1|S|+1$ edges, \item[(ii)] every set $S\subset V(S)$ of size $|S| \leq \beta_1 \gamma_1 n$ is incident to less than $2(1-\beta_1)\gamma_1 n$ edges, \item[(iii)] $G$ does not span a set of $\frac{2n}{(\log\log n)^6}$ vertex disjoint cycles. \end{itemize} \end{lemma} \subsection{Decomposing $G_{n,m}^{\delta\geq k}$} To pill off matchings of size $(1+o(1))n/2$ from the large $k$-matching promised by Theorem \ref{thm:kGreedy2} we use the following Lemma. \begin{lemma}\label{lem:pillmatch} Let $r\geq 0$ and $\ell\in\mathbb{N}^+$ . Let $G=(V=[n],E)$ be a graph of maximum degree $\ell$ with $|E|\geq \ell n/2- \frac{rn}{(\log\log n)^6}$. If $G$ does not span a set of $\frac{2n}{(\log\log n)^6}$ vertex disjoint cycles then it spans a matching of size at least $n/2-\frac{(r+2)n}{2(\log\log n)^6}$. \end{lemma} \begin{proof} The Tutte-Berge formula states that the maximum matching of $G$, denoted by $\alpha'(G)$, is given by \begin{equation}\label{eq:T-B} 2\alpha'(G)=\min_{S\subset V(G)}\{n+|S|-o(G-S)\}, \end{equation} where by $o(G-S)$ we denote the number of odd components in $G-S$. Let $S^*$ be a set of maximum size for which $n+|S|-o(G-S)$ is minimized. Observe that every odd component in $G-S^*$ that is a tree has size 1 i.e. it is an isolated vertex of $G-S$. Indeed, if an odd component $C_i$ of $G-S$ is a tree of size larger than 1 (hence of size at least 3) then by letting $L$ to be the set of leaves of $C_i$, $R$ their neighbors in $C_i$ and $S'=S^*\cup R$ we have the following: If $|L|=|R|+i$ for $i=0,1$ then, $$n+|S'|-o(G-S')= n+|S^*|+|R|-o(G-S^*)-|L|+i= n+|S^*|-o(G-S^*),$$ contradicting the maximality of $S^*$. Otherwise, $$n+|S'|-o(G-S')< n+|S^*|+|R|-o(G-S^*)-|R|,$$ contradicting that $S^*$ has been chosen to minimize $n+|S|-o(G-S)$. Now let $n_{s}$ be the number of isolated vertices in $G-S$ and $n_l$ be the number of the odd components in $G-S$ that span a cycle. Then, as no odd component of $G\setminus S$ is a tree on more than 2 vertices, we have that $o(G\setminus S)=n_s+n_l$ and $n_l$ is bounded by the maximum number of vertex disjoint cycles in $G$ which is by assumption at most $\frac{2n}{(\log\log n)^6}$. Thereafter, as $G$ has maximum degree $\ell$ and spans at least $\ell n/2- \frac{rn}{(\log\log n)^6}$ edges, by considering the edges between $S$ and the isolated vertices in $G-S$ we have, $$ \ell n_s - \frac{rn}{(\log\log n)^6} \leq \ell |S|.$$ Thus, $$2\alpha'(G)= n +|S| - n_s-n_l\geq n- \frac{rn}{\ell(\log\log n)^6}-\frac{2n}{(\log\log n)^6} \geq n-\frac{(r+2)n}{(\log\log n)^6}.$$ \end{proof} \begin{theorem}\label{lem:kGreedy2} Let $k\geq 3$, $k< c=O(1)$ and $G\sim G_{n,cn}^{\delta \geq k}$. Then, with probability $1-o(n^{-2})$, there exist $E_R\subset E(G)$ of size $\frac{(k-1)n}{\log\log n}$ and $E'\subset \binom{[n]}{2}$ of size $o(n^2)$ satisfy the following: \begin{itemize} \item[(i)] $E_R$ is distributed uniformly over all sets of size $\frac{(k-1)n}{\log\log n}$ that are subset of\\ $\binom{[n]}{2}\setminus \big(E'\cup E(G)\setminus E_R \big)$ \item[(ii)] $E(G)\setminus E_R$ spans a set of $k-1$ edge disjoint matchings $M_1,M_2,...,M_{k-1}$ each having size at least $\frac{n}{2}-\frac{2^kn}{(\log\log n)^6}$. \end{itemize} \end{theorem} \begin{proof} We first apply Theorem \ref{thm:kGreedy2} with $p=\frac{n}{\log\log \log n}$. We let $E_R$ be a random subset of $E_p$ of size $\frac{(k-1)n}{\log\log n}$ and $E'$ be the set of edges incident to the set $V_0$ (of size $O(np)$) given by Theorem \ref{thm:kGreedy2}. Then Theorem \ref{thm:kGreedy2} implies that with probability $1-o(n^{-2})$, $G$, $E_R$, $E'$ satisfy Condition (i) while $G\setminus (E'\cup R)$ spans a $k$-matching $M$ of size $kn/2-o(n^{0.41})$. Let $H$ be the graph spanned by $M$. We let $H_1=H$. For $i\in [k-1]$, having defined a subgraph $H_i$ of $H$ of maximum degree $k-i+1$ and of size at least $\frac{(k-i+1)n}{2}-\frac{2^{i}n}{(\log\log n)^6}$ we let $M_i\subset E(H_i)$ be a maximum matching of $H_i$. Lemma \ref{lem:expansion} implies that $H_i$ satisfies the conditions of Lemma \ref{lem:pillmatch} with $r=2^i$ and $\ell=k-i+1$. Thus, Lemma \ref{lem:pillmatch} implies that $|M_i|\geq n/2-\frac{2^{i}n}{(\log\log n)^6}$. Now to construct $H_{i+1}$, we first remove form $H_i$ the matching $M_i$, and then we remove an edge incident to every vertex of $H_i$ that is not saturated by $M_i$. Hence $H_{i+1}$ has maximum degree $k-i$ and spans at least $E(H_i)-|M_i|-(n-2|M_i|) \geq \frac{(k-i)n}{2}-\frac{2^{i+1}n}{(\log\log n)^6}$ many edges. \end{proof} \section{Packing Hamilton Cycles in $G_{n,m}^{\delta\geq k}$}\label{sec:gnm} In this section we prove Theorem \ref{thm:ham}. The main tool that we are going to use are P\'osa rotations. P\'osa rotations is a procedure that starts with a path and aims to either find a path of larger length or many paths of the same length. Given a path $P=(x_1,x_2,\ldots,x_s)$ and an edge $\set{x_s,x_i}$ with $1<i<s-1$, the path $(x_1,\ldots,x_i,x_s,x_{s-1},\ldots,x_{i+1})$ is said to be obtained from $P$ by a P\'{o}sa rotation that fixes the end-vertex $x_1$. In such a case we call the vertex $x_i$ the pivot vertex, $x_ix_{i+1}$ the deleted edge and $x_ix_s$ the inserted edge. We will repeatedly apply the following lemma to subgraphs of $G^{\delta \geq k}_{n,m}$ in order to construct the Hamilton cycles one by one. \begin{lemma}\label{lem:builtingmatch} Let $G=(V=[n],E)$ be a graph, $E',E_R\subset \binom{[n]}{2}\setminus E$, and $\beta,\gamma,\epsilon \in (0,1)$ be such that \begin{itemize} \item[(i)] $G$ has minimum degree $4$, \item[(ii)] $E$ spans a 2-matching $M$ of size $n-\frac{n}{(\log\log n)^{6-\epsilon}}$, \item[(iii)] $G$ does not spans a set of $\frac{n}{(\log\log n)^6}$ pairwise vertex disjoint cycles, \item[(iv)] $|E'|=o(n^2)$ and $|E_R| = \frac{n}{\log\log n }$, \item[(v)] $E_R$ is distributed uniformly over the subsets of $\binom{[n]}{2}\setminus (E\cup E')$ of size $|E_R|$, \item[(vi)] every set $S\subset V$ of size less than $\gamma n$ spans less than $1.1|S|+1$ edges, \item[(vii)] every set $S\subset V$ of size less than $ \beta \gamma n$ is incident to less than $2(1-\beta)\gamma n$ edges. \end{itemize} Then, with probability $1-o(n^{-1})$, $G \cup E_R$ spans a Hamilton cycle $H$ that intersects $M$ in at least $n- \frac{n}{(\log \log n)^{6-\epsilon-1/10k }}$ edges. \end{lemma} \begin{proof} Let $M$ be a maximum $2$-matching of $G$, $\tau=\frac{n}{\log\log n}$ and $E_R=\{e_1,e_2,...,e_{\tau}\}$. Properties (ii) and (iii) imply that upon removing an edge from every cycle, $M$ defines a VDPC, say $\mathcal{P}_0$, of size at most $\frac{2n}{(\log\log n)^{6-\epsilon}}$ that intersects $M$ in at least $|M|-\frac{2n}{(\log\log n)^{6-\epsilon}}$ edges. For $0\leq t \leq \tau$ let $G_t=G\cup \{e_1,e_2,...,e_{t}\}$ and $s_t$ be the minimum size of a VDPC of $G_t$ that intersects $M$ in at least $|M|-r_t$ edges, where $r_t$ is defined as follows. $r_0 = \frac{2n}{(\log\log n)^{6-\epsilon}}$ and therefore $s_0\geq 2r_0$. We also let $s_{-1}=n$. Thereafter, for $t\geq 1$ if $s_{t-1}=s_{t-2}$ then $r_{t}=r_{t-1}$. Else, \begin{align*} r_t=r_{t-1}+ \begin{cases} (\log\log\log n)^2 &\text{ if } s_t\geq \frac{n}{(\log\log n)^8}, \\(\log\log n)^2 &\text{ if } \frac{n}{(\log n)^8} <s_t < \frac{n}{(\log\log n)^8}, \\(\log n)^2 &\text{ if } s_t\leq \frac{n}{(\log n)^8}. \end{cases} \end{align*} As $s_t$ is decreasing $r_t \leq r_0+ s_0(\log\log\log n)^2$ for $t\geq 0$ and if $s_{t}=0$ for some $t>0$ then $G_{t}$ spans a Hamilton cycle that intersects $M$ in at least $|M|-r_t\geq n-\frac{n}{(\log\log n)^{6-\epsilon-1/10k}}$ edges for sufficiently large $n$. Now let $t\geq 1$, $\mathcal{P}_t=\{P_1,P_2,\ldots,P_{s_t}\}$ be a VDPC of $G_t$ of size $s_t$ that intersects $M$ in at least $|M|-r_t$ edges, $l_t=\log_{1.1}\frac{n}{\max\{s_t-1,1\}}+4$ and $l_t'=l_t +\log_{1.1}\log n$. For $P_i \in \mathcal{P}_t$ let $v_{i,1},v_{i,2}$ be its two endpoints. For each pair $i\neq j \in [s_t]$ we introduce a set of edges $F_{i,j}$ of size $s_t-1$ such that $F_{i,j} \cup \big(\bigcup_{P\in \mathcal{P}_t} E(P)\big)$ spans a Hamilton path $H_{i,j}$ from $v_{i,1}$ to $v_{j,2}$. We let $V_{left}=\{v_{i,1}:i \in [s_t]\}$ and for $v=v_{i,1}\in V_{left}$ we denote by ${\mathcal H}_{t,v,left}$ the set of Hamilton paths $\{P_{i,j}:j\in[s_t]\setminus\{i\}\}$ if $s_t>1$. Otherwise we let ${\mathcal H}_{t,v,left}=\{P_1\}.$ Thereafter, for $v\in V_{left}$ we let ${\mathcal H}_{t,v,left,l_t}$ be the set of Hamilton paths that can be obtain from some path in ${\mathcal H}_{t,v,left}$, via at most $l_t$ P\'{o}sa rotations that fix the vertex $v$ and with the restriction that the inserted edges do not belong to $F$. Having generated the sets ${\mathcal H}_{t,v,left,l_t}$ we let $V_{right}\subseteq V$ be the set of vertices $v'\in V$ for which there exists at least $\max\{\frac{s_t}{\log n},1\}$ sets ${\mathcal H}_{t,v,left,l_t}$, $v\in V_{left}$ containing a Hamilton path from $v$ to $v'$. We then let for $v'\in V_{right}$, ${\mathcal H}_{t,v,right}$ be a set containing $\max\{\frac{s_t}{\log n},1\}$ of those Hamilton paths with pairwise distinct endpoints. We then let ${\mathcal H}_{t,v',right,l_t'}$ be the set of Hamilton paths that can be obtained from some path in ${\mathcal H}_{t,v',right}$ via at most $l_t'$ P\'{o}sa rotations that fix the vertex $v'$ and with the restriction that the inserted edges do not belong to $F$. Finally we let ${\mathcal H}_t$ be a maximal set of Hamilton paths in $\cup_{v'\in V_{right}}{\mathcal H}_{t,v',right,l_t'}$ with pairwise distinct endpoints. The claim that shortly follows will be utilized to lower bound the size of ${\mathcal H}_t$. For $\ell \geq 0$, $dir\in \{left,right\}$ and $v\in V_{dir}$ we let $End_{v,\ell,dir}$ be the set of endpoints of Hamilton paths in $G\cup F$ that can be obtain from some path in ${\mathcal H}_{t,v,dir}$ via at most $\ell$ P\'{o}sa rotations that fix the vertex $v$ and with the restriction that the inserted edges do not belong to $F$. In addition we let $Pivot_{v,\ell,dir}$ be the corresponding set of $Pivot$ vertices. \begin{claim}\label{claim:Ham:2} For $\ell \geq 0$, $dir\in \{left,right\}$ and $v\in V_{dir}$ at least one of the following holds, \begin{itemize} \item[(i)] $\ell \leq 4$, \item[(ii)] $|End_{v,\ell+1,dir}|\geq 1.1|End_{v,\ell,dir}|$, \item[(iii)] $End_{v,\ell+1,dir}\cup Pivot_{v,\ell+1,dir}$ spans at least $1.1|End_{v,\ell+1,dir}\cup Pivot_{\ell+1}|$ edges in $G$, \item[(iv)] some endpoint in $|End_{v,\ell+1,dir}|$ is obtained via a P\'osa rotation at which an edge in $F$ is deleted. \end{itemize} \end{claim} \textbf{Proof of Claim \ref{claim:Ham:2}:} Fix $\ell \geq 0$, $dir\in \{left,right\}$ and $v\in V_{dir}$ and assume that (iv) does not hold. Let $R_1=End_{v,\ell,dir}$, $R_2=End_{v,\ell+1,dir} \setminus End_{v,\ell,dir}$, $R=R_1\cup R_{2}=End_{v,\ell+1,dir}$ and $L=Pivot_{v,\ell+1,dir} \setminus R$. Let $S$ be the subgraph of $G_t$ induced by $R \cup L$. Let $u\in End_{v,\ell,dir}$ and $P_{v,u}$ be a $v-u$ Hamilton path. At a P\'osa rotation applied to $P_{v,u}$, that may follow, one of the at least 3 edges incident to $u$ in $E(G)\setminus E(P_{v,u})$ may be chosen to be inserted making its other endpoint, say $r$, a pivot vertex. Thereafter an edge incident to $r$ in $E(P_{v,u})$ will be removed resulting to a possibly new endpoint. As Condition (iv) of Claim \ref{claim:Ham:2} does not apply, the removed edge belongs to $E(G)$. Thus, in $S$ every vertex in $R_{1}$ and $R_{2}$ respectively has degree at least 3 and 1 respectively while every vertex in $L$ is adjacent to at least 2 vertices in $R$. Now if $|End_{v,\ell+1,dir}|\leq 1.1|End_{v,\ell,dir}|$ and $|R| > 0.6|L|$ then, $$ \frac{2|E(S)|}{|V(S)|} \geq \frac{2|L|+3\cdot 0.9|R|+0.1|R|}{|L|+|R|} > \frac{2+3\cdot 0.9\cdot 0.6+0.1\cdot 0.6}{1+0.6}= 2.3.$$ On the other hand if $|End_{v,\ell+1,dir}|\leq 1.1|End_{v,\ell,dir}|$ and $|R| \leq 0.6 |L|$ then, $$ \frac{|E(S)|}{|V(S)|} \geq \frac{2|L|}{1.6|L|}>1.25.$$ Thus if neither of Conditions (ii), (iv) of Claim \ref{claim:Ham:2} apply then $R\cup L$ either spans at least $1.1|R \cup L|+1$ many edges (i.e. Condition (iii) holds) or $|R\cup L| \leq 9$. Now recall that $|Pivot_{v,1,dir}|=|End_{v,1,dir}|=d(v)-1\geq 2$ and in the graph spanned by $S'=End_{v,5,dir}\cup Pivot_{v,5,dir}$ every vertex in $End_{v,4,dir}$ has degree at least 3 while every vertex in $Pivot_{v,5,dir}$ has degree at least 2. Thus $|V(S')|\geq 10$ and if $|R\cup L| \leq 9$ then $\ell \leq 4$. \qed First assume that in the process of generating ${\mathcal H}_t$ at some P\'osa rotations, an edge from $F$ was removed resulting to a Hamilton path $P$. Then, as $P$ was generated via a sequence of at most $(l_t+l_t')$ P\'osa rotations, $E(P)\setminus F$ defines a path covering of size $s_t-1$ that intersects $M$ in at least $|M|-r_t-2(l_t+l_t')$ edges. Otherwise, Claim \ref{claim:Ham:2} together with Condition (vi) implies that either $|End_{l_t,v,left}|\geq 1.1^{l_t-4}(s_t-1) \geq n$ or $|End_{l,v,left} \cup Pivot_{l,v,left}| \geq \gamma n$ for some $l\leq l_t$. In the second case, as every vertex in $Pivot_{l,v,left} \setminus End_{l,v,left}$ has at least 2 neighbors in $End_{l,v,left}$ Condition (vii) implies that $|End_{l_t,v,left}| \geq |End_{l,v,left}| \geq \beta\gamma n$. Hence, $$|V_{right}| \geq \frac{s_t\cdot \beta \gamma n-\frac{s_t}{\log n}\cdot n}{s_t} \geq \frac{\beta \gamma n}{2}.$$ Thereafter, Claim \ref{claim:Ham:2} implies that $|End_{l_t',v,right}|\geq \beta\gamma n$ for $v\in V_{right}$ and therefore, $${\mathcal H}_t \geq \frac{(\beta\gamma)^2n}{4}.$$ For $P \in {\mathcal H}_t$ let $P_1,P_2$ be its endpoints and $Q_t=\set{\{P_1,P_1\}:P\in {\mathcal H}_t}$. As $P\in {\mathcal H}_t$ was generated via a sequence of at most $(l_t+l_t')$ P\'osa rotations, $(E(P) \cup \{P_1,P_2\}) \setminus F$ defines a path covering of size $s_t-1$ that intersects $M$ in at least $|M|-r_t-2(l_t+l_t')$ edges (since after every P\'osa the ``current" path differs in 2 edges from its ``predecessor"). . Thus, \begin{align*} 2(l_t+l_t')\leq \begin{cases} (\log \log \log n)^2 &\text{ if } s_t\geq \frac{n}{(\log \log n)^8}, \\(\log \log n)^2 &\text{ if } \frac{n}{(\log n)^8}< s_t < \frac{n}{(\log \log n)^8}, \\(\log n)^2 &\text{ if } s_t \leq \frac{n}{(\log n)^8}. \end{cases} \end{align*} Hence, \begin{align}\label{bound_prob_rot1} \Pr(s_{t+i}< s_t)\geq \Pr(e_{t+i}\in Q_t \setminus E')\geq (1+o(1))(\beta \gamma)^2/2, \end{align} and \begin{align*} \Pr(s_\tau >0) &\leq \Pr(Binomial(\tau,(\beta \gamma)^2/3)\leq \tau/(\log\log n)^3)+o(n^{-1}) \\& \leq \binom{\tau}{\tau/(\log\log n)^3}\bigg(1-\frac{(\beta\gamma)^2}{3} \bigg)^{(1+o(1))\tau}+o(n^{-1}) \\&\leq \bigg(e(\log\log n)^3)\bigg)^{\frac{\tau}{(\log\log n)^3}}\cdot e^{-0.3(\beta\gamma)^2\tau} o(n^{-1})=o(n^{-1}). \end{align*} Hence with probability $1-o(n^{-1})$ we have that $s_{\tau}=0$ yielding a VDPC of size 0, hence a Hamilton cycle in $G\cup E_R$, that intersects $M$ in at least $|M|-\frac{n}{(\log\log n)^{6-\epsilon-10/k}}$ edges. \end{proof} We will use the following Lemma to augment the final 2-matching to a 2-factor. \begin{lemma}\label{lem:builting2factor} Let $G=(V=[n],E)$ be a graph, $E',E_R\subset \binom{[n]}{2}\setminus E$, and $\beta,\gamma,\epsilon \in (0,1)$ be such that \begin{itemize} \item[(i)] $G$ has minimum degree $3$, \item[(ii)] $E$ spans a 2-matching $M$ of size $n-\frac{n}{(\log\log n)^{4}}$, \item[(iii)] $|E'|=o(n^2)$ and $|E_R| = \frac{n}{\log\log n }$, \item[(v)] $E_R$ is distributed uniformly over the subsets of $\binom{[n]}{2}\setminus (E\cup E')$ of size $|E_R|$, \item[(vi)] every set $S\subset V$ of size less than $\gamma n$ spans less than $1.1|S|+1$ edges. \end{itemize} Then, with probability $1-o(n^{-1})$, $G \cup E_R$ spans a 2-factor. \end{lemma} \begin{proof} Given a $2$-matching $M'$ of $G$, we say that the path $P=v_0,e_1,v_1,.....,e_s,v_s$ is $M'$-alternating if its odd indexed edges do not belong to $M'$ whereas its even indexed edges do (here we slightly abuse the traditional definition of alternating paths where $E(P)\cap M$ consists either of the odd or of the even indexed edges of $P$). We say that $P$ is $M'$-augmenting if it is an $M'$-alternating path of odd length. Hence if $P$ is $M'$-augmenting then $M'\triangle E(P)$ is a $2$-matching of size $|M'|+1$. In addition for a $2$-matching $M'$ and $v\in V(G)$ we denote by $d_{M'}(v)$ the number of edges that are incident to $v$ in $M'$. Let $\tau=\frac{n}{\log\log n}$ and $E_R=\{e_1,e_2,...,e_{\tau}\}$. For $0\leq t \leq \tau$ let $G_t=G\cup\{e_1,e_2,...,e_{t}\}$ and $M_t$ be a maximum $2$-matching of $G_t$. If $|M_t|<n$ let $v,w\in [n]$ be such that $d_{M_t}(v), d_{M_t}(w)\leq 1$. In the case that $d_{M_t}(v)=0$ we may let $w=v$. For $u\in V(G)$ we let $P_u$ be the shortest $M_t$-alternating path from $v$ to $u$ if such a path exists, otherwise we let $P_u=\emptyset$. Define the sets $$Q_v:=\{u\in V(G): v=u \text{ or }|P_u|= 0\text{ mod }2 \text{ and }P_u \neq \emptyset\}$$ and $$W_v:=\{u\in V(G): |P_u|= 1\text{ mod } 2\}.$$ Let $S$ be the subgraph of $G_t$ induced by $Q_v\cup W_v$. As $M_t$ is maximum every vertex $u\in W_v$ is incident to 2 edges in $M_t$ (otherwise $P_u$ is $M_t$-augmenting) and has 3 neighbors in $V(S)$, 1 defined by $P_u$ and 2 defined by $M_t$. Moreover every vertex in $Q_v$ has at least 2 neighbors in $V(S)$ and at least 1 in $W_v$, one defined by $M_t$ and all of its neighbors via edges not in $M$. Thus either $|Q_v| \geq 0.3|W_v|$ and $$\frac{2|E(S)|}{|V(S)|} \geq \frac{(2+0.3\cdot 3)|W_v|}{(1+0.3)|W_v|}> 2.23$$ or $|Q_v| \leq 0.3|W_v|$ and $$\frac{|E(S)|}{|V(S)|} \geq \frac{|W_v|+|W_v|/2}{1.3|W_v|}\geq 1.15$$ Thus either $V(S)$ spans at least $1.1|S|+1$ edges and therefore $|S| \geq \gamma n$ or $|S| \leq 34$. Now observe that as every vertex in $Q_v$ is incident to 2 edges in $M_t$ the number of vertices $u$ for which $P_u$ has length $\ell$ is at least $2,4,2,4,4,8,8$ and $16$ for $\ell=1,2,3,4,5,6$ and $7$ respectively. Thus $|S|>34$ and therefore $|S|\geq \gamma n.$ Now let $Q_v'=Q(v,M_t,G_t)$ be the set of vertices that are reachable from $v$ via an $M_t$-alternating path of even length. Observe that if $z\in N(Q_v')$ then $z$ is incident to some vertex in $Q_v'$ via an edge in $M_t$ and hence $|N(Q_v')| \leq 2|Q_v'|$. Indeed, assume otherwise. Then there exist $z\in N(Q_v')$ and $u\in Q_v'$ such that $\{u,z\} \in G_t\setminus M_t$ and $z$ does not have an $M_t$-neighbor in $Q_v'$. The edge $\{u,z\}$ gives rise to an $M_t$-alternating path $P$ from $v$ to $u$ to $z$. Now if $d_{M_t}(z)=0$ then $P$ is $M_t$-augmenting contradicting the maximality of $M_t$. Otherwise there exists some edge $\{z,z'\}\in M_t$. In such a case the path $P,\{z,z'\},z'$ witnesses the candidacy of $z'$ in $Q_v'$ which gives a contradiction. Finally observe that $V(S)\subset Q_v'\cup N(Q_v').$ As $|N(Q_v')| \leq 2|Q_v'|$ we have that $|Q_v'| \geq |S|/3 \geq \gamma n/3.$ For every vertex $u\in Q_v'$ the underlying $M_t$-alternating path $P_{v,u}$ from $v$ to $u$ defines a maximum $2$-matching $M_u=M_t\triangle E(P_{v,u})$ of $G_t$ such that $d_{M_u}(u),d_{M_u}(w)\leq 1$. Now, by repeating the same argument with $M_u$ in place of $M_t$ and $w$ in place of $v$ we can define in a similar manner the set $Q_{u,w}'$ (in place of $Q_v'$). This gives a set $\mathcal{M}$ of at least $\gamma^2n^2/18$ couples $(\{x,y\},M_{\{x,y\}})$ where $x\in Q_v'$, $y\in Q_{x,w} \cap V_1$, $M_{\{x,y\}}$ is a maximum $2$-matching of $G_t$ and $d_{M_{\{x,y\}}}(x),d_{M_{\{x,y\}}}(y)\leq 1$. Thus if $e_{t+1}=e$ for some $\{e,M_e\} \in \mathcal{M}$ then $\{e\}\cup M_e$ is a 2-matching of $G_{t+1}$ of size $|M_t|+1>|M_t|$. Hence, the probability that $G_\tau$ does not span a 2-factor is bounded above by \begin{align*} \Pr\bigg( Bin\bigg(\frac{n}{\log\log n},\frac{\gamma^2 n^{2}}{18}\bigg) \leq \frac{n}{(\log\log n)^4} \bigg)=o(n^{-1}). \end{align*} \end{proof} \textbf{Proof of Theorem \ref{thm:ham}}: We let $M_1$, $M_2$,...,$M_{k-1}$, $E_R$,$E'$, $G'=G\setminus E_R$ be the matchings, edge sets and graph promised by Lemma \ref{lem:kGreedy2}. We randomly partition $E_R$ into $k-1$ sets $R_1,R_2,...,R_{k-1}$ of size $\frac{n}{\log\log n}$. Having constructed Hamilton cycles $H_1,H_2,...,H_{i-1}$, $i< (k-3)/2$ such that $E(H_j)\setminus (M_{2j-1}\cup M_{2j})$ has size at most $\frac{n}{(\log\log n)^{6-j/k}}$ for $j\in[i-1]$ we construct a Hamilton cycle $H_i$ with $E(H_i)\subset E(G)\setminus \big(\cup_{j\in[i-1]}E( H_j)\big)$ such that $E(H_i)\setminus (M_{2i-1}\cup M_i)$ has size at most $\frac{n}{(\log\log n)^{6-i/k}}$. For that we apply Lemma \ref{lem:builtingmatch} with 2-matching $M_i'=(M_{2i-1}\cup M_{2i})\setminus \big(\cup_{j\in[i-1]} E(H_j)\big)$, graph of minimum degree 4 $G_i'=G'\setminus \big(\cup_{j\in[i-1]} H_j\big)$, the set of random edges $R_i$, the set of forbidden edges $E_i'=E'\cup \big(\cup_{j\in[i-1]} E(H_j)\big) \cup \big(\cup_{j\in[i-1]} R_j\big)$, $\beta=\beta_1$, $\gamma=\gamma_1$ (as in Lemma \ref{lem:expansion}) and $\epsilon= 9i/10k$. Then, $|M_i'|\geq |M_{2i-1}|+|M_{2i}|- \sum_{j=1}^{i-1} \frac{n}{(\log\log n)^{6-j/k}} \geq n- \frac{n}{(\log\log n)^{6-\epsilon}}.$ Lemma \ref{lem:expansion} implies that the rest of the conditions of Lemma \ref{lem:builtingmatch} hold with probability $1-o(n^{-1})$. Thus with probability $1-o(n^{-1})$, $G_i'\cup R_i$ spans a Hamilton cycle $H_i$ that intersects $M_i'$ in at least $n-\frac{n}{(\log\log n)^{6-9i/10k+i/10k}}= n-\frac{n}{(\log\log n)^{6-i/k}}.$ Finally if $k$ is even then $M_{k-1}\setminus \big(\cup_{j\in[(k-2)/2]} E(H_j)\big)$ is a matching of size at least $$n/2-O\bigg(\sum_{j=1}^{(k-2)/2} \frac{n}{(\log\log n)^{6-j/k}}\bigg)=n/2-o(n).$$ On the other hand, if $k$ is odd then $M_{last}=M_{k-2} \cup M_{k-1}\setminus \big(\cup_{j\in[(k-3)/2]} H_j\big)$ is a 2-matching of size $n-o\bfrac{n}{(\log \log n)^4}$. Let $G_{last}=G'\setminus \big(\cup_{j\in[(k-3)/2]}E( H_j)\big)$. Then $G_{last}$ has minimum degree 3 and Lemma \ref{lem:builting2factor} implies that $G_{last}\cup R_k$ spans a 2-factor with probability $1-o(n^{-1})$. \qed \section{Packing Hamilton Cycles in $G_{t}^{(k)}$}\label{sec:gnp} Recall we denote by $G_0,G_1,...,G_{\binom{n}{2}}$ the random graph process, $V(G_0)=[n]$. For the proof of Theorem\ref{thm:hamCores} we will need Lemma \ref{lem:expansion2} which replaces Lemma \ref{lem:expansion} in the case that the underlying graph $G_i$ has sufficiently many edges. Its proof is found at Appendix \ref{app:lemmas2}. \begin{lemma}\label{lem:expansion2} W.h.p. for $k^{100}n\leq i\leq n\log n$, \begin{itemize} \item[(i)] every set $S\subset V(G)$ of size $|S| \leq \frac{3n}{\log^2 n}$ spans less than $1.1|S|+1$ edges in $G_i$, \item[(ii)] there does not exists a set $S\subset V(S)$ of size $\frac{n}{\log^2 n} \leq |S| \leq \frac{n}{100k}$ such that $N(S)\cup S$ induces a connected subgraph of $G_i$ and $|N(S)| < k|S|$, \item[(iii)] $|V(G_i^{(k)})| \geq (1-e^{\frac{i}{40n}})n$, \item [(iv)] for every subgraph $F$ of $G_i$ of maximum degree $k-2$ the graph $G_i^{(k)}\setminus F$ spans a matching of size at least $0.5n-\frac{n}{\log\log n}$. \end{itemize} \end{lemma} {\em Proof of Theorem\ref{thm:hamCores}(sketch):} We consider 3 distinct intervals that partition $\{0,1,...,n(n-1)/2\}$. \noindent \textbf{Case 1:} $0\leq i \leq k^{101}n$. The fact that $G_{i}^{(k)}$ is either empty or has order linear in $n$ and it is distributed as $G_{n,m}^{\delta \geq k}$ together with Theorem \ref{thm:ham} implies that w.h.p. $G_i^{(k)}\in {\mathcal A}_k'$ for $i\leq k^{101}n$. \noindent \textbf{Case 2:} $k^{101} n\leq i \leq n\log n$. For this regime we condition on the events described at Lemma \ref{lem:expansion2} occurring. We first reveal the edges of $G_{i/k}$ and then the edges of $G_i$ that are not incident to vertices of $V(G_{i/k}^{(k)})$. We let $F_i$ be the graph consisting of the edges revealed so far and $R$ be the set of edge of $G_i$ that have not been revealed yet. Observe that as every vertex outside $G_{i/k}^{(k)}$ is incident to the same set of edges in both $F_i$ and $G_i$ and $G_{i/k}^{(k)} \subseteq G_i^{(k)}$ we have that $V(F_i^{(k)})=V(G_i^{(k)})$ and $F_i^{(k)} \subseteq G_i^{(k)}$. In addition with $V_1=V(G_{i/k}^{(k)})$ part (iv) of Lemma \ref{lem:expansion2} implies that $|V_1| \geq (1-e^{i/40n})n$. Moreover one can show that $R\geq 0.5i$ with probability $1-o(n^{-2})$ and $R$ is distributed uniformly among all set of edges spanned by $V_1$, of size $|R|$, that do not intersect $E(G_{i/k}^{(k)})$. We randomly split $R$ into $k-1$ sets $E_1,E_2,...,E_{k-1}$ each of size at least $\lfloor 0.5i/(k-1) \rfloor$. We then construct the Hamilton cycles of $G_{i}^{(k)}$ one by one. Having constructed Hamilton cycles $H_1,H_2,...,H_{j-1}$, $j< (k-2)/2$ of $G_i^{(k)}$ such that $H_\ell$ is spanned by $F_i^{(k)} \cup R_\ell$ for $\ell <j$ we construct a Hamilton cycle $H_j$ spanned by $F_j'\cup R_j$ where $F_j'=F_i^{(k)}\setminus \big( \cup_{\ell \in[j-1]} H_j\big)$. Observe that $F_j'$ has minimum degree 4. Let $R_j=\{e_1,e_2,...,e_{\tau_j}\}$, where $\tau_j=|R_j|\geq-1 + 0.5i/k$. For $\ell\in [0.5i-1]$ let $F_{j,\ell}=F_j'\cup\{e_1,e_2,...,e_\ell\}$, $P_\ell$ be a longest path of $F_{j,\ell}$ and $v$ one of the endpoints of $P_\ell$. Let $End(P_\ell,v)$ be the set of endpoints such that if $u\in End(P_\ell,v)$ then there exists a sequence of Posa rotations starting from $P_\ell$ that outputs a longest path in $F_{j,\ell}$ from $v$ to $u$. As shown in the proof of Claim \ref{claim:Ham:2} we have that there exists $S\subset End(P_\ell,v)\cup N(End(P_\ell,v))$ such that $S$ spans at least $1.1|S|$ edges of $F_i'$. In addition, P\'osa Lemma states (see \cite{abook}) states that $$|N(End(P_\ell,v)|<2|End(P_\ell,v)|.$$ Thus Lemma \ref{lem:expansion2} implies that $|End(P,v)| \geq \frac{n}{100k}$, and therefore $|End(P_\ell,v)\cap V_1| \geq \frac{n}{1000k}$. The rest of the argument is identical to the one used in the proof of Lemma \ref{lem:builtingmatch} and gives that the probability that $F_i'\cup R_i$ does not span a Hamilton cycle is bounded by, $$\Pr\bigg(Bin\bigg(0.5i,\frac{n}{2000k}\bigg)\leq n\bigg)\leq \Pr\bigg(Bin\bigg(0.5k^{101}n,\frac{n}{1000k}\bigg)\leq n\bigg)=o(n^{-2}).$$ In a similar manner in the case that $k$ is odd we can built the last 2-matching after pilling off the $(k-3)/2$ Hamilton cycles. On the other hand in the case that $k$ is even, with $H=\cup_{1\leq j\leq(k-2)/2}H_j$, Lemma \ref{lem:expansion2} implies that $F_i^{(k)}\setminus H$ spans a matching of size at least $0.5|V(G^{(k)}_i)|-\frac{n}{\log\log n}$. \noindent \textbf{Case 3:} $n\log n < i \leq \binom{n}{2}$. Case 2 implies that w.h.p. $G_{n\log n}^{(k)} \in {\mathcal A}_k'$. Thus, since $G_i\subset G_{i+1}$ for $i\geq 0$ we have, \begin{align*} \Pr( \exists i\geq n\log n: G_i^{(k)}\notin {\mathcal A}_{k}') \leq \Pr( G_{n\log n} \notin {\mathcal A}_{k}')+\Pr( G_{n\log n} \neq G_{n\log n}^{(k)})=o(1). \end{align*} \qed
\section{INTRODUCTION} \label{sec:introduction} ''{\it The eyes which are the windows of the soul.}`` \\ \rightline{--- Plato (427 BC - 347 BC)} \\ Eye movements are crucial but implicit cues for determining people's attention. Gaze estimation enables the study of visual perception mechanisms in humans, and has been used in many fields, such as action recognition\cite{Fathaliyan-Frontiers2018}, situation awareness estimation\cite{Dini-IROS2017}, and driver attention analysis\cite{Maekawa-ICCVW2019}. It is also a non-verbal communication method, and thus, it can be applied to shared autonomy \cite{Admoni-AAAIS2016} or teleoperation \cite{Webb-ACC2016} in the context of Human-Robot Interaction (HRI). Recent studies have enabled human attention mapping in 3D environments using mobile eye-tracking glasses\cite{Munn-ETRA2008}\cite{Paletta-IRCV2013}. Most approaches compute a 3D gaze by extending a measured 2D gaze vector from a camera pose estimated by visual localization or motion capture systems in a pre-built static 3D map. They are assumed to operate in static environments; however, the real world is a place of constant change, with objects appearing and disappearing from the scenes. Human attention analysis in both spatial and temporal domains is still an open problem, which when solved will help determine human behavior in the real world. To address this issue, we propose a comprehensive framework for 4D attention mapping (see Fig.\ref{fig:eyecatch}). The main contributions of this study are three-fold: \begin{itemize} \item A new framework, {\it 4D Attention}, is proposed for capturing human attention to static and dynamic objects by assembling 6-DoF camera localization, rapid gaze projection, and instant dynamic object reconstruction. Human attention is accumulated on each 3D mesh model, which makes gaze mapping much more meaningful, for example, the semantic analysis of perceptual activities rather than generating cluttered 3D gaze point clouds. \item The framework is designed so that scene rendering plays a central role. This makes the entire system simple and does not require additional map or object model representations for localization and attention mapping. Additionally, it facilitates a unified attention-mapping procedure regardless of the target objects. \item We examined the accuracy and precision of our method using a moving target board whose ground truth position was measured by a total station. Additional experiments for monitoring human attention in the real world demonstrated the capability of analyzing human attention in static and dynamic targets including maps, household items, and people, during the free movement of the subject. \end{itemize} \begin{figure}[t] \vspace{2mm} \begin{center} \includegraphics[width=0.9\linewidth]{./img/eyecatch.pdf} \end{center} \vspace{-3mm} \caption{4D attention analysis in a dynamic environment. Given first-person view with the subject's 2D gaze, it projects human attention onto the static 3D map and dynamic object models employing visual localization, rapid intersection search, and instance object reconstruction.} \label{fig:eyecatch} \vspace{-5mm} \end{figure} \begin{figure*}[t] \vspace{2mm} \begin{center} \scriptsize \includegraphics[width = 0.9\linewidth ]{./img/overview_imu_option.pdf}\\ \end{center} \vspace{-4mm} \caption{Overview of 4D Attention: In the localization layer, we compute the pose of the eye-tracker with C${}^{*}$\cite{Oishi-RAL2020} based on images from a scene camera. Fusing IMU data with the raw pose estimate can further boost and stabilize visual localization\cite{Lynen-IROS2013}. In the 3D gaze layer, the intersection of a gaze ray and the environment map is calculated using the direct 2D-3D gaze association via scene rendering with an ID texture. The 4D gaze layer incorporates any object reconstruction components into the framework to instantiate dynamic objects, which facilitates the analysis of spatio-temporal human attention in the real world. } \vspace{-4mm} \label{fig:overview} \end{figure*} \section{RELATED WORK} \label{sec:related_work} {\bf Eye movement patterns: } Eye movements imply visual perception activities. Several approaches have inferred or determined perceptual activities based on the observations from electrooculography (EOG). Bulling \emph{et al.}\xspace \cite{Bulling-TPAMI2011} developed a pioneering system that classifies several activities from eye movement patterns by utilizing machine learning. Ishimaru \emph{et al.}\xspace \cite{Ishimaru-UbiComp2014} also determined daily activities including typing, reading, eating, and talking, using signals from EOG glasses. This approach allows us to identify the current activity of a subject without complex settings, and can be applied to HCI to provide relevant services. {\bf 2D contextual analysis: } However, human beings live in a context. Visual perception activities are not independent of the surrounding environment; in fact, they are induced by ``attractive'' objects in the scene. Eye-tracking and gaze overlay on 2D camera views make it possible to determine the focus of the subject, as in \cite{Pelz-EI2011}. For semantic human attention analysis in natural environments, Fritz and Paletta \cite{Fritz-ICIP2010} introduced object recognition in mobile eye tracking using local image descriptors. A similar approach can be observed in \cite{Toyama-ETRA2012}, which identifies objects fixated by the subject for a museum guide. \cite{Harmening-SAGA2013} further progressed toward online object-of-interest recognition using a hierarchical visual feature representation. {\bf 3D gaze mapping: } For the holistic estimation of human attention, recent techniques have attempted to obtain fixations in the real 3D world leaving the image plane. \cite{Pfeiffer-ETRA2012} and \cite{Dini-IROS2017} extended 2D gaze mapping by combining it with a motion capture system to track the pose of gaze glasses, which enables the measurement of the 3D point of interest. \cite{Pfeiffer-ETRA2016a} built a similar system relying on visual markers for monocular camera tracking and 3D gaze analysis. However, they require a complex setup of multiple sensors, making the measurement area small and unscalable to large environments. Thus, several approaches compute the 3D gaze by localizing an agile monocular camera using visual localization or structure-from-motion. \cite{Munn-ETRA2008} was the pioneering work, and was followed by promising techniques such as \cite{Paletta-IRCV2013, Hagihara-AH2018} where they estimated camera poses using visual features and projected 3D gaze information onto the pre-built 3D environment map. {\bf Toward attention analysis in the real world: } 3D gaze mapping facilitates the analysis of human attention regardless of the scale of the environment; however, they still operate only in the static environment. Attention analysis in dynamic situations is still an open problem; it is necessary to address the {\it spatio-temporal} attention analysis to truly comprehend perceptual activities in the real world. \section{PROPOSED METHOD} \label{sec:proposed_method} \subsection{System overview} In this study, we propose a comprehensive framework to capture {\it 4D human attention}, which is attention in the spatial and temporal domains in dynamic environments. A schematic overview of the proposed system is depicted in Fig.\ref{fig:overview}. Obtaining 4D human attention from eye-tracking glasses with a scene camera has three main problems that need to be solved: robust camera localization, rapid 3D gaze mapping, and instant processing of dynamic objects. Principally, 4D attention mapping is performed by projecting a first-person 2D human gaze onto a 3D environment map (static) and moving objects (dynamic). It first requires accurate and stable 6-DoF camera localization even in dynamic environments, which means that appearance of the pre-built 3D map and current view can be significantly changed. Additionally, given the camera pose, the system has to compute the intersection of the gaze ray and target object surface in real-time to record the 3D distribution of the subject's interest. Furthermore, dynamic objects such as humans or daily objects should not stay in the same position, but should rather change their poses. Therefore, they cannot be captured in the 3D map in advance; instead, they should be processed on the fly. In this section, we describe the major components of the framework shown in Fig.\ref{fig:overview} that are assembled to address these issues and capture 4D attention in the real world. \begin{figure*}[t] \vspace{2mm} \begin{center} \scriptsize \includegraphics[width = 0.9\linewidth]{./img/projection.pdf}\\ \end{center} \vspace{-3mm} \caption{ID texture mapping for direct 2D and 3D gaze association: The scene rendering component synthesizes an image from the estimated camera pose to simulate the first-person view. Different textures help to comprehend the scene. Here, we attach an ID texture to the 3D environment map to directly look up the surface with which the input 2D gaze intersects. Gaze hits are accumulated on an attention texture \cite{Pfeiffer-ETRA2016b}, which simplifies the management of human attention information.} \vspace{-2mm} \label{fig:gaze_mapping} \end{figure*} \subsection{Localization} \label{subsec:localization} \subsubsection{Monocular camera localization} Visual localization is used to infer the pose of an agile monocular camera in a given 3D map. It can be categorized as either indirect methods via feature point matching, or direct methods via appearance comparison. Although major 3D gaze mapping methods\cite{Paletta-IRCV2013}\cite{Hagihara-AH2018} rely on indirect methods to estimate the camera pose, they require the construction and maintenance of an extra feature point 3D map for localization. As will be explained later in Section \ref{subsec:gaze_mapping}, the subject's gaze is projected and accumulated on the dense 3D environment map (or dynamic object models); thus, the requirement doubles the map building cost. It also incurs other problems such as a 7-DoF exact alignment (including scale) between the environment and feature point maps. Therefore, for a simple and straightforward system, we employ a direct localization method, specifically C${}^{*}$\cite{Oishi-RAL2020}, which facilitates the localization of the agile monocular camera only with the colored 3D environment map. It leverages the information-theoretic cost, the Normalized Information Distance (NID), to directly evaluate the appearance similarity between the current camera view and 3D map. It achieves high robustness to large appearance changes owing to lighting conditions, dynamic obstacles, or different sensor properties\cite{Oishi-RAL2020}, and results in minimal effort in map management. Given the current view $I_t$, C${}^{*}$ estimates the camera pose $\mathbf{T}_W^t$ in the world coordinate system $W$ via $\mathbb{SE}(3)$ local tracking against a synthetic key frame $I_k$ rendered at a known pose $\mathbf{T}_W^k$: \begin{equation} \begin{aligned} \hat{\mathbf{T}}_k^t & = {\argmin_{\mathbf{T}_k^t}} \; \; {\delta I}_{NID} \left(I_t, I_k, \mathbf{T}_k^t \right), \\ \mathbf{T}_W^t & = \hat{\mathbf{T}}_k^t \circ \mathbf{T}_W^k. \end{aligned} \label{eq:minimization} \end{equation} C${}^{*}$ reduces the localization problem to alternate local tracking and occasional key frame rendering for efficiency, which leads to 6-DoF real-time localization regardless of the 3D map scale. The NID metric between the current frame $I_t$ and key frame $I_k$ is given as follows: \begin{equation} {\delta I}_{NID}\left(I_t, I_k, \mathbf{T}_k^t \right) \equiv \frac{H_{t,k}\left(\mathbf{T}_k^t \right)-I_{t,k}\left(\mathbf{T}_k^t \right)}{H_{t,k}\left(\mathbf{T}_k^t \right)} \label{eq:NID} \end{equation} where $H_{t,k}$ and $I_{t,k}$ denote the joint entropy and mutual information calculated based on the color co-occurrence in $I_t$ and $I_k$, respectively. To determine the most likely relative pose $\mathbf{T}_k^t$, gradient-based optimization is performed. Specifically, starting from the given initial guess or previously estimated pose, the BFGS is employed to iteratively solve Eq.\ref{eq:minimization} according to the Jacobian of the NID as follows: \begin{equation} \begin{aligned} {}^{(i+1)} \mathbf{T}_k^t & = {}^{(i)} \mathbf{T}_k^t - \alpha B_k^{-1} \frac{d \delta I_{NID}}{d {}^{(i)}\mathbf{T}_{k}^{t}}, \\ \frac{d \delta I_{NID}}{d \mathbf{T}_{k}^{t}} & = \frac{\left(\frac{d H_{t,k}}{d \mathbf{T}_{k}^{t}}-\frac{d I_{t,k}}{d \mathbf{T}_{k}^{t}}\right) H_{t,k}-\left(H_{t,k}-I_{t;k}\right) \frac{d H_{t,k}}{d \mathbf{T}_{k}^{t}}}{H_{t,k}^{2}}. \end{aligned} \label{eq:bfgs} \end{equation} \subsubsection{Visual-Inertial integration for rapid head and eye movement tracking} C${}^{*}$ is capable of providing reliable camera poses at several tens of hertz. To track the rapid head movements of the subjects, we further fuse the localization results and measurements from an Inertial Measurement Unit (IMU) calibrated to the camera in a loosely coupled manner\cite{Lynen-IROS2013}. The framework allows us to achieve more than several hundreds of hertz estimation rates according to the IMU rates. Simultaneously, it significantly stabilizes visual localization by forming a closed loop that feeds the output pose into the localizer as the next initial guess of the optimization. Localization boosting and stabilization are suitable for real-time gaze projection, as described in the following section. \subsection{3D gaze projection onto the environment map} \label{subsec:gaze_mapping} Given the camera pose (subject's head pose) and gaze position on the 2D image, the 3D human gaze can be recovered by generating a 3D ray beginning from the camera through the gaze point. To determine the fixation point, the intersection of the gaze ray and target object must be calculated. Ray casting can be computationally expensive for real-time operation. Therefore, Paletta \emph{et al.}\xspace \cite{Paletta-IRCV2013} pre-computed a hierarchical map representation, specifically, an Oriented Bounding Box Tree (OBB-Tree), and traversed the tree to rapidly find the intersection. In \cite{Takemura-ToHMS2014} and \cite{Matsumoto-MobileHCI2019}, the authors estimated the 3D gaze point by first applying Delaunay triangulation to the feature point map, detecting the triangular plane that includes the 2D gaze, and finally investing the sub-mesh 3D gaze point into the world coordinate system from the triangle vertices. Although these methods work efficiently, they require pre-computation to build certain data structures for 3D gaze mapping, and their resolutions significantly affect the balance between the runtime computation cost and mapping accuracy. Furthermore, when dealing with dynamic objects that are not included in the pre-built 3D environment map, a more flexible scheme that does not require the construction of the data structure each time is preferable. Thus, for a unified framework of human gaze projection, we propose ID texture mapping as depicted in Fig.\ref{fig:gaze_mapping}. Texture mapping is a very popular method for attaching a highly detailed appearance to a geometric model that provides realistic rendering images. Given a 3D mesh model, its texture image, and per-vertex UV coordinates, we can generate a textured 3D model with GPU acceleration. Any texture images are available in texture mapping; therefore, we attach a 32-bit integer texture that contains an unique ID of each pixel in its position, for example, $p(x, y) = y * width + x$, for gaze projection. Specifically, we determine the pixels that are currently observable by rendering the 3D map from the camera pose with the ID texture, and directly find the 3D gaze point by accessing the pixel corresponding to the 2D gaze point. In addition to the simple setup and direct 2D-3D gaze association, the framework offers other benefits with the use of different types of textures. For example, by preparing another texture filled with zero and counting gaze hits, attention accumulation can be easily managed on a 2D image similar to the {\it attention texture} proposed in \cite{Pfeiffer-ETRA2016b}. Additionally, overlaying a texture with an object class or semantics on the ID texture enables the semantic understanding of the subject's perceptual activities \cite{Hagihara-AH2018} in a unified pipeline. ID texture mapping provides a simple yet efficient way of projecting the human gaze onto any geometric model, which is not limited to the map data. In the next section, we extend this framework to dynamic objects for 4D attention mapping. \begin{figure}[t] \vspace{2mm} \scriptsize \begin{center} \includegraphics[width = 0.9\linewidth]{./img/dynamic_object_texturing.pdf}\\ \end{center} \vspace{-3mm} \caption{Texturing dynamic objects: Attention mapping onto dynamic objects is performed in the same way as the case of 3D environment maps by employing the corresponding ID textures. Notably, attaching different textures, for example, a semantic texture, helps to determine perceptual activities in the spatio-temporal domain. } \vspace{-4mm} \label{fig:dynamic_objects} \end{figure} \begin{figure*}[t] \vspace{2mm} \scriptsize \begin{center} {\tabcolsep = 2.0mm \begin{tabular}{ccc} \includegraphics[height = 0.22\linewidth]{./img/gazeEvaluation/evaluation1_overview.pdf} & \includegraphics[height = 0.22\linewidth]{./img/gazeEvaluation/evaluation2_overview.pdf} & \includegraphics[height = 0.22\linewidth]{./img/gazeEvaluation/evaluation3_overview.pdf} \\ (a) Evaluation 1: Static target $\times$ Walking around & (b) Evaluation 2: Dynamic target $\times$ Standing still & (c) Evaluation 3: Dyamic target $\times$ Following \\ \end{tabular}} \end{center} \caption{Overview of the quantitative evaluation: AprilTag\cite{Olson_ICRA2011} was used as a target object to evaluate our attention mapping. Our framework generated successive 3D gaze points by finding gaze intersections while the subject stared at its center. The target board and subject changed their states: (Static or dynamic), and (walking around, standing still, or following), respectively, to demonstrate the robustness of the framework to scene dynamics. Notably, AprilTag was embedded in the 3D map in Evaluation 1, whereas it was reconstructed on the fly in Evaluations 2 and 3.} \label{fig:quantitative_overview} \vspace{-3mm} \end{figure*} \subsection{Dynamic object handling for 4D attention mapping} \label{subsec:dynamic_object_handling} Objects that do not exist in the map building phase cannot be stored in the 3D environment map, which means that the map data should only record static objects. However, many dynamic objects such as humans or household items are observed in daily life, and they seem to have ``illegally'' appeared in the static 3D map. The temporal gap between the mapping and runtime phases causes the absence or presence of dynamic objects, which leads to incorrect gaze projection. Most conventional works only focus on static scenes and have no choice but to ignore dynamic objects. To analyze human gaze in dynamic scenes, Fathaliyan \emph{et al.}\xspace \cite{Fathaliyan-Frontiers2018} proposed a 3D gaze tracking method that relies on a marker-based motion capture system installed in a small space. It inquires the motion capture tabletop objects' poses in a moment and computes the intersections between the object models and gaze vector; however, the settings are costly and the model does not scale to larger environments. For wearable 3D gaze acquisition outside the laboratory, Qodseya \emph{et al.}\xspace \cite{Qodseya-ECCVW2016} and Hausamann \emph{et al.}\xspace \cite{Hausamann-ETRA2020} developed eye-trackers equipped with depth sensors. They overlay 2D gaze points on the depth image and directly reconstruct the 3D human gaze. However, the scheme is highly sensitive to depth noise and the maximum measurement range. Moreover, the 3D gaze information is represented as cluttered 3D point clouds, which makes gaze analysis less meaningful than accumulation on model surfaces. To address this, we enable the framework to install additional components of object reconstruction for instantiating dynamic objects not captured in the 3D environment map. The recent development of object recognition and tracking techniques has facilitated the determination of full 3D shapes of target objects from monocular images on the fly. Here, we exploit two methods to handle rigid and non-rigid objects, specifically household items and human models, respectively, for 4D attention mapping. Notably, any desired components that estimate the poses and 3D shapes of specific objects can be incorporated as explained below. \subsubsection{Household item models (Rigid objects)} We introduce a pose detection and tracking method\cite{Pauwels-TCSVT2016} into our system. Given the mesh models and textures of the target objects, it facilitates the recovery of the 6-DoF poses of hundreds of objects in real-time through the proposed scene simulation with SIFT features. The acquired information is sent to the same process as the 3D environment maps described in Section \ref{subsec:gaze_mapping}; By attaching an ID texture to each model (Fig.\ref{fig:dynamic_objects}) and rendering it at the estimated 6-DoF pose, we can easily associate the 2D human gaze with the object model surface. Notably, Multiple Render Targets (MRT) on OpenGL are used to create an integer mask image that helps to distinguish the categories and individuals captured in the rendered view (see the bottom right of Fig.\ref{fig:eyecatch}). In the following experiments, an 8-bit integer mask was rendered in addition to the ID image in the MRT manner to distinguish up to 256 objects belonging to three categories: map, object, and human. \subsubsection{Human models (Non-rigid objects)} The human model is a representative example of non-rigid objects that are important for analyzing perceptual activity in the real world. Humans change their postures unlike rigid objects; therefore, the reconstruction includes non-rigid deformation, making it more complicated than just detecting 6-DoF poses. In this research, we use the state-of-the-art method, FrankMocap\cite{Rong-arXiv2020}, to instantiate humans in a 3D environment map. It fits a statistical body model SMPL-X\cite{Pavlakos-CVPR2019} to each person captured in the input image and provides their shape and pose parameters. The renderer in our framework subscribes the parameters to reconstruct the human models on-demand and examines whether the 3D human gaze hits the surfaces as in the rigid objects. \section{EXPERIMENTS} \label{sec:experiments} \subsection{Setup} In this section, we verify the capability of the proposed framework to recover 4D human attention in dynamic environments. We first quantitatively evaluated the accuracy and precision of the recovered gaze points using a dynamic target marker, followed by demonstrations in real situations. To build 3D environment maps, we used LiDAR, Focus3D (FARO Technologies, Inc.), which enabled us to capture dense and colored 3D point clouds. A panoramic spherical image can be generated by arranging each vertex color; we used it as a texture of the 3D map while thinning out some vertices to save GPU memory usage. Notably, our method only assumes that colored or textured 3D models are available for localization and gaze mapping, and thus it also operates on 3D geometric models reconstructed with different sensors, for example, RGB-D SLAM \cite{Lee-CVPR2020}, similar to \cite{Paletta-IRCV2013}. The rendering and localization components rely on GPU parallelization; a GeForce GTX2080 performed the computations in all the experiments. We also used a wearable eye tracker, Tobii Pro Glasses 3 (Tobii Technology, Inc.) to capture first-person views with the subject's 2D gaze information and IMU data. \subsection{Performance evaluation} To evaluate the proposed attention mapping, AprilTag \cite{Olson_ICRA2011}, which provides reliable 6-DoF marker poses, was employed as shown in Fig.\ref{fig:quantitative_overview}, whereas the subject was changing the relative positions and its states. We asked the subject to stare at the center of the target board ($0.24 \times 0.24$ [m]) wearing the eye-tracker, and our method generated the corresponding 3D gaze points. In Evaluation 1, the board was embedded in the 3D map; thus, we calculated the Absolute Position Error (APE) between the generated 3D gaze points and the center of the board. In Evaluations 2 and 3, the ground truth trajectories of the agile target board were obtained by tracking a total station prism attached to the board with the known relative transformation using a Trimble S7 (Trinble Navigation, Limited.). Subsequently, we synchronized the pairs of trajectories based on system timestamps to evaluate the Absolute Trajectory Error (ATE)\cite{Zhang-IROS2018} with a least-squares transformation estimation\cite{Umeyama-TPAMI1991}, in addition to APE. Notably, the 3D trajectory comparison computes a rigid transformation that minimizes the positional errors between the two point clouds. The minimization process cancels the systematic bias underlying the framework, which is caused by reasons such as eye-camera miscalibration. Therefore, the ATE is approximately equivalent to the precision of our framework, whereas the APE is equivalent to the accuracy. Table \ref{tab:quantitative} and Figure \ref{fig:quantitative} present the evaluation results. --- {\bf Evaluation 1:} We demonstrated the performance of our framework in a static scene to compare it with the most relevant work \cite{Paletta-IRCV2013} as a baseline. Specifically, we implemented \cite{Paletta-IRCV2013} whose localizer was replaced with state-of-the-art indirect visual localization\cite{Campos-TRO2021} for a comparison in the same 3D map retaining the concept of the method. Compared with \cite{Paletta-IRCV2013}, 4D attention achieved high accuracy of 3D gaze mapping benefitting from the rendering-centerd framework such as direct localization and ID texture mapping, which suppress the systematic error. {\bf Evaluation 2:} The subject watched the center of the moving target standing at four different positions to evaluate the influence of proximity following the evaluations in previous studies\cite{Paletta-IRCV2013}\cite{ Hagihara-AH2018}. Overall, although the APE (inaccuracy) increased proportionally with the distance from the target board, the framework successfully suppressed the increase in the ATE (imprecision). {\bf Evaluation 3:} The subject walked around a $4 \times 6$ [m] space to follow the moving target board approximately 1.5 [m] behind while watching the center. Notably, the subject and the person to follow held an assistant rope to maintain their distance. Although the proposed framework slightly increased the APE and ATE owing to the necessity of the 6-DoF and instant object reconstruction in a complicated situation, it successfully facilitated valid attention mapping even in highly dynamic environments. \begin{table}[t] \vspace{2mm} \caption{Errors of 3D gaze points in the quantitative evaluation.} \label{tab:quantitative} \scriptsize \vspace{-4mm} \begin{center} {\tabcolsep = 1.3mm \begin{tabular}{l|cc|c|cc} \hline No. & object & subject & distance [m] & APE [m] & ATE [m] \\ & state & state & from board & ($\simeq$ inaccuracy) & ($\simeq$ imprecision) \\ \hline \hline 1 & static & walking & approx. & $0.034 \pm 0.015$ & - \\ & & around & 1.0 - 2.5 & $0.115 \pm 0.021$\textdagger & - \\ \hdashline[0.5pt/1pt] & & & 1.0 & $0.028 \pm 0.016$ & $0.020 \pm 0.012$ \\ 2 & dynamic & standing & 1.5 & $0.034 \pm 0.012$ & $0.017 \pm 0.011$ \\ & & still & 2.0 & $0.049 \pm 0.019$ & $0.034 \pm 0.017$ \\ & & & 2.5 & $0.070 \pm 0.025$ & $0.034 \pm 0.018$ \\ \hdashline[0.5pt/1pt] 3 & dynamic & following & approx. 1.5 & $0.046 \pm 0.0092$ & $0.024 \pm 0.014$ \\ \hline \end{tabular}} \end{center} \vspace{-1mm} \textdagger : Errors of 3D gaze points generated by \cite{Paletta-IRCV2013} (our implementation) as a baseline. \vspace{-4mm} \end{table} \begin{figure}[t] \vspace{2mm} \begin{center} \scriptsize \includegraphics[width=0.85\linewidth]{./img/gazeEvaluation/evaluation1.pdf} \\ (a) Evaluation 1: 4D Attention (left) and \cite{Paletta-IRCV2013} (right)\vspace{1mm}\\ \includegraphics[width=0.85\linewidth]{./img/gazeEvaluation/evaluation2_1m.pdf} \\ (b) Evaluation 2 (1 m) \vspace{1mm}\\ \includegraphics[width=0.85\linewidth]{./img/gazeEvaluation/evaluation2_1dot5m.pdf} \\ (c) Evaluation 2 (1.5 m) \vspace{1mm}\\ \includegraphics[width=0.85\linewidth]{./img/gazeEvaluation/evaluation2_2m.pdf} \\ (d) Evaluation 2 (2 m) \vspace{1mm}\\ \includegraphics[width=0.85\linewidth]{./img/gazeEvaluation/evaluation2_2dot5m.pdf} \\ (e) Evaluation 2 (2.5 m) \vspace{1mm}\\ \includegraphics[width=0.85\linewidth]{./img/gazeEvaluation/evaluation3_1dot5m.pdf} \\ (f) Evaluation 3 \\ \end{center} \vspace{-3mm} \caption{Quantitative evaluation results: The 3D gaze points obtained in each situation were compared with the ground truth (see also Table \ref{tab:quantitative}). The proposed framework overwhelmed the competitive method\cite{Paletta-IRCV2013} and achieved high-precision 4D gaze mapping in every case. However, the bias was clearly observed in the gaze accumulation, and the accuracy proportionally decreased as the distance from the target board increased. The results imply that our framework is capable of providing stable gaze projection onto dynamic objects, and strict gaze-camera calibration of eye-tracking glasses may improve the accuracy cancelling the systematic error.} \label{fig:quantitative} \vspace{-4mm} \end{figure} \begin{figure}[t] \vspace{2mm} \begin{center} \scriptsize \begin{flushleft} first-person view \end{flushleft} {\tabcolsep = 0.2mm \begin{tabular}{cccc} \includegraphics[width = 0.24\linewidth]{./img/experiment1/cam/experiment1_4_cam.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment1/cam/experiment1_5_cam.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment1/cam/experiment1_6_cam.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment1/cam/experiment1_10_cam.png} \\ \end{tabular}} \\ \vspace{-2.5mm} \begin{flushleft} 4D attention \end{flushleft} \vspace{-2mm} {\tabcolsep = 0.2mm \begin{tabular}{cccc} \includegraphics[width = 0.24\linewidth]{./img/experiment1/4d/experiment1_4.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment1/4d/experiment1_5.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment1/4d/experiment1_6.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment1/4d/experiment1_10.png} \\ \end{tabular}} \\ (a) Case 1: Observe physical actions of a person \vspace{-1mm} \begin{flushleft} first-person view \end{flushleft} \vspace{-2mm} {\tabcolsep = 0.2mm \begin{tabular}{cccc} \includegraphics[width = 0.24\linewidth]{./img/experiment2/cam/experiment2_3_cam.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment2/cam/experiment2_4_cam.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment2/cam/experiment2_5_cam.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment2/cam/experiment2_8_cam.png} \\ \end{tabular}} \\ \vspace{-2.5mm} \begin{flushleft} 4D attention \end{flushleft} \vspace{-2mm} {\tabcolsep = 0.2mm \begin{tabular}{cccc} \includegraphics[width = 0.24\linewidth]{./img/experiment2/4d/experiment2_3.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment2/4d/experiment2_4.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment2/4d/experiment2_5.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment2/4d/experiment2_8.png} \\ \end{tabular}} \\ (b) Case 2: Take a Coffee break \vspace{-1mm} \begin{flushleft} first-person view \end{flushleft} \vspace{-2mm} {\tabcolsep = 0.2mm \begin{tabular}{cccc} \includegraphics[width = 0.24\linewidth]{./img/experiment3/cam/experiment3_3_cam.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment3/cam/experiment3_4_cam.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment3/cam/experiment3_8_cam.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment3/cam/experiment3_10_cam.png} \\ \end{tabular}} \\ \vspace{-2.5mm} \begin{flushleft} 4D attention \end{flushleft} \vspace{-2mm} {\tabcolsep = 0.2mm \begin{tabular}{cccc} \includegraphics[width = 0.24\linewidth]{./img/experiment3/4d/experiment3_3.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment3/4d/experiment3_4.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment3/4d/experiment3_8.png} & \includegraphics[width = 0.24\linewidth]{./img/experiment3/4d/experiment3_10.png} \\ \end{tabular}} \\ (c) Case 3: Pass by a person and buy a drink from a vending machine \vspace{-1mm} \end{center} \vspace{-3mm} \caption{First-person views and attention accumulation in different situations. 4D attention successfully localized the subject and simultaneously detected moving objects. Spatio-temporal human attention was accumulated on the target models according to the subject's observations.} \label{fig:experiments} \vspace{-1mm} \end{figure} \begin{figure}[t] \scriptsize \vspace{2mm} \begin{center} \includegraphics[width = 0.90\linewidth]{./img/experiment1/models/attention_experiment1_without_comment.pdf} \\ (a) Human model in Case 1: Appearance (left) and semantics (right) \vspace{2mm} \\ \includegraphics[width = 0.80\linewidth]{./img/experiment2/models/attention_experiment2.pdf} \\ (b) Electric pot and snacks in Case 2 \vspace{2mm} \\ \includegraphics[width = 0.80\linewidth]{./img/experiment3/models/attention_experiment3.pdf} \\ (c) Vending machine, human, and can models in Case 3 \\ \end{center} \vspace{-3mm} \caption{Attractive models in each case with accumulated attention} \label{fig:attention} \vspace{-3mm} \end{figure} \subsection{Applications} \label{sec:applications} To further evaluate our method, we performed attention mapping in three realistic situations as shown in Fig. \ref{fig:experiments}. Figure \ref{fig:attention} picks up ``attractive'' models in each case, in which accumulated human gaze is highlighted. 4D Attention robustly estimated the subject's poses and 3D gaze directions, and simultaneously projected human gaze onto the static and dynamic targets. This facilitates the analysis of human intention or semantic understanding of the subject's perceptual activities in the real world. {\bf Case 1:} As described in Sec.\ref{subsec:gaze_mapping}, attaching different types of textures onto the models makes it possible to access various properties of the models, for example, semantics (see Fig. \ref{fig:attention}(a)). We easily understand which body parts the subject was focusing on (face and hands, in this case). {\bf Case 2:} Instance object reconstruction allows us to observe human attention in highly dynamic situations, for example, object manipulation. In case 2, after pouring hot water into the mug, the subject picked up freebies and took one. By accumulating gaze information on the models, we may acquire cues to determine the reason for the subject's choice (Fig. \ref{fig:attention}(b)). {\bf Case 3:} We simulated a more realistic situation: The subject walked to a vending machine passing by a person and bought a drink from it. Our method successfully provided the trajectory, and attention to the static and dynamic objects of the subject (Fig. \ref{fig:attention}(c)), which helps in determining human behavior in the spatio-temporal domain. \section{DISCUSSION} \label{sec:discussion} In this section, we discuss the contributions, limitations, and practicality of the proposed method. According to Table \ref{tab:comparison}, which comprehensively compares the characteristics of different works, our framework is distinguished from other competitive methods in several aspects, for example, various targets, real-time operation, and easy setup on a simple 3D map. In particular, the rendering-centered framework provides significant benefits to direct localization and gaze projection via ID texture mapping, which leads to high accuracy of attention mapping as demonstrated in the evaluations. Map-based methods, however, require a denser 3D map for accurate localization and attention mapping, which can also be a limitation of 4D Attention. Large 3D map reconstruction and rendering can restrict the application of the method to certain scenes. Fortunately, 3D reconstruction technologies, such as SLAM with LiDAR\cite{Yokozuka-ICRA2021} or RGB-D cameras\cite{Lee-CVPR2020}, have evolved and are widely available. Techniques such as view frustum culling\cite{Assarsson-JGT2000} also help in rendering large 3D maps for real-time processing for further applications in indoor and outdoor environments. Moreover, as demonstrated in Section \ref{sec:applications}, learning-based shape inference, for example, \cite{Rong-arXiv2020}\cite{Manhardt-arXiv2020}, enables attention mapping to unknown dynamic objects by reconstructing target shapes on the fly. This also allows easier setup to free us from 3D modeling of specific objects, and strengthens our framework toward various usages. \section{CONCLUSIONS} \label{sec:conclusion} We developed a novel gaze-mapping framework to capture human attention in the real world. The experiments demonstrated that the combination of robust camera localization, unified attention mapping, and instant object reconstruction enables access to 4D human attention. The proposed system is capable of providing a series of human head poses (trajectory) and simultaneous gaze targets; thus, it would be applicable in action recognition, for example, skill-level evaluation in humanitude tender-care \cite{Nakazawa-JIRS2019}. It also allows us to incorporate any desired components of instance object reconstruction into the framework, which facilitates attention analysis to specific objects and is helpful for gaze-based target selection in dynamic scenes \cite{Chacn-IROSW2018}. Additionally, gaze accumulation on 3D models with multiple textures enables semantic analysis of human behavior. \begin{table*}[t] \vspace{2mm} \caption{Comparison of gaze mapping methods} \label{tab:comparison} \vspace{-4mm} \fontsize{6pt}{7pt}\selectfont \begin{center} {\tabcolsep = 1.0mm \begin{tabular}{l|cccc|cccc} \hline method & \multicolumn{2}{c}{target} & scalable & Real-time & sensors except & map & localization & attention mapping \\ \cdashline{2-3}[0.5pt/1pt] & static map & dynamic objects & & & eye tracker & & & \\ \hline \hline \cite{Fathaliyan-Frontiers2018} & & \checkmark \textdagger & & \checkmark & Motion capture & - & Motion capture & Ray casting \\ \cite{Dini-IROS2017} & & \checkmark \textdagger & & \checkmark & Motion capture & - & Motion capture & Ray casting (Sphere approx.) \\ \cite{Maekawa-ICCVW2019} & \checkmark & & \checkmark & & LiDAR \& Motion capture \& IMU & 3D point cloud & AMCL \& Motion capture & Exhaustive examination \\ \cite{Paletta-IRCV2013} & \checkmark & & \checkmark & \checkmark & RGB camera & Color meshes \& feature points\textdaggerdbl & Indirect visual localization & OBB-Tree \\ \cite{Pfeiffer-ETRA2016a} & & \checkmark \textdagger & & \checkmark & RGB camera (\& Kinect) & - & Visual markers & Ray casting (Box approx.) \\ \cite{Hagihara-AH2018} & \checkmark & & \checkmark & & RGB camera & Color meshes \& feature points\textdaggerdbl & Structure-from-Motion & Ray casting \\ \cite{Matsumoto-MobileHCI2019} & \checkmark & & \checkmark & & RGB camera & [Simultaneously built] & Mult-View Stereo \& Geometry & Projection onto Delaunay trinagles \\ \cite{Qodseya-ECCVW2016} & \checkmark & \checkmark & \checkmark & & Stereo camera & [Simultaneously built] & RGB-D SLAM & 3D cluttered points from the depth \\ \hdashline[0.5pt/1pt] Proposed & \checkmark & \checkmark(rigid\&non-rigid) & \checkmark & \checkmark & RGB camera (\& IMU) & Color meshes & Direct visual localization (C*) & ID texture mapping \\ \hline \end{tabular}} \end{center} \vspace{-1mm} \textdagger : Optical or visual marker(s) should be associated with each object for pose tracking. \\ \textdaggerdbl : Construction of an extra feature-point map that is strictly aligned to the 3D map is required for localization. \vspace{-4mm} \end{table*} \bibliographystyle{IEEEtran}
\section{Introduction} \setcounter{equation}{0} The Jacobian conjecture was first formulated in 1939 by Keller \cite{K} which states that a polynomial map $P:\bfF^n\to \bfF^n$ where $\bfF$ is a field of characteristic zero and $n\geq2$ has a polynomial inverse if the Jacobian $J(P)$ of $P$ is a nonzero constant. This conjecture has not been solved for any $n\geq2$ and appears in Smale's list of the eighteen mathematical problems for the new century \cite{S}. With a suitable normalization, the polynomial map $P$ may be taken to satisfy the condition $ P(0)=0$ and $DP(0)=I$ such that it has the representation \be\lb{1.1} P(x_1,\dots,x_n)=(x_1+H_1,\dots,x_n+H_n),\quad (x_1,\dots,x_n)\in\bfF^n, \ee where $H_1,\dots,H_n$ are polynomials in the variables $x_1,\dots,x_n$ consisting of terms of degrees at least 2 in nontrivial situations so that the condition imposed on $J(P)$ becomes $J(P)=1$. Among the notable developments, Wang \cite{W} established the conjecture when $H_1,\dots,H_n$ are all quadratic and Bass, Connell, and Wright \cite{BCW} and Yagzhev \cite{Y} proved an important reduction theorem which states that the general conjecture amounts to showing that the conjecture is true for the special case when each of $H_1,\dots,H_n$ is either cubic-homogeneous or zero for {\em all} $n$. Subsequently, Druzkowski \cite{D} further showed that the cubic-homogeneous reduction of \cite{BCW,Y} may be assumed to be of the form of cubic-linear type, \be\lb{1.2} H_i=(a_{i1}x_1+\cdots+a_{in}x_n)^3,\quad i=1,\dots,n. \ee In \cite{BE}, Bondt and Essen proved that the conjecture for the case $\bfF=\bfC$ may be reduced to showing that the conjecture is true when the Jacobian matrix of the map $H=(H_1,\dots,H_n)$ is homogeneous, nilpotent, and symmetric, for all $n\geq2$. For $n=2$, Moh \cite{M} established the conjecture when the degrees of $H_1$ and $H_2$ are up to 100. See the survey articles \cite{Dru,E1,Mei} and monograph \cite{E2} and references therein for further results and progress. While these developments were mainly based on ideas and methods of algebra and algebraic geometry, the problem also naturally prompts us to explore its structure in view of partial differential equations, which will be our take here. In doing so, we are able to obtain some new families of polynomial maps satisfying the conjecture. Below we unfold our study going from low dimensions to arbitrary dimensions. Due to their analytic simplicity, invertible polynomial maps are of obvious interest and importance in applications. For example, consider the autonomous dynamical system \be\lb{1.3} \dot{x}_i=X_i(x_1,\dots,x_n),\quad i=1,\dots,n, \ee describing the trajectory of a hypothetical particle with coordinates $x_1,\dots,x_n$ in $\bfR^n$ in terms of a time variable $t$ where the overdot denotes the time derivative and $X_1,\dots,X_n$ are polynomial functions in terms of $x_1,\dots,x_n$. To recast \eq{1.3} into a more tractable form, we consider an invertible transformation \be\lb{1.4} (u_1,\dots,u_n)=P(x_1,\dots,x_n)=(P_1(x_1,\dots,x_n),\dots,P_n(x_1,\dots,x_n)), \ee where $P_1,\dots,P_n$ are differentiable functions of $x_1,\dots,x_n$, to obtain an equivalent dynamical system \be\lb{1.5} \dot{u}_i=U_i(u_1,\dots,u_n),\quad i=1,\dots,n. \ee If we are to stay within the class of autonomous dynamical systems with polynomial-type nonlinearity, it suffices to work with the kind of the transformations in \eq{1.4} for which $P_1,\dots,P_n$ are polynomials in $x_1,\dots,x_n$ with $P$ being an invertible map so that \be\lb{1.6} (x_1,\dots,x_n)=Q(u_1,\dots,u_n)\equiv P^{-1}(u_1,\dots,u_n), \ee a polynomial map as well. Thus, with \eq{1.4}, \eq{1.6}, and the differential or the Jacobian matrix $DP=\left(\frac{\pa P_i}{\pa x_j}\right)$ in terms of $x_1,\dots,x_n$, we arrive at \be\lb{1.7} (\dot{u}_1,\dots,\dot{u}_n)^\tau=(DP)(\dot{x}_1,\dots,\dot{x}_n)^\tau=(DP)(X_1,\dots,X_n)^\tau(u_1,\dots,u_n), \ee which indicates that the functions $U_1,\dots,U_n$ in \eq{1.5} are polynomials in $u_1,\dots,u_n$ indeed. As a consequence, we may gain insight into a dynamical system under study by transforming it back and forth using explicitly constructed invertible transformations of polynomial type, which may not be available otherwise. \section{Two dimensions} \setcounter{equation}{0} First we consider $n=2$ and rewrite \eq{1.1} conveniently as \be\lb{2.1} P(x,y)=(x+f(x,y),y+g(x,y)), \ee where $f$ and $g$ are polynomials in the variables $x,y$ over $\bfF$ consisting of terms of degrees at least 2 in nontrivial situations. Inserting \eq{2.1} into $J(P)=1$ we have \be\lb{2.2} f_x+g_y+J(f,g)(x,y)=0, \ee where $f_x$ (e.g.) denotes the partial derivative of $f$ with respect to $x$ and $J(f,g)(x,y)$ the Jacobian of the map $(f,g)$ over $x,y$. That is, $J(f,g)(x,y)=\frac{\pa(f,g)}{\pa(x,y)}$. This is an underdetermined equation which may be solved by setting \be\lb{2.3} f_x+g_y=0,\quad J(f,g)(x,y)=0, \ee separately, such that the first equation in \eq{2.3} implies that there is a polynomial $h(x,y)$ serving as a scalar potential of the divergence-free vector field $(f,g)$ satisfying \be\lb{2.4} f=h_y,\quad g=-h_x. \ee Inserting \eq{2.4} into the second equation in \eq{2.3} we see that $h$ satisfies the homogeneous Monge--Amp\'{e}re equation \cite{A,E} \be\lb{2.5} \det(D^2 h)=h_{xx}h_{yy}-h^2_{xy}=0. \ee Alternatively, if we are only concerned with $f$ and $g$ being homogeneous of the same degree, then a degree counting argument applied to \eq{2.2} leads to two separate equations, as given in \eq{2.3}, as well. Hence we arrive at \eq{2.5} again. To proceed, we consider the solution of \eq{2.5} of the homogeneous type \be\lb{2.6} h(x,y)=\sigma(\xi),\quad \xi=ax+by,\quad a,b\in\bfF, \ee as suggested by \eq{1.1}--\eq{1.2}, where the arbitrary polynomial function $\sigma(\xi)$ is taken to be of degree $m\geq3$ or zero. Thus, with the notation $P(x,y)=(u,v)$ and the relations \eq{2.1} and \eq{2.4}, we have \be\lb{2.7} u=x+b\sigma'(\xi),\quad v=y-a\sigma'(\xi), \ee resulting in the invariance condition between the two sets of the variables: \be\lb{2.8} au+bv=ax+by=\xi. \ee As a consequence of \eq{2.7} and \eq{2.8}, we obtain the inverse of the map $P$ immediately as follows: \be x=u-b\sigma'(\xi),\quad y=v+a\sigma'(\xi),\quad\xi=au+bv. \ee As a by-product, the arbitrariness of the function $\sigma$ indicates that the solution gives rise to a family of polynomial maps of arbitrarily high degrees. For later development, we also observe that the second equation in \eq{2.3} implies that $f$ and $g$ are functionally dependent. Therefore, if we set $g=G(f)$ (say), then the first equation in \eq{2.3} leads to \be f_x+G'(f)f_y=0, \ee which has a nontrivial solution of the homogeneous type, $f=\phi(\xi)$ ($\xi=ax+by$), if and only if \be\lb{2.11} g=G(f)=-\frac ab f,\quad b\neq0. \ee Thus, it follows that there hold the simplified relations \be\lb{2.12} u=x+\phi(\xi),\quad v=y-\frac ab \phi(\xi),\quad au+bv=ax+by=\xi, \ee where the invariance relation between the variables again makes the inverse of the map ready to be read off. If $P:\bfF^n\to \bfF^n$ ($n\geq2$) is a polynomial automorphism (that is, the inverse $P^{-1}$ of $P$ exists which is also a polynomial map), then it has been shown \cite{BCW,Dru,RW} that there holds the following general bound between the degrees of $P$ and $P^{-1}$: \be\lb{2.13} \deg(P^{-1})\leq (\deg(P))^{n-1}. \ee In the $n=2$ situation here, the map $P$ stated in \eq{2.12} satisfies $\deg(P)=\deg(P^{-1})$ where $\deg(P)$ may be any positive integer. In other words, the bound \eq{2.13} is seen to be sharp when $n=2$ in all degree cases. We remark that \eq{2.12} is the most general polynomial automorphism of homogeneous type in two dimensions. To see this, we let the map $P$ be defined by \be\lb{2.14} u=x+\phi(\xi),\quad v=y+\psi(\eta),\quad \xi=ax+by,\quad \eta=cx+dy,\quad a,b,c,d\in\bfF, \ee where $\phi(\xi)$ and $\psi(\eta)$ are polynomials in the variables $\xi$ and $\eta$, respectively, of degrees $l\geq2$ and $m\geq2$, satisfying $\phi(0)=\psi(0)=0$. Inserting \eq{2.14} into $J(P)=1$, or $f=\phi$ and $g=\psi$ into \eq{2.2}, we get \be\lb{2.15} a\phi'(\xi)+d\psi'(\eta)+(ad-bc)\phi'(\xi)\psi'(\eta)=0. \ee On the other hand, as polynomials in the variables $x,y$, we have \bea \deg(a\phi'(\xi)+d\psi'(\eta))&\leq& \max\{l-1,m-1\},\lb{2.16}\\ \deg(\phi'(\xi)\psi'(\eta))&=&(l-1)+(m-1)>\max\{l-1,m-1\},\lb{2.17} \eea since $l,m\geq2$. In view of \eq{2.15}--\eq{2.17}, we arrive at $ad-bc=0$. In other words, the variables $\xi$ and $\eta$ as given in \eq{2.14} are linearly dependent. Consequently, \eq{2.14} is simplified into the form \be\lb{2.18} u=x+\phi(\xi),\quad v=y+\psi(\xi),\quad \xi=ax+by, \ee which renders $a\phi'(\xi)+b\psi'(\xi)=0$. Thus \eq{2.12} follows if $b\neq0$ and $\phi(\xi)=-\frac ba\psi(\xi)$ if $a\neq0$. So we have obtained the most general homogeneous solution to the equation $J(P)=1$ or \eq{2.2}. It can be checked directly that, when the polynomial map \eq{2.1} is of the type $\deg(P)\leq3$, then $J(P)=1$ or \eq{2.2} leads to the homogeneous form \eq{2.18}, or more precisely, \eq{2.12}. \section{Three dimensions} \setcounter{equation}{0} Next we consider $n=3$ and rewrite \eq{1.1} as \be\lb{3.1} (u,v,w)=P(x,y,z)=(x+f(x,y,z),y+g(x,y,z),z+h(x,y,z)),\quad(x,y,z)\in\bfF^3, \ee where $f,g$, and $h$ are polynomials in $x,y,z$ with terms of degrees at least 2 in nontrivial situations. Thus the equation $J(P)=1$ is recast into \be\lb{3.2} f_x+g_y+h_z+J(f,g)(x,y)+J(g,h)(y,z)+J(f,h)(x,z)+J(f,g,h)(x,y,z)=0, \ee which is underdetermined as well. If we focus on $f,g$, and $h$ being homogeneous of the same degree, then \eq{3.2} splits into the coupled system \be\lb{3.3} f_x+g_y+h_z=0,\quad J(f,g)(x,y)+J(g,h)(y,z)+J(f,h)(x,z)=0,\quad J(f,g,h)(x,y,z)=0, \ee as in Section 2. However, here, we are interested in solutions of more general characteristics. To proceed, we solve the third equation in \eq{3.3} by setting $h=H(f,g)$ where $H$ is a function of the variables $f$ and $g$ to be determined. Hinted by the study in Section 2, we seek for solutions of the form \be\lb{3.4} f(x,y,z)=\phi(\xi),\, g(x,y,z)=\psi(\eta),\, \xi=ax+by+cz,\, \eta=px+qy+rz,\, a,b,c,p,q,r\in\bfF. \ee Inserting \eq{3.4} into the first equation in \eq{3.3}, we get \be\lb{3.5} (a+cH_f)\phi'(\xi)+(q+rH_g)\psi'(\eta)=0. \ee We are interested in being able to allow $\phi$ and $\psi$ to be arbitrary. This leads to $a+cH_f=0$ and $q+rH_g=0$ or \be\lb{3.6} h=-\frac ac f-\frac qr g,\quad c,r\neq0, \ee which extends \eq{2.11}. In view of \eq{3.6}, we see that the second equation in \eq{3.3} is equivalent to the equation \be\lb{3.7} (ar-cp)(br-cq)=0. \ee Thus either $ar=cp$ or $br=cq$. As an example, we assume the former. That is, suppose \be\lb{3.8} \frac ac=\frac pr. \ee Consequently, subject to \eq{3.8}, we have solved the Jacobian equation $J(P)=1$ where $P(x,y,z)=(u,v,w)$ in 3 dimensions with \be\lb{3.9} u=x+\phi(\xi),\,v=y+\psi(\eta),\, w=z-\frac ac\phi(\xi)-\frac qr \psi(\eta),\,\xi=ax+by+cz,\,\eta=px+qy+rz. \ee Besides, with \eq{3.8}, we also have \bea au+bv+cw&=&ax+by+cz+\left(b-\frac{cq}r\right)\psi(\eta)=\xi+\left(b-\frac{cq}r\right)\psi(\eta),\lb{3.10}\\ pu+qv+rw&=&px+qy+rz=\eta.\lb{3.11} \eea So the quantity $\eta$ is seen as an invariant between the two sets of the variables but not $\xi$. In other words, we achieve a {\em partial invariance}. As a consequence of \eq{3.9}--\eq{3.11}, we obtain the inverse of the map $P$ given by \bea x&=&u-\phi\left(au+bv+cw-\left[b-\frac{cq}r\right]\psi(\eta)\right),\lb{3.12}\\ y&=&v-\psi(\eta),\lb{3.13}\\ z&=&w+\frac ac\phi\left(au+bv+cw-\left[b-\frac{cq}r\right]\psi(\eta)\right)+\frac qr \psi(\eta),\lb{3.14} \eea where $\eta=pu+qv+rw$. It will be of interest to compare the degrees of the map $P$ given by \eq{3.9} and its inverse $P^{-1}$ given by \eq{3.12}--\eq{3.14}, with regard to the general bound \eq{2.13}, which are \be \deg(P)=\max\{\deg(\phi),\deg(\psi)\};\quad \deg(P^{-1})=\deg(\phi)\deg(\psi),\quad br\neq cq. \ee Hence we have \be\lb{deg} \deg(P^{-1})\leq (\deg(P))^2, \ee which is a realization of \eq{2.13} when $n=3$. Of course, $\deg(P^{-1})=(\deg(P))^2$ if and only if $\deg(\phi)=\deg(\psi)$ and all possible integer combinations in the inequality \eq{deg} can be achieved concretely by choosing appropriate pair of the generating polynomials, $\phi$ and $\psi$. It is worth noting that, if both factors in \eq{3.7} vanish, or both \eq{3.8} and \be\lb{3.15} \frac bc=\frac qr \ee are simultaneously valid, then \eq{3.10} and \eq{3.11} imply that both $\xi$ and $\eta$ are invariant quantities between the two sets of the variables. In fact, now $\xi$ and $\eta$ are linearly dependent quantities, \be\lb{3.16} r\xi=c\eta. \ee In this situation, we may rewrite \eq{3.9} as \be\lb{3.17} u=x+\phi(\xi),\, v=y+\psi(\xi),\, w=z-\frac ac\phi(\xi)-\frac bc\psi(\xi),\, \xi=ax+by+cz=au+bv+cw, \ee where $\phi$ and $\psi$ are arbitrary functions of $\xi$, which is a direct 3-dimensional extension of \eq{2.12} for which the inverse is obviously constructed as well. Of course, we now have $\deg(P)=\deg(P^{-1})$ and the equality in \eq{deg} never occurs in nontrivial situations where $\min\{\deg(\phi),\deg(\psi)\}\geq2$. We emphasize that the polynomial functions $\phi$ and $\psi$ in \eq{3.12}--\eq{3.14} and \eq{3.17} are of arbitrary degrees. It may be of interest to explore a Monge--Amp\'{e}re equation type structure, as \eq{2.5} as we did in 2 dimensions for the Jacobian equation \eq{2.2}, for \eq{3.2}. For this purpose, we note that the first equation in \eq{3.3} implies that the vector $(f,g,h)$, being divergence free, has a vector potential, $(A,B,C)$, satisfying \be\lb{3.18} (f,g,h)=\mbox{curl of } (A,B,C)=(C_y-B_z,A_z-C_x,B_x-A_y). \ee Hence \eq{3.2} becomes the following second-order nonlinear equation \bea\lb{3.19} &&\left|\begin{array}{cc}C_{xy}-B_{xz}&C_{yy}-B_{yz}\\A_{xz}-C_{xx}&A_{yz}-C_{xy}\end{array}\right| +\left|\begin{array}{cc}A_{yz}-C_{xy}&A_{zz}-C_{xz}\\B_{xy}-A_{yy}&B_{xz}-A_{yz}\end{array}\right| +\left|\begin{array}{cc}C_{xy}-B_{xz}&C_{yz}-B_{zz}\\B_{xx}-A_{xy}&B_{xz}-A_{yz}\end{array}\right|\nn\\ &&+\left|\begin{array}{ccc}C_{xy}-B_{xz}&C_{yy}-B_{yz}&C_{yz}-B_{zz}\\A_{xz}-C_{xx}&A_{yz}-C_{xy}&A_{zz}-C_{xz}\\B_{xx}-A_{xy}&B_{xy}-A_{yy}&B_{xz}-A_{yz} \end{array}\right|=0. \eea As another reduction of \eq{3.2}, we may set $h=H(f,g)$ where $H$ is a prescribed function of $f$ and $g$. Hence \eq{3.2} becomes \be\lb{3.20} f_x+g_y+H_f f_z+H_g g_z+J(f,g)(x,y)+H_g J(f,g)(x,z)+H_f J(g,f)(y,z)=0. \ee The underdetermined equations \eq{3.19} and \eq{3.20} can be reduced further, of course. \section{General dimensions} \setcounter{equation}{0} In the general situation, with the notation \be\lb{4.1} (u_1,\dots,u_n)=P(x_1,\dots,x_n)=(x_1+f_1,\dots,x_n+f_n),\quad f_{ij}=\frac{\pa f_i}{\pa x_j},\quad i,j=1, \dots,n, \ee then it is clear that the Jacobian equation $J(P)=1$ or $\det(I +F)=1$ where $F=(f_{ij})$ assumes the form \be\lb{4.2} E_1(F)+E_2(F)+\cdots+E_n(F)=0, \ee where $E_k(F)$ is the sum of all $k$ by $k$ principal minors of the matrix $F$, $k=1,\dots,n$, such that $E_1(F)=\mbox{tr}(F)$ and $E_n(F)=\det(F)$ (cf. \cite{HJ}). We now aim to obtain a family of solutions of \eq{4.2} of our interest that satisfy the Jacobian conjecture and extend what we found earlier in low dimensions. For such a purpose and suggested by the study in Section 3, we use $(a_{ij})$ to denote an $(n-1)$ by $n$ matrix in $\bfF$ and introduce the variables \be\lb{4.3} \xi_i=\sum_{j=1}^n a_{ij}x_j,\quad i=1,\dots,n-1. \ee Define \be\lb{4.4} u_j=x_j+f_j,\quad j=1,\dots,n, \ee where $f_1,\dots,f_{n-1}$ are arbitrary polynomials in $\xi_1,\dots,\xi_{n-1}$, respectively, but \be\lb{4.5} f_n=\sum_{j=1}^{n-1}b_j f_{j}(\xi_j), \ee where the coefficients $b_1,\dots,b_{n-1}\in\bfF$ are to be determined through the equation \eq{4.2} which due to \eq{4.5} is now slightly reduced into \be E_1(F)+E_2(F)+\cdots+E_{n-1}(F)=0, \ee which is still rather complicated. For simplicity and in view of the study in Section 3, we impose the following {\em full invariance} condition between the two sets of variables $x_1,\dots,x_n$ and $u_1, \dots,u_n$: \be\lb{4.6} \xi_i=\sum_{j=1}^n a_{ij} x_j=\sum_{j=1}^n a_{ij}u_i,\quad i=1,\dots,n-1, \ee so that by virtue of \eq{4.4} we arrive at \bea \sum_{j=1}^n a_{ij} u_j&=&\sum_{j=1}^n a_{ij} x_j+\sum_{j=1}^{n-1} a_{ij}f_j +a_{in}f_n\nn\\ &=&\xi_i+\sum_{j=1}^{n-1}\left(a_{ij}+a_{in}b_j\right)f_j,\quad i=1,\dots,n-1, \eea which results in the solution \be\lb{4.8} b_j=-\frac{a_{ij}}{a_{in}},\quad a_{in}\neq0,\quad i,j=1,\dots,n-1. \ee This solution indicates that the quantities $\xi_1,\dots, \xi_{n-1}$ are linearly dependent: \be a_{in}\xi_{j}=a_{jn}\xi_{i},\quad i,j=1,\dots, n-1, \ee which extends \eq{3.16}. Since the functions $f_1,\dots,f_{n-1}$ are arbitrary, we may now set \be f_i=\phi_i(\xi),\quad i=1,\dots,n-1,\quad \xi=\sum_{j=1}^n a_j x_j. \ee Hence we obtain the polynomial map $P$ defined by \be\lb{4.12} u_1=x_1+\phi_1(\xi),\quad\dots,\quad u_{n-1}=x_{n-1}+\phi_{n-1}(\xi),\quad u_n=x_n-\sum_{i=1}^{n-1}\frac {a_i}{a_n} \phi_i(\xi). \ee With \eq{4.12}, it is readily checked that the inverse of the polynomial map $P$ defined in \eq{4.1} is given by \be x_1=u_1-\phi_1(\xi),\quad\dots,\quad x_{n-1}=u_{n-1}-\phi_{n-1}(\xi),\quad x_n=u_n+\sum_{i=1}^{n-1}\frac{a_{i}}{a_{n}} \phi_i(\xi), \ee where $\phi_1,\dots,\phi_{n-1}$ are polynomial functions of the variable $\xi=a_1u_1+\cdots+a_{n}u_{n}$. Of course we now have $\deg(P^{-1})=\deg(P)$. Note that $\phi_1,\dots,\phi_{n-1}$, in nontrivial situations, consist of terms of degrees at least 2 of the variable $\xi$, which are arbitrary otherwise. Since $DP(0)=I$, we automatically get $J(P)=1$. In particular, $(f_1,\dots,f_{n-1},f_n)$ so constructed is a solution to the Jacobian equation \eq{4.2} such that the associated polynomial map $P$ given in \eq{4.1} satisfies the Jacobian conjecture. Further reductions to \eq{4.2} may be carried out along the lines shown in Section 3 which are omitted here. \section{Applications} \setcounter{equation}{0} As a concrete example, consider the following nonlinear dynamical system in $\bfR^2$: \bea \dot{u}&=&2(u+v)(u-v-2[u+v]^2)+(u-[u+v]^2)(1-v-[u+v]^2),\lb{5.1}\\ \dot{v}&=&-2(u+v)(u-v-2[u+v]^2)+(v+[u+v]^2)(-1+u-[u+v]^2),\lb{5.2} \eea which appears complicated. We are interested in the existence of periodic orbits. First it is readily checked that the equilibria of this system are \be\lb{5.3} (0,0),\quad (5,-3), \ee for which $(0,0)$ is a saddle point and $(5,-3)$ a center. By the classical index theorem \cite{Gu,St}, we know that the only possible closed orbits would be those winding about the point $(5,-3)$. To show the existence of such orbits, we use the transformation \be\lb{5.4} u=x+(x+y)^2,\quad v=y-(x+y)^2, \ee which satisfies the invariance property $x+y=u+v$ studied in Section 2, rendering the inverse transformation \be x=u-(u+v)^2,\quad y=v+(u+v)^2, \ee and recasts the system \eq{5.1}--\eq{5.2} into an equivalent but much simplified one, \be\lb{5.6} \dot{x}=x-xy,\quad \dot{y}=-y+xy, \ee which happens to be the celebrated the Lotka--Volterra equations modeling a predator-prey ecological system in mathematical biology \cite{Be,Br,Ki,Mu}. Correspondingly, the two equilibria of \eq{5.6} are $(0,0)$ and $(1,1)$, the former being a saddle point and the latter a center. Hence the possible closed orbits would be those winding about $(1,1)$. In fact, the simplicity of \eq{5.6} allows a complete integration of it which establishes that all the trajectories in the first quadrant of the $(x,y)$-plane, away from the point $(1,1)$, are closed orbits, as depicted in Figure \ref{F}, which is a classical fact. Consequently, in terms of the transformation \eq{5.4}, we obtain a full collection of periodic solutions to the original system \eq{5.1}--\eq{5.2}. \begin{figure}[h] \begin{center} \includegraphics[height=8cm,width=8cm]{prey-predator.jpg} \caption{An $(x,y)$-plane realization of the periodic orbits of the nonlinear dynamical system \eq{5.1}--\eq{5.2} which is complicated in its original $(u,v)$-plane setting. With the polynomial automorphism \eq{5.4}, the system is recast into the Lotka--Volterra equations, \eq{5.6}, which may be integrated completely, thus rendering a family of periodic orbits about its center-type equilibrium, $(5,-3)$, as stated in \eq{5.3}, and depicted here in terms of the $x$ and $y$ variables in the first quadrant of the $(x,y)$-plane. } \label{F} \end{center} \end{figure} In \cite{Evans} and references therein, the Lotka--Volterra equations are transformed into many other equivalent systems of nonlinear equations including those with non-polynomial type nonlinearities. Our work here, however, allows us to stay within the family of dynamical systems with polynomial type nonlinearities for which the possibilities are unlimited. The $n$-dimensional extension \cite{Mu,Plank1,Plank2,V} of the Lotka--Volterra equations is another interesting and important subject. In view of the construction in Section 4, we can obtain a broad family of dynamical systems in $n$ dimensions with polynomial type nonlinearities which are equivalent to the Lotka--Volterra equations in $\bfR^n$. Of course, the explicit construction of the polynomial automorphisms presented here will also be of immediate applicability in numerous other areas of nonlinear problems in mathematical sciences, including those studied exemplarily in \cite{Fa,L,Ma,Mu}, for instance. \section{Conclusions} \setcounter{equation}{0} In this work, the Jacobian conjecture is directly studied by way of the partial differential equations it prompts. These equations are first order, nonlinear, and expressed in terms of the sum of all principal minors of the Jacobian matrix of the nonlinear part of the polynomial map. In two dimensions, the equation may be reduced into a homogeneous Monge--Amp\'{e}re equation. In any $n\geq2$ dimension, solutions depending on $n-1$ arbitrary polynomial functions are obtained, which give rise to polynomial maps of arbitrarily high degrees, satisfying the Jacobian conjecture. Thus, the maps may or may not be homogeneous, depending on the choice of these arbitrary functions. Interestingly and practically, for these maps, the inverse maps are of similar structures and can be constructed immediately using an invariance property, either partial or full, of the variables in consideration. This explicit construction can be used to unveil broad families of nonlinear problems of distinctive characteristics in mathematical sciences. \medskip {\bf Data availability statement:} The data that support the findings of this study are available within the article. {
\section{Introduction} \label{sec_intuduction} The Low Gain Avalanche Diode (LGAD) is a new type of silicon sensor which has good timing resolution and moderate spatial resolution. This technology will be used to build the High Granularity Timing Detector (HGTD) for the ATLAS experiment in the High Luminosity Large Hadron Collider (HL-LHC)~\cite{HGTDtdr2020,HL-LHC,Nicolo2018}. The LGAD is a thin n-on-p silicon sensor with a highly doped $p^{+}$ region (as shown in Fig.~\ref{fig:SchematicLGAD}), where this $p^+$ region creates a high electric field and becomes a gain layer. Due to such a high electric field (> \SI{3}{\times10^{5}~V/cm}), more electron-hole pairs are generated by the initial carriers when passing through the gain layer. In the HGTD project, the timing resolution of LGAD sensor is required to be better than 70~ps after irradiation up to \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}. The collected charge with the same irradiation is required to be larger than 4~fC to reduce the jitter contribution in the readout ASIC chip~\cite{HGTDtdr2020}. The deteriorations of the collected charge and timing resolution for LGAD sensor after irradiation is due to the acceptor removal mechanism as described in Refs.~\cite{Moll2018,Ferrero2019,Kramberger2015,Tanyh2021}. Refs.~\cite{Cartiglia2017,Kramberger2018,Zhao2018,Lange2017,Shi2020,Wiehe2021} reported the radiation performance of HPK and CNM LGAD sensors. Previously, the Institute of High Energy Physics (IHEP) and the Novel Device Laboratory (NDL) jointly designed LGAD sensors with a \SI{33}{\micro\metre} active layer~\cite{Fan2020,NDL}. After proton irradiation with a fluence of \SI{1.5}{\times10^{15}~n_{eq}/\centi\metre^2}, the timing resolution can reach 45~ps with a collected charge of 2-4~fC. The performance of such LGAD sensor can not match the HGTD requirement for irradiation hardness (\SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2} irradiation). To improve the radiation hardness, IHEP and NDL optimized the sensor design and fabricated a new type of LGAD sensor with an increased active layer thickness of \SI{50}{\micro\metre}. This article will present in detail the irradiation hardness performance of the new type \SI{50}{\micro\metre} LGAD after neutron irradiation up to \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}, including the capacitance, the leakage current, the collected charge, and the timing resolution. Besides, the factors affecting the time resolution after irradiation are analyzed in detail. \begin{figure}[htbp] \begin{center} \rotatebox{0}{\includegraphics [scale=0.3]{Fig/SchematicLGAD2.pdf} \caption{Shematic for the LGAD sensors.} \label{fig:SchematicLGAD} \end{center} \end{figure} \begin{figure}[htbp] \begin{center} \includegraphics[scale=0.3]{Fig/Layout.pdf} \caption{The layout of the \SI{50}{\micro\metre} LGAD sensors produced with single pad size of \SI{1.3}{mm} \si{\times} \SI{1.3}{mm}.} \label{fig:Layout} \end{center} \end{figure} \section{Properties of the IHEP-NDL \SI{50}{\micro\metre} LGAD} \label{sec_Properties} The IHEP-NDL \SI{50}{\micro\metre} LGAD was fabricated on a 6-inch wafer with a p-type epitaxial layer of a silicon substrate. The resistivity of the active layer is \SI{350}{~\Omega\cdot\centi\metre}. A highly-doped $p^{+}$ region is implemented to create a high electric field and moderate internal gain. The layout of IHEP-NDL \SI{50}{\micro\metre} LGAD shown in Fig.~\ref{fig:Layout}. It is 2~\si{\times}~2 arrays with three type electrodes, the single pad size is \SI{1.3}{mm}~\si{\times}~\SI{1.3}{mm}, and the lower left is a PIN without the gain layer. The upper left has a full coverage electrode, which is the electrode structure of the full-scale LGAD array. \section{Neutron irradiation} \label{sec_irrad} The \SI{50}{\micro\metre} LGADs were irradiated with neutrons by the Institut Jozef Stefan in Ljubljana, which has been used successfully in the past decades to support sensor development~\cite{Snoj2012}. In order to study the irradiation performance, three irradiation fluences are set, which are \SI{0.8}{\times10^{15}}, \SI{1.5}{\times10^{15}} and \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}. After irradiation, these sensors were annealed for 80 minutes at \SI{60}{\celsius}, which roughly emulates the long-term annealing at the end of year shut-down period during the operation of the HL-LHC. After that, sensors with three irradiation fluences were tested and studied. \section{Effect of irradiation on capacitance and leakage current characteristics} \label{IV-CV} Neutron irradiation affects the doping and the leakage current of the sensor. The Capacitance-Voltage(C-V) and Current-Voltage(I-V) tests before and after irradiation are necessary. \subsection{Capacitance-Voltage(C-V)} LCR meter was used to test the C-V characteristics of the \SI{50}{\micro\metre} LGAD sensors at room temperature. Fig.~\ref{fig:CVCurve} shows the inverse of capacitance square as a function of the bias voltage for sensors before and after the irradiation. The gain layer depletion voltage $V_{GL}$ of the sensor before the irradiation is 29 V, and drops to 18 V, 12 V, and 7 V with irradiation fluences of \SI{0.8}{\times10^{15}}, \SI{1.5}{\times10^{15}} and \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}, respectively. With this C-V curve, the doping profile of the LGAD sensor was extracted ~\cite{Peiner1995,Nagai1992}. The relationship between doping concentration ${N_w}$ and depth ${w}$ is calculated with the following equations: \begin{equation} \begin{aligned} N_{w} &= \frac{2}{{q\epsilon_{r}\epsilon_{0}A^2}}[\mathrm{d}(\frac{1}{C^2})/\mathrm{d}{V}]^{-1}, \\ w&=\epsilon_{r}\epsilon_{0}\frac{A}{C}. \end{aligned} \end{equation} where ${q}=\SI{1.6}{\times 10^{-19}~\coulomb}$ is the electron charge, $\epsilon_{r}=11.7$ is the relative permittivity of silicon, $\epsilon_{0}=\SI{8.854}{\times 10^{-12}}~\si{\mathrm{F}/\metre}$ is the permittivity of vacuum, ${A}$ is the area of the LGAD, ${V}$ is the bias voltage, and ${C}$ is the measured capacitance. The doping profiles for various irradiation conditions are shown in Fig.~\ref{fig:doping_depth}. Due to the acceptor removal mechanism~\cite{Ferrero2019}, the doping concentration of the gain layer decreases rapidly with the increase of the irradiation fluence. Compared with the case before irradiation, the doping concentration with the irradiation fluence of \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2} reduces by a factor of 2.5. \begin{figure}[htbp] \begin{center} \subfigure[]{\includegraphics[width=.4\textwidth]{Fig/C2_V-2.pdf} \label{fig:CVCurve}} \subfigure[]{\includegraphics[width=.4\textwidth]{Fig/Doping.pdf} \label{fig:doping_depth}} \caption{(a) ${1/C^{2}}$ as a function of the bias voltage for \SI{50}{\micro\metre} LGAD sensors at the room temperature. (b) The doping profiles of \SI{50}{\micro\metre} LGAD sensors estimated from C-V measurements. } \label{fig:CV_Dop} \end{center} \end{figure} \begin{figure}[htbp] \begin{center} \includegraphics[scale=0.4]{Fig/M30C_B14_IV.pdf} \caption{ I-V curves of 50 \SI{}{\micro\metre} LGAD sensors at the temperature of \SI{-30}{\celsius}.} \label{fig:IV} \end{center} \end{figure} \subsection{Current-Voltage(I-V)} Fig.~\ref{fig:IV} shows the leakage current of \SI{50}{\micro\metre} LGAD sensor in a dark environment at the temperature of \SI{-30}{\celsius}. The leakage current of the sensor before irradiation was at nA level, and its breakdowns at a voltage of \SI{190}{V}. When the irradiation fluence increases to \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}, the total leakage current (4 pads + GR) was \SI{3.36}{\micro\ampere} (\SI{50}{\micro\ampere/\centi\metre^2}) at the bias voltage of \SI{760}{V}. This is lower than the HGTD requirement(\SI{125}{\micro\ampere/\centi\metre^2}). The collected charge at such bias voltage reaches \SI{4}{fC}, which meets the HGTD requirements. \section{Low temperature beta telescope experiment} \label{beta} \subsection{Beta telescope setup} To study the timing resolution and the collected charge, LGAD sensors were tested with a beta source at the temperature of \SI{-30}{\celsius} with the humidity controlled within 10\%. The pad under test is wire bonded to the readout board, while the guard ring and the other three pads are grounded. The readout board is a single channel readout board designed by the University of California Santa Cruz (UCSC)~\cite{Cartiglia2017}. The readout board has a high-speed inverting preamplifier with a trans-impedance of \SI{470}{~\Omega}. This preamplifier is followed by an external main amplifier with a gain of \SI{20}{~dB}. Fig.~\ref{fig:BetaSetup} shows the telescope experiment setup with a beta source. The top sensor is the device under test (DUT), and the bottom sensor is used to trigger electron signals from the beta source. The signal pulses from both sensors are recorded by a digital oscilloscope for offline analysis. \begin{figure}[htbp] \begin{center} \includegraphics[scale=0.3]{Fig/BetaSetup.pdf} \caption{Beta telescope setup for IHEP-NDL sensors.} \label{fig:BetaSetup} \end{center} \end{figure} \begin{figure}[htbp] \begin{center} \includegraphics[scale=0.4]{Fig/CC_B14-3_JSI_IHEP_-30C.pdf} \caption{The collected charge as a function of bias voltage for IHEP-NDL \SI{50}{\micro\metre} LGAD before and after irradiation at temperature of \SI{-30}{\celsius}. } \label{fig:Charge} \end{center} \end{figure} \subsection{Collected charge} \label{CC} The collected charge for each sensor is calculated as the integration of the pulse shape divided by the total gain of the preamplifier and the main amplifier. The distribution of the collected charge is fit with a shape from the convolution of the Landau and the Gaussian functions to get the most probability value (MPV) for the collected charge. The collected charges of the \SI{50}{\micro\metre} LGAD sensor before and after irradiation are shown in Fig.~\ref{fig:Charge}. The LGAD sensor before irradiation has a very high collected charge of \SI{40}{fC}. When the irradiation fluence increased to \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}, the collected charge of the \SI{50}{\micro\metre} LGAD sensor reaches \SI{4}{fC} at a bias voltage of \SI{760}{V}, and keep increasing with the higher bias voltage to \SI{7}{fC} for current measurement. As the neutron fluence increasing, the space charge density of the gain layer decreases due to the acceptor removal mechanism. Even with a high bias voltage, the ability of the sensor to collect charge decreases. This result indicates that the IHEP-NDL \SI{50}{\micro\metre} sensor passes the HGTD requirement for charge collection with irradiation (\textgreater \SI{4}{fC} after \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2} irradiation fluence). \subsection{Timing resolution} \label{Timing} The timing resolution $\sigma_{t}$ of charge particles passing through LGAD sensors is mainly composed of the following three items: \begin{equation} \label{eq:Timing} \sigma^2_t = \sigma^2_{\mathrm{TimeWalk}} + \sigma^2_{\mathrm{Landau}} + \sigma^2_{\mathrm{Jitter}} \end{equation} The time walk effect ($\sigma_{\mathrm{TimeWalk}}$) is caused by different signal amplitudes, which can be corrected by using the constant fraction discriminator (CFD) method. The details of the CFD method are in reference \cite{Cartiglia2017}. The jitter effect ($\sigma_{\mathrm{Jitter}}$) is proportional to the noise and the inverse of the signal slope~\cite{Nicolo2018}: \begin{equation} \label{eq:Jitter} \sigma^2_{\mathrm{Jitter}} = \left(\frac{N}{\mathrm{d}V/\mathrm{d}t}\right)^2, \end{equation} where ${N}$ is the Root Mean Square (RMS) of noise, d${V/}$d${t}$ is the slope of the rising edge around the threshold value. A better signal-to-noise ratio (SNR) introduces a smaller jitter contribution to the timing resolution. The Landau contribution ($\sigma_{\mathrm{Landau}}$) corresponds to the effect from Landau fluctuations in the energy deposition non-uniformities along the path of a particle passing through the detector. The CFD method is used to calculate the flight time ($\Delta{t}$) of the electron between two LGAD sensors. The detailed calculation for the timing resolution is described in Ref.~\cite{Cartiglia2017}. Since the timing resolution of the trigger sensor is known, the timing resolution of the DUT sensor is derived as: \begin{equation} \sigma_{\mathrm{DUT}} = \sqrt{\sigma^2_{\Delta{t}} - \sigma^2_{\mathrm{Trigger}}} \end{equation} \begin{figure}[htbp] \begin{center} \includegraphics[scale=0.4]{Fig/Res_B14-3_JSI_IHEP_-30C.pdf} \caption{Timing resolution as a function of bias voltage for IHEP-NDL \SI{50}{\micro\metre} LGAD sensor before and after irradiation at temperature of \SI{-30}{\celsius}.} \label{fig:Res} \end{center} \end{figure} The timing resolution of the \SI{50}{\micro\metre} LGAD sensors before and after the irradiation is shown in Fig.~\ref{fig:Res}. The timing resolution before the irradiation can reach \SI{26}{ps}. As the increase of the irradiation fluence, the working voltage increases quickly. To have a same timing resolution of \SI{40}{ps}, the sensor irradiated with three different fluences needs bias voltages of \SI{500}{V}, \SI{720}{V} and \SI{780}{V} respectively. The IHEP-NDL \SI{50}{\micro\metre} LGAD sensor meets the HGTD requirement for the timing resolution (\textless \SI{70}{ps} after \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2} irradiation fluence). \subsection{Jitter and Landau contributions} The irradiation increases the working voltage, reduces the collected charge, and deteriorates the timing resolution. The Jitter and the Landau contributions are the main sources for the timing resolution. Their contributions in the timing resolution as various irradiation fluences are analyzed and presented in this section. The Jitter contribution is calculated with Eq.~(\ref{eq:Jitter}). Fig.~\ref{fig:Jitter_BV} shows the Jitter contributions with different irradiation fluences as functions of the bias voltage and the SNR. The Jitter contribution decreases with the bias voltage increase and increases with the irradiation fluence. As the irradiation fluence increasing, acceptors in the gain layer are quickly removed, resulting in a gain decrease. This decrease of the gain results in a worse SNR and a larger Jitter contribution. As shown in Fig.~\ref{fig:Jitter_SNR}, The Jitter and SNR have a negative index relationship. When the SNR is less than 10, the Jitter contribution increases rapidly. The SNR of the IHEP-NDL \SI{50}{\micro\metre} sensor before the irradiation can be as high as 48, and reduces by a factor of 4 to be 12 after the irradiation with a fluence of \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}. \begin{figure}[htbp] \begin{center} \subfigure[]{\includegraphics[width=.6\textwidth]{Fig/Jitter_B14-3_JSI_IHEP_-30C.pdf} \label{fig:Jitter_BV} } \subfigure[]{\includegraphics[width=.6\textwidth]{Fig/SNR_Jitter_B14-3_JSI_IHEP_-30C.pdf}\label{fig:Jitter_SNR} } \subfigure[]{\includegraphics[width=.6\textwidth]{Fig/Landau_B14-3_JSI_IHEP_-30C.pdf} \label{fig:Landau_BV} } \caption{(a) The Jitter contribution as a function of the bias voltage for \SI{50}{\micro\metre} IHEP-NDL sensors. (b) The Jitter contribution as a function of the signal-to-noise ratio for IHEP-NDL sensors. (c) The Landau contribution as a function of the bias voltage for IHEP-NDL 50 \SI{}{\micro\metre} LGAD before and after the irradiation at the temperature of \SI{-30}{\celsius}. } \label{fig:Jitter_landau} \end{center} \end{figure} The Landau contribution is calculated from Eq.~(\ref{eq:Timing}). Fig.~\ref{fig:Landau_BV} gives the Landau contribution for different irradiation fluences. The Landau contribution is about 25-30 ps, and does not change dramatically with the bias voltage and the irradiation fluence. The reason is that the Landau contribution is caused by the non-uniform energy deposition and the bias voltage and the irradiation do not significantly affect this non-uniform energy deposition of the electron in the epitaxial layer. \section{Conclusion} \label{sec_Conclusion} The new \SI{50}{\micro\metre} LGAD sensor was designed by the IHEP and the NDL. It was irradiated by neutrons and tested with the beta telescope at the temperature of \SI{-30}{\celsius}. The doping concentration of the gain layer drops quickly after irradiation, and a higher working voltage is required to compensate for the gain. After the irradiation with a fluence of \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}, the collected charge meets the HGTD requirements (4 fC) at the bias voltage of \SI{760}{V}. Besides, the leakage current is \SI{50}{\micro\ampere/\centi\metre^2} at the same bias voltage, which also passes the HGTD requirements (125 \SI{}{\micro\ampere/\centi\metre^2}). The Landau contribution is almost stable with different irradiation fluences and bias voltages as expected. The decreases of the gain and the SNR for the irradiated sensor lead to an increase of the jitter contribution, and eventually worsen the timing resolution. After irradiation with a fluence of \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}, the timing resolution can still reach \SI{39}{ps}, which meets the HGTD requirements (70 ps). The HEP-NDL \SI{50}{\micro\metre} LGAD sensor performs a very good irradiation hardness and has the potential to be used in the HGTD project for the ATLAS detector upgrade during the HL-LHC. \acknowledgments This work was supported by the National Natural Science Foundation of China (No.11961141014), the State Key Laboratory of Particle Detection and Electronics (SKLPDE-ZZ-202001), the Hundred Talent Program of the Chinese Academy of Sciences (Y6291150K2), the CAS Center for Excellence in Particle Physics (CCEPP). Thanks to Beijing Normal University for the detector production. \section{Introduction} \label{sec_intuduction} The Low Gain Avalanche Diode (LGAD) is a new type of silicon sensor which has good timing resolution and moderate spatial resolution. This technology will be used to build the High Granularity Timing Detector (HGTD) for the ATLAS experiment in the High Luminosity Large Hadron Collider (HL-LHC)~\cite{HGTDtdr2020,HL-LHC,Nicolo2018}. The LGAD is a thin n-on-p silicon sensor with a highly doped $p^{+}$ region (as shown in Fig.~\ref{fig:SchematicLGAD}), where this $p^+$ region creates a high electric field and becomes a gain layer. Due to such a high electric field (> \SI{3}{\times10^{5}~V/cm}), more electron-hole pairs are generated by the initial carriers when passing through the gain layer. In the HGTD project, the timing resolution of LGAD sensor is required to be better than 70~ps after irradiation up to \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}. The collected charge with the same irradiation is required to be larger than 4~fC to reduce the jitter contribution in the readout ASIC chip~\cite{HGTDtdr2020}. The deteriorations of the collected charge and timing resolution for LGAD sensor after irradiation is due to the acceptor removal mechanism as described in Refs.~\cite{Moll2018,Ferrero2019,Kramberger2015,Tanyh2021}. Refs.~\cite{Cartiglia2017,Kramberger2018,Zhao2018,Lange2017,Shi2020,Wiehe2021} reported the radiation performance of HPK and CNM LGAD sensors. Previously, the Institute of High Energy Physics (IHEP) and the Novel Device Laboratory (NDL) jointly designed LGAD sensors with a \SI{33}{\micro\metre} active layer~\cite{Fan2020,NDL}. After proton irradiation with a fluence of \SI{1.5}{\times10^{15}~n_{eq}/\centi\metre^2}, the timing resolution can reach 45~ps with a collected charge of 2-4~fC. The performance of such LGAD sensor can not match the HGTD requirement for irradiation hardness (\SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2} irradiation). To improve the radiation hardness, IHEP and NDL optimized the sensor design and fabricated a new type of LGAD sensor with an increased active layer thickness of \SI{50}{\micro\metre}. This article will present in detail the irradiation hardness performance of the new type \SI{50}{\micro\metre} LGAD after neutron irradiation up to \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}, including the capacitance, the leakage current, the collected charge, and the timing resolution. Besides, the factors affecting the time resolution after irradiation are analyzed in detail. \begin{figure}[htbp] \begin{center} \rotatebox{0}{\includegraphics [scale=0.3]{Fig/SchematicLGAD2.pdf} \caption{Shematic for the LGAD sensors.} \label{fig:SchematicLGAD} \end{center} \end{figure} \begin{figure}[htbp] \begin{center} \includegraphics[scale=0.3]{Fig/Layout.pdf} \caption{The layout of the \SI{50}{\micro\metre} LGAD sensors produced with single pad size of \SI{1.3}{mm} \si{\times} \SI{1.3}{mm}.} \label{fig:Layout} \end{center} \end{figure} \section{Properties of the IHEP-NDL \SI{50}{\micro\metre} LGAD} \label{sec_Properties} The IHEP-NDL \SI{50}{\micro\metre} LGAD was fabricated on a 6-inch wafer with a p-type epitaxial layer of a silicon substrate. The resistivity of the active layer is \SI{350}{~\Omega\cdot\centi\metre}. A highly-doped $p^{+}$ region is implemented to create a high electric field and moderate internal gain. The layout of IHEP-NDL \SI{50}{\micro\metre} LGAD shown in Fig.~\ref{fig:Layout}. It is 2~\si{\times}~2 arrays with three type electrodes, the single pad size is \SI{1.3}{mm}~\si{\times}~\SI{1.3}{mm}, and the lower left is a PIN without the gain layer. The upper left has a full coverage electrode, which is the electrode structure of the full-scale LGAD array. \section{Neutron irradiation} \label{sec_irrad} The \SI{50}{\micro\metre} LGADs were irradiated with neutrons by the Institut Jozef Stefan in Ljubljana, which has been used successfully in the past decades to support sensor development~\cite{Snoj2012}. In order to study the irradiation performance, three irradiation fluences are set, which are \SI{0.8}{\times10^{15}}, \SI{1.5}{\times10^{15}} and \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}. After irradiation, these sensors were annealed for 80 minutes at \SI{60}{\celsius}, which roughly emulates the long-term annealing at the end of year shut-down period during the operation of the HL-LHC. After that, sensors with three irradiation fluences were tested and studied. \section{Effect of irradiation on capacitance and leakage current characteristics} \label{IV-CV} Neutron irradiation affects the doping and the leakage current of the sensor. The Capacitance-Voltage(C-V) and Current-Voltage(I-V) tests before and after irradiation are necessary. \subsection{Capacitance-Voltage(C-V)} LCR meter was used to test the C-V characteristics of the \SI{50}{\micro\metre} LGAD sensors at room temperature. Fig.~\ref{fig:CVCurve} shows the inverse of capacitance square as a function of the bias voltage for sensors before and after the irradiation. The gain layer depletion voltage $V_{GL}$ of the sensor before the irradiation is 29 V, and drops to 18 V, 12 V, and 7 V with irradiation fluences of \SI{0.8}{\times10^{15}}, \SI{1.5}{\times10^{15}} and \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}, respectively. With this C-V curve, the doping profile of the LGAD sensor was extracted ~\cite{Peiner1995,Nagai1992}. The relationship between doping concentration ${N_w}$ and depth ${w}$ is calculated with the following equations: \begin{equation} \begin{aligned} N_{w} &= \frac{2}{{q\epsilon_{r}\epsilon_{0}A^2}}[\mathrm{d}(\frac{1}{C^2})/\mathrm{d}{V}]^{-1}, \\ w&=\epsilon_{r}\epsilon_{0}\frac{A}{C}. \end{aligned} \end{equation} where ${q}=\SI{1.6}{\times 10^{-19}~\coulomb}$ is the electron charge, $\epsilon_{r}=11.7$ is the relative permittivity of silicon, $\epsilon_{0}=\SI{8.854}{\times 10^{-12}}~\si{\mathrm{F}/\metre}$ is the permittivity of vacuum, ${A}$ is the area of the LGAD, ${V}$ is the bias voltage, and ${C}$ is the measured capacitance. The doping profiles for various irradiation conditions are shown in Fig.~\ref{fig:doping_depth}. Due to the acceptor removal mechanism~\cite{Ferrero2019}, the doping concentration of the gain layer decreases rapidly with the increase of the irradiation fluence. Compared with the case before irradiation, the doping concentration with the irradiation fluence of \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2} reduces by a factor of 2.5. \begin{figure}[htbp] \begin{center} \subfigure[]{\includegraphics[width=.4\textwidth]{Fig/C2_V-2.pdf} \label{fig:CVCurve}} \subfigure[]{\includegraphics[width=.4\textwidth]{Fig/Doping.pdf} \label{fig:doping_depth}} \caption{(a) ${1/C^{2}}$ as a function of the bias voltage for \SI{50}{\micro\metre} LGAD sensors at the room temperature. (b) The doping profiles of \SI{50}{\micro\metre} LGAD sensors estimated from C-V measurements. } \label{fig:CV_Dop} \end{center} \end{figure} \begin{figure}[htbp] \begin{center} \includegraphics[scale=0.4]{Fig/M30C_B14_IV.pdf} \caption{ I-V curves of 50 \SI{}{\micro\metre} LGAD sensors at the temperature of \SI{-30}{\celsius}.} \label{fig:IV} \end{center} \end{figure} \subsection{Current-Voltage(I-V)} Fig.~\ref{fig:IV} shows the leakage current of \SI{50}{\micro\metre} LGAD sensor in a dark environment at the temperature of \SI{-30}{\celsius}. The leakage current of the sensor before irradiation was at nA level, and its breakdowns at a voltage of \SI{190}{V}. When the irradiation fluence increases to \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}, the total leakage current (4 pads + GR) was \SI{3.36}{\micro\ampere} (\SI{50}{\micro\ampere/\centi\metre^2}) at the bias voltage of \SI{760}{V}. This is lower than the HGTD requirement(\SI{125}{\micro\ampere/\centi\metre^2}). The collected charge at such bias voltage reaches \SI{4}{fC}, which meets the HGTD requirements. \section{Low temperature beta telescope experiment} \label{beta} \subsection{Beta telescope setup} To study the timing resolution and the collected charge, LGAD sensors were tested with a beta source at the temperature of \SI{-30}{\celsius} with the humidity controlled within 10\%. The pad under test is wire bonded to the readout board, while the guard ring and the other three pads are grounded. The readout board is a single channel readout board designed by the University of California Santa Cruz (UCSC)~\cite{Cartiglia2017}. The readout board has a high-speed inverting preamplifier with a trans-impedance of \SI{470}{~\Omega}. This preamplifier is followed by an external main amplifier with a gain of \SI{20}{~dB}. Fig.~\ref{fig:BetaSetup} shows the telescope experiment setup with a beta source. The top sensor is the device under test (DUT), and the bottom sensor is used to trigger electron signals from the beta source. The signal pulses from both sensors are recorded by a digital oscilloscope for offline analysis. \begin{figure}[htbp] \begin{center} \includegraphics[scale=0.3]{Fig/BetaSetup.pdf} \caption{Beta telescope setup for IHEP-NDL sensors.} \label{fig:BetaSetup} \end{center} \end{figure} \begin{figure}[htbp] \begin{center} \includegraphics[scale=0.4]{Fig/CC_B14-3_JSI_IHEP_-30C.pdf} \caption{The collected charge as a function of bias voltage for IHEP-NDL \SI{50}{\micro\metre} LGAD before and after irradiation at temperature of \SI{-30}{\celsius}. } \label{fig:Charge} \end{center} \end{figure} \subsection{Collected charge} \label{CC} The collected charge for each sensor is calculated as the integration of the pulse shape divided by the total gain of the preamplifier and the main amplifier. The distribution of the collected charge is fit with a shape from the convolution of the Landau and the Gaussian functions to get the most probability value (MPV) for the collected charge. The collected charges of the \SI{50}{\micro\metre} LGAD sensor before and after irradiation are shown in Fig.~\ref{fig:Charge}. The LGAD sensor before irradiation has a very high collected charge of \SI{40}{fC}. When the irradiation fluence increased to \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}, the collected charge of the \SI{50}{\micro\metre} LGAD sensor reaches \SI{4}{fC} at a bias voltage of \SI{760}{V}, and keep increasing with the higher bias voltage to \SI{7}{fC} for current measurement. As the neutron fluence increasing, the space charge density of the gain layer decreases due to the acceptor removal mechanism. Even with a high bias voltage, the ability of the sensor to collect charge decreases. This result indicates that the IHEP-NDL \SI{50}{\micro\metre} sensor passes the HGTD requirement for charge collection with irradiation (\textgreater \SI{4}{fC} after \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2} irradiation fluence). \subsection{Timing resolution} \label{Timing} The timing resolution $\sigma_{t}$ of charge particles passing through LGAD sensors is mainly composed of the following three items: \begin{equation} \label{eq:Timing} \sigma^2_t = \sigma^2_{\mathrm{TimeWalk}} + \sigma^2_{\mathrm{Landau}} + \sigma^2_{\mathrm{Jitter}} \end{equation} The time walk effect ($\sigma_{\mathrm{TimeWalk}}$) is caused by different signal amplitudes, which can be corrected by using the constant fraction discriminator (CFD) method. The details of the CFD method are in reference \cite{Cartiglia2017}. The jitter effect ($\sigma_{\mathrm{Jitter}}$) is proportional to the noise and the inverse of the signal slope~\cite{Nicolo2018}: \begin{equation} \label{eq:Jitter} \sigma^2_{\mathrm{Jitter}} = \left(\frac{N}{\mathrm{d}V/\mathrm{d}t}\right)^2, \end{equation} where ${N}$ is the Root Mean Square (RMS) of noise, d${V/}$d${t}$ is the slope of the rising edge around the threshold value. A better signal-to-noise ratio (SNR) introduces a smaller jitter contribution to the timing resolution. The Landau contribution ($\sigma_{\mathrm{Landau}}$) corresponds to the effect from Landau fluctuations in the energy deposition non-uniformities along the path of a particle passing through the detector. The CFD method is used to calculate the flight time ($\Delta{t}$) of the electron between two LGAD sensors. The detailed calculation for the timing resolution is described in Ref.~\cite{Cartiglia2017}. Since the timing resolution of the trigger sensor is known, the timing resolution of the DUT sensor is derived as: \begin{equation} \sigma_{\mathrm{DUT}} = \sqrt{\sigma^2_{\Delta{t}} - \sigma^2_{\mathrm{Trigger}}} \end{equation} \begin{figure}[htbp] \begin{center} \includegraphics[scale=0.4]{Fig/Res_B14-3_JSI_IHEP_-30C.pdf} \caption{Timing resolution as a function of bias voltage for IHEP-NDL \SI{50}{\micro\metre} LGAD sensor before and after irradiation at temperature of \SI{-30}{\celsius}.} \label{fig:Res} \end{center} \end{figure} The timing resolution of the \SI{50}{\micro\metre} LGAD sensors before and after the irradiation is shown in Fig.~\ref{fig:Res}. The timing resolution before the irradiation can reach \SI{26}{ps}. As the increase of the irradiation fluence, the working voltage increases quickly. To have a same timing resolution of \SI{40}{ps}, the sensor irradiated with three different fluences needs bias voltages of \SI{500}{V}, \SI{720}{V} and \SI{780}{V} respectively. The IHEP-NDL \SI{50}{\micro\metre} LGAD sensor meets the HGTD requirement for the timing resolution (\textless \SI{70}{ps} after \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2} irradiation fluence). \subsection{Jitter and Landau contributions} The irradiation increases the working voltage, reduces the collected charge, and deteriorates the timing resolution. The Jitter and the Landau contributions are the main sources for the timing resolution. Their contributions in the timing resolution as various irradiation fluences are analyzed and presented in this section. The Jitter contribution is calculated with Eq.~(\ref{eq:Jitter}). Fig.~\ref{fig:Jitter_BV} shows the Jitter contributions with different irradiation fluences as functions of the bias voltage and the SNR. The Jitter contribution decreases with the bias voltage increase and increases with the irradiation fluence. As the irradiation fluence increasing, acceptors in the gain layer are quickly removed, resulting in a gain decrease. This decrease of the gain results in a worse SNR and a larger Jitter contribution. As shown in Fig.~\ref{fig:Jitter_SNR}, The Jitter and SNR have a negative index relationship. When the SNR is less than 10, the Jitter contribution increases rapidly. The SNR of the IHEP-NDL \SI{50}{\micro\metre} sensor before the irradiation can be as high as 48, and reduces by a factor of 4 to be 12 after the irradiation with a fluence of \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}. \begin{figure}[htbp] \begin{center} \subfigure[]{\includegraphics[width=.6\textwidth]{Fig/Jitter_B14-3_JSI_IHEP_-30C.pdf} \label{fig:Jitter_BV} } \subfigure[]{\includegraphics[width=.6\textwidth]{Fig/SNR_Jitter_B14-3_JSI_IHEP_-30C.pdf}\label{fig:Jitter_SNR} } \subfigure[]{\includegraphics[width=.6\textwidth]{Fig/Landau_B14-3_JSI_IHEP_-30C.pdf} \label{fig:Landau_BV} } \caption{(a) The Jitter contribution as a function of the bias voltage for \SI{50}{\micro\metre} IHEP-NDL sensors. (b) The Jitter contribution as a function of the signal-to-noise ratio for IHEP-NDL sensors. (c) The Landau contribution as a function of the bias voltage for IHEP-NDL 50 \SI{}{\micro\metre} LGAD before and after the irradiation at the temperature of \SI{-30}{\celsius}. } \label{fig:Jitter_landau} \end{center} \end{figure} The Landau contribution is calculated from Eq.~(\ref{eq:Timing}). Fig.~\ref{fig:Landau_BV} gives the Landau contribution for different irradiation fluences. The Landau contribution is about 25-30 ps, and does not change dramatically with the bias voltage and the irradiation fluence. The reason is that the Landau contribution is caused by the non-uniform energy deposition and the bias voltage and the irradiation do not significantly affect this non-uniform energy deposition of the electron in the epitaxial layer. \section{Conclusion} \label{sec_Conclusion} The new \SI{50}{\micro\metre} LGAD sensor was designed by the IHEP and the NDL. It was irradiated by neutrons and tested with the beta telescope at the temperature of \SI{-30}{\celsius}. The doping concentration of the gain layer drops quickly after irradiation, and a higher working voltage is required to compensate for the gain. After the irradiation with a fluence of \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}, the collected charge meets the HGTD requirements (4 fC) at the bias voltage of \SI{760}{V}. Besides, the leakage current is \SI{50}{\micro\ampere/\centi\metre^2} at the same bias voltage, which also passes the HGTD requirements (125 \SI{}{\micro\ampere/\centi\metre^2}). The Landau contribution is almost stable with different irradiation fluences and bias voltages as expected. The decreases of the gain and the SNR for the irradiated sensor lead to an increase of the jitter contribution, and eventually worsen the timing resolution. After irradiation with a fluence of \SI{2.5}{\times10^{15}~n_{eq}/\centi\metre^2}, the timing resolution can still reach \SI{39}{ps}, which meets the HGTD requirements (70 ps). The HEP-NDL \SI{50}{\micro\metre} LGAD sensor performs a very good irradiation hardness and has the potential to be used in the HGTD project for the ATLAS detector upgrade during the HL-LHC. \acknowledgments This work was supported by the National Natural Science Foundation of China (No.11961141014), the State Key Laboratory of Particle Detection and Electronics (SKLPDE-ZZ-202001), the Hundred Talent Program of the Chinese Academy of Sciences (Y6291150K2), the CAS Center for Excellence in Particle Physics (CCEPP). Thanks to Beijing Normal University for the detector production.
\section{INTRODUCTION} In the past decades, many charmoniumlike states were observed experimentally, such as the $X(3872)$, $Y(4260)$, and $Z_c(3900)$~\cite{Olsen:2017bmm}. Among them, the vector $Y$-states should have quantum numbers $J^{PC} = 1^{--}$, as they are produced in $e^+e^-$ annihilation process. Considering the $Y(4260)$~\cite{Aubert:2005rm,He:2006kg,Yuan:2007sj,Yuan:2007sj,Liu:2013dau}, $Y(4360)$, and $Y(4660)$ states~\cite{Aubert:2006ge,Wang:2007ea,Lees:2012pv,Wang:2014hta}, together with the conventional charmonium states $\psi(4040)$, $\psi(4160)$, and $\psi(4415)$, there are at least six vector states between 4.0 and 4.7~GeV. However, the potential model only predicts five vector charmonium states in this mass region~\cite{potential}. In addition, unlike the known $1^{--}$ conventional charmonium states that decay predominantly into open-charm final states [$D^{(*)}\overline{D}^{(*)}$], the $Y$-states show strong coupling to hidden-charm final states. These unusual behaviors indicate that the $Y$-states might be non-conventional quarkonium states. To better understand the nature of these states and also one gets better insights in the relevant degrees of freedom that play a role in these systems that are governed by the strong interaction, it is important to further investigate these states experimentally. The radiative transition rates between charmonium states have been predicted theoretically from potential models~\cite{Barnes:2005pb}. The partial widths of electric dipole (E1) transitions between $\psi(4040)/\psi(4160)/\psi(4415)$ and $\chi_{cJ}$ states ($J=0,1,2$) are in the range 0 $\sim$ 35~keV. Quoting the full width of $\psi(4040)$, $\psi(4160)$, and $\psi(4415)$ to be 80, 70, and 62~MeV~\cite{pdg}, respectively, and the expected branching fractions are at the level of $10^{-7}$ - $10^{-4}$. By studying the radiative transitions between vector $Y$-states and $\chi_{cJ}$ ($J=0,1,2$), we can compare the decay of $Y$-states with conventional charmonium states, and thus help to understand the nature of $Y$ states~\cite{Ma:2014ofa,Chao:2013cca}. Experimentally, the $e^+e^-\to\gamma\chi_{cJ}$ ($J=1,2$) processes above 4~GeV have been studied before by BESIII~\cite{Ablikim:2014hwn}, CLEO~\cite{CLEOchicj}, and Belle experiments~\cite{Bellechicj}. Due to the limited statistics, no obvious signal has been observed between 4 - 5~GeV. The BESIII has collected the world's largest dataset from 4.0 to 4.6~GeV, and it is thus highly motivated to search for these decay modes. In this paper, we report the study of the $e^+e^-\to\gamma \chi_{cJ} (J=0,1,2)$ processes at $e^+e^-$ center-of-mass (c.m.) energies between $\sqrt{s}=$ 4.008 - 4.6~GeV, using data samples corresponding to an integrated luminosity of 16.0~fb$^{-1}$ accumulated with the BESIII detector at the BEPCII collider. To better estimate the contributions from $\psi(3686)$ and $\psi(3770)$, the datasets with integrated luminosity of 3.3~fb$^{-1}$ between $\sqrt{s}$ of 3.773 and 4.008~GeV for $e^+e^-\to\gamma \chi_{c1,c2}$ channels are also analyzed. The datasets together with the corresponding c.m. energies are summarized in Table~\ref{tab:cross-db_c1} in the Appendix. Compared with the previous BESIII measurement~\cite{Ablikim:2014hwn}, the new dataset covers an extended c.m. energies with about one order of magnitude higher luminosity, and also both $J/\psi\to e^{+}e^{-}/\mu^+\mu^-$ events (only $\mu^+\mu^-$ used in previous work) are studied. The integrated luminosities are measured with Bhabha events ($e^+e^-\to(\gamma)e^+e^-$) with an uncertainty of 1$\%$~\cite{Ablikim:2015nan}. The c.m. energy of each dataset is measured using dimuon events ($e^+e^-\to(\gamma)\mu^+\mu^-$), with an uncertainty of $\pm$ 0.8~MeV~\cite{Ablikim:2015zaa}. \section{BESIII DETECTOR AND MC SIMULATION} The BESIII detector~\cite{Ablikim:2009aa} records symmetric $e^+e^-$ collisions provided by the BEPCII storage ring~\cite{Yu:IPAC2016-TUYA01}, with a designed peak luminosity of $1\times10^{33}$~cm$^{-2}$s$^{-1}$ at c.m. energy of 3.77~GeV. BESIII has collected large data samples between 2.0 and 4.6~GeV~\cite{Ablikim:2019hff}. The cylindrical core of the BESIII detector covers 93\% of the full solid angle and consists of a helium-based multilayer drift chamber~(MDC), a plastic scintillator time-of-flight system~(TOF), and a CsI(Tl) electromagnetic calorimeter~(EMC), which are all enclosed in a superconducting solenoidal magnet providing a 1.0~T magnetic field. The solenoid is supported by an octagonal flux-return yoke with resistive plate counter muon identification modules interleaved with steel. The charged-particle momentum resolution at $1~{\rm GeV}/c$ is $0.5\%$, and the d$E/$d$x$ resolution is $6\%$ for electrons from Bhabha scattering. The EMC measures photon energies with a resolution of $2.5\%$ ($5\%$) at $1$~GeV in the barrel (end cap) region~\cite{Ablikim:2009aa}. The time resolution in the TOF barrel region is 68~ps, while that in the end cap region is 110~ps. The end cap TOF system was upgraded in 2015 using multi-gap resistive plate chamber technology, providing a time resolution of 60~ps~\cite{etof}. Simulated Monte Carlo (MC) samples produced with {\sc geant4}-based~\cite{geant4} software, which includes the geometrical description of the BESIII detector and the detector response, are used to determine the detection efficiency, and to estimate physical background. The signal MC $e^+e^-\to\gamma\chi_{c0,c1,c2}$ events are generated assuming a pure E1 transition. The simulation models the beam energy spread and initial-state-radiation (ISR) in $e^+e^-$ annihilation using the generator {\sc kkmc}~\cite{ref:kkmc}. The maximum ISR photon energy is set to the energy corresponding to the $\gamma\chi_{c0,c1,c2}$ production threshold. The final-state-radiation (FSR) from charged final state particles is modelled with {\sc photos}~\cite{photos}. Possible background contributions are investigated with the inclusive MC samples, which consist of open-charm processes, the ISR production of lower mass vector charmonium(-like) states, and the continuum processes. The known decay modes of charmed hadrons are modelled with {\sc evtgen}~\cite{ref:evtgen}, with known branching fractions taken from the Particle Data Group (PDG)~\cite{pdg}, and the remaining unknown decays with {\sc lundcharm}~\cite{ref:lundcharm}. \section{$e^+e^-\to\gamma\chi_{c1,c2}$} \subsection{Event selection} The final state particles for $e^+e^-\to\gamma\chi_{c1,c2}$ are $\gamma\gamma\ell^{+}\ell^{-}$, where the $\chi_{c1,c2}$ are reconstructed with $\gammaJ/\psi$, and the $J/\psi$ is reconstructed with $\ell^{+}\ell^{-}$ ($\ell=$ e or $\mu$). Events with two charged tracks with zero net charge and at least two photons are selected. Each charged track is required to originate from the interaction point, within $\pm$1~cm in the plane perpendicular to the beams and 10~cm along the beam direction. The $|\!\cos\theta|$ of each charged track is required to be less than 0.93, where $\theta$ is the polar angle of each track. Photons are required to have a deposited energy larger than 25~$\mbox{MeV}$ in the barrel EMC region ($|\!\cos\theta|<0.8$) and larger than 50~$\mbox{MeV}$ in the end cap region ($0.86<|\!\cos\theta|<0.92$). The EMC time for a photon is required to be within 700~ns of the event start time to suppress the electronic noise and energy deposition unrelated to the physical events. Each charged track should have a momentum larger than 1~$\mbox{GeV/$c$}$. For leptons, we use the energy deposited in the EMC to separate electrons from muons. Charged tracks with the energy deposited in the EMC larger than 1 GeV are identified as electrons, and charged tracks with the energy deposited less than 0.4~GeV are identified as muons. For photons, the two most energetic photons are regarded as the candidates for signal events. Through the paper, we denote the photon with higher energy as $\gamma_{H}$, and the other as $\gamma_{L}$. To improve the mass resolution and to suppress backgrounds, a four-constraint (4C) kinematic fit is performed under the $\gamma\gamma\ell^{+}\ell^{-}$ hypothesis, which constrains the total four momentum of the final measured particles to the initial four-momentum of the colliding beams. The $\chi^{2}$ of the kinematic fit is required to be less than 40. To suppress the radiative Bhabha events ($e^+e^-\to \gammae^+e^-$) in the $J/\psi\toe^+e^-$ mode, the cosine of the opening angle between the electron and the nearest photon ($\!\cos\theta_{e\gamma})$ is required to be less than 0.86. Since the photon from radiative Bhabha process is always close to the beam direction, the cosine of the polar angle of the selected photons are required to satisfy $|\!\cos\theta_{\gamma_{L/H}}|<0.8$. In both $e^+e^-$ and $\mu^+\mu^-$ modes, the background from $e^+e^-\to\etaJ/\psi$ with $\eta\to\gamma\gamma$ is rejected by requiring $|M(\gamma_{H}\gamma_{L})-m(\eta)|>0.03$~$\mbox{GeV/$c^2$}$. Furthermore, the $\pi^{+}\pi^{-}\pi^{0}$ background is rejected by requiring $|M(\gamma_{H}\gamma_{L})-m(\pi^{0})|>0.015$~$\mbox{GeV/$c^2$}$ in the $J/\psi\to\mu^+\mu^-$ mode. MC simulations show that the background from $e^+e^-\to\gamma_{\rm ISR}\psi(3686)$ with $ \psi(3686)\to\gamma\chi_{c1,c2}$ can be ignored for most of the energies expect for data at $\sqrt{s}=3.773$~GeV. These background events are simulated and subtracted from the signal yield at $\sqrt{s}=3.773$~GeV. A fit to the lepton pair invariant mass gives a resolution of 10.8~$\mbox{MeV/$c^2$}$ and 10.5~$\mbox{MeV/$c^2$}$ for $J/\psi\toe^+e^-$ and $J/\psi\to\mu^+\mu^-$ events, respectively. The $J/\psi$ mass window is defined as 3.08~$<M(\ell^+\ell^-)<3.12$~$\mbox{GeV/$c^2$}$. While the sidebands of the $J/\psi$ are defined by 3.00~$<M(\ell^+\ell^-)<3.06$~$\mbox{GeV/$c^2$}$ and 3.14~$<M(\ell^+\ell^-)<3.20$~$\mbox{GeV/$c^2$}$, which is three times as wide as the $J/\psi$ signal region. \subsection{Cross section} According to kinematic, we find that the photon from $e^+e^-\to\gamma\chi_{c1,c2}$ has lower energy than the one from $\chi_{c1,c2}\to\gammaJ/\psi$ for data with $\sqrt{s}<4.009$~GeV. On the contrary, the former has higher energy than the latter for data with $\sqrt{s}>4.009$~GeV. To obtain the number of signal events, we make use of both fitting and counting methods. For each data sample with $\cal{L}_{\rm int}>$ 400~pb$^{-1}$($\cal{L}_{\rm int}$ is integrated luminosity), a fit with $J/\psi\toe^+e^-$ or $\mu^+\mu^-$ events is performed to the invariant mass distribution of $\gamma_{H}J/\psi$ ($\sqrt{s}<4.009$~GeV) or $\gamma_{L}J/\psi$ ($\sqrt{s}>4.009$~GeV). For data at $\sqrt{s}=4.009$~GeV, these two photons cannot be distinguished by energy. A 2-dimensional fit to the distribution of $M(\gamma_{H}J/\psi)$ versus $M(\gamma_{L}J/\psi)$ is used to extract the number of signal events. In these fits, the signal probability density functions (PDFs) are described with MC-simulated shapes, and the background PDFs are constrained to $J/\psi$ sideband events. For the low-statistics data samples with $\cal{L}_{\rm int}<$ 200~pb$^{-1}$ and $\sqrt{s}>4.009$~GeV, we obtain the signal yield by counting the number of events in the $\chi_{c1,c2}$ signal region and by subtracting the number of normalized background events in the $\chi_{c1,c2}$ mass sideband region. The $\chi_{c1}$ and $\chi_{c2}$ signal regions are defined as 3.49~$<M(\gamma_{L}J/\psi)<3.53$~$\mbox{GeV/$c^2$}$ and 3.54~$<M(\gamma_{L}J/\psi)<3.58$~$\mbox{GeV/$c^2$}$, which include more than 94$\%$ of the signal events. The sidebands of $\chi_{c1,c2}$ are defined as 3.42~$<M(\gamma_{L}J/\psi)<3.46$~$\mbox{GeV/$c^2$}$ and 3.6~$<M(\gamma_{L}J/\psi)<3.64$~$\mbox{GeV/$c^2$}$. Taking $\sqrt{s}=4.178$~GeV as an example, the invariant mass distribution of $M(\gamma_{L}J/\psi)$ as well as the fit results for the surviving events are shown in Fig.~\ref{fig:chic12_4180}. Clear $\chi_{c1,c2}$ signals are observed. The statistical significance of $\chi_{c1,c2}$ signals are calculated by comparing the log-likelihoods with and without the signal components in the fit, and taking the change of number of degrees of freedom into account. The statistical significances are estimated to be 7.6$\sigma$ for the $\chi_{c1}$ signal and 6.0$\sigma$ for the $\chi_{c2}$ signal. This is the first observation of the $e^+e^-\to\gamma\chi_{c1,c2}$ processes between 4 - 5~GeV. The invariant mass distributions of $M(\gamma_{L}J/\psi)$ for both $J/\psi\toe^+e^-$ and $J/\psi\to\mu^+\mu^-$ at $\sqrt{s}=4.13\sim 4.3$~GeV (exclude 4.178~GeV) and $\sqrt{s}=4.3\sim 4.5$~GeV are also shown in Fig.~\ref{fig:chic12_4180}. \begin{figure}[htp] \centering \subfigure{ \includegraphics[width=3.2in,height=1.6in]{Fig1a.eps} } \subfigure{ \includegraphics[width=3.2in,height=1.6in]{Fig1b.eps} } \subfigure{ \includegraphics[width=3.2in,height=1.6in]{Fig1c.eps} } \caption{Fit to the $M(\gamma_{L}J/\psi)$ distributions for (a) $J/\psi\toe^+e^-$ and (b) $J/\psi\to\mu^+\mu^-$ data at $\sqrt{s}=4.178$~GeV. The $M(\gamma_{L}J/\psi)$ distributions for $J/\psi\toe^+e^-$ (c,e) and $J/\psi\to\mu^+\mu^-$ (d,f) data at $\sqrt{s}=4.129$ - $4.288$~GeV (exclude 4.178~GeV) (c,d) and $\sqrt{s}=4.308$ - $4.467$~GeV (e,f). In a, b: Dots with error bars are data, the blue solid curves are the total fit results, the red dotted (pink dashed) curves are $\chi_{c1}$ ($\chi_{c2}$) signals, and the green dotted-dashed curves are backgrounds. In c, d, e, f: the shaded histograms are from normalized $J/\psi$ mass sideband events, the red and blue vertical dashed lines represent the world average mass values of $\chi_{c1}$ and $\chi_{c2}$ resonances, respectively.} \label{fig:chic12_4180} \end{figure} \par The production cross section of $e^+e^-\to\gamma\chi_{c1,c2}$ at each $e^+e^-$ c.m. energy is calculated as \begin{linenomath} \begin{equation} \sigma(\sqrt{s})=\frac{N^{\rm signal}}{\mathcal{L}_{\rm int}(1+\delta)\epsilon\mathcal{B}}, \end{equation} \end{linenomath} where $N^{\rm signal}$ is the number of signal events, $\mathcal{L}_{\rm int}$ is the integrated luminosity, $\epsilon$ is the selection efficiency, and $\mathcal{B}=\mathcal{B}(\chi_{c1,c2}\to\gammaJ/\psi)\times\mathcal{B}(J/\psi\to\ell^{+}\ell^{-})$ is the branching fraction of intermediate states in the sequential decay, $(1+\delta)$ is the ISR correction factor~\cite{isr-cor}. The ISR correction factor is calculated with the {\sc kkmc} program, with the measured $\sqrt{s}$-dependent cross section of the reactions $e^+e^-\to\gamma\chi_{c1,c2}$ as input. This procedure is iterated several times until $(1+\delta)\epsilon$ converges, i.e. the relative difference between the last two iterations is less than 1\%. The final measured cross sections $\sigma(\sqrt{s})$ for $e^+e^-\to\gamma\chi_{c1}$ are shown in Fig.~\ref{fig:cross_c1} and are summarized in Table~\ref{tab:cross-db_c1} in the Appendix. Note that some of the cross sections are negative, thereby seem unphysical. This is caused by the fact that the number of events in the signal region is less than the estimated number of background events from sideband regions, and it can be explained by statistical fluctuations. To study the possible resonances in the $e^+e^-\to\gamma\chi_{c1}$ process, a maximum likelihood fit is performed to the $\sqrt{s}$-dependent cross sections. To describe the data, we use two coherent Breit-Wigner (BW) resonances, i.e. the $\psi(4040)$ and $\psi(4160)$, together with a continuum term and the incoherent $\psi(3686)$, $\psi(3770)$ tail contributions. Since the contribution from $\psi(3686)$ and $\psi(3770)$ is small at $\sqrt{s}>4$~GeV and also lack of data between 3.77 and 4.0~GeV, we do not consider the interference effect from $\psi(3686)$ and $\psi(3770)$. The possible interference effect between continuum and other components is also investigated and we find its contribution is small (and taken as systematic effects). The fit function is thus written as \begin{linenomath} \begin{equation} \begin{split} \sigma_{e^+e^-\to\gamma\chi_{c1}}(\sqrt{s})=&|A_{cont}|^2+|BW_{\psi(3686)}(\sqrt{s})|^{2}\\ &+|BW_{\psi(3770)}(\sqrt{s})|^2+ |BW_{\psi(4040)}(\sqrt{s})\\ &+BW_{\psi(4160)}(\sqrt{s})e^{i\phi_1}|^{2}, \end{split} \end{equation} \end{linenomath} where $\phi_{i}$ is the relative phase of the amplitude, and $A_{cont}$ is the continuum amplitude which is parametrized as \begin{linenomath} \begin{equation} A_{cont}=\sqrt{\frac{f_{cont}}{\sqrt{s}^n}\Phi(\sqrt{s})}, \end{equation} \end{linenomath} where $f_{cont}$ and $n$ are the free parameters. $BW$ function is described as \begin{linenomath} \begin{equation} BW_R(\sqrt{s})=\frac{M_R}{\sqrt{s}} \frac{\sqrt{12\pi\Gamma_R^{ee}\Gamma_R^{tot}{B_R}}}{s-M_R^{2}+iM_R\Gamma_R^{tot}}\sqrt{\frac{\Phi(\sqrt{s})}{\Phi(M_R)}}, \end{equation} \end{linenomath} where M, $\Gamma^{tot}_{R}$ and $\Gamma^{ee}_{R}$ are the mass, full width and electric width of the resonance $R$, respectively. ${B_{R}}$ is the branching fraction of $R\to\gamma\chi_{c1}$, and $\Phi(\sqrt{s})$ is the phase space factor. For the E1 transition of the process $\psi(3686)\to\gamma\chi_{c1}$, we consider an additional factor the $E_\gamma^3$~\cite{Brambilla:2010cs} and a damping factor~\cite{Anashin:2010dh}, according to \begin{linenomath} \begin{equation} BW_{\psi(3686)}(\sqrt{s})=\frac{M}{\sqrt{s}}\frac{\sqrt{12\pi\Gamma^{ee}\Gamma^{tot}B_{i}}}{s-M^{2}+iM\Gamma^{tot}}{\Phi(\sqrt{s}){D(\sqrt{s})}}, \end{equation} \end{linenomath} \\ where the phase space factor is given by ${\Phi(\sqrt{s})}=\left(\frac{E_\gamma}{E_\gamma^{0}}\right)^{3/2}$ ~\cite{Brambilla:2010cs}, and the damping factor as $D(\sqrt{s})=\left(\frac{(E_\gamma^{0})^2}{E_\gamma^{0}E_{\gamma}+(E_\gamma^{0}-E_{\gamma})^2}\right)^{1/2} $ ~\cite{Anashin:2010dh}. The parameters $E_\gamma$ and $E_\gamma^{0}$ are the energy of the E1 photon for the $\psi(3686)\to\gamma{\chi_{c1}}$ decay at c.m. energy $\sqrt{s}$ and at the $\psi(3686)$ mass, respectively. In the cross section fit, the likelihood function is defined as \begin{linenomath} \begin{equation} \mathcal{L}=\prod {G}(N^{\rm sig}_{i}|s_i)\prod{P}(N^{\rm obs}_{j}|(s+b)_j), \end{equation} \end{linenomath} where $N^{\rm sig}$ is the number of signal events measured from dataset $i$, $s_i$ is the expected number of signal events for the corresponding dataset, and $G$ represents a Gaussian distribution which describes datasets with high statistics at $\sqrt{s}=3.773$ and $ 4.178$~GeV. $N_j^{\rm obs}$ is the number of events observed in the $\chi_{c1}$ mass interval from dataset $j$, $(s+b)_j$ is the expected sum of signal and background events in the same interval, and $P$ represents a Poisson distribution which describes low statistics datasets at other c.m. energies. In the fit PDF, the masses and widths of $\psi(3686)$, $\psi(3773)$, $\psi(4040)$, $\psi(4160)$, and $\Gamma_{ee}\cdot\mathcal{B}_{i} [\psi(3686)\to\gamma\chi_{c1}]$ are fixed to PDG values~\cite{pdg}. The fit result is shown in Fig.~\ref{fig:cross_c1}, and also summarized in Table~\ref{tab:BW-fit_chic1}. The significance of $\psi(4040)$, $\psi(4160)$ and the continuum term are estimated to be 3.7$\sigma$, 3.3$\sigma$ and 6.7$\sigma$, respectively. Considering the constructive and destructive interferences between $\psi(4040)$ and $\psi(4160)$, there are two solutions with equal good quality from the fit, which has been proved mathematically~\cite{Bai:2019jrb}. A $\chi^{2}$-test is used to estimate the fit quality. Due to the low statistics of data at some c.m. energies, we merge the datasets into 17 groups, and the $\chi^{2}$-test gives $\chi^{2}/ndf = 10.6/11=0.96$, where $ndf$ is the number of degree of freedom. \begin{figure}[htp] \centering \subfigure{ \includegraphics[width=2.8in,height=2.3in]{Fig2.eps} } \caption{Cross section of $e^+e^-\to\gamma\chi_{c1}$ process and a maximum likelihood fit to the line shape. Dots with error bars are data, the red curve shows the fit results, and the dashed curves show the contribution of each component.} \label{fig:cross_c1} \end{figure} \begin{table}[htbp] \centering \caption{Results of the fit to the $e^+e^-\to\gamma\chi_{c1}$ cross sections. The unit of $e^+e^-$ partial width is~eV$/c^{2}$ and the unit of $f_{cont}$ is ~eV$^n/$pb. The errors are statistical only. } \label{tab:BW-fit_chic1} \begin{tabular}{c r@{.}l r@{.}l } \hline\hline \centering{Parameter} & \multicolumn{2}{c}{\centering{Solution I}}& \multicolumn{2}{c}{\centering{Solution II}} \\ \hline $\Gamma^{ee}\mathcal{B}(\psi(3770)\to\gamma\chi_{c1})$ & \multicolumn{4}{c}{(6.8$\pm$0.4)$\times10^{-1}$}\\ $\Gamma^{ee}\mathcal{B}(\psi(4040)\to\gamma\chi_{c1})$ & (6&0$\pm$2.1)$\times10^{-1}$&(6&1$\pm$2.1)$\times10^{-1}$ \\ $\Gamma^{ee}\mathcal{B}(\psi(4160)\to\gamma\chi_{c1})$ & (1&3$\pm$0.8)$\times10^{-1}$&(1&4$\pm$0.9)$\times10^{-1}$\\ $\phi_1$ &192&$1^{\circ}\pm24.1^{\circ}$ &196&$0^{\circ}\pm24.6^{\circ}$ \\ $f_{cont}$&\multicolumn{4}{c}{$4.1\pm0.6$}\\ $n$ &\multicolumn{4}{c}{$0\pm1.3$}\\ \hline\hline \end{tabular} \end{table} \begin{figure}[htp] \centering \subfigure{ \includegraphics[width=2.8in,height=2.3in]{Fig3.eps} } \caption{Cross section of $e^+e^-\to\gamma\chi_{c2}$ process and a maximum likelihood fit to the line shape. Dots with error bars are data, the red curve shows the fit results, and the dashed curves show the contribution of each component.} \label{fig:cross_c2} \end{figure} For the $e^+e^-\to\gamma\chi_{c2}$ process, the measured cross sections are shown in the Fig.~\ref{fig:cross_c2} and summarized in Table~\ref{tab:cross-db_c2} in the Appendix. In the fit PDF, the resonance parameters of $\psi(3686)$, $\psi(3770)$, $\psi(4040)$, and $\psi(4160)$ are also fixed to PDG values. To describe the $\sqrt{s}$-dependent cross section, one more resonance is added in the fit function to describe the structure around $\sqrt{s}=4.39$~GeV. According to the fit, the contribution from continuum is not significant in this process ($<1\sigma$). Thus, we construct the fit function as \begin{linenomath} \begin{equation} \begin{split} \sigma_{e^+e^-\to\gamma\chi_{c2}}(\sqrt{s})=&|BW_{\psi(3686)}(\sqrt{s})|^{2}+|BW_{\psi(3770)}(\sqrt{s})|^2+\\ &|BW_{\psi(4040)}(\sqrt{s})+BW_{\psi(4160)}(\sqrt{s})e^{i\phi_1}\\ &+BW_{\mathcal{R}}(\sqrt{s})e^{i\phi_2}|^{2}, \end{split} \end{equation} \end{linenomath} The fit results are shown in Fig.~\ref{fig:cross_c2} and summarized in Table~\ref{tab:BW-fit_chic2}. Same as before, there are four solutions with equal fit quality, due to the interferences between $\psi(4040)$, $\psi(4160)$, and the new resonance~\cite{Bai:2019jrb}. The significance of $\psi(4040)$, $\psi(4160)$ and the resonance near 4.39~GeV are estimated to be 2.0$\sigma$, 4.6$\sigma$ and 5.8$\sigma$, respectively. Similarly, we merge the data into 17 groups when performing a $\chi^{2}$-test. The $\chi^{2}$-test to the fit quality gives $\chi^{2}/ndf = 7.8/9=0.87$. \begin{table*} \centering \caption{Results of the fit to the $e^+e^-\to\gamma\chi_{c2}$ cross sections. The unit of the $e^+e^-$ partial width is~eV$/c^{2}$. The errors are statistical only.} \label{tab:BW-fit_chic2} \begin{tabular}{c r@{.}l r@{.}l r@{.}l r@{.}l} \hline\hline \centering{Parameter} & \multicolumn{2}{c}{\centering{Solution I}}& \multicolumn{2}{c}{\centering{Solution II}} & \multicolumn{2}{c}{\centering{Solution III}}& \multicolumn{2}{c}{\centering{Solution IV}}\\ \hline $\Gamma^{ee}\mathcal{B}(\psi(3770)\to\gamma\chi_{c2})$ & \multicolumn{8}{c}{(0.6$\pm$0.4)$\times10^{-1}$}\\ $\Gamma^{ee}\mathcal{B}(\psi(4040)\to\gamma\chi_{c2})$ & (13&4$\pm$4.7)$\times10^{-1}$&(6&9$\pm$3.5)$\times10^{-1}$ &(13&3$\pm$4.7)$\times10^{-1}$& (6&9$\pm$3.5)$\times10^{-1}$\\ $\Gamma^{ee}\mathcal{B}(\psi(4160)\to\gamma\chi_{c2})$ & (6&8$\pm$1.9)$\times10^{-1}$&(2&1$\pm$0.9)$\times10^{-1}$ &(6&4$\pm$1.8)$\times10^{-1}$&(2&1$\pm$0.9)$\times10^{-1}$ \\ $M(\mathcal{R})$ & \multicolumn{8}{c}{4371.7$\pm7.5$}\\ $\Gamma^{tot}(\mathcal{R})$ & \multicolumn{8}{c}{51.1$\pm17.6$} \\ $\Gamma^{ee}\mathcal{B}(\mathcal{R}\to\gamma\chi_{c2})$ & (4&7$\pm$1.6)$\times10^{-1}$&(3&9$\pm$1.3)$\times10^{-1}$ & (4&4$\pm$1.5)$\times10^{-1}$& (4&1$\pm$1.4)$\times10^{-1}$ \\ $\phi_1$ &241&5$^{\circ}\pm15.0^{\circ}$&105&$6^{\circ}\pm33.7^{\circ}$ & 238&$9^{\circ}\pm14.8^{\circ}$ &107&$3^{\circ}\pm34.2^{\circ}$\\ $\phi_2$ &248&$7^{\circ}\pm31.3^{\circ}$&24&$8^{\circ}\pm39.2^{\circ}$ & 252&$6^{\circ}\pm31.7^{\circ}$ &19&$5^{\circ}\pm30.8^{\circ}$\\ \hline\hline \end{tabular} \end{table*} \section{$e^+e^-\to\gamma\chi_{c0}$} \subsection{Event selection} For the $e^+e^-\to\gamma\chi_{c0}$ study, the $\chi_{c0}$ resonance is reconstructed with $2(\pi^{+}\pi^{-})$, $\pi^{+}\pi^{-}K^{+}K^{-}$, and $K^{+}K^{-}$ decay modes. Considering the relatively small branching fractions from the $\chi_{c0}$ decay and also the high background levels, only the data samples with $L_{\rm int}>400$~pb$^{-1}$ at $\sqrt{s}>4.0$~GeV are used in this study. The selection criteria of charged tracks and photons are the same as for the $e^+e^-\to\gamma\chi_{c1,c2}$ analysis. The particle identification (PID) of kaons and pions is based on the d$E/$d$x$ and TOF information, and the particle type with the highest probability is assigned to each track. For photons, the most energetic photon is regarded as the candidate for signal events. A 4C kinematic fit is performed to these three decay modes and $\chi_{4c}^{2}<25$ is required for both $\chi_{c0}\to2(\pi^+\pi^-)/ K^+K^-\pi^+\pi^-$ modes and $\chi_{4c}^{2}<30$ for the $\chi_{c0}\to K^+K^-$ mode. For the $\chi_{c0}\to K^+K^-\pi^+\pi^-$ decay mode, background events with a photon from resonances decay, such as $\omega\to\pi^{+}\pi^{-}\pi^{0}$, $\eta'\to\gamma\pi^{+}\pi^{-}$ and $\pi^{0}\to\gamma\gamma$ are vetoed. For $\omega\to\pi^{+}\pi^{-}\pi^{0}$ events with one of the photons from the $\pi^{0}$ decay undetected, we require $|M(\gamma\pi^+\pi^-)-756.9$~$\mbox{MeV/$c^2$}|>20$~$\mbox{MeV/$c^2$}$ to suppress them. Here, $756.9$~$\mbox{MeV/$c^2$}$ is the position of the peak obtained by fitting the $M(\gamma\pi^+\pi^-)$ distribution in the data, which has a $\sim$ 25~MeV mass shift from the $\omega$ world average mass~\cite{pdg}. The $\eta'\to\gamma\pi^{+}\pi^{-}$ background events are vetoed by requiring $|M(\gamma\pi^+\pi^-)-m(\eta')|>10$~$\mbox{MeV/$c^2$}$ (hereafter, $m$(particle) denotes the world average mass of a particle listed in the PDG~\cite{pdg}). To further suppress backgrounds from $\pi^{0}\to\gamma\gamma$ decay, the combination of the radiative photon with an extra reconstructed photon should not come from a $\pi^{0}$ candidate. We require $|M(\gamma\gamma_{extra})-m(\pi^{0})|>12$~$\mbox{MeV/$c^2$}$, where $M(\gamma\gamma_{extra})$ is the mass closest to $m(\pi^{0})$ from the radiative photon and an extra photon combination. Further background from $\phi\to K^{+}K^{-}$ process is also vetoed by requiring $M(K^{+}K^{-})>1.05$~$\mbox{GeV/$c^2$}$. For the $\chi_{c0}\to 2(\pi^+\pi^-)$ decay mode, the background events with $\eta\to\gamma\pi^{+}\pi^{-}$, $\omega\to\pi^{0}\pi^{+}\pi^{-}$, $\eta'\to\gamma\pi^{+}\pi^{-}$ and $\pi^{0}\to\gamma\gamma$ are suppressed by requiring $|M(\gamma\pi\pi)-m(\eta)|>6$~$\mbox{MeV/$c^2$}$, $|M(\gamma\pi\pi)-765.4$~$\mbox{MeV/$c^2$}|>22$~$\mbox{MeV/$c^2$}$, $|M(\gamma\pi\pi)-m(\eta')|>10$~$\mbox{MeV/$c^2$}$ and $|M(\gamma\gamma_{extra})-m(\pi^{0})|>6$~$\mbox{MeV/$c^2$}$, respectively. Similarly, the $765.4$~$\mbox{MeV/$c^2$}$ is the average value obtained by fitting the $M(\gamma\pi^+\pi^-)$ spectrum for $\omega$ background events. Here, $M(\gamma\pi\pi)$ keeps all combinations of pion pairs. There are backgrounds from radiative Bhabha and radiative dimuon events ($e^+e^-\to\gamma\mu^+\mu^-$), with one of the radiative photon converted to an $e^+e^-$ pair ($\gamma$-conversion) and misidentified as pions. The opening angle of the $\pi^{+}\pi^{-}$ candidate is expected to be small ($\cos\theta\sim$1) for such kind of background events, and we require $\cos\theta_{\pi^{+}\pi^{-}}<0.98$ for all $\pi^+\pi^-$ candidate combinations to suppress them. For the $\chi_{c0}\to K^+K^-$ decay mode, there are Bhabha background events. We require the deposited energy in the EMC over the momentum of a charged track $E_{EMC}/p<0.8$ to reject them. Same as before, $|M(\gamma\gamma_{extra})-m(\pi^{0})|>10$~$\mbox{MeV/$c^2$}$ is required to suppress background with $\pi^{0}\to\gamma\gamma$. \subsection{Cross section} Figure~\ref{fig:data_c0} shows the $M(K^+K^-\pi^+\pi^-$), $M(\pi^+\pi^-\pi^+\pi^-$), and $M(K^+K^-)$ invariant mass distributions for the full datasets after imposing the above selection criteria. \begin{figure*}[htp] \centering \subfigure{ \includegraphics[width=2.0in,height=1.7in]{Fig4a.eps} \includegraphics[width=2.0in,height=1.7in]{Fig4b.eps} } \subfigure{ \includegraphics[width=2.0in,height=1.7in]{Fig4c.eps} } \caption{Mass distributions of (a) $M(K^+K^-\pi^+\pi^-)$, (b) $M(\pi^+\pi^-\pi^+\pi^-)$ and (c) $M(K^+K^-)$ for combined data samples from $\sqrt{s}=4.008$ to 4.600~GeV. The red histograms represent the $\chi_{c0}$ MC shape with an arbitrary normalization.} \label{fig:data_c0} \end{figure*} To obtain the number of $\chi_{c0}$ signal events, an unbinned maximum likelihood fit is performed to the $M(K^+K^-\pi^+\pi^-$), $M(\pi^+\pi^-\pi^+\pi^-$) and $M(K^+K^-)$ distributions simultaneously at each c.m. energy. The signal yields for three decay modes are constrained according to corresponding reconstruction efficiencies and branching fractions. In the fit, the signal PDFs are described with the shapes from simulated signal MC events. The background shapes are described with two 2nd-order polynomial functions for the $\chi_{c0}\to K^+K^-\pi^+\pi^-$, $2(\pi^+\pi^-)$ decay modes, and a 1st-order polynomial function for the $K^+K^-$ mode. The significance of $\chi_{c0}$ signal is estimated to be less than 2$\sigma$ at each c.m. energy point. To estimate an upper limit (UL) of the production cross sections, we scan the likelihood curve in the fit and set the 90\% C.L. The corresponding UL of the cross section is calculated as \begin{linenomath} \begin{equation} \sigma_{e^+e^-\to\gamma\chi_{c0}}^{\rm up}(\sqrt{s})=\frac{N^{\rm up}}{\mathcal{L}_{\rm int}(1+\delta)(1+\delta_{v})\sum_{i=0}^{3}\epsilon_i\cdot\mathcal{B}_i}, \end{equation} \end{linenomath} where $N^{\rm up}$ is the UL of the number of signal events at 90\% C.L., which is obtained by integrating the likelihood curve of the fit (the systematic uncertainty is considered by convolving the likelihood curve with a Gaussian and its standard deviation is set to the systematic uncertainty). $(1+\delta_{v})$ is the vacuum polarization factor taken from calculation~\cite{VP-cite}. The UL of the cross sections at all c.m. energies are shown in Fig.~\ref{fig:UL-c0} and summarized in Table~\ref{tab:chi0_chic0_upper} in the Appendix . \begin{figure}[htp] \centering \subfigure{ \includegraphics[width=2.8in,height=2.3in]{Fig5.eps} } \caption{The upper limits of Born cross section for $e^+e^-\to\gamma\chi_{c0}$ process at $\sqrt{s}=4.008$ - $4.600$~GeV.} \label{fig:UL-c0} \end{figure} \section{SYSTEMATIC UNCERTAINTY} The systematic uncertainty of the cross section measurements of $e^+e^-\to\gamma\chi_{cJ}$ ($J=0,1,2$) mainly comes from the luminosity measurement, detection efficiency, decay branching fractions, signal extraction, and radiative correction. The luminosity is measured using Bhabha events and the uncertainty is estimated to be 1$\%$~\cite{Ablikim:2015nan}. For high momentum leptons, the uncertainty of the tracking efficiency is 1$\%$ per track~\cite{Ablikim:2014hwn}. The uncertainty in the photon reconstruction is 1$\%$ per photon, estimated by studying the $J/\psi\to\rho^{0}\pi^{0}$ decay~\cite{Ablikim:2010zn}. The PID efficiency uncertainty for each charged track is taken as 1$\%$~\cite{Ablikim:2017cbv}. For the systematic uncertainty from the kinematic fit, we correct the track helix parameters in the MC simulation according to the method described in Ref.~\cite{Ablikim:2012pg}, and the efficiency difference before and after correction is considered as the systematic uncertainty. The uncertainties for the branching fractions of $\chi_{c1,c2}\to\gamma J/\psi$, and $\chi_{c0}\to\pi^+\pi^-\pi^+\pi^-,~K^+K^-\pi^+\pi^-,~K^+K^-$ from the PDG~\cite{pdg} are taken as systematic uncertainties for the cross section measurement. For the $e^+e^-\to\gamma\chi_{c0}$ process, the systematic uncertainties for tracking, PID, photon detection and kinematic fit are the same, and the total systematic error is obtained by weighting each individual one according to the branching fractions and efficiencies of three $\chi_{c0}$ decay modes, by considering the possible correlations between them. For the systematic uncertainty from the background veto requirements, we select the $\psi(3686)\to\gamma\chi_{c0,c1,c2}$ control samples, and the selection requirements are exactly the same as the requirements described above. We take the efficiency difference between MC simulation and corresponding control samples as the systematic uncertainties. For the systematic uncertainty from the $J/\psi$ mass window, an $e^+e^-\to\etaJ/\psi$ control sample is studied and we take the efficiency difference between MC simulation and control samples as the uncertainties. \begin{table}[htbp] \centering \caption{Summary of systematic uncertainties sources on the cross section measurement in $\%$, the ``$-$" indicates that the uncertainty is not applicable. } \label{tab:sys_chic1c2} \begin{tabular}{c | c |c |c } \hline\hline \centering{Source} & {\centering{$\chi_{c0}$}} & {\centering{$\chi_{c1}$}}& {\centering{$\chi_{c2}$}} \\ \hline Luminosity & 1.0 & 1.0&1.0\\ Tracking & 3.7 & 2.0&2.0 \\ Photon efficiency & 1.0 & 2.0 &2.0 \\ PID & 3.7 & $-$ & $-$ \\ Kinematic fit & 2.4 & 0.3 &0.1\\ Branching fraction & 7.5 & 3.5 &3.6\\ Signal extraction & $-$ & 7.0 & 7.0\\ Background veto & 1.2 & 1.7 & 1.2 \\ Decay model & 1.3 & $-$ & $-$ \\ Radiative correction & 1.2 & 4.5 & 3.9\\ \hline Total & 9.8 & 9.7&9.4\\ \hline\hline \end{tabular} \end{table} To obtain the systematic uncertainty from signal extraction, we refit the $M(\gamma_{H}J/\psi)$ by replacing the background shape with 2nd-order polynomial function, varying the fit range (+0.05~$\mbox{GeV/$c^2$}$), changing the signal shape from signal MC shape to signal MC shape convoluted with a float Gaussian function. The difference with nominal fit results is taken as the systematic uncertainty. For the systematic uncertainties from the ISR correction factor in $e^+e^-\to\gamma\chi_{c1,c2}$, two sources are considered. First, the difference of $(1+\delta)*\epsilon$ between the last two iterations is taken as systematic uncertainty, which is 1\%. The other sources are the uncertainty of the fit parameters, fit components and damping factor. We sample the fit parameters with Gaussian functions (take the fit results as mean values and the errors as standard deviations) 200 times, then calculate the corresponding $(1+\delta)*\epsilon$ values. The standard deviation for $(1+\delta)*\epsilon$ of the 200 samplings is taken as a systematic error, which is 1.0\% and 1.8\% for $e^+e^-\to\gamma\chi_{c1}$ and $\gamma\chi_{c2}$, respectively. Due to the low significance of $\psi(4040)$/$\psi(4160)$ in the $e^+e^-\to\gamma\chi_{c1}$ process and $\psi(4040)$ in the $e^+e^-\to\gamma\chi_{c2}$ process, the input cross section line shapes in MC generation are tested by excluding these charmonium states. The differences for $(1+\delta)*\epsilon$ are 3.5$\%$ and 3.0$\%$ for $e^+e^-\to\gamma\chi_{c1}$ and $\gamma\chi_{c2}$, respectively. For the systematic uncertainty from the damping factor, we change the damping factor from $\left(\frac{(E_\gamma^{0})^2}{E_\gamma^{0}E_{\gamma}+(E_\gamma^{0}-E_{\gamma})^2}\right)^{1/2} $ ~\cite{Anashin:2010dh} to $e^{-\frac{E_\gamma^2}{8\beta^2}}$~\cite{Mitchell:2008aa}(the value of $\beta$ is also quoted from Ref.~\cite{Mitchell:2008aa}), the $(1+\delta)*\epsilon$ difference with two different damping factor are 0.9$\%$ and 1.3$\%$ for $e^+e^-\to\gamma\chi_{c1}$ and $\gamma\chi_{c2}$, respectively. For the possible interference between continuum and other components in the $e^+e^-\to\gamma\chi_{c1}$ process, the $(1+\delta)*\epsilon$ difference with or without considering interference is taken as systematic error, which is 2.3$\%$. For the $e^+e^-\to\gamma\chi_{c0}$, the difference between a flat line shape or a $\psi(3770)$ line shape is taken as uncertainty. For $\chi_{c0}\to\pi^+\pi^-\pi^+\pi^-, K^+K^-\pi^+\pi^-$ decay modes, the signal MC samples are generated by including all subprocesses. The difference with a pure phase space model is taken as the uncertainty due to the decay model. Table~\ref{tab:sys_chic1c2} summarizes all the systematic uncertainty sources and their contributions. The total systematic uncertainty is obtained by adding all sources in quadrature. For the resonance parameters of the structure around 4.39~GeV, the uncertainty of c.m. energies ($\pm 0.8$~$\mbox{MeV}$) are common for all data samples, and this uncertainty will propagate directly to the mass measurement. For the uncertainty from the damping factor, we change the damping factor from $\left(\frac{(E_\gamma^{0})^2}{E_\gamma^{0}E_{\gamma}+(E_\gamma^{0}-E_{\gamma})^2}\right)^{1/2} $ ~\cite{Anashin:2010dh} to $e^{-\frac{E_\gamma^2}{8\beta^2}}$~\cite{Mitchell:2008aa}, and the differences are 0.9~$\mbox{MeV}$ and 0.5~$\mbox{MeV}$ for the mass and width, respectively. To estimate the uncertainties from the parameters of $\psi(3686), \psi(3770), \psi(4160)$ and $\psi(4040)$, we randomly sample the four resonances parameters with Gaussian functions (PDG means and errors), and these values are used as input to refit the cross section. The standard deviations of these 1500 fit results are quoted as systematic errors, which are 1.0 $\mbox{MeV/$c^2$}$ and 1.6 $\mbox{MeV}$ for the mass and width, respectively. In the cross section fit, the $\psi(3770)$ contribution is added incoherently in the PDF. The possible systematic from the interference effect of $\psi(3770)$ is estimated by considering interference effect in the cross section fit. The differences are 0.8~$\mbox{MeV/$c^2$}$ and 0.8~$\mbox{MeV}$ for the mass and width. Assuming all the systematic errors are independent, the total systematic errors are 1.8~$\mbox{MeV/$c^2$}$ and 1.9~$\mbox{MeV}$ for mass and width, respectively, by adding all sources in quadrature. \section{SUMMARY} In summary, using 19.3 fb$^{-1}$ data at c.m. energies between 3.773 and 4.600~GeV, we observe the $e^+e^-\to\gamma\chi_{c1,c2}$ processes for the first time at $\sqrt{s}=4.178$~GeV. The statistical significances are 7.6$\sigma$ and 6.0$\sigma$ for $\gamma\chi_{c1,c2}$, respectively. For the $e^+e^-\to\gamma\chi_{c1}$ process, the cross section line shape can be described with $\psi(3686)$, $\psi(3770)$, $\psi(4040)$ and $\psi(4160)$ resonances. For the $e^+e^-\to\gamma{\chi_{c2}}$ process, one more resonance is added to describe the line shape of the cross section. The significance of this resonance is estimated to be $5.8\sigma$, and its parameters are measured to be $M=4371.7\pm7.5\pm1.8$~$\mbox{MeV/$c^2$}$ and $\Gamma^{tot}=51.1\pm17.6\pm1.9$~$\mbox{MeV}$, which are consistent with the $Y(4360)$/$Y(4390)$ resonances~\cite{pdg} within errors. Our result supports the $Y(4360)/Y(4390)\to\gamma\chi_{c2}$ radiative transition. In addition, the measured cross sections for $e^+e^-\to\gamma\chi_{c1,c2}$ are consistent with the potential model predictions~\cite{Barnes:2005pb}, except for $\mathcal{B}[\psi(4160)\to\gamma\chi_{c2}]\sim10^{-7}$, which is significantly lower than our measurement $\mathcal{B}[\psi(4160)\to\gamma\chi_{c2}]$=(4.4 - 14.2$)\times 10^{-4}$. For the $e^+e^-\to\gamma\chi_{c0}$ process, no obvious signal is observed. The UL indicates the $e^+e^-\to\gamma\chi_{c0}$ cross section is less than 8~pb between 4 and 4.6~GeV, and the UL is consistent with theoretical expectations. \section{ACKNOWLEDGEMENTS} The BESIII collaboration thanks the staff of BEPCII and the IHEP computing center for their strong support. This work is supported in part by National Key R$\&$D Program of China under Contracts No. 2020YFA0406300, No. 2020YFA0406400; National Natural Science Foundation of China (NSFC) under Contracts No. 11625523, No. 11635010, No. 11735014, No. 11822506, No. 11835012, No. 11935015, No. 11935016, No. 11935018, No. 11961141012, No. 12022510, No. 12025502, No. 12035009, No. 12035013, No. 12061131003, No. 11975141; the Chinese Academy of Sciences (CAS) Large-Scale Scientific Facility Program; Joint Large-Scale Scientific Facility Funds of the NSFC and CAS under Contracts No. U1732263, No. U1832207; CAS Key Research Program of Frontier Sciences under Contract No. QYZDJ-SSW-SLH040; 100 Talents Program of CAS; INPAC and Shanghai Key Laboratory for Particle Physics and Cosmology; ERC under Contract No. 758462; European Union Horizon 2020 research and innovation programme under Contract No. Marie Sklodowska-Curie grant agreement No 894790; German Research Foundation DFG under Contracts Nos. 443159800, Collaborative Research Center CRC 1044, FOR 2359, FOR 2359, GRK 214; Istituto Nazionale di Fisica Nucleare, Italy; Ministry of Development of Turkey under Contract No. DPT2006K-120470; National Science and Technology fund; Olle Engkvist Foundation under Contract No. 200-0605; STFC (United Kingdom); The Knut and Alice Wallenberg Foundation (Sweden) under Contract No. 2016.0157; The Royal Society, UK under Contracts No. DH140054, No. DH160214; The Swedish Research Council; U. S. Department of Energy under Contracts No. DE-FG02-05ER41374, No. DE-SC-0012069
\section{Introduction} Ultra-compact dwarf galaxies (UCDs) were first discovered in spectroscopic surveys of the Fornax cluster \citep{Hilker1999, Drinkwater2000} and have since been discovered in other clusters \citep{Mieske2004, Mieske2007a, has2005, Madrid2010, Misgeld2011, caso2013, Zhang2015}, in galaxy groups \citep{Evstig2007a,DaRocha2011, Madrid2013} and around isolated galaxies \citep{Hau200}. UCDs appear as objects intermediate between globular clusters and dwarf galaxies having absolute magnitudes -14.0~mag < M\textsubscript{v} < -10~mag \citep{Voggel2016} and half-light radii of 7~pc < r\textsubscript{h} < 100~pc \citep{Mieske2008}. They have central velocity dispersions similar to dwarf galaxies, of approximately 20 < $\sigma$\textsubscript{0} < 50~km s\textsuperscript{-1}, giving dynamical masses of approximately 2~$\times$~10\textsuperscript{6} to 10\textsuperscript{8}~\(\textup{M}_\odot\) \citep{has2005, Hilker2008, Mieske2008, Mieske2013}. They typically have old stellar populations, with ages of at least 8 Gyr \citep{Chilingarian2011, Janz_2015}. The method by which UCDs form is a matter of some debate, and there are a variety of competing formation theories. One scenario contends that they are the high-mass end of the globular cluster mass-function around galaxies with rich GC systems \citep{Mieske2002, Mieske2012}, possibly formed from the merger of many globular clusters in star cluster complexes \citep{Kroupa1998, Fellhauer2002, brun2011, brun2012}. The alternate scenario is that they are the compact nuclei of dwarf galaxies that underwent galaxy threshing leaving only the nucleus remaining \citep{Bassino1994, Bekki2001, Bekki2003, Drinkwater2003, Goerdt2008, Pfeffer2013, Pfeffer2014}. There is a growing body of evidence that neither formation scenario is responsible for the full UCD population and that both the main scenarios make up some portion of the UCD population \citep{Mieske2006, brodie2011, Chilingarian2011, DaRocha2011,Norris2011,Pfeffer2014, Pfeffer2016}. Aside from a few distinct objects that contain central supermassive black holes or feature extended star formation histories \citep[e.g.][]{Seth2014, Norris2015, Ahn2017, Ahn2018} it is difficult to distinguish between the different formation scenarios since they predict similar internal UCD properties. Therefore, determining what role each mechanism plays in the formation of UCDs requires predictions from simulations on how each process may contribute to the formation of UCD populations. Stripped nuclei are a likely explanation for at least some percentage of the UCD population for a variety of reasons. In structure and properties, UCDs bear many resemblances to the compact nuclei of galaxies: They overlap the luminosity distribution of nuclei \citep{Drinkwater2004}, and follow a similar size-luminosity distribution while being approximately 2.2 times larger than galaxy nuclei at the same luminosity \citep{Evstig2008A}. They have similar internal velocity dispersions \citep{Drinkwater2003}, follow dwarf elliptical nuclei on the colour-magnitude diagram \citep{Cote2006, Evstig2008A, brodie2011}, and have similar metallicities to dwarf galaxies, while lying above the metallicity-luminosity relation \citep{Chilingarian2011, Francis2012, Spengler2017, Zhang2018}. This would be expected in the case of tidal stripping as it would cause luminosity to decrease while metallicity remains constant. \hl{\mbox{\citet{Janz_2015}} found a transition in UCD stellar populations at \mbox{M~=~2~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\)}, which they interpreted as the point at which UCDs transition from being composed of a mixture of stripped nuclei and globular clusters to being composed primarily of stripped nuclei.} Some UCDs have been found to have stellar halos which might be the remains of the original galaxies \citep{Drinkwater2003, has2005, Chilingarian2008, Evstig2008A, Chiboucas2011}. Other UCDs show evidence of tidal tail-like features \citep{Voggel2016}, and a UCD in the Virgo cluster, M59-UCD3, has a tidal stream pointing towards it which is potentially the remnant of its tidally stripped galaxy \citep{LiuPeng2015}. Irregular objects have been found which may be dwarf galaxy nuclei in the process of being tidally stripped \citep{Richtler2005, brodie2011, Jennings2015}. Tidal stripping is a confirmed origin for several UCDs \citep{Seth2014, Norris2015} due to the indirect evidence of a supermassive black hole. The nearby nucleated dwarf galaxy Sagittarius which is undergoing tidal stripping around the Milky Way is the closest example of a possible UCD in formation \citep{Ibata1994, Carretta2010}. \hl{Tidal stripping is also a possible formation mechanism for compact elliptical (cE) galaxies \mbox{\citep[e.g.][]{Huxor_2011}}}. Pioneering simulations established that galaxy stripping can produce objects with similar properties to UCDs \citep{Bassino1994, Bekki2001, Bekki2003, Pfeffer2013}. Several simulations have been carried out for UCD formation in static potentials \citep{Bekki2003, Goerdt2008, Thomas2008}, and suggest that the radial distributions of UCD populations should be centrally concentrated. The models predict too few UCDs at large radii, however, and static models have limitations, such as being unable to account for UCD formation within smaller sub-clusters that subsequently merged with the larger one, as well as an inability to account for time-varying potentials. Triaxial potentials resulting in box or other chaotic orbits are also possible for dwarf galaxies \citep{Pfeffer2013} and may provide more accurate models of UCD formation. \citet{Pfeffer2014} and \citet{Pfeffer2016} carried out the first investigations of the contribution of galaxy stripping to the UCD population using cosmological simulations of galaxy formation. By modelling the formation of stripped nuclei in the Millennium II simulations \citep{Boylan2009}, combined with a semi-analytic model for galaxy formation \citep{Guo2011}, it was found that at most 10 per cent of UCDs in the Fornax cluster could have formed by tidal stripping. However, semi-analytic models of galaxy formation have some limitations. The lack of a baryonic component for galaxies affects the time taken for them to undergo stripping, and the numbers of galaxies stripped. Modelling UCD formation with hydrodynamical simulations may provide more accurate results. In this paper, we use the EAGLE simulation of galaxy formation and evolution \citep{Crain_2015, Schaye2015} to simulate our new method of stripped nuclei formation and predict the numbers, masses and distributions of stripped nuclei. We then compare these properties to observations. We aim to determine whether the radial distributions, numbers and masses of UCDs in large galaxy clusters can be explained by tidal stripping of galactic nuclei, whether the UCD population is primarily dependant on central galaxy mass or host cluster mass, and also whether transitional objects, galaxies in the process of being stripped, exist in the simulations. Throughout the paper, the objects formed are referred to as stripped nuclei as they resemble both GCs and UCDs and more than one formation channel may contribute to UCD formation. This paper has the following organization. The method by which we identified stripped nuclei in the EAGLE simulations is described in Section 2. The results of our research are presented in Section 3. We discuss the implications of our work for models of UCD formation in Section 4, and a summary of our results is given in Section 5. \section{Methods and observations} \label{method} In this section, we give an overview of the EAGLE simulations used to identify stripped nuclei by tracking the most tightly bound star particles of galaxies in the simulation. We also give an overview of the observations of UCDs and the methods used for comparison. \label{sec:maths} \subsection{Overview of simulations} Hydrodynamical simulations of galaxy formation can, in principle, predict the distribution of galaxies much more accurately than semi-analytic simulations due to the addition of baryonic particles. By directly accounting for the presence of baryonic matter, fluid motions can be calculated as well as gravity. This will impact the timescale on which the gas in satellite galaxies undergoes ram-pressure stripping and the stellar component is stripped through tidal forces, and therefore influence the number of galaxies stripped in the simulation. Additionally, the presence of baryonic matter allows for properties of galaxies such as stellar and black hole mass to be determined directly from the baryonic particles in the simulation. In this work, we use the state-of-the-art hydrodynamical EAGLE simulations \citep{Schaye2015, Crain_2015}. The EAGLE simulations are well tested and reproduce many properties of evolving galaxy populations. Feedback from supernovae and black holes is calibrated to reproduce the z = 0 galaxy mass function, galaxy sizes and black hole masses \citep{Schaye2015}. The simulations also reproduce the evolution of the galaxy mass function \citep{Furlong2015} and galaxy sizes \citep{Furlong2017}, galaxy luminosities and colours \citep{Trayford2015}, cold gas properties \citep{Lagos2015, Crain_2015}, and largely reproduce the cosmic star formation rate density and specific SFR-galaxy mass relation \citep{Furlong2015}. The largest of the EAGLE simulations has a box side length of 100 comoving Mpc, large enough to contain ten thousand galaxies of the mass of the Milky Way or larger, and is made up of a total of 6.8 billion particles. Baryonic particles in the simulation have an initial mass of 1.81~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) and dark matter particles a mass of 9.70~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\), meaning galaxies with as low a stellar-mass as 1~$\times$~10\textsuperscript{8}~\(\textup{M}_\odot\) are resolved by more than 50 particles. We use three forms of data from the EAGLE simulation in this paper: \begin{enumerate} \item [\textbf{Online Database}] \item Halo and galaxy data for the simulation is stored in an online database \citep{McAlpine2016}. The database can be used to determine information such as galaxy masses and merger trees for use in the analysis of tidally stripped nuclei without relying on the more cumbersome particle data. \item [\textbf{Raw Particle Data}] \item The individual particle data can be downloaded from the EAGLE website. The raw particle data are required to determine the locations of the stripped nuclei, but we did the bulk of our analysis using the online database, to reduce the amount of information that must be processed. \item [\textbf{Linking Database}] \item We linked the online database and raw particle data through a database we created that connects the ID of each galaxy in the online database to the ID of its most bound star particle in the particle data. \end{enumerate} \subsection{Simulated cluster selection} As our objective is to compare the properties of tidally stripped nuclei in the simulations to those of observed UCDs in the Virgo cluster, we begin by selecting clusters in the most massive of the EAGLE simulations, RefL0100N1504, which has a box size of 100 comoving Mpc containing 2~$\times$~1504\textsuperscript{3} particles. The most massive cluster in this simulation has a Friend-of-Friends (FoF) mass of 6.4~$\times$~10\textsuperscript{14}~\(\textup{M}_\odot\) and $\mathcal{M}$\textsubscript{200} = 1.87~$\times$~10\textsuperscript{14}~\(\textup{M}_\odot\). We further select 6 other clusters in the simulation with $\mathcal{M}$\textsubscript{200} above 1~$\times$~10\textsuperscript{14}~\(\textup{M}_\odot\) for subsequent analysis. Properties of the seven clusters are outlined in Table \ref{tab:clusters_analysed}. The Friend-of-Friends (FoF) mass is determined by linking spatially connected structure. A linking length is defined, and every nearby particle that has a distance shorter than that length is connected \citep{Davis1985}. EAGLE has a defined linking length of 0.2 times the mean interparticle separation. The critical mass or $\mathcal{M}$\textsubscript{200} is the total mass within the $\mathcal{R}$\textsubscript{200} radius, which is the physical radius within which the cluster density is 200 times the critical density of the Universe. The critical mass is generally considered to be a more observationally comparable property than the FoF mass, but it does not take into account non-spherical distributions since it uses a single radius. This can be a problem for the most massive structures since they are often not fully virialized and/or may be composed of several massive substructures. Similar issues can occur when considering observations of clusters such as Virgo. We will use both these masses in this paper, and when considering $\mathcal{M}$\textsubscript{200}, we will only include the stripped nuclei that are found within $\mathcal{R}$\textsubscript{200}. For comparisons with Virgo we will work primarily with the most massive simulated cluster which has a similar luminosity function to Virgo. In cases where we directly compare the masses of our simulated clusters to Virgo we will use the Virgo masses M = 5.5~$\times$~10\textsuperscript{14}~\(\textup{M}_\odot\) \citep{Durrell2014}, which was obtained by combining the masses of subclusters within Virgo, making it comparable to the FoF mass, and a critical mass of $\mathcal{M}$\textsubscript{200} = 4.2~$\times$~10\textsuperscript{14}~\(\textup{M}_\odot\) \citep{McLaughlin1999}. \begin{table*} \centering \caption{List of clusters analysed from the EAGLE simulation} \label{tab:clusters_analysed} \begin{tabular}{lccc} \hline Cluster ID & Friend-of-Friends Mass (\(\textup{M}_\odot\)) & Critical Mass (\(\textup{M}_\odot\)) & Most Massive Galaxy (\(\textup{M}_\odot\))\\ \hline 28000000000000 & 6.42~$\times$~10\textsuperscript{14} & 1.87 $\times$ 10\textsuperscript{14} & 4.65 $\times$ 10\textsuperscript{11}\\ 28000000000001 & 6.22 $\times$ 10\textsuperscript{14} & 3.73 $\times$ 10\textsuperscript{14} & 3.53 $\times$ 10\textsuperscript{11}\\ 28000000000002 & 3.76 $\times$ 10\textsuperscript{14} & 3.00 $\times$ 10\textsuperscript{14} & 2.99 $\times$ 10\textsuperscript{11}\\ 28000000000003 & 3.48 $\times$ 10\textsuperscript{14} & 3.07 $\times$ 10\textsuperscript{14} & 4.48 $\times$ 10\textsuperscript{11}\\ 28000000000004 & 2.50 $\times$ 10\textsuperscript{14} & 1.96 $\times$ 10\textsuperscript{14} & 2.05 $\times$ 10\textsuperscript{11}\\ 28000000000005 & 2.31 $\times$ 10\textsuperscript{14} & 1.98 $\times$ 10\textsuperscript{14} & 3.73 $\times$ 10\textsuperscript{11}\\ 28000000000006 & 2.05 $\times$ 10\textsuperscript{14} & 1.30 $\times$ 10\textsuperscript{14} & 2.37 $\times$ 10\textsuperscript{11}\\ \hline \end{tabular} \end{table*} \subsection{Identifying stripped nuclei} UCDs are too compact to be fully resolved in the EAGLE simulations, but the EAGLE particle masses of 1.81~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) for baryonic particles is similar to the mass range of observed UCDs (2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) to 10\textsuperscript{8}~\(\textup{M}_\odot\)). Therefore, we define the central, most bound star particle (MBP) of a galaxy before its merger as the nucleus of the galaxy. \hl{We use that MBP to track the position of the nucleus following the merger, through to redshift zero}. \hl{Star particles are not affected by hydrodynamic forces, and so will behave in a similar way gravitationally to nuclear star clusters}, meaning they can be used to model nuclei behaviour. We did not use the other types of particles found in the simulation to track nuclei because they may behave differently than nuclear star clusters: i.e., a gas particle disappearing from the simulation due to accretion or a black hole particle experiencing mergers. \hl{The exact star particle that is most bound can vary from snapshot to snapshot, so we tested this method by repeating some of our analysis with the 5th most bound particle. This was found not to affect our results.} To create a sample of candidate galaxies that could be disrupted to become stripped nuclei, we carried out the following steps. Note that we designed the process to create a sample of possible progenitor galaxies in the simulation and a sample of their most bound particles. The numbers of galaxies or stripped nuclei remaining after each step are listed in Tables \ref{tab:28000000000000} and \ref{tab:21242350}. \begin{enumerate} \item First, for a cluster in the simulation, we define the massive galaxies in the cluster at z = 0 that will have potentially disrupted smaller galaxies in the past. Galaxies in the simulation are defined as potential disrupting galaxies if they have a stellar-mass greater than 10\textsuperscript{7}~\(\textup{M}_\odot\), as this mass approaches the lower limit at which galaxies can be defined in the EAGLE simulation. \item In order to identify stripped nuclei, we traced back the merger trees of these massive galaxies to find mergers involving any progenitor galaxies with stellar mass > 10\textsuperscript{7}~\(\textup{M}_\odot\). \citet{Sanchez2019} found that at a stellar mass of 10\textsuperscript{7}~\(\textup{M}_\odot\) approximately 30 per cent of galaxies are nucleated and have a mean nuclear star cluster to galaxy mass ratio of 1.7 per cent. Therefore, our stripped nuclei sample will be unreliable below a mass of $\approx$ 1.7~$\times$~10\textsuperscript{5}~\(\textup{M}_\odot\). We will also lose several objects above this mass due to scatter in the nuclear star cluster to galaxy mass ratio relation. As we primarily focus on M > 2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) objects, this should not affect our results. \item Galaxies in the merger tree may appear in multiple snapshots before merger, so we reduce the merger tree to unique galaxies. This was done by selecting the progenitor galaxy immediately before its merger, and determining the particle ID of the most bound star particle in this snapshot. \item We then used the particle data to determine properties for the most bound particles, defined as galaxy nuclei, such as their position at z = 0. \end{enumerate} The next step was to determine whether the nuclei of the progenitor galaxies could have survived to z = 0 and become potential UCDs. We consider that a stripped nucleus is formed in a merger if the following conditions are satisfied: \begin{enumerate} \item The merger between the progenitor and the central galaxy was a minor merger rather than a major one. For a merger to be minor, the stellar mass ratio between the two galaxies must be smaller than 1/4 \citep{Qu2017}. During major mergers instead of one galaxy being stripped by a more massive one, both galaxies will be highly disrupted \citep{Casteels2014}. \item The time the stripped nucleus has been orbiting its central galaxy is shorter than its dynamical friction timescale. We calculated the dynamical friction timescale with equation 7-26 from \citet{Binney1987}, modified with an eccentricity function as defined in Appendix B of \citet{Lacey1993}. To calculate the eccentricity, we first determine the circular velocity of the particle around the central galaxy from the \hl{virial} velocity and radius of the halo. The angular momentum of the particle around the central galaxy is then calculated from its velocity and position relative to the central galaxy. Next, the energy of the particle is calculated from the circular velocity, particle velocity and radius around the central galaxy. This energy is then used to calculate the radius the particle would have if it were on a circular orbit. The angular momentum for the circular orbit is then calculated from the circular radius and velocity. Next, the eccentricity is determined by taking the ratio of the true angular momentum and the circular orbit angular momentum. Finally, the dynamical friction is calculated using the eccentricity function \hl{\mbox{\citep[eq. B4 from][]{Lacey1993}}}, circular radius, circular velocity and mass of the stripped nucleus (see Section~\ref{section:mass}). Stripped nuclei with dynamical friction timescales shorter than the orbital time will have spiralled inwards and merged with the central galaxy before the final (z = 0) snapshot. \end{enumerate} \subsection{Nucleation fraction and nucleus mass } \label{section:mass} UCDs are most commonly defined as having masses greater than 2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) \citep[e.g.][]{Mieske_2008}, so our analysis will primarily focus on objects above this mass. Two crucial aspects of our study that will impact the numbers and masses of our simulated UCDs are the fraction of stripped galaxies that are nucleated and the masses of the nuclei within those galaxies. \subsubsection{Nucleation fraction} We base our estimate of the number of galaxies that are nucleated on Figure 2 from \citet{Sanchez2019}, which plots the fraction of nucleated galaxies in the Virgo, Fornax and Coma clusters. In the Virgo Cluster, the galaxy nucleation fraction peaks at approximately 90 per cent for galaxies with stellar mass $\approx$ 10\textsuperscript{9}~\(\textup{M}_\odot\) and linearly declines for more and less massive galaxies, on a logarithmic scale. The nucleation fraction reaches zero at approximately M\textsubscript{*} = 10\textsuperscript{11}~\(\textup{M}_\odot\) for high mass galaxies and 5~$\times$~10\textsuperscript{5}~\(\textup{M}_\odot\) for low mass galaxies. When considering the nucleation fraction for galaxies, we primarily work with fractions of stripped nuclei rather than choosing a random sample of stripped nuclei in each mass range. \subsubsection{Nucleus mass} The masses of the resulting stripped nuclei can be estimated from the original progenitor galaxy's stellar mass. We base our nuclei mass estimates on Figure 9. from \citet{Sanchez2019}, which plots the ratio of nuclear star cluster to galaxy mass as a function of galaxy stellar mass. The mass ratio has a minimum of approximately 0.36 per cent for galaxies with stellar mass 3~$\times$~10\textsuperscript{9}~\(\textup{M}_\odot\) and then increases for more and less massive galaxies. To determine the masses of the stripped nuclei, we assign each one a mass randomly chosen from a log-normal mass function for the nucleus-to-galaxy mass ratio with a mean chosen by applying linear fits to the upper and lower mass ranges of Figure 9 in \citet{Sanchez2019} and a log-normal standard deviation of 0.4 dex. Tidal stripping for the nuclear cluster is not taken into account. This may cause us to slightly overestimate the masses of the resulting stripped nuclei if they lose mass during the merger, although, the nucleus is known to lose little mass during the stripping process \citep{Bekki2001, Bekki2003}. There is also the possible case of the nucleus retaining some mass from the host galaxy halo so the stripped nucleus would be more massive than the nuclear cluster itself \citep{Pfeffer2013, LiuPeng2015,Voggel2016}, which would cause us to underestimate the masses of the resulting stripped nuclei \subsection{Simulation corrections} \label{simcorr} There are several methodology issues related to the use of the EAGLE simulations. These are induced by the limitations of the simulations or our methods of tracking stripped nuclei. One issue that relates to studying UCD formation in EAGLE is the simulation mass resolution, induced by using a single particle to represent a galactic nucleus. It is possible for the particle to be ejected during the merger before the merger is complete and therefore not accurately follow the path of the stripped nucleus. Our choice of the most bound star particle before merging as the nucleus makes this less probable. Another issue is that galaxies in the merger tree occasionally exhibit unstable behaviour during mergers \citep{Qu2017}, which complicates the determination of the major-minor ratio, and the mass of the resulting stripped nucleus. Occasionally two merging galaxies will appear to change masses radically between snapshots. This is due to the \textsc{subfind} \citep{Springel2001, Dolag2009} routine identifying particles attached to the central galaxy as being attached to the progenitor galaxy, resulting in an apparent ``see-saw" change in central and progenitor galaxy masses between snapshots. Fewer than 5 per cent of mergers exhibit this behaviour, but it can lead to an overestimate of stripped nuclei masses and numbers. To combat this, when determining mass ratios, we take the mass ratio from the snapshot with the maximum central galaxy stellar mass in the five snapshots before merger. Due to stripping during a merger event, a progenitor galaxy in the snapshot immediately before a merger may have lost stellar mass found in earlier snapshots. Therefore for progenitor galaxies that do not exhibit switching behaviour, we take the maximum stellar mass in all snapshots before merger. In galaxies which do switch masses, we take the stellar mass from the snapshot where the central galaxy stellar mass is at a maximum, which may lead to a slight underestimate of stellar mass for the progenitor galaxy in these cases. The \textsc{subfind} algorithm occasionally erroneously identifies small dense stellar regions within galaxies as separate distinct objects \citep{Schaye2015}. These objects are not genuine galaxies, and so we discarded progenitor galaxies flagged as spurious in the EAGLE database. Around 4 per cent of merging galaxies appear to be massive galaxies without any progenitors and an extremely low (< 10\textsuperscript{7}~\(\textup{M}_\odot\)) dark matter content. These galaxies are anomalous self-bound regions of the host galaxy from a past merger the host galaxy experienced \citep{Wetzel2009}. We excluded these galaxies as potential progenitors by removing galaxies with dark matter content < 10\textsuperscript{7}~\(\textup{M}_\odot\). Because of the presence of diffuse stars and the possibility of particles being miss-assigned to the wrong halo it is recommended that the stellar mass of a galaxy be measured using a spherical aperture in EAGLE \citep{McAlpine2016}. We use an aperture \hl{radius} of 30~kpc, which is recommended due to being suited for comparisons to observations \citep{Schaye2015}. \subsection{Observational Data} \label{obsdata} To determine the contribution that stripped nuclei make to the UCD population, we made comparisons with observations of UCDs in the Virgo cluster. We made single galaxy radial distribution comparisons with UCDs taken from the Next Generation Virgo Cluster Survey \citep{Ferrarese2012, Liu2015}. The survey finds 92 confirmed UCDs around M87, the galaxy closest to the centre of the potential for the Virgo cluster, and 28 and 23 around the other massive galaxies M49 and M60 respectively. The UCDs were defined as having projected half-light radii 11 < r\textsubscript{h} < 100~pc. The magnitude range of UCDs for this study was 18.5 $\leqslant$ g $\leqslant$ 21.5~mag (-12.7 $\leqslant$ M\textsubscript{g} $\leqslant$ -9.7, Virgo distance of 16.5~Mpc, distance modulus = 31.087 \citep{Mei2007}). With a mass-to-light ratio of 2.15 \(\textup{(M/L)}_\odot\) applied \citep{Voggel_2019} this magnitude range converts roughly to a mass range of 1.6~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) $\lesssim$ M $\lesssim$ 2.58~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\). UCDs close to the center of galaxies may have been missed due to light saturation. The mass-size relation of UCDs reaches 10~pc at a magnitude of M\textsubscript{v}~$\approx$~-11~mag, or mass M~$\approx$~10\textsuperscript{7}~\(\textup{M}_\odot\) \citep{Norris2011}. Because of the lower radius limit of 11 pc used to take this sample the UCDs at masses below $\approx$~10\textsuperscript{7}~\(\textup{M}_\odot\) are likely to be undersampled. Therefore when comparing this sample to our simulation data, we will primarily work with stripped nuclei above this mass. This limit will also result in a smaller number of UCDs with M > 10\textsuperscript{7}~\(\textup{M}_\odot\) being undersampled. Our analysis with the full simulated clusters was made using a new sample of 243 UCD candidates in the Virgo cluster \citet{liu2020generation}. The completeness level of the sample is over 90 per cent and is selected using the same range in r\textsubscript{h} as the \citet{Liu2015} UCDs, with magnitude g~$\leqslant$~21.5~mag (mass range M~$\geqslant$~1.6~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\)). The sample is subject to the same radius-mass under-sampling as the single galaxy comparison. Fig.~\ref{fig:virgoscatter} shows the distribution of these UCDs on the sky, with the position converted from right ascension and declination to megaparsecs. \begin{figure} \includegraphics[width=\columnwidth]{Getafix_images/Figure_7virgodistv6.pdf} \caption{Projected, observed, distribution of 243 UCD candidates in the Virgo cluster, described in Section \ref{obsdata}. \citet{liu2020generation}.} \label{fig:virgoscatter} \end{figure} \begin{table*} \centering \caption{Most massive EAGLE Cluster: ID = 28000000000000} \label{tab:28000000000000} \begin{tabular}{lr} \hline Step & Number\\ \hline Galaxies in cluster with stellar mass > 1 $\times$ 10\textsuperscript{7} \(\textup{M}_\odot\) & 678 galaxies\\ Post stripped nuclei processing: Galaxies with stripped nuclei & 313 galaxies\\ Post stripped nuclei processing: Galaxies with stripped nuclei M > 2~$\times$~ 10\textsuperscript{6}~\(\textup{M}_\odot\) & 111 galaxies\\ \hline \end{tabular} \end{table*} \begin{table*} \centering \caption{Most massive galaxy in Cluster ID = 28000000000000: Galaxy ID = 21242350} \label{tab:21242350} \begin{tabular}{lr} \hline Step & Number\\ \hline Number of unique galaxies in merger tree & 22056 Galaxies \\ Galaxies with stellar mass > 1 $\times$ 10\textsuperscript{7} \(\textup{M}_\odot\)& 1238 Galaxies \\ Number of galaxies that merged via minor mergers & 1122 Galaxies\\ Number of stripped nuclei that did not spiral in due to dynamical friction & 1080 Stripped Nuclei\\ Number of stripped nuclei M > 2 $\times$ 10\textsuperscript{6} \(\textup{M}_\odot\) & 145 Stripped Nuclei\\ Non-anomalous galaxies & 118 Stripped Nuclei\\ Fraction nucleated & 80 Stripped Nuclei\\ \hline \end{tabular} \end{table*} When considering the number of stripped nuclei found around simulated galaxies, we can consider both the ``merger-tree" and the ``aperture" \hl{samples}. The merger tree \hl{sample} is taken directly from disrupted galaxies found in the merger tree of the central galaxy and is a direct representation of the number of satellite galaxies stripped by the central galaxy. This \hl{sample} is the most reliable for determining the number of stripped nuclei directly formed by progenitors disrupted by a galaxy, however, it may not be reliable when making comparisons with observations. This method will not account for stripped nuclei clustering around a massive galaxy that may have been stripped by other smaller galaxies close to it, and it will also include merger tree nuclei that may no longer be associated with the central galaxy, that would not be seen in observations. A more accurate method for comparing simulated stripped nuclei to observations of UCDs is to take an aperture sample of stripped nuclei found close to the galaxy. This is done by sampling all the stripped nuclei within a defined radius around the galaxy. Thus the aperture sample will include stripped nuclei from other galaxies close in projected distance to the central galaxy, and exclude merger tree stripped nuclei that may be located some distance away. This provides a more accurate comparison to observations, as observed samples of UCDs are based on projected distance to massive galaxies. However, it has the limitation of some stripped nuclei possibly being ``double-counted" if we are analysing multiple galaxies close to each other and the apertures we are using for the multiple galaxies overlap. \hl{ Throughout the paper the radius used for the aperture sample differs depending on the variable measured but is chosen to be consistent with observations. The distance the stripped nuclei sample extends to is typically larger than the 30 kpc aperture radius EAGLE galaxy stellar masses are measured within.} For both the merger tree and the aperture \hl{samples}, we use a projected distribution, for the sake of more accurate comparisons to observations. \section{Results} In this section, we present results from the analysis of the EAGLE simulations described in Section \ref{method}. Where possible, we work with fractions of stripped nuclei rather than randomly choosing a number of stripped nuclei to satisfy the progenitor galaxy nucleation fractions, with direct number quotations using fractions, and plots primarily working with a random selection. \subsection{Properties of most massive simulated cluster} Fig.~\ref{fig:10galsproj} shows the distribution of all the stripped nuclei from the merger trees of the ten most massive galaxies of the most massive cluster analysed, \hl{projected in the x-y plane of the simulation volume (i.e. a random projection)}. The stellar masses of these galaxies and the number of stripped nuclei they formed via merging progenitors is listed in Table.~\ref{tab:cluster000}. Similarly to Fig.~\ref{fig:virgoscatter}, the stripped nuclei are not spread throughout the cluster but largely grouped around massive galaxies. Several of the stripped nuclei populations for the galaxies appear to overlap in the projected view. We find that this cluster has a total of $400 \pm 53$ stripped nuclei above a mass of 2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\). Of these, $51.8 \pm 7.7$ were massive stripped nuclei M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) and $2.3 \pm 1.1$ were more massive than 1~$\times$~10\textsuperscript{8}~\(\textup{M}_\odot\) \begin{table*} \centering \caption{The 10 most massive galaxies of galaxy cluster ID = 28000000000000, and their merger tree stripped nuclei} \label{tab:cluster000} \begin{tabular}{llcc} \hline Galaxy ID & Stellar mass & No. M > 2 $\times$ 10\textsuperscript{6} \(\textup{M}_\odot\) & No. M > 10\textsuperscript{7} \(\textup{M}_\odot\)\\ \hline 21242350 & 4.65 $\times$ 10\textsuperscript{11} & $80 \pm 10$ & $10.8 \pm 3.0$ \\ 21109760 & 4.20 $\times$ 10\textsuperscript{11} & $74 \pm 11$ & $11.3 \pm 2.3$ \\ 18481114 & 3.06 $\times$ 10\textsuperscript{11} & $41.4 \pm 6.0$ & $6.1 \pm 1.8$ \\ 13892596 & 1.86 $\times$ 10\textsuperscript{11} & $17.1 \pm 3.0$ & $3.0 \pm 1.1$ \\ 13921560 & 1.85 $\times$ 11\textsuperscript{11} & $13.9 \pm 2.9$ & $2.2 \pm 1.1$ \\ 13938864 & 1.03 $\times$ 10\textsuperscript{11} & $5.5 \pm 1.5$ & $0.75 \pm 0.48$ \\ 13914718 & 9.61 $\times$ 10\textsuperscript{10} & $7.0 \pm 1.6$ & $1.20 \pm 0.89$ \\ 8092293 & 8.98 $\times$ 10\textsuperscript{10} & $5.1 \pm 1.4$ & $1.00 \pm 0.79$ \\ 8071905 & 8.68 $\times$ 10\textsuperscript{10} & $4.40 \pm 0.34$ & $0.41 \pm 0.56$ \\ 13935854 & 7.81 $\times$ 10\textsuperscript{10} & $1.60 \pm 0.79$ & $0.04 \pm 0.15$ \\ \hline \end{tabular} \end{table*} \begin{figure} \includegraphics[width=\columnwidth]{Getafix_images/Figure_2_full_clusterv4.pdf} \caption{Projected distribution of all merger tree stripped nuclei formed by the 10 most massive galaxies in the most massive EAGLE cluster. The stripped nuclei largely cluster around the galaxy their progenitors merged with.} \label{fig:10galsproj} \end{figure} A total of 109 galaxies in the cluster were found to be producers of M~>~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) stripped nuclei. The massive, central galaxies of the cluster were found to be the primary producers of stripped nuclei. The most massive galaxy (shown in red in Fig.~\ref{fig:10galsproj}) produced $80 \pm 10$ or $19.9 \pm 4.5$ per cent of the stripped nuclei found in the whole cluster, including $20.8 \pm 1.8$ per cent of stripped nuclei above a mass of 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) and $13.6 \pm 2.5$ per cent of the stripped nuclei above a mass of 1~$\times$~10\textsuperscript{8}~\(\textup{M}_\odot\). The two most massive galaxies in the cluster produced $38.5 \pm 9.0$ per cent of the total M~>~2 $\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) stripped nuclei population of the cluster and $43 \pm 14$ per cent of stripped nuclei above a mass of 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\). \subsection{Comparisons between the most massive simulated galaxy and the central Virgo cluster galaxy} \label{212comps} Fig.~\ref{fig:212scatterplot} depicts the distribution of merger tree and aperture stripped nuclei with mass >~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) surrounding the most massive galaxy in the most massive cluster in the EAGLE simulation. The merger tree stripped nuclei are represented by red stars and are the nuclei of the progenitor galaxies that were stripped by the massive galaxy. The aperture stripped nuclei are shown with open blue circles and are a mixture of this galaxies merger tree nuclei and stripped nuclei from the merger trees of satellite galaxies. In both cases, the stripped nuclei cluster strongly around the massive galaxy with over 50 per cent of the nuclei located within 100 kiloparsecs of the central galaxy. Applying the Kolmogorov-Smirnov test to the radial distributions of the merger tree and aperture stripped nuclei returns p~=~0.234, indicating that the two distributions are consistent. Table \ref{tab:sn21242350} shows the numbers of stripped nuclei found for both the merger tree and aperture \hl{samples} of this galaxy. The number of M~>~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) stripped nuclei increases by 50 per cent from the merger tree to the aperture \hl{sample}, while the number of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei increases by 27 per cent. This suggests that the numbers of stripped nuclei surrounding galaxies are more sensitive to aperture \hl{sampling} than the radial distributions are. When comparing with observations, we will only use the aperture selection because the observed samples can only use apertures. When comparing different simulated galaxies, we will also consider the merger tree sample. \begin{figure} \includegraphics[width=\columnwidth]{Getafix_images/Figure_3-4mtascatterv7.pdf} \caption{\hl{X-Y plane} projected merger-tree and aperture \hl{sampled} M~>~2~$\times$ 10\textsuperscript{6}~\(\textup{M}_\odot\) stripped nuclei for the most massive galaxy of the simulated cluster, Galaxy ID = 21242350.} \label{fig:212scatterplot} \end{figure} \begin{table*} \centering \caption{Number of stripped nuclei around simulated galaxy ID = 21242350} \label{tab:sn21242350} \begin{tabular}{llcc} \hline Sample & No. M > 2 $\times$ 10\textsuperscript{6} & No. M > 10\textsuperscript{7} \(\textup{M}_\odot\) & No. M > 10\textsuperscript{8} \(\textup{M}_\odot\)\\ \hline Merger tree & $80 \pm 10$ & $10.8 \pm 3.0$ & $0.31 \pm 0.37$ \\ Aperture & $120 \pm 14$ & $13.7 \pm 3.8$ & $0.95 \pm 0.37$ \\ \hline \end{tabular} \end{table*} \subsubsection{Radial distributions of stripped nuclei compared with UCDs in the Virgo cluster} The next step is to compare the numbers and distributions of our simulated stripped nuclei to observations of UCDs in the Virgo cluster. In Fig.~\ref{fig:distnew}, we compare the cumulative radial distributions of the aperture \hl{sampled} distribution of stripped nuclei associated with the most massive galaxy of the simulated cluster with UCDs associated with the dominant galaxy of the Virgo cluster, M87 \citep{Liu2015}. Both galaxies are located at centre of potentials in their respective clusters and have similar masses. Within a 30 kpc radius the simulated galaxy has a stellar mass of 4.65~$\times$~10\textsuperscript{11}~\(\textup{M}_\odot\), while M87 has a stellar mass of 5.5~$\times$~10\textsuperscript{11}~\(\textup{M}_\odot\) \citep{Gebhardt_2009}. An upper radius limit of 400 kpc was imposed on the simulated stripped nuclei to match the observational selection. Visually the two distributions appear to have a strong correlation and applying the Kolmogorov-Smirnov test to these two distributions returns p~=~0.460, indicating that they are consistent. \begin{figure} \includegraphics[width=\columnwidth]{Getafix_images/Figure_5virgo212cumdistAPv3noinnerv2.pdf} \caption{Aperture sampled radial distribution of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei associated with the most massive simulated galaxy of the cluster and UCDs around M87 \citep{Liu2015}. An outer radius limit of 400~kpc was imposed on the simulated distribution to account for observational limitations. The two distributions were found to be consistent (KS test, p~=~0.460.)} \label{fig:distnew} \end{figure} \subsubsection{Mass distributions of stripped nuclei and UCDs} We next compare masses of the stripped nuclei from the central most massive galaxy of the most massive cluster to observed UCDs around M87. For both galaxies, we use aperture \hl{samples}, with a 400~kpc aperture, and the Virgo UCDs chosen from \citet{liu2020generation}. Above 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) the simulated galaxy contains $14 \pm 4$ stripped nuclei, while M87 contains 18. Therefore stripped nuclei are fully consistent with making up the 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) UCDs that surround M87, when considering a singular central massive galaxy in two similar clusters. Applying the Kolmogorov-Smirnov test to these two distributions for UCDs and stripped nuclei above a mass of 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) returns p~=~0.97 indicating, that the mass distributions are consistent. Fig.~\ref{fig:212masses} plots the comparative mass distributions of both galaxies. \begin{figure} \includegraphics[width=\columnwidth]{Getafix_images/Figure_6m87212massv4.pdf} \caption{Comparative mass distributions for stripped nuclei from the most massive simulated galaxy and M87 UCDs. The black line indicates the lower luminosity limit for observed UCDs, and the red line the lower radius limit below which UCDs are undersampled, converted to mass limits as described in Section~\ref{obsdata}. The two distributions were consistent above a mass of 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) (KS test, p~=~0.97). The objects are divided into seven bins from a minimum mass of 1.6~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) to a maximum of 2~$\times$~10\textsuperscript{8}~\(\textup{M}_\odot\).} \label{fig:212masses} \end{figure} \subsection{Comparisons with Full Virgo Cluster} We next compare the numbers and distributions of our stripped nuclei sample from the full simulated cluster with observations of UCDs throughout the entire extent of the Virgo cluster. \subsubsection{Mass distribution comparison} Fig.~\ref{fig:fullclustermasses} depicts the mass distribution of stripped nuclei and UCDs for the simulated cluster and Virgo. Above a mass of 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) the simulated cluster contains a total of $51.8 \pm 7.7$ stripped nuclei, including $2.3 \pm 1.1$ above a mass of 1~$\times$~10\textsuperscript{8}~\(\textup{M}_\odot\). In the Virgo cluster, there are 40 UCDs above a mass of 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\), including 2 above a mass of 1~$\times$~10\textsuperscript{8}~\(\textup{M}_\odot\), indicating that stripped nuclei are consistent with making up all of the UCDs in Virgo that are above a mass of 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\), and all of the extremely massive M~>~1~$\times$~10\textsuperscript{8}~\(\textup{M}_\odot\) ones. Applying the Kolmogorov-Smirnov test to the mass distributions of UCDs and stripped nuclei above 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) returns \hl{p~=~0.51}, indicating that the two distributions are consistent. \begin{figure} \includegraphics[width=\columnwidth]{Getafix_images/Figure_9fullclustermassv3.pdf} \caption{Comparative mass distributions for stripped nuclei in the simulated cluster and UCDs in Virgo. The black line indicates the mass corresponding to the lower luminosity limit, while the red line indicates the mass corresponding to the lower radius limit. The two distributions were found to be consistent above a mass of 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) (KS test, \hl{p~=~0.51}). The objects are divided into 7 bins from a minimum mass of 1.6~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) to a maximum of 2~$\times$~10\textsuperscript{8}~\(\textup{M}_\odot\).} \label{fig:fullclustermasses} \end{figure} \subsubsection{Radial distributions around the central three galaxies} \label{section:3raddists} Fig.~\ref{fig:allchngzemergedradlimit} depicts the aperture \hl{sampled} distribution of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei and UCDs for the three most massive galaxies in the simulated cluster (Table.~\ref{tab:cluster000}) and in Virgo. Visually the three galaxies show similar distributions to the simulated galaxies. The radial distributions of the stripped nuclei surrounding the simulated galaxies were consistent between the three galaxies with p~>~0.05. The radial distributions of the simulated stripped nuclei are consistent between the three different simulated galaxies. The radial distributions of UCDs around the observed galaxies are also consistent. Comparing each of the radial distributions of the aperture sampled simulated M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei to the Virgo galaxy UCDs allows for a total of 9 different distribution comparisons. We found that all comparisons returned p-values above 0.05 except for M60 and Galaxy ID = 21242350, which had p~=~0.046. M60 appears to lack many UCDs at a low galactocentric distance. This could be due to the difficulty of detecting UCDs at small radii around observed galaxies because of the high surface brightnesses at the centres of galaxies, or to the lower numbers of UCDs surrounding M60 making the radial distribution less reliable. Visually it appears most similar to the simulated galaxy Galaxy ID = 18481114, which is the least massive of the three simulated galaxies and contains the fewest stripped nuclei. \begin{figure} \includegraphics[width=\columnwidth]{Getafix_images/Figure_13galandvirgov4.pdf} \caption{A combined plot of the radial distributions of aperture sampled M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei around simulated galaxies and UCDs around the Virgo galaxies.} \label{fig:allchngzemergedradlimit} \end{figure} \subsection{Comparisons with other simulated clusters} In addition to the massive cluster selected to compare with Virgo, we further analyze 6 other clusters with $\mathcal{M}$\textsubscript{200}~>~1~$\times$~10\textsuperscript{14}~\(\textup{M}_\odot\). \subsubsection{Numbers of stripped nuclei in clusters} When comparing the number of stripped nuclei in simulated clusters to Virgo we consider both the FoF mass and $\mathcal{M}$\textsubscript{200}, listed in Table \ref{tab:clusters_analysed}. Fig.~\ref{fig:clustnummasseslobf} plots the number of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei as a function of $\mathcal{M}$\textsubscript{200}, while Fig.~\ref{fig:clustnummasseslobfv2} does the same for the FoF masses. \hl{The number of stripped nuclei for the FoF masses is taken within the whole cluster. For \mbox{$\mathcal{M}$\textsubscript{200}} the stripped nuclei sample is taken within \mbox{$\mathcal{R}$\textsubscript{200}}}. Vertical error bars are determined from the uncertainty in nucleus mass and nucleation fraction. The $\mathcal{M}$\textsubscript{200} plot has a linear relationship of $\log$\textsubscript{10} N =~($0.75 \pm 0.3$)~$\log$\textsubscript{10}~M\textsubscript{*}~$-(9 \pm 4)$, while the FoF plot has a relationship $\log$\textsubscript{10}~N~=~($1.0 \pm 0.2$)~$\log$\textsubscript{10}~M\textsubscript{*}~$-(14 \pm 2)$. The number-cluster mass relations are consistent with the number of observed UCDs in the Virgo Cluster (to 1 sigma), in both cases. The overlapping relationships suggest that the distinction between FoF and $\mathcal{M}$\textsubscript{200} may not be strictly necessary when comparing numbers of stripped nuclei in galaxy clusters, although the predicted numbers for the FoF masses trend lower. \begin{figure} \includegraphics[width=\columnwidth]{Getafix_images/Figure_16noofsnagainstclustermassv8.pdf} \caption{The number of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei compared with $\mathcal{M}$\textsubscript{200}, including the Virgo cluster} \label{fig:clustnummasseslobf} \end{figure} \begin{figure} \includegraphics[width=\columnwidth]{Getafix_images/Figure_16noofsnagainstclustermassv7.pdf} \caption{The number of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei compared with FoF mass, including the Virgo cluster} \label{fig:clustnummasseslobfv2} \end{figure} \subsubsection{Cumulative radial distributions around central galaxies} \label{section:cenraddists} To verify that the stripped nuclei distributions of simulated galaxies could explain the distributions of observed UCDs around observed galaxies we need to test the amount of scatter in the simulations. We do this by comparing radial distributions of simulated stripped nuclei surrounding massive galaxies in different simulated clusters. We will primarily work with the aperture sample of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei, as the observed sample is largely complete in this mass range and may be incomplete for lower masses. Fig.~\ref{fig:cumdistcnetralclusters} plots the aperture sampled cumulative radial distribution of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei around the most massive galaxy for the seven simulated clusters, shown in Table \ref{tab:clusters_analysed}. \hl{From the 7 galaxies we can choose 21 different pairs of galaxy stripped nuclei distributions to compare}. Of these 17/21 were consistent above p~>~0.05 and 18/21 above p~>~0.01. Three of the comparisons returned p~<~0.01. All three of these p~<~0.01 pairs included a single galaxy, the massive one in Cluster 1. The central galaxies in these seven clusters had a range of properties such as radii, so we also considered the radial distributions when rescaled by the half mass radius of the stellar mass within 30 kpc, shown in Fig.~\ref{fig:multiclustercumdensityhalfmassradproj1e7}. In this case, 18/21 of the radial distributions were consistent above p~>~0.05 and 20/21 were consistent above p~>~0.01. Two of the p~<~0.05 pairs again included a single galaxy, the massive one in Cluster 1. The merger tree distributions for M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei were found not to require rescaling with all 21 being consistent above p~>~0.05. The lower mass distributions were less consistent than the higher mass ones. Few of the radial distributions for M~>~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) stripped nuclei were consistent. This applied to both the merger tree and aperture \hl{sampled} distributions even when rescaled. Fig.~\ref{fig:multiclustercumdensityhalfmassradproj2E6} depicts the rescaled aperture \hl{sampled} distribution of M~>~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) stripped nuclei. \begin{figure} \includegraphics[width=\columnwidth]{Getafix_images/Figure_20apcumdist1E7v7.pdf} \caption{Aperture \hl{sampled} cumulative distribution of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei around the central most massive galaxies of the simulated clusters.} \label{fig:cumdistcnetralclusters} \end{figure} \begin{figure} \includegraphics[width=\columnwidth]{Getafix_images/Figure_20apcumdist1E7v6hmr30.pdf} \caption{Aperture \hl{sampled} cumulative distribution of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei around the central most massive galaxies of the simulated clusters divided by the projected physical radius enclosing half of the stellar mass within 30 kpc.} \label{fig:multiclustercumdensityhalfmassradproj1e7} \end{figure} \begin{figure} \includegraphics[width=\columnwidth]{Getafix_images/Figure_20apcumdist2E6v8.pdf} \caption{Aperture \hl{sampled} cumulative distribution of M~>~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) stripped nuclei around the central most massive galaxies of the simulated clusters divided by the projected physical radius enclosing half of the stellar mass within 30 kpc.} \label{fig:multiclustercumdensityhalfmassradproj2E6} \end{figure} \subsubsection{Numbers of stripped nuclei in individual galaxies against galaxy stellar mass} \label{section:stellmass} Fig.~\ref{fig:nosnlinearfits} plots the mean number of merger-tree M~>~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) stripped nuclei in individual simulated galaxies for all seven clusters binned by galaxy stellar mass, with horizontal error bars from the binned mass range and vertical error bars from the uncertainty of the mean. A linear fit is applied to the total distribution, and found to have a relationship of $\log$\textsubscript{10}~N~=~($1.53 \pm 0.05$)~$\log$\textsubscript{10}~M\textsubscript{*}~$-(16.0 \pm 0.6)$. To determine whether there is a relationship between the stellar masses of the host clusters and the number of stripped nuclei, we then binned the numbers of stripped nuclei around galaxies in each of the seven clusters separately. We applied a linear fit to each of these seven plots using the same slope as the full fit to galaxies in all seven clusters. We next determined the y-intercept of these separate cluster fits and compared them to the y intercept of the fit to all seven clusters. For each separate fit, the y-intercept was found within 1 sigma of the y-intercept of the fit to all seven clusters, suggesting that the stripped nuclei number to stellar mass relation is not influenced by the mass of the cluster the galaxy is located within. This suggests that while Fig.~\ref{fig:clustnummasseslobf} and Fig.~\ref{fig:clustnummasseslobfv2} show a trend between the cluster mass and the number of stripped nuclei, the number of stripped nuclei in a cluster is more dependent on the numbers and masses of galaxies located within the cluster than the total cluster mass. More massive clusters have more stripped nuclei due to containing more massive galaxies and a greater number of galaxies, which will produce more stripped nuclei. The cluster mass itself does not have any influence on the stripping process. Fig.~\ref{fig:multimassiveprojectedwithvirgo} plots the binned number of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei around individual galaxies from all 7 clusters, using the aperture \hl{sample}, as well as the number of UCDs observed surrounding the three most massive galaxies in Virgo. \hl{In order to be consistent with the simulated galaxies, we take the stellar mass of the observed galaxies to be the enclosed stellar mass inside a radius of 30 kpc.} M87's stellar mass \hl{inside this radius} is from \hl{figure 7 in} \citep{Gebhardt_2009}, M60's is from \hl{figure 10 in} \citep{Hwang_2008}, and M49's is from \hl{figure 17 in} \citep{Cote_2003}. \hl{The total masses of the galaxies within a radius of 100 kpc can be drawn from the same plots.} The horizontal error bars are from the binned mass range, while the vertical error bars are from the standard deviation of the binned data. A linear fit is applied to the total distribution and found to have a relationship of $\log$\textsubscript{10}~N~=~($1.2 \pm 0.3$)~$\log$\textsubscript{10}~M\textsubscript{*}~$-(12.0 \pm 4)$. Plotting the aperture \hl{sampled} numbers of stripped nuclei gives considerably more uncertainty than plotting the merger-tree numbers. This is because if two galaxies are lying close together, their distributions can overlap, resulting in stripped nuclei being double-counted for these two galaxies, inflating the overall numbers of stripped nuclei. To mitigate this issue, we implement the following criteria when plotting simulated galaxies: \begin{enumerate} \item We included only galaxies with stellar mass M~>~1~$\times$~10\textsuperscript{11}~\(\textup{M}_\odot\), because smaller galaxies are more likely to overlap with larger ones \item The sampled radius of stripped nuclei was restricted to 200~kpc, to reduce the number of galaxies with overlapping stripped nuclei populations. \item When two galaxies would have overlapping stripped nuclei populations (distance between galaxies < 400~kpc) we excluded the less massive of the two galaxies from the plot. \end{enumerate} The plot shows substantially more scatter than the merger tree plot, largely due to the more variable numbers produced by the apertures. Of the Virgo galaxies, M49 and M60 \hl{are} within two sigma of the line of best fit, and M87 is within one sigma, indicating that the numbers of M~>~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei in the simulated galaxies are consistent with the numbers of M~>~10\textsuperscript{7}~\(\textup{M}_\odot\) UCDs within the Virgo galaxies. \subsubsection{Numbers of stripped nuclei in individual galaxies against galaxy halo mass} In addition to comparing the number of stripped nuclei surrounding galaxies to galaxy stellar mass we compared the number to galaxy halo mass, as some studies have suggested that halo mass is a better predictor of UCD numbers than stellar mass \citep{Pfeffer2014,Liu2015}. Fig.~\ref{fig:multimassiveprojectedwithvirgov2} plots the binned aperture \hl{sampled} number of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei around individual galaxies from all 7 clusters, as well as the number of UCDs observed surrounding the three most massive galaxies in Virgo, against the total galaxy mass within a 100~kpc aperture. The stripped nuclei are selected using the same criteria as the stellar mass sample, however, we now sample stripped nuclei within a 100 kpc radius to match the halo radius. \hl{We take the total masses of the three observed Virgo galaxies from the same sources as the stellar masses, as described in section \mbox{\ref{section:stellmass}}}. The horizontal error bars are from the binned mass range, while the vertical error bars are from the standard deviation of the binned data. A linear fit is applied to the total distribution, and was found to have a relationship of $\log$\textsubscript{10}~N~=~($0.6 \pm 0.03$)~$\log$\textsubscript{10}~M\textsubscript{*}~$-(7.4 \pm 0.3)$. The plot shows a similar amount of scatter to Fig.~\ref{fig:multimassiveprojectedwithvirgo}, but the Virgo galaxies are more consistent with this fit than they are with the stellar mass relation, with all three found within one sigma of the line of best fit. \begin{figure} \includegraphics[width=\columnwidth]{Getafix_images/Figure_ybinnedmassplotv5.pdf} \caption{The total number of M~>~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) stripped nuclei in individual simulated galaxies binned by galaxy stellar mass. The horizontal error bars are the mass range, the vertical error bars are the uncertainty of the mean.} \label{fig:nosnlinearfits} \end{figure} \begin{figure} \includegraphics[width=\columnwidth]{Getafix_images/Figure_24no1e7SNandUCDsapertureBINNEDSDv5.pdf} \caption{Number of aperture sampled M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) UCDs and stripped nuclei in individual galaxies for galaxies in our simulated cluster with stellar mass M~>~10\textsuperscript{11}~\(\textup{M}_\odot\) and the three Virgo cluster galaxies, against galaxy stellar mass. The simulated galaxy stripped nuclei numbers are taken from sampling stripped nuclei in the area within 200~kpc radii of them. M87's mass is from \citep{Gebhardt_2009}, M60's from \citep{Hwang_2008} and M49's from \citep{Cote_2003}. The horizontal error bars are the mass range, the vertical error bars are the standard deviation of each bin.} \label{fig:multimassiveprojectedwithvirgo} \end{figure} \begin{figure} \includegraphics[width=\columnwidth]{Getafix_images/Figure_24no1e7SNandUCDsapertureBINNEDSDv7.pdf} \caption{Same as Fig.~\ref{fig:multimassiveprojectedwithvirgo}, but with the total galaxy mass within an aperture of 100~kpc against the number of aperture sampled M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) UCDs and stripped nuclei within a 100~kpc radius.} \label{fig:multimassiveprojectedwithvirgov2} \end{figure} \subsection{Low-mass stripped nuclei} We also find that a number of low mass M~<~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) stripped nuclei are created by tidal stripping. These stripped nuclei may not be identified in observations as UCDs due to their low masses but instead, be observed as globular clusters. Around the three most massive galaxies in the most massive cluster, we find $321 \pm 43$, $289 \pm 38$ and $163 \pm 21$ low mass stripped nuclei respectively. This is low in comparison to the number of globular clusters hosted in galaxies of this mass, with M87 predicted to host as many as 18000 globular clusters \citep{Oldham2016} and M60 to host a globular cluster population of approximately 3700 \citep{Forbes2004}. However, it should be noted that due to the limitation of this study to simulated galaxies with stellar mass M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) we likely underestimate the number of low mass stripped nuclei and instead the number should be taken as a lower limit. Fig.~\ref{fig:lowmasssn} plots the mass distribution for low mass stripped nuclei in the most massive simulated cluster. While the distribution appears to peak around M~$\sim$~5~$\times$~10\textsuperscript{5}~\(\textup{M}_\odot\) this is an artificial result of the 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stellar mass limit on progenitor galaxies, and the true peak is likely lower. We find a total of $1780 \pm 240$ low mass stripped nuclei in this cluster. Of these $1400 \pm 190$ are in the 10\textsuperscript{4}~\(\textup{M}_\odot\) < M < 10\textsuperscript{6}~\(\textup{M}_\odot\) range typically defined for globular clusters. Virgo is known to host $67300 \pm 1440$ globular clusters \citep{Durrell2014} indicating that several per cent of the globular clusters in Virgo sized galaxy clusters are likely stripped nuclei. \begin{figure} \includegraphics[width=\columnwidth]{Getafix_images/Figure_xxlowmassSNv4.pdf} \caption{Mass distribution for all stripped nuclei from the most massive simulated cluster including low mass M~<~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) stripped nuclei.} \label{fig:lowmasssn} \end{figure} Depending on their mass and size, these low-mass stripped nuclei will either be seen as massive globular clusters or as low mass stripped nuclei. It should be noted that while M~$\sim$~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) is often considered the dividing mass between globular clusters and UCDs \citep[e.g.][]{has2005} the UCD/GC divide is largely arbitrary and differs from study to study, meaning that whether these objects would be classified as UCDs or globular clusters would depend on other factors such as their size. \citet{Forbes2013} for example, finds several low luminosity UCDs with sizes > 7~pc and M\textsubscript{V}~$\sim$ -8 to -9 (M~$\sim$~few~*~10\textsuperscript{5}~\(\textup{M}_\odot\)), that would be similar to these low mass stripped nuclei. \hl{Although the number of stripped nuclei contributing to the overall globular cluster population will be small, each of these merging galaxies likely brought in their own population of globular clusters. Modern cosmological hydrodynamical galaxy formation simulations, including EAGLE, consistently find that as much as 80 per cent of the mass of massive galaxies is accreted} \citep[e.g.][]{Oser2010,Rodriguez_Gomez_2017,Clauwens_2018,Davison2020}. \hl{Therefore a large portion of globular clusters found in massive galaxies will likely have been contributed by the progenitor galaxies of the existing stripped nuclei population.} \subsection{Recently formed stripped nuclei} A small number of stripped nuclei will have been accreted within the past two billion years. Instead of being seen as fully-formed objects, these stripped nuclei will likely appear as transitional objects undergoing stripping, or with significant amounts of galaxy debris surrounding them. For the most massive galaxies, we find 1-3 objects of this sort per galaxy, and in the most massive cluster, we find $6.3 \pm 3.2$ stripped nuclei that have merged within two billion years. \hl{Depending on the pericenter of the stripped nuclei orbits, objects older than 2 Gyr may also retain galaxy debris.} Additionally, since our method focuses on progenitor galaxies found in merger-trees, we will likely miss a small number of stripped nuclei in the process of forming that are made up of merging galaxies that have suffered significant tidal stripping but are still considered by EAGLE to be separate galaxies. Transitional objects of this sort have been observed in the nearby universe \citep{Galianni2010, Jennings2015}. Depending on the mass and surface density of the stellar debris of our transitional objects they may or may not be observable, i.e. a 10\textsuperscript{10}~\(\textup{M}_\odot\) galaxy may be very clear, but a $\sim$10\textsuperscript{7}~\(\textup{M}_\odot\) galaxy may not be detectable without extremely deep imaging. \section{Discussion} \subsection{Can the radial distributions of UCDs in massive galaxy clusters be explained by stripped galaxy nuclei?} \subsubsection{Using the simulations to test the consistency of stripped nuclei distributions} In Section \ref{section:cenraddists}, we compared radial distributions of central galaxies to determine the scatter in the simulations. We found that the preferred method of comparing the radial distributions of stripped nuclei around different simulated galaxies included only M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei and rescaled these distributions by the effective radius, as shown in Fig.~\ref{fig:multiclustercumdensityhalfmassradproj1e7}. In contrast to the higher mass sample, the radial distributions of M~>~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) stripped nuclei showed large amounts of scatter. The reason why some of the M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei distributions and few of the lower mass M~>~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) stripped nuclei distributions were inconsistent before rescaling is unknown. However one likely explanation is that the massive galaxies in each of the clusters have different structures or cluster environments, which would impact the distributions of stripped nuclei and the way progenitor galaxies merged. This would have a greater impact on the distributions of low mass stripped nuclei, and the lower mass merging galaxies which produced those nuclei because these objects would be more sensitive to changes in environment. Supporting this hypothesis is the fact that all M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) merger tree stripped nuclei distributions were consistent even before rescaling, as this sample does not include stripped nuclei from satellite galaxies and is, therefore, less influenced by the environment surrounding the galaxy than the aperture sample. It should also be noted that 3/21 of the aperture sampled M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) radial distributions that were inconsistent before rescaling all included the same galaxy, the most massive one in cluster 1, which then became more consistent with the other galaxies when rescaled. This galaxy's stripped nuclei population appeared more shallow and extended than the other 5 in Fig.~\ref{fig:cumdistcnetralclusters}, which is the reason why it was inconsistent before rescaling. The radial distributions of the other galaxies did not require rescaling to be consistent. A caveat here is that we are comparing massive galaxies found largely at centres of potential in their respective clusters. Less massive or more isolated galaxies could have more or less consistent distributions. Considering galaxies less massive than those found here could be difficult, however, as lower mass galaxies contain very few M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei, as we found for the most massive galaxy in the least massive cluster. Comparing the distributions of M~>~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) stripped nuclei around less massive galaxies could be valuable, however, especially if those galaxies are more isolated and thus could be used to test whether lower mass stripped nuclei are more influenced by the galaxy environment. An additional caveat is that rescaling massive galaxies by the half stellar-mass radius within 30 kpc may not fully take into account variables in the environment around those galaxies that will impact the distributions of stripped nuclei. For example, properties such as the presence or lack of nearby massive galaxies, or the structure of the dark matter halo. When comparing distributions of different galaxies, a more detailed survey of the environment surrounding those galaxies may be important to determine if the environments could impact the consistency of the distributions. From this we conclude that it is likely that lower mass M~<~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei are more influenced by galaxy structure and environment than higher mass M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei, and this is likely to impact comparisons of radial distributions of stripped nuclei and UCDs between galaxies. Higher mass M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei are a more viable option when comparing radial distributions between simulations and observations, and rescaling the distributions is a viable method of increasing consistency between the radial distributions of differently structured massive galaxies for M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei. It may be desirable to compare the radial distributions of UCDs around central galaxies found in different clusters such as Virgo and Fornax to see if the distributions of observed UCDs are consistent. Additionally, comparisons of the radial distributions for UCDs of lower masses (M~<~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\)) and those of higher masses (M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\)) between galaxies could be made to see if lower mass UCD distributions are observed to be more disrupted. \subsubsection{Radial distributions of simulated stripped nuclei and observed UCDs} Recent observations suggest that in the Virgo cluster UCDs are found clustered around the most massive galaxies rather than being spread evenly throughout the cluster \citet{liu2020generation}. Our simulation results agree with this, with Fig.~\ref{fig:10galsproj} showing that stripped nuclei are associated with massive galaxies, which suggests that stripped nuclei can account for the overall distributions of UCDs throughout the Virgo cluster. Due to the strong evidence of clustering shown by UCDs around massive galaxies in clusters, it is more valuable to compare distributions of stripped nuclei around single galaxies, rather than analysing the distribution of stripped nuclei throughout clusters. We found that in addition to the observed similar clustering between UCDs and stripped nuclei the radial distribution of UCDs around M87 can be explained by the distribution of stripped nuclei around the central galaxy of the most massive galaxy cluster analysed, as shown in Fig.~\ref{fig:distnew}, with these two distributions being consistent to p~=~0.460 for M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei. In Fig.~\ref{fig:allchngzemergedradlimit} we extended this comparison to the three massive simulated galaxies in this massive cluster compared against the radial distributions of the three Virgo cluster galaxies M87, M60 and M49 giving a total of 9 different distribution comparisons. All but one of the KS tests between the simulated galaxies and Virgo galaxies returned p~>~0.05, and the remainder returned p~=~0.046, which indicates the distribution of UCDs around central galaxies in the Virgo cluster are consistent with being stripped nuclei. \citet{Thomas2008} found that the static model of galaxy stripping under-predicts the number of stripped nuclei at large radii, however, they noted that the static model has several challenges that could cause the number of stripped nuclei at large radii to be underestimated. \citet{Pfeffer2016} subsequently found that the radial distribution of GCs+UCDs and stripped nuclei were very consistent within 83 kpc for masses~M~>~5~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\), but within 300~kpc and for masses M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei had a significantly more extended radial distribution than that of UCDs. In contrast to the previous studies we found that the radial distributions of stripped nuclei and UCDs were consistent up to 400 kpc for stripped nuclei with masses M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\), so we conclude that the radial distributions of UCDs in the Virgo cluster are consistent with the radial distributions produced by stripped nuclei. The reason for the different results compared with \citet{Pfeffer2016} is likely due to that work using dark matter only simulations that cannot include important processes, such as the lack of a stellar component causing dark matter halos to disrupt at larger distances and a longer merging timescale allowing more time for dynamical friction to act. \subsection{Can the numbers and masses of UCDs in large galaxy clusters be explained by stripped galaxy nuclei?} \subsubsection{Numbers of stripped nuclei with masses M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\)} Previous studies have suggested that stripped nuclei make up approximately two-thirds of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) UCDs \citep[e.g.][]{Mieske2012, Pfeffer2014, Pfeffer2016}. Our findings are consistent with these results, but also suggest that stripped nuclei could make up the entirety of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) UCDs. Above 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) the most massive simulated galaxy in the most massive cluster contains $14 \pm 4$ stripped nuclei, while M87 contains 18, indicating that stripped nuclei are consistent with making up all of the 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) UCDs that surround M87. Fig.~\ref{fig:multimassiveprojectedwithvirgo} plots the binned average number of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei found within massive simulated galaxies, along with the three Virgo galaxies against stellar mass. All three Virgo galaxies are found within one or two sigma of the line of best fit indicating that stripped nuclei can completely explain the number of M~>~1~$\times$ 10\textsuperscript{7}~\(\textup{M}_\odot\) UCDs within these galaxies. In particular, the line of best fit predicts that M87 should have a total of $14.1 \pm 5.3$ UCDs which fits well with the actual number of 18. \citet{Liu2015} found that the number of UCDs associated with observed galaxies is more closely correlated with the total mass of the host system than the stellar mass. \citet{Pfeffer2014} found that the number of stripped nuclei formed around simulated galaxies was also more correlated with halo mass than stellar mass. In Fig.~\ref{fig:multimassiveprojectedwithvirgov2} we plotted the binned average number of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei against total mass within 100~kpc. The plot shows similar amounts of scatter to the stellar mass plot making it difficult to confirm whether the number of stripped nuclei is more closely correlated with halo mass than stellar mass, however, this plot was more consistent with the observed galaxies than the stellar mass plot. All three Virgo galaxies are within one sigma of the line of best fit, a higher consistency than found with the stellar masses. The most massive simulated cluster contained a total of $51.8 \pm 7.7$ stripped nuclei, while in the Virgo cluster there are 40 UCDs above a mass of 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\). Fig.~\ref{fig:clustnummasseslobf} and Fig.~\ref{fig:clustnummasseslobfv2} plot the number of stripped nuclei in 7 simulated clusters against the number of UCDs in Virgo for both the FoF mass and $\mathcal{M}$\textsubscript{200}. In both cases Virgo is found within one sigma of the line of best fit, indicating that stripped nuclei are consistent with making up the entirety of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) UCDs in the Virgo cluster. In conclusion, our model of stripped nuclei formation correctly predicts M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) UCD numbers for both individual galaxies and in the full Virgo cluster. \subsubsection{Mass distributions of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei} Fig.~\ref{fig:212masses} plots the binned number of stripped nuclei in the most massive galaxy in the most massive simulated cluster along with UCDs surrounding M87, the central galaxy in the Virgo cluster. A KS test found that the mass distributions of stripped nuclei and UCDs are consistent above M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) to p = 0.97. Fig.~\ref{fig:fullclustermasses} extends this test to the full cluster and Virgo, and finds that the mass distributions are consistent to p = 0.57. This indicates that the mass distributions of simulated stripped nuclei and UCDs are consistent above M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\). \subsubsection{Stripped nuclei in the mass range 2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) < M < 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\)} Because of observational limitations on the detection of UCDs in the Virgo cluster, we can make no solid conclusions about what percentage of the M~<~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) UCDs in Virgo are stripped nuclei. However, in our most massive cluster we find that $349 \pm 46$ of the $400 \pm 53$ M~>~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) stripped nuclei have masses in the 2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) < M < 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) range, indicating that 2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) < M < 1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei make up approximately $87 \pm 20$ per cent of the stripped nuclei population in this cluster above a mass of 2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\). \citet{Pfeffer2014} predicted that stripped nuclei could only make up 5~-~12 per cent of UCDs in the Fornax cluster above a mass of M > 2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\). For this to be true for the Virgo cluster Virgo would have to host a population of 3300~-~8000 UCDs, substantially more than the current known 243. Therefore we predict that there either exists a large population of undiscovered low mass UCDs or a much larger percentage of the low mass UCD population is made up of stripped nuclei than previously predicted. \subsubsection{Stripped nuclei with masses M < 2 $\times$ 10\textsuperscript{6} \(\textup{M}_\odot\)} A number of globular clusters have been speculated to be stripped nuclei, including Omega Centauri \citep{Lee1999, hilker2000}, M22 \citep{Marino2009} NGC 1851 \citep{Han_2009}, Terzan 5 \citep{Ferraro_2009}, NGC 2419 \citep{Cohen2010}, NGC 3201 and \citep{Simmerer2013} in the Milky Way and G1 \citep{Meylan_2001} and G78, G213, G280 \citep{Fuentes_Carrera_2008} in M31. Our results predict that some stripped nuclei which are lower than the typically defined minimum mass of M~$\approx$~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) for UCDs \citep[e.g.][]{hilker2015} should exist, and that massive galaxies should contain a minimum of a few hundred, and massive clusters a few thousand, stripped nuclei around the range of masses that are typical of globular clusters. This is small in comparison to the several thousand globular clusters these massive galaxies are seen to host, and the $67300 \pm 1440$ globular clusters Virgo hosts \citep{Durrell2014}. However, since even low mass galaxy nuclei can contain black holes, the presence of a black hole with an unusually high mass might be used to discriminate between stripped nuclei and GCs, and investigate the population of stripped nuclei mingling with globular clusters. In a future work, we plan to predict the ages, metallicities and colours of stripped nuclei, so we will be able to predict the properties these stripped nuclei globular clusters will have, which will aid in finding them in observations \subsection{Does the UCD population depend more on central galaxy mass or host cluster mass?} We find that the numbers of UCDs around individual galaxies are more strongly correlated with the stellar mass or halo mass of the central galaxy than they are with the mass of the host cluster. Fig.~\ref{fig:nosnlinearfits}, and Fig.~\ref{fig:multimassiveprojectedwithvirgo} respectively plot the merger tree and aperture \hl{sampled} average numbers of stripped nuclei per galaxy against stellar mass, while Fig.~\ref{fig:multimassiveprojectedwithvirgov2} plots aperture \hl{sampled} numbers against halo mass. The merger tree distribution shows a clear linear trend between the two, while the aperture \hl{sampled} plots show more scatter, but still a linear trend. For all graphs, there is no particular relationship between the host cluster and the number of stripped nuclei surrounding galaxies within the cluster, with the y-intercepts of the individual fits to each cluster plotted with the same slope falling well within one sigma of the y-intercept of the fit to all the clusters. Likely reasons for the correlation between stripped nuclei numbers and halo mass are that the number of mergers a galaxy undergoes will scale with the halo mass of the galaxy because of hierarchical formation. The correlation between stellar mass and numbers of stripped nuclei then follows on from the stellar mass-halo mass relation, which becomes steep at high halo masses. This results in an increase in scatter for the stellar mass-stripped nuclei number relation, as galaxies of a given stellar mass may inhabit a large range of halo masses. While Fig.~\ref{fig:clustnummasseslobf} and Fig.~\ref{fig:clustnummasseslobfv2} show a trend between cluster mass and stripped nuclei numbers this likely follows on from the galaxy halo mass-stripped nuclei number relation, rather than the mass of the cluster influencing the numbers of stripped nuclei the galaxies within it form. This result is, however, limited to M~>~1~$\times$~10\textsuperscript{14}~\(\textup{M}_\odot\) clusters, and clusters with masses lower than this may have a different relationship between cluster mass and the number of stripped nuclei. \citet{Pfeffer2014} investigated clusters in the mass range of 1~$\times$~10\textsuperscript{13}~\(\textup{M}_\odot\) < M < 1~$\times$~10\textsuperscript{15}~\(\textup{M}_\odot\) and found that lower mass clusters are slightly more efficient in producing stripped nuclei than higher mass ones, and our narrow range of cluster masses makes it difficult to say for sure that there is no dependence on cluster mass for the number of stripped nuclei. As UCDs have been detected around isolated galaxies that are not found within clusters, it would be worthwhile to plot them on the galaxy mass-UCD number relation to test if they are consistent with the number of UCDs found in galaxies in galaxy clusters. Another test could be holding the central galaxy mass constant while comparing different halo masses, however, this would be difficult due to the correlation between central galaxy mass and halo masses. Fig.~\ref{fig:cumdistcnetralclusters} depicts the radial distribution of stripped nuclei in central galaxies in clusters of different masses and finds no particular correlation between radial distribution and cluster mass. There is no particular pattern between cluster mass and the shallowness or steepness of the distributions: for example, the galaxy within the most massive cluster is in the centre of the distributions. \subsection{Do objects transitioning from galaxies to UCDs by the stripping process exist?} \citet{Pfeffer2014} predicted that Virgo should contain 9-12 disrupting nucleated galaxies. A number of studies have found galaxies that appear to be in the process of being stripped to become UCD-like objects \citep{Richtler2005, brodie2011, LiuPeng2015}. We find that around $6.3 \pm 3.2$ such objects should exist in Virgo-sized clusters and between 1-3 for massive galaxies, consistent with \citep{Pfeffer2014}. Therefore our simulations show that objects can exist that are nuclei in the process of being stripped. An additional number of merging galaxies may exist that have suffered significant tidal stripping but are still considered by EAGLE to be separate galaxies, and resemble UCDs in the process of formation. \subsection{Caveats} One source of uncertainty lies in the scatter from the nucleus-to-galaxy mass ratio. We have assumed that the nuclei survive the galaxy merger, based on predictions from previous studies \citep[e.g.][]{Bekki2001, Bekki2003}. These studies model the formation of stripped nuclei from typical dwarf galaxies in the 10\textsuperscript{8}~\(\textup{M}_\odot\) to 10\textsuperscript{10}~\(\textup{M}_\odot\) mass range with typical nuclei sizes of 2~-~20 per cent the stellar envelope mass. However, due to the scatter in the nucleus-to-galaxy mass ratio, some of our lower mass stripped nuclei will have been produced by M < 10\textsuperscript{8}~\(\textup{M}_\odot\) galaxies with very high nuclear star cluster to galaxy stellar mass ratios. The effect the threshing process has on these types of galaxies has been less studied than the typical mass range and nuclear star cluster/galaxy mass ratio. If low mass galaxies with very high nuclear star cluster masses are more likely to be totally disrupted than the typical models, it would substantially decrease our predicted numbers of low mass stripped nuclei. \citet{Janssens2016} studied ultra-diffuse galaxies and suggested that they are easier to disrupt than typical galaxies, for example. Additionally, our method relies on the assumption that nuclei at high redshifts have the same nucleus mass and nucleation fraction relationships, as those observed today. If these relationships are different at high redshifts, it will significantly impact the numbers and mass relationships of stripped nuclei that form. Another challenge is that the observations we are using rely on sampling UCDs with radii > 11~pc, while our stripped nuclei samples are mass-based, and we are unable to determine the radii of our stripped nuclei. As a result, we may overestimate the number of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei relative to observations of UCDs, because we cannot be sure that none of our sample of stripped nuclei have radii < 11~pc. Other sources of uncertainty may be induced by the simulation, and are outlined in Section \ref{simcorr}. The unstable behaviours galaxies exhibit during mergers can impact the masses of the resulting stripped nuclei. Because stripping can begin several snapshots before the merger event, the stellar mass of the merging galaxy is taken to be the maximum of that in the snapshots before merger. However, in mergers that exhibit mass switching between the progenitor and the central galaxy the true stellar mass of the progenitor is difficult to determine, and so is taken from the snapshot in which the central galaxy mass is at a maximum. This may result in the mass of the stripped nucleus being underestimated if this snapshot did not contain an accurate stellar mass before stripping. This means a small number (< 5 per cent) of our stripped nuclei may have underestimated masses. \hl{At the lower limit of our galaxy stellar masses of \mbox{M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\)} galaxies may be resolved by less than 10 stellar particles. This could affect two properties: (1) the number of low mass galaxies in the simulation, and (2) their orbits. The number of low mass galaxies in EAGLE is fairly accurate, as it is a calibrated property \mbox{\citep{Schaye2015}}. Galaxy orbits should also be fairly accurate as this property will be determined largely by the dark matter halo, which is resolved by as many as \mbox{$\approx$}1000 particles at a stellar mass of \mbox{M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\)}. We could raise the lower mass limit to improve the reliability of low-mass galaxies in the sample, but this would induce a separate source of error as we do expect lower mass galaxies to produce stripped nuclei.} \hl{There is evidence that accretion of ex-situ material onto galaxies in the EAGLE simulation might be less efficient in high-mass clusters \mbox{\citep{Davison2020}}. This is possibly because high passing velocities inhibit true merging at z=0. This could affect the number of stripped nuclei formed and their masses. Extending our analysis to lower mass clusters and groups could help to verify our results. This we defer to a later paper.} It should be noted that there are large uncertainties in our numbers of stripped nuclei per galaxy (as seen in Fig.~\ref{fig:multimassiveprojectedwithvirgo}), and unknown uncertainties in the masses and numbers of observed UCDs caused by factors such as the radius limit and the use of a broad mass-to-light ratio. Due to this our results comparing the numbers and masses of stripped nuclei to UCDs are significantly less reliable than our radial distribution comparisons, which we are confident in. \section{Summary} In this paper, we present the first work to simulate stripped nuclei formation in hydrodynamical cosmological simulations and compare them to observations of UCDs. We use the EAGLE simulations to predict the numbers, masses and distributions of stripped nuclei formed in Virgo-sized galaxy clusters. Our conclusions are summarised as follows. \subsection{Radial distributions } \begin{enumerate} \item Simulated stripped nuclei cluster strongly around the galaxies their progenitors merged with, rather than being spread evenly throughout the cluster. Observed UCDs similarly cluster around the most massive galaxies. \item The most viable method of comparing radial distributions of stripped nuclei involves using M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) stripped nuclei and rescaling the distributions by the galaxy effective radius. \item The radial distribution of UCDs around M87 is consistent with the radial distribution of stripped nuclei around the central galaxy of the most massive simulated galaxy cluster for M~>~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) stripped nuclei. \item The radial distribution of UCDs around massive galaxies in the Virgo cluster are consistent with the radial distribution of simulated galaxies. \end{enumerate} \subsection{Numbers and masses} \begin{enumerate} \item Stripped nuclei can fully explain the number of M~>~1~$\times$~10\textsuperscript{7}~\(\textup{M}_\odot\) UCDs in the Virgo cluster around individual galaxies and in the full cluster. \item Galaxy halo mass predicts the number of UCDs surrounding the Virgo galaxies more accurately than stellar mass. \item We predict that there should exist a number of M~<~2~$\times$~10\textsuperscript{6}~\(\textup{M}_\odot\) stripped nuclei; several hundred surrounding massive galaxies and over a thousand in massive clusters. \end{enumerate} \subsection{Central galaxy mass vs host cluster mass} \begin{enumerate} \item The numbers of UCDs around individual galaxies are strongly correlated with the stellar mass and halo mass of the central galaxy. This relationship does not depend on the mass of the host cluster. \item The radial distribution of stripped nuclei around central galaxies in different simulated clusters shows no dependence on cluster mass. \end{enumerate} \subsection{Transition objects} \begin{enumerate} \item In Virgo-sized clusters there should exist around 6 objects transitioning from galaxies to stripped nuclei. Around 1-3 of these objects should exist for massive galaxies. \end{enumerate} In conclusion, stripped nuclei can explain the numbers and distributions of high-mass UCDs in the Virgo cluster and around massive galaxies. The use of hydrodynamical simulations appears to solve some of the issues dark matter only simulations face with predicting numbers and distributions. We additionally predict that there should exist stripped nuclei with masses typical of globular clusters, as well as a number of transition objects. \section*{Acknowledgements} \hl{We thank the referee for the many helpful suggestions that improved this article.} This work is based on observations obtained with MegaPrime/MegaCam, a joint project of CFHT and CEA/DAPNIA, at the Canada France Hawaii Telescope (CFHT) which is operated by the National Research Council (NRC) of Canada, the Institut National des Sciences de Univers of the Centre National de la Recherche Scientique (CNRS) of France, and the University of Hawaii. This work is based in part on data products produced at Terapix available at the Canadian Astronomy Data Centre as part of the CanadaFranceHawaii Telescope Legacy Survey, a collaborative project of NRC and CNRS. We thank Lilian Garratt-Smithson for her assistance with the EAGLE database. JP gratefully acknowledges funding from a European Research Council consolidator grant (ERC-CoG-646928-Multi-Pop). C.L. acknowledges support from the National Natural Science Foundation of China (NSFC, Grant No. 11673017, 11833005, 11933003, 11973033 and 11203017) This work used the DiRAC@Durham facility managed by the Institute for Computational Cosmology on behalf of the STFC DiRAC HPC Facility (www.dirac.ac.uk). The equipment was funded by BEIS capital funding via STFC capital grants ST/K00042X/1, ST/P002293/1, ST/R002371/1 and ST/S002502/1, Durham University and STFC operations grant ST/R000832/1. DiRAC is part of the National e-Infrastructure. \section*{DATA AVAILABILITY STATEMENT} Data available on request. \bibliographystyle{mnras}
\section{Introduction} 3D point cloud semantic segmentation draws increasing attention in the field of computer vision. In recent years, a large number of Deep Neural Networks (DNNs)~\cite{2017pointnet, 2017pointnet++, 2018sscn, 2018pointcnn, 2018spgraph, 2018dgcnn, 2019pointweb, 2019sspspg, 2020randlanet, 2020grid, 2021rtn, 2021scfnet, 2021ganet} for point cloud semantic segmentation have been proposed. Although these methods have a great ability to obtain the semantic features of point clouds, most of them require a large number of accurately labeled 3D scenes, and manually labeling point clouds is time and labor-intensive. Recently, some weakly supervised segmentation methods~\cite{2012active, 2020wsspcs, 2020ss3ld, 2021spcs, 2021sspcnet} for 3D point clouds have been proposed, which could be roughly divided into two groups according to two different kinds of training datasets: (1) weakly supervised methods whose training dataset contains a small portion of labeled points sampled from each 3D training scene; (2) weakly supervised methods (also called semi-supervised methods) whose training dataset contains a small portion of labeled 3D scenes. The former group of methods~\cite{2020wsspcs, 2021sspcnet} require point sampling for all 3D scenes, and the point clouds sampled from some dense 3D scenes will still be somewhat dense, and the labor costs of assigning point labels will not be reduced too much. Compared with the former group of methods, the semi-supervised methods~\cite{2012active, 2020ss3ld, 2021spcs} are able to significantly reduce labeling costs, hence, we focus on the semi-supervised point cloud segmentation probelm in this paper. For solving the semi-supervised semantic segmentation problem for 3D point clouds, the two methods~\cite{2012active, 2020ss3ld} introduce additional information of point clouds. Wang et al.~\cite{2012active} utilizes expert knowledge and Mei et al.~\cite{2020ss3ld} considers the consistency of scans stream. Besides, the point clouds used by the methods~\cite{2012active, 2021spcs} are CAD models, which are much simpler than 3D scenes. All these three methods~\cite{2012active, 2020ss3ld, 2021spcs} do not consider the prior geometry and color knowledge of point clouds, which is useful for pseudo-label selecting. In addition, there are some methods~\cite{2017pimodel, 2017meanteacher, 2017ssgan, 2021dtc} to solve the semi-supervised segmentation problem for 2D images. However, since 3D point cloud is an unordered and irregular structure, these methods cannot be applied to 3D point clouds directly. It is noted that several existing works~\cite{2018spgraph, 2019sspspg, 2020pointnl, 2021sspcnet} for 3D point cloud semantic segmentation utilize superpoints to improve their performances. A few methods~\cite{2018spgraph, 2020pointnl, 2021sspcnet} geometrically partition the point clouds by minimizing a global energy function. These methods do not consider the color information of 3D point clouds, where some classes of objects are only different in color from the surrounding objects (\emph{i.e.} window and board). And minimizing the global energy function is time-consuming. Landrieu et al.~\cite{2019sspspg} formulates superpoints generation as a deep metric learning problem. But this partition method requires semantic information of the 3D point clouds. Addressing the aforementioned issues, we propose a superpoint-guided semi-supervised segmentation network for 3D point clouds. The labeled and unlabeled point clouds will be processed in different ways. We use the ground truth labels to supervise the labeled point clouds. And the pseudo labels predicted from unlabeled point clouds are used for self-training. Since the pseudo labels are not completely accurate, we utilize the superpoints to optimize pseudo labels. Specifically, we propose a superpoint generation module, named as SPG module, to combine the superpoints produced by geometry-based and color-based Region Growing algorithms~\cite{1994regiongrowin}, and a pseudo-label optimization module, named as PLO module, to modify and delete pseudo labels with low confidence in each superpoint. There are some 3D points without pseudo-label supervision. We propose an edge prediction module, named as EP module, to constrain the features from edge points of geometry and color. A superpoint feature aggregation module, named as SPFA module, and a superpoint feature consistency loss function are introduced to smooth the point features in each superpoint. In sum, the main contributions of this paper include: \begin{itemize} \item For solving the semi-supervised semantic segmentation problem of 3D point clouds effectively and efficiently, we utilize the superpoints generated by combining geometry-based and color-based Region Growing algorithms to optimize pseudo labels predicted from unlabeled point clouds. \item We propose an edge prediction module, a superpoint feature aggregation module and a superpoint feature consistency loss function for constraining point features without pseudo labels. \item We propose the superpoint-guided semi-supervised segmentation network for 3D point clouds. The experimental results on two 3D public datasets show that the proposed method outperforms several state-of-the-art point cloud segmentation networks and several popular semi-supervised segmentation methods with few labeled scenes. \end{itemize} \section{Superpoint-guided Semi-supervised Segmentation Network} In this section, we propose the superpoint-guided semi-supervised segmentation network for 3D point clouds. Firstly, we introduce the architecture of the proposed network. Secondly, we describe the details of the superpoint generation module (SPG module), the pseudo-label optimization module (PLO module), the edge prediction module (EP module), the superpoint feature aggregation module (SPFA module) and the superpoint feature consistency loss function respectively. Lastly, we end up with the final training loss of the network. \subsection{Architecture} As shown in Fig. \ref{architecture}, our end-to-end superpoint-guided semi-supervised segmentation network consists of two branches. The inputs of one branch are labeled point clouds and their ground truth labels, and the other branch are unlabeled point clouds and their pseudo labels. The pseudo labels are predicted by our network from unlabeled point clouds. Both branches consist of a superpoint generation module (SPG module), an feature extractor based on U-Net~\cite{2015unet}, a superpoint feature aggregation module (SPFA module), a fully connected layer (FC), and an edge prediction module (EP module). And their parameters are shared. For the branch of unlabeled point clouds, there is a pseudo-label optimization module (PLO module) to optimize the pseudo labels. The U-Net-based feature extractor consists of four encoder layers and four decoder layers. The encoder layers are Local Feature Aggregation layers in RandLA-Net~\cite{2020randlanet}, and the decoder layers are MLPs. \begin{figure} \centering \includegraphics[width=1 \columnwidth]{SPG.pdf} \caption{The process of combining superpoints produced by geometry-based and color-based Region Growing algorithms. The black points are not clustered as superpoints due to the curvature threshold in the geometry-based Growing Region algorithm.} \label{spg} \end{figure} \begin{figure} \centering \includegraphics[width=1 \columnwidth]{PLO.pdf} \caption{The process of optimizing pseudo labels. Some pseudo labels inside the red and blue circles are incorrect. The black points have no pseudo labels after optimizing. } \label{plo} \end{figure} When a labeled 3D point cloud $\mathbf{P}^l = \{\boldsymbol{p}^l_1, \boldsymbol{p}^l_2, ..., \boldsymbol{p}^l_{N^l}\} \in \mathbb{R}^{N^l \times 6}$ and its one-hot ground truth labels $\mathbf{Y}^l = \{\boldsymbol{y}^l_1, \boldsymbol{y}^l_2, ..., \boldsymbol{y}^l_{N^l}\} \in \mathbb{R}^{N^l \times C}$, and an unlabeled point cloud $\mathbf{P}^u = \{\boldsymbol{p}^u_1, \boldsymbol{p}^u_2, ..., \boldsymbol{p}^u_{N^u}\} \in \mathbb{R}^{N^u \times 6}$ and its one-hot pseudo labels $\mathbf{Y}^u = \{\boldsymbol{y}^u_1, \boldsymbol{y}^u_2, ..., \boldsymbol{y}^u_{N^u}\} \in \mathbb{R}^{N^u \times C}$ are given, where $N^l$ and $N^u$ are the number of points, $6$ denotes the XYZ dimensions and RGB dimensions, and $C$ is the number of semantic classes, we firstly send $\mathbf{P}^l$ and $\mathbf{P}^u$ to the SPG module to generate their superpoint collections $\mathbf{S}^l = \{\mathbf{S}^l_1, \mathbf{S}^l_2, ..., \mathbf{S}^l_{M^l}\}$ and $\mathbf{S}^u = \{\mathbf{S}^u_1, \mathbf{S}^u_2, ..., \mathbf{S}^u_{M^u}\}$, where $M^l$ and $M^u$ are the number of superpoints. For the $i^{th}$ superpoint in $\mathbf{S}^l$, $\mathbf{S}^l_i = \{\boldsymbol{p}^l_{i_1}, \boldsymbol{p}^l_{i_2}, ..., \boldsymbol{p}^l_{i_n}\} \in \mathbb{R}^{n \times 6}$, where $n$ is the number of points in this superpoint, similar in $\mathbf{S}^u$. Secondly, we send $\mathbf{P}^l$ and $\mathbf{P}^u$ to the U-Net-based feature extractor to construct their high-level representations $\mathbf{F}^l = \{\boldsymbol{f}^l_1, \boldsymbol{f}^l_2, ..., \boldsymbol{f}^l_{N^l}\} \in \mathbb{R}^{N^l \times C_h}$ and $\mathbf{F}^u = \{\boldsymbol{f}^u_1, \boldsymbol{f}^u_2, ..., \boldsymbol{f}^u_{N^u}\} \in \mathbb{R}^{N^u \times C_h}$, where $C_h$ is the dimension of high-level features. Then we send $\mathbf{F}^l$ and $\mathbf{F}^u$ to the SPFA module to get feature maps $\mathbf{G}^l = \{\boldsymbol{g}^l_1, \boldsymbol{g}^l_2, ..., \boldsymbol{g}^l_{N^l}\} \in \mathbb{R}^{N^l \times C_h}$ and $\mathbf{G}^u = \{\boldsymbol{g}^u_1, \boldsymbol{g}^u_2, ..., \boldsymbol{g}^u_{N^u}\} \in \mathbb{R}^{N^u \times C_h}$ for feature smoothing in superpoints. After a FC layer, we obtain the final feature maps $\mathbf{X}^l = \{\boldsymbol{x}^l_1, \boldsymbol{x}^l_2, ..., \boldsymbol{x}^l_{N^l}\} \in \mathbb{R}^{N^l \times C}$ and $\mathbf{X}^u = \{\boldsymbol{x}^u_1, \boldsymbol{x}^u_2, ..., \boldsymbol{x}^u_{N^u}\} \in \mathbb{R}^{N^u \times C}$. \subsection{Superpoint Generation Module} We propose a novel superpoint generation module, named as SPG, to produce superpoints effectively and efficiently. The geometric and color characteristics of classes of objects in scenes are different. Some classes of objects are different in geometry and color from the surrounding objects (\emph{i.e.} chair and table). But there are also some classes of objects are only different in geometry from the surrounding objects (\emph{i.e.} beam and column), or only different in color from the surrounding objects (\emph{i.e.} window and board). Some existing superpoint generation methods~\cite{2018spgraph, 2020pointnl, 2021sspcnet} can only geometrically partition the 3D point clouds, which ignore the color information. The proposed SPG module combines geometry-based and color-based superpoints produced by the Region Growing algorithm~\cite{1994regiongrowin}, which has low computational complexity. In each iteration of the geometry-based Region Growing algorithm, there is a point with minimum curvature value to be selected as a seed and added to a seeds set and a superpoint. Then, the following three steps are repeated until there are no point in the seeds set: (1) Finding the neighbouring points of seeds and testing their angles between their normals, these neighbouring points will be added to the current superpoint if the angles are less than the threshold value $t_{ang}$. (2) If the curvatures of these neighbouring points are less than the threshold value $t_{cvt}$, then these points are added to the seeds set. (3) Current seeds are removed from the seeds set. If there are no unsegmented points whose curvatures are smaller than the threshold value $t_{cvt}$ in the scene, the process of iterations is terminated. Due to the curvature threshold $t_{cvt}$, some points will not be clustered to superpoints. The color-based Region Growing algorithm is similar to the geometry-based ones. There are two main differences in the color-based algorithm. The first one is that it uses color instead of normals. The color threshold value is $t_{clr}$. The second one is that it uses the merging algorithm for segmentation control. Two neighbouring clusters with a small difference between average color are merged together. The color-based Region Growing algorithm has no curvature threshold, so every point can be clustered. After obtaining the superpoints from the geometry-based and color-based Region Growing algorithms, we over-segment every geometry-based superpoint based on the color-based superpoints, which can be seen in Fig. \ref{spg}. It is noted that the geometric edge points will not be clustered as superpoints due to the curvature threshold $t_{cvt}$. The final merged superpoints $\mathbf{S}^l$ and $\mathbf{S}^u$ could be used by the PLO module, the SPFA module, and the superpoint feature consistency loss function. \subsection{Pseudo-label Optimization Module} Since the pseudo labels $\mathbf{Y}^u$ predicted by the network are not completely accurate, and the points in same superpoint should have same semantic labels in most cases, we utilize the superpoints to optimize pseudo labels. We propose a novel pseudo-label optimization module, named as PLO module, to modify and delete pseudo labels with low confidence. As shown from the red circle areas in the second row of Fig. \ref{plo}, incorrect pseudo labels generally have no geometric and color rules. So we can constrain pseudo labels by the geometry and color-based superpoints. Specifically, for a superpoint $\mathbf{S}^u_i (i = 1, 2, ..., M^u)$ with $n$ points, we first count the number of points contained in each semantic category $n_j (\sum_{j=1}^C n_j = n)$. Then we find the category $c_i$ that contains the most points, which can be formulated as: \begin{equation} \begin{split} &c_i = \mathop{\arg\max}_{j} \ \ (n_j). \\ \end{split} \label{equ_plo} \end{equation} If $n_{c_i} > t_{plo} \times n$, where $t_{plo}$ is a ratio parameter, we modify all the pseudo labels in superpoint $\mathbf{S}^l_i$ to $c_i$, otherwise all the pseudo labels in this superpoint will be deleted. We also delete the pseudo labels of points which are not clustered as superpoints in the geometry-based Growing Region algorithm~\cite{1994regiongrowin}. After above operations being done on all superpoints in the unlabeled point clouds, the optimized pseudo labels $\mathbf{\bar{Y}}^u = \{\boldsymbol{\bar{y}}^u_1, \boldsymbol{\bar{y}}^u_2, ..., \boldsymbol{\bar{y}}^u_{N^u}\} \in \mathbb{R}^{N^u \times C}$ are shown in the second row of Fig. \ref{plo}. \subsection{Edge Prediction Module} The geometry-based Region Growing algorithm~\cite{1994regiongrowin} does not contain edge points due to the curvature threshold setting. And the predicted pseudo labels of geometric edge points are usually unstable, which can be seen from the area inside the blue circle in the second row of Fig. \ref{plo}. So we design an edge prediction module, named as EP module, to constrain the features of edge points. We consider not only geometric edge points, but also color edge points. The geometric edge points are composed of points that are not clustered by the geometry-based region growing algorithm. The color edge points are those points whose neighboring points do not belong to the same color-based superpoint. The EP module consists of two FC layers, which reduce the number of feature channels to two. The activation function of the first FC layer is Leaky ReLU (LReLU)~\cite{2013lrelu}. The activation function of the second FC layer is Sigmoid. For the features of unlabeled point cloud $\mathbf{X}^u$, the outputs of the EP module are $\mathbf{E}^u = \{\boldsymbol{e}^u_1, \boldsymbol{e}^u_2, ..., \boldsymbol{e}^u_{N^u}\} \in \mathbb{R}^{N^u \times 2}$, which can be formulated as: \begin{equation} \begin{split} &\boldsymbol{e}^u_i = \textup{Sigmoid}(\textup{FC}(\textup{LReLU}(\textup{FC}(\boldsymbol{x}^u_i)))) \\ \end{split} \label{equ_ep} \end{equation} where $\boldsymbol{e}^u_i $ is the $i$-th element of $\mathbf{E}^u$. The labels of EP module for the unlabeled point cloud $\mathbf{P}^u$ are $\mathbf{\hat{E}}^u = \{\boldsymbol{\hat{e}}^u_1, \boldsymbol{\hat{e}}^u_2, ..., \boldsymbol{\hat{e}}^u_{N^u}\} \in \mathbb{R}^{N^u \times 2}$, where the values of edge points are $1$, otherwise $0$. So the edge prediction loss function for the unlabeled point cloud $Loss^u_{edge}$ is: \begin{equation} \begin{split} &Loss^u_{edge} = \sum_{i=1}^{N^u} \sum_{c=1}^2 -\boldsymbol{\hat{e}}^u_{i,c}\textup{log}(\boldsymbol{e}^u_{i,c}) - (1 - \boldsymbol{\hat{e}}^u_{i,c})\textup{log}(1 - \boldsymbol{e}^u_{i,c}) \\ \end{split} \label{equ_loss_edge} \end{equation} where $\boldsymbol{e}^u_{i,c}$ is the $c$-th channel of $\boldsymbol{e}^u_i$. The edge prediction loss function for the labeled point cloud $Loss^l_{edge}$ is obtained by the same way. \subsection{Smoothing Superpoint Features} In the PLO module, the pseudo labels of some superpoints are deleted, the features in these superpoints are not constrained. Besides, the points within same superpoint should have similar semantic features in most cases. So we propose a superpoint feature aggregation module, named as SPFA module, and a superpoint feature consistency loss function to smooth superpoint features. We first introduce the SPFA module. For the $i$-th clustered point in the unlabeled point cloud $\boldsymbol{p}^u_i$, we randomly sample $K$ points $\boldsymbol{p}^u_{i_1}, \boldsymbol{p}^u_{i_2}, ..., \boldsymbol{p}^u_{i_K}$ within the same superpoint as $\boldsymbol{p}^u_i$, and thier high-level features $\boldsymbol{f}^u_{i_1}, \boldsymbol{f}^u_{i_2}, ..., \boldsymbol{f}^u_{i_K}$. The aggregated feature $\boldsymbol{g}^u_i$ for the point $\boldsymbol{p}^u_i$ is obtained by: \begin{equation} \begin{split} &\boldsymbol{g}^u_i = \frac{(\boldsymbol{f}^u_i + \sum_{k=1}^{K} \boldsymbol{f}^u_{i_k})}{2}. \\ \end{split} \label{equ_spfa} \end{equation} Obtaining $\boldsymbol{g}^l_i$ is in the same way. Then we introduce the superpoint feature consistency loss functions $Loss^l_{sp}$ and $Loss^u_{sp}$. We use the variance function as the metric criterion of smoothness. For the features of unlabeled point cloud $\mathbf{X}^u$, the loss function $Loss^u_{sp}$ is formulated as: \begin{equation} \begin{split} &Loss^u_{sp} = \sum_{i=1}^{N^u} \sum_{c=1}^{C} w^u_i(\boldsymbol{x}^u_{i,c} - \frac{\sum_{k=1}^{K} \boldsymbol{x}^u_{i_k,c}}{K})^2\\ \end{split} \label{equ_loss_sp} \end{equation} where $w^u_i$ is a boolean value whether $\boldsymbol{p}^u_i$ is within a superpoint. $Loss^l_{sp}$ is obtained in the same way. \subsection{Training Loss} We introduce the final training loss of the superpoint-guided semi-supervised segmentation network. For the labeled point clouds, we calculate a multi-class cross-entropy loss $Loss^l_{seg}$ between $\mathbf{Y}^l$ and the Softmax of features $\mathbf{X}^l$ as follows: \begin{equation} \begin{split} &Loss^l_{seg} = -\sum_{i=1}^{N^l} \sum_{c=1}^{C} \boldsymbol{y}^l_{i,c}\textup{log}(\textup{Softmax}(\boldsymbol{x}^l_{i,c}))\\ \end{split} \label{equ_loss_seg_l} \end{equation} where $\boldsymbol{y}^l_{i,c}$ is the $c$-th channel of $\boldsymbol{y}^l_i$. For the unlabeled point clouds, we calculate a weighted multi-class cross-entropy loss $Loss^u_{seg}$ between $\mathbf{\bar{Y}}^u$ and features $\mathbf{X}^u$ as follows: \begin{equation} \begin{split} &Loss^u_{seg} = -\sum_{i=1}^{N^u} \sum_{c=1}^{C} \bar{w}^u_i\boldsymbol{\bar{y}}^u_{i,c}\textup{log}(\textup{Softmax}(\boldsymbol{x}^u_{i,c}))\\ \end{split} \label{equ_loss_seg_u} \end{equation} where $\bar{w}^u_i$ is a boolean value whether $\boldsymbol{p}^u_i$ has an optimized pseudo label after PLO module. The final loss function is formulated as: \begin{equation} \begin{split} Loss = &Loss^l_{seg} + Loss^u_{seg} + Loss^l_{edge} + Loss^u_{edge} + \\ &Loss^l_{sp} + Loss^u_{sp}. \\ \end{split} \label{equ_loss_all} \end{equation} \begin{table}[t] \begin{center} \caption{Semantic segmentation results (\%) on the S3DIS dataset (Area-5).} \label{tab_s3dis} \resizebox{0.95\columnwidth}{!}{ \begin{tabular}{|c|c|c|c|c|} \hline \rule{0pt}{8pt}&Methods &mIoU &mAcc &OA\\ \hline \multirow{7}{*}{\begin{sideways}20\%\end{sideways}} \rule{0pt}{8pt}&RandLA-Net~\cite{2020randlanet} &50.90 &60.76 &81.24\\ \rule{0pt}{8pt}&GA-Net~\cite{2021ganet} &52.12 &61.76 &81.46\\ \rule{0pt}{8pt}&SCF-Net~\cite{2021scfnet} &51.78 &61.19 &81.61\\ \cline{2-5} \rule{0pt}{8pt}&$\pi$-Model~\cite{2017pimodel} &51.58 &59.46 &82.09\\ \rule{0pt}{8pt}&Mean Teacher~\cite{2017meanteacher} &51.44 &62.27 &81.70\\ \rule{0pt}{8pt}&Pseudo-Labels~\cite{2013pseudolabels} &52.21 &63.76 &82.39\\ \cline{2-5} \rule{0pt}{8pt}&Ours &\textbf{55.49} &\textbf{65.45} &\textbf{83.55}\\ \hline \multirow{7}{*}{\begin{sideways}10\%\end{sideways}} \rule{0pt}{8pt}&RandLA-Net~\cite{2020randlanet} &45.64 &58.58 &79.08\\ \rule{0pt}{8pt}&GA-Net~\cite{2021ganet} &43.85 &52.60 &78.41\\ \rule{0pt}{8pt}&SCF-Net~\cite{2021scfnet} &42.64 &53.16 &76.54\\ \cline{2-5} \rule{0pt}{8pt}&$\pi$-Model~\cite{2017pimodel} &46.05 &57.49 &80.26\\ \rule{0pt}{8pt}&Mean Teacher~\cite{2017meanteacher} &46.72 &57.84 &80.50\\ \rule{0pt}{8pt}&Pseudo-Labels~\cite{2013pseudolabels} &47.78 &61.40 &81.13\\ \cline{2-5} \rule{0pt}{8pt}&Ours &\textbf{51.14} &\textbf{64.92} &\textbf{82.54}\\ \hline \end{tabular} } \end{center} \end{table} \begin{table}[t] \begin{center} \caption{Semantic segmentation results (\%) on the ScanNet dataset.} \label{tab_scannet} \resizebox{0.95\columnwidth}{!}{ \begin{tabular}{|c|c|c|c|c|} \hline \rule{0pt}{8pt}&Methods &mIoU &mAcc &OA\\ \hline \multirow{7}{*}{\begin{sideways}20\%\end{sideways}} \rule{0pt}{8pt}&RandLA-Net~\cite{2020randlanet} &52.86 &62.56 &81.43\\ \rule{0pt}{8pt}&GA-Net~\cite{2021ganet} &52.12 &61.50 &81.39\\ \rule{0pt}{8pt}&SCF-Net~\cite{2021scfnet} &52.05 &61.32 &81.31\\ \cline{2-5} \rule{0pt}{8pt}&$\pi$-Model~\cite{2017pimodel} &53.07 &62.78 &81.52\\ \rule{0pt}{8pt}&Mean Teacher~\cite{2017meanteacher} &52.98 &62.65 &81.48\\ \rule{0pt}{8pt}&Pseudo-Labels~\cite{2013pseudolabels} &53.23 &62.95 &81.63\\ \cline{2-5} \rule{0pt}{8pt}&Ours &\textbf{55.12} &\textbf{63.61} &\textbf{82.43}\\ \hline \multirow{7}{*}{\begin{sideways}10\%\end{sideways}} \rule{0pt}{8pt}&RandLA-Net~\cite{2020randlanet} &49.34 &58.20 &79.66\\ \rule{0pt}{8pt}&GA-Net~\cite{2021ganet} &49.03 &58.05 &79.29\\ \rule{0pt}{8pt}&SCF-Net~\cite{2021scfnet} &49.11 &59.35 &79.21\\ \cline{2-5} \rule{0pt}{8pt}&$\pi$-Model~\cite{2017pimodel} &49.52 &58.48 &79.87\\ \rule{0pt}{8pt}&Mean Teacher~\cite{2017meanteacher} &49.41 &58.65 &79.70\\ \rule{0pt}{8pt}&Pseudo-Labels~\cite{2013pseudolabels} &50.25 &59.37 &79.92\\ \cline{2-5} \rule{0pt}{8pt}&Ours &\textbf{52.38} &\textbf{60.76} &\textbf{81.18}\\ \hline \end{tabular} } \end{center} \end{table} \section{Experiments} In this section, we firstly introduce the details of experimental setup. Secondly, we evaluate the performances of proposed superpoint-guided semi-supervised segmentation network on two 3D public datasets with a few labeled 3D scenes. Thirdly, we explore the effect of $t_{plo}$. Finally, we end up with ablation analysis. \subsection{Experimental Setup} The proposed superpoint-guided semi-supervised segmentation network is evaluated on two 3D public datasets, including S3DIS~\cite{2016s3dis}, and ScanNet~\cite{2017scannet}. In the geometry-based Region Growing algorithm~\cite{1994regiongrowin}, the curvature threshold value $t_{cvt}$ is $1$, and the angle threshold value $t_{ang}$ is $3$ degree following PCL~\cite{pclrg}. In the color-based Region Growing algorithm, the color threshold value $t_{clr}$ is $6$ following PCL~\cite{pclrgrgb}. In the PLO module, the ratio parameter $t_{plo}$ is $0.8$. The U-Net-based feature extractor parameters are consistent with the model before the FC layers in RandLA-Net~\cite{2020randlanet}, where $C_h$ is $64$. The output dimensionality of the first FC layer in EP module is $6$. We train the network using the Adam optimizer with initial learning rate $0.01$ and batchsize $6$ for $100$ epochs. In the first $50$ epochs, we only optimize the network branch for labeled point clouds. And in the last $50$ epochs, we train the whole network. The pseudo labels are updated after each epoch. \subsection{Evaluation on the S3DIS Dataset} The S3DIS dataset consists of 271 rooms in 6 different areas inside an office building. 13 semantic categories are assigned to each 3D point with XYZ coordinates and RGB features. Since the fifth area with 68 rooms does not overlap with other areas, experiments on Area-5 could better reflect the generalization ability of the framework. So we conducted our experiments on Area-5 validation. We randomly sample about 20\% and 10\% (40 and 20 rooms) of the 203 rooms respectively in the training set as labeled point clouds, and the remaining rooms in the training set are used as unlabeled point clouds. The evaluation metrics we use are mean class Intersection-over-Union (mIoU), mean class Accuracy (mAcc) and Overall Accuracy (OA). We compare our superpoint-guided semi-supervised segmentation network to several state-of-the-art point cloud semantic segmentation methods with same labeled and unlabeled data including RandLA-Net~\cite{2020randlanet}, GA-Net~\cite{2021ganet}, and SCF-Net~\cite{2021scfnet}, and several popular semi-supervised semantic segmentation methods based on RandLA-Net including $\pi$-Model~\cite{2017pimodel}, Mean Teacher~\cite{2017meanteacher}, and Pseudo-Labels~\cite{2013pseudolabels}. In the $\pi$-Model and Mean Teacher, the dual inputs are the original point cloud and the point cloud after a random plane rotation and a random mirror transformation. In the Pseudo-Labels, the predicted labels are updated after each epoch. As seen from Table \ref{tab_s3dis}, $\pi$-Model and Mean Teacher only improving mIoU by about 1\% based on RandLA-Net indicates that the consistency between geometric transformed point clouds is not enough to constrain the unlabeled point cloud features. The results of Pseudo-Labels are worse than our method, indicating that there are some false-predicted pseudo labels which will affect the learning of network. Our method achieves best on all metrics due to its more effective use of unlabeled data. The results on 20\% semi-supervised setting are better than on 10\% semi-supervised setting, which may be attributed to more labeled point clouds. \subsection{Evaluation on the ScanNet Dataset} The ScanNet dataset contains 1,513 3D indoor scenes obtained by scanning and reconstruction, of which 1,201 are used for training and the remaining 312 are used for testing. 20 semantic categories are provided for evaluation. We randomly sample about 20\% and 10\% (240 and 120 rooms) of the 1201 rooms in the training set as labeled scenes, and the remaining rooms in the training set are used as unlabeled scenes. The mIoU, mAcc, and OA are used as evaluation metrics. The competitive methods we use following experiments on the S3DIS dataset. Table \ref{tab_scannet} shows the comparison results. As seen from Table \ref{tab_scannet}, the results of $\pi$-Model~\cite{2017pimodel}, Mean Teacher~\cite{2017meanteacher}, and Pseudo-Labels~\cite{2013pseudolabels} have a small improvement on the basis of RandLA-Net, which may be attributed to the fact that there are more semantic categories in ScanNet than S3DIS, which results in a small number of labeled points of some categories. It is not easy to learn the features of these categories by the DNNs. Our method achieves the state-of-the-art performance, probably due to the great pseudo-label filtering and feature constraining abilities. \begin{table}[t] \begin{center} \caption{Results of different $t_{plo}$ on the S3DIS dataset (Area-5).} \label{tab_tplo} \resizebox{0.8\columnwidth}{!}{ \begin{tabular}{|c|c|c|c|c|} \hline \rule{0pt}{8pt}&$t_{plo}$ values &mIoU &mAcc &OA\\ \hline \multirow{5}{*}{\begin{sideways}20\%\end{sideways}} \rule{0pt}{8pt}&0.70 &53.93 &64.80 &82.92\\ \rule{0pt}{8pt}&0.75 &54.48 &65.20 &83.23\\ \rule{0pt}{8pt}&0.80 &\textbf{55.49} &\textbf{65.45} &\textbf{83.55}\\ \rule{0pt}{8pt}&0.85 &54.13 &64.79 &82.81\\ \rule{0pt}{8pt}&0.90 &53.38 &64.02 &82.53\\ \hline \multirow{5}{*}{\begin{sideways}10\%\end{sideways}} \rule{0pt}{8pt}&0.70 &50.59 &64.56 &81.93\\ \rule{0pt}{8pt}&0.75 &50.97 &64.78 &82.21\\ \rule{0pt}{8pt}&0.80 &\textbf{51.14} &\textbf{64.92} &\textbf{82.54}\\ \rule{0pt}{8pt}&0.85 &50.67 &63.56 &82.19\\ \rule{0pt}{8pt}&0.90 &49.57 &60.07 &82.15\\ \hline \end{tabular} } \end{center} \end{table} \begin{table}[t] \begin{center} \caption{Ablation study of the modules on the S3DIS dataset (Area-5).} \label{tab_module} \resizebox{1.0\columnwidth}{!}{ \begin{tabular}{|c|c|c|c|c|} \hline \rule{0pt}{8pt}&Methods &mIoU &mAcc &OA\\ \hline \multirow{6}{*}{\begin{sideways}20\%\end{sideways}} \rule{0pt}{8pt}&Baseline &50.90 &60.76 &81.24\\ \rule{0pt}{8pt}&Baseline+SPFA &51.32 &61.21 &82.22\\ \rule{0pt}{8pt}&Baseline+SPFA+PL &52.75 &63.86 &82.78\\ \rule{0pt}{8pt}&Baseline+SPFA+PLO &53.95 &64.57 &83.04\\ \rule{0pt}{8pt}&Baseline+SPFA+PLO+EP &54.77 &64.98 &83.30\\ \rule{0pt}{8pt}&Ours &\textbf{55.49} &\textbf{65.45} &\textbf{83.55}\\ \hline \multirow{6}{*}{\begin{sideways}10\%\end{sideways}} \rule{0pt}{8pt}&Baseline &45.64 &58.58 &79.08\\ \rule{0pt}{8pt}&Baseline+SPFA &46.05 &59.62 &80.38\\ \rule{0pt}{8pt}&Baseline+SPFA+PL &47.86 &61.59 &81.38\\ \rule{0pt}{8pt}&Baseline+SPFA+PLO &49.78 &62.63 &81.86\\ \rule{0pt}{8pt}&Baseline+SPFA+PLO+EP &50.45 &63.25 &82.17\\ \rule{0pt}{8pt}&Ours &\textbf{51.14} &\textbf{64.92} &\textbf{82.54}\\ \hline \end{tabular} } \end{center} \end{table} \subsection{Effect of $t_{plo}$} The ratio parameter $t_{plo}$ in the PLO module affects the quality of the optimized pseudo labels, and results in affecting the final segmentation performances. Too small value of $t_{plo}$ will result in pseudo labels with lower-confidence being assigned to superpoints, and too large value of $t_{plo}$ will result in many correct pseudo labels being deleted. Here we conduct experiments to analyze the effect of $t_{plo}$ by setting different values \{0.7, 0.75, 0.8, 0.85, 0.9\}. We conduct experiments on Area-5 of the S3DIS dataset with the evaluation metrics mIoU, mAcc and OA. The results are listed in Table \ref{tab_tplo}. As seen from Table \ref{tab_tplo}, the results by setting $t_{plo}$ to 0.8 achieve the best performance, so we use this value as $t_{plo}$ in the PLO module. \subsection{Ablation Study} For ablation study, we stack the proposed sub-modules on the baseline step-to-step to prove the effectiveness of our method. Our baseline method employs a U-Net-based feature extractor from RandLA-Net~\cite{2020randlanet}, and is only trained on the labeled point clouds for $100$ epochs. The comparing experiments are (1) baseline method, denoted as ``Baseline"; (2) adding the SPG and SPFA modules on baseline and being trained on the labeled point clouds, denoted as ``Baseline+SPFA"; (3) adding pseudo labels to unlabeled point clouds for supervision in the last $50$ epochs based on (2), denoted as ``Baseline+SPFA+PL"; (4) adding the PLO module on (3) for unlabeled point clouds, denoted as ``Baseline+SPFA+PLO"; (5) adding the EP module on (4) for all point clouds, denoted as ``Baseline+SPFA+PLO+EP"; and (6) adding the superpoint feature consistency loss functions $Loss^l_{sp}$ and $Loss^u_{sp}$ on (5), denoted as ``Ours". We conduct ablation study on Area-5 of the S3DIS dataset with the evaluation metrics mIoU, mAcc and OA. And 20\% and 10\% of the rooms in the training set are used for labeled point clouds. As shown in Table \ref{tab_module}, the performances on ``Baseline+SPFA" being better than ``Baseline" demonstrate the importance of smoothing the features in superpoints. ``Baseline+SPFA+PL" achieves better than ``Baseline+SPFA", which may be attributed to the supervision of unlabeled point clouds. ``Baseline+SPFA+PLO" performing better than ``Baseline+SPFA+PL" indicates that the superpoints produced by combining geometry-based and color-based Region Growing algorithms~\cite{1994regiongrowin} can help optimize pseudo labels effectively. The result of ``Baseline+SPFA+PLO+EP" achieves better than ``Baseline+SPFA+PLO", which may be attributed to edge-point feature learning. ``Ours" achieves best, which demonstrates that combining all these modules can reach the best results. \section{Conclusions} For using the large amount of unlabeled point clouds which can be easily obtained from sensors or reconstruction, we propose a superpoint-guided semi-supervised segmentation network for 3D point clouds, which jointly utilizes a small portion of labeled scenes and a large number of unlabeled scenes for network training. Specifically, we combine the superpoints produced by geometry-based and color-based Region Growing algorithms~\cite{1994regiongrowin} to optimize the pseudo labels predicted by unlabeled point clouds. The features of points without pseudo labels are constrained by the superpoint feature aggregation module, the edge prediction module, and the superpoint feature consistency loss function. Our method can learn the discriminative features of unlabeled point clouds and achieve best performance on two 3D public datasets with a few number of labeled scenes in most cases. \newpage \bibliographystyle{IEEEtran}
\section{Introduction} In the development of the standard model(SM) \cite{1948Phys}, the anomalous magnetic dipole moment (MDM) of muon has played a huge role. The SM contributions to muon MDM include several parts: The QED loop contributions $a_\mu^{QED}=116584718.931(104)\times 10^{-11}$ \cite{g2rep2020,add,GWB,AKDN1,GCMH,MHBL,MDAH,AKDN2,TBPA,TAMH,GCFH,GECS,TBNC,TATK,ACWJ,CGDS}; The electroweak contributions $a^{EW}_\mu=153.6(1.0)\times 10^{-11}$ \cite{ACWJ,CGDS}; The hadronic vacuum polarization contributions $a^{HVP}=6845(40)\times 10^{-11}$ \cite{g2rep2020,GCMH, had2}; The hadronic light-by-light contributions $a^{HLBL}=92(18)\times 10^{-11}$ \cite{GCFH, GECS, TBNC}. Combining these results, one can obtain the SM prediction of muon anomaly $a^{SM}_\mu=116591810(43)\times 10^{-11}$(0.37ppm) \cite{ g2rep2020, muon2, mdm2, TBPA}. The MDM of muon $a_\mu\equiv(g_\mu-2)/2$ has been detected recently by the Fermilab National Accelerator Laboratory(FNAL) muon g-2 experiment\cite{fnal,wx1,wx2,wx3,wx4,wx5,wx6,wx7}. The result is $a_{\mu}^{FNAL}=116592040(54)\times 10^{-11}$(0.46ppm) \cite{046} and 3.3 standard deviations larger than the SM prediction, which is in great agreement with BNL E821 result\cite{GWB}. Then the new averaged experiment value of muon anomaly is $a^{exp}_{\mu}=116592061(41)\times 10^{-11}$(0.35ppm). The deviation between experiment and SM prediction is $\Delta a_\mu=a^{exp}_\mu-a^{SM}_\mu=251(59)\times 10^{-11}$, which is 4.2$\sigma$. The present deviation($4.2\sigma$) between the SM prediction and the experimental data for $a_\mu$ is more stable, and it indicates that there should be new physics beyond the SM. With the improvement of both experimental precision and theoretical prediction, the deviation will become more important in the future, and open a window to explore new physics. The electroweak one-loop corrections from new physics sector are generally suppressed by the factor $\Lambda_{{\rm EW}}^2/\Lambda^2$ with $\Lambda_{{\rm EW}}$ denoting the electroweak energy scale and $\Lambda$ representing the new physics energy scale. Supposing the masses of neutralinos, charginos and scalar leptons of the second generation equal to $M_{SUSY}$\cite{susy1, susy2}, the authors obtain the approximated supersymmetric (SUSY) one-loop contributions by simplification \begin{eqnarray} |a_{\mu}^{SUSY}|=13\times10^{-10}\Big( \frac{100{\rm GeV}} {M_{SUSY}}\Big)^2\tan\beta{\rm sign}(\mu_{H}) \label{susyoneloop}. \end{eqnarray} From this equation, one can estimate the one-loop SUSY contributions well. To obtain one-loop SUSY corrections around $2\times10^{-9}$, the parameters should be in the region $M_{SUSY}\sim(200,500)$ GeV, $\tan\beta\sim(5,50)$. If $M_{SUSY}$ is larger than 500 GeV, the one-loop SUSY corrections are suppressed strongly. The authors\cite{wx3} study the muon g-2 in several GUT-scale constrained SUSY models including CMSSM/mSUGRA, pMSSM, CMSSM/mSUGRA extensions and GMSB/AMSB extensions. In the general next-to-minimal supersymmetric standard model (GNMSSM) with a singlino-dominated neutralino as a dark matter candidate, the numerical result of muon g-2 is researched with the MultiNest technique for the parameter space\cite{caojj}. To probe new physics accounting for muon g-2 and gravitational waves with pulsar timing array measurements, the authors\cite{shuj} study the model possessing a light gauge boson or neutral scalar interacting with muons. The current experimental precision is high and sensitive to the two-loop electroweak corrections. The one-loop correction to muon g-2 is well researched, but the two-loop study is more complicated and less advanced. In some parameter space, the two-loop SUSY contributions become very important. In the minimal supersymmetric extension of the standard model(MSSM), the contributions to muon MDM from two-loop Barr-Zee type diagrams with sub-scalar-loop\cite{s1} and two-loop diagrams enhanced by two powers of $\tan\beta$\cite{s2} are researched. The photonic SUSY two-loop diagrams\cite{s3} where an additional photon loop is attached to a SUSY one-loop diagram are studied in compact and analytic expressions. There are non-decoupling two-loop corrections from fermion/sfermion loops\cite{s4,s5} in the MSSM. These corrections can be generally large and even logarithmically enhanced for heavy sfermions. The analytical results are presented and they obtain a very compact formula with approximation\cite{s5}. GM2Calc (a public C++ program) is used to calculate precise MSSM prediction for muon MDM\cite{s6}. In the CP-violating MSSM, there are some special two-loop diagrams belonging to diamond type, which include virtual neutralino-slepton-Z\cite{two1}, chargino-sneutrino, neutralino-slepton, slepton-sneutrino\cite{two2}, and their corrections to muon MDM are studied. Employing an effective Lagrangian approach, the authors\cite{other1} derive the leading-logarithm two-loop and three-loop electroweak contributions to the muon MDM. In Refs.\cite{other2,other3}, the authors research corrections to muon MDM from the two-loop rainbow diagrams and Barr-Zee diagrams with heavy fermion sub-loop. Furthermore, the analytic results are simplified at the decoupling limit and the leading corrections are obtained obviously\cite{other2}. The two-loop Barr-Zee type diagrams with sub-fermion-loop and sub-scalar-loop between vector boson and Higgs are studied in BLMSSM\cite{one}. The MSSM is one of the most popular models of new physics. The authors present statistically convergent profile likelihood maps obtained via global fits of a phenomenological MSSM with 15 free parameters, and analyze the phenomenology of this model\cite{MSSM15fit}. Including constraints from LHC data at 13 TeV and other experiments, a frequentist analysis of the constraints on a phenomenological MSSM model with 11 parameters is performed with MasterCode\cite{MSSM11fit}. With the new GAMBIT software framework, the authors study a global fit of the MSSM\cite{MSSMgfit}. Many people also study the phenomenology of MSSM including the anomaly of muon g-2, dark matter relic density and direct detection, LHC constraints and so on. So, the viable parameter space of MSSM is compressed\cite{MSSMg2DM,wx5,wx6,wx7} by more and more accurate experimental progresses. Furthermore, the MSSM has $\mu$ problem, and can not produce tiny mass to light neutrinos. With these issues in mind, physicists extend MSSM. In these MSSM extensions, the U(1) extension is interesting. We call the $U(1)_X$ extension of MSSM as $U(1)_X$SSM \cite{Sarah, ZSMJHEP}, where three Higgs singlets and right-handed neutrinos are added to MSSM. Two gauge groups $U(1)_X$ and $U(1)_Y$ have gauge mixing. The right-handed neutrinos have two effects: 1. produce tiny mass to light neutrinos through see-saw mechanism, 2. provide a new dark matter candidate-light sneutrino. This model relieves the so called little hierarchy problem that appears in the MSSM. $\hat{S}$ is the singlet Higgs superfield with a non-zero VEV ($v_S/\sqrt{2}$). The terms $\mu\hat{H}_u\hat{H}_d$ and $\lambda_H\hat{S}\hat{H}_u\hat{H}_d$ can produce an effective $\mu_{eff}=\mu+\lambda_Hv_S/\sqrt{2}$, which relieves the $\mu$ problem. Comparing with the condition in MSSM, the lightest CP-even Higgs mass at tree level is improved. The second light neutral CP-even Higgs can be at TeV order. Then it easily satisfies the constraints for heavy Higgs from experiments. In our previous work, we calculate the contributions to muon MDM from some two-loop diagrams under the $U(1)_X$SSM with the effective Lagrangian method. In this work, we research one-loop diagrams and more two-loop diagrams than our previous work \cite{slh}. To make up the departure between experiment data and SM prediction for $a_\mu$, the scalar neutrino and scalar lepton should not be heavy. In the Fig.\ref{twolooptu}, we show the studied two-loop self-energy diagrams. $a_\mu$ is deduced from the triangle diagrams of the process $\mu\rightarrow \mu+\gamma$. Attaching a photon on the internal lines of the two-loop self-energy diagrams in all possible way, one can get the two loop triangle diagrams. A two-loop self-energy diagram can produce several two-loop triangle diagrams, and the sum of their amplitudes satisfies Ward-identity. In this work, we study the electroweak corrections from several type two-loop SUSY diagrams(Barr-Zee type, rainbow type and diamond type) and the virtual SUSY particles include chargino, neutralino, scalar lepton and scalar neutrino. After tedious calculation and using on-shell condition for the external leptons, we get all dimension 6 operators and their coefficients. We neglect higher dimensional operators such as dimension 8 operators, because they are tiny. After this introduction, we show the main content of $U(1)_X$SSM and its superfields in section 2. The one-loop and two-loop analytic results of $a_\mu$ are shown in the section 3. The numerical results are shown in the section 4. The last section is used for the discussion and conclusion. \section{The main content of $U(1)_X$SSM} $U(1)_X$SSM is the U(1) extension of MSSM, whose local gauge group is $SU(3)_C\otimes SU(2)_L \otimes U(1)_Y\otimes U(1)_X$. Comparing with MSSM, $U(1)_X$SSM has more superfields including: right-handed neutrinos and three Higgs singlets. Through the see-saw mechanism, three light neutrinos obtain tiny masses at tree level. The neutral CP-even Higgs mass squared matrix is $5\times5$, because of the introduction of $\eta,~\bar{\eta}$ and $S$. The lightest CP-even Higgs mass can be improved at tree level. The particle contents can be found in our previous work\cite{ZSMJHEP,slh}. The superpotential of $U(1)_X$SSM is \begin{eqnarray} &&W=l_W\hat{S}+\mu\hat{H}_u\hat{H}_d+M_S\hat{S}\hat{S}-Y_d\hat{d}\hat{q}\hat{H}_d-Y_e\hat{e}\hat{l}\hat{H}_d+\lambda_H\hat{S}\hat{H}_u\hat{H}_d \nonumber\\&&+\lambda_C\hat{S}\hat{\eta}\hat{\bar{\eta}}+\frac{\kappa}{3}\hat{S}\hat{S}\hat{S}+Y_u\hat{u}\hat{q}\hat{H}_u+Y_X\hat{\nu}\hat{\bar{\eta}}\hat{\nu} +Y_\nu\hat{\nu}\hat{l}\hat{H}_u. \end{eqnarray} We show the concrete forms of the two Higgs doublets and three Higgs singlets \begin{eqnarray} &&H_{u}=\left(\begin{array}{c}H_{u}^+\\{1\over\sqrt{2}}\Big(v_{u}+H_{u}^0+iP_{u}^0\Big)\end{array}\right), ~~~~~~ H_{d}=\left(\begin{array}{c}{1\over\sqrt{2}}\Big(v_{d}+H_{d}^0+iP_{d}^0\Big)\\H_{d}^-\end{array}\right), \nonumber\\ &&\eta={1\over\sqrt{2}}\Big(v_{\eta}+\phi_{\eta}^0+iP_{\eta}^0\Big),~~~~~~~~~~~~~~~ \bar{\eta}={1\over\sqrt{2}}\Big(v_{\bar{\eta}}+\phi_{\bar{\eta}}^0+iP_{\bar{\eta}}^0\Big),\nonumber\\&& \hspace{4.0cm}S={1\over\sqrt{2}}\Big(v_{S}+\phi_{S}^0+iP_{S}^0\Big). \end{eqnarray} The VEVs of the Higgs superfields $H_u$, $H_d$, $\eta$, $\bar{\eta}$ and $S$ are presented by $v_u,~v_d,~v_\eta$,~ $v_{\bar\eta}$ and $v_S$ respectively. Two angles are defined as $\tan\beta=v_u/v_d$ and $\tan\beta_\eta=v_{\bar{\eta}}/v_{\eta}$. The soft SUSY breaking terms are \begin{eqnarray} &&\mathcal{L}_{soft}=\mathcal{L}_{soft}^{MSSM}-B_SS^2-L_SS-\frac{T_\kappa}{3}S^3-T_{\lambda_C}S\eta\bar{\eta} +\epsilon_{ij}T_{\lambda_H}SH_d^iH_u^j\nonumber\\&& -T_X^{IJ}\bar{\eta}\tilde{\nu}_R^{*I}\tilde{\nu}_R^{*J} +\epsilon_{ij}T^{IJ}_{\nu}H_u^i\tilde{\nu}_R^{I*}\tilde{l}_j^J -m_{\eta}^2|\eta|^2-m_{\bar{\eta}}^2|\bar{\eta}|^2\nonumber\\&& -m_S^2S^2-(m_{\tilde{\nu}_R}^2)^{IJ}\tilde{\nu}_R^{I*}\tilde{\nu}_R^{J} -\frac{1}{2}\Big(M_S\lambda^2_{\tilde{X}}+2M_{BB^\prime}\lambda_{\tilde{B}}\lambda_{\tilde{X}}\Big)+h.c~~. \end{eqnarray} $Y^Y$ denotes the $U(1)_Y$ charge and $Y^X$ represents the $U(1)_X$ charge. We have proven that $U(1)_X$SSM is anomaly free. Two Abelian groups $U(1)_Y$ and $U(1)_X$ in $U(1)_X$SSM produce a new effect: the gauge kinetic mixing, which can also be induced through RGEs even with zero value at $M_{GUT}$. In the general form, the covariant derivatives of $U(1)_X$SSM reads as \cite{model1, model2, model3} \begin{eqnarray} &&D_\mu=\partial_\mu-i\left(\begin{array}{cc}Y^Y,&Y^X\end{array}\right) \left(\begin{array}{cc}g_{Y},&g{'}_{{YX}}\\g{'}_{{XY}},&g{'}_{{X}}\end{array}\right) \left(\begin{array}{c}A_{\mu}^{\prime Y} \\ A_{\mu}^{\prime X}\end{array}\right)\;. \label{gauge1} \end{eqnarray} The gauge fields of $U(1)_Y$ and $U(1)_X$ are denoted by $A_{\mu}^{\prime Y}$ and $A^{\prime X}_\mu$. With the two Abelian gauge groups unbroken condition, we use the matrix $R$ \cite{model1, model3} to obtain \begin{eqnarray} &&\left(\begin{array}{cc}g_{Y},&g{'}_{{YX}}\\g{'}_{{XY}},&g{'}_{{X}}\end{array}\right) R^T=\left(\begin{array}{cc}g_{1},&g_{{YX}}\\0,&g_{{X}}\end{array}\right)\;. \label{gauge2} \end{eqnarray} In this model, the gauge bosons $A^{X}_\mu,~A^Y_\mu$ and $V^3_\mu$ mix together at the tree level. We show the mass matrix in the basis $(A^Y_\mu, V^3_\mu, A^{X}_\mu)$ as \begin{eqnarray} &&\left(\begin{array}{*{20}{c}} \frac{1}{8}g_{1}^2 v^2 &~~~ -\frac{1}{8}g_{1}g_{2} v^2 & ~~~\frac{1}{8}g_{1}(g_{YX}+g_X) v^2 \\ -\frac{1}{8}g_{1}g_{2} v^2 &~~~ \frac{1}{8}g_{2}^2 v^2 & ~~~~-\frac{1}{8}g_{2}(g_{YX}+g_X) v^2\\ \frac{1}{8}g_{1}(g_{YX}+g_X) v^2 &~~~ -\frac{1}{8}g_{2}(g_{YX}+g_X) v^2 &~~~~ \frac{1}{8}(g_{YX}+g_X)^2 v^2+\frac{1}{8}g_{{X}}^2 \xi^2 \end{array}\right),\label{gauge matrix} \end{eqnarray} with $v^2=v_u^2+v_d^2$ and $\xi^2=v_\eta^2+v_{\bar{\eta}}^2$. Two mixing angles $\theta_{W}$ and $\theta_{W}'$ are used to diagonalize the mass matrix in Eq. (\ref{gauge matrix}). $\sin^2\theta_{W}^\prime$ is defined as \begin{eqnarray} \sin^2\theta_{W}'=\frac{1}{2}-\frac{((g_{YX}+g_X)^2-g_{1}^2-g_{2}^2)v^2+ 4g_{X}^2\xi^2}{2\sqrt{((g_{YX}+g_X)^2+g_{1}^2+g_{2}^2)^2v^4+8g_{X}^2((g_{YX}+g_X)^2-g_{1}^2-g_{2}^2)v^2\xi^2+16g_{X}^4\xi^4}}. \end{eqnarray} We deduce the eigenvalues of Eq. (\ref{gauge matrix}) \begin{eqnarray} &&m_\gamma^2=0,\nonumber\\ &&m_{Z,{Z^{'}}}^2=\frac{1}{8}\Big((g_{1}^2+g_2^2+(g_{YX}+g_X)^2)v^2+4g_{X}^2\xi^2 \nonumber\\ &&\mp\sqrt{(g_{1}^2+g_{2}^2+(g_{YX}+g_X)^2)^2v^4+8((g_{YX}+g_X)^2-g_{1}^2- g_{2}^2)g_{X}^2v^2\xi^2+16g_{X}^4\xi^4}\Big). \end{eqnarray} These results are similar as the condition of B-LSSM with the relation $g_{YX}+g_X\rightarrow g_{YX}$. The reason comes from the differences of the $Y^X$ charges of the superfields in the both models. The used mass matrixes can be found in the work \cite{ffa}. Here, we show some used couplings. We also deduce the vertexes of $\bar{l}_i-\chi_j^--\tilde{\nu}^R_k(\tilde{\nu}^I_k)$ \begin{eqnarray} &&\mathcal{L}_{\bar{l}\chi^-\tilde{\nu}^R}=\frac{1}{\sqrt{2}}\bar{l}_i\Big\{U^*_{j2}Z^{R*}_{ki}Y_l^iP_L -g_2V_{j1}Z^{R*}_{ki}P_R\Big\}\chi_j^-\tilde{\nu}^R_k,\nonumber\\ &&\mathcal{L}_{\bar{l}\chi^-\tilde{\nu}^I}=\frac{i}{\sqrt{2}}\bar{l}_i\Big\{U^*_{j2}Z^{I*}_{ki}Y_l^iP_L -g_2V_{j1}Z^{I*}_{ki}P_R\Big\}\chi_j^-\tilde{\nu}^I_k. \end{eqnarray} The vertexes of $\bar{\chi}_i^0-\nu_i-\tilde{\nu}^R_k(\tilde{\nu}^I_k)$ are \begin{eqnarray} &&\mathcal{L}_{\bar{\chi}^0\nu\tilde{\nu}^R}=\frac{1}{2}\bar{\chi}_i^0\Big\{(-g_2N^*_{i2}+g_{YX}N^*_{i5}+g_1N^*_{i1}) \sum_{a=1}^3Z^{R*}_{ka}U_{ja}^{V*}P_L\nonumber\\&&\hspace{1.7cm}+ (-g_2N_{i2}+g_{YX}N_{i5}+g_1N_{i1})\sum_{a=1}^3Z^{R*}_{ka}U_{ja}^{V}P_R\Big\}\nu_i\tilde{\nu}^R_k,\nonumber \\&&\mathcal{L}_{\bar{\chi}^0\nu\tilde{\nu}^I}=-\frac{i}{2}\bar{\chi}_i^0\Big\{(-g_2N^*_{i2}+g_{YX}N^*_{i5}+g_1N^*_{i1}) \sum_{a=1}^3Z^{I*}_{ka}U_{ja}^{V*}P_L\nonumber\\&&\hspace{1.7cm}+ (g_2N_{i2}-g_{YX}N_{i5}-g_1N_{i1})\sum_{a=1}^3Z^{I*}_{ka}U_{ja}^{V}P_R\Big\}\nu_i\tilde{\nu}^I_k. \end{eqnarray} The vertexes of W-slepton-sneutrino(CP-even and CP-odd) read as \begin{eqnarray} &&\mathcal{L}_{\tilde{L}\tilde{\nu}^{R*}W}=-\frac{1}{2}g_2\tilde{L}_i\tilde{\nu}^{R*}_j \sum_{a=1}^3Z^{E*}_{ia}Z^{R*}_{ja}(-p_{\mu}^{\tilde{\nu}_j^R}+p_\mu^{\tilde{L}_i})W^\mu +h.c,\nonumber\\&& \mathcal{L}_{\tilde{L}\tilde{\nu}^{I*}W}=\frac{i}{2}g_2\tilde{L}_i\tilde{\nu}^{I*}_j \sum_{a=1}^3Z^{E*}_{ia}Z^{I*}_{ja}(-p_{\mu}^{\tilde{\nu}_j^I}+p_\mu^{\tilde{L}_i})W^\mu +h.c. \end{eqnarray} We also deduce the vertex couplings of neutrino-slepton-chargino and neutralino-lepton-slepton \begin{eqnarray} &&\mathcal{L}_{\bar{\nu}\chi^-\tilde{L}}=\bar{\nu}_i\Big((-g_2U^*_{j1}\sum_{a=1}^3U^{V*}_{ia}Z^E_{ka}+U^*_{j2}\sum_{a=1}^3U^{V*}_{ia}Y^a_lZ^E_{k(3+a)})P_L \nonumber\\&&\hspace{1.6cm}+\sum_{a,b=1}^3Y_{\nu}^{ab}U^V_{i(3+a)}Z^E_{kb}V_{j2}P_R\Big)\chi^-_j\tilde{L}_k, \\ &&\mathcal{L}_{\bar{\chi}^0l\tilde{L}}=\bar{\chi}^0_i\Big\{\Big(\frac{1}{\sqrt{2}}(g_1N^*_{i1}+g_2N^*_{i2}+g_{YX}N^*_{i5})Z^E_{kj} -N^*_{i3}Y^j_lZ^E_{k(3+j)}\Big)P_L\nonumber\\&&\hspace{1.6cm} -\Big[\frac{1}{\sqrt{2}}\Big(2g_1N_{i1}+(2g_{YX}+g_X)N_{i5}\Big)Z^E_{k(3+a)}+Y_{l}^jZ^E_{kj}N_{i3}\Big]P_R\Big\}l_j\tilde{L}_k. \end{eqnarray} The other needed couplings can be found in our previous works\cite{ZSMJHEP,slh}. \section{formulation} For the process $l^I\rightarrow l^I+\gamma$, the Feynman amplitude can be expressed by these dimension 6 operators \cite{lepton} with the effective Lagrangian method. For muon MDM, the dimension 8 operators are suppressed by additional factor $\frac{m_{\mu}^2}{M_{SUSY}^2}$ $\sim$ ($10^{-7}$, $10^{-8}$) and are neglected safely. These dimension 6 operators are shown as \begin{eqnarray} &&\mathcal{O}_1^{L,R}=\frac{1}{(4\pi)^2}\bar{l}(i\mathcal{D}\!\!\!\slash)^3P_{L,R}l,~~~~~~~~~~~~~~ \mathcal{O}_2^{L,R}=\frac{eQ_f}{(4\pi)^2}\overline{(i\mathcal{D}_{\mu}l)}\gamma^{\mu} F\cdot\sigma P_{L,R}l, \nonumber\\ &&\mathcal{O}_3^{L,R}=\frac{eQ_f}{(4\pi)^2}\bar{l}F\cdot\sigma\gamma^{\mu} P_{L,R} (i\mathcal{D}_{\mu}l),~~~~\mathcal{O}_4^{L,R}=\frac{eQ_f}{(4\pi)^2}\bar{l}(\partial^{\mu}F_{\mu\nu})\gamma^{\nu} P_{L,R}l,\nonumber\\&& \mathcal{O}_5^{L,R}=\frac{m_l}{(4\pi)^2}\bar{l}(i\mathcal{D}\!\!\!\slash)^2P_{L,R}l, ~~~~~~~~~~~~~~\mathcal{O}_6^{L,R}=\frac{eQ_fm_l}{(4\pi)^2}\bar{l}F\cdot\sigma P_{L,R}l, \end{eqnarray} with $\mathcal{D}_{\mu}=\partial_{\mu}+ieA_{\mu}$ and $P_{L,R}=\frac{1\mp\gamma_5}{2}$. $F_{{\mu\nu}}$ is the electromagnetic field strength, and $m_{l}$ is the lepton mass. The operators $\mathcal{O}_{2,3,6}^{L,R}$ have relation with lepton MDM, which is the combination of the Wilson coefficients $C^{L,R}_{2,3,6}$. Using the on-shell condition for the external leptons, one can obtain lepton MDM from the following effective Lagrangian. \begin{eqnarray} &&{\cal L}_{{MDM}}={e\over4m_{l}}\;a_{l}\;\bar{l}\sigma^{\mu\nu} l\;F_{{\mu\nu}}\label{adm}. \end{eqnarray} \subsection{The one-loop corrections} In $U(1)_X$SSM, the one-loop self-energy diagrams of lepton are shown in the Fig.\ref{onelooptu}. Attaching a photon on the internal lines of the one-loop self-energy diagram in all possible way, one can obtain the triangle diagrams for $l\rightarrow l+\gamma$. \begin{figure}[h] \setlength{\unitlength}{1mm} \centering \includegraphics[width=3.6in]{one-loops.eps} \caption[]{ The one-loop self-energy diagrams \label{onelooptu}} \end{figure} The analytic forms of the one-loop contributions are collected here. 1. The corrections from neutralinos and scalar leptons \begin{eqnarray} &&a_{\mu}^{1L,~\tilde{L}\chi^{0}}= -\sum_{k=1}^6\sum_{j=1}^8\Big[\Re(A_L^*A_R) \sqrt{x_{\chi_j^{0}}x_{\mu}}x_{\tilde{L}_k}\frac{\partial^2 \mathcal{B}(x_{\chi_j^{0}},x_{\tilde{L}_k})}{\partial x_{\tilde{L}_k}^2} \nonumber\\&&\hspace{1.4cm}+\frac{1}{3}(|A_L|^2+|A_R|^2)x_{\tilde{L}_k}x_{\mu} \frac{\partial\mathcal{B}_1(x_{\chi_j^{0}},x_{\tilde{L}_k})}{\partial x_{\tilde{L}_k}}\Big]. \end{eqnarray} with $x=\frac{m^2}{\Lambda^2}$. Here, $m$ is the particle mass. The concrete forms of $A_R$ and $A_L$ read as \begin{eqnarray} &&A_R=\frac{1}{\sqrt{2}}Z_{k2}^{E}(g_1N_{j1}^{*}+g_2N_{j2}^{*}+g_{YX}N_{j5}^{*}) -N_{j3}^{*}Y_\mu Z_{k5}^{E},\nonumber\\&& A_L=-\frac{1}{\sqrt{2}}Z_{k5}^{E}[2g_1N_{j1}+(2g_{YX}+g_X)N_{j5}]-Y_\mu^{*}Z_{k2}^EN_{j3}. \end{eqnarray} We show the functions $\mathcal{B}(x,y)$ and $\mathcal{B}_1(x,y)$ explicitly \begin{eqnarray} \mathcal{B}(x,y)=\frac{1}{16 \pi ^2}\Big(\frac{x \ln x}{y-x}+\frac{y \ln y}{x-y}\Big),~~~ \mathcal{B}_1(x,y)=( \frac{\partial}{\partial y}+\frac{y}{2}\frac{\partial^2 }{\partial y^2})\mathcal{B}(x,y). \end{eqnarray} 2. The corrections from chargino and CP-odd scalar neutrino \begin{eqnarray} &&a_{\mu}^{1L,~\tilde{\nu}^I\chi^{\pm}}=\sum_{i=1}^2\sum_{k=1}^6 \Big[-2\Re(B_L^{*}B_R)\sqrt{x_{\chi_i^{-}}x_\mu}\mathcal{B}_1(x_{\tilde{\nu}^I_k},x_{\chi_i^{-}}) \nonumber\\&&\hspace{1.8cm}+\frac{1}{3}(|B_L|^2+|B_R|^2)x_\mu x_{\chi_i^{-}}\frac{\partial\mathcal{B}_1(x_{\tilde{\nu}^I_k},x_{\chi_i^{-}})}{\partial x_{\chi_i^{-}}}\Big]. \nonumber\\&& B_L=-\frac{1}{\sqrt{2}}U_{i2}^{*}Z_{k2}^{I*}Y_\mu,~~~ B_R=\frac{1}{\sqrt{2}}g_2Z_{k2}^{I*}V_{i1}. \end{eqnarray} 3. The corrections from chargino and CP-even scalar neutrino \begin{eqnarray} &&a_{\mu}^{1L,~\tilde{\nu}^R\chi^{\pm}}=\sum_{i=1}^2\sum_{k=1}^6 \Big[-2\Re(C_L^{*}C_R)\sqrt{x_{\chi_i^{-}}x_\mu}\mathcal{B}_1(x_{\tilde{\nu}^R_k},x_{\chi_i^{-}}) \nonumber\\&&\hspace{1.8cm}+\frac{1}{3}(|C_L|^2+|C_R|^2)x_\mu x_{\chi_i^{-}}\frac{\partial\mathcal{B}_1(x_{\tilde{\nu}^R_k},x_{\chi_i^{-}})}{\partial x_{\chi_i^{-}}}\Big]. \nonumber\\&& C_L=\frac{1}{\sqrt{2}}U_{i2}^{*}Z_{k2}^{R*}Y_\mu,~~~ C_R=-\frac{1}{\sqrt{2}}g_2Z_{k2}^{R*}V_{i1}. \end{eqnarray} 4. The corrections from the new vector boson $Z^\prime$ and lepton. The mass of $Z^\prime$ are very heavy, and we take $m_{Z^\prime}$ larger than 5.1 TeV. Comparing with Z-lepton one-loop contribution, the corresponding contributions from $Z^\prime$-lepton are suppressed by the factor $\frac{m_Z^2}{m^2_{Z^\prime}}\sim 4\times 10^{-4}$. Therefore, we neglect $Z^\prime$-lepton one-loop contribution. 5. The neutral Higgs-lepton and charged Higgs-neutrino contributions are suppressed by the square of the Higgs-lepton coupling $\frac{m_{\mu}^2}{m^2_W}\sim10^{-6}$. As discussed in Ref.\cite{our}, these type contributions are neglected. The one-loop contributions to muon g-2 can be expressed as \begin{eqnarray} a_\mu^{1L}=a_{\mu}^{1L,~\tilde{L}\chi^{0}}+a_{\mu}^{1L,~\tilde{\nu}^R\chi^{\pm}}+a_{\mu}^{1L,~\tilde{\nu}^I\chi^{\pm}}. \end{eqnarray} For the one-loop contributions, in fact the factor does not represent an enhancement proportional to $m_\chi/m_\mu$, because it is suppressed by the combined rotation matrixes. In the end, they produce an overall enhancement factor $\tan\beta$\cite{dabeta1,dabeta2}. The similar condition is also for the two-loop contributions. The apparent factor $m_\chi/m_\mu$ in the two-loop corrections is also suppressed by the combined rotation matrixes and can not yield enhancement proportional to $m_\chi/m_\mu$ in the total analysis. To show the factor more clearly, we give the one-loop corrections with the mass insertion approximation (MIA)\cite{wx1,wx7,dabeta1,MIAhao}. These approximations indeed clarify the major parameter dependence (the appearance of $\tan\beta$ instead of $m_\chi/m_\mu$). Here, using MIA we obtain the concrete forms of the one-loop g-2 results in $U(1)_X$SSM. 1. The one-loop contributions from chargino and CP-even(odd) sneutrino. \begin{eqnarray} &&a_\mu(\tilde{\nu}^R_L, \tilde{H}^-, \tilde{W}^-) =\frac{g_2^2}{2} x_\mu\sqrt{x_2x_{\mu^{\prime}_H}}\tan\beta[2\mathcal{I}(x_{\mu^{\prime}_H},x_{\tilde{\nu}^R_L},x_2) -\mathcal{J}(x_2,x_{\mu^{\prime}_H},x_{\tilde{\nu}^R_L}) \nonumber\\&&\hspace{3.8cm}+2\mathcal{I}(x_2,x_{\tilde{\nu}^R_L},x_{\mu^{\prime}_H}) -\mathcal{J}(x_{\mu^{\prime}_H},x_2,x_{\tilde{\nu}^R_L})]\label{MIARC}, \\&&a_\mu(\tilde{\nu}^I_L, \tilde{H}^-, \tilde{W}^-) =\frac{g_2^2}{2} x_\mu\sqrt{x_2x_{\mu^{\prime}_H}}\tan\beta[2\mathcal{I}(x_{\mu^{\prime}_H},x_{\tilde{\nu}^I_L},x_2) -\mathcal{J}(x_2,x_{\mu^{\prime}_H},x_{\tilde{\nu}^I_L}) \nonumber\\&&\hspace{3.8cm}+2\mathcal{I}(x_2,x_{\tilde{\nu}^I_L},x_{\mu^{\prime}_H}) -\mathcal{J}(x_{\mu^{\prime}_H},x_2,x_{\tilde{\nu}^I_L})]\label{MIAIC}. \end{eqnarray} with $\mu_{H}^\prime=\frac{\lambda_H v_S}{\sqrt{2}}+\mu$ and $x_{\mu^{\prime}_H}=\frac{\mu_{H}^{\prime2}}{\Lambda^2}$. The one-loop functions $\mathcal{I}(x,y,z)$ and $\mathcal{J}(x,y,z)$ read as \begin{eqnarray} &&\mathcal{J}(x,y,z)=\frac{1}{16\pi^2}\Big[\frac{x (x^2+x z-2 y z)\log x}{(x-y)^2 (x-z)^3}-\frac{y^2 \log y}{(x-y)^2 (y-z)^2}\nonumber\\&&\hspace{1.8cm}+\frac{z[x (z-2 y)+z^2] \log z}{(z-x)^3 (y-z)^2}-\frac{x (y-2 z)+y z}{(x-y) (x-z)^2 (y-z)}\Big]. \\&&\mathcal{I}(x,y,z)=\frac{1}{16\pi^2}\Big[\frac{1}{(x-z) (z-y)}+\frac{(z^2-x y)\log z}{(x-z)^2 (y-z)^2}\nonumber\\&&\hspace{1.8cm}-\frac{x \log x}{(x-y) (x-z)^2}+\frac{y \log y}{(x-y) (y-z)^2}\Big]. \end{eqnarray} 2. The one-loop contributions from $\tilde{B}(\lambda_{\tilde{X}})$-$\tilde{\mu}_L$-$\tilde{\mu}_R$. \begin{eqnarray} &&a_\mu(\tilde{\mu}_R,\tilde{\mu}_L, \tilde{B})= g_1^2x_\mu\sqrt{x_1x_{\mu^{\prime}_H}} \tan\beta[\mathcal{J}(x_1,x_{\tilde{\mu}_L},x_{\tilde{\mu}_R}) +\mathcal{J}(x_1,x_{\tilde{\mu}_R},x_{\tilde{\mu}_L})]\label{MIABLR} .\\ &&a_\mu(\tilde{\mu}_R,\tilde{\mu}_L, \lambda_{\tilde{X}}) =(g_{YX}^2 +\frac{g_Xg_{YX}}{2})x_\mu\sqrt{x_{\lambda_{\tilde{X}}}x_{\mu^{\prime}_H}}\tan\beta \nonumber\\&&\hspace{3.0cm}\times[\mathcal{J}(x_{\lambda_{\tilde{X}}}^2,x_{\tilde{\mu}_L},x_{\tilde{\mu}_R}) +\mathcal{J}(x_{\lambda_{\tilde{X}}}^2,x_{\tilde{\mu}_R},x_{\tilde{\mu}_L})]\label{MIAXLR}. \end{eqnarray} 3. The one-loop contributions from $\tilde{B}(\lambda_{\tilde{X}})$-$\tilde{H}^0$-$\tilde{\mu}_R$. \begin{eqnarray} &&a_\mu(\tilde{\mu}_R, \tilde{B}, \tilde{H}^0) =-g_1^2x_\mu\sqrt{x_1x_{\mu^{\prime}_H}}\tan\beta[ \mathcal{J}(x_1^2,x_{\mu^{\prime}_H},x_{\tilde{\mu}_R})+\mathcal{J}(x_{\mu^{\prime}_H},x_1^2,x_{\tilde{\mu}_R})]\label{MIAHBR}, \\&&a_\mu(\tilde{\mu}_R, \lambda_{\tilde{X}}, \tilde{H}^0) =-(g_{YX}+\frac{g_X}{2})(g_{YX}+g_X)x_\mu\sqrt{x_{\lambda_{\tilde{X}}}x_{\mu^{\prime}_H}}\tan\beta \nonumber\\&&\hspace{3.2cm}\times[\mathcal{J}(x_{\lambda_{\tilde{X}}},x_{\mu^{\prime}_H},x_{\tilde{\mu}_R}) +\mathcal{J}(x_{\mu^{\prime}_H},x_{\lambda_{\tilde{X}}},x_{\tilde{\mu}_R})]\label{MIAHXR}. \end{eqnarray} 4. The one-loop contributions from $\tilde{B}(\tilde{W}^0,\lambda_{\tilde{X}})$-$\tilde{H}^0$-$\tilde{\mu}_L$. \begin{eqnarray} &&a_\mu(\tilde{\mu}_L, \tilde{H}^0, \tilde{B}) =\frac{1}{2}g_1^2x_\mu\sqrt{x_1x_{\mu^{\prime}_H}}\tan\beta[ \mathcal{J}(x_1,x_{\mu^{\prime}_H},x_{\tilde{\mu}_L})+\mathcal{J}(x_{\mu^{\prime}_H},x_1,x_{\tilde{\mu}_L})]\label{MIABHL}, \\&&a_\mu(\tilde{\mu}_L, \tilde{H}^0, \tilde{W}^0)=-\frac{1}{2}g_2^2 x_\mu\sqrt{x_2x_{\mu^{\prime}_H}}\tan\beta[ \mathcal{J}(x_2,x_{\mu^{\prime}_H},x_{\tilde{\mu}_L})+\mathcal{J}(x_{\mu^{\prime}_H},x_2,x_{\tilde{\mu}_L})]\label{MIAWHL}, \\&&a_\mu(\tilde{\mu}_L, \tilde{H}^0, \lambda_{\tilde{X}}) =\frac{1}{2}(g_{YX}+g_X)g_{YX}x_\mu\sqrt{x_{\lambda_{\tilde{X}}}x_{\mu^{\prime}_H}}\tan\beta\nonumber\\&&\hspace{3cm}\times [\mathcal{J}(x_{\lambda_{\tilde{X}}},x_{\mu^{\prime}_H},x_{\tilde{\mu}_L})+ \mathcal{J}(x_{\mu^{\prime}_H},x_{\lambda_{\tilde{X}}},x_{\tilde{\mu}_L})]\label{MIAXHL}. \end{eqnarray} 5. The one-loop contributions from $\tilde{B}-\lambda_{\tilde{X}}-\tilde{\mu}_R-\tilde{\mu}_L$. \begin{eqnarray} &&a_\mu(\tilde{\mu}_R,\tilde{\mu}_L, \tilde{B}, \lambda_{\tilde{X}}) =g_1(4g_{YX}+g_X)x_\mu \sqrt{x_{BB^\prime}x_{\mu^\prime_H}}\tan\beta \nonumber\\&&\times\Big(\sqrt{x_1x_{\lambda_{\tilde{X}}}} f(x_{\lambda_{\tilde{X}}},x_1,x_{\tilde{\mu}_L},x_{\tilde{\mu}_R}) -g(x_{\lambda_{\tilde{X}}},x_1,x_{\tilde{\mu}_L},x_{\tilde{\mu}_R}) \Big)\label{MIAXBLR}. \end{eqnarray} We show the one loop functions $f(x,y,z,t)$ and $g(x,y,z,t)$ in the following form \begin{eqnarray} &&f(x,y,z,t)= \frac{1}{16\pi^2}\Big[\frac{t [t^3-3 t x y+x y (x+y)]\log t}{(t-x)^3 (t-y)^3 (t-z)}-\frac{x[x^3-3 t x z+t z (t+z)] \log x }{(t-x)^3 (x-y) (x-z)^3}\nonumber\\&&+\frac{y [y^3-3 t y z+t z (t+z)]\log y}{(t-y)^3 (x-y) (y-z)^3}-\frac{z[z^3-3 x y z+x y (x+y)] \log z}{(t-z) (z-x)^3 (z-y)^3}+\frac{1}{2 (x-y)}\nonumber\\&&\times\Big(\frac{t}{(t-x)^2 (z-x)}-\frac{2y}{(t-y) (y-z)^2}+\frac{x (2 t-3 x+z)}{(t-x)^2 (x-z)^2}+\frac{t+y}{(t-y)^2 (y-z)}\Big)\Big], \\&&g(x,y,z,t)=\frac{1}{16\pi^2}\Big\{-\frac{t [t^3 (x+y)-3 t^2 x y+x^2 y^2]\log t }{(t-x)^3 (t-y)^3 (t-z)}\nonumber\\&&+\frac{z [x^2 y^2+x z^2 (z-3 y)+y z^3]\log z }{(t-z) (z-x)^3 (z-y)^3}+\frac{x^2[x^3-3 t x z+t z (t+z)] \log x}{(t-x)^3 (x-y) (x-z)^3}\nonumber\\&&-\frac{y^2 [y^3-3 t y z+t z (t+z)]\log y }{(t-y)^3 (x-y) (y-z)^3}-\frac{x^2 (2 t-3 x+z)}{2(t-x)^2 (x-y) (x-z)^2}\nonumber\\&&+\frac{t x}{2(t-x)^2 (x-y) (x-z)}-\frac{y [t (y+z)+y (z-3 y)]}{2(t-y)^2 (y-x) (y-z)^2}\Big\}. \end{eqnarray} In Eqs.(\ref{MIARC}), (\ref{MIAIC}), (\ref{MIABLR}) $\dots$ (\ref{MIAXBLR}), one can easily find the factors $x_\mu=\frac{m_\mu^2}{\Lambda^2}$ and $\tan\beta$. This characteristic is same as the condition in MSSM. The contributions relating with the new gaugino $\lambda_{\tilde{X}}$ are shown in Eqs.(\ref{MIAXLR}), (\ref{MIAHXR}), (\ref{MIAXHL}), (\ref{MIAXBLR}), which include the new gauge coupling constants $g_X$ and $g_{YX}$. To obtain clearer images of the results, we suppose that all the masses of the superparticles are almost degenerate. The author\cite{dabeta1} gives the one-loop MSSM results(chargino-sneutrino, neutralino-slepton) in the extreme case where the masses for superparticles$(M_1, M_2, \mu_H, m_{\tilde{\mu}_L}, m_{\tilde{\mu}_R})$ are equal to $M_{SUSY}$ \begin{eqnarray} a^{MSSM}_{\mu}\simeq\frac{1}{192\pi^2}\frac{m_\mu^2}{M_{SUSY}^2}\tan\beta(5g_2^2+g_1^2).\label{amumssm} \end{eqnarray} Here, we also use the similar case \[M_1=M_2=\mu_H^\prime=m_{\tilde{\mu}_L} =m_{\tilde{\mu}_R}=|M_{\lambda_{\tilde{X}}}|=|M_{BB^\prime}|=M_{SUSY},\] and the four functions $\mathcal{I}(x,y,z),~\mathcal{J}(x,y,z),~f(x,y,z,t),~g(x,y,z,t)$ are much simplified as \begin{eqnarray} &&\mathcal{J}(1,1,1)=\frac{1}{192\pi^2},~~~~~~~~ \mathcal{I}(1,1,1)= \frac{1}{96\pi^2},\nonumber\\&& f(1,1,1,1)= -\frac{1}{240 \pi^2 },~~~~g(1,1,1,1)= -\frac{1}{960 \pi ^2}. \end{eqnarray} In this condition, we obtain the much simplified one-loop results of muon g-2 in $U(1)_X$SSM. \begin{eqnarray} &&a^{1L}_\mu\simeq \frac{1}{192\pi^2}\frac{m_\mu^2}{M_{SUSY}^2}\tan\beta(5g_2^2+g_1^2)\nonumber\\&& +\frac{1}{960\pi^2}\frac{m_\mu^2}{M_{SUSY}^2}\tan\beta\Big[5(g_{YX}^2-g_{YX}g_X-g_X^2)\texttt{sign}[M_{\lambda_{\tilde{X}}}] \nonumber\\&&+g_1(4g_{YX}+g_X)\texttt{sign}[M_{BB^\prime}] \Big(1-4\texttt{sign}[M_{\lambda_{\tilde{X}}}]\Big)\Big].\label{amuS} \end{eqnarray} The terms in the first line of Eq.(\ref{amuS}) is equal to the MSSM results in Eq.(\ref{amumssm}). From this equation, we can see the new gaugino $\lambda_{\tilde{X}}$ can give considerable corrections to $a_\mu$. In the condition $1>g_X>g_{YX}>0$ and with the supposition $\texttt{sign}[M_{\lambda_{\tilde{X}}}]=-1$ and $\texttt{sign}[M_{BB^\prime}]=1$, the corrections beyond MSSM can reach large value. \begin{eqnarray} &&a^{1L}_\mu\rightarrow\frac{1}{192\pi^2}\frac{m_\mu^2}{M_{SUSY}^2}\tan\beta\Big[(5g_2^2+g_1^2) +(g_{YX}g_X+g_X^2 -g_{YX}^2+4g_1g_{YX}+g_1g_X)\Big]. \end{eqnarray} Here, the order analysis shows \begin{eqnarray} 0<\frac{g_{YX}g_X+g_X^2 -g_{YX}^2+4g_1g_{YX}+g_1g_X}{5g_2^2+g_1^2}\lesssim 1. \end{eqnarray} Then the $U(1)_X$SSM contributions beyond MSSM are considerable. \subsection{The two-loop corrections} In this work, we study major two-loop diagram contributions to muon MDM. The researched two-loop self-energy diagrams include: 1. the two-loop Barr-Zee type diagrams with fermion sub-loop, 2. the two-loop rainbow diagrams with fermion sub-loop and the vector bosons($\gamma$, Z, W). 3. the diamond type diagrams in Ref.\cite{two2,our} possessing large factors. These diagrams are shown in the Fig.\ref{twolooptu}. We give the explanation why the particular subset of diagrams is chosen. 1. Fig.\ref{twolooptu}(a), Fig.\ref{twolooptu}(b) and Fig.\ref{twolooptu}(c) are the two-loop Barr-Zee type diagrams, and their contributions to muon MDM are studied particularly in the work\cite{other2}. On the supposition $\chi^\pm\sim\chi^0\sim M$, we can obtain very concise results with the factor $\frac{x_\mu}{x_M^{1/2}x_V^{1/2}}=\frac{m^2_\mu}{Mm_V}$. $m_V$ represents the mass of heavy vector bosons $m_Z\sim m_W\sim m_V$. The factor $\frac{m_\mu}{m_V}$ comes from the Higgs lepton vertex $\bar{\mu}-H-\mu$. This type contributions are considerable. 2. The rainbow diagrams (Fig.\ref{twolooptu}(d) and Fig.\ref{twolooptu}(e)) with heavy fermion sub-loop and two vector bosons ZZ(WW, Z$\gamma$, $\gamma\gamma$) can give important corrections to muon MDM\cite{ffa,lepton}. 3. The two-loop self-energy diagrams (Fig.\ref{twolooptu}(f), $\dots$, Fig.\ref{twolooptu}(j)) belong to the diamond type, where the vector boson couples with external lepton. This type two-loop diagram studied in this work contains five virtual particles including: one vector boson, two scalars and two fermions. The corresponding contributions to muon MDM possess two unique factors: $\frac{x_l^{1/2}}{x_M^{1/2}}$ and $\frac{x_l}{x_V}$. It should be noted that, the total effects from the factor $\frac{x_l^{1/2}}{x_M^{1/2}}$ and the rotation matrixes change into the factor $\frac{x_l}{x_M}\tan\beta$ in the end. It is similar as the condition of the one-loop results\cite{dabeta2}. These diagrams can also give considerable corrections. \begin{figure}[h] \setlength{\unitlength}{1mm} \centering \includegraphics[width=4.6in]{two-loops.eps} \caption[]{ The two-loop self-energy diagrams \label{twolooptu}} \end{figure} In fact, there are so many two-loop diagrams that we can not calculate all of them in one work. Furthermore, the calculation of the two-loop diagrams is very tedious. So, we study the two-loop SUSY diagrams step by step, and calculate several types of two-loop diagrams giving important contributions to muon MDM. Other two-loop diagrams will be researched in our future work. To obtain the corrections to muon MDM from these two-loop diagrams, we have to resolve the complicated two-loop integrals. The required steps are the following: $\bullet$ We use "momentum expansion" method \cite{zhkrp}, and assume that all external leptons as well as photon are off-shell, then expand the amplitude of corresponding triangle diagrams according to the external momenta of leptons and photon\cite{other2,fengtf04}. We expand them in powers of external momenta to the second order. The even rank tensors in the loop momenta $k_1$, $k_2$ are kept. $\bullet$ To simplify the calculation, we use the following formulas of the loop momenta $k_1$ and $k_2$\cite{other2,fengtf04}. {\small \begin{eqnarray} &&\int\!\!\!\frac{d^Dk_1d^Dk_2}{(2\pi)^{2D}}\frac{(k_{1\mu}k_{1\nu},~k_{1\mu}k_{2\nu})}{\mathcal{D}_0} \rightarrow \int\!\!\!\frac{d^Dk_1d^Dk_2}{(2\pi)^{2D}} \frac{(k^2,~k_1\cdot k_2)g_{\mu\nu}}{D\mathcal{D}_0}, \nonumber\\ &&\int\!\!\!\frac{d^Dk_1d^Dk_2}{(2\pi)^{2D}}\frac{(k_{1\mu}k_{1\nu}k_{1\rho}k_{1\sigma},~k_{1\mu}k_{1\nu}k_{1\rho}k_{2\sigma})}{\mathcal{D}_0} \rightarrow\int\!\!\!\frac{d^Dk_1d^Dk_2}{(2\pi)^{2D}}\frac{(k_1^4,~k_1^2k_1\cdot k_2)T_{\mu\nu\rho\sigma}}{D(D+2)\mathcal{D}_0},\nonumber\\ &&\int\!\!\!\frac{d^Dk_1d^Dk_2}{(2\pi)^{2D}}\frac{k_{1\mu}k_{1\nu}k_{2\rho}k_{2\sigma} }{\mathcal{D}_0}\nonumber\\ &&\rightarrow\int\frac{d^Dk_1d^Dk_2}{(2\pi)^{2D}}\frac{1}{\mathcal{D}_0} \Big(\frac{D(k_1\cdot k_2)^2-k_1^2k_2^2}{D(D-1)(D+2)}T_{\mu\nu\rho\sigma}-\frac{(k_1\cdot k_2)^2-k_1^2k_2^2}{D(D-1)}g_{\mu\nu}g_{\rho\sigma}\Big), \nonumber\\ &&\int\!\!\!\frac{d^Dk_1d^Dk_2}{(2\pi)^{2D}}\frac{k_{1\mu}k_{1\nu}k_{1\rho}k_{1\sigma} k_{2\alpha}k_{2\beta}}{\mathcal{D}_0}\nonumber\\ &&\rightarrow\int\!\!\!\frac{d^Dk_1d^Dk_2}{(2\pi)^{2D}}\frac{1}{\mathcal{D}_0} \Big(\frac{D(k_1\cdot k_2)^2k_1^2-k_1^4k_2^2}{D(D+2)(D+4)(D-1)}T_{\alpha\beta\mu\nu\rho\sigma}-\frac{(k_1\cdot k_2)^2k_1^2-k_1^4k_2^2}{D(D+2)(D-1)}g_{\alpha\beta}T_{\mu\nu\rho\sigma}\Big),\nonumber\\ &&\int\frac{d^Dk_1d^Dk_2}{(2\pi)^{2D}}\frac{k_{1\mu}k_{1\nu}k_{1\rho}k_{2\sigma} k_{2\alpha}k_{2\beta}}{\mathcal{D}_0}\nonumber\\ &&\rightarrow\int\!\!\!\frac{d^Dk_1d^Dk_2}{(2\pi)^{2D}}\frac{1}{\mathcal{D}_0} \Big(\frac{(D+1)k_1^2k_2^2(k_1\cdot k_2)-2(k_1\cdot k_2)^3}{D(D+2)(D+4)(D-1)}T_{\alpha\beta\mu\nu\rho\sigma}-\frac{k_1^2k_2^2(k_1\cdot k_2)-(k_1\cdot k_2)^3}{D(D+2)(D-1)}\nonumber\\ &&\times[g_{\mu\sigma}(g_{\nu\alpha} g_{\rho\beta}+g_{\nu\beta}g_{\rho\alpha})+g_{\mu\alpha}(g_{\nu\sigma}g_{\rho\beta} +g_{\nu\beta}g_{\rho\sigma})+g_{\mu\beta}(g_{\nu\sigma}g_{\rho\alpha} +g_{\nu\alpha}g_{\rho\sigma})]\Big)\label{tihuan}, \end{eqnarray}} where the time-space dimension $D=4-2\epsilon$. The concrete forms of $T_{\mu\nu\rho\sigma}$, $T_{\mu\nu\rho\sigma\alpha\beta}$ and $\mathcal{D}_0$ are \begin{eqnarray} &&T_{\mu\nu\rho\sigma}=g_{\mu\nu}g_{\rho\sigma}+g_{\mu\rho}g_{\nu\sigma} +g_{\mu\sigma}g_{\nu\rho},\nonumber\\&& T_{\mu\nu\rho\sigma\alpha\beta}=g_{\mu\nu}T_{\rho\sigma\alpha\beta}+g_{\mu\rho}T_{\nu\sigma\alpha\beta} +g_{\mu\sigma}T_{\nu\rho\alpha\beta}+g_{\mu\alpha}T_{\nu\rho\sigma\beta}+g_{\mu\beta}T_{\nu\rho\sigma\alpha},\nonumber\\&& \mathcal{D}_0=(k_1^2-m_1^2)(k_2^2-m_2^2)\Big((k_1-k_2)^2-m_0^2\Big). \end{eqnarray} $\bullet$ Because the integrations are symmetric under the transformation $k_{1,2}\rightarrow-k_{1,2}$, we abandon the odd rank terms in the loop momenta. With the decomposition formula \begin{eqnarray} &&\frac{1}{(k^2-m_1^2)}\frac{1}{(k^2-m_2^2)}=\frac{1}{m_1^2-m_2^2}\left( \frac{1}{k^2-m_1^2}-\frac{1}{k^2-m_2^2}\right)\label{chai},\nonumber \\&& \frac{1}{(k^2-m^2)^n}=\frac{1}{(n-1)!}\left(\frac{\partial}{\partial m^2}\right)^{n-1}\frac{1}{k^2-m^2}\label{dao}, \end{eqnarray} the complicated two-loop integrals can be reduced to the simple form with one $1/\mathcal{D}_0$. All the two-loop integrations that we treat can be simplified to the two-loop vacuum integrals\cite{npb93tl} and one-loop integrals. $\bullet$ The two-loop vacuum integral is expressed as \begin{eqnarray} &&\Lambda_{{\rm RE}}^{4\epsilon}\int\int{d^Dk_1d^Dk_2\over(2\pi)^{2D}}{1\over (k_1^2-m_1^2)(k_2^2-m_2^2)((k_1-k_2)^2-m_0^2)} \nonumber\\&&= {\Lambda^2\over2(4\pi)^4}{\Gamma^2(1+\epsilon)\over(1-\epsilon)^2} \Big({4\pi x_{R}}\Big)^{2\epsilon} \Big\{-{1\over\epsilon^2}\Big(x_0+x_1+x_2\Big) +{1\over\epsilon}\Big(-(x_0+x_1+x_2)\nonumber\\&&+2(x_0\ln x_0+x_1\ln x_1+x_2\ln x_2)\Big) +2(x_0\ln x_0+x_1\ln x_1+x_2\ln x_2) \nonumber\\&&-2(x_0+x_1+x_2) -x_0\ln^2x_0-x_1\ln^2x_1-x_2\ln^2x_2-\Phi(x_0,x_1,x_2)\Big\}, \label{2l-vacuum} \end{eqnarray} with \begin{eqnarray} &&\Phi(x,y,z)=(x+y-z)\ln x\ln y+(x-y+z)\ln x\ln z \nonumber\\ &&\hspace{1.7cm}+(y+z-x)\ln y\ln z+{\rm sign}(\lambda^2)\sqrt{|\lambda^2|}\Psi(x,y,z)\;. \label{phi} \end{eqnarray} The concrete form of $\Psi(x,y,z)$ is: $1.~~\lambda^2>0,\;\sqrt{y}+\sqrt{z}<\sqrt{x}$: \begin{eqnarray} &&\Psi(x,y,z)=2\ln\Big({x+y-z-\lambda\over2x}\Big) \ln\Big({x-y+z-\lambda\over2x}\Big)-\ln{y\over x}\ln{z\over x} \nonumber\\ &&\hspace{2.2cm} -2L_{i_2}\Big({x+y-z-\lambda\over2x}\Big) -2L_{i_2}\Big({x-y+z-\lambda\over2x}\Big)+{\pi^2\over3}\;, \label{aeq2} \end{eqnarray} with $L_{i_2}(x)$ representing the spence function; $2.~~\lambda^2>0,\;\sqrt{x}+\sqrt{z}<\sqrt{y}$: \begin{eqnarray} &&\Psi(x,y,z)={\rm Eq.}(\ref{aeq2})(x\leftrightarrow y)\;; \label{aeq3} \end{eqnarray} $3.~~\lambda^2>0,\;\sqrt{x}+\sqrt{y}<\sqrt{z}$: \begin{eqnarray} &&\Psi(x,y,z)={\rm Eq.}(\ref{aeq2})(x\leftrightarrow z)\;; \label{aeq4} \end{eqnarray} $4.~~\lambda^2<0$: \begin{eqnarray} &&\Psi(x,y,z)=2\Big\{Cl_2\Big(2\arccos( {-x+y+z\over2\sqrt{yz}})\Big) +Cl_2\Big(2\arccos({x-y+z\over2\sqrt{xz}})\Big) \nonumber\\ &&\hspace{2.2cm} +Cl_2\Big(2\arccos({x+y-z\over2\sqrt{xy}})\Big)\Big\}\;, \label{aeq12} \end{eqnarray} with $Cl_2(x)$ denoting the Clausen function. With the supposition $z\ll x\sim y$, the function $\Phi(x,y,z)$ is much simplified as \begin{eqnarray} &&\Phi(x,y,z)\simeq 2 x \ln ^2x+z \Big(2 (\ln z-2)\ln x -\ln^2x+4 \ln z\Big)\nonumber\\&&\hspace{1.8cm} +\frac{z^2 (3 \ln x-3 \ln z+2)}{9 x}+\frac{z^3 (15 \ln x-15 \ln z+1)}{450 x^2}+\dots. \end{eqnarray} Here, we give an example for the calculation of the contributions to $a_\mu$ from the two-loop self-energy diagram. For Fig.\ref{twolooptu}(d), a closed heavy fermion loop is inserted into the self-energy of W gauge boson. The heavy fermions in the sub-loop are chargino and neutralino. In the Fig.\ref{wwst}, the diagrams Fig.\ref{wwst}(a), Fig.\ref{wwst}(b), Fig.\ref{wwst}(c) are the two-loop triangle diagrams and they have UV-divergent terms which are caused by the UV-divergent sub-diagrams. Their counter terms are denoted by the diagrams Fig.\ref{wwst}(d), Fig.\ref{wwst}(e) and Fig.\ref{wwst}(f) respectively. The UV-divergent term of Fig.\ref{wwst}(a) comes from the W one-loop self-energy diagram with heavy virtual fermion. Fig.\ref{wwst}(d) is the counter term of Fig.\ref{wwst}(a), whose condition is same as that of Fig.\ref{wwst}(e) and Fig.\ref{wwst}(b). In Fig.\ref{wwst}(c), $F_\alpha$ denotes chargino and $F_\beta$ represents neutralino. Its sub-loop is the one-loop diagram of the vertex $\gamma W^+W^-$ producing UV-divergent term. Fig.\ref{wwst}(f) represents the counter term of Fig.\ref{wwst}(c). \begin{figure}[h] \vspace{-1.5cm} \setlength{\unitlength}{1mm} \centering \includegraphics[width=7.0in]{ww.eps} \vspace{-17cm} \caption[]{The two-loop triangle diagrams with a closed heavy fermion sub-loop correspond to the two-loop self-energy diagram Fig.\ref{twolooptu}(d). The diagrams (d, e, f) give counter terms to cancel the UV-divergences produced from the UV-divergent sub-diagrams in (a, b, c) respectively.}\label{wwst} \end{figure} The sum of the Feynman amplitudes for diagrams in Fig.\ref{wwst} satisfies the Ward-identity, which is required by the QED gauge invariance \begin{eqnarray} &&q_\mu\Gamma^\mu_{{ WW}}(p,q)=e[\Sigma_{WW}(p+q) -\Sigma_{WW}(p)]\;, \end{eqnarray} with $\Gamma_{WW}^\mu$ denoting the sum of amplitudes for the diagrams Fig.\ref{wwst}(a), Fig.\ref{wwst}(b), Fig.\ref{wwst}(c). Correspondingly, $\Sigma_{WW}$ denotes the amplitude of W self-energy diagram. In general way, the unrenormalized W self-energy can be expressed as \begin{eqnarray} &&\Sigma_{\mu\nu}^{WW}(p,\Lambda_{{RE}})=\Lambda^2\mathcal{A}_0^{W}g_{\mu\nu}+\Big(\mathcal{A}_1^{W} +{p^2\over\Lambda^2}\mathcal{A}_2^{W}+\cdots\Big)(p^2g_{\mu\nu}-p_\mu p_\nu) \nonumber\\ &&\hspace{2.5cm} +\Big(\mathcal{B}_1^{W}+{p^2\over\Lambda^2}\mathcal{B}_2^{W}+\cdots\Big)p_\mu p_\nu. \label{eq-w1} \end{eqnarray} The form factors $\mathcal{A}_{0,1,2}^{W}$ and $\mathcal{B}_{1,2}^{W}$ are obtained after performing loop integration, and they are function of the virtual particle masses and renormalization scale. The counter terms of W self-energy are shown in the following form \begin{eqnarray} &&\Sigma_{{\mu\nu}}^{W,C}(p,\Lambda_{{RE}})=-\Big[\delta m_{W}^2(\Lambda_{{RE}}) +m_{W}^2\delta Z_{W}(\Lambda_{{ RE}})\Big]g_{\mu\nu} -\delta Z_{W}(\Lambda_{{RE}})\Big[p^2g_{\mu\nu}-p_\mu p_\nu\Big]. \label{eq-w2} \end{eqnarray} From $\Sigma_{\mu\nu}^{WW}(p,\Lambda_{{RE}})$ and $\Sigma_{{\mu\nu}}^{W,C}(p,\Lambda_{{RE}})$, one can obtain the renormalized self-energy \begin{eqnarray} &&\hat{\Sigma}_{{\mu\nu}}^{W}(p,\Lambda_{{RE}})= \Sigma_{{\mu\nu}}^W(p,\Lambda_{{ RE}}) +\Sigma_{{\mu\nu}}^{W,C}(p,\Lambda_{{RE}}). \end{eqnarray} The condition for the on-shell external gauge boson W reads as \begin{eqnarray} &&\hat{\Sigma}_{{\mu\nu}}^{W}(p,m_{{W}})\epsilon^\nu(p)\Big|_{p^2=m_{W}^2}=0 \;,\nonumber\\ &&\lim\limits_{p^2\rightarrow m_{W}^2}{1\over p^2-m_{W}^2} \hat{\Sigma}_{{\mu\nu}}^{W}(p,m_{W})\epsilon^\nu(p)=\epsilon_{\mu}(p)\;, \label{eq-w4} \end{eqnarray} with $\epsilon(p)$ denoting the polarization vector of W gauge boson. From Eq.(\ref{eq-w1}), Eq.(\ref{eq-w2}) and Eq.(\ref{eq-w4}), the counter terms for the W self-energy are deduced in on-shell scheme \begin{eqnarray} &&\delta Z_{W}(m_{W})=\mathcal{A}_1^{W}+x_{W}\mathcal{A}_2^{W},~~~ \delta m_{W}^{2}(m_{W})=\mathcal{A}_0^{W}\Lambda^2 -m_{W}^2\delta Z_{W}. \label{eq-w5} \end{eqnarray} There is the $\gamma W^+W^-$ vertex at tree level, whose counter term is derived in the following form \begin{eqnarray} &&i\delta C_{\gamma W^+W^-}=ie\cdot\delta Z_{W}(\Lambda_{RE}) \Big[g_{\mu\nu}(k_1-k_2)_\rho+g_{\nu\rho}(k_2-k_3)_\mu+g_{\rho\mu}(k_3-k_1)_\nu\Big]. \label{eq-w6} \end{eqnarray} Here, $k_1$ and $k_2$ denote the incoming momenta of $W^\pm$. While $k_3$ denotes the incoming momentum of photon. $\mu,\;\nu,\;\rho$ are the corresponding Lorentz indices. After tedious calculation, we obtain the analytic results of the diagrams in the Fig.\ref{wwst}, whose sum is finite and very complex. Because the full analytic results take up a lot of space, we do not show them here. In order to make the analytic results more concise and practice, the full analytic results are expended in the condition $m_{F_\alpha}\sim m_{F_\beta}\gg m_W\gg m_\mu$. In the end, the very complex results are much simplified and they are shown as $a^{2L,WW}_\mu$ in the following parts noted by Eq.(\ref{tlww}). In the similar way, the other two-loop diagrams are also deduced and expanded. In the end, the simplified analytic results are obtained and shown in this work. With the assumption $m_{F_1}=m_{F_2}\gg m_W$, the results \cite{ffa} for the Fig.\ref{twolooptu} (a) can be simplified as \begin{eqnarray} &&a_\mu^{2L,~WH}=\frac{eH_{\bar{\mu}H\nu}^L}{512\sqrt{2}\pi^4s_W}\sum_{F_1=\chi^{\pm}}\sum_{F_2=\chi^0}\frac{x_\mu^{1/2}}{ x^{1/2}_{F_1}}\Big\{\frac{199}{36}\Re(H_{H\bar{F}_1F_2}^LH_{W\bar{F}_2F_1}^L+H_{H\bar{F}_1F_2}^RH_{W\bar{F}_2F_1}^R) \nonumber\\&&\hspace{1.6cm}+\Big[\frac{13}{3}+2 (\ln{x_{F_1}}-\varrho_{1,1}(x_W,x_{H^\pm}))\Big]\Re(H_{H\bar{F}_1F_2}^LH_{W\bar{F}_2F_1}^R+H_{H\bar{F}_1F_2}^RH_{W\bar{F}_2F_1}^L) \nonumber\\ &&\hspace{1.6cm}+\Big[\frac{4}{3}(\ln{x_{F_1}}-\varrho_{1,1}(x_W,x_{H^\pm}))-\frac{16}{9}\Big]\Re(H_{H\bar{F}_1F_2}^LH_{W\bar{F}_2F_1}^L\hspace{-0.1cm} -\hspace{-0.1cm}H_{H\bar{F}_1F_2}^RH_{W\bar{F}_2F_1}^R) \nonumber\\ &&\hspace{1.6cm}+\Big[\frac{2}{9}-\frac{8}{3}(\ln{x_{F_1}}-\varrho_{1,1}(x_W,x_{H^\pm}))\Big]\Re(H_{H\bar{F}_1F_2}^LH_{W\bar{F}_2F_1}^R\hspace{-0.1cm} -\hspace{-0.1cm}H_{H\bar{F}_1F_2}^RH_{W\bar{F}_2F_1}^L)\Big\}, \\ &&a_\mu^{2L,~WG} =\frac{eH_{\bar{\mu}G\nu}^L}{512\sqrt{2}\pi^4s_W}\sum_{F_1=\chi^{\pm}}\sum_{F_2=\chi^0}\frac{x_\mu^{1/2}}{ x^{1/2}_{F_1}}\Big\{\frac{199}{36}\Re(H_{G\bar{F}_1F_2}^LH_{W\bar{F}_2F_1}^L+H_{G\bar{F}_1F_2}^RH_{W\bar{F}_2F_1}^R) \nonumber\\&&\hspace{1.6cm}+\Big[\frac{7}{3}+2 (\ln{x_{F_1}}-\ln x_W)\Big]\Re(H_{G\bar{F}_1F_2}^LH_{W\bar{F}_2F_1}^R+H_{G\bar{F}_1F_2}^RH_{W\bar{F}_2F_1}^L) \nonumber\\ &&\hspace{1.6cm}+\Big[\frac{4}{3}(\ln{x_{F_1}}-\ln x_W)-\frac{28}{9}\Big]\Re(H_{G\bar{F}_1F_2}^LH_{W\bar{F}_2F_1}^L\hspace{-0.1cm} -\hspace{-0.1cm}H_{G\bar{F}_1F_2}^RH_{W\bar{F}_2F_1}^R) \nonumber\\ &&\hspace{1.6cm}+\Big[\frac{26}{9}-\frac{8}{3}(\ln{x_{F_1}}-\ln x_W)\Big]\Re(H_{G\bar{F}_1F_2}^LH_{W\bar{F}_2F_1}^R\hspace{-0.1cm} -\hspace{-0.1cm}H_{G\bar{F}_1F_2}^RH_{W\bar{F}_2F_1}^L)\Big\}.\label{awg} \end{eqnarray} with $\varrho_{1,1}(x,y)=\frac{x\ln x-y\ln y}{x-y}$. The Feynman rules of F-H-F and F-W-F vertexes are written in the following form, \begin{eqnarray} &&\mathcal{L}_{H(G)\bar{F}_1F_2}=i\bar{F_1}(H_{H\bar{F}_1F_2}^{L}P_L+H_{H\bar{F}_1F_2}^{R}P_R)F_2H^{\pm} \nonumber\\&&\hspace{2.0cm}+i\bar{F_1}(H_{G\bar{F}_1F_2}^{L}P_L+H_{G\bar{F}_1F_2}^{R}P_R)F_2G^{\pm},\nonumber\\&& \mathcal{L}_{W\bar{F}_1F_2}=i\bar{F_1}(H_{W\bar{F}_1F_2}^{L}\gamma_\mu P_L+H_{W\bar{F}_1F_2}^{R}\gamma_\mu P_R)F_2W^{\pm\mu}. \end{eqnarray} One can find the concrete forms of $H_{H(G)\bar{F}_1F_2}^{L,R}$ and $H_{W\bar{F}_1F_2}^{L,R}$ in the Ref.\cite{slh}. Using similar assumption $m_{F_1}=m_{F_2}\gg m_{h^0}$, one can simplify the two-loop Barr-Zee type diagrams contributing to the muon MDM for the Figs. \ref{twolooptu} (b) and \ref{twolooptu} (c) \begin{eqnarray} &&a_\mu^{2L,~\gamma h^0}=\frac{e^2}{64\sqrt{2}\pi^4}H_{h^0\bar{\mu}\mu}\sum_{F_1=F_2=\chi^\pm}\frac{x_\mu^{1/2}}{ x^{1/2}_{F_1}} \Re(H_{h^0\bar{F}_1F_2}^L)\Big[1+\ln\frac{x_{F_1}}{x_{h^0}}\Big], \\ &&a_\mu^{2L,~Zh^0}=\frac{\sqrt{2}}{512\pi^4}\sum_{F_1=F_2=\chi^{\pm},\chi^0} H_{h^0\bar{\mu}\mu}\frac{x_\mu^{1/2}}{ x^{1/2}_{F_1}}\Big[\varrho_{1,1}(x_Z,x_{h^0})-\ln{x_{F_1}}-1\Big] \nonumber\\&&\hspace{1.6cm}\times(H^L_{Z\bar{\mu}\mu}+H^R_{Z\bar{\mu}\mu})\Re(H_{h^0\bar{F}_1F_2}^LH_{Z\bar{F}_2F_1}^L+H_{h^0\bar{F}_1F_2}^RH_{Z\bar{F}_2F_1}^R). \end{eqnarray} The couplings of the CP-odd neutral bosons(the neutral Goldstone boson) with fermions are written as \begin{eqnarray} &&\mathcal{L}_{A^0(G^0)\mu\mu}=\bar{l}H^{\gamma_5}_{A^0\bar{\mu}\mu}\gamma_5lA^0+\bar{l}H^{\gamma_5}_{G^0\bar{\mu}\mu}\gamma_5lG^0,\nonumber\\&& \mathcal{L}_{A^0(G^0)F_1F_2}=\bar{F}_1(H_{A^0\bar{F}_1F_2}^{L}P_L+H_{A^0\bar{F}_1F_2}^{R}P_R)F_2A^0\nonumber\\&&\hspace{2.2cm}+ \bar{F}_1(H_{G^0\bar{F}_1F_2}^{L}P_L+H_{G^0\bar{F}_1F_2}^{R}P_R)F_2G^0+h.c. \end{eqnarray} In the same way, the contributions of Fig. 2b and Fig. 2c with $A^0$ and $G^0$ instead of $h^0$ are obtained \begin{eqnarray} &&a_\mu^{2L,~\gamma A^0}=-\frac{e^2Q_{F_1}^2}{64\sqrt{2}\pi^4} \sum_{F_1=\chi^\pm}\frac{x_\mu^{1/2}}{ x^{1/2}_{F_1}} \Re(H^{\gamma_5}_{A^0\bar{\mu}\mu}H_{A^0\bar{F}_1F_1}^L)(1+\ln\frac{x_{F_1}}{x_{A^0}}),\label{aga} \\&& a_\mu^{2L,~\gamma G^0}=-\frac{e^2Q_{F_1}^2}{64\sqrt{2}\pi^4} \sum_{F_1=\chi^\pm}\frac{x_\mu^{1/2}}{ x^{1/2}_{F_1}} \Re(H^{\gamma_5}_{G^0\bar{\mu}\mu}H_{G^0\bar{F}_1F_1}^L)(1+\ln\frac{x_{F_1}}{x_{Z}}),\label{agg} \\ &&a_\mu^{2L,~ZA^0}=-\frac{\sqrt{2}}{256\pi^4}\sum_{F_1=F_2=\chi^{\pm},\chi^0} \frac{x_\mu^{1/2}}{ x^{1/2}_{F_1}}(H^L_{Z\bar{\mu}\mu}+H^R_{Z\bar{\mu}\mu}) \Re \Big((H_{A^0\bar{F}_1F_2}^LH_{Z\bar{F}_2F_1}^L\nonumber\\&&\hspace{1.6cm} +H_{A^0\bar{F}_1F_2}^RH_{Z\bar{F}_2F_1}^R)H^{\gamma_5}_{A^0\bar{\mu}\mu}\Big)[\varrho_{1,1}(x_Z,x_{A^0})-\ln{x_{F_1}}-1],\label{aza} \\&& a_\mu^{2L,~ZG^0}=-\frac{\sqrt{2}}{256\pi^4}\sum_{F_1=F_2=\chi^{\pm},\chi^0} \frac{x_\mu^{1/2}}{ x^{1/2}_{F_1}}(H^L_{Z\bar{\mu}\mu}+H^R_{Z\bar{\mu}\mu}) \nonumber\\&&\hspace{1.6cm}\times \Re [H^{\gamma_5}_{G^0\bar{\mu}\mu}(H_{G^0\bar{F}_1F_2}^LH_{Z\bar{F}_2F_1}^L +H_{G^0\bar{F}_1F_2}^RH_{Z\bar{F}_2F_1}^R)]\ln \frac{x_Z}{x_{F_1}}.\label{azg} \end{eqnarray} They have a suppression factor$\frac{m_\mu}{m_W}\sim\frac{x_\mu^{1/2}}{ x^{1/2}_{V}}$ from the vertex couplings $H_{\bar{\mu}G\nu}^L$, $H^{\gamma_5}_{A^0\bar{\mu}\mu}$, $H^{\gamma_5}_{G^0\bar{\mu}\mu}$ respectively. For the two-loop rainbow diagrams with two vector bosons $(\gamma,\gamma)$ and $(\gamma, Z)$, their contributions are simplified with the assumption $m_{F_1}=m_{F_2}\gg m_W\sim m_Z$, and the simplified results are suppressed by the small factor $\frac{x_{\mu}}{x_{F_1}}$, as discussed in Ref. \cite{our}. Therefore, we can neglect their corrections safely. With the same assumption, the two-loop rainbow diagrams with two vector bosons (W, W) are deduced here \begin{eqnarray} &&a_\mu^{2L,~WW}=\frac{e^2}{1536\pi^4s_W^2}\frac{x_\mu}{x_W}\sum_{F_1=\chi^{\pm}}\sum_{F_2=\chi^0} \Big\{-31(|H_{W\bar{F}_1F_2}^L|^2+|H_{W\bar{F}_1F_2}^R|^2) \nonumber\\ &&-12(|H_{W\bar{F}_1F_2}^L|^2-|H_{W\bar{F}_1F_2}^R|^2)+11\Re(H_{W\bar{F}_1F_2}^{R*}H_{W\bar{F}_1F_2}^L)\Big\}.\label{tlww} \end{eqnarray} In the similar way, the corrections from rainbow diagrams with two Z vector bosons are also simplified and only the terms with the largest factor $\frac{x_\mu}{x_Z}$ are kept. \begin{eqnarray} &&a_{\mu}^{2L,~ZZ}=\frac{1}{1024\pi^4} \frac{x_\mu}{x_Z}\sum_{F_1=F_2=\chi^\pm}\Big\{ -6\Big(|H^L_{Z\bar{F}_1F_2}|^2+|H^R_{Z\bar{F}_1F_2}|^2\Big)\Big(|H^L_{Z\bar{\mu}\mu}|^2 +|H^R_{Z\bar{\mu}\mu}|^2\Big)\nonumber\\&&\times(2\ln x_{F_1}+5) +16\Big(|H^L_{Z\bar{F}_1F_2}|^2+|H^R_{Z\bar{F}_1F_2}|^2\Big)H^L_{Z\bar{\mu}\mu}H^R_{Z\bar{\mu}\mu} [(\ln x_{F_1}+2)\ln \frac{x_{F_1}}{ x_Z} +2]\Big\}. \end{eqnarray} The diagrams of the form Fig. 2e with $Z\gamma~ (\gamma\gamma)$ exchange instead of $ZZ $ exchange are calculated\cite{slh,ffa} and the simplified results read as \begin{eqnarray} &&a_\mu^{2L,\gamma Z}=\frac{Q_{F_1}m_\mu^2e^2}{256\pi^4}(H^R_{Z\bar{\mu}\mu}-H^L_{Z\bar{\mu}\mu})\sum_{F_1=F_2=\chi^\pm} \frac{\Re(H_{Z\bar{F}_1F_2}^L-H_{Z\bar{F}_1F_2}^R)}{m_{F_1}^2} \Big[35+\ln\frac{x_{F_1}}{x_Z}\Big],\\&& a_\mu^{2L,\gamma\gamma}=\frac{e^4Q_{F_1}^2}{720\pi^4\sin^2\theta_W}\sum_{F_1=F_2=\chi^\pm}\frac{m_\mu^2}{m_{F_1}^2}. \end{eqnarray} The Figs.\ref{twolooptu}(f, g, h, i, j) have their H.C. diagrams, which give same contributions to muon MDM. So, we do not plot them here. After tedious calculation and simplification, we obtain the analytic results in the following form. For the Fig. \ref{twolooptu} (f), we keep the terms as \begin{eqnarray} &&a^{2L,\;Z\tilde{\nu}\chi^{\pm}}_{\mu}=\frac{1}{768\pi^4} \sum_{i=1}^2\sum_{j,k=1}^6 G_{Z\tilde{\nu}^I_j\tilde{\nu}^R_k}\bigg\{\frac{x_{\mu}}{x_Z}\Big[-4\Re\Big(H^L_{Z\bar{\mu}\mu} H^{L}_{\mu\bar{\chi}_i^\pm\tilde{\nu}^I_j}H^{L*}_{\mu\bar{\chi}^\pm_i\tilde{\nu}^R_k}+H^R_{Z\bar{\mu}\mu} H^{R}_{\mu\bar{\chi}_i^\pm\tilde{\nu}^I_j}H^{R*}_{\mu\bar{\chi}^\pm_i\tilde{\nu}^R_k}\Big)\nonumber\\&&-\Re\Big(H^L_{Z\bar{\mu}\mu} H^{R}_{\mu\bar{\chi}_i^\pm\tilde{\nu}^I_j}H^{R*}_{\mu\bar{\chi}^\pm_i\tilde{\nu}^R_k}+H^R_{Z\bar{\mu}\mu} H^{L}_{\mu\bar{\chi}_i^\pm\tilde{\nu}^I_j}H^{L*}_{\mu\bar{\chi}^\pm_i\tilde{\nu}^R_k}\Big)(6 \ln x_{\mu}-10)\Big] \nonumber\\&& +(H^L_{Z\bar{\mu}\mu}+H^R_{Z\bar{\mu}\mu})\Re\Big(H^{R}_{\mu\bar{\chi}^\pm_i\tilde{\nu}^I_j}H^{L*}_{\mu\bar{\chi}^\pm_i\tilde{\nu}^R_k}\Big) \frac{x_{\mu}^{1/2}}{x_{\chi^{\pm}_i}^{1/2}}\Big(\ln x_{\chi^\pm_i}-2 \ln x_Z-\frac{35}{12}\Big)\bigg\}+(\tilde{\nu}^I\leftrightarrow\tilde{\nu}^R) . \end{eqnarray} $G_{VS^*_1S_2}$ is the coupling constant for one vector boson and two scalars with the general form \begin{eqnarray} \mathcal{L}_{{VS^*_1S_2}}=S_1^*G_{VS^*_1S_2}(-p_{\mu}^{S_1^*}+p_\mu^{S_2})S_2V^\mu. \end{eqnarray} For the Fig.\ref{twolooptu}(h) with vector boson Z and the Fig.\ref{twolooptu}(i) with gauge boson $\gamma$, the results are deduced \begin{eqnarray} &&a^{2L,\;Z\tilde{L}\chi^{0}}_{\mu}=\frac{-1}{1536 \pi ^4}\sum_{s,t=1}^6\sum_{j=1}^8\limits \bigg\{4\Re\Big(H^{R*}_{\mu\bar{\chi}^0_j\tilde{L}_t}{G}_{Z\tilde{L}_t\tilde{L}_s} H^{R}_{\mu\bar{\chi}^0_j\tilde{L}_s}\Big)\frac{x_{\mu}}{x_Z}\Big[4H^R_{Z\bar{\mu}\mu}+H^L_{Z\bar{\mu}\mu}(3\ln x_{\mu}-5)\Big] \nonumber\\&&\hspace{2.2cm} +4\Re\Big(H^{L*}_{\mu\bar{\chi}^0_j\tilde{L}_t}{G}_{Z\tilde{L}_t\tilde{L}_s} H^{L}_{\mu\bar{\chi}^0_j\tilde{L}_s}\Big)\frac{x_{\mu}}{x_Z} \Big[4 H^L_{Z\bar{\mu}\mu} +H^R_{Z\bar{\mu}\mu}( 3 \ln x_{\mu}-5)\Big]\nonumber\\&&\hspace{2.2cm} -\Re\Big(H^{R*}_{\mu\bar{\chi}^0_j\tilde{L}_t}{G}_{Z\tilde{L}_t\tilde{L}_s} H^{L}_{\mu\bar{\chi}^0_j\tilde{L}_s}+ H^{L*}_{\mu\bar{\chi}^0_j\tilde{L}_t}{G}_{Z\tilde{L}_t\tilde{L}_s} H^{R}_{\mu\bar{\chi}^0_j\tilde{L}_s}\Big)\nonumber\\&&\hspace{2.2cm}\times(H^L_{Z\bar{\mu}\mu}+H^R_{Z\bar{\mu}\mu}) \frac{x_{\mu}^{1/2}}{x_{\chi^{0}_j}^{1/2}}\Big(8\ln x_{\chi^{0}_j}-10 \ln x_Z+\frac{287}{12} \Big)\bigg\},\\ &&a^{2L,\;\gamma\tilde{L}\chi^{0}}_{\mu}=\frac{e^2}{384\pi^4}\sum_{s=1}^6\sum_{j=1}^8\limits \Re\Big(H^{R*}_{\mu\bar{\chi}^0_j\tilde{L}_s}H^{L}_{\mu\bar{\chi}^0_j\tilde{L}_s}\Big) \frac{x_{\mu}^{1/2}}{x_{\chi^{0}_j}^{1/2}} \Big[10 \log x_{\mu}-8 \log x_{\chi^{0}_j}-\frac{289}{12}\Big]. \end{eqnarray} Both Fig.\ref{twolooptu}(g) and Fig.\ref{twolooptu}(j) have W boson, whose contributions to muon MDM are shown here \begin{eqnarray} && a^{2L,\;W\tilde{L}\tilde{\nu}\chi^{0}}_{\mu}=\frac{1}{768\pi ^4}\sum_{j=1}^8\sum_{i,k=1}^6 H^L_{W\bar{\nu} \mu} \bigg\{-15\frac{x_{\mu}}{x_W}\Re\Big(H^{L*}_{\mu\bar{\chi}^0_j\tilde{L}_k}H^{L}_{\nu\bar{\chi}^0_j\tilde{\nu}^I_i}G_{W\tilde{L}_k\tilde{\nu}^I_i} \Big)\nonumber\\&&+\Re\Big(H^{R*}_{\mu\bar{\chi}^0_j\tilde{L}_k}H^{L}_{\nu\bar{\chi}^0_j\tilde{\nu}_i^I}G_{W\tilde{L}_k\tilde{\nu}^I_i} \Big)\frac{x_{\mu}^{1/2}}{x_{\chi^{0}_j}^{1/2}}\Big(\frac{29}{12} -2\ln x_W+4\ln x_{\chi_j^0}\Big) \bigg\}+(\tilde{\nu}^I\leftrightarrow \tilde{\nu}^R), \nonumber\\ && a^{2L,\;W\tilde{L}\tilde{\nu}\chi^{-}}_{\mu}=-\frac{1}{1536\pi^4}\sum_{j=1}^2\sum_{i,k=1}^6H^L_{W\bar{\nu} \mu} \bigg\{-18 \frac{x_{\mu}}{x_W}\Re\Big(H^{L*}_{\mu\bar{\chi}^\pm_j\tilde{\nu}^I_i}H^{L}_{\nu\bar{\chi}^\pm_j\tilde{L}_k}G_{W\tilde{L}_k\tilde{\nu}^I_i} \Big)\nonumber\\&&+\Re\Big(H^{R*}_{\mu\bar{\chi}^\pm_j\tilde{\nu}^I_i}H^{L}_{\nu\bar{\chi}^\pm_j\tilde{L}_k}G_{W\tilde{L}_k\tilde{\nu}^I_i} \Big)\frac{x_{\mu}^{1/2}}{x_{\chi^{\pm}_j}^{1/2}}\Big(2 \ln x_{\chi_j^\pm}-4 \ln x_W-\frac{7}{6}\Big)\bigg\}+(\tilde{\nu}^I\leftrightarrow \tilde{\nu}^R). \label{result-zms} \end{eqnarray} The corrections to muon MDM from the researched two-loop diagrams are \begin{eqnarray} && a_\mu^{2L}=a_\mu^{2L,~WH}+a_\mu^{2L,~WG}+a_\mu^{2L,~\gamma h_0}+a_\mu^{2L,~\gamma G_0} +a_\mu^{2L,~\gamma A_0}+a_\mu^{2L,~Z h_0}\nonumber\\&&\hspace{1.0cm}+a_\mu^{2L,~Z G_0}+a_\mu^{2L,~Z A_0}+a_{\mu}^{2L,~WW} +a_{\mu}^{2L,~ZZ}+a_{\mu}^{2L,~Z\gamma}+a_{\mu}^{2L,~\gamma\gamma}\nonumber\\&&\hspace{1.0cm} +a^{2L,Z\tilde{\nu}\chi^{\pm}}_{\mu}+a^{2L,Z\tilde{L}\chi^{0}}_{\mu}+a^{2L,\gamma\tilde{L}\chi^{0}}_{\mu} +a^{2L,W\tilde{L}\tilde{\nu}\chi^{0}}_{\mu}+a^{2L,W\tilde{L}\tilde{\nu}\chi^{-}}_{\mu}. \end{eqnarray} At two-loop level, the total results are the sum of one-loop results and two-loop results \begin{eqnarray} && a_\mu=a_{\mu}^{1L}+a_{\mu}^{2L}. \end{eqnarray} \section{numerical results} In the $U(1)_X$SSM, we have researched several processes\cite{ZSMJHEP,slh}. In this section of the numerical results, we consider the experimental constraints from the lightest CP-even Higgs $h^0$ mass ($\thickapprox$125 GeV) and $h^0$ decays including $h^0\rightarrow \gamma+\gamma$, $h^0\rightarrow Z+Z$ and $h^0\rightarrow W+W$\cite{2020pdg}. The mass constraint for the $Z^\prime$ boson from LHC experiments is more severe than the limits from the low energy data. To satisfy the $M_{Z^\prime}$ constraint, we take the parameters to obtain $M_{Z^{\prime}}> 5.1$ TeV\cite{Zp5d1}. At 99\% CL\cite{UPbmzgx}, the ratio ($M_{Z^\prime}/g_X$) between $M_{Z^\prime}$ and its gauge coupling should be not smaller than 6 TeV. To satisfy the LHC experimental data, we take $\tan \beta_\eta< 1.5$ \cite{TBnew}. The papers\cite{wx1,wx2,wx3,wx4,wx5,wx6,wx7} perform a detailed recasting of LHC limits. We take into account the experimental constraints on masses of the new particles to make the scalar lepton masses larger than 700 GeV. and chargino masses larger than 1100 GeV. Considering the above experimental constraints, we adopt the following parameters in the numerical calculation. \begin{eqnarray} &&\lambda_H=\kappa=0.1,~\lambda_C=-0.1, ~v_S=3.6~{\rm TeV}, ~\mu=0.9~{\rm TeV},~M_S=1~{\rm TeV},\nonumber\\&& \xi=17~{\rm TeV},~\tan{\beta_\eta}=1.05, ~ l_W=B_\mu=B_S=0.1~{\rm TeV^2},~T_{\lambda_C}=150~{\rm GeV}, \nonumber\\&&T_{X11}=T_{X22}=T_{X33}=10~{\rm GeV},~m_{S}^2=0.2~{\rm TeV^2}, ~T_{\lambda_H}=T_\kappa=1~{\rm TeV}, \nonumber\\&&Y_{X11}=Y_{X22}=Y_{X33}=0.04, ~T_{E11}=T_{E22}=T_{E33}=0.1~{\rm TeV}, ~M_2=1.2~{\rm TeV}. \end{eqnarray} To simplify the numerical discussion, we use the following relations \begin{eqnarray} &&M_{Eii}=M_E, ~M_{Lii}=M_L, ~M_{\nu ii}=M_{NU},~T_{\nu ii}=T_{nu}, ~(i=1,2,3). \end{eqnarray} \subsection{The numerical results with one or two variables} In this subsection, we use the parameters as $M_1= 4 ~{\rm TeV}, M_{BL} = 1~{\rm TeV},~ g_X=0.3,~ g_{YX} = 0.07,~M_E = 0.3 ~{\rm TeV}^2,~T_{nu}= 3~{\rm TeV}$. $M_{NU}$ are the parameters in the diagonal elements of scalar neutrino(CP-even and CP-odd) mass squared matrix. Therefore, $M_{NU}$ can affect the masses of scalar neutrino strongly. With the parameters $M_{BB^\prime} = 3 ~{\rm TeV}$ and $M_L= 0.6 ~{\rm TeV}^2$, we plot $a_\mu$ versus $M_{NU}$ in the Fig.\ref{Mnu}, where the solid (dashed, dotted) line corresponds to the results as $\tan{\beta}=20~(30, ~40)$. The three lines are all decreasing functions as $M_{NU}$ turn large. That is to say heavy scalar neutrino suppresses the SUSY contributions to muon g-2. This characteristic is similar as the MSSM condition, and it is generic for the SUSY models, because the loop corrections from SUSY particles have the factor $\frac{m^2_\mu}{M_{SUSY}^2}$. The dotted line($\tan\beta=40$) is upon the dashed line($\tan\beta=30$), and the dashed line is upon the solid line($\tan\beta=20$). It implies that $\tan\beta$ is a sensitive parameter and larger $\tan\beta$ leads to larger $a_\mu$. It is consistent with the one-loop results obtained by MIA. The simplified one-loop results shown as Eq.(\ref{amuS}) are proportional to $\tan\beta$, which is similar as the MSSM condition. The biggest value of the dotted line can reach $2.4\times10^{-9}$, that can well compensate the departure between experiment value and the theoretical prediction of SM. \begin{figure}[t] \begin{center} \begin{minipage}[c]{0.48\textwidth} \includegraphics[width=2.9in]{YMnutu.eps} \end{minipage \caption{$a_\mu$ versus $M_{NU}$. The solid (dashed, dotted) line corresponds to the results with $\tan{\beta}=20~(30, ~40)$.} \label{Mnu} \end{center} \end{figure} To find the feature different from MSSM, we study the parameter $M_{BB^\prime}$ effects to muon MDM. $M_{BB^\prime}$ is the mass of the two U(1) gauginos mixing, and appears as the non-diagonal element of the neutralino mass matrix. In the Eq.(\ref{MIAXBLR}) obtained by MIA, one can easily find that this contribution is proportional to $\sqrt{x_{BB^\prime}}=\frac{M_{BB^\prime}}{\Lambda}$. That is to say, $M_{BB^\prime}$ is an important parameter beyond MSSM, and can give new contribution. We plot the results versus $M_{BB^\prime}$ in the Fig.\ref{MBBP} with $M_{NU} = 0.4 ~{\rm TeV}^2, ~M_L= 0.6 ~{\rm TeV}^2$. In this figure, the solid (dashed, dotted) line corresponds to the results as $\tan{\beta}=20~(30, ~40)$. The three lines are all increasing functions, when $M_{BB^\prime}$ turns large from 0 to 4400 GeV. The growth trends become weaker and weaker with the increasing $M_{BB^\prime}$, and they are very gentle as $M_{BB^\prime}>3000~{\rm GeV}$. The reason of this feature comes from two conflict sides: 1 larger $M_{BB^\prime}$ can improve the new contributions; 2 larger $M_{BB^\prime}$ leads to heavier neutralino, then suppresses the contributions. In the region of $M_{BB^\prime}$ from 2000 GeV to 4400 GeV, the dotted line is around $2.2\times10^{-9}$, the dashed line is around $1.5\times10^{-9}$, the solid line is around $1\times10^{-9}$. \begin{figure}[t] \begin{center} \begin{minipage}[c]{0.48\textwidth} \includegraphics[width=2.9in]{YMBBPtu.eps} \end{minipage \caption{$a_\mu$ versus $M_{BB^\prime}$. The solid (dashed, dotted) line corresponds to the results with $\tan{\beta}=20~(30, ~40)$.} \label{MBBP} \end{center} \end{figure} To scan the parameter space better, with $\tan\beta = 40$ and $M_{BB^\prime} = 3 ~{\rm TeV}$, we show $a_\mu$ in the plane of $M_L$ versus $M_{NU}$ in the Fig.\ref{MLMNU}. $M_L$ and $M_{NU}$ affect the masses of scalar leptons and scalar neutrinos. So, they should influence $a_\mu$ to some extent. The light-gray lozenge \textcolor{light-gray} {$\blacklozenge$} represents the results as $0<a_\mu<10^{-9}$. The gray triangle \textcolor{mid-gray}{$\blacktriangle$} denotes the results in the region $10^{-9}\leq a_\mu<1.5\times10^{-9}$. The dark-gray square \textcolor{dark-gray}{$\blacksquare$} denotes the results in the region $1.5\times10^{-9}\leq a_\mu<2\times10^{-9}$. The filled circle $\bullet$ represents the results as $2\times10^{-9}\leq a_\mu<3\times10^{-9}$. What needs illustration is that the represented values of \textcolor{light-gray} {$\blacklozenge$}, \textcolor{mid-gray}{$\blacktriangle$}, \textcolor{dark-gray}{$\blacksquare$} and $\bullet$ are also suitable for the following numerical results. In this figure, \textcolor{light-gray} {$\blacklozenge$} takes up a lot of space. Similar as the feature of MSSM, heavy scalar lepton and heavy scalar neutrino suppress the SUSY contributions to muon MDM. It is easy to see that \textcolor{light-gray} {$\blacklozenge$}, \textcolor{mid-gray}{$\blacktriangle$}, \textcolor{dark-gray}{$\blacksquare$} and $\bullet$ are obviously layered. $\bullet$ concentrates in the narrow area $M_L~(0.75,1){\rm TeV}^2$ and $M_{NU}~(0.2,1.7){\rm TeV}^2$. The blank area as $M_L<0.75~{\rm TeV}^2$ can give large contributions to $a_\mu$, but it is excluded by the scalar lepton mass constraint from LHC. One can also find that $M_L$ are more sensitive than $M_{NU}$, because $M_L$ affect the masses of both scalar lepton and scalar neutrino, and $M_{NU}$ just influence scalar neutrino masses. \begin{figure}[t] \begin{center} \begin{minipage}[c]{0.48\textwidth} \includegraphics[width=2.9in]{YEWMLMNU.eps} \end{minipage \caption{$a_\mu$ in the plane of $M_L$ versus $M_{NU}$.} \label{MLMNU} \end{center} \end{figure} As $M_L= 0.6 ~{\rm TeV}^2,~ M_{NU} = 0.4 ~{\rm TeV}^2$, $a_\mu$ in the plane of $\tan\beta$ versus $M_{BB^\prime}$ is shown by the Fig.\ref{TBMBBP}. When $\tan\beta<20$, the space is filled with \textcolor{light-gray} {$\blacklozenge$}. In the range $20\leq\tan\beta\leq30$, \textcolor{mid-gray}{$\blacktriangle$} occupies much space. $\bullet$ denoting large contribution to $a_\mu$ concentrates in the area $38<\tan\beta<50$ and $1400 ~{\rm GeV}<M_{BB^\prime}<5000 ~{\rm GeV}$. The results imply that large $\tan\beta$ and large $M_{BB^\prime}$ produce suitable SUSY corrections to compensate the departure. The bounds between \textcolor{light-gray} {$\blacklozenge$}, \textcolor{mid-gray}{$\blacktriangle$} and \textcolor{dark-gray}{$\blacksquare$} are obvious. \begin{figure}[t] \begin{center} \begin{minipage}[c]{0.48\textwidth} \includegraphics[width=2.9in]{YEWTBMBBp.eps} \end{minipage \caption{$a_\mu$ in the plane of $\tan\beta$ versus $M_{BB^\prime}$.} \label{TBMBBP} \end{center} \end{figure} \subsection{The numerical results with many variables} In order to analyse the results more extensively, we calculate $a_\mu$ numerically with the scanned parameters: $1\leq\tan\beta\leq50,~0.2 ~{\rm TeV} \leq M_1 \leq 5 ~{\rm TeV}, ~0.2 ~{\rm TeV} \leq M_{BL} \leq 5 ~{\rm TeV},~0\leq M_{BB^\prime} \leq 5 ~{\rm TeV},~0.2\leq g_X\leq 0.6,~0.01\leq g_{YX} \leq 0.5$, $0.1 ~{\rm TeV}^2 \leq M_L \leq 10 ~{\rm TeV}^2,~0.1 ~{\rm TeV}^2 \leq M_E \leq 10 ~{\rm TeV}^2,~0.1 ~{\rm TeV}^2 \leq M_{NU} \leq 10 ~{\rm TeV}^2$, $-5~{\rm TeV}\leq T_{nu}\leq 5~{\rm TeV}$. These parameters include sensitive parameters and insensitive parameters. So we show the results in several groups of the parameters to find the laws. In the Fig.\ref{Bumingxian}, the left diagram shows the results in the plane of $M_E$ versus $g_X$, where we can not find obvious rule for the results. \textcolor{light-gray}{$\blacklozenge$}, \textcolor{mid-gray}{$\blacktriangle$}, \textcolor{dark-gray}{$\blacksquare$} and $\bullet$ are distributed in a disorderly way in the plane. The right diagram in the Fig.\ref{Bumingxian} represents the results in the plane of $T_{nu}$ versus $M_{BL}$, that possesses similar character as the left diagram. These results imply that the effects to $a_\mu$ from $M_E$, $g_X$, $T_{nu}$ and $M_{BL}$ are gentle. \begin{figure}[t] \begin{center} \begin{minipage}[c]{1.0\textwidth} \includegraphics[width=2.9in]{YdwMEgX.eps}~~~~~~\includegraphics[width=2.9in]{YdwTnuMBL.eps} \end{minipage \caption{The left diagram denotes $a_\mu$ in the plane of $M_E$ versus $g_X$. The right diagram denotes $a_\mu$ in the plane of $T_{nu}$ versus $M_{BL}$.} \label{Bumingxian} \end{center} \end{figure} We plot $a_\mu$ in the plane of $M_{BB^\prime}$ versus $M_{BL}$ by the left diagram in the Fig.\ref{yiban}, while the right diagram shows the relation between $a_\mu$, $\tan\beta$ and $M_{NU}$. The both diagrams in the Fig.\ref{yiban} reflect the common law, though it is not very clear. In the left diagram, there more $\bullet$ in the top right corner. When $M_{BB^\prime} < 2000 {\rm GeV}$, the color of the figure is light gray. We can conclude that $M_{BB^\prime}$ is a sensitive parameter and $M_{BL}$ is a dull parameter. In the right diagram, larger corrections (darker area) appear at the lower right corner. It shows that large $\tan\beta$ and small $M_{NU}$ can improve the theoretical corrections. This rule is consistent with the case of MSSM. When $M_{NU}$ turn larger and $\tan\beta$ becomes smaller, the color of the diagram turns lighter. Large $M_{NU}$ lead to heavy scalar neutrino and suppress the new physics contribution. \begin{figure}[t] \begin{center} \begin{minipage}[c]{1.0\textwidth} \includegraphics[width=2.9in]{YdwMBBpMBL.eps}~~~~~~\includegraphics[width=2.9in]{YdwTbMnu.eps} \end{minipage \caption{The left diagram denotes $a_\mu$ in the plane of $M_{BB^\prime}$ versus $M_{BL}$. The right diagram denotes $a_\mu$ in the plane of $\tan\beta$ versus $M_{NU}$.} \label{yiban} \end{center} \end{figure} In the Fig.\ref{hao}, the left diagram reflects the results in the plane of $M_1$ versus $g_{YX}$. $g_{YX}$ is the coupling constant of gauge mixing, and it is the parameter beyond MSSM. From the analysis by MIA, $g_{YX}$ is an important parameter. In the area $0.4<g_{YX}<0.5$, the color of the diagram is dark. When $M_1$ is bigger than 2500 GeV, there are also a certain amount of large results with $g_{YX}<0.3$. \textcolor{light-gray}{$\blacklozenge$} concentrates in the area $g_{YX}<0.3$ and $M_1<2500~{\rm GeV}$. $g_{YX}$ and $M_1$ are both sensitive parameters. Furthermore, $g_{YX}$ is more sensitive than $M_1$. The right diagram reflects the results in the plane of $\tan\beta$ versus $g_{YX}$. The both diagrams in the Fig.\ref{hao} are more clear than the diagrams in the Fig.\ref{yiban} and Fig.\ref{Bumingxian}. These results plotted in the right diagram manifest that $\tan\beta$ and $g_{YX}$ are both sensitive parameters. There are many \textcolor{dark-gray}{$\blacksquare$} and $\bullet$ in the up side of $g_{YX}$ and right side of $\tan\beta$. The top right corner is the most concentrated place for the large results. The bottom left corner is denominated by the \textcolor{light-gray}{$\blacklozenge$}. In the whole, large $\tan\beta$ and large $g_{YX}$ can obviously improve the corrections to $a_\mu$. \begin{figure}[t] \begin{center} \begin{minipage}[c]{1.0\textwidth} \includegraphics[width=2.9in]{YdwgYXM1.eps},~~~~~~\includegraphics[width=2.9in]{YdwTbgYX.eps} \end{minipage \caption{The left diagram denotes $a_\mu$ in the plane of $g_{YX}$ versus $M_1$. The right diagram denotes $a_\mu$ in the plane of $\tan\beta$ versus $g_{YX}$.} \label{hao} \end{center} \end{figure} \section{discussion and conclusion} Extending MSSM with the $U(1)_X$ local gauge group and introducing three Higgs singlets and right-handed neutrinos, we obtain $U(1)_X$SSM. In this model, the one-loop diagrams and some important two-loop diagrams are researched with the effective Lagrangian method. To apparently see the sensitive parameters, the MIA method is used to analyze the one-loop SUSY contributions. Based on our previous works for the two-loop corrections to muon MDM, the studied two-loop diagrams include: Barr-Zee type, rainbow type and diamond type. It is well known that the one-loop corrections are more important than the two-loop corrections. The works of muon g-2 in MSSM show that large $\tan\beta$ can improve loop corrections obviously under the constraint for scalar lepton and chargino from LHC. If all the SUSY particles are very heavy, the loop corrections will be suppressed evidently. These two characteristics relating with $\tan\beta$ and SUSY particle masses are general in the SUSY corrections to $a_\mu$. Here, we discuss the speciality of the $U(1)_X$SSM contributions to $a_\mu$. $M_{BB^\prime}$ is the mass for the mixing of the $U(1)_Y$ gaugino and $U(1)_X$ gaugino, and it is the non diagonal element of neutralino mass matrix. Large $M_{BB^\prime}$ can distinctly boost the one-loop contributions, which is reflected in Eq.(\ref{MIAXBLR}). The gauge mixing coupling constant $g_{YX}$ is also an important parameter. From Eqs.(\ref{MIAXLR}), (\ref{MIAHXR}), (\ref{MIAXHL}), (\ref{MIAXBLR}) and the Fig.\ref{hao}, one easily finds that large $g_{YX}$ can improve $a_\mu$ strongly. In the used parameter spaces, the one-loop corrections are dominated. The ratio ($a^{2L}_\mu/a^{1L}_\mu$) of just two-loop results to the one-loop results is around $10\%$. From the numerical results, we find that the corrections from the studied three types of two-loop diagrams(Barr-Zee type, rainbow type, diamond type) are in the region $10^{-10}\sim10^{-12}$. In the numerical calculation, we take many parameters as variables including $\tan\beta,~g_X,~g_{YX},~M_1,~M_{BL}, ~M_{BB^\prime}$, $ M_L,~M_E,~ M_{NU} $ and $T_{nu}$. The best numerical result of $a_\mu$ is around $2.5\times10^{-9}$, which can well compensate the departure between the experiment data and SM prediction. Through the analysis of the numerical results, we find that $\tan\beta,~M_L,~M_{NU},~M_1,~M_{BB^\prime}$ and $g_{YX}$ are sensitive parameters. $a_\mu$ is an increasing function of $\tan\beta,~M_{BB^\prime},~g_{YX}$ and decreasing function of $M_L$ and $M_{NU}$. Large $M_L$ and $M_{NU}$ lead to heavy scalar lepton and scalar neutrino, then SUSY contributions to $a_\mu$ are suppressed by heavy particles. $g_X$, $M_{BL}$, $M_E$ and $T_{nu}$ are insensitive parameters, that give mild influences on the numerical results. There are a great many two-loop diagrams contributing to $a_\mu$, and some of them can also give considerable corrections. In the near future, we shall study other important two-loop diagrams for muon MDM. \begin{acknowledgments} This work is supported by National Natural Science Foundation of China (NNSFC) (No. 12075074), Natural Science Foundation of Hebei Province (A2020201002), and the youth top-notch talent support program of the Hebei Province. \end{acknowledgments}
\section{Introduction and Statement of Results}\label{sec: intro} In his 1916 paper titled ``On certain arithmetical functions,'' Ramanujan defined the function $\tau(n)$ to be the Fourier coefficients of the normalized weight 12 cusp form for $\operatorname{SL}_2(\mathbb{Z})$ given by \begin{equation} \Delta(z) = \sum_{n=1}^\infty \tau(n)q^n:= q\prod_{n=1}^\infty (1-q^n)^{24} = q-24q^2+252q^3-1472q^4+4830q^5-\dots, \end{equation} where $q := e^{2\pi i z}$. The $\tau$-function plays an important role in the theory of modular forms, yet some of its basic properties remain unknown. For instance, Lehmer's 1947 conjecture \cite{Lehmer} that $\tau(n)$ never vanishes remains open. A natural variant of Lehmer's conjecture asks whether, for any given integer $\alpha$, there exist any $n \in \mathbb{Z}^+$ such that $\tau(n) = \alpha$. Much is known for odd $\alpha$ due to the fact that \begin{equation}\label{eq: deltamod2} \Delta(z) \equiv \sum_{n=0}^\infty q^{(2n+1)^2} \pmod 2. \end{equation} In 1987, Murty, Murty, and Shorey \cite{MMS} showed that for any odd integer $\alpha$, we have $\tau(n) = \alpha$ for at most finitely many $n \in \mathbb{Z}^+$. It was not until 2013, however, that the first integers were ruled out as values of $\tau(n)$, when Lygeros and Rozier \cite{LR} proved that $\tau(n) \neq \pm 1$ for all $n > 1$. In 2020, Balakrishnan, Craig, Ono, and Tsai \cite{BCO,BCOT} introduced new methods to the problem, and showed that $$\tau(n) \notin \{\pm 1, \pm 3, \pm 5, \pm 7, \pm 13, \pm 17, -19, \pm 23, \pm 37, \pm 691\}.$$ Later that year, Hanada and Madhukara \cite{HM} additionally proved that $$\tau(n) \notin \{-9,\pm 15,\pm 21,-25,-27,-33,\pm 35, \pm 45, \pm 49,-55,\pm 63, \pm 77, -81,\pm 91\},$$ and Dembner and Jain \cite{DJ} showed that $\tau(n) \neq \pm \ell$, where $\ell < 100$ is any odd prime. Shortly thereafter, Bennett, Gherga, Patel, and Siksek \cite{Bennett} proved that the same is true for any positive power of $\ell$, and that $\tau(n) \neq \pm 3^a 5^b 7^c 11^d$ for any $a,b,c,d \in \mathbb{Z}_{\ge 0}$ and any $n > 1$. Using some of these results concerning odd primes, Balakrishnan, Ono, and Tsai \cite{BOT} were able to make progress eliminating non-zero even integers as values of the $\tau$-function. For odd primes $\ell$, they showed that $$\tau(n) \notin \{\pm 2\ell:\, \ell < 100\} \cup \{\pm 2\ell^2:\, \ell < 100\} \cup \{\pm 2\ell^3:\, \ell < 100 \text{ with } \ell \neq 59\}.$$ The methods used to obtain these results include the theory of primitive divisors of Lucas numbers, the paucity of integer points on hyperelliptic curves and Thue equations, and the congruences for the $\tau$-function (see \eqref{eq: congs} and \eqref{eq: pmod}) arising from the theory of 2-dimensional Galois representations due to Serre and Swinnerton-Dyer \cite{Mods}. The objective of this paper is to synthesize these results and exclude as many additional non-zero $\tau$-values with absolute value less than $100$ as possible given current methods, as well as to explain the limitations of these methods. In particular, we prove the following: \begin{theorem}\label{thm: main} The following are true: \begin{enumerate}[(i)] \item If $\tau(n) \in \{2,-24, -70,-90,92\}$, then $n = p$ is prime. \item If $\tau(n) = 2^k < 100$, then $n = p_1\cdots p_k$ for distinct primes $p_i$ with $\tau(p_i) = 2$ for all $i$. \item If $\tau(n) =-48$, then $n = p_1p_2$ for primes $p_1,p_2$ with $\tau(p_1)=2$ and $\tau(p_2)=-24$. \item If $\tau(n) = -96$, then $n = p_1p_2p_3$ for distinct primes with $\tau(p_1) = \tau(p_2) = 2$ and $\tau(p_3) = -24$. \item For all $\alpha \in \mathbb{Z}$ with $0 < \abs{\alpha} < 100$ not listed in (i)-(iv), we have that $\tau(n) \neq \alpha$ for all $n > 1$. \end{enumerate} \end{theorem} \begin{remark} Assuming the Lang-Trotter conjecture~\cite{LangTrotter}, there are only finitely many primes $p$ with $\tau(p) = \alpha$ for any integer $\alpha$, in which case Theorem~\ref{thm: main} shows that there are only finitely many $n$ with $0<\abs{\tau(n)}<100$. \end{remark} The obstacle to proving that $\abs{\tau(n)} \ge 100$ for all $n>2$ is that the congruences given in \cite{Mods}, which are currently the only known means for ruling out possible values of $\tau(p)$, do not eliminate the exceptional values in Theorem~\ref{thm: main} (i) (whose products give rise to the exceptional values in (ii)-(iv)). New methods will therefore be needed to better understand possible values of $\tau(p)$. Recent progress on the Atkin-Serre conjecture provides hope that $\abs{\tau(p)}$ could be bounded below for all primes. Using an effective form of the Sato-Tate conjecture, Gafni, Thorner, and Wong \cite{Jesse} recently showed that \begin{equation}\label{eq: StrongJesse} 2p^{\frac{11}{2}}\,\frac{\log \log p}{\sqrt{\log p}} < \abs{\tau(p)} \end{equation} for 100 percent of (but not all) primes $p$. We call the set $S$ of all primes contradicting \eqref{eq: StrongJesse} the \textit{exceptional set}. If $p \notin S \cup \{2,3\}$, then \eqref{eq: StrongJesse} shows that $\abs{\tau(p)}>100$, and hence we immediately obtain the following corollary of Theorem~\ref{thm: main}: \begin{corollary}\label{thm: dumbAT} If $n>1$ and $0 < \abs{\tau(n)} < 100$, then every odd prime factor of $n$ is in $S$. \end{corollary} Of course, to prove that $\abs{\tau(n)}\ge 100$ for $n > 2$, we would need a stronger statement, such as an effective version of the Atkin-Serre conjecture for $\tau(n)$ \cite{Atkin-Serre}. \begin{conj*}[Atkin-Serre $+\,\varepsilon$] For any $\varepsilon> 0$, there are constants $c(\varepsilon), d(\varepsilon) > 0$ such that for all primes $p > d(\varepsilon)$, we have \begin{equation}\label{eq: AtkinSerre} \abs{\tau(p)} \ge\, c(\varepsilon)\cdot p^{\frac{9}{2}-\varepsilon}. \end{equation} \end{conj*} If one could find an $\varepsilon > 0$ and corresponding constants $c(\varepsilon)$ and $d(\varepsilon)$ satisfying this form of the Atkin-Serre conjecture, then proving that $\abs{\tau(n)} < 100$ if and only if $n \le 2$ would reduce to a finite calculation. Since such a statement is currently out of reach, we instead carry out numerical experiments that suggest an $\varepsilon > 0$ and constants $c(\varepsilon),d(\varepsilon)$ which could conceivably satisfy this condition. In particular, we let $P_n$ denote the set of the first $n$ primes, and $p_{\mathrm{min}}(\varepsilon,n) \in P_n$ denote the prime at which the expression $\abs{\tau(p)}p^{-\frac 92+\varepsilon}$ is minimized. The values of $p_{\mathrm{min}}(\varepsilon,n)$ and $\min_{p \in P_n} \abs{\tau(p)}p^{-\frac 92+\varepsilon}$ for $n = 30000$ and different small values of $\varepsilon$ are given in the following table: \begin{table}[H] \centering \begin{tabular}{|c|c|c|c|c|c|} \hline $\varepsilon$ & $0.001$ & $0.01$ & $0.1$ & $0.25$ & $0.5$ \\ \hline $p_{\mathrm{min}}(\varepsilon, 30000)$ & $43$ & $43$ & $43$ & $2$ & $2$ \\ \hline $\min_{p \in P_{30000}}\abs{\tau(p)}p^{-\frac 92+\varepsilon}$ & $0.766 \dots$ & $0.793 \dots$ & $1.112 \dots$ & $1.261 \dots $ & $1.5$\\ \hline \end{tabular} \label{tbl: epexperiments} \vspace{2mm} \caption{Numerics for the Atkin-Serre conjecture $+\, \varepsilon$ with the first $30000$ primes} \end{table} \noindent Assuming, for instance, that $\abs{\tau(p)} \ge 0.793p^{\frac 92-0.01}$ for all primes $p$ (so that $\varepsilon = 0.01$ satisfies the Atkin-Serre conjecture with $c(\varepsilon) = 0.793$, $d(\varepsilon) = 0$), we have $\abs{\tau(n)} < 100$ if and only if $n \le 2$. \begin{remark} It would be interesting to carry out further numerics with the goal of finding explicit constants $c(\varepsilon)$ and $d(\varepsilon)$ for which some form of the Atkin-Serre conjecture for arbitrary newforms of integer weight $k \ge 4$ without complex multiplication appears to hold. \end{remark} The proof of Theorem~\ref{thm: main} follows the approach of \cite{BCOT} and \cite{BOT} for odd and even values, respectively. For each $\alpha$, we use the fact that smaller values have been excluded as values of the $\tau$-function to show that $\tau(n) = \alpha$ implies $n=p^a$ for some prime $p$. Due to the classification of primitive divisors of Lucas sequences in \cite{BHV, Abouzaid}, we are able to restrict the list of possibilities for $a$, each of which we then eliminate using the congruences for the $\tau$-function listed in \cite{Mods}. (In contrast to previous work, where $\tau(p^a) = \alpha$ for $a>1$ is excluded by solving Diophantine equations, we found these congruences to be sufficient in all cases of interest.) This paper is organized as follows: In Section~\ref{sec: prelims}, we recall some facts about Lucas numbers and their primitive prime divisors, and connect these to values of the $\tau$-function at prime powers. In Sections~\ref{sec: odd} and \ref{sec: even}, we exclude the odd and even integers indicated in Theorem~\ref{thm: main} as possible values of $\tau(n)$, respectively. Finally, we complete the proof of Theorem~\ref{thm: main} in Section~\ref{sec: proofofmain}. \section*{Acknowledgements} We would like to thank Ken Ono for suggesting and advising this project, and for many valuable comments. We also thank William Craig, Badri Pandey, Wei-Lun Tsai, and the referee for their helpful suggestions. Finally, we are grateful for the generous support of the National Science Foundation (DMS 2002265 and DMS 205118), the National Security Agency (H98230-21-1-0059), the Thomas Jefferson Fund at the University of Virginia, and the Templeton World Charity Foundation. This research was conducted as part of the Number Theory Research Experience for Undergraduates at the University of Virginia. \section{Preliminaries}\label{sec: prelims} In this section, we recall some facts about primitive prime divisors of Lucas sequences, as well as several properties of the $\tau$-function, which we will need to prove Theorem~\ref{thm: main}. \subsection{Lucas sequences} If $\alpha$ and $\beta$ are algebraic integers such that $\alpha+\beta$ and $\alpha\beta$ are relatively prime non-zero integers and $\frac{\alpha}{\beta}$ is not a root of unity, then we call $(\alpha,\beta)$ a \textit{Lucas pair}, and we define the \textit{Lucas sequence} $u_n(\alpha,\beta) = \{u_1 = 1,\, u_2 = \alpha+\beta, \dots\}$ by \begin{equation*} u_n(\alpha,\beta) := \frac{\alpha^n-\beta^n}{\alpha-\beta}. \end{equation*} Lucas sequences have the following divisibility property: \begin{proposition}[Proposition 2.1 (ii) of \cite{BHV}]\label{prop: relativedivisibility} If $d \mid n$, then $u_d(\alpha,\beta) \mid u_n(\alpha,\beta)$. \end{proposition} For any prime $\ell$, let $m_\ell(\alpha,\beta)$ denote the smallest $n \ge 2$ such that $\ell \mid u_n(\alpha,\beta)$. Then we have $m_\ell(\alpha,\beta) = 2$ if and only if $\alpha +\beta \equiv 0 \pmod\ell$, and $m_\ell(\alpha,\beta)$ fulfills the following condition: \begin{proposition}[Proposition 2.3 of \cite{BOT}]\label{prop: possiblea} If $\ell$ is an odd prime with $2 < m_\ell(\alpha,\beta) < \infty$, then the following are true: \begin{enumerate}[(i)] \item If $\ell \mid (\alpha-\beta)^2$, then $m_\ell(\alpha,\beta) = \ell$. \item If $\ell \nmid (\alpha-\beta)^2$, then $m_\ell(\alpha,\beta)\mid \ell-1$ or $m_\ell(\alpha,\beta) \mid \ell+1$. \end{enumerate} \end{proposition} If $(\alpha,\beta)$ is a Lucas pair, then a prime number $p$ is called a \textit{primitive prime divisor} of $u_n(\alpha,\beta)$ if $p \mid u_n(\alpha,\beta)$, but $p \nmid (\alpha-\beta)^2u_1(\alpha,\beta)\cdots u_{n-1}(\alpha,\beta)$. If $n > 2$ and $u_n(\alpha,\beta)$ does not have a primitive prime divisor, then $u_n(\alpha,\beta)$ is called \textit{defective}. Bilu, Hanrot, and Voutier \cite{BHV} showed that every Lucas number $u_n(\alpha,\beta)$ with $n > 30$ has a primitive prime divisor. Their work, together with a subsequent paper of Abouzaid \cite{Abouzaid}, completely classifies defective Lucas numbers. \subsection{Properties of $\texorpdfstring{\tau(n)}{tau(n)}$} Important properties of the $\tau$-function include the Hecke multiplicativity established by Mordell \cite{Mordell}, and a deep theorem of Deligne \cite{Deligne1, Deligne2} that gives an upper bound for $\abs{\tau(p)}$. \begin{theorem}\label{thm: properties} The following are true: \begin{enumerate}[(i)] \item If $\gcd(m,n) = 1$, then $\tau(mn) = \tau(m)\tau(n)$. \item If $p$ is prime and $a \ge 2$, then \begin{equation*} \tau(p^a) = \tau(p)\tau(p^{a-1})-p^{11}\tau(p^{a-2}). \end{equation*} \item If $p$ is prime and $\alpha_p, \beta_p$ are roots of $F_p(X) := X^2-\tau(p)X+p^{11},$ then $$\tau(p^a) = u_{a+1}(\alpha_p,\beta_p) = \frac{\alpha_p^{a+1}-\beta_p^{a+1}}{\alpha_p-\beta_p}.$$ Moreover, $\abs{\tau(p)} \le 2p^{\frac{11}{2}}$, and $\alpha_p$ and $\beta_p$ are complex conjugates. \end{enumerate} \end{theorem} \noindent In particular, Theorem~\ref{thm: properties} (i) has the following corollary, which we use to prove Theorem~\ref{thm: main}: \begin{corollary}\label{lem: npaodd} Suppose $\alpha \in \mathbb{Z}$ is such that for any factorization $\alpha = \beta \gamma$, we have either $\tau(n) \ne \beta$ or $\tau(n) \ne \gamma$ for $n>1$. If $\tau(n) = \alpha$, then $n=p^a$ for some prime $p$. \end{corollary} If $p \mid \tau(p)$, then $p^a \mid \tau(p^a)$ for all $a \in \mathbb{Z}^+$ by the recursion in Theorem~\ref{thm: properties} (ii). Since $\abs{\tau(n)} > 100$ for $3 \le n \le 100$, we have that $\alpha \neq \tau(p^a)$ for any $p$ such that $p \mid \tau(p)$ when $0 < \abs{\alpha} < 100$ (except for $\tau(2) = -24$). Therefore, for the purposes of this paper, it suffices to assume that $p \nmid \tau(p)$, in which case $\{1,\tau(p), \tau(p^2),\dots\}$ forms a Lucas sequence by Theorem~\ref{thm: properties} (iii). \begin{lemma}\label{lemma: defectivity} If $p \nmid \tau(p)$ and $\abs{\tau(p^a)} < 100$, then $\tau(p^a)$ is not a defective term in the Lucas sequence $\{1,\tau(p),\tau(p^2),\dots\}$. \end{lemma} \begin{proof} A complete classification of the defective Lucas numbers is given in Tables 1 (sporadic examples) and 2 (parametrized families) of \cite{BCOT}. For the particular Lucas sequence $u_n = \tau(p^{n-1})$, the variables $(A,B)$ given in these tables correspond to $(\tau(p),p^{11})$. Since none of the values of $B$ listed in Table 1 are $11$th powers, the sporadic examples listed here do not apply to the Lucas sequence $u_n$. Now, by the results of Lygeros and Rozier \cite{LR} as well as Bennett, Gherga, Patel, and Siksek \cite{Bennett} stated in Section~\ref{sec: intro}, we have that $\tau(p^a) \neq -1, \pm 3^r$ as in rows 1 and 2 of Table 2. Rows 3, 5, and 7 give rise to a defective term only if $m = \tau(p)$ is odd; however, by \eqref{eq: deltamod2} we know that $\tau(p)$ is even for all primes. If row 4 of Table 2 gives rise to a defective term $u_4 = \tau(p^3)$, then $(p,\pm m) = (p,\pm \tau(p)) \in B_{3,k}^\pm$ (as defined on p.~20 of \cite{BCOT}), meaning that $\tau(p)^2 = 2p^{11}\pm 2$. Using Theorem~\ref{thm: properties} (ii), we see that then \begin{align*} \abs{\tau(p^3)} = \abs{\tau(p)(\tau(p)^2-2p^{11})} = 2 \abs{\tau(p)} = 2 (2p^{11} \pm 2)^{\frac{1}{2}} > 100. \end{align*} Finally, row 6 yields a defective term $u_6$ only if $\abs{\tau(p)} \geq 6$. However, if this is the case, then $$\abs{\tau(p^5)} = \abs{u_6} = \abs{\tau(p)} (2\tau(p)^2\pm 3) > 100.$$ \end{proof} \section{Odd Values of \texorpdfstring{$\tau(n)$}{tau(n)}}\label{sec: odd} The goal of this section is to prove the following theorem concerning odd inadmissible values for the $\tau$-function: \begin{theorem}\label{thm: mainodd} If $\alpha$ is any odd integer with $\abs{\alpha} < 100$, then $\tau(n) \neq \alpha$ for any $n > 1$. \end{theorem} \begin{proof} Using the previous results described in Section~\ref{sec: intro}, it suffices to show that \begin{equation}\label{eq: oddvals} \tau(n) \notin \{\pm 39, \pm 51, \pm 57, \pm 65, \pm 69, \pm 85, \pm 87, \pm 93, \pm 95\} \end{equation} for $n \in \mathbb{Z}^+$. We note that all the values $\alpha$ in \eqref{eq: oddvals} satisfy the conditions of Corollary~\ref{lem: npaodd} by the results stated in Section~\ref{sec: intro}. Thus if $\tau(n) = \alpha$, we must have $n = p^a$ for some prime $p$ and $a \ge 1$, where $p$ is odd and $a$ is even by \eqref{eq: deltamod2}. As explained in Section~\ref{sec: prelims}, it suffices to consider the case $p \nmid \tau(p)$, so that the values $\{1, \tau(p), \tau(p^2), \cdots\}$ form a Lucas sequence. By Lemma~\ref{lemma: defectivity}, we have that $\alpha = \tau(p^a)$ is a non-defective term in this sequence, so $\alpha$ has some prime divisor $\ell$ such that $m_{\ell} = a+1$. Hence by Proposition~\ref{prop: possiblea}, we have that $(a+1) \mid \ell(\ell^2-1)$. Moreover, we note that $a+1$ must be prime. Indeed, if $a+1$ had a non-trivial divisor $b$, then by Proposition~\ref{prop: relativedivisibility}, we would have $\tau(p^{b-1}) \mid \tau(p^a)$, but by non-defectivity of $\tau(p^a)$ and the odd $\tau$-values previously ruled out, this is impossible. Considering each possible primitive prime divisor $\ell$ of $\alpha$ individually, we use these conditions on $a+1$ to obtain a finite list of possible values for $a$ (which is given in Table~\ref{table: congruences} below for each $\alpha$ in \eqref{eq: oddvals}). To rule out each of these values of $a$, we use the following well-known congruences \cite{Ramanujan, Mods}: \begin{align}\label{eq: congs} \begin{split} \tau(n) \equiv \begin{dcases} \sigma_{11}(n) \qquad \quad \pmod{691}, \\ 0 \qquad\, \qquad \quad \pmod{23} &\text{ if } n = p \text{ and } p^{11} \equiv -1 \pmod{23}, \\ -1, 2 \,\,\, \qquad \quad \pmod{23} &\text{ if } n = p \text{ and } p^{11} \equiv 1 \,\,\,\,\, \pmod{23}, \\ n^{-610} \sigma_{1231}(n) \pmod{3^6} & \text{ if } n \not\equiv 0 \pmod{3}. \end{dcases} \end{split} \end{align} If $n = p^a$, then the mod $691$ congruence in \eqref{eq: congs} gives $$ \tau(p^a) \equiv \sigma_{11}(p^a) = \sum_{i=0}^a p^{11i} \pmod{691}.$$ In particular, if the equation $\sum_{i=0}^a x^i \equiv \alpha \pmod{691}$ has no solutions, then $\alpha \ne \tau(p^a)$ for any prime $p$. Checking this for each $(\alpha,a)$ in Table~\ref{table: congruences}, we eliminate the pairs indicated in the table. By the mod 23 congruence, we have $\tau(p) \equiv 0, -1, 2 \pmod{23}$ for all $p \ne 23$, where $\tau(p) \equiv 0 \pmod{23}$ exactly when $p^{11} \equiv -1 \pmod{23}$. Combining this with the recurrence in Theorem~\ref{thm: properties}~(ii), we can find a list of possible values for $\tau(p^a)$ mod 23, as long as $p \ne 23$. Checking whether $\alpha$ is on this list for each pair in Table~\ref{table: congruences} not already eliminated by the mod 691 congruence, and then checking numerically that $|\tau(23^a)|>10^{14} > \alpha$ for each $a$ in the table, we eliminate the pairs shown in Table~\ref{table: congruences}. Finally, if for all possible equivalence classes of $3 \nmid p \pmod{3^6}$ we have $p^{-610a} \sigma_{1231}(p^a) \not\equiv \alpha \pmod{3^6}$, then $\alpha \ne \tau(p^a)$ for $p \ne 3$. Furthermore, for all $\alpha$ in the table and any $a \ge 1$, we have $\alpha \not\equiv \tau(3^a) \equiv 0 \pmod{9}$. This eliminates all remaining pairs $(\alpha, a)$ in Table~\ref{table: congruences}. \begin{table}[H] \begin{adjustbox}{width=\columnwidth,center} \centering \begin{tabular}{|c|l|l|l|} \hline $\abs{\alpha}$ & $a$ & $\mathrm{Congruences} \,\, \mathrm{for} \,\, \tau(p^a) \ne \abs{\alpha}$ & $\mathrm{Congruences} \,\, \mathrm{for} \,\, \tau(p^a) \ne -\abs{\alpha}$\\ \hline $39 = 3\cdot 13$ & $2,6,12$ & $2,6,12 \pmod{691}$ & $2,6 \pmod{691}, 12 \pmod{23}$ \\ \hline $51 = 3\cdot 17$ & $2,16$ & $2,16 \pmod{23}$ & $2,16 \pmod{23}$ \\ \hline $57 = 3\cdot 19$ & $2,4,18$ & $2,18 \pmod{23}, 4 \pmod{691}$ & $2 \pmod{691}, 4,18 \pmod{23}$ \\ \hline $65 = 5\cdot 13$ & $2,4,6,12$ & $2,4,6,12 \pmod{691}$ & $2 \pmod{691}, 4,6,12 \pmod{23}$ \\ \hline $69 = 3\cdot 23$ & $2,10,22$ & $2,22 \pmod{3^6}, 10 \pmod{23}$ & $2,22 \pmod{3^6}, 10 \pmod{691}$ \\ \hline $85 = 5\cdot 17$ & $2,4,16$ & $2, 4, 16 \pmod{691}$ & $2 \pmod{691}, 4, 16 \pmod{23}$ \\ \hline $87 = 3\cdot 29$ & $2,4,6,28$ & $2, 6, 28 \pmod{23}, 4 \pmod{691}$ & $2 \pmod{691}, 4 \pmod{3^6}, 6,28 \pmod{23}$ \\ \hline $93 = 3\cdot 31$ & $2,4,30$ & $2 \pmod{691}, 4, 30 \pmod{3^6}$ & $2 \pmod{23}, 4 \pmod{3^6}, 30 \pmod{691}$ \\ \hline $95 = 5\cdot 19$ & $2,4,18$ & $2 , 4 , 18 \pmod{691}$ & $2 \pmod{691}, 4, 18 \pmod{23}$ \\ \hline \end{tabular} \end{adjustbox} \vspace{2mm} \caption{Congruences showing that $\tau(p^a) \ne \alpha$ for each pair $(\alpha,a)$}\label{table: congruences} \end{table} \vspace{-1cm} \end{proof} \section{Even Values of \texorpdfstring{$\tau(n)$}{tau(n)}}\label{sec: even} The main result of this section is the following theorem concerning even inadmissible values for the $\tau$-function: \begin{theorem}\label{thm: maineven} If $\alpha$ is any even integer with $\abs{\alpha} < 100$ such that $$\alpha \notin\{2^k:\, k \in \mathbb{Z}^+\} \cup \{0,-24,-48,-70,-90,92,-96\},$$ then $\tau(n) \neq \alpha$ for any $n \in \mathbb{Z}^+$. \end{theorem} \begin{proof} Given the previous results stated in Section~\ref{sec: intro}, it suffices to show that \begin{align}\label{eq: eventaulist} \begin{split} \tau(n) \notin \{&-2, -4, -8, \pm 12, -16, \pm 20, 24, \pm 28, \pm 30, -32, \pm 36, \pm 40, \pm 42, \pm 44, 48, \\ &\pm 52,\pm 56, \pm 60, -64, \pm 66, \pm 68, 70, \pm 72, \pm 76, \pm 78, \pm 80, \pm 84, \pm 88, 90, -92, 96\}, \end{split} \end{align} for all $n \in \mathbb{Z}^+$. We generalize the proof of Theorem 1.1 in \cite{BOT}, and apply the following argument to the values $\alpha$ in \eqref{eq: eventaulist} inductively starting with the $\alpha$ of smallest absolute value (for example, we need to know that $12$ is not an admissible value for the $\tau$-function in order to show that $\tau(n) \neq 24$ for all $n \in \mathbb{Z}^+$). Suppose for the sake of contradiction that for some $\alpha$ in \eqref{eq: eventaulist}, there exists a positive integer $n$ such that $\tau(n) = \alpha$. By the induction hypothesis, the results in Section~\ref{sec: intro}, and Theorem~\ref{thm: mainodd}, Corollary~\ref{lem: npaodd} applies, and so it follows that $n = p^a$ for some prime $p$ and some $a \in \mathbb{Z}^+$. As explained in Section~\ref{sec: prelims}, we can assume that $p \nmid \tau(p)$, so in particular $p \ne 2$. Since $\tau(p^a) = \alpha \equiv 0 \pmod{2}$, it follows by \eqref{eq: deltamod2} that $a$ must be odd. We claim that this implies $a = 1$. Assume otherwise. By Lemma~\ref{lemma: defectivity}, we know $\alpha = \tau(p^a)$ is not a defective term in the Lucas sequence $\{1,\tau(p),\tau(p^2),\dots\}$. Therefore, $\tau(p^a)$ must have a primitive prime divisor $\ell$, which must furthermore be odd since $2 \mid \tau(p)$. Suppose now that $a+1$ has a non-trivial divisor $b$. Then $\tau(p^{b-1})$ divides $\tau(p^a) = \alpha$ by Proposition~\ref{prop: relativedivisibility}. Using Theorem~\ref{thm: mainodd}, the results stated in Section~\ref{sec: intro}, and the induction hypothesis, we check that for any odd prime $\ell$ dividing $\alpha$, any factor of $\alpha$ not divisible by $\ell$ which is not a power of 2 is not an admissible value for the $\tau$-function. Thus, we must have $\tau(p^{b-1}) = 2^k$ for some $1 \le k \le 6$. By Lemma~\ref{lemma: defectivity} and the fact that $2 \mid \tau(p)$, it follows that $b = 2$. We conclude that $2$ is the only possible non-trivial factor of $a+1$, so either $a+1$ is prime or $a+1 = 4$. If $a+1$ is prime, then since $a$ is odd, we must have $a=1$. On the other hand, if $a+1 = 4$, then $\tau(p) = 2^k$ for some $1 \le k \le 6$, and by the recursive relation in Theorem~\ref{thm: properties} (ii), we then get $\alpha = \tau(p^3) =2^{k+1}(2^{2k-1} - p^{11})$. However, for any odd prime $p$, we have $\abs{2^{2k-1} - p^{11}} > 175000 > \abs{\alpha}$, so this is impossible. We conclude that $n = p$ for some odd prime $p$. Finally, the congruences for $\tau(n)$ given in \cite[p. 4]{Mods} imply that for any prime $p \neq 23$, \begin{align}\label{eq: pmod} \begin{split} \tau(p) \equiv 0 &\pmod 2, \quad \tau(p) \equiv 0,2 \pmod 3, \quad \tau(p) \equiv 0,1,2 \pmod 5, \\ \tau(p) &\equiv 0,1,2,4 \pmod 7, \quad \tau(p) \equiv 0,-1,2 \pmod{23}. \end{split} \end{align} However, we check that each $\alpha$ in \eqref{eq: eventaulist} fails to satisfy one of these congruences and $\abs{\tau(23)} > 100$, so we cannot have $\tau(p) = \alpha$. \end{proof} \section{Proof of Theorem~\ref{thm: main}}\label{sec: proofofmain} Theorems~\ref{thm: mainodd} and \ref{thm: maineven} prove Theorem~\ref{thm: main} (v). Moreover, the argument used in the proof of Theorem~\ref{thm: maineven} shows that if $\tau(n) \in \{2,-24,-70,-90,92\}$, then $n = p$ is prime, which proves (i). To show (ii), we proceed by induction on $k$. From (i), we know that if $\tau(n) = 2$, then $n = p$ is prime. Now, if $\tau(n) = 2^k$ and $n = p_1^{a_1} \cdots p_j^{a_j}$, then since $\tau(m) \notin \{-2^k: 0 \le k \le 6\} \cup \{1\}$ for all $m > 1$ by (v), we must have $\tau(p_i^{a_i}) = 2^{c_i}$ for some $c_i > 0$ such that $c_1 + \cdots + c_j = k$. If $j > 1$, then by the induction hypothesis, we have $a_i = 1$ and $\tau(p_i) = 2$ for all $i$, so that in particular $j = k$. Hence, it suffices to consider the case $n=p^a$. As in the proof of Theorem~\ref{thm: maineven}, we can assume $p \nmid \tau(p)$, so that $\{1, \tau(p), \tau(p^2),\cdots\}$ forms a Lucas sequence. By Lemma~\ref{lemma: defectivity}, $\tau(p^a) = 2^k$ is not a defective term. Thus since $2\mid \tau(p)$, we must have $a = 1$. However, $\tau(p) \ne 2^k$ by the congruences in \eqref{eq: pmod}, hence we cannot have $n = p^a$. The proofs of (iii) and (iv) are quite similar: Suppose first that $\tau(n) = -48$. Then given the values ruled out for $\tau(n)$ in (v), we find that either $n=p^a$ or $n = p_1^{a_1} p_2^{a_2}$ for primes $p_1,p_2$ such that $\tau(p_1^{a_1}) = 2$ and $\tau(p_2^{a_2}) = -24$ (in which case $a_1,a_2 = 1$ by part (i)). Therefore, it suffices to exclude the possibility that $\tau(p^a) = -48$. By the argument used in the proof of Theorem~\ref{thm: maineven}, we need only to consider the case $a=1$, at which point $\tau(p) = -48$ is again ruled out by the congruences in \eqref{eq: pmod}. Finally, if $\tau(n) = -96$, then given the values ruled out for $\tau(n)$ in (v) and the cases of $2,4,-24,-48$ handled above, we find that either $n=p^a$ or $n=p_1p_2p_3$ with $\tau(p_1)=\tau(p_2)=2$ and $\tau(p_3)=-24$. As before, to rule out the case $\tau(p^a) = -96$, we note that the proof of Theorem~\ref{thm: maineven} implies that we must have $a=1$, which is impossible by the congruences in \eqref{eq: pmod}. \qed
\section{Introduction} In the era of information explosion, Recommender Systems (RSs) play critical roles in providing users with interesting contents in many online applications such as e-commerce or music application. Most conventional RSs discover the users' preferences based on their long-term interaction history with items, and then predict the next item of interest based on their preferences \cite{mf, bpr, caser, fpmc}. However, most users (i.e., users without logging in) tend not to leave their profiles while browsing online services \cite{srgnn, fgnn, csrm, gcegnn}. That is, in numerous real-world online services, what RSs can refer to are the short-term (e.g., in a day) sequences of item consumption (i.e., \emph{sessions}) left by anonymous users. Accordingly, Session-based Recommender Systems (SRSs) have been actively developed to provide more accurate recommendations for the next items of the sessions without any user-dependent information. \begin{figure}[t] \centering \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=\textwidth, trim={0.0cm 0.0cm 0cm 0.0cm}, clip] {figures/intro_seq.pdf} \caption{Sequence-aware RS} \label{fig:intro_seq} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=\textwidth, trim={0.0cm 0.3cm 0cm 0.6cm}, clip] {figures/intro_sess.pdf} \caption{SRS} \label{fig:intro_sess} \end{subfigure} \vspace{-0.2cm} \caption{Difference between the amount of information available in sequence-aware RSs and SRSs. The gray dotted lines indicate the unavailable information in SRSs.} \vspace{-0.4cm} \end{figure} The absence of the user-dependent information causes a challenge for the SRSs. With the user-dependent information, sequence-aware RSs which utilize the whole interaction sequence of each user can model a user's \emph{general (or long-term) interest} via a sequence modeling or a user embedding \cite{sasrec, attrec}, in addition to the \emph{short-term (or current) interest} within the last few interactions (Fig. \ref{fig:intro_seq}). The general interest of a user is the user's individual preference which changes slowly over time, and discovering it increases the recommendation performance as it influences the user's next behavior along with the user's short-term interest \cite{generalinterest1, generalinterest2, generalinterest3}. However, SRSs, only using the anonymous sessions, capture only the short-term interest within the sessions and have a limitation in directly deriving the user's general interest (Fig. \ref{fig:intro_sess}). Although many SRSs have been developed recently, this limitation has not been addressed. Most existing methods focus on how to effectively extract useful information from a single session \cite{gru4rec, narm, stamp, srgnn, fgnn}, and thus cannot consider the relationships between sessions. To address this problem, some recent methods define the relationships using the item co-occurrence between the sessions and achieve the state-of-the-art recommendation performances \cite{csrm, gcegnn}. However, they do not consider the relationships between sessions that are more complex than the item co-occurrence. Several studies pointed out that the general interest of users is too complex to model only with relationships based on the item co-occurrence \cite{hybridsvd, magnn}. Therefore, the existing methods that employ a static rule based on the item co-occurrence to define the relationships between sessions are insufficient to capture the general interest of users. To overcome the limitation of the SRSs, we propose a novel SRS framework named ProxySR\xspace, which imitates the missing information (i.e., general interest of users) by modeling \emph{proxies}, each of which encodes information shared by multiple sessions. ProxySR\xspace is designed inspired by the following characteristics of general interest: 1) multiple sessions have similar general interests in them (i.e., multiple sessions are created by a user who has a steady general interest), and 2) the general interest can compensate for the missing information in SRSs other than the short-term interest in predicting the next item. Specifically, in addition to the session encoder capturing the short-term interest within the input session, ProxySR\xspace includes a separate component that \emph{selects a proxy} from a set of proxies in an unsupervised manner. The encoded short-term interest and the selected proxy are combined, and the two modeling components are jointly learned in an end-to-end manner to accurately predict the next item of the input session. Through the joint learning, ProxySR\xspace learns how to select a suitable proxy to fill in the missing information other than the short-term interest in predicting the next item, and at the same time, the proxy selected by several sessions learns the information common to those sessions. Moreover, we establish another real-world situation of SRSs where a few users are logged-in and leave their identifiers in sessions, and propose a revision of ProxySR\xspace for the situation. In this situation, ProxySR\xspace can assign more suitable proxies using the user identifiers to provide more accurate predictions. Our extensive experiments on real-world datasets show that ProxySR\xspace considerably outperforms the state-of-the-art competitors. Our analyses also show that the proxies actually imitate the general interest of users without any user-dependent information, and play an important role in predicting the next item of sessions. Lastly, we show that ProxySR\xspace provides more accurate recommendations as the ratio of known users increases. \vspace{-0.2cm} \section{Related Work} \subsection{Session-based Recommender Systems} SRSs aim at predicting the next item of each session. Without any user-dependent information, the only information that SRSs can utilize is the chronologically-ordered item sequence in each session which implies the short-term interest of user. Accordingly, some existing methods focus on how to effectively modeling the information in each single session. For example, GRU4Rec \cite{gru4rec} uses GRU \cite{gru} which takes the embeddings of items in a session as input, to model the sequential patterns in the session. NARM \cite{narm} summarizes the hidden states of GRU using an attention module, to model the user's main purpose and sequential patterns in the session. STAMP \cite{stamp} incorporates each item information in a session according to its similarity to the last item based on an attention mechanism, to focus on the most recent interest. SASRec \cite{sasrec} uses a self-attention network to capture the user's preference within a sequence. SR-GNN \cite{srgnn}, which is the first attempt to express the sessions in directed graphs, captures the complex transitions of items in a session via graph neural networks. FGNN \cite{fgnn} introduces an attentional layer and a new readout function in graph neural networks to consider the latent order rather than the chronological item order in a session. RepeatNet \cite{repeatnet} first predicts whether the next item will be a repeat consumption or a new item, and then predicts the next item for each case. GRec \cite{grec} leverages future data as well when learning the preferences for target items in a session for richer information in dilated convolutional neural networks. However, these methods cannot consider the relationships between sessions, as they use only the information within a single session. To overcome this limitation, some recent methods define the relationships between sessions using the item co-occurrence between them. CSRM \cite{csrm} incorporates information of the latest few sessions according to their similarity to the current session. CoSAN \cite{cosan} extends CSRM to find out the similar sessions for each item, not for each session. GCE-GNN \cite{gcegnn}, which shows the state-of-the-art recommendation performance, constructs a global graph that models pairwise item-transitions over sessions. However, all these approaches do not consider the general interest of users, which is important to increase the recommendation performance but too complex to be captured only by the relationships based on the item co-occurrence between sessions \cite{hybridsvd, magnn}. \begin{figure*}[t] \centering \includegraphics[width=1.5\columnwidth, trim={1.0cm 0.4cm 1.6cm 1.2cm}, clip]{figures/model.pdf} \vspace{-0.2cm} \caption{The overall architecture of ProxySR\xspace.} \vspace{-0.2cm} \label{fig:model} \end{figure*} \vspace{-0.2cm} \subsection{Learning with Proxies} Recently, there have been many attempts to learn the model using proxies, each of which is a representative of several instances, in order to revise a conventional operation between the instances. For example, in computer vision, Proxy-NCA \cite{proxynca} firstly employed the proxy triplets in metric learning instead of the triplets of data instances, which reduces the number of triplets and improves the robustness of the model against noisy labels. SoftTriple \cite{softtriple} assigns multiple proxies for an image class, as a class may contain multiple local clusters due to the intra-class variance. Although it is adopted to various methods, the main role of a proxy in them is to learn common information about a set of data instances. Likewise, a proxy in ProxySR\xspace models the information common to several sessions and serves as a representative of them. A distinctive characteristic of the proxy in ProxySR\xspace is that it imitates the general interest of a user, by being shared across several sessions and used in combination with the short-term interest. As a result, ProxySR\xspace provides more accurate recommendations by alleviating the problem of SRSs mentioned above. \vspace{-0.1cm} \section{Method} This section first introduces the task of SRSs and the notation in this paper (Section \ref{section:problemformulation}), then describes the details of ProxySR\xspace (Fig. \ref{fig:model}). ProxySR\xspace selects a proxy for the input session (Section \ref{section:proxyselection}) and encodes the session into a short-term interest representation (Section \ref{section:shortterminterestencoder}), and then uses the aggregation of them to define the distance function between the session and the target item (Section \ref{section:combination}). Finally, the loss function for training ProxySR\xspace is proposed using the distance function (Section \ref{section:training}). Moreover, we establish another real-world scenario for SRSs, and propose a revised version of ProxySR\xspace for the scenario (Section \ref{section:realistic}). \subsection{Problem Formulation and Notation} \label{section:problemformulation} In this paper, we aim to recommend the next item for an input session. Let $\mathbf{I} \in \mathbb{R}^{N \times d}$ denote the item embedding matrix where $N$ is the number of items and $d$ is the embedding size. Given a session $s = [s_1, s_2, ..., s_n]$, where $s_* \in \{1, 2, ..., N\}$ is the index of an item in session $s$, $n$ is the number of items in $s$ (i.e., $n=|s|$), and the interactions are chronologically-ordered, our goal is to recommend top-$k$ items as the next item $s_{n+1}$. In the training phase, the model is trained to predict every item $s_t$ ($t \le n$) in $s$ using $[s_1, s_2, ..., s_{t-1}]$. Throughout this paper, we use a bold capital letter for a matrix (e.g., $\mathbf{I}$, $\mathbf{P}$), a bold small letter for a vector (e.g., $\mathbf{p}$, $\boldsymbol{\pi}$), a superscript $P$ for a modeling component for the proxy selection (e.g., $\mathbf{W}^{P,(1)}$, $\mathbf{E}^{P}$), and a superscript $S$ for a modeling component for the short-term interest encoder (e.g., $\mathbf{W}^{S,(1)}$, $\mathbf{E}^{S}$). Also we denote the $i$-th vector (or element) of a matrix (or vector) as a subscript $i$ (e.g., $\mathbf{I}_{s_j}$, $\boldsymbol{\pi}_j$). \subsection{Proxy Selection} \label{section:proxyselection} This section describes how ProxySR\xspace obtains a proxy $\mathbf{p}^{(s)}$ for an input session $s$. Given an input session, ProxySR\xspace selects a proxy from the predefined set of proxies in an unsupervised manner, and combines it with the encoded short-term interest to make the final representation of the session. Through the end-to-end learning, the modeling component for proxy selection learns how to select a suitable proxy for an input session, and the selected proxy learns the information common to the sessions that select the proxy. As the proxy fills in the missing information other than the short-term interest in predicting the next item, the proxy imitates the general interest of the user. To this end, ProxySR\xspace first uses the input session $s$ to build a skewed probability distribution to select a proxy embedding from a predefined set of $K$ proxy embeddings. More specifically, ProxySR\xspace utilizes an encoder network to produce logits of the probabilities, and then converts them to the skewed probability distribution $\boldsymbol{\pi} \in \mathbb{R}^K$ using a softmax function with a temperature parameter \cite{temperature} as follows: \begin{equation} \begin{split} \boldsymbol{\alpha} &= f^P(s) \\ \boldsymbol{\pi}_{j} &= {\frac{\exp({\boldsymbol{\alpha}_j / \tau})} {\sum_{j'=1}^K \exp({\boldsymbol{\alpha}_{j'} / \tau})}} \text{ for } j \in \{1, 2, ..., K\} \end{split} \label{equation:alpha} \end{equation} where $f^P$ is an encoder network for a session where $f^P(s) \in \mathbb{R}^{K}$, $K$ is the predefined number of proxies, $\boldsymbol{\pi}_{j}$ is the probability for the $j$-th proxy, and $\tau > 0$ is the temperature parameter. As $\tau$ gets smaller, $\boldsymbol{\pi}$ becomes a hard distribution close to a one-hot vector, and as $\tau$ gets larger, $\boldsymbol{\pi}$ becomes a uniform distribution where every element is close to $1/K$. Therefore, we assign a large initial value to $\tau$ and decrease it as the training progresses, because if the initial value of $\tau$ is small, the gradients are skewed to few logits, which is not desirable for the unstable initial training \cite{gumbel, temperature}. Finally, we obtain the proxy embedding $\mathbf{p}^{(s)}$ for session $s$ as follows: \begin{equation} \begin{split} \gamma &= {\frac{\sum_{j=1}^K \left\lVert \boldsymbol{\pi}_{j} \mathbf{P}_j \right\rVert_2} {\left\lVert \sum_{j=1}^K \boldsymbol{\pi}_{j} \mathbf{P}_j \right\rVert_2}} \\ \mathbf{p}^{(s)} &= \gamma \cdot \sum_{j=1}^K \boldsymbol{\pi}_{j} \mathbf{P}_j \end{split} \label{equation:pi1} \end{equation} where $\mathbf{P} \in \mathbb{R}^{K \times d}$ is the proxy embedding matrix. When $\tau$ is small enough after several training epochs, $\boldsymbol{\pi}$ becomes a one-hot vector and only one proxy embedding is selected from the set. When $\tau$ is large in the initial training phase, the scale of obtained proxy can be too small because each of the proxies is randomly initialized with a mean of zero and is uniformly aggregated to cancel out each other. Therefore, we prevent this problem by rescaling the obtained proxy with $\gamma$ which forces its $l_2$-norm to maintain the weighted mean of the $l_2$-norms of proxies. \subsubsection{Implementation Details} Any encoder network for a sequence that captures the sequential pattern in the input sequence can be used as $f^P$. In our experiments, as a non-linear network for sessions of any length, we use two-layer point-wise feed-forward networks for the item embeddings in a session and take the average of the outputs as the logits. Also we add a learnable positional embedding \cite{bert, positionalembedding} to each item embedding, which encodes information about its position, in order to model the sequential pattern. That is, the encoder network for proxy selection in our experiments is built as follows: \begin{equation} f^P(s)={\frac{1} {n}} \sum_{j=1}^{n} {\mathbf{W}^{P,(2)}}^\top \sigma \left( {\mathbf{W}^{P,(1)}}^\top \left(\mathbf{I}_{s_j} + \mathbf{E}^P_j \right) \right) \end{equation} where $\mathbf{E}^P_j \in \mathbb{R}^{d}$ is the learnable positional embedding for the $j$-th position, and $\mathbf{W}^{P,(1)} \in \mathbb{R}^{d \times \lfloor(d+K)/2\rfloor}$, $\mathbf{W}^{P,(2)} \in \mathbb{R}^{\lfloor(d+K)/2\rfloor \times K}$ are the weight matrices. $\sigma$ is the Leaky ReLU activation function \cite{leakyrelu} with negative slope 0.1. Note that in the training phase, we employ the proxy which is selected by the whole session $s$ (i.e., $\mathbf{p}^{(s)}$) even when predicting each item $s_t$ $(t \le n)$ using $[s_1, s_2, ..., s_{t-1}]$, because each item in a session is generated with a consistent general interest of a user. Thus $\mathbf{p}^{(s)}$ learns its relationships with all items in $s$. \subsubsection{Discussion} To build a representation that imitates a general interest, ProxySR\xspace \emph{selects} a proxy via the softmax with a temperature parameter, rather than a weighted combination of several proxies using an ordinary softmax function. A weighted combination of several proxies produces a unique representation for each input session, which is equivalent to encoding a session into a representation. However, since the general interest is difficult to be fully encoded with only the information within a single session, we cannot guarantee that the weighted combination models the general interest which is common to several sessions. Alternatively, ProxySR\xspace models the proxies which imitate the general interests by selecting the most probable proxy, and jointly training the selected proxy with the short-term interest of the session. Thus, a proxy in ProxySR\xspace, which is shared across the sessions that select the proxy, encodes the information common to the sessions. In Section \ref{section:experiments}, we provide the analyses that show the superiority of proxy selection compared to the weighted combination. \vspace{-0.2cm} \subsection{Short-term Interest Encoder} \label{section:shortterminterestencoder} The short session itself represents the short-term (or current) interest of the user \cite{longshort2}. Therefore, ProxySR\xspace encodes the input session $s$ with an encoder network into a latent representation $\mathbf{s}^{(s)}$ and uses it as the short-term interest within the session: Specifically, we can obtain the short-term interest representation for the input session $s$ as follows: \begin{equation} \vspace{-0.05cm} \mathbf{s}^{(s)} = f^S(s) \vspace{-0.05cm} \end{equation} where $f^S$ is a session encoder which encodes the session into a latent representation (i.e., $f^S(s) \in \mathbb{R}^{d}$), and $\mathbf{s}^{(s)} \in \mathbb{R}^{d}$ is the representation of short-term interest within session $s$. \vspace{-0.1cm} \subsubsection{Implementation Details} Any session encoder can be adopted as $f^S$. In the experiments, we adopt a self-attention network \cite{transformer, sasrec} with residual connection \cite{resnet}, which effectively models a sequence considering the dependendies between the items in the sequence. Our short-term interest representation for the input sessions $s$ can be obtained as follows: \begin{equation} \begin{split} \mathbf{X} &= [\mathbf{I}_{s_1} + \mathbf{E}^S_{n}, \mathbf{I}_{s_2} + \mathbf{E}^S_{n-1}, ..., \mathbf{I}_{s_{n}} + \mathbf{E}^S_1]^\top \\ \mathbf{Q} &= \text{ReLU}(\mathbf{X} \mathbf{W}^{S,(Q)})\\ \mathbf{K} &= \text{ReLU}(\mathbf{X} \mathbf{W}^{S,(K)})\\ \mathbf{A} &= \text{softmax}\left( \frac{\mathbf{Q} \mathbf{K}^\top} {\sqrt{d}} \right)\\ \mathbf{Z} &= \mathbf{A} \mathbf{X} + \mathbf{X}\\ f^S (s) &= {\mathbf{W}^{S,(2)}}^\top \text{ReLU}\left({\mathbf{W}^{S,(1)}}^\top \mathbf{Z}_n + \mathbf{b}^{S,(1)} \right) + \mathbf{b}^{S,(2)} \end{split} \vspace{-0.4cm} \end{equation} where $\mathbf{E}^S_j$ is the learnable positional embedding for the $j$-th recent interaction, $\mathbf{X} \in \mathbb{R}^{n \times d}$ is a representation of session $s$ as the input to $f^S$. $\mathbf{W}^{S,(Q)}$, $\mathbf{W}^{S,(K)}$, $\mathbf{W}^{S,(1)}$, $\mathbf{W}^{S,(2)}$ $\in$ $\mathbb{R}^{d \times d}$ are the weight matrices, and $\mathbf{b}^{S,(1)}$, $\mathbf{b}^{S,(2)}$ $\in$ $\mathbb{R}^{d}$ are the biases. Note that the positional embeddings for short-term interest encoder are assigned in reverse chronological order, to model the impact of the recent items on the short-term interest \cite{sasrec}. \vspace{-0.2cm} \subsection{Combination} \label{section:combination} ProxySR\xspace adds the selected proxy and the encoded short-term interest to make the final representation of session $s$, and uses it to compute the dissimilarity score between the session and the target item $i$. Finally, $K$ items with the smallest dissimilarity score with $s$ are recommended. However, according to some precedent studies \cite{transh, transr}, a simple addition cannot model relationships within a triplet that are more complex than a one-to-one relationship. In other words, if the same item has to be related to two different short-term interests with the same proxy, the model forces the two short-term interests to be similar (i.e., if $\mathbf{p} + \mathbf{s}^{(1)} \approx \mathbf{I}_i$ and $\mathbf{p} + \mathbf{s}^{(2)} \approx \mathbf{I}_i$, then $\mathbf{s}^{(1)} \approx \mathbf{s}^{(2)}$). Likewise, if two items have to be related to the similar short-term interests with the same proxy, the model forces the two items to be similar (i.e., if $\mathbf{p} + \mathbf{s}^{(1)} \approx \mathbf{I}_{i^{(1)}}$ and $\mathbf{p} + \mathbf{s}^{(2)} \approx \mathbf{I}_{i^{(2)}}$ where $\mathbf{s}^{(1)} \approx \mathbf{s}^{(2)}$, then $\mathbf{I}_{i^{(1)}} \approx \mathbf{I}_{i^{(2)}}$). As SRSs may have such complex relationships, the model should be designed to capture them. To this end, we project the encoded short-term interest and the target item embedding onto a hyperplane for the selected proxy and define the relationship between them on the hyperplane \cite{transh}. Thus, different items (or short-term interests) can have the same representation on a hyperplane, allowing ProxySR\xspace to capture the complex relationships. Specifically, we first obtain the projected short-term interest $\mathbf{s}^{(s)}_\bot$ and the projected target item embedding ${\mathbf{I}_{i}}_\bot$ on the proxy's hyperplane as follows: \begin{equation} \begin{split} \mathbf{v} &= {\frac{\sum^K_{j=1} \boldsymbol{\pi}_j \mathbf{V}_j} {\left\lVert \sum^K_{j=1} \boldsymbol{\pi}_j \mathbf{V}_j \right\rVert_2}}\\ \mathbf{s}^{(s)}_{\bot} &= \mathbf{s}^{(s)} - \mathbf{v}^\top \mathbf{s}^{(s)} \mathbf{v}\\ {\mathbf{I}_i}_\bot &= \mathbf{I}_i - \mathbf{v}^\top \mathbf{I}_{i} \mathbf{v}\\ \end{split} \label{equation:pi2} \end{equation} where $\mathbf{V} \in \mathbb{R}^{K \times d}$ is the unit normal vector set for the proxy hyperplanes \cite{transh}, and $\mathbf{v} \in \mathbb{R}^{d}$ is the unit normal vector for projecting onto the hyperplane for $\mathbf{p}^{(s)}$. For the normal vector to be orthogonal to the proxy's hyperplane and to have the unit length, we force $|\mathbf{v} \cdot \mathbf{p}^{(s)}| / \lVert \mathbf{p}^{(s)} \rVert_2 \le \epsilon$ and $\lVert \mathbf{V}_j \rVert_2 = 1$ with regularizers. Lastly, the dissimilarity score between session $s$ and target item $i$ is estimated with the distance between the projected item embedding and the aggregation of the proxy and the projected short-term interest. We compute the dissimilarity score as follows: \begin{equation} dist(s, i) = \left\lVert \left( \mathbf{p}^{(s)} + \mathbf{s}^{(s)}_{\bot} \right)- {\mathbf{I}_{i}}_\bot \right\rVert^2_2 \end{equation} As a result, a higher $dist(s, i)$ value implies a lower probability of $i$ as the next item of session $s$. \subsection{Training} \label{section:training} We use the marginal loss (i.e., hinge loss) \cite{cml, transcf} to train ProxySR\xspace, so that the true next item of a session becomes closer to the session compared to the other items. In addition, we adopt the orthogonality regularizer for the unit normal vector $\mathbf{v}$ and the distance regularizer introduced in \cite{transcf}, which explicitly forces the session representation close to the target item embedding. Firstly, we define the loss function $\mathcal{L}$ as follows: \begin{equation} \begin{split} \mathcal{L} &= \sum_{\{s, i^+\} \in \mathcal{S}} \sum_{i^- \in NI(s)} [m + dist(s, i^+) - dist(s, i^-)]_+ \\ \end{split} \end{equation} where $\mathcal{S}$ is the training dataset of sessions and their true next item, $i^+$ is the true next item of session $s$, $NI(s) \subset \mathbf{I} \backslash i^+$ is a set of the negative items of $s$, $[x]_+=\max(x,0)$, and $m$ is the margin. Including the regularizers, we define our final objective function $\mathcal{J}$ to minimize as follows: \begin{equation} \begin{split} \text{reg}^{\text{dist}} &= \sum_{\{s, i^+\} \in \mathcal{S}} dist(s, i^+)\\ \text{reg}^{\text{orthog}} &= \sum_{\{s, i^+\} \in \mathcal{S}} {\frac{|\mathbf{v}^{(s)} \cdot \mathbf{p}^{(s)}|} {\lVert \mathbf{p}^{(s)} \rVert_2}}\\ \mathcal{J} &= \mathcal{L} + \lambda^{\text{dist}} \cdot \text{reg}^{\text{dist}} + \lambda^{\text{orthog}} \cdot \text{reg}^{\text{orthog}} \end{split} \end{equation} where $\mathbf{v}^{(s)}$ is $\mathbf{v}$ for session $s$, and $\lambda^{\text{dist}}, \lambda^{\text{orthog}}$ are the regularization coefficients for the distance regularizer and the orthogonality regularizer, respectively. \vspace{-0.2cm} \subsection{Another Real-world Case: User Semi-supervision} \label{section:realistic} Several studies on user behavior in the online environment report that in real world, about 50\% to 70\% of users browse the items without logging in, while the others log in and leave their user identifiers \cite{user1, user2, user3}. In this real-world scenario, the ground-truth user information can provide ProxySR\xspace with information about which proxy to select for the input session. In this regard, for an input session that has its user information, we add a user bias to the logits (i.e., $\boldsymbol{\alpha}$ in Equation (\ref{equation:alpha})) for selecting a proxy, modeling the users' inclination for particular proxies. The other sessions without user information use the original logits. Thus, we only increase the probability of selecting a preferred proxy for the users, rather than forcing to assign a particular proxy according to the user information, to flexibly model which proxy the each user prefers. Specifically, for the sessions that have their user information, $\boldsymbol{\pi}$ in Equation (\ref{equation:pi1}) and (\ref{equation:pi2}) for selecting a proxy can be replaced with $\boldsymbol{\pi}^{\text{user}}$ as follows: \vspace{-0.4cm} \begin{equation} \begin{split} \boldsymbol{\pi}^{\text{user}}_{j}={\frac{\exp\left({(\boldsymbol{\alpha}_{j} + \mathbf{u}^{(s)}_{j}) / \tau}\right)} {\sum^K_{j'=1} \exp\left({(\boldsymbol{\alpha}_{j'} + \mathbf{u}^{(s)}_{j'}) / \tau}\right)}}\\ \end{split} \label{equation:pi_user} \end{equation} where $\mathbf{u}^{(s)} \in \mathbb{R}^K$ is the learnable user bias for the user of session $s$. In Section \ref{section:experiments}, we provide the experimental results in this scenario that report the performance improvement according to the ratio of known users. \vspace{-0.2cm} \section{Experiments} \label{section:experiments} In this section, we provide the experimental results and analyses on ProxySR\xspace and other state-of-the-art baselines. Our experiments are designed to answer the following research questions. \begin{itemize} \item \textbf{RQ1}: How does ProxySR\xspace perform compared to the other state-of-the-art baselines for the task of recommending the next item that have not appeared in the session? \item \textbf{RQ2}: How does ProxySR\xspace perform for the task of next item recommendation that contains repetitive consumption? \item \textbf{RQ3}: Does each component and design choice in ProxySR\xspace contributes to the performance significantly? \item \textbf{RQ4}: What information do the proxy embeddings encode? \item \textbf{RQ5}: Is the additional user information in the proposed real-world case beneficial to ProxySR\xspace? \end{itemize} \vspace{-0.3cm} \subsection{Experimental Settings} \subsubsection{Datasets} We conducted our experiments on three public datasets: \emph{RetailRocket}\footnote{https://www.kaggle.com/retailrocket/ecommerce-dataset}, \emph{Diginetica}\footnote{https://competitions.codalab.org/competitions/11161}, and \emph{LastFM}\footnote{http://ocelma.net/MusicRecommendationDataset/lastfm-1K.html} \cite{lastfm}. Table \ref{table:datasets} summarizes the statistics of each dataset. For datasets without the session information (i.e., RetailRocket and LastFM), we first divided each user's interactions in a day into sessions and anonymized the sessions. Then, for all datasets, we split the sessions in each dataset into train/validation/test set in chronological order in a ratio of 8:1:1. Also we filtered out items in validation and test set which did not appear in the training set \cite{narm, stamp, csrm}. \textbf{RetailRocket} contains the users' interactions (i.e., clicks) collected from a real-world e-commerce website. This dataset is the smallest dataset we used, and has the shortest session length on average. To evaluate the models' performance on short sessions, we filtered out only the sessions that contain less than two items. \textbf{Diginetica} has anonymous sessions of search logs from an e-commerce website. As the interactions in this dataset have their session id, we use the session ids to establish the sessions. We filtered out items that appear less than five times, and sessions with less than three items are excluded. \textbf{LastFM} has users' music listening history. We consider an artist as an item, and used this dataset for artist recommendation \cite{repeatnet, csrm}. We filtered out items that appear less than five times, and sessions with less than three interactions or more than fifty interactions. \subsubsection{Evaluation} For all the baselines, we ranked the true next item of each session in the test set among all the other items and used two widely-used metrics for ranking to evaluate the performance of top-$k$ recommendation \cite{narm, fgnn, csrm, grec}: recall (R@$k$) and mean reciprocal rank (M@$k$). We use several values for $k$: 5, 10, 20. \subsubsection{Baselines} We compare the performance of ProxySR\xspace with the following state-of-the-art baselines: \begin{itemize} \item \textbf{GRU4Rec} \cite{gru4rec} encodes the session sequence into the final representation with GRU units. \item \textbf{NARM} \cite{narm} is an RNN-based model with an attention layer that models the user's sequential behavior and main purpose. \item \textbf{STAMP} \cite{stamp} employs an attention mechanism to summarize a session based on the recent interest (i.e., the last item). \item \textbf{SASRec} \cite{sasrec} adopts a self-attention network to capture the user's preference within a sequence. \item \textbf{RepeatNet} \cite{repeatnet} employs a repeat-explore mechanism to predict repetitive interactions in a session. \item \textbf{SR-GNN} \cite{srgnn} expresses a session in a graph and encodes it with graph neural networks and an attention mechanism. \item \textbf{FGNN} \cite{fgnn} extends SR-GNN to model the latent order in the session with an attentional layer and a new readout function. \item \textbf{CSRM} \cite{csrm} utilizes memory networks to incorporate the neighbor sessions of the input session. \item \textbf{GRec} \cite{grec} leverages future data in a session as well when learning the preference of the session for richer information in dilated convolutional neural networks. \item \textbf{GCE-GNN} \cite{gcegnn} is the state-of-the-art SRS that constructs a global graph that models pairwise item-transitions over all sessions as well as the session graphs. \end{itemize} \begin{table}[t] \fontsize{8}{9}\selectfont \caption{Statistics of datasets. \# sessions is the number of sessions before the sessions are divided into sub-sessions.} \vspace{-0.3cm} \begin{tabular}{c|rrr} \hline Dataset & \multicolumn{1}{c}{RetailRocket} & \multicolumn{1}{c}{Diginetica} & \multicolumn{1}{c}{LastFM} \\ \hline \# interactions & 170,488 & 713,308 & 5,103,585 \\ \# items & 38,736 & 33,950 & 33,531 \\ \# sessions & 47,705 & 101,691 & 229,760 \\ avg. length & 3.57 & 7.01 & 22.21 \\ \hline \end{tabular} \label{table:datasets} \vspace{-0.3cm} \end{table} We omitted conventional recommendation systems that require the user information (e.g., MF \cite{mf}, BPR \cite{bpr}, FPMC \cite{fpmc}, Caser \cite{caser}, and HRNN \cite{hrnn}). \begin{table*}[t] \fontsize{8}{8.5}\selectfont \setlength{\tabcolsep}{2pt} \centering \caption{Overall performance on the next unseen item recommendation. \emph{Imprv.} is the improvement of the performance from ProxySR\xspace compared to the best performance among the other baselines. The best results are highlighted in boldface, and the second best results are underlined. } \vspace{-0.2cm} \begin{tabular}{c|c|cccccccccc|c|c} \hline Dataset & Metric & GRU4Rec & NARM & STAMP & SASRec & RepeatNet & SR-GNN & FGNN & CSRM & GRec & GCE-GNN & ProxySR\xspace & Imprv.(\%) \\ \hline \multirow{6}{*}{RetailRocket} & R@5 & 0.1182 & 0.1322 & 0.0780 & 0.1834 & 0.1073 & 0.1746 & 0.1308 & 0.1385 & 0.1393 & \underline{0.1876} & \textbf{0.2449} & 30.54\% \\ & M@5 & 0.0827 & 0.0786 & 0.0526 & 0.1145 & 0.0716 & 0.1126 & 0.0819 & 0.0815 & 0.0832 & \underline{0.1173} & \textbf{0.1454} & 23.96\% \\ & R@10 & 0.1513 & 0.1741 & 0.0958 & 0.2326 & 0.1289 & 0.2151 & 0.1708 & 0.1954 & 0.1852 & \underline{0.2342} & \textbf{0.3300} & 40.91\% \\ & M@10 & 0.0871 & 0.0842 & 0.0551 & 0.1197 & 0.0746 & 0.1180 & 0.0874 & 0.0892 & 0.0881 & \underline{0.1230} & \textbf{0.1567} & 27.40\% \\ & R@20 & 0.1752 & 0.2178 & 0.1092 & 0.2781 & 0.1544 & 0.2570 & 0.2061 & 0.2469 & 0.2289 & \underline{0.2787} & \textbf{0.4053} & 45.43\% \\ & M@20 & 0.0888 & 0.0873 & 0.0560 & 0.1245 & 0.0763 & 0.1209 & 0.0898 & 0.0928 & 0.0914 & \underline{0.1274} & \textbf{0.1622} & 27.32\% \\ \hline \multirow{6}{*}{Diginetica} & R@5 & 0.1124 & 0.1120 & 0.1090 & 0.1266 & 0.0959 & 0.1373 & 0.1339 & 0.1374 & 0.1313 & \underline{0.1467} & \textbf{0.1737} & 18.40\% \\ & M@5 & 0.0569 & 0.0565 & 0.0562 & 0.0643 & 0.0500 & 0.0712 & 0.0693 & 0.0693 & 0.0673 & \underline{0.0753} & \textbf{0.0906} & 20.32\% \\ & R@10 & 0.1879 & 0.1893 & 0.1808 & 0.2082 & 0.1544 & 0.2234 & 0.2164 & 0.2260 & 0.2166 & \underline{0.2321} & \textbf{0.2760} & 18.91\% \\ & M@10 & 0.0668 & 0.0681 & 0.0657 & 0.0750 & 0.0578 & 0.0826 & 0.0801 & 0.0809 & 0.0786 & \underline{0.0853} & \textbf{0.1041} & 22.04\% \\ & R@20 & 0.2963 & 0.2995 & 0.2785 & 0.3234 & 0.2326 & 0.3386 & 0.3297 & 0.3454 & 0.3321 & \underline{0.3573} & \textbf{0.4069} & 13.88\% \\ & M@20 & 0.0741 & 0.0753 & 0.0724 & 0.0830 & 0.0631 & 0.0905 & 0.0879 & 0.0895 & 0.0865 & \underline{0.0931} & \textbf{0.1130} & 21.37\% \\ \hline \multirow{6}{*}{LastFM} & R@5 & 0.0480 & 0.0455 & 0.0502 & 0.0523 & 0.0483 & 0.0564 & 0.0506 & 0.0502 & 0.0450 & \underline{0.0589} & \textbf{0.0640} & 8.66\% \\ & M@5 & 0.0248 & 0.0235 & 0.0260 & 0.0282 & 0.0249 & 0.0310 & 0.0242 & 0.0255 & 0.0233 & \underline{0.0317} & \textbf{0.0335} & 5.68\% \\ & R@10 & 0.0795 & 0.0752 & 0.0821 & 0.0846 & 0.0794 & 0.0910 & 0.0897 & 0.0843 & 0.0744 & \underline{0.0939} & \textbf{0.1025} & 9.16\% \\ & M@10 & 0.0289 & 0.0274 & 0.0302 & 0.0324 & 0.0290 & 0.0355 & 0.0290 & 0.0300 & 0.0270 & \underline{0.0366} & \textbf{0.0385} & 5.19\% \\ & R@20 & 0.1258 & 0.1207 & 0.1301 & 0.1318 & 0.1270 & 0.1423 & 0.1399 & 0.1341 & 0.1198 & \underline{0.1468} & \textbf{0.1589} & 8.24\% \\ & M@20 & 0.0321 & 0.0305 & 0.0334 & 0.0356 & 0.0322 & 0.0390 & 0.0320 & 0.0334 & 0.0301 & \underline{0.0402} & \textbf{0.0424} & 5.47\% \\ \hline \end{tabular} \label{table:main1} \vspace{-0.2cm} \end{table*} \begin{table*}[t] \fontsize{8}{8.5}\selectfont \setlength{\tabcolsep}{2pt} \centering \caption{Overall performance on the next item recommendation with repetitive consumption. \emph{Imprv.} is the improvement of the performance from ProxySR\xspace compared to the best performance among the other baselines. The best results are highlighted in boldface, and the second best results are underlined.} \vspace{-0.2cm} \begin{tabular}{c|c|cccccccccc|c|c} \hline Dataset & Metric & GRU4Rec & NARM & STAMP & SASRec & RepeatNet & SR-GNN & FGNN & CSRM & GRec & GCE-GNN & ProxySR\xspace & Imprv.(\%) \\ \hline \multirow{6}{*}{RetailRocket} & R@5 & 0.3840 & 0.4056 & 0.3361 & 0.3980 & 0.4357 & 0.4133 & 0.4093 & {\underline{0.4462}} & 0.4118 & 0.4346 & \textbf{0.5222} & 17.03\% \\ & M@5 & 0.2797 & 0.3008 & 0.2449 & 0.2707 & 0.3105 & 0.2914 & 0.2933 & {\underline{0.3139}} & 0.3016 & 0.3108 & \textbf{0.3613} & 15.10\% \\ & R@10 & 0.4341 & 0.4475 & 0.3989 & 0.4648 & 0.4540 & 0.4714 & 0.4410 & {\underline{0.5245}} & 0.4662 & 0.5114 & \textbf{0.5922} & 12.91\% \\ & M@10 & 0.2866 & 0.3064 & 0.2523 & 0.2798 & 0.3143 & 0.2994 & 0.3007 & {\underline{0.3246}} & 0.3071 & 0.3178 & \textbf{0.3718} & 14.54\% \\ & R@20 & 0.4758 & 0.4921 & 0.4304 & 0.5093 & 0.4697 & 0.5209 & 0.4918 & {\underline{0.5774}} & 0.5151 & 0.5582 & \textbf{0.6528} & 13.06\% \\ & M@20 & 0.2894 & 0.3092 & 0.2550 & 0.2829 & 0.3157 & 0.3029 & 0.3030 & {\underline{0.3283}} & 0.3095 & 0.3211 & \textbf{0.3757} & 14.44\% \\ \hline \multirow{6}{*}{Diginetica} & R@5 & 0.2064 & 0.2055 & 0.1913 & 0.2191 & 0.2335 & 0.2357 & 0.2235 & 0.2209 & 0.2302 & {\underline{0.2378}} & \textbf{0.2563} & 7.78\% \\ & M@5 & 0.1163 & 0.1153 & 0.1069 & 0.1266 & 0.1308 & 0.1343 & 0.1283 & 0.1234 & 0.1342 & {\underline{0.1350}} & \textbf{0.1454} & 7.70\% \\ & R@10 & 0.3037 & 0.2988 & 0.2819 & 0.3152 & 0.3137 & 0.3370 & 0.3266 & 0.3305 & 0.3324 & {\underline{0.3388}} & \textbf{0.3722} & 9.86\% \\ & M@10 & 0.1292 & 0.1275 & 0.1188 & 0.1393 & 0.1415 & 0.1497 & 0.1434 & 0.1379 & 0.1487 & {\underline{0.1501}} & \textbf{0.1609} & 7.20\% \\ & R@20 & 0.4167 & 0.4129 & 0.3908 & 0.4304 & 0.4016 & 0.4580 & 0.4423 & 0.4608 & 0.4571 & {\underline{0.4614}} & \textbf{0.5034} & 9.10\% \\ & M@20 & 0.1370 & 0.1354 & 0.1264 & 0.1472 & 0.1476 & 0.1580 & 0.1487 & 0.1474 & 0.1569 & {\underline{0.1588}} & \textbf{0.1699} & 6.99\% \\ \hline \multirow{6}{*}{LastFM} & R@5 & 0.5459 & 0.5499 & 0.5193 & 0.5502 & {\underline{0.5542}} & 0.5337 & 0.5389 & 0.5403 & 0.5251 & 0.5531 & \textbf{0.5822} & 5.05\% \\ & M@5 & 0.4966 & 0.5005 & 0.4912 & 0.5042 & {\underline{0.5128}} & 0.4954 & 0.4919 & 0.5032 & 0.4936 & 0.5072 & \textbf{0.5373} & 4.78\% \\ & R@10 & 0.5777 & 0.5791 & 0.5597 & 0.5796 & 0.5810 & 0.5771 & 0.5715 & 0.5689 & 0.5511 & {\underline{0.5819}} & \textbf{0.6076} & 4.42\% \\ & M@10 & 0.5045 & 0.5066 & 0.5005 & 0.5108 & {\underline{0.5132}} & 0.5028 & 0.4960 & 0.5050 & 0.4970 & 0.5119 & \textbf{0.5406} & 5.34\% \\ & R@20 & 0.6049 & 0.6108 & 0.5900 & 0.6120 & 0.6123 & 0.6038 & 0.5958 & 0.6025 & 0.5828 & {\underline{0.6149}} & \textbf{0.6370} & 3.59\% \\ & M@20 & 0.5074 & 0.5136 & 0.5026 & 0.5147 & 0.5137 & 0.5070 & 0.5004 & 0.5093 & 0.4992 & {\underline{0.5142}} & \textbf{0.5444} & 5.77\% \\ \hline \end{tabular} \label{table:main2} \vspace{-0.2cm} \end{table*} \subsubsection{Implementation Details} Each of the baselines is trained to predict every item in each session in the training dataset depending on the items before it \cite{narm, stamp, srgnn, fgnn, gcegnn}. Likewise, each full session instance $s=\{s_1, s_2, ..., s_{n}\}$ in the validation and test dataset is divided into its sub-sessions (i.e., $\{s_1\}$, $\{s_1, s_2\}$, $...$, $\{s_1, s_2, ..., s_{n}\}$), each with its next item \cite{narm, stamp, srgnn, fgnn, gcegnn}. We optimized all the baselines using Adam optimizer \cite{adam}, and tuned each hyperparameter with R@20 performance on the validation data: learning rate $\eta \in \{0.0001$, $0.0002$, $0.0005$, $0.001$, $0.002$, $0.005$, $0.01\}$, batch size $b \in \{32, 64, 128, 256, 512\}$, dropout rate \cite{dropout} $r$ $\in$ $\{0.0$, $0.1$, $0.2$, $0.3$, $0.4$, $0.5\}$, coefficient for L2 regularization $\lambda$ $\in$ $\{0.0$, $0.0001$, $0.001$, $0.01$, $0.1\}$, embedding size $d$ $\in$ $\{16$, $32$, $64$, $128\}$. Maximum length of each session is 50. We tuned the other hyperparameters of the baselines within the ranges of values provided in their papers. For ProxySR\xspace, we bound all the embeddings within a unit sphere (e.g., $\lVert \mathbf{P}_j \rVert_2^2 \le 1$) as done in \cite{cml, transcf}. We tuned the number of proxies $K$ $\in$ $\{3$, $10$, $30$, $100$, $300$, $1000$, $3000\}$, regularization coefficient (i.e., $\lambda_{\text{dist}}$, $\lambda_{\text{orthog}}$) $\in$ $\{0.0$, $0.01$, $0.02$, $0.05$, $0.1$, $0.2$, $0.5\}$, margin $m$ $\in$ $\{0.1$, $0.2$, $0.5$, $1.0$, $2.0\}$. We used the exponential annealing for $\tau$: $\tau = \max(T_0 ({\frac{T_E} {T_0}})^{\frac{e} {E}}, T_E)$ where $e$ is the current training epoch, $E=10$ is the number of annealing epoch, $T_0=3$ is the initial temperature, and $T_E=0.01$ is the final temperature. \vspace{-0.2cm} \subsection{Task Formulation} We conducted the experiments on two tasks: 1) next unseen item recommendation, and 2) next item recommendation with repetitive consumption. Although the previous studies \cite{narm, stamp, srgnn, fgnn, gcegnn, csrm} only focus on the second task, we claim that the task of next unseen item recommendation is more suitable for evaluating the ability of the model to capture the user's purpose within the session. That is because it is difficult to properly evaluate the learning ability of the model if the model can achieve a high performance by memorizing the items in the session. On the other hand, the next unseen item recommendation task requires a higher ability to discover the user's hidden preferences. We also claim that the next unseen item recommendation is more practical, as the repetitive consumption within a session for a short period of time is driven by the user's need for the item that the user already knows. That is, the user does not have to rely on a RS, and it is more desirable to recommend items that the user does not know. For the next unseen item recommendation in our experiments, we omitted every sub-session that contains its target item, and forced the probabilities of repetitive items to be zero when predicting the next item. Note that in our experiments, the results of all experiments and analyses except for Table \ref{table:main2} were on the task of next unseen item recommendation. \vspace{-0.2cm} \subsection{Performance Comparison} \subsubsection{Overall Performance} We measured the performance of the baselines on the test set at the epoch when the validation performance (i.e., R@20) is the best. We report the average performance from five independent runs. Table \ref{table:main1} and Table \ref{table:main2} are the overall performance of the models on the next unseen item recommendation and the next item recommendation with the repetitive consumption for each session, respectively. We can see some notable observations from the results. Firstly, our proposed ProxySR\xspace outperforms all the competitors on both tasks, for all the datasets. Moreover, the performance improvement of ProxySR\xspace on the competitors is more significant on the next unseen item recommendation task. This result verifies the superiority of ProxySR\xspace compared to the other baselines on learning the user's latent purpose within each session, as the next unseen item recommendation task requires a higher ability to discover the user's latent preferences as we claimed above. We can also observe that the methods that utilize other information in addition to the information within the input session (i.e., CSRM, GCE-GNN, and ProxySR\xspace) mostly outperform the methods that utilize only the information within the input session. This result supports our claim that a short session itself has insufficient information to fully understand the user's preferences. Moreover, the superior performance ProxySR\xspace compared to CSRM and GCE-GNN proves that the information from the neighbor sessions based on the item co-occurrence is insufficient to capture the general interest of sessions. Furthermore, we can see that ProxySR\xspace is more effective in the dataset with shorter average session length. In both tasks, the performance improvement of ProxySR\xspace is the largest on RetailRocket dataset whose the average session length is the shortest, and the smallest on LastFM dataset whose the average session length is the longest. A long session may include more information than a short session, and the session itself may have information about the user's general interest rather than a short session. Therefore, ProxySR\xspace which imitates the user's general interest can be more effective on the dataset with short sessions. \begin{figure*}[t] \centering \begin{subfigure}[b]{0.26\textwidth} \centering \includegraphics[width=\textwidth, trim={0.2cm 0.3cm 2cm 1.3cm}, clip] {figures/k_retailrocket.pdf} \caption{RetailRocket} \end{subfigure} \begin{subfigure}[b]{0.26\textwidth} \centering \includegraphics[width=\textwidth, trim={0.2cm 0.3cm 2cm 1.3cm}, clip] {figures/k_diginetica.pdf} \caption{Diginetica} \end{subfigure} \begin{subfigure}[b]{0.26\textwidth} \centering \includegraphics[width=\textwidth, trim={0.2cm 0.3cm 2cm 1.3cm}, clip] {figures/k_lastfm.pdf} \caption{LastFM} \end{subfigure} \vspace{-0.2cm} \caption{Result of the hyperparameter parameter study on $K$ in ProxySR\xspace.} \label{fig:hyperparameter} \vspace{-0.2cm} \end{figure*} \begin{table}[t] \fontsize{8.9}{10}\selectfont \centering \caption{Performance of ProxySR\xspace in the real-world scenario where a few sessions have their user information.} \vspace{-0.2cm} \begin{tabular}{c|cccc} \hline \begin{tabular}[c]{@{}c@{}}Ratio of \\ known users\end{tabular} & R@20 & M@20 & R@10 & M@10 \\ \hline 0\% & 0.1589 & 0.0424 & 0.1025 & 0.0385 \\ 10\% & 0.1632 & 0.0431 & 0.1061 & 0.0391 \\ 30\% & 0.1672 & 0.0443 & 0.1088 & 0.0399 \\ 50\% & \textbf{0.1696} & \textbf{0.0447} & \textbf{0.1114} & \textbf{0.0402} \\ \hline \end{tabular} \label{table:usersemisupervision} \vspace{-0.5cm} \end{table} \subsubsection{Another Real-world Case: User Semi-supervision} We conducted an extra experiment on another real-world scenario, where a few sessions have their user information. For the experiment, ProxySR\xspace uses $\boldsymbol{\pi}^\text{user}_{j}$ in Equation (\ref{equation:pi_user}) instead of $\boldsymbol{\pi}_{j}$ in Equation (\ref{equation:pi1}) and (\ref{equation:pi2}) for the sessions that have their user information. Table \ref{table:usersemisupervision} shows the performance of ProxySR\xspace according to the percentage of given user information among the users with at least 10 sessions in LastFM dataset, which has the largest number of sessions per user. The following conclusions can be drawn with the result: 1) the performance of ProxySR\xspace is increased by adding the user bias to the logits for proxy selection using known user information. Moreover, as the amount of the known user information increases, ProxySR\xspace makes a larger performance improvement. 2) Adding the user bias makes the logits skewed to few proxies for each known user. The improved performance by making each user have biased proxy verifies that the proxy proposed in ProxySR\xspace actually encodes the user's general interest. \vspace{-0.2cm} \subsection{Ablation Study} To evaluate the impact of each component of ProxySR\xspace, we provide the analysis on an ablation study with each dataset. Table \ref{table:ablation} shows the results of our ablation study. From the results, we can draw the following conclusions: 1) $\mathbf{p}^{(s)}$ and $\mathbf{s}^{(s)}$ in the table, which are the results when the input session is expressed only using $\mathbf{p}^{(s)}$ and $\mathbf{s}^{(s)}$ in ProxySR\xspace respectively, show worse performance than when both are used. This result suggests that both the proxy and the short-term interest are important when predicting the next item of sessions. 2) The distance regularizer significantly improves the performance of ProxySR\xspace. This verifies that it is effective to make the representation of session directly close to the next item embedding, and that it is valid to define the next item as the sum of proxy and short-term interest. 3) \emph{No projection} is the result when the short-term interest and the target item embedding are not projected on the proxy's hyperplane (i.e., $dist(s, i) = \lVert (\mathbf{p}^{(s)} + \mathbf{s}^{(s)}) - \mathbf{I}_{i} \rVert^2_2$). As the complex relationships in SRSs are difficult to be fully modeled in a one-to-one relationship, designing ProxySR\xspace to be able to capture the complex relationships improves the performance. 4) \emph{Encoding $\mathbf{p}^{(s)}$} is the result when ProxySR\xspace directly encodes the proxy representation with $f^S$ instead of selecting a proxy. The result shows that for the general interest, the session information should be used only to select as the general interest is difficult to be directly derived from the session information. 5) \emph{Weighted comb.} is the result when the proxy representation is obtained by a weighted combination of multiple proxies using the ordinary softmax function instead of selecting a proxy. The result proves that, as we claimed above, selecting a proxy to let it shared across several sessions is more effective than creating a unique representation for each session. 6) \emph{Dot product} is the result when the similarity score between the session and the target item is computed using the dot product instead of the distance function we define. Although the distance is more effective than the dot product, ProxySR\xspace with the dot product still shows higher performance than other baselines due to the superiority of ProxySR\xspace. \begin{table}[t] \fontsize{9}{9}\selectfont \setlength{\tabcolsep}{2pt} \centering \caption{Result of the ablation study on each component in ProxySR\xspace.} \vspace{-0.3cm} \begin{tabular}{l|cc|cc|cc} \hline & \multicolumn{2}{c|}{RetailRocket} & \multicolumn{2}{c|}{Diginetica} & \multicolumn{2}{c}{LastFM} \\ \hline \multicolumn{1}{l|}{} & R@20 & M@20 & R@20 & M@20 & R@20 & M@20 \\ \hline ProxySR\xspace & \textbf{0.4053} & \textbf{0.1622} & \textbf{0.4069} & \textbf{0.1130} & \textbf{0.1589} & \textbf{0.0424} \\ \hline $\mathbf{p}^{(s)}$ & 0.1742 & 0.0843 & 0.1795 & 0.0362 & 0.0964 & 0.0221 \\ $\mathbf{s}^{(s)}$ & 0.3076 & 0.1244 & 0.3446 & 0.0887 & 0.1417 & 0.0385 \\ No $\text{reg}_{\text{dist}}$ & 0.3294 & 0.1364 & 0.2909 & 0.0816 & 0.1369 & 0.0372 \\ No projection & 0.3202 & 0.1294 & 0.3842 & 0.1072 & 0.1492 & 0.0409 \\ Encoding $\mathbf{p}^{(s)}$ & 0.2701 & 0.1203 & 0.3209 & 0.0837 & 0.1356 & 0.0369 \\ Weighted comb. & 0.3281 & 0.1355 & 0.3443 & 0.0953 & 0.1507 & 0.0401 \\ Dot product & 0.3877 & 0.1571 & 0.4021 & 0.1096 & 0.1538 & 0.0416 \\ \hline \end{tabular} \label{table:ablation} \vspace{-0.5cm} \end{table} \vspace{-0.2cm} \subsection{Hyperparameter Study} We performed a hyperparameter study for the number of proxy embeddings $K$ to analyse the effect of it. Figure \ref{fig:hyperparameter} shows the performances (i.e., R@20) according to the number of proxy embeddings. For all the datasets, the performance is degraded when $K$ is too small or too large. If $K$ is too small, the proxies cannot be personalized for the sessions because even sessions that are less related to each other share the same proxy. Therefore, the proxy embeddings underfit the sessions and the model cannot provide the accurate predictions. On the other hand, if $K$ is too large, few sessions are allocated to each proxy, so each proxy cannot be sufficiently trained and the performance is degraded. Therefore, it is important to set an appropriate number of the proxies, which seems to be larger as the number of sessions in the dataset is large. \vspace{-0.2cm} \subsection{Analyses on Proxies from ProxySR\xspace} \subsubsection{Information Encoded in Proxies} This section provides an analysis on the proxies in ProxySR\xspace in order to find out what information the proxies encode. To verify $\mathbf{p}^{(s)}$ encodes the general interest of the user of session $s$, we adopt HRNN \cite{hrnn} which is a SRS that explicitly utilizes the user information. HRNN trains the user embedding using the sessions of a user in sequence via a user-level RNN, and uses the user embedding as the user's general interest along with the user's next session. Providing each session with the user's general interest, HRNN exploits the general interest of users in addition to the sessions to enhance the accuracy of the next item prediction. In order to show that the proxies in ProxySR\xspace actually encodes the general interest of the users, we train HRNN with the sessions grouped not by the given user information, but by the proxy they share (\emph{Proxy} in Table \ref{table:hrnn}). Table \ref{table:hrnn} shows the overall performance of HRNN with various kinds of user information on RetailRocket dataset, where ProxySR\xspace shows the largest performance improvement. \emph{No user} is the same as GRU4REC, and \emph{Random index} is the case when the sessions are randomly grouped. From the result, it can be seen that the sessions grouped by the proxy they share in ProxySR\xspace also share the general interest as meaningful as the ground-truth user information. Even, the performance for the next item prediction is slightly higher when the sessions are grouped based on proxies rather than based on the ground-truth user information. This result implies the proxies, which are learned in an unsupervised manner, encode information related to the general interest of users, while also containing more detailed information as needed. As a result, through the result of significantly improving the performance compared to the results with no or incorrect user information, we can conclude that the proxies in ProxySR\xspace effectively imitate the general interest of users. \begin{table}[t] \fontsize{9}{9}\selectfont \centering \caption{Performance of HRNN with various types of the user information in it.} \vspace{-0.3cm} \begin{tabular}{l|cccc} \hline Mode & R@20 & M@20 & R@10 & M@10 \\ \hline No user & 0.1738 & 0.1073 & 0.1633 & 0.1061 \\ Ground-truth & 0.1922 & 0.1157 & 0.1779 & 0.1150 \\ Proxy & \textbf{0.1941} & \textbf{0.1187} & \textbf{0.1783} & \textbf{0.1158} \\ Random index & 0.1275 & 0.0828 & 0.1149 & 0.0804 \\ \hline \end{tabular} \label{table:hrnn} \vspace{-0.5cm} \end{table} \vspace{-0.1cm} \subsubsection{Visualizations} To visually show the superiority of the ability of ProxySR\xspace to imitate the general interests of users, this section provides visualizations of several latent representations related to the \emph{full} sessions of RetailRocket dataset from ProxySR\xspace, GCE-GNN, and a simple mean encoder (Fig. \ref{fig:tsne}). The mean encoder is a simple encoder that expresses a session as the mean of the item embeddings within the session, and predicts the next item with the dot product score between the session representation and the item embedding. We used t-distributed Stochastic Neighbor Embedding (t-SNE) \cite{tsne} to visualize the high-dimensional representations. Figure \ref{fig:tsne} demonstrates the representations related to the sessions of 10 random users. The circles of the same color means they belong to the same user. Each circle represents the proxy representation for ProxySR\xspace, the global feature from the global graph for GCE-GNN \cite{gcegnn}, and the session representation for the mean encoder. \begin{figure}[t] \centering \begin{subfigure}[b]{0.45\columnwidth} \centering \includegraphics[width=\textwidth, trim={2.5cm 1.5cm 2cm 1.5cm}, clip] {figures/ProxySR50.pdf} \caption{ProxySR\xspace, 50\% trained.} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\columnwidth} \centering \includegraphics[width=\textwidth, trim={2.5cm 1.5cm 2cm 1.5cm}, clip] {figures/ProxySR100.pdf} \caption{ProxySR\xspace, 100\% trained.} \label{fig:tsne_full} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\columnwidth} \centering \includegraphics[width=\textwidth, trim={2.5cm 1.5cm 2cm 1.5cm}, clip] {figures/GCEGNN50.pdf} \caption{GCE-GNN, 50\% trained.} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\columnwidth} \centering \includegraphics[width=\textwidth, trim={2.5cm 1.5cm 2cm 1.5cm}, clip] {figures/GCEGNN100.pdf} \caption{GCE-GNN, 100\% trained.} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\columnwidth} \centering \includegraphics[width=\textwidth, trim={2.5cm 1.5cm 2cm 1.5cm}, clip]{figures/MEAN50.pdf} \caption{Mean, 50\% trained.} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\columnwidth} \centering \includegraphics[width=\textwidth, trim={2.5cm 1.5cm 2cm 1.5cm}, clip]{figures/MEAN100.pdf} \caption{Mean, 100\% trained.} \end{subfigure} \vspace{-0.2cm} \caption{Visualizations of several representations related to sessions in ProxySR\xspace, GCE-GNN, and the mean encoder (best viewed in color).} \label{fig:tsne} \vspace{-0.7cm} \end{figure} In GCE-GNN and the mean encoder, few representations are classified according to the users. In contrast, although there is no user information, the proxies selected by sessions of the same user tend to be clustered. Some of the proxies are grouped when ProxySR\xspace is half-trained, and others are grouped as the model is further trained. This result further supports our claim: 1) the user's general interest is difficult to be fully captured only by the information within the short session or the information from the neighbor sessions based on item co-occurrence, and 2) the user's general interest can be imitated by a proxy in ProxySR\xspace which is selected in an unsupervised manner and is shared across several sessions. From the visualization of proxies (Fig., \ref{fig:tsne_full}), we can discover a characteristic of proxies in ProxySR\xspace. Some proxies are selected by sessions of several users, which is because several users may share similar general interests. That is, such proxies are associated with universal interests that a number of users have. Also, there are multiple proxies that are selected by sessions of the same user (e.g., light blue, green, and light green), which means that a proxy can model a more fine-grained information than the general interest of a user, as needed. As a result, as mentioned above, the proxies in ProxySR\xspace trained in an unsupervised manner learn information related to the general interest of users by imitating it, but model more detailed information if necessary. \vspace{-0.2cm} \section{Conclusion} This paper proposes a novel framework for SRS, called ProxySR\xspace, which uses the input session to select a proxy which imitates the user's general interest in an unsupervised manner, and then predicts the next item of the session considering the proxy and the short-term interest within the session. Moreover, we provide a revised version of ProxySR\xspace for another real-world scenario, where a few sessions have their user information, and achieve a further improvement of recommendation performance on the scenario. Through extensive experiments, we show that ProxySR\xspace considerably outperforms the state-of-the-art competitors by modeling proxies. Also, our analyses on the proxies in ProxySR\xspace demonstrate that the information encoded in the proxies actually implies the general interests of users. \begin{acks} This work was supported by the NRF grant funded by the MSIT (No. 2020R1A2B5B03097210), and the IITP grant funded by the MSIT (No. 2018-0-00584, 2019-0-01906). \end{acks} \bibliographystyle{ACM-Reference-Format}